diff --git a/copilot/js/main.js b/copilot/js/main.js index dac0fae9..b93309f6 100644 --- a/copilot/js/main.js +++ b/copilot/js/main.js @@ -1,139 +1,95 @@ -"use strict";var _ro=Object.create;var W_e=Object.defineProperty;var Cro=Object.getOwnPropertyDescriptor;var vro=Object.getOwnPropertyNames;var bro=Object.getPrototypeOf,Sro=Object.prototype.hasOwnProperty;var i9r=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),o9r=t=>{throw TypeError(t)};var a=(t,e)=>W_e(t,"name",{value:e,configurable:!0});var me=(t,e)=>()=>(t&&(e=t(t=0)),e);var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wi=(t,e)=>{for(var r in e)W_e(t,r,{get:e[r],enumerable:!0})},s9r=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vro(e))!Sro.call(t,o)&&o!==r&&W_e(t,o,{get:()=>e[o],enumerable:!(n=Cro(e,o))||n.enumerable});return t};var ce=(t,e,r)=>(r=t!=null?_ro(bro(t)):{},s9r(e||!t||!t.__esModule?W_e(r,"default",{value:t,enumerable:!0}):r,t)),Ca=t=>s9r(W_e({},"__esModule",{value:!0}),t);var swt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&o9r("Object expected");var n,o;r&&(n=e[i9r("asyncDispose")]),n===void 0&&(n=e[i9r("dispose")],r&&(o=n)),typeof n!="function"&&o9r("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},awt=(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=me(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var p9r,h9r=me(()=>{p();p9r="ffffffff-ffff-ffff-ffff-ffffffffffff"});var m9r,g9r=me(()=>{p();m9r="00000000-0000-0000-0000-000000000000"});var A9r,y9r=me(()=>{p();A9r=/^(?:[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 kro(t){return typeof t=="string"&&A9r.test(t)}var C9,z_e=me(()=>{p();y9r();a(kro,"validate");C9=kro});function Pro(t){if(!C9(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 EB,Y_e=me(()=>{p();z_e();a(Pro,"parse");EB=Pro});function JE(t,e=0){return($g[t[e+0]]+$g[t[e+1]]+$g[t[e+2]]+$g[t[e+3]]+"-"+$g[t[e+4]]+$g[t[e+5]]+"-"+$g[t[e+6]]+$g[t[e+7]]+"-"+$g[t[e+8]]+$g[t[e+9]]+"-"+$g[t[e+10]]+$g[t[e+11]]+$g[t[e+12]]+$g[t[e+13]]+$g[t[e+14]]+$g[t[e+15]]).toLowerCase()}function Dro(t,e=0){let r=JE(t,e);if(!C9(r))throw TypeError("Stringified UUID is invalid");return r}var $g,E9r,_B=me(()=>{p();z_e();$g=[];for(let t=0;t<256;++t)$g.push((t+256).toString(16).slice(1));a(JE,"unsafeStringify");a(Dro,"stringify");E9r=Dro});function CB(){return crypto.getRandomValues(Nro)}var Nro,t8e=me(()=>{p();Nro=new Uint8Array(16);a(CB,"rng")});function Mro(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=_9r(t.random??t.rng?.()??CB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=CB();Oro(K_e,s,c),n=_9r(c,K_e.msecs,K_e.nsecs,o?void 0:K_e.clockseq,o?void 0:K_e.node,e,r)}return e??JE(n)}function Oro(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 K_e,r8e,lwt=me(()=>{p();t8e();_B();K_e={};a(Mro,"v1");a(Oro,"updateV1State");a(_9r,"v1Bytes");r8e=Mro});function J_e(t){let e=typeof t=="string"?EB(t):t,r=Bro(e);return typeof t=="string"?JE(r):r}function Bro(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 uwt=me(()=>{p();Y_e();_B();a(J_e,"v1ToV6");a(Bro,"_v1ToV6")});function Lro(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,C9r.createHash)("md5").update(t).digest()}var C9r,v9r,b9r=me(()=>{p();C9r=require("node:crypto");a(Lro,"md5");v9r=Lro});function Fro(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 JE(u)}var n8e,i8e,dwt=me(()=>{p();Y_e();_B();a(Fro,"stringToBytes");n8e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i8e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(Z_e,"v35")});function fwt(t,e,r,n){return Z_e(48,v9r,t,e,r,n)}var S9r,T9r=me(()=>{p();b9r();dwt();a(fwt,"v3");fwt.DNS=n8e;fwt.URL=i8e;S9r=fwt});function Uro(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Qro(t,e,r)}function Qro(t,e,r){t=t||{};let n=t.random??t.rng?.()??CB();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 JE(n)}var gr,I9r=me(()=>{p();t8e();_B();a(Uro,"v4");a(Qro,"_v4");gr=Uro});function qro(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,x9r.createHash)("sha1").update(t).digest()}var x9r,w9r,R9r=me(()=>{p();x9r=require("node:crypto");a(qro,"sha1");w9r=qro});function pwt(t,e,r,n){return Z_e(80,w9r,t,e,r,n)}var k9r,P9r=me(()=>{p();R9r();dwt();a(pwt,"v5");pwt.DNS=n8e;pwt.URL=i8e;k9r=pwt});function jro(t,e,r){t??={},r??=0;let n=r8e({...t,_v6:!0},new Uint8Array(16));if(n=J_e(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 JE(n)}var D9r,N9r=me(()=>{p();_B();lwt();uwt();a(jro,"v6");D9r=jro});function hwt(t){let e=typeof t=="string"?EB(t):t,r=Hro(e);return typeof t=="string"?JE(r):r}function Hro(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 M9r=me(()=>{p();Y_e();_B();a(hwt,"v6ToV1");a(Hro,"_v6ToV1")});function Gro(t,e,r){let n;if(t)n=O9r(t.random??t.rng?.()??CB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=CB();$ro(mwt,o,s),n=O9r(s,mwt.msecs,mwt.seq,e,r)}return e??JE(n)}function $ro(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 O9r(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 mwt,B9r,L9r=me(()=>{p();t8e();_B();mwt={};a(Gro,"v7");a($ro,"updateV7State");a(O9r,"v7Bytes");B9r=Gro});function Vro(t){if(!C9(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var F9r,U9r=me(()=>{p();z_e();a(Vro,"version");F9r=Vro});var yc={};wi(yc,{MAX:()=>p9r,NIL:()=>m9r,parse:()=>EB,stringify:()=>E9r,v1:()=>r8e,v1ToV6:()=>J_e,v3:()=>S9r,v4:()=>gr,v5:()=>k9r,v6:()=>D9r,v6ToV1:()=>hwt,v7:()=>B9r,validate:()=>C9,version:()=>F9r});var Ns=me(()=>{p();h9r();g9r();Y_e();_B();lwt();uwt();T9r();I9r();P9r();N9r();M9r();L9r();z_e();U9r()});var Rm=I(gwt=>{"use strict";p();gwt.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})};gwt.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 q9r=I((dXc,Q9r)=>{p();var v9=require("constants"),Wro=process.cwd,o8e=null,zro=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return o8e||(o8e=Wro.call(process)),o8e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Awt=process.chdir,process.chdir=function(t){o8e=null,Awt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Awt));var Awt;Q9r.exports=Yro;function Yro(t){v9.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(){}),zro==="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,v9.O_WRONLY|v9.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,v9.O_WRONLY|v9.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){v9.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,v9.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,v9.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(Yro,"patch")});var G9r=I((hXc,H9r)=>{p();var j9r=require("stream").Stream;H9r.exports=Kro;function Kro(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);j9r.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);j9r.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(Kro,"legacy")});var V9r=I((AXc,$9r)=>{"use strict";p();$9r.exports=Zro;var Jro=Object.getPrototypeOf||function(t){return t.__proto__};function Zro(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Jro(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Zro,"clone")});var hie=I((_Xc,_wt)=>{p();var Jd=require("fs"),Xro=q9r(),eno=G9r(),tno=V9r(),s8e=require("util"),Vg,c8e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Vg=Symbol.for("graceful-fs.queue"),c8e=Symbol.for("graceful-fs.previous")):(Vg="___graceful-fs.queue",c8e="___graceful-fs.previous");function rno(){}a(rno,"noop");function Y9r(t,e){Object.defineProperty(t,Vg,{get:a(function(){return e},"get")})}a(Y9r,"publishQueue");var qV=rno;s8e.debuglog?qV=s8e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qV=a(function(){var t=s8e.format.apply(s8e,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)},"debug"));Jd[Vg]||(W9r=global[Vg]||[],Y9r(Jd,W9r),Jd.close=(function(t){function e(r,n){return t.call(Jd,r,function(o){o||z9r(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,c8e,{value:t}),e})(Jd.close),Jd.closeSync=(function(t){function e(r){t.apply(Jd,arguments),z9r()}return a(e,"closeSync"),Object.defineProperty(e,c8e,{value:t}),e})(Jd.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){qV(Jd[Vg]),require("assert").equal(Jd[Vg].length,0)}));var W9r;global[Vg]||Y9r(global,Jd[Vg]);_wt.exports=ywt(tno(Jd));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Jd.__patched&&(_wt.exports=ywt(Jd),Jd.__patched=!0);function ywt(t){Xro(t),t.gracefulify=ywt,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,q){return e(Q,M,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?pie([B,[Q,M,O],F,q||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,q,F,U){return n(M,O,q,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.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,q,F,U){return s(M,O,q,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.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,q,F,U){return l(M,O,q,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.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,q,F,U){return d(O,Q(O,q,F,U))},"go$readdir"):a(function(O,q,F,U){return d(O,q,Q(O,q,F,U))},"go$readdir");return B(D,N,L);function Q(M,O,q,F){return function(U,W){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pie([B,[M,O,q],U,F||Date.now(),Date.now()]):(W&&W.sort&&W.sort(),typeof q=="function"&&q.call(this,U,W))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=eno(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;k(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;k(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=k;function k(D,N,L,B){return typeof L=="function"&&(B=L,L=null),Q(D,N,L,B);function Q(M,O,q,F,U){return x(M,O,q,function(W,V){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}a(Q,"go$open")}return a(k,"open"),t}a(ywt,"patch");function pie(t){qV("ENQUEUE",t[0].name,t[1]),Jd[Vg].push(t),Ewt()}a(pie,"enqueue");var a8e;function z9r(){for(var t=Date.now(),e=0;e2&&(Jd[Vg][e][3]=t,Jd[Vg][e][4]=t);Ewt()}a(z9r,"resetQueue");function Ewt(){if(clearTimeout(a8e),a8e=void 0,Jd[Vg].length!==0){var t=Jd[Vg].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)qV("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){qV("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?(qV("RETRY",e.name,r),e.apply(null,r.concat([o]))):Jd[Vg].push(t)}a8e===void 0&&(a8e=setTimeout(Ewt,0))}}a(Ewt,"retry")});var XE=I(vB=>{"use strict";p();var K9r=Rm().fromCallback,ZE=hie(),nno=["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 ZE[t]=="function");Object.assign(vB,ZE);nno.forEach(t=>{vB[t]=K9r(ZE[t])});vB.exists=function(t,e){return typeof e=="function"?ZE.exists(t,e):new Promise(r=>ZE.exists(t,r))};vB.read=function(t,e,r,n,o,s){return typeof s=="function"?ZE.read(t,e,r,n,o,s):new Promise((c,l)=>{ZE.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};vB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?ZE.write(t,e,...r):new Promise((n,o)=>{ZE.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};vB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?ZE.readv(t,e,...r):new Promise((n,o)=>{ZE.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};vB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?ZE.writev(t,e,...r):new Promise((n,o)=>{ZE.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof ZE.realpath.native=="function"?vB.realpath.native=K9r(ZE.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Z9r=I((TXc,J9r)=>{"use strict";p();var ino=require("path");J9r.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(ino.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var rUr=I((wXc,Cwt)=>{"use strict";p();var X9r=XE(),{checkPath:eUr}=Z9r(),tUr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");Cwt.exports.makeDir=async(t,e)=>(eUr(t),X9r.mkdir(t,{mode:tUr(e),recursive:!0}));Cwt.exports.makeDirSync=(t,e)=>(eUr(t),X9r.mkdirSync(t,{mode:tUr(e),recursive:!0}))});var ok=I((PXc,nUr)=>{"use strict";p();var ono=Rm().fromPromise,{makeDir:sno,makeDirSync:vwt}=rUr(),bwt=ono(sno);nUr.exports={mkdirs:bwt,mkdirsSync:vwt,mkdirp:bwt,mkdirpSync:vwt,ensureDir:bwt,ensureDirSync:vwt}});var b9=I((NXc,oUr)=>{"use strict";p();var ano=Rm().fromPromise,iUr=XE();function cno(t){return iUr.access(t).then(()=>!0).catch(()=>!1)}a(cno,"pathExists");oUr.exports={pathExists:ano(cno),pathExistsSync:iUr.existsSync}});var Swt=I((BXc,sUr)=>{"use strict";p();var mie=XE(),lno=Rm().fromPromise;async function uno(t,e,r){let n=await mie.open(t,"r+"),o=null;try{await mie.futimes(n,e,r)}finally{try{await mie.close(n)}catch(s){o=s}}if(o)throw o}a(uno,"utimesMillis");function dno(t,e,r){let n=mie.openSync(t,"r+");return mie.futimesSync(n,e,r),mie.closeSync(n)}a(dno,"utimesMillisSync");sUr.exports={utimesMillis:lno(uno),utimesMillisSync:dno}});var jV=I((UXc,uUr)=>{"use strict";p();var gie=XE(),km=require("path"),aUr=Rm().fromPromise;function fno(t,e,r){let n=r.dereference?o=>gie.stat(o,{bigint:!0}):o=>gie.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(fno,"getStats");function pno(t,e,r){let n,o=r.dereference?c=>gie.statSync(c,{bigint:!0}):c=>gie.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(pno,"getStatsSync");async function hno(t,e,r,n){let{srcStat:o,destStat:s}=await fno(t,e,n);if(s){if(X_e(o,s)){let c=km.basename(t),l=km.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()&&Twt(t,e))throw new Error(l8e(t,e,r));return{srcStat:o,destStat:s}}a(hno,"checkPaths");function mno(t,e,r,n){let{srcStat:o,destStat:s}=pno(t,e,n);if(s){if(X_e(o,s)){let c=km.basename(t),l=km.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()&&Twt(t,e))throw new Error(l8e(t,e,r));return{srcStat:o,destStat:s}}a(mno,"checkPathsSync");async function cUr(t,e,r,n){let o=km.resolve(km.dirname(t)),s=km.resolve(km.dirname(r));if(s===o||s===km.parse(s).root)return;let c;try{c=await gie.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(X_e(e,c))throw new Error(l8e(t,r,n));return cUr(t,e,s,n)}a(cUr,"checkParentPaths");function lUr(t,e,r,n){let o=km.resolve(km.dirname(t)),s=km.resolve(km.dirname(r));if(s===o||s===km.parse(s).root)return;let c;try{c=gie.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(X_e(e,c))throw new Error(l8e(t,r,n));return lUr(t,e,s,n)}a(lUr,"checkParentPathsSync");function X_e(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(X_e,"areIdentical");function Twt(t,e){let r=km.resolve(t).split(km.sep).filter(o=>o),n=km.resolve(e).split(km.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(Twt,"isSrcSubdir");function l8e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(l8e,"errMsg");uUr.exports={checkPaths:aUr(hno),checkPathsSync:mno,checkParentPaths:aUr(cUr),checkParentPathsSync:lUr,isSrcSubdir:Twt,areIdentical:X_e}});var fUr=I((jXc,dUr)=>{"use strict";p();async function gno(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(gno,"asyncIteratorConcurrentProcess");dUr.exports={asyncIteratorConcurrentProcess:gno}});var AUr=I(($Xc,gUr)=>{"use strict";p();var hy=XE(),eCe=require("path"),{mkdirs:Ano}=ok(),{pathExists:yno}=b9(),{utimesMillis:Eno}=Swt(),tCe=jV(),{asyncIteratorConcurrentProcess:_no}=fUr();async function Cno(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 Jeo=Object.create;var S_e=Object.defineProperty;var Zeo=Object.getOwnPropertyDescriptor;var Xeo=Object.getOwnPropertyNames;var eto=Object.getPrototypeOf,tto=Object.prototype.hasOwnProperty;var e6r=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),t6r=t=>{throw TypeError(t)};var a=(t,e)=>S_e(t,"name",{value:e,configurable:!0});var _e=(t,e)=>()=>(t&&(e=t(t=0)),e);var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xi=(t,e)=>{for(var r in e)S_e(t,r,{get:e[r],enumerable:!0})},r6r=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Xeo(e))!tto.call(t,o)&&o!==r&&S_e(t,o,{get:()=>e[o],enumerable:!(n=Zeo(e,o))||n.enumerable});return t};var he=(t,e,r)=>(r=t!=null?Jeo(eto(t)):{},r6r(e||!t||!t.__esModule?S_e(r,"default",{value:t,enumerable:!0}):r,t)),ya=t=>r6r(S_e({},"__esModule",{value:!0}),t);var Sxt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&t6r("Object expected");var n,o;r&&(n=e[e6r("asyncDispose")]),n===void 0&&(n=e[e6r("dispose")],r&&(o=n)),typeof n!="function"&&t6r("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},Txt=(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=_e(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var l6r,u6r=_e(()=>{p();l6r="ffffffff-ffff-ffff-ffff-ffffffffffff"});var d6r,f6r=_e(()=>{p();d6r="00000000-0000-0000-0000-000000000000"});var p6r,h6r=_e(()=>{p();p6r=/^(?:[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 ato(t){return typeof t=="string"&&p6r.test(t)}var s9,T_e=_e(()=>{p();h6r();a(ato,"validate");s9=ato});function cto(t){if(!s9(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 aB,I_e=_e(()=>{p();T_e();a(cto,"parse");aB=cto});function zE(t,e=0){return(Wg[t[e+0]]+Wg[t[e+1]]+Wg[t[e+2]]+Wg[t[e+3]]+"-"+Wg[t[e+4]]+Wg[t[e+5]]+"-"+Wg[t[e+6]]+Wg[t[e+7]]+"-"+Wg[t[e+8]]+Wg[t[e+9]]+"-"+Wg[t[e+10]]+Wg[t[e+11]]+Wg[t[e+12]]+Wg[t[e+13]]+Wg[t[e+14]]+Wg[t[e+15]]).toLowerCase()}function lto(t,e=0){let r=zE(t,e);if(!s9(r))throw TypeError("Stringified UUID is invalid");return r}var Wg,m6r,cB=_e(()=>{p();T_e();Wg=[];for(let t=0;t<256;++t)Wg.push((t+256).toString(16).slice(1));a(zE,"unsafeStringify");a(lto,"stringify");m6r=lto});function lB(){return crypto.getRandomValues(uto)}var uto,xFe=_e(()=>{p();uto=new Uint8Array(16);a(lB,"rng")});function dto(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=g6r(t.random??t.rng?.()??lB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=lB();fto(x_e,s,c),n=g6r(c,x_e.msecs,x_e.nsecs,o?void 0:x_e.clockseq,o?void 0:x_e.node,e,r)}return e??zE(n)}function fto(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 x_e,wFe,xxt=_e(()=>{p();xFe();cB();x_e={};a(dto,"v1");a(fto,"updateV1State");a(g6r,"v1Bytes");wFe=dto});function w_e(t){let e=typeof t=="string"?aB(t):t,r=pto(e);return typeof t=="string"?zE(r):r}function pto(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 wxt=_e(()=>{p();I_e();cB();a(w_e,"v1ToV6");a(pto,"_v1ToV6")});function hto(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,A6r.createHash)("md5").update(t).digest()}var A6r,y6r,E6r=_e(()=>{p();A6r=require("node:crypto");a(hto,"md5");y6r=hto});function mto(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 zE(u)}var RFe,PFe,Rxt=_e(()=>{p();I_e();cB();a(mto,"stringToBytes");RFe="6ba7b810-9dad-11d1-80b4-00c04fd430c8",PFe="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(R_e,"v35")});function Pxt(t,e,r,n){return R_e(48,y6r,t,e,r,n)}var _6r,v6r=_e(()=>{p();E6r();Rxt();a(Pxt,"v3");Pxt.DNS=RFe;Pxt.URL=PFe;_6r=Pxt});function gto(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Ato(t,e,r)}function Ato(t,e,r){t=t||{};let n=t.random??t.rng?.()??lB();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 zE(n)}var ir,C6r=_e(()=>{p();xFe();cB();a(gto,"v4");a(Ato,"_v4");ir=gto});function yto(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,b6r.createHash)("sha1").update(t).digest()}var b6r,S6r,T6r=_e(()=>{p();b6r=require("node:crypto");a(yto,"sha1");S6r=yto});function kxt(t,e,r,n){return R_e(80,S6r,t,e,r,n)}var I6r,x6r=_e(()=>{p();T6r();Rxt();a(kxt,"v5");kxt.DNS=RFe;kxt.URL=PFe;I6r=kxt});function Eto(t,e,r){t??={},r??=0;let n=wFe({...t,_v6:!0},new Uint8Array(16));if(n=w_e(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 zE(n)}var w6r,R6r=_e(()=>{p();cB();xxt();wxt();a(Eto,"v6");w6r=Eto});function Dxt(t){let e=typeof t=="string"?aB(t):t,r=_to(e);return typeof t=="string"?zE(r):r}function _to(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 P6r=_e(()=>{p();I_e();cB();a(Dxt,"v6ToV1");a(_to,"_v6ToV1")});function vto(t,e,r){let n;if(t)n=k6r(t.random??t.rng?.()??lB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=lB();Cto(Nxt,o,s),n=k6r(s,Nxt.msecs,Nxt.seq,e,r)}return e??zE(n)}function Cto(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 k6r(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 Nxt,D6r,N6r=_e(()=>{p();xFe();cB();Nxt={};a(vto,"v7");a(Cto,"updateV7State");a(k6r,"v7Bytes");D6r=vto});function bto(t){if(!s9(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var M6r,O6r=_e(()=>{p();T_e();a(bto,"version");M6r=bto});var gc={};xi(gc,{MAX:()=>l6r,NIL:()=>d6r,parse:()=>aB,stringify:()=>m6r,v1:()=>wFe,v1ToV6:()=>w_e,v3:()=>_6r,v4:()=>ir,v5:()=>I6r,v6:()=>w6r,v6ToV1:()=>Dxt,v7:()=>D6r,validate:()=>s9,version:()=>M6r});var As=_e(()=>{p();u6r();f6r();I_e();cB();xxt();wxt();v6r();C6r();x6r();R6r();P6r();N6r();T_e();O6r()});var Rm=I(Mxt=>{"use strict";p();Mxt.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})};Mxt.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 L6r=I((cYc,B6r)=>{p();var a9=require("constants"),Sto=process.cwd,kFe=null,Tto=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return kFe||(kFe=Sto.call(process)),kFe};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Oxt=process.chdir,process.chdir=function(t){kFe=null,Oxt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Oxt));var Oxt;B6r.exports=Ito;function Ito(t){a9.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(){}),Tto==="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,a9.O_WRONLY|a9.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,a9.O_WRONLY|a9.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){a9.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,a9.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,a9.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(Ito,"patch")});var Q6r=I((dYc,U6r)=>{p();var F6r=require("stream").Stream;U6r.exports=xto;function xto(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);F6r.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);F6r.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(xto,"legacy")});var j6r=I((hYc,q6r)=>{"use strict";p();q6r.exports=Rto;var wto=Object.getPrototypeOf||function(t){return t.__proto__};function Rto(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:wto(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Rto,"clone")});var Jne=I((AYc,Fxt)=>{p();var Yd=require("fs"),Pto=L6r(),kto=Q6r(),Dto=j6r(),DFe=require("util"),zg,MFe;typeof Symbol=="function"&&typeof Symbol.for=="function"?(zg=Symbol.for("graceful-fs.queue"),MFe=Symbol.for("graceful-fs.previous")):(zg="___graceful-fs.queue",MFe="___graceful-fs.previous");function Nto(){}a(Nto,"noop");function $6r(t,e){Object.defineProperty(t,zg,{get:a(function(){return e},"get")})}a($6r,"publishQueue");var bV=Nto;DFe.debuglog?bV=DFe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(bV=a(function(){var t=DFe.format.apply(DFe,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)},"debug"));Yd[zg]||(H6r=global[zg]||[],$6r(Yd,H6r),Yd.close=(function(t){function e(r,n){return t.call(Yd,r,function(o){o||G6r(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,MFe,{value:t}),e})(Yd.close),Yd.closeSync=(function(t){function e(r){t.apply(Yd,arguments),G6r()}return a(e,"closeSync"),Object.defineProperty(e,MFe,{value:t}),e})(Yd.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){bV(Yd[zg]),require("assert").equal(Yd[zg].length,0)}));var H6r;global[zg]||$6r(global,Yd[zg]);Fxt.exports=Bxt(Dto(Yd));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Yd.__patched&&(Fxt.exports=Bxt(Yd),Yd.__patched=!0);function Bxt(t){Pto(t),t.gracefulify=Bxt,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,q){return e(j,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?Kne([B,[j,M,O],Q,q||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,q,Q,U){return n(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?Kne([j,[M,O,q,Q],z,U||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,q,Q,U){return s(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?Kne([j,[M,O,q,Q],z,U||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,q,Q,U){return l(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?Kne([j,[M,O,q,Q],z,U||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,q,Q,U){return d(O,j(O,q,Q,U))},"go$readdir"):a(function(O,q,Q,U){return d(O,q,j(O,q,Q,U))},"go$readdir");return B(D,N,L);function j(M,O,q,Q){return function(U,z){U&&(U.code==="EMFILE"||U.code==="ENFILE")?Kne([B,[M,O,q],U,Q||Date.now(),Date.now()]):(z&&z.sort&&z.sort(),typeof q=="function"&&q.call(this,U,z))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=kto(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,q,Q,U){return x(M,O,q,function(z,W){z&&(z.code==="EMFILE"||z.code==="ENFILE")?Kne([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$open")}return a(P,"open"),t}a(Bxt,"patch");function Kne(t){bV("ENQUEUE",t[0].name,t[1]),Yd[zg].push(t),Lxt()}a(Kne,"enqueue");var NFe;function G6r(){for(var t=Date.now(),e=0;e2&&(Yd[zg][e][3]=t,Yd[zg][e][4]=t);Lxt()}a(G6r,"resetQueue");function Lxt(){if(clearTimeout(NFe),NFe=void 0,Yd[zg].length!==0){var t=Yd[zg].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)bV("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){bV("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?(bV("RETRY",e.name,r),e.apply(null,r.concat([o]))):Yd[zg].push(t)}NFe===void 0&&(NFe=setTimeout(Lxt,0))}}a(Lxt,"retry")});var KE=I(uB=>{"use strict";p();var V6r=Rm().fromCallback,YE=Jne(),Mto=["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 YE[t]=="function");Object.assign(uB,YE);Mto.forEach(t=>{uB[t]=V6r(YE[t])});uB.exists=function(t,e){return typeof e=="function"?YE.exists(t,e):new Promise(r=>YE.exists(t,r))};uB.read=function(t,e,r,n,o,s){return typeof s=="function"?YE.read(t,e,r,n,o,s):new Promise((c,l)=>{YE.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};uB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?YE.write(t,e,...r):new Promise((n,o)=>{YE.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};uB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?YE.readv(t,e,...r):new Promise((n,o)=>{YE.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};uB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?YE.writev(t,e,...r):new Promise((n,o)=>{YE.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof YE.realpath.native=="function"?uB.realpath.native=V6r(YE.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var z6r=I((CYc,W6r)=>{"use strict";p();var Oto=require("path");W6r.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Oto.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var Z6r=I((TYc,Uxt)=>{"use strict";p();var Y6r=KE(),{checkPath:K6r}=z6r(),J6r=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");Uxt.exports.makeDir=async(t,e)=>(K6r(t),Y6r.mkdir(t,{mode:J6r(e),recursive:!0}));Uxt.exports.makeDirSync=(t,e)=>(K6r(t),Y6r.mkdirSync(t,{mode:J6r(e),recursive:!0}))});var ZR=I((wYc,X6r)=>{"use strict";p();var Bto=Rm().fromPromise,{makeDir:Lto,makeDirSync:Qxt}=Z6r(),qxt=Bto(Lto);X6r.exports={mkdirs:qxt,mkdirsSync:Qxt,mkdirp:qxt,mkdirpSync:Qxt,ensureDir:qxt,ensureDirSync:Qxt}});var c9=I((PYc,t9r)=>{"use strict";p();var Fto=Rm().fromPromise,e9r=KE();function Uto(t){return e9r.access(t).then(()=>!0).catch(()=>!1)}a(Uto,"pathExists");t9r.exports={pathExists:Fto(Uto),pathExistsSync:e9r.existsSync}});var jxt=I((NYc,r9r)=>{"use strict";p();var Zne=KE(),Qto=Rm().fromPromise;async function qto(t,e,r){let n=await Zne.open(t,"r+"),o=null;try{await Zne.futimes(n,e,r)}finally{try{await Zne.close(n)}catch(s){o=s}}if(o)throw o}a(qto,"utimesMillis");function jto(t,e,r){let n=Zne.openSync(t,"r+");return Zne.futimesSync(n,e,r),Zne.closeSync(n)}a(jto,"utimesMillisSync");r9r.exports={utimesMillis:Qto(qto),utimesMillisSync:jto}});var SV=I((BYc,s9r)=>{"use strict";p();var Xne=KE(),Pm=require("path"),n9r=Rm().fromPromise;function Hto(t,e,r){let n=r.dereference?o=>Xne.stat(o,{bigint:!0}):o=>Xne.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(Hto,"getStats");function Gto(t,e,r){let n,o=r.dereference?c=>Xne.statSync(c,{bigint:!0}):c=>Xne.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(Gto,"getStatsSync");async function $to(t,e,r,n){let{srcStat:o,destStat:s}=await Hto(t,e,n);if(s){if(P_e(o,s)){let c=Pm.basename(t),l=Pm.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()&&Hxt(t,e))throw new Error(OFe(t,e,r));return{srcStat:o,destStat:s}}a($to,"checkPaths");function Vto(t,e,r,n){let{srcStat:o,destStat:s}=Gto(t,e,n);if(s){if(P_e(o,s)){let c=Pm.basename(t),l=Pm.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()&&Hxt(t,e))throw new Error(OFe(t,e,r));return{srcStat:o,destStat:s}}a(Vto,"checkPathsSync");async function i9r(t,e,r,n){let o=Pm.resolve(Pm.dirname(t)),s=Pm.resolve(Pm.dirname(r));if(s===o||s===Pm.parse(s).root)return;let c;try{c=await Xne.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(P_e(e,c))throw new Error(OFe(t,r,n));return i9r(t,e,s,n)}a(i9r,"checkParentPaths");function o9r(t,e,r,n){let o=Pm.resolve(Pm.dirname(t)),s=Pm.resolve(Pm.dirname(r));if(s===o||s===Pm.parse(s).root)return;let c;try{c=Xne.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(P_e(e,c))throw new Error(OFe(t,r,n));return o9r(t,e,s,n)}a(o9r,"checkParentPathsSync");function P_e(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(P_e,"areIdentical");function Hxt(t,e){let r=Pm.resolve(t).split(Pm.sep).filter(o=>o),n=Pm.resolve(e).split(Pm.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(Hxt,"isSrcSubdir");function OFe(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(OFe,"errMsg");s9r.exports={checkPaths:n9r($to),checkPathsSync:Vto,checkParentPaths:n9r(i9r),checkParentPathsSync:o9r,isSrcSubdir:Hxt,areIdentical:P_e}});var c9r=I((UYc,a9r)=>{"use strict";p();async function Wto(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(Wto,"asyncIteratorConcurrentProcess");a9r.exports={asyncIteratorConcurrentProcess:Wto}});var p9r=I((jYc,f9r)=>{"use strict";p();var Ey=KE(),k_e=require("path"),{mkdirs:zto}=ZR(),{pathExists:Yto}=c9(),{utimesMillis:Kto}=jxt(),D_e=SV(),{asyncIteratorConcurrentProcess:Jto}=c9r();async function Zto(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 tCe.checkPaths(t,e,"copy",r);if(await tCe.checkParentPaths(t,n,e,"copy"),!await hUr(t,e,r))return;let c=eCe.dirname(e);await yno(c)||await Ano(c),await mUr(o,t,e,r)}a(Cno,"copy");async function hUr(t,e,r){return r.filter?r.filter(t,e):!0}a(hUr,"runFilter");async function mUr(t,e,r,n){let s=await(n.dereference?hy.stat:hy.lstat)(e);if(s.isDirectory())return Tno(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return vno(s,t,e,r,n);if(s.isSymbolicLink())return Ino(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(mUr,"getStatsAndPerformCopy");async function vno(t,e,r,n,o){if(!e)return pUr(t,r,n,o);if(o.overwrite)return await hy.unlink(n),pUr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(vno,"onFile");async function pUr(t,e,r,n){if(await hy.copyFile(e,r),n.preserveTimestamps){bno(t.mode)&&await Sno(r,t.mode);let o=await hy.stat(e);await Eno(r,o.atime,o.mtime)}return hy.chmod(r,t.mode)}a(pUr,"copyFile");function bno(t){return(t&128)===0}a(bno,"fileIsNotWritable");function Sno(t,e){return hy.chmod(t,e|128)}a(Sno,"makeFileWritable");async function Tno(t,e,r,n,o){e||await hy.mkdir(n),await _no(await hy.opendir(r),async s=>{let c=eCe.join(r,s.name),l=eCe.join(n,s.name);if(await hUr(c,l,o)){let{destStat:d}=await tCe.checkPaths(c,l,"copy",o);await mUr(d,c,l,o)}}),e||await hy.chmod(n,t.mode)}a(Tno,"onDir");async function Ino(t,e,r,n){let o=await hy.readlink(e);if(n.dereference&&(o=eCe.resolve(process.cwd(),o)),!t)return hy.symlink(o,r);let s=null;try{s=await hy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return hy.symlink(o,r);throw c}if(n.dereference&&(s=eCe.resolve(process.cwd(),s)),o!==s){if(tCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(tCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await hy.unlink(r),hy.symlink(o,r)}a(Ino,"onLink");gUr.exports=Cno});var vUr=I((zXc,CUr)=>{"use strict";p();var e_=hie(),rCe=require("path"),xno=ok().mkdirsSync,wno=Swt().utimesMillisSync,nCe=jV();function Rno(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 D_e.checkPaths(t,e,"copy",r);if(await D_e.checkParentPaths(t,n,e,"copy"),!await u9r(t,e,r))return;let c=k_e.dirname(e);await Yto(c)||await zto(c),await d9r(o,t,e,r)}a(Zto,"copy");async function u9r(t,e,r){return r.filter?r.filter(t,e):!0}a(u9r,"runFilter");async function d9r(t,e,r,n){let s=await(n.dereference?Ey.stat:Ey.lstat)(e);if(s.isDirectory())return rro(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Xto(s,t,e,r,n);if(s.isSymbolicLink())return nro(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(d9r,"getStatsAndPerformCopy");async function Xto(t,e,r,n,o){if(!e)return l9r(t,r,n,o);if(o.overwrite)return await Ey.unlink(n),l9r(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(Xto,"onFile");async function l9r(t,e,r,n){if(await Ey.copyFile(e,r),n.preserveTimestamps){ero(t.mode)&&await tro(r,t.mode);let o=await Ey.stat(e);await Kto(r,o.atime,o.mtime)}return Ey.chmod(r,t.mode)}a(l9r,"copyFile");function ero(t){return(t&128)===0}a(ero,"fileIsNotWritable");function tro(t,e){return Ey.chmod(t,e|128)}a(tro,"makeFileWritable");async function rro(t,e,r,n,o){e||await Ey.mkdir(n),await Jto(await Ey.opendir(r),async s=>{let c=k_e.join(r,s.name),l=k_e.join(n,s.name);if(await u9r(c,l,o)){let{destStat:d}=await D_e.checkPaths(c,l,"copy",o);await d9r(d,c,l,o)}}),e||await Ey.chmod(n,t.mode)}a(rro,"onDir");async function nro(t,e,r,n){let o=await Ey.readlink(e);if(n.dereference&&(o=k_e.resolve(process.cwd(),o)),!t)return Ey.symlink(o,r);let s=null;try{s=await Ey.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Ey.symlink(o,r);throw c}if(n.dereference&&(s=k_e.resolve(process.cwd(),s)),o!==s){if(D_e.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(D_e.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Ey.unlink(r),Ey.symlink(o,r)}a(nro,"onLink");f9r.exports=Zto});var y9r=I(($Yc,A9r)=>{"use strict";p();var JE=Jne(),N_e=require("path"),iro=ZR().mkdirsSync,oro=jxt().utimesMillisSync,M_e=SV();function sro(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}=nCe.checkPathsSync(t,e,"copy",r);if(nCe.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=rCe.dirname(e);return e_.existsSync(s)||xno(s),yUr(o,t,e,r)}a(Rno,"copySync");function yUr(t,e,r,n){let s=(n.dereference?e_.statSync:e_.lstatSync)(e);if(s.isDirectory())return Bno(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return kno(s,t,e,r,n);if(s.isSymbolicLink())return Uno(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(yUr,"getStats");function kno(t,e,r,n,o){return e?Pno(t,r,n,o):EUr(t,r,n,o)}a(kno,"onFile");function Pno(t,e,r,n){if(n.overwrite)return e_.unlinkSync(r),EUr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}a(Pno,"mayCopyFile");function EUr(t,e,r,n){return e_.copyFileSync(e,r),n.preserveTimestamps&&Dno(t.mode,e,r),Iwt(r,t.mode)}a(EUr,"copyFile");function Dno(t,e,r){return Nno(t)&&Mno(r,t),Ono(e,r)}a(Dno,"handleTimestamps");function Nno(t){return(t&128)===0}a(Nno,"fileIsNotWritable");function Mno(t,e){return Iwt(t,e|128)}a(Mno,"makeFileWritable");function Iwt(t,e){return e_.chmodSync(t,e)}a(Iwt,"setDestMode");function Ono(t,e){let r=e_.statSync(t);return wno(e,r.atime,r.mtime)}a(Ono,"setDestTimestamps");function Bno(t,e,r,n,o){return e?_Ur(r,n,o):Lno(t.mode,r,n,o)}a(Bno,"onDir");function Lno(t,e,r,n){return e_.mkdirSync(r),_Ur(e,r,n),Iwt(r,t)}a(Lno,"mkDirAndCopy");function _Ur(t,e,r){let n=e_.opendirSync(t);try{let o;for(;(o=n.readSync())!==null;)Fno(o.name,t,e,r)}finally{n.closeSync()}}a(_Ur,"copyDir");function Fno(t,e,r,n){let o=rCe.join(e,t),s=rCe.join(r,t);if(n.filter&&!n.filter(o,s))return;let{destStat:c}=nCe.checkPathsSync(o,s,"copy",n);return yUr(c,o,s,n)}a(Fno,"copyDirItem");function Uno(t,e,r,n){let o=e_.readlinkSync(e);if(n.dereference&&(o=rCe.resolve(process.cwd(),o)),t){let s;try{s=e_.readlinkSync(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return e_.symlinkSync(o,r);throw c}if(n.dereference&&(s=rCe.resolve(process.cwd(),s)),o!==s){if(nCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(nCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return Qno(o,r)}else return e_.symlinkSync(o,r)}a(Uno,"onLink");function Qno(t,e){return e_.unlinkSync(e),e_.symlinkSync(t,e)}a(Qno,"copyLink");CUr.exports=Rno});var u8e=I((JXc,bUr)=>{"use strict";p();var qno=Rm().fromPromise;bUr.exports={copy:qno(AUr()),copySync:vUr()}});var iCe=I((XXc,TUr)=>{"use strict";p();var SUr=hie(),jno=Rm().fromCallback;function Hno(t,e){SUr.rm(t,{recursive:!0,force:!0},e)}a(Hno,"remove");function Gno(t){SUr.rmSync(t,{recursive:!0,force:!0})}a(Gno,"removeSync");TUr.exports={remove:jno(Hno),removeSync:Gno}});var NUr=I((rel,DUr)=>{"use strict";p();var $no=Rm().fromPromise,wUr=XE(),RUr=require("path"),kUr=ok(),PUr=iCe(),IUr=$no(a(async function(e){let r;try{r=await wUr.readdir(e)}catch{return kUr.mkdirs(e)}return Promise.all(r.map(n=>PUr.remove(RUr.join(e,n))))},"emptyDir"));function xUr(t){let e;try{e=wUr.readdirSync(t)}catch{return kUr.mkdirsSync(t)}e.forEach(r=>{r=RUr.join(t,r),PUr.removeSync(r)})}a(xUr,"emptyDirSync");DUr.exports={emptyDirSync:xUr,emptydirSync:xUr,emptyDir:IUr,emptydir:IUr}});var LUr=I((oel,BUr)=>{"use strict";p();var Vno=Rm().fromPromise,MUr=require("path"),bB=XE(),OUr=ok();async function Wno(t){let e;try{e=await bB.stat(t)}catch{}if(e&&e.isFile())return;let r=MUr.dirname(t),n=null;try{n=await bB.stat(r)}catch(o){if(o.code==="ENOENT"){await OUr.mkdirs(r),await bB.writeFile(t,"");return}else throw o}n.isDirectory()?await bB.writeFile(t,""):await bB.readdir(r)}a(Wno,"createFile");function zno(t){let e;try{e=bB.statSync(t)}catch{}if(e&&e.isFile())return;let r=MUr.dirname(t);try{bB.statSync(r).isDirectory()||bB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")OUr.mkdirsSync(r);else throw n}bB.writeFileSync(t,"")}a(zno,"createFileSync");BUr.exports={createFile:Vno(Wno),createFileSync:zno}});var jUr=I((cel,qUr)=>{"use strict";p();var Yno=Rm().fromPromise,FUr=require("path"),S9=XE(),UUr=ok(),{pathExists:Kno}=b9(),{areIdentical:QUr}=jV();async function Jno(t,e){let r;try{r=await S9.lstat(e)}catch{}let n;try{n=await S9.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&QUr(n,r))return;let o=FUr.dirname(e);await Kno(o)||await UUr.mkdirs(o),await S9.link(t,e)}a(Jno,"createLink");function Zno(t,e){let r;try{r=S9.lstatSync(e)}catch{}try{let s=S9.lstatSync(t);if(r&&QUr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=FUr.dirname(e);return S9.existsSync(n)||UUr.mkdirsSync(n),S9.linkSync(t,e)}a(Zno,"createLinkSync");qUr.exports={createLink:Yno(Jno),createLinkSync:Zno}});var GUr=I((del,HUr)=>{"use strict";p();var T9=require("path"),oCe=XE(),{pathExists:Xno}=b9(),eio=Rm().fromPromise;async function tio(t,e){if(T9.isAbsolute(t)){try{await oCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=T9.dirname(e),n=T9.join(r,t);if(await Xno(n))return{toCwd:n,toDst:t};try{await oCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:T9.relative(r,t)}}a(tio,"symlinkPaths");function rio(t,e){if(T9.isAbsolute(t)){if(!oCe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=T9.dirname(e),n=T9.join(r,t);if(oCe.existsSync(n))return{toCwd:n,toDst:t};if(!oCe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:T9.relative(r,t)}}a(rio,"symlinkPathsSync");HUr.exports={symlinkPaths:eio(tio),symlinkPathsSync:rio}});var WUr=I((hel,VUr)=>{"use strict";p();var $Ur=XE(),nio=Rm().fromPromise;async function iio(t,e){if(e)return e;let r;try{r=await $Ur.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(iio,"symlinkType");function oio(t,e){if(e)return e;let r;try{r=$Ur.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(oio,"symlinkTypeSync");VUr.exports={symlinkType:nio(iio),symlinkTypeSync:oio}});var KUr=I((Ael,YUr)=>{"use strict";p();var sio=Rm().fromPromise,I9=require("path"),HC=XE(),{mkdirs:aio,mkdirsSync:cio}=ok(),{symlinkPaths:lio,symlinkPathsSync:uio}=GUr(),{symlinkType:dio,symlinkTypeSync:fio}=WUr(),{pathExists:pio}=b9(),{areIdentical:zUr}=jV();async function hio(t,e,r){let n;try{n=await HC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(I9.isAbsolute(t))l=await HC.stat(t);else{let d=I9.dirname(e),f=I9.join(d,t);try{l=await HC.stat(f)}catch{l=await HC.stat(t)}}let u=await HC.stat(e);if(zUr(l,u))return}let o=await lio(t,e);t=o.toDst;let s=await dio(o.toCwd,r),c=I9.dirname(e);return await pio(c)||await aio(c),HC.symlink(t,e,s)}a(hio,"createSymlink");function mio(t,e,r){let n;try{n=HC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(I9.isAbsolute(t))l=HC.statSync(t);else{let d=I9.dirname(e),f=I9.join(d,t);try{l=HC.statSync(f)}catch{l=HC.statSync(t)}}let u=HC.statSync(e);if(zUr(l,u))return}let o=uio(t,e);t=o.toDst,r=fio(o.toCwd,r);let s=I9.dirname(e);return HC.existsSync(s)||cio(s),HC.symlinkSync(t,e,r)}a(mio,"createSymlinkSync");YUr.exports={createSymlink:sio(hio),createSymlinkSync:mio}});var i7r=I((_el,n7r)=>{"use strict";p();var{createFile:JUr,createFileSync:ZUr}=LUr(),{createLink:XUr,createLinkSync:e7r}=jUr(),{createSymlink:t7r,createSymlinkSync:r7r}=KUr();n7r.exports={createFile:JUr,createFileSync:ZUr,ensureFile:JUr,ensureFileSync:ZUr,createLink:XUr,createLinkSync:e7r,ensureLink:XUr,ensureLinkSync:e7r,createSymlink:t7r,createSymlinkSync:r7r,ensureSymlink:t7r,ensureSymlinkSync:r7r}});var d8e=I((vel,o7r)=>{p();function gio(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(gio,"stringify");function Aio(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(Aio,"stripBom");o7r.exports={stringify:gio,stripBom:Aio}});var l7r=I((Tel,c7r)=>{p();var Aie;try{Aie=hie()}catch{Aie=require("fs")}var f8e=Rm(),{stringify:s7r,stripBom:a7r}=d8e();async function yio(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Aie,n="throws"in e?e.throws:!0,o=await f8e.fromCallback(r.readFile)(t,e);o=a7r(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(yio,"_readFile");var Eio=f8e.fromPromise(yio);function _io(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Aie,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=a7r(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(_io,"readFileSync");async function Cio(t,e,r={}){let n=r.fs||Aie,o=s7r(e,r);await f8e.fromCallback(n.writeFile)(t,o,r)}a(Cio,"_writeFile");var vio=f8e.fromPromise(Cio);function bio(t,e,r={}){let n=r.fs||Aie,o=s7r(e,r);return n.writeFileSync(t,o,r)}a(bio,"writeFileSync");c7r.exports={readFile:Eio,readFileSync:_io,writeFile:vio,writeFileSync:bio}});var d7r=I((wel,u7r)=>{"use strict";p();var p8e=l7r();u7r.exports={readJson:p8e.readFile,readJsonSync:p8e.readFileSync,writeJson:p8e.writeFile,writeJsonSync:p8e.writeFileSync}});var h8e=I((kel,h7r)=>{"use strict";p();var Sio=Rm().fromPromise,xwt=XE(),f7r=require("path"),p7r=ok(),Tio=b9().pathExists;async function Iio(t,e,r="utf-8"){let n=f7r.dirname(t);return await Tio(n)||await p7r.mkdirs(n),xwt.writeFile(t,e,r)}a(Iio,"outputFile");function xio(t,...e){let r=f7r.dirname(t);xwt.existsSync(r)||p7r.mkdirsSync(r),xwt.writeFileSync(t,...e)}a(xio,"outputFileSync");h7r.exports={outputFile:Sio(Iio),outputFileSync:xio}});var g7r=I((Nel,m7r)=>{"use strict";p();var{stringify:wio}=d8e(),{outputFile:Rio}=h8e();async function kio(t,e,r={}){let n=wio(e,r);await Rio(t,n,r)}a(kio,"outputJson");m7r.exports=kio});var y7r=I((Bel,A7r)=>{"use strict";p();var{stringify:Pio}=d8e(),{outputFileSync:Dio}=h8e();function Nio(t,e,r){let n=Pio(e,r);Dio(t,n,r)}a(Nio,"outputJsonSync");A7r.exports=Nio});var _7r=I((Uel,E7r)=>{"use strict";p();var Mio=Rm().fromPromise,t_=d7r();t_.outputJson=Mio(g7r());t_.outputJsonSync=y7r();t_.outputJSON=t_.outputJson;t_.outputJSONSync=t_.outputJsonSync;t_.writeJSON=t_.writeJson;t_.writeJSONSync=t_.writeJsonSync;t_.readJSON=t_.readJson;t_.readJSONSync=t_.readJsonSync;E7r.exports=t_});var T7r=I((qel,S7r)=>{"use strict";p();var Oio=XE(),C7r=require("path"),{copy:Bio}=u8e(),{remove:b7r}=iCe(),{mkdirp:Lio}=ok(),{pathExists:Fio}=b9(),v7r=jV();async function Uio(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await v7r.checkPaths(t,e,"move",r);await v7r.checkParentPaths(t,o,e,"move");let c=C7r.dirname(e);return C7r.parse(c).root!==c&&await Lio(c),Qio(t,e,n,s)}a(Uio,"move");async function Qio(t,e,r,n){if(!n){if(r)await b7r(e);else if(await Fio(e))throw new Error("dest already exists.")}try{await Oio.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await qio(t,e,r)}}a(Qio,"doRename");async function qio(t,e,r){return await Bio(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),b7r(t)}a(qio,"moveAcrossDevice");S7r.exports=Uio});var k7r=I((Gel,R7r)=>{"use strict";p();var x7r=hie(),Rwt=require("path"),jio=u8e().copySync,w7r=iCe().removeSync,Hio=ok().mkdirpSync,I7r=jV();function Gio(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=I7r.checkPathsSync(t,e,"move",r);return I7r.checkParentPathsSync(t,o,e,"move"),$io(e)||Hio(Rwt.dirname(e)),Vio(t,e,n,s)}a(Gio,"moveSync");function $io(t){let e=Rwt.dirname(t);return Rwt.parse(e).root===e}a($io,"isParentRoot");function Vio(t,e,r,n){if(n)return wwt(t,e,r);if(r)return w7r(e),wwt(t,e,r);if(x7r.existsSync(e))throw new Error("dest already exists.");return wwt(t,e,r)}a(Vio,"doRename");function wwt(t,e,r){try{x7r.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Wio(t,e,r)}}a(wwt,"rename");function Wio(t,e,r){return jio(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),w7r(t)}a(Wio,"moveAcrossDevice");R7r.exports=Gio});var D7r=I((Wel,P7r)=>{"use strict";p();var zio=Rm().fromPromise;P7r.exports={move:zio(T7r()),moveSync:k7r()}});var M7r=I((Yel,N7r)=>{"use strict";p();N7r.exports={...XE(),...u8e(),...NUr(),...i7r(),..._7r(),...ok(),...D7r(),...h8e(),...b9(),...iCe()}});var g8e=I((Jel,L7r)=>{p();var kwt=require("fs"),m8e=require("path"),sCe=m8e.join,Yio=m8e.dirname,O7r=kwt.accessSync&&function(t){try{kwt.accessSync(t)}catch{return!1}return!0}||kwt.existsSync||m8e.existsSync,B7r={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 Kio(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(B7r).map(function(u){u in t||(t[u]=B7r[u])}),t.module_root||(t.module_root=Jio(__filename)),m8e.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 yro=Rm().fromPromise;E9r.exports={copy:yro(p9r()),copySync:y9r()}});var O_e=I((KYc,v9r)=>{"use strict";p();var _9r=Jne(),Ero=Rm().fromCallback;function _ro(t,e){_9r.rm(t,{recursive:!0,force:!0},e)}a(_ro,"remove");function vro(t){_9r.rmSync(t,{recursive:!0,force:!0})}a(vro,"removeSync");v9r.exports={remove:Ero(_ro),removeSync:vro}});var R9r=I((XYc,w9r)=>{"use strict";p();var Cro=Rm().fromPromise,S9r=KE(),T9r=require("path"),I9r=ZR(),x9r=O_e(),C9r=Cro(a(async function(e){let r;try{r=await S9r.readdir(e)}catch{return I9r.mkdirs(e)}return Promise.all(r.map(n=>x9r.remove(T9r.join(e,n))))},"emptyDir"));function b9r(t){let e;try{e=S9r.readdirSync(t)}catch{return I9r.mkdirsSync(t)}e.forEach(r=>{r=T9r.join(t,r),x9r.removeSync(r)})}a(b9r,"emptyDirSync");w9r.exports={emptyDirSync:b9r,emptydirSync:b9r,emptyDir:C9r,emptydir:C9r}});var N9r=I((rKc,D9r)=>{"use strict";p();var bro=Rm().fromPromise,P9r=require("path"),dB=KE(),k9r=ZR();async function Sro(t){let e;try{e=await dB.stat(t)}catch{}if(e&&e.isFile())return;let r=P9r.dirname(t),n=null;try{n=await dB.stat(r)}catch(o){if(o.code==="ENOENT"){await k9r.mkdirs(r),await dB.writeFile(t,"");return}else throw o}n.isDirectory()?await dB.writeFile(t,""):await dB.readdir(r)}a(Sro,"createFile");function Tro(t){let e;try{e=dB.statSync(t)}catch{}if(e&&e.isFile())return;let r=P9r.dirname(t);try{dB.statSync(r).isDirectory()||dB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")k9r.mkdirsSync(r);else throw n}dB.writeFileSync(t,"")}a(Tro,"createFileSync");D9r.exports={createFile:bro(Sro),createFileSync:Tro}});var F9r=I((oKc,L9r)=>{"use strict";p();var Iro=Rm().fromPromise,M9r=require("path"),l9=KE(),O9r=ZR(),{pathExists:xro}=c9(),{areIdentical:B9r}=SV();async function wro(t,e){let r;try{r=await l9.lstat(e)}catch{}let n;try{n=await l9.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&B9r(n,r))return;let o=M9r.dirname(e);await xro(o)||await O9r.mkdirs(o),await l9.link(t,e)}a(wro,"createLink");function Rro(t,e){let r;try{r=l9.lstatSync(e)}catch{}try{let s=l9.lstatSync(t);if(r&&B9r(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=M9r.dirname(e);return l9.existsSync(n)||O9r.mkdirsSync(n),l9.linkSync(t,e)}a(Rro,"createLinkSync");L9r.exports={createLink:Iro(wro),createLinkSync:Rro}});var Q9r=I((cKc,U9r)=>{"use strict";p();var u9=require("path"),B_e=KE(),{pathExists:Pro}=c9(),kro=Rm().fromPromise;async function Dro(t,e){if(u9.isAbsolute(t)){try{await B_e.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=u9.dirname(e),n=u9.join(r,t);if(await Pro(n))return{toCwd:n,toDst:t};try{await B_e.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:u9.relative(r,t)}}a(Dro,"symlinkPaths");function Nro(t,e){if(u9.isAbsolute(t)){if(!B_e.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=u9.dirname(e),n=u9.join(r,t);if(B_e.existsSync(n))return{toCwd:n,toDst:t};if(!B_e.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:u9.relative(r,t)}}a(Nro,"symlinkPathsSync");U9r.exports={symlinkPaths:kro(Dro),symlinkPathsSync:Nro}});var H9r=I((dKc,j9r)=>{"use strict";p();var q9r=KE(),Mro=Rm().fromPromise;async function Oro(t,e){if(e)return e;let r;try{r=await q9r.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Oro,"symlinkType");function Bro(t,e){if(e)return e;let r;try{r=q9r.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Bro,"symlinkTypeSync");j9r.exports={symlinkType:Mro(Oro),symlinkTypeSync:Bro}});var V9r=I((hKc,$9r)=>{"use strict";p();var Lro=Rm().fromPromise,d9=require("path"),Uv=KE(),{mkdirs:Fro,mkdirsSync:Uro}=ZR(),{symlinkPaths:Qro,symlinkPathsSync:qro}=Q9r(),{symlinkType:jro,symlinkTypeSync:Hro}=H9r(),{pathExists:Gro}=c9(),{areIdentical:G9r}=SV();async function $ro(t,e,r){let n;try{n=await Uv.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(d9.isAbsolute(t))l=await Uv.stat(t);else{let d=d9.dirname(e),f=d9.join(d,t);try{l=await Uv.stat(f)}catch{l=await Uv.stat(t)}}let u=await Uv.stat(e);if(G9r(l,u))return}let o=await Qro(t,e);t=o.toDst;let s=await jro(o.toCwd,r),c=d9.dirname(e);return await Gro(c)||await Fro(c),Uv.symlink(t,e,s)}a($ro,"createSymlink");function Vro(t,e,r){let n;try{n=Uv.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(d9.isAbsolute(t))l=Uv.statSync(t);else{let d=d9.dirname(e),f=d9.join(d,t);try{l=Uv.statSync(f)}catch{l=Uv.statSync(t)}}let u=Uv.statSync(e);if(G9r(l,u))return}let o=qro(t,e);t=o.toDst,r=Hro(o.toCwd,r);let s=d9.dirname(e);return Uv.existsSync(s)||Uro(s),Uv.symlinkSync(t,e,r)}a(Vro,"createSymlinkSync");$9r.exports={createSymlink:Lro($ro),createSymlinkSync:Vro}});var eUr=I((AKc,X9r)=>{"use strict";p();var{createFile:W9r,createFileSync:z9r}=N9r(),{createLink:Y9r,createLinkSync:K9r}=F9r(),{createSymlink:J9r,createSymlinkSync:Z9r}=V9r();X9r.exports={createFile:W9r,createFileSync:z9r,ensureFile:W9r,ensureFileSync:z9r,createLink:Y9r,createLinkSync:K9r,ensureLink:Y9r,ensureLinkSync:K9r,createSymlink:J9r,createSymlinkSync:Z9r,ensureSymlink:J9r,ensureSymlinkSync:Z9r}});var LFe=I((EKc,tUr)=>{p();function Wro(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(Wro,"stringify");function zro(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(zro,"stripBom");tUr.exports={stringify:Wro,stripBom:zro}});var oUr=I((CKc,iUr)=>{p();var eie;try{eie=Jne()}catch{eie=require("fs")}var FFe=Rm(),{stringify:rUr,stripBom:nUr}=LFe();async function Yro(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||eie,n="throws"in e?e.throws:!0,o=await FFe.fromCallback(r.readFile)(t,e);o=nUr(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(Yro,"_readFile");var Kro=FFe.fromPromise(Yro);function Jro(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||eie,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=nUr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(Jro,"readFileSync");async function Zro(t,e,r={}){let n=r.fs||eie,o=rUr(e,r);await FFe.fromCallback(n.writeFile)(t,o,r)}a(Zro,"_writeFile");var Xro=FFe.fromPromise(Zro);function eno(t,e,r={}){let n=r.fs||eie,o=rUr(e,r);return n.writeFileSync(t,o,r)}a(eno,"writeFileSync");iUr.exports={readFile:Kro,readFileSync:Jro,writeFile:Xro,writeFileSync:eno}});var aUr=I((TKc,sUr)=>{"use strict";p();var UFe=oUr();sUr.exports={readJson:UFe.readFile,readJsonSync:UFe.readFileSync,writeJson:UFe.writeFile,writeJsonSync:UFe.writeFileSync}});var QFe=I((xKc,uUr)=>{"use strict";p();var tno=Rm().fromPromise,$xt=KE(),cUr=require("path"),lUr=ZR(),rno=c9().pathExists;async function nno(t,e,r="utf-8"){let n=cUr.dirname(t);return await rno(n)||await lUr.mkdirs(n),$xt.writeFile(t,e,r)}a(nno,"outputFile");function ino(t,...e){let r=cUr.dirname(t);$xt.existsSync(r)||lUr.mkdirsSync(r),$xt.writeFileSync(t,...e)}a(ino,"outputFileSync");uUr.exports={outputFile:tno(nno),outputFileSync:ino}});var fUr=I((PKc,dUr)=>{"use strict";p();var{stringify:ono}=LFe(),{outputFile:sno}=QFe();async function ano(t,e,r={}){let n=ono(e,r);await sno(t,n,r)}a(ano,"outputJson");dUr.exports=ano});var hUr=I((NKc,pUr)=>{"use strict";p();var{stringify:cno}=LFe(),{outputFileSync:lno}=QFe();function uno(t,e,r){let n=cno(e,r);lno(t,n,r)}a(uno,"outputJsonSync");pUr.exports=uno});var gUr=I((BKc,mUr)=>{"use strict";p();var dno=Rm().fromPromise,ZE=aUr();ZE.outputJson=dno(fUr());ZE.outputJsonSync=hUr();ZE.outputJSON=ZE.outputJson;ZE.outputJSONSync=ZE.outputJsonSync;ZE.writeJSON=ZE.writeJson;ZE.writeJSONSync=ZE.writeJsonSync;ZE.readJSON=ZE.readJson;ZE.readJSONSync=ZE.readJsonSync;mUr.exports=ZE});var vUr=I((FKc,_Ur)=>{"use strict";p();var fno=KE(),AUr=require("path"),{copy:pno}=BFe(),{remove:EUr}=O_e(),{mkdirp:hno}=ZR(),{pathExists:mno}=c9(),yUr=SV();async function gno(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await yUr.checkPaths(t,e,"move",r);await yUr.checkParentPaths(t,o,e,"move");let c=AUr.dirname(e);return AUr.parse(c).root!==c&&await hno(c),Ano(t,e,n,s)}a(gno,"move");async function Ano(t,e,r,n){if(!n){if(r)await EUr(e);else if(await mno(e))throw new Error("dest already exists.")}try{await fno.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await yno(t,e,r)}}a(Ano,"doRename");async function yno(t,e,r){return await pno(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),EUr(t)}a(yno,"moveAcrossDevice");_Ur.exports=gno});var IUr=I((qKc,TUr)=>{"use strict";p();var bUr=Jne(),Wxt=require("path"),Eno=BFe().copySync,SUr=O_e().removeSync,_no=ZR().mkdirpSync,CUr=SV();function vno(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=CUr.checkPathsSync(t,e,"move",r);return CUr.checkParentPathsSync(t,o,e,"move"),Cno(e)||_no(Wxt.dirname(e)),bno(t,e,n,s)}a(vno,"moveSync");function Cno(t){let e=Wxt.dirname(t);return Wxt.parse(e).root===e}a(Cno,"isParentRoot");function bno(t,e,r,n){if(n)return Vxt(t,e,r);if(r)return SUr(e),Vxt(t,e,r);if(bUr.existsSync(e))throw new Error("dest already exists.");return Vxt(t,e,r)}a(bno,"doRename");function Vxt(t,e,r){try{bUr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Sno(t,e,r)}}a(Vxt,"rename");function Sno(t,e,r){return Eno(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),SUr(t)}a(Sno,"moveAcrossDevice");TUr.exports=vno});var wUr=I((GKc,xUr)=>{"use strict";p();var Tno=Rm().fromPromise;xUr.exports={move:Tno(vUr()),moveSync:IUr()}});var PUr=I((VKc,RUr)=>{"use strict";p();RUr.exports={...KE(),...BFe(),...R9r(),...eUr(),...gUr(),...ZR(),...wUr(),...QFe(),...c9(),...O_e()}});var jFe=I((zKc,NUr)=>{p();var zxt=require("fs"),qFe=require("path"),L_e=qFe.join,Ino=qFe.dirname,kUr=zxt.accessSync&&function(t){try{zxt.accessSync(t)}catch{return!1}return!0}||zxt.existsSync||qFe.existsSync,DUr={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 xno(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(DUr).map(function(u){u in t||(t[u]=DUr[u])}),t.module_root||(t.module_root=wno(__filename)),qFe.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 Zio=_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]})),Xio=_I&&_I.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),F7r=_I&&_I.__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)&&Zio(e,t,r);return Xio(e,t),e};Object.defineProperty(_I,"__esModule",{value:!0});_I.setDeviceId=_I.getDeviceId=void 0;var A8e=F7r(require("path")),y8e=F7r(M7r()),U7r=process.platform==="win32"?g8e()("windows"):null,eoo="deviceid";function Q7r(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=A8e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??A8e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return A8e.join(t,"Microsoft","DeveloperTools")}a(Q7r,"getDirectory");function Pwt(){return A8e.join(Q7r(),eoo)}a(Pwt,"getDeviceIdFilePath");async function too(){return process.platform==="win32"?U7r?.GetDeviceId():await roo(Pwt())?y8e.readFile(Pwt(),"utf8"):void 0}a(too,"getDeviceId");_I.getDeviceId=too;async function roo(t){try{return await y8e.promises.access(t),!0}catch{return!1}}a(roo,"exists");async function noo(t){process.platform==="win32"?U7r?.SetDeviceId(t):(await y8e.ensureDir(Q7r()),await y8e.writeFile(Pwt(),t,"utf8"))}a(noo,"setDeviceId");_I.setDeviceId=noo});var H7r=I(vN=>{"use strict";p();var ioo=vN&&vN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ooo=vN&&vN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),soo=vN&&vN.__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)&&ioo(e,t,r);return ooo(e,t),e};Object.defineProperty(vN,"__esModule",{value:!0});vN.getDeviceId=void 0;var aoo=(Ns(),Ca(yc)),j7r=soo(q7r());async function coo(){let t;try{t=await j7r.getDeviceId()}catch{}if(t)return t;{let e=(0,aoo.v4)().toLowerCase();return await j7r.setDeviceId(e),e}}a(coo,"getDeviceId");vN.getDeviceId=coo});var G7r=I(HV=>{"use strict";p();var loo=HV&&HV.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uoo=HV&&HV.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&loo(e,t,r)};Object.defineProperty(HV,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");uoo(H7r(),HV)});var na=I((E8e,$7r)=>{p();(function(t,e){typeof E8e=="object"?$7r.exports=E8e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(E8e,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 k=0;k>>2]=b[k>>>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,k=w/x;_?k=e.ceil(k):k=e.max((k|0)-this._minBufferSize,0);var D=k*R,N=e.min(D*4,w);if(D){for(var L=0;L{p();(function(t,e){typeof _8e=="object"?V7r.exports=_8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(_8e,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 C8e=="object"?W7r.exports=C8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(C8e,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 K7r=I((v8e,Y7r)=>{p();(function(t,e){typeof v8e=="object"?Y7r.exports=v8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(v8e,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 x9=I((b8e,J7r)=>{p();(function(t,e){typeof b8e=="object"?J7r.exports=b8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(b8e,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 X7r=I((S8e,Z7r)=>{p();(function(t,e){typeof S8e=="object"?Z7r.exports=S8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(S8e,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 w9=I((T8e,eQr)=>{p();(function(t,e){typeof T8e=="object"?eQr.exports=T8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(T8e,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],k=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],q=g[A+13],F=g[A+14],U=g[A+15],W=v[0],V=v[1],G=v[2],Y=v[3];W=d(W,V,G,Y,b,7,l[0]),Y=d(Y,W,V,G,T,12,l[1]),G=d(G,Y,W,V,w,17,l[2]),V=d(V,G,Y,W,R,22,l[3]),W=d(W,V,G,Y,x,7,l[4]),Y=d(Y,W,V,G,k,12,l[5]),G=d(G,Y,W,V,D,17,l[6]),V=d(V,G,Y,W,N,22,l[7]),W=d(W,V,G,Y,L,7,l[8]),Y=d(Y,W,V,G,B,12,l[9]),G=d(G,Y,W,V,Q,17,l[10]),V=d(V,G,Y,W,M,22,l[11]),W=d(W,V,G,Y,O,7,l[12]),Y=d(Y,W,V,G,q,12,l[13]),G=d(G,Y,W,V,F,17,l[14]),V=d(V,G,Y,W,U,22,l[15]),W=f(W,V,G,Y,T,5,l[16]),Y=f(Y,W,V,G,D,9,l[17]),G=f(G,Y,W,V,M,14,l[18]),V=f(V,G,Y,W,b,20,l[19]),W=f(W,V,G,Y,k,5,l[20]),Y=f(Y,W,V,G,Q,9,l[21]),G=f(G,Y,W,V,U,14,l[22]),V=f(V,G,Y,W,x,20,l[23]),W=f(W,V,G,Y,B,5,l[24]),Y=f(Y,W,V,G,F,9,l[25]),G=f(G,Y,W,V,R,14,l[26]),V=f(V,G,Y,W,L,20,l[27]),W=f(W,V,G,Y,q,5,l[28]),Y=f(Y,W,V,G,w,9,l[29]),G=f(G,Y,W,V,N,14,l[30]),V=f(V,G,Y,W,O,20,l[31]),W=h(W,V,G,Y,k,4,l[32]),Y=h(Y,W,V,G,L,11,l[33]),G=h(G,Y,W,V,M,16,l[34]),V=h(V,G,Y,W,F,23,l[35]),W=h(W,V,G,Y,T,4,l[36]),Y=h(Y,W,V,G,x,11,l[37]),G=h(G,Y,W,V,N,16,l[38]),V=h(V,G,Y,W,Q,23,l[39]),W=h(W,V,G,Y,q,4,l[40]),Y=h(Y,W,V,G,b,11,l[41]),G=h(G,Y,W,V,R,16,l[42]),V=h(V,G,Y,W,D,23,l[43]),W=h(W,V,G,Y,B,4,l[44]),Y=h(Y,W,V,G,O,11,l[45]),G=h(G,Y,W,V,U,16,l[46]),V=h(V,G,Y,W,w,23,l[47]),W=m(W,V,G,Y,b,6,l[48]),Y=m(Y,W,V,G,N,10,l[49]),G=m(G,Y,W,V,F,15,l[50]),V=m(V,G,Y,W,k,21,l[51]),W=m(W,V,G,Y,O,6,l[52]),Y=m(Y,W,V,G,R,10,l[53]),G=m(G,Y,W,V,Q,15,l[54]),V=m(V,G,Y,W,T,21,l[55]),W=m(W,V,G,Y,L,6,l[56]),Y=m(Y,W,V,G,U,10,l[57]),G=m(G,Y,W,V,D,15,l[58]),V=m(V,G,Y,W,q,21,l[59]),W=m(W,V,G,Y,x,6,l[60]),Y=m(Y,W,V,G,M,10,l[61]),G=m(G,Y,W,V,w,15,l[62]),V=m(V,G,Y,W,B,21,l[63]),v[0]=v[0]+W|0,v[1]=v[1]+V|0,v[2]=v[2]+G|0,v[3]=v[3]+Y|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 Nwt=I((I8e,tQr)=>{p();(function(t,e){typeof I8e=="object"?tQr.exports=I8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(I8e,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 w8e=I((x8e,rQr)=>{p();(function(t,e){typeof x8e=="object"?rQr.exports=x8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(x8e,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],k=(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]=k+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],q=Q+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+q|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 iQr=I((R8e,nQr)=>{p();(function(t,e,r){typeof R8e=="object"?nQr.exports=R8e=e(na(),w8e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(R8e,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 Mwt=I((k8e,oQr)=>{p();(function(t,e,r){typeof k8e=="object"?oQr.exports=k8e=e(na(),aCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(k8e,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,k=y.low,D=E.high,N=E.low,L=_.high,B=_.low,Q=v.high,M=v.low,O=b.high,q=b.low,F=T.high,U=T.low,W=w.high,V=w.low,G=R.high,Y=R.low,re=x,j=k,X=D,ie=N,we=L,Ae=B,De=Q,Te=M,Z=O,J=q,z=F,le=U,K=W,ae=V,Me=G,ne=Y,se=0;se<80;se++){var Ie,_e,Re=f[se];if(se<16)_e=Re.high=m[g+se*2]|0,Ie=Re.low=m[g+se*2+1]|0;else{var Je=f[se-15],Xe=Je.high,Ct=Je.low,Ot=(Xe>>>1|Ct<<31)^(Xe>>>8|Ct<<24)^Xe>>>7,$t=(Ct>>>1|Xe<<31)^(Ct>>>8|Xe<<24)^(Ct>>>7|Xe<<25),Gt=f[se-2],Ee=Gt.high,Qe=Gt.low,nt=(Ee>>>19|Qe<<13)^(Ee<<3|Qe>>>29)^Ee>>>6,mt=(Qe>>>19|Ee<<13)^(Qe<<3|Ee>>>29)^(Qe>>>6|Ee<<26),xe=f[se-7],He=xe.high,Ze=xe.low,at=f[se-16],ct=at.high,ut=at.low;Ie=$t+Ze,_e=Ot+He+(Ie>>>0<$t>>>0?1:0),Ie=Ie+mt,_e=_e+nt+(Ie>>>0>>0?1:0),Ie=Ie+ut,_e=_e+ct+(Ie>>>0>>0?1:0),Re.high=_e,Re.low=Ie}var ee=Z&z^~Z&K,pe=J&le^~J&ae,ke=re&X^re&we^X&we,Le=j&ie^j&Ae^ie&Ae,Ve=(re>>>28|j<<4)^(re<<30|j>>>2)^(re<<25|j>>>7),tt=(j>>>28|re<<4)^(j<<30|re>>>2)^(j<<25|re>>>7),vt=(Z>>>14|J<<18)^(Z>>>18|J<<14)^(Z<<23|J>>>9),Nt=(J>>>14|Z<<18)^(J>>>18|Z<<14)^(J<<23|Z>>>9),Vt=d[se],It=Vt.high,Be=Vt.low,oe=ne+Nt,ve=Me+vt+(oe>>>0>>0?1:0),oe=oe+pe,ve=ve+ee+(oe>>>0>>0?1:0),oe=oe+Be,ve=ve+It+(oe>>>0>>0?1:0),oe=oe+Ie,ve=ve+_e+(oe>>>0>>0?1:0),Se=tt+Le,de=Ve+ke+(Se>>>0>>0?1:0);Me=K,ne=ae,K=z,ae=le,z=Z,le=J,J=Te+oe|0,Z=De+ve+(J>>>0>>0?1:0)|0,De=we,Te=Ae,we=X,Ae=ie,X=re,ie=j,j=oe+Se|0,re=ve+de+(j>>>0>>0?1:0)|0}k=y.low=k+j,y.high=x+re+(k>>>0>>0?1:0),N=E.low=N+ie,E.high=D+X+(N>>>0>>0?1:0),B=_.low=B+Ae,_.high=L+we+(B>>>0>>0?1:0),M=v.low=M+Te,v.high=Q+De+(M>>>0>>0?1:0),q=b.low=q+J,b.high=O+Z+(q>>>0>>0?1:0),U=T.low=U+le,T.high=F+z+(U>>>0>>0?1:0),V=w.low=V+ae,w.high=W+K+(V>>>0>>0?1:0),Y=R.low=Y+ne,R.high=G+Me+(Y>>>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 aQr=I((P8e,sQr)=>{p();(function(t,e,r){typeof P8e=="object"?sQr.exports=P8e=e(na(),aCe(),Mwt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(P8e,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 lQr=I((D8e,cQr)=>{p();(function(t,e,r){typeof D8e=="object"?cQr.exports=D8e=e(na(),aCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(D8e,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 k=(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 k=0,D=0,N=0;N<5;N++){var w=E[x+5*N];k^=w.high,D^=w.low}var L=m[x];L.high=k,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,k=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^=k,w.low^=D}for(var q=1;q<25;q++){var k,D,w=E[q],F=w.high,U=w.low,W=d[q];W<32?(k=F<>>32-W,D=U<>>32-W):(k=U<>>64-W,D=F<>>64-W);var V=m[f[q]];V.high=k,V.low=D}var G=m[0],Y=E[0];G.high=Y.high,G.low=Y.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var q=x+5*N,w=E[q],re=m[q],j=m[(x+1)%5+5*N],X=m[(x+2)%5+5*N];w.high=re.high^~j.high&X.high,w.low=re.low^~j.low&X.low}var w=E[0],ie=h[R];w.high^=ie.high,w.low^=ie.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 dQr=I((N8e,uQr)=>{p();(function(t,e){typeof N8e=="object"?uQr.exports=N8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(N8e,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,k=T[x];T[x]=(k<<8|k>>>24)&16711935|(k<<24|k>>>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,q,F,U,W,V,G,Y,re,j,X;G=q=D[0],Y=F=D[1],re=U=D[2],j=W=D[3],X=V=D[4];for(var ie,R=0;R<80;R+=1)ie=q+T[w+B[R]]|0,R<16?ie+=A(F,U,W)+N[0]:R<32?ie+=y(F,U,W)+N[1]:R<48?ie+=E(F,U,W)+N[2]:R<64?ie+=_(F,U,W)+N[3]:ie+=v(F,U,W)+N[4],ie=ie|0,ie=b(ie,M[R]),ie=ie+V|0,q=V,V=W,W=b(U,10),U=F,F=ie,ie=G+T[w+Q[R]]|0,R<16?ie+=v(Y,re,j)+L[0]:R<32?ie+=_(Y,re,j)+L[1]:R<48?ie+=E(Y,re,j)+L[2]:R<64?ie+=y(Y,re,j)+L[3]:ie+=A(Y,re,j)+L[4],ie=ie|0,ie=b(ie,O[R]),ie=ie+X|0,G=X,X=j,j=b(re,10),re=Y,Y=ie;ie=D[1]+U+j|0,D[1]=D[2]+W+X|0,D[2]=D[3]+V+G|0,D[3]=D[4]+q+Y|0,D[4]=D[0]+F+re|0,D[0]=ie},"_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 k=this._hash,D=k.words,N=0;N<5;N++){var L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return k},"_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 O8e=I((M8e,fQr)=>{p();(function(t,e){typeof M8e=="object"?fQr.exports=M8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(M8e,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 B8e=="object"?pQr.exports=B8e=e(na(),w8e(),O8e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(B8e,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 L8e=="object"?mQr.exports=L8e=e(na(),Nwt(),O8e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(L8e,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 F8e=="object"?gQr.exports=F8e=e(na(),TB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(F8e,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,q=O.blockSize;B.call(this,Q,M,q),O.encryptBlock(Q,M),this._prevBlock=Q.slice(M,M+q)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(Q,M){var O=this._cipher,q=O.blockSize,F=Q.slice(M,M+q);O.decryptBlock(Q,M),B.call(this,Q,M,q),this._prevBlock=F},"processBlock")});function B(Q,M,O){var q,F=this._iv;F?(q=F,this._iv=e):q=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),q=O.finalize(B),F=O.cfg;return T.create({ciphertext:q,key:Q,iv:F.iv,algorithm:L,mode:F.mode,padding:F.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")}),k=r.kdf={},D=k.OpenSSL={execute:a(function(L,B,Q,M,O){if(M||(M=s.random(64/8)),O)var q=h.create({keySize:B+Q,hasher:O}).compute(L,M);else var q=h.create({keySize:B+Q}).compute(L,M);var F=s.create(q.words.slice(B),Q*4);return q.sigBytes=B*4,T.create({key:q,iv:F,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 q=x.encrypt.call(this,L,B,O.key,M);return q.mixIn(O),q},"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 q=x.decrypt.call(this,L,B,O.key,M);return q},"decrypt")})})()})});var yQr=I((U8e,AQr)=>{p();(function(t,e,r){typeof U8e=="object"?AQr.exports=U8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(U8e,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 Q8e=="object"?EQr.exports=Q8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Q8e,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 q8e=="object"?CQr.exports=q8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(q8e,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 j8e=="object"?bQr.exports=j8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(j8e,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 H8e=="object"?TQr.exports=H8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(H8e,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 wQr=I((G8e,xQr)=>{p();(function(t,e,r){typeof G8e=="object"?xQr.exports=G8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(G8e,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 kQr=I(($8e,RQr)=>{p();(function(t,e,r){typeof $8e=="object"?RQr.exports=$8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})($8e,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 DQr=I((V8e,PQr)=>{p();(function(t,e,r){typeof V8e=="object"?PQr.exports=V8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(V8e,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 MQr=I((W8e,NQr)=>{p();(function(t,e,r){typeof W8e=="object"?NQr.exports=W8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(W8e,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 BQr=I((z8e,OQr)=>{p();(function(t,e,r){typeof z8e=="object"?OQr.exports=z8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(z8e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var FQr=I((Y8e,LQr)=>{p();(function(t,e,r){typeof Y8e=="object"?LQr.exports=Y8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Y8e,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 QQr=I((K8e,UQr)=>{p();(function(t,e,r){typeof K8e=="object"?UQr.exports=K8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(K8e,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],k=_[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=k*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^_[_[_[k^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=[],k=0;k6&&k%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[k/T|0]<<24),x[k]=x[k-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,k){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++],F=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++],W=T[Q>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=q,L=F,B=U,Q=W}var q=(k[N>>>24]<<24|k[L>>>16&255]<<16|k[B>>>8&255]<<8|k[Q&255])^b[M++],F=(k[L>>>24]<<24|k[B>>>16&255]<<16|k[Q>>>8&255]<<8|k[N&255])^b[M++],U=(k[B>>>24]<<24|k[Q>>>16&255]<<16|k[N>>>8&255]<<8|k[L&255])^b[M++],W=(k[Q>>>24]<<24|k[N>>>16&255]<<16|k[L>>>8&255]<<8|k[B&255])^b[M++];_[v]=q,_[v+1]=F,_[v+2]=U,_[v+3]=W},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var jQr=I((J8e,qQr)=>{p();(function(t,e,r){typeof J8e=="object"?qQr.exports=J8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(J8e,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 k=this._invSubKeys=[],v=0;v<16;v++)k[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 k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,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 GQr=I((Z8e,HQr)=>{p();(function(t,e,r){typeof Z8e=="object"?HQr.exports=Z8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(Z8e,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 VQr=I((X8e,$Qr)=>{p();(function(t,e,r){typeof X8e=="object"?$Qr.exports=X8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(X8e,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 zQr=I((e6e,WQr)=>{p();(function(t,e,r){typeof e6e=="object"?WQr.exports=e6e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(e6e,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 KQr=I((t6e,YQr)=>{p();(function(t,e,r){typeof t6e=="object"?YQr.exports=t6e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(t6e,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 r6e=="object"?JQr.exports=r6e=e(na(),aCe(),z7r(),K7r(),x9(),X7r(),w9(),Nwt(),w8e(),iQr(),Mwt(),aQr(),lQr(),dQr(),O8e(),hQr(),TB(),w0(),yQr(),_Qr(),vQr(),SQr(),IQr(),wQr(),kQr(),DQr(),MQr(),BQr(),FQr(),QQr(),jQr(),GQr(),VQr(),zQr(),KQr()):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)})(r6e,function(t){return t})});var Wie=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 xfo(t){return t===!0||t===!1}a(xfo,"boolean");_y.boolean=xfo;function DHr(t){return typeof t=="string"||t instanceof String}a(DHr,"string");_y.string=DHr;function wfo(t){return typeof t=="number"||t instanceof Number}a(wfo,"number");_y.number=wfo;function Rfo(t){return t instanceof Error}a(Rfo,"error");_y.error=Rfo;function kfo(t){return typeof t=="function"}a(kfo,"func");_y.func=kfo;function NHr(t){return Array.isArray(t)}a(NHr,"array");_y.array=NHr;function Pfo(t){return NHr(t)&&t.every(e=>DHr(e))}a(Pfo,"stringArray");_y.stringArray=Pfo});var okt=I(ui=>{"use strict";p();Object.defineProperty(ui,"__esModule",{value:!0});ui.Message=ui.NotificationType9=ui.NotificationType8=ui.NotificationType7=ui.NotificationType6=ui.NotificationType5=ui.NotificationType4=ui.NotificationType3=ui.NotificationType2=ui.NotificationType1=ui.NotificationType0=ui.NotificationType=ui.RequestType9=ui.RequestType8=ui.RequestType7=ui.RequestType6=ui.RequestType5=ui.RequestType4=ui.RequestType3=ui.RequestType2=ui.RequestType1=ui.RequestType=ui.RequestType0=ui.AbstractMessageSignature=ui.ParameterStructures=ui.ResponseError=ui.ErrorCodes=void 0;var eW=Wie(),ORt;(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})(ORt||(ui.ErrorCodes=ORt={}));var BRt=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=eW.number(e)?e:ORt.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}};ui.ResponseError=BRt;var YC=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}};ui.ParameterStructures=YC;YC.auto=new YC("auto");YC.byPosition=new YC("byPosition");YC.byName=new YC("byName");var Bu=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return YC.auto}};ui.AbstractMessageSignature=Bu;var LRt=class extends Bu{static{a(this,"RequestType0")}constructor(e){super(e,0)}};ui.RequestType0=LRt;var FRt=class extends Bu{static{a(this,"RequestType")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.RequestType=FRt;var URt=class extends Bu{static{a(this,"RequestType1")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.RequestType1=URt;var QRt=class extends Bu{static{a(this,"RequestType2")}constructor(e){super(e,2)}};ui.RequestType2=QRt;var qRt=class extends Bu{static{a(this,"RequestType3")}constructor(e){super(e,3)}};ui.RequestType3=qRt;var jRt=class extends Bu{static{a(this,"RequestType4")}constructor(e){super(e,4)}};ui.RequestType4=jRt;var HRt=class extends Bu{static{a(this,"RequestType5")}constructor(e){super(e,5)}};ui.RequestType5=HRt;var GRt=class extends Bu{static{a(this,"RequestType6")}constructor(e){super(e,6)}};ui.RequestType6=GRt;var $Rt=class extends Bu{static{a(this,"RequestType7")}constructor(e){super(e,7)}};ui.RequestType7=$Rt;var VRt=class extends Bu{static{a(this,"RequestType8")}constructor(e){super(e,8)}};ui.RequestType8=VRt;var WRt=class extends Bu{static{a(this,"RequestType9")}constructor(e){super(e,9)}};ui.RequestType9=WRt;var zRt=class extends Bu{static{a(this,"NotificationType")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.NotificationType=zRt;var YRt=class extends Bu{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};ui.NotificationType0=YRt;var KRt=class extends Bu{static{a(this,"NotificationType1")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.NotificationType1=KRt;var JRt=class extends Bu{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};ui.NotificationType2=JRt;var ZRt=class extends Bu{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};ui.NotificationType3=ZRt;var XRt=class extends Bu{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};ui.NotificationType4=XRt;var ekt=class extends Bu{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};ui.NotificationType5=ekt;var tkt=class extends Bu{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};ui.NotificationType6=tkt;var rkt=class extends Bu{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};ui.NotificationType7=rkt;var nkt=class extends Bu{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};ui.NotificationType8=nkt;var ikt=class extends Bu{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};ui.NotificationType9=ikt;var MHr;(function(t){function e(o){let s=o;return s&&eW.string(s.method)&&(eW.string(s.id)||eW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&eW.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)&&(eW.string(s.id)||eW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(MHr||(ui.Message=MHr={}))});var akt=I(j9=>{"use strict";p();var OHr;Object.defineProperty(j9,"__esModule",{value:!0});j9.LRUCache=j9.LinkedMap=j9.Touch=void 0;var Cy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Cy||(j9.Touch=Cy={}));var F6e=class{static{a(this,"LinkedMap")}constructor(){this[OHr]="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=Cy.None){let n=this._map.get(e);if(n)return r!==Cy.None&&this.touch(n,r),n.value}set(e,r,n=Cy.None){let o=this._map.get(e);if(o)o.value=r,n!==Cy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case Cy.None:this.addItemLast(o);break;case Cy.First:this.addItemFirst(o);break;case Cy.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}[(OHr=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!==Cy.First&&r!==Cy.Last)){if(r===Cy.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===Cy.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)}};j9.LinkedMap=F6e;var skt=class extends F6e{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=Cy.AsNew){return super.get(e,r)}peek(e){return super.get(e,Cy.None)}set(e,r){return super.set(e,r,Cy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};j9.LRUCache=skt});var LHr=I(U6e=>{"use strict";p();Object.defineProperty(U6e,"__esModule",{value:!0});U6e.Disposable=void 0;var BHr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(BHr||(U6e.Disposable=BHr={}))});var H9=I(ukt=>{"use strict";p();Object.defineProperty(ukt,"__esModule",{value:!0});var ckt;function lkt(){if(ckt===void 0)throw new Error("No runtime abstraction layer installed");return ckt}a(lkt,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");ckt=r}a(e,"install"),t.install=e})(lkt||(lkt={}));ukt.default=lkt});var Yie=I(zie=>{"use strict";p();Object.defineProperty(zie,"__esModule",{value:!0});zie.Emitter=zie.Event=void 0;var Dfo=H9(),FHr;(function(t){let e={dispose(){}};t.None=function(){return e}})(FHr||(zie.Event=FHr={}));var dkt=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 dkt),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)}};zie.Emitter=Q6e;Q6e._noop=function(){}});var H6e=I(Kie=>{"use strict";p();Object.defineProperty(Kie,"__esModule",{value:!0});Kie.CancellationTokenSource=Kie.CancellationToken=void 0;var Nfo=H9(),Mfo=Wie(),fkt=Yie(),q6e;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:fkt.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:fkt.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||Mfo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(q6e||(Kie.CancellationToken=q6e={}));var Ofo=Object.freeze(function(t,e){let r=(0,Nfo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),j6e=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?Ofo:(this._emitter||(this._emitter=new fkt.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},pkt=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new j6e),this._token}cancel(){this._token?this._token.cancel():this._token=q6e.Cancelled}dispose(){this._token?this._token instanceof j6e&&this._token.dispose():this._token=q6e.None}};Kie.CancellationTokenSource=pkt});var UHr=I(Jie=>{"use strict";p();Object.defineProperty(Jie,"__esModule",{value:!0});Jie.SharedArrayReceiverStrategy=Jie.SharedArraySenderStrategy=void 0;var Bfo=H6e(),xCe;(function(t){t.Continue=0,t.Cancelled=1})(xCe||(xCe={}));var hkt=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]=xCe.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,xCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Jie.SharedArraySenderStrategy=hkt;var mkt=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===xCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},gkt=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new mkt(e)}cancel(){}dispose(){}},Akt=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Bfo.CancellationTokenSource:new gkt(r)}};Jie.SharedArrayReceiverStrategy=Akt});var Ekt=I(G6e=>{"use strict";p();Object.defineProperty(G6e,"__esModule",{value:!0});G6e.Semaphore=void 0;var Lfo=H9(),ykt=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,Lfo.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()}}};G6e.Semaphore=ykt});var qHr=I(G9=>{"use strict";p();Object.defineProperty(G9,"__esModule",{value:!0});G9.ReadableStreamMessageReader=G9.AbstractMessageReader=G9.MessageReader=void 0;var Ckt=H9(),Zie=Wie(),_kt=Yie(),Ffo=Ekt(),QHr;(function(t){function e(r){let n=r;return n&&Zie.func(n.listen)&&Zie.func(n.dispose)&&Zie.func(n.onError)&&Zie.func(n.onClose)&&Zie.func(n.onPartialMessage)}a(e,"is"),t.is=e})(QHr||(G9.MessageReader=QHr={}));var $6e=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new _kt.Emitter,this.closeEmitter=new _kt.Emitter,this.partialMessageEmitter=new _kt.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: ${Zie.string(e.message)?e.message:"unknown"}`)}};G9.AbstractMessageReader=$6e;var vkt;(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,Ckt.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(vkt||(vkt={}));var bkt=class extends $6e{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=vkt.fromOptions(r),this.buffer=(0,Ckt.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Ffo.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,Ckt.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))}};G9.ReadableStreamMessageReader=bkt});var VHr=I($9=>{"use strict";p();Object.defineProperty($9,"__esModule",{value:!0});$9.WriteableStreamMessageWriter=$9.AbstractMessageWriter=$9.MessageWriter=void 0;var jHr=H9(),wCe=Wie(),Ufo=Ekt(),HHr=Yie(),Qfo="Content-Length: ",GHr=`\r -`,$Hr;(function(t){function e(r){let n=r;return n&&wCe.func(n.dispose)&&wCe.func(n.onClose)&&wCe.func(n.onError)&&wCe.func(n.write)}a(e,"is"),t.is=e})($Hr||($9.MessageWriter=$Hr={}));var V6e=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new HHr.Emitter,this.closeEmitter=new HHr.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: ${wCe.string(e.message)?e.message:"unknown"}`)}};$9.AbstractMessageWriter=V6e;var Skt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,jHr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,jHr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(Skt||(Skt={}));var Tkt=class extends V6e{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=Skt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new Ufo.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(Qfo,n.byteLength.toString(),GHr),o.push(GHr),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()}};$9.WriteableStreamMessageWriter=Tkt});var WHr=I(W6e=>{"use strict";p();Object.defineProperty(W6e,"__esModule",{value:!0});W6e.AbstractMessageBuffer=void 0;var qfo=13,jfo=10,Hfo=`\r -`,Ikt=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}};W6e.AbstractMessageBuffer=Ikt});var ZHr=I(Mo=>{"use strict";p();Object.defineProperty(Mo,"__esModule",{value:!0});Mo.createMessageConnection=Mo.ConnectionOptions=Mo.MessageStrategy=Mo.CancellationStrategy=Mo.CancellationSenderStrategy=Mo.CancellationReceiverStrategy=Mo.RequestCancellationReceiverStrategy=Mo.IdCancellationReceiverStrategy=Mo.ConnectionStrategy=Mo.ConnectionError=Mo.ConnectionErrors=Mo.LogTraceNotification=Mo.SetTraceNotification=Mo.TraceFormat=Mo.TraceValues=Mo.Trace=Mo.NullLogger=Mo.ProgressType=Mo.ProgressToken=void 0;var zHr=H9(),ef=Wie(),Wi=okt(),YHr=akt(),RCe=Yie(),xkt=H6e(),DCe;(function(t){t.type=new Wi.NotificationType("$/cancelRequest")})(DCe||(DCe={}));var wkt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(wkt||(Mo.ProgressToken=wkt={}));var kCe;(function(t){t.type=new Wi.NotificationType("$/progress")})(kCe||(kCe={}));var Rkt=class{static{a(this,"ProgressType")}constructor(){}};Mo.ProgressType=Rkt;var kkt;(function(t){function e(r){return ef.func(r)}a(e,"is"),t.is=e})(kkt||(kkt={}));Mo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var Ec;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ec||(Mo.Trace=Ec={}));var KHr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(KHr||(Mo.TraceValues=KHr={}));(function(t){function e(n){if(!ef.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})(Ec||(Mo.Trace=Ec={}));var P1;(function(t){t.Text="text",t.JSON="json"})(P1||(Mo.TraceFormat=P1={}));(function(t){function e(r){return ef.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(P1||(Mo.TraceFormat=P1={}));var Pkt;(function(t){t.type=new Wi.NotificationType("$/setTrace")})(Pkt||(Mo.SetTraceNotification=Pkt={}));var z6e;(function(t){t.type=new Wi.NotificationType("$/logTrace")})(z6e||(Mo.LogTraceNotification=z6e={}));var PCe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(PCe||(Mo.ConnectionErrors=PCe={}));var Xie=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Mo.ConnectionError=Xie;var Dkt;(function(t){function e(r){let n=r;return n&&ef.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(Dkt||(Mo.ConnectionStrategy=Dkt={}));var Y6e;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&ef.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ef.func(n.dispose))}a(e,"is"),t.is=e})(Y6e||(Mo.IdCancellationReceiverStrategy=Y6e={}));var Nkt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&ef.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ef.func(n.dispose))}a(e,"is"),t.is=e})(Nkt||(Mo.RequestCancellationReceiverStrategy=Nkt={}));var K6e;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new xkt.CancellationTokenSource}});function e(r){return Y6e.is(r)||Nkt.is(r)}a(e,"is"),t.is=e})(K6e||(Mo.CancellationReceiverStrategy=K6e={}));var J6e;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(DCe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&ef.func(n.sendCancellation)&&ef.func(n.cleanup)}a(e,"is"),t.is=e})(J6e||(Mo.CancellationSenderStrategy=J6e={}));var Z6e;(function(t){t.Message=Object.freeze({receiver:K6e.Message,sender:J6e.Message});function e(r){let n=r;return n&&K6e.is(n.receiver)&&J6e.is(n.sender)}a(e,"is"),t.is=e})(Z6e||(Mo.CancellationStrategy=Z6e={}));var X6e;(function(t){function e(r){let n=r;return n&&ef.func(n.handleMessage)}a(e,"is"),t.is=e})(X6e||(Mo.MessageStrategy=X6e={}));var JHr;(function(t){function e(r){let n=r;return n&&(Z6e.is(n.cancellationStrategy)||Dkt.is(n.connectionStrategy)||X6e.is(n.messageStrategy))}a(e,"is"),t.is=e})(JHr||(Mo.ConnectionOptions=JHr={}));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 Gfo(t,e,r,n){let o=r!==void 0?r:Mo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new YHr.LinkedMap,E=new Map,_=new Set,v=new Map,b=Ec.Off,T=P1.Text,w,R=_k.New,x=new RCe.Emitter,k=new RCe.Emitter,D=new RCe.Emitter,N=new RCe.Emitter,L=new RCe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:Z6e.Message;function Q(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}a(Q,"createRequestQueueKey");function M(Ee){return Ee===null?"res-unknown-"+(++l).toString():"res-"+Ee.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function q(Ee,Qe){Wi.Message.isRequest(Qe)?Ee.set(Q(Qe.id),Qe):Wi.Message.isResponse(Qe)?Ee.set(M(Qe.id),Qe):Ee.set(O(),Qe)}a(q,"addMessageToQueue");function F(Ee){}a(F,"cancelUndispatched");function U(){return R===_k.Listening}a(U,"isListening");function W(){return R===_k.Closed}a(W,"isClosed");function V(){return R===_k.Disposed}a(V,"isDisposed");function G(){(R===_k.New||R===_k.Listening)&&(R=_k.Closed,k.fire(void 0))}a(G,"closeHandler");function Y(Ee){x.fire([Ee,void 0,void 0])}a(Y,"readErrorHandler");function re(Ee){x.fire(Ee)}a(re,"writeErrorHandler"),t.onClose(G),t.onError(Y),e.onClose(G),e.onError(re);function j(){A||y.size===0||(A=(0,zHr.default)().timer.setImmediate(()=>{A=void 0,ie()}))}a(j,"triggerMessageQueue");function X(Ee){Wi.Message.isRequest(Ee)?Ae(Ee):Wi.Message.isNotification(Ee)?Te(Ee):Wi.Message.isResponse(Ee)?De(Ee):Z(Ee)}a(X,"handleMessage");function ie(){if(y.size===0)return;let Ee=y.shift();try{let Qe=n?.messageStrategy;X6e.is(Qe)?Qe.handleMessage(Ee,X):X(Ee)}finally{j()}}a(ie,"processMessageQueue");let we=a(Ee=>{try{if(Wi.Message.isNotification(Ee)&&Ee.method===DCe.type.method){let Qe=Ee.params.id,nt=Q(Qe),mt=y.get(nt);if(Wi.Message.isRequest(mt)){let He=n?.connectionStrategy,Ze=He&&He.cancelUndispatched?He.cancelUndispatched(mt,F):void 0;if(Ze&&(Ze.error!==void 0||Ze.result!==void 0)){y.delete(nt),v.delete(Qe),Ze.id=mt.id,K(Ze,Ee.method,Date.now()),e.write(Ze).catch(()=>o.error("Sending response for canceled message failed."));return}}let xe=v.get(Qe);if(xe!==void 0){xe.cancel(),Me(Ee);return}else _.add(Qe)}q(y,Ee)}finally{j()}},"callback");function Ae(Ee){if(V())return;function Qe(ct,ut,ee){let pe={jsonrpc:u,id:Ee.id};ct instanceof Wi.ResponseError?pe.error=ct.toJson():pe.result=ct===void 0?null:ct,K(pe,ut,ee),e.write(pe).catch(()=>o.error("Sending response failed."))}a(Qe,"reply");function nt(ct,ut,ee){let pe={jsonrpc:u,id:Ee.id,error:ct.toJson()};K(pe,ut,ee),e.write(pe).catch(()=>o.error("Sending response failed."))}a(nt,"replyError");function mt(ct,ut,ee){ct===void 0&&(ct=null);let pe={jsonrpc:u,id:Ee.id,result:ct};K(pe,ut,ee),e.write(pe).catch(()=>o.error("Sending response failed."))}a(mt,"replySuccess"),ae(Ee);let xe=f.get(Ee.method),He,Ze;xe&&(He=xe.type,Ze=xe.handler);let at=Date.now();if(Ze||d){let ct=Ee.id??String(Date.now()),ut=Y6e.is(B.receiver)?B.receiver.createCancellationTokenSource(ct):B.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&_.has(Ee.id)&&ut.cancel(),Ee.id!==null&&v.set(ct,ut);try{let ee;if(Ze)if(Ee.params===void 0){if(He!==void 0&&He.numberOfParams!==0){nt(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${He.numberOfParams} params but received none.`),Ee.method,at);return}ee=Ze(ut.token)}else if(Array.isArray(Ee.params)){if(He!==void 0&&He.parameterStructures===Wi.ParameterStructures.byName){nt(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,at);return}ee=Ze(...Ee.params,ut.token)}else{if(He!==void 0&&He.parameterStructures===Wi.ParameterStructures.byPosition){nt(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,at);return}ee=Ze(Ee.params,ut.token)}else d&&(ee=d(Ee.method,Ee.params,ut.token));let pe=ee;ee?pe.then?pe.then(ke=>{v.delete(ct),Qe(ke,Ee.method,at)},ke=>{v.delete(ct),ke instanceof Wi.ResponseError?nt(ke,Ee.method,at):ke&&ef.string(ke.message)?nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${ke.message}`),Ee.method,at):nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,at)}):(v.delete(ct),Qe(ee,Ee.method,at)):(v.delete(ct),mt(ee,Ee.method,at))}catch(ee){v.delete(ct),ee instanceof Wi.ResponseError?Qe(ee,Ee.method,at):ee&&ef.string(ee.message)?nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${ee.message}`),Ee.method,at):nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,at)}}else nt(new Wi.ResponseError(Wi.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,at)}a(Ae,"handleRequest");function De(Ee){if(!V())if(Ee.id===null)Ee.error?o.error(`Received response message without id: Error is: -${JSON.stringify(Ee.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let Qe=Ee.id,nt=E.get(Qe);if(ne(Ee,nt),nt!==void 0){E.delete(Qe);try{if(Ee.error){let mt=Ee.error;nt.reject(new Wi.ResponseError(mt.code,mt.message,mt.data))}else if(Ee.result!==void 0)nt.resolve(Ee.result);else throw new Error("Should never happen.")}catch(mt){mt.message?o.error(`Response handler '${nt.method}' failed with message: ${mt.message}`):o.error(`Response handler '${nt.method}' failed unexpectedly.`)}}}}a(De,"handleResponse");function Te(Ee){if(V())return;let Qe,nt;if(Ee.method===DCe.type.method){let mt=Ee.params.id;_.delete(mt),Me(Ee);return}else{let mt=m.get(Ee.method);mt&&(nt=mt.handler,Qe=mt.type)}if(nt||h)try{if(Me(Ee),nt)if(Ee.params===void 0)Qe!==void 0&&Qe.numberOfParams!==0&&Qe.parameterStructures!==Wi.ParameterStructures.byName&&o.error(`Notification ${Ee.method} defines ${Qe.numberOfParams} params but received none.`),nt();else if(Array.isArray(Ee.params)){let mt=Ee.params;Ee.method===kCe.type.method&&mt.length===2&&wkt.is(mt[0])?nt({token:mt[0],value:mt[1]}):(Qe!==void 0&&(Qe.parameterStructures===Wi.ParameterStructures.byName&&o.error(`Notification ${Ee.method} defines parameters by name but received parameters by position`),Qe.numberOfParams!==Ee.params.length&&o.error(`Notification ${Ee.method} defines ${Qe.numberOfParams} params but received ${mt.length} arguments`)),nt(...mt))}else Qe!==void 0&&Qe.parameterStructures===Wi.ParameterStructures.byPosition&&o.error(`Notification ${Ee.method} defines parameters by position but received parameters by name`),nt(Ee.params);else h&&h(Ee.method,Ee.params)}catch(mt){mt.message?o.error(`Notification handler '${Ee.method}' failed with message: ${mt.message}`):o.error(`Notification handler '${Ee.method}' failed unexpectedly.`)}else D.fire(Ee)}a(Te,"handleNotification");function Z(Ee){if(!Ee){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(Ee,null,4)}`);let Qe=Ee;if(ef.string(Qe.id)||ef.number(Qe.id)){let nt=Qe.id,mt=E.get(nt);mt&&mt.reject(new Error("The received response has neither a result nor an error property."))}}a(Z,"handleInvalidMessage");function J(Ee){if(Ee!=null)switch(b){case Ec.Verbose:return JSON.stringify(Ee,null,4);case Ec.Compact:return JSON.stringify(Ee);default:return}}a(J,"stringifyTrace");function z(Ee){if(!(b===Ec.Off||!w))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&Ee.params&&(Qe=`Params: ${J(Ee.params)} +`)),l.tries=r,l}a(xno,"bindings");NUr.exports=xno;function wno(t){for(var e=Ino(t),r;;){if(e==="."&&(e=process.cwd()),kUr(L_e(e,"dist")))return L_e(e,"dist");if(kUr(L_e(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=L_e(e,"..")}}a(wno,"getRoot")});var LUr=I(hI=>{"use strict";p();var Rno=hI&&hI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pno=hI&&hI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MUr=hI&&hI.__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)&&Rno(e,t,r);return Pno(e,t),e};Object.defineProperty(hI,"__esModule",{value:!0});hI.setDeviceId=hI.getDeviceId=void 0;var HFe=MUr(require("path")),GFe=MUr(PUr()),OUr=process.platform==="win32"?jFe()("windows"):null,kno="deviceid";function BUr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=HFe.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??HFe.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return HFe.join(t,"Microsoft","DeveloperTools")}a(BUr,"getDirectory");function Yxt(){return HFe.join(BUr(),kno)}a(Yxt,"getDeviceIdFilePath");async function Dno(){return process.platform==="win32"?OUr?.GetDeviceId():await Nno(Yxt())?GFe.readFile(Yxt(),"utf8"):void 0}a(Dno,"getDeviceId");hI.getDeviceId=Dno;async function Nno(t){try{return await GFe.promises.access(t),!0}catch{return!1}}a(Nno,"exists");async function Mno(t){process.platform==="win32"?OUr?.SetDeviceId(t):(await GFe.ensureDir(BUr()),await GFe.writeFile(Yxt(),t,"utf8"))}a(Mno,"setDeviceId");hI.setDeviceId=Mno});var UUr=I(hN=>{"use strict";p();var Ono=hN&&hN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bno=hN&&hN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Lno=hN&&hN.__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)&&Ono(e,t,r);return Bno(e,t),e};Object.defineProperty(hN,"__esModule",{value:!0});hN.getDeviceId=void 0;var Fno=(As(),ya(gc)),FUr=Lno(LUr());async function Uno(){let t;try{t=await FUr.getDeviceId()}catch{}if(t)return t;{let e=(0,Fno.v4)().toLowerCase();return await FUr.setDeviceId(e),e}}a(Uno,"getDeviceId");hN.getDeviceId=Uno});var QUr=I(TV=>{"use strict";p();var Qno=TV&&TV.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qno=TV&&TV.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Qno(e,t,r)};Object.defineProperty(TV,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");qno(UUr(),TV)});var Xs=I(($Fe,qUr)=>{p();(function(t,e){typeof $Fe=="object"?qUr.exports=$Fe=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})($Fe,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 VFe=="object"?jUr.exports=VFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(VFe,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 WFe=="object"?HUr.exports=WFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(WFe,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 VUr=I((zFe,$Ur)=>{p();(function(t,e){typeof zFe=="object"?$Ur.exports=zFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(zFe,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 f9=I((YFe,WUr)=>{p();(function(t,e){typeof YFe=="object"?WUr.exports=YFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(YFe,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 YUr=I((KFe,zUr)=>{p();(function(t,e){typeof KFe=="object"?zUr.exports=KFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(KFe,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 p9=I((JFe,KUr)=>{p();(function(t,e){typeof JFe=="object"?KUr.exports=JFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(JFe,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],q=g[A+13],Q=g[A+14],U=g[A+15],z=v[0],W=v[1],$=v[2],J=v[3];z=d(z,W,$,J,b,7,l[0]),J=d(J,z,W,$,T,12,l[1]),$=d($,J,z,W,w,17,l[2]),W=d(W,$,J,z,R,22,l[3]),z=d(z,W,$,J,x,7,l[4]),J=d(J,z,W,$,P,12,l[5]),$=d($,J,z,W,D,17,l[6]),W=d(W,$,J,z,N,22,l[7]),z=d(z,W,$,J,L,7,l[8]),J=d(J,z,W,$,B,12,l[9]),$=d($,J,z,W,j,17,l[10]),W=d(W,$,J,z,M,22,l[11]),z=d(z,W,$,J,O,7,l[12]),J=d(J,z,W,$,q,12,l[13]),$=d($,J,z,W,Q,17,l[14]),W=d(W,$,J,z,U,22,l[15]),z=f(z,W,$,J,T,5,l[16]),J=f(J,z,W,$,D,9,l[17]),$=f($,J,z,W,M,14,l[18]),W=f(W,$,J,z,b,20,l[19]),z=f(z,W,$,J,P,5,l[20]),J=f(J,z,W,$,j,9,l[21]),$=f($,J,z,W,U,14,l[22]),W=f(W,$,J,z,x,20,l[23]),z=f(z,W,$,J,B,5,l[24]),J=f(J,z,W,$,Q,9,l[25]),$=f($,J,z,W,R,14,l[26]),W=f(W,$,J,z,L,20,l[27]),z=f(z,W,$,J,q,5,l[28]),J=f(J,z,W,$,w,9,l[29]),$=f($,J,z,W,N,14,l[30]),W=f(W,$,J,z,O,20,l[31]),z=h(z,W,$,J,P,4,l[32]),J=h(J,z,W,$,L,11,l[33]),$=h($,J,z,W,M,16,l[34]),W=h(W,$,J,z,Q,23,l[35]),z=h(z,W,$,J,T,4,l[36]),J=h(J,z,W,$,x,11,l[37]),$=h($,J,z,W,N,16,l[38]),W=h(W,$,J,z,j,23,l[39]),z=h(z,W,$,J,q,4,l[40]),J=h(J,z,W,$,b,11,l[41]),$=h($,J,z,W,R,16,l[42]),W=h(W,$,J,z,D,23,l[43]),z=h(z,W,$,J,B,4,l[44]),J=h(J,z,W,$,O,11,l[45]),$=h($,J,z,W,U,16,l[46]),W=h(W,$,J,z,w,23,l[47]),z=m(z,W,$,J,b,6,l[48]),J=m(J,z,W,$,N,10,l[49]),$=m($,J,z,W,Q,15,l[50]),W=m(W,$,J,z,P,21,l[51]),z=m(z,W,$,J,O,6,l[52]),J=m(J,z,W,$,R,10,l[53]),$=m($,J,z,W,j,15,l[54]),W=m(W,$,J,z,T,21,l[55]),z=m(z,W,$,J,L,6,l[56]),J=m(J,z,W,$,U,10,l[57]),$=m($,J,z,W,D,15,l[58]),W=m(W,$,J,z,q,21,l[59]),z=m(z,W,$,J,x,6,l[60]),J=m(J,z,W,$,M,10,l[61]),$=m($,J,z,W,w,15,l[62]),W=m(W,$,J,z,B,21,l[63]),v[0]=v[0]+z|0,v[1]=v[1]+W|0,v[2]=v[2]+$|0,v[3]=v[3]+J|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 Jxt=I((ZFe,JUr)=>{p();(function(t,e){typeof ZFe=="object"?JUr.exports=ZFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(ZFe,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 e8e=I((XFe,ZUr)=>{p();(function(t,e){typeof XFe=="object"?ZUr.exports=XFe=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(XFe,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],q=j+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+q|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 e7r=I((t8e,XUr)=>{p();(function(t,e,r){typeof t8e=="object"?XUr.exports=t8e=e(Xs(),e8e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(t8e,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 Zxt=I((r8e,t7r)=>{p();(function(t,e,r){typeof r8e=="object"?t7r.exports=r8e=e(Xs(),F_e()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(r8e,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,q=b.low,Q=T.high,U=T.low,z=w.high,W=w.low,$=R.high,J=R.low,ne=x,H=P,re=D,ae=N,Oe=L,ve=B,Fe=j,Pe=M,Z=O,ee=q,K=Q,fe=U,X=z,ue=W,qe=$,ie=J,le=0;le<80;le++){var Ne,we,Be=f[le];if(le<16)we=Be.high=m[g+le*2]|0,Ne=Be.low=m[g+le*2+1]|0;else{var tt=f[le-15],st=tt.high,Et=tt.low,kt=(st>>>1|Et<<31)^(st>>>8|Et<<24)^st>>>7,Ht=(Et>>>1|st<<31)^(Et>>>8|st<<24)^(Et>>>7|st<<25),jt=f[le-2],Ie=jt.high,F=jt.low,be=(Ie>>>19|F<<13)^(Ie<<3|F>>>29)^Ie>>>6,Ue=(F>>>19|Ie<<13)^(F<<3|Ie>>>29)^(F>>>6|Ie<<26),de=f[le-7],Se=de.high,Le=de.low,te=f[le-16],Te=te.high,Ge=te.low;Ne=Ht+Le,we=kt+Se+(Ne>>>0>>0?1:0),Ne=Ne+Ue,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 Y=Z&K^~Z&X,se=ee&fe^~ee&ue,pe=ne&re^ne&Oe^re&Oe,Ce=H&ae^H&ve^ae&ve,He=(ne>>>28|H<<4)^(ne<<30|H>>>2)^(ne<<25|H>>>7),$e=(H>>>28|ne<<4)^(H<<30|ne>>>2)^(H<<25|ne>>>7),Xe=(Z>>>14|ee<<18)^(Z>>>18|ee<<14)^(Z<<23|ee>>>9),ct=(ee>>>14|Z<<18)^(ee>>>18|Z<<14)^(ee<<23|Z>>>9),bt=d[le],ht=bt.high,We=bt.low,ce=ie+ct,Re=qe+Xe+(ce>>>0>>0?1:0),ce=ce+se,Re=Re+Y+(ce>>>0>>0?1:0),ce=ce+We,Re=Re+ht+(ce>>>0>>0?1:0),ce=ce+Ne,Re=Re+we+(ce>>>0>>0?1:0),Me=$e+Ce,ge=He+pe+(Me>>>0<$e>>>0?1:0);qe=X,ie=ue,X=K,ue=fe,K=Z,fe=ee,ee=Pe+ce|0,Z=Fe+Re+(ee>>>0>>0?1:0)|0,Fe=Oe,Pe=ve,Oe=re,ve=ae,re=ne,ae=H,H=ce+Me|0,ne=Re+ge+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ne+(P>>>0>>0?1:0),N=E.low=N+ae,E.high=D+re+(N>>>0>>0?1:0),B=_.low=B+ve,_.high=L+Oe+(B>>>0>>0?1:0),M=v.low=M+Pe,v.high=j+Fe+(M>>>0>>0?1:0),q=b.low=q+ee,b.high=O+Z+(q>>>0>>0?1:0),U=T.low=U+fe,T.high=Q+K+(U>>>0>>0?1:0),W=w.low=W+ue,w.high=z+X+(W>>>0>>0?1:0),J=R.low=J+ie,R.high=$+qe+(J>>>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 n7r=I((n8e,r7r)=>{p();(function(t,e,r){typeof n8e=="object"?r7r.exports=n8e=e(Xs(),F_e(),Zxt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(n8e,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 o7r=I((i8e,i7r)=>{p();(function(t,e,r){typeof i8e=="object"?i7r.exports=i8e=e(Xs(),F_e()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(i8e,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 q=1;q<25;q++){var P,D,w=E[q],Q=w.high,U=w.low,z=d[q];z<32?(P=Q<>>32-z,D=U<>>32-z):(P=U<>>64-z,D=Q<>>64-z);var W=m[f[q]];W.high=P,W.low=D}var $=m[0],J=E[0];$.high=J.high,$.low=J.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var q=x+5*N,w=E[q],ne=m[q],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ne.high^~H.high&re.high,w.low=ne.low^~H.low&re.low}var w=E[0],ae=h[R];w.high^=ae.high,w.low^=ae.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 a7r=I((o8e,s7r)=>{p();(function(t,e){typeof o8e=="object"?s7r.exports=o8e=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(o8e,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,q,Q,U,z,W,$,J,ne,H,re;$=q=D[0],J=Q=D[1],ne=U=D[2],H=z=D[3],re=W=D[4];for(var ae,R=0;R<80;R+=1)ae=q+T[w+B[R]]|0,R<16?ae+=A(Q,U,z)+N[0]:R<32?ae+=y(Q,U,z)+N[1]:R<48?ae+=E(Q,U,z)+N[2]:R<64?ae+=_(Q,U,z)+N[3]:ae+=v(Q,U,z)+N[4],ae=ae|0,ae=b(ae,M[R]),ae=ae+W|0,q=W,W=z,z=b(U,10),U=Q,Q=ae,ae=$+T[w+j[R]]|0,R<16?ae+=v(J,ne,H)+L[0]:R<32?ae+=_(J,ne,H)+L[1]:R<48?ae+=E(J,ne,H)+L[2]:R<64?ae+=y(J,ne,H)+L[3]:ae+=A(J,ne,H)+L[4],ae=ae|0,ae=b(ae,O[R]),ae=ae+re|0,$=re,re=H,H=b(ne,10),ne=J,J=ae;ae=D[1]+U+H|0,D[1]=D[2]+z+re|0,D[2]=D[3]+W+$|0,D[3]=D[4]+q+J|0,D[4]=D[0]+Q+ne|0,D[0]=ae},"_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 a8e=I((s8e,c7r)=>{p();(function(t,e){typeof s8e=="object"?c7r.exports=s8e=e(Xs()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(s8e,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 c8e=="object"?l7r.exports=c8e=e(Xs(),e8e(),a8e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(c8e,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 l8e=="object"?d7r.exports=l8e=e(Xs(),Jxt(),a8e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(l8e,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 u8e=="object"?f7r.exports=u8e=e(Xs(),pB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(u8e,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,q=O.blockSize;B.call(this,j,M,q),O.encryptBlock(j,M),this._prevBlock=j.slice(M,M+q)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(j,M){var O=this._cipher,q=O.blockSize,Q=j.slice(M,M+q);O.decryptBlock(j,M),B.call(this,j,M,q),this._prevBlock=Q},"processBlock")});function B(j,M,O){var q,Q=this._iv;Q?(q=Q,this._iv=e):q=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,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),q=O.finalize(B),Q=O.cfg;return T.create({ciphertext:q,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 q=h.create({keySize:B+j,hasher:O}).compute(L,M);else var q=h.create({keySize:B+j}).compute(L,M);var Q=s.create(q.words.slice(B),j*4);return q.sigBytes=B*4,T.create({key:q,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 q=x.encrypt.call(this,L,B,O.key,M);return q.mixIn(O),q},"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 q=x.decrypt.call(this,L,B,O.key,M);return q},"decrypt")})})()})});var h7r=I((d8e,p7r)=>{p();(function(t,e,r){typeof d8e=="object"?p7r.exports=d8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(d8e,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 f8e=="object"?m7r.exports=f8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(f8e,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 p8e=="object"?A7r.exports=p8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(p8e,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 h8e=="object"?E7r.exports=h8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(h8e,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 m8e=="object"?v7r.exports=m8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(m8e,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 S7r=I((g8e,b7r)=>{p();(function(t,e,r){typeof g8e=="object"?b7r.exports=g8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(g8e,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 I7r=I((A8e,T7r)=>{p();(function(t,e,r){typeof A8e=="object"?T7r.exports=A8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(A8e,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 w7r=I((y8e,x7r)=>{p();(function(t,e,r){typeof y8e=="object"?x7r.exports=y8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(y8e,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 P7r=I((E8e,R7r)=>{p();(function(t,e,r){typeof E8e=="object"?R7r.exports=E8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(E8e,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 D7r=I((_8e,k7r)=>{p();(function(t,e,r){typeof _8e=="object"?k7r.exports=_8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(_8e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var M7r=I((v8e,N7r)=>{p();(function(t,e,r){typeof v8e=="object"?N7r.exports=v8e=e(Xs(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(v8e,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 B7r=I((C8e,O7r)=>{p();(function(t,e,r){typeof C8e=="object"?O7r.exports=C8e=e(Xs(),f9(),p9(),pB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(C8e,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++],U=T[B>>>24]^w[j>>>16&255]^R[N>>>8&255]^x[L&255]^b[M++],z=T[j>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=q,L=Q,B=U,j=z}var q=(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++],U=(P[B>>>24]<<24|P[j>>>16&255]<<16|P[N>>>8&255]<<8|P[L&255])^b[M++],z=(P[j>>>24]<<24|P[N>>>16&255]<<16|P[L>>>8&255]<<8|P[B&255])^b[M++];_[v]=q,_[v+1]=Q,_[v+2]=U,_[v+3]=z},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var F7r=I((b8e,L7r)=>{p();(function(t,e,r){typeof b8e=="object"?L7r.exports=b8e=e(Xs(),f9(),p9(),pB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(b8e,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 Q7r=I((S8e,U7r)=>{p();(function(t,e,r){typeof S8e=="object"?U7r.exports=S8e=e(Xs(),f9(),p9(),pB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(S8e,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 j7r=I((T8e,q7r)=>{p();(function(t,e,r){typeof T8e=="object"?q7r.exports=T8e=e(Xs(),f9(),p9(),pB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(T8e,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 G7r=I((I8e,H7r)=>{p();(function(t,e,r){typeof I8e=="object"?H7r.exports=I8e=e(Xs(),f9(),p9(),pB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(I8e,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 V7r=I((x8e,$7r)=>{p();(function(t,e,r){typeof x8e=="object"?$7r.exports=x8e=e(Xs(),f9(),p9(),pB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(x8e,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 w8e=="object"?W7r.exports=w8e=e(Xs(),F_e(),GUr(),VUr(),f9(),YUr(),p9(),Jxt(),e8e(),e7r(),Zxt(),n7r(),o7r(),a7r(),a8e(),u7r(),pB(),w0(),h7r(),g7r(),y7r(),_7r(),C7r(),S7r(),I7r(),w7r(),P7r(),D7r(),M7r(),B7r(),F7r(),Q7r(),j7r(),G7r(),V7r()):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)})(w8e,function(t){return t})});var Pie=I(Ty=>{"use strict";p();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.stringArray=Ty.array=Ty.func=Ty.error=Ty.number=Ty.string=Ty.boolean=void 0;function ido(t){return t===!0||t===!1}a(ido,"boolean");Ty.boolean=ido;function wjr(t){return typeof t=="string"||t instanceof String}a(wjr,"string");Ty.string=wjr;function odo(t){return typeof t=="number"||t instanceof Number}a(odo,"number");Ty.number=odo;function sdo(t){return t instanceof Error}a(sdo,"error");Ty.error=sdo;function ado(t){return typeof t=="function"}a(ado,"func");Ty.func=ado;function Rjr(t){return Array.isArray(t)}a(Rjr,"array");Ty.array=Rjr;function cdo(t){return Rjr(t)&&t.every(e=>wjr(e))}a(cdo,"stringArray");Ty.stringArray=cdo});var bRt=I(di=>{"use strict";p();Object.defineProperty(di,"__esModule",{value:!0});di.Message=di.NotificationType9=di.NotificationType8=di.NotificationType7=di.NotificationType6=di.NotificationType5=di.NotificationType4=di.NotificationType3=di.NotificationType2=di.NotificationType1=di.NotificationType0=di.NotificationType=di.RequestType9=di.RequestType8=di.RequestType7=di.RequestType6=di.RequestType5=di.RequestType4=di.RequestType3=di.RequestType2=di.RequestType1=di.RequestType=di.RequestType0=di.AbstractMessageSignature=di.ParameterStructures=di.ResponseError=di.ErrorCodes=void 0;var BV=Pie(),Xwt;(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})(Xwt||(di.ErrorCodes=Xwt={}));var eRt=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=BV.number(e)?e:Xwt.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}};di.ResponseError=eRt;var $v=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}};di.ParameterStructures=$v;$v.auto=new $v("auto");$v.byPosition=new $v("byPosition");$v.byName=new $v("byName");var Ou=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return $v.auto}};di.AbstractMessageSignature=Ou;var tRt=class extends Ou{static{a(this,"RequestType0")}constructor(e){super(e,0)}};di.RequestType0=tRt;var rRt=class extends Ou{static{a(this,"RequestType")}constructor(e,r=$v.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.RequestType=rRt;var nRt=class extends Ou{static{a(this,"RequestType1")}constructor(e,r=$v.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.RequestType1=nRt;var iRt=class extends Ou{static{a(this,"RequestType2")}constructor(e){super(e,2)}};di.RequestType2=iRt;var oRt=class extends Ou{static{a(this,"RequestType3")}constructor(e){super(e,3)}};di.RequestType3=oRt;var sRt=class extends Ou{static{a(this,"RequestType4")}constructor(e){super(e,4)}};di.RequestType4=sRt;var aRt=class extends Ou{static{a(this,"RequestType5")}constructor(e){super(e,5)}};di.RequestType5=aRt;var cRt=class extends Ou{static{a(this,"RequestType6")}constructor(e){super(e,6)}};di.RequestType6=cRt;var lRt=class extends Ou{static{a(this,"RequestType7")}constructor(e){super(e,7)}};di.RequestType7=lRt;var uRt=class extends Ou{static{a(this,"RequestType8")}constructor(e){super(e,8)}};di.RequestType8=uRt;var dRt=class extends Ou{static{a(this,"RequestType9")}constructor(e){super(e,9)}};di.RequestType9=dRt;var fRt=class extends Ou{static{a(this,"NotificationType")}constructor(e,r=$v.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.NotificationType=fRt;var pRt=class extends Ou{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};di.NotificationType0=pRt;var hRt=class extends Ou{static{a(this,"NotificationType1")}constructor(e,r=$v.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.NotificationType1=hRt;var mRt=class extends Ou{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};di.NotificationType2=mRt;var gRt=class extends Ou{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};di.NotificationType3=gRt;var ARt=class extends Ou{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};di.NotificationType4=ARt;var yRt=class extends Ou{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};di.NotificationType5=yRt;var ERt=class extends Ou{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};di.NotificationType6=ERt;var _Rt=class extends Ou{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};di.NotificationType7=_Rt;var vRt=class extends Ou{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};di.NotificationType8=vRt;var CRt=class extends Ou{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};di.NotificationType9=CRt;var Pjr;(function(t){function e(o){let s=o;return s&&BV.string(s.method)&&(BV.string(s.id)||BV.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&BV.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)&&(BV.string(s.id)||BV.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(Pjr||(di.Message=Pjr={}))});var TRt=I(w9=>{"use strict";p();var kjr;Object.defineProperty(w9,"__esModule",{value:!0});w9.LRUCache=w9.LinkedMap=w9.Touch=void 0;var Iy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Iy||(w9.Touch=Iy={}));var u6e=class{static{a(this,"LinkedMap")}constructor(){this[kjr]="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=Iy.None){let n=this._map.get(e);if(n)return r!==Iy.None&&this.touch(n,r),n.value}set(e,r,n=Iy.None){let o=this._map.get(e);if(o)o.value=r,n!==Iy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case Iy.None:this.addItemLast(o);break;case Iy.First:this.addItemFirst(o);break;case Iy.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}[(kjr=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!==Iy.First&&r!==Iy.Last)){if(r===Iy.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===Iy.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)}};w9.LinkedMap=u6e;var SRt=class extends u6e{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=Iy.AsNew){return super.get(e,r)}peek(e){return super.get(e,Iy.None)}set(e,r){return super.set(e,r,Iy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};w9.LRUCache=SRt});var Njr=I(d6e=>{"use strict";p();Object.defineProperty(d6e,"__esModule",{value:!0});d6e.Disposable=void 0;var Djr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(Djr||(d6e.Disposable=Djr={}))});var R9=I(wRt=>{"use strict";p();Object.defineProperty(wRt,"__esModule",{value:!0});var IRt;function xRt(){if(IRt===void 0)throw new Error("No runtime abstraction layer installed");return IRt}a(xRt,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");IRt=r}a(e,"install"),t.install=e})(xRt||(xRt={}));wRt.default=xRt});var Die=I(kie=>{"use strict";p();Object.defineProperty(kie,"__esModule",{value:!0});kie.Emitter=kie.Event=void 0;var ldo=R9(),Mjr;(function(t){let e={dispose(){}};t.None=function(){return e}})(Mjr||(kie.Event=Mjr={}));var RRt=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 RRt),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)}};kie.Emitter=f6e;f6e._noop=function(){}});var m6e=I(Nie=>{"use strict";p();Object.defineProperty(Nie,"__esModule",{value:!0});Nie.CancellationTokenSource=Nie.CancellationToken=void 0;var udo=R9(),ddo=Pie(),PRt=Die(),p6e;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:PRt.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:PRt.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||ddo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(p6e||(Nie.CancellationToken=p6e={}));var fdo=Object.freeze(function(t,e){let r=(0,udo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),h6e=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?fdo:(this._emitter||(this._emitter=new PRt.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},kRt=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new h6e),this._token}cancel(){this._token?this._token.cancel():this._token=p6e.Cancelled}dispose(){this._token?this._token instanceof h6e&&this._token.dispose():this._token=p6e.None}};Nie.CancellationTokenSource=kRt});var Ojr=I(Mie=>{"use strict";p();Object.defineProperty(Mie,"__esModule",{value:!0});Mie.SharedArrayReceiverStrategy=Mie.SharedArraySenderStrategy=void 0;var pdo=m6e(),ive;(function(t){t.Continue=0,t.Cancelled=1})(ive||(ive={}));var DRt=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]=ive.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,ive.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Mie.SharedArraySenderStrategy=DRt;var NRt=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===ive.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},MRt=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new NRt(e)}cancel(){}dispose(){}},ORt=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new pdo.CancellationTokenSource:new MRt(r)}};Mie.SharedArrayReceiverStrategy=ORt});var LRt=I(g6e=>{"use strict";p();Object.defineProperty(g6e,"__esModule",{value:!0});g6e.Semaphore=void 0;var hdo=R9(),BRt=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,hdo.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()}}};g6e.Semaphore=BRt});var Ljr=I(P9=>{"use strict";p();Object.defineProperty(P9,"__esModule",{value:!0});P9.ReadableStreamMessageReader=P9.AbstractMessageReader=P9.MessageReader=void 0;var URt=R9(),Oie=Pie(),FRt=Die(),mdo=LRt(),Bjr;(function(t){function e(r){let n=r;return n&&Oie.func(n.listen)&&Oie.func(n.dispose)&&Oie.func(n.onError)&&Oie.func(n.onClose)&&Oie.func(n.onPartialMessage)}a(e,"is"),t.is=e})(Bjr||(P9.MessageReader=Bjr={}));var A6e=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new FRt.Emitter,this.closeEmitter=new FRt.Emitter,this.partialMessageEmitter=new FRt.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: ${Oie.string(e.message)?e.message:"unknown"}`)}};P9.AbstractMessageReader=A6e;var QRt;(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,URt.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(QRt||(QRt={}));var qRt=class extends A6e{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=QRt.fromOptions(r),this.buffer=(0,URt.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new mdo.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,URt.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))}};P9.ReadableStreamMessageReader=qRt});var jjr=I(k9=>{"use strict";p();Object.defineProperty(k9,"__esModule",{value:!0});k9.WriteableStreamMessageWriter=k9.AbstractMessageWriter=k9.MessageWriter=void 0;var Fjr=R9(),ove=Pie(),gdo=LRt(),Ujr=Die(),Ado="Content-Length: ",Qjr=`\r +`,qjr;(function(t){function e(r){let n=r;return n&&ove.func(n.dispose)&&ove.func(n.onClose)&&ove.func(n.onError)&&ove.func(n.write)}a(e,"is"),t.is=e})(qjr||(k9.MessageWriter=qjr={}));var y6e=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new Ujr.Emitter,this.closeEmitter=new Ujr.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: ${ove.string(e.message)?e.message:"unknown"}`)}};k9.AbstractMessageWriter=y6e;var jRt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,Fjr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,Fjr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(jRt||(jRt={}));var HRt=class extends y6e{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=jRt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new gdo.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(Ado,n.byteLength.toString(),Qjr),o.push(Qjr),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()}};k9.WriteableStreamMessageWriter=HRt});var Hjr=I(E6e=>{"use strict";p();Object.defineProperty(E6e,"__esModule",{value:!0});E6e.AbstractMessageBuffer=void 0;var ydo=13,Edo=10,_do=`\r +`,GRt=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}};E6e.AbstractMessageBuffer=GRt});var zjr=I(Do=>{"use strict";p();Object.defineProperty(Do,"__esModule",{value:!0});Do.createMessageConnection=Do.ConnectionOptions=Do.MessageStrategy=Do.CancellationStrategy=Do.CancellationSenderStrategy=Do.CancellationReceiverStrategy=Do.RequestCancellationReceiverStrategy=Do.IdCancellationReceiverStrategy=Do.ConnectionStrategy=Do.ConnectionError=Do.ConnectionErrors=Do.LogTraceNotification=Do.SetTraceNotification=Do.TraceFormat=Do.TraceValues=Do.Trace=Do.NullLogger=Do.ProgressType=Do.ProgressToken=void 0;var Gjr=R9(),Zd=Pie(),$i=bRt(),$jr=TRt(),sve=Die(),$Rt=m6e(),lve;(function(t){t.type=new $i.NotificationType("$/cancelRequest")})(lve||(lve={}));var VRt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(VRt||(Do.ProgressToken=VRt={}));var ave;(function(t){t.type=new $i.NotificationType("$/progress")})(ave||(ave={}));var WRt=class{static{a(this,"ProgressType")}constructor(){}};Do.ProgressType=WRt;var zRt;(function(t){function e(r){return Zd.func(r)}a(e,"is"),t.is=e})(zRt||(zRt={}));Do.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var Ac;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ac||(Do.Trace=Ac={}));var Vjr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(Vjr||(Do.TraceValues=Vjr={}));(function(t){function e(n){if(!Zd.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})(Ac||(Do.Trace=Ac={}));var b1;(function(t){t.Text="text",t.JSON="json"})(b1||(Do.TraceFormat=b1={}));(function(t){function e(r){return Zd.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(b1||(Do.TraceFormat=b1={}));var YRt;(function(t){t.type=new $i.NotificationType("$/setTrace")})(YRt||(Do.SetTraceNotification=YRt={}));var _6e;(function(t){t.type=new $i.NotificationType("$/logTrace")})(_6e||(Do.LogTraceNotification=_6e={}));var cve;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(cve||(Do.ConnectionErrors=cve={}));var Bie=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Do.ConnectionError=Bie;var KRt;(function(t){function e(r){let n=r;return n&&Zd.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(KRt||(Do.ConnectionStrategy=KRt={}));var v6e;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Zd.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Zd.func(n.dispose))}a(e,"is"),t.is=e})(v6e||(Do.IdCancellationReceiverStrategy=v6e={}));var JRt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Zd.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Zd.func(n.dispose))}a(e,"is"),t.is=e})(JRt||(Do.RequestCancellationReceiverStrategy=JRt={}));var C6e;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new $Rt.CancellationTokenSource}});function e(r){return v6e.is(r)||JRt.is(r)}a(e,"is"),t.is=e})(C6e||(Do.CancellationReceiverStrategy=C6e={}));var b6e;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(lve.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Zd.func(n.sendCancellation)&&Zd.func(n.cleanup)}a(e,"is"),t.is=e})(b6e||(Do.CancellationSenderStrategy=b6e={}));var S6e;(function(t){t.Message=Object.freeze({receiver:C6e.Message,sender:b6e.Message});function e(r){let n=r;return n&&C6e.is(n.receiver)&&b6e.is(n.sender)}a(e,"is"),t.is=e})(S6e||(Do.CancellationStrategy=S6e={}));var T6e;(function(t){function e(r){let n=r;return n&&Zd.func(n.handleMessage)}a(e,"is"),t.is=e})(T6e||(Do.MessageStrategy=T6e={}));var Wjr;(function(t){function e(r){let n=r;return n&&(S6e.is(n.cancellationStrategy)||KRt.is(n.connectionStrategy)||T6e.is(n.messageStrategy))}a(e,"is"),t.is=e})(Wjr||(Do.ConnectionOptions=Wjr={}));var pP;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(pP||(pP={}));function vdo(t,e,r,n){let o=r!==void 0?r:Do.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new $jr.LinkedMap,E=new Map,_=new Set,v=new Map,b=Ac.Off,T=b1.Text,w,R=pP.New,x=new sve.Emitter,P=new sve.Emitter,D=new sve.Emitter,N=new sve.Emitter,L=new sve.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:S6e.Message;function j(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(j,"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 q(Ie,F){$i.Message.isRequest(F)?Ie.set(j(F.id),F):$i.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(q,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===pP.Listening}a(U,"isListening");function z(){return R===pP.Closed}a(z,"isClosed");function W(){return R===pP.Disposed}a(W,"isDisposed");function $(){(R===pP.New||R===pP.Listening)&&(R=pP.Closed,P.fire(void 0))}a($,"closeHandler");function J(Ie){x.fire([Ie,void 0,void 0])}a(J,"readErrorHandler");function ne(Ie){x.fire(Ie)}a(ne,"writeErrorHandler"),t.onClose($),t.onError(J),e.onClose($),e.onError(ne);function H(){A||y.size===0||(A=(0,Gjr.default)().timer.setImmediate(()=>{A=void 0,ae()}))}a(H,"triggerMessageQueue");function re(Ie){$i.Message.isRequest(Ie)?ve(Ie):$i.Message.isNotification(Ie)?Pe(Ie):$i.Message.isResponse(Ie)?Fe(Ie):Z(Ie)}a(re,"handleMessage");function ae(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;T6e.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(ae,"processMessageQueue");let Oe=a(Ie=>{try{if($i.Message.isNotification(Ie)&&Ie.method===lve.type.method){let F=Ie.params.id,be=j(F),Ue=y.get(be);if($i.Message.isRequest(Ue)){let Se=n?.connectionStrategy,Le=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Ue,Q):void 0;if(Le&&(Le.error!==void 0||Le.result!==void 0)){y.delete(be),v.delete(F),Le.id=Ue.id,X(Le,Ie.method,Date.now()),e.write(Le).catch(()=>o.error("Sending response for canceled message failed."));return}}let de=v.get(F);if(de!==void 0){de.cancel(),qe(Ie);return}else _.add(F)}q(y,Ie)}finally{H()}},"callback");function ve(Ie){if(W())return;function F(Te,Ge,Y){let se={jsonrpc:u,id:Ie.id};Te instanceof $i.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,Y){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Ue(Te,Ge,Y){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(Ue,"replySuccess"),ue(Ie);let de=f.get(Ie.method),Se,Le;de&&(Se=de.type,Le=de.handler);let te=Date.now();if(Le||d){let Te=Ie.id??String(Date.now()),Ge=v6e.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 Y;if(Le)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}Y=Le(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===$i.ParameterStructures.byName){be(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}Y=Le(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===$i.ParameterStructures.byPosition){be(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}Y=Le(Ie.params,Ge.token)}else d&&(Y=d(Ie.method,Ie.params,Ge.token));let se=Y;Y?se.then?se.then(pe=>{v.delete(Te),F(pe,Ie.method,te)},pe=>{v.delete(Te),pe instanceof $i.ResponseError?be(pe,Ie.method,te):pe&&Zd.string(pe.message)?be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${pe.message}`),Ie.method,te):be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(Y,Ie.method,te)):(v.delete(Te),Ue(Y,Ie.method,te))}catch(Y){v.delete(Te),Y instanceof $i.ResponseError?F(Y,Ie.method,te):Y&&Zd.string(Y.message)?be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${Y.message}`),Ie.method,te):be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new $i.ResponseError($i.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ve,"handleRequest");function Fe(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(ie(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Ue=Ie.error;be.reject(new $i.ResponseError(Ue.code,Ue.message,Ue.data))}else if(Ie.result!==void 0)be.resolve(Ie.result);else throw new Error("Should never happen.")}catch(Ue){Ue.message?o.error(`Response handler '${be.method}' failed with message: ${Ue.message}`):o.error(`Response handler '${be.method}' failed unexpectedly.`)}}}}a(Fe,"handleResponse");function Pe(Ie){if(W())return;let F,be;if(Ie.method===lve.type.method){let Ue=Ie.params.id;_.delete(Ue),qe(Ie);return}else{let Ue=m.get(Ie.method);Ue&&(be=Ue.handler,F=Ue.type)}if(be||h)try{if(qe(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==$i.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received none.`),be();else if(Array.isArray(Ie.params)){let Ue=Ie.params;Ie.method===ave.type.method&&Ue.length===2&&VRt.is(Ue[0])?be({token:Ue[0],value:Ue[1]}):(F!==void 0&&(F.parameterStructures===$i.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 ${Ue.length} arguments`)),be(...Ue))}else F!==void 0&&F.parameterStructures===$i.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(Ue){Ue.message?o.error(`Notification handler '${Ie.method}' failed with message: ${Ue.message}`):o.error(`Notification handler '${Ie.method}' failed unexpectedly.`)}else D.fire(Ie)}a(Pe,"handleNotification");function Z(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(Zd.string(F.id)||Zd.number(F.id)){let be=F.id,Ue=E.get(be);Ue&&Ue.reject(new Error("The received response has neither a result nor an error property."))}}a(Z,"handleInvalidMessage");function ee(Ie){if(Ie!=null)switch(b){case Ac.Verbose:return JSON.stringify(Ie,null,4);case Ac.Compact:return JSON.stringify(Ie);default:return}}a(ee,"stringifyTrace");function K(Ie){if(!(b===Ac.Off||!w))if(T===b1.Text){let F;(b===Ac.Verbose||b===Ac.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} -`),w.log(`Sending request '${Ee.method} - (${Ee.id})'.`,Qe)}else se("send-request",Ee)}a(z,"traceSendingRequest");function le(Ee){if(!(b===Ec.Off||!w))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&(Ee.params?Qe=`Params: ${J(Ee.params)} +`),w.log(`Sending request '${Ie.method} - (${Ie.id})'.`,F)}else le("send-request",Ie)}a(K,"traceSendingRequest");function fe(Ie){if(!(b===Ac.Off||!w))if(T===b1.Text){let F;(b===Ac.Verbose||b===Ac.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} -`:Qe=`No parameters provided. +`:F=`No parameters provided. -`),w.log(`Sending notification '${Ee.method}'.`,Qe)}else se("send-notification",Ee)}a(le,"traceSendingNotification");function K(Ee,Qe,nt){if(!(b===Ec.Off||!w))if(T===P1.Text){let mt;(b===Ec.Verbose||b===Ec.Compact)&&(Ee.error&&Ee.error.data?mt=`Error data: ${J(Ee.error.data)} +`),w.log(`Sending notification '${Ie.method}'.`,F)}else le("send-notification",Ie)}a(fe,"traceSendingNotification");function X(Ie,F,be){if(!(b===Ac.Off||!w))if(T===b1.Text){let Ue;(b===Ac.Verbose||b===Ac.Compact)&&(Ie.error&&Ie.error.data?Ue=`Error data: ${ee(Ie.error.data)} -`:Ee.result?mt=`Result: ${J(Ee.result)} +`:Ie.result?Ue=`Result: ${ee(Ie.result)} -`:Ee.error===void 0&&(mt=`No result returned. +`:Ie.error===void 0&&(Ue=`No result returned. -`)),w.log(`Sending response '${Qe} - (${Ee.id})'. Processing request took ${Date.now()-nt}ms`,mt)}else se("send-response",Ee)}a(K,"traceSendingResponse");function ae(Ee){if(!(b===Ec.Off||!w))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&Ee.params&&(Qe=`Params: ${J(Ee.params)} +`)),w.log(`Sending response '${F} - (${Ie.id})'. Processing request took ${Date.now()-be}ms`,Ue)}else le("send-response",Ie)}a(X,"traceSendingResponse");function ue(Ie){if(!(b===Ac.Off||!w))if(T===b1.Text){let F;(b===Ac.Verbose||b===Ac.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} -`),w.log(`Received request '${Ee.method} - (${Ee.id})'.`,Qe)}else se("receive-request",Ee)}a(ae,"traceReceivedRequest");function Me(Ee){if(!(b===Ec.Off||!w||Ee.method===z6e.type.method))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&(Ee.params?Qe=`Params: ${J(Ee.params)} +`),w.log(`Received request '${Ie.method} - (${Ie.id})'.`,F)}else le("receive-request",Ie)}a(ue,"traceReceivedRequest");function qe(Ie){if(!(b===Ac.Off||!w||Ie.method===_6e.type.method))if(T===b1.Text){let F;(b===Ac.Verbose||b===Ac.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} -`:Qe=`No parameters provided. +`:F=`No parameters provided. -`),w.log(`Received notification '${Ee.method}'.`,Qe)}else se("receive-notification",Ee)}a(Me,"traceReceivedNotification");function ne(Ee,Qe){if(!(b===Ec.Off||!w))if(T===P1.Text){let nt;if((b===Ec.Verbose||b===Ec.Compact)&&(Ee.error&&Ee.error.data?nt=`Error data: ${J(Ee.error.data)} +`),w.log(`Received notification '${Ie.method}'.`,F)}else le("receive-notification",Ie)}a(qe,"traceReceivedNotification");function ie(Ie,F){if(!(b===Ac.Off||!w))if(T===b1.Text){let be;if((b===Ac.Verbose||b===Ac.Compact)&&(Ie.error&&Ie.error.data?be=`Error data: ${ee(Ie.error.data)} -`:Ee.result?nt=`Result: ${J(Ee.result)} +`:Ie.result?be=`Result: ${ee(Ie.result)} -`:Ee.error===void 0&&(nt=`No result returned. +`:Ie.error===void 0&&(be=`No result returned. -`)),Qe){let mt=Ee.error?` Request failed: ${Ee.error.message} (${Ee.error.code}).`:"";w.log(`Received response '${Qe.method} - (${Ee.id})' in ${Date.now()-Qe.timerStart}ms.${mt}`,nt)}else w.log(`Received response ${Ee.id} without active response promise.`,nt)}else se("receive-response",Ee)}a(ne,"traceReceivedResponse");function se(Ee,Qe){if(!w||b===Ec.Off)return;let nt={isLSPMessage:!0,type:Ee,message:Qe,timestamp:Date.now()};w.log(nt)}a(se,"logLSPMessage");function Ie(){if(W())throw new Xie(PCe.Closed,"Connection is closed.");if(V())throw new Xie(PCe.Disposed,"Connection is disposed.")}a(Ie,"throwIfClosedOrDisposed");function _e(){if(U())throw new Xie(PCe.AlreadyListening,"Connection is already listening")}a(_e,"throwIfListening");function Re(){if(!U())throw new Error("Call listen() first.")}a(Re,"throwIfNotListening");function Je(Ee){return Ee===void 0?null:Ee}a(Je,"undefinedToNull");function Xe(Ee){if(Ee!==null)return Ee}a(Xe,"nullToUndefined");function Ct(Ee){return Ee!=null&&!Array.isArray(Ee)&&typeof Ee=="object"}a(Ct,"isNamedParam");function Ot(Ee,Qe){switch(Ee){case Wi.ParameterStructures.auto:return Ct(Qe)?Xe(Qe):[Je(Qe)];case Wi.ParameterStructures.byName:if(!Ct(Qe))throw new Error("Received parameters by name but param is not an object literal.");return Xe(Qe);case Wi.ParameterStructures.byPosition:return[Je(Qe)];default:throw new Error(`Unknown parameter structure ${Ee.toString()}`)}}a(Ot,"computeSingleParam");function $t(Ee,Qe){let nt,mt=Ee.numberOfParams;switch(mt){case 0:nt=void 0;break;case 1:nt=Ot(Ee.parameterStructures,Qe[0]);break;default:nt=[];for(let xe=0;xe{Ie();let nt,mt;if(ef.string(Ee)){nt=Ee;let He=Qe[0],Ze=0,at=Wi.ParameterStructures.auto;Wi.ParameterStructures.is(He)&&(Ze=1,at=He);let ct=Qe.length,ut=ct-Ze;switch(ut){case 0:mt=void 0;break;case 1:mt=Ot(at,Qe[Ze]);break;default:if(at===Wi.ParameterStructures.byName)throw new Error(`Received ${ut} parameters for 'by Name' notification parameter structure.`);mt=Qe.slice(Ze,ct).map(ee=>Je(ee));break}}else{let He=Qe;nt=Ee.method,mt=$t(Ee,He)}let xe={jsonrpc:u,method:nt,params:mt};return le(xe),e.write(xe).catch(He=>{throw o.error("Sending notification failed."),He})},"sendNotification"),onNotification:a((Ee,Qe)=>{Ie();let nt;return ef.func(Ee)?h=Ee:Qe&&(ef.string(Ee)?(nt=Ee,m.set(Ee,{type:void 0,handler:Qe})):(nt=Ee.method,m.set(Ee.method,{type:Ee,handler:Qe}))),{dispose:a(()=>{nt!==void 0?m.delete(nt):h=void 0},"dispose")}},"onNotification"),onProgress:a((Ee,Qe,nt)=>{if(g.has(Qe))throw new Error(`Progress handler for token ${Qe} already registered`);return g.set(Qe,nt),{dispose:a(()=>{g.delete(Qe)},"dispose")}},"onProgress"),sendProgress:a((Ee,Qe,nt)=>Gt.sendNotification(kCe.type,{token:Qe,value:nt}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ee,...Qe)=>{Ie(),Re();let nt,mt,xe;if(ef.string(Ee)){nt=Ee;let ct=Qe[0],ut=Qe[Qe.length-1],ee=0,pe=Wi.ParameterStructures.auto;Wi.ParameterStructures.is(ct)&&(ee=1,pe=ct);let ke=Qe.length;xkt.CancellationToken.is(ut)&&(ke=ke-1,xe=ut);let Le=ke-ee;switch(Le){case 0:mt=void 0;break;case 1:mt=Ot(pe,Qe[ee]);break;default:if(pe===Wi.ParameterStructures.byName)throw new Error(`Received ${Le} parameters for 'by Name' request parameter structure.`);mt=Qe.slice(ee,ke).map(Ve=>Je(Ve));break}}else{let ct=Qe;nt=Ee.method,mt=$t(Ee,ct);let ut=Ee.numberOfParams;xe=xkt.CancellationToken.is(ct[ut])?ct[ut]:void 0}let He=s++,Ze;xe&&(Ze=xe.onCancellationRequested(()=>{let ct=B.sender.sendCancellation(Gt,He);return ct===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${He}`),Promise.resolve()):ct.catch(()=>{o.log(`Sending cancellation messages for id ${He} failed`)})}));let at={jsonrpc:u,id:He,method:nt,params:mt};return z(at),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(at),new Promise(async(ct,ut)=>{let ee=a(Le=>{ct(Le),B.sender.cleanup(He),Ze?.dispose()},"resolveWithCleanup"),pe=a(Le=>{ut(Le),B.sender.cleanup(He),Ze?.dispose()},"rejectWithCleanup"),ke={method:nt,timerStart:Date.now(),resolve:ee,reject:pe};try{await e.write(at),E.set(He,ke)}catch(Le){throw o.error("Sending request failed."),ke.reject(new Wi.ResponseError(Wi.ErrorCodes.MessageWriteError,Le.message?Le.message:"Unknown reason")),Le}})},"sendRequest"),onRequest:a((Ee,Qe)=>{Ie();let nt=null;return kkt.is(Ee)?(nt=void 0,d=Ee):ef.string(Ee)?(nt=null,Qe!==void 0&&(nt=Ee,f.set(Ee,{handler:Qe,type:void 0}))):Qe!==void 0&&(nt=Ee.method,f.set(Ee.method,{type:Ee,handler:Qe})),{dispose:a(()=>{nt!==null&&(nt!==void 0?f.delete(nt):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>E.size>0,"hasPendingResponse"),trace:a(async(Ee,Qe,nt)=>{let mt=!1,xe=P1.Text;nt!==void 0&&(ef.boolean(nt)?mt=nt:(mt=nt.sendNotification||!1,xe=nt.traceFormat||P1.Text)),b=Ee,T=xe,b===Ec.Off?w=void 0:w=Qe,mt&&!W()&&!V()&&await Gt.sendNotification(Pkt.type,{value:Ec.toString(Ee)})},"trace"),onError:x.event,onClose:k.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(V())return;R=_k.Disposed,L.fire(void 0);let Ee=new Wi.ResponseError(Wi.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let Qe of E.values())Qe.reject(Ee);E=new Map,v=new Map,_=new Set,y=new YHr.LinkedMap,ef.func(e.dispose)&&e.dispose(),ef.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ie(),_e(),R=_k.Listening,t.listen(we)},"listen"),inspect:a(()=>{(0,zHr.default)().console.log("inspect")},"inspect")};return Gt.onNotification(z6e.type,Ee=>{if(b===Ec.Off||!w)return;let Qe=b===Ec.Verbose||b===Ec.Compact;w.log(Ee.message,Qe?Ee.verbose:void 0)}),Gt.onNotification(kCe.type,Ee=>{let Qe=g.get(Ee.token);Qe?Qe(Ee.value):N.fire(Ee)}),Gt}a(Gfo,"createMessageConnection");Mo.createMessageConnection=Gfo});var e9e=I(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.ProgressType=Mt.ProgressToken=Mt.createMessageConnection=Mt.NullLogger=Mt.ConnectionOptions=Mt.ConnectionStrategy=Mt.AbstractMessageBuffer=Mt.WriteableStreamMessageWriter=Mt.AbstractMessageWriter=Mt.MessageWriter=Mt.ReadableStreamMessageReader=Mt.AbstractMessageReader=Mt.MessageReader=Mt.SharedArrayReceiverStrategy=Mt.SharedArraySenderStrategy=Mt.CancellationToken=Mt.CancellationTokenSource=Mt.Emitter=Mt.Event=Mt.Disposable=Mt.LRUCache=Mt.Touch=Mt.LinkedMap=Mt.ParameterStructures=Mt.NotificationType9=Mt.NotificationType8=Mt.NotificationType7=Mt.NotificationType6=Mt.NotificationType5=Mt.NotificationType4=Mt.NotificationType3=Mt.NotificationType2=Mt.NotificationType1=Mt.NotificationType0=Mt.NotificationType=Mt.ErrorCodes=Mt.ResponseError=Mt.RequestType9=Mt.RequestType8=Mt.RequestType7=Mt.RequestType6=Mt.RequestType5=Mt.RequestType4=Mt.RequestType3=Mt.RequestType2=Mt.RequestType1=Mt.RequestType0=Mt.RequestType=Mt.Message=Mt.RAL=void 0;Mt.MessageStrategy=Mt.CancellationStrategy=Mt.CancellationSenderStrategy=Mt.CancellationReceiverStrategy=Mt.ConnectionError=Mt.ConnectionErrors=Mt.LogTraceNotification=Mt.SetTraceNotification=Mt.TraceFormat=Mt.TraceValues=Mt.Trace=void 0;var ru=okt();Object.defineProperty(Mt,"Message",{enumerable:!0,get:a(function(){return ru.Message},"get")});Object.defineProperty(Mt,"RequestType",{enumerable:!0,get:a(function(){return ru.RequestType},"get")});Object.defineProperty(Mt,"RequestType0",{enumerable:!0,get:a(function(){return ru.RequestType0},"get")});Object.defineProperty(Mt,"RequestType1",{enumerable:!0,get:a(function(){return ru.RequestType1},"get")});Object.defineProperty(Mt,"RequestType2",{enumerable:!0,get:a(function(){return ru.RequestType2},"get")});Object.defineProperty(Mt,"RequestType3",{enumerable:!0,get:a(function(){return ru.RequestType3},"get")});Object.defineProperty(Mt,"RequestType4",{enumerable:!0,get:a(function(){return ru.RequestType4},"get")});Object.defineProperty(Mt,"RequestType5",{enumerable:!0,get:a(function(){return ru.RequestType5},"get")});Object.defineProperty(Mt,"RequestType6",{enumerable:!0,get:a(function(){return ru.RequestType6},"get")});Object.defineProperty(Mt,"RequestType7",{enumerable:!0,get:a(function(){return ru.RequestType7},"get")});Object.defineProperty(Mt,"RequestType8",{enumerable:!0,get:a(function(){return ru.RequestType8},"get")});Object.defineProperty(Mt,"RequestType9",{enumerable:!0,get:a(function(){return ru.RequestType9},"get")});Object.defineProperty(Mt,"ResponseError",{enumerable:!0,get:a(function(){return ru.ResponseError},"get")});Object.defineProperty(Mt,"ErrorCodes",{enumerable:!0,get:a(function(){return ru.ErrorCodes},"get")});Object.defineProperty(Mt,"NotificationType",{enumerable:!0,get:a(function(){return ru.NotificationType},"get")});Object.defineProperty(Mt,"NotificationType0",{enumerable:!0,get:a(function(){return ru.NotificationType0},"get")});Object.defineProperty(Mt,"NotificationType1",{enumerable:!0,get:a(function(){return ru.NotificationType1},"get")});Object.defineProperty(Mt,"NotificationType2",{enumerable:!0,get:a(function(){return ru.NotificationType2},"get")});Object.defineProperty(Mt,"NotificationType3",{enumerable:!0,get:a(function(){return ru.NotificationType3},"get")});Object.defineProperty(Mt,"NotificationType4",{enumerable:!0,get:a(function(){return ru.NotificationType4},"get")});Object.defineProperty(Mt,"NotificationType5",{enumerable:!0,get:a(function(){return ru.NotificationType5},"get")});Object.defineProperty(Mt,"NotificationType6",{enumerable:!0,get:a(function(){return ru.NotificationType6},"get")});Object.defineProperty(Mt,"NotificationType7",{enumerable:!0,get:a(function(){return ru.NotificationType7},"get")});Object.defineProperty(Mt,"NotificationType8",{enumerable:!0,get:a(function(){return ru.NotificationType8},"get")});Object.defineProperty(Mt,"NotificationType9",{enumerable:!0,get:a(function(){return ru.NotificationType9},"get")});Object.defineProperty(Mt,"ParameterStructures",{enumerable:!0,get:a(function(){return ru.ParameterStructures},"get")});var Mkt=akt();Object.defineProperty(Mt,"LinkedMap",{enumerable:!0,get:a(function(){return Mkt.LinkedMap},"get")});Object.defineProperty(Mt,"LRUCache",{enumerable:!0,get:a(function(){return Mkt.LRUCache},"get")});Object.defineProperty(Mt,"Touch",{enumerable:!0,get:a(function(){return Mkt.Touch},"get")});var $fo=LHr();Object.defineProperty(Mt,"Disposable",{enumerable:!0,get:a(function(){return $fo.Disposable},"get")});var XHr=Yie();Object.defineProperty(Mt,"Event",{enumerable:!0,get:a(function(){return XHr.Event},"get")});Object.defineProperty(Mt,"Emitter",{enumerable:!0,get:a(function(){return XHr.Emitter},"get")});var eGr=H6e();Object.defineProperty(Mt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return eGr.CancellationTokenSource},"get")});Object.defineProperty(Mt,"CancellationToken",{enumerable:!0,get:a(function(){return eGr.CancellationToken},"get")});var tGr=UHr();Object.defineProperty(Mt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return tGr.SharedArraySenderStrategy},"get")});Object.defineProperty(Mt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return tGr.SharedArrayReceiverStrategy},"get")});var Okt=qHr();Object.defineProperty(Mt,"MessageReader",{enumerable:!0,get:a(function(){return Okt.MessageReader},"get")});Object.defineProperty(Mt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return Okt.AbstractMessageReader},"get")});Object.defineProperty(Mt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return Okt.ReadableStreamMessageReader},"get")});var Bkt=VHr();Object.defineProperty(Mt,"MessageWriter",{enumerable:!0,get:a(function(){return Bkt.MessageWriter},"get")});Object.defineProperty(Mt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return Bkt.AbstractMessageWriter},"get")});Object.defineProperty(Mt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return Bkt.WriteableStreamMessageWriter},"get")});var Vfo=WHr();Object.defineProperty(Mt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return Vfo.AbstractMessageBuffer},"get")});var Kg=ZHr();Object.defineProperty(Mt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return Kg.ConnectionStrategy},"get")});Object.defineProperty(Mt,"ConnectionOptions",{enumerable:!0,get:a(function(){return Kg.ConnectionOptions},"get")});Object.defineProperty(Mt,"NullLogger",{enumerable:!0,get:a(function(){return Kg.NullLogger},"get")});Object.defineProperty(Mt,"createMessageConnection",{enumerable:!0,get:a(function(){return Kg.createMessageConnection},"get")});Object.defineProperty(Mt,"ProgressToken",{enumerable:!0,get:a(function(){return Kg.ProgressToken},"get")});Object.defineProperty(Mt,"ProgressType",{enumerable:!0,get:a(function(){return Kg.ProgressType},"get")});Object.defineProperty(Mt,"Trace",{enumerable:!0,get:a(function(){return Kg.Trace},"get")});Object.defineProperty(Mt,"TraceValues",{enumerable:!0,get:a(function(){return Kg.TraceValues},"get")});Object.defineProperty(Mt,"TraceFormat",{enumerable:!0,get:a(function(){return Kg.TraceFormat},"get")});Object.defineProperty(Mt,"SetTraceNotification",{enumerable:!0,get:a(function(){return Kg.SetTraceNotification},"get")});Object.defineProperty(Mt,"LogTraceNotification",{enumerable:!0,get:a(function(){return Kg.LogTraceNotification},"get")});Object.defineProperty(Mt,"ConnectionErrors",{enumerable:!0,get:a(function(){return Kg.ConnectionErrors},"get")});Object.defineProperty(Mt,"ConnectionError",{enumerable:!0,get:a(function(){return Kg.ConnectionError},"get")});Object.defineProperty(Mt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return Kg.CancellationReceiverStrategy},"get")});Object.defineProperty(Mt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return Kg.CancellationSenderStrategy},"get")});Object.defineProperty(Mt,"CancellationStrategy",{enumerable:!0,get:a(function(){return Kg.CancellationStrategy},"get")});Object.defineProperty(Mt,"MessageStrategy",{enumerable:!0,get:a(function(){return Kg.MessageStrategy},"get")});var Wfo=H9();Mt.RAL=Wfo.default});var iGr=I(Qkt=>{"use strict";p();Object.defineProperty(Qkt,"__esModule",{value:!0});var rGr=require("util"),qB=e9e(),t9e=class t extends qB.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 rGr.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)}};t9e.emptyBuffer=Buffer.allocUnsafe(0);var Lkt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),qB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),qB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),qB.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),qB.Disposable.create(()=>this.stream.off("data",e))}},Fkt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),qB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),qB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),qB.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()}},nGr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new t9e(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 rGr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new Lkt(t),"asReadableStream"),asWritableStream:a(t=>new Fkt(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 Ukt(){return nGr}a(Ukt,"RIL");(function(t){function e(){qB.RAL.install(nGr)}a(e,"install"),t.install=e})(Ukt||(Ukt={}));Qkt.default=Ukt});var nW=I(Ta=>{"use strict";p();var zfo=Ta&&Ta.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yfo=Ta&&Ta.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zfo(e,t,r)};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.createMessageConnection=Ta.createServerSocketTransport=Ta.createClientSocketTransport=Ta.createServerPipeTransport=Ta.createClientPipeTransport=Ta.generateRandomPipeName=Ta.StreamMessageWriter=Ta.StreamMessageReader=Ta.SocketMessageWriter=Ta.SocketMessageReader=Ta.PortMessageWriter=Ta.PortMessageReader=Ta.IPCMessageWriter=Ta.IPCMessageReader=void 0;var eoe=iGr();eoe.default.install();var oGr=require("path"),Kfo=require("os"),Jfo=require("crypto"),i9e=require("net"),D1=e9e();Yfo(e9e(),Ta);var qkt=class extends D1.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),D1.Disposable.create(()=>this.process.off("message",e))}};Ta.IPCMessageReader=qkt;var jkt=class extends D1.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(){}};Ta.IPCMessageWriter=jkt;var Hkt=class extends D1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new D1.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)}};Ta.PortMessageReader=Hkt;var Gkt=class extends D1.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(){}};Ta.PortMessageWriter=Gkt;var tW=class extends D1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,eoe.default)().stream.asReadableStream(e),r)}};Ta.SocketMessageReader=tW;var rW=class extends D1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,eoe.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ta.SocketMessageWriter=rW;var r9e=class extends D1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,eoe.default)().stream.asReadableStream(e),r)}};Ta.StreamMessageReader=r9e;var n9e=class extends D1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,eoe.default)().stream.asWritableStream(e),r)}};Ta.StreamMessageWriter=n9e;var sGr=process.env.XDG_RUNTIME_DIR,Zfo=new Map([["linux",107],["darwin",103]]);function Xfo(){let t=(0,Jfo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;sGr?e=oGr.join(sGr,`vscode-ipc-${t}.sock`):e=oGr.join(Kfo.tmpdir(),`vscode-${t}.sock`);let r=Zfo.get(process.platform);return r!==void 0&&e.length>r&&(0,eoe.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(Xfo,"generateRandomPipeName");Ta.generateRandomPipeName=Xfo;function epo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,i9e.createServer)(l=>{c.close(),r([new tW(l,e),new rW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(epo,"createClientPipeTransport");Ta.createClientPipeTransport=epo;function tpo(t,e="utf-8"){let r=(0,i9e.createConnection)(t);return[new tW(r,e),new rW(r,e)]}a(tpo,"createServerPipeTransport");Ta.createServerPipeTransport=tpo;function rpo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,i9e.createServer)(l=>{c.close(),r([new tW(l,e),new rW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(rpo,"createClientSocketTransport");Ta.createClientSocketTransport=rpo;function npo(t,e="utf-8"){let r=(0,i9e.createConnection)(t,"127.0.0.1");return[new tW(r,e),new rW(r,e)]}a(npo,"createServerSocketTransport");Ta.createServerSocketTransport=npo;function ipo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(ipo,"isReadableStream");function opo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(opo,"isWritableStream");function spo(t,e,r,n){r||(r=D1.NullLogger);let o=ipo(t)?new r9e(t):t,s=opo(e)?new n9e(e):e;return D1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,D1.createMessageConnection)(o,s,r,n)}a(spo,"createMessageConnection");Ta.createMessageConnection=spo});var $kt=I((jEl,aGr)=>{"use strict";p();aGr.exports=nW()});var NCe=I((cGr,o9e)=>{p();(function(t){if(typeof o9e=="object"&&typeof o9e.exports=="object"){var e=t(require,cGr);e!==void 0&&(o9e.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(oe){function ve(Se){return typeof Se=="string"}a(ve,"is"),oe.is=ve})(r||(e.DocumentUri=r={}));var n;(function(oe){function ve(Se){return typeof Se=="string"}a(ve,"is"),oe.is=ve})(n||(e.URI=n={}));var o;(function(oe){oe.MIN_VALUE=-2147483648,oe.MAX_VALUE=2147483647;function ve(Se){return typeof Se=="number"&&oe.MIN_VALUE<=Se&&Se<=oe.MAX_VALUE}a(ve,"is"),oe.is=ve})(o||(e.integer=o={}));var s;(function(oe){oe.MIN_VALUE=0,oe.MAX_VALUE=2147483647;function ve(Se){return typeof Se=="number"&&oe.MIN_VALUE<=Se&&Se<=oe.MAX_VALUE}a(ve,"is"),oe.is=ve})(s||(e.uinteger=s={}));var c;(function(oe){function ve(de,te){return de===Number.MAX_VALUE&&(de=s.MAX_VALUE),te===Number.MAX_VALUE&&(te=s.MAX_VALUE),{line:de,character:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.uinteger(te.line)&&Be.uinteger(te.character)}a(Se,"is"),oe.is=Se})(c||(e.Position=c={}));var l;(function(oe){function ve(de,te,Fe,et){if(Be.uinteger(de)&&Be.uinteger(te)&&Be.uinteger(Fe)&&Be.uinteger(et))return{start:c.create(de,te),end:c.create(Fe,et)};if(c.is(de)&&c.is(te))return{start:de,end:te};throw new Error("Range#create called with invalid arguments[".concat(de,", ").concat(te,", ").concat(Fe,", ").concat(et,"]"))}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&c.is(te.start)&&c.is(te.end)}a(Se,"is"),oe.is=Se})(l||(e.Range=l={}));var u;(function(oe){function ve(de,te){return{uri:de,range:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&l.is(te.range)&&(Be.string(te.uri)||Be.undefined(te.uri))}a(Se,"is"),oe.is=Se})(u||(e.Location=u={}));var d;(function(oe){function ve(de,te,Fe,et){return{targetUri:de,targetRange:te,targetSelectionRange:Fe,originSelectionRange:et}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&l.is(te.targetRange)&&Be.string(te.targetUri)&&l.is(te.targetSelectionRange)&&(l.is(te.originSelectionRange)||Be.undefined(te.originSelectionRange))}a(Se,"is"),oe.is=Se})(d||(e.LocationLink=d={}));var f;(function(oe){function ve(de,te,Fe,et){return{red:de,green:te,blue:Fe,alpha:et}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.numberRange(te.red,0,1)&&Be.numberRange(te.green,0,1)&&Be.numberRange(te.blue,0,1)&&Be.numberRange(te.alpha,0,1)}a(Se,"is"),oe.is=Se})(f||(e.Color=f={}));var h;(function(oe){function ve(de,te){return{range:de,color:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&l.is(te.range)&&f.is(te.color)}a(Se,"is"),oe.is=Se})(h||(e.ColorInformation=h={}));var m;(function(oe){function ve(de,te,Fe){return{label:de,textEdit:te,additionalTextEdits:Fe}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.string(te.label)&&(Be.undefined(te.textEdit)||w.is(te))&&(Be.undefined(te.additionalTextEdits)||Be.typedArray(te.additionalTextEdits,w.is))}a(Se,"is"),oe.is=Se})(m||(e.ColorPresentation=m={}));var g;(function(oe){oe.Comment="comment",oe.Imports="imports",oe.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(oe){function ve(de,te,Fe,et,Ht,mr){var or={startLine:de,endLine:te};return Be.defined(Fe)&&(or.startCharacter=Fe),Be.defined(et)&&(or.endCharacter=et),Be.defined(Ht)&&(or.kind=Ht),Be.defined(mr)&&(or.collapsedText=mr),or}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.uinteger(te.startLine)&&Be.uinteger(te.startLine)&&(Be.undefined(te.startCharacter)||Be.uinteger(te.startCharacter))&&(Be.undefined(te.endCharacter)||Be.uinteger(te.endCharacter))&&(Be.undefined(te.kind)||Be.string(te.kind))}a(Se,"is"),oe.is=Se})(A||(e.FoldingRange=A={}));var y;(function(oe){function ve(de,te){return{location:de,message:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&u.is(te.location)&&Be.string(te.message)}a(Se,"is"),oe.is=Se})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(oe){oe.Error=1,oe.Warning=2,oe.Information=3,oe.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(oe){oe.Unnecessary=1,oe.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(oe){function ve(Se){var de=Se;return Be.objectLiteral(de)&&Be.string(de.href)}a(ve,"is"),oe.is=ve})(v||(e.CodeDescription=v={}));var b;(function(oe){function ve(de,te,Fe,et,Ht,mr){var or={range:de,message:te};return Be.defined(Fe)&&(or.severity=Fe),Be.defined(et)&&(or.code=et),Be.defined(Ht)&&(or.source=Ht),Be.defined(mr)&&(or.relatedInformation=mr),or}a(ve,"create"),oe.create=ve;function Se(de){var te,Fe=de;return Be.defined(Fe)&&l.is(Fe.range)&&Be.string(Fe.message)&&(Be.number(Fe.severity)||Be.undefined(Fe.severity))&&(Be.integer(Fe.code)||Be.string(Fe.code)||Be.undefined(Fe.code))&&(Be.undefined(Fe.codeDescription)||Be.string((te=Fe.codeDescription)===null||te===void 0?void 0:te.href))&&(Be.string(Fe.source)||Be.undefined(Fe.source))&&(Be.undefined(Fe.relatedInformation)||Be.typedArray(Fe.relatedInformation,y.is))}a(Se,"is"),oe.is=Se})(b||(e.Diagnostic=b={}));var T;(function(oe){function ve(de,te){for(var Fe=[],et=2;et0&&(Ht.arguments=Fe),Ht}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.title)&&Be.string(te.command)}a(Se,"is"),oe.is=Se})(T||(e.Command=T={}));var w;(function(oe){function ve(Fe,et){return{range:Fe,newText:et}}a(ve,"replace"),oe.replace=ve;function Se(Fe,et){return{range:{start:Fe,end:Fe},newText:et}}a(Se,"insert"),oe.insert=Se;function de(Fe){return{range:Fe,newText:""}}a(de,"del"),oe.del=de;function te(Fe){var et=Fe;return Be.objectLiteral(et)&&Be.string(et.newText)&&l.is(et.range)}a(te,"is"),oe.is=te})(w||(e.TextEdit=w={}));var R;(function(oe){function ve(de,te,Fe){var et={label:de};return te!==void 0&&(et.needsConfirmation=te),Fe!==void 0&&(et.description=Fe),et}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.string(te.label)&&(Be.boolean(te.needsConfirmation)||te.needsConfirmation===void 0)&&(Be.string(te.description)||te.description===void 0)}a(Se,"is"),oe.is=Se})(R||(e.ChangeAnnotation=R={}));var x;(function(oe){function ve(Se){var de=Se;return Be.string(de)}a(ve,"is"),oe.is=ve})(x||(e.ChangeAnnotationIdentifier=x={}));var k;(function(oe){function ve(Fe,et,Ht){return{range:Fe,newText:et,annotationId:Ht}}a(ve,"replace"),oe.replace=ve;function Se(Fe,et,Ht){return{range:{start:Fe,end:Fe},newText:et,annotationId:Ht}}a(Se,"insert"),oe.insert=Se;function de(Fe,et){return{range:Fe,newText:"",annotationId:et}}a(de,"del"),oe.del=de;function te(Fe){var et=Fe;return w.is(et)&&(R.is(et.annotationId)||x.is(et.annotationId))}a(te,"is"),oe.is=te})(k||(e.AnnotatedTextEdit=k={}));var D;(function(oe){function ve(de,te){return{textDocument:de,edits:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&W.is(te.textDocument)&&Array.isArray(te.edits)}a(Se,"is"),oe.is=Se})(D||(e.TextDocumentEdit=D={}));var N;(function(oe){function ve(de,te,Fe){var et={kind:"create",uri:de};return te!==void 0&&(te.overwrite!==void 0||te.ignoreIfExists!==void 0)&&(et.options=te),Fe!==void 0&&(et.annotationId=Fe),et}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&te.kind==="create"&&Be.string(te.uri)&&(te.options===void 0||(te.options.overwrite===void 0||Be.boolean(te.options.overwrite))&&(te.options.ignoreIfExists===void 0||Be.boolean(te.options.ignoreIfExists)))&&(te.annotationId===void 0||x.is(te.annotationId))}a(Se,"is"),oe.is=Se})(N||(e.CreateFile=N={}));var L;(function(oe){function ve(de,te,Fe,et){var Ht={kind:"rename",oldUri:de,newUri:te};return Fe!==void 0&&(Fe.overwrite!==void 0||Fe.ignoreIfExists!==void 0)&&(Ht.options=Fe),et!==void 0&&(Ht.annotationId=et),Ht}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&te.kind==="rename"&&Be.string(te.oldUri)&&Be.string(te.newUri)&&(te.options===void 0||(te.options.overwrite===void 0||Be.boolean(te.options.overwrite))&&(te.options.ignoreIfExists===void 0||Be.boolean(te.options.ignoreIfExists)))&&(te.annotationId===void 0||x.is(te.annotationId))}a(Se,"is"),oe.is=Se})(L||(e.RenameFile=L={}));var B;(function(oe){function ve(de,te,Fe){var et={kind:"delete",uri:de};return te!==void 0&&(te.recursive!==void 0||te.ignoreIfNotExists!==void 0)&&(et.options=te),Fe!==void 0&&(et.annotationId=Fe),et}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&te.kind==="delete"&&Be.string(te.uri)&&(te.options===void 0||(te.options.recursive===void 0||Be.boolean(te.options.recursive))&&(te.options.ignoreIfNotExists===void 0||Be.boolean(te.options.ignoreIfNotExists)))&&(te.annotationId===void 0||x.is(te.annotationId))}a(Se,"is"),oe.is=Se})(B||(e.DeleteFile=B={}));var Q;(function(oe){function ve(Se){var de=Se;return de&&(de.changes!==void 0||de.documentChanges!==void 0)&&(de.documentChanges===void 0||de.documentChanges.every(function(te){return Be.string(te.kind)?N.is(te)||L.is(te)||B.is(te):D.is(te)}))}a(ve,"is"),oe.is=ve})(Q||(e.WorkspaceEdit=Q={}));var M=(function(){function oe(ve,Se){this.edits=ve,this.changeAnnotations=Se}return a(oe,"TextEditChangeImpl"),oe.prototype.insert=function(ve,Se,de){var te,Fe;if(de===void 0?te=w.insert(ve,Se):x.is(de)?(Fe=de,te=k.insert(ve,Se,de)):(this.assertChangeAnnotations(this.changeAnnotations),Fe=this.changeAnnotations.manage(de),te=k.insert(ve,Se,Fe)),this.edits.push(te),Fe!==void 0)return Fe},oe.prototype.replace=function(ve,Se,de){var te,Fe;if(de===void 0?te=w.replace(ve,Se):x.is(de)?(Fe=de,te=k.replace(ve,Se,de)):(this.assertChangeAnnotations(this.changeAnnotations),Fe=this.changeAnnotations.manage(de),te=k.replace(ve,Se,Fe)),this.edits.push(te),Fe!==void 0)return Fe},oe.prototype.delete=function(ve,Se){var de,te;if(Se===void 0?de=w.del(ve):x.is(Se)?(te=Se,de=k.del(ve,Se)):(this.assertChangeAnnotations(this.changeAnnotations),te=this.changeAnnotations.manage(Se),de=k.del(ve,te)),this.edits.push(de),te!==void 0)return te},oe.prototype.add=function(ve){this.edits.push(ve)},oe.prototype.all=function(){return this.edits},oe.prototype.clear=function(){this.edits.splice(0,this.edits.length)},oe.prototype.assertChangeAnnotations=function(ve){if(ve===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},oe})(),O=(function(){function oe(ve){this._annotations=ve===void 0?Object.create(null):ve,this._counter=0,this._size=0}return a(oe,"ChangeAnnotations"),oe.prototype.all=function(){return this._annotations},Object.defineProperty(oe.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),oe.prototype.manage=function(ve,Se){var de;if(x.is(ve)?de=ve:(de=this.nextId(),Se=ve),this._annotations[de]!==void 0)throw new Error("Id ".concat(de," is already in use."));if(Se===void 0)throw new Error("No annotation provided for id ".concat(de));return this._annotations[de]=Se,this._size++,de},oe.prototype.nextId=function(){return this._counter++,this._counter.toString()},oe})(),q=(function(){function oe(ve){var Se=this;this._textEditChanges=Object.create(null),ve!==void 0?(this._workspaceEdit=ve,ve.documentChanges?(this._changeAnnotations=new O(ve.changeAnnotations),ve.changeAnnotations=this._changeAnnotations.all(),ve.documentChanges.forEach(function(de){if(D.is(de)){var te=new M(de.edits,Se._changeAnnotations);Se._textEditChanges[de.textDocument.uri]=te}})):ve.changes&&Object.keys(ve.changes).forEach(function(de){var te=new M(ve.changes[de]);Se._textEditChanges[de]=te})):this._workspaceEdit={}}return a(oe,"WorkspaceChange"),Object.defineProperty(oe.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}),oe.prototype.getTextEditChange=function(ve){if(W.is(ve)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Se={uri:ve.uri,version:ve.version},de=this._textEditChanges[Se.uri];if(!de){var te=[],Fe={textDocument:Se,edits:te};this._workspaceEdit.documentChanges.push(Fe),de=new M(te,this._changeAnnotations),this._textEditChanges[Se.uri]=de}return de}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var de=this._textEditChanges[ve];if(!de){var te=[];this._workspaceEdit.changes[ve]=te,de=new M(te),this._textEditChanges[ve]=de}return de}},oe.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())},oe.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},oe.prototype.createFile=function(ve,Se,de){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var te;R.is(Se)||x.is(Se)?te=Se:de=Se;var Fe,et;if(te===void 0?Fe=N.create(ve,de):(et=x.is(te)?te:this._changeAnnotations.manage(te),Fe=N.create(ve,de,et)),this._workspaceEdit.documentChanges.push(Fe),et!==void 0)return et},oe.prototype.renameFile=function(ve,Se,de,te){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Fe;R.is(de)||x.is(de)?Fe=de:te=de;var et,Ht;if(Fe===void 0?et=L.create(ve,Se,te):(Ht=x.is(Fe)?Fe:this._changeAnnotations.manage(Fe),et=L.create(ve,Se,te,Ht)),this._workspaceEdit.documentChanges.push(et),Ht!==void 0)return Ht},oe.prototype.deleteFile=function(ve,Se,de){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var te;R.is(Se)||x.is(Se)?te=Se:de=Se;var Fe,et;if(te===void 0?Fe=B.create(ve,de):(et=x.is(te)?te:this._changeAnnotations.manage(te),Fe=B.create(ve,de,et)),this._workspaceEdit.documentChanges.push(Fe),et!==void 0)return et},oe})();e.WorkspaceChange=q;var F;(function(oe){function ve(de){return{uri:de}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)}a(Se,"is"),oe.is=Se})(F||(e.TextDocumentIdentifier=F={}));var U;(function(oe){function ve(de,te){return{uri:de,version:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)&&Be.integer(te.version)}a(Se,"is"),oe.is=Se})(U||(e.VersionedTextDocumentIdentifier=U={}));var W;(function(oe){function ve(de,te){return{uri:de,version:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)&&(te.version===null||Be.integer(te.version))}a(Se,"is"),oe.is=Se})(W||(e.OptionalVersionedTextDocumentIdentifier=W={}));var V;(function(oe){function ve(de,te,Fe,et){return{uri:de,languageId:te,version:Fe,text:et}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)&&Be.string(te.languageId)&&Be.integer(te.version)&&Be.string(te.text)}a(Se,"is"),oe.is=Se})(V||(e.TextDocumentItem=V={}));var G;(function(oe){oe.PlainText="plaintext",oe.Markdown="markdown";function ve(Se){var de=Se;return de===oe.PlainText||de===oe.Markdown}a(ve,"is"),oe.is=ve})(G||(e.MarkupKind=G={}));var Y;(function(oe){function ve(Se){var de=Se;return Be.objectLiteral(Se)&&G.is(de.kind)&&Be.string(de.value)}a(ve,"is"),oe.is=ve})(Y||(e.MarkupContent=Y={}));var re;(function(oe){oe.Text=1,oe.Method=2,oe.Function=3,oe.Constructor=4,oe.Field=5,oe.Variable=6,oe.Class=7,oe.Interface=8,oe.Module=9,oe.Property=10,oe.Unit=11,oe.Value=12,oe.Enum=13,oe.Keyword=14,oe.Snippet=15,oe.Color=16,oe.File=17,oe.Reference=18,oe.Folder=19,oe.EnumMember=20,oe.Constant=21,oe.Struct=22,oe.Event=23,oe.Operator=24,oe.TypeParameter=25})(re||(e.CompletionItemKind=re={}));var j;(function(oe){oe.PlainText=1,oe.Snippet=2})(j||(e.InsertTextFormat=j={}));var X;(function(oe){oe.Deprecated=1})(X||(e.CompletionItemTag=X={}));var ie;(function(oe){function ve(de,te,Fe){return{newText:de,insert:te,replace:Fe}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&Be.string(te.newText)&&l.is(te.insert)&&l.is(te.replace)}a(Se,"is"),oe.is=Se})(ie||(e.InsertReplaceEdit=ie={}));var we;(function(oe){oe.asIs=1,oe.adjustIndentation=2})(we||(e.InsertTextMode=we={}));var Ae;(function(oe){function ve(Se){var de=Se;return de&&(Be.string(de.detail)||de.detail===void 0)&&(Be.string(de.description)||de.description===void 0)}a(ve,"is"),oe.is=ve})(Ae||(e.CompletionItemLabelDetails=Ae={}));var De;(function(oe){function ve(Se){return{label:Se}}a(ve,"create"),oe.create=ve})(De||(e.CompletionItem=De={}));var Te;(function(oe){function ve(Se,de){return{items:Se||[],isIncomplete:!!de}}a(ve,"create"),oe.create=ve})(Te||(e.CompletionList=Te={}));var Z;(function(oe){function ve(de){return de.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(ve,"fromPlainText"),oe.fromPlainText=ve;function Se(de){var te=de;return Be.string(te)||Be.objectLiteral(te)&&Be.string(te.language)&&Be.string(te.value)}a(Se,"is"),oe.is=Se})(Z||(e.MarkedString=Z={}));var J;(function(oe){function ve(Se){var de=Se;return!!de&&Be.objectLiteral(de)&&(Y.is(de.contents)||Z.is(de.contents)||Be.typedArray(de.contents,Z.is))&&(Se.range===void 0||l.is(Se.range))}a(ve,"is"),oe.is=ve})(J||(e.Hover=J={}));var z;(function(oe){function ve(Se,de){return de?{label:Se,documentation:de}:{label:Se}}a(ve,"create"),oe.create=ve})(z||(e.ParameterInformation=z={}));var le;(function(oe){function ve(Se,de){for(var te=[],Fe=2;Fe{Ne();let be,Ue;if(Zd.string(Ie)){be=Ie;let Se=F[0],Le=0,te=$i.ParameterStructures.auto;$i.ParameterStructures.is(Se)&&(Le=1,te=Se);let Te=F.length,Ge=Te-Le;switch(Ge){case 0:Ue=void 0;break;case 1:Ue=kt(te,F[Le]);break;default:if(te===$i.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Ue=F.slice(Le,Te).map(Y=>tt(Y));break}}else{let Se=F;be=Ie.method,Ue=Ht(Ie,Se)}let de={jsonrpc:u,method:be,params:Ue};return fe(de),e.write(de).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Ne();let be;return Zd.func(Ie)?h=Ie:F&&(Zd.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)=>jt.sendNotification(ave.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Ne(),Be();let be,Ue,de;if(Zd.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],Y=0,se=$i.ParameterStructures.auto;$i.ParameterStructures.is(Te)&&(Y=1,se=Te);let pe=F.length;$Rt.CancellationToken.is(Ge)&&(pe=pe-1,de=Ge);let Ce=pe-Y;switch(Ce){case 0:Ue=void 0;break;case 1:Ue=kt(se,F[Y]);break;default:if(se===$i.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Ue=F.slice(Y,pe).map(He=>tt(He));break}}else{let Te=F;be=Ie.method,Ue=Ht(Ie,Te);let Ge=Ie.numberOfParams;de=$Rt.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Le;de&&(Le=de.onCancellationRequested(()=>{let Te=B.sender.sendCancellation(jt,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:Ue};return K(te),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let Y=a(Ce=>{Te(Ce),B.sender.cleanup(Se),Le?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),B.sender.cleanup(Se),Le?.dispose()},"rejectWithCleanup"),pe={method:be,timerStart:Date.now(),resolve:Y,reject:se};try{await e.write(te),E.set(Se,pe)}catch(Ce){throw o.error("Sending request failed."),pe.reject(new $i.ResponseError($i.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Ne();let be=null;return zRt.is(Ie)?(be=void 0,d=Ie):Zd.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 Ue=!1,de=b1.Text;be!==void 0&&(Zd.boolean(be)?Ue=be:(Ue=be.sendNotification||!1,de=be.traceFormat||b1.Text)),b=Ie,T=de,b===Ac.Off?w=void 0:w=F,Ue&&!z()&&!W()&&await jt.sendNotification(YRt.type,{value:Ac.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=pP.Disposed,L.fire(void 0);let Ie=new $i.ResponseError($i.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 $jr.LinkedMap,Zd.func(e.dispose)&&e.dispose(),Zd.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),we(),R=pP.Listening,t.listen(Oe)},"listen"),inspect:a(()=>{(0,Gjr.default)().console.log("inspect")},"inspect")};return jt.onNotification(_6e.type,Ie=>{if(b===Ac.Off||!w)return;let F=b===Ac.Verbose||b===Ac.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),jt.onNotification(ave.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),jt}a(vdo,"createMessageConnection");Do.createMessageConnection=vdo});var I6e=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 Xl=bRt();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return Xl.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return Xl.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return Xl.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return Xl.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return Xl.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return Xl.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return Xl.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return Xl.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return Xl.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return Xl.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return Xl.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return Xl.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return Xl.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return Xl.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return Xl.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return Xl.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return Xl.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return Xl.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return Xl.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return Xl.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return Xl.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return Xl.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return Xl.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return Xl.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return Xl.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return Xl.ParameterStructures},"get")});var ZRt=TRt();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return ZRt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return ZRt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return ZRt.Touch},"get")});var Cdo=Njr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return Cdo.Disposable},"get")});var Yjr=Die();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return Yjr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return Yjr.Emitter},"get")});var Kjr=m6e();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Kjr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return Kjr.CancellationToken},"get")});var Jjr=Ojr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return Jjr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return Jjr.SharedArrayReceiverStrategy},"get")});var XRt=Ljr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return XRt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return XRt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return XRt.ReadableStreamMessageReader},"get")});var ePt=jjr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return ePt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return ePt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return ePt.WriteableStreamMessageWriter},"get")});var bdo=Hjr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return bdo.AbstractMessageBuffer},"get")});var Zg=zjr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return Zg.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return Zg.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return Zg.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return Zg.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return Zg.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return Zg.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return Zg.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return Zg.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return Zg.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return Zg.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return Zg.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return Zg.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return Zg.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return Zg.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return Zg.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return Zg.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return Zg.MessageStrategy},"get")});var Sdo=R9();Bt.RAL=Sdo.default});var eHr=I(iPt=>{"use strict";p();Object.defineProperty(iPt,"__esModule",{value:!0});var Zjr=require("util"),wB=I6e(),x6e=class t extends wB.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 Zjr.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)}};x6e.emptyBuffer=Buffer.allocUnsafe(0);var tPt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),wB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),wB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),wB.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),wB.Disposable.create(()=>this.stream.off("data",e))}},rPt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),wB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),wB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),wB.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()}},Xjr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new x6e(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 Zjr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new tPt(t),"asReadableStream"),asWritableStream:a(t=>new rPt(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 nPt(){return Xjr}a(nPt,"RIL");(function(t){function e(){wB.RAL.install(Xjr)}a(e,"install"),t.install=e})(nPt||(nPt={}));iPt.default=nPt});var UV=I(Ca=>{"use strict";p();var Tdo=Ca&&Ca.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ido=Ca&&Ca.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tdo(e,t,r)};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.createMessageConnection=Ca.createServerSocketTransport=Ca.createClientSocketTransport=Ca.createServerPipeTransport=Ca.createClientPipeTransport=Ca.generateRandomPipeName=Ca.StreamMessageWriter=Ca.StreamMessageReader=Ca.SocketMessageWriter=Ca.SocketMessageReader=Ca.PortMessageWriter=Ca.PortMessageReader=Ca.IPCMessageWriter=Ca.IPCMessageReader=void 0;var Lie=eHr();Lie.default.install();var tHr=require("path"),xdo=require("os"),wdo=require("crypto"),P6e=require("net"),S1=I6e();Ido(I6e(),Ca);var oPt=class extends S1.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),S1.Disposable.create(()=>this.process.off("message",e))}};Ca.IPCMessageReader=oPt;var sPt=class extends S1.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(){}};Ca.IPCMessageWriter=sPt;var aPt=class extends S1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new S1.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)}};Ca.PortMessageReader=aPt;var cPt=class extends S1.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(){}};Ca.PortMessageWriter=cPt;var LV=class extends S1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,Lie.default)().stream.asReadableStream(e),r)}};Ca.SocketMessageReader=LV;var FV=class extends S1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,Lie.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ca.SocketMessageWriter=FV;var w6e=class extends S1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,Lie.default)().stream.asReadableStream(e),r)}};Ca.StreamMessageReader=w6e;var R6e=class extends S1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,Lie.default)().stream.asWritableStream(e),r)}};Ca.StreamMessageWriter=R6e;var rHr=process.env.XDG_RUNTIME_DIR,Rdo=new Map([["linux",107],["darwin",103]]);function Pdo(){let t=(0,wdo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;rHr?e=tHr.join(rHr,`vscode-ipc-${t}.sock`):e=tHr.join(xdo.tmpdir(),`vscode-${t}.sock`);let r=Rdo.get(process.platform);return r!==void 0&&e.length>r&&(0,Lie.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(Pdo,"generateRandomPipeName");Ca.generateRandomPipeName=Pdo;function kdo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,P6e.createServer)(l=>{c.close(),r([new LV(l,e),new FV(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(kdo,"createClientPipeTransport");Ca.createClientPipeTransport=kdo;function Ddo(t,e="utf-8"){let r=(0,P6e.createConnection)(t);return[new LV(r,e),new FV(r,e)]}a(Ddo,"createServerPipeTransport");Ca.createServerPipeTransport=Ddo;function Ndo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,P6e.createServer)(l=>{c.close(),r([new LV(l,e),new FV(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(Ndo,"createClientSocketTransport");Ca.createClientSocketTransport=Ndo;function Mdo(t,e="utf-8"){let r=(0,P6e.createConnection)(t,"127.0.0.1");return[new LV(r,e),new FV(r,e)]}a(Mdo,"createServerSocketTransport");Ca.createServerSocketTransport=Mdo;function Odo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(Odo,"isReadableStream");function Bdo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(Bdo,"isWritableStream");function Ldo(t,e,r,n){r||(r=S1.NullLogger);let o=Odo(t)?new w6e(t):t,s=Bdo(e)?new R6e(e):e;return S1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,S1.createMessageConnection)(o,s,r,n)}a(Ldo,"createMessageConnection");Ca.createMessageConnection=Ldo});var lPt=I((Uml,nHr)=>{"use strict";p();nHr.exports=UV()});var uve=I((iHr,k6e)=>{p();(function(t){if(typeof k6e=="object"&&typeof k6e.exports=="object"){var e=t(require,iHr);e!==void 0&&(k6e.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 Re(Me){return typeof Me=="string"}a(Re,"is"),ce.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ce){function Re(Me){return typeof Me=="string"}a(Re,"is"),ce.is=Re})(n||(e.URI=n={}));var o;(function(ce){ce.MIN_VALUE=-2147483648,ce.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Re,"is"),ce.is=Re})(o||(e.integer=o={}));var s;(function(ce){ce.MIN_VALUE=0,ce.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Re,"is"),ce.is=Re})(s||(e.uinteger=s={}));var c;(function(ce){function Re(ge,oe){return ge===Number.MAX_VALUE&&(ge=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ge,character:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe,ze,at){if(We.uinteger(ge)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(ge,oe),end:c.create(ze,at)};if(c.is(ge)&&c.is(oe))return{start:ge,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ge,", ").concat(oe,", ").concat(ze,", ").concat(at,"]"))}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe){return{uri:ge,range:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe,ze,at){return{targetUri:ge,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe,ze,at){return{red:ge,green:oe,blue:ze,alpha:at}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe){return{range:ge,color:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe,ze){return{label:ge,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe,ze,at,$t,gr){var sr={startLine:ge,endLine:oe};return We.defined(ze)&&(sr.startCharacter=ze),We.defined(at)&&(sr.endCharacter=at),We.defined($t)&&(sr.kind=$t),We.defined(gr)&&(sr.collapsedText=gr),sr}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe){return{location:ge,message:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(Me){var ge=Me;return We.objectLiteral(ge)&&We.string(ge.href)}a(Re,"is"),ce.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ce){function Re(ge,oe,ze,at,$t,gr){var sr={range:ge,message:oe};return We.defined(ze)&&(sr.severity=ze),We.defined(at)&&(sr.code=at),We.defined($t)&&(sr.source=$t),We.defined(gr)&&(sr.relatedInformation=gr),sr}a(Re,"create"),ce.create=Re;function Me(ge){var oe,ze=ge;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"),ce.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ce){function Re(ge,oe){for(var ze=[],at=2;at0&&($t.arguments=ze),$t}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ce.replace=Re;function Me(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Me,"insert"),ce.insert=Me;function ge(ze){return{range:ze,newText:""}}a(ge,"del"),ce.del=ge;function oe(ze){var at=ze;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 Re(ge,oe,ze){var at={label:ge};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(Me){var ge=Me;return We.string(ge)}a(Re,"is"),ce.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ce){function Re(ze,at,$t){return{range:ze,newText:at,annotationId:$t}}a(Re,"replace"),ce.replace=Re;function Me(ze,at,$t){return{range:{start:ze,end:ze},newText:at,annotationId:$t}}a(Me,"insert"),ce.insert=Me;function ge(ze,at){return{range:ze,newText:"",annotationId:at}}a(ge,"del"),ce.del=ge;function oe(ze){var at=ze;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 Re(ge,oe){return{textDocument:ge,edits:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&z.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ce.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ce){function Re(ge,oe,ze){var at={kind:"create",uri:ge};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"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe,ze,at){var $t={kind:"rename",oldUri:ge,newUri:oe};return ze!==void 0&&(ze.overwrite!==void 0||ze.ignoreIfExists!==void 0)&&($t.options=ze),at!==void 0&&($t.annotationId=at),$t}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 Re(ge,oe,ze){var at={kind:"delete",uri:ge};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"),ce.create=Re;function Me(ge){var oe=ge;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 Re(Me){var ge=Me;return ge&&(ge.changes!==void 0||ge.documentChanges!==void 0)&&(ge.documentChanges===void 0||ge.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||L.is(oe)||B.is(oe):D.is(oe)}))}a(Re,"is"),ce.is=Re})(j||(e.WorkspaceEdit=j={}));var M=(function(){function ce(Re,Me){this.edits=Re,this.changeAnnotations=Me}return a(ce,"TextEditChangeImpl"),ce.prototype.insert=function(Re,Me,ge){var oe,ze;if(ge===void 0?oe=w.insert(Re,Me):x.is(ge)?(ze=ge,oe=P.insert(Re,Me,ge)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ge),oe=P.insert(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ce.prototype.replace=function(Re,Me,ge){var oe,ze;if(ge===void 0?oe=w.replace(Re,Me):x.is(ge)?(ze=ge,oe=P.replace(Re,Me,ge)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ge),oe=P.replace(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ce.prototype.delete=function(Re,Me){var ge,oe;if(Me===void 0?ge=w.del(Re):x.is(Me)?(oe=Me,ge=P.del(Re,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ge=P.del(Re,oe)),this.edits.push(ge),oe!==void 0)return oe},ce.prototype.add=function(Re){this.edits.push(Re)},ce.prototype.all=function(){return this.edits},ce.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ce.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ce})(),O=(function(){function ce(Re){this._annotations=Re===void 0?Object.create(null):Re,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(Re,Me){var ge;if(x.is(Re)?ge=Re:(ge=this.nextId(),Me=Re),this._annotations[ge]!==void 0)throw new Error("Id ".concat(ge," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(ge));return this._annotations[ge]=Me,this._size++,ge},ce.prototype.nextId=function(){return this._counter++,this._counter.toString()},ce})(),q=(function(){function ce(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(ge){if(D.is(ge)){var oe=new M(ge.edits,Me._changeAnnotations);Me._textEditChanges[ge.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(ge){var oe=new M(Re.changes[ge]);Me._textEditChanges[ge]=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(Re){if(z.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},ge=this._textEditChanges[Me.uri];if(!ge){var oe=[],ze={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(ze),ge=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=ge}return ge}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ge=this._textEditChanges[Re];if(!ge){var oe=[];this._workspaceEdit.changes[Re]=oe,ge=new M(oe),this._textEditChanges[Re]=ge}return ge}},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(Re,Me,ge){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:ge=Me;var ze,at;if(oe===void 0?ze=N.create(Re,ge):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,ge,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ce.prototype.renameFile=function(Re,Me,ge,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(ge)||x.is(ge)?ze=ge:oe=ge;var at,$t;if(ze===void 0?at=L.create(Re,Me,oe):($t=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=L.create(Re,Me,oe,$t)),this._workspaceEdit.documentChanges.push(at),$t!==void 0)return $t},ce.prototype.deleteFile=function(Re,Me,ge){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:ge=Me;var ze,at;if(oe===void 0?ze=B.create(Re,ge):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=B.create(Re,ge,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ce})();e.WorkspaceChange=q;var Q;(function(ce){function Re(ge){return{uri:ge}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ce.is=Me})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ce){function Re(ge,oe){return{uri:ge,version:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ce.is=Me})(U||(e.VersionedTextDocumentIdentifier=U={}));var z;(function(ce){function Re(ge,oe){return{uri:ge,version:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ce.is=Me})(z||(e.OptionalVersionedTextDocumentIdentifier=z={}));var W;(function(ce){function Re(ge,oe,ze,at){return{uri:ge,languageId:oe,version:ze,text:at}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;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 $;(function(ce){ce.PlainText="plaintext",ce.Markdown="markdown";function Re(Me){var ge=Me;return ge===ce.PlainText||ge===ce.Markdown}a(Re,"is"),ce.is=Re})($||(e.MarkupKind=$={}));var J;(function(ce){function Re(Me){var ge=Me;return We.objectLiteral(Me)&&$.is(ge.kind)&&We.string(ge.value)}a(Re,"is"),ce.is=Re})(J||(e.MarkupContent=J={}));var ne;(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})(ne||(e.CompletionItemKind=ne={}));var H;(function(ce){ce.PlainText=1,ce.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ce){ce.Deprecated=1})(re||(e.CompletionItemTag=re={}));var ae;(function(ce){function Re(ge,oe,ze){return{newText:ge,insert:oe,replace:ze}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ce.is=Me})(ae||(e.InsertReplaceEdit=ae={}));var Oe;(function(ce){ce.asIs=1,ce.adjustIndentation=2})(Oe||(e.InsertTextMode=Oe={}));var ve;(function(ce){function Re(Me){var ge=Me;return ge&&(We.string(ge.detail)||ge.detail===void 0)&&(We.string(ge.description)||ge.description===void 0)}a(Re,"is"),ce.is=Re})(ve||(e.CompletionItemLabelDetails=ve={}));var Fe;(function(ce){function Re(Me){return{label:Me}}a(Re,"create"),ce.create=Re})(Fe||(e.CompletionItem=Fe={}));var Pe;(function(ce){function Re(Me,ge){return{items:Me||[],isIncomplete:!!ge}}a(Re,"create"),ce.create=Re})(Pe||(e.CompletionList=Pe={}));var Z;(function(ce){function Re(ge){return ge.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ce.fromPlainText=Re;function Me(ge){var oe=ge;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ce.is=Me})(Z||(e.MarkedString=Z={}));var ee;(function(ce){function Re(Me){var ge=Me;return!!ge&&We.objectLiteral(ge)&&(J.is(ge.contents)||Z.is(ge.contents)||We.typedArray(ge.contents,Z.is))&&(Me.range===void 0||l.is(Me.range))}a(Re,"is"),ce.is=Re})(ee||(e.Hover=ee={}));var K;(function(ce){function Re(Me,ge){return ge?{label:Me,documentation:ge}:{label:Me}}a(Re,"create"),ce.create=Re})(K||(e.ParameterInformation=K={}));var fe;(function(ce){function Re(Me,ge){for(var oe=[],ze=2;ze=0;Nr--){var Hr=mr[Nr],Gr=Fe.offsetAt(Hr.range.start),zt=Fe.offsetAt(Hr.range.end);if(zt<=or)Ht=Ht.substring(0,Gr)+Hr.newText+Ht.substring(zt,Ht.length);else throw new Error("Overlapping edit");or=Gr}return Ht}a(de,"applyEdits"),oe.applyEdits=de;function te(Fe,et){if(Fe.length<=1)return Fe;var Ht=Fe.length/2|0,mr=Fe.slice(0,Ht),or=Fe.slice(Ht);te(mr,et),te(or,et);for(var Nr=0,Hr=0,Gr=0;Nr0&&ve.push(Se.length),this._lineOffsets=ve}return this._lineOffsets},oe.prototype.positionAt=function(ve){ve=Math.max(Math.min(ve,this._content.length),0);var Se=this.getLineOffsets(),de=0,te=Se.length;if(te===0)return c.create(0,ve);for(;deve?te=Fe:de=Fe+1}var et=de-1;return c.create(et,ve-Se[et])},oe.prototype.offsetAt=function(ve){var Se=this.getLineOffsets();if(ve.line>=Se.length)return this._content.length;if(ve.line<0)return 0;var de=Se[ve.line],te=ve.line+1"u"}a(de,"undefined"),oe.undefined=de;function te(zt){return zt===!0||zt===!1}a(te,"boolean"),oe.boolean=te;function Fe(zt){return ve.call(zt)==="[object String]"}a(Fe,"string"),oe.string=Fe;function et(zt){return ve.call(zt)==="[object Number]"}a(et,"number"),oe.number=et;function Ht(zt,_r,wm){return ve.call(zt)==="[object Number]"&&_r<=zt&&zt<=wm}a(Ht,"numberRange"),oe.numberRange=Ht;function mr(zt){return ve.call(zt)==="[object Number]"&&-2147483648<=zt&&zt<=2147483647}a(mr,"integer"),oe.integer=mr;function or(zt){return ve.call(zt)==="[object Number]"&&0<=zt&&zt<=2147483647}a(or,"uinteger"),oe.uinteger=or;function Nr(zt){return ve.call(zt)==="[object Function]"}a(Nr,"func"),oe.func=Nr;function Hr(zt){return zt!==null&&typeof zt=="object"}a(Hr,"objectLiteral"),oe.objectLiteral=Hr;function Gr(zt,_r){return Array.isArray(zt)&&zt.every(_r)}a(Gr,"typedArray"),oe.typedArray=Gr})(Be||(Be={}))})});var Sd=I(KC=>{"use strict";p();Object.defineProperty(KC,"__esModule",{value:!0});KC.ProtocolNotificationType=KC.ProtocolNotificationType0=KC.ProtocolRequestType=KC.ProtocolRequestType0=KC.RegistrationType=KC.MessageDirection=void 0;var toe=nW(),lGr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(lGr||(KC.MessageDirection=lGr={}));var Vkt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};KC.RegistrationType=Vkt;var Wkt=class extends toe.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};KC.ProtocolRequestType0=Wkt;var zkt=class extends toe.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,toe.ParameterStructures.byName)}};KC.ProtocolRequestType=zkt;var Ykt=class extends toe.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};KC.ProtocolNotificationType0=Ykt;var Kkt=class extends toe.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,toe.ParameterStructures.byName)}};KC.ProtocolNotificationType=Kkt});var s9e=I(mh=>{"use strict";p();Object.defineProperty(mh,"__esModule",{value:!0});mh.objectLiteral=mh.typedArray=mh.stringArray=mh.array=mh.func=mh.error=mh.number=mh.string=mh.boolean=void 0;function apo(t){return t===!0||t===!1}a(apo,"boolean");mh.boolean=apo;function uGr(t){return typeof t=="string"||t instanceof String}a(uGr,"string");mh.string=uGr;function cpo(t){return typeof t=="number"||t instanceof Number}a(cpo,"number");mh.number=cpo;function lpo(t){return t instanceof Error}a(lpo,"error");mh.error=lpo;function upo(t){return typeof t=="function"}a(upo,"func");mh.func=upo;function dGr(t){return Array.isArray(t)}a(dGr,"array");mh.array=dGr;function dpo(t){return dGr(t)&&t.every(e=>uGr(e))}a(dpo,"stringArray");mh.stringArray=dpo;function fpo(t,e){return Array.isArray(t)&&t.every(e)}a(fpo,"typedArray");mh.typedArray=fpo;function ppo(t){return t!==null&&typeof t=="object"}a(ppo,"objectLiteral");mh.objectLiteral=ppo});var hGr=I(a9e=>{"use strict";p();Object.defineProperty(a9e,"__esModule",{value:!0});a9e.ImplementationRequest=void 0;var fGr=Sd(),pGr;(function(t){t.method="textDocument/implementation",t.messageDirection=fGr.MessageDirection.clientToServer,t.type=new fGr.ProtocolRequestType(t.method)})(pGr||(a9e.ImplementationRequest=pGr={}))});var AGr=I(c9e=>{"use strict";p();Object.defineProperty(c9e,"__esModule",{value:!0});c9e.TypeDefinitionRequest=void 0;var mGr=Sd(),gGr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=mGr.MessageDirection.clientToServer,t.type=new mGr.ProtocolRequestType(t.method)})(gGr||(c9e.TypeDefinitionRequest=gGr={}))});var _Gr=I(roe=>{"use strict";p();Object.defineProperty(roe,"__esModule",{value:!0});roe.DidChangeWorkspaceFoldersNotification=roe.WorkspaceFoldersRequest=void 0;var l9e=Sd(),yGr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=l9e.MessageDirection.serverToClient,t.type=new l9e.ProtocolRequestType0(t.method)})(yGr||(roe.WorkspaceFoldersRequest=yGr={}));var EGr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=l9e.MessageDirection.clientToServer,t.type=new l9e.ProtocolNotificationType(t.method)})(EGr||(roe.DidChangeWorkspaceFoldersNotification=EGr={}))});var bGr=I(u9e=>{"use strict";p();Object.defineProperty(u9e,"__esModule",{value:!0});u9e.ConfigurationRequest=void 0;var CGr=Sd(),vGr;(function(t){t.method="workspace/configuration",t.messageDirection=CGr.MessageDirection.serverToClient,t.type=new CGr.ProtocolRequestType(t.method)})(vGr||(u9e.ConfigurationRequest=vGr={}))});var IGr=I(noe=>{"use strict";p();Object.defineProperty(noe,"__esModule",{value:!0});noe.ColorPresentationRequest=noe.DocumentColorRequest=void 0;var d9e=Sd(),SGr;(function(t){t.method="textDocument/documentColor",t.messageDirection=d9e.MessageDirection.clientToServer,t.type=new d9e.ProtocolRequestType(t.method)})(SGr||(noe.DocumentColorRequest=SGr={}));var TGr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=d9e.MessageDirection.clientToServer,t.type=new d9e.ProtocolRequestType(t.method)})(TGr||(noe.ColorPresentationRequest=TGr={}))});var RGr=I(ioe=>{"use strict";p();Object.defineProperty(ioe,"__esModule",{value:!0});ioe.FoldingRangeRefreshRequest=ioe.FoldingRangeRequest=void 0;var f9e=Sd(),xGr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=f9e.MessageDirection.clientToServer,t.type=new f9e.ProtocolRequestType(t.method)})(xGr||(ioe.FoldingRangeRequest=xGr={}));var wGr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=f9e.MessageDirection.serverToClient,t.type=new f9e.ProtocolRequestType0(t.method)})(wGr||(ioe.FoldingRangeRefreshRequest=wGr={}))});var DGr=I(p9e=>{"use strict";p();Object.defineProperty(p9e,"__esModule",{value:!0});p9e.DeclarationRequest=void 0;var kGr=Sd(),PGr;(function(t){t.method="textDocument/declaration",t.messageDirection=kGr.MessageDirection.clientToServer,t.type=new kGr.ProtocolRequestType(t.method)})(PGr||(p9e.DeclarationRequest=PGr={}))});var OGr=I(h9e=>{"use strict";p();Object.defineProperty(h9e,"__esModule",{value:!0});h9e.SelectionRangeRequest=void 0;var NGr=Sd(),MGr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=NGr.MessageDirection.clientToServer,t.type=new NGr.ProtocolRequestType(t.method)})(MGr||(h9e.SelectionRangeRequest=MGr={}))});var UGr=I(V9=>{"use strict";p();Object.defineProperty(V9,"__esModule",{value:!0});V9.WorkDoneProgressCancelNotification=V9.WorkDoneProgressCreateRequest=V9.WorkDoneProgress=void 0;var hpo=nW(),m9e=Sd(),BGr;(function(t){t.type=new hpo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(BGr||(V9.WorkDoneProgress=BGr={}));var LGr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=m9e.MessageDirection.serverToClient,t.type=new m9e.ProtocolRequestType(t.method)})(LGr||(V9.WorkDoneProgressCreateRequest=LGr={}));var FGr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=m9e.MessageDirection.clientToServer,t.type=new m9e.ProtocolNotificationType(t.method)})(FGr||(V9.WorkDoneProgressCancelNotification=FGr={}))});var HGr=I(W9=>{"use strict";p();Object.defineProperty(W9,"__esModule",{value:!0});W9.CallHierarchyOutgoingCallsRequest=W9.CallHierarchyIncomingCallsRequest=W9.CallHierarchyPrepareRequest=void 0;var ooe=Sd(),QGr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ooe.MessageDirection.clientToServer,t.type=new ooe.ProtocolRequestType(t.method)})(QGr||(W9.CallHierarchyPrepareRequest=QGr={}));var qGr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ooe.MessageDirection.clientToServer,t.type=new ooe.ProtocolRequestType(t.method)})(qGr||(W9.CallHierarchyIncomingCallsRequest=qGr={}));var jGr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ooe.MessageDirection.clientToServer,t.type=new ooe.ProtocolRequestType(t.method)})(jGr||(W9.CallHierarchyOutgoingCallsRequest=jGr={}))});var YGr=I(JC=>{"use strict";p();Object.defineProperty(JC,"__esModule",{value:!0});JC.SemanticTokensRefreshRequest=JC.SemanticTokensRangeRequest=JC.SemanticTokensDeltaRequest=JC.SemanticTokensRequest=JC.SemanticTokensRegistrationType=JC.TokenFormat=void 0;var jB=Sd(),GGr;(function(t){t.Relative="relative"})(GGr||(JC.TokenFormat=GGr={}));var MCe;(function(t){t.method="textDocument/semanticTokens",t.type=new jB.RegistrationType(t.method)})(MCe||(JC.SemanticTokensRegistrationType=MCe={}));var $Gr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=jB.MessageDirection.clientToServer,t.type=new jB.ProtocolRequestType(t.method),t.registrationMethod=MCe.method})($Gr||(JC.SemanticTokensRequest=$Gr={}));var VGr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=jB.MessageDirection.clientToServer,t.type=new jB.ProtocolRequestType(t.method),t.registrationMethod=MCe.method})(VGr||(JC.SemanticTokensDeltaRequest=VGr={}));var WGr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=jB.MessageDirection.clientToServer,t.type=new jB.ProtocolRequestType(t.method),t.registrationMethod=MCe.method})(WGr||(JC.SemanticTokensRangeRequest=WGr={}));var zGr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=jB.MessageDirection.serverToClient,t.type=new jB.ProtocolRequestType0(t.method)})(zGr||(JC.SemanticTokensRefreshRequest=zGr={}))});var ZGr=I(g9e=>{"use strict";p();Object.defineProperty(g9e,"__esModule",{value:!0});g9e.ShowDocumentRequest=void 0;var KGr=Sd(),JGr;(function(t){t.method="window/showDocument",t.messageDirection=KGr.MessageDirection.serverToClient,t.type=new KGr.ProtocolRequestType(t.method)})(JGr||(g9e.ShowDocumentRequest=JGr={}))});var t$r=I(A9e=>{"use strict";p();Object.defineProperty(A9e,"__esModule",{value:!0});A9e.LinkedEditingRangeRequest=void 0;var XGr=Sd(),e$r;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=XGr.MessageDirection.clientToServer,t.type=new XGr.ProtocolRequestType(t.method)})(e$r||(A9e.LinkedEditingRangeRequest=e$r={}))});var l$r=I(vy=>{"use strict";p();Object.defineProperty(vy,"__esModule",{value:!0});vy.WillDeleteFilesRequest=vy.DidDeleteFilesNotification=vy.DidRenameFilesNotification=vy.WillRenameFilesRequest=vy.DidCreateFilesNotification=vy.WillCreateFilesRequest=vy.FileOperationPatternKind=void 0;var PI=Sd(),r$r;(function(t){t.file="file",t.folder="folder"})(r$r||(vy.FileOperationPatternKind=r$r={}));var n$r;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolRequestType(t.method)})(n$r||(vy.WillCreateFilesRequest=n$r={}));var i$r;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolNotificationType(t.method)})(i$r||(vy.DidCreateFilesNotification=i$r={}));var o$r;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolRequestType(t.method)})(o$r||(vy.WillRenameFilesRequest=o$r={}));var s$r;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolNotificationType(t.method)})(s$r||(vy.DidRenameFilesNotification=s$r={}));var a$r;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolNotificationType(t.method)})(a$r||(vy.DidDeleteFilesNotification=a$r={}));var c$r;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolRequestType(t.method)})(c$r||(vy.WillDeleteFilesRequest=c$r={}))});var h$r=I(z9=>{"use strict";p();Object.defineProperty(z9,"__esModule",{value:!0});z9.MonikerRequest=z9.MonikerKind=z9.UniquenessLevel=void 0;var u$r=Sd(),d$r;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(d$r||(z9.UniquenessLevel=d$r={}));var f$r;(function(t){t.$import="import",t.$export="export",t.local="local"})(f$r||(z9.MonikerKind=f$r={}));var p$r;(function(t){t.method="textDocument/moniker",t.messageDirection=u$r.MessageDirection.clientToServer,t.type=new u$r.ProtocolRequestType(t.method)})(p$r||(z9.MonikerRequest=p$r={}))});var y$r=I(Y9=>{"use strict";p();Object.defineProperty(Y9,"__esModule",{value:!0});Y9.TypeHierarchySubtypesRequest=Y9.TypeHierarchySupertypesRequest=Y9.TypeHierarchyPrepareRequest=void 0;var soe=Sd(),m$r;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=soe.MessageDirection.clientToServer,t.type=new soe.ProtocolRequestType(t.method)})(m$r||(Y9.TypeHierarchyPrepareRequest=m$r={}));var g$r;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=soe.MessageDirection.clientToServer,t.type=new soe.ProtocolRequestType(t.method)})(g$r||(Y9.TypeHierarchySupertypesRequest=g$r={}));var A$r;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=soe.MessageDirection.clientToServer,t.type=new soe.ProtocolRequestType(t.method)})(A$r||(Y9.TypeHierarchySubtypesRequest=A$r={}))});var C$r=I(aoe=>{"use strict";p();Object.defineProperty(aoe,"__esModule",{value:!0});aoe.InlineValueRefreshRequest=aoe.InlineValueRequest=void 0;var y9e=Sd(),E$r;(function(t){t.method="textDocument/inlineValue",t.messageDirection=y9e.MessageDirection.clientToServer,t.type=new y9e.ProtocolRequestType(t.method)})(E$r||(aoe.InlineValueRequest=E$r={}));var _$r;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=y9e.MessageDirection.serverToClient,t.type=new y9e.ProtocolRequestType0(t.method)})(_$r||(aoe.InlineValueRefreshRequest=_$r={}))});var T$r=I(K9=>{"use strict";p();Object.defineProperty(K9,"__esModule",{value:!0});K9.InlayHintRefreshRequest=K9.InlayHintResolveRequest=K9.InlayHintRequest=void 0;var coe=Sd(),v$r;(function(t){t.method="textDocument/inlayHint",t.messageDirection=coe.MessageDirection.clientToServer,t.type=new coe.ProtocolRequestType(t.method)})(v$r||(K9.InlayHintRequest=v$r={}));var b$r;(function(t){t.method="inlayHint/resolve",t.messageDirection=coe.MessageDirection.clientToServer,t.type=new coe.ProtocolRequestType(t.method)})(b$r||(K9.InlayHintResolveRequest=b$r={}));var S$r;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=coe.MessageDirection.serverToClient,t.type=new coe.ProtocolRequestType0(t.method)})(S$r||(K9.InlayHintRefreshRequest=S$r={}))});var D$r=I(DI=>{"use strict";p();Object.defineProperty(DI,"__esModule",{value:!0});DI.DiagnosticRefreshRequest=DI.WorkspaceDiagnosticRequest=DI.DocumentDiagnosticRequest=DI.DocumentDiagnosticReportKind=DI.DiagnosticServerCancellationData=void 0;var P$r=nW(),mpo=s9e(),loe=Sd(),I$r;(function(t){function e(r){let n=r;return n&&mpo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(I$r||(DI.DiagnosticServerCancellationData=I$r={}));var x$r;(function(t){t.Full="full",t.Unchanged="unchanged"})(x$r||(DI.DocumentDiagnosticReportKind=x$r={}));var w$r;(function(t){t.method="textDocument/diagnostic",t.messageDirection=loe.MessageDirection.clientToServer,t.type=new loe.ProtocolRequestType(t.method),t.partialResult=new P$r.ProgressType})(w$r||(DI.DocumentDiagnosticRequest=w$r={}));var R$r;(function(t){t.method="workspace/diagnostic",t.messageDirection=loe.MessageDirection.clientToServer,t.type=new loe.ProtocolRequestType(t.method),t.partialResult=new P$r.ProgressType})(R$r||(DI.WorkspaceDiagnosticRequest=R$r={}));var k$r;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=loe.MessageDirection.serverToClient,t.type=new loe.ProtocolRequestType0(t.method)})(k$r||(DI.DiagnosticRefreshRequest=k$r={}))});var U$r=I(Of=>{"use strict";p();Object.defineProperty(Of,"__esModule",{value:!0});Of.DidCloseNotebookDocumentNotification=Of.DidSaveNotebookDocumentNotification=Of.DidChangeNotebookDocumentNotification=Of.NotebookCellArrayChange=Of.DidOpenNotebookDocumentNotification=Of.NotebookDocumentSyncRegistrationType=Of.NotebookDocument=Of.NotebookCell=Of.ExecutionSummary=Of.NotebookCellKind=void 0;var OCe=NCe(),Ck=s9e(),wN=Sd(),Jkt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(Jkt||(Of.NotebookCellKind=Jkt={}));var Zkt;(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 Ck.objectLiteral(s)&&OCe.uinteger.is(s.executionOrder)&&(s.success===void 0||Ck.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})(Zkt||(Of.ExecutionSummary=Zkt={}));var E9e;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return Ck.objectLiteral(c)&&Jkt.is(c.kind)&&OCe.DocumentUri.is(c.document)&&(c.metadata===void 0||Ck.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)&&!Zkt.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(_9e,"__esModule",{value:!0});_9e.InlineCompletionRequest=void 0;var Q$r=Sd(),q$r;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Q$r.MessageDirection.clientToServer,t.type=new Q$r.ProtocolRequestType(t.method)})(q$r||(_9e.InlineCompletionRequest=q$r={}))});var tWr=I(Oe=>{"use strict";p();Object.defineProperty(Oe,"__esModule",{value:!0});Oe.WorkspaceSymbolRequest=Oe.CodeActionResolveRequest=Oe.CodeActionRequest=Oe.DocumentSymbolRequest=Oe.DocumentHighlightRequest=Oe.ReferencesRequest=Oe.DefinitionRequest=Oe.SignatureHelpRequest=Oe.SignatureHelpTriggerKind=Oe.HoverRequest=Oe.CompletionResolveRequest=Oe.CompletionRequest=Oe.CompletionTriggerKind=Oe.PublishDiagnosticsNotification=Oe.WatchKind=Oe.RelativePattern=Oe.FileChangeType=Oe.DidChangeWatchedFilesNotification=Oe.WillSaveTextDocumentWaitUntilRequest=Oe.WillSaveTextDocumentNotification=Oe.TextDocumentSaveReason=Oe.DidSaveTextDocumentNotification=Oe.DidCloseTextDocumentNotification=Oe.DidChangeTextDocumentNotification=Oe.TextDocumentContentChangeEvent=Oe.DidOpenTextDocumentNotification=Oe.TextDocumentSyncKind=Oe.TelemetryEventNotification=Oe.LogMessageNotification=Oe.ShowMessageRequest=Oe.ShowMessageNotification=Oe.MessageType=Oe.DidChangeConfigurationNotification=Oe.ExitNotification=Oe.ShutdownRequest=Oe.InitializedNotification=Oe.InitializeErrorCodes=Oe.InitializeRequest=Oe.WorkDoneProgressOptions=Oe.TextDocumentRegistrationOptions=Oe.StaticRegistrationOptions=Oe.PositionEncodingKind=Oe.FailureHandlingKind=Oe.ResourceOperationKind=Oe.UnregistrationRequest=Oe.RegistrationRequest=Oe.DocumentSelector=Oe.NotebookCellTextDocumentFilter=Oe.NotebookDocumentFilter=Oe.TextDocumentFilter=void 0;Oe.MonikerRequest=Oe.MonikerKind=Oe.UniquenessLevel=Oe.WillDeleteFilesRequest=Oe.DidDeleteFilesNotification=Oe.WillRenameFilesRequest=Oe.DidRenameFilesNotification=Oe.WillCreateFilesRequest=Oe.DidCreateFilesNotification=Oe.FileOperationPatternKind=Oe.LinkedEditingRangeRequest=Oe.ShowDocumentRequest=Oe.SemanticTokensRegistrationType=Oe.SemanticTokensRefreshRequest=Oe.SemanticTokensRangeRequest=Oe.SemanticTokensDeltaRequest=Oe.SemanticTokensRequest=Oe.TokenFormat=Oe.CallHierarchyPrepareRequest=Oe.CallHierarchyOutgoingCallsRequest=Oe.CallHierarchyIncomingCallsRequest=Oe.WorkDoneProgressCancelNotification=Oe.WorkDoneProgressCreateRequest=Oe.WorkDoneProgress=Oe.SelectionRangeRequest=Oe.DeclarationRequest=Oe.FoldingRangeRefreshRequest=Oe.FoldingRangeRequest=Oe.ColorPresentationRequest=Oe.DocumentColorRequest=Oe.ConfigurationRequest=Oe.DidChangeWorkspaceFoldersNotification=Oe.WorkspaceFoldersRequest=Oe.TypeDefinitionRequest=Oe.ImplementationRequest=Oe.ApplyWorkspaceEditRequest=Oe.ExecuteCommandRequest=Oe.PrepareRenameRequest=Oe.RenameRequest=Oe.PrepareSupportDefaultBehavior=Oe.DocumentOnTypeFormattingRequest=Oe.DocumentRangesFormattingRequest=Oe.DocumentRangeFormattingRequest=Oe.DocumentFormattingRequest=Oe.DocumentLinkResolveRequest=Oe.DocumentLinkRequest=Oe.CodeLensRefreshRequest=Oe.CodeLensResolveRequest=Oe.CodeLensRequest=Oe.WorkspaceSymbolResolveRequest=void 0;Oe.InlineCompletionRequest=Oe.DidCloseNotebookDocumentNotification=Oe.DidSaveNotebookDocumentNotification=Oe.DidChangeNotebookDocumentNotification=Oe.NotebookCellArrayChange=Oe.DidOpenNotebookDocumentNotification=Oe.NotebookDocumentSyncRegistrationType=Oe.NotebookDocument=Oe.NotebookCell=Oe.ExecutionSummary=Oe.NotebookCellKind=Oe.DiagnosticRefreshRequest=Oe.WorkspaceDiagnosticRequest=Oe.DocumentDiagnosticRequest=Oe.DocumentDiagnosticReportKind=Oe.DiagnosticServerCancellationData=Oe.InlayHintRefreshRequest=Oe.InlayHintResolveRequest=Oe.InlayHintRequest=Oe.InlineValueRefreshRequest=Oe.InlineValueRequest=Oe.TypeHierarchySupertypesRequest=Oe.TypeHierarchySubtypesRequest=Oe.TypeHierarchyPrepareRequest=void 0;var br=Sd(),H$r=NCe(),Om=s9e(),gpo=hGr();Object.defineProperty(Oe,"ImplementationRequest",{enumerable:!0,get:a(function(){return gpo.ImplementationRequest},"get")});var Apo=AGr();Object.defineProperty(Oe,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return Apo.TypeDefinitionRequest},"get")});var JVr=_Gr();Object.defineProperty(Oe,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return JVr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Oe,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return JVr.DidChangeWorkspaceFoldersNotification},"get")});var ypo=bGr();Object.defineProperty(Oe,"ConfigurationRequest",{enumerable:!0,get:a(function(){return ypo.ConfigurationRequest},"get")});var ZVr=IGr();Object.defineProperty(Oe,"DocumentColorRequest",{enumerable:!0,get:a(function(){return ZVr.DocumentColorRequest},"get")});Object.defineProperty(Oe,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return ZVr.ColorPresentationRequest},"get")});var XVr=RGr();Object.defineProperty(Oe,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return XVr.FoldingRangeRequest},"get")});Object.defineProperty(Oe,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return XVr.FoldingRangeRefreshRequest},"get")});var Epo=DGr();Object.defineProperty(Oe,"DeclarationRequest",{enumerable:!0,get:a(function(){return Epo.DeclarationRequest},"get")});var _po=OGr();Object.defineProperty(Oe,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return _po.SelectionRangeRequest},"get")});var nPt=UGr();Object.defineProperty(Oe,"WorkDoneProgress",{enumerable:!0,get:a(function(){return nPt.WorkDoneProgress},"get")});Object.defineProperty(Oe,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return nPt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Oe,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return nPt.WorkDoneProgressCancelNotification},"get")});var iPt=HGr();Object.defineProperty(Oe,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return iPt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Oe,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return iPt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Oe,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return iPt.CallHierarchyPrepareRequest},"get")});var doe=YGr();Object.defineProperty(Oe,"TokenFormat",{enumerable:!0,get:a(function(){return doe.TokenFormat},"get")});Object.defineProperty(Oe,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensRequest},"get")});Object.defineProperty(Oe,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Oe,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensRangeRequest},"get")});Object.defineProperty(Oe,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Oe,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return doe.SemanticTokensRegistrationType},"get")});var Cpo=ZGr();Object.defineProperty(Oe,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return Cpo.ShowDocumentRequest},"get")});var vpo=t$r();Object.defineProperty(Oe,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return vpo.LinkedEditingRangeRequest},"get")});var iW=l$r();Object.defineProperty(Oe,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return iW.FileOperationPatternKind},"get")});Object.defineProperty(Oe,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return iW.DidCreateFilesNotification},"get")});Object.defineProperty(Oe,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return iW.WillCreateFilesRequest},"get")});Object.defineProperty(Oe,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return iW.DidRenameFilesNotification},"get")});Object.defineProperty(Oe,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return iW.WillRenameFilesRequest},"get")});Object.defineProperty(Oe,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return iW.DidDeleteFilesNotification},"get")});Object.defineProperty(Oe,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return iW.WillDeleteFilesRequest},"get")});var oPt=h$r();Object.defineProperty(Oe,"UniquenessLevel",{enumerable:!0,get:a(function(){return oPt.UniquenessLevel},"get")});Object.defineProperty(Oe,"MonikerKind",{enumerable:!0,get:a(function(){return oPt.MonikerKind},"get")});Object.defineProperty(Oe,"MonikerRequest",{enumerable:!0,get:a(function(){return oPt.MonikerRequest},"get")});var sPt=y$r();Object.defineProperty(Oe,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return sPt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Oe,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return sPt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Oe,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return sPt.TypeHierarchySupertypesRequest},"get")});var eWr=C$r();Object.defineProperty(Oe,"InlineValueRequest",{enumerable:!0,get:a(function(){return eWr.InlineValueRequest},"get")});Object.defineProperty(Oe,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return eWr.InlineValueRefreshRequest},"get")});var aPt=T$r();Object.defineProperty(Oe,"InlayHintRequest",{enumerable:!0,get:a(function(){return aPt.InlayHintRequest},"get")});Object.defineProperty(Oe,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return aPt.InlayHintResolveRequest},"get")});Object.defineProperty(Oe,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return aPt.InlayHintRefreshRequest},"get")});var BCe=D$r();Object.defineProperty(Oe,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return BCe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Oe,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return BCe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Oe,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return BCe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Oe,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return BCe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Oe,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return BCe.DiagnosticRefreshRequest},"get")});var RN=U$r();Object.defineProperty(Oe,"NotebookCellKind",{enumerable:!0,get:a(function(){return RN.NotebookCellKind},"get")});Object.defineProperty(Oe,"ExecutionSummary",{enumerable:!0,get:a(function(){return RN.ExecutionSummary},"get")});Object.defineProperty(Oe,"NotebookCell",{enumerable:!0,get:a(function(){return RN.NotebookCell},"get")});Object.defineProperty(Oe,"NotebookDocument",{enumerable:!0,get:a(function(){return RN.NotebookDocument},"get")});Object.defineProperty(Oe,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return RN.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Oe,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Oe,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return RN.NotebookCellArrayChange},"get")});Object.defineProperty(Oe,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Oe,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Oe,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidCloseNotebookDocumentNotification},"get")});var bpo=j$r();Object.defineProperty(Oe,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return bpo.InlineCompletionRequest},"get")});var Xkt;(function(t){function e(r){let n=r;return Om.string(n)||Om.string(n.language)||Om.string(n.scheme)||Om.string(n.pattern)}a(e,"is"),t.is=e})(Xkt||(Oe.TextDocumentFilter=Xkt={}));var ePt;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(Om.string(n.notebookType)||Om.string(n.scheme)||Om.string(n.pattern))}a(e,"is"),t.is=e})(ePt||(Oe.NotebookDocumentFilter=ePt={}));var tPt;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(Om.string(n.notebook)||ePt.is(n.notebook))&&(n.language===void 0||Om.string(n.language))}a(e,"is"),t.is=e})(tPt||(Oe.NotebookCellTextDocumentFilter=tPt={}));var rPt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Om.string(n)&&!Xkt.is(n)&&!tPt.is(n))return!1;return!0}a(e,"is"),t.is=e})(rPt||(Oe.DocumentSelector=rPt={}));var G$r;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(G$r||(Oe.RegistrationRequest=G$r={}));var $$r;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})($$r||(Oe.UnregistrationRequest=$$r={}));var V$r;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(V$r||(Oe.ResourceOperationKind=V$r={}));var W$r;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(W$r||(Oe.FailureHandlingKind=W$r={}));var z$r;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(z$r||(Oe.PositionEncodingKind=z$r={}));var Y$r;(function(t){function e(r){let n=r;return n&&Om.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(Y$r||(Oe.StaticRegistrationOptions=Y$r={}));var K$r;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||rPt.is(n.documentSelector))}a(e,"is"),t.is=e})(K$r||(Oe.TextDocumentRegistrationOptions=K$r={}));var J$r;(function(t){function e(n){let o=n;return Om.objectLiteral(o)&&(o.workDoneProgress===void 0||Om.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Om.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(J$r||(Oe.WorkDoneProgressOptions=J$r={}));var Z$r;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(Z$r||(Oe.InitializeRequest=Z$r={}));var X$r;(function(t){t.unknownProtocolVersion=1})(X$r||(Oe.InitializeErrorCodes=X$r={}));var eVr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(eVr||(Oe.InitializedNotification=eVr={}));var tVr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(tVr||(Oe.ShutdownRequest=tVr={}));var rVr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(rVr||(Oe.ExitNotification=rVr={}));var nVr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(nVr||(Oe.DidChangeConfigurationNotification=nVr={}));var iVr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(iVr||(Oe.MessageType=iVr={}));var oVr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(oVr||(Oe.ShowMessageNotification=oVr={}));var sVr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(sVr||(Oe.ShowMessageRequest=sVr={}));var aVr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(aVr||(Oe.LogMessageNotification=aVr={}));var cVr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(cVr||(Oe.TelemetryEventNotification=cVr={}));var lVr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(lVr||(Oe.TextDocumentSyncKind=lVr={}));var uVr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(uVr||(Oe.DidOpenTextDocumentNotification=uVr={}));var dVr;(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})(dVr||(Oe.TextDocumentContentChangeEvent=dVr={}));var fVr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(fVr||(Oe.DidChangeTextDocumentNotification=fVr={}));var pVr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(pVr||(Oe.DidCloseTextDocumentNotification=pVr={}));var hVr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(hVr||(Oe.DidSaveTextDocumentNotification=hVr={}));var mVr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(mVr||(Oe.TextDocumentSaveReason=mVr={}));var gVr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(gVr||(Oe.WillSaveTextDocumentNotification=gVr={}));var AVr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(AVr||(Oe.WillSaveTextDocumentWaitUntilRequest=AVr={}));var yVr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(yVr||(Oe.DidChangeWatchedFilesNotification=yVr={}));var EVr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(EVr||(Oe.FileChangeType=EVr={}));var _Vr;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(H$r.URI.is(n.baseUri)||H$r.WorkspaceFolder.is(n.baseUri))&&Om.string(n.pattern)}a(e,"is"),t.is=e})(_Vr||(Oe.RelativePattern=_Vr={}));var CVr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(CVr||(Oe.WatchKind=CVr={}));var vVr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(vVr||(Oe.PublishDiagnosticsNotification=vVr={}));var bVr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(bVr||(Oe.CompletionTriggerKind=bVr={}));var SVr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(SVr||(Oe.CompletionRequest=SVr={}));var TVr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(TVr||(Oe.CompletionResolveRequest=TVr={}));var IVr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(IVr||(Oe.HoverRequest=IVr={}));var xVr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(xVr||(Oe.SignatureHelpTriggerKind=xVr={}));var wVr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(wVr||(Oe.SignatureHelpRequest=wVr={}));var RVr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(RVr||(Oe.DefinitionRequest=RVr={}));var kVr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(kVr||(Oe.ReferencesRequest=kVr={}));var PVr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(PVr||(Oe.DocumentHighlightRequest=PVr={}));var DVr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(DVr||(Oe.DocumentSymbolRequest=DVr={}));var NVr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(NVr||(Oe.CodeActionRequest=NVr={}));var MVr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(MVr||(Oe.CodeActionResolveRequest=MVr={}));var OVr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(OVr||(Oe.WorkspaceSymbolRequest=OVr={}));var BVr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(BVr||(Oe.WorkspaceSymbolResolveRequest=BVr={}));var LVr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(LVr||(Oe.CodeLensRequest=LVr={}));var FVr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(FVr||(Oe.CodeLensResolveRequest=FVr={}));var UVr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(UVr||(Oe.CodeLensRefreshRequest=UVr={}));var QVr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(QVr||(Oe.DocumentLinkRequest=QVr={}));var qVr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(qVr||(Oe.DocumentLinkResolveRequest=qVr={}));var jVr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(jVr||(Oe.DocumentFormattingRequest=jVr={}));var HVr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HVr||(Oe.DocumentRangeFormattingRequest=HVr={}));var GVr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GVr||(Oe.DocumentRangesFormattingRequest=GVr={}));var $Vr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Vr||(Oe.DocumentOnTypeFormattingRequest=$Vr={}));var VVr;(function(t){t.Identifier=1})(VVr||(Oe.PrepareSupportDefaultBehavior=VVr={}));var WVr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WVr||(Oe.RenameRequest=WVr={}));var zVr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zVr||(Oe.PrepareRenameRequest=zVr={}));var YVr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(YVr||(Oe.ExecuteCommandRequest=YVr={}));var KVr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(KVr||(Oe.ApplyWorkspaceEditRequest=KVr={}))});var nWr=I(C9e=>{"use strict";p();Object.defineProperty(C9e,"__esModule",{value:!0});C9e.createProtocolConnection=void 0;var rWr=nW();function Spo(t,e,r,n){return rWr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,rWr.createMessageConnection)(t,e,r,n)}a(Spo,"createProtocolConnection");C9e.createProtocolConnection=Spo});var oWr=I(ZC=>{"use strict";p();var Tpo=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]})),v9e=ZC&&ZC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tpo(e,t,r)};Object.defineProperty(ZC,"__esModule",{value:!0});ZC.LSPErrorCodes=ZC.createProtocolConnection=void 0;v9e(nW(),ZC);v9e(NCe(),ZC);v9e(Sd(),ZC);v9e(tWr(),ZC);var Ipo=nWr();Object.defineProperty(ZC,"createProtocolConnection",{enumerable:!0,get:a(function(){return Ipo.createProtocolConnection},"get")});var iWr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(iWr||(ZC.LSPErrorCodes=iWr={}))});var ti=I(kN=>{"use strict";p();var xpo=kN&&kN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sWr=kN&&kN.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xpo(e,t,r)};Object.defineProperty(kN,"__esModule",{value:!0});kN.createProtocolConnection=void 0;var wpo=$kt();sWr($kt(),kN);sWr(oWr(),kN);function Rpo(t,e,r,n){return(0,wpo.createMessageConnection)(t,e,r,n)}a(Rpo,"createProtocolConnection");kN.createProtocolConnection=Rpo});var gMt=I(eqe=>{"use strict";p();Object.defineProperty(eqe,"__esModule",{value:!0});eqe.state=void 0;eqe.state={instrumenterImplementation:void 0}});var Cae=I((Y5t,den)=>{p();var eje=require("buffer"),AM=eje.Buffer;function uen(t,e){for(var r in t)e[r]=t[r]}a(uen,"copyProps");AM.from&&AM.alloc&&AM.allocUnsafe&&AM.allocUnsafeSlow?den.exports=eje:(uen(eje,Y5t),Y5t.Buffer=Fz);function Fz(t,e,r){return AM(t,e,r)}a(Fz,"SafeBuffer");Fz.prototype=Object.create(AM.prototype);uen(AM,Fz);Fz.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return AM(t,e,r)};Fz.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=AM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Fz.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return AM(t)};Fz.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return eje.SlowBuffer(t)}});var K5t=I((SGl,fen)=>{p();var tje=Cae().Buffer,W_o=require("stream"),z_o=require("util");function rje(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=tje.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=tje.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(rje,"DataStream");z_o.inherits(rje,W_o);rje.prototype.write=a(function(e){this.buffer=tje.concat([this.buffer,tje.from(e)]),this.emit("data",e)},"write");rje.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");fen.exports=rje});var hen=I((xGl,pen)=>{"use strict";p();function J5t(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(J5t,"getParamSize");var Y_o={ES256:J5t(256),ES384:J5t(384),ES512:J5t(521)};function K_o(t){var e=Y_o[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(K_o,"getParamBytesForAlg");pen.exports=K_o});var Cen=I((kGl,_en)=>{"use strict";p();var nje=Cae().Buffer,gen=hen(),ije=128,Aen=0,J_o=32,Z_o=16,X_o=2,yen=Z_o|J_o|Aen<<6,oje=X_o|Aen<<6;function eCo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(eCo,"base64Url");function Een(t){if(nje.isBuffer(t))return t;if(typeof t=="string")return nje.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Een,"signatureAsBuffer");function tCo(t,e){t=Een(t);var r=gen(e),n=r+1,o=t.length,s=0;if(t[s++]!==yen)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(ije|1)&&(c=t[s++]),o-s=ije;return o&&--n,n}a(men,"countPadding");function rCo(t,e){t=Een(t);var r=gen(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=men(t,0,r),s=men(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var D1e=require("buffer").Buffer,Z5t=require("buffer").SlowBuffer;ven.exports=sje;function sje(t,e){if(!D1e.isBuffer(t)||!D1e.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var bae=Cae().Buffer,ax=require("crypto"),Ten=Cen(),Sen=require("util"),oCo=`"%s" is not a valid algorithm. +`,"\r"];var bt;(function(ce){function Re(ze,at,$t,gr){return new ht(ze,at,$t,gr)}a(Re,"create"),ce.create=Re;function Me(ze){var at=ze;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 ge(ze,at){for(var $t=ze.getText(),gr=oe(at,function(_r,wm){var X8r=_r.range.start.line-wm.range.start.line;return X8r===0?_r.range.start.character-wm.range.start.character:X8r}),sr=$t.length,Nr=gr.length-1;Nr>=0;Nr--){var Hr=gr[Nr],Gr=ze.offsetAt(Hr.range.start),zt=ze.offsetAt(Hr.range.end);if(zt<=sr)$t=$t.substring(0,Gr)+Hr.newText+$t.substring(zt,$t.length);else throw new Error("Overlapping edit");sr=Gr}return $t}a(ge,"applyEdits"),ce.applyEdits=ge;function oe(ze,at){if(ze.length<=1)return ze;var $t=ze.length/2|0,gr=ze.slice(0,$t),sr=ze.slice($t);oe(gr,at),oe(sr,at);for(var Nr=0,Hr=0,Gr=0;Nr0&&Re.push(Me.length),this._lineOffsets=Re}return this._lineOffsets},ce.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Me=this.getLineOffsets(),ge=0,oe=Me.length;if(oe===0)return c.create(0,Re);for(;geRe?oe=ze:ge=ze+1}var at=ge-1;return c.create(at,Re-Me[at])},ce.prototype.offsetAt=function(Re){var Me=this.getLineOffsets();if(Re.line>=Me.length)return this._content.length;if(Re.line<0)return 0;var ge=Me[Re.line],oe=Re.line+1"u"}a(ge,"undefined"),ce.undefined=ge;function oe(zt){return zt===!0||zt===!1}a(oe,"boolean"),ce.boolean=oe;function ze(zt){return Re.call(zt)==="[object String]"}a(ze,"string"),ce.string=ze;function at(zt){return Re.call(zt)==="[object Number]"}a(at,"number"),ce.number=at;function $t(zt,_r,wm){return Re.call(zt)==="[object Number]"&&_r<=zt&&zt<=wm}a($t,"numberRange"),ce.numberRange=$t;function gr(zt){return Re.call(zt)==="[object Number]"&&-2147483648<=zt&&zt<=2147483647}a(gr,"integer"),ce.integer=gr;function sr(zt){return Re.call(zt)==="[object Number]"&&0<=zt&&zt<=2147483647}a(sr,"uinteger"),ce.uinteger=sr;function Nr(zt){return Re.call(zt)==="[object Function]"}a(Nr,"func"),ce.func=Nr;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 Sd=I(Vv=>{"use strict";p();Object.defineProperty(Vv,"__esModule",{value:!0});Vv.ProtocolNotificationType=Vv.ProtocolNotificationType0=Vv.ProtocolRequestType=Vv.ProtocolRequestType0=Vv.RegistrationType=Vv.MessageDirection=void 0;var Fie=UV(),oHr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(oHr||(Vv.MessageDirection=oHr={}));var uPt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};Vv.RegistrationType=uPt;var dPt=class extends Fie.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};Vv.ProtocolRequestType0=dPt;var fPt=class extends Fie.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,Fie.ParameterStructures.byName)}};Vv.ProtocolRequestType=fPt;var pPt=class extends Fie.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};Vv.ProtocolNotificationType0=pPt;var hPt=class extends Fie.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,Fie.ParameterStructures.byName)}};Vv.ProtocolNotificationType=hPt});var D6e=I(gh=>{"use strict";p();Object.defineProperty(gh,"__esModule",{value:!0});gh.objectLiteral=gh.typedArray=gh.stringArray=gh.array=gh.func=gh.error=gh.number=gh.string=gh.boolean=void 0;function Fdo(t){return t===!0||t===!1}a(Fdo,"boolean");gh.boolean=Fdo;function sHr(t){return typeof t=="string"||t instanceof String}a(sHr,"string");gh.string=sHr;function Udo(t){return typeof t=="number"||t instanceof Number}a(Udo,"number");gh.number=Udo;function Qdo(t){return t instanceof Error}a(Qdo,"error");gh.error=Qdo;function qdo(t){return typeof t=="function"}a(qdo,"func");gh.func=qdo;function aHr(t){return Array.isArray(t)}a(aHr,"array");gh.array=aHr;function jdo(t){return aHr(t)&&t.every(e=>sHr(e))}a(jdo,"stringArray");gh.stringArray=jdo;function Hdo(t,e){return Array.isArray(t)&&t.every(e)}a(Hdo,"typedArray");gh.typedArray=Hdo;function Gdo(t){return t!==null&&typeof t=="object"}a(Gdo,"objectLiteral");gh.objectLiteral=Gdo});var uHr=I(N6e=>{"use strict";p();Object.defineProperty(N6e,"__esModule",{value:!0});N6e.ImplementationRequest=void 0;var cHr=Sd(),lHr;(function(t){t.method="textDocument/implementation",t.messageDirection=cHr.MessageDirection.clientToServer,t.type=new cHr.ProtocolRequestType(t.method)})(lHr||(N6e.ImplementationRequest=lHr={}))});var pHr=I(M6e=>{"use strict";p();Object.defineProperty(M6e,"__esModule",{value:!0});M6e.TypeDefinitionRequest=void 0;var dHr=Sd(),fHr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=dHr.MessageDirection.clientToServer,t.type=new dHr.ProtocolRequestType(t.method)})(fHr||(M6e.TypeDefinitionRequest=fHr={}))});var gHr=I(Uie=>{"use strict";p();Object.defineProperty(Uie,"__esModule",{value:!0});Uie.DidChangeWorkspaceFoldersNotification=Uie.WorkspaceFoldersRequest=void 0;var O6e=Sd(),hHr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=O6e.MessageDirection.serverToClient,t.type=new O6e.ProtocolRequestType0(t.method)})(hHr||(Uie.WorkspaceFoldersRequest=hHr={}));var mHr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=O6e.MessageDirection.clientToServer,t.type=new O6e.ProtocolNotificationType(t.method)})(mHr||(Uie.DidChangeWorkspaceFoldersNotification=mHr={}))});var EHr=I(B6e=>{"use strict";p();Object.defineProperty(B6e,"__esModule",{value:!0});B6e.ConfigurationRequest=void 0;var AHr=Sd(),yHr;(function(t){t.method="workspace/configuration",t.messageDirection=AHr.MessageDirection.serverToClient,t.type=new AHr.ProtocolRequestType(t.method)})(yHr||(B6e.ConfigurationRequest=yHr={}))});var CHr=I(Qie=>{"use strict";p();Object.defineProperty(Qie,"__esModule",{value:!0});Qie.ColorPresentationRequest=Qie.DocumentColorRequest=void 0;var L6e=Sd(),_Hr;(function(t){t.method="textDocument/documentColor",t.messageDirection=L6e.MessageDirection.clientToServer,t.type=new L6e.ProtocolRequestType(t.method)})(_Hr||(Qie.DocumentColorRequest=_Hr={}));var vHr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=L6e.MessageDirection.clientToServer,t.type=new L6e.ProtocolRequestType(t.method)})(vHr||(Qie.ColorPresentationRequest=vHr={}))});var THr=I(qie=>{"use strict";p();Object.defineProperty(qie,"__esModule",{value:!0});qie.FoldingRangeRefreshRequest=qie.FoldingRangeRequest=void 0;var F6e=Sd(),bHr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=F6e.MessageDirection.clientToServer,t.type=new F6e.ProtocolRequestType(t.method)})(bHr||(qie.FoldingRangeRequest=bHr={}));var SHr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=F6e.MessageDirection.serverToClient,t.type=new F6e.ProtocolRequestType0(t.method)})(SHr||(qie.FoldingRangeRefreshRequest=SHr={}))});var wHr=I(U6e=>{"use strict";p();Object.defineProperty(U6e,"__esModule",{value:!0});U6e.DeclarationRequest=void 0;var IHr=Sd(),xHr;(function(t){t.method="textDocument/declaration",t.messageDirection=IHr.MessageDirection.clientToServer,t.type=new IHr.ProtocolRequestType(t.method)})(xHr||(U6e.DeclarationRequest=xHr={}))});var kHr=I(Q6e=>{"use strict";p();Object.defineProperty(Q6e,"__esModule",{value:!0});Q6e.SelectionRangeRequest=void 0;var RHr=Sd(),PHr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=RHr.MessageDirection.clientToServer,t.type=new RHr.ProtocolRequestType(t.method)})(PHr||(Q6e.SelectionRangeRequest=PHr={}))});var OHr=I(D9=>{"use strict";p();Object.defineProperty(D9,"__esModule",{value:!0});D9.WorkDoneProgressCancelNotification=D9.WorkDoneProgressCreateRequest=D9.WorkDoneProgress=void 0;var $do=UV(),q6e=Sd(),DHr;(function(t){t.type=new $do.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(DHr||(D9.WorkDoneProgress=DHr={}));var NHr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=q6e.MessageDirection.serverToClient,t.type=new q6e.ProtocolRequestType(t.method)})(NHr||(D9.WorkDoneProgressCreateRequest=NHr={}));var MHr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=q6e.MessageDirection.clientToServer,t.type=new q6e.ProtocolNotificationType(t.method)})(MHr||(D9.WorkDoneProgressCancelNotification=MHr={}))});var UHr=I(N9=>{"use strict";p();Object.defineProperty(N9,"__esModule",{value:!0});N9.CallHierarchyOutgoingCallsRequest=N9.CallHierarchyIncomingCallsRequest=N9.CallHierarchyPrepareRequest=void 0;var jie=Sd(),BHr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=jie.MessageDirection.clientToServer,t.type=new jie.ProtocolRequestType(t.method)})(BHr||(N9.CallHierarchyPrepareRequest=BHr={}));var LHr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=jie.MessageDirection.clientToServer,t.type=new jie.ProtocolRequestType(t.method)})(LHr||(N9.CallHierarchyIncomingCallsRequest=LHr={}));var FHr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=jie.MessageDirection.clientToServer,t.type=new jie.ProtocolRequestType(t.method)})(FHr||(N9.CallHierarchyOutgoingCallsRequest=FHr={}))});var $Hr=I(Wv=>{"use strict";p();Object.defineProperty(Wv,"__esModule",{value:!0});Wv.SemanticTokensRefreshRequest=Wv.SemanticTokensRangeRequest=Wv.SemanticTokensDeltaRequest=Wv.SemanticTokensRequest=Wv.SemanticTokensRegistrationType=Wv.TokenFormat=void 0;var RB=Sd(),QHr;(function(t){t.Relative="relative"})(QHr||(Wv.TokenFormat=QHr={}));var dve;(function(t){t.method="textDocument/semanticTokens",t.type=new RB.RegistrationType(t.method)})(dve||(Wv.SemanticTokensRegistrationType=dve={}));var qHr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=RB.MessageDirection.clientToServer,t.type=new RB.ProtocolRequestType(t.method),t.registrationMethod=dve.method})(qHr||(Wv.SemanticTokensRequest=qHr={}));var jHr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=RB.MessageDirection.clientToServer,t.type=new RB.ProtocolRequestType(t.method),t.registrationMethod=dve.method})(jHr||(Wv.SemanticTokensDeltaRequest=jHr={}));var HHr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=RB.MessageDirection.clientToServer,t.type=new RB.ProtocolRequestType(t.method),t.registrationMethod=dve.method})(HHr||(Wv.SemanticTokensRangeRequest=HHr={}));var GHr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=RB.MessageDirection.serverToClient,t.type=new RB.ProtocolRequestType0(t.method)})(GHr||(Wv.SemanticTokensRefreshRequest=GHr={}))});var zHr=I(j6e=>{"use strict";p();Object.defineProperty(j6e,"__esModule",{value:!0});j6e.ShowDocumentRequest=void 0;var VHr=Sd(),WHr;(function(t){t.method="window/showDocument",t.messageDirection=VHr.MessageDirection.serverToClient,t.type=new VHr.ProtocolRequestType(t.method)})(WHr||(j6e.ShowDocumentRequest=WHr={}))});var JHr=I(H6e=>{"use strict";p();Object.defineProperty(H6e,"__esModule",{value:!0});H6e.LinkedEditingRangeRequest=void 0;var YHr=Sd(),KHr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=YHr.MessageDirection.clientToServer,t.type=new YHr.ProtocolRequestType(t.method)})(KHr||(H6e.LinkedEditingRangeRequest=KHr={}))});var oGr=I(xy=>{"use strict";p();Object.defineProperty(xy,"__esModule",{value:!0});xy.WillDeleteFilesRequest=xy.DidDeleteFilesNotification=xy.DidRenameFilesNotification=xy.WillRenameFilesRequest=xy.DidCreateFilesNotification=xy.WillCreateFilesRequest=xy.FileOperationPatternKind=void 0;var TI=Sd(),ZHr;(function(t){t.file="file",t.folder="folder"})(ZHr||(xy.FileOperationPatternKind=ZHr={}));var XHr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=TI.MessageDirection.clientToServer,t.type=new TI.ProtocolRequestType(t.method)})(XHr||(xy.WillCreateFilesRequest=XHr={}));var eGr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=TI.MessageDirection.clientToServer,t.type=new TI.ProtocolNotificationType(t.method)})(eGr||(xy.DidCreateFilesNotification=eGr={}));var tGr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=TI.MessageDirection.clientToServer,t.type=new TI.ProtocolRequestType(t.method)})(tGr||(xy.WillRenameFilesRequest=tGr={}));var rGr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=TI.MessageDirection.clientToServer,t.type=new TI.ProtocolNotificationType(t.method)})(rGr||(xy.DidRenameFilesNotification=rGr={}));var nGr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=TI.MessageDirection.clientToServer,t.type=new TI.ProtocolNotificationType(t.method)})(nGr||(xy.DidDeleteFilesNotification=nGr={}));var iGr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=TI.MessageDirection.clientToServer,t.type=new TI.ProtocolRequestType(t.method)})(iGr||(xy.WillDeleteFilesRequest=iGr={}))});var uGr=I(M9=>{"use strict";p();Object.defineProperty(M9,"__esModule",{value:!0});M9.MonikerRequest=M9.MonikerKind=M9.UniquenessLevel=void 0;var sGr=Sd(),aGr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(aGr||(M9.UniquenessLevel=aGr={}));var cGr;(function(t){t.$import="import",t.$export="export",t.local="local"})(cGr||(M9.MonikerKind=cGr={}));var lGr;(function(t){t.method="textDocument/moniker",t.messageDirection=sGr.MessageDirection.clientToServer,t.type=new sGr.ProtocolRequestType(t.method)})(lGr||(M9.MonikerRequest=lGr={}))});var hGr=I(O9=>{"use strict";p();Object.defineProperty(O9,"__esModule",{value:!0});O9.TypeHierarchySubtypesRequest=O9.TypeHierarchySupertypesRequest=O9.TypeHierarchyPrepareRequest=void 0;var Hie=Sd(),dGr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Hie.MessageDirection.clientToServer,t.type=new Hie.ProtocolRequestType(t.method)})(dGr||(O9.TypeHierarchyPrepareRequest=dGr={}));var fGr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Hie.MessageDirection.clientToServer,t.type=new Hie.ProtocolRequestType(t.method)})(fGr||(O9.TypeHierarchySupertypesRequest=fGr={}));var pGr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Hie.MessageDirection.clientToServer,t.type=new Hie.ProtocolRequestType(t.method)})(pGr||(O9.TypeHierarchySubtypesRequest=pGr={}))});var AGr=I(Gie=>{"use strict";p();Object.defineProperty(Gie,"__esModule",{value:!0});Gie.InlineValueRefreshRequest=Gie.InlineValueRequest=void 0;var G6e=Sd(),mGr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=G6e.MessageDirection.clientToServer,t.type=new G6e.ProtocolRequestType(t.method)})(mGr||(Gie.InlineValueRequest=mGr={}));var gGr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=G6e.MessageDirection.serverToClient,t.type=new G6e.ProtocolRequestType0(t.method)})(gGr||(Gie.InlineValueRefreshRequest=gGr={}))});var vGr=I(B9=>{"use strict";p();Object.defineProperty(B9,"__esModule",{value:!0});B9.InlayHintRefreshRequest=B9.InlayHintResolveRequest=B9.InlayHintRequest=void 0;var $ie=Sd(),yGr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=$ie.MessageDirection.clientToServer,t.type=new $ie.ProtocolRequestType(t.method)})(yGr||(B9.InlayHintRequest=yGr={}));var EGr;(function(t){t.method="inlayHint/resolve",t.messageDirection=$ie.MessageDirection.clientToServer,t.type=new $ie.ProtocolRequestType(t.method)})(EGr||(B9.InlayHintResolveRequest=EGr={}));var _Gr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=$ie.MessageDirection.serverToClient,t.type=new $ie.ProtocolRequestType0(t.method)})(_Gr||(B9.InlayHintRefreshRequest=_Gr={}))});var wGr=I(II=>{"use strict";p();Object.defineProperty(II,"__esModule",{value:!0});II.DiagnosticRefreshRequest=II.WorkspaceDiagnosticRequest=II.DocumentDiagnosticRequest=II.DocumentDiagnosticReportKind=II.DiagnosticServerCancellationData=void 0;var xGr=UV(),Vdo=D6e(),Vie=Sd(),CGr;(function(t){function e(r){let n=r;return n&&Vdo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(CGr||(II.DiagnosticServerCancellationData=CGr={}));var bGr;(function(t){t.Full="full",t.Unchanged="unchanged"})(bGr||(II.DocumentDiagnosticReportKind=bGr={}));var SGr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Vie.MessageDirection.clientToServer,t.type=new Vie.ProtocolRequestType(t.method),t.partialResult=new xGr.ProgressType})(SGr||(II.DocumentDiagnosticRequest=SGr={}));var TGr;(function(t){t.method="workspace/diagnostic",t.messageDirection=Vie.MessageDirection.clientToServer,t.type=new Vie.ProtocolRequestType(t.method),t.partialResult=new xGr.ProgressType})(TGr||(II.WorkspaceDiagnosticRequest=TGr={}));var IGr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Vie.MessageDirection.serverToClient,t.type=new Vie.ProtocolRequestType0(t.method)})(IGr||(II.DiagnosticRefreshRequest=IGr={}))});var OGr=I(Of=>{"use strict";p();Object.defineProperty(Of,"__esModule",{value:!0});Of.DidCloseNotebookDocumentNotification=Of.DidSaveNotebookDocumentNotification=Of.DidChangeNotebookDocumentNotification=Of.NotebookCellArrayChange=Of.DidOpenNotebookDocumentNotification=Of.NotebookDocumentSyncRegistrationType=Of.NotebookDocument=Of.NotebookCell=Of.ExecutionSummary=Of.NotebookCellKind=void 0;var fve=uve(),hP=D6e(),_N=Sd(),mPt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(mPt||(Of.NotebookCellKind=mPt={}));var gPt;(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 hP.objectLiteral(s)&&fve.uinteger.is(s.executionOrder)&&(s.success===void 0||hP.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})(gPt||(Of.ExecutionSummary=gPt={}));var $6e;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return hP.objectLiteral(c)&&mPt.is(c.kind)&&fve.DocumentUri.is(c.document)&&(c.metadata===void 0||hP.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)&&!gPt.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(V6e,"__esModule",{value:!0});V6e.InlineCompletionRequest=void 0;var BGr=Sd(),LGr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=BGr.MessageDirection.clientToServer,t.type=new BGr.ProtocolRequestType(t.method)})(LGr||(V6e.InlineCompletionRequest=LGr={}))});var J$r=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=Sd(),UGr=uve(),Om=D6e(),Wdo=uHr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return Wdo.ImplementationRequest},"get")});var zdo=pHr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return zdo.TypeDefinitionRequest},"get")});var W$r=gHr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return W$r.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return W$r.DidChangeWorkspaceFoldersNotification},"get")});var Ydo=EHr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return Ydo.ConfigurationRequest},"get")});var z$r=CHr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return z$r.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return z$r.ColorPresentationRequest},"get")});var Y$r=THr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return Y$r.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return Y$r.FoldingRangeRefreshRequest},"get")});var Kdo=wHr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return Kdo.DeclarationRequest},"get")});var Jdo=kHr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return Jdo.SelectionRangeRequest},"get")});var vPt=OHr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return vPt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return vPt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return vPt.WorkDoneProgressCancelNotification},"get")});var CPt=UHr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return CPt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return CPt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return CPt.CallHierarchyPrepareRequest},"get")});var zie=$Hr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return zie.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return zie.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return zie.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return zie.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return zie.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return zie.SemanticTokensRegistrationType},"get")});var Zdo=zHr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return Zdo.ShowDocumentRequest},"get")});var Xdo=JHr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return Xdo.LinkedEditingRangeRequest},"get")});var QV=oGr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return QV.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return QV.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return QV.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return QV.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return QV.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return QV.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return QV.WillDeleteFilesRequest},"get")});var bPt=uGr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return bPt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return bPt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return bPt.MonikerRequest},"get")});var SPt=hGr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return SPt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return SPt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return SPt.TypeHierarchySupertypesRequest},"get")});var K$r=AGr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return K$r.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return K$r.InlineValueRefreshRequest},"get")});var TPt=vGr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return TPt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return TPt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return TPt.InlayHintRefreshRequest},"get")});var pve=wGr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return pve.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return pve.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return pve.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return pve.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return pve.DiagnosticRefreshRequest},"get")});var vN=OGr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return vN.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return vN.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return vN.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return vN.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return vN.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return vN.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return vN.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return vN.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return vN.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return vN.DidCloseNotebookDocumentNotification},"get")});var efo=FGr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return efo.InlineCompletionRequest},"get")});var APt;(function(t){function e(r){let n=r;return Om.string(n)||Om.string(n.language)||Om.string(n.scheme)||Om.string(n.pattern)}a(e,"is"),t.is=e})(APt||(Ve.TextDocumentFilter=APt={}));var yPt;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(Om.string(n.notebookType)||Om.string(n.scheme)||Om.string(n.pattern))}a(e,"is"),t.is=e})(yPt||(Ve.NotebookDocumentFilter=yPt={}));var EPt;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(Om.string(n.notebook)||yPt.is(n.notebook))&&(n.language===void 0||Om.string(n.language))}a(e,"is"),t.is=e})(EPt||(Ve.NotebookCellTextDocumentFilter=EPt={}));var _Pt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Om.string(n)&&!APt.is(n)&&!EPt.is(n))return!1;return!0}a(e,"is"),t.is=e})(_Pt||(Ve.DocumentSelector=_Pt={}));var QGr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(QGr||(Ve.RegistrationRequest=QGr={}));var qGr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(qGr||(Ve.UnregistrationRequest=qGr={}));var jGr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(jGr||(Ve.ResourceOperationKind=jGr={}));var HGr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(HGr||(Ve.FailureHandlingKind=HGr={}));var GGr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(GGr||(Ve.PositionEncodingKind=GGr={}));var $Gr;(function(t){function e(r){let n=r;return n&&Om.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})($Gr||(Ve.StaticRegistrationOptions=$Gr={}));var VGr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||_Pt.is(n.documentSelector))}a(e,"is"),t.is=e})(VGr||(Ve.TextDocumentRegistrationOptions=VGr={}));var WGr;(function(t){function e(n){let o=n;return Om.objectLiteral(o)&&(o.workDoneProgress===void 0||Om.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Om.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(WGr||(Ve.WorkDoneProgressOptions=WGr={}));var zGr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zGr||(Ve.InitializeRequest=zGr={}));var YGr;(function(t){t.unknownProtocolVersion=1})(YGr||(Ve.InitializeErrorCodes=YGr={}));var KGr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(KGr||(Ve.InitializedNotification=KGr={}));var JGr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(JGr||(Ve.ShutdownRequest=JGr={}));var ZGr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(ZGr||(Ve.ExitNotification=ZGr={}));var XGr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(XGr||(Ve.DidChangeConfigurationNotification=XGr={}));var e$r;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(e$r||(Ve.MessageType=e$r={}));var t$r;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(t$r||(Ve.ShowMessageNotification=t$r={}));var r$r;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(r$r||(Ve.ShowMessageRequest=r$r={}));var n$r;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(n$r||(Ve.LogMessageNotification=n$r={}));var i$r;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(i$r||(Ve.TelemetryEventNotification=i$r={}));var o$r;(function(t){t.None=0,t.Full=1,t.Incremental=2})(o$r||(Ve.TextDocumentSyncKind=o$r={}));var s$r;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(s$r||(Ve.DidOpenTextDocumentNotification=s$r={}));var a$r;(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})(a$r||(Ve.TextDocumentContentChangeEvent=a$r={}));var c$r;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(c$r||(Ve.DidChangeTextDocumentNotification=c$r={}));var l$r;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(l$r||(Ve.DidCloseTextDocumentNotification=l$r={}));var u$r;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(u$r||(Ve.DidSaveTextDocumentNotification=u$r={}));var d$r;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(d$r||(Ve.TextDocumentSaveReason=d$r={}));var f$r;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(f$r||(Ve.WillSaveTextDocumentNotification=f$r={}));var p$r;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(p$r||(Ve.WillSaveTextDocumentWaitUntilRequest=p$r={}));var h$r;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(h$r||(Ve.DidChangeWatchedFilesNotification=h$r={}));var m$r;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(m$r||(Ve.FileChangeType=m$r={}));var g$r;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(UGr.URI.is(n.baseUri)||UGr.WorkspaceFolder.is(n.baseUri))&&Om.string(n.pattern)}a(e,"is"),t.is=e})(g$r||(Ve.RelativePattern=g$r={}));var A$r;(function(t){t.Create=1,t.Change=2,t.Delete=4})(A$r||(Ve.WatchKind=A$r={}));var y$r;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(y$r||(Ve.PublishDiagnosticsNotification=y$r={}));var E$r;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(E$r||(Ve.CompletionTriggerKind=E$r={}));var _$r;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(_$r||(Ve.CompletionRequest=_$r={}));var v$r;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(v$r||(Ve.CompletionResolveRequest=v$r={}));var C$r;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(C$r||(Ve.HoverRequest=C$r={}));var b$r;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(b$r||(Ve.SignatureHelpTriggerKind=b$r={}));var S$r;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(S$r||(Ve.SignatureHelpRequest=S$r={}));var T$r;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(T$r||(Ve.DefinitionRequest=T$r={}));var I$r;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(I$r||(Ve.ReferencesRequest=I$r={}));var x$r;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(x$r||(Ve.DocumentHighlightRequest=x$r={}));var w$r;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(w$r||(Ve.DocumentSymbolRequest=w$r={}));var R$r;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(R$r||(Ve.CodeActionRequest=R$r={}));var P$r;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(P$r||(Ve.CodeActionResolveRequest=P$r={}));var k$r;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(k$r||(Ve.WorkspaceSymbolRequest=k$r={}));var D$r;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(D$r||(Ve.WorkspaceSymbolResolveRequest=D$r={}));var N$r;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(N$r||(Ve.CodeLensRequest=N$r={}));var M$r;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(M$r||(Ve.CodeLensResolveRequest=M$r={}));var O$r;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(O$r||(Ve.CodeLensRefreshRequest=O$r={}));var B$r;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(B$r||(Ve.DocumentLinkRequest=B$r={}));var L$r;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(L$r||(Ve.DocumentLinkResolveRequest=L$r={}));var F$r;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(F$r||(Ve.DocumentFormattingRequest=F$r={}));var U$r;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(U$r||(Ve.DocumentRangeFormattingRequest=U$r={}));var Q$r;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(Q$r||(Ve.DocumentRangesFormattingRequest=Q$r={}));var q$r;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(q$r||(Ve.DocumentOnTypeFormattingRequest=q$r={}));var j$r;(function(t){t.Identifier=1})(j$r||(Ve.PrepareSupportDefaultBehavior=j$r={}));var H$r;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(H$r||(Ve.RenameRequest=H$r={}));var G$r;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(G$r||(Ve.PrepareRenameRequest=G$r={}));var $$r;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($$r||(Ve.ExecuteCommandRequest=$$r={}));var V$r;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(V$r||(Ve.ApplyWorkspaceEditRequest=V$r={}))});var X$r=I(W6e=>{"use strict";p();Object.defineProperty(W6e,"__esModule",{value:!0});W6e.createProtocolConnection=void 0;var Z$r=UV();function tfo(t,e,r,n){return Z$r.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Z$r.createMessageConnection)(t,e,r,n)}a(tfo,"createProtocolConnection");W6e.createProtocolConnection=tfo});var tVr=I(zv=>{"use strict";p();var rfo=zv&&zv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z6e=zv&&zv.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rfo(e,t,r)};Object.defineProperty(zv,"__esModule",{value:!0});zv.LSPErrorCodes=zv.createProtocolConnection=void 0;z6e(UV(),zv);z6e(uve(),zv);z6e(Sd(),zv);z6e(J$r(),zv);var nfo=X$r();Object.defineProperty(zv,"createProtocolConnection",{enumerable:!0,get:a(function(){return nfo.createProtocolConnection},"get")});var eVr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(eVr||(zv.LSPErrorCodes=eVr={}))});var ti=I(CN=>{"use strict";p();var ifo=CN&&CN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rVr=CN&&CN.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ifo(e,t,r)};Object.defineProperty(CN,"__esModule",{value:!0});CN.createProtocolConnection=void 0;var ofo=lPt();rVr(lPt(),CN);rVr(tVr(),CN);function sfo(t,e,r,n){return(0,ofo.createMessageConnection)(t,e,r,n)}a(sfo,"createProtocolConnection");CN.createProtocolConnection=sfo});var MNt=I(IQe=>{"use strict";p();Object.defineProperty(IQe,"__esModule",{value:!0});IQe.state=void 0;IQe.state={instrumenterImplementation:void 0}});var nae=I((p5t,aXr)=>{p();var Iqe=require("buffer"),cM=Iqe.Buffer;function sXr(t,e){for(var r in t)e[r]=t[r]}a(sXr,"copyProps");cM.from&&cM.alloc&&cM.allocUnsafe&&cM.allocUnsafeSlow?aXr.exports=Iqe:(sXr(Iqe,p5t),p5t.Buffer=_z);function _z(t,e,r){return cM(t,e,r)}a(_z,"SafeBuffer");_z.prototype=Object.create(cM.prototype);sXr(cM,_z);_z.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return cM(t,e,r)};_z.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=cM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};_z.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return cM(t)};_z.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Iqe.SlowBuffer(t)}});var h5t=I((vQl,cXr)=>{p();var xqe=nae().Buffer,SEo=require("stream"),TEo=require("util");function wqe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=xqe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=xqe.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(wqe,"DataStream");TEo.inherits(wqe,SEo);wqe.prototype.write=a(function(e){this.buffer=xqe.concat([this.buffer,xqe.from(e)]),this.emit("data",e)},"write");wqe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");cXr.exports=wqe});var uXr=I((SQl,lXr)=>{"use strict";p();function m5t(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(m5t,"getParamSize");var IEo={ES256:m5t(256),ES384:m5t(384),ES512:m5t(521)};function xEo(t){var e=IEo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(xEo,"getParamBytesForAlg");lXr.exports=xEo});var AXr=I((xQl,gXr)=>{"use strict";p();var Rqe=nae().Buffer,fXr=uXr(),Pqe=128,pXr=0,wEo=32,REo=16,PEo=2,hXr=REo|wEo|pXr<<6,kqe=PEo|pXr<<6;function kEo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(kEo,"base64Url");function mXr(t){if(Rqe.isBuffer(t))return t;if(typeof t=="string")return Rqe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(mXr,"signatureAsBuffer");function DEo(t,e){t=mXr(t);var r=fXr(e),n=r+1,o=t.length,s=0;if(t[s++]!==hXr)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Pqe|1)&&(c=t[s++]),o-s=Pqe;return o&&--n,n}a(dXr,"countPadding");function NEo(t,e){t=mXr(t);var r=fXr(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=dXr(t,0,r),s=dXr(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var l1e=require("buffer").Buffer,g5t=require("buffer").SlowBuffer;yXr.exports=Dqe;function Dqe(t,e){if(!l1e.isBuffer(t)||!l1e.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var oae=nae().Buffer,tx=require("crypto"),vXr=AXr(),_Xr=require("util"),BEo=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,N1e="secret must be a string or buffer",vae="key must be a string or a buffer",sCo="key must be a string, a buffer or an object",e4t=typeof ax.createPublicKey=="function";e4t&&(vae+=" or a KeyObject",N1e+="or a KeyObject");function Ien(t){if(!bae.isBuffer(t)&&typeof t!="string"&&(!e4t||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw $k(vae)}a(Ien,"checkIsPublicKey");function xen(t){if(!bae.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw $k(sCo)}a(xen,"checkIsPrivateKey");function aCo(t){if(!bae.isBuffer(t)){if(typeof t=="string")return t;if(!e4t||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw $k(N1e)}}a(aCo,"checkIsSecretKey");function t4t(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(t4t,"fromBase64");function wen(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var ACo=require("buffer").Buffer;Nen.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||ACo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Uen=I((jGl,Fen)=>{p();var yCo=Cae().Buffer,Men=K5t(),ECo=r4t(),_Co=require("stream"),Oen=n4t(),i4t=require("util");function Ben(t,e){return yCo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Ben,"base64url");function CCo(t,e,r){r=r||"utf8";var n=Ben(Oen(t),"binary"),o=Ben(Oen(e),r);return i4t.format("%s.%s",n,o)}a(CCo,"jwsSecuredInput");function Len(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=ECo(e.alg),c=CCo(e,r,o),l=s.sign(c,n);return i4t.format("%s.%s",c,l)}a(Len,"jwsSign");function aje(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 Men(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Men(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(aje,"SignStream");i4t.inherits(aje,_Co);aje.prototype.sign=a(function(){try{var e=Len({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");aje.sign=Len;Fen.exports=aje});var Yen=I(($Gl,zen)=>{p();var qen=Cae().Buffer,Qen=K5t(),vCo=r4t(),bCo=require("stream"),jen=n4t(),SCo=require("util"),TCo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function ICo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(ICo,"isObject");function xCo(t){if(ICo(t))return t;try{return JSON.parse(t)}catch{return}}a(xCo,"safeJsonParse");function Hen(t){var e=t.split(".",1)[0];return xCo(qen.from(e,"base64").toString("binary"))}a(Hen,"headerFromJWS");function wCo(t){return t.split(".",2).join(".")}a(wCo,"securedInputFromJWS");function Gen(t){return t.split(".")[2]}a(Gen,"signatureFromJWS");function RCo(t,e){e=e||"utf8";var r=t.split(".")[1];return qen.from(r,"base64").toString(e)}a(RCo,"payloadFromJWS");function $en(t){return TCo.test(t)&&!!Hen(t)}a($en,"isValidJws");function Ven(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=jen(t);var o=Gen(t),s=wCo(t),c=vCo(e);return c.verify(s,o,r)}a(Ven,"jwsVerify");function Wen(t,e){if(e=e||{},t=jen(t),!$en(t))return null;var r=Hen(t);if(!r)return null;var n=RCo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Gen(t)}}a(Wen,"jwsDecode");function Sae(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 Qen(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Qen(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(Sae,"VerifyStream");SCo.inherits(Sae,bCo);Sae.prototype.verify=a(function(){try{var e=Ven(this.signature.buffer,this.algorithm,this.key.buffer),r=Wen(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");Sae.decode=Wen;Sae.isValid=$en;Sae.verify=Ven;zen.exports=Sae});var lje=I(p7=>{p();var Ken=Uen(),cje=Yen(),kCo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];p7.ALGORITHMS=kCo;p7.sign=Ken.sign;p7.verify=cje.verify;p7.decode=cje.decode;p7.isValid=cje.isValid;p7.createSign=a(function(e){return new Ken(e)},"createSign");p7.createVerify=a(function(e){return new cje(e)},"createVerify")});var o4t=I((JGl,Jen)=>{p();var PCo=lje();Jen.exports=function(t,e){e=e||{};var r=PCo.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 O1e=I((XGl,Zen)=>{p();var uje=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");uje.prototype=Object.create(Error.prototype);uje.prototype.constructor=uje;Zen.exports=uje});var s4t=I((r$l,etn)=>{p();var Xen=O1e(),dje=a(function(t,e){Xen.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");dje.prototype=Object.create(Xen.prototype);dje.prototype.constructor=dje;etn.exports=dje});var a4t=I((o$l,rtn)=>{p();var ttn=O1e(),fje=a(function(t,e){ttn.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");fje.prototype=Object.create(ttn.prototype);fje.prototype.constructor=fje;rtn.exports=fje});var c4t=I((c$l,ntn)=>{p();var Tae=1e3,Iae=Tae*60,xae=Iae*60,Uz=xae*24,DCo=Uz*7,NCo=Uz*365.25;ntn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return MCo(t);if(r==="number"&&isFinite(t))return e.long?BCo(t):OCo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function MCo(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*NCo;case"weeks":case"week":case"w":return r*DCo;case"days":case"day":case"d":return r*Uz;case"hours":case"hour":case"hrs":case"hr":case"h":return r*xae;case"minutes":case"minute":case"mins":case"min":case"m":return r*Iae;case"seconds":case"second":case"secs":case"sec":case"s":return r*Tae;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(MCo,"parse");function OCo(t){var e=Math.abs(t);return e>=Uz?Math.round(t/Uz)+"d":e>=xae?Math.round(t/xae)+"h":e>=Iae?Math.round(t/Iae)+"m":e>=Tae?Math.round(t/Tae)+"s":t+"ms"}a(OCo,"fmtShort");function BCo(t){var e=Math.abs(t);return e>=Uz?pje(t,e,Uz,"day"):e>=xae?pje(t,e,xae,"hour"):e>=Iae?pje(t,e,Iae,"minute"):e>=Tae?pje(t,e,Tae,"second"):t+" ms"}a(BCo,"fmtLong");function pje(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(pje,"plural")});var l4t=I((d$l,itn)=>{p();var LCo=c4t();itn.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=LCo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var wae=I((p$l,otn)=>{"use strict";p();var FCo="2.0.0",UCo=Number.MAX_SAFE_INTEGER||9007199254740991,QCo=16,qCo=250,jCo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];otn.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:QCo,MAX_SAFE_BUILD_LENGTH:qCo,MAX_SAFE_INTEGER:UCo,RELEASE_TYPES:jCo,SEMVER_SPEC_VERSION:FCo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var B1e=I((m$l,stn)=>{"use strict";p();var HCo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};stn.exports=HCo});var Rae=I((yM,atn)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:u4t,MAX_SAFE_BUILD_LENGTH:GCo,MAX_LENGTH:$Co}=wae(),VCo=B1e();yM=atn.exports={};var WCo=yM.re=[],zCo=yM.safeRe=[],bn=yM.src=[],YCo=yM.safeSrc=[],Sn=yM.t={},KCo=0,d4t="[a-zA-Z0-9-]",JCo=[["\\s",1],["\\d",$Co],[d4t,GCo]],ZCo=a(t=>{for(let[e,r]of JCo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Lo=a((t,e,r)=>{let n=ZCo(e),o=KCo++;VCo(t,o,e),Sn[t]=o,bn[o]=e,YCo[o]=n,WCo[o]=new RegExp(e,r?"g":void 0),zCo[o]=new RegExp(n,r?"g":void 0)},"createToken");Lo("NUMERICIDENTIFIER","0|[1-9]\\d*");Lo("NUMERICIDENTIFIERLOOSE","\\d+");Lo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d4t}*`);Lo("MAINVERSION",`(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})`);Lo("MAINVERSIONLOOSE",`(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Lo("PRERELEASEIDENTIFIER",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIER]})`);Lo("PRERELEASEIDENTIFIERLOOSE",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Lo("PRERELEASE",`(?:-(${bn[Sn.PRERELEASEIDENTIFIER]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIER]})*))`);Lo("PRERELEASELOOSE",`(?:-?(${bn[Sn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIERLOOSE]})*))`);Lo("BUILDIDENTIFIER",`${d4t}+`);Lo("BUILD",`(?:\\+(${bn[Sn.BUILDIDENTIFIER]}(?:\\.${bn[Sn.BUILDIDENTIFIER]})*))`);Lo("FULLPLAIN",`v?${bn[Sn.MAINVERSION]}${bn[Sn.PRERELEASE]}?${bn[Sn.BUILD]}?`);Lo("FULL",`^${bn[Sn.FULLPLAIN]}$`);Lo("LOOSEPLAIN",`[v=\\s]*${bn[Sn.MAINVERSIONLOOSE]}${bn[Sn.PRERELEASELOOSE]}?${bn[Sn.BUILD]}?`);Lo("LOOSE",`^${bn[Sn.LOOSEPLAIN]}$`);Lo("GTLT","((?:<|>)?=?)");Lo("XRANGEIDENTIFIERLOOSE",`${bn[Sn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Lo("XRANGEIDENTIFIER",`${bn[Sn.NUMERICIDENTIFIER]}|x|X|\\*`);Lo("XRANGEPLAIN",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:${bn[Sn.PRERELEASE]})?${bn[Sn.BUILD]}?)?)?`);Lo("XRANGEPLAINLOOSE",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:${bn[Sn.PRERELEASELOOSE]})?${bn[Sn.BUILD]}?)?)?`);Lo("XRANGE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAIN]}$`);Lo("XRANGELOOSE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAINLOOSE]}$`);Lo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${u4t}})(?:\\.(\\d{1,${u4t}}))?(?:\\.(\\d{1,${u4t}}))?`);Lo("COERCE",`${bn[Sn.COERCEPLAIN]}(?:$|[^\\d])`);Lo("COERCEFULL",bn[Sn.COERCEPLAIN]+`(?:${bn[Sn.PRERELEASE]})?(?:${bn[Sn.BUILD]})?(?:$|[^\\d])`);Lo("COERCERTL",bn[Sn.COERCE],!0);Lo("COERCERTLFULL",bn[Sn.COERCEFULL],!0);Lo("LONETILDE","(?:~>?)");Lo("TILDETRIM",`(\\s*)${bn[Sn.LONETILDE]}\\s+`,!0);yM.tildeTrimReplace="$1~";Lo("TILDE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAIN]}$`);Lo("TILDELOOSE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Lo("LONECARET","(?:\\^)");Lo("CARETTRIM",`(\\s*)${bn[Sn.LONECARET]}\\s+`,!0);yM.caretTrimReplace="$1^";Lo("CARET",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAIN]}$`);Lo("CARETLOOSE",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Lo("COMPARATORLOOSE",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]})$|^$`);Lo("COMPARATOR",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.FULLPLAIN]})$|^$`);Lo("COMPARATORTRIM",`(\\s*)${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]}|${bn[Sn.XRANGEPLAIN]})`,!0);yM.comparatorTrimReplace="$1$2$3";Lo("HYPHENRANGE",`^\\s*(${bn[Sn.XRANGEPLAIN]})\\s+-\\s+(${bn[Sn.XRANGEPLAIN]})\\s*$`);Lo("HYPHENRANGELOOSE",`^\\s*(${bn[Sn.XRANGEPLAINLOOSE]})\\s+-\\s+(${bn[Sn.XRANGEPLAINLOOSE]})\\s*$`);Lo("STAR","(<|>)?=?\\s*\\*");Lo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Lo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var hje=I((E$l,ctn)=>{"use strict";p();var XCo=Object.freeze({loose:!0}),evo=Object.freeze({}),tvo=a(t=>t?typeof t!="object"?XCo:t:evo,"parseOptions");ctn.exports=tvo});var f4t=I((v$l,dtn)=>{"use strict";p();var ltn=/^[0-9]+$/,utn=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tutn(e,t),"rcompareIdentifiers");dtn.exports={compareIdentifiers:utn,rcompareIdentifiers:rvo}});var iA=I((T$l,ptn)=>{"use strict";p();var mje=B1e(),{MAX_LENGTH:ftn,MAX_SAFE_INTEGER:gje}=wae(),{safeRe:Aje,t:yje}=Rae(),nvo=hje(),{compareIdentifiers:p4t}=f4t(),h4t=class t{static{a(this,"SemVer")}constructor(e,r){if(r=nvo(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ftn)throw new TypeError(`version is longer than ${ftn} characters`);mje("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Aje[yje.LOOSE]:Aje[yje.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>gje||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gje||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gje||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(mje("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 p4t(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(mje("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 p4t(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?Aje[yje.PRERELEASELOOSE]:Aje[yje.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];n===!1&&(s=[r]),p4t(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):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}};ptn.exports=h4t});var h7=I((w$l,mtn)=>{"use strict";p();var htn=iA(),ivo=a((t,e,r=!1)=>{if(t instanceof htn)return t;try{return new htn(t,e)}catch(n){if(!r)return null;throw n}},"parse");mtn.exports=ivo});var Atn=I((P$l,gtn)=>{"use strict";p();var ovo=h7(),svo=a((t,e)=>{let r=ovo(t,e);return r?r.version:null},"valid");gtn.exports=svo});var Etn=I((M$l,ytn)=>{"use strict";p();var avo=h7(),cvo=a((t,e)=>{let r=avo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");ytn.exports=cvo});var vtn=I((L$l,Ctn)=>{"use strict";p();var _tn=iA(),lvo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new _tn(t instanceof _tn?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Ctn.exports=lvo});var Ttn=I((Q$l,Stn)=>{"use strict";p();var btn=h7(),uvo=a((t,e)=>{let r=btn(t,null,!0),n=btn(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");Stn.exports=uvo});var xtn=I((H$l,Itn)=>{"use strict";p();var dvo=iA(),fvo=a((t,e)=>new dvo(t,e).major,"major");Itn.exports=fvo});var Rtn=I((V$l,wtn)=>{"use strict";p();var pvo=iA(),hvo=a((t,e)=>new pvo(t,e).minor,"minor");wtn.exports=hvo});var Ptn=I((Y$l,ktn)=>{"use strict";p();var mvo=iA(),gvo=a((t,e)=>new mvo(t,e).patch,"patch");ktn.exports=gvo});var Ntn=I((Z$l,Dtn)=>{"use strict";p();var Avo=h7(),yvo=a((t,e)=>{let r=Avo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");Dtn.exports=yvo});var cx=I((tVl,Otn)=>{"use strict";p();var Mtn=iA(),Evo=a((t,e,r)=>new Mtn(t,r).compare(new Mtn(e,r)),"compare");Otn.exports=Evo});var Ltn=I((iVl,Btn)=>{"use strict";p();var _vo=cx(),Cvo=a((t,e,r)=>_vo(e,t,r),"rcompare");Btn.exports=Cvo});var Utn=I((aVl,Ftn)=>{"use strict";p();var vvo=cx(),bvo=a((t,e)=>vvo(t,e,!0),"compareLoose");Ftn.exports=bvo});var Eje=I((uVl,qtn)=>{"use strict";p();var Qtn=iA(),Svo=a((t,e,r)=>{let n=new Qtn(t,r),o=new Qtn(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");qtn.exports=Svo});var Htn=I((pVl,jtn)=>{"use strict";p();var Tvo=Eje(),Ivo=a((t,e)=>t.sort((r,n)=>Tvo(r,n,e)),"sort");jtn.exports=Ivo});var $tn=I((gVl,Gtn)=>{"use strict";p();var xvo=Eje(),wvo=a((t,e)=>t.sort((r,n)=>xvo(n,r,e)),"rsort");Gtn.exports=wvo});var L1e=I((EVl,Vtn)=>{"use strict";p();var Rvo=cx(),kvo=a((t,e,r)=>Rvo(t,e,r)>0,"gt");Vtn.exports=kvo});var _je=I((vVl,Wtn)=>{"use strict";p();var Pvo=cx(),Dvo=a((t,e,r)=>Pvo(t,e,r)<0,"lt");Wtn.exports=Dvo});var m4t=I((TVl,ztn)=>{"use strict";p();var Nvo=cx(),Mvo=a((t,e,r)=>Nvo(t,e,r)===0,"eq");ztn.exports=Mvo});var g4t=I((wVl,Ytn)=>{"use strict";p();var Ovo=cx(),Bvo=a((t,e,r)=>Ovo(t,e,r)!==0,"neq");Ytn.exports=Bvo});var Cje=I((PVl,Ktn)=>{"use strict";p();var Lvo=cx(),Fvo=a((t,e,r)=>Lvo(t,e,r)>=0,"gte");Ktn.exports=Fvo});var vje=I((MVl,Jtn)=>{"use strict";p();var Uvo=cx(),Qvo=a((t,e,r)=>Uvo(t,e,r)<=0,"lte");Jtn.exports=Qvo});var A4t=I((LVl,Ztn)=>{"use strict";p();var qvo=m4t(),jvo=g4t(),Hvo=L1e(),Gvo=Cje(),$vo=_je(),Vvo=vje(),Wvo=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 qvo(t,r,n);case"!=":return jvo(t,r,n);case">":return Hvo(t,r,n);case">=":return Gvo(t,r,n);case"<":return $vo(t,r,n);case"<=":return Vvo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");Ztn.exports=Wvo});var ern=I((QVl,Xtn)=>{"use strict";p();var zvo=iA(),Yvo=h7(),{safeRe:bje,t:Sje}=Rae(),Kvo=a((t,e)=>{if(t instanceof zvo)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?bje[Sje.COERCEFULL]:bje[Sje.COERCE]);else{let u=e.includePrerelease?bje[Sje.COERCERTLFULL]:bje[Sje.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 Yvo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");Xtn.exports=Kvo});var rrn=I((HVl,trn)=>{"use strict";p();var Jvo=h7(),Zvo=wae(),Xvo=iA(),ebo=a((t,e,r)=>{if(!Zvo.RELEASE_TYPES.includes(e))return null;let n=tbo(t,r);return n&&rbo(n,e)},"truncate"),tbo=a((t,e)=>{let r=t instanceof Xvo?t.version:t;return Jvo(r,e)},"cloneInputVersion"),rbo=a((t,e)=>{if(nbo(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"),nbo=a(t=>t.startsWith("pre"),"isPrerelease");trn.exports=ebo});var irn=I((VVl,nrn)=>{"use strict";p();var y4t=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}};nrn.exports=y4t});var lx=I((YVl,crn)=>{"use strict";p();var ibo=/\s+/g,E4t=class t{static{a(this,"Range")}constructor(e,r){if(r=sbo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof _4t)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(ibo," "),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=>!srn(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&&mbo(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(hbo,"");let n=((this.options.includePrerelease&&fbo)|(this.options.loose&&pbo))+":"+e,o=orn.get(n);if(o)return o;let s=this.options.loose,c=s?m_[oA.HYPHENRANGELOOSE]:m_[oA.HYPHENRANGE];e=e.replace(c,Tbo(this.options.includePrerelease)),Gu("hyphen replace",e),e=e.replace(m_[oA.COMPARATORTRIM],lbo),Gu("comparator trim",e),e=e.replace(m_[oA.TILDETRIM],ubo),Gu("tilde trim",e),e=e.replace(m_[oA.CARETTRIM],dbo),Gu("caret trim",e);let l=e.split(" ").map(h=>gbo(h,this.options)).join(" ").split(/\s+/).map(h=>Sbo(h,this.options));s&&(l=l.filter(h=>(Gu("loose invalid filter",h,this.options),!!h.match(m_[oA.COMPARATORLOOSE])))),Gu("range list",l);let u=new Map,d=l.map(h=>new _4t(h,this.options));for(let h of d){if(srn(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return orn.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>arn(n,r)&&e.set.some(o=>arn(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 abo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),mbo=a(t=>t.value==="","isAny"),arn=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"),gbo=a((t,e)=>(t=t.replace(m_[oA.BUILD],""),Gu("comp",t,e),t=Ebo(t,e),Gu("caret",t),t=Abo(t,e),Gu("tildes",t),t=Cbo(t,e),Gu("xrange",t),t=bbo(t,e),Gu("stars",t),t),"parseComparator"),g_=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),Abo=a((t,e)=>t.trim().split(/\s+/).map(r=>ybo(r,e)).join(" "),"replaceTildes"),ybo=a((t,e)=>{let r=e.loose?m_[oA.TILDELOOSE]:m_[oA.TILDE];return t.replace(r,(n,o,s,c,l)=>{Gu("tilde",t,n,o,s,c,l);let u;return g_(o)?u="":g_(s)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:g_(c)?u=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:l?(Gu("replaceTilde pr",l),u=`>=${o}.${s}.${c}-${l} <${o}.${+s+1}.0-0`):u=`>=${o}.${s}.${c} <${o}.${+s+1}.0-0`,Gu("tilde return",u),u})},"replaceTilde"),Ebo=a((t,e)=>t.trim().split(/\s+/).map(r=>_bo(r,e)).join(" "),"replaceCarets"),_bo=a((t,e)=>{Gu("caret",t,e);let r=e.loose?m_[oA.CARETLOOSE]:m_[oA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Gu("caret",t,o,s,c,l,u);let d;return g_(s)?d="":g_(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:g_(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Gu("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`):(Gu("no pr"),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`),Gu("caret return",d),d})},"replaceCaret"),Cbo=a((t,e)=>(Gu("replaceXRanges",t,e),t.split(/\s+/).map(r=>vbo(r,e)).join(" ")),"replaceXRanges"),vbo=a((t,e)=>{t=t.trim();let r=e.loose?m_[oA.XRANGELOOSE]:m_[oA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{Gu("xRange",t,n,o,s,c,l,u);let d=g_(s),f=d||g_(c),h=f||g_(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`),Gu("xRange return",n),n})},"replaceXRange"),bbo=a((t,e)=>(Gu("replaceStars",t,e),t.trim().replace(m_[oA.STAR],"")),"replaceStars"),Sbo=a((t,e)=>(Gu("replaceGTE0",t,e),t.trim().replace(m_[e.includePrerelease?oA.GTE0PRE:oA.GTE0],"")),"replaceGTE0"),Tbo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(g_(n)?r="":g_(o)?r=`>=${n}.0.0${t?"-0":""}`:g_(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,g_(d)?u="":g_(f)?u=`<${+d+1}.0.0-0`:g_(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"),Ibo=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 F1e=I((ZVl,hrn)=>{"use strict";p();var U1e=Symbol("SemVer ANY"),b4t=class t{static{a(this,"Comparator")}static get ANY(){return U1e}constructor(e,r){if(r=lrn(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),v4t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===U1e?this.value="":this.value=this.operator+this.semver.version,v4t("comp",this)}parse(e){let r=this.options.loose?urn[drn.COMPARATORLOOSE]:urn[drn.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 frn(n[2],this.options.loose):this.semver=U1e}toString(){return this.value}test(e){if(v4t("Comparator.test",e,this.options.loose),this.semver===U1e||e===U1e)return!0;if(typeof e=="string")try{e=new frn(e,this.options)}catch{return!1}return C4t(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 prn(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new prn(this.value,r).test(e.semver):(r=lrn(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("=")||C4t(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||C4t(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};hrn.exports=b4t;var lrn=hje(),{safeRe:urn,t:drn}=Rae(),C4t=A4t(),v4t=B1e(),frn=iA(),prn=lx()});var Q1e=I((tWl,mrn)=>{"use strict";p();var xbo=lx(),wbo=a((t,e,r)=>{try{e=new xbo(e,r)}catch{return!1}return e.test(t)},"satisfies");mrn.exports=wbo});var Arn=I((iWl,grn)=>{"use strict";p();var Rbo=lx(),kbo=a((t,e)=>new Rbo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");grn.exports=kbo});var Ern=I((aWl,yrn)=>{"use strict";p();var Pbo=iA(),Dbo=lx(),Nbo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Dbo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Pbo(n,r))}),n},"maxSatisfying");yrn.exports=Nbo});var Crn=I((uWl,_rn)=>{"use strict";p();var Mbo=iA(),Obo=lx(),Bbo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Obo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Mbo(n,r))}),n},"minSatisfying");_rn.exports=Bbo});var Srn=I((pWl,brn)=>{"use strict";p();var S4t=iA(),Lbo=lx(),vrn=L1e(),Fbo=a((t,e)=>{t=new Lbo(t,e);let r=new S4t("0.0.0");if(t.test(r)||(r=new S4t("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new S4t(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||vrn(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||vrn(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");brn.exports=Fbo});var Irn=I((gWl,Trn)=>{"use strict";p();var Ubo=lx(),Qbo=a((t,e)=>{try{return new Ubo(t,e).range||"*"}catch{return null}},"validRange");Trn.exports=Qbo});var Tje=I((EWl,krn)=>{"use strict";p();var qbo=iA(),Rrn=F1e(),{ANY:jbo}=Rrn,Hbo=lx(),Gbo=Q1e(),xrn=L1e(),wrn=_je(),$bo=vje(),Vbo=Cje(),Wbo=a((t,e,r,n)=>{t=new qbo(t,n),e=new Hbo(e,n);let o,s,c,l,u;switch(r){case">":o=xrn,s=$bo,c=wrn,l=">",u=">=";break;case"<":o=wrn,s=Vbo,c=xrn,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gbo(t,e,n))return!1;for(let d=0;d{g.semver===jbo&&(g=new Rrn(">=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");krn.exports=Wbo});var Drn=I((vWl,Prn)=>{"use strict";p();var zbo=Tje(),Ybo=a((t,e,r)=>zbo(t,e,">",r),"gtr");Prn.exports=Ybo});var Mrn=I((TWl,Nrn)=>{"use strict";p();var Kbo=Tje(),Jbo=a((t,e,r)=>Kbo(t,e,"<",r),"ltr");Nrn.exports=Jbo});var Lrn=I((wWl,Brn)=>{"use strict";p();var Orn=lx(),Zbo=a((t,e,r)=>(t=new Orn(t,r),e=new Orn(e,r),t.intersects(e,r)),"intersects");Brn.exports=Zbo});var Urn=I((PWl,Frn)=>{"use strict";p();var Xbo=Q1e(),e1o=cx();Frn.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>e1o(f,h,r));for(let f of c)Xbo(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 Qrn=lx(),x4t=F1e(),{ANY:T4t}=x4t,I4t=Q1e(),w4t=cx(),t1o=a((t,e,r={})=>{if(t===e)return!0;t=new Qrn(t,r),e=new Qrn(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=n1o(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),r1o=[new x4t(">=0.0.0-0")],qrn=[new x4t(">=0.0.0")],n1o=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===T4t){if(e.length===1&&e[0].semver===T4t)return!0;r.includePrerelease?t=r1o:t=qrn}if(e.length===1&&e[0].semver===T4t){if(r.includePrerelease)return!0;e=qrn}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=jrn(o,g,r):g.operator==="<"||g.operator==="<="?s=Hrn(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=w4t(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&&!I4t(g,String(o),r)||s&&!I4t(g,String(s),r))return null;for(let A of e)if(!I4t(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=jrn(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=Hrn(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"),jrn=a((t,e,r)=>{if(!t)return e;let n=w4t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),Hrn=a((t,e,r)=>{if(!t)return e;let n=w4t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");Grn.exports=t1o});var DL=I((BWl,zrn)=>{"use strict";p();var R4t=Rae(),Vrn=wae(),i1o=iA(),Wrn=f4t(),o1o=h7(),s1o=Atn(),a1o=Etn(),c1o=vtn(),l1o=Ttn(),u1o=xtn(),d1o=Rtn(),f1o=Ptn(),p1o=Ntn(),h1o=cx(),m1o=Ltn(),g1o=Utn(),A1o=Eje(),y1o=Htn(),E1o=$tn(),_1o=L1e(),C1o=_je(),v1o=m4t(),b1o=g4t(),S1o=Cje(),T1o=vje(),I1o=A4t(),x1o=ern(),w1o=rrn(),R1o=F1e(),k1o=lx(),P1o=Q1e(),D1o=Arn(),N1o=Ern(),M1o=Crn(),O1o=Srn(),B1o=Irn(),L1o=Tje(),F1o=Drn(),U1o=Mrn(),Q1o=Lrn(),q1o=Urn(),j1o=$rn();zrn.exports={parse:o1o,valid:s1o,clean:a1o,inc:c1o,diff:l1o,major:u1o,minor:d1o,patch:f1o,prerelease:p1o,compare:h1o,rcompare:m1o,compareLoose:g1o,compareBuild:A1o,sort:y1o,rsort:E1o,gt:_1o,lt:C1o,eq:v1o,neq:b1o,gte:S1o,lte:T1o,cmp:I1o,coerce:x1o,truncate:w1o,Comparator:R1o,Range:k1o,satisfies:P1o,toComparators:D1o,maxSatisfying:N1o,minSatisfying:M1o,minVersion:O1o,validRange:B1o,outside:L1o,gtr:F1o,ltr:U1o,intersects:Q1o,simplifyRange:q1o,subset:j1o,SemVer:i1o,re:R4t.re,src:R4t.src,tokens:R4t.t,SEMVER_SPEC_VERSION:Vrn.SEMVER_SPEC_VERSION,RELEASE_TYPES:Vrn.RELEASE_TYPES,compareIdentifiers:Wrn.compareIdentifiers,rcompareIdentifiers:Wrn.rcompareIdentifiers}});var Krn=I((FWl,Yrn)=>{p();var H1o=DL();Yrn.exports=H1o.satisfies(process.version,">=15.7.0")});var Zrn=I((QWl,Jrn)=>{p();var G1o=DL();Jrn.exports=G1o.satisfies(process.version,">=16.9.0")});var k4t=I((jWl,Xrn)=>{p();var $1o=Krn(),V1o=Zrn(),W1o={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},z1o={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Xrn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=W1o[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($1o)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=z1o[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(V1o){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 P4t=I((GWl,enn)=>{p();var Y1o=DL();enn.exports=Y1o.satisfies(process.version,"^6.12.0 || >=8.0.0")});var nnn=I((VWl,rnn)=>{p();var au=O1e(),K1o=s4t(),tnn=a4t(),J1o=o4t(),Z1o=l4t(),X1o=k4t(),eSo=P4t(),tSo=lje(),{KeyObject:rSo,createSecretKey:nSo,createPublicKey:iSo}=require("crypto"),D4t=["RS256","RS384","RS512"],oSo=["ES256","ES384","ES512"],N4t=["RS256","RS384","RS512"],sSo=["HS256","HS384","HS512"];eSo&&(D4t.splice(D4t.length,0,"PS256","PS384","PS512"),N4t.splice(N4t.length,0,"PS256","PS384","PS512"));rnn.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 au("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new au("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new au("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new au("jwt must be provided"));if(typeof t!="string")return o(new au("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new au("jwt malformed"));let l;try{l=J1o(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new au("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new au("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 au("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new au("jwt signature is required"));if(m&&!h)return o(new au("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new au('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof rSo))try{h=iSo(h)}catch{try{h=nSo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new au("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=sSo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=N4t:h.asymmetricKeyType==="ec"?r.algorithms=oSo:r.algorithms=D4t),r.algorithms.indexOf(l.header.alg)===-1)return o(new au("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new au(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new au(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{X1o(u.alg,h)}catch(y){return o(y)}let g;try{g=tSo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new au("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new au("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new K1o("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new au("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new tnn("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 au("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 au("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new au("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new au("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new au("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new au("iat required when maxAge is specified"));let y=Z1o(r.maxAge,A.iat);if(typeof y>"u")return o(new au('"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 tnn("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 lnn=I((YWl,cnn)=>{p();var inn=1/0,snn=9007199254740991,aSo=17976931348623157e292,onn=NaN,cSo="[object Arguments]",lSo="[object Function]",uSo="[object GeneratorFunction]",dSo="[object String]",fSo="[object Symbol]",pSo=/^\s+|\s+$/g,hSo=/^[-+]0x[0-9a-f]+$/i,mSo=/^0b[01]+$/i,gSo=/^0o[0-7]+$/i,ASo=/^(?:0|[1-9]\d*)$/,ySo=parseInt;function ESo(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&CSo(t,e,r)>-1}a(NSo,"includes");function MSo(t){return OSo(t)&&O4t.call(t,"callee")&&(!ISo.call(t,"callee")||xje.call(t)==cSo)}a(MSo,"isArguments");var ann=Array.isArray;function B4t(t){return t!=null&&LSo(t.length)&&!BSo(t)}a(B4t,"isArrayLike");function OSo(t){return L4t(t)&&B4t(t)}a(OSo,"isArrayLikeObject");function BSo(t){var e=M4t(t)?xje.call(t):"";return e==lSo||e==uSo}a(BSo,"isFunction");function LSo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=snn}a(LSo,"isLength");function M4t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(M4t,"isObject");function L4t(t){return!!t&&typeof t=="object"}a(L4t,"isObjectLike");function FSo(t){return typeof t=="string"||!ann(t)&&L4t(t)&&xje.call(t)==dSo}a(FSo,"isString");function USo(t){return typeof t=="symbol"||L4t(t)&&xje.call(t)==fSo}a(USo,"isSymbol");function QSo(t){if(!t)return t===0?t:0;if(t=jSo(t),t===inn||t===-inn){var e=t<0?-1:1;return e*aSo}return t===t?t:0}a(QSo,"toFinite");function qSo(t){var e=QSo(t),r=e%1;return e===e?r?e-r:e:0}a(qSo,"toInteger");function jSo(t){if(typeof t=="number")return t;if(USo(t))return onn;if(M4t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=M4t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(pSo,"");var r=mSo.test(t);return r||gSo.test(t)?ySo(t.slice(2),r?2:8):hSo.test(t)?onn:+t}a(jSo,"toNumber");function HSo(t){return B4t(t)?RSo(t):kSo(t)}a(HSo,"keys");function GSo(t){return t?SSo(t,HSo(t)):[]}a(GSo,"values");cnn.exports=NSo});var dnn=I((ZWl,unn)=>{p();var $So="[object Boolean]",VSo=Object.prototype,WSo=VSo.toString;function zSo(t){return t===!0||t===!1||YSo(t)&&WSo.call(t)==$So}a(zSo,"isBoolean");function YSo(t){return!!t&&typeof t=="object"}a(YSo,"isObjectLike");unn.exports=zSo});var gnn=I((tzl,mnn)=>{p();var fnn=1/0,KSo=17976931348623157e292,pnn=NaN,JSo="[object Symbol]",ZSo=/^\s+|\s+$/g,XSo=/^[-+]0x[0-9a-f]+$/i,eTo=/^0b[01]+$/i,tTo=/^0o[0-7]+$/i,rTo=parseInt,nTo=Object.prototype,iTo=nTo.toString;function oTo(t){return typeof t=="number"&&t==lTo(t)}a(oTo,"isInteger");function hnn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(hnn,"isObject");function sTo(t){return!!t&&typeof t=="object"}a(sTo,"isObjectLike");function aTo(t){return typeof t=="symbol"||sTo(t)&&iTo.call(t)==JSo}a(aTo,"isSymbol");function cTo(t){if(!t)return t===0?t:0;if(t=uTo(t),t===fnn||t===-fnn){var e=t<0?-1:1;return e*KSo}return t===t?t:0}a(cTo,"toFinite");function lTo(t){var e=cTo(t),r=e%1;return e===e?r?e-r:e:0}a(lTo,"toInteger");function uTo(t){if(typeof t=="number")return t;if(aTo(t))return pnn;if(hnn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=hnn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(ZSo,"");var r=eTo.test(t);return r||tTo.test(t)?rTo(t.slice(2),r?2:8):XSo.test(t)?pnn:+t}a(uTo,"toNumber");mnn.exports=oTo});var ynn=I((izl,Ann)=>{p();var dTo="[object Number]",fTo=Object.prototype,pTo=fTo.toString;function hTo(t){return!!t&&typeof t=="object"}a(hTo,"isObjectLike");function mTo(t){return typeof t=="number"||hTo(t)&&pTo.call(t)==dTo}a(mTo,"isNumber");Ann.exports=mTo});var vnn=I((azl,Cnn)=>{p();var gTo="[object Object]";function ATo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(ATo,"isHostObject");function yTo(t,e){return function(r){return t(e(r))}}a(yTo,"overArg");var ETo=Function.prototype,Enn=Object.prototype,_nn=ETo.toString,_To=Enn.hasOwnProperty,CTo=_nn.call(Object),vTo=Enn.toString,bTo=yTo(Object.getPrototypeOf,Object);function STo(t){return!!t&&typeof t=="object"}a(STo,"isObjectLike");function TTo(t){if(!STo(t)||vTo.call(t)!=gTo||ATo(t))return!1;var e=bTo(t);if(e===null)return!0;var r=_To.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&_nn.call(r)==CTo}a(TTo,"isPlainObject");Cnn.exports=TTo});var Snn=I((uzl,bnn)=>{p();var ITo="[object String]",xTo=Object.prototype,wTo=xTo.toString,RTo=Array.isArray;function kTo(t){return!!t&&typeof t=="object"}a(kTo,"isObjectLike");function PTo(t){return typeof t=="string"||!RTo(t)&&kTo(t)&&wTo.call(t)==ITo}a(PTo,"isString");bnn.exports=PTo});var Rnn=I((pzl,wnn)=>{p();var DTo="Expected a function",Tnn=1/0,NTo=17976931348623157e292,Inn=NaN,MTo="[object Symbol]",OTo=/^\s+|\s+$/g,BTo=/^[-+]0x[0-9a-f]+$/i,LTo=/^0b[01]+$/i,FTo=/^0o[0-7]+$/i,UTo=parseInt,QTo=Object.prototype,qTo=QTo.toString;function jTo(t,e){var r;if(typeof e!="function")throw new TypeError(DTo);return t=WTo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(jTo,"before");function HTo(t){return jTo(2,t)}a(HTo,"once");function xnn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(xnn,"isObject");function GTo(t){return!!t&&typeof t=="object"}a(GTo,"isObjectLike");function $To(t){return typeof t=="symbol"||GTo(t)&&qTo.call(t)==MTo}a($To,"isSymbol");function VTo(t){if(!t)return t===0?t:0;if(t=zTo(t),t===Tnn||t===-Tnn){var e=t<0?-1:1;return e*NTo}return t===t?t:0}a(VTo,"toFinite");function WTo(t){var e=VTo(t),r=e%1;return e===e?r?e-r:e:0}a(WTo,"toInteger");function zTo(t){if(typeof t=="number")return t;if($To(t))return Inn;if(xnn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=xnn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(OTo,"");var r=LTo.test(t);return r||FTo.test(t)?UTo(t.slice(2),r?2:8):BTo.test(t)?Inn:+t}a(zTo,"toNumber");wnn.exports=HTo});var Fnn=I((gzl,Lnn)=>{p();var knn=l4t(),YTo=P4t(),KTo=k4t(),Pnn=lje(),JTo=lnn(),wje=dnn(),Dnn=gnn(),F4t=ynn(),Mnn=vnn(),m7=Snn(),ZTo=Rnn(),{KeyObject:XTo,createSecretKey:eIo,createPrivateKey:tIo}=require("crypto"),Onn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];YTo&&Onn.splice(3,0,"PS256","PS384","PS512");var rIo={expiresIn:{isValid:a(function(t){return Dnn(t)||m7(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return Dnn(t)||m7(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return m7(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:JTo.bind(null,Onn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Mnn,message:'"header" must be an object'},encoding:{isValid:m7,message:'"encoding" must be a string'},issuer:{isValid:m7,message:'"issuer" must be a string'},subject:{isValid:m7,message:'"subject" must be a string'},jwtid:{isValid:m7,message:'"jwtid" must be a string'},noTimestamp:{isValid:wje,message:'"noTimestamp" must be a boolean'},keyid:{isValid:m7,message:'"keyid" must be a string'},mutatePayload:{isValid:wje,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:wje,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:wje,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},nIo={iat:{isValid:F4t,message:'"iat" should be a number of seconds'},exp:{isValid:F4t,message:'"exp" should be a number of seconds'},nbf:{isValid:F4t,message:'"nbf" should be a number of seconds'}};function Bnn(t,e,r,n){if(!Mnn(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(Bnn,"validate");function iIo(t){return Bnn(rIo,!1,t,"options")}a(iIo,"validateOptions");function oIo(t){return Bnn(nIo,!0,t,"payload")}a(oIo,"validatePayload");var Nnn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},sIo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Lnn.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 XTo))try{e=tIo(e)}catch{try{e=eIo(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{oIo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=sIo.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{iIo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{KTo(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=knn(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=knn(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(Nnn).forEach(function(d){let f=Nnn[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&&ZTo(n),Pnn.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=Pnn.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 Qnn=I((Ezl,Unn)=>{p();Unn.exports={decode:o4t(),verify:nnn(),sign:Fnn(),JsonWebTokenError:O1e(),NotBeforeError:s4t(),TokenExpiredError:a4t()}});var mBt=I((pru,Qin)=>{p();function cxo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=c4t(),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 k=r.formatters[x];if(typeof k=="function"){let D=E[T];R=k.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();lS.formatArgs=uxo;lS.save=dxo;lS.load=fxo;lS.useColors=lxo;lS.storage=pxo();lS.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`."))}})();lS.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 lxo(){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(lxo,"useColors");function uxo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+oHe.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(uxo,"formatArgs");lS.log=console.debug||console.log||(()=>{});function dxo(t){try{t?lS.storage.setItem("debug",t):lS.storage.removeItem("debug")}catch{}}a(dxo,"save");function fxo(){let t;try{t=lS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(fxo,"load");function pxo(){try{return localStorage}catch{}}a(pxo,"localstorage");oHe.exports=mBt()(lS);var{formatters:hxo}=oHe.exports;hxo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Hin=I((yru,jin)=>{"use strict";p();jin.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 mxo=require("os"),Gin=require("tty"),dx=Hin(),{env:jm}=process,y7;dx("no-color")||dx("no-colors")||dx("color=false")||dx("color=never")?y7=0:(dx("color")||dx("colors")||dx("color=true")||dx("color=always"))&&(y7=1);"FORCE_COLOR"in jm&&(jm.FORCE_COLOR==="true"?y7=1:jm.FORCE_COLOR==="false"?y7=0:y7=jm.FORCE_COLOR.length===0?1:Math.min(parseInt(jm.FORCE_COLOR,10),3));function gBt(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(gBt,"translateLevel");function ABt(t,e){if(y7===0)return 0;if(dx("color=16m")||dx("color=full")||dx("color=truecolor"))return 3;if(dx("color=256"))return 2;if(t&&!e&&y7===void 0)return 0;let r=y7||0;if(jm.TERM==="dumb")return r;if(process.platform==="win32"){let n=mxo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in jm)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in jm)||jm.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in jm)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(jm.TEAMCITY_VERSION)?1:0;if(jm.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in jm){let n=parseInt((jm.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(jm.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(jm.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(jm.TERM)||"COLORTERM"in jm?1:r}a(ABt,"supportsColor");function gxo(t){let e=ABt(t,t&&t.isTTY);return gBt(e)}a(gxo,"getSupportLevel");$in.exports={supportsColor:gxo,stdout:gBt(ABt(!0,Gin.isatty(1))),stderr:gBt(ABt(!0,Gin.isatty(2)))}});var Win=I((aA,cHe)=>{p();var Axo=require("tty"),aHe=require("util");aA.init=Sxo;aA.log=Cxo;aA.formatArgs=Exo;aA.save=vxo;aA.load=bxo;aA.useColors=yxo;aA.destroy=aHe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");aA.colors=[6,2,3,4,5,1];try{let t=sHe();t&&(t.stderr||t).level>=2&&(aA.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{}aA.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 yxo(){return"colors"in aA.inspectOpts?!!aA.inspectOpts.colors:Axo.isatty(process.stderr.fd)}a(yxo,"useColors");function Exo(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".`,u1e="secret must be a string or buffer",iae="key must be a string or a buffer",LEo="key must be a string, a buffer or an object",y5t=typeof tx.createPublicKey=="function";y5t&&(iae+=" or a KeyObject",u1e+="or a KeyObject");function CXr(t){if(!oae.isBuffer(t)&&typeof t!="string"&&(!y5t||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw FP(iae)}a(CXr,"checkIsPublicKey");function bXr(t){if(!oae.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw FP(LEo)}a(bXr,"checkIsPrivateKey");function FEo(t){if(!oae.isBuffer(t)){if(typeof t=="string")return t;if(!y5t||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw FP(u1e)}}a(FEo,"checkIsSecretKey");function E5t(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(E5t,"fromBase64");function SXr(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var zEo=require("buffer").Buffer;RXr.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||zEo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var OXr=I((UQl,MXr)=>{p();var YEo=nae().Buffer,PXr=h5t(),KEo=_5t(),JEo=require("stream"),kXr=v5t(),C5t=require("util");function DXr(t,e){return YEo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(DXr,"base64url");function ZEo(t,e,r){r=r||"utf8";var n=DXr(kXr(t),"binary"),o=DXr(kXr(e),r);return C5t.format("%s.%s",n,o)}a(ZEo,"jwsSecuredInput");function NXr(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=KEo(e.alg),c=ZEo(e,r,o),l=s.sign(c,n);return C5t.format("%s.%s",c,l)}a(NXr,"jwsSign");function Nqe(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 PXr(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new PXr(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(Nqe,"SignStream");C5t.inherits(Nqe,JEo);Nqe.prototype.sign=a(function(){try{var e=NXr({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");Nqe.sign=NXr;MXr.exports=Nqe});var $Xr=I((jQl,GXr)=>{p();var LXr=nae().Buffer,BXr=h5t(),XEo=_5t(),e_o=require("stream"),FXr=v5t(),t_o=require("util"),r_o=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function n_o(t){return Object.prototype.toString.call(t)==="[object Object]"}a(n_o,"isObject");function i_o(t){if(n_o(t))return t;try{return JSON.parse(t)}catch{return}}a(i_o,"safeJsonParse");function UXr(t){var e=t.split(".",1)[0];return i_o(LXr.from(e,"base64").toString("binary"))}a(UXr,"headerFromJWS");function o_o(t){return t.split(".",2).join(".")}a(o_o,"securedInputFromJWS");function QXr(t){return t.split(".")[2]}a(QXr,"signatureFromJWS");function s_o(t,e){e=e||"utf8";var r=t.split(".")[1];return LXr.from(r,"base64").toString(e)}a(s_o,"payloadFromJWS");function qXr(t){return r_o.test(t)&&!!UXr(t)}a(qXr,"isValidJws");function jXr(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=FXr(t);var o=QXr(t),s=o_o(t),c=XEo(e);return c.verify(s,o,r)}a(jXr,"jwsVerify");function HXr(t,e){if(e=e||{},t=FXr(t),!qXr(t))return null;var r=UXr(t);if(!r)return null;var n=s_o(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:QXr(t)}}a(HXr,"jwsDecode");function sae(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 BXr(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new BXr(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(sae,"VerifyStream");t_o.inherits(sae,e_o);sae.prototype.verify=a(function(){try{var e=jXr(this.signature.buffer,this.algorithm,this.key.buffer),r=HXr(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");sae.decode=HXr;sae.isValid=qXr;sae.verify=jXr;GXr.exports=sae});var Oqe=I(e7=>{p();var VXr=OXr(),Mqe=$Xr(),a_o=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e7.ALGORITHMS=a_o;e7.sign=VXr.sign;e7.verify=Mqe.verify;e7.decode=Mqe.decode;e7.isValid=Mqe.isValid;e7.createSign=a(function(e){return new VXr(e)},"createSign");e7.createVerify=a(function(e){return new Mqe(e)},"createVerify")});var b5t=I((zQl,WXr)=>{p();var c_o=Oqe();WXr.exports=function(t,e){e=e||{};var r=c_o.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 f1e=I((KQl,zXr)=>{p();var Bqe=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");Bqe.prototype=Object.create(Error.prototype);Bqe.prototype.constructor=Bqe;zXr.exports=Bqe});var S5t=I((XQl,KXr)=>{p();var YXr=f1e(),Lqe=a(function(t,e){YXr.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");Lqe.prototype=Object.create(YXr.prototype);Lqe.prototype.constructor=Lqe;KXr.exports=Lqe});var T5t=I((rql,ZXr)=>{p();var JXr=f1e(),Fqe=a(function(t,e){JXr.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");Fqe.prototype=Object.create(JXr.prototype);Fqe.prototype.constructor=Fqe;ZXr.exports=Fqe});var I5t=I((oql,XXr)=>{p();var aae=1e3,cae=aae*60,lae=cae*60,vz=lae*24,l_o=vz*7,u_o=vz*365.25;XXr.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return d_o(t);if(r==="number"&&isFinite(t))return e.long?p_o(t):f_o(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function d_o(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*u_o;case"weeks":case"week":case"w":return r*l_o;case"days":case"day":case"d":return r*vz;case"hours":case"hour":case"hrs":case"hr":case"h":return r*lae;case"minutes":case"minute":case"mins":case"min":case"m":return r*cae;case"seconds":case"second":case"secs":case"sec":case"s":return r*aae;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(d_o,"parse");function f_o(t){var e=Math.abs(t);return e>=vz?Math.round(t/vz)+"d":e>=lae?Math.round(t/lae)+"h":e>=cae?Math.round(t/cae)+"m":e>=aae?Math.round(t/aae)+"s":t+"ms"}a(f_o,"fmtShort");function p_o(t){var e=Math.abs(t);return e>=vz?Uqe(t,e,vz,"day"):e>=lae?Uqe(t,e,lae,"hour"):e>=cae?Uqe(t,e,cae,"minute"):e>=aae?Uqe(t,e,aae,"second"):t+" ms"}a(p_o,"fmtLong");function Uqe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Uqe,"plural")});var x5t=I((cql,een)=>{p();var h_o=I5t();een.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=h_o(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var uae=I((uql,ten)=>{"use strict";p();var m_o="2.0.0",g_o=Number.MAX_SAFE_INTEGER||9007199254740991,A_o=16,y_o=250,E_o=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ten.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:A_o,MAX_SAFE_BUILD_LENGTH:y_o,MAX_SAFE_INTEGER:g_o,RELEASE_TYPES:E_o,SEMVER_SPEC_VERSION:m_o,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var p1e=I((fql,ren)=>{"use strict";p();var __o=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};ren.exports=__o});var dae=I((lM,nen)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:w5t,MAX_SAFE_BUILD_LENGTH:v_o,MAX_LENGTH:C_o}=uae(),b_o=p1e();lM=nen.exports={};var S_o=lM.re=[],T_o=lM.safeRe=[],bn=lM.src=[],I_o=lM.safeSrc=[],Sn=lM.t={},x_o=0,R5t="[a-zA-Z0-9-]",w_o=[["\\s",1],["\\d",C_o],[R5t,v_o]],R_o=a(t=>{for(let[e,r]of w_o)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Oo=a((t,e,r)=>{let n=R_o(e),o=x_o++;b_o(t,o,e),Sn[t]=o,bn[o]=e,I_o[o]=n,S_o[o]=new RegExp(e,r?"g":void 0),T_o[o]=new RegExp(n,r?"g":void 0)},"createToken");Oo("NUMERICIDENTIFIER","0|[1-9]\\d*");Oo("NUMERICIDENTIFIERLOOSE","\\d+");Oo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${R5t}*`);Oo("MAINVERSION",`(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})`);Oo("MAINVERSIONLOOSE",`(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Oo("PRERELEASEIDENTIFIER",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIER]})`);Oo("PRERELEASEIDENTIFIERLOOSE",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Oo("PRERELEASE",`(?:-(${bn[Sn.PRERELEASEIDENTIFIER]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIER]})*))`);Oo("PRERELEASELOOSE",`(?:-?(${bn[Sn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIERLOOSE]})*))`);Oo("BUILDIDENTIFIER",`${R5t}+`);Oo("BUILD",`(?:\\+(${bn[Sn.BUILDIDENTIFIER]}(?:\\.${bn[Sn.BUILDIDENTIFIER]})*))`);Oo("FULLPLAIN",`v?${bn[Sn.MAINVERSION]}${bn[Sn.PRERELEASE]}?${bn[Sn.BUILD]}?`);Oo("FULL",`^${bn[Sn.FULLPLAIN]}$`);Oo("LOOSEPLAIN",`[v=\\s]*${bn[Sn.MAINVERSIONLOOSE]}${bn[Sn.PRERELEASELOOSE]}?${bn[Sn.BUILD]}?`);Oo("LOOSE",`^${bn[Sn.LOOSEPLAIN]}$`);Oo("GTLT","((?:<|>)?=?)");Oo("XRANGEIDENTIFIERLOOSE",`${bn[Sn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Oo("XRANGEIDENTIFIER",`${bn[Sn.NUMERICIDENTIFIER]}|x|X|\\*`);Oo("XRANGEPLAIN",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:${bn[Sn.PRERELEASE]})?${bn[Sn.BUILD]}?)?)?`);Oo("XRANGEPLAINLOOSE",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:${bn[Sn.PRERELEASELOOSE]})?${bn[Sn.BUILD]}?)?)?`);Oo("XRANGE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAIN]}$`);Oo("XRANGELOOSE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAINLOOSE]}$`);Oo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${w5t}})(?:\\.(\\d{1,${w5t}}))?(?:\\.(\\d{1,${w5t}}))?`);Oo("COERCE",`${bn[Sn.COERCEPLAIN]}(?:$|[^\\d])`);Oo("COERCEFULL",bn[Sn.COERCEPLAIN]+`(?:${bn[Sn.PRERELEASE]})?(?:${bn[Sn.BUILD]})?(?:$|[^\\d])`);Oo("COERCERTL",bn[Sn.COERCE],!0);Oo("COERCERTLFULL",bn[Sn.COERCEFULL],!0);Oo("LONETILDE","(?:~>?)");Oo("TILDETRIM",`(\\s*)${bn[Sn.LONETILDE]}\\s+`,!0);lM.tildeTrimReplace="$1~";Oo("TILDE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAIN]}$`);Oo("TILDELOOSE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Oo("LONECARET","(?:\\^)");Oo("CARETTRIM",`(\\s*)${bn[Sn.LONECARET]}\\s+`,!0);lM.caretTrimReplace="$1^";Oo("CARET",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAIN]}$`);Oo("CARETLOOSE",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Oo("COMPARATORLOOSE",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]})$|^$`);Oo("COMPARATOR",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.FULLPLAIN]})$|^$`);Oo("COMPARATORTRIM",`(\\s*)${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]}|${bn[Sn.XRANGEPLAIN]})`,!0);lM.comparatorTrimReplace="$1$2$3";Oo("HYPHENRANGE",`^\\s*(${bn[Sn.XRANGEPLAIN]})\\s+-\\s+(${bn[Sn.XRANGEPLAIN]})\\s*$`);Oo("HYPHENRANGELOOSE",`^\\s*(${bn[Sn.XRANGEPLAINLOOSE]})\\s+-\\s+(${bn[Sn.XRANGEPLAINLOOSE]})\\s*$`);Oo("STAR","(<|>)?=?\\s*\\*");Oo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Oo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Qqe=I((gql,ien)=>{"use strict";p();var P_o=Object.freeze({loose:!0}),k_o=Object.freeze({}),D_o=a(t=>t?typeof t!="object"?P_o:t:k_o,"parseOptions");ien.exports=D_o});var P5t=I((Eql,aen)=>{"use strict";p();var oen=/^[0-9]+$/,sen=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tsen(e,t),"rcompareIdentifiers");aen.exports={compareIdentifiers:sen,rcompareIdentifiers:N_o}});var sA=I((Cql,len)=>{"use strict";p();var qqe=p1e(),{MAX_LENGTH:cen,MAX_SAFE_INTEGER:jqe}=uae(),{safeRe:Hqe,t:Gqe}=dae(),M_o=Qqe(),{compareIdentifiers:k5t}=P5t(),D5t=class t{static{a(this,"SemVer")}constructor(e,r){if(r=M_o(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>cen)throw new TypeError(`version is longer than ${cen} characters`);qqe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Hqe[Gqe.LOOSE]:Hqe[Gqe.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>jqe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>jqe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>jqe||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(qqe("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 k5t(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(qqe("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 k5t(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?Hqe[Gqe.PRERELEASELOOSE]:Hqe[Gqe.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];n===!1&&(s=[r]),k5t(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):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}};len.exports=D5t});var t7=I((Tql,den)=>{"use strict";p();var uen=sA(),O_o=a((t,e,r=!1)=>{if(t instanceof uen)return t;try{return new uen(t,e)}catch(n){if(!r)return null;throw n}},"parse");den.exports=O_o});var pen=I((wql,fen)=>{"use strict";p();var B_o=t7(),L_o=a((t,e)=>{let r=B_o(t,e);return r?r.version:null},"valid");fen.exports=L_o});var men=I((kql,hen)=>{"use strict";p();var F_o=t7(),U_o=a((t,e)=>{let r=F_o(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");hen.exports=U_o});var yen=I((Mql,Aen)=>{"use strict";p();var gen=sA(),Q_o=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new gen(t instanceof gen?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Aen.exports=Q_o});var ven=I((Lql,_en)=>{"use strict";p();var Een=t7(),q_o=a((t,e)=>{let r=Een(t,null,!0),n=Een(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");_en.exports=q_o});var ben=I((Qql,Cen)=>{"use strict";p();var j_o=sA(),H_o=a((t,e)=>new j_o(t,e).major,"major");Cen.exports=H_o});var Ten=I((Hql,Sen)=>{"use strict";p();var G_o=sA(),$_o=a((t,e)=>new G_o(t,e).minor,"minor");Sen.exports=$_o});var xen=I((Vql,Ien)=>{"use strict";p();var V_o=sA(),W_o=a((t,e)=>new V_o(t,e).patch,"patch");Ien.exports=W_o});var Ren=I((Yql,wen)=>{"use strict";p();var z_o=t7(),Y_o=a((t,e)=>{let r=z_o(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");wen.exports=Y_o});var rx=I((Zql,ken)=>{"use strict";p();var Pen=sA(),K_o=a((t,e,r)=>new Pen(t,r).compare(new Pen(e,r)),"compare");ken.exports=K_o});var Nen=I((tjl,Den)=>{"use strict";p();var J_o=rx(),Z_o=a((t,e,r)=>J_o(e,t,r),"rcompare");Den.exports=Z_o});var Oen=I((ijl,Men)=>{"use strict";p();var X_o=rx(),evo=a((t,e)=>X_o(t,e,!0),"compareLoose");Men.exports=evo});var $qe=I((ajl,Len)=>{"use strict";p();var Ben=sA(),tvo=a((t,e,r)=>{let n=new Ben(t,r),o=new Ben(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");Len.exports=tvo});var Uen=I((ujl,Fen)=>{"use strict";p();var rvo=$qe(),nvo=a((t,e)=>t.sort((r,n)=>rvo(r,n,e)),"sort");Fen.exports=nvo});var qen=I((pjl,Qen)=>{"use strict";p();var ivo=$qe(),ovo=a((t,e)=>t.sort((r,n)=>ivo(n,r,e)),"rsort");Qen.exports=ovo});var h1e=I((gjl,jen)=>{"use strict";p();var svo=rx(),avo=a((t,e,r)=>svo(t,e,r)>0,"gt");jen.exports=avo});var Vqe=I((Ejl,Hen)=>{"use strict";p();var cvo=rx(),lvo=a((t,e,r)=>cvo(t,e,r)<0,"lt");Hen.exports=lvo});var N5t=I((Cjl,Gen)=>{"use strict";p();var uvo=rx(),dvo=a((t,e,r)=>uvo(t,e,r)===0,"eq");Gen.exports=dvo});var M5t=I((Tjl,$en)=>{"use strict";p();var fvo=rx(),pvo=a((t,e,r)=>fvo(t,e,r)!==0,"neq");$en.exports=pvo});var Wqe=I((wjl,Ven)=>{"use strict";p();var hvo=rx(),mvo=a((t,e,r)=>hvo(t,e,r)>=0,"gte");Ven.exports=mvo});var zqe=I((kjl,Wen)=>{"use strict";p();var gvo=rx(),Avo=a((t,e,r)=>gvo(t,e,r)<=0,"lte");Wen.exports=Avo});var O5t=I((Mjl,zen)=>{"use strict";p();var yvo=N5t(),Evo=M5t(),_vo=h1e(),vvo=Wqe(),Cvo=Vqe(),bvo=zqe(),Svo=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 yvo(t,r,n);case"!=":return Evo(t,r,n);case">":return _vo(t,r,n);case">=":return vvo(t,r,n);case"<":return Cvo(t,r,n);case"<=":return bvo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");zen.exports=Svo});var Ken=I((Ljl,Yen)=>{"use strict";p();var Tvo=sA(),Ivo=t7(),{safeRe:Yqe,t:Kqe}=dae(),xvo=a((t,e)=>{if(t instanceof Tvo)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?Yqe[Kqe.COERCEFULL]:Yqe[Kqe.COERCE]);else{let u=e.includePrerelease?Yqe[Kqe.COERCERTLFULL]:Yqe[Kqe.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 Ivo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");Yen.exports=xvo});var Zen=I((Qjl,Jen)=>{"use strict";p();var wvo=t7(),Rvo=uae(),Pvo=sA(),kvo=a((t,e,r)=>{if(!Rvo.RELEASE_TYPES.includes(e))return null;let n=Dvo(t,r);return n&&Nvo(n,e)},"truncate"),Dvo=a((t,e)=>{let r=t instanceof Pvo?t.version:t;return wvo(r,e)},"cloneInputVersion"),Nvo=a((t,e)=>{if(Mvo(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"),Mvo=a(t=>t.startsWith("pre"),"isPrerelease");Jen.exports=kvo});var etn=I((Hjl,Xen)=>{"use strict";p();var B5t=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}};Xen.exports=B5t});var nx=I((Vjl,itn)=>{"use strict";p();var Ovo=/\s+/g,L5t=class t{static{a(this,"Range")}constructor(e,r){if(r=Lvo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof F5t)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(Ovo," "),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=>!rtn(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&&Vvo(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($vo,"");let n=((this.options.includePrerelease&&Hvo)|(this.options.loose&&Gvo))+":"+e,o=ttn.get(n);if(o)return o;let s=this.options.loose,c=s?f_[aA.HYPHENRANGELOOSE]:f_[aA.HYPHENRANGE];e=e.replace(c,rCo(this.options.includePrerelease)),Hu("hyphen replace",e),e=e.replace(f_[aA.COMPARATORTRIM],Qvo),Hu("comparator trim",e),e=e.replace(f_[aA.TILDETRIM],qvo),Hu("tilde trim",e),e=e.replace(f_[aA.CARETTRIM],jvo),Hu("caret trim",e);let l=e.split(" ").map(h=>Wvo(h,this.options)).join(" ").split(/\s+/).map(h=>tCo(h,this.options));s&&(l=l.filter(h=>(Hu("loose invalid filter",h,this.options),!!h.match(f_[aA.COMPARATORLOOSE])))),Hu("range list",l);let u=new Map,d=l.map(h=>new F5t(h,this.options));for(let h of d){if(rtn(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return ttn.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>ntn(n,r)&&e.set.some(o=>ntn(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 Fvo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),Vvo=a(t=>t.value==="","isAny"),ntn=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"),Wvo=a((t,e)=>(t=t.replace(f_[aA.BUILD],""),Hu("comp",t,e),t=Kvo(t,e),Hu("caret",t),t=zvo(t,e),Hu("tildes",t),t=Zvo(t,e),Hu("xrange",t),t=eCo(t,e),Hu("stars",t),t),"parseComparator"),p_=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),zvo=a((t,e)=>t.trim().split(/\s+/).map(r=>Yvo(r,e)).join(" "),"replaceTildes"),Yvo=a((t,e)=>{let r=e.loose?f_[aA.TILDELOOSE]:f_[aA.TILDE];return t.replace(r,(n,o,s,c,l)=>{Hu("tilde",t,n,o,s,c,l);let u;return p_(o)?u="":p_(s)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:p_(c)?u=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:l?(Hu("replaceTilde pr",l),u=`>=${o}.${s}.${c}-${l} <${o}.${+s+1}.0-0`):u=`>=${o}.${s}.${c} <${o}.${+s+1}.0-0`,Hu("tilde return",u),u})},"replaceTilde"),Kvo=a((t,e)=>t.trim().split(/\s+/).map(r=>Jvo(r,e)).join(" "),"replaceCarets"),Jvo=a((t,e)=>{Hu("caret",t,e);let r=e.loose?f_[aA.CARETLOOSE]:f_[aA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Hu("caret",t,o,s,c,l,u);let d;return p_(s)?d="":p_(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:p_(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Hu("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`):(Hu("no pr"),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`),Hu("caret return",d),d})},"replaceCaret"),Zvo=a((t,e)=>(Hu("replaceXRanges",t,e),t.split(/\s+/).map(r=>Xvo(r,e)).join(" ")),"replaceXRanges"),Xvo=a((t,e)=>{t=t.trim();let r=e.loose?f_[aA.XRANGELOOSE]:f_[aA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{Hu("xRange",t,n,o,s,c,l,u);let d=p_(s),f=d||p_(c),h=f||p_(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`),Hu("xRange return",n),n})},"replaceXRange"),eCo=a((t,e)=>(Hu("replaceStars",t,e),t.trim().replace(f_[aA.STAR],"")),"replaceStars"),tCo=a((t,e)=>(Hu("replaceGTE0",t,e),t.trim().replace(f_[e.includePrerelease?aA.GTE0PRE:aA.GTE0],"")),"replaceGTE0"),rCo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(p_(n)?r="":p_(o)?r=`>=${n}.0.0${t?"-0":""}`:p_(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,p_(d)?u="":p_(f)?u=`<${+d+1}.0.0-0`:p_(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"),nCo=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 m1e=I((Yjl,utn)=>{"use strict";p();var g1e=Symbol("SemVer ANY"),q5t=class t{static{a(this,"Comparator")}static get ANY(){return g1e}constructor(e,r){if(r=otn(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Q5t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===g1e?this.value="":this.value=this.operator+this.semver.version,Q5t("comp",this)}parse(e){let r=this.options.loose?stn[atn.COMPARATORLOOSE]:stn[atn.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 ctn(n[2],this.options.loose):this.semver=g1e}toString(){return this.value}test(e){if(Q5t("Comparator.test",e,this.options.loose),this.semver===g1e||e===g1e)return!0;if(typeof e=="string")try{e=new ctn(e,this.options)}catch{return!1}return U5t(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 ltn(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new ltn(this.value,r).test(e.semver):(r=otn(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("=")||U5t(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||U5t(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};utn.exports=q5t;var otn=Qqe(),{safeRe:stn,t:atn}=dae(),U5t=O5t(),Q5t=p1e(),ctn=sA(),ltn=nx()});var A1e=I((Zjl,dtn)=>{"use strict";p();var iCo=nx(),oCo=a((t,e,r)=>{try{e=new iCo(e,r)}catch{return!1}return e.test(t)},"satisfies");dtn.exports=oCo});var ptn=I((tHl,ftn)=>{"use strict";p();var sCo=nx(),aCo=a((t,e)=>new sCo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");ftn.exports=aCo});var mtn=I((iHl,htn)=>{"use strict";p();var cCo=sA(),lCo=nx(),uCo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new lCo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new cCo(n,r))}),n},"maxSatisfying");htn.exports=uCo});var Atn=I((aHl,gtn)=>{"use strict";p();var dCo=sA(),fCo=nx(),pCo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new fCo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new dCo(n,r))}),n},"minSatisfying");gtn.exports=pCo});var _tn=I((uHl,Etn)=>{"use strict";p();var j5t=sA(),hCo=nx(),ytn=h1e(),mCo=a((t,e)=>{t=new hCo(t,e);let r=new j5t("0.0.0");if(t.test(r)||(r=new j5t("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new j5t(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||ytn(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||ytn(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Etn.exports=mCo});var Ctn=I((pHl,vtn)=>{"use strict";p();var gCo=nx(),ACo=a((t,e)=>{try{return new gCo(t,e).range||"*"}catch{return null}},"validRange");vtn.exports=ACo});var Jqe=I((gHl,Itn)=>{"use strict";p();var yCo=sA(),Ttn=m1e(),{ANY:ECo}=Ttn,_Co=nx(),vCo=A1e(),btn=h1e(),Stn=Vqe(),CCo=zqe(),bCo=Wqe(),SCo=a((t,e,r,n)=>{t=new yCo(t,n),e=new _Co(e,n);let o,s,c,l,u;switch(r){case">":o=btn,s=CCo,c=Stn,l=">",u=">=";break;case"<":o=Stn,s=bCo,c=btn,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vCo(t,e,n))return!1;for(let d=0;d{g.semver===ECo&&(g=new Ttn(">=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");Itn.exports=SCo});var wtn=I((EHl,xtn)=>{"use strict";p();var TCo=Jqe(),ICo=a((t,e,r)=>TCo(t,e,">",r),"gtr");xtn.exports=ICo});var Ptn=I((CHl,Rtn)=>{"use strict";p();var xCo=Jqe(),wCo=a((t,e,r)=>xCo(t,e,"<",r),"ltr");Rtn.exports=wCo});var Ntn=I((THl,Dtn)=>{"use strict";p();var ktn=nx(),RCo=a((t,e,r)=>(t=new ktn(t,r),e=new ktn(e,r),t.intersects(e,r)),"intersects");Dtn.exports=RCo});var Otn=I((wHl,Mtn)=>{"use strict";p();var PCo=A1e(),kCo=rx();Mtn.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>kCo(f,h,r));for(let f of c)PCo(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 Btn=nx(),$5t=m1e(),{ANY:H5t}=$5t,G5t=A1e(),V5t=rx(),DCo=a((t,e,r={})=>{if(t===e)return!0;t=new Btn(t,r),e=new Btn(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=MCo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),NCo=[new $5t(">=0.0.0-0")],Ltn=[new $5t(">=0.0.0")],MCo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===H5t){if(e.length===1&&e[0].semver===H5t)return!0;r.includePrerelease?t=NCo:t=Ltn}if(e.length===1&&e[0].semver===H5t){if(r.includePrerelease)return!0;e=Ltn}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=Ftn(o,g,r):g.operator==="<"||g.operator==="<="?s=Utn(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=V5t(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&&!G5t(g,String(o),r)||s&&!G5t(g,String(s),r))return null;for(let A of e)if(!G5t(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=Ftn(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=Utn(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"),Ftn=a((t,e,r)=>{if(!t)return e;let n=V5t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),Utn=a((t,e,r)=>{if(!t)return e;let n=V5t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");Qtn.exports=DCo});var _L=I((NHl,Gtn)=>{"use strict";p();var W5t=dae(),jtn=uae(),OCo=sA(),Htn=P5t(),BCo=t7(),LCo=pen(),FCo=men(),UCo=yen(),QCo=ven(),qCo=ben(),jCo=Ten(),HCo=xen(),GCo=Ren(),$Co=rx(),VCo=Nen(),WCo=Oen(),zCo=$qe(),YCo=Uen(),KCo=qen(),JCo=h1e(),ZCo=Vqe(),XCo=N5t(),ebo=M5t(),tbo=Wqe(),rbo=zqe(),nbo=O5t(),ibo=Ken(),obo=Zen(),sbo=m1e(),abo=nx(),cbo=A1e(),lbo=ptn(),ubo=mtn(),dbo=Atn(),fbo=_tn(),pbo=Ctn(),hbo=Jqe(),mbo=wtn(),gbo=Ptn(),Abo=Ntn(),ybo=Otn(),Ebo=qtn();Gtn.exports={parse:BCo,valid:LCo,clean:FCo,inc:UCo,diff:QCo,major:qCo,minor:jCo,patch:HCo,prerelease:GCo,compare:$Co,rcompare:VCo,compareLoose:WCo,compareBuild:zCo,sort:YCo,rsort:KCo,gt:JCo,lt:ZCo,eq:XCo,neq:ebo,gte:tbo,lte:rbo,cmp:nbo,coerce:ibo,truncate:obo,Comparator:sbo,Range:abo,satisfies:cbo,toComparators:lbo,maxSatisfying:ubo,minSatisfying:dbo,minVersion:fbo,validRange:pbo,outside:hbo,gtr:mbo,ltr:gbo,intersects:Abo,simplifyRange:ybo,subset:Ebo,SemVer:OCo,re:W5t.re,src:W5t.src,tokens:W5t.t,SEMVER_SPEC_VERSION:jtn.SEMVER_SPEC_VERSION,RELEASE_TYPES:jtn.RELEASE_TYPES,compareIdentifiers:Htn.compareIdentifiers,rcompareIdentifiers:Htn.rcompareIdentifiers}});var Vtn=I((OHl,$tn)=>{p();var _bo=_L();$tn.exports=_bo.satisfies(process.version,">=15.7.0")});var ztn=I((LHl,Wtn)=>{p();var vbo=_L();Wtn.exports=vbo.satisfies(process.version,">=16.9.0")});var z5t=I((UHl,Ytn)=>{p();var Cbo=Vtn(),bbo=ztn(),Sbo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Tbo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Ytn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=Sbo[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(Cbo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=Tbo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(bbo){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 Y5t=I((qHl,Ktn)=>{p();var Ibo=_L();Ktn.exports=Ibo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Xtn=I((HHl,Ztn)=>{p();var iu=f1e(),xbo=S5t(),Jtn=T5t(),wbo=b5t(),Rbo=x5t(),Pbo=z5t(),kbo=Y5t(),Dbo=Oqe(),{KeyObject:Nbo,createSecretKey:Mbo,createPublicKey:Obo}=require("crypto"),K5t=["RS256","RS384","RS512"],Bbo=["ES256","ES384","ES512"],J5t=["RS256","RS384","RS512"],Lbo=["HS256","HS384","HS512"];kbo&&(K5t.splice(K5t.length,0,"PS256","PS384","PS512"),J5t.splice(J5t.length,0,"PS256","PS384","PS512"));Ztn.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 iu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new iu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new iu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new iu("jwt must be provided"));if(typeof t!="string")return o(new iu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new iu("jwt malformed"));let l;try{l=wbo(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new iu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new iu("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 iu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new iu("jwt signature is required"));if(m&&!h)return o(new iu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new iu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof Nbo))try{h=Obo(h)}catch{try{h=Mbo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new iu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=Lbo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=J5t:h.asymmetricKeyType==="ec"?r.algorithms=Bbo:r.algorithms=K5t),r.algorithms.indexOf(l.header.alg)===-1)return o(new iu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new iu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new iu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{Pbo(u.alg,h)}catch(y){return o(y)}let g;try{g=Dbo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new iu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new iu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new xbo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new iu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new Jtn("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 iu("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 iu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new iu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new iu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new iu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new iu("iat required when maxAge is specified"));let y=Rbo(r.maxAge,A.iat);if(typeof y>"u")return o(new iu('"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 Jtn("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 orn=I((VHl,irn)=>{p();var ern=1/0,rrn=9007199254740991,Fbo=17976931348623157e292,trn=NaN,Ubo="[object Arguments]",Qbo="[object Function]",qbo="[object GeneratorFunction]",jbo="[object String]",Hbo="[object Symbol]",Gbo=/^\s+|\s+$/g,$bo=/^[-+]0x[0-9a-f]+$/i,Vbo=/^0b[01]+$/i,Wbo=/^0o[0-7]+$/i,zbo=/^(?:0|[1-9]\d*)$/,Ybo=parseInt;function Kbo(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&Zbo(t,e,r)>-1}a(u1o,"includes");function d1o(t){return f1o(t)&&X5t.call(t,"callee")&&(!n1o.call(t,"callee")||Xqe.call(t)==Ubo)}a(d1o,"isArguments");var nrn=Array.isArray;function e4t(t){return t!=null&&h1o(t.length)&&!p1o(t)}a(e4t,"isArrayLike");function f1o(t){return t4t(t)&&e4t(t)}a(f1o,"isArrayLikeObject");function p1o(t){var e=Z5t(t)?Xqe.call(t):"";return e==Qbo||e==qbo}a(p1o,"isFunction");function h1o(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=rrn}a(h1o,"isLength");function Z5t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Z5t,"isObject");function t4t(t){return!!t&&typeof t=="object"}a(t4t,"isObjectLike");function m1o(t){return typeof t=="string"||!nrn(t)&&t4t(t)&&Xqe.call(t)==jbo}a(m1o,"isString");function g1o(t){return typeof t=="symbol"||t4t(t)&&Xqe.call(t)==Hbo}a(g1o,"isSymbol");function A1o(t){if(!t)return t===0?t:0;if(t=E1o(t),t===ern||t===-ern){var e=t<0?-1:1;return e*Fbo}return t===t?t:0}a(A1o,"toFinite");function y1o(t){var e=A1o(t),r=e%1;return e===e?r?e-r:e:0}a(y1o,"toInteger");function E1o(t){if(typeof t=="number")return t;if(g1o(t))return trn;if(Z5t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Z5t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Gbo,"");var r=Vbo.test(t);return r||Wbo.test(t)?Ybo(t.slice(2),r?2:8):$bo.test(t)?trn:+t}a(E1o,"toNumber");function _1o(t){return e4t(t)?s1o(t):a1o(t)}a(_1o,"keys");function v1o(t){return t?t1o(t,_1o(t)):[]}a(v1o,"values");irn.exports=u1o});var arn=I((YHl,srn)=>{p();var C1o="[object Boolean]",b1o=Object.prototype,S1o=b1o.toString;function T1o(t){return t===!0||t===!1||I1o(t)&&S1o.call(t)==C1o}a(T1o,"isBoolean");function I1o(t){return!!t&&typeof t=="object"}a(I1o,"isObjectLike");srn.exports=T1o});var frn=I((ZHl,drn)=>{p();var crn=1/0,x1o=17976931348623157e292,lrn=NaN,w1o="[object Symbol]",R1o=/^\s+|\s+$/g,P1o=/^[-+]0x[0-9a-f]+$/i,k1o=/^0b[01]+$/i,D1o=/^0o[0-7]+$/i,N1o=parseInt,M1o=Object.prototype,O1o=M1o.toString;function B1o(t){return typeof t=="number"&&t==Q1o(t)}a(B1o,"isInteger");function urn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(urn,"isObject");function L1o(t){return!!t&&typeof t=="object"}a(L1o,"isObjectLike");function F1o(t){return typeof t=="symbol"||L1o(t)&&O1o.call(t)==w1o}a(F1o,"isSymbol");function U1o(t){if(!t)return t===0?t:0;if(t=q1o(t),t===crn||t===-crn){var e=t<0?-1:1;return e*x1o}return t===t?t:0}a(U1o,"toFinite");function Q1o(t){var e=U1o(t),r=e%1;return e===e?r?e-r:e:0}a(Q1o,"toInteger");function q1o(t){if(typeof t=="number")return t;if(F1o(t))return lrn;if(urn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=urn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(R1o,"");var r=k1o.test(t);return r||D1o.test(t)?N1o(t.slice(2),r?2:8):P1o.test(t)?lrn:+t}a(q1o,"toNumber");drn.exports=B1o});var hrn=I((tGl,prn)=>{p();var j1o="[object Number]",H1o=Object.prototype,G1o=H1o.toString;function $1o(t){return!!t&&typeof t=="object"}a($1o,"isObjectLike");function V1o(t){return typeof t=="number"||$1o(t)&&G1o.call(t)==j1o}a(V1o,"isNumber");prn.exports=V1o});var yrn=I((iGl,Arn)=>{p();var W1o="[object Object]";function z1o(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(z1o,"isHostObject");function Y1o(t,e){return function(r){return t(e(r))}}a(Y1o,"overArg");var K1o=Function.prototype,mrn=Object.prototype,grn=K1o.toString,J1o=mrn.hasOwnProperty,Z1o=grn.call(Object),X1o=mrn.toString,eSo=Y1o(Object.getPrototypeOf,Object);function tSo(t){return!!t&&typeof t=="object"}a(tSo,"isObjectLike");function rSo(t){if(!tSo(t)||X1o.call(t)!=W1o||z1o(t))return!1;var e=eSo(t);if(e===null)return!0;var r=J1o.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&grn.call(r)==Z1o}a(rSo,"isPlainObject");Arn.exports=rSo});var _rn=I((aGl,Ern)=>{p();var nSo="[object String]",iSo=Object.prototype,oSo=iSo.toString,sSo=Array.isArray;function aSo(t){return!!t&&typeof t=="object"}a(aSo,"isObjectLike");function cSo(t){return typeof t=="string"||!sSo(t)&&aSo(t)&&oSo.call(t)==nSo}a(cSo,"isString");Ern.exports=cSo});var Trn=I((uGl,Srn)=>{p();var lSo="Expected a function",vrn=1/0,uSo=17976931348623157e292,Crn=NaN,dSo="[object Symbol]",fSo=/^\s+|\s+$/g,pSo=/^[-+]0x[0-9a-f]+$/i,hSo=/^0b[01]+$/i,mSo=/^0o[0-7]+$/i,gSo=parseInt,ASo=Object.prototype,ySo=ASo.toString;function ESo(t,e){var r;if(typeof e!="function")throw new TypeError(lSo);return t=SSo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(ESo,"before");function _So(t){return ESo(2,t)}a(_So,"once");function brn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(brn,"isObject");function vSo(t){return!!t&&typeof t=="object"}a(vSo,"isObjectLike");function CSo(t){return typeof t=="symbol"||vSo(t)&&ySo.call(t)==dSo}a(CSo,"isSymbol");function bSo(t){if(!t)return t===0?t:0;if(t=TSo(t),t===vrn||t===-vrn){var e=t<0?-1:1;return e*uSo}return t===t?t:0}a(bSo,"toFinite");function SSo(t){var e=bSo(t),r=e%1;return e===e?r?e-r:e:0}a(SSo,"toInteger");function TSo(t){if(typeof t=="number")return t;if(CSo(t))return Crn;if(brn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=brn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(fSo,"");var r=hSo.test(t);return r||mSo.test(t)?gSo(t.slice(2),r?2:8):pSo.test(t)?Crn:+t}a(TSo,"toNumber");Srn.exports=_So});var Mrn=I((pGl,Nrn)=>{p();var Irn=x5t(),ISo=Y5t(),xSo=z5t(),xrn=Oqe(),wSo=orn(),eje=arn(),wrn=frn(),r4t=hrn(),Prn=yrn(),r7=_rn(),RSo=Trn(),{KeyObject:PSo,createSecretKey:kSo,createPrivateKey:DSo}=require("crypto"),krn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];ISo&&krn.splice(3,0,"PS256","PS384","PS512");var NSo={expiresIn:{isValid:a(function(t){return wrn(t)||r7(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return wrn(t)||r7(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return r7(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:wSo.bind(null,krn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Prn,message:'"header" must be an object'},encoding:{isValid:r7,message:'"encoding" must be a string'},issuer:{isValid:r7,message:'"issuer" must be a string'},subject:{isValid:r7,message:'"subject" must be a string'},jwtid:{isValid:r7,message:'"jwtid" must be a string'},noTimestamp:{isValid:eje,message:'"noTimestamp" must be a boolean'},keyid:{isValid:r7,message:'"keyid" must be a string'},mutatePayload:{isValid:eje,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:eje,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:eje,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},MSo={iat:{isValid:r4t,message:'"iat" should be a number of seconds'},exp:{isValid:r4t,message:'"exp" should be a number of seconds'},nbf:{isValid:r4t,message:'"nbf" should be a number of seconds'}};function Drn(t,e,r,n){if(!Prn(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(Drn,"validate");function OSo(t){return Drn(NSo,!1,t,"options")}a(OSo,"validateOptions");function BSo(t){return Drn(MSo,!0,t,"payload")}a(BSo,"validatePayload");var Rrn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},LSo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Nrn.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 PSo))try{e=DSo(e)}catch{try{e=kSo(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{BSo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=LSo.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{OSo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{xSo(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=Irn(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=Irn(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(Rrn).forEach(function(d){let f=Rrn[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&&RSo(n),xrn.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=xrn.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 Brn=I((gGl,Orn)=>{p();Orn.exports={decode:b5t(),verify:Xtn(),sign:Mrn(),JsonWebTokenError:f1e(),NotBeforeError:S5t(),TokenExpiredError:T5t()}});var N4t=I((uZl,Bnn)=>{p();function UTo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=I5t(),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();tS.formatArgs=qTo;tS.save=jTo;tS.load=HTo;tS.useColors=QTo;tS.storage=GTo();tS.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`."))}})();tS.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 QTo(){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(QTo,"useColors");function qTo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+kje.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(qTo,"formatArgs");tS.log=console.debug||console.log||(()=>{});function jTo(t){try{t?tS.storage.setItem("debug",t):tS.storage.removeItem("debug")}catch{}}a(jTo,"save");function HTo(){let t;try{t=tS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(HTo,"load");function GTo(){try{return localStorage}catch{}}a(GTo,"localstorage");kje.exports=N4t()(tS);var{formatters:$To}=kje.exports;$To.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Unn=I((mZl,Fnn)=>{"use strict";p();Fnn.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 VTo=require("os"),Qnn=require("tty"),ox=Unn(),{env:Hm}=process,o7;ox("no-color")||ox("no-colors")||ox("color=false")||ox("color=never")?o7=0:(ox("color")||ox("colors")||ox("color=true")||ox("color=always"))&&(o7=1);"FORCE_COLOR"in Hm&&(Hm.FORCE_COLOR==="true"?o7=1:Hm.FORCE_COLOR==="false"?o7=0:o7=Hm.FORCE_COLOR.length===0?1:Math.min(parseInt(Hm.FORCE_COLOR,10),3));function M4t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(M4t,"translateLevel");function O4t(t,e){if(o7===0)return 0;if(ox("color=16m")||ox("color=full")||ox("color=truecolor"))return 3;if(ox("color=256"))return 2;if(t&&!e&&o7===void 0)return 0;let r=o7||0;if(Hm.TERM==="dumb")return r;if(process.platform==="win32"){let n=VTo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Hm)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Hm)||Hm.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Hm)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Hm.TEAMCITY_VERSION)?1:0;if(Hm.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Hm){let n=parseInt((Hm.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Hm.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Hm.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Hm.TERM)||"COLORTERM"in Hm?1:r}a(O4t,"supportsColor");function WTo(t){let e=O4t(t,t&&t.isTTY);return M4t(e)}a(WTo,"getSupportLevel");qnn.exports={supportsColor:WTo,stdout:M4t(O4t(!0,Qnn.isatty(1))),stderr:M4t(O4t(!0,Qnn.isatty(2)))}});var Hnn=I((lA,Mje)=>{p();var zTo=require("tty"),Nje=require("util");lA.init=tIo;lA.log=ZTo;lA.formatArgs=KTo;lA.save=XTo;lA.load=eIo;lA.useColors=YTo;lA.destroy=Nje.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");lA.colors=[6,2,3,4,5,1];try{let t=Dje();t&&(t.stderr||t).level>=2&&(lA.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{}lA.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 YTo(){return"colors"in lA.inspectOpts?!!lA.inspectOpts.colors:zTo.isatty(process.stderr.fd)}a(YTo,"useColors");function KTo(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+"+cHe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=_xo()+e+" "+t[0]}a(Exo,"formatArgs");function _xo(){return aA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(_xo,"getDate");function Cxo(...t){return process.stderr.write(aHe.format(...t)+` -`)}a(Cxo,"log");function vxo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(vxo,"save");function bxo(){return process.env.DEBUG}a(bxo,"load");function Sxo(t){t.inspectOpts={};let e=Object.keys(aA.inspectOpts);for(let r=0;re.trim()).join(" ")};Vin.O=function(t){return this.inspectOpts.colors=this.useColors,aHe.inspect(t,this.inspectOpts)}});var Wk=I((Tru,yBt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?yBt.exports=qin():yBt.exports=Win()});var Kin=I(pv=>{"use strict";p();var Txo=pv&&pv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ixo=pv&&pv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zin=pv&&pv.__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)&&Txo(e,t,r);return Ixo(e,t),e};Object.defineProperty(pv,"__esModule",{value:!0});pv.req=pv.json=pv.toBuffer=void 0;var xxo=zin(require("http")),wxo=zin(require("https"));async function Yin(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(Yin,"toBuffer");pv.toBuffer=Yin;async function Rxo(t){let r=(await Yin(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(Rxo,"json");pv.json=Rxo;function kxo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?wxo:xxo).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(kxo,"req");pv.req=kxo});var _Bt=I(uS=>{"use strict";p();var Zin=uS&&uS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pxo=uS&&uS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xin=uS&&uS.__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)&&Zin(e,t,r);return Pxo(e,t),e},Dxo=uS&&uS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zin(e,t,r)};Object.defineProperty(uS,"__esModule",{value:!0});uS.Agent=void 0;var Nxo=Xin(require("net")),Jin=Xin(require("http")),Mxo=require("https");Dxo(Kin(),uS);var vM=Symbol("AgentBaseInternalState"),EBt=class extends Jin.Agent{static{a(this,"Agent")}constructor(e){super(e),this[vM]={}}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 Nxo.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))?Mxo.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 Jin.Agent)return l.addRequest(e,o);this[vM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[vM].currentSocket;if(this[vM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[vM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[vM]&&(this[vM].defaultPort=e)}get protocol(){return this[vM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[vM]&&(this[vM].protocol=e)}};uS.Agent=EBt});var eon=I(Hae=>{"use strict";p();var Oxo=Hae&&Hae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hae,"__esModule",{value:!0});Hae.parseProxyResponse=void 0;var Bxo=Oxo(Wk()),lHe=(0,Bxo.default)("https-proxy-agent:parse-proxy-response");function Lxo(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(),lHe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),lHe("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+"+Mje.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=JTo()+e+" "+t[0]}a(KTo,"formatArgs");function JTo(){return lA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(JTo,"getDate");function ZTo(...t){return process.stderr.write(Nje.format(...t)+` +`)}a(ZTo,"log");function XTo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(XTo,"save");function eIo(){return process.env.DEBUG}a(eIo,"load");function tIo(t){t.inspectOpts={};let e=Object.keys(lA.inspectOpts);for(let r=0;re.trim()).join(" ")};jnn.O=function(t){return this.inspectOpts.colors=this.useColors,Nje.inspect(t,this.inspectOpts)}});var QP=I((CZl,B4t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?B4t.exports=Lnn():B4t.exports=Hnn()});var Vnn=I(lC=>{"use strict";p();var rIo=lC&&lC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nIo=lC&&lC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Gnn=lC&&lC.__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)&&rIo(e,t,r);return nIo(e,t),e};Object.defineProperty(lC,"__esModule",{value:!0});lC.req=lC.json=lC.toBuffer=void 0;var iIo=Gnn(require("http")),oIo=Gnn(require("https"));async function $nn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a($nn,"toBuffer");lC.toBuffer=$nn;async function sIo(t){let r=(await $nn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(sIo,"json");lC.json=sIo;function aIo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?oIo:iIo).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(aIo,"req");lC.req=aIo});var F4t=I(rS=>{"use strict";p();var znn=rS&&rS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cIo=rS&&rS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ynn=rS&&rS.__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)&&znn(e,t,r);return cIo(e,t),e},lIo=rS&&rS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&znn(e,t,r)};Object.defineProperty(rS,"__esModule",{value:!0});rS.Agent=void 0;var uIo=Ynn(require("net")),Wnn=Ynn(require("http")),dIo=require("https");lIo(Vnn(),rS);var pM=Symbol("AgentBaseInternalState"),L4t=class extends Wnn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[pM]={}}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 uIo.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))?dIo.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 Wnn.Agent)return l.addRequest(e,o);this[pM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[pM].currentSocket;if(this[pM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[pM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[pM]&&(this[pM].defaultPort=e)}get protocol(){return this[pM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[pM]&&(this[pM].protocol=e)}};rS.Agent=L4t});var Knn=I(Tae=>{"use strict";p();var fIo=Tae&&Tae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tae,"__esModule",{value:!0});Tae.parseProxyResponse=void 0;var pIo=fIo(QP()),Oje=(0,pIo.default)("https-proxy-agent:parse-proxy-response");function hIo(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(),Oje("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),Oje("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){lHe("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}lHe("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(Lxo,"parseProxyResponse");Hae.parseProxyResponse=Lxo});var vBt=I(fx=>{"use strict";p();var Fxo=fx&&fx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uxo=fx&&fx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),non=fx&&fx.__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)&&Fxo(e,t,r);return Uxo(e,t),e},ion=fx&&fx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fx,"__esModule",{value:!0});fx.HttpsProxyAgent=void 0;var CBt=non(require("net")),ton=non(require("tls")),Qxo=ion(require("assert")),qxo=ion(Wk()),jxo=_Bt(),Hxo=require("url"),Gxo=eon(),X1e=(0,qxo.default)("https-proxy-agent"),uHe=class extends jxo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new Hxo.URL(e):e,this.proxyHeaders=r?.headers??{},X1e("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?ron(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:"){X1e("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=ton.connect({...this.connectOpts,servername:m})}else X1e("Creating `net.Socket`: %o",this.connectOpts),o=CBt.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=CBt.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r +`);if(m===-1){Oje("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}Oje("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(hIo,"parseProxyResponse");Tae.parseProxyResponse=hIo});var Q4t=I(sx=>{"use strict";p();var mIo=sx&&sx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gIo=sx&&sx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xnn=sx&&sx.__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)&&mIo(e,t,r);return gIo(e,t),e},ein=sx&&sx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sx,"__esModule",{value:!0});sx.HttpsProxyAgent=void 0;var U4t=Xnn(require("net")),Jnn=Xnn(require("tls")),AIo=ein(require("assert")),yIo=ein(QP()),EIo=F4t(),_Io=require("url"),vIo=Knn(),P1e=(0,yIo.default)("https-proxy-agent"),Bje=class extends EIo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new _Io.URL(e):e,this.proxyHeaders=r?.headers??{},P1e("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?Znn(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:"){P1e("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=Jnn.connect({...this.connectOpts,servername:m})}else P1e("Creating `net.Socket`: %o",this.connectOpts),o=U4t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=U4t.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,Gxo.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",$xo),r.secureEndpoint){X1e("Upgrading socket connection to TLS");let m=r.servername||r.host;return ton.connect({...ron(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new CBt.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{X1e("Replaying proxy buffer for failed request"),(0,Qxo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};uHe.protocols=["http","https"];fx.HttpsProxyAgent=uHe;function $xo(t){t.resume()}a($xo,"resume");function ron(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(ron,"omit")});var bBt=I(px=>{"use strict";p();var Vxo=px&&px.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wxo=px&&px.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),son=px&&px.__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)&&Vxo(e,t,r);return Wxo(e,t),e},zxo=px&&px.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(px,"__esModule",{value:!0});px.HttpProxyAgent=void 0;var Yxo=son(require("net")),Kxo=son(require("tls")),Jxo=zxo(Wk()),Zxo=require("events"),Xxo=_Bt(),oon=require("url"),Gae=(0,Jxo.default)("http-proxy-agent"),dHe=class extends Xxo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new oon.URL(e):e,this.proxyHeaders=r?.headers??{},Gae("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?ewo(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 oon.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;Gae("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(Gae("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r +`;let u=(0,vIo.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",CIo),r.secureEndpoint){P1e("Upgrading socket connection to TLS");let m=r.servername||r.host;return Jnn.connect({...Znn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new U4t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{P1e("Replaying proxy buffer for failed request"),(0,AIo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};Bje.protocols=["http","https"];sx.HttpsProxyAgent=Bje;function CIo(t){t.resume()}a(CIo,"resume");function Znn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(Znn,"omit")});var q4t=I(ax=>{"use strict";p();var bIo=ax&&ax.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SIo=ax&&ax.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rin=ax&&ax.__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)&&bIo(e,t,r);return SIo(e,t),e},TIo=ax&&ax.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ax,"__esModule",{value:!0});ax.HttpProxyAgent=void 0;var IIo=rin(require("net")),xIo=rin(require("tls")),wIo=TIo(QP()),RIo=require("events"),PIo=F4t(),tin=require("url"),Iae=(0,wIo.default)("http-proxy-agent"),Lje=class extends PIo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new tin.URL(e):e,this.proxyHeaders=r?.headers??{},Iae("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?kIo(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 tin.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;Iae("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(Iae("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),Gae("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(Gae("Creating `tls.Socket`: %o",this.connectOpts),s=Kxo.connect(this.connectOpts)):(Gae("Creating `net.Socket`: %o",this.connectOpts),s=Yxo.connect(this.connectOpts)),await(0,Zxo.once)(s,"connect"),s}};dHe.protocols=["http","https"];px.HttpProxyAgent=dHe;function ewo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(ewo,"omit")});var E7={};wi(E7,{__addDisposableResource:()=>Oon,__assign:()=>AHe,__asyncDelegator:()=>won,__asyncGenerator:()=>eSe,__asyncValues:()=>_He,__await:()=>dS,__awaiter:()=>von,__classPrivateFieldGet:()=>Don,__classPrivateFieldIn:()=>Mon,__classPrivateFieldSet:()=>Non,__createBinding:()=>EHe,__decorate:()=>mon,__disposeResources:()=>Bon,__esDecorate:()=>Aon,__exportStar:()=>Son,__extends:()=>pon,__generator:()=>bon,__importDefault:()=>Pon,__importStar:()=>kon,__makeTemplateObject:()=>Ron,__metadata:()=>Con,__param:()=>gon,__propKey:()=>Eon,__read:()=>RBt,__rest:()=>hon,__rewriteRelativeImportExtension:()=>Lon,__runInitializers:()=>yon,__setFunctionName:()=>_on,__spread:()=>Ton,__spreadArray:()=>xon,__spreadArrays:()=>Ion,__values:()=>yHe,default:()=>fwo});function pon(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xBt(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function hon(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 gon(t,e){return function(r,n){e(r,n,t)}}function Aon(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 yon(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 RBt(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 Ton(){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 dS?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 won(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:dS(t[o](c)),done:!1}:s?s(c):c}:s}}function _He(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 yHe=="function"?yHe(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 Ron(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function kon(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=wBt(t),n=0;n{p();xBt=a(function(t,e){return xBt=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])},xBt(t,e)},"extendStatics");a(pon,"__extends");AHe=a(function(){return AHe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(PHe,"__esModule",{value:!0});PHe.state=void 0;PHe.state={operationRequestMap:new WeakMap}});function pRo(){try{return rLt.default.statSync("/.dockerenv"),!0}catch{return!1}}function hRo(){try{return rLt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function nLt(){return tLt===void 0&&(tLt=pRo()||hRo()),tLt}var rLt,tLt,gsn=me(()=>{p();rLt=ce(require("node:fs"),1);a(pRo,"hasDockerEnv");a(hRo,"hasDockerCGroup");a(nLt,"isDocker")});function zae(){return iLt===void 0&&(iLt=mRo()||nLt()),iLt}var Asn,iLt,mRo,oLt=me(()=>{p();Asn=ce(require("node:fs"),1);gsn();mRo=a(()=>{try{return Asn.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(zae,"isInsideContainer")});var sLt,Esn,_sn,ysn,b7,aLt=me(()=>{p();sLt=ce(require("node:process"),1),Esn=ce(require("node:os"),1),_sn=ce(require("node:fs"),1);oLt();ysn=a(()=>{if(sLt.default.platform!=="linux")return!1;if(Esn.default.release().toLowerCase().includes("microsoft"))return!zae();try{return _sn.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!zae():!1}catch{return!1}},"isWsl"),b7=sLt.default.env.__IS_WSL_TEST__?ysn:ysn()});var cLt,sSe,gRo,ARo,lLt,Csn=me(()=>{p();cLt=ce(require("node:process"),1),sSe=ce(require("node:fs/promises"),1);aLt();aLt();gRo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await sSe.default.access(r,sSe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await sSe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),ARo=a(async()=>`${await gRo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),lLt=a(async()=>b7?ARo():`${cLt.default.env.SYSTEMROOT||cLt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function S7(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 vsn=me(()=>{p();a(S7,"defineLazyProperty")});async function uLt(){if(Ssn.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await yRo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var bsn,Ssn,Tsn,yRo,Isn=me(()=>{p();bsn=require("node:util"),Ssn=ce(require("node:process"),1),Tsn=require("node:child_process"),yRo=(0,bsn.promisify)(Tsn.execFile);a(uLt,"defaultBrowserId")});async function Rsn(t,{humanReadableOutput:e=!0}={}){if(xsn.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await ERo("osascript",["-e",t,r]);return n.trim()}var xsn,wsn,dLt,ERo,ksn=me(()=>{p();xsn=ce(require("node:process"),1),wsn=require("node:util"),dLt=require("node:child_process"),ERo=(0,wsn.promisify)(dLt.execFile);a(Rsn,"runAppleScript")});async function fLt(t){return Rsn(`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 Psn=me(()=>{p();ksn();a(fLt,"bundleName")});async function pLt(t=_Ro){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 NHe(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=CRo[n];if(!o)throw new NHe(`Unknown browser ID: ${n}`);return o}var Dsn,Nsn,_Ro,CRo,NHe,Msn=me(()=>{p();Dsn=require("node:util"),Nsn=require("node:child_process"),_Ro=(0,Dsn.promisify)(Nsn.execFile),CRo={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"}},NHe=class extends Error{static{a(this,"UnknownBrowserError")}};a(pLt,"defaultBrowser")});async function hLt(){if(MHe.default.platform==="darwin"){let t=await uLt();return{name:await fLt(t),id:t}}if(MHe.default.platform==="linux"){let{stdout:t}=await vRo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:bRo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(MHe.default.platform==="win32")return pLt();throw new Error("Only macOS, Linux, and Windows are supported")}var Osn,MHe,Bsn,vRo,bRo,Lsn=me(()=>{p();Osn=require("node:util"),MHe=ce(require("node:process"),1),Bsn=require("node:child_process");Isn();Psn();Msn();vRo=(0,Osn.promisify)(Bsn.execFile),bRo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(hLt,"defaultBrowser")});var Gsn={};wi(Gsn,{apps:()=>T7,default:()=>cSe,openApp:()=>xRo});async function TRo(){let t=await lLt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=ALt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await SRo(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 qsn(t){if(typeof t=="string"||Array.isArray(t))return t;let{[Usn]:e}=t;if(!e)throw new Error(`${Usn} is not supported`);return e}function BHe({[Yae]:t},{wsl:e}){if(e&&b7)return qsn(e);if(!t)throw new Error(`${Yae} is not supported`);return qsn(t)}var gLt,ALt,yLt,jsn,Hsn,ELt,OHe,SRo,mLt,Fsn,Yae,Usn,Qsn,aSe,IRo,xRo,T7,cSe,LHe=me(()=>{p();gLt=ce(require("node:process"),1),ALt=require("node:buffer"),yLt=ce(require("node:path"),1),jsn=require("node:url"),Hsn=require("node:util"),ELt=ce(require("node:child_process"),1),OHe=ce(require("node:fs/promises"),1);Csn();vsn();Lsn();oLt();SRo=(0,Hsn.promisify)(ELt.default.execFile),mLt=yLt.default.dirname((0,jsn.fileURLToPath)(importMetaUrlShim)),Fsn=yLt.default.join(mLt,"xdg-open"),{platform:Yae,arch:Usn}=gLt.default;a(TRo,"getWindowsDefaultBrowserFromWsl");Qsn=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),aSe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Qsn(t.app,l=>aSe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return Qsn(e,l=>aSe({...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=b7?await TRo():await hLt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),aSe({...t,app:{name:T7[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Yae==="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(Yae==="win32"||b7&&!zae()&&!e){n=await lLt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),b7||(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=ALt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!mLt||mLt==="/",u=!1;try{await OHe.default.access(Fsn,OHe.constants.X_OK),u=!0}catch{}n=gLt.default.versions.electron??(Yae==="android"||l||!u)?"xdg-open":Fsn}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Yae==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=ELt.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"),IRo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return aSe({...e,target:t})},"open"),xRo=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 aSe({...e,app:{name:t,arguments:r}})},"openApp");a(qsn,"detectArchBinary");a(BHe,"detectPlatformBinary");T7={};S7(T7,"chrome",()=>BHe({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"]}}));S7(T7,"brave",()=>BHe({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"]}}));S7(T7,"firefox",()=>BHe({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));S7(T7,"edge",()=>BHe({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));S7(T7,"browser",()=>"browser");S7(T7,"browserPrivate",()=>"browserPrivate");cSe=IRo});var Ean=I(wM=>{"use strict";p();Object.defineProperty(wM,"__esModule",{value:!0});wM.bytePairEncode=wM.BinaryMap=wM.binaryMapKey=void 0;var nko=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");wM.binaryMapKey=nko;var OLt=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,wM.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,wM.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)}}};wM.BinaryMap=OLt;var xM=new Int32Array(128),E_=new Int32Array(128);function iko(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;xM.length0&&(xM[E_[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(eGe,"__esModule",{value:!0});eGe.makeTextEncoder=void 0;var BLt=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}},LLt=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 LLt:new BLt,"makeTextEncoder");eGe.makeTextEncoder=oko});var Can=I(tGe=>{"use strict";p();Object.defineProperty(tGe,"__esModule",{value:!0});tGe.LRUCache=void 0;var FLt=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 ULt(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}};tGe.LRUCache=FLt;var ULt=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var qLt=I(nGe=>{"use strict";p();Object.defineProperty(nGe,"__esModule",{value:!0});nGe.TikTokenizer=void 0;var rGe=Ean(),sko=_an(),ako=Can();function cko(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(cko,"loadTikTokenBpe");function lko(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(lko,"escapeRegExp");var QLt=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,sko.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new ako.LRUCache(o);let s=typeof e=="string"?cko(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new rGe.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=>lko(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,rGe.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,rGe.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,rGe.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))}};nGe.TikTokenizer=QLt});var Pan=I(Ph=>{"use strict";p();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.createTokenizer=Ph.createByEncoderName=Ph.createByModelName=Ph.getRegexByModel=Ph.getRegexByEncoder=Ph.getSpecialTokensByModel=Ph.getSpecialTokensByEncoder=Ph.MODEL_TO_ENCODING=void 0;var uko=qLt(),dko=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Ph.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 iGe="<|endoftext|>",van="<|fim_prefix|>",ban="<|fim_middle|>",San="<|fim_suffix|>",Tan="<|endofprompt|>",bSe="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",Ian="(?:'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+",fko=[`[^\r +`)+4,e.outputData[0].data=e._header+n.substring(o),Iae("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(Iae("Creating `tls.Socket`: %o",this.connectOpts),s=xIo.connect(this.connectOpts)):(Iae("Creating `net.Socket`: %o",this.connectOpts),s=IIo.connect(this.connectOpts)),await(0,RIo.once)(s,"connect"),s}};Lje.protocols=["http","https"];ax.HttpProxyAgent=Lje;function kIo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(kIo,"omit")});var s7={};xi(s7,{__addDisposableResource:()=>kin,__assign:()=>Hje,__asyncDelegator:()=>Sin,__asyncGenerator:()=>k1e,__asyncValues:()=>Vje,__await:()=>nS,__awaiter:()=>yin,__classPrivateFieldGet:()=>win,__classPrivateFieldIn:()=>Pin,__classPrivateFieldSet:()=>Rin,__createBinding:()=>$je,__decorate:()=>din,__disposeResources:()=>Din,__esDecorate:()=>pin,__exportStar:()=>_in,__extends:()=>lin,__generator:()=>Ein,__importDefault:()=>xin,__importStar:()=>Iin,__makeTemplateObject:()=>Tin,__metadata:()=>Ain,__param:()=>fin,__propKey:()=>min,__read:()=>W4t,__rest:()=>uin,__rewriteRelativeImportExtension:()=>Nin,__runInitializers:()=>hin,__setFunctionName:()=>gin,__spread:()=>vin,__spreadArray:()=>bin,__spreadArrays:()=>Cin,__values:()=>Gje,default:()=>HIo});function lin(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$4t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function uin(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 fin(t,e){return function(r,n){e(r,n,t)}}function pin(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 hin(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 W4t(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 vin(){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 nS?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 Sin(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:nS(t[o](c)),done:!1}:s?s(c):c}:s}}function Vje(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 Gje=="function"?Gje(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 Tin(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Iin(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=V4t(t),n=0;n{p();$4t=a(function(t,e){return $4t=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])},$4t(t,e)},"extendStatics");a(lin,"__extends");Hje=a(function(){return Hje=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(nHe,"__esModule",{value:!0});nHe.state=void 0;nHe.state={operationRequestMap:new WeakMap}});function Gxo(){try{return _Bt.default.statSync("/.dockerenv"),!0}catch{return!1}}function $xo(){try{return _Bt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function vBt(){return EBt===void 0&&(EBt=Gxo()||$xo()),EBt}var _Bt,EBt,fon=_e(()=>{p();_Bt=he(require("node:fs"),1);a(Gxo,"hasDockerEnv");a($xo,"hasDockerCGroup");a(vBt,"isDocker")});function Pae(){return CBt===void 0&&(CBt=Vxo()||vBt()),CBt}var pon,CBt,Vxo,bBt=_e(()=>{p();pon=he(require("node:fs"),1);fon();Vxo=a(()=>{try{return pon.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Pae,"isInsideContainer")});var SBt,mon,gon,hon,u7,TBt=_e(()=>{p();SBt=he(require("node:process"),1),mon=he(require("node:os"),1),gon=he(require("node:fs"),1);bBt();hon=a(()=>{if(SBt.default.platform!=="linux")return!1;if(mon.default.release().toLowerCase().includes("microsoft"))return!Pae();try{return gon.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Pae():!1}catch{return!1}},"isWsl"),u7=SBt.default.env.__IS_WSL_TEST__?hon:hon()});var IBt,L1e,Wxo,zxo,xBt,Aon=_e(()=>{p();IBt=he(require("node:process"),1),L1e=he(require("node:fs/promises"),1);TBt();TBt();Wxo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await L1e.default.access(r,L1e.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await L1e.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),zxo=a(async()=>`${await Wxo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),xBt=a(async()=>u7?zxo():`${IBt.default.env.SYSTEMROOT||IBt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function d7(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 yon=_e(()=>{p();a(d7,"defineLazyProperty")});async function wBt(){if(_on.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await Yxo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Eon,_on,von,Yxo,Con=_e(()=>{p();Eon=require("node:util"),_on=he(require("node:process"),1),von=require("node:child_process"),Yxo=(0,Eon.promisify)(von.execFile);a(wBt,"defaultBrowserId")});async function Ton(t,{humanReadableOutput:e=!0}={}){if(bon.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await Kxo("osascript",["-e",t,r]);return n.trim()}var bon,Son,RBt,Kxo,Ion=_e(()=>{p();bon=he(require("node:process"),1),Son=require("node:util"),RBt=require("node:child_process"),Kxo=(0,Son.promisify)(RBt.execFile);a(Ton,"runAppleScript")});async function PBt(t){return Ton(`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 xon=_e(()=>{p();Ion();a(PBt,"bundleName")});async function kBt(t=Jxo){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 oHe(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=Zxo[n];if(!o)throw new oHe(`Unknown browser ID: ${n}`);return o}var won,Ron,Jxo,Zxo,oHe,Pon=_e(()=>{p();won=require("node:util"),Ron=require("node:child_process"),Jxo=(0,won.promisify)(Ron.execFile),Zxo={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"}},oHe=class extends Error{static{a(this,"UnknownBrowserError")}};a(kBt,"defaultBrowser")});async function DBt(){if(sHe.default.platform==="darwin"){let t=await wBt();return{name:await PBt(t),id:t}}if(sHe.default.platform==="linux"){let{stdout:t}=await Xxo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:ewo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(sHe.default.platform==="win32")return kBt();throw new Error("Only macOS, Linux, and Windows are supported")}var kon,sHe,Don,Xxo,ewo,Non=_e(()=>{p();kon=require("node:util"),sHe=he(require("node:process"),1),Don=require("node:child_process");Con();xon();Pon();Xxo=(0,kon.promisify)(Don.execFile),ewo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(DBt,"defaultBrowser")});var Qon={};xi(Qon,{apps:()=>f7,default:()=>U1e,openApp:()=>iwo});async function rwo(){let t=await xBt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=OBt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await two(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 Lon(t){if(typeof t=="string"||Array.isArray(t))return t;let{[Oon]:e}=t;if(!e)throw new Error(`${Oon} is not supported`);return e}function cHe({[kae]:t},{wsl:e}){if(e&&u7)return Lon(e);if(!t)throw new Error(`${kae} is not supported`);return Lon(t)}var MBt,OBt,BBt,Fon,Uon,LBt,aHe,two,NBt,Mon,kae,Oon,Bon,F1e,nwo,iwo,f7,U1e,lHe=_e(()=>{p();MBt=he(require("node:process"),1),OBt=require("node:buffer"),BBt=he(require("node:path"),1),Fon=require("node:url"),Uon=require("node:util"),LBt=he(require("node:child_process"),1),aHe=he(require("node:fs/promises"),1);Aon();yon();Non();bBt();two=(0,Uon.promisify)(LBt.default.execFile),NBt=BBt.default.dirname((0,Fon.fileURLToPath)(importMetaUrlShim)),Mon=BBt.default.join(NBt,"xdg-open"),{platform:kae,arch:Oon}=MBt.default;a(rwo,"getWindowsDefaultBrowserFromWsl");Bon=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),F1e=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Bon(t.app,l=>F1e({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return Bon(e,l=>F1e({...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=u7?await rwo():await DBt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),F1e({...t,app:{name:f7[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(kae==="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(kae==="win32"||u7&&!Pae()&&!e){n=await xBt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),u7||(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=OBt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!NBt||NBt==="/",u=!1;try{await aHe.default.access(Mon,aHe.constants.X_OK),u=!0}catch{}n=MBt.default.versions.electron??(kae==="android"||l||!u)?"xdg-open":Mon}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}kae==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=LBt.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"),nwo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return F1e({...e,target:t})},"open"),iwo=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 F1e({...e,app:{name:t,arguments:r}})},"openApp");a(Lon,"detectArchBinary");a(cHe,"detectPlatformBinary");f7={};d7(f7,"chrome",()=>cHe({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"]}}));d7(f7,"brave",()=>cHe({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"]}}));d7(f7,"firefox",()=>cHe({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));d7(f7,"edge",()=>cHe({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));d7(f7,"browser",()=>"browser");d7(f7,"browserPrivate",()=>"browserPrivate");U1e=nwo});var gsn=I(EM=>{"use strict";p();Object.defineProperty(EM,"__esModule",{value:!0});EM.bytePairEncode=EM.BinaryMap=EM.binaryMapKey=void 0;var Mwo=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");EM.binaryMapKey=Mwo;var XBt=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,EM.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,EM.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)}}};EM.BinaryMap=XBt;var yM=new Int32Array(128),g_=new Int32Array(128);function Owo(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;yM.length0&&(yM[g_[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(xHe,"__esModule",{value:!0});xHe.makeTextEncoder=void 0;var eLt=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}},tLt=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 tLt:new eLt,"makeTextEncoder");xHe.makeTextEncoder=Bwo});var ysn=I(wHe=>{"use strict";p();Object.defineProperty(wHe,"__esModule",{value:!0});wHe.LRUCache=void 0;var rLt=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 nLt(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}};wHe.LRUCache=rLt;var nLt=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var oLt=I(PHe=>{"use strict";p();Object.defineProperty(PHe,"__esModule",{value:!0});PHe.TikTokenizer=void 0;var RHe=gsn(),Lwo=Asn(),Fwo=ysn();function Uwo(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(Uwo,"loadTikTokenBpe");function Qwo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Qwo,"escapeRegExp");var iLt=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,Lwo.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new Fwo.LRUCache(o);let s=typeof e=="string"?Uwo(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new RHe.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=>Qwo(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,RHe.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,RHe.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,RHe.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))}};PHe.TikTokenizer=iLt});var wsn=I(Dh=>{"use strict";p();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.createTokenizer=Dh.createByEncoderName=Dh.createByModelName=Dh.getRegexByModel=Dh.getRegexByEncoder=Dh.getSpecialTokensByModel=Dh.getSpecialTokensByEncoder=Dh.MODEL_TO_ENCODING=void 0;var qwo=oLt(),jwo=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Dh.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 kHe="<|endoftext|>",Esn="<|fim_prefix|>",_sn="<|fim_middle|>",vsn="<|fim_suffix|>",Csn="<|endofprompt|>",Z1e="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",bsn="(?:'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+",Hwo=[`[^\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+"],xan=fko.join("|");function jLt(t){let e="";if(Ph.MODEL_TO_ENCODING.has(t))e=Ph.MODEL_TO_ENCODING.get(t);else for(let[r,n]of dko)if(t.startsWith(r)){e=n;break}return e}a(jLt,"getEncoderFromModelName");async function pko(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(pko,"fetchAndSaveFile");function HLt(t){let e=new Map([[iGe,50256]]);switch(t){case"o200k_base":e=new Map([[iGe,199999],[Tan,200018]]);break;case"cl100k_base":e=new Map([[iGe,100257],[van,100258],[ban,100259],[San,100260],[Tan,100276]]);break;case"p50k_edit":e=new Map([[iGe,50256],[van,50281],[ban,50282],[San,50283]]);break;default:break}return e}a(HLt,"getSpecialTokensByEncoder");Ph.getSpecialTokensByEncoder=HLt;function hko(t){let e=jLt(t);return HLt(e)}a(hko,"getSpecialTokensByModel");Ph.getSpecialTokensByModel=hko;function wan(t){switch(t){case"o200k_base":return xan;case"cl100k_base":return Ian;default:break}return bSe}a(wan,"getRegexByEncoder");Ph.getRegexByEncoder=wan;function mko(t){let e=jLt(t);return wan(e)}a(mko,"getRegexByModel");Ph.getRegexByModel=mko;async function gko(t,e=null){return Ran(jLt(t),e)}a(gko,"createByModelName");Ph.createByModelName=gko;async function Ran(t,e=null){let r,n,o=HLt(t);switch(t){case"o200k_base":r=xan,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=Ian,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=bSe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=bSe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=bSe,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=bSe,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 pko(n,d),console.log(`Saved file to ${d}`)),kan(d,o,r)}a(Ran,"createByEncoderName");Ph.createByEncoderName=Ran;function kan(t,e,r,n=8192){return new uko.TikTokenizer(t,e,r,n)}a(kan,"createTokenizer");Ph.createTokenizer=kan});var oGe=I(Dh=>{"use strict";p();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.createTokenizer=Dh.createByEncoderName=Dh.createByModelName=Dh.getSpecialTokensByModel=Dh.getSpecialTokensByEncoder=Dh.getRegexByModel=Dh.getRegexByEncoder=Dh.MODEL_TO_ENCODING=Dh.TikTokenizer=void 0;var Ako=qLt();Object.defineProperty(Dh,"TikTokenizer",{enumerable:!0,get:a(function(){return Ako.TikTokenizer},"get")});var x7=Pan();Object.defineProperty(Dh,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return x7.MODEL_TO_ENCODING},"get")});Object.defineProperty(Dh,"getRegexByEncoder",{enumerable:!0,get:a(function(){return x7.getRegexByEncoder},"get")});Object.defineProperty(Dh,"getRegexByModel",{enumerable:!0,get:a(function(){return x7.getRegexByModel},"get")});Object.defineProperty(Dh,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return x7.getSpecialTokensByEncoder},"get")});Object.defineProperty(Dh,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return x7.getSpecialTokensByModel},"get")});Object.defineProperty(Dh,"createByModelName",{enumerable:!0,get:a(function(){return x7.createByModelName},"get")});Object.defineProperty(Dh,"createByEncoderName",{enumerable:!0,get:a(function(){return x7.createByEncoderName},"get")});Object.defineProperty(Dh,"createTokenizer",{enumerable:!0,get:a(function(){return x7.createTokenizer},"get")})});var ZLt=I((K_u,tcn)=>{"use strict";p();tcn.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 ncn=I((X_u,rcn)=>{"use strict";p();var z2o=ZLt();function Y2o(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=z2o(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(Y2o,"parsePath");rcn.exports=Y2o});var lcn=I((rCu,ccn)=>{"use strict";p();var K2o=ncn();function J2o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(J2o,"_interopDefaultLegacy");var Z2o=J2o(K2o);function X2o(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(X2o,"getAugmentedNamespace");var ocn={},eDo="text/plain",tDo="us-ascii",icn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),rDo=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===tDo)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==eDo)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function nDo(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 rDo(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];icn(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()])icn(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(nDo,"normalizeUrl");var iDo=Object.freeze({__proto__:null,default:nDo}),oDo=X2o(iDo);Object.defineProperty(ocn,"__esModule",{value:!0});var sDo=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},aDo=oDo,cDo=scn(aDo),lDo=Z2o.default,uDo=scn(lDo);function scn(t){return t&&t.__esModule?t:{default:t}}a(scn,"_interopRequireDefault");var acn=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":sDo(r))!=="object"&&(r={stripHash:!1}),e=(0,cDo.default)(e,r));var s=(0,uDo.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");acn.MAX_INPUT_LENGTH=2048;var dDo=ocn.default=acn;ccn.exports=dDo});var fcn=I((oCu,dcn)=>{"use strict";p();var fDo=ZLt();function ucn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=fDo(t);if(t=t.substring(t.indexOf("://")+3),ucn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var pDo=lcn(),pcn=fcn();function hDo(t){let e=pDo(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),pcn(e.protocols)||e.protocols.length===0&&pcn(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(hDo,"gitUp");hcn.exports=hDo});var Acn=I((dCu,gcn)=>{"use strict";p();var mDo=mcn();function XLt(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=mDo(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return XLt.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=yDo(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(XLt,"gitUrlParse");XLt.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?gDo(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+ADo(t)+o;default:return t.href}};function gDo(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(gDo,"buildToken");function ADo(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(ADo,"buildPath");function yDo(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(yDo,"findLongestMatchingSubstring");gcn.exports=XLt});var ice=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,k=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":k=!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(q=>{let F=[],U=[];for(let V of q)V.name===M&&F.push(V.node),V.name===O&&U.push(V.node);let W=a((V,G,Y)=>Y?V.text===G.text:V.text!==G.text,"compare");return D?F.every(V=>U.some(G=>W(V,G,k))):F.some(V=>U.some(G=>W(V,G,k)))})}else{N=v[1].name;let M=v[2].value,O=a(F=>F.text===M,"matches"),q=a(F=>F.text!==M,"doesNotMatch");A[y].push(F=>{let U=[];for(let V of F)V.name===N&&U.push(V.node);let W=k?O:q;return D?U.every(W):U.some(W)})}break;case"any-not-match?":case"not-match?":k=!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 F of M)F.name===N&&O.push(F.node.text);let q=a((F,U)=>U?L.test(F):!L.test(F),"test");return O.length===0?!k:D?O.every(F=>q(F,k)):O.some(F=>q(F,k))});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?":k=!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 q of M)q.name===N&&O.push(q.node.text);return O.length===0?!k:O.every(q=>Q.includes(q))===k});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}. +\\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+"],Ssn=Hwo.join("|");function sLt(t){let e="";if(Dh.MODEL_TO_ENCODING.has(t))e=Dh.MODEL_TO_ENCODING.get(t);else for(let[r,n]of jwo)if(t.startsWith(r)){e=n;break}return e}a(sLt,"getEncoderFromModelName");async function Gwo(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(Gwo,"fetchAndSaveFile");function aLt(t){let e=new Map([[kHe,50256]]);switch(t){case"o200k_base":e=new Map([[kHe,199999],[Csn,200018]]);break;case"cl100k_base":e=new Map([[kHe,100257],[Esn,100258],[_sn,100259],[vsn,100260],[Csn,100276]]);break;case"p50k_edit":e=new Map([[kHe,50256],[Esn,50281],[_sn,50282],[vsn,50283]]);break;default:break}return e}a(aLt,"getSpecialTokensByEncoder");Dh.getSpecialTokensByEncoder=aLt;function $wo(t){let e=sLt(t);return aLt(e)}a($wo,"getSpecialTokensByModel");Dh.getSpecialTokensByModel=$wo;function Tsn(t){switch(t){case"o200k_base":return Ssn;case"cl100k_base":return bsn;default:break}return Z1e}a(Tsn,"getRegexByEncoder");Dh.getRegexByEncoder=Tsn;function Vwo(t){let e=sLt(t);return Tsn(e)}a(Vwo,"getRegexByModel");Dh.getRegexByModel=Vwo;async function Wwo(t,e=null){return Isn(sLt(t),e)}a(Wwo,"createByModelName");Dh.createByModelName=Wwo;async function Isn(t,e=null){let r,n,o=aLt(t);switch(t){case"o200k_base":r=Ssn,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=bsn,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=Z1e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=Z1e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=Z1e,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=Z1e,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 Gwo(n,d),console.log(`Saved file to ${d}`)),xsn(d,o,r)}a(Isn,"createByEncoderName");Dh.createByEncoderName=Isn;function xsn(t,e,r,n=8192){return new qwo.TikTokenizer(t,e,r,n)}a(xsn,"createTokenizer");Dh.createTokenizer=xsn});var DHe=I(Nh=>{"use strict";p();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.createTokenizer=Nh.createByEncoderName=Nh.createByModelName=Nh.getSpecialTokensByModel=Nh.getSpecialTokensByEncoder=Nh.getRegexByModel=Nh.getRegexByEncoder=Nh.MODEL_TO_ENCODING=Nh.TikTokenizer=void 0;var zwo=oLt();Object.defineProperty(Nh,"TikTokenizer",{enumerable:!0,get:a(function(){return zwo.TikTokenizer},"get")});var h7=wsn();Object.defineProperty(Nh,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return h7.MODEL_TO_ENCODING},"get")});Object.defineProperty(Nh,"getRegexByEncoder",{enumerable:!0,get:a(function(){return h7.getRegexByEncoder},"get")});Object.defineProperty(Nh,"getRegexByModel",{enumerable:!0,get:a(function(){return h7.getRegexByModel},"get")});Object.defineProperty(Nh,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return h7.getSpecialTokensByEncoder},"get")});Object.defineProperty(Nh,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return h7.getSpecialTokensByModel},"get")});Object.defineProperty(Nh,"createByModelName",{enumerable:!0,get:a(function(){return h7.createByModelName},"get")});Object.defineProperty(Nh,"createByEncoderName",{enumerable:!0,get:a(function(){return h7.createByEncoderName},"get")});Object.defineProperty(Nh,"createTokenizer",{enumerable:!0,get:a(function(){return h7.createTokenizer},"get")})});var gLt=I((Wgu,Zsn)=>{"use strict";p();Zsn.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 ean=I((Kgu,Xsn)=>{"use strict";p();var Tko=gLt();function Iko(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=Tko(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(Iko,"parsePath");Xsn.exports=Iko});var san=I((Xgu,oan)=>{"use strict";p();var xko=ean();function wko(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(wko,"_interopDefaultLegacy");var Rko=wko(xko);function Pko(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(Pko,"getAugmentedNamespace");var ran={},kko="text/plain",Dko="us-ascii",tan=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),Nko=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===Dko)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==kko)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function Mko(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 Nko(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];tan(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()])tan(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(Mko,"normalizeUrl");var Oko=Object.freeze({__proto__:null,default:Mko}),Bko=Pko(Oko);Object.defineProperty(ran,"__esModule",{value:!0});var Lko=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},Fko=Bko,Uko=nan(Fko),Qko=Rko.default,qko=nan(Qko);function nan(t){return t&&t.__esModule?t:{default:t}}a(nan,"_interopRequireDefault");var ian=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":Lko(r))!=="object"&&(r={stripHash:!1}),e=(0,Uko.default)(e,r));var s=(0,qko.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");ian.MAX_INPUT_LENGTH=2048;var jko=ran.default=ian;oan.exports=jko});var lan=I((rAu,can)=>{"use strict";p();var Hko=gLt();function aan(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=Hko(t);if(t=t.substring(t.indexOf("://")+3),aan(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var Gko=san(),uan=lan();function $ko(t){let e=Gko(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),uan(e.protocols)||e.protocols.length===0&&uan(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($ko,"gitUp");dan.exports=$ko});var han=I((cAu,pan)=>{"use strict";p();var Vko=fan();function ALt(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=Vko(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return ALt.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=Yko(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(ALt,"gitUrlParse");ALt.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?Wko(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+zko(t)+o;default:return t.href}};function Wko(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(Wko,"buildToken");function zko(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(zko,"buildPath");function Yko(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(Yko,"findLongestMatchingSubstring");pan.exports=ALt});var Qae=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(q=>{let Q=[],U=[];for(let W of q)W.name===M&&Q.push(W.node),W.name===O&&U.push(W.node);let z=a((W,$,J)=>J?W.text===$.text:W.text!==$.text,"compare");return D?Q.every(W=>U.some($=>z(W,$,P))):Q.some(W=>U.some($=>z(W,$,P)))})}else{N=v[1].name;let M=v[2].value,O=a(Q=>Q.text===M,"matches"),q=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 z=P?O:q;return D?U.every(z):U.some(z)})}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 q=a((Q,U)=>U?L.test(Q):!L.test(Q),"test");return O.length===0?!P:D?O.every(Q=>q(Q,P)):O.some(Q=>q(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 q of M)q.name===N&&O.push(q.node.text);return O.length===0?!P:O.every(q=>j.includes(q))===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 Pln={};wi(Pln,{TextDocument:()=>$L});function W3t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);W3t(n,e),W3t(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 SMo(t){let e=kln(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var x$e,$L,z3t=me(()=>{"use strict";p();x$e=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=kln(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=wln(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&&Rln(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 x$e(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof x$e)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=W3t(s.map(SMo),(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})($L||($L={}));a(W3t,"mergeSort");a(wln,"computeLineOffsets");a(Rln,"isEOL");a(kln,"getWellformedRange");a(SMo,"getWellformedEdit")});var L$e=I(Bh=>{"use strict";p();Object.defineProperty(Bh,"__esModule",{value:!0});Bh.thenable=Bh.typedArray=Bh.stringArray=Bh.array=Bh.func=Bh.error=Bh.number=Bh.string=Bh.boolean=void 0;function wMo(t){return t===!0||t===!1}a(wMo,"boolean");Bh.boolean=wMo;function Hun(t){return typeof t=="string"||t instanceof String}a(Hun,"string");Bh.string=Hun;function RMo(t){return typeof t=="number"||t instanceof Number}a(RMo,"number");Bh.number=RMo;function kMo(t){return t instanceof Error}a(kMo,"error");Bh.error=kMo;function Gun(t){return typeof t=="function"}a(Gun,"func");Bh.func=Gun;function $un(t){return Array.isArray(t)}a($un,"array");Bh.array=$un;function PMo(t){return $un(t)&&t.every(e=>Hun(e))}a(PMo,"stringArray");Bh.stringArray=PMo;function DMo(t,e){return Array.isArray(t)&&t.every(e)}a(DMo,"typedArray");Bh.typedArray=DMo;function NMo(t){return t&&Gun(t.then)}a(NMo,"thenable");Bh.thenable=NMo});var fFt=I(Ax=>{"use strict";p();Object.defineProperty(Ax,"__esModule",{value:!0});Ax.generateUuid=Ax.parse=Ax.isUUID=Ax.v4=Ax.empty=void 0;var tTe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},rTe=class t extends tTe{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(""))}};rTe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];rTe._timeHighBits=["8","9","a","b"];Ax.empty=new tTe("00000000-0000-0000-0000-000000000000");function Vun(){return new rTe}a(Vun,"v4");Ax.v4=Vun;var MMo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Wun(t){return MMo.test(t)}a(Wun,"isUUID");Ax.isUUID=Wun;function OMo(t){if(!Wun(t))throw new Error("invalid uuid");return new tTe(t)}a(OMo,"parse");Ax.parse=OMo;function BMo(){return Vun().asHex()}a(BMo,"generateUuid");Ax.generateUuid=BMo});var zun=I($7=>{"use strict";p();Object.defineProperty($7,"__esModule",{value:!0});$7.attachPartialResult=$7.ProgressFeature=$7.attachWorkDone=void 0;var G7=ti(),LMo=fFt(),sY=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(G7.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(G7.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(G7.WorkDoneProgress.type,this._token,{kind:"end"})}};sY.Instances=new Map;var F$e=class extends sY{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new G7.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},nTe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},U$e=class extends nTe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new G7.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function FMo(t,e){if(e===void 0||e.workDoneToken===void 0)return new nTe;let r=e.workDoneToken;return delete e.workDoneToken,new sY(t,r)}a(FMo,"attachWorkDone");$7.attachWorkDone=FMo;var UMo=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(G7.WorkDoneProgressCancelNotification.type,r=>{let n=sY.Instances.get(r.token);(n instanceof F$e||n instanceof U$e)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new nTe:new sY(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,LMo.generateUuid)();return this.connection.sendRequest(G7.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new F$e(this.connection,e))}else return Promise.resolve(new U$e)}},"ProgressFeature");$7.ProgressFeature=UMo;var pFt;(function(t){t.type=new G7.ProgressType})(pFt||(pFt={}));var hFt=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(pFt.type,this._token,e)}};function QMo(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new hFt(t,r)}a(QMo,"attachPartialResult");$7.attachPartialResult=QMo});var Yun=I(Q$e=>{"use strict";p();Object.defineProperty(Q$e,"__esModule",{value:!0});Q$e.ConfigurationFeature=void 0;var qMo=ti(),jMo=L$e(),HMo=a(t=>class extends t{getConfiguration(e){return e?jMo.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(qMo.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");Q$e.ConfigurationFeature=HMo});var Kun=I(j$e=>{"use strict";p();Object.defineProperty(j$e,"__esModule",{value:!0});j$e.WorkspaceFoldersFeature=void 0;var q$e=ti(),GMo=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 q$e.Emitter,this.connection.onNotification(q$e.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(q$e.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(q$e.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");j$e.WorkspaceFoldersFeature=GMo});var Jun=I(H$e=>{"use strict";p();Object.defineProperty(H$e,"__esModule",{value:!0});H$e.CallHierarchyFeature=void 0;var mFt=ti(),$Mo=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(mFt.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=mFt.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=mFt.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");H$e.CallHierarchyFeature=$Mo});var AFt=I(V7=>{"use strict";p();Object.defineProperty(V7,"__esModule",{value:!0});V7.SemanticTokensBuilder=V7.SemanticTokensDiff=V7.SemanticTokensFeature=void 0;var G$e=ti(),VMo=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(G$e.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=G$e.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=G$e.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=G$e.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");V7.SemanticTokensFeature=VMo;var $$e=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 $$e(this._prevData,this._data).computeDiff()}:this.build()}};V7.SemanticTokensBuilder=gFt});var Zun=I(V$e=>{"use strict";p();Object.defineProperty(V$e,"__esModule",{value:!0});V$e.ShowDocumentFeature=void 0;var WMo=ti(),zMo=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(WMo.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");V$e.ShowDocumentFeature=zMo});var Xun=I(W$e=>{"use strict";p();Object.defineProperty(W$e,"__esModule",{value:!0});W$e.FileOperationsFeature=void 0;var _ce=ti(),YMo=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(_ce.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(_ce.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(_ce.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(_ce.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(_ce.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(_ce.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");W$e.FileOperationsFeature=YMo});var edn=I(z$e=>{"use strict";p();Object.defineProperty(z$e,"__esModule",{value:!0});z$e.LinkedEditingRangeFeature=void 0;var KMo=ti(),JMo=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(KMo.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");z$e.LinkedEditingRangeFeature=JMo});var tdn=I(Y$e=>{"use strict";p();Object.defineProperty(Y$e,"__esModule",{value:!0});Y$e.TypeHierarchyFeature=void 0;var yFt=ti(),ZMo=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(yFt.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=yFt.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=yFt.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");Y$e.TypeHierarchyFeature=ZMo});var ndn=I(K$e=>{"use strict";p();Object.defineProperty(K$e,"__esModule",{value:!0});K$e.InlineValueFeature=void 0;var rdn=ti(),XMo=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(rdn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(rdn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");K$e.InlineValueFeature=XMo});var odn=I(J$e=>{"use strict";p();Object.defineProperty(J$e,"__esModule",{value:!0});J$e.FoldingRangeFeature=void 0;var idn=ti(),eOo=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(idn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=idn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");J$e.FoldingRangeFeature=eOo});var sdn=I(Z$e=>{"use strict";p();Object.defineProperty(Z$e,"__esModule",{value:!0});Z$e.InlayHintFeature=void 0;var EFt=ti(),tOo=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(EFt.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(EFt.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(EFt.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");Z$e.InlayHintFeature=tOo});var adn=I(X$e=>{"use strict";p();Object.defineProperty(X$e,"__esModule",{value:!0});X$e.DiagnosticFeature=void 0;var iTe=ti(),rOo=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(iTe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(iTe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(iTe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(iTe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(iTe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");X$e.DiagnosticFeature=rOo});var CFt=I(eVe=>{"use strict";p();Object.defineProperty(eVe,"__esModule",{value:!0});eVe.TextDocuments=void 0;var aY=ti(),_Ft=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new aY.Emitter,this._onDidOpen=new aY.Emitter,this._onDidClose=new aY.Emitter,this._onDidSave=new aY.Emitter,this._onWillSave=new aY.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=aY.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}))})),aY.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};eVe.TextDocuments=_Ft});var bFt=I(Cce=>{"use strict";p();Object.defineProperty(Cce,"__esModule",{value:!0});Cce.NotebookDocuments=Cce.NotebookSyncFeature=void 0;var yx=ti(),cdn=CFt(),nOo=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(yx.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(yx.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(yx.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(yx.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Cce.NotebookSyncFeature=nOo;var tVe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,yx.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,yx.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,yx.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}};tVe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var vFt=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof cdn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new cdn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new yx.Emitter,this._onDidChange=new yx.Emitter,this._onDidSave=new yx.Emitter,this._onDidClose=new yx.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 tVe,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)}})),yx.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Cce.NotebookDocuments=vFt});var ldn=I(rVe=>{"use strict";p();Object.defineProperty(rVe,"__esModule",{value:!0});rVe.MonikerFeature=void 0;var iOo=ti(),oOo=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=iOo.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");rVe.MonikerFeature=oOo});var RFt=I(fc=>{"use strict";p();Object.defineProperty(fc,"__esModule",{value:!0});fc.createConnection=fc.combineFeatures=fc.combineNotebooksFeatures=fc.combineLanguagesFeatures=fc.combineWorkspaceFeatures=fc.combineWindowFeatures=fc.combineClientFeatures=fc.combineTracerFeatures=fc.combineTelemetryFeatures=fc.combineConsoleFeatures=fc._NotebooksImpl=fc._LanguagesImpl=fc.BulkUnregistration=fc.BulkRegistration=fc.ErrorMessageTracker=void 0;var Yr=ti(),Ex=L$e(),TFt=fFt(),xo=zun(),sOo=Yun(),aOo=Kun(),cOo=Jun(),lOo=AFt(),uOo=Zun(),dOo=Xun(),fOo=edn(),pOo=tdn(),hOo=ndn(),mOo=odn(),gOo=sdn(),AOo=adn(),yOo=bFt(),EOo=ldn();function SFt(t){if(t!==null)return t}a(SFt,"null2Undefined");var IFt=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)})}};fc.ErrorMessageTracker=IFt;var nVe=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(Yr.MessageType.Error,e)}warn(e){this.send(Yr.MessageType.Warning,e)}info(e){this.send(Yr.MessageType.Info,e)}log(e){this.send(Yr.MessageType.Log,e)}debug(e){this.send(Yr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Yr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Yr.RAL)().console.error("Sending log message failed")})}},xFt=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:Yr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(SFt)}showWarningMessage(e,...r){let n={type:Yr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(SFt)}showInformationMessage(e,...r){let n={type:Yr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(SFt)}},udn=(0,uOo.ShowDocumentFeature)((0,xo.ProgressFeature)(xFt)),ddn;(function(t){function e(){return new iVe}a(e,"create"),t.create=e})(ddn||(fc.BulkRegistration=ddn={}));var iVe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Ex.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=TFt.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},fdn;(function(t){function e(){return new oTe(void 0,[])}a(e,"create"),t.create=e})(fdn||(fc.BulkUnregistration=fdn={}));var oTe=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(Yr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Ex.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Yr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},oVe=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 iVe?this.registerMany(e):e instanceof oTe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=Ex.string(r)?r:r.method,s=TFt.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Yr.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=Ex.string(e)?e:e.method,o=TFt.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Yr.RegistrationRequest.type,s).then(c=>Yr.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(Yr.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(Yr.RegistrationRequest.type,r).then(()=>new oTe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},wFt=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(Yr.ApplyWorkspaceEditRequest.type,n)}},pdn=(0,dOo.FileOperationsFeature)((0,aOo.WorkspaceFoldersFeature)((0,sOo.ConfigurationFeature)(wFt))),sVe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Yr.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!==Yr.Trace.Off&&this.connection.sendNotification(Yr.LogTraceNotification.type,{message:e,verbose:this._trace===Yr.Trace.Verbose?r:void 0}).catch(()=>{})}},aVe=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(Yr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},cVe=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,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};fc._LanguagesImpl=cVe;var hdn=(0,mOo.FoldingRangeFeature)((0,EOo.MonikerFeature)((0,AOo.DiagnosticFeature)((0,gOo.InlayHintFeature)((0,hOo.InlineValueFeature)((0,pOo.TypeHierarchyFeature)((0,fOo.LinkedEditingRangeFeature)((0,lOo.SemanticTokensFeature)((0,cOo.CallHierarchyFeature)(cVe))))))))),lVe=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,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};fc._NotebooksImpl=lVe;var mdn=(0,yOo.NotebookSyncFeature)(lVe);function gdn(t,e){return function(r){return e(t(r))}}a(gdn,"combineConsoleFeatures");fc.combineConsoleFeatures=gdn;function Adn(t,e){return function(r){return e(t(r))}}a(Adn,"combineTelemetryFeatures");fc.combineTelemetryFeatures=Adn;function ydn(t,e){return function(r){return e(t(r))}}a(ydn,"combineTracerFeatures");fc.combineTracerFeatures=ydn;function Edn(t,e){return function(r){return e(t(r))}}a(Edn,"combineClientFeatures");fc.combineClientFeatures=Edn;function _dn(t,e){return function(r){return e(t(r))}}a(_dn,"combineWindowFeatures");fc.combineWindowFeatures=_dn;function Cdn(t,e){return function(r){return e(t(r))}}a(Cdn,"combineWorkspaceFeatures");fc.combineWorkspaceFeatures=Cdn;function vdn(t,e){return function(r){return e(t(r))}}a(vdn,"combineLanguagesFeatures");fc.combineLanguagesFeatures=vdn;function bdn(t,e){return function(r){return e(t(r))}}a(bdn,"combineNotebooksFeatures");fc.combineNotebooksFeatures=bdn;function _Oo(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,gdn),tracer:r(t.tracer,e.tracer,ydn),telemetry:r(t.telemetry,e.telemetry,Adn),client:r(t.client,e.client,Edn),window:r(t.window,e.window,_dn),workspace:r(t.workspace,e.workspace,Cdn),languages:r(t.languages,e.languages,vdn),notebooks:r(t.notebooks,e.notebooks,bdn)}}a(_Oo,"combineFeatures");fc.combineFeatures=_Oo;function COo(t,e,r){let n=r&&r.console?new(r.console(nVe)):new nVe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(sVe)):new sVe,c=r&&r.telemetry?new(r.telemetry(aVe)):new aVe,l=r&&r.client?new(r.client(oVe)):new oVe,u=r&&r.window?new(r.window(udn)):new udn,d=r&&r.workspace?new(r.workspace(pdn)):new pdn,f=r&&r.languages?new(r.languages(hdn)):new hdn,h=r&&r.notebooks?new(r.notebooks(mdn)):new mdn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:Ex.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(Ex.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=Ex.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(Yr.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(Yr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Yr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Yr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Yr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Yr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Yr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Yr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Yr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Yr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Yr.HoverRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Yr.CompletionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Yr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Yr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Yr.DeclarationRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Yr.DefinitionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Yr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Yr.ImplementationRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Yr.ReferencesRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Yr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Yr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Yr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Yr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Yr.CodeActionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Yr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Yr.CodeLensRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Yr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Yr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Yr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Yr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Yr.RenameRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Yr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Yr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Yr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Yr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Yr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Yr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Yr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Yr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Yr.InitializeRequest.type,v=>{e.initialize(v),Ex.string(v.trace)&&(s.trace=Yr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Yr.CancellationTokenSource().token,(0,xo.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Yr.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=Ex.number(_.__textDocumentSync)?_.__textDocumentSync:Yr.TextDocumentSyncKind.None:!Ex.number(R.textDocumentSync)&&!Ex.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Ex.number(_.__textDocumentSync)?_.__textDocumentSync:Yr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Yr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Yr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Yr.CancellationTokenSource().token)}),o.onNotification(Yr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Yr.SetTraceNotification.type,v=>{s.trace=Yr.Trace.fromString(v.value)}),_}a(COo,"createConnection");fc.createConnection=COo});var Sdn=I(yv=>{"use strict";p();Object.defineProperty(yv,"__esModule",{value:!0});yv.resolveModulePath=yv.FileSystem=yv.resolveGlobalYarnPath=yv.resolveGlobalNodePath=yv.resolve=yv.uriToFilePath=void 0;var vOo=require("url"),oP=require("path"),kFt=require("fs"),MFt=require("child_process");function bOo(t){let e=vOo.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 oP.normalize(r.join("/"))}a(bOo,"uriToFilePath");yv.uriToFilePath=bOo;function PFt(){return process.platform==="win32"}a(PFt,"isWindows");function uVe(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&&kFt.existsSync(e)&&(d[o]?d[o]=e+oP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,MFt.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(uVe,"resolve");yv.resolve=uVe;function DFt(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};PFt()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,MFt.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?PFt()?oP.join(c,"node_modules"):oP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(DFt,"resolveGlobalNodePath");yv.resolveGlobalNodePath=DFt;function SOo(t){let e="yarn",r={encoding:"utf8"};PFt()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,MFt.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 oP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(SOo,"resolveGlobalYarnPath");yv.resolveGlobalYarnPath=SOo;var NFt;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!kFt.existsSync(__filename.toUpperCase())||!kFt.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?oP.normalize(s).indexOf(oP.normalize(o))===0:oP.normalize(s).toLowerCase().indexOf(oP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(NFt||(yv.FileSystem=NFt={}));function TOo(t,e,r,n){return r?(oP.isAbsolute(r)||(r=oP.join(t,r)),uVe(e,r,r,n).then(o=>NFt.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>uVe(e,DFt(n),t,n))):uVe(e,DFt(n),t,n)}a(TOo,"resolveModulePath");yv.resolveModulePath=TOo});var OFt=I((Gku,Tdn)=>{"use strict";p();Tdn.exports=ti()});var Idn=I(dVe=>{"use strict";p();Object.defineProperty(dVe,"__esModule",{value:!0});dVe.InlineCompletionFeature=void 0;var IOo=ti(),xOo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(IOo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");dVe.InlineCompletionFeature=xOo});var Rdn=I(Fy=>{"use strict";p();var wOo=Fy&&Fy.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wdn=Fy&&Fy.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wOo(e,t,r)};Object.defineProperty(Fy,"__esModule",{value:!0});Fy.ProposedFeatures=Fy.NotebookDocuments=Fy.TextDocuments=Fy.SemanticTokensBuilder=void 0;var ROo=AFt();Object.defineProperty(Fy,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return ROo.SemanticTokensBuilder},"get")});var kOo=Idn();wdn(ti(),Fy);var POo=CFt();Object.defineProperty(Fy,"TextDocuments",{enumerable:!0,get:a(function(){return POo.TextDocuments},"get")});var DOo=bFt();Object.defineProperty(Fy,"NotebookDocuments",{enumerable:!0,get:a(function(){return DOo.NotebookDocuments},"get")});wdn(RFt(),Fy);var xdn;(function(t){t.all={__brand:"features",languages:kOo.InlineCompletionFeature}})(xdn||(Fy.ProposedFeatures=xdn={}))});var Al=I(_x=>{"use strict";p();var NOo=_x&&_x.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ndn=_x&&_x.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NOo(e,t,r)};Object.defineProperty(_x,"__esModule",{value:!0});_x.createConnection=_x.Files=void 0;var kdn=require("node:util"),BFt=L$e(),MOo=RFt(),sTe=Sdn(),cY=OFt();Ndn(OFt(),_x);Ndn(Rdn(),_x);var Pdn;(function(t){t.uriToFilePath=sTe.uriToFilePath,t.resolveGlobalNodePath=sTe.resolveGlobalNodePath,t.resolveGlobalYarnPath=sTe.resolveGlobalYarnPath,t.resolve=sTe.resolve,t.resolveModulePath=sTe.resolveModulePath})(Pdn||(_x.Files=Pdn={}));var Ddn;function fVe(){if(Ddn!==void 0)try{Ddn.end()}catch{}}a(fVe,"endProtocolConnection");var vce=!1,Mdn;function OOo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(Mdn=setInterval(()=>{try{process.kill(n,0)}catch{fVe(),process.exit(vce?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;BFt.number(e)&&Mdn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(vce?0:1)}},3e3)},"initialize"),get shutdownReceived(){return vce},set shutdownReceived(t){vce=t},exit:a(t=>{fVe(),process.exit(t)},"exit")};function LOo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),cY.ConnectionStrategy.is(t)||cY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),FOo(s,c,l,o)}a(LOo,"createConnection");_x.createConnection=LOo;function FOo(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{fVe(),process.exit(vce?0:1)}),u.on("close",()=>{fVe(),process.exit(vce?0:1)})}let l=a(u=>{let d=(0,cY.createProtocolConnection)(t,e,u,r);return o&&UOo(u),d},"connectionFactory");return(0,MOo.createConnection)(l,BOo,n)}a(FOo,"_createConnection");function UOo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,kdn.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,kdn.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(UOo,"patchConsole")});var sP=I((rPu,Odn)=>{"use strict";p();Odn.exports=Al()});var pfn=I((W2u,ffn)=>{"use strict";p();ffn.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 dpn=I($0=>{"use strict";p();var y8t=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),U5o=y8t(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")}),Q5o=y8t(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")}),q5o=y8t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),spn=$0&&$0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),j5o=$0&&$0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),apn=$0&&$0.__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:$5o,sync:V5o}=dpn(),{join:W5o,delimiter:z5o,sep:fpn,posix:ppn}=require("path"),hpn=process.platform==="win32",mpn=new RegExp(`[${ppn.sep}${fpn===ppn.sep?"":fpn}]`.replace(/(\\)/g,"\\$1")),Y5o=new RegExp(`^\\.${mpn.source}`),gpn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),Apn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=z5o})=>{let o=t.match(mpn)?[""]:[...hpn?[process.cwd()]:[],...(e||"").split(n)];if(hpn){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"),ypn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&Y5o.test(e)?e.slice(0,2):"")+W5o(r,e)},"getPathPart"),Epn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Apn(t,e),s=[];for(let c of r){let l=ypn(c,t);for(let u of n){let d=l+u;if(await $5o(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 gpn(t)},"which"),K5o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Apn(t,e),s=[];for(let c of r){let l=ypn(c,t);for(let u of n){let d=l+u;if(V5o(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 gpn(t)},"whichSync");_pn.exports=Epn;Epn.sync=K5o});var STe=I((ABu,n0n)=>{"use strict";p();var Xhn="[^\\\\/]",$3o="(?=.)",e0n="[^/]",Y8t="(?:\\/|$)",t0n="(?:^|\\/)",K8t=`\\.{1,2}${Y8t}`,V3o="(?!\\.)",W3o=`(?!${t0n}${K8t})`,z3o=`(?!\\.{0,1}${Y8t})`,Y3o=`(?!${K8t})`,K3o="[^.\\/]",J3o=`${e0n}*?`,Z3o="/",r0n={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:$3o,QMARK:e0n,END_ANCHOR:Y8t,DOTS_SLASH:K8t,NO_DOT:V3o,NO_DOTS:W3o,NO_DOT_SLASH:z3o,NO_DOTS_SLASH:Y3o,QMARK_NO_DOT:K3o,STAR:J3o,START_ANCHOR:t0n,SEP:Z3o},X3o={...r0n,SLASH_LITERAL:"[\\\\/]",QMARK:Xhn,STAR:`${Xhn}*?`,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:"\\"},eFo={__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"};n0n.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:eFo,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?X3o:r0n}}});var TTe=I(Sv=>{"use strict";p();var{REGEX_BACKSLASH:tFo,REGEX_REMOVE_BACKSLASH:rFo,REGEX_SPECIAL_CHARS:nFo,REGEX_SPECIAL_CHARS_GLOBAL:iFo}=STe();Sv.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Sv.hasRegexChars=t=>nFo.test(t);Sv.isRegexChar=t=>t.length===1&&Sv.hasRegexChars(t);Sv.escapeRegex=t=>t.replace(iFo,"\\$1");Sv.toPosixSlashes=t=>t.replace(tFo,"/");Sv.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};Sv.removeBackslashes=t=>t.replace(rFo,e=>e==="\\"?"":e);Sv.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Sv.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Sv.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Sv.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};Sv.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var d0n=I((CBu,u0n)=>{"use strict";p();var i0n=TTe(),{CHAR_ASTERISK:J8t,CHAR_AT:oFo,CHAR_BACKWARD_SLASH:ITe,CHAR_COMMA:sFo,CHAR_DOT:Z8t,CHAR_EXCLAMATION_MARK:X8t,CHAR_FORWARD_SLASH:l0n,CHAR_LEFT_CURLY_BRACE:e6t,CHAR_LEFT_PARENTHESES:t6t,CHAR_LEFT_SQUARE_BRACKET:aFo,CHAR_PLUS:cFo,CHAR_QUESTION_MARK:o0n,CHAR_RIGHT_CURLY_BRACE:lFo,CHAR_RIGHT_PARENTHESES:s0n,CHAR_RIGHT_SQUARE_BRACKET:uFo}=STe(),a0n=a(t=>t===l0n||t===ITe,"isPathSeparator"),c0n=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),dFo=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,k,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=k,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&&a0n(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),r.unescape===!0&&(O&&(O=i0n.removeBackslashes(O)),Q&&v===!0&&(Q=i0n.removeBackslashes(Q)));let q={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&&(q.maxDepth=0,a0n(k)||c.push(D),q.tokens=c),r.parts===!0||r.tokens===!0){let F;for(let U=0;U{"use strict";p();var xTe=STe(),TS=TTe(),{MAX_LENGTH:lWe,POSIX_REGEX_SOURCE:fFo,REGEX_NON_SPECIAL_CHARS:pFo,REGEX_SPECIAL_CHARS_BACKREF:hFo,REPLACEMENTS:f0n}=xTe,mFo=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=>TS.escapeRegex(o)).join("..")}return r},"expandRange"),Uce=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),p0n=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"),gFo=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"),h0n=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(gFo(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),AFo=a(t=>{let e=t.map(h0n).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"),yFo=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=h0n(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?TS.escapeRegex(r[0]):`[${r.map(o=>TS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),EFo=a(t=>{let e=0,r=t.trim(),n=r6t(r);for(;n;)e++,r=n.body.trim(),n=r6t(r);return e},"repeatedExtglobRecursion"),_Fo=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:xTe.DEFAULT_MAX_EXTGLOB_RECURSION,n=p0n(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||AFo(n)))return{risky:!0};for(let o of n){let s=yFo(o);if(s)return{risky:!0,safeOutput:s};if(EFo(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),n6t=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=f0n[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(lWe,r.maxLength):lWe,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=xTe.globChars(r.windows),d=xTe.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(Ae=>`(${l}(?:(?!${w}${Ae.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,k=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=TS.removePrefix(t,N),o=t.length;let L=[],B=[],Q=[],M=s,O,q=a(()=>N.index===o-1,"eos"),F=N.peek=(Ae=1)=>t[N.index+Ae],U=N.advance=()=>t[++N.index]||"",W=a(()=>t.slice(N.index+1),"remaining"),V=a((Ae="",De=0)=>{N.consumed+=Ae,N.index+=De},"consume"),G=a(Ae=>{N.output+=Ae.output!=null?Ae.output:Ae.value,V(Ae.value)},"append"),Y=a(()=>{let Ae=1;for(;F()==="!"&&(F(2)!=="("||F(3)==="?");)U(),N.start++,Ae++;return Ae%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),re=a(Ae=>{N[Ae]++,Q.push(Ae)},"increment"),j=a(Ae=>{N[Ae]--,Q.pop()},"decrement"),X=a(Ae=>{if(M.type==="globstar"){let De=N.braces>0&&(Ae.type==="comma"||Ae.type==="brace"),Te=Ae.extglob===!0||L.length&&(Ae.type==="pipe"||Ae.type==="paren");Ae.type!=="slash"&&Ae.type!=="paren"&&!De&&!Te&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&Ae.type!=="paren"&&(L[L.length-1].inner+=Ae.value),(Ae.value||Ae.output)&&G(Ae),M&&M.type==="text"&&Ae.type==="text"){M.output=(M.output||M.value)+Ae.value,M.value+=Ae.value;return}Ae.prev=M,c.push(Ae),M=Ae},"push"),ie=a((Ae,De)=>{let Te={...d[De],conditions:1,inner:""};Te.prev=M,Te.parens=N.parens,Te.output=N.output,Te.startIndex=N.index,Te.tokensIndex=c.length;let Z=(r.capture?"(":"")+Te.open;re("parens"),X({type:Ae,value:De,output:N.output?"":g}),X({type:"paren",extglob:!0,value:U(),output:Z}),L.push(Te)},"extglobOpen"),we=a(Ae=>{let De=t.slice(Ae.startIndex,N.index+1),Te=t.slice(Ae.startIndex+2,N.index),Z=_Fo(Te,r);if((Ae.type==="plus"||Ae.type==="star")&&Z.risky){let le=Z.safeOutput?(Ae.output?"":g)+(r.capture?`(${Z.safeOutput})`:Z.safeOutput):void 0,K=c[Ae.tokensIndex];K.type="text",K.value=De,K.output=le||TS.escapeRegex(De);for(let ae=Ae.tokensIndex+1;ae1&&Ae.inner.includes("/")&&(le=R(r)),(le!==D||q()||/^\)+$/.test(W()))&&(J=Ae.close=`)$))${le}`),Ae.inner.includes("*")&&(z=W())&&/^\.[^\\/.]+$/.test(z)){let K=n6t(z,{...e,fastpaths:!1}).output;J=Ae.close=`)${K})${le})`}Ae.prev.type==="bos"&&(N.negatedExtglob=!0)}X({type:"paren",extglob:!0,value:O,output:J}),j("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let Ae=!1,De=t.replace(hFo,(Te,Z,J,z,le,K)=>z==="\\"?(Ae=!0,Te):z==="?"?Z?Z+z+(le?v.repeat(le.length):""):K===0?k+(le?v.repeat(le.length):""):v.repeat(J.length):z==="."?f.repeat(J.length):z==="*"?Z?Z+z+(le?D:""):D:Z?Te:`\\${Te}`);return Ae===!0&&(r.unescape===!0?De=De.replace(/\\/g,""):De=De.replace(/\\+/g,Te=>Te.length%2===0?"\\\\":Te?"\\":"")),De===t&&r.contains===!0?(N.output=t,N):(N.output=TS.wrapOutput(De,N,e),N)}for(;!q();){if(O=U(),O==="\0")continue;if(O==="\\"){let Te=F();if(Te==="/"&&r.bash!==!0||Te==="."||Te===";")continue;if(!Te){O+="\\",X({type:"text",value:O});continue}let Z=/^\\+/.exec(W()),J=0;if(Z&&Z[0].length>2&&(J=Z[0].length,N.index+=J,J%2!==0&&(O+="\\")),r.unescape===!0?O=U():O+=U(),N.brackets===0){X({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let Te=M.value.slice(1);if(Te.includes("[")&&(M.posix=!0,Te.includes(":"))){let Z=M.value.lastIndexOf("["),J=M.value.slice(0,Z),z=M.value.slice(Z+2),le=fFo[z];if(le){M.value=J+le,N.backtrack=!0,U(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(O==="["&&F()!==":"||O==="-"&&F()==="]")&&(O=`\\${O}`),O==="]"&&(M.value==="["||M.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&M.value==="["&&(O="^"),M.value+=O,G({value:O});continue}if(N.quotes===1&&O!=='"'){O=TS.escapeRegex(O),M.value+=O,G({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&X({type:"text",value:O});continue}if(O==="("){re("parens"),X({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Uce("opening","("));let Te=L[L.length-1];if(Te&&N.parens===Te.parens+1){we(L.pop());continue}X({type:"paren",value:O,output:N.parens?")":"\\)"}),j("parens");continue}if(O==="["){if(r.nobracket===!0||!W().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Uce("closing","]"));O=`\\${O}`}else re("brackets");X({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){X({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Uce("opening","["));X({type:"text",value:O,output:`\\${O}`});continue}j("brackets");let Te=M.value.slice(1);if(M.posix!==!0&&Te[0]==="^"&&!Te.includes("/")&&(O=`/${O}`),M.value+=O,G({value:O}),r.literalBrackets===!1||TS.hasRegexChars(Te))continue;let Z=TS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=Z,M.value=Z;continue}M.value=`(${l}${Z}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){re("braces");let Te={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(Te),X(Te);continue}if(O==="}"){let Te=B[B.length-1];if(r.nobrace===!0||!Te){X({type:"text",value:O,output:O});continue}let Z=")";if(Te.dots===!0){let J=c.slice(),z=[];for(let le=J.length-1;le>=0&&(c.pop(),J[le].type!=="brace");le--)J[le].type!=="dots"&&z.unshift(J[le].value);Z=mFo(z,r),N.backtrack=!0}if(Te.comma!==!0&&Te.dots!==!0){let J=N.output.slice(0,Te.outputIndex),z=N.tokens.slice(Te.tokensIndex);Te.value=Te.output="\\{",O=Z="\\}",N.output=J;for(let le of z)N.output+=le.output||le.value}X({type:"brace",value:O,output:Z}),j("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,X({type:"text",value:O});continue}if(O===","){let Te=O,Z=B[B.length-1];Z&&Q[Q.length-1]==="braces"&&(Z.comma=!0,Te="|"),X({type:"comma",value:O,output:Te});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}X({type:"slash",value:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let Te=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,Te.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){X({type:"text",value:O,output:f});continue}X({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&F()==="("&&F(2)!=="?"){ie("qmark",O);continue}if(M&&M.type==="paren"){let Z=F(),J=O;(M.value==="("&&!/[!=<:]/.test(Z)||Z==="<"&&!/<([!=]|\w+>)/.test(W()))&&(J=`\\${O}`),X({type:"text",value:O,output:J});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){X({type:"qmark",value:O,output:b});continue}X({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&F()==="("&&(F(2)!=="?"||!/[!=<:]/.test(F(3)))){ie("negate",O);continue}if(r.nonegate!==!0&&N.index===0){Y();continue}}if(O==="+"){if(r.noextglob!==!0&&F()==="("&&F(2)!=="?"){ie("plus",O);continue}if(M&&M.value==="("||r.regex===!1){X({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){X({type:"plus",value:O});continue}X({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&F()==="("&&F(2)!=="?"){X({type:"at",extglob:!0,value:O,output:""});continue}X({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let Te=pFo.exec(W());Te&&(O+=Te[0],N.index+=Te[0].length),X({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,V(O);continue}let Ae=W();if(r.noextglob!==!0&&/^\([^?]/.test(Ae)){ie("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){V(O);continue}let Te=M.prev,Z=Te.prev,J=Te.type==="slash"||Te.type==="bos",z=Z&&(Z.type==="star"||Z.type==="globstar");if(r.bash===!0&&(!J||Ae[0]&&Ae[0]!=="/")){X({type:"star",value:O,output:""});continue}let le=N.braces>0&&(Te.type==="comma"||Te.type==="brace"),K=L.length&&(Te.type==="pipe"||Te.type==="paren");if(!J&&Te.type!=="paren"&&!le&&!K){X({type:"star",value:O,output:""});continue}for(;Ae.slice(0,3)==="/**";){let ae=t[N.index+4];if(ae&&ae!=="/")break;Ae=Ae.slice(3),V("/**",3)}if(Te.type==="bos"&&q()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,V(O);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&!z&&q()){N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=Te.output+M.output,V(O);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&Ae[0]==="/"){let ae=Ae[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ae})`,M.value+=O,N.output+=Te.output+M.output,N.globstar=!0,V(O+U()),X({type:"slash",value:"/",output:""});continue}if(Te.type==="bos"&&Ae[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,V(O+U()),X({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,V(O);continue}let De={type:"star",value:O,output:D};if(r.bash===!0){De.output=".*?",(M.type==="bos"||M.type==="slash")&&(De.output=x+De.output),X(De);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){De.output=O,X(De);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),F()!=="*"&&(N.output+=g,M.output+=g)),X(De)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Uce("closing","]"));N.output=TS.escapeLast(N.output,"["),j("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Uce("closing",")"));N.output=TS.escapeLast(N.output,"("),j("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Uce("closing","}"));N.output=TS.escapeLast(N.output,"{"),j("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&X({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let Ae of N.tokens)N.output+=Ae.output!=null?Ae.output:Ae.value,Ae.suffix&&(N.output+=Ae.suffix)}return N},"parse");n6t.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(lWe,r.maxLength):lWe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=f0n[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}=xTe.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 k=/^(.*?)\.(\w+)$/.exec(x);if(!k)return;let D=T(k[1]);return D?D+s+k[2]:void 0}}},"create"),w=TS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};m0n.exports=n6t});var E0n=I((xBu,y0n)=>{"use strict";p();var CFo=d0n(),i6t=g0n(),A0n=TTe(),vFo=STe(),bFo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Qp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Qp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=bFo(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?Qp.compileRe(t,e):Qp.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=Qp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Qp.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");Qp.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?A0n.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=Qp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Qp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Qp.makeRe(e,r)).test(A0n.basename(t));Qp.isMatch=(t,e,r)=>Qp(e,r)(t);Qp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Qp.parse(r,e)):i6t(t,{...e,fastpaths:!1});Qp.scan=(t,e)=>CFo(t,e);Qp.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=Qp.toRegex(l,e);return n===!0&&(u.state=t),u};Qp.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=i6t.fastpaths(t,e)),o.output||(o=i6t(t,e)),Qp.compileRe(o,e,r,n)};Qp.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/$^/}};Qp.constants=vFo;y0n.exports=Qp});var b0n=I((kBu,v0n)=>{"use strict";p();var _0n=E0n(),SFo=TTe();function C0n(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:SFo.isWindows()}),_0n(t,e,r)}a(C0n,"picomatch");Object.assign(C0n,_0n);v0n.exports=C0n});var T0n=I((NBu,S0n)=>{p();S0n.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 w0n=I((BBu,x0n)=>{p();var TFo=T0n(),I0n={"{":"}","(":")","[":"]"},IFo=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=I0n[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),xFo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var OY=require("path"),wFo=b0n(),RFo=w0n();function uWe(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(RFo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=wFo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(OY.resolve(t,o))}return e}a(uWe,"normalizeOptions");R0n.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(OY.resolve(e),OY.resolve(r),uWe(e,n))},getEventsSince(e,r,n){return t.getEventsSince(OY.resolve(e),OY.resolve(r),uWe(e,n))},async subscribe(e,r,n){return e=OY.resolve(e),n=uWe(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(OY.resolve(e),r,uWe(e,n))}})});var P0n=I(wTe=>{"use strict";p();var kFo=require("path"),{createWrapper:PFo}=k0n();function DFo(){return kFo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(DFo,"resolveBindingPath");var NFo=require(DFo()),dWe=PFo(NFo);wTe.writeSnapshot=dWe.writeSnapshot;wTe.getEventsSince=dWe.getEventsSince;wTe.subscribe=dWe.subscribe;wTe.unsubscribe=dWe.unsubscribe});var I_=I(gWe=>{"use strict";p();Object.defineProperty(gWe,"__esModule",{value:!0});gWe.Position=void 0;var c6t=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(AWe,"__esModule",{value:!0});AWe.Range=void 0;var q0n=I_(),l6t=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 q0n.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new q0n.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}};AWe.Range=l6t});var Umn=I(W6t=>{"use strict";p();Object.defineProperty(W6t,"__esModule",{value:!0});W6t.assertNever=M8o;function M8o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(M8o,"assertNever")});var qTe=I(n3=>{"use strict";p();Object.defineProperty(n3,"__esModule",{value:!0});n3.ChatCompletionContentPartOpaque=n3.ChatCompletionContentPartKind=n3.ChatRole=void 0;var O8o=Umn(),HWe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(HWe||(n3.ChatRole=HWe={}));(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,O8o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(HWe||(n3.ChatRole=HWe={}));var Qmn;(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"})(Qmn||(n3.ChatCompletionContentPartKind=Qmn={}));var qmn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(qmn||(n3.ChatCompletionContentPartOpaque=qmn={}))});var z6t=I($M=>{"use strict";p();Object.defineProperty($M,"__esModule",{value:!0});$M.BaseTokensPerName=$M.BaseTokensPerMessage=$M.BaseTokensPerCompletion=$M.ChatRole=void 0;var jmn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(jmn||($M.ChatRole=jmn={}));$M.BaseTokensPerCompletion=3;$M.BaseTokensPerMessage=3;$M.BaseTokensPerName=1});var Vmn=I($We=>{"use strict";p();Object.defineProperty($We,"__esModule",{value:!0});$We.toOpenAiChatMessage=$mn;$We.toOpenAIChatMessages=L8o;var VM=qTe(),GWe=z6t(),B8o=IQ();function Hmn(t){return t.filter(e=>e.type===VM.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(Hmn,"onlyStringContent");function Gmn(t){let e=t.map(r=>{if(r.type===VM.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===VM.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===VM.ChatCompletionContentPartKind.Document)return;if(r.type===VM.ChatCompletionContentPartKind.Opaque&&VM.ChatCompletionContentPartOpaque.usableIn(r,B8o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(Gmn,"stringAndImageContent");function $mn(t){switch(t.role){case VM.ChatRole.System:return{role:GWe.ChatRole.System,content:Hmn(t.content),name:t.name};case VM.ChatRole.User:return{role:GWe.ChatRole.User,content:Gmn(t.content),name:t.name};case VM.ChatRole.Assistant:return{role:GWe.ChatRole.Assistant,content:Hmn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case VM.ChatRole.Tool:return{role:GWe.ChatRole.Tool,content:Gmn(t.content),tool_call_id:t.toolCallId};default:return}}a($mn,"toOpenAiChatMessage");function L8o(t){return t.map($mn).filter(e=>!!e)}a(L8o,"toOpenAIChatMessages")});var zmn=I(zWe=>{"use strict";p();Object.defineProperty(zWe,"__esModule",{value:!0});zWe.toVsCodeChatMessage=Wmn;zWe.toVsCodeChatMessages=F8o;var WWe=qTe();function VWe(t){return t.filter(e=>e.type===WWe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(VWe,"onlyStringContent");var xQ;function Wmn(t){switch(xQ??=require("vscode"),t.role){case WWe.ChatRole.Assistant:let e=xQ.LanguageModelChatMessage.Assistant(VWe(t.content),t.name);return t.toolCalls&&(e.content=[new xQ.LanguageModelTextPart(VWe(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 xQ.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case WWe.ChatRole.User:return xQ.LanguageModelChatMessage.User(VWe(t.content),t.name);case WWe.ChatRole.Tool:{let r=xQ.LanguageModelChatMessage.User("");return r.content=[new xQ.LanguageModelToolResultPart(t.toolCallId,[new xQ.LanguageModelTextPart(VWe(t.content))])],r}default:return}}a(Wmn,"toVsCodeChatMessage");function F8o(t){return t.map(Wmn).filter(e=>!!e)}a(F8o,"toVsCodeChatMessages")});var IQ=I(pP=>{"use strict";p();Object.defineProperty(pP,"__esModule",{value:!0});pP.OutputMode=pP.Raw=pP.OpenAI=void 0;pP.toMode=Y6t;pP.toVSCode=U8o;pP.toOpenAI=Q8o;var Ymn=Vmn(),Kmn=zmn();pP.OpenAI=z6t();pP.Raw=qTe();var jY;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(jY||(pP.OutputMode=jY={}));function Y6t(t,e){switch(t){case jY.Raw:return e;case jY.VSCode:return e instanceof Array?(0,Kmn.toVsCodeChatMessages)(e):(0,Kmn.toVsCodeChatMessage)(e);case jY.OpenAI:return e instanceof Array?(0,Ymn.toOpenAIChatMessages)(e):(0,Ymn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(Y6t,"toMode");function U8o(t){return Y6t(jY.VSCode,t)}a(U8o,"toVSCode");function Q8o(t){return Y6t(jY.OpenAI,t)}a(Q8o,"toOpenAI")});var K6t=I(jTe=>{"use strict";p();Object.defineProperty(jTe,"__esModule",{value:!0});jTe.jsonRetainedProps=void 0;jTe.forEachNode=Jmn;jTe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Jmn(t,e){if(e(t),t.type===1)for(let r of t.children)Jmn(r,e)}a(Jmn,"forEachNode")});var Zmn=I(J6t=>{"use strict";p();Object.defineProperty(J6t,"__esModule",{value:!0});J6t.once=q8o;function q8o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(q8o,"once")});var t9t=I(Jm=>{"use strict";p();Object.defineProperty(Jm,"__esModule",{value:!0});Jm.BudgetExceededError=Jm.MaterializedChatMessageDocument=Jm.MaterializedChatMessageImage=Jm.MaterializedChatMessageBreakpoint=Jm.MaterializedChatMessageOpaque=Jm.MaterializedChatMessage=Jm.MaterializedChatMessageTextChunk=Jm.GenericMaterializedContainer=void 0;var HY=Zmn(),uA=IQ(),i3=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=RQ(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 agn(e,this.children,r)}allMetadata(){return sgn(this)}findById(e){return e9t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)j8o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof mP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof mP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return X6t(this,e),e}};Jm.GenericMaterializedContainer=i3;var HTe=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,HY.once)(async e=>await e.tokenLength({type:uA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};Jm.MaterializedChatMessageTextChunk=HTe;var mP=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=agn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return X6t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return e9t(e,this)}_tokenCount=(0,HY.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,uA.toMode)(e.mode,r))});_upperBound=(0,HY.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,HY.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===uA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===uA.Raw.ChatCompletionContentPartKind.Image||n.type===uA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,uA.toMode)(e.mode,r))});_text=(0,HY.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of ign(this)){if(r instanceof GY||r instanceof $Y||r instanceof wQ){e.push(r);continue}if(r instanceof hP){e.at(-1)instanceof hP?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 wcn={};xi(wcn,{TextDocument:()=>DL});function d3t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);d3t(n,e),d3t(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 tNo(t){let e=xcn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var e$e,DL,f3t=_e(()=>{"use strict";p();e$e=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=xcn(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=Tcn(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&&Icn(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 e$e(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof e$e)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=d3t(s.map(tNo),(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})(DL||(DL={}));a(d3t,"mergeSort");a(Tcn,"computeLineOffsets");a(Icn,"isEOL");a(xcn,"getWellformedRange");a(tNo,"getWellformedEdit")});var u$e=I(Lh=>{"use strict";p();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.thenable=Lh.typedArray=Lh.stringArray=Lh.array=Lh.func=Lh.error=Lh.number=Lh.string=Lh.boolean=void 0;function oNo(t){return t===!0||t===!1}a(oNo,"boolean");Lh.boolean=oNo;function Fln(t){return typeof t=="string"||t instanceof String}a(Fln,"string");Lh.string=Fln;function sNo(t){return typeof t=="number"||t instanceof Number}a(sNo,"number");Lh.number=sNo;function aNo(t){return t instanceof Error}a(aNo,"error");Lh.error=aNo;function Uln(t){return typeof t=="function"}a(Uln,"func");Lh.func=Uln;function Qln(t){return Array.isArray(t)}a(Qln,"array");Lh.array=Qln;function cNo(t){return Qln(t)&&t.every(e=>Fln(e))}a(cNo,"stringArray");Lh.stringArray=cNo;function lNo(t,e){return Array.isArray(t)&&t.every(e)}a(lNo,"typedArray");Lh.typedArray=lNo;function uNo(t){return t&&Uln(t.then)}a(uNo,"thenable");Lh.thenable=uNo});var P3t=I(dx=>{"use strict";p();Object.defineProperty(dx,"__esModule",{value:!0});dx.generateUuid=dx.parse=dx.isUUID=dx.v4=dx.empty=void 0;var PSe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},kSe=class t extends PSe{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(""))}};kSe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];kSe._timeHighBits=["8","9","a","b"];dx.empty=new PSe("00000000-0000-0000-0000-000000000000");function qln(){return new kSe}a(qln,"v4");dx.v4=qln;var dNo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function jln(t){return dNo.test(t)}a(jln,"isUUID");dx.isUUID=jln;function fNo(t){if(!jln(t))throw new Error("invalid uuid");return new PSe(t)}a(fNo,"parse");dx.parse=fNo;function pNo(){return qln().asHex()}a(pNo,"generateUuid");dx.generateUuid=pNo});var Hln=I(k7=>{"use strict";p();Object.defineProperty(k7,"__esModule",{value:!0});k7.attachPartialResult=k7.ProgressFeature=k7.attachWorkDone=void 0;var P7=ti(),hNo=P3t(),Gz=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(P7.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(P7.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(P7.WorkDoneProgress.type,this._token,{kind:"end"})}};Gz.Instances=new Map;var d$e=class extends Gz{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new P7.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},DSe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},f$e=class extends DSe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new P7.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function mNo(t,e){if(e===void 0||e.workDoneToken===void 0)return new DSe;let r=e.workDoneToken;return delete e.workDoneToken,new Gz(t,r)}a(mNo,"attachWorkDone");k7.attachWorkDone=mNo;var gNo=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(P7.WorkDoneProgressCancelNotification.type,r=>{let n=Gz.Instances.get(r.token);(n instanceof d$e||n instanceof f$e)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new DSe:new Gz(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,hNo.generateUuid)();return this.connection.sendRequest(P7.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new d$e(this.connection,e))}else return Promise.resolve(new f$e)}},"ProgressFeature");k7.ProgressFeature=gNo;var k3t;(function(t){t.type=new P7.ProgressType})(k3t||(k3t={}));var D3t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(k3t.type,this._token,e)}};function ANo(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new D3t(t,r)}a(ANo,"attachPartialResult");k7.attachPartialResult=ANo});var Gln=I(p$e=>{"use strict";p();Object.defineProperty(p$e,"__esModule",{value:!0});p$e.ConfigurationFeature=void 0;var yNo=ti(),ENo=u$e(),_No=a(t=>class extends t{getConfiguration(e){return e?ENo.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(yNo.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");p$e.ConfigurationFeature=_No});var $ln=I(m$e=>{"use strict";p();Object.defineProperty(m$e,"__esModule",{value:!0});m$e.WorkspaceFoldersFeature=void 0;var h$e=ti(),vNo=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 h$e.Emitter,this.connection.onNotification(h$e.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(h$e.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(h$e.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");m$e.WorkspaceFoldersFeature=vNo});var Vln=I(g$e=>{"use strict";p();Object.defineProperty(g$e,"__esModule",{value:!0});g$e.CallHierarchyFeature=void 0;var N3t=ti(),CNo=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(N3t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=N3t.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=N3t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");g$e.CallHierarchyFeature=CNo});var O3t=I(D7=>{"use strict";p();Object.defineProperty(D7,"__esModule",{value:!0});D7.SemanticTokensBuilder=D7.SemanticTokensDiff=D7.SemanticTokensFeature=void 0;var A$e=ti(),bNo=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(A$e.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=A$e.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=A$e.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=A$e.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");D7.SemanticTokensFeature=bNo;var y$e=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 y$e(this._prevData,this._data).computeDiff()}:this.build()}};D7.SemanticTokensBuilder=M3t});var Wln=I(E$e=>{"use strict";p();Object.defineProperty(E$e,"__esModule",{value:!0});E$e.ShowDocumentFeature=void 0;var SNo=ti(),TNo=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(SNo.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");E$e.ShowDocumentFeature=TNo});var zln=I(_$e=>{"use strict";p();Object.defineProperty(_$e,"__esModule",{value:!0});_$e.FileOperationsFeature=void 0;var rce=ti(),INo=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(rce.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(rce.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(rce.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(rce.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(rce.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(rce.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");_$e.FileOperationsFeature=INo});var Yln=I(v$e=>{"use strict";p();Object.defineProperty(v$e,"__esModule",{value:!0});v$e.LinkedEditingRangeFeature=void 0;var xNo=ti(),wNo=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(xNo.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");v$e.LinkedEditingRangeFeature=wNo});var Kln=I(C$e=>{"use strict";p();Object.defineProperty(C$e,"__esModule",{value:!0});C$e.TypeHierarchyFeature=void 0;var B3t=ti(),RNo=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(B3t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=B3t.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=B3t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");C$e.TypeHierarchyFeature=RNo});var Zln=I(b$e=>{"use strict";p();Object.defineProperty(b$e,"__esModule",{value:!0});b$e.InlineValueFeature=void 0;var Jln=ti(),PNo=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(Jln.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(Jln.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");b$e.InlineValueFeature=PNo});var eun=I(S$e=>{"use strict";p();Object.defineProperty(S$e,"__esModule",{value:!0});S$e.FoldingRangeFeature=void 0;var Xln=ti(),kNo=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Xln.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Xln.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");S$e.FoldingRangeFeature=kNo});var tun=I(T$e=>{"use strict";p();Object.defineProperty(T$e,"__esModule",{value:!0});T$e.InlayHintFeature=void 0;var L3t=ti(),DNo=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(L3t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(L3t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(L3t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");T$e.InlayHintFeature=DNo});var nun=I(I$e=>{"use strict";p();Object.defineProperty(I$e,"__esModule",{value:!0});I$e.DiagnosticFeature=void 0;var NSe=ti(),NNo=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(NSe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(NSe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(NSe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(NSe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(NSe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");I$e.DiagnosticFeature=NNo});var U3t=I(x$e=>{"use strict";p();Object.defineProperty(x$e,"__esModule",{value:!0});x$e.TextDocuments=void 0;var $z=ti(),F3t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new $z.Emitter,this._onDidOpen=new $z.Emitter,this._onDidClose=new $z.Emitter,this._onDidSave=new $z.Emitter,this._onWillSave=new $z.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=$z.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}))})),$z.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};x$e.TextDocuments=F3t});var q3t=I(nce=>{"use strict";p();Object.defineProperty(nce,"__esModule",{value:!0});nce.NotebookDocuments=nce.NotebookSyncFeature=void 0;var fx=ti(),iun=U3t(),MNo=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(fx.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(fx.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(fx.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(fx.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");nce.NotebookSyncFeature=MNo;var w$e=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,fx.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,fx.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,fx.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}};w$e.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var Q3t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof iun.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new iun.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new fx.Emitter,this._onDidChange=new fx.Emitter,this._onDidSave=new fx.Emitter,this._onDidClose=new fx.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 w$e,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)}})),fx.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};nce.NotebookDocuments=Q3t});var oun=I(R$e=>{"use strict";p();Object.defineProperty(R$e,"__esModule",{value:!0});R$e.MonikerFeature=void 0;var ONo=ti(),BNo=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=ONo.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");R$e.MonikerFeature=BNo});var W3t=I(uc=>{"use strict";p();Object.defineProperty(uc,"__esModule",{value:!0});uc.createConnection=uc.combineFeatures=uc.combineNotebooksFeatures=uc.combineLanguagesFeatures=uc.combineWorkspaceFeatures=uc.combineWindowFeatures=uc.combineClientFeatures=uc.combineTracerFeatures=uc.combineTelemetryFeatures=uc.combineConsoleFeatures=uc._NotebooksImpl=uc._LanguagesImpl=uc.BulkUnregistration=uc.BulkRegistration=uc.ErrorMessageTracker=void 0;var Yr=ti(),px=u$e(),H3t=P3t(),To=Hln(),LNo=Gln(),FNo=$ln(),UNo=Vln(),QNo=O3t(),qNo=Wln(),jNo=zln(),HNo=Yln(),GNo=Kln(),$No=Zln(),VNo=eun(),WNo=tun(),zNo=nun(),YNo=q3t(),KNo=oun();function j3t(t){if(t!==null)return t}a(j3t,"null2Undefined");var G3t=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)})}};uc.ErrorMessageTracker=G3t;var P$e=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(Yr.MessageType.Error,e)}warn(e){this.send(Yr.MessageType.Warning,e)}info(e){this.send(Yr.MessageType.Info,e)}log(e){this.send(Yr.MessageType.Log,e)}debug(e){this.send(Yr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Yr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Yr.RAL)().console.error("Sending log message failed")})}},$3t=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:Yr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(j3t)}showWarningMessage(e,...r){let n={type:Yr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(j3t)}showInformationMessage(e,...r){let n={type:Yr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(j3t)}},sun=(0,qNo.ShowDocumentFeature)((0,To.ProgressFeature)($3t)),aun;(function(t){function e(){return new k$e}a(e,"create"),t.create=e})(aun||(uc.BulkRegistration=aun={}));var k$e=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=px.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=H3t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},cun;(function(t){function e(){return new MSe(void 0,[])}a(e,"create"),t.create=e})(cun||(uc.BulkUnregistration=cun={}));var MSe=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(Yr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=px.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Yr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},D$e=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 k$e?this.registerMany(e):e instanceof MSe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=px.string(r)?r:r.method,s=H3t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Yr.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=px.string(e)?e:e.method,o=H3t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Yr.RegistrationRequest.type,s).then(c=>Yr.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(Yr.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(Yr.RegistrationRequest.type,r).then(()=>new MSe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},V3t=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(Yr.ApplyWorkspaceEditRequest.type,n)}},lun=(0,jNo.FileOperationsFeature)((0,FNo.WorkspaceFoldersFeature)((0,LNo.ConfigurationFeature)(V3t))),N$e=class{static{a(this,"TracerImpl")}constructor(){this._trace=Yr.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!==Yr.Trace.Off&&this.connection.sendNotification(Yr.LogTraceNotification.type,{message:e,verbose:this._trace===Yr.Trace.Verbose?r:void 0}).catch(()=>{})}},M$e=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(Yr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},O$e=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)}};uc._LanguagesImpl=O$e;var uun=(0,VNo.FoldingRangeFeature)((0,KNo.MonikerFeature)((0,zNo.DiagnosticFeature)((0,WNo.InlayHintFeature)((0,$No.InlineValueFeature)((0,GNo.TypeHierarchyFeature)((0,HNo.LinkedEditingRangeFeature)((0,QNo.SemanticTokensFeature)((0,UNo.CallHierarchyFeature)(O$e))))))))),B$e=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)}};uc._NotebooksImpl=B$e;var dun=(0,YNo.NotebookSyncFeature)(B$e);function fun(t,e){return function(r){return e(t(r))}}a(fun,"combineConsoleFeatures");uc.combineConsoleFeatures=fun;function pun(t,e){return function(r){return e(t(r))}}a(pun,"combineTelemetryFeatures");uc.combineTelemetryFeatures=pun;function hun(t,e){return function(r){return e(t(r))}}a(hun,"combineTracerFeatures");uc.combineTracerFeatures=hun;function mun(t,e){return function(r){return e(t(r))}}a(mun,"combineClientFeatures");uc.combineClientFeatures=mun;function gun(t,e){return function(r){return e(t(r))}}a(gun,"combineWindowFeatures");uc.combineWindowFeatures=gun;function Aun(t,e){return function(r){return e(t(r))}}a(Aun,"combineWorkspaceFeatures");uc.combineWorkspaceFeatures=Aun;function yun(t,e){return function(r){return e(t(r))}}a(yun,"combineLanguagesFeatures");uc.combineLanguagesFeatures=yun;function Eun(t,e){return function(r){return e(t(r))}}a(Eun,"combineNotebooksFeatures");uc.combineNotebooksFeatures=Eun;function JNo(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,fun),tracer:r(t.tracer,e.tracer,hun),telemetry:r(t.telemetry,e.telemetry,pun),client:r(t.client,e.client,mun),window:r(t.window,e.window,gun),workspace:r(t.workspace,e.workspace,Aun),languages:r(t.languages,e.languages,yun),notebooks:r(t.notebooks,e.notebooks,Eun)}}a(JNo,"combineFeatures");uc.combineFeatures=JNo;function ZNo(t,e,r){let n=r&&r.console?new(r.console(P$e)):new P$e,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(N$e)):new N$e,c=r&&r.telemetry?new(r.telemetry(M$e)):new M$e,l=r&&r.client?new(r.client(D$e)):new D$e,u=r&&r.window?new(r.window(sun)):new sun,d=r&&r.workspace?new(r.workspace(lun)):new lun,f=r&&r.languages?new(r.languages(uun)):new uun,h=r&&r.notebooks?new(r.notebooks(dun)):new dun,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:px.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(px.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=px.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(Yr.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(Yr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Yr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Yr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Yr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Yr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Yr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Yr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Yr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Yr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Yr.HoverRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Yr.CompletionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Yr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Yr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Yr.DeclarationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Yr.DefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Yr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Yr.ImplementationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Yr.ReferencesRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Yr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Yr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Yr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Yr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Yr.CodeActionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Yr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Yr.CodeLensRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Yr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Yr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Yr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Yr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Yr.RenameRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Yr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Yr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Yr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Yr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Yr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Yr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Yr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Yr.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(Yr.InitializeRequest.type,v=>{e.initialize(v),px.string(v.trace)&&(s.trace=Yr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Yr.CancellationTokenSource().token,(0,To.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Yr.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=px.number(_.__textDocumentSync)?_.__textDocumentSync:Yr.TextDocumentSyncKind.None:!px.number(R.textDocumentSync)&&!px.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=px.number(_.__textDocumentSync)?_.__textDocumentSync:Yr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Yr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Yr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Yr.CancellationTokenSource().token)}),o.onNotification(Yr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Yr.SetTraceNotification.type,v=>{s.trace=Yr.Trace.fromString(v.value)}),_}a(ZNo,"createConnection");uc.createConnection=ZNo});var _un=I(hC=>{"use strict";p();Object.defineProperty(hC,"__esModule",{value:!0});hC.resolveModulePath=hC.FileSystem=hC.resolveGlobalYarnPath=hC.resolveGlobalNodePath=hC.resolve=hC.uriToFilePath=void 0;var XNo=require("url"),ZP=require("path"),z3t=require("fs"),Z3t=require("child_process");function eMo(t){let e=XNo.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 ZP.normalize(r.join("/"))}a(eMo,"uriToFilePath");hC.uriToFilePath=eMo;function Y3t(){return process.platform==="win32"}a(Y3t,"isWindows");function L$e(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&&z3t.existsSync(e)&&(d[o]?d[o]=e+ZP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,Z3t.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(L$e,"resolve");hC.resolve=L$e;function K3t(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};Y3t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,Z3t.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?Y3t()?ZP.join(c,"node_modules"):ZP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(K3t,"resolveGlobalNodePath");hC.resolveGlobalNodePath=K3t;function tMo(t){let e="yarn",r={encoding:"utf8"};Y3t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,Z3t.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 ZP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(tMo,"resolveGlobalYarnPath");hC.resolveGlobalYarnPath=tMo;var J3t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!z3t.existsSync(__filename.toUpperCase())||!z3t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?ZP.normalize(s).indexOf(ZP.normalize(o))===0:ZP.normalize(s).toLowerCase().indexOf(ZP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(J3t||(hC.FileSystem=J3t={}));function rMo(t,e,r,n){return r?(ZP.isAbsolute(r)||(r=ZP.join(t,r)),L$e(e,r,r,n).then(o=>J3t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>L$e(e,K3t(n),t,n))):L$e(e,K3t(n),t,n)}a(rMo,"resolveModulePath");hC.resolveModulePath=rMo});var X3t=I((qIu,vun)=>{"use strict";p();vun.exports=ti()});var Cun=I(F$e=>{"use strict";p();Object.defineProperty(F$e,"__esModule",{value:!0});F$e.InlineCompletionFeature=void 0;var nMo=ti(),iMo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(nMo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");F$e.InlineCompletionFeature=iMo});var Tun=I(jy=>{"use strict";p();var oMo=jy&&jy.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Sun=jy&&jy.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oMo(e,t,r)};Object.defineProperty(jy,"__esModule",{value:!0});jy.ProposedFeatures=jy.NotebookDocuments=jy.TextDocuments=jy.SemanticTokensBuilder=void 0;var sMo=O3t();Object.defineProperty(jy,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return sMo.SemanticTokensBuilder},"get")});var aMo=Cun();Sun(ti(),jy);var cMo=U3t();Object.defineProperty(jy,"TextDocuments",{enumerable:!0,get:a(function(){return cMo.TextDocuments},"get")});var lMo=q3t();Object.defineProperty(jy,"NotebookDocuments",{enumerable:!0,get:a(function(){return lMo.NotebookDocuments},"get")});Sun(W3t(),jy);var bun;(function(t){t.all={__brand:"features",languages:aMo.InlineCompletionFeature}})(bun||(jy.ProposedFeatures=bun={}))});var ml=I(hx=>{"use strict";p();var uMo=hx&&hx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Run=hx&&hx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uMo(e,t,r)};Object.defineProperty(hx,"__esModule",{value:!0});hx.createConnection=hx.Files=void 0;var Iun=require("node:util"),eFt=u$e(),dMo=W3t(),OSe=_un(),Vz=X3t();Run(X3t(),hx);Run(Tun(),hx);var xun;(function(t){t.uriToFilePath=OSe.uriToFilePath,t.resolveGlobalNodePath=OSe.resolveGlobalNodePath,t.resolveGlobalYarnPath=OSe.resolveGlobalYarnPath,t.resolve=OSe.resolve,t.resolveModulePath=OSe.resolveModulePath})(xun||(hx.Files=xun={}));var wun;function U$e(){if(wun!==void 0)try{wun.end()}catch{}}a(U$e,"endProtocolConnection");var ice=!1,Pun;function fMo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(Pun=setInterval(()=>{try{process.kill(n,0)}catch{U$e(),process.exit(ice?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;eFt.number(e)&&Pun===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(ice?0:1)}},3e3)},"initialize"),get shutdownReceived(){return ice},set shutdownReceived(t){ice=t},exit:a(t=>{U$e(),process.exit(t)},"exit")};function hMo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),Vz.ConnectionStrategy.is(t)||Vz.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),mMo(s,c,l,o)}a(hMo,"createConnection");hx.createConnection=hMo;function mMo(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{U$e(),process.exit(ice?0:1)}),u.on("close",()=>{U$e(),process.exit(ice?0:1)})}let l=a(u=>{let d=(0,Vz.createProtocolConnection)(t,e,u,r);return o&&gMo(u),d},"connectionFactory");return(0,dMo.createConnection)(l,pMo,n)}a(mMo,"_createConnection");function gMo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,Iun.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,Iun.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(gMo,"patchConsole")});var XP=I((XIu,kun)=>{"use strict";p();kun.exports=ml()});var udn=I((Gwu,ldn)=>{"use strict";p();ldn.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 cfn=I($0=>{"use strict";p();var BFt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),gOo=BFt(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")}),AOo=BFt(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")}),yOo=BFt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),nfn=$0&&$0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EOo=$0&&$0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ifn=$0&&$0.__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:COo,sync:bOo}=cfn(),{join:SOo,delimiter:TOo,sep:lfn,posix:ufn}=require("path"),dfn=process.platform==="win32",ffn=new RegExp(`[${ufn.sep}${lfn===ufn.sep?"":lfn}]`.replace(/(\\)/g,"\\$1")),IOo=new RegExp(`^\\.${ffn.source}`),pfn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),hfn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=TOo})=>{let o=t.match(ffn)?[""]:[...dfn?[process.cwd()]:[],...(e||"").split(n)];if(dfn){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"),mfn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&IOo.test(e)?e.slice(0,2):"")+SOo(r,e)},"getPathPart"),gfn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=hfn(t,e),s=[];for(let c of r){let l=mfn(c,t);for(let u of n){let d=l+u;if(await COo(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 pfn(t)},"which"),xOo=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=hfn(t,e),s=[];for(let c of r){let l=mfn(c,t);for(let u of n){let d=l+u;if(bOo(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 pfn(t)},"whichSync");Afn.exports=gfn;gfn.sync=xOo});var KSe=I((bMu,Dpn)=>{"use strict";p();var wpn="[^\\\\/]",u4o="(?=.)",Rpn="[^/]",t8t="(?:\\/|$)",Ppn="(?:^|\\/)",r8t=`\\.{1,2}${t8t}`,d4o="(?!\\.)",f4o=`(?!${Ppn}${r8t})`,p4o=`(?!\\.{0,1}${t8t})`,h4o=`(?!${r8t})`,m4o="[^.\\/]",g4o=`${Rpn}*?`,A4o="/",kpn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:u4o,QMARK:Rpn,END_ANCHOR:t8t,DOTS_SLASH:r8t,NO_DOT:d4o,NO_DOTS:f4o,NO_DOT_SLASH:p4o,NO_DOTS_SLASH:h4o,QMARK_NO_DOT:m4o,STAR:g4o,START_ANCHOR:Ppn,SEP:A4o},y4o={...kpn,SLASH_LITERAL:"[\\\\/]",QMARK:wpn,STAR:`${wpn}*?`,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:"\\"},E4o={__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"};Dpn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:E4o,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?y4o:kpn}}});var JSe=I(yC=>{"use strict";p();var{REGEX_BACKSLASH:_4o,REGEX_REMOVE_BACKSLASH:v4o,REGEX_SPECIAL_CHARS:C4o,REGEX_SPECIAL_CHARS_GLOBAL:b4o}=KSe();yC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);yC.hasRegexChars=t=>C4o.test(t);yC.isRegexChar=t=>t.length===1&&yC.hasRegexChars(t);yC.escapeRegex=t=>t.replace(b4o,"\\$1");yC.toPosixSlashes=t=>t.replace(_4o,"/");yC.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};yC.removeBackslashes=t=>t.replace(v4o,e=>e==="\\"?"":e);yC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?yC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};yC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};yC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};yC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var Qpn=I((xMu,Upn)=>{"use strict";p();var Npn=JSe(),{CHAR_ASTERISK:n8t,CHAR_AT:S4o,CHAR_BACKWARD_SLASH:ZSe,CHAR_COMMA:T4o,CHAR_DOT:i8t,CHAR_EXCLAMATION_MARK:o8t,CHAR_FORWARD_SLASH:Fpn,CHAR_LEFT_CURLY_BRACE:s8t,CHAR_LEFT_PARENTHESES:a8t,CHAR_LEFT_SQUARE_BRACKET:I4o,CHAR_PLUS:x4o,CHAR_QUESTION_MARK:Mpn,CHAR_RIGHT_CURLY_BRACE:w4o,CHAR_RIGHT_PARENTHESES:Opn,CHAR_RIGHT_SQUARE_BRACKET:R4o}=KSe(),Bpn=a(t=>t===Fpn||t===ZSe,"isPathSeparator"),Lpn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),P4o=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&&Bpn(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),r.unescape===!0&&(O&&(O=Npn.removeBackslashes(O)),j&&v===!0&&(j=Npn.removeBackslashes(j)));let q={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&&(q.maxDepth=0,Bpn(P)||c.push(D),q.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var XSe=KSe(),yS=JSe(),{MAX_LENGTH:PVe,POSIX_REGEX_SOURCE:k4o,REGEX_NON_SPECIAL_CHARS:D4o,REGEX_SPECIAL_CHARS_BACKREF:N4o,REPLACEMENTS:qpn}=XSe,M4o=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=>yS.escapeRegex(o)).join("..")}return r},"expandRange"),Ace=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),jpn=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"),O4o=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"),Hpn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(O4o(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),B4o=a(t=>{let e=t.map(Hpn).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"),L4o=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=Hpn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?yS.escapeRegex(r[0]):`[${r.map(o=>yS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),F4o=a(t=>{let e=0,r=t.trim(),n=c8t(r);for(;n;)e++,r=n.body.trim(),n=c8t(r);return e},"repeatedExtglobRecursion"),U4o=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:XSe.DEFAULT_MAX_EXTGLOB_RECURSION,n=jpn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||B4o(n)))return{risky:!0};for(let o of n){let s=L4o(o);if(s)return{risky:!0,safeOutput:s};if(F4o(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),l8t=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=qpn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(PVe,r.maxLength):PVe,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=XSe.globChars(r.windows),d=XSe.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(ve=>`(${l}(?:(?!${w}${ve.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=yS.removePrefix(t,N),o=t.length;let L=[],B=[],j=[],M=s,O,q=a(()=>N.index===o-1,"eos"),Q=N.peek=(ve=1)=>t[N.index+ve],U=N.advance=()=>t[++N.index]||"",z=a(()=>t.slice(N.index+1),"remaining"),W=a((ve="",Fe=0)=>{N.consumed+=ve,N.index+=Fe},"consume"),$=a(ve=>{N.output+=ve.output!=null?ve.output:ve.value,W(ve.value)},"append"),J=a(()=>{let ve=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ve++;return ve%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ne=a(ve=>{N[ve]++,j.push(ve)},"increment"),H=a(ve=>{N[ve]--,j.pop()},"decrement"),re=a(ve=>{if(M.type==="globstar"){let Fe=N.braces>0&&(ve.type==="comma"||ve.type==="brace"),Pe=ve.extglob===!0||L.length&&(ve.type==="pipe"||ve.type==="paren");ve.type!=="slash"&&ve.type!=="paren"&&!Fe&&!Pe&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&ve.type!=="paren"&&(L[L.length-1].inner+=ve.value),(ve.value||ve.output)&&$(ve),M&&M.type==="text"&&ve.type==="text"){M.output=(M.output||M.value)+ve.value,M.value+=ve.value;return}ve.prev=M,c.push(ve),M=ve},"push"),ae=a((ve,Fe)=>{let Pe={...d[Fe],conditions:1,inner:""};Pe.prev=M,Pe.parens=N.parens,Pe.output=N.output,Pe.startIndex=N.index,Pe.tokensIndex=c.length;let Z=(r.capture?"(":"")+Pe.open;ne("parens"),re({type:ve,value:Fe,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:Z}),L.push(Pe)},"extglobOpen"),Oe=a(ve=>{let Fe=t.slice(ve.startIndex,N.index+1),Pe=t.slice(ve.startIndex+2,N.index),Z=U4o(Pe,r);if((ve.type==="plus"||ve.type==="star")&&Z.risky){let fe=Z.safeOutput?(ve.output?"":g)+(r.capture?`(${Z.safeOutput})`:Z.safeOutput):void 0,X=c[ve.tokensIndex];X.type="text",X.value=Fe,X.output=fe||yS.escapeRegex(Fe);for(let ue=ve.tokensIndex+1;ue1&&ve.inner.includes("/")&&(fe=R(r)),(fe!==D||q()||/^\)+$/.test(z()))&&(ee=ve.close=`)$))${fe}`),ve.inner.includes("*")&&(K=z())&&/^\.[^\\/.]+$/.test(K)){let X=l8t(K,{...e,fastpaths:!1}).output;ee=ve.close=`)${X})${fe})`}ve.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 ve=!1,Fe=t.replace(N4o,(Pe,Z,ee,K,fe,X)=>K==="\\"?(ve=!0,Pe):K==="?"?Z?Z+K+(fe?v.repeat(fe.length):""):X===0?P+(fe?v.repeat(fe.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?Z?Z+K+(fe?D:""):D:Z?Pe:`\\${Pe}`);return ve===!0&&(r.unescape===!0?Fe=Fe.replace(/\\/g,""):Fe=Fe.replace(/\\+/g,Pe=>Pe.length%2===0?"\\\\":Pe?"\\":"")),Fe===t&&r.contains===!0?(N.output=t,N):(N.output=yS.wrapOutput(Fe,N,e),N)}for(;!q();){if(O=U(),O==="\0")continue;if(O==="\\"){let Pe=Q();if(Pe==="/"&&r.bash!==!0||Pe==="."||Pe===";")continue;if(!Pe){O+="\\",re({type:"text",value:O});continue}let Z=/^\\+/.exec(z()),ee=0;if(Z&&Z[0].length>2&&(ee=Z[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 Pe=M.value.slice(1);if(Pe.includes("[")&&(M.posix=!0,Pe.includes(":"))){let Z=M.value.lastIndexOf("["),ee=M.value.slice(0,Z),K=M.value.slice(Z+2),fe=k4o[K];if(fe){M.value=ee+fe,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,$({value:O});continue}if(N.quotes===1&&O!=='"'){O=yS.escapeRegex(O),M.value+=O,$({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ne("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Ace("opening","("));let Pe=L[L.length-1];if(Pe&&N.parens===Pe.parens+1){Oe(L.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!z().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Ace("closing","]"));O=`\\${O}`}else ne("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(Ace("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let Pe=M.value.slice(1);if(M.posix!==!0&&Pe[0]==="^"&&!Pe.includes("/")&&(O=`/${O}`),M.value+=O,$({value:O}),r.literalBrackets===!1||yS.hasRegexChars(Pe))continue;let Z=yS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=Z,M.value=Z;continue}M.value=`(${l}${Z}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ne("braces");let Pe={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(Pe),re(Pe);continue}if(O==="}"){let Pe=B[B.length-1];if(r.nobrace===!0||!Pe){re({type:"text",value:O,output:O});continue}let Z=")";if(Pe.dots===!0){let ee=c.slice(),K=[];for(let fe=ee.length-1;fe>=0&&(c.pop(),ee[fe].type!=="brace");fe--)ee[fe].type!=="dots"&&K.unshift(ee[fe].value);Z=M4o(K,r),N.backtrack=!0}if(Pe.comma!==!0&&Pe.dots!==!0){let ee=N.output.slice(0,Pe.outputIndex),K=N.tokens.slice(Pe.tokensIndex);Pe.value=Pe.output="\\{",O=Z="\\}",N.output=ee;for(let fe of K)N.output+=fe.output||fe.value}re({type:"brace",value:O,output:Z}),H("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let Pe=O,Z=B[B.length-1];Z&&j[j.length-1]==="braces"&&(Z.comma=!0,Pe="|"),re({type:"comma",value:O,output:Pe});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 Pe=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,Pe.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)!=="?"){ae("qmark",O);continue}if(M&&M.type==="paren"){let Z=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(Z)||Z==="<"&&!/<([!=]|\w+>)/.test(z()))&&(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)))){ae("negate",O);continue}if(r.nonegate!==!0&&N.index===0){J();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ae("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 Pe=D4o.exec(z());Pe&&(O+=Pe[0],N.index+=Pe[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 ve=z();if(r.noextglob!==!0&&/^\([^?]/.test(ve)){ae("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let Pe=M.prev,Z=Pe.prev,ee=Pe.type==="slash"||Pe.type==="bos",K=Z&&(Z.type==="star"||Z.type==="globstar");if(r.bash===!0&&(!ee||ve[0]&&ve[0]!=="/")){re({type:"star",value:O,output:""});continue}let fe=N.braces>0&&(Pe.type==="comma"||Pe.type==="brace"),X=L.length&&(Pe.type==="pipe"||Pe.type==="paren");if(!ee&&Pe.type!=="paren"&&!fe&&!X){re({type:"star",value:O,output:""});continue}for(;ve.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ve=ve.slice(3),W("/**",3)}if(Pe.type==="bos"&&q()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(Pe.type==="slash"&&Pe.prev.type!=="bos"&&!K&&q()){N.output=N.output.slice(0,-(Pe.output+M.output).length),Pe.output=`(?:${Pe.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=Pe.output+M.output,W(O);continue}if(Pe.type==="slash"&&Pe.prev.type!=="bos"&&ve[0]==="/"){let ue=ve[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(Pe.output+M.output).length),Pe.output=`(?:${Pe.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=Pe.output+M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}if(Pe.type==="bos"&&ve[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 Fe={type:"star",value:O,output:D};if(r.bash===!0){Fe.output=".*?",(M.type==="bos"||M.type==="slash")&&(Fe.output=x+Fe.output),re(Fe);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Fe.output=O,re(Fe);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(Fe)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Ace("closing","]"));N.output=yS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Ace("closing",")"));N.output=yS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Ace("closing","}"));N.output=yS.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 ve of N.tokens)N.output+=ve.output!=null?ve.output:ve.value,ve.suffix&&(N.output+=ve.suffix)}return N},"parse");l8t.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(PVe,r.maxLength):PVe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=qpn[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}=XSe.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=yS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};Gpn.exports=l8t});var zpn=I((NMu,Wpn)=>{"use strict";p();var Q4o=Qpn(),u8t=$pn(),Vpn=JSe(),q4o=KSe(),j4o=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),qp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>qp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=j4o(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?qp.compileRe(t,e):qp.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=qp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=qp.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");qp.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?Vpn.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=qp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};qp.matchBase=(t,e,r)=>(e instanceof RegExp?e:qp.makeRe(e,r)).test(Vpn.basename(t));qp.isMatch=(t,e,r)=>qp(e,r)(t);qp.parse=(t,e)=>Array.isArray(t)?t.map(r=>qp.parse(r,e)):u8t(t,{...e,fastpaths:!1});qp.scan=(t,e)=>Q4o(t,e);qp.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=qp.toRegex(l,e);return n===!0&&(u.state=t),u};qp.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=u8t.fastpaths(t,e)),o.output||(o=u8t(t,e)),qp.compileRe(o,e,r,n)};qp.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/$^/}};qp.constants=q4o;Wpn.exports=qp});var Zpn=I((BMu,Jpn)=>{"use strict";p();var Ypn=zpn(),H4o=JSe();function Kpn(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:H4o.isWindows()}),Ypn(t,e,r)}a(Kpn,"picomatch");Object.assign(Kpn,Ypn);Jpn.exports=Kpn});var ehn=I((UMu,Xpn)=>{p();Xpn.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 nhn=I((jMu,rhn)=>{p();var G4o=ehn(),thn={"{":"}","(":")","[":"]"},$4o=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=thn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),V4o=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var AY=require("path"),W4o=Zpn(),z4o=nhn();function kVe(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(z4o(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=W4o.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(AY.resolve(t,o))}return e}a(kVe,"normalizeOptions");ihn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(AY.resolve(e),AY.resolve(r),kVe(e,n))},getEventsSince(e,r,n){return t.getEventsSince(AY.resolve(e),AY.resolve(r),kVe(e,n))},async subscribe(e,r,n){return e=AY.resolve(e),n=kVe(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(AY.resolve(e),r,kVe(e,n))}})});var shn=I(eTe=>{"use strict";p();var Y4o=require("path"),{createWrapper:K4o}=ohn();function J4o(){return Y4o.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(J4o,"resolveBindingPath");var Z4o=require(J4o()),DVe=K4o(Z4o);eTe.writeSnapshot=DVe.writeSnapshot;eTe.getEventsSince=DVe.getEventsSince;eTe.subscribe=DVe.subscribe;eTe.unsubscribe=DVe.unsubscribe});var b_=I(LVe=>{"use strict";p();Object.defineProperty(LVe,"__esModule",{value:!0});LVe.Position=void 0;var h8t=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(FVe,"__esModule",{value:!0});FVe.Range=void 0;var ghn=b_(),m8t=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 ghn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new ghn.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}};FVe.Range=m8t});var p0n=I(X8t=>{"use strict";p();Object.defineProperty(X8t,"__esModule",{value:!0});X8t.assertNever=eLo;function eLo(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(eLo,"assertNever")});var hTe=I(GL=>{"use strict";p();Object.defineProperty(GL,"__esModule",{value:!0});GL.ChatCompletionContentPartOpaque=GL.ChatCompletionContentPartKind=GL.ChatRole=void 0;var tLo=p0n(),uWe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(uWe||(GL.ChatRole=uWe={}));(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,tLo.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(uWe||(GL.ChatRole=uWe={}));var h0n;(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"})(h0n||(GL.ChatCompletionContentPartKind=h0n={}));var m0n;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(m0n||(GL.ChatCompletionContentPartOpaque=m0n={}))});var e6t=I(MM=>{"use strict";p();Object.defineProperty(MM,"__esModule",{value:!0});MM.BaseTokensPerName=MM.BaseTokensPerMessage=MM.BaseTokensPerCompletion=MM.ChatRole=void 0;var g0n;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(g0n||(MM.ChatRole=g0n={}));MM.BaseTokensPerCompletion=3;MM.BaseTokensPerMessage=3;MM.BaseTokensPerName=1});var _0n=I(fWe=>{"use strict";p();Object.defineProperty(fWe,"__esModule",{value:!0});fWe.toOpenAiChatMessage=E0n;fWe.toOpenAIChatMessages=nLo;var OM=hTe(),dWe=e6t(),rLo=uQ();function A0n(t){return t.filter(e=>e.type===OM.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(A0n,"onlyStringContent");function y0n(t){let e=t.map(r=>{if(r.type===OM.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===OM.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===OM.ChatCompletionContentPartKind.Document)return;if(r.type===OM.ChatCompletionContentPartKind.Opaque&&OM.ChatCompletionContentPartOpaque.usableIn(r,rLo.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(y0n,"stringAndImageContent");function E0n(t){switch(t.role){case OM.ChatRole.System:return{role:dWe.ChatRole.System,content:A0n(t.content),name:t.name};case OM.ChatRole.User:return{role:dWe.ChatRole.User,content:y0n(t.content),name:t.name};case OM.ChatRole.Assistant:return{role:dWe.ChatRole.Assistant,content:A0n(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case OM.ChatRole.Tool:return{role:dWe.ChatRole.Tool,content:y0n(t.content),tool_call_id:t.toolCallId};default:return}}a(E0n,"toOpenAiChatMessage");function nLo(t){return t.map(E0n).filter(e=>!!e)}a(nLo,"toOpenAIChatMessages")});var C0n=I(mWe=>{"use strict";p();Object.defineProperty(mWe,"__esModule",{value:!0});mWe.toVsCodeChatMessage=v0n;mWe.toVsCodeChatMessages=iLo;var hWe=hTe();function pWe(t){return t.filter(e=>e.type===hWe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(pWe,"onlyStringContent");var dQ;function v0n(t){switch(dQ??=require("vscode"),t.role){case hWe.ChatRole.Assistant:let e=dQ.LanguageModelChatMessage.Assistant(pWe(t.content),t.name);return t.toolCalls&&(e.content=[new dQ.LanguageModelTextPart(pWe(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 dQ.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case hWe.ChatRole.User:return dQ.LanguageModelChatMessage.User(pWe(t.content),t.name);case hWe.ChatRole.Tool:{let r=dQ.LanguageModelChatMessage.User("");return r.content=[new dQ.LanguageModelToolResultPart(t.toolCallId,[new dQ.LanguageModelTextPart(pWe(t.content))])],r}default:return}}a(v0n,"toVsCodeChatMessage");function iLo(t){return t.map(v0n).filter(e=>!!e)}a(iLo,"toVsCodeChatMessages")});var uQ=I(sk=>{"use strict";p();Object.defineProperty(sk,"__esModule",{value:!0});sk.OutputMode=sk.Raw=sk.OpenAI=void 0;sk.toMode=t6t;sk.toVSCode=oLo;sk.toOpenAI=sLo;var b0n=_0n(),S0n=C0n();sk.OpenAI=e6t();sk.Raw=hTe();var SY;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(SY||(sk.OutputMode=SY={}));function t6t(t,e){switch(t){case SY.Raw:return e;case SY.VSCode:return e instanceof Array?(0,S0n.toVsCodeChatMessages)(e):(0,S0n.toVsCodeChatMessage)(e);case SY.OpenAI:return e instanceof Array?(0,b0n.toOpenAIChatMessages)(e):(0,b0n.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(t6t,"toMode");function oLo(t){return t6t(SY.VSCode,t)}a(oLo,"toVSCode");function sLo(t){return t6t(SY.OpenAI,t)}a(sLo,"toOpenAI")});var r6t=I(mTe=>{"use strict";p();Object.defineProperty(mTe,"__esModule",{value:!0});mTe.jsonRetainedProps=void 0;mTe.forEachNode=T0n;mTe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function T0n(t,e){if(e(t),t.type===1)for(let r of t.children)T0n(r,e)}a(T0n,"forEachNode")});var I0n=I(n6t=>{"use strict";p();Object.defineProperty(n6t,"__esModule",{value:!0});n6t.once=aLo;function aLo(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(aLo,"once")});var a6t=I(Zm=>{"use strict";p();Object.defineProperty(Zm,"__esModule",{value:!0});Zm.BudgetExceededError=Zm.MaterializedChatMessageDocument=Zm.MaterializedChatMessageImage=Zm.MaterializedChatMessageBreakpoint=Zm.MaterializedChatMessageOpaque=Zm.MaterializedChatMessage=Zm.MaterializedChatMessageTextChunk=Zm.GenericMaterializedContainer=void 0;var TY=I0n(),pA=uQ(),$L=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=pQ(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 O0n(e,this.children,r)}allMetadata(){return M0n(this)}findById(e){return s6t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)cLo(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof ck&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof ck||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return o6t(this,e),e}};Zm.GenericMaterializedContainer=$L;var gTe=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,TY.once)(async e=>await e.tokenLength({type:pA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};Zm.MaterializedChatMessageTextChunk=gTe;var ck=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=O0n(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return o6t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return s6t(e,this)}_tokenCount=(0,TY.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,pA.toMode)(e.mode,r))});_upperBound=(0,TY.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,TY.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===pA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===pA.Raw.ChatCompletionContentPartKind.Image||n.type===pA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,pA.toMode)(e.mode,r))});_text=(0,TY.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of D0n(this)){if(r instanceof IY||r instanceof xY||r instanceof fQ){e.push(r);continue}if(r instanceof ak){e.at(-1)instanceof ak?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:uA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof GY)return{type:uA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:cgn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof $Y)return{type:uA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof wQ)return{type:uA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof hP)return r.part;throw new Error("Unexpected element type")});if(this.role===uA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===uA.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===uA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===uA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};Jm.MaterializedChatMessage=mP;var wQ=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&&uA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};Jm.MaterializedChatMessageOpaque=wQ;var hP=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};Jm.MaterializedChatMessageBreakpoint=hP;var GY=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,HY.once)(async e=>e.tokenLength({type:uA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:cgn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};Jm.MaterializedChatMessageImage=GY;var $Y=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,HY.once)(async e=>e.tokenLength({type:uA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};Jm.MaterializedChatMessageDocument=$Y;function RQ(t){return t instanceof i3||t instanceof mP}a(RQ,"isContainerType");function ngn(t){return t instanceof HTe||t instanceof GY||t instanceof $Y||t instanceof wQ||t instanceof hP}a(ngn,"isContentType");function j8o(t){if(!RQ(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(j8o,"assertContainerOrChatMessage");function*ign(t,e=!1){for(let r of t.children)r instanceof HTe?(yield{content:r,isTextSibling:e},e=!0):r instanceof GY||r instanceof $Y||r instanceof wQ||r instanceof hP?yield{content:r,isTextSibling:!1}:r instanceof wQ?yield{content:r,isTextSibling:!0}:(r&&(yield*ign(r,e)),e=!1)}a(ign,"contentChunks");function H8o(t,e){let r;function n(o,s){if(ngn(o))(!r||o.priorityn instanceof hP):t instanceof i3&&(r=t.children.some(ogn)),Xmn.set(t,r),r}a(ogn,"hasCachePoint");function G8o(t){if(t instanceof mP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof mP)return!1;return!0}a(G8o,"shouldLookForCachePointInNode");function X6t(t,e){let r;if(t instanceof i3&&t.has(1)){H8o(t,e);return}let n=G8o(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 mP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};Jm.BudgetExceededError=YWe;function egn(t){if(!RQ(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(egn,"getLowestPriorityAmongChildren");function*sgn(t){yield*t.metadata;for(let e of t.children)RQ(e)?yield*sgn(e):yield*e.metadata}a(sgn,"allMetadata");function agn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,RQ(r)&&e.push(...r.children)}}a(tgn,"forEachNode");function $8o(t){let e=t;for(;e.parent;)e=e.parent;return e}a($8o,"getRoot");function rgn(t){return t instanceof i3&&t.keepWithId!==void 0}a(rgn,"isKeepWith");var Z6t=new Set;function V8o(t,e){let r=new Set;for(let n of tgn(t))rgn(n)&&!Z6t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)Z6t.add(n);try{let n=$8o(t);for(let o of tgn(n))rgn(o)&&r.has(o.keepWithId)?GTe(o,e):o instanceof mP&&o.toolCalls&&(o.toolCalls=W8o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&>e(o,e))}finally{for(let n of r)Z6t.delete(n)}}a(V8o,"removeOtherKeepWiths");function e9t(t,e){if(e.id===t)return e;for(let r of e.children)if(RQ(r)){let n=e9t(t,r);if(n)return n}}a(e9t,"findNodeById");function GTe(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),V8o(t,e),r.isEmpty?GTe(r,e):r.onChunksChange())}a(GTe,"removeNode");function cgn(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(cgn,"getEncodedBase64");function W8o(t,e){for(let r=0;r{"use strict";p();function z8o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(z8o,"_vscpp");function lgn(){throw new Error("This should not be invoked!")}a(lgn,"_vscppf");lgn.isFragment=!0;globalThis.vscpp=z8o;globalThis.vscppf=lgn});var n9t=I(KWe=>{"use strict";p();Object.defineProperty(KWe,"__esModule",{value:!0});KWe.PromptElement=void 0;ugn();var r9t=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}};KWe.PromptElement=r9t});var h9t=I(Bs=>{"use strict";p();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.LogicalWrapper=Bs.IfEmpty=Bs.AbstractKeepWith=Bs.TokenLimit=Bs.Expandable=Bs.Chunk=Bs.LegacyPrioritization=Bs.ToolResult=Bs.PrioritizedList=Bs.Document=Bs.Image=Bs.TextChunk=Bs.ToolMessage=Bs.AssistantMessage=Bs.UserMessage=Bs.SystemMessage=Bs.BaseChatMessage=void 0;Bs.isChatMessagePromptElement=Y8o;Bs.useKeepWith=X8o;var VTe=wo(),kS=n9t();function Y8o(t){return t instanceof JWe||t instanceof ZWe||t instanceof XWe}a(Y8o,"isChatMessagePromptElement");var VY=class extends kS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.BaseChatMessage=VY;var JWe=class extends VY{static{a(this,"SystemMessage")}constructor(e){e.role=VTe.Raw.ChatRole.System,super(e)}};Bs.SystemMessage=JWe;var ZWe=class extends VY{static{a(this,"UserMessage")}constructor(e){e.role=VTe.Raw.ChatRole.User,super(e)}};Bs.UserMessage=ZWe;var XWe=class extends VY{static{a(this,"AssistantMessage")}constructor(e){e.role=VTe.Raw.ChatRole.Assistant,super(e)}};Bs.AssistantMessage=XWe;var K8o=/\s+/g,i9t=class extends VY{static{a(this,"ToolMessage")}constructor(e){e.role=VTe.Raw.ChatRole.Tool,super(e)}};Bs.ToolMessage=i9t;var eze=class extends kS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?K8o: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 J8o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Bs.TextChunk=eze;async function J8o(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(J8o,"getTextContentBelowBudget");var o9t=class extends kS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Bs.Image=o9t;var s9t=class extends kS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Bs.Document=s9t;var a9t=class extends kS.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(eze,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Bs.PrioritizedList=a9t;var c9t=class extends kS.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})}))}};Bs.ToolResult=c9t;var l9t=class extends kS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.LegacyPrioritization=l9t;var u9t=class extends kS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.Chunk=u9t;var d9t=class extends kS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Bs.Expandable=d9t;var f9t=class extends kS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.TokenLimit=f9t;var tze=class extends kS.PromptElement{static{a(this,"AbstractKeepWith")}};Bs.AbstractKeepWith=tze;var Z8o=0;function X8o(){let t=Z8o++;return class extends tze{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(X8o,"useKeepWith");var p9t=class extends kS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp($Te,null,this.props.alt),vscpp($Te,{flexGrow:1},this.props.children))}};Bs.IfEmpty=p9t;var $Te=class extends kS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.LogicalWrapper=$Te});var fgn=I(WTe=>{"use strict";p();Object.defineProperty(WTe,"__esModule",{value:!0});WTe.localize=e6o;WTe.localize2=t6o;WTe.getConfiguredDefaultLocale=r6o;function dgn(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(dgn,"_format");function e6o(t,e,...r){return dgn(e,r)}a(e6o,"localize");function t6o(t,e,...r){let n=dgn(e,r);return{original:n,value:n}}a(t6o,"localize2");function r6o(t){}a(r6o,"getConfiguredDefaultLocale")});var y9t=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=i6o;Sr.isLittleEndian=o6o;Sr.isBigSurOrNewer=s6o;var pgn=fgn();Sr.LANGUAGE_DEFAULT="en";var KTe=!1,JTe=!1,YTe=!1,Agn=!1,ygn=!1,g9t=!1,Egn=!1,A9t=!1,_gn=!1,Cgn=!1,zTe,rze=Sr.LANGUAGE_DEFAULT,m9t=Sr.LANGUAGE_DEFAULT,vgn,o3,s3=globalThis,PS;typeof s3.vscode<"u"&&typeof s3.vscode.process<"u"?PS=s3.vscode.process:typeof process<"u"&&(PS=process);var bgn=typeof PS?.versions?.electron=="string",n6o=bgn&&PS?.type==="renderer";if(typeof PS=="object"){KTe=PS.platform==="win32",JTe=PS.platform==="darwin",YTe=PS.platform==="linux",Agn=YTe&&!!PS.env.SNAP&&!!PS.env.SNAP_REVISION,Egn=bgn,_gn=!!PS.env.CI||!!PS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,zTe=Sr.LANGUAGE_DEFAULT,rze=Sr.LANGUAGE_DEFAULT;let t=PS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];zTe=e.locale,m9t=e.osLocale,rze=r||Sr.LANGUAGE_DEFAULT,vgn=e._translationsConfigFile}catch{}ygn=!0}else typeof navigator=="object"&&!n6o?(o3=navigator.userAgent,KTe=o3.indexOf("Windows")>=0,JTe=o3.indexOf("Macintosh")>=0,A9t=(o3.indexOf("Macintosh")>=0||o3.indexOf("iPad")>=0||o3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,YTe=o3.indexOf("Linux")>=0,Cgn=o3?.indexOf("Mobi")>=0,g9t=!0,zTe=pgn.getConfiguredDefaultLocale(pgn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,rze=zTe,m9t=navigator.language):console.error("Unable to resolve platform.");function i6o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(i6o,"PlatformToString");var nze=0;JTe?nze=1:KTe?nze=3:YTe&&(nze=2);Sr.isWindows=KTe;Sr.isMacintosh=JTe;Sr.isLinux=YTe;Sr.isLinuxSnap=Agn;Sr.isNative=ygn;Sr.isElectron=Egn;Sr.isWeb=g9t;Sr.isWebWorker=g9t&&typeof s3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?s3.origin:void 0;Sr.isIOS=A9t;Sr.isMobile=Cgn;Sr.isCI=_gn;Sr.platform=nze;Sr.userAgent=o3;Sr.language=rze;var hgn;(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})(hgn||(Sr.Language=hgn={}));Sr.locale=zTe;Sr.platformLocale=m9t;Sr.translationsConfigFile=vgn;Sr.setTimeout0IsFaster=typeof s3.postMessage=="function"&&!s3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];s3.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}),s3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=JTe||A9t?2:KTe?1:3;var mgn=!0,ggn=!1;function o6o(){if(!ggn){ggn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,mgn=new Uint16Array(t.buffer)[0]===513}return mgn}a(o6o,"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 s6o(t){return parseFloat(t)>=20}a(s6o,"isBigSurOrNewer")});var Tgn=I(WM=>{"use strict";p();Object.defineProperty(WM,"__esModule",{value:!0});WM.arch=WM.platform=WM.env=WM.cwd=void 0;var Sgn=y9t(),WY,E9t=globalThis.vscode;if(typeof E9t<"u"&&typeof E9t.process<"u"){let t=E9t.process;WY={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?WY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:WY={get platform(){return Sgn.isWindows?"win32":Sgn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};WM.cwd=WY.cwd;WM.env=WY.env;WM.platform=WY.platform;WM.arch=WY.arch});var xgn=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.delimiter=hn.sep=hn.toNamespacedPath=hn.parse=hn.format=hn.extname=hn.basename=hn.dirname=hn.relative=hn.resolve=hn.join=hn.isAbsolute=hn.normalize=hn.posix=hn.win32=void 0;var Zce=Tgn(),a6o=65,c6o=97,l6o=90,u6o=122,DQ=46,Zm=47,Tv=92,kQ=58,d6o=63,ize=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 f6o(t,e){if(t===null||typeof t!="object")throw new ize(e,"Object",t)}a(f6o,"validateObject");function Wf(t,e){if(typeof t!="string")throw new ize(e,"string",t)}a(Wf,"validateString");var Iv=Zce.platform==="win32";function Xo(t){return t===Zm||t===Tv}a(Xo,"isPathSeparator");function _9t(t){return t===Zm}a(_9t,"isPosixPathSeparator");function PQ(t){return t>=a6o&&t<=l6o||t>=c6o&&t<=u6o}a(PQ,"isWindowsDeviceRoot");function oze(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===DQ&&l!==-1?++l:l=-1}return o}a(oze,"normalizeString");function Ign(t,e){f6o(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(Ign,"_format");hn.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],Wf(s,"path"),s.length===0)continue}else e.length===0?s=Zce.cwd():(s=Zce.env[`=${e}`]||Zce.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===Tv)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Xo(f)&&(l=1,d=!0);else if(Xo(f))if(d=!0,Xo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Xo(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=oze(r,!n,"\\",Xo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Wf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return _9t(s)?"\\":t;if(Xo(s))if(o=!0,Xo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Xo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Xo(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Wf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Xo(r)||e>2&&PQ(r)&&t.charCodeAt(1)===kQ&&Xo(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"&&Xo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Xo(r.charCodeAt(1))&&(++o,s>2&&(Xo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return hn.win32.normalize(e)},relative(t,e){if(Wf(t,"from"),Wf(e,"to"),t===e)return"";let r=hn.win32.resolve(t),n=hn.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===Tv;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===Tv;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===Tv)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===Tv?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)===Tv)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===Tv&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=hn.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===Tv){if(e.charCodeAt(1)===Tv){let r=e.charCodeAt(2);if(r!==d6o&&r!==DQ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(PQ(e.charCodeAt(0))&&e.charCodeAt(1)===kQ&&e.charCodeAt(2)===Tv)return`\\\\?\\${e}`;return t},dirname(t){Wf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Xo(o)?t:".";if(Xo(o)){if(r=n=1,Xo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Xo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Xo(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&&Wf(e,"ext"),Wf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&PQ(t.charCodeAt(0))&&t.charCodeAt(1)===kQ&&(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(Xo(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(Xo(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){Wf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===kQ&&PQ(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Xo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===DQ?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:Ign.bind(null,"\\"),parse(t){Wf(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 Xo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Xo(o)){if(n=1,Xo(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),Xo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===DQ?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 p6o=(()=>{if(Iv){let t=/\\/g;return()=>{let e=Zce.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Zce.cwd()})();hn.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:p6o();Wf(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Zm)}return e=oze(e,!r,"/",_9t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Wf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Zm,r=t.charCodeAt(t.length-1)===Zm;return t=oze(t,!e,"/",_9t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Wf(t,"path"),t.length>0&&t.charCodeAt(0)===Zm},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?".":hn.posix.normalize(e)},relative(t,e){if(Wf(t,"from"),Wf(e,"to"),t===e||(t=hn.posix.resolve(t),e=hn.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)===Zm)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Zm?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Zm)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Wf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Zm,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Zm){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&&Wf(e,"ext"),Wf(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===Zm){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)===Zm){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Wf(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===Zm){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===DQ?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:Ign.bind(null,"/"),parse(t){Wf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Zm,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===Zm){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===DQ?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};hn.posix.win32=hn.win32.win32=hn.win32;hn.posix.posix=hn.win32.posix=hn.posix;hn.normalize=Iv?hn.win32.normalize:hn.posix.normalize;hn.isAbsolute=Iv?hn.win32.isAbsolute:hn.posix.isAbsolute;hn.join=Iv?hn.win32.join:hn.posix.join;hn.resolve=Iv?hn.win32.resolve:hn.posix.resolve;hn.relative=Iv?hn.win32.relative:hn.posix.relative;hn.dirname=Iv?hn.win32.dirname:hn.posix.dirname;hn.basename=Iv?hn.win32.basename:hn.posix.basename;hn.extname=Iv?hn.win32.extname:hn.posix.extname;hn.format=Iv?hn.win32.format:hn.posix.format;hn.parse=Iv?hn.win32.parse:hn.posix.parse;hn.toNamespacedPath=Iv?hn.win32.toNamespacedPath:hn.posix.toNamespacedPath;hn.sep=Iv?hn.win32.sep:hn.posix.sep;hn.delimiter=Iv?hn.win32.delimiter:hn.posix.delimiter});var Mgn=I(Xce=>{"use strict";p();Object.defineProperty(Xce,"__esModule",{value:!0});Xce.URI=void 0;Xce.isUriComponents=C6o;Xce.uriToFsPath=lze;var wgn=xgn(),aze=y9t(),h6o=/^\w[\w\d+.-]*$/,m6o=/^\//,g6o=/^\/\//;function A6o(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&&!h6o.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!m6o.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(g6o.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(A6o,"_validateUri");function y6o(t,e){return!t&&!e?"file":t}a(y6o,"_schemeFix");function E6o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==gP&&(e=gP+e):e=gP;break}return e}a(E6o,"_referenceResolution");var Fl="",gP="/",_6o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,cze=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||Fl,this.authority=e.authority||Fl,this.path=e.path||Fl,this.query=e.query||Fl,this.fragment=e.fragment||Fl):(this.scheme=y6o(e,c),this.authority=r||Fl,this.path=E6o(this.scheme,n||Fl),this.query=o||Fl,this.fragment=s||Fl,A6o(this,c))}get fsPath(){return lze(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=Fl),n===void 0?n=this.authority:n===null&&(n=Fl),o===void 0?o=this.path:o===null&&(o=Fl),s===void 0?s=this.query:s===null&&(s=Fl),c===void 0?c=this.fragment:c===null&&(c=Fl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new NQ(r,n,o,s,c)}static parse(e,r=!1){let n=_6o.exec(e);return n?new NQ(n[2]||Fl,sze(n[4]||Fl),sze(n[5]||Fl),sze(n[7]||Fl),sze(n[9]||Fl),r):new NQ(Fl,Fl,Fl,Fl,Fl)}static file(e){let r=Fl;if(aze.isWindows&&(e=e.replace(/\\/g,gP)),e[0]===gP&&e[1]===gP){let n=e.indexOf(gP,2);n===-1?(r=e.substring(2),e=gP):(r=e.substring(2,n),e=e.substring(n)||gP)}return new NQ("file",r,e,Fl,Fl)}static from(e,r){return new NQ(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 aze.isWindows&&e.scheme==="file"?n=t.file(wgn.win32.join(lze(e,!0),...r)).path:n=wgn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return C9t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new NQ(e);return r._formatted=e.external??null,r._fsPath=e._sep===Pgn?e.fsPath??null:null,r}}else return e}};Xce.URI=cze;function C6o(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(C6o,"isUriComponents");var Pgn=aze.isWindows?1:void 0,NQ=class extends cze{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=lze(this,!1)),this._fsPath}toString(e=!1){return e?C9t(this,!0):(this._formatted||(this._formatted=C9t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Pgn),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}},Dgn={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 Rgn(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=Dgn[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(Rgn,"encodeURIComponentFast");function v6o(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,aze.isWindows&&(r=r.replace(/\//g,"\\")),r}a(lze,"uriToFsPath");function C9t(t,e){let r=e?v6o:Rgn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=gP,n+=gP),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:Rgn(u,!1,!1)),n}a(C9t,"_asFormatted");function Ngn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+Ngn(t.substr(3)):t}}a(Ngn,"decodeURIComponentGraceful");var kgn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function sze(t){return t.match(kgn)?t.replace(kgn,e=>Ngn(e)):t}a(sze,"percentDecode")});var S9t=I(MQ=>{"use strict";p();Object.defineProperty(MQ,"__esModule",{value:!0});MQ.PromptReference=MQ.ChatResponseReferencePartStatusKind=MQ.PromptMetadata=void 0;var ZTe=Mgn(),v9t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};MQ.PromptMetadata=v9t;var Ogn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(Ogn||(MQ.ChatResponseReferencePartStatusKind=Ogn={}));var b9t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?ZTe.URI.from(n):{uri:ZTe.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?ZTe.URI.from(e.iconPath):"light"in e.iconPath?{light:ZTe.URI.from(e.iconPath.light),dark:ZTe.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}}};MQ.PromptReference=b9t});var D9t=I(ele=>{"use strict";p();Object.defineProperty(ele,"__esModule",{value:!0});ele.PromptRenderer=ele.MetadataMap=void 0;var b6o=K6t(),OQ=t9t(),YY=IQ(),kd=h9t(),P9t=S9t(),dze;(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")})})(dze||(ele.MetadataMap=dze={}));var T9t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new hze(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=Ugn(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 kd.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:YY.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 Lgn(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 Lgn(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 zY(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof kd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=Fgn(o),u=new zY(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await S6o(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 zY(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,YY.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new zY(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 zM))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(mze),h=o.map(m=>{if(!(m instanceof zM)||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(mze);return{metadata:dze.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 OQ.BudgetExceededError&&(m.metadata=dze.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 kd.Expandable))throw new Error("unreachable: expected growable");let l=new hze(null,0,s.elem.id),u=new zY(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:YY.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===kd.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},fze(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 zM(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 zM(u));else this._handleIntrinsic(e,l.name,l.props,fze(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};ele.PromptRenderer=T9t;async function S6o(t,e,r,n){let o=0;if((0,kd.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,YY.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:YY.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(S6o,"computeTokensConsumedByLiterals");function Fgn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new w9t(String(t))):T6o(t)?fze(t.children,e):I6o(t)?fze(t,e):typeof t.ctor=="string"?e.push(new I9t(t.ctor,t.props,t.children)):e.push(new x9t(t.ctor,t.props,t.children)),e)}a(Fgn,"flattenAndReduce");function fze(t,e=[]){for(let r of t)Fgn(r,e);return e}a(fze,"flattenAndReduceArr");var I9t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},x9t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},w9t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},pze=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 OQ.MaterializedChatMessageOpaque(e,{type:YY.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},zY=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}},hze=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 zM(P9t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return XTe.fromJSON(o,c,s);case 3:return pze.fromJSON(o,c,s);default:}}).filter(mze),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new kd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,kd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new kd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new kd.Image(r.props);break;case 4:o._obj=new kd.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 kd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof kd.Chunk&&(this._objFlags|=2),this._obj instanceof kd.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 XTe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new XTe(this,r,` -`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new pze(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(mze),props:{},references:this._metadata.filter(r=>r instanceof zM).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=uze(this._obj.props,b6o.jsonRetainedProps)),this._obj instanceof kd.BaseChatMessage)e.ctor=1,Object.assign(e.props,uze(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof kd.Image)return{...e,ctor:3,props:{...e.props,...uze(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof kd.Document)return{...e,ctor:4,props:{...e.props,...uze(this._obj.props,["data","mediaType"])}};this._obj instanceof kd.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 kd.Image)return new OQ.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 kd.Document)return new OQ.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 kd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new OQ.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof kd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof kd.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 OQ.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 kd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof kd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new R9t({type:YY.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},R9t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new OQ.MaterializedChatMessageBreakpoint(e,this.part)}},XTe=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 zM(P9t.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 OQ.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 zM).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function T6o(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(T6o,"isFragmentCtor");function mze(t){return t!==void 0}a(mze,"isDefined");var k9t=class extends P9t.PromptMetadata{static{a(this,"InternalMetadata")}},zM=class extends k9t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function I6o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(I6o,"isIterable");function uze(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(uze,"pickProps");function Ugn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(Ugn,"atPath");var Bgn=new WeakSet;async function Lgn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!Bgn.has(r)&&r.constructor.name!=="CancellationError"&&(Bgn.add(r),r.message+=` (at tsx element ${Ugn(t.path)})`),r}}a(Lgn,"annotateError")});var Qgn=I(gze=>{"use strict";p();Object.defineProperty(gze,"__esModule",{value:!0});gze.VSCodeTokenizer=void 0;var N9t=IQ(),M9t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=N9t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==N9t.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===N9t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};gze.VSCodeTokenizer=M9t});var qgn=I(tle=>{"use strict";p();Object.defineProperty(tle,"__esModule",{value:!0});tle.tracerCss=tle.tracerSrc=void 0;tle.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';tle.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 Vgn=I(yze=>{"use strict";p();Object.defineProperty(yze,"__esModule",{value:!0});yze.HTMLTracer=void 0;var jgn=qgn(),BQ=t9t(),x6o=IQ(),O9t=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 B9t.create({epochs:this.epochs,traceData:Ggn(this.traceData)})}serveRouter(e){return new Aze({baseAddress:e,epochs:this.epochs,traceData:Ggn(this.traceData)})}};yze.HTMLTracer=O9t;var Aze=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:pA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof IY)return{type:pA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:B0n(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof xY)return{type:pA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof fQ)return{type:pA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof ak)return r.part;throw new Error("Unexpected element type")});if(this.role===pA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===pA.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===pA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===pA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};Zm.MaterializedChatMessage=ck;var fQ=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&&pA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};Zm.MaterializedChatMessageOpaque=fQ;var ak=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};Zm.MaterializedChatMessageBreakpoint=ak;var IY=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,TY.once)(async e=>e.tokenLength({type:pA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:B0n(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};Zm.MaterializedChatMessageImage=IY;var xY=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,TY.once)(async e=>e.tokenLength({type:pA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};Zm.MaterializedChatMessageDocument=xY;function pQ(t){return t instanceof $L||t instanceof ck}a(pQ,"isContainerType");function k0n(t){return t instanceof gTe||t instanceof IY||t instanceof xY||t instanceof fQ||t instanceof ak}a(k0n,"isContentType");function cLo(t){if(!pQ(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(cLo,"assertContainerOrChatMessage");function*D0n(t,e=!1){for(let r of t.children)r instanceof gTe?(yield{content:r,isTextSibling:e},e=!0):r instanceof IY||r instanceof xY||r instanceof fQ||r instanceof ak?yield{content:r,isTextSibling:!1}:r instanceof fQ?yield{content:r,isTextSibling:!0}:(r&&(yield*D0n(r,e)),e=!1)}a(D0n,"contentChunks");function lLo(t,e){let r;function n(o,s){if(k0n(o))(!r||o.priorityn instanceof ak):t instanceof $L&&(r=t.children.some(N0n)),x0n.set(t,r),r}a(N0n,"hasCachePoint");function uLo(t){if(t instanceof ck)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof ck)return!1;return!0}a(uLo,"shouldLookForCachePointInNode");function o6t(t,e){let r;if(t instanceof $L&&t.has(1)){lLo(t,e);return}let n=uLo(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 ck?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};Zm.BudgetExceededError=gWe;function w0n(t){if(!pQ(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(w0n,"getLowestPriorityAmongChildren");function*M0n(t){yield*t.metadata;for(let e of t.children)pQ(e)?yield*M0n(e):yield*e.metadata}a(M0n,"allMetadata");function O0n(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,pQ(r)&&e.push(...r.children)}}a(R0n,"forEachNode");function dLo(t){let e=t;for(;e.parent;)e=e.parent;return e}a(dLo,"getRoot");function P0n(t){return t instanceof $L&&t.keepWithId!==void 0}a(P0n,"isKeepWith");var i6t=new Set;function fLo(t,e){let r=new Set;for(let n of R0n(t))P0n(n)&&!i6t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)i6t.add(n);try{let n=dLo(t);for(let o of R0n(n))P0n(o)&&r.has(o.keepWithId)?ATe(o,e):o instanceof ck&&o.toolCalls&&(o.toolCalls=pLo(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&ATe(o,e))}finally{for(let n of r)i6t.delete(n)}}a(fLo,"removeOtherKeepWiths");function s6t(t,e){if(e.id===t)return e;for(let r of e.children)if(pQ(r)){let n=s6t(t,r);if(n)return n}}a(s6t,"findNodeById");function ATe(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),fLo(t,e),r.isEmpty?ATe(r,e):r.onChunksChange())}a(ATe,"removeNode");function B0n(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(B0n,"getEncodedBase64");function pLo(t,e){for(let r=0;r{"use strict";p();function hLo(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(hLo,"_vscpp");function L0n(){throw new Error("This should not be invoked!")}a(L0n,"_vscppf");L0n.isFragment=!0;globalThis.vscpp=hLo;globalThis.vscppf=L0n});var l6t=I(AWe=>{"use strict";p();Object.defineProperty(AWe,"__esModule",{value:!0});AWe.PromptElement=void 0;F0n();var c6t=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}};AWe.PromptElement=c6t});var _6t=I(Ns=>{"use strict";p();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.LogicalWrapper=Ns.IfEmpty=Ns.AbstractKeepWith=Ns.TokenLimit=Ns.Expandable=Ns.Chunk=Ns.LegacyPrioritization=Ns.ToolResult=Ns.PrioritizedList=Ns.Document=Ns.Image=Ns.TextChunk=Ns.ToolMessage=Ns.AssistantMessage=Ns.UserMessage=Ns.SystemMessage=Ns.BaseChatMessage=void 0;Ns.isChatMessagePromptElement=mLo;Ns.useKeepWith=ELo;var ETe=Io(),bS=l6t();function mLo(t){return t instanceof yWe||t instanceof EWe||t instanceof _We}a(mLo,"isChatMessagePromptElement");var wY=class extends bS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.BaseChatMessage=wY;var yWe=class extends wY{static{a(this,"SystemMessage")}constructor(e){e.role=ETe.Raw.ChatRole.System,super(e)}};Ns.SystemMessage=yWe;var EWe=class extends wY{static{a(this,"UserMessage")}constructor(e){e.role=ETe.Raw.ChatRole.User,super(e)}};Ns.UserMessage=EWe;var _We=class extends wY{static{a(this,"AssistantMessage")}constructor(e){e.role=ETe.Raw.ChatRole.Assistant,super(e)}};Ns.AssistantMessage=_We;var gLo=/\s+/g,u6t=class extends wY{static{a(this,"ToolMessage")}constructor(e){e.role=ETe.Raw.ChatRole.Tool,super(e)}};Ns.ToolMessage=u6t;var vWe=class extends bS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?gLo: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 ALo(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Ns.TextChunk=vWe;async function ALo(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(ALo,"getTextContentBelowBudget");var d6t=class extends bS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Ns.Image=d6t;var f6t=class extends bS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Ns.Document=f6t;var p6t=class extends bS.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(vWe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Ns.PrioritizedList=p6t;var h6t=class extends bS.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})}))}};Ns.ToolResult=h6t;var m6t=class extends bS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.LegacyPrioritization=m6t;var g6t=class extends bS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.Chunk=g6t;var A6t=class extends bS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Ns.Expandable=A6t;var y6t=class extends bS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.TokenLimit=y6t;var CWe=class extends bS.PromptElement{static{a(this,"AbstractKeepWith")}};Ns.AbstractKeepWith=CWe;var yLo=0;function ELo(){let t=yLo++;return class extends CWe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(ELo,"useKeepWith");var E6t=class extends bS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(yTe,null,this.props.alt),vscpp(yTe,{flexGrow:1},this.props.children))}};Ns.IfEmpty=E6t;var yTe=class extends bS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.LogicalWrapper=yTe});var Q0n=I(_Te=>{"use strict";p();Object.defineProperty(_Te,"__esModule",{value:!0});_Te.localize=_Lo;_Te.localize2=vLo;_Te.getConfiguredDefaultLocale=CLo;function U0n(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(U0n,"_format");function _Lo(t,e,...r){return U0n(e,r)}a(_Lo,"localize");function vLo(t,e,...r){let n=U0n(e,r);return{original:n,value:n}}a(vLo,"localize2");function CLo(t){}a(CLo,"getConfiguredDefaultLocale")});var S6t=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=SLo;Sr.isLittleEndian=TLo;Sr.isBigSurOrNewer=ILo;var q0n=Q0n();Sr.LANGUAGE_DEFAULT="en";var bTe=!1,STe=!1,CTe=!1,$0n=!1,V0n=!1,C6t=!1,W0n=!1,b6t=!1,z0n=!1,Y0n=!1,vTe,bWe=Sr.LANGUAGE_DEFAULT,v6t=Sr.LANGUAGE_DEFAULT,K0n,VL,WL=globalThis,SS;typeof WL.vscode<"u"&&typeof WL.vscode.process<"u"?SS=WL.vscode.process:typeof process<"u"&&(SS=process);var J0n=typeof SS?.versions?.electron=="string",bLo=J0n&&SS?.type==="renderer";if(typeof SS=="object"){bTe=SS.platform==="win32",STe=SS.platform==="darwin",CTe=SS.platform==="linux",$0n=CTe&&!!SS.env.SNAP&&!!SS.env.SNAP_REVISION,W0n=J0n,z0n=!!SS.env.CI||!!SS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,vTe=Sr.LANGUAGE_DEFAULT,bWe=Sr.LANGUAGE_DEFAULT;let t=SS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];vTe=e.locale,v6t=e.osLocale,bWe=r||Sr.LANGUAGE_DEFAULT,K0n=e._translationsConfigFile}catch{}V0n=!0}else typeof navigator=="object"&&!bLo?(VL=navigator.userAgent,bTe=VL.indexOf("Windows")>=0,STe=VL.indexOf("Macintosh")>=0,b6t=(VL.indexOf("Macintosh")>=0||VL.indexOf("iPad")>=0||VL.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,CTe=VL.indexOf("Linux")>=0,Y0n=VL?.indexOf("Mobi")>=0,C6t=!0,vTe=q0n.getConfiguredDefaultLocale(q0n.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,bWe=vTe,v6t=navigator.language):console.error("Unable to resolve platform.");function SLo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(SLo,"PlatformToString");var SWe=0;STe?SWe=1:bTe?SWe=3:CTe&&(SWe=2);Sr.isWindows=bTe;Sr.isMacintosh=STe;Sr.isLinux=CTe;Sr.isLinuxSnap=$0n;Sr.isNative=V0n;Sr.isElectron=W0n;Sr.isWeb=C6t;Sr.isWebWorker=C6t&&typeof WL.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?WL.origin:void 0;Sr.isIOS=b6t;Sr.isMobile=Y0n;Sr.isCI=z0n;Sr.platform=SWe;Sr.userAgent=VL;Sr.language=bWe;var j0n;(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})(j0n||(Sr.Language=j0n={}));Sr.locale=vTe;Sr.platformLocale=v6t;Sr.translationsConfigFile=K0n;Sr.setTimeout0IsFaster=typeof WL.postMessage=="function"&&!WL.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];WL.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}),WL.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=STe||b6t?2:bTe?1:3;var H0n=!0,G0n=!1;function TLo(){if(!G0n){G0n=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,H0n=new Uint16Array(t.buffer)[0]===513}return H0n}a(TLo,"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 ILo(t){return parseFloat(t)>=20}a(ILo,"isBigSurOrNewer")});var X0n=I(BM=>{"use strict";p();Object.defineProperty(BM,"__esModule",{value:!0});BM.arch=BM.platform=BM.env=BM.cwd=void 0;var Z0n=S6t(),RY,T6t=globalThis.vscode;if(typeof T6t<"u"&&typeof T6t.process<"u"){let t=T6t.process;RY={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?RY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:RY={get platform(){return Z0n.isWindows?"win32":Z0n.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};BM.cwd=RY.cwd;BM.env=RY.env;BM.platform=RY.platform;BM.arch=RY.arch});var tmn=I(pn=>{"use strict";p();Object.defineProperty(pn,"__esModule",{value:!0});pn.delimiter=pn.sep=pn.toNamespacedPath=pn.parse=pn.format=pn.extname=pn.basename=pn.dirname=pn.relative=pn.resolve=pn.join=pn.isAbsolute=pn.normalize=pn.posix=pn.win32=void 0;var Pce=X0n(),xLo=65,wLo=97,RLo=90,PLo=122,gQ=46,Xm=47,EC=92,hQ=58,kLo=63,TWe=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 DLo(t,e){if(t===null||typeof t!="object")throw new TWe(e,"Object",t)}a(DLo,"validateObject");function zf(t,e){if(typeof t!="string")throw new TWe(e,"string",t)}a(zf,"validateString");var _C=Pce.platform==="win32";function Ko(t){return t===Xm||t===EC}a(Ko,"isPathSeparator");function I6t(t){return t===Xm}a(I6t,"isPosixPathSeparator");function mQ(t){return t>=xLo&&t<=RLo||t>=wLo&&t<=PLo}a(mQ,"isWindowsDeviceRoot");function IWe(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===gQ&&l!==-1?++l:l=-1}return o}a(IWe,"normalizeString");function emn(t,e){DLo(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(emn,"_format");pn.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],zf(s,"path"),s.length===0)continue}else e.length===0?s=Pce.cwd():(s=Pce.env[`=${e}`]||Pce.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===EC)&&(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=IWe(r,!n,"\\",Ko),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){zf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return I6t(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+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){zf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Ko(r)||e>2&&mQ(r)&&t.charCodeAt(1)===hQ&&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 pn.win32.normalize(e)},relative(t,e){if(zf(t,"from"),zf(e,"to"),t===e)return"";let r=pn.win32.resolve(t),n=pn.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===EC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===EC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===EC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===EC?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)===EC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===EC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=pn.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===EC){if(e.charCodeAt(1)===EC){let r=e.charCodeAt(2);if(r!==kLo&&r!==gQ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(mQ(e.charCodeAt(0))&&e.charCodeAt(1)===hQ&&e.charCodeAt(2)===EC)return`\\\\?\\${e}`;return t},dirname(t){zf(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&&zf(e,"ext"),zf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&mQ(t.charCodeAt(0))&&t.charCodeAt(1)===hQ&&(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){zf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===hQ&&mQ(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===gQ?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:emn.bind(null,"\\"),parse(t){zf(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===gQ?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 NLo=(()=>{if(_C){let t=/\\/g;return()=>{let e=Pce.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Pce.cwd()})();pn.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:NLo();zf(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Xm)}return e=IWe(e,!r,"/",I6t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Xm,r=t.charCodeAt(t.length-1)===Xm;return t=IWe(t,!e,"/",I6t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return zf(t,"path"),t.length>0&&t.charCodeAt(0)===Xm},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?".":pn.posix.normalize(e)},relative(t,e){if(zf(t,"from"),zf(e,"to"),t===e||(t=pn.posix.resolve(t),e=pn.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)===Xm)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Xm?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Xm)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Xm,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Xm){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&&zf(e,"ext"),zf(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===Xm){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)===Xm){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){zf(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===Xm){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===gQ?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:emn.bind(null,"/"),parse(t){zf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Xm,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===Xm){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===gQ?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};pn.posix.win32=pn.win32.win32=pn.win32;pn.posix.posix=pn.win32.posix=pn.posix;pn.normalize=_C?pn.win32.normalize:pn.posix.normalize;pn.isAbsolute=_C?pn.win32.isAbsolute:pn.posix.isAbsolute;pn.join=_C?pn.win32.join:pn.posix.join;pn.resolve=_C?pn.win32.resolve:pn.posix.resolve;pn.relative=_C?pn.win32.relative:pn.posix.relative;pn.dirname=_C?pn.win32.dirname:pn.posix.dirname;pn.basename=_C?pn.win32.basename:pn.posix.basename;pn.extname=_C?pn.win32.extname:pn.posix.extname;pn.format=_C?pn.win32.format:pn.posix.format;pn.parse=_C?pn.win32.parse:pn.posix.parse;pn.toNamespacedPath=_C?pn.win32.toNamespacedPath:pn.posix.toNamespacedPath;pn.sep=_C?pn.win32.sep:pn.posix.sep;pn.delimiter=_C?pn.win32.delimiter:pn.posix.delimiter});var cmn=I(kce=>{"use strict";p();Object.defineProperty(kce,"__esModule",{value:!0});kce.URI=void 0;kce.isUriComponents=qLo;kce.uriToFsPath=PWe;var rmn=tmn(),wWe=S6t(),MLo=/^\w[\w\d+.-]*$/,OLo=/^\//,BLo=/^\/\//;function LLo(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&&!MLo.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!OLo.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(BLo.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(LLo,"_validateUri");function FLo(t,e){return!t&&!e?"file":t}a(FLo,"_schemeFix");function ULo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==lk&&(e=lk+e):e=lk;break}return e}a(ULo,"_referenceResolution");var Ol="",lk="/",QLo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,RWe=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||Ol,this.authority=e.authority||Ol,this.path=e.path||Ol,this.query=e.query||Ol,this.fragment=e.fragment||Ol):(this.scheme=FLo(e,c),this.authority=r||Ol,this.path=ULo(this.scheme,n||Ol),this.query=o||Ol,this.fragment=s||Ol,LLo(this,c))}get fsPath(){return PWe(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=Ol),n===void 0?n=this.authority:n===null&&(n=Ol),o===void 0?o=this.path:o===null&&(o=Ol),s===void 0?s=this.query:s===null&&(s=Ol),c===void 0?c=this.fragment:c===null&&(c=Ol),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new AQ(r,n,o,s,c)}static parse(e,r=!1){let n=QLo.exec(e);return n?new AQ(n[2]||Ol,xWe(n[4]||Ol),xWe(n[5]||Ol),xWe(n[7]||Ol),xWe(n[9]||Ol),r):new AQ(Ol,Ol,Ol,Ol,Ol)}static file(e){let r=Ol;if(wWe.isWindows&&(e=e.replace(/\\/g,lk)),e[0]===lk&&e[1]===lk){let n=e.indexOf(lk,2);n===-1?(r=e.substring(2),e=lk):(r=e.substring(2,n),e=e.substring(n)||lk)}return new AQ("file",r,e,Ol,Ol)}static from(e,r){return new AQ(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 wWe.isWindows&&e.scheme==="file"?n=t.file(rmn.win32.join(PWe(e,!0),...r)).path:n=rmn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return x6t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new AQ(e);return r._formatted=e.external??null,r._fsPath=e._sep===omn?e.fsPath??null:null,r}}else return e}};kce.URI=RWe;function qLo(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(qLo,"isUriComponents");var omn=wWe.isWindows?1:void 0,AQ=class extends RWe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=PWe(this,!1)),this._fsPath}toString(e=!1){return e?x6t(this,!0):(this._formatted||(this._formatted=x6t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=omn),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}},smn={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 nmn(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=smn[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(nmn,"encodeURIComponentFast");function jLo(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,wWe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(PWe,"uriToFsPath");function x6t(t,e){let r=e?jLo:nmn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=lk,n+=lk),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:nmn(u,!1,!1)),n}a(x6t,"_asFormatted");function amn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+amn(t.substr(3)):t}}a(amn,"decodeURIComponentGraceful");var imn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function xWe(t){return t.match(imn)?t.replace(imn,e=>amn(e)):t}a(xWe,"percentDecode")});var P6t=I(yQ=>{"use strict";p();Object.defineProperty(yQ,"__esModule",{value:!0});yQ.PromptReference=yQ.ChatResponseReferencePartStatusKind=yQ.PromptMetadata=void 0;var TTe=cmn(),w6t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};yQ.PromptMetadata=w6t;var lmn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(lmn||(yQ.ChatResponseReferencePartStatusKind=lmn={}));var R6t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?TTe.URI.from(n):{uri:TTe.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?TTe.URI.from(e.iconPath):"light"in e.iconPath?{light:TTe.URI.from(e.iconPath.light),dark:TTe.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}}};yQ.PromptReference=R6t});var F6t=I(Dce=>{"use strict";p();Object.defineProperty(Dce,"__esModule",{value:!0});Dce.PromptRenderer=Dce.MetadataMap=void 0;var HLo=r6t(),EQ=a6t(),kY=uQ(),wd=_6t(),L6t=P6t(),DWe;(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")})})(DWe||(Dce.MetadataMap=DWe={}));var k6t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new OWe(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=pmn(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 wd.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:kY.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 dmn(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 dmn(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 PY(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof wd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=fmn(o),u=new PY(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await GLo(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 PY(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,kY.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new PY(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 LM))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(BWe),h=o.map(m=>{if(!(m instanceof LM)||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(BWe);return{metadata:DWe.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 EQ.BudgetExceededError&&(m.metadata=DWe.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 wd.Expandable))throw new Error("unreachable: expected growable");let l=new OWe(null,0,s.elem.id),u=new PY(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:kY.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===wd.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},NWe(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 LM(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 LM(u));else this._handleIntrinsic(e,l.name,l.props,NWe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};Dce.PromptRenderer=k6t;async function GLo(t,e,r,n){let o=0;if((0,wd.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,kY.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:kY.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(GLo,"computeTokensConsumedByLiterals");function fmn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new M6t(String(t))):$Lo(t)?NWe(t.children,e):VLo(t)?NWe(t,e):typeof t.ctor=="string"?e.push(new D6t(t.ctor,t.props,t.children)):e.push(new N6t(t.ctor,t.props,t.children)),e)}a(fmn,"flattenAndReduce");function NWe(t,e=[]){for(let r of t)fmn(r,e);return e}a(NWe,"flattenAndReduceArr");var D6t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},N6t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},M6t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},MWe=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 EQ.MaterializedChatMessageOpaque(e,{type:kY.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},PY=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}},OWe=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 LM(L6t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return ITe.fromJSON(o,c,s);case 3:return MWe.fromJSON(o,c,s);default:}}).filter(BWe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new wd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,wd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new wd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new wd.Image(r.props);break;case 4:o._obj=new wd.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 wd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof wd.Chunk&&(this._objFlags|=2),this._obj instanceof wd.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 ITe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new ITe(this,r,` +`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new MWe(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(BWe),props:{},references:this._metadata.filter(r=>r instanceof LM).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=kWe(this._obj.props,HLo.jsonRetainedProps)),this._obj instanceof wd.BaseChatMessage)e.ctor=1,Object.assign(e.props,kWe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof wd.Image)return{...e,ctor:3,props:{...e.props,...kWe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof wd.Document)return{...e,ctor:4,props:{...e.props,...kWe(this._obj.props,["data","mediaType"])}};this._obj instanceof wd.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 wd.Image)return new EQ.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 wd.Document)return new EQ.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 wd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new EQ.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof wd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof wd.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 EQ.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 wd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof wd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new O6t({type:kY.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},O6t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new EQ.MaterializedChatMessageBreakpoint(e,this.part)}},ITe=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 LM(L6t.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 EQ.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 LM).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function $Lo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a($Lo,"isFragmentCtor");function BWe(t){return t!==void 0}a(BWe,"isDefined");var B6t=class extends L6t.PromptMetadata{static{a(this,"InternalMetadata")}},LM=class extends B6t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function VLo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(VLo,"isIterable");function kWe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(kWe,"pickProps");function pmn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(pmn,"atPath");var umn=new WeakSet;async function dmn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!umn.has(r)&&r.constructor.name!=="CancellationError"&&(umn.add(r),r.message+=` (at tsx element ${pmn(t.path)})`),r}}a(dmn,"annotateError")});var hmn=I(LWe=>{"use strict";p();Object.defineProperty(LWe,"__esModule",{value:!0});LWe.VSCodeTokenizer=void 0;var U6t=uQ(),Q6t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=U6t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==U6t.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===U6t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};LWe.VSCodeTokenizer=Q6t});var mmn=I(Nce=>{"use strict";p();Object.defineProperty(Nce,"__esModule",{value:!0});Nce.tracerCss=Nce.tracerSrc=void 0;Nce.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';Nce.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 _mn=I(UWe=>{"use strict";p();Object.defineProperty(UWe,"__esModule",{value:!0});UWe.HTMLTracer=void 0;var gmn=mmn(),_Q=a6t(),WLo=uQ(),q6t=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 j6t.create({epochs:this.epochs,traceData:ymn(this.traceData)})}serveRouter(e){return new FWe({baseAddress:e,epochs:this.epochs,traceData:ymn(this.traceData)})}};UWe.HTMLTracer=q6t;var FWe=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 Hgn(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)})}},B9t=class t extends Aze{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 Hgn(t,e){return{container:await $gn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(Hgn,"serializeRenderData");async function $gn(t,e,r){let n={metadata:e.metadata.map(R6o),priority:e.priority};if(e instanceof BQ.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof BQ.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof BQ.MaterializedChatMessageOpaque||e instanceof BQ.MaterializedChatMessageBreakpoint||e instanceof BQ.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>$gn(t,s,r||e instanceof BQ.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof BQ.GenericMaterializedContainer)return{...o,type:0};if(e instanceof BQ.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:x6o.Raw.ChatRole.display(e.role),text:s}}}w6o(e)}a($gn,"serializeMaterialized");function w6o(t){throw new Error("unreachable")}a(w6o,"assertNever");function R6o(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(R6o,"serializeMetadata");var Ggn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var zgn=I(Wgn=>{"use strict";p();Object.defineProperty(Wgn,"__esModule",{value:!0})});var Kgn=I(Ygn=>{"use strict";p();Object.defineProperty(Ygn,"__esModule",{value:!0})});var Zgn=I(Jgn=>{"use strict";p();Object.defineProperty(Jgn,"__esModule",{value:!0})});var wo=I(Wu=>{"use strict";p();var k6o=Wu&&Wu.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KY=Wu&&Wu.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k6o(e,t,r)};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.contentType=Wu.PromptRenderer=Wu.MetadataMap=Wu.PromptElement=Wu.JSONTree=void 0;Wu.renderPrompt=N6o;Wu.renderElementJSON=M6o;var L9t=IQ(),Xgn=D9t(),P6o=Qgn();KY(Vgn(),Wu);Wu.JSONTree=K6t();KY(IQ(),Wu);KY(h9t(),Wu);KY(S9t(),Wu);KY(zgn(),Wu);KY(Kgn(),Wu);KY(Zgn(),Wu);var D6o=n9t();Object.defineProperty(Wu,"PromptElement",{enumerable:!0,get:a(function(){return D6o.PromptElement},"get")});var eAn=D9t();Object.defineProperty(Wu,"MetadataMap",{enumerable:!0,get:a(function(){return eAn.MetadataMap},"get")});Object.defineProperty(Wu,"PromptRenderer",{enumerable:!0,get:a(function(){return eAn.PromptRenderer},"get")});async function N6o(t,e,r,n,o,s,c=L9t.OutputMode.VSCode){let l="countTokens"in n?new P6o.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new Xgn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(N6o,"renderPrompt");Wu.contentType="application/vnd.codechat.prompt+json.1";function M6o(t,e,r,n){return new Xgn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:L9t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===L9t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(M6o,"renderElementJSON")});var uEn=I((wJu,AIe)=>{"use strict";p();var kYe=a(function(){},"NullObject");kYe.prototype=Object.create(null);var wYe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,RYe=/\\([\v\u0020-\u00ff])/gu,aEn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,sK={type:"",parameters:new kYe};Object.freeze(sK.parameters);Object.freeze(sK);function cEn(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(aEn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new kYe};if(e===-1)return n;let o,s,c;for(wYe.lastIndex=e;s=wYe.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),RYe.test(c)&&(c=c.replace(RYe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(cEn,"parse");function lEn(t){if(typeof t!="string")return sK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(aEn.test(r)===!1)return sK;let n={type:r.toLowerCase(),parameters:new kYe};if(e===-1)return n;let o,s,c;for(wYe.lastIndex=e;s=wYe.exec(t);){if(s.index!==e)return sK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),RYe.test(c)&&(c=c.replace(RYe,"$1"))),n.parameters[o]=c}return e!==t.length?sK:n}a(lEn,"safeParse");AIe.exports.default={parse:cEn,safeParse:lEn};AIe.exports.parse=cEn;AIe.exports.safeParse=lEn;AIe.exports.defaultContentType=sK});var KEn=I(g7t=>{"use strict";p();Object.defineProperty(g7t,"__esModule",{value:!0});g7t.workerFile=` -const { parentPort } = require('worker_threads') - -parentPort.on('message', async worker => { - const response = { - error: null, - data: null - } - - try { - eval(worker) - // __executor__ is defined in worker - response.data = await __executor__() - parentPort.postMessage(response) - } catch (err) { - response.data = null - response.error = { - message: err.message, - stack: err.stack - } - - try { - parentPort.postMessage(response) - } catch (err) { - console.error(err) - } - } -}) -`});var r_n=I(y7t=>{"use strict";p();Object.defineProperty(y7t,"__esModule",{value:!0});var JEn=require("worker_threads"),rQo=require("v8"),nQo=require("os"),ZEn=KEn(),$Ye="ready",XEn="spawning",iQo="busy",VYe="off",e_n=nQo.cpus().length,t_n=process.version.replace("v","").split("."),oQo=parseInt(t_n[0]),sQo=parseInt(t_n[1]),A7t=class{static{a(this,"WorkerPool")}constructor(){this.maxWorkers=e_n,this.taskQueue=[],this.workers=[]}resurrect(e){let r=new JEn.Worker(ZEn.workerFile,{eval:!0});e.status=XEn,e.worker=r,r.once("online",()=>process.nextTick(()=>{e.status=$Ye,r.removeAllListeners(),this.tick()})),r.once("error",n=>{console.error(n),e.status=VYe,r.removeAllListeners(),this.tick()})}tick(){if(this.workers.filter(({status:u})=>u===VYe).forEach(u=>this.resurrect(u)),this.taskQueue.length===0)return;let e;for(let u=0;u"u")return;let r=this.taskQueue.shift();e.status=iQo;let{worker:n}=e,{handler:o,config:s,resolve:c,reject:l}=r;try{let u="";for(let m in s.ctx){if(!s.ctx.hasOwnProperty(m))continue;let g;switch(typeof s.ctx[m]){case"string":g=`'${s.ctx[m]}'`;break;case"object":g=JSON.stringify(s.ctx[m]);break;default:g=s.ctx[m]}u+=`let ${m} = ${g} -`}let d=rQo.serialize(s.data),f=JSON.stringify(d),h=` - async function __executor__() { - const v8 = require('v8') - ${u} - const dataParsed = JSON.parse('${f}') - const dataBuffer = Buffer.from(dataParsed.data) - const dataDeserialized = v8.deserialize(dataBuffer) - return await (${o.toString()})(dataDeserialized) - } - `;n.once("message",m=>{if(this.free(n),typeof m.error>"u"||m.error===null)return c(m.data);let g=new Error(m.error.message);g.stack=m.error.stack,l(g)}),n.once("error",m=>{e.status=VYe,l(m),this.tick()}),n.postMessage(h)}catch(u){this.free(n),l(u)}}enqueue({handler:e,config:r,resolve:n,reject:o}){this.taskQueue.push({handler:e,config:r,resolve:n,reject:o}),this.tick()}free(e){for(let r=0;r0?e.maxWorkers:e_n,this.maxWorkers>10&&console.warn(`Worker pool has more than 10 workers. -You should also increase the Max Listeners of Node.js (https://nodejs.org/docs/latest/api/events.html#events_emitter_setmaxlisteners_n) -Otherwise, limit them with start({maxWorkers: 10})`),new Promise((r,n)=>{let o=0,s=0;for(let c=0;c()=>{process.nextTick(()=>{this.workers[u].status=$Ye,this.workers[u].worker.removeAllListeners(),o++,o>0&&o+s===this.maxWorkers&&r()})})(c)),l.once("error",(u=>d=>{this.workers[u].status=VYe,this.workers[u].worker.removeAllListeners(),s++,s===this.maxWorkers&&n(d)})(c))}})}async teardown(){if(oQo>=12&&sQo>=5){let e=[];for(let{worker:r}of this.workers)e.push(r.terminate());await Promise.all(e),this.workers=[]}else await new Promise(r=>{let n=0;for(let o=0;o{n++,n===this.workers.length&&(this.workers=[],r())})})}};y7t.default=new A7t});var WYe=I(lK=>{"use strict";p();var aQo=lK&&lK.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lK,"__esModule",{value:!0});var vIe=aQo(r_n()),cQo=`job needs a function. -Try with: -> job(() => {...}, config)`,lQo=`job needs an object as ctx. -Try with: -> job(() => {...}, {ctx: {...}})`;function uQo(t,e={ctx:{},data:{}}){return new Promise((r,n)=>{if(typeof t!="function")return n(new Error(cQo));if(e.ctx=e.ctx||{},e.data=e.data||{},typeof e.ctx!="object")return n(new Error(lQo));vIe.default.enqueue({handler:t,config:e,resolve:r,reject:n})})}a(uQo,"job");lK.job=uQo;lK.stop=vIe.default.teardown.bind(vIe.default);lK.start=vIe.default.setup.bind(vIe.default)});var ZQ=I(ig=>{"use strict";p();Object.defineProperty(ig,"__esModule",{value:!0});ig.MonotonousArray=void 0;ig.findLast=BQo;ig.findLastIdx=m_n;ig.findFirst=LQo;ig.findFirstIdx=g_n;ig.findLastMonotonous=FQo;ig.findLastIdxMonotonous=M7t;ig.findFirstMonotonous=UQo;ig.findFirstIdxMonotonousOrArrLen=O7t;ig.findFirstIdxMonotonous=QQo;ig.findFirstMax=A_n;ig.findLastMax=qQo;ig.findFirstMin=jQo;ig.findMaxIdx=HQo;ig.mapFindFirst=GQo;function BQo(t,e,r=t.length-1){let n=m_n(t,e,r);if(n!==-1)return t[n]}a(BQo,"findLast");function m_n(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(m_n,"findLastIdx");function LQo(t,e,r=0){let n=g_n(t,e,r);if(n!==-1)return t[n]}a(LQo,"findFirst");function g_n(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(A_n,"findFirstMax");function qQo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(qQo,"findLastMax");function jQo(t,e){return A_n(t,(r,n)=>-e(r,n))}a(jQo,"findFirstMin");function HQo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(HQo,"findMaxIdx");function GQo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(GQo,"mapFindFirst")});var Ts=I(Ro=>{"use strict";p();Object.defineProperty(Ro,"__esModule",{value:!0});Ro.BugIndicatingError=Ro.ErrorNoTelemetry=Ro.ExpectedError=Ro.NotSupportedError=Ro.NotImplementedError=Ro.ReadonlyError=Ro.PendingMigrationError=Ro.CancellationError=Ro.canceledName=Ro.errorHandler=Ro.ErrorHandler=void 0;Ro.setUnexpectedErrorHandler=$Qo;Ro.isSigPipeError=VQo;Ro.onBugIndicatingError=WQo;Ro.onUnexpectedError=zQo;Ro.onUnexpectedExternalError=YQo;Ro.transformErrorForSerialization=y_n;Ro.transformErrorFromSerialization=E_n;Ro.isCancellationError=j7t;Ro.canceled=KQo;Ro.illegalArgument=JQo;Ro.illegalState=ZQo;Ro.getErrorMessage=XQo;var lKe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?dK.isErrorNoTelemetry(e)?new dK(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 Amn(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)})}},j6t=class t extends FWe{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 Amn(t,e){return{container:await Emn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(Amn,"serializeRenderData");async function Emn(t,e,r){let n={metadata:e.metadata.map(YLo),priority:e.priority};if(e instanceof _Q.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof _Q.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof _Q.MaterializedChatMessageOpaque||e instanceof _Q.MaterializedChatMessageBreakpoint||e instanceof _Q.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>Emn(t,s,r||e instanceof _Q.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof _Q.GenericMaterializedContainer)return{...o,type:0};if(e instanceof _Q.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:WLo.Raw.ChatRole.display(e.role),text:s}}}zLo(e)}a(Emn,"serializeMaterialized");function zLo(t){throw new Error("unreachable")}a(zLo,"assertNever");function YLo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(YLo,"serializeMetadata");var ymn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var Cmn=I(vmn=>{"use strict";p();Object.defineProperty(vmn,"__esModule",{value:!0})});var Smn=I(bmn=>{"use strict";p();Object.defineProperty(bmn,"__esModule",{value:!0})});var Imn=I(Tmn=>{"use strict";p();Object.defineProperty(Tmn,"__esModule",{value:!0})});var Io=I(Wu=>{"use strict";p();var KLo=Wu&&Wu.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DY=Wu&&Wu.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KLo(e,t,r)};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.contentType=Wu.PromptRenderer=Wu.MetadataMap=Wu.PromptElement=Wu.JSONTree=void 0;Wu.renderPrompt=XLo;Wu.renderElementJSON=e3o;var H6t=uQ(),xmn=F6t(),JLo=hmn();DY(_mn(),Wu);Wu.JSONTree=r6t();DY(uQ(),Wu);DY(_6t(),Wu);DY(P6t(),Wu);DY(Cmn(),Wu);DY(Smn(),Wu);DY(Imn(),Wu);var ZLo=l6t();Object.defineProperty(Wu,"PromptElement",{enumerable:!0,get:a(function(){return ZLo.PromptElement},"get")});var wmn=F6t();Object.defineProperty(Wu,"MetadataMap",{enumerable:!0,get:a(function(){return wmn.MetadataMap},"get")});Object.defineProperty(Wu,"PromptRenderer",{enumerable:!0,get:a(function(){return wmn.PromptRenderer},"get")});async function XLo(t,e,r,n,o,s,c=H6t.OutputMode.VSCode){let l="countTokens"in n?new JLo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new xmn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(XLo,"renderPrompt");Wu.contentType="application/vnd.codechat.prompt+json.1";function e3o(t,e,r,n){return new xmn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:H6t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===H6t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(e3o,"renderElementJSON")});var FAn=I((UWu,GTe)=>{"use strict";p();var Jze=a(function(){},"NullObject");Jze.prototype=Object.create(null);var Yze=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,Kze=/\\([\v\u0020-\u00ff])/gu,OAn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,jY={type:"",parameters:new Jze};Object.freeze(jY.parameters);Object.freeze(jY);function BAn(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(OAn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new Jze};if(e===-1)return n;let o,s,c;for(Yze.lastIndex=e;s=Yze.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),Kze.test(c)&&(c=c.replace(Kze,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(BAn,"parse");function LAn(t){if(typeof t!="string")return jY;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(OAn.test(r)===!1)return jY;let n={type:r.toLowerCase(),parameters:new Jze};if(e===-1)return n;let o,s,c;for(Yze.lastIndex=e;s=Yze.exec(t);){if(s.index!==e)return jY;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),Kze.test(c)&&(c=c.replace(Kze,"$1"))),n.parameters[o]=c}return e!==t.length?jY:n}a(LAn,"safeParse");GTe.exports.default={parse:BAn,safeParse:LAn};GTe.exports.parse=BAn;GTe.exports.safeParse=LAn;GTe.exports.defaultContentType=jY});var MQ=I(ig=>{"use strict";p();Object.defineProperty(ig,"__esModule",{value:!0});ig.MonotonousArray=void 0;ig.findLast=P6o;ig.findLastIdx=kyn;ig.findFirst=k6o;ig.findFirstIdx=Dyn;ig.findLastMonotonous=D6o;ig.findLastIdxMonotonous=wUt;ig.findFirstMonotonous=N6o;ig.findFirstIdxMonotonousOrArrLen=RUt;ig.findFirstIdxMonotonous=M6o;ig.findFirstMax=Nyn;ig.findLastMax=O6o;ig.findFirstMin=B6o;ig.findMaxIdx=L6o;ig.mapFindFirst=F6o;function P6o(t,e,r=t.length-1){let n=kyn(t,e,r);if(n!==-1)return t[n]}a(P6o,"findLast");function kyn(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(kyn,"findLastIdx");function k6o(t,e,r=0){let n=Dyn(t,e,r);if(n!==-1)return t[n]}a(k6o,"findFirst");function Dyn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(Nyn,"findFirstMax");function O6o(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(O6o,"findLastMax");function B6o(t,e){return Nyn(t,(r,n)=>-e(r,n))}a(B6o,"findFirstMin");function L6o(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(L6o,"findMaxIdx");function F6o(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(F6o,"mapFindFirst")});var Cs=I(xo=>{"use strict";p();Object.defineProperty(xo,"__esModule",{value:!0});xo.BugIndicatingError=xo.ErrorNoTelemetry=xo.ExpectedError=xo.NotSupportedError=xo.NotImplementedError=xo.ReadonlyError=xo.PendingMigrationError=xo.CancellationError=xo.canceledName=xo.errorHandler=xo.ErrorHandler=void 0;xo.setUnexpectedErrorHandler=U6o;xo.isSigPipeError=Q6o;xo.onBugIndicatingError=q6o;xo.onUnexpectedError=j6o;xo.onUnexpectedExternalError=H6o;xo.transformErrorForSerialization=Myn;xo.transformErrorFromSerialization=Oyn;xo.isCancellationError=BUt;xo.canceled=G6o;xo.illegalArgument=$6o;xo.illegalState=V6o;xo.getErrorMessage=W6o;var vYe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?VY.isErrorNoTelemetry(e)?new VY(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)}};Ro.ErrorHandler=lKe;Ro.errorHandler=new lKe;function $Qo(t){Ro.errorHandler.setUnexpectedErrorHandler(t)}a($Qo,"setUnexpectedErrorHandler");function VQo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(VQo,"isSigPipeError");function WQo(t){Ro.errorHandler.onUnexpectedError(t)}a(WQo,"onBugIndicatingError");function zQo(t){j7t(t)||Ro.errorHandler.onUnexpectedError(t)}a(zQo,"onUnexpectedError");function YQo(t){j7t(t)||Ro.errorHandler.onUnexpectedExternalError(t)}a(YQo,"onUnexpectedExternalError");function y_n(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:dK.isErrorNoTelemetry(t),cause:n?y_n(n):void 0,code:t.code}}return t}a(y_n,"transformErrorForSerialization");function E_n(t){let e;return t.noTelemetry?e=new dK:(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=E_n(t.cause)),e}a(E_n,"transformErrorFromSerialization");Ro.canceledName="Canceled";function j7t(t){return t instanceof uKe?!0:t instanceof Error&&t.name===Ro.canceledName&&t.message===Ro.canceledName}a(j7t,"isCancellationError");var uKe=class extends Error{static{a(this,"CancellationError")}constructor(){super(Ro.canceledName),this.name=this.message}};Ro.CancellationError=uKe;var B7t=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}};Ro.PendingMigrationError=B7t;function KQo(){let t=new Error(Ro.canceledName);return t.name=t.message,t}a(KQo,"canceled");function JQo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(JQo,"illegalArgument");function ZQo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(ZQo,"illegalState");var L7t=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};Ro.ReadonlyError=L7t;function XQo(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}a(XQo,"getErrorMessage");var F7t=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};Ro.NotImplementedError=F7t;var U7t=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};Ro.NotSupportedError=U7t;var Q7t=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};Ro.ExpectedError=Q7t;var dK=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"}};Ro.ErrorNoTelemetry=dK;var q7t=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};Ro.BugIndicatingError=q7t});var El=I($n=>{"use strict";p();Object.defineProperty($n,"__esModule",{value:!0});$n.Permutation=$n.CallbackIterable=$n.ArrayQueue=$n.booleanComparator=$n.numberComparator=$n.CompareResult=void 0;$n.tail=rqo;$n.equals=nqo;$n.removeFastWithoutKeepingOrder=iqo;$n.binarySearch=oqo;$n.binarySearch2=__n;$n.quickSelect=H7t;$n.groupBy=sqo;$n.groupAdjacentBy=aqo;$n.forEachAdjacent=cqo;$n.forEachWithNeighbors=lqo;$n.concatArrays=uqo;$n.sortedDiff=C_n;$n.delta=dqo;$n.top=fqo;$n.topAsync=pqo;$n.coalesce=hqo;$n.coalesceInPlace=mqo;$n.move=gqo;$n.isFalsyOrEmpty=Aqo;$n.isNonEmptyArray=yqo;$n.distinct=Eqo;$n.uniqueFilter=_qo;$n.commonPrefixLength=Cqo;$n.range=vqo;$n.index=bqo;$n.insert=Sqo;$n.remove=b_n;$n.arrayInsert=Tqo;$n.shuffle=Iqo;$n.pushToStart=xqo;$n.pushToEnd=wqo;$n.pushMany=Rqo;$n.mapArrayOrNot=kqo;$n.mapFilter=Pqo;$n.withoutDuplicates=Dqo;$n.asArray=Nqo;$n.getRandomElement=Mqo;$n.insertInto=S_n;$n.splice=Oqo;$n.compareBy=Bqo;$n.tieBreakComparators=Lqo;$n.reverseOrder=Qqo;$n.compareUndefinedSmallest=qqo;$n.findAsync=jqo;$n.sum=Hqo;$n.sumBy=Gqo;var eqo=ZQ(),tqo=Ts();function rqo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(rqo,"tail");function nqo(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(oqo,"binarySearch");function __n(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(__n,"binarySearch2");function H7t(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(C_n,"sortedDiff");function dqo(t,e,r){let n=C_n(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(dqo,"delta");function fqo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return v_n(t,e,n,r,t.length),n}a(fqo,"top");function pqo(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 tqo.CancellationError;v_n(t,e,u,d,f)}return u})().then(s,c)})}a(pqo,"topAsync");function v_n(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(v_n,"topStep");function hqo(t){return t.filter(e=>!!e)}a(hqo,"coalesce");function mqo(t){let e=0;for(let r=0;r0}a(yqo,"isNonEmptyArray");function Eqo(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(Eqo,"distinct");function _qo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(_qo,"uniqueFilter");function Cqo(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(vqo,"range");function bqo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(bqo,"index");function Sqo(t,e){return t.push(e),()=>b_n(t,e)}a(Sqo,"insert");function b_n(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(b_n,"remove");function Tqo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(Tqo,"arrayInsert");function Iqo(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(Iqo,"shuffle");function xqo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(xqo,"pushToStart");function wqo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(wqo,"pushToEnd");function Rqo(t,e){for(let r of e)t.push(r)}a(Rqo,"pushMany");function kqo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(kqo,"mapArrayOrNot");function Pqo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(Pqo,"mapFilter");function Dqo(t){let e=new Set(t);return Array.from(e)}a(Dqo,"withoutDuplicates");function Nqo(t){return Array.isArray(t)?t:[t]}a(Nqo,"asArray");function Mqo(t){return t[Math.floor(Math.random()*t.length)]}a(Mqo,"getRandomElement");function S_n(t,e,r){let n=T_n(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})(XQ||($n.CompareResult=XQ={}));function Bqo(t,e){return(r,n)=>e(t(r),t(n))}a(Bqo,"compareBy");function Lqo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!XQ.isNeitherLessOrGreaterThan(o))return o}return XQ.neitherLessOrGreaterThan}}a(Lqo,"tieBreakComparators");var Fqo=a((t,e)=>t-e,"numberComparator");$n.numberComparator=Fqo;var Uqo=a((t,e)=>(0,$n.numberComparator)(t?1:0,e?1:0),"booleanComparator");$n.booleanComparator=Uqo;function Qqo(t){return(e,r)=>-t(e,r)}a(Qqo,"reverseOrder");function qqo(t){return(e,r)=>e===void 0?r===void 0?XQ.neitherLessOrGreaterThan:XQ.lessThan:r===void 0?XQ.greaterThan:t(e,r)}a(qqo,"compareUndefinedSmallest");var G7t=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}};$n.ArrayQueue=G7t;var $7t=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||XQ.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};$n.CallbackIterable=$7t;var V7t=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(jqo,"findAsync");function Hqo(t){return t.reduce((e,r)=>e+r,0)}a(Hqo,"sum");function Gqo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(Gqo,"sumBy")});var Y7t=I(f3=>{"use strict";p();var x_n;Object.defineProperty(f3,"__esModule",{value:!0});f3.SetWithKey=void 0;f3.groupBy=Wqo;f3.groupByMap=zqo;f3.diffSets=Yqo;f3.diffMaps=Kqo;f3.intersection=Jqo;function Wqo(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(Wqo,"groupBy");function zqo(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(zqo,"groupByMap");function Yqo(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(Yqo,"diffSets");function Kqo(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(Kqo,"diffMaps");function Jqo(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(Jqo,"intersection");var z7t=class{static{a(this,"SetWithKey")}static{x_n=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[x_n]="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()}};f3.SetWithKey=z7t});var J7t=I(K7t=>{"use strict";p();Object.defineProperty(K7t,"__esModule",{value:!0});K7t.createSingleCallFunction=Zqo;function Zqo(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(Zqo,"createSingleCallFunction")});var bP=I(Dd=>{"use strict";p();var w_n,R_n,k_n;Object.defineProperty(Dd,"__esModule",{value:!0});Dd.NKeyMap=Dd.SetMap=Dd.BidirectionalMap=Dd.CounterSet=Dd.MRUCache=Dd.LRUCache=Dd.LinkedMap=Dd.ResourceSet=Dd.ResourceMap=void 0;Dd.getOrSet=Xqo;Dd.mapToString=ejo;Dd.setToString=tjo;Dd.mapsStrictEqualIgnoreOrder=njo;function Xqo(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(Xqo,"getOrSet");function ejo(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(ejo,"mapToString");function tjo(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(tjo,"setToString");var Z7t=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function rjo(t){return Array.isArray(t)}a(rjo,"isEntries");var DIe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[w_n]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(rjo(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 Z7t(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]}*[(w_n=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Dd.ResourceMap=DIe;var X7t=class{static{a(this,"ResourceSet")}constructor(e,r){this[R_n]="ResourceSet",!e||typeof e=="function"?this._map=new DIe(e):(this._map=new DIe(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()}[(R_n=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Dd.ResourceSet=X7t;var dKe=class{static{a(this,"LinkedMap")}constructor(){this[k_n]="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}[(k_n=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)}};Dd.LinkedMap=dKe;var fKe=class extends dKe{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))}},eQt=class extends fKe{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}};Dd.LRUCache=eQt;var tQt=class extends fKe{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}};Dd.MRUCache=tQt;var rQt=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)}};Dd.CounterSet=rQt;var nQt=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()}};Dd.BidirectionalMap=nQt;var iQt=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}};Dd.SetMap=iQt;function njo(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(njo,"mapsStrictEqualIgnoreOrder");var oQt=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)}};xo.ErrorHandler=vYe;xo.errorHandler=new vYe;function U6o(t){xo.errorHandler.setUnexpectedErrorHandler(t)}a(U6o,"setUnexpectedErrorHandler");function Q6o(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(Q6o,"isSigPipeError");function q6o(t){xo.errorHandler.onUnexpectedError(t)}a(q6o,"onBugIndicatingError");function j6o(t){BUt(t)||xo.errorHandler.onUnexpectedError(t)}a(j6o,"onUnexpectedError");function H6o(t){BUt(t)||xo.errorHandler.onUnexpectedExternalError(t)}a(H6o,"onUnexpectedExternalError");function Myn(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:VY.isErrorNoTelemetry(t),cause:n?Myn(n):void 0,code:t.code}}return t}a(Myn,"transformErrorForSerialization");function Oyn(t){let e;return t.noTelemetry?e=new VY:(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=Oyn(t.cause)),e}a(Oyn,"transformErrorFromSerialization");xo.canceledName="Canceled";function BUt(t){return t instanceof CYe?!0:t instanceof Error&&t.name===xo.canceledName&&t.message===xo.canceledName}a(BUt,"isCancellationError");var CYe=class extends Error{static{a(this,"CancellationError")}constructor(){super(xo.canceledName),this.name=this.message}};xo.CancellationError=CYe;var PUt=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}};xo.PendingMigrationError=PUt;function G6o(){let t=new Error(xo.canceledName);return t.name=t.message,t}a(G6o,"canceled");function $6o(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a($6o,"illegalArgument");function V6o(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(V6o,"illegalState");var kUt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};xo.ReadonlyError=kUt;function W6o(t){return t?t.message?t.message:t.stack?t.stack.split(` +`)[0]:String(t):"Error"}a(W6o,"getErrorMessage");var DUt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};xo.NotImplementedError=DUt;var NUt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};xo.NotSupportedError=NUt;var MUt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};xo.ExpectedError=MUt;var VY=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"}};xo.ErrorNoTelemetry=VY;var OUt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};xo.BugIndicatingError=OUt});var Al=I($n=>{"use strict";p();Object.defineProperty($n,"__esModule",{value:!0});$n.Permutation=$n.CallbackIterable=$n.ArrayQueue=$n.booleanComparator=$n.numberComparator=$n.CompareResult=void 0;$n.tail=K6o;$n.equals=J6o;$n.removeFastWithoutKeepingOrder=Z6o;$n.binarySearch=X6o;$n.binarySearch2=Byn;$n.quickSelect=LUt;$n.groupBy=e9o;$n.groupAdjacentBy=t9o;$n.forEachAdjacent=r9o;$n.forEachWithNeighbors=n9o;$n.concatArrays=i9o;$n.sortedDiff=Lyn;$n.delta=o9o;$n.top=s9o;$n.topAsync=a9o;$n.coalesce=c9o;$n.coalesceInPlace=l9o;$n.move=u9o;$n.isFalsyOrEmpty=d9o;$n.isNonEmptyArray=f9o;$n.distinct=p9o;$n.uniqueFilter=h9o;$n.commonPrefixLength=m9o;$n.range=g9o;$n.index=A9o;$n.insert=y9o;$n.remove=Uyn;$n.arrayInsert=E9o;$n.shuffle=_9o;$n.pushToStart=v9o;$n.pushToEnd=C9o;$n.pushMany=b9o;$n.mapArrayOrNot=S9o;$n.mapFilter=T9o;$n.withoutDuplicates=I9o;$n.asArray=x9o;$n.getRandomElement=w9o;$n.insertInto=Qyn;$n.splice=R9o;$n.compareBy=P9o;$n.tieBreakComparators=k9o;$n.reverseOrder=M9o;$n.compareUndefinedSmallest=O9o;$n.findAsync=B9o;$n.sum=L9o;$n.sumBy=F9o;var z6o=MQ(),Y6o=Cs();function K6o(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(K6o,"tail");function J6o(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(X6o,"binarySearch");function Byn(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(Byn,"binarySearch2");function LUt(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(Lyn,"sortedDiff");function o9o(t,e,r){let n=Lyn(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(o9o,"delta");function s9o(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return Fyn(t,e,n,r,t.length),n}a(s9o,"top");function a9o(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 Y6o.CancellationError;Fyn(t,e,u,d,f)}return u})().then(s,c)})}a(a9o,"topAsync");function Fyn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(Fyn,"topStep");function c9o(t){return t.filter(e=>!!e)}a(c9o,"coalesce");function l9o(t){let e=0;for(let r=0;r0}a(f9o,"isNonEmptyArray");function p9o(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(p9o,"distinct");function h9o(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(h9o,"uniqueFilter");function m9o(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(g9o,"range");function A9o(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(A9o,"index");function y9o(t,e){return t.push(e),()=>Uyn(t,e)}a(y9o,"insert");function Uyn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(Uyn,"remove");function E9o(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(E9o,"arrayInsert");function _9o(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(_9o,"shuffle");function v9o(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(v9o,"pushToStart");function C9o(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(C9o,"pushToEnd");function b9o(t,e){for(let r of e)t.push(r)}a(b9o,"pushMany");function S9o(t,e){return Array.isArray(t)?t.map(e):e(t)}a(S9o,"mapArrayOrNot");function T9o(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(T9o,"mapFilter");function I9o(t){let e=new Set(t);return Array.from(e)}a(I9o,"withoutDuplicates");function x9o(t){return Array.isArray(t)?t:[t]}a(x9o,"asArray");function w9o(t){return t[Math.floor(Math.random()*t.length)]}a(w9o,"getRandomElement");function Qyn(t,e,r){let n=qyn(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})(OQ||($n.CompareResult=OQ={}));function P9o(t,e){return(r,n)=>e(t(r),t(n))}a(P9o,"compareBy");function k9o(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!OQ.isNeitherLessOrGreaterThan(o))return o}return OQ.neitherLessOrGreaterThan}}a(k9o,"tieBreakComparators");var D9o=a((t,e)=>t-e,"numberComparator");$n.numberComparator=D9o;var N9o=a((t,e)=>(0,$n.numberComparator)(t?1:0,e?1:0),"booleanComparator");$n.booleanComparator=N9o;function M9o(t){return(e,r)=>-t(e,r)}a(M9o,"reverseOrder");function O9o(t){return(e,r)=>e===void 0?r===void 0?OQ.neitherLessOrGreaterThan:OQ.lessThan:r===void 0?OQ.greaterThan:t(e,r)}a(O9o,"compareUndefinedSmallest");var FUt=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}};$n.ArrayQueue=FUt;var UUt=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||OQ.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};$n.CallbackIterable=UUt;var QUt=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(B9o,"findAsync");function L9o(t){return t.reduce((e,r)=>e+r,0)}a(L9o,"sum");function F9o(t,e){return t.reduce((r,n)=>r+e(n),0)}a(F9o,"sumBy")});var HUt=I(ZL=>{"use strict";p();var Hyn;Object.defineProperty(ZL,"__esModule",{value:!0});ZL.SetWithKey=void 0;ZL.groupBy=q9o;ZL.groupByMap=j9o;ZL.diffSets=H9o;ZL.diffMaps=G9o;ZL.intersection=$9o;function q9o(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(q9o,"groupBy");function j9o(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(j9o,"groupByMap");function H9o(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(H9o,"diffSets");function G9o(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(G9o,"diffMaps");function $9o(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a($9o,"intersection");var jUt=class{static{a(this,"SetWithKey")}static{Hyn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[Hyn]="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()}};ZL.SetWithKey=jUt});var $Ut=I(GUt=>{"use strict";p();Object.defineProperty(GUt,"__esModule",{value:!0});GUt.createSingleCallFunction=V9o;function V9o(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(V9o,"createSingleCallFunction")});var gk=I(Pd=>{"use strict";p();var Gyn,$yn,Vyn;Object.defineProperty(Pd,"__esModule",{value:!0});Pd.NKeyMap=Pd.SetMap=Pd.BidirectionalMap=Pd.CounterSet=Pd.MRUCache=Pd.LRUCache=Pd.LinkedMap=Pd.ResourceSet=Pd.ResourceMap=void 0;Pd.getOrSet=W9o;Pd.mapToString=z9o;Pd.setToString=Y9o;Pd.mapsStrictEqualIgnoreOrder=J9o;function W9o(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(W9o,"getOrSet");function z9o(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(z9o,"mapToString");function Y9o(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(Y9o,"setToString");var VUt=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function K9o(t){return Array.isArray(t)}a(K9o,"isEntries");var rIe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[Gyn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(K9o(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 VUt(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]}*[(Gyn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Pd.ResourceMap=rIe;var WUt=class{static{a(this,"ResourceSet")}constructor(e,r){this[$yn]="ResourceSet",!e||typeof e=="function"?this._map=new rIe(e):(this._map=new rIe(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()}[($yn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Pd.ResourceSet=WUt;var bYe=class{static{a(this,"LinkedMap")}constructor(){this[Vyn]="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}[(Vyn=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)}};Pd.LinkedMap=bYe;var SYe=class extends bYe{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))}},zUt=class extends SYe{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}};Pd.LRUCache=zUt;var YUt=class extends SYe{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}};Pd.MRUCache=YUt;var KUt=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)}};Pd.CounterSet=KUt;var JUt=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()}};Pd.BidirectionalMap=JUt;var ZUt=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}};Pd.SetMap=ZUt;function J9o(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(J9o,"mapsStrictEqualIgnoreOrder");var XUt=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)}};Dd.NKeyMap=oQt});var Yu=I(p3=>{"use strict";p();Object.defineProperty(p3,"__esModule",{value:!0});p3.ok=ijo;p3.assertNever=ojo;p3.softAssertNever=sjo;p3.assert=ajo;p3.softAssert=cjo;p3.assertFn=ljo;p3.checkAdjacentItems=ujo;var NIe=Ts();function ijo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(ijo,"ok");function ojo(t,e="Unreachable"){throw new Error(e)}a(ojo,"assertNever");function sjo(t){}a(sjo,"softAssertNever");function ajo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new NIe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(ajo,"assert");function cjo(t,e="Soft Assertion Failed"){t||(0,NIe.onUnexpectedError)(new NIe.BugIndicatingError(e))}a(cjo,"softAssert");function ljo(t){if(!t()){debugger;t(),(0,NIe.onUnexpectedError)(new NIe.BugIndicatingError("Assertion Failed"))}}a(ljo,"assertFn");function ujo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(_l,"__esModule",{value:!0});_l.isOneOf=void 0;_l.isString=sQt;_l.isStringArray=fjo;_l.isArrayOf=P_n;_l.isObject=D_n;_l.isTypedArray=pjo;_l.isNumber=hjo;_l.isIterable=mjo;_l.isAsyncIterable=gjo;_l.isBoolean=Ajo;_l.isUndefined=N_n;_l.isDefined=yjo;_l.isUndefinedOrNull=pKe;_l.assertType=Ejo;_l.assertReturnsDefined=_jo;_l.assertDefined=Cjo;_l.assertReturnsAllDefined=vjo;_l.typeCheck=Sjo;_l.isEmptyObject=Ijo;_l.isFunction=aQt;_l.areFunctions=xjo;_l.validateConstraints=wjo;_l.validateConstraint=M_n;_l.upcast=Rjo;_l.hasKey=kjo;var djo=Yu();function sQt(t){return typeof t=="string"}a(sQt,"isString");function fjo(t){return P_n(t,sQt)}a(fjo,"isStringArray");function P_n(t,e){return Array.isArray(t)&&t.every(e)}a(P_n,"isArrayOf");function D_n(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(D_n,"isObject");function pjo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(pjo,"isTypedArray");function hjo(t){return typeof t=="number"&&!isNaN(t)}a(hjo,"isNumber");function mjo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(mjo,"isIterable");function gjo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(gjo,"isAsyncIterable");function Ajo(t){return t===!0||t===!1}a(Ajo,"isBoolean");function N_n(t){return typeof t>"u"}a(N_n,"isUndefined");function yjo(t){return!pKe(t)}a(yjo,"isDefined");function pKe(t){return N_n(t)||t===null}a(pKe,"isUndefinedOrNull");function Ejo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(Ejo,"assertType");function _jo(t){return(0,djo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(_jo,"assertReturnsDefined");function Cjo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(Cjo,"assertDefined");function vjo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");_l.isOneOf=bjo;function Sjo(t){}a(Sjo,"typeCheck");var Tjo=Object.prototype.hasOwnProperty;function Ijo(t){if(!D_n(t))return!1;for(let e in t)if(Tjo.call(t,e))return!1;return!0}a(Ijo,"isEmptyObject");function aQt(t){return typeof t=="function"}a(aQt,"isFunction");function xjo(...t){return t.length>0&&t.every(aQt)}a(xjo,"areFunctions");function wjo(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(hKe,"__esModule",{value:!0});hKe.Iterable=void 0;var Pjo=BS(),O_n;(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 k=x.length-1;k>=0;k--)yield x[k]}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,k){let D=0;for(let N of x)if(k(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,k){let D=0;for(let N of x)if(!k(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,k){for(let D of x)if(k(D))return D}a(m,"find"),t.find=m;function*g(x,k){for(let D of x)k(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,k){let D=0;for(let N of x)yield k(N,D++)}a(A,"map"),t.map=A;function*y(x,k){let D=0;for(let N of x)yield*k(N,D++)}a(y,"flatMap"),t.flatMap=y;function*E(...x){for(let k of x)(0,Pjo.isIterable)(k)?yield*k:yield k}a(E,"concat"),t.concat=E;function _(x,k,D){let N=D;for(let L of x)N=k(N,L);return N}a(_,"reduce"),t.reduce=_;function v(x){let k=0;for(let D of x)k++;return k}a(v,"length"),t.length=v;function*b(x,k,D=x.length){for(k<-x.length&&(k=0),k<0&&(k+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);k{"use strict";p();Object.defineProperty(cs,"__esModule",{value:!0});cs.DisposableResourceMap=cs.DisposableSet=cs.DisposableMap=cs.ImmortalReference=cs.AsyncReferenceCollection=cs.ReferenceCollection=cs.RefCountedDisposable=cs.MandatoryMutableDisposable=cs.MutableDisposable=cs.Disposable=cs.DisposableStore=cs.DisposableTracker=cs.GCBasedDisposableTracker=void 0;cs.setDisposableTracker=U_n;cs.trackDisposable=pK;cs.markAsDisposed=hK;cs.markAsSingleton=Ljo;cs.isDisposable=Q_n;cs.dispose=OIe;cs.disposeIfDisposable=Fjo;cs.combinedDisposable=Ujo;cs.toDisposable=EQt;cs.disposeOnReturn=Qjo;cs.thenIfNotDisposed=qjo;cs.thenRegisterOrDispose=jjo;var B_n=El(),Djo=Y7t(),F_n=bP(),Njo=J7t(),Mjo=cQt(),L_n=Ts(),Ojo=!1,fK=null,lQt=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)}};cs.GCBasedDisposableTracker=lQt;var uQt=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 F_n.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,B_n.compareBy)(u=>u.idx,B_n.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(XL,"__esModule",{value:!0});XL.ok=Z9o;XL.assertNever=X9o;XL.softAssertNever=eUo;XL.assert=tUo;XL.softAssert=rUo;XL.assertFn=nUo;XL.checkAdjacentItems=iUo;var nIe=Cs();function Z9o(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(Z9o,"ok");function X9o(t,e="Unreachable"){throw new Error(e)}a(X9o,"assertNever");function eUo(t){}a(eUo,"softAssertNever");function tUo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new nIe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(tUo,"assert");function rUo(t,e="Soft Assertion Failed"){t||(0,nIe.onUnexpectedError)(new nIe.BugIndicatingError(e))}a(rUo,"softAssert");function nUo(t){if(!t()){debugger;t(),(0,nIe.onUnexpectedError)(new nIe.BugIndicatingError("Assertion Failed"))}}a(nUo,"assertFn");function iUo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(yl,"__esModule",{value:!0});yl.isOneOf=void 0;yl.isString=e7t;yl.isStringArray=sUo;yl.isArrayOf=Wyn;yl.isObject=zyn;yl.isTypedArray=aUo;yl.isNumber=cUo;yl.isIterable=lUo;yl.isAsyncIterable=uUo;yl.isBoolean=dUo;yl.isUndefined=Yyn;yl.isDefined=fUo;yl.isUndefinedOrNull=TYe;yl.assertType=pUo;yl.assertReturnsDefined=hUo;yl.assertDefined=mUo;yl.assertReturnsAllDefined=gUo;yl.typeCheck=yUo;yl.isEmptyObject=_Uo;yl.isFunction=t7t;yl.areFunctions=vUo;yl.validateConstraints=CUo;yl.validateConstraint=Kyn;yl.upcast=bUo;yl.hasKey=SUo;var oUo=Yu();function e7t(t){return typeof t=="string"}a(e7t,"isString");function sUo(t){return Wyn(t,e7t)}a(sUo,"isStringArray");function Wyn(t,e){return Array.isArray(t)&&t.every(e)}a(Wyn,"isArrayOf");function zyn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(zyn,"isObject");function aUo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(aUo,"isTypedArray");function cUo(t){return typeof t=="number"&&!isNaN(t)}a(cUo,"isNumber");function lUo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(lUo,"isIterable");function uUo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(uUo,"isAsyncIterable");function dUo(t){return t===!0||t===!1}a(dUo,"isBoolean");function Yyn(t){return typeof t>"u"}a(Yyn,"isUndefined");function fUo(t){return!TYe(t)}a(fUo,"isDefined");function TYe(t){return Yyn(t)||t===null}a(TYe,"isUndefinedOrNull");function pUo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(pUo,"assertType");function hUo(t){return(0,oUo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(hUo,"assertReturnsDefined");function mUo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(mUo,"assertDefined");function gUo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");yl.isOneOf=AUo;function yUo(t){}a(yUo,"typeCheck");var EUo=Object.prototype.hasOwnProperty;function _Uo(t){if(!zyn(t))return!1;for(let e in t)if(EUo.call(t,e))return!1;return!0}a(_Uo,"isEmptyObject");function t7t(t){return typeof t=="function"}a(t7t,"isFunction");function vUo(...t){return t.length>0&&t.every(t7t)}a(vUo,"areFunctions");function CUo(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(IYe,"__esModule",{value:!0});IYe.Iterable=void 0;var TUo=RS(),Jyn;(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,TUo.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(ss,"__esModule",{value:!0});ss.DisposableResourceMap=ss.DisposableSet=ss.DisposableMap=ss.ImmortalReference=ss.AsyncReferenceCollection=ss.ReferenceCollection=ss.RefCountedDisposable=ss.MandatoryMutableDisposable=ss.MutableDisposable=ss.Disposable=ss.DisposableStore=ss.DisposableTracker=ss.GCBasedDisposableTracker=void 0;ss.setDisposableTracker=tEn;ss.trackDisposable=zY;ss.markAsDisposed=YY;ss.markAsSingleton=kUo;ss.isDisposable=rEn;ss.dispose=oIe;ss.disposeIfDisposable=DUo;ss.combinedDisposable=NUo;ss.toDisposable=p7t;ss.disposeOnReturn=MUo;ss.thenIfNotDisposed=OUo;ss.thenRegisterOrDispose=BUo;var Zyn=Al(),IUo=HUt(),eEn=gk(),xUo=$Ut(),wUo=r7t(),Xyn=Cs(),RUo=!1,WY=null,n7t=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)}};ss.GCBasedDisposableTracker=n7t;var i7t=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 eEn.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,Zyn.compareBy)(u=>u.idx,Zyn.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,IUo.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} ==================== @@ -146,129 +102,129 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};cs.DisposableTracker=uQt;function U_n(t){fK=t}a(U_n,"setDisposableTracker");if(Ojo){let t="__is_disposable_tracked__";U_n(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!==yle.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==yle.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function pK(t){return fK?.trackDisposable(t),t}a(pK,"trackDisposable");function hK(t){fK?.markAsDisposed(t)}a(hK,"markAsDisposed");function h3(t,e){fK?.setParent(t,e)}a(h3,"setParentOfDisposable");function Bjo(t,e){if(fK)for(let r of t)fK.setParent(r,e)}a(Bjo,"setParentOfDisposables");function Ljo(t){return fK?.markAsSingleton(t),t}a(Ljo,"markAsSingleton");function Q_n(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(Q_n,"isDisposable");function OIe(t){if(Mjo.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(OIe,"dispose");function Fjo(t){for(let e of t)Q_n(e)&&e.dispose();return[]}a(Fjo,"disposeIfDisposable");function Ujo(...t){let e=EQt(()=>OIe(t));return Bjo(t,e),e}a(Ujo,"combinedDisposable");var dQt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,pK(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,hK(this),this._fn()}}};function EQt(t){return new dQt(t)}a(EQt,"toDisposable");var MIe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,pK(this)}dispose(){this._isDisposed||(hK(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{OIe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===yle.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return h3(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)&&h3(e,null)}assertNotDisposed(){this._isDisposed&&(0,L_n.onUnexpectedError)(new L_n.BugIndicatingError("Object disposed"))}};cs.DisposableStore=MIe;var yle=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new MIe,pK(this),h3(this._store,this)}dispose(){hK(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};cs.Disposable=yle;var mKe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,pK(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&h3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,hK(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&h3(e,null),e}};cs.MutableDisposable=mKe;var fQt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new mKe,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()}};cs.MandatoryMutableDisposable=fQt;var pQt=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}};cs.RefCountedDisposable=pQt;var hQt=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,Njo.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};cs.ReferenceCollection=hQt;var mQt=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}}};cs.AsyncReferenceCollection=mQt;var gQt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};cs.ImmortalReference=gQt;function Qjo(t){let e=new MIe;try{t(e)}finally{e.dispose()}}a(Qjo,"disposeOnReturn");var gKe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,pK(this)}dispose(){hK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{OIe(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),h3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&h3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};cs.DisposableMap=gKe;var AQt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,pK(this)}dispose(){hK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{OIe(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),h3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return h3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};cs.DisposableSet=AQt;function qjo(t,e){let r=!1;return t.then(n=>{r||e(n)}),EQt(()=>{r=!0})}a(qjo,"thenIfNotDisposed");function jjo(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(jjo,"thenRegisterOrDispose");var yQt=class extends gKe{static{a(this,"DisposableResourceMap")}constructor(){super(new F_n.ResourceMap)}};cs.DisposableResourceMap=yQt});var Ele=I(AKe=>{"use strict";p();Object.defineProperty(AKe,"__esModule",{value:!0});AKe.LinkedList=void 0;var du=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}},_Qt=class{static{a(this,"LinkedList")}constructor(){this._first=du.Undefined,this._last=du.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===du.Undefined}clear(){let e=this._first;for(;e!==du.Undefined;){let r=e.next;e.prev=du.Undefined,e.next=du.Undefined,e=r}this._first=du.Undefined,this._last=du.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new du(e);if(this._first===du.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!==du.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==du.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==du.Undefined)return this._last.element}_remove(e){if(e.prev!==du.Undefined&&e.next!==du.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===du.Undefined&&e.next===du.Undefined?(this._first=du.Undefined,this._last=du.Undefined):e.next===du.Undefined?(this._last=this._last.prev,this._last.next=du.Undefined):e.prev===du.Undefined&&(this._first=this._first.next,this._first.prev=du.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==du.Undefined;)yield e.element,e=e.next}};AKe.LinkedList=_Qt});var G_n=I(_le=>{"use strict";p();Object.defineProperty(_le,"__esModule",{value:!0});_le.getNLSMessages=q_n;_le.getNLSLanguage=j_n;_le.localize=Gjo;_le.localize2=$jo;function q_n(){return globalThis._VSCODE_NLS_MESSAGES}a(q_n,"getNLSMessages");function j_n(){return globalThis._VSCODE_NLS_LANGUAGE}a(j_n,"getNLSLanguage");var Hjo=j_n()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function yKe(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}),Hjo&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(yKe,"_format");function Gjo(t,e,...r){return yKe(typeof t=="number"?H_n(t,e):e,r)}a(Gjo,"localize");function H_n(t,e){let r=q_n()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(H_n,"lookupMessage");function $jo(t,e,...r){let n;typeof t=="number"?n=H_n(t,e):n=e;let o=yKe(n,r);return{value:o,original:e===n?o:yKe(e,r)}}a($jo,"localize2")});var eq=I(fr=>{"use strict";p();var Vjo=fr&&fr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wjo=fr&&fr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zjo=fr&&fr.__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,UIe=m3.indexOf("Macintosh")>=0,bQt=(m3.indexOf("Macintosh")>=0||m3.indexOf("iPad")>=0||m3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,LIe=m3.indexOf("Linux")>=0,Z_n=m3?.indexOf("Mobi")>=0,vQt=!0,EKe=Yjo.getNLSLanguage()||fr.LANGUAGE_DEFAULT,BIe=navigator.language.toLowerCase(),CQt=BIe):console.error("Unable to resolve platform.");function Jjo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(Jjo,"PlatformToString");var _Ke=0;UIe?_Ke=1:FIe?_Ke=3:LIe&&(_Ke=2);fr.isWindows=FIe;fr.isMacintosh=UIe;fr.isLinux=LIe;fr.isLinuxSnap=z_n;fr.isNative=Y_n;fr.isElectron=K_n;fr.isWeb=vQt;fr.isWebWorker=vQt&&typeof g3.importScripts=="function";fr.webWorkerOrigin=fr.isWebWorker?g3.origin:void 0;fr.isIOS=bQt;fr.isMobile=Z_n;fr.isCI=J_n;fr.platform=_Ke;fr.userAgent=m3;fr.language=EKe;var $_n;(function(t){function e(){return fr.language}a(e,"value"),t.value=e;function r(){return fr.language.length===2?fr.language==="en":fr.language.length>=3?fr.language[0]==="e"&&fr.language[1]==="n"&&fr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return fr.language==="en"}a(n,"isDefault"),t.isDefault=n})($_n||(fr.Language=$_n={}));fr.locale=BIe;fr.platformLocale=CQt;fr.translationsConfigFile=X_n;fr.setTimeout0IsFaster=typeof g3.postMessage=="function"&&!g3.importScripts;fr.setTimeout0=(()=>{if(fr.setTimeout0IsFaster){let t=[];g3.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}),g3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();fr.OS=UIe||bQt?2:FIe?1:3;var V_n=!0,W_n=!1;function Zjo(){if(!W_n){W_n=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,V_n=new Uint16Array(t.buffer)[0]===513}return V_n}a(Zjo,"isLittleEndian");fr.isChrome=!!(fr.userAgent&&fr.userAgent.indexOf("Chrome")>=0);fr.isFirefox=!!(fr.userAgent&&fr.userAgent.indexOf("Firefox")>=0);fr.isSafari=!!(!fr.isChrome&&fr.userAgent&&fr.userAgent.indexOf("Safari")>=0);fr.isEdge=!!(fr.userAgent&&fr.userAgent.indexOf("Edg/")>=0);fr.isAndroid=!!(fr.userAgent&&fr.userAgent.indexOf("Android")>=0);function Xjo(t){return parseFloat(t)>=25}a(Xjo,"isTahoeOrNewer")});var QIe=I(aO=>{"use strict";p();Object.defineProperty(aO,"__esModule",{value:!0});aO.arch=aO.platform=aO.env=aO.cwd=void 0;var tCn=eq(),mK,SQt=globalThis.vscode;if(typeof SQt<"u"&&typeof SQt.process<"u"){let t=SQt.process;mK={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"?mK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:mK={get platform(){return tCn.isWindows?"win32":tCn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};aO.cwd=mK.cwd;aO.env=mK.env;aO.platform=mK.platform;aO.arch=mK.arch});var cO=I(CKe=>{"use strict";p();Object.defineProperty(CKe,"__esModule",{value:!0});CKe.StopWatch=void 0;var eHo=globalThis.performance.now.bind(globalThis.performance),TQt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:eHo,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}};CKe.StopWatch=TQt});var Sc=I(ja=>{"use strict";p();Object.defineProperty(ja,"__esModule",{value:!0});ja.ValueWithChangeEvent=ja.Relay=ja.EventBufferer=ja.DynamicListEventMultiplexer=ja.EventMultiplexer=ja.MicrotaskEmitter=ja.DebounceEmitter=ja.PauseableEmitter=ja.AsyncEmitter=ja.createEventDeliveryQueue=ja.Emitter=ja.ListenerRefusalError=ja.ListenerLeakError=ja.EventProfiling=ja.Event=void 0;ja.setGlobalLeakWarningThreshold=aHo;ja.trackSetChanges=dHo;var tHo=Y7t(),qIe=Ts(),rHo=J7t(),Nv=ko(),sCn=Ele(),nHo=QIe(),iHo=cO(),rCn=!1,oHo=!1,sHo=100,nCn=6e4;function iCn(){return!!nHo.env.VSCODE_DEV}a(iCn,"_isBufferLeakWarningEnabled");var vKe;(function(t){t.None=()=>Nv.Disposable.None;function e(M){if(oHo){let{onDidAddListener:O}=M,q=vle.create(),F=0;M.onDidAddListener=()=>{++F===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),q.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,q){return g(M,()=>{},0,void 0,O??!0,void 0,q)}a(r,"defer"),t.defer=r;function n(M){return(O,q=null,F)=>{let U=!1,W;return W=M(V=>{if(!U)return W?W.dispose():U=!0,O.call(q,V)},null,F),U&&W.dispose(),W}}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,q){return h((F,U=null,W)=>M(V=>F.call(U,O(V)),null,W),q)}a(s,"map"),t.map=s;function c(M,O,q){return h((F,U=null,W)=>M(V=>{O(V),F.call(U,V)},null,W),q)}a(c,"forEach"),t.forEach=c;function l(M,O,q){return h((F,U=null,W)=>M(V=>O(V)&&F.call(U,V),null,W),q)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,q=null,F)=>{let U=(0,Nv.combinedDisposable)(...M.map(W=>W(V=>O.call(q,V))));return m(U,F)}}a(d,"any"),t.any=d;function f(M,O,q,F){let U=q;return s(M,W=>(U=O(U,W),U),F)}a(f,"reduce"),t.reduce=f;function h(M,O){let q,F={onWillAddFirstListener(){q=M(U.fire,U)},onDidRemoveLastListener(){q?.dispose()}};O||e(F);let U=new Yy(F);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,q=100,F=!1,U=!1,W,V){let G,Y,re,j=0,X,ie={leakWarningThreshold:W,onWillAddFirstListener(){G=M(Ae=>{j++,Y=O(Y,Ae),F&&!re&&(we.fire(Y),Y=void 0),X=a(()=>{let De=Y;Y=void 0,re=void 0,(!F||j>1)&&we.fire(De),j=0},"doFire"),typeof q=="number"?(re&&clearTimeout(re),re=setTimeout(X,q)):re===void 0&&(re=null,queueMicrotask(X))})},onWillRemoveListener(){U&&j>0&&X?.()},onDidRemoveLastListener(){X=void 0,G.dispose()}};V||e(ie);let we=new Yy(ie);return V?.add(we),we.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,q,F){return t.debounce(M,(U,W)=>U?(U.push(W),U):[W],O,void 0,q??!0,void 0,F)}a(A,"accumulate"),t.accumulate=A;function y(M,O,q=100,F=!0,U=!0,W,V){let G,Y,re,j=0,X={leakWarningThreshold:W,onWillAddFirstListener(){G=M(we=>{j++,Y=O(Y,we),re===void 0&&(F&&(ie.fire(Y),Y=void 0,j=0),typeof q=="number"?re=setTimeout(()=>{U&&j>0&&ie.fire(Y),Y=void 0,re=void 0,j=0},q):(re=0,queueMicrotask(()=>{U&&j>0&&ie.fire(Y),Y=void 0,re=void 0,j=0})))})},onDidRemoveLastListener(){G.dispose()}};V||e(X);let ie=new Yy(X);return V?.add(ie),ie.event}a(y,"throttle"),t.throttle=y;function E(M,O=(F,U)=>F===U,q){let F=!0,U;return l(M,W=>{let V=F||!O(W,U);return F=!1,U=W,V},q)}a(E,"latch"),t.latch=E;function _(M,O,q){return[t.filter(M,O,q),t.filter(M,F=>!O(F),q)]}a(_,"split"),t.split=_;function v(M,O,q=!1,F=[],U){let W=F.slice(),V;iCn()&&(V={stack:vle.create(),timerId:setTimeout(()=>{W&&W.length>0&&V&&!V.warned&&(V.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${W.length} events buffered for ${nCn/1e3}s without being consumed. Buffered here:`),V.stack.print())},nCn),warned:!1},U&&U.add((0,Nv.toDisposable)(()=>clearTimeout(V.timerId))));let G=a(()=>{V&&clearTimeout(V.timerId)},"clearLeakWarningTimer"),Y=M(X=>{W?(W.push(X),iCn()&&V&&!V.warned&&W.length>=sHo&&(V.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${W.length} events buffered without being consumed. Buffered here:`),V.stack.print())):j.fire(X)});U&&U.add(Y);let re=a(()=>{W?.forEach(X=>j.fire(X)),W=null,G()},"flush"),j=new Yy({onWillAddFirstListener(){Y||(Y=M(X=>j.fire(X)),U&&U.add(Y))},onDidAddFirstListener(){W&&(q?setTimeout(re):re())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null,G()}});return U&&U.add(j),j.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((F,U,W)=>{let V=O(new w);return M(function(G){let Y=V.evaluate(G);Y!==T&&F.call(U,Y)},void 0,W)},"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(q=>(O(q),q)),this}filter(O){return this.steps.push(q=>O(q)?q:T),this}reduce(O,q){let F=q;return this.steps.push(U=>(F=O(F,U),F)),this}latch(O=(q,F)=>q===F){let q=!0,F;return this.steps.push(U=>{let W=q||!O(U,F);return q=!1,F=U,W?U:T}),this}evaluate(O){for(let q of this.steps)if(O=q(O),O===T)break;return O}}function R(M,O,q=F=>F){let F=a((...G)=>V.fire(q(...G)),"fn"),U=a(()=>M.on(O,F),"onFirstListenerAdd"),W=a(()=>M.removeListener(O,F),"onLastListenerRemove"),V=new Yy({onWillAddFirstListener:U,onDidRemoveLastListener:W});return V.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,q=F=>F){let F=a((...G)=>V.fire(q(...G)),"fn"),U=a(()=>M.addEventListener(O,F),"onFirstListenerAdd"),W=a(()=>M.removeEventListener(O,F),"onLastListenerRemove"),V=new Yy({onWillAddFirstListener:U,onDidRemoveLastListener:W});return V.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function k(M,O){let q,F,U=new Promise(W=>{F=n(M)(W),OQt(F,O),q=a(()=>{oCn(F,O)},"cancelRef")});return U.cancel=q,O&&U.finally(()=>oCn(F,O)),U}a(k,"toPromise"),t.toPromise=k;function D(M,O){return M(q=>O.fire(q))}a(D,"forward"),t.forward=D;function N(M,O,q){return O(q),M(F=>O(F))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,q){this._observable=O,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};q||e(F),this.emitter=new Yy(F),q&&q.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,q){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,q,F)=>{let U=0,W=!1,V={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),W&&(W=!1,O.call(q)))},handlePossibleChange(){},handleChange(){W=!0}};M.addObserver(V),M.reportChanges();let G={dispose(){M.removeObserver(V)}};return OQt(G,F),G}}a(Q,"fromObservableLight"),t.fromObservableLight=Q})(vKe||(ja.Event=vKe={}));var bKe=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 iHo.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}}};ja.EventProfiling=bKe;var jIe=-1;function aHo(t){let e=jIe;return jIe=t,{dispose(){jIe=e}}}a(aHo,"setGlobalLeakWarningThreshold");var IQt=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 HIe(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!==Yce.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==Yce.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function zY(t){return WY?.trackDisposable(t),t}a(zY,"trackDisposable");function YY(t){WY?.markAsDisposed(t)}a(YY,"markAsDisposed");function e3(t,e){WY?.setParent(t,e)}a(e3,"setParentOfDisposable");function PUo(t,e){if(WY)for(let r of t)WY.setParent(r,e)}a(PUo,"setParentOfDisposables");function kUo(t){return WY?.markAsSingleton(t),t}a(kUo,"markAsSingleton");function rEn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(rEn,"isDisposable");function oIe(t){if(wUo.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(oIe,"dispose");function DUo(t){for(let e of t)rEn(e)&&e.dispose();return[]}a(DUo,"disposeIfDisposable");function NUo(...t){let e=p7t(()=>oIe(t));return PUo(t,e),e}a(NUo,"combinedDisposable");var o7t=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,zY(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,YY(this),this._fn()}}};function p7t(t){return new o7t(t)}a(p7t,"toDisposable");var iIe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,zY(this)}dispose(){this._isDisposed||(YY(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{oIe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Yce.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return e3(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)&&e3(e,null)}assertNotDisposed(){this._isDisposed&&(0,Xyn.onUnexpectedError)(new Xyn.BugIndicatingError("Object disposed"))}};ss.DisposableStore=iIe;var Yce=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new iIe,zY(this),e3(this._store,this)}dispose(){YY(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};ss.Disposable=Yce;var xYe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,zY(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&e3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,YY(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&e3(e,null),e}};ss.MutableDisposable=xYe;var s7t=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new xYe,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()}};ss.MandatoryMutableDisposable=s7t;var a7t=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}};ss.RefCountedDisposable=a7t;var c7t=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,xUo.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};ss.ReferenceCollection=c7t;var l7t=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}}};ss.AsyncReferenceCollection=l7t;var u7t=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};ss.ImmortalReference=u7t;function MUo(t){let e=new iIe;try{t(e)}finally{e.dispose()}}a(MUo,"disposeOnReturn");var wYe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,zY(this)}dispose(){YY(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{oIe(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),e3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&e3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};ss.DisposableMap=wYe;var d7t=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,zY(this)}dispose(){YY(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{oIe(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),e3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return e3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};ss.DisposableSet=d7t;function OUo(t,e){let r=!1;return t.then(n=>{r||e(n)}),p7t(()=>{r=!0})}a(OUo,"thenIfNotDisposed");function BUo(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(BUo,"thenRegisterOrDispose");var f7t=class extends wYe{static{a(this,"DisposableResourceMap")}constructor(){super(new eEn.ResourceMap)}};ss.DisposableResourceMap=f7t});var Kce=I(RYe=>{"use strict";p();Object.defineProperty(RYe,"__esModule",{value:!0});RYe.LinkedList=void 0;var uu=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}},h7t=class{static{a(this,"LinkedList")}constructor(){this._first=uu.Undefined,this._last=uu.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===uu.Undefined}clear(){let e=this._first;for(;e!==uu.Undefined;){let r=e.next;e.prev=uu.Undefined,e.next=uu.Undefined,e=r}this._first=uu.Undefined,this._last=uu.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new uu(e);if(this._first===uu.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!==uu.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==uu.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==uu.Undefined)return this._last.element}_remove(e){if(e.prev!==uu.Undefined&&e.next!==uu.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===uu.Undefined&&e.next===uu.Undefined?(this._first=uu.Undefined,this._last=uu.Undefined):e.next===uu.Undefined?(this._last=this._last.prev,this._last.next=uu.Undefined):e.prev===uu.Undefined&&(this._first=this._first.next,this._first.prev=uu.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==uu.Undefined;)yield e.element,e=e.next}};RYe.LinkedList=h7t});var sEn=I(Jce=>{"use strict";p();Object.defineProperty(Jce,"__esModule",{value:!0});Jce.getNLSMessages=nEn;Jce.getNLSLanguage=iEn;Jce.localize=FUo;Jce.localize2=UUo;function nEn(){return globalThis._VSCODE_NLS_MESSAGES}a(nEn,"getNLSMessages");function iEn(){return globalThis._VSCODE_NLS_LANGUAGE}a(iEn,"getNLSLanguage");var LUo=iEn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function PYe(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}),LUo&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(PYe,"_format");function FUo(t,e,...r){return PYe(typeof t=="number"?oEn(t,e):e,r)}a(FUo,"localize");function oEn(t,e){let r=nEn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(oEn,"lookupMessage");function UUo(t,e,...r){let n;typeof t=="number"?n=oEn(t,e):n=e;let o=PYe(n,r);return{value:o,original:e===n?o:PYe(e,r)}}a(UUo,"localize2")});var BQ=I(pr=>{"use strict";p();var QUo=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]})),qUo=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jUo=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,lIe=t3.indexOf("Macintosh")>=0,A7t=(t3.indexOf("Macintosh")>=0||t3.indexOf("iPad")>=0||t3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,aIe=t3.indexOf("Linux")>=0,hEn=t3?.indexOf("Mobi")>=0,g7t=!0,kYe=HUo.getNLSLanguage()||pr.LANGUAGE_DEFAULT,sIe=navigator.language.toLowerCase(),m7t=sIe):console.error("Unable to resolve platform.");function $Uo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a($Uo,"PlatformToString");var DYe=0;lIe?DYe=1:cIe?DYe=3:aIe&&(DYe=2);pr.isWindows=cIe;pr.isMacintosh=lIe;pr.isLinux=aIe;pr.isLinuxSnap=uEn;pr.isNative=dEn;pr.isElectron=fEn;pr.isWeb=g7t;pr.isWebWorker=g7t&&typeof r3.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?r3.origin:void 0;pr.isIOS=A7t;pr.isMobile=hEn;pr.isCI=pEn;pr.platform=DYe;pr.userAgent=t3;pr.language=kYe;var aEn;(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})(aEn||(pr.Language=aEn={}));pr.locale=sIe;pr.platformLocale=m7t;pr.translationsConfigFile=mEn;pr.setTimeout0IsFaster=typeof r3.postMessage=="function"&&!r3.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];r3.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}),r3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=lIe||A7t?2:cIe?1:3;var cEn=!0,lEn=!1;function VUo(){if(!lEn){lEn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,cEn=new Uint16Array(t.buffer)[0]===513}return cEn}a(VUo,"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 WUo(t){return parseFloat(t)>=25}a(WUo,"isTahoeOrNewer")});var uIe=I(YM=>{"use strict";p();Object.defineProperty(YM,"__esModule",{value:!0});YM.arch=YM.platform=YM.env=YM.cwd=void 0;var AEn=BQ(),KY,y7t=globalThis.vscode;if(typeof y7t<"u"&&typeof y7t.process<"u"){let t=y7t.process;KY={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"?KY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:KY={get platform(){return AEn.isWindows?"win32":AEn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};YM.cwd=KY.cwd;YM.env=KY.env;YM.platform=KY.platform;YM.arch=KY.arch});var KM=I(NYe=>{"use strict";p();Object.defineProperty(NYe,"__esModule",{value:!0});NYe.StopWatch=void 0;var zUo=globalThis.performance.now.bind(globalThis.performance),E7t=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:zUo,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}};NYe.StopWatch=E7t});var Cc=I(Qa=>{"use strict";p();Object.defineProperty(Qa,"__esModule",{value:!0});Qa.ValueWithChangeEvent=Qa.Relay=Qa.EventBufferer=Qa.DynamicListEventMultiplexer=Qa.EventMultiplexer=Qa.MicrotaskEmitter=Qa.DebounceEmitter=Qa.PauseableEmitter=Qa.AsyncEmitter=Qa.createEventDeliveryQueue=Qa.Emitter=Qa.ListenerRefusalError=Qa.ListenerLeakError=Qa.EventProfiling=Qa.Event=void 0;Qa.setGlobalLeakWarningThreshold=t7o;Qa.trackSetChanges=o7o;var YUo=HUt(),dIe=Cs(),KUo=$Ut(),xC=wo(),CEn=Kce(),JUo=uIe(),ZUo=KM(),yEn=!1,XUo=!1,e7o=100,EEn=6e4;function _En(){return!!JUo.env.VSCODE_DEV}a(_En,"_isBufferLeakWarningEnabled");var MYe;(function(t){t.None=()=>xC.Disposable.None;function e(M){if(XUo){let{onDidAddListener:O}=M,q=Xce.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),q.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,q){return g(M,()=>{},0,void 0,O??!0,void 0,q)}a(r,"defer"),t.defer=r;function n(M){return(O,q=null,Q)=>{let U=!1,z;return z=M(W=>{if(!U)return z?z.dispose():U=!0,O.call(q,W)},null,Q),U&&z.dispose(),z}}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,q){return h((Q,U=null,z)=>M(W=>Q.call(U,O(W)),null,z),q)}a(s,"map"),t.map=s;function c(M,O,q){return h((Q,U=null,z)=>M(W=>{O(W),Q.call(U,W)},null,z),q)}a(c,"forEach"),t.forEach=c;function l(M,O,q){return h((Q,U=null,z)=>M(W=>O(W)&&Q.call(U,W),null,z),q)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,q=null,Q)=>{let U=(0,xC.combinedDisposable)(...M.map(z=>z(W=>O.call(q,W))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,q,Q){let U=q;return s(M,z=>(U=O(U,z),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let q,Q={onWillAddFirstListener(){q=M(U.fire,U)},onDidRemoveLastListener(){q?.dispose()}};O||e(Q);let U=new Yy(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,q=100,Q=!1,U=!1,z,W){let $,J,ne,H=0,re,ae={leakWarningThreshold:z,onWillAddFirstListener(){$=M(ve=>{H++,J=O(J,ve),Q&&!ne&&(Oe.fire(J),J=void 0),re=a(()=>{let Fe=J;J=void 0,ne=void 0,(!Q||H>1)&&Oe.fire(Fe),H=0},"doFire"),typeof q=="number"?(ne&&clearTimeout(ne),ne=setTimeout(re,q)):ne===void 0&&(ne=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,$.dispose()}};W||e(ae);let Oe=new Yy(ae);return W?.add(Oe),Oe.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,q,Q){return t.debounce(M,(U,z)=>U?(U.push(z),U):[z],O,void 0,q??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,q=100,Q=!0,U=!0,z,W){let $,J,ne,H=0,re={leakWarningThreshold:z,onWillAddFirstListener(){$=M(Oe=>{H++,J=O(J,Oe),ne===void 0&&(Q&&(ae.fire(J),J=void 0,H=0),typeof q=="number"?ne=setTimeout(()=>{U&&H>0&&ae.fire(J),J=void 0,ne=void 0,H=0},q):(ne=0,queueMicrotask(()=>{U&&H>0&&ae.fire(J),J=void 0,ne=void 0,H=0})))})},onDidRemoveLastListener(){$.dispose()}};W||e(re);let ae=new Yy(re);return W?.add(ae),ae.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,q){let Q=!0,U;return l(M,z=>{let W=Q||!O(z,U);return Q=!1,U=z,W},q)}a(E,"latch"),t.latch=E;function _(M,O,q){return[t.filter(M,O,q),t.filter(M,Q=>!O(Q),q)]}a(_,"split"),t.split=_;function v(M,O,q=!1,Q=[],U){let z=Q.slice(),W;_En()&&(W={stack:Xce.create(),timerId:setTimeout(()=>{z&&z.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${z.length} events buffered for ${EEn/1e3}s without being consumed. Buffered here:`),W.stack.print())},EEn),warned:!1},U&&U.add((0,xC.toDisposable)(()=>clearTimeout(W.timerId))));let $=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),J=M(re=>{z?(z.push(re),_En()&&W&&!W.warned&&z.length>=e7o&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${z.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});U&&U.add(J);let ne=a(()=>{z?.forEach(re=>H.fire(re)),z=null,$()},"flush"),H=new Yy({onWillAddFirstListener(){J||(J=M(re=>H.fire(re)),U&&U.add(J))},onDidAddFirstListener(){z&&(q?setTimeout(ne):ne())},onDidRemoveLastListener(){J&&J.dispose(),J=null,$()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,z)=>{let W=O(new w);return M(function($){let J=W.evaluate($);J!==T&&Q.call(U,J)},void 0,z)},"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(q=>(O(q),q)),this}filter(O){return this.steps.push(q=>O(q)?q:T),this}reduce(O,q){let Q=q;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(q,Q)=>q===Q){let q=!0,Q;return this.steps.push(U=>{let z=q||!O(U,Q);return q=!1,Q=U,z?U:T}),this}evaluate(O){for(let q of this.steps)if(O=q(O),O===T)break;return O}}function R(M,O,q=Q=>Q){let Q=a((...$)=>W.fire(q(...$)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),z=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),W=new Yy({onWillAddFirstListener:U,onDidRemoveLastListener:z});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,q=Q=>Q){let Q=a((...$)=>W.fire(q(...$)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),z=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),W=new Yy({onWillAddFirstListener:U,onDidRemoveLastListener:z});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let q,Q,U=new Promise(z=>{Q=n(M)(z),R7t(Q,O),q=a(()=>{vEn(Q,O)},"cancelRef")});return U.cancel=q,O&&U.finally(()=>vEn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(q=>O.fire(q))}a(D,"forward"),t.forward=D;function N(M,O,q){return O(q),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,q){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")};q||e(Q),this.emitter=new Yy(Q),q&&q.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,q){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,q,Q)=>{let U=0,z=!1,W={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),z&&(z=!1,O.call(q)))},handlePossibleChange(){},handleChange(){z=!0}};M.addObserver(W),M.reportChanges();let $={dispose(){M.removeObserver(W)}};return R7t($,Q),$}}a(j,"fromObservableLight"),t.fromObservableLight=j})(MYe||(Qa.Event=MYe={}));var OYe=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 ZUo.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}}};Qa.EventProfiling=OYe;var fIe=-1;function t7o(t){let e=fIe;return fIe=t,{dispose(){fIe=e}}}a(t7o,"setGlobalLeakWarningThreshold");var _7t=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 pIe(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 Cle)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new IQt(e?.onListenerError??qIe.onUnexpectedError,this._options?.leakWarningThreshold??jIe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new bKe(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(rCn){let e=this._listeners;queueMicrotask(()=>{aCn(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 SKe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||qIe.onUnexpectedError)(h),Nv.Disposable.None}if(this._disposed)return Nv.Disposable.None;r&&(e=e.bind(r));let o=new Cle(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=vle.create(),s=this._leakageMon.check(o.stack,this._size+1)),rCn&&(o.stack=c??vle.create()),this._listeners?this._listeners instanceof Cle?(this._deliveryQueue??=new TKe,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,Nv.toDisposable)(()=>{s?.(),this._removeListener(o)});return OQt(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*lHo<=r.length){let s=0;for(let c=0;c0}};ja.Emitter=Yy;var uHo=a(()=>new TKe,"createEventDeliveryQueue");ja.createEventDeliveryQueue=uHo;var TKe=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}},xQt=class extends Yy{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new sCn.LinkedList),aCn(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,qIe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,qIe.onUnexpectedError)(d.reason)})}}};ja.AsyncEmitter=xQt;var IKe=class extends Yy{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new sCn.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))}};ja.PauseableEmitter=IKe;var wQt=class extends IKe{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)}};ja.DebounceEmitter=wQt;var RQt=class extends Yy{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=[]}))}};ja.MicrotaskEmitter=RQt;var xKe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Yy({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,Nv.toDisposable)((0,rHo.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=[]}};ja.EventMultiplexer=xKe;var kQt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new Nv.DisposableStore;let s=this._store.add(new xKe),c=this._store.add(new Nv.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()}};ja.DynamicListEventMultiplexer=kQt;var PQt=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}};ja.EventBufferer=PQt;var DQt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=vKe.None,this.inputEventListener=Nv.Disposable.None,this.emitter=new Yy({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()}};ja.Relay=DQt;var NQt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new MQt(e)}constructor(e){this._value=e,this._onDidChange=new Yy,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};ja.ValueWithChangeEvent=NQt;var MQt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=vKe.None}};function dHo(t,e,r){let n=new Nv.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new Nv.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,tHo.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(dHo,"trackSetChanges");function OQt(t,e){e instanceof Nv.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(OQt,"addToDisposables");function oCn(t,e){if(e instanceof Nv.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(oCn,"disposeAndRemove")});var SP=I(A3=>{"use strict";p();Object.defineProperty(A3,"__esModule",{value:!0});A3.CancellationTokenPool=A3.CancellationTokenSource=A3.CancellationToken=void 0;A3.cancelOnDispose=pHo;var cCn=Sc(),fHo=ko(),lCn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),wKe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof ble?!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:cCn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:lCn})})(wKe||(A3.CancellationToken=wKe={}));var ble=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?lCn:(this._emitter||(this._emitter=new cCn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},GIe=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 ble),this._token}cancel(){this._token?this._token instanceof ble&&this._token.cancel():this._token=wKe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof ble&&this._token.dispose():this._token=wKe.None}};A3.CancellationTokenSource=GIe;function pHo(t){let e=new GIe;return t.add({dispose(){e.cancel()}}),e.token}a(pHo,"cancelOnDispose");var BQt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new GIe,this._listeners=new fHo.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()}};A3.CancellationTokenPool=BQt});var hA=I(Kr=>{"use strict";p();var hHo=Kr&&Kr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mHo=Kr&&Kr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gHo=Kr&&Kr.__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=AHo&&t<=EHo||t>=yHo&&t<=_Ho}a(E3,"isWindowsDeviceRoot");function kKe(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===gK&&l!==-1?++l:l=-1}return o}a(kKe,"normalizeString");function bHo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(bHo,"formatExt");function uCn(t,e){vHo(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(uCn,"_format");Kr.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],Jf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Sle.cwd():(s=Sle.env[`=${e}`]||Sle.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===Mv)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)zo(f)&&(l=1,d=!0);else if(zo(f))if(d=!0,zo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&zo(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=kKe(r,!n,"\\",zo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Jf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return LQt(s)?"\\":t;if(zo(s))if(o=!0,zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&zo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&zo(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&E3(c.charCodeAt(0))&&c.charCodeAt(1)===y3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||zo(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){Jf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return zo(r)||e>2&&E3(r)&&t.charCodeAt(1)===y3&&zo(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"&&zo(r.charCodeAt(0))){++o;let s=r.length;s>1&&zo(r.charCodeAt(1))&&(++o,s>2&&(zo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kr.win32.normalize(e)},relative(t,e){if(Jf(t,"from"),Jf(e,"to"),t===e)return"";let r=Kr.win32.resolve(t),n=Kr.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)===Mv;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===Mv;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===Mv)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===Mv?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)===Mv)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===Mv&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===Mv){if(e.charCodeAt(1)===Mv){let r=e.charCodeAt(2);if(r!==CHo&&r!==gK)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(E3(e.charCodeAt(0))&&e.charCodeAt(1)===y3&&e.charCodeAt(2)===Mv)return`\\\\?\\${e}`;return e},dirname(t){Jf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return zo(o)?t:".";if(zo(o)){if(r=n=1,zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&zo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(zo(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&&Jf(e,"suffix"),Jf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&E3(t.charCodeAt(0))&&t.charCodeAt(1)===y3&&(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(zo(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(zo(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){Jf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===y3&&E3(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(zo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===gK?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:uCn.bind(null,"\\"),parse(t){Jf(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 zo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(zo(o)){if(n=1,zo(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),zo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===gK?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 SHo=(()=>{if(Ov){let t=/\\/g;return()=>{let e=Sle.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Sle.cwd()})();Kr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];Jf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===og)}if(!r){let n=SHo();e=`${n}/${e}`,r=n.charCodeAt(0)===og}return e=kKe(e,!r,"/",LQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Jf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===og,r=t.charCodeAt(t.length-1)===og;return t=kKe(t,!e,"/",LQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Jf(t,"path"),t.length>0&&t.charCodeAt(0)===og},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Kr.posix.normalize(e.join("/"))},relative(t,e){if(Jf(t,"from"),Jf(e,"to"),t===e||(t=Kr.posix.resolve(t),e=Kr.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)===og)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===og?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===og)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Jf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===og,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===og){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&&Jf(e,"suffix"),Jf(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===og){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)===og){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Jf(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:uCn.bind(null,"/"),parse(t){Jf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===og,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===og){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===gK?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};Kr.posix.win32=Kr.win32.win32=Kr.win32;Kr.posix.posix=Kr.win32.posix=Kr.posix;Kr.normalize=Ov?Kr.win32.normalize:Kr.posix.normalize;Kr.isAbsolute=Ov?Kr.win32.isAbsolute:Kr.posix.isAbsolute;Kr.join=Ov?Kr.win32.join:Kr.posix.join;Kr.resolve=Ov?Kr.win32.resolve:Kr.posix.resolve;Kr.relative=Ov?Kr.win32.relative:Kr.posix.relative;Kr.dirname=Ov?Kr.win32.dirname:Kr.posix.dirname;Kr.basename=Ov?Kr.win32.basename:Kr.posix.basename;Kr.extname=Ov?Kr.win32.extname:Kr.posix.extname;Kr.format=Ov?Kr.win32.format:Kr.posix.format;Kr.parse=Ov?Kr.win32.parse:Kr.posix.parse;Kr.toNamespacedPath=Ov?Kr.win32.toNamespacedPath:Kr.posix.toNamespacedPath;Kr.sep=Ov?Kr.win32.sep:Kr.posix.sep;Kr.delimiter=Ov?Kr.win32.delimiter:Kr.posix.delimiter});var DKe=I(TP=>{"use strict";p();Object.defineProperty(TP,"__esModule",{value:!0});TP.WeakCachedFunction=TP.CachedFunction=TP.LRUCachedFunction=TP.Cache=void 0;TP.identity=PKe;var THo=SP(),FQt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new THo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};TP.Cache=FQt;function PKe(t){return t}a(PKe,"identity");var UQt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=PKe):(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}};TP.LRUCachedFunction=UQt;var QQt=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=PKe):(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}};TP.CachedFunction=QQt;var qQt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=PKe):(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}};TP.WeakCachedFunction=qQt});var _3=I(NKe=>{"use strict";p();Object.defineProperty(NKe,"__esModule",{value:!0});NKe.Lazy=void 0;var tq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(tq||(tq={}));var jQt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=tq.Uninitialized}get hasValue(){return this._state===tq.Completed}get value(){if(this._state===tq.Uninitialized){this._state=tq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=tq.Completed}}else if(this._state===tq.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}};NKe.Lazy=jQt});var Gh=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=xHo;Rr.format=RHo;Rr.format2=PHo;Rr.htmlAttributeEncodeValue=DHo;Rr.escape=NHo;Rr.escapeRegExpCharacters=pCn;Rr.count=MHo;Rr.truncate=OHo;Rr.truncateMiddle=BHo;Rr.trim=LHo;Rr.ltrim=hCn;Rr.rtrim=mCn;Rr.convertSimple2RegExpPattern=FHo;Rr.createRegExp=UHo;Rr.regExpLeadsToEndlessLoop=QHo;Rr.joinStrings=qHo;Rr.splitLines=jHo;Rr.splitLinesIncludeSeparators=HHo;Rr.indexOfPattern=GHo;Rr.firstNonWhitespaceIndex=gCn;Rr.getLeadingWhitespace=$Ho;Rr.lastNonWhitespaceIndex=VHo;Rr.getIndentationLength=WHo;Rr.replaceAsync=zHo;Rr.compare=YHo;Rr.compareSubstring=ACn;Rr.compareIgnoreCase=KHo;Rr.compareSubstringIgnoreCase=VIe;Rr.isAsciiDigit=JHo;Rr.isLowerAsciiLetter=GQt;Rr.isUpperAsciiLetter=ZHo;Rr.equalsIgnoreCase=yCn;Rr.equals=XHo;Rr.startsWithIgnoreCase=eGo;Rr.endsWithIgnoreCase=tGo;Rr.commonPrefixLength=rGo;Rr.commonSuffixLength=nGo;Rr.isHighSurrogate=WQt;Rr.isLowSurrogate=MKe;Rr.computeCodePoint=zQt;Rr.getNextCodePoint=ECn;Rr.nextCharLength=_Cn;Rr.prevCharLength=CCn;Rr.getCharContainingOffset=oGo;Rr.charCount=sGo;Rr.containsRTL=cGo;Rr.isBasicASCII=uGo;Rr.containsUnusualLineTerminators=dGo;Rr.isFullWidthCharacter=fGo;Rr.isEmojiImprecise=vCn;Rr.lcut=pGo;Rr.rcut=hGo;Rr.forAnsiStringParts=yGo;Rr.removeAnsiEscapeCodes=SCn;Rr.removeAnsiEscapeCodesFromPrompt=_Go;Rr.startsWithUTF8BOM=TCn;Rr.stripUTF8BOM=CGo;Rr.fuzzyContains=vGo;Rr.containsUppercaseCharacter=bGo;Rr.uppercaseFirstLetter=SGo;Rr.getNLines=TGo;Rr.singleLetterHash=IGo;Rr.getGraphemeBreakType=xGo;Rr.getLeftDeleteOffset=RGo;Rr.multibyteAwareBtoa=NGo;var IHo=DKe(),dCn=_3();function xHo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(xHo,"isFalsyOrWhitespace");var wHo=/{(\d+)}/g;function RHo(t,...e){return e.length===0?t:t.replace(wHo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(RHo,"format");var kHo=/{([^}]+)}/g;function PHo(t,e){return Object.keys(e).length===0?t:t.replace(kHo,(r,n)=>e[n]??r)}a(PHo,"format2");function DHo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(DHo,"htmlAttributeEncodeValue");function NHo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(NHo,"escape");function pCn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(pCn,"escapeRegExpCharacters");function MHo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(MHo,"count");function OHo(t,e,r=Rr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(OHo,"truncate");function BHo(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(BHo,"truncateMiddle");function LHo(t,e=" "){let r=hCn(t,e);return mCn(r,e)}a(LHo,"trim");function hCn(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(mCn,"rtrim");function FHo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(FHo,"convertSimple2RegExpPattern");function UHo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=pCn(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(UHo,"createRegExp");function QHo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(QHo,"regExpLeadsToEndlessLoop");function qHo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(qHo,"joinStrings");function jHo(t){return t.split(/\r\n|\r|\n/)}a(jHo,"splitLines");function HHo(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(VHo,"lastNonWhitespaceIndex");function WHo(t){let e=gCn(t);return e===-1?t.length:e}a(WHo,"getIndentationLength");function zHo(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(zHo,"replaceAsync");function YHo(t,e){return te?1:0}a(YHo,"compare");function ACn(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(ACn,"compareSubstring");function KHo(t,e){return VIe(t,e,0,t.length,0,e.length)}a(KHo,"compareIgnoreCase");function VIe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return ACn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);GQt(u)&&(u-=32),GQt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(VIe,"compareSubstringIgnoreCase");function JHo(t){return t>=48&&t<=57}a(JHo,"isAsciiDigit");function GQt(t){return t>=97&&t<=122}a(GQt,"isLowerAsciiLetter");function ZHo(t){return t>=65&&t<=90}a(ZHo,"isUpperAsciiLetter");function yCn(t,e){return t.length===e.length&&VIe(t,e)===0}a(yCn,"equalsIgnoreCase");function XHo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&yCn(t,e)}a(XHo,"equals");function eGo(t,e){let r=e.length;return r<=t.length&&VIe(t,e,0,r)===0}a(eGo,"startsWithIgnoreCase");function tGo(t,e){let r=t.length,n=r-e.length;return n>=0&&VIe(t,e,n,r)===0}a(tGo,"endsWithIgnoreCase");function rGo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(WQt(n))return zQt(n,r)}return r}a(iGo,"getPrevCodePoint");var Tle=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=iGo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=ECn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};Rr.CodePointIterator=Tle;var Ile=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new Tle(e,r)}nextGraphemeLength(){let e=$Ie.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(fCn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=$Ie.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(fCn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};Rr.GraphemeIterator=Ile;function _Cn(t,e){return new Ile(t,e).nextGraphemeLength()}a(_Cn,"nextCharLength");function CCn(t,e){return new Ile(t,e).prevGraphemeLength()}a(CCn,"prevCharLength");function oGo(t,e){e>0&&MKe(t.charCodeAt(e))&&e--;let r=e+_Cn(t,e);return[r-CCn(t,r),r]}a(oGo,"getCharContainingOffset");function sGo(t){let e=new Ile(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(sGo,"charCount");var HQt;function aGo(){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(aGo,"makeContainsRtl");function cGo(t){return HQt||(HQt=aGo()),HQt.test(t)}a(cGo,"containsRTL");var lGo=/^[\t\n\r\x20-\x7E]*$/;function uGo(t){return lGo.test(t)}a(uGo,"isBasicASCII");Rr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function dGo(t){return Rr.UNUSUAL_LINE_TERMINATORS.test(t)}a(dGo,"containsUnusualLineTerminators");function fGo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(fGo,"isFullWidthCharacter");function vCn(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(vCn,"isEmojiImprecise");function pGo(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@^`{}|~]/,gGo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,AGo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,bCn=new RegExp("(?:"+[mGo.source,gGo.source,AGo.source].join("|")+")","g");function*yGo(t){let e=0;for(let r of t.matchAll(bCn))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(yGo,"forAnsiStringParts");function SCn(t){return t&&(t=t.replace(bCn,"")),t}a(SCn,"removeAnsiEscapeCodes");var EGo=/\\\[.*?\\\]/g;function _Go(t){return SCn(t).replace(EGo,"")}a(_Go,"removeAnsiEscapeCodesFromPrompt");Rr.UTF8_BOM_CHARACTER="\uFEFF";function TCn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(TCn,"startsWithUTF8BOM");function CGo(t){return TCn(t)?t.substr(1):t}a(CGo,"stripUTF8BOM");function vGo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(TGo,"getNLines");function IGo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(IGo,"singleLetterHash");function xGo(t){return $Ie.getInstance().getGraphemeBreakType(t)}a(xGo,"getGraphemeBreakType");function fCn(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(fCn,"breakBetweenGraphemeBreakType");var $Ie=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=wGo()}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 wGo(){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(wGo,"getGraphemeBreakRawData");function RGo(t,e){if(t===0)return 0;let r=kGo(t,e);if(r!==void 0)return r;let n=new Tle(e,t);return n.prevCodePoint(),n.offset}a(RGo,"getLeftDeleteOffset");function kGo(t,e){let r=new Tle(e,t),n=r.prevCodePoint();for(;PGo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!vCn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(kGo,"getOffsetBeforeLastEmojiComponent");function PGo(t){return 127995<=t&&t<=127999}a(PGo,"isEmojiModifier");Rr.noBreakWhitespace="\xA0";var $Qt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new dCn.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 IHo.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 dCn.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(K0,"__esModule",{value:!0});K0.isPathSeparator=C3;K0.toSlashes=ICn;K0.toPosixPath=OGo;K0.getRoot=BGo;K0.isUNC=LGo;K0.isValidBasename=qGo;K0.isEqual=jGo;K0.isEqualOrParent=HGo;K0.isWindowsDriveLetter=YQt;K0.sanitizeFilePath=GGo;K0.removeTrailingPathSeparator=xCn;K0.isRootOrDriveLetter=$Go;K0.hasDriveLetter=KQt;K0.getDriveLetter=VGo;K0.indexOfPath=WGo;K0.parseLineAndColumnAware=zGo;K0.randomPath=JGo;var Bv=hA(),rq=eq(),OKe=Gh(),MGo=BS();function C3(t){return t===47||t===92}a(C3,"isPathSeparator");function ICn(t){return t.replace(/[\\/]/g,Bv.posix.sep)}a(ICn,"toSlashes");function OGo(t){return t.indexOf("/")===-1&&(t=ICn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(OGo,"toPosixPath");function BGo(t,e=Bv.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(C3(n)){if(C3(t.charCodeAt(1))&&!C3(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,UGo=/[/]/g,QGo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function qGo(t,e=rq.isWindows){let r=e?FGo:UGo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&QGo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(qGo,"isValidBasename");function jGo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,OKe.equalsIgnoreCase)(t,e)}a(jGo,"isEqual");function HGo(t,e,r,n=Bv.sep){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(r){if(!(0,OKe.startsWithIgnoreCase)(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(HGo,"isEqualOrParent");function YQt(t){return t>=65&&t<=90||t>=97&&t<=122}a(YQt,"isWindowsDriveLetter");function GGo(t,e){return rq.isWindows&&t.endsWith(":")&&(t+=Bv.sep),(0,Bv.isAbsolute)(t)||(t=(0,Bv.join)(e,t)),t=(0,Bv.normalize)(t),xCn(t)}a(GGo,"sanitizeFilePath");function xCn(t){return rq.isWindows?(t=(0,OKe.rtrim)(t,Bv.sep),t.endsWith(":")&&(t+=Bv.sep)):(t=(0,OKe.rtrim)(t,Bv.sep),t||(t=Bv.sep)),t}a(xCn,"removeTrailingPathSeparator");function $Go(t){let e=(0,Bv.normalize)(t);return rq.isWindows?t.length>3?!1:KQt(e)&&(t.length===2||e.charCodeAt(2)===92):e===Bv.posix.sep}a($Go,"isRootOrDriveLetter");function KQt(t,e=rq.isWindows){return e?YQt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(KQt,"hasDriveLetter");function VGo(t,e=rq.isWindows){return KQt(t,e)?t[0]:void 0}a(VGo,"getDriveLetter");function WGo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(WGo,"indexOfPath");function zGo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,MGo.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(zGo,"parseLineAndColumnAware");var YGo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",KGo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function JGo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var ZGo=Fx&&Fx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XGo=Fx&&Fx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e$o=Fx&&Fx.__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(!r$o.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(n$o.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(i$o,"_validateUri");function o$o(t,e){return!t&&!e?"file":t}a(o$o,"_schemeFix");function s$o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==IP&&(e=IP+e):e=IP;break}return e}a(s$o,"_referenceResolution");var Ul="",IP="/",a$o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,FKe=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||Ul,this.authority=e.authority||Ul,this.path=e.path||Ul,this.query=e.query||Ul,this.fragment=e.fragment||Ul):(this.scheme=o$o(e,c),this.authority=r||Ul,this.path=s$o(this.scheme,n||Ul),this.query=o||Ul,this.fragment=s||Ul,i$o(this,c))}get fsPath(){return UKe(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=Ul),n===void 0?n=this.authority:n===null&&(n=Ul),o===void 0?o=this.path:o===null&&(o=Ul),s===void 0?s=this.query:s===null&&(s=Ul),c===void 0?c=this.fragment:c===null&&(c=Ul),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new nq(r,n,o,s,c)}static parse(e,r=!1){let n=a$o.exec(e);return n?new nq(n[2]||Ul,BKe(n[4]||Ul),BKe(n[5]||Ul),BKe(n[7]||Ul),BKe(n[9]||Ul),r):new nq(Ul,Ul,Ul,Ul,Ul)}static file(e){let r=Ul;if(LKe.isWindows&&(e=e.replace(/\\/g,IP)),e[0]===IP&&e[1]===IP){let n=e.indexOf(IP,2);n===-1?(r=e.substring(2),e=IP):(r=e.substring(2,n),e=e.substring(n)||IP)}return new nq("file",r,e,Ul,Ul)}static from(e,r){return new nq(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 LKe.isWindows&&e.scheme==="file"?n=t.file(wCn.win32.join(UKe(e,!0),...r)).path:n=wCn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return ZQt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new nq(e);return r._formatted=e.external??null,r._fsPath=e._sep===PCn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};Fx.URI=FKe;function c$o(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(c$o,"isUriComponents");var PCn=LKe.isWindows?1:void 0,nq=class extends FKe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=UKe(this,!1)),this._fsPath}toString(e=!1){return e?ZQt(this,!0):(this._formatted||(this._formatted=ZQt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=PCn),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}},DCn={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 RCn(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=DCn[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(RCn,"encodeURIComponentFast");function l$o(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,LKe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(UKe,"uriToFsPath");function ZQt(t,e){let r=e?l$o:RCn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=IP,n+=IP),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:RCn(u,!1,!1)),n}a(ZQt,"_asFormatted");function NCn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+NCn(t.substr(3)):t}}a(NCn,"decodeURIComponentGraceful");var kCn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BKe(t){return t.match(kCn)?t.replace(kCn,e=>NCn(e)):t}a(BKe,"percentDecode")});var yK=I(ls=>{"use strict";p();var u$o=ls&&ls.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d$o=ls&&ls.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nqt=ls&&ls.__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;oBCn(t,r))}a(p$o,"matchesSomeScheme");ls.connectionTokenCookieName="vscode-tkn";ls.connectionTokenQueryName="tkn";var tqt=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=eqt.posix.join(r??"/",LCn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return eqt.posix.join(this._serverRootPath,lO.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 f$o.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+=`&${ls.connectionTokenQueryName}=${encodeURIComponent(s)}`),AK.URI.from({scheme:XQt.isWeb?this._preferredWebSchema:lO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ls.RemoteAuthorities=new tqt;function LCn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(LCn,"getServerProductSegment");ls.builtinExtensionsPath="vs/../../extensions";ls.nodeModulesPath="vs/../../node_modules";ls.nodeModulesAsarPath="vs/../../node_modules.asar";ls.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ls.VSCODE_AUTHORITY="vscode-app";var rqt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ls.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===lO.vscodeRemote?ls.RemoteAuthorities.rewrite(e):e.scheme===lO.file&&(XQt.isNative||XQt.webWorkerOrigin===`${lO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:lO.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===lO.vscodeFileResource?e.with({scheme:lO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(AK.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return AK.URI.joinPath(AK.URI.parse(r,!0),e);let n=eqt.join(r,e);return AK.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ls.FileAccess=new rqt;ls.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ls.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var OCn;(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:AK.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})(OCn||(ls.COI=OCn={}))});var xP=I(yr=>{"use strict";p();var h$o=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]})),m$o=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QCn=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;oxle.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=N_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=N_.sep){let n=!1;if(e.scheme===iq.Schemas.file){let o=uO(e);n=o!==void 0&&o.length===xle.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=wle;yr.extUri=new wle(()=>!1);yr.extUriBiasedIgnorePathCase=new wle(t=>t.scheme===iq.Schemas.file?!qCn.isLinux:!0);yr.extUriIgnorePathCase=new wle(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 g$o(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(g$o,"distinctParents");var UCn;(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})(UCn||(yr.DataUri=UCn={}));function A$o(t,e,r){if(e){let n=t.path;return n&&n[0]!==N_.posix.sep&&(n=N_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(A$o,"toLocalResource")});var jCn=I(QKe=>{"use strict";p();Object.defineProperty(QKe,"__esModule",{value:!0});QKe.MicrotaskDelay=void 0;QKe.MicrotaskDelay=Symbol("MicrotaskDelay")});var Xc=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=$Cn;Yt.createCancelablePromise=VCn;Yt.raceCancellation=WCn;Yt.raceCancellationError=C$o;Yt.rejectIfNotCanceled=v$o;Yt.notCancellablePromise=b$o;Yt.raceCancellablePromises=S$o;Yt.raceTimeout=zCn;Yt.asPromise=T$o;Yt.promiseWithResolvers=YCn;Yt.timeout=bqt;Yt.disposableTimeout=w$o;Yt.sequence=R$o;Yt.first=k$o;Yt.firstParallel=P$o;Yt.installFakeRunWhenIdle=D$o;Yt.retry=N$o;Yt.createCancelableAsyncIterableProducer=M$o;Yt.cancellableIterable=O$o;Yt.createTimeout=B$o;var vqt=SP(),M_=Ts(),zIe=Sc(),oq=ko(),HCn=xP(),y$o=eq(),E$o=jCn(),_$o=_3();function $Cn(t){return!!t&&typeof t.then=="function"}a($Cn,"isThenable");function VCn(t){let e=new vqt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new M_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,oq.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(VCn,"createCancelablePromise");function WCn(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(WCn,"raceCancellation");function C$o(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new M_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(C$o,"raceCancellationError");function v$o(t){if(!(0,M_.isCancellationError)(t))return Promise.reject(t)}a(v$o,"rejectIfNotCanceled");function b$o(t){return new Promise((e,r)=>{t.then(e,r)})}a(b$o,"notCancellablePromise");function S$o(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(S$o,"raceCancellablePromises");function zCn(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(zCn,"raceTimeout");function T$o(t){return new Promise((e,r)=>{let n=t();$Cn(n)?n.then(e,r):e(n)})}a(T$o,"asPromise");function YCn(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(YCn,"promiseWithResolvers");var qKe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new vqt.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=qKe;var iqt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Yt.Sequencer=iqt;var oqt=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=oqt;var I$o=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"),x$o=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),jKe=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===E$o.MicrotaskDelay?x$o(n):I$o(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new M_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Yt.Delayer=jKe;var sqt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new jKe(e),this.throttler=new qKe}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=sqt;var HKe=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=HKe;var aqt=class extends HKe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Yt.AutoOpenBarrier=aqt;function bqt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new M_.CancellationError)})}):VCn(r=>bqt(t,r))}a(bqt,"timeout");function w$o(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,oq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(w$o,"disposableTimeout");function R$o(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(k$o,"first");function P$o(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(P$o,"firstParallel");var GKe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new zIe.Emitter}whenIdle(){return this.size>0?zIe.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=GKe;var $Ke=class extends GKe{static{a(this,"Queue")}constructor(){super(1)}};Yt.Queue=$Ke;var cqt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new WKe,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=cqt;var lqt=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 v3;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=HCn.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=HCn.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new $Ke;let c=this.drainListenerCount++,l=zIe.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 oq.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=lqt;var uqt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new v3;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new v3;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 M_.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 M_.CancellationError)}};Yt.TaskQueue=uqt;var dqt=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 M_.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 M_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Yt.TimeoutTimer=dqt;var fqt=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 M_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,oq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Yt.IntervalTimer=fqt;var YIe=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=YIe;var pqt=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=pqt;var hqt=class extends YIe{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=hqt;var mqt=class extends oq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new oq.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 YIe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Yt.ThrottledWorker=mqt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Yt._runWhenIdle=(e,r,n)=>{(0,y$o.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 D$o(t){let e=Yt._runWhenIdle,r=Yt.runWhenGlobalIdle;return Yt._runWhenIdle=t,Yt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,oq.toDisposable)(()=>{Yt._runWhenIdle=e,Yt.runWhenGlobalIdle=r})}a(D$o,"installFakeRunWhenIdle");var VKe=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=VKe;var gqt=class extends VKe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Yt.GlobalIdleValue=gqt;async function N$o(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}=YCn();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=WKe;var Aqt=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=Aqt;var v3=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 M_.CancellationError)}};Yt.DeferredPromise=v3;var GCn;(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})(GCn||(Yt.Promises=GCn={}));var zKe=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 M_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Yt.StatefulPromise=zKe;var yqt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new _$o.Lazy(()=>new zKe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Yt.LazyStatefulPromise=yqt;var YKe=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 zIe.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=YKe;function M$o(t){let e=new vqt.CancellationTokenSource,r=t(e.token);return new JKe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new M_.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(M$o,"createCancelableAsyncIterableProducer");var Eqt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new v3,this._asyncIterable=new YKe(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=Eqt;function O$o(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await WCn(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(O$o,"cancellableIterable");var _qt=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 M_.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 v3;return this._unsatisfiedConsumers.push(e),e.p}}},KKe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new _qt,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 v3,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=KKe;var JKe=class extends KKe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Yt.CancelableAsyncIterableProducer=JKe;Yt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var Cqt=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 M_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await zCn(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=Cqt;function B$o(t,e){let r=setTimeout(e,t);return(0,oq.toDisposable)(()=>clearTimeout(r))}a(B$o,"createTimeout")});var nvn=I(LS=>{"use strict";p();var q$o=LS&&LS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(LS,"__esModule",{value:!0});var j$o=require("fs"),H$o=q$o(Wk()),kle=H$o.default("@kwsites/file-exists");function G$o(t,e,r){kle("checking %s",t);try{let n=j$o.statSync(t);return n.isFile()&&e?(kle("[OK] path represents a file"),!0):n.isDirectory()&&r?(kle("[OK] path represents a directory"),!0):(kle("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return kle("[FAIL] path is not accessible: %o",n),!1;throw kle("[FATAL] %o",n),n}}a(G$o,"check");function $$o(t,e=LS.READABLE){return G$o(t,(e&LS.FILE)>0,(e&LS.FOLDER)>0)}a($$o,"exists");LS.exists=$$o;LS.FILE=1;LS.FOLDER=2;LS.READABLE=LS.FILE+LS.FOLDER});var ivn=I(nJe=>{"use strict";p();function V$o(t){for(var e in t)nJe.hasOwnProperty(e)||(nJe[e]=t[e])}a(V$o,"__export");Object.defineProperty(nJe,"__esModule",{value:!0});V$o(nvn())});var svn=I((nud,ovn)=>{p();var Nle=1e3,Mle=Nle*60,Ole=Mle*60,EK=Ole*24,W$o=EK*7,z$o=EK*365.25;ovn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Y$o(t);if(r==="number"&&isFinite(t))return e.long?J$o(t):K$o(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Y$o(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*z$o;case"weeks":case"week":case"w":return r*W$o;case"days":case"day":case"d":return r*EK;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ole;case"minutes":case"minute":case"mins":case"min":case"m":return r*Mle;case"seconds":case"second":case"secs":case"sec":case"s":return r*Nle;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Y$o,"parse");function K$o(t){var e=Math.abs(t);return e>=EK?Math.round(t/EK)+"d":e>=Ole?Math.round(t/Ole)+"h":e>=Mle?Math.round(t/Mle)+"m":e>=Nle?Math.round(t/Nle)+"s":t+"ms"}a(K$o,"fmtShort");function J$o(t){var e=Math.abs(t);return e>=EK?iJe(t,e,EK,"day"):e>=Ole?iJe(t,e,Ole,"hour"):e>=Mle?iJe(t,e,Mle,"minute"):e>=Nle?iJe(t,e,Nle,"second"):t+" ms"}a(J$o,"fmtLong");function iJe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(iJe,"plural")});var xqt=I((sud,avn)=>{p();function Z$o(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=svn(),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 k=r.formatters[x];if(typeof k=="function"){let D=E[T];R=k.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(Z$o,"setup");avn.exports=Z$o});var cvn=I((FS,oJe)=>{p();FS.formatArgs=eVo;FS.save=tVo;FS.load=rVo;FS.useColors=X$o;FS.storage=nVo();FS.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`."))}})();FS.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 X$o(){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(X$o,"useColors");function eVo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+oJe.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(eVo,"formatArgs");FS.log=console.debug||console.log||(()=>{});function tVo(t){try{t?FS.storage.setItem("debug",t):FS.storage.removeItem("debug")}catch{}}a(tVo,"save");function rVo(){let t;try{t=FS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(rVo,"load");function nVo(){try{return localStorage}catch{}}a(nVo,"localstorage");oJe.exports=xqt()(FS);var{formatters:iVo}=oJe.exports;iVo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var uvn=I((sg,aJe)=>{p();var oVo=require("tty"),sJe=require("util");sg.init=fVo;sg.log=lVo;sg.formatArgs=aVo;sg.save=uVo;sg.load=dVo;sg.useColors=sVo;sg.destroy=sJe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");sg.colors=[6,2,3,4,5,1];try{let t=sHe();t&&(t.stderr||t).level>=2&&(sg.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{}sg.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 sVo(){return"colors"in sg.inspectOpts?!!sg.inspectOpts.colors:oVo.isatty(process.stderr.fd)}a(sVo,"useColors");function aVo(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(` +`))}},pIe=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"}};Qa.ListenerLeakError=pIe;var BYe=class extends pIe{static{a(this,"ListenerRefusalError")}constructor(e,r,n,o,s){super(e,r,n,o,s),this.name="ListenerRefusalError"}};Qa.ListenerRefusalError=BYe;var r7o=0,Zce=class{static{a(this,"UniqueContainer")}constructor(e){this.value=e,this.id=r7o++}},n7o=2,bEn=a((t,e)=>{if(t instanceof Zce)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new _7t(e?.onListenerError??dIe.onUnexpectedError,this._options?.leakWarningThreshold??fIe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new OYe(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(yEn){let e=this._listeners;queueMicrotask(()=>{bEn(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 BYe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||dIe.onUnexpectedError)(h),xC.Disposable.None}if(this._disposed)return xC.Disposable.None;r&&(e=e.bind(r));let o=new Zce(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Xce.create(),s=this._leakageMon.check(o.stack,this._size+1)),yEn&&(o.stack=c??Xce.create()),this._listeners?this._listeners instanceof Zce?(this._deliveryQueue??=new LYe,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,xC.toDisposable)(()=>{s?.(),this._removeListener(o)});return R7t(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*n7o<=r.length){let s=0;for(let c=0;c0}};Qa.Emitter=Yy;var i7o=a(()=>new LYe,"createEventDeliveryQueue");Qa.createEventDeliveryQueue=i7o;var LYe=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}},v7t=class extends Yy{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new CEn.LinkedList),bEn(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,dIe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,dIe.onUnexpectedError)(d.reason)})}}};Qa.AsyncEmitter=v7t;var FYe=class extends Yy{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new CEn.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))}};Qa.PauseableEmitter=FYe;var C7t=class extends FYe{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)}};Qa.DebounceEmitter=C7t;var b7t=class extends Yy{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=[]}))}};Qa.MicrotaskEmitter=b7t;var UYe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Yy({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,xC.toDisposable)((0,KUo.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=[]}};Qa.EventMultiplexer=UYe;var S7t=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new xC.DisposableStore;let s=this._store.add(new UYe),c=this._store.add(new xC.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()}};Qa.DynamicListEventMultiplexer=S7t;var T7t=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}};Qa.EventBufferer=T7t;var I7t=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=MYe.None,this.inputEventListener=xC.Disposable.None,this.emitter=new Yy({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()}};Qa.Relay=I7t;var x7t=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new w7t(e)}constructor(e){this._value=e,this._onDidChange=new Yy,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Qa.ValueWithChangeEvent=x7t;var w7t=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=MYe.None}};function o7o(t,e,r){let n=new xC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new xC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,YUo.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(o7o,"trackSetChanges");function R7t(t,e){e instanceof xC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(R7t,"addToDisposables");function vEn(t,e){if(e instanceof xC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(vEn,"disposeAndRemove")});var Ak=I(n3=>{"use strict";p();Object.defineProperty(n3,"__esModule",{value:!0});n3.CancellationTokenPool=n3.CancellationTokenSource=n3.CancellationToken=void 0;n3.cancelOnDispose=a7o;var SEn=Cc(),s7o=wo(),TEn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),QYe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof ele?!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:SEn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:TEn})})(QYe||(n3.CancellationToken=QYe={}));var ele=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?TEn:(this._emitter||(this._emitter=new SEn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},hIe=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 ele),this._token}cancel(){this._token?this._token instanceof ele&&this._token.cancel():this._token=QYe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof ele&&this._token.dispose():this._token=QYe.None}};n3.CancellationTokenSource=hIe;function a7o(t){let e=new hIe;return t.add({dispose(){e.cancel()}}),e.token}a(a7o,"cancelOnDispose");var P7t=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new hIe,this._listeners=new s7o.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()}};n3.CancellationTokenPool=P7t});var AA=I(Kr=>{"use strict";p();var c7o=Kr&&Kr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l7o=Kr&&Kr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u7o=Kr&&Kr.__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=d7o&&t<=p7o||t>=f7o&&t<=h7o}a(o3,"isWindowsDeviceRoot");function jYe(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===JY&&l!==-1?++l:l=-1}return o}a(jYe,"normalizeString");function A7o(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(A7o,"formatExt");function IEn(t,e){g7o(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${A7o(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(IEn,"_format");Kr.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],Zf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=tle.cwd():(s=tle.env[`=${e}`]||tle.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===wC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Go(f)&&(l=1,d=!0);else if(Go(f))if(d=!0,Go(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Go(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=jYe(r,!n,"\\",Go),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Zf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return k7t(s)?"\\":t;if(Go(s))if(o=!0,Go(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Go(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Go(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&o3(c.charCodeAt(0))&&c.charCodeAt(1)===i3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Go(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){Zf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Go(r)||e>2&&o3(r)&&t.charCodeAt(1)===i3&&Go(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"&&Go(r.charCodeAt(0))){++o;let s=r.length;s>1&&Go(r.charCodeAt(1))&&(++o,s>2&&(Go(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kr.win32.normalize(e)},relative(t,e){if(Zf(t,"from"),Zf(e,"to"),t===e)return"";let r=Kr.win32.resolve(t),n=Kr.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)===wC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===wC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===wC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===wC?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)===wC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===wC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===wC){if(e.charCodeAt(1)===wC){let r=e.charCodeAt(2);if(r!==m7o&&r!==JY)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(o3(e.charCodeAt(0))&&e.charCodeAt(1)===i3&&e.charCodeAt(2)===wC)return`\\\\?\\${e}`;return e},dirname(t){Zf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Go(o)?t:".";if(Go(o)){if(r=n=1,Go(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Go(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Go(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&&Zf(e,"suffix"),Zf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&o3(t.charCodeAt(0))&&t.charCodeAt(1)===i3&&(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(Go(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(Go(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){Zf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===i3&&o3(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Go(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===JY?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:IEn.bind(null,"\\"),parse(t){Zf(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 Go(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Go(o)){if(n=1,Go(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),Go(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===JY?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 y7o=(()=>{if(RC){let t=/\\/g;return()=>{let e=tle.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>tle.cwd()})();Kr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];Zf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===og)}if(!r){let n=y7o();e=`${n}/${e}`,r=n.charCodeAt(0)===og}return e=jYe(e,!r,"/",k7t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===og,r=t.charCodeAt(t.length-1)===og;return t=jYe(t,!e,"/",k7t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Zf(t,"path"),t.length>0&&t.charCodeAt(0)===og},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Kr.posix.normalize(e.join("/"))},relative(t,e){if(Zf(t,"from"),Zf(e,"to"),t===e||(t=Kr.posix.resolve(t),e=Kr.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)===og)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===og?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===og)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===og,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===og){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&&Zf(e,"suffix"),Zf(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===og){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)===og){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Zf(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:IEn.bind(null,"/"),parse(t){Zf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===og,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===og){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===JY?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};Kr.posix.win32=Kr.win32.win32=Kr.win32;Kr.posix.posix=Kr.win32.posix=Kr.posix;Kr.normalize=RC?Kr.win32.normalize:Kr.posix.normalize;Kr.isAbsolute=RC?Kr.win32.isAbsolute:Kr.posix.isAbsolute;Kr.join=RC?Kr.win32.join:Kr.posix.join;Kr.resolve=RC?Kr.win32.resolve:Kr.posix.resolve;Kr.relative=RC?Kr.win32.relative:Kr.posix.relative;Kr.dirname=RC?Kr.win32.dirname:Kr.posix.dirname;Kr.basename=RC?Kr.win32.basename:Kr.posix.basename;Kr.extname=RC?Kr.win32.extname:Kr.posix.extname;Kr.format=RC?Kr.win32.format:Kr.posix.format;Kr.parse=RC?Kr.win32.parse:Kr.posix.parse;Kr.toNamespacedPath=RC?Kr.win32.toNamespacedPath:Kr.posix.toNamespacedPath;Kr.sep=RC?Kr.win32.sep:Kr.posix.sep;Kr.delimiter=RC?Kr.win32.delimiter:Kr.posix.delimiter});var GYe=I(yk=>{"use strict";p();Object.defineProperty(yk,"__esModule",{value:!0});yk.WeakCachedFunction=yk.CachedFunction=yk.LRUCachedFunction=yk.Cache=void 0;yk.identity=HYe;var E7o=Ak(),D7t=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new E7o.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};yk.Cache=D7t;function HYe(t){return t}a(HYe,"identity");var N7t=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=HYe):(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}};yk.LRUCachedFunction=N7t;var M7t=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=HYe):(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}};yk.CachedFunction=M7t;var O7t=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=HYe):(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}};yk.WeakCachedFunction=O7t});var s3=I($Ye=>{"use strict";p();Object.defineProperty($Ye,"__esModule",{value:!0});$Ye.Lazy=void 0;var LQ;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(LQ||(LQ={}));var B7t=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=LQ.Uninitialized}get hasValue(){return this._state===LQ.Completed}get value(){if(this._state===LQ.Uninitialized){this._state=LQ.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=LQ.Completed}}else if(this._state===LQ.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}};$Ye.Lazy=B7t});var Gh=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=v7o;Rr.format=b7o;Rr.format2=T7o;Rr.htmlAttributeEncodeValue=I7o;Rr.escape=x7o;Rr.escapeRegExpCharacters=REn;Rr.count=w7o;Rr.truncate=R7o;Rr.truncateMiddle=P7o;Rr.trim=k7o;Rr.ltrim=PEn;Rr.rtrim=kEn;Rr.convertSimple2RegExpPattern=D7o;Rr.createRegExp=N7o;Rr.regExpLeadsToEndlessLoop=M7o;Rr.joinStrings=O7o;Rr.splitLines=B7o;Rr.splitLinesIncludeSeparators=L7o;Rr.indexOfPattern=F7o;Rr.firstNonWhitespaceIndex=DEn;Rr.getLeadingWhitespace=U7o;Rr.lastNonWhitespaceIndex=Q7o;Rr.getIndentationLength=q7o;Rr.replaceAsync=j7o;Rr.compare=H7o;Rr.compareSubstring=NEn;Rr.compareIgnoreCase=G7o;Rr.compareSubstringIgnoreCase=gIe;Rr.isAsciiDigit=$7o;Rr.isLowerAsciiLetter=F7t;Rr.isUpperAsciiLetter=V7o;Rr.equalsIgnoreCase=MEn;Rr.equals=W7o;Rr.startsWithIgnoreCase=z7o;Rr.endsWithIgnoreCase=Y7o;Rr.commonPrefixLength=K7o;Rr.commonSuffixLength=J7o;Rr.isHighSurrogate=q7t;Rr.isLowSurrogate=VYe;Rr.computeCodePoint=j7t;Rr.getNextCodePoint=OEn;Rr.nextCharLength=BEn;Rr.prevCharLength=LEn;Rr.getCharContainingOffset=X7o;Rr.charCount=eQo;Rr.containsRTL=rQo;Rr.isBasicASCII=iQo;Rr.containsUnusualLineTerminators=oQo;Rr.isFullWidthCharacter=sQo;Rr.isEmojiImprecise=FEn;Rr.lcut=aQo;Rr.rcut=cQo;Rr.forAnsiStringParts=fQo;Rr.removeAnsiEscapeCodes=QEn;Rr.removeAnsiEscapeCodesFromPrompt=hQo;Rr.startsWithUTF8BOM=qEn;Rr.stripUTF8BOM=mQo;Rr.fuzzyContains=gQo;Rr.containsUppercaseCharacter=AQo;Rr.uppercaseFirstLetter=yQo;Rr.getNLines=EQo;Rr.singleLetterHash=_Qo;Rr.getGraphemeBreakType=vQo;Rr.getLeftDeleteOffset=bQo;Rr.multibyteAwareBtoa=xQo;var _7o=GYe(),xEn=s3();function v7o(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(v7o,"isFalsyOrWhitespace");var C7o=/{(\d+)}/g;function b7o(t,...e){return e.length===0?t:t.replace(C7o,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(b7o,"format");var S7o=/{([^}]+)}/g;function T7o(t,e){return Object.keys(e).length===0?t:t.replace(S7o,(r,n)=>e[n]??r)}a(T7o,"format2");function I7o(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(I7o,"htmlAttributeEncodeValue");function x7o(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(x7o,"escape");function REn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(REn,"escapeRegExpCharacters");function w7o(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(w7o,"count");function R7o(t,e,r=Rr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(R7o,"truncate");function P7o(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(P7o,"truncateMiddle");function k7o(t,e=" "){let r=PEn(t,e);return kEn(r,e)}a(k7o,"trim");function PEn(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(kEn,"rtrim");function D7o(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(D7o,"convertSimple2RegExpPattern");function N7o(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=REn(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(N7o,"createRegExp");function M7o(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(M7o,"regExpLeadsToEndlessLoop");function O7o(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(O7o,"joinStrings");function B7o(t){return t.split(/\r\n|\r|\n/)}a(B7o,"splitLines");function L7o(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(Q7o,"lastNonWhitespaceIndex");function q7o(t){let e=DEn(t);return e===-1?t.length:e}a(q7o,"getIndentationLength");function j7o(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(j7o,"replaceAsync");function H7o(t,e){return te?1:0}a(H7o,"compare");function NEn(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(NEn,"compareSubstring");function G7o(t,e){return gIe(t,e,0,t.length,0,e.length)}a(G7o,"compareIgnoreCase");function gIe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return NEn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);F7t(u)&&(u-=32),F7t(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(gIe,"compareSubstringIgnoreCase");function $7o(t){return t>=48&&t<=57}a($7o,"isAsciiDigit");function F7t(t){return t>=97&&t<=122}a(F7t,"isLowerAsciiLetter");function V7o(t){return t>=65&&t<=90}a(V7o,"isUpperAsciiLetter");function MEn(t,e){return t.length===e.length&&gIe(t,e)===0}a(MEn,"equalsIgnoreCase");function W7o(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&MEn(t,e)}a(W7o,"equals");function z7o(t,e){let r=e.length;return r<=t.length&&gIe(t,e,0,r)===0}a(z7o,"startsWithIgnoreCase");function Y7o(t,e){let r=t.length,n=r-e.length;return n>=0&&gIe(t,e,n,r)===0}a(Y7o,"endsWithIgnoreCase");function K7o(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(q7t(n))return j7t(n,r)}return r}a(Z7o,"getPrevCodePoint");var rle=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=Z7o(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=OEn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};Rr.CodePointIterator=rle;var nle=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new rle(e,r)}nextGraphemeLength(){let e=mIe.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(wEn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=mIe.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(wEn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};Rr.GraphemeIterator=nle;function BEn(t,e){return new nle(t,e).nextGraphemeLength()}a(BEn,"nextCharLength");function LEn(t,e){return new nle(t,e).prevGraphemeLength()}a(LEn,"prevCharLength");function X7o(t,e){e>0&&VYe(t.charCodeAt(e))&&e--;let r=e+BEn(t,e);return[r-LEn(t,r),r]}a(X7o,"getCharContainingOffset");function eQo(t){let e=new nle(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(eQo,"charCount");var L7t;function tQo(){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(tQo,"makeContainsRtl");function rQo(t){return L7t||(L7t=tQo()),L7t.test(t)}a(rQo,"containsRTL");var nQo=/^[\t\n\r\x20-\x7E]*$/;function iQo(t){return nQo.test(t)}a(iQo,"isBasicASCII");Rr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function oQo(t){return Rr.UNUSUAL_LINE_TERMINATORS.test(t)}a(oQo,"containsUnusualLineTerminators");function sQo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(sQo,"isFullWidthCharacter");function FEn(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(FEn,"isEmojiImprecise");function aQo(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@^`{}|~]/,uQo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,dQo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,UEn=new RegExp("(?:"+[lQo.source,uQo.source,dQo.source].join("|")+")","g");function*fQo(t){let e=0;for(let r of t.matchAll(UEn))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(fQo,"forAnsiStringParts");function QEn(t){return t&&(t=t.replace(UEn,"")),t}a(QEn,"removeAnsiEscapeCodes");var pQo=/\\\[.*?\\\]/g;function hQo(t){return QEn(t).replace(pQo,"")}a(hQo,"removeAnsiEscapeCodesFromPrompt");Rr.UTF8_BOM_CHARACTER="\uFEFF";function qEn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(qEn,"startsWithUTF8BOM");function mQo(t){return qEn(t)?t.substr(1):t}a(mQo,"stripUTF8BOM");function gQo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(EQo,"getNLines");function _Qo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(_Qo,"singleLetterHash");function vQo(t){return mIe.getInstance().getGraphemeBreakType(t)}a(vQo,"getGraphemeBreakType");function wEn(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(wEn,"breakBetweenGraphemeBreakType");var mIe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=CQo()}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 CQo(){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(CQo,"getGraphemeBreakRawData");function bQo(t,e){if(t===0)return 0;let r=SQo(t,e);if(r!==void 0)return r;let n=new rle(e,t);return n.prevCodePoint(),n.offset}a(bQo,"getLeftDeleteOffset");function SQo(t,e){let r=new rle(e,t),n=r.prevCodePoint();for(;TQo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!FEn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(SQo,"getOffsetBeforeLastEmojiComponent");function TQo(t){return 127995<=t&&t<=127999}a(TQo,"isEmojiModifier");Rr.noBreakWhitespace="\xA0";var U7t=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new xEn.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 _7o.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 xEn.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(Y0,"__esModule",{value:!0});Y0.isPathSeparator=a3;Y0.toSlashes=jEn;Y0.toPosixPath=RQo;Y0.getRoot=PQo;Y0.isUNC=kQo;Y0.isValidBasename=OQo;Y0.isEqual=BQo;Y0.isEqualOrParent=LQo;Y0.isWindowsDriveLetter=H7t;Y0.sanitizeFilePath=FQo;Y0.removeTrailingPathSeparator=HEn;Y0.isRootOrDriveLetter=UQo;Y0.hasDriveLetter=G7t;Y0.getDriveLetter=QQo;Y0.indexOfPath=qQo;Y0.parseLineAndColumnAware=jQo;Y0.randomPath=$Qo;var PC=AA(),FQ=BQ(),WYe=Gh(),wQo=RS();function a3(t){return t===47||t===92}a(a3,"isPathSeparator");function jEn(t){return t.replace(/[\\/]/g,PC.posix.sep)}a(jEn,"toSlashes");function RQo(t){return t.indexOf("/")===-1&&(t=jEn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(RQo,"toPosixPath");function PQo(t,e=PC.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(a3(n)){if(a3(t.charCodeAt(1))&&!a3(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,NQo=/[/]/g,MQo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function OQo(t,e=FQ.isWindows){let r=e?DQo:NQo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&MQo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(OQo,"isValidBasename");function BQo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,WYe.equalsIgnoreCase)(t,e)}a(BQo,"isEqual");function LQo(t,e,r,n=PC.sep){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(r){if(!(0,WYe.startsWithIgnoreCase)(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(LQo,"isEqualOrParent");function H7t(t){return t>=65&&t<=90||t>=97&&t<=122}a(H7t,"isWindowsDriveLetter");function FQo(t,e){return FQ.isWindows&&t.endsWith(":")&&(t+=PC.sep),(0,PC.isAbsolute)(t)||(t=(0,PC.join)(e,t)),t=(0,PC.normalize)(t),HEn(t)}a(FQo,"sanitizeFilePath");function HEn(t){return FQ.isWindows?(t=(0,WYe.rtrim)(t,PC.sep),t.endsWith(":")&&(t+=PC.sep)):(t=(0,WYe.rtrim)(t,PC.sep),t||(t=PC.sep)),t}a(HEn,"removeTrailingPathSeparator");function UQo(t){let e=(0,PC.normalize)(t);return FQ.isWindows?t.length>3?!1:G7t(e)&&(t.length===2||e.charCodeAt(2)===92):e===PC.posix.sep}a(UQo,"isRootOrDriveLetter");function G7t(t,e=FQ.isWindows){return e?H7t(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(G7t,"hasDriveLetter");function QQo(t,e=FQ.isWindows){return G7t(t,e)?t[0]:void 0}a(QQo,"getDriveLetter");function qQo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(qQo,"indexOfPath");function jQo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,wQo.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(jQo,"parseLineAndColumnAware");var HQo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",GQo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function $Qo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var VQo=kx&&kx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WQo=kx&&kx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zQo=kx&&kx.__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(!KQo.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(JQo.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(ZQo,"_validateUri");function XQo(t,e){return!t&&!e?"file":t}a(XQo,"_schemeFix");function eqo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==Ek&&(e=Ek+e):e=Ek;break}return e}a(eqo,"_referenceResolution");var Bl="",Ek="/",tqo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,KYe=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||Bl,this.authority=e.authority||Bl,this.path=e.path||Bl,this.query=e.query||Bl,this.fragment=e.fragment||Bl):(this.scheme=XQo(e,c),this.authority=r||Bl,this.path=eqo(this.scheme,n||Bl),this.query=o||Bl,this.fragment=s||Bl,ZQo(this,c))}get fsPath(){return JYe(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=Bl),n===void 0?n=this.authority:n===null&&(n=Bl),o===void 0?o=this.path:o===null&&(o=Bl),s===void 0?s=this.query:s===null&&(s=Bl),c===void 0?c=this.fragment:c===null&&(c=Bl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new UQ(r,n,o,s,c)}static parse(e,r=!1){let n=tqo.exec(e);return n?new UQ(n[2]||Bl,zYe(n[4]||Bl),zYe(n[5]||Bl),zYe(n[7]||Bl),zYe(n[9]||Bl),r):new UQ(Bl,Bl,Bl,Bl,Bl)}static file(e){let r=Bl;if(YYe.isWindows&&(e=e.replace(/\\/g,Ek)),e[0]===Ek&&e[1]===Ek){let n=e.indexOf(Ek,2);n===-1?(r=e.substring(2),e=Ek):(r=e.substring(2,n),e=e.substring(n)||Ek)}return new UQ("file",r,e,Bl,Bl)}static from(e,r){return new UQ(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 YYe.isWindows&&e.scheme==="file"?n=t.file(GEn.win32.join(JYe(e,!0),...r)).path:n=GEn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return V7t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new UQ(e);return r._formatted=e.external??null,r._fsPath=e._sep===WEn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};kx.URI=KYe;function rqo(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(rqo,"isUriComponents");var WEn=YYe.isWindows?1:void 0,UQ=class extends KYe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=JYe(this,!1)),this._fsPath}toString(e=!1){return e?V7t(this,!0):(this._formatted||(this._formatted=V7t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=WEn),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}},zEn={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 $En(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=zEn[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($En,"encodeURIComponentFast");function nqo(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,YYe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(JYe,"uriToFsPath");function V7t(t,e){let r=e?nqo:$En,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=Ek,n+=Ek),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:$En(u,!1,!1)),n}a(V7t,"_asFormatted");function YEn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+YEn(t.substr(3)):t}}a(YEn,"decodeURIComponentGraceful");var VEn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function zYe(t){return t.match(VEn)?t.replace(VEn,e=>YEn(e)):t}a(zYe,"percentDecode")});var XY=I(as=>{"use strict";p();var iqo=as&&as.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oqo=as&&as.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),J7t=as&&as.__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;oZEn(t,r))}a(aqo,"matchesSomeScheme");as.connectionTokenCookieName="vscode-tkn";as.connectionTokenQueryName="tkn";var Y7t=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=z7t.posix.join(r??"/",XEn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return z7t.posix.join(this._serverRootPath,JM.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 sqo.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+=`&${as.connectionTokenQueryName}=${encodeURIComponent(s)}`),ZY.URI.from({scheme:W7t.isWeb?this._preferredWebSchema:JM.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};as.RemoteAuthorities=new Y7t;function XEn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(XEn,"getServerProductSegment");as.builtinExtensionsPath="vs/../../extensions";as.nodeModulesPath="vs/../../node_modules";as.nodeModulesAsarPath="vs/../../node_modules.asar";as.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";as.VSCODE_AUTHORITY="vscode-app";var K7t=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=as.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===JM.vscodeRemote?as.RemoteAuthorities.rewrite(e):e.scheme===JM.file&&(W7t.isNative||W7t.webWorkerOrigin===`${JM.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:JM.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===JM.vscodeFileResource?e.with({scheme:JM.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(ZY.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return ZY.URI.joinPath(ZY.URI.parse(r,!0),e);let n=z7t.join(r,e);return ZY.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};as.FileAccess=new K7t;as.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});as.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var JEn;(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:ZY.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})(JEn||(as.COI=JEn={}))});var _k=I(yr=>{"use strict";p();var cqo=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]})),lqo=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),r_n=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;oile.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=P_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=P_.sep){let n=!1;if(e.scheme===QQ.Schemas.file){let o=ZM(e);n=o!==void 0&&o.length===ile.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=ole;yr.extUri=new ole(()=>!1);yr.extUriBiasedIgnorePathCase=new ole(t=>t.scheme===QQ.Schemas.file?!n_n.isLinux:!0);yr.extUriIgnorePathCase=new ole(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 uqo(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(uqo,"distinctParents");var t_n;(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})(t_n||(yr.DataUri=t_n={}));function dqo(t,e,r){if(e){let n=t.path;return n&&n[0]!==P_.posix.sep&&(n=P_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(dqo,"toLocalResource")});var i_n=I(ZYe=>{"use strict";p();Object.defineProperty(ZYe,"__esModule",{value:!0});ZYe.MicrotaskDelay=void 0;ZYe.MicrotaskDelay=Symbol("MicrotaskDelay")});var Jc=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=a_n;Yt.createCancelablePromise=c_n;Yt.raceCancellation=l_n;Yt.raceCancellationError=mqo;Yt.rejectIfNotCanceled=gqo;Yt.notCancellablePromise=Aqo;Yt.raceCancellablePromises=yqo;Yt.raceTimeout=u_n;Yt.asPromise=Eqo;Yt.promiseWithResolvers=d_n;Yt.timeout=AQt;Yt.disposableTimeout=Cqo;Yt.sequence=bqo;Yt.first=Sqo;Yt.firstParallel=Tqo;Yt.installFakeRunWhenIdle=Iqo;Yt.retry=xqo;Yt.createCancelableAsyncIterableProducer=wqo;Yt.cancellableIterable=Rqo;Yt.createTimeout=Pqo;var gQt=Ak(),k_=Cs(),yIe=Cc(),qQ=wo(),o_n=_k(),fqo=BQ(),pqo=i_n(),hqo=s3();function a_n(t){return!!t&&typeof t.then=="function"}a(a_n,"isThenable");function c_n(t){let e=new gQt.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,qQ.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(c_n,"createCancelablePromise");function l_n(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(l_n,"raceCancellation");function mqo(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(mqo,"raceCancellationError");function gqo(t){if(!(0,k_.isCancellationError)(t))return Promise.reject(t)}a(gqo,"rejectIfNotCanceled");function Aqo(t){return new Promise((e,r)=>{t.then(e,r)})}a(Aqo,"notCancellablePromise");function yqo(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(yqo,"raceCancellablePromises");function u_n(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(u_n,"raceTimeout");function Eqo(t){return new Promise((e,r)=>{let n=t();a_n(n)?n.then(e,r):e(n)})}a(Eqo,"asPromise");function d_n(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(d_n,"promiseWithResolvers");var XYe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new gQt.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=XYe;var Z7t=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Yt.Sequencer=Z7t;var X7t=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=X7t;var _qo=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"),vqo=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),eKe=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===pqo.MicrotaskDelay?vqo(n):_qo(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()}};Yt.Delayer=eKe;var eQt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new eKe(e),this.throttler=new XYe}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=eQt;var tKe=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=tKe;var tQt=class extends tKe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Yt.AutoOpenBarrier=tQt;function AQt(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)})}):c_n(r=>AQt(t,r))}a(AQt,"timeout");function Cqo(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,qQ.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(Cqo,"disposableTimeout");function bqo(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(Sqo,"first");function Tqo(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(Tqo,"firstParallel");var rKe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new yIe.Emitter}whenIdle(){return this.size>0?yIe.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=rKe;var nKe=class extends rKe{static{a(this,"Queue")}constructor(){super(1)}};Yt.Queue=nKe;var rQt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new oKe,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=rQt;var nQt=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 c3;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=o_n.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=o_n.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new nKe;let c=this.drainListenerCount++,l=yIe.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 qQ.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=nQt;var iQt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new c3;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new c3;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)}};Yt.TaskQueue=iQt;var oQt=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))}};Yt.TimeoutTimer=oQt;var sQt=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,qQ.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Yt.IntervalTimer=sQt;var EIe=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=EIe;var aQt=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=aQt;var cQt=class extends EIe{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=cQt;var lQt=class extends qQ.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new qQ.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 EIe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Yt.ThrottledWorker=lQt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Yt._runWhenIdle=(e,r,n)=>{(0,fqo.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 Iqo(t){let e=Yt._runWhenIdle,r=Yt.runWhenGlobalIdle;return Yt._runWhenIdle=t,Yt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,qQ.toDisposable)(()=>{Yt._runWhenIdle=e,Yt.runWhenGlobalIdle=r})}a(Iqo,"installFakeRunWhenIdle");var iKe=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=iKe;var uQt=class extends iKe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Yt.GlobalIdleValue=uQt;async function xqo(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}=d_n();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=oKe;var dQt=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=dQt;var c3=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)}};Yt.DeferredPromise=c3;var s_n;(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})(s_n||(Yt.Promises=s_n={}));var sKe=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}};Yt.StatefulPromise=sKe;var fQt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new hqo.Lazy(()=>new sKe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Yt.LazyStatefulPromise=fQt;var aKe=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 yIe.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=aKe;function wqo(t){let e=new gQt.CancellationTokenSource,r=t(e.token);return new lKe(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(wqo,"createCancelableAsyncIterableProducer");var pQt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new c3,this._asyncIterable=new aKe(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=pQt;function Rqo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await l_n(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(Rqo,"cancellableIterable");var hQt=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 c3;return this._unsatisfiedConsumers.push(e),e.p}}},cKe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new hQt,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 c3,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=cKe;var lKe=class extends cKe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Yt.CancelableAsyncIterableProducer=lKe;Yt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var mQt=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 k_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await u_n(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=mQt;function Pqo(t,e){let r=setTimeout(e,t);return(0,qQ.toDisposable)(()=>clearTimeout(r))}a(Pqo,"createTimeout")});var E_n=I(PS=>{"use strict";p();var Oqo=PS&&PS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(PS,"__esModule",{value:!0});var Bqo=require("fs"),Lqo=Oqo(QP()),ale=Lqo.default("@kwsites/file-exists");function Fqo(t,e,r){ale("checking %s",t);try{let n=Bqo.statSync(t);return n.isFile()&&e?(ale("[OK] path represents a file"),!0):n.isDirectory()&&r?(ale("[OK] path represents a directory"),!0):(ale("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return ale("[FAIL] path is not accessible: %o",n),!1;throw ale("[FATAL] %o",n),n}}a(Fqo,"check");function Uqo(t,e=PS.READABLE){return Fqo(t,(e&PS.FILE)>0,(e&PS.FOLDER)>0)}a(Uqo,"exists");PS.exists=Uqo;PS.FILE=1;PS.FOLDER=2;PS.READABLE=PS.FILE+PS.FOLDER});var __n=I(mKe=>{"use strict";p();function Qqo(t){for(var e in t)mKe.hasOwnProperty(e)||(mKe[e]=t[e])}a(Qqo,"__export");Object.defineProperty(mKe,"__esModule",{value:!0});Qqo(E_n())});var C_n=I((eid,v_n)=>{p();var ule=1e3,dle=ule*60,fle=dle*60,eK=fle*24,qqo=eK*7,jqo=eK*365.25;v_n.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Hqo(t);if(r==="number"&&isFinite(t))return e.long?$qo(t):Gqo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Hqo(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*jqo;case"weeks":case"week":case"w":return r*qqo;case"days":case"day":case"d":return r*eK;case"hours":case"hour":case"hrs":case"hr":case"h":return r*fle;case"minutes":case"minute":case"mins":case"min":case"m":return r*dle;case"seconds":case"second":case"secs":case"sec":case"s":return r*ule;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Hqo,"parse");function Gqo(t){var e=Math.abs(t);return e>=eK?Math.round(t/eK)+"d":e>=fle?Math.round(t/fle)+"h":e>=dle?Math.round(t/dle)+"m":e>=ule?Math.round(t/ule)+"s":t+"ms"}a(Gqo,"fmtShort");function $qo(t){var e=Math.abs(t);return e>=eK?gKe(t,e,eK,"day"):e>=fle?gKe(t,e,fle,"hour"):e>=dle?gKe(t,e,dle,"minute"):e>=ule?gKe(t,e,ule,"second"):t+" ms"}a($qo,"fmtLong");function gKe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(gKe,"plural")});var vQt=I((nid,b_n)=>{p();function Vqo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=C_n(),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(Vqo,"setup");b_n.exports=Vqo});var S_n=I((kS,AKe)=>{p();kS.formatArgs=zqo;kS.save=Yqo;kS.load=Kqo;kS.useColors=Wqo;kS.storage=Jqo();kS.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`."))}})();kS.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 Wqo(){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(Wqo,"useColors");function zqo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+AKe.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(zqo,"formatArgs");kS.log=console.debug||console.log||(()=>{});function Yqo(t){try{t?kS.storage.setItem("debug",t):kS.storage.removeItem("debug")}catch{}}a(Yqo,"save");function Kqo(){let t;try{t=kS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Kqo,"load");function Jqo(){try{return localStorage}catch{}}a(Jqo,"localstorage");AKe.exports=vQt()(kS);var{formatters:Zqo}=AKe.exports;Zqo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var I_n=I((sg,EKe)=>{p();var Xqo=require("tty"),yKe=require("util");sg.init=sjo;sg.log=njo;sg.formatArgs=tjo;sg.save=ijo;sg.load=ojo;sg.useColors=ejo;sg.destroy=yKe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");sg.colors=[6,2,3,4,5,1];try{let t=Dje();t&&(t.stderr||t).level>=2&&(sg.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{}sg.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 ejo(){return"colors"in sg.inspectOpts?!!sg.inspectOpts.colors:Xqo.isatty(process.stderr.fd)}a(ejo,"useColors");function tjo(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+"+aJe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=cVo()+e+" "+t[0]}a(aVo,"formatArgs");function cVo(){return sg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(cVo,"getDate");function lVo(...t){return process.stderr.write(sJe.formatWithOptions(sg.inspectOpts,...t)+` -`)}a(lVo,"log");function uVo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(uVo,"save");function dVo(){return process.env.DEBUG}a(dVo,"load");function fVo(t){t.inspectOpts={};let e=Object.keys(sg.inspectOpts);for(let r=0;re.trim()).join(" ")};lvn.O=function(t){return this.inspectOpts.colors=this.useColors,sJe.inspect(t,this.inspectOpts)}});var dvn=I((pud,wqt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?wqt.exports=cvn():wqt.exports=uvn()});var kqt=I(_K=>{"use strict";p();Object.defineProperty(_K,"__esModule",{value:!0});_K.createDeferred=_K.deferred=void 0;function Rqt(){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(Rqt,"deferred");_K.deferred=Rqt;_K.createDeferred=Rqt;_K.default=Rqt});var MJe=I(QS=>{"use strict";p();Object.defineProperty(QS,"__esModule",{value:!0});QS.deepClone=pSn;QS.deepFreeze=YYo;QS.cloneAndChange=KYo;QS.mixin=mSn;QS.equals=cxe;QS.safeStringify=JYo;QS.stableStringify=ZYo;QS.distinct=XYo;QS.getCaseInsensitive=eKo;QS.filter=tKo;QS.mapValues=rKo;var lq=BS();function pSn(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"?pSn(n):n}),e}a(pSn,"deepClone");function YYo(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(hSn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,lq.isTypedArray)(o)&&e.push(o)}}return t}a(YYo,"deepFreeze");var hSn=Object.prototype.hasOwnProperty;function KYo(t,e){return kjt(t,e,new Set)}a(KYo,"cloneAndChange");function kjt(t,e,r){if((0,lq.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(kjt(s,e,r));return o}if((0,lq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)hSn.call(t,s)&&(o[s]=kjt(t[s],e,r));return r.delete(t),o}return t}a(kjt,"_cloneAndChange");function mSn(t,e,r=!0){return(0,lq.isObject)(t)?((0,lq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,lq.isObject)(t[n])&&(0,lq.isObject)(e[n])?mSn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(mSn,"mixin");function cxe(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,lq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(JYo,"safeStringify");function ZYo(t){if(t===void 0)return"undefined";try{return Pjt(t,new WeakSet)}catch{return""}}a(ZYo,"stableStringify");function Pjt(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=>Pjt(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)+":"+Pjt(s,e))}return"{"+n.join(",")+"}"}a(Pjt,"_stableStringify");function XYo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];cxe(s,c)||(r[o]=c)}),r}a(XYo,"distinct");function eKo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(eKo,"getCaseInsensitive");function tKo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(tKo,"filter");function rKo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(rKo,"mapValues")});var L_=I(OJe=>{"use strict";p();Object.defineProperty(OJe,"__esModule",{value:!0});OJe.ErrorUtils=void 0;var nKo=MJe(),gSn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,nKo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(gSn||(OJe.ErrorUtils=gSn={}))});var Gx=I(BJe=>{"use strict";p();Object.defineProperty(BJe,"__esModule",{value:!0});BJe.Result=void 0;var Djt=L_(),ASn;(function(t){function e(c){return new Njt(c)}a(e,"ok"),t.ok=e;function r(c){return new Mjt(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(Djt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(Djt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(ASn||(BJe.Result=ASn={}));var Njt=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}},Mjt=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:Djt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var Od=I((Q$d,wRn)=>{p();wRn.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 mc=I((j$d,XRn)=>{"use strict";p();var RRn=Symbol.for("undici.error.UND_ERR"),Bd=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[RRn]===!0}[RRn]=!0},kRn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),NKt=class extends Bd{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[kRn]===!0}[kRn]=!0},PRn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),MKt=class extends Bd{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[PRn]===!0}[PRn]=!0},DRn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),OKt=class extends Bd{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[DRn]===!0}[DRn]=!0},NRn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),BKt=class extends Bd{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[NRn]===!0}[NRn]=!0},MRn=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),LKt=class extends Bd{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[MRn]===!0}[MRn]=!0},ORn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),FKt=class extends Bd{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[ORn]===!0}[ORn]=!0},BRn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),UKt=class extends Bd{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[BRn]===!0}[BRn]=!0},LRn=Symbol.for("undici.error.UND_ERR_ABORT"),vtt=class extends Bd{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[LRn]===!0}[LRn]=!0},FRn=Symbol.for("undici.error.UND_ERR_ABORTED"),QKt=class extends vtt{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[FRn]===!0}[FRn]=!0},URn=Symbol.for("undici.error.UND_ERR_INFO"),qKt=class extends Bd{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[URn]===!0}[URn]=!0},QRn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),jKt=class extends Bd{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[QRn]===!0}[QRn]=!0},qRn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),HKt=class extends Bd{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[qRn]===!0}[qRn]=!0},jRn=Symbol.for("undici.error.UND_ERR_DESTROYED"),GKt=class extends Bd{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[jRn]===!0}[jRn]=!0},HRn=Symbol.for("undici.error.UND_ERR_CLOSED"),$Kt=class extends Bd{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[HRn]===!0}[HRn]=!0},GRn=Symbol.for("undici.error.UND_ERR_SOCKET"),VKt=class extends Bd{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[GRn]===!0}[GRn]=!0},$Rn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),WKt=class extends Bd{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[$Rn]===!0}[$Rn]=!0},VRn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),zKt=class extends Bd{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[VRn]===!0}[VRn]=!0},WRn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),YKt=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[WRn]===!0}[WRn]=!0},zRn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),KKt=class extends Bd{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[zRn]===!0}[zRn]=!0},YRn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),JKt=class extends Bd{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[YRn]===!0}[YRn]=!0},KRn=Symbol.for("undici.error.UND_ERR_RESPONSE"),ZKt=class extends Bd{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[KRn]===!0}[KRn]=!0},JRn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),XKt=class extends Bd{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[JRn]===!0}[JRn]=!0},ZRn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),eJt=class extends Bd{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[ZRn]===!0}get[ZRn](){return!0}};XRn.exports={AbortError:vtt,HTTPParserError:YKt,UndiciError:Bd,HeadersTimeoutError:MKt,HeadersOverflowError:OKt,BodyTimeoutError:BKt,RequestContentLengthMismatchError:jKt,ConnectTimeoutError:NKt,ResponseStatusCodeError:LKt,InvalidArgumentError:FKt,InvalidReturnValueError:UKt,RequestAbortedError:QKt,ClientDestroyedError:GKt,ClientClosedError:$Kt,InformationalError:qKt,SocketError:VKt,NotSupportedError:WKt,ResponseContentLengthMismatchError:HKt,BalancedPoolMissingUpstreamError:zKt,ResponseExceededMaxSizeError:KKt,RequestRetryError:JKt,ResponseError:ZKt,SecureProxyConnectionError:XKt,MessageSizeExceededError:eJt}});var Stt=I(($$d,ekn)=>{"use strict";p();var btt={},tJt=["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:tkn,headerNameLowerCasedRecord:qss}=Stt(),rJt=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 Pwe=require("node:assert"),{kDestroyed:skn,kBodyUsed:que,kListeners:nJt,kBody:okn}=Od(),{IncomingMessage:jss}=require("node:http"),wtt=require("node:stream"),Hss=require("node:net"),{Blob:Gss}=require("node:buffer"),$ss=require("node:util"),{stringify:Vss}=require("node:querystring"),{EventEmitter:Wss}=require("node:events"),{InvalidArgumentError:fg}=mc(),{headerNameLowerCasedRecord:zss}=Stt(),{tree:akn}=ikn(),[Yss,Kss]=process.versions.node.split(".").map(t=>Number(t)),xtt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[okn]=e,this[que]=!1}async*[Symbol.asyncIterator](){Pwe(!this[que],"disturbed"),this[que]=!0,yield*this[okn]}};function Jss(t){return Rtt(t)?(fkn(t)===0&&t.on("data",function(){Pwe(!1)}),typeof t.readableDidRead!="boolean"&&(t[que]=!1,Wss.prototype.on.call(t,"data",function(){this[que]=!0})),t):t&&typeof t.pipeTo=="function"?new xtt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&dkn(t)?new xtt(t):t}a(Jss,"wrapRequestBody");function Zss(){}a(Zss,"nop");function Rtt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Rtt,"isStream");function ckn(t){if(t===null)return!1;if(t instanceof Gss)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(ckn,"isBlobLike");function Xss(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Vss(e);return r&&(t+="?"+r),t}a(Xss,"buildURL");function lkn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(lkn,"isValidPort");function Itt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Itt,"isHttpOrHttpsPrefixed");function ukn(t){if(typeof t=="string"){if(t=new URL(t),!Itt(t.origin||t.protocol))throw new fg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new fg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&lkn(t.port)===!1)throw new fg("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 fg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new fg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new fg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new fg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Itt(t.origin||t.protocol))throw new fg("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(!Itt(t.origin||t.protocol))throw new fg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(ukn,"parseURL");function eas(t){if(t=ukn(t),t.pathname!=="/"||t.search||t.hash)throw new fg("invalid url");return t}a(eas,"parseOrigin");function tas(t){if(t[0]==="["){let r=t.indexOf("]");return Pwe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(tas,"getHostname");function ras(t){if(!t)return null;Pwe(typeof t=="string");let e=tas(t);return Hss.isIP(e)?"":e}a(ras,"getServerName");function nas(t){return JSON.parse(JSON.stringify(t))}a(nas,"deepClone");function ias(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(ias,"isAsyncIterable");function dkn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(dkn,"isIterable");function fkn(t){if(t==null)return 0;if(Rtt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(ckn(t))return t.size!=null?t.size:null;if(mkn(t))return t.byteLength}return null}a(fkn,"bodyLength");function pkn(t){return t&&!!(t.destroyed||t[skn]||wtt.isDestroyed?.(t))}a(pkn,"isDestroyed");function oas(t,e){t==null||!Rtt(t)||pkn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===jss&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[skn]=!0))}a(oas,"destroy");var sas=/timeout=(\d+)/;function aas(t){let e=t.toString().match(sas);return e?parseInt(e[1],10)*1e3:null}a(aas,"parseKeepAliveTimeout");function hkn(t){return typeof t=="string"?zss[t]??t.toLowerCase():akn.lookup(t)??t.toString("latin1").toLowerCase()}a(hkn,"headerNameToString");function cas(t){return akn.lookup(t)??t.toString("latin1").toLowerCase()}a(cas,"bufferToLowerCasedHeaderName");function las(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(las,"parseHeaders");function uas(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(gas,"ReadableStreamFrom");function Aas(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(Aas,"isFormDataLike");function yas(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(yas,"addAbortListener");var Eas=typeof String.prototype.toWellFormed=="function",_as=typeof String.prototype.isWellFormed=="function";function gkn(t){return Eas?`${t}`.toWellFormed():$ss.toUSVString(t)}a(gkn,"toUSVString");function Cas(t){return _as?`${t}`.isWellFormed():gkn(t)===`${t}`}a(Cas,"isUSVString");function Akn(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(Akn,"isTokenCharCode");function vas(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Fc=require("node:diagnostics_channel"),sJt=require("node:util"),ktt=sJt.debuglog("undici"),oJt=sJt.debuglog("fetch"),nJ=sJt.debuglog("websocket"),Ckn=!1,Ras={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(ktt.enabled||oJt.enabled){let t=oJt.enabled?oJt:ktt;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)}),Ckn=!0}if(nJ.enabled){if(!Ckn){let t=ktt.enabled?ktt:nJ;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;nJ("connection opened %s%s",e,r?`:${r}`:"")}),Fc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;nJ("closed connection to %s - %s %s",e.url,r,n)}),Fc.channel("undici:websocket:socket_error").subscribe(t=>{nJ("connection errored - %s",t.message)}),Fc.channel("undici:websocket:ping").subscribe(t=>{nJ("ping received")}),Fc.channel("undici:websocket:pong").subscribe(t=>{nJ("pong received")})}vkn.exports={channels:Ras}});var Ikn=I((tVd,Tkn)=>{"use strict";p();var{InvalidArgumentError:Au,NotSupportedError:kas}=mc(),W3=require("node:assert"),{isValidHTTPToken:Skn,isValidHeaderValue:aJt,isStream:Pas,destroy:Das,isBuffer:Nas,isFormDataLike:Mas,isIterable:Oas,isBlobLike:Bas,buildURL:Las,validateHandler:Fas,getServerName:Uas,normalizedMethodRecords:Qas}=Ls(),{channels:kO}=jue(),{headerNameLowerCasedRecord:bkn}=Stt(),qas=/[^\u0021-\u00ff]/,Xx=Symbol("handler"),cJt=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 Au("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Au("path must be an absolute URL or start with a slash");if(qas.test(r))throw new Au("invalid request path");if(typeof n!="string")throw new Au("method must be a string");if(Qas[n]===void 0&&!Skn(n))throw new Au("invalid request method");if(d&&typeof d!="string")throw new Au("upgrade must be a string");if(d&&!aJt(d))throw new Au("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Au("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Au("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Au("invalid reset");if(A!=null&&typeof A!="boolean")throw new Au("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(Pas(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){Das(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(Nas(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(Mas(o)||Oas(o)||Bas(o))this.body=o;else throw new Au("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?Las(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 Au("headers array must be even");for(let _=0;_{"use strict";p();var jas=require("node:events"),Dtt=class extends jas{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 lJt(this,n)}},lJt=class extends Dtt{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)}};xkn.exports=Dtt});var Vue=I((aVd,wkn)=>{"use strict";p();var Has=Dwe(),{ClientDestroyedError:uJt,ClientClosedError:Gas,InvalidArgumentError:Hue}=mc(),{kDestroy:$as,kClose:Vas,kClosed:Nwe,kDestroyed:Gue,kDispatch:dJt,kInterceptors:iJ}=Od(),z3=Symbol("onDestroyed"),$ue=Symbol("onClosed"),Ntt=Symbol("Intercepted Dispatch"),fJt=class extends Has{static{a(this,"DispatcherBase")}constructor(){super(),this[Gue]=!1,this[z3]=null,this[Nwe]=!1,this[$ue]=[]}get destroyed(){return this[Gue]}get closed(){return this[Nwe]}get interceptors(){return this[iJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[iJ][r]!="function")throw new Hue("interceptor must be an function")}this[iJ]=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 Hue("invalid callback");if(this[Gue]){queueMicrotask(()=>e(new uJt,null));return}if(this[Nwe]){this[$ue]?this[$ue].push(e):queueMicrotask(()=>e(null,null));return}this[Nwe]=!0,this[$ue].push(e);let r=a(()=>{let n=this[$ue];this[$ue]=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 Hue("invalid callback");if(this[Gue]){this[z3]?this[z3].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new uJt),this[Gue]=!0,this[z3]=this[z3]||[],this[z3].push(r);let n=a(()=>{let o=this[z3];this[z3]=null;for(let s=0;s{queueMicrotask(n)})}[Ntt](e,r){if(!this[iJ]||this[iJ].length===0)return this[Ntt]=this[dJt],this[dJt](e,r);let n=this[dJt].bind(this);for(let o=this[iJ].length-1;o>=0;o--)n=this[iJ][o](n);return this[Ntt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Hue("handler must be an object");try{if(!e||typeof e!="object")throw new Hue("opts must be an object.");if(this[Gue]||this[z3])throw new uJt;if(this[Nwe])throw new Gas;return this[Ntt](e,r)}catch(n){if(typeof r.onError!="function")throw new Hue("invalid onError method");return r.onError(n),!1}}};wkn.exports=fJt});var EJt=I((uVd,Dkn)=>{"use strict";p();var Wue=0,pJt=1e3,hJt=(pJt>>1)-1,Y3,mJt=Symbol("kFastTimer"),K3=[],gJt=-2,AJt=-1,kkn=0,Rkn=1;function yJt(){Wue+=hJt;let t=0,e=K3.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=AJt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===AJt?(r._state=gJt,--e!==0&&(K3[t]=K3[e])):++t}K3.length=e,K3.length!==0&&Pkn()}a(yJt,"onTick");function Pkn(){Y3?Y3.refresh():(clearTimeout(Y3),Y3=setTimeout(yJt,hJt),Y3.unref&&Y3.unref())}a(Pkn,"refreshTimeout");var Mtt=class{static{a(this,"FastTimer")}[mJt]=!0;_state=gJt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===gJt&&K3.push(this),(!Y3||K3.length===1)&&Pkn(),this._state=kkn}clear(){this._state=AJt,this._idleStart=-1}};Dkn.exports={setTimeout(t,e,r){return e<=pJt?setTimeout(t,e,r):new Mtt(t,e,r)},clearTimeout(t){t[mJt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Mtt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Wue},tick(t=0){Wue+=t-pJt+1,yJt(),yJt()},reset(){Wue=0,K3.length=0,clearTimeout(Y3),Y3=null},kFastTimer:mJt}});var Mwe=I((mVd,Lkn)=>{"use strict";p();var Was=require("node:net"),Nkn=require("node:assert"),Bkn=Ls(),{InvalidArgumentError:zas,ConnectTimeoutError:Yas}=mc(),Ott=EJt();function Mkn(){}a(Mkn,"noop");var _Jt,CJt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?CJt=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 Kas({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new zas("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new CJt(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:"){_Jt||(_Jt=require("node:tls")),g=g||c.servername||Bkn.getServerName(f)||null;let b=g||d;Nkn(b);let T=o||l.get(b)||null;m=m||443,_=_Jt.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 Nkn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Was.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=Jas(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(Kas,"buildConnector");var Jas=process.platform==="win32"?(t,e)=>{if(!e.timeout)return Mkn;let r=null,n=null,o=Ott.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>Okn(t.deref(),e))})},e.timeout);return()=>{Ott.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return Mkn;let r=null,n=Ott.setFastTimeout(()=>{r=setImmediate(()=>{Okn(t.deref(),e)})},e.timeout);return()=>{Ott.clearFastTimeout(n),clearImmediate(r)}};function Okn(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)`,Bkn.destroy(t,new Yas(r))}a(Okn,"onConnectTimeout");Lkn.exports=Kas});var Fkn=I(Btt=>{"use strict";p();Object.defineProperty(Btt,"__esModule",{value:!0});Btt.enumToMap=void 0;function Zas(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Zas,"enumToMap");Btt.enumToMap=Zas});var Ukn=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 Xas=Fkn(),ecs;(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"})(ecs=kr.ERROR||(kr.ERROR={}));var tcs;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(tcs=kr.TYPE||(kr.TYPE={}));var rcs;(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"})(rcs=kr.FLAGS||(kr.FLAGS={}));var ncs;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(ncs=kr.LENIENT_FLAGS||(kr.LENIENT_FLAGS={}));var Di;(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"})(Di=kr.METHODS||(kr.METHODS={}));kr.METHODS_HTTP=[Di.DELETE,Di.GET,Di.HEAD,Di.POST,Di.PUT,Di.CONNECT,Di.OPTIONS,Di.TRACE,Di.COPY,Di.LOCK,Di.MKCOL,Di.MOVE,Di.PROPFIND,Di.PROPPATCH,Di.SEARCH,Di.UNLOCK,Di.BIND,Di.REBIND,Di.UNBIND,Di.ACL,Di.REPORT,Di.MKACTIVITY,Di.CHECKOUT,Di.MERGE,Di["M-SEARCH"],Di.NOTIFY,Di.SUBSCRIBE,Di.UNSUBSCRIBE,Di.PATCH,Di.PURGE,Di.MKCALENDAR,Di.LINK,Di.UNLINK,Di.PRI,Di.SOURCE];kr.METHODS_ICE=[Di.SOURCE];kr.METHODS_RTSP=[Di.OPTIONS,Di.DESCRIBE,Di.ANNOUNCE,Di.SETUP,Di.PLAY,Di.PAUSE,Di.TEARDOWN,Di.GET_PARAMETER,Di.SET_PARAMETER,Di.REDIRECT,Di.RECORD,Di.FLUSH,Di.GET,Di.POST];kr.METHOD_MAP=Xas.enumToMap(Di);kr.H_METHOD_MAP={};Object.keys(kr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(kr.H_METHOD_MAP[t]=kr.METHOD_MAP[t])});var ics;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(ics=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 zue;(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"})(zue=kr.HEADER_STATE||(kr.HEADER_STATE={}));kr.SPECIAL_HEADERS={connection:zue.CONNECTION,"content-length":zue.CONTENT_LENGTH,"proxy-connection":zue.CONNECTION,"transfer-encoding":zue.TRANSFER_ENCODING,upgrade:zue.UPGRADE}});var vJt=I((bVd,Qkn)=>{"use strict";p();var{Buffer:ocs}=require("node:buffer");Qkn.exports=ocs.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 jkn=I((TVd,qkn)=>{"use strict";p();var{Buffer:scs}=require("node:buffer");qkn.exports=scs.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 Owe=I((xVd,Kkn)=>{"use strict";p();var Hkn=["GET","HEAD","POST"],acs=new Set(Hkn),ccs=[101,204,205,304],Gkn=[301,302,303,307,308],lcs=new Set(Gkn),$kn=["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"],ucs=new Set($kn),Vkn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],dcs=new Set(Vkn),fcs=["follow","manual","error"],Wkn=["GET","HEAD","OPTIONS","TRACE"],pcs=new Set(Wkn),hcs=["navigate","same-origin","no-cors","cors"],mcs=["omit","same-origin","include"],gcs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],Acs=["content-encoding","content-language","content-location","content-type","content-length"],ycs=["half"],zkn=["CONNECT","TRACE","TRACK"],Ecs=new Set(zkn),Ykn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],_cs=new Set(Ykn);Kkn.exports={subresource:Ykn,forbiddenMethods:zkn,requestBodyHeader:Acs,referrerPolicy:Vkn,requestRedirect:fcs,requestMode:hcs,requestCredentials:mcs,requestCache:gcs,redirectStatus:Gkn,corsSafeListedMethods:Hkn,nullBodyStatus:ccs,safeMethods:Wkn,badPorts:$kn,requestDuplex:ycs,subresourceSet:_cs,badPortsSet:ucs,redirectStatusSet:lcs,corsSafeListedMethodsSet:acs,safeMethodsSet:pcs,forbiddenMethodsSet:Ecs,referrerPolicySet:dcs}});var SJt=I((RVd,Jkn)=>{"use strict";p();var bJt=Symbol.for("undici.globalOrigin.1");function Ccs(){return globalThis[bJt]}a(Ccs,"getGlobalOrigin");function vcs(t){if(t===void 0){Object.defineProperty(globalThis,bJt,{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,bJt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(vcs,"setGlobalOrigin");Jkn.exports={getGlobalOrigin:Ccs,setGlobalOrigin:vcs}});var Gv=I((DVd,iPn)=>{"use strict";p();var Ftt=require("node:assert"),bcs=new TextEncoder,Bwe=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,Scs=/[\u000A\u000D\u0009\u0020]/,Tcs=/[\u0009\u000A\u000C\u000D\u0020]/g,Ics=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function xcs(t){Ftt(t.protocol==="data:");let e=ePn(t,!0);e=e.slice(5);let r={position:0},n=Yue(",",e,r),o=n.length;if(n=Ncs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=tPn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=nPn(c);if(c=Rcs(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=TJt(n);return l==="failure"&&(l=TJt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(xcs,"dataURLProcessor");function ePn(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(ePn,"URLSerializer");function Utt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(Zkn,"isHexCharByte");function Xkn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(Xkn,"hexByteToNumber");function wcs(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Yue(";",t,e);if(n=Ltt(n,!1,!0),n.length===0||!Bwe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionScs.test(d),t,e);let l=Utt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=rPn(t,e,!0),Yue(";",t,e);else if(u=Yue(";",t,e),u=Ltt(u,!1,!0),u.length===0)continue;l.length!==0&&Bwe.test(l)&&(u.length===0||Ics.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(TJt,"parseMIMEType");function Rcs(t){t=t.replace(Tcs,"");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(Rcs,"forgivingBase64");function rPn(t,e,r){let n=e.position,o="";for(Ftt(t[e.position]==='"'),e.position++;o+=Utt(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{Ftt(s==='"');break}}return r?o:t.slice(n,e.position)}a(rPn,"collectAnHTTPQuotedString");function kcs(t){Ftt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",Bwe.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(kcs,"serializeAMimeType");function Pcs(t){return t===13||t===10||t===9||t===32}a(Pcs,"isHTTPWhiteSpace");function Ltt(t,e=!0,r=!0){return IJt(t,e,r,Pcs)}a(Ltt,"removeHTTPWhitespace");function Dcs(t){return t===13||t===10||t===9||t===12||t===32}a(Dcs,"isASCIIWhitespace");function Ncs(t,e=!0,r=!0){return IJt(t,e,r,Dcs)}a(Ncs,"removeASCIIWhitespace");function IJt(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(IJt,"removeChars");function nPn(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(nPn,"isomorphicDecode");function Mcs(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(Mcs,"minimizeSupportedMimeType");iPn.exports={dataURLProcessor:xcs,URLSerializer:ePn,collectASequenceOfCodePoints:Utt,collectASequenceOfCodePointsFast:Yue,stringPercentDecode:tPn,parseMIMEType:TJt,collectAnHTTPQuotedString:rPn,serializeAMimeType:kcs,removeChars:IJt,removeHTTPWhitespace:Ltt,minimizeSupportedMimeType:Mcs,HTTP_TOKEN_CODEPOINTS:Bwe,isomorphicDecode:nPn}});var bA=I((OVd,oPn)=>{"use strict";p();var{types:PO,inspect:Ocs}=require("node:util"),{markAsUncloneable:Bcs}=require("node:worker_threads"),{toUSVString:Lcs}=Ls(),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 Ocs(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(!PO.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=Lcs;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"||!PO.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&PO.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"||!PO.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&&PO.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"||!PO.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&PO.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(PO.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(PO.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(PO.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);oPn.exports={webidl:Er}});var $S=I((LVd,EPn)=>{"use strict";p();var{Transform:Fcs}=require("node:stream"),sPn=require("node:zlib"),{redirectStatusSet:Ucs,referrerPolicySet:Qcs,badPortsSet:qcs}=Owe(),{getGlobalOrigin:aPn}=SJt(),{collectASequenceOfCodePoints:oJ,collectAnHTTPQuotedString:jcs,removeChars:Hcs,parseMIMEType:Gcs}=Gv(),{performance:$cs}=require("node:perf_hooks"),{isBlobLike:Vcs,ReadableStreamFrom:Wcs,isValidHTTPToken:cPn,normalizedMethodRecordsBase:zcs}=Ls(),sJ=require("node:assert"),{isUint8Array:Ycs}=require("node:util/types"),{webidl:Lwe}=bA(),lPn=[],qtt;try{qtt=require("node:crypto");let t=["sha256","sha384","sha512"];lPn=qtt.getHashes().filter(e=>t.includes(e))}catch{}function uPn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(uPn,"responseURL");function Kcs(t,e){if(!Ucs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&fPn(r)&&(dPn(r)||(r=Jcs(r)),r=new URL(r,uPn(t))),r&&!r.hash&&(r.hash=e),r}a(Kcs,"responseLocationURL");function dPn(t){for(let e=0;e126||r<32)return!1}return!0}a(dPn,"isValidEncodedURL");function Jcs(t){return Buffer.from(t,"binary").toString("utf8")}a(Jcs,"normalizeBinaryStringToUtf8");function Uwe(t){return t.urlList[t.urlList.length-1]}a(Uwe,"requestCurrentURL");function Zcs(t){let e=Uwe(t);return APn(e)&&qcs.has(e.port)?"blocked":"allowed"}a(Zcs,"requestBadPort");function Xcs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Xcs,"isErrorLike");function els(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(els,"isValidReasonPhrase");var tls=cPn;function fPn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(fPn,"isValidHeaderValue");function rls(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(Qcs.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(rls,"setRequestReferrerPolicyOnRedirect");function nls(){return"allowed"}a(nls,"crossOriginResourcePolicyCheck");function ils(){return"success"}a(ils,"corsCheck");function ols(){return"success"}a(ols,"TAOCheck");function sls(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(sls,"appendFetchMetadata");function als(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&&wJt(t.origin)&&!wJt(Uwe(t))&&(e=null);break;case"same-origin":jtt(t,Uwe(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(als,"appendRequestOriginHeader");function Kue(t,e){return t}a(Kue,"coarsenTime");function cls(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=jtt(t,n),c=Fwe(n)&&!Fwe(t.url);switch(e){case"origin":return o??xJt(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=Uwe(t);return jtt(n,l)?n:Fwe(n)&&!Fwe(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(fls,"determineRequestsReferrer");function xJt(t,e){return sJ(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(xJt,"stripURLForReferrer");function Fwe(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(Fwe,"isURLPotentiallyTrustworthy");function pls(t,e){if(qtt===void 0)return!0;let r=hPn(e);if(r==="no metadata"||r.length===0)return!0;let n=mls(r),o=gls(r,n);for(let s of o){let c=s.algo,l=s.hash,u=qtt.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)),Als(u,l))return!0}return!1}a(pls,"bytesMatch");var hls=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function hPn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=hls.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();lPn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(hPn,"parseMetadata");function mls(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(Els,"createDeferredPromise");function _ls(t){return t.controller.state==="aborted"}a(_ls,"isAborted");function Cls(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Cls,"isCancelled");function vls(t){return zcs[t.toLowerCase()]??t}a(vls,"normalizeMethod");function bls(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return sJ(typeof e=="string"),e}a(bls,"serializeJavascriptValueToJSONString");var Sls=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function mPn(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,Sls),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(mPn,"createIterator");function Tls(t,e,r,n=0,o=1){let s=mPn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Lwe.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Lwe.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Lwe.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Lwe.brandCheck(this,e),Lwe.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(Tls,"iteratorMixin");async function Ils(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await gPn(s))}catch(c){o(c)}}a(Ils,"fullyReadBody");function xls(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(xls,"isReadableStreamLike");function wls(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(wls,"readableStreamClose");var Rls=/[^\x00-\xFF]/;function Qtt(t){return sJ(!Rls.test(t)),t}a(Qtt,"isomorphicEncode");async function gPn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!Ycs(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(gPn,"readAllBytes");function kls(t){sJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(kls,"urlIsLocal");function wJt(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(wJt,"urlHasHttpsScheme");function APn(t){sJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(APn,"urlIsHttpHttpsScheme");function Pls(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&oJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&oJ(u=>u===" "||u===" ",r,n);let o=oJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&oJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&oJ(u=>u===" "||u===" ",r,n);let c=oJ(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(Pls,"simpleRangeHeaderValue");function Dls(t,e,r){let n="bytes ";return n+=Qtt(`${t}`),n+="-",n+=Qtt(`${e}`),n+="/",n+=Qtt(`${r}`),n}a(Dls,"buildContentRange");var RJt=class extends Fcs{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?sPn.createInflate(this.#e):sPn.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 Nls(t){return new RJt(t)}a(Nls,"createInflate");function Mls(t){let e=null,r=null,n=null,o=yPn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Gcs(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(Mls,"extractMimeType");function Ols(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(Ols,"gettingDecodingSplitting");function yPn(t,e){let r=e.get(t,!0);return r===null?null:Ols(r)}a(yPn,"getDecodeSplit");var Bls=new TextDecoder;function Lls(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),Bls.decode(t))}a(Lls,"utf8DecodeBytes");var kJt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return aPn()}get origin(){return this.baseUrl?.origin}policyContainer=pPn()},PJt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new kJt},Fls=new PJt;EPn.exports={isAborted:_ls,isCancelled:Cls,isValidEncodedURL:dPn,createDeferredPromise:Els,ReadableStreamFrom:Wcs,tryUpgradeRequestToAPotentiallyTrustworthyURL:yls,clampAndCoarsenConnectionTimingInfo:cls,coarsenedSharedCurrentTime:lls,determineRequestsReferrer:fls,makePolicyContainer:pPn,clonePolicyContainer:dls,appendFetchMetadata:sls,appendRequestOriginHeader:als,TAOCheck:ols,corsCheck:ils,crossOriginResourcePolicyCheck:nls,createOpaqueTimingInfo:uls,setRequestReferrerPolicyOnRedirect:rls,isValidHTTPToken:cPn,requestBadPort:Zcs,requestCurrentURL:Uwe,responseURL:uPn,responseLocationURL:Kcs,isBlobLike:Vcs,isURLPotentiallyTrustworthy:Fwe,isValidReasonPhrase:els,sameOrigin:jtt,normalizeMethod:vls,serializeJavascriptValueToJSONString:bls,iteratorMixin:Tls,createIterator:mPn,isValidHeaderName:tls,isValidHeaderValue:fPn,isErrorLike:Xcs,fullyReadBody:Ils,bytesMatch:pls,isReadableStreamLike:xls,readableStreamClose:wls,isomorphicEncode:Qtt,urlIsLocal:kls,urlHasHttpsScheme:wJt,urlIsHttpHttpsScheme:APn,readAllBytes:gPn,simpleRangeHeaderValue:Pls,buildContentRange:Dls,parseMetadata:hPn,createInflate:Nls,extractMimeType:Mls,getDecodeSplit:yPn,utf8DecodeBytes:Lls,environmentSettingsObject:Fls}});var kq=I((QVd,_Pn)=>{"use strict";p();_Pn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var NJt=I((jVd,CPn)=>{"use strict";p();var{Blob:Uls,File:Qls}=require("node:buffer"),{kState:J3}=kq(),{webidl:DO}=bA(),DJt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[J3]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return DO.brandCheck(this,t),this[J3].blobLike.stream(...e)}arrayBuffer(...e){return DO.brandCheck(this,t),this[J3].blobLike.arrayBuffer(...e)}slice(...e){return DO.brandCheck(this,t),this[J3].blobLike.slice(...e)}text(...e){return DO.brandCheck(this,t),this[J3].blobLike.text(...e)}get size(){return DO.brandCheck(this,t),this[J3].blobLike.size}get type(){return DO.brandCheck(this,t),this[J3].blobLike.type}get name(){return DO.brandCheck(this,t),this[J3].name}get lastModified(){return DO.brandCheck(this,t),this[J3].lastModified}get[Symbol.toStringTag](){return"File"}};DO.converters.Blob=DO.interfaceConverter(Uls);function qls(t){return t instanceof Qls||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(qls,"isFileLike");CPn.exports={FileLike:DJt,isFileLike:qls}});var qwe=I(($Vd,IPn)=>{"use strict";p();var{isBlobLike:Htt,iteratorMixin:jls}=$S(),{kState:q_}=kq(),{kEnumerableProperty:Jue}=Ls(),{FileLike:vPn,isFileLike:Hls}=NJt(),{webidl:yu}=bA(),{File:TPn}=require("node:buffer"),bPn=require("node:util"),SPn=globalThis.File??TPn,Qwe=class t{static{a(this,"FormData")}constructor(e){if(yu.util.markAsUncloneable(this),e!==void 0)throw yu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[q_]=[]}append(e,r,n=void 0){yu.brandCheck(this,t);let o="FormData.append";if(yu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Htt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=yu.converters.USVString(e,o,"name"),r=Htt(r)?yu.converters.Blob(r,o,"value",{strict:!1}):yu.converters.USVString(r,o,"value"),n=arguments.length===3?yu.converters.USVString(n,o,"filename"):void 0;let s=MJt(e,r,n);this[q_].push(s)}delete(e){yu.brandCheck(this,t);let r="FormData.delete";yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name"),this[q_]=this[q_].filter(n=>n.name!==e)}get(e){yu.brandCheck(this,t);let r="FormData.get";yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name");let n=this[q_].findIndex(o=>o.name===e);return n===-1?null:this[q_][n].value}getAll(e){yu.brandCheck(this,t);let r="FormData.getAll";return yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name"),this[q_].filter(n=>n.name===e).map(n=>n.value)}has(e){yu.brandCheck(this,t);let r="FormData.has";return yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name"),this[q_].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){yu.brandCheck(this,t);let o="FormData.set";if(yu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Htt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=yu.converters.USVString(e,o,"name"),r=Htt(r)?yu.converters.Blob(r,o,"name",{strict:!1}):yu.converters.USVString(r,o,"name"),n=arguments.length===3?yu.converters.USVString(n,o,"name"):void 0;let s=MJt(e,r,n),c=this[q_].findIndex(l=>l.name===e);c!==-1?this[q_]=[...this[q_].slice(0,c),s,...this[q_].slice(c+1).filter(l=>l.name!==e)]:this[q_].push(s)}[bPn.inspect.custom](e,r){let n=this[q_].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=bPn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};jls("FormData",Qwe,q_,"name","value");Object.defineProperties(Qwe.prototype,{append:Jue,delete:Jue,get:Jue,getAll:Jue,has:Jue,set:Jue,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function MJt(t,e,r){if(typeof e!="string"){if(Hls(e)||(e=e instanceof Blob?new SPn([e],"blob",{type:e.type}):new vPn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof TPn?new SPn([e],r,n):new vPn(e,r,n)}}return{name:t,value:e}}a(MJt,"makeEntry");IPn.exports={FormData:Qwe,makeEntry:MJt}});var DPn=I((zVd,PPn)=>{"use strict";p();var{isUSVString:xPn,bufferToLowerCasedHeaderName:Gls}=Ls(),{utf8DecodeBytes:$ls}=$S(),{HTTP_TOKEN_CODEPOINTS:Vls,isomorphicDecode:wPn}=Gv(),{isFileLike:Wls}=NJt(),{makeEntry:zls}=qwe(),Gtt=require("node:assert"),{File:Yls}=require("node:buffer"),Kls=globalThis.File??Yls,Jls=Buffer.from('form-data; name="'),RPn=Buffer.from("; filename"),Zls=Buffer.from("--"),Xls=Buffer.from(`--\r -`);function eus(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(tus,"validateBoundary");function rus(t,e){Gtt(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&&$tt(t,Zls,s)||s.position===t.length-4&&$tt(t,Xls,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=nus(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",eus(f)||(f=""),g=new Kls([m],d,{type:f})):g=$ls(Buffer.from(m)),Gtt(xPn(u)),Gtt(typeof g=="string"&&xPn(g)||Wls(g)),o.push(zls(u,g,d))}}a(rus,"multipartFormDataParser");function nus(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=Zue(l=>l!==10&&l!==13&&l!==58,t,e);if(c=OJt(c,!0,!0,l=>l===9||l===32),!Vls.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,Zue(l=>l===32||l===9,t,e),Gls(c)){case"content-disposition":{if(r=n=null,!$tt(t,Jls,e)||(e.position+=17,r=kPn(t,e),r===null))return"failure";if($tt(t,RPn,e)){let l=e.position+RPn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=kPn(t,e),n===null))return"failure"}break}case"content-type":{let l=Zue(u=>u!==10&&u!==13,t,e);l=OJt(l,!1,!0,u=>u===9||u===32),o=wPn(l);break}case"content-transfer-encoding":{let l=Zue(u=>u!==10&&u!==13,t,e);l=OJt(l,!1,!0,u=>u===9||u===32),s=wPn(l);break}default:Zue(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(nus,"parseMultipartFormDataHeaders");function kPn(t,e){Gtt(t[e.position-1]===34);let r=Zue(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(kPn,"parseMultipartFormDataName");function Zue(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(OJt,"removeChars");function $tt(t,e,r){if(t.length{"use strict";p();var jwe=Ls(),{ReadableStreamFrom:ius,isBlobLike:NPn,isReadableStreamLike:ous,readableStreamClose:sus,createDeferredPromise:aus,fullyReadBody:cus,extractMimeType:lus,utf8DecodeBytes:BPn}=$S(),{FormData:MPn}=qwe(),{kState:ede}=kq(),{webidl:uus}=bA(),{Blob:dus}=require("node:buffer"),BJt=require("node:assert"),{isErrored:LPn,isDisturbed:fus}=require("node:stream"),{isArrayBuffer:pus}=require("node:util/types"),{serializeAMimeType:hus}=Gv(),{multipartFormDataParser:mus}=DPn(),LJt;try{let t=require("node:crypto");LJt=a(e=>t.randomInt(0,e),"random")}catch{LJt=a(t=>Math.floor(Math.random(t)),"random")}var Vtt=new TextEncoder;function gus(){}a(gus,"noop");var FPn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,UPn;FPn&&(UPn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!fus(e)&&!LPn(e)&&e.cancel("Response object has been garbage collected").catch(gus)}));function QPn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:NPn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?Vtt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>sus(u))},start(){},type:"bytes"}),BJt(ous(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(pus(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(jwe.isFormDataLike(t)){let u=`----formdata-undici-0${`${LJt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r +`+s),t.push(o+"m+"+EKe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=rjo()+e+" "+t[0]}a(tjo,"formatArgs");function rjo(){return sg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(rjo,"getDate");function njo(...t){return process.stderr.write(yKe.formatWithOptions(sg.inspectOpts,...t)+` +`)}a(njo,"log");function ijo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(ijo,"save");function ojo(){return process.env.DEBUG}a(ojo,"load");function sjo(t){t.inspectOpts={};let e=Object.keys(sg.inspectOpts);for(let r=0;re.trim()).join(" ")};T_n.O=function(t){return this.inspectOpts.colors=this.useColors,yKe.inspect(t,this.inspectOpts)}});var x_n=I((uid,CQt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?CQt.exports=S_n():CQt.exports=I_n()});var SQt=I(tK=>{"use strict";p();Object.defineProperty(tK,"__esModule",{value:!0});tK.createDeferred=tK.deferred=void 0;function bQt(){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(bQt,"deferred");tK.deferred=bQt;tK.createDeferred=bQt;tK.default=bQt});var VKe=I(NS=>{"use strict";p();Object.defineProperty(NS,"__esModule",{value:!0});NS.deepClone=Rbn;NS.deepFreeze=G$o;NS.cloneAndChange=$$o;NS.mixin=kbn;NS.equals=DIe;NS.safeStringify=V$o;NS.stableStringify=W$o;NS.distinct=z$o;NS.getCaseInsensitive=Y$o;NS.filter=K$o;NS.mapValues=J$o;var $Q=RS();function Rbn(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"?Rbn(n):n}),e}a(Rbn,"deepClone");function G$o(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(Pbn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,$Q.isTypedArray)(o)&&e.push(o)}}return t}a(G$o,"deepFreeze");var Pbn=Object.prototype.hasOwnProperty;function $$o(t,e){return Tqt(t,e,new Set)}a($$o,"cloneAndChange");function Tqt(t,e,r){if((0,$Q.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(Tqt(s,e,r));return o}if((0,$Q.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)Pbn.call(t,s)&&(o[s]=Tqt(t[s],e,r));return r.delete(t),o}return t}a(Tqt,"_cloneAndChange");function kbn(t,e,r=!0){return(0,$Q.isObject)(t)?((0,$Q.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,$Q.isObject)(t[n])&&(0,$Q.isObject)(e[n])?kbn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(kbn,"mixin");function DIe(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,$Q.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(V$o,"safeStringify");function W$o(t){if(t===void 0)return"undefined";try{return Iqt(t,new WeakSet)}catch{return""}}a(W$o,"stableStringify");function Iqt(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=>Iqt(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)+":"+Iqt(s,e))}return"{"+n.join(",")+"}"}a(Iqt,"_stableStringify");function z$o(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];DIe(s,c)||(r[o]=c)}),r}a(z$o,"distinct");function Y$o(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(Y$o,"getCaseInsensitive");function K$o(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(K$o,"filter");function J$o(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(J$o,"mapValues")});var M_=I(WKe=>{"use strict";p();Object.defineProperty(WKe,"__esModule",{value:!0});WKe.ErrorUtils=void 0;var Z$o=VKe(),Dbn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,Z$o.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(Dbn||(WKe.ErrorUtils=Dbn={}))});var Lx=I(zKe=>{"use strict";p();Object.defineProperty(zKe,"__esModule",{value:!0});zKe.Result=void 0;var xqt=M_(),Nbn;(function(t){function e(c){return new wqt(c)}a(e,"ok"),t.ok=e;function r(c){return new Rqt(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(xqt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(xqt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(Nbn||(zKe.Result=Nbn={}));var wqt=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}},Rqt=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:xqt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var Nd=I((o7d,Oxn)=>{p();Oxn.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 pc=I((a7d,swn)=>{"use strict";p();var Bxn=Symbol.for("undici.error.UND_ERR"),Md=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[Bxn]===!0}[Bxn]=!0},Lxn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),CYt=class extends Md{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[Lxn]===!0}[Lxn]=!0},Fxn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),bYt=class extends Md{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[Fxn]===!0}[Fxn]=!0},Uxn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),SYt=class extends Md{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[Uxn]===!0}[Uxn]=!0},Qxn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),TYt=class extends Md{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[Qxn]===!0}[Qxn]=!0},qxn=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),IYt=class extends Md{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[qxn]===!0}[qxn]=!0},jxn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),xYt=class extends Md{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[jxn]===!0}[jxn]=!0},Hxn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),wYt=class extends Md{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[Hxn]===!0}[Hxn]=!0},Gxn=Symbol.for("undici.error.UND_ERR_ABORT"),Det=class extends Md{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[Gxn]===!0}[Gxn]=!0},$xn=Symbol.for("undici.error.UND_ERR_ABORTED"),RYt=class extends Det{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[$xn]===!0}[$xn]=!0},Vxn=Symbol.for("undici.error.UND_ERR_INFO"),PYt=class extends Md{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[Vxn]===!0}[Vxn]=!0},Wxn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),kYt=class extends Md{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[Wxn]===!0}[Wxn]=!0},zxn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),DYt=class extends Md{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[zxn]===!0}[zxn]=!0},Yxn=Symbol.for("undici.error.UND_ERR_DESTROYED"),NYt=class extends Md{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[Yxn]===!0}[Yxn]=!0},Kxn=Symbol.for("undici.error.UND_ERR_CLOSED"),MYt=class extends Md{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[Kxn]===!0}[Kxn]=!0},Jxn=Symbol.for("undici.error.UND_ERR_SOCKET"),OYt=class extends Md{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[Jxn]===!0}[Jxn]=!0},Zxn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),BYt=class extends Md{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[Zxn]===!0}[Zxn]=!0},Xxn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),LYt=class extends Md{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[Xxn]===!0}[Xxn]=!0},ewn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),FYt=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[ewn]===!0}[ewn]=!0},twn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),UYt=class extends Md{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[twn]===!0}[twn]=!0},rwn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),QYt=class extends Md{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[rwn]===!0}[rwn]=!0},nwn=Symbol.for("undici.error.UND_ERR_RESPONSE"),qYt=class extends Md{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[nwn]===!0}[nwn]=!0},iwn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),jYt=class extends Md{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[iwn]===!0}[iwn]=!0},own=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),HYt=class extends Md{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[own]===!0}get[own](){return!0}};swn.exports={AbortError:Det,HTTPParserError:FYt,UndiciError:Md,HeadersTimeoutError:bYt,HeadersOverflowError:SYt,BodyTimeoutError:TYt,RequestContentLengthMismatchError:kYt,ConnectTimeoutError:CYt,ResponseStatusCodeError:IYt,InvalidArgumentError:xYt,InvalidReturnValueError:wYt,RequestAbortedError:RYt,ClientDestroyedError:NYt,ClientClosedError:MYt,InformationalError:PYt,SocketError:OYt,NotSupportedError:BYt,ResponseContentLengthMismatchError:DYt,BalancedPoolMissingUpstreamError:LYt,ResponseExceededMaxSizeError:UYt,RequestRetryError:QYt,ResponseError:qYt,SecureProxyConnectionError:jYt,MessageSizeExceededError:HYt}});var Met=I((u7d,awn)=>{"use strict";p();var Net={},GYt=["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:cwn,headerNameLowerCasedRecord:yrs}=Met(),$Yt=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 twe=require("node:assert"),{kDestroyed:pwn,kBodyUsed:Aue,kListeners:VYt,kBody:fwn}=Nd(),{IncomingMessage:Ers}=require("node:http"),Fet=require("node:stream"),_rs=require("node:net"),{Blob:vrs}=require("node:buffer"),Crs=require("node:util"),{stringify:brs}=require("node:querystring"),{EventEmitter:Srs}=require("node:events"),{InvalidArgumentError:fg}=pc(),{headerNameLowerCasedRecord:Trs}=Met(),{tree:hwn}=dwn(),[Irs,xrs]=process.versions.node.split(".").map(t=>Number(t)),Let=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[fwn]=e,this[Aue]=!1}async*[Symbol.asyncIterator](){twe(!this[Aue],"disturbed"),this[Aue]=!0,yield*this[fwn]}};function wrs(t){return Uet(t)?(Ewn(t)===0&&t.on("data",function(){twe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Aue]=!1,Srs.prototype.on.call(t,"data",function(){this[Aue]=!0})),t):t&&typeof t.pipeTo=="function"?new Let(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&ywn(t)?new Let(t):t}a(wrs,"wrapRequestBody");function Rrs(){}a(Rrs,"nop");function Uet(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Uet,"isStream");function mwn(t){if(t===null)return!1;if(t instanceof vrs)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(mwn,"isBlobLike");function Prs(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=brs(e);return r&&(t+="?"+r),t}a(Prs,"buildURL");function gwn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(gwn,"isValidPort");function Bet(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Bet,"isHttpOrHttpsPrefixed");function Awn(t){if(typeof t=="string"){if(t=new URL(t),!Bet(t.origin||t.protocol))throw new fg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new fg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&gwn(t.port)===!1)throw new fg("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 fg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new fg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new fg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new fg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Bet(t.origin||t.protocol))throw new fg("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(!Bet(t.origin||t.protocol))throw new fg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(Awn,"parseURL");function krs(t){if(t=Awn(t),t.pathname!=="/"||t.search||t.hash)throw new fg("invalid url");return t}a(krs,"parseOrigin");function Drs(t){if(t[0]==="["){let r=t.indexOf("]");return twe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Drs,"getHostname");function Nrs(t){if(!t)return null;twe(typeof t=="string");let e=Drs(t);return _rs.isIP(e)?"":e}a(Nrs,"getServerName");function Mrs(t){return JSON.parse(JSON.stringify(t))}a(Mrs,"deepClone");function Ors(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Ors,"isAsyncIterable");function ywn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(ywn,"isIterable");function Ewn(t){if(t==null)return 0;if(Uet(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(mwn(t))return t.size!=null?t.size:null;if(Cwn(t))return t.byteLength}return null}a(Ewn,"bodyLength");function _wn(t){return t&&!!(t.destroyed||t[pwn]||Fet.isDestroyed?.(t))}a(_wn,"isDestroyed");function Brs(t,e){t==null||!Uet(t)||_wn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Ers&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[pwn]=!0))}a(Brs,"destroy");var Lrs=/timeout=(\d+)/;function Frs(t){let e=t.toString().match(Lrs);return e?parseInt(e[1],10)*1e3:null}a(Frs,"parseKeepAliveTimeout");function vwn(t){return typeof t=="string"?Trs[t]??t.toLowerCase():hwn.lookup(t)??t.toString("latin1").toLowerCase()}a(vwn,"headerNameToString");function Urs(t){return hwn.lookup(t)??t.toString("latin1").toLowerCase()}a(Urs,"bufferToLowerCasedHeaderName");function Qrs(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(Qrs,"parseHeaders");function qrs(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(Wrs,"ReadableStreamFrom");function zrs(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(zrs,"isFormDataLike");function Yrs(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(Yrs,"addAbortListener");var Krs=typeof String.prototype.toWellFormed=="function",Jrs=typeof String.prototype.isWellFormed=="function";function bwn(t){return Krs?`${t}`.toWellFormed():Crs.toUSVString(t)}a(bwn,"toUSVString");function Zrs(t){return Jrs?`${t}`.isWellFormed():bwn(t)===`${t}`}a(Zrs,"isUSVString");function Swn(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(Swn,"isTokenCharCode");function Xrs(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Oc=require("node:diagnostics_channel"),YYt=require("node:util"),Qet=YYt.debuglog("undici"),zYt=YYt.debuglog("fetch"),LK=YYt.debuglog("websocket"),wwn=!1,sns={beforeConnect:Oc.channel("undici:client:beforeConnect"),connected:Oc.channel("undici:client:connected"),connectError:Oc.channel("undici:client:connectError"),sendHeaders:Oc.channel("undici:client:sendHeaders"),create:Oc.channel("undici:request:create"),bodySent:Oc.channel("undici:request:bodySent"),headers:Oc.channel("undici:request:headers"),trailers:Oc.channel("undici:request:trailers"),error:Oc.channel("undici:request:error"),open:Oc.channel("undici:websocket:open"),close:Oc.channel("undici:websocket:close"),socketError:Oc.channel("undici:websocket:socket_error"),ping:Oc.channel("undici:websocket:ping"),pong:Oc.channel("undici:websocket:pong")};if(Qet.enabled||zYt.enabled){let t=zYt.enabled?zYt:Qet;Oc.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)}),Oc.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)}),Oc.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)}),Oc.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)}),Oc.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)}),Oc.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)}),Oc.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)}),wwn=!0}if(LK.enabled){if(!wwn){let t=Qet.enabled?Qet:LK;Oc.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)}),Oc.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)}),Oc.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)}),Oc.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)})}Oc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;LK("connection opened %s%s",e,r?`:${r}`:"")}),Oc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;LK("closed connection to %s - %s %s",e.url,r,n)}),Oc.channel("undici:websocket:socket_error").subscribe(t=>{LK("connection errored - %s",t.message)}),Oc.channel("undici:websocket:ping").subscribe(t=>{LK("ping received")}),Oc.channel("undici:websocket:pong").subscribe(t=>{LK("pong received")})}Rwn.exports={channels:sns}});var Nwn=I((_7d,Dwn)=>{"use strict";p();var{InvalidArgumentError:gu,NotSupportedError:ans}=pc(),N3=require("node:assert"),{isValidHTTPToken:kwn,isValidHeaderValue:KYt,isStream:cns,destroy:lns,isBuffer:uns,isFormDataLike:dns,isIterable:fns,isBlobLike:pns,buildURL:hns,validateHandler:mns,getServerName:gns,normalizedMethodRecords:Ans}=Ms(),{channels:yO}=yue(),{headerNameLowerCasedRecord:Pwn}=Met(),yns=/[^\u0021-\u00ff]/,Vx=Symbol("handler"),JYt=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 gu("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new gu("path must be an absolute URL or start with a slash");if(yns.test(r))throw new gu("invalid request path");if(typeof n!="string")throw new gu("method must be a string");if(Ans[n]===void 0&&!kwn(n))throw new gu("invalid request method");if(d&&typeof d!="string")throw new gu("upgrade must be a string");if(d&&!KYt(d))throw new gu("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new gu("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new gu("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new gu("invalid reset");if(A!=null&&typeof A!="boolean")throw new gu("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(cns(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){lns(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(uns(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(dns(o)||fns(o)||pns(o))this.body=o;else throw new gu("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?hns(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 gu("headers array must be even");for(let _=0;_{"use strict";p();var Ens=require("node:events"),jet=class extends Ens{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 ZYt(this,n)}},ZYt=class extends jet{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)}};Mwn.exports=jet});var Cue=I((I7d,Own)=>{"use strict";p();var _ns=rwe(),{ClientDestroyedError:XYt,ClientClosedError:vns,InvalidArgumentError:Eue}=pc(),{kDestroy:Cns,kClose:bns,kClosed:nwe,kDestroyed:_ue,kDispatch:eKt,kInterceptors:FK}=Nd(),M3=Symbol("onDestroyed"),vue=Symbol("onClosed"),Het=Symbol("Intercepted Dispatch"),tKt=class extends _ns{static{a(this,"DispatcherBase")}constructor(){super(),this[_ue]=!1,this[M3]=null,this[nwe]=!1,this[vue]=[]}get destroyed(){return this[_ue]}get closed(){return this[nwe]}get interceptors(){return this[FK]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[FK][r]!="function")throw new Eue("interceptor must be an function")}this[FK]=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 Eue("invalid callback");if(this[_ue]){queueMicrotask(()=>e(new XYt,null));return}if(this[nwe]){this[vue]?this[vue].push(e):queueMicrotask(()=>e(null,null));return}this[nwe]=!0,this[vue].push(e);let r=a(()=>{let n=this[vue];this[vue]=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 Eue("invalid callback");if(this[_ue]){this[M3]?this[M3].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new XYt),this[_ue]=!0,this[M3]=this[M3]||[],this[M3].push(r);let n=a(()=>{let o=this[M3];this[M3]=null;for(let s=0;s{queueMicrotask(n)})}[Het](e,r){if(!this[FK]||this[FK].length===0)return this[Het]=this[eKt],this[eKt](e,r);let n=this[eKt].bind(this);for(let o=this[FK].length-1;o>=0;o--)n=this[FK][o](n);return this[Het]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Eue("handler must be an object");try{if(!e||typeof e!="object")throw new Eue("opts must be an object.");if(this[_ue]||this[M3])throw new XYt;if(this[nwe])throw new vns;return this[Het](e,r)}catch(n){if(typeof r.onError!="function")throw new Eue("invalid onError method");return r.onError(n),!1}}};Own.exports=tKt});var cKt=I((R7d,Uwn)=>{"use strict";p();var bue=0,rKt=1e3,nKt=(rKt>>1)-1,O3,iKt=Symbol("kFastTimer"),B3=[],oKt=-2,sKt=-1,Lwn=0,Bwn=1;function aKt(){bue+=nKt;let t=0,e=B3.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=sKt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===sKt?(r._state=oKt,--e!==0&&(B3[t]=B3[e])):++t}B3.length=e,B3.length!==0&&Fwn()}a(aKt,"onTick");function Fwn(){O3?O3.refresh():(clearTimeout(O3),O3=setTimeout(aKt,nKt),O3.unref&&O3.unref())}a(Fwn,"refreshTimeout");var Get=class{static{a(this,"FastTimer")}[iKt]=!0;_state=oKt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===oKt&&B3.push(this),(!O3||B3.length===1)&&Fwn(),this._state=Lwn}clear(){this._state=sKt,this._idleStart=-1}};Uwn.exports={setTimeout(t,e,r){return e<=rKt?setTimeout(t,e,r):new Get(t,e,r)},clearTimeout(t){t[iKt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Get(t,e,r)},clearFastTimeout(t){t.clear()},now(){return bue},tick(t=0){bue+=t-rKt+1,aKt(),aKt()},reset(){bue=0,B3.length=0,clearTimeout(O3),O3=null},kFastTimer:iKt}});var iwe=I((M7d,Gwn)=>{"use strict";p();var Sns=require("node:net"),Qwn=require("node:assert"),Hwn=Ms(),{InvalidArgumentError:Tns,ConnectTimeoutError:Ins}=pc(),$et=cKt();function qwn(){}a(qwn,"noop");var lKt,uKt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?uKt=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 xns({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Tns("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new uKt(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:"){lKt||(lKt=require("node:tls")),g=g||c.servername||Hwn.getServerName(f)||null;let b=g||d;Qwn(b);let T=o||l.get(b)||null;m=m||443,_=lKt.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 Qwn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Sns.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=wns(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(xns,"buildConnector");var wns=process.platform==="win32"?(t,e)=>{if(!e.timeout)return qwn;let r=null,n=null,o=$et.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>jwn(t.deref(),e))})},e.timeout);return()=>{$et.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return qwn;let r=null,n=$et.setFastTimeout(()=>{r=setImmediate(()=>{jwn(t.deref(),e)})},e.timeout);return()=>{$et.clearFastTimeout(n),clearImmediate(r)}};function jwn(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)`,Hwn.destroy(t,new Ins(r))}a(jwn,"onConnectTimeout");Gwn.exports=xns});var $wn=I(Vet=>{"use strict";p();Object.defineProperty(Vet,"__esModule",{value:!0});Vet.enumToMap=void 0;function Rns(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Rns,"enumToMap");Vet.enumToMap=Rns});var Vwn=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 Pns=$wn(),kns;(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"})(kns=Pr.ERROR||(Pr.ERROR={}));var Dns;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Dns=Pr.TYPE||(Pr.TYPE={}));var Nns;(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"})(Nns=Pr.FLAGS||(Pr.FLAGS={}));var Mns;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(Mns=Pr.LENIENT_FLAGS||(Pr.LENIENT_FLAGS={}));var ki;(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"})(ki=Pr.METHODS||(Pr.METHODS={}));Pr.METHODS_HTTP=[ki.DELETE,ki.GET,ki.HEAD,ki.POST,ki.PUT,ki.CONNECT,ki.OPTIONS,ki.TRACE,ki.COPY,ki.LOCK,ki.MKCOL,ki.MOVE,ki.PROPFIND,ki.PROPPATCH,ki.SEARCH,ki.UNLOCK,ki.BIND,ki.REBIND,ki.UNBIND,ki.ACL,ki.REPORT,ki.MKACTIVITY,ki.CHECKOUT,ki.MERGE,ki["M-SEARCH"],ki.NOTIFY,ki.SUBSCRIBE,ki.UNSUBSCRIBE,ki.PATCH,ki.PURGE,ki.MKCALENDAR,ki.LINK,ki.UNLINK,ki.PRI,ki.SOURCE];Pr.METHODS_ICE=[ki.SOURCE];Pr.METHODS_RTSP=[ki.OPTIONS,ki.DESCRIBE,ki.ANNOUNCE,ki.SETUP,ki.PLAY,ki.PAUSE,ki.TEARDOWN,ki.GET_PARAMETER,ki.SET_PARAMETER,ki.REDIRECT,ki.RECORD,ki.FLUSH,ki.GET,ki.POST];Pr.METHOD_MAP=Pns.enumToMap(ki);Pr.H_METHOD_MAP={};Object.keys(Pr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Pr.H_METHOD_MAP[t]=Pr.METHOD_MAP[t])});var Ons;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(Ons=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 Sue;(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"})(Sue=Pr.HEADER_STATE||(Pr.HEADER_STATE={}));Pr.SPECIAL_HEADERS={connection:Sue.CONNECTION,"content-length":Sue.CONTENT_LENGTH,"proxy-connection":Sue.CONNECTION,"transfer-encoding":Sue.TRANSFER_ENCODING,upgrade:Sue.UPGRADE}});var dKt=I((j7d,Wwn)=>{"use strict";p();var{Buffer:Bns}=require("node:buffer");Wwn.exports=Bns.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 Ywn=I((G7d,zwn)=>{"use strict";p();var{Buffer:Lns}=require("node:buffer");zwn.exports=Lns.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 owe=I((V7d,nRn)=>{"use strict";p();var Kwn=["GET","HEAD","POST"],Fns=new Set(Kwn),Uns=[101,204,205,304],Jwn=[301,302,303,307,308],Qns=new Set(Jwn),Zwn=["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"],qns=new Set(Zwn),Xwn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],jns=new Set(Xwn),Hns=["follow","manual","error"],eRn=["GET","HEAD","OPTIONS","TRACE"],Gns=new Set(eRn),$ns=["navigate","same-origin","no-cors","cors"],Vns=["omit","same-origin","include"],Wns=["default","no-store","reload","no-cache","force-cache","only-if-cached"],zns=["content-encoding","content-language","content-location","content-type","content-length"],Yns=["half"],tRn=["CONNECT","TRACE","TRACK"],Kns=new Set(tRn),rRn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],Jns=new Set(rRn);nRn.exports={subresource:rRn,forbiddenMethods:tRn,requestBodyHeader:zns,referrerPolicy:Xwn,requestRedirect:Hns,requestMode:$ns,requestCredentials:Vns,requestCache:Wns,redirectStatus:Jwn,corsSafeListedMethods:Kwn,nullBodyStatus:Uns,safeMethods:eRn,badPorts:Zwn,requestDuplex:Yns,subresourceSet:Jns,badPortsSet:qns,redirectStatusSet:Qns,corsSafeListedMethodsSet:Fns,safeMethodsSet:Gns,forbiddenMethodsSet:Kns,referrerPolicySet:jns}});var pKt=I((z7d,iRn)=>{"use strict";p();var fKt=Symbol.for("undici.globalOrigin.1");function Zns(){return globalThis[fKt]}a(Zns,"getGlobalOrigin");function Xns(t){if(t===void 0){Object.defineProperty(globalThis,fKt,{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,fKt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(Xns,"setGlobalOrigin");iRn.exports={getGlobalOrigin:Zns,setGlobalOrigin:Xns}});var FC=I((J7d,dRn)=>{"use strict";p();var zet=require("node:assert"),eis=new TextEncoder,swe=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,tis=/[\u000A\u000D\u0009\u0020]/,ris=/[\u0009\u000A\u000C\u000D\u0020]/g,nis=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function iis(t){zet(t.protocol==="data:");let e=aRn(t,!0);e=e.slice(5);let r={position:0},n=Tue(",",e,r),o=n.length;if(n=uis(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=cRn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=uRn(c);if(c=sis(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=hKt(n);return l==="failure"&&(l=hKt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(iis,"dataURLProcessor");function aRn(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(aRn,"URLSerializer");function Yet(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(oRn,"isHexCharByte");function sRn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(sRn,"hexByteToNumber");function ois(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Tue(";",t,e);if(n=Wet(n,!1,!0),n.length===0||!swe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positiontis.test(d),t,e);let l=Yet(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=lRn(t,e,!0),Tue(";",t,e);else if(u=Tue(";",t,e),u=Wet(u,!1,!0),u.length===0)continue;l.length!==0&&swe.test(l)&&(u.length===0||nis.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(hKt,"parseMIMEType");function sis(t){t=t.replace(ris,"");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(sis,"forgivingBase64");function lRn(t,e,r){let n=e.position,o="";for(zet(t[e.position]==='"'),e.position++;o+=Yet(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{zet(s==='"');break}}return r?o:t.slice(n,e.position)}a(lRn,"collectAnHTTPQuotedString");function ais(t){zet(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",swe.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(ais,"serializeAMimeType");function cis(t){return t===13||t===10||t===9||t===32}a(cis,"isHTTPWhiteSpace");function Wet(t,e=!0,r=!0){return mKt(t,e,r,cis)}a(Wet,"removeHTTPWhitespace");function lis(t){return t===13||t===10||t===9||t===12||t===32}a(lis,"isASCIIWhitespace");function uis(t,e=!0,r=!0){return mKt(t,e,r,lis)}a(uis,"removeASCIIWhitespace");function mKt(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(mKt,"removeChars");function uRn(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(uRn,"isomorphicDecode");function dis(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(dis,"minimizeSupportedMimeType");dRn.exports={dataURLProcessor:iis,URLSerializer:aRn,collectASequenceOfCodePoints:Yet,collectASequenceOfCodePointsFast:Tue,stringPercentDecode:cRn,parseMIMEType:hKt,collectAnHTTPQuotedString:lRn,serializeAMimeType:ais,removeChars:mKt,removeHTTPWhitespace:Wet,minimizeSupportedMimeType:dis,HTTP_TOKEN_CODEPOINTS:swe,isomorphicDecode:uRn}});var TA=I((eQd,fRn)=>{"use strict";p();var{types:EO,inspect:fis}=require("node:util"),{markAsUncloneable:pis}=require("node:worker_threads"),{toUSVString:his}=Ms(),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 fis(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(!EO.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=his;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"||!EO.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&EO.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"||!EO.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&&EO.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"||!EO.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&EO.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(EO.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(EO.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(EO.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);fRn.exports={webidl:Er}});var FS=I((rQd,IRn)=>{"use strict";p();var{Transform:mis}=require("node:stream"),pRn=require("node:zlib"),{redirectStatusSet:gis,referrerPolicySet:Ais,badPortsSet:yis}=owe(),{getGlobalOrigin:hRn}=pKt(),{collectASequenceOfCodePoints:UK,collectAnHTTPQuotedString:Eis,removeChars:_is,parseMIMEType:vis}=FC(),{performance:Cis}=require("node:perf_hooks"),{isBlobLike:bis,ReadableStreamFrom:Sis,isValidHTTPToken:mRn,normalizedMethodRecordsBase:Tis}=Ms(),QK=require("node:assert"),{isUint8Array:Iis}=require("node:util/types"),{webidl:awe}=TA(),gRn=[],Jet;try{Jet=require("node:crypto");let t=["sha256","sha384","sha512"];gRn=Jet.getHashes().filter(e=>t.includes(e))}catch{}function ARn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(ARn,"responseURL");function xis(t,e){if(!gis.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&ERn(r)&&(yRn(r)||(r=wis(r)),r=new URL(r,ARn(t))),r&&!r.hash&&(r.hash=e),r}a(xis,"responseLocationURL");function yRn(t){for(let e=0;e126||r<32)return!1}return!0}a(yRn,"isValidEncodedURL");function wis(t){return Buffer.from(t,"binary").toString("utf8")}a(wis,"normalizeBinaryStringToUtf8");function lwe(t){return t.urlList[t.urlList.length-1]}a(lwe,"requestCurrentURL");function Ris(t){let e=lwe(t);return SRn(e)&&yis.has(e.port)?"blocked":"allowed"}a(Ris,"requestBadPort");function Pis(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Pis,"isErrorLike");function kis(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(kis,"isValidReasonPhrase");var Dis=mRn;function ERn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(ERn,"isValidHeaderValue");function Nis(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(Ais.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(Nis,"setRequestReferrerPolicyOnRedirect");function Mis(){return"allowed"}a(Mis,"crossOriginResourcePolicyCheck");function Ois(){return"success"}a(Ois,"corsCheck");function Bis(){return"success"}a(Bis,"TAOCheck");function Lis(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Lis,"appendFetchMetadata");function Fis(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&&AKt(t.origin)&&!AKt(lwe(t))&&(e=null);break;case"same-origin":Zet(t,lwe(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(Fis,"appendRequestOriginHeader");function Iue(t,e){return t}a(Iue,"coarsenTime");function Uis(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=Zet(t,n),c=cwe(n)&&!cwe(t.url);switch(e){case"origin":return o??gKt(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=lwe(t);return Zet(n,l)?n:cwe(n)&&!cwe(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(His,"determineRequestsReferrer");function gKt(t,e){return QK(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(gKt,"stripURLForReferrer");function cwe(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(cwe,"isURLPotentiallyTrustworthy");function Gis(t,e){if(Jet===void 0)return!0;let r=vRn(e);if(r==="no metadata"||r.length===0)return!0;let n=Vis(r),o=Wis(r,n);for(let s of o){let c=s.algo,l=s.hash,u=Jet.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)),zis(u,l))return!0}return!1}a(Gis,"bytesMatch");var $is=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function vRn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=$is.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();gRn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(vRn,"parseMetadata");function Vis(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(Kis,"createDeferredPromise");function Jis(t){return t.controller.state==="aborted"}a(Jis,"isAborted");function Zis(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Zis,"isCancelled");function Xis(t){return Tis[t.toLowerCase()]??t}a(Xis,"normalizeMethod");function eos(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return QK(typeof e=="string"),e}a(eos,"serializeJavascriptValueToJSONString");var tos=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function CRn(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,tos),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(CRn,"createIterator");function ros(t,e,r,n=0,o=1){let s=CRn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return awe.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return awe.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return awe.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(awe.brandCheck(this,e),awe.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(ros,"iteratorMixin");async function nos(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await bRn(s))}catch(c){o(c)}}a(nos,"fullyReadBody");function ios(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(ios,"isReadableStreamLike");function oos(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(oos,"readableStreamClose");var sos=/[^\x00-\xFF]/;function Ket(t){return QK(!sos.test(t)),t}a(Ket,"isomorphicEncode");async function bRn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!Iis(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(bRn,"readAllBytes");function aos(t){QK("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(aos,"urlIsLocal");function AKt(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(AKt,"urlHasHttpsScheme");function SRn(t){QK("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(SRn,"urlIsHttpHttpsScheme");function cos(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&UK(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&UK(u=>u===" "||u===" ",r,n);let o=UK(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&UK(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&UK(u=>u===" "||u===" ",r,n);let c=UK(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(cos,"simpleRangeHeaderValue");function los(t,e,r){let n="bytes ";return n+=Ket(`${t}`),n+="-",n+=Ket(`${e}`),n+="/",n+=Ket(`${r}`),n}a(los,"buildContentRange");var yKt=class extends mis{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?pRn.createInflate(this.#e):pRn.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 uos(t){return new yKt(t)}a(uos,"createInflate");function dos(t){let e=null,r=null,n=null,o=TRn("content-type",t);if(o===null)return"failure";for(let s of o){let c=vis(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(dos,"extractMimeType");function fos(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(fos,"gettingDecodingSplitting");function TRn(t,e){let r=e.get(t,!0);return r===null?null:fos(r)}a(TRn,"getDecodeSplit");var pos=new TextDecoder;function hos(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),pos.decode(t))}a(hos,"utf8DecodeBytes");var EKt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return hRn()}get origin(){return this.baseUrl?.origin}policyContainer=_Rn()},_Kt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new EKt},mos=new _Kt;IRn.exports={isAborted:Jis,isCancelled:Zis,isValidEncodedURL:yRn,createDeferredPromise:Kis,ReadableStreamFrom:Sis,tryUpgradeRequestToAPotentiallyTrustworthyURL:Yis,clampAndCoarsenConnectionTimingInfo:Uis,coarsenedSharedCurrentTime:Qis,determineRequestsReferrer:His,makePolicyContainer:_Rn,clonePolicyContainer:jis,appendFetchMetadata:Lis,appendRequestOriginHeader:Fis,TAOCheck:Bis,corsCheck:Ois,crossOriginResourcePolicyCheck:Mis,createOpaqueTimingInfo:qis,setRequestReferrerPolicyOnRedirect:Nis,isValidHTTPToken:mRn,requestBadPort:Ris,requestCurrentURL:lwe,responseURL:ARn,responseLocationURL:xis,isBlobLike:bis,isURLPotentiallyTrustworthy:cwe,isValidReasonPhrase:kis,sameOrigin:Zet,normalizeMethod:Xis,serializeJavascriptValueToJSONString:eos,iteratorMixin:ros,createIterator:CRn,isValidHeaderName:Dis,isValidHeaderValue:ERn,isErrorLike:Pis,fullyReadBody:nos,bytesMatch:Gis,isReadableStreamLike:ios,readableStreamClose:oos,isomorphicEncode:Ket,urlIsLocal:aos,urlHasHttpsScheme:AKt,urlIsHttpHttpsScheme:SRn,readAllBytes:bRn,simpleRangeHeaderValue:cos,buildContentRange:los,parseMetadata:vRn,createInflate:uos,extractMimeType:dos,getDecodeSplit:TRn,utf8DecodeBytes:hos,environmentSettingsObject:mos}});var fq=I((oQd,xRn)=>{"use strict";p();xRn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var CKt=I((aQd,wRn)=>{"use strict";p();var{Blob:gos,File:Aos}=require("node:buffer"),{kState:L3}=fq(),{webidl:_O}=TA(),vKt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[L3]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return _O.brandCheck(this,t),this[L3].blobLike.stream(...e)}arrayBuffer(...e){return _O.brandCheck(this,t),this[L3].blobLike.arrayBuffer(...e)}slice(...e){return _O.brandCheck(this,t),this[L3].blobLike.slice(...e)}text(...e){return _O.brandCheck(this,t),this[L3].blobLike.text(...e)}get size(){return _O.brandCheck(this,t),this[L3].blobLike.size}get type(){return _O.brandCheck(this,t),this[L3].blobLike.type}get name(){return _O.brandCheck(this,t),this[L3].name}get lastModified(){return _O.brandCheck(this,t),this[L3].lastModified}get[Symbol.toStringTag](){return"File"}};_O.converters.Blob=_O.interfaceConverter(gos);function yos(t){return t instanceof Aos||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(yos,"isFileLike");wRn.exports={FileLike:vKt,isFileLike:yos}});var dwe=I((uQd,NRn)=>{"use strict";p();var{isBlobLike:Xet,iteratorMixin:Eos}=FS(),{kState:F_}=fq(),{kEnumerableProperty:xue}=Ms(),{FileLike:RRn,isFileLike:_os}=CKt(),{webidl:Au}=TA(),{File:DRn}=require("node:buffer"),PRn=require("node:util"),kRn=globalThis.File??DRn,uwe=class t{static{a(this,"FormData")}constructor(e){if(Au.util.markAsUncloneable(this),e!==void 0)throw Au.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[F_]=[]}append(e,r,n=void 0){Au.brandCheck(this,t);let o="FormData.append";if(Au.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Xet(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Au.converters.USVString(e,o,"name"),r=Xet(r)?Au.converters.Blob(r,o,"value",{strict:!1}):Au.converters.USVString(r,o,"value"),n=arguments.length===3?Au.converters.USVString(n,o,"filename"):void 0;let s=bKt(e,r,n);this[F_].push(s)}delete(e){Au.brandCheck(this,t);let r="FormData.delete";Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name"),this[F_]=this[F_].filter(n=>n.name!==e)}get(e){Au.brandCheck(this,t);let r="FormData.get";Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name");let n=this[F_].findIndex(o=>o.name===e);return n===-1?null:this[F_][n].value}getAll(e){Au.brandCheck(this,t);let r="FormData.getAll";return Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name"),this[F_].filter(n=>n.name===e).map(n=>n.value)}has(e){Au.brandCheck(this,t);let r="FormData.has";return Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name"),this[F_].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Au.brandCheck(this,t);let o="FormData.set";if(Au.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Xet(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Au.converters.USVString(e,o,"name"),r=Xet(r)?Au.converters.Blob(r,o,"name",{strict:!1}):Au.converters.USVString(r,o,"name"),n=arguments.length===3?Au.converters.USVString(n,o,"name"):void 0;let s=bKt(e,r,n),c=this[F_].findIndex(l=>l.name===e);c!==-1?this[F_]=[...this[F_].slice(0,c),s,...this[F_].slice(c+1).filter(l=>l.name!==e)]:this[F_].push(s)}[PRn.inspect.custom](e,r){let n=this[F_].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=PRn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Eos("FormData",uwe,F_,"name","value");Object.defineProperties(uwe.prototype,{append:xue,delete:xue,get:xue,getAll:xue,has:xue,set:xue,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function bKt(t,e,r){if(typeof e!="string"){if(_os(e)||(e=e instanceof Blob?new kRn([e],"blob",{type:e.type}):new RRn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof DRn?new kRn([e],r,n):new RRn(e,r,n)}}return{name:t,value:e}}a(bKt,"makeEntry");NRn.exports={FormData:uwe,makeEntry:bKt}});var URn=I((pQd,FRn)=>{"use strict";p();var{isUSVString:MRn,bufferToLowerCasedHeaderName:vos}=Ms(),{utf8DecodeBytes:Cos}=FS(),{HTTP_TOKEN_CODEPOINTS:bos,isomorphicDecode:ORn}=FC(),{isFileLike:Sos}=CKt(),{makeEntry:Tos}=dwe(),ett=require("node:assert"),{File:Ios}=require("node:buffer"),xos=globalThis.File??Ios,wos=Buffer.from('form-data; name="'),BRn=Buffer.from("; filename"),Ros=Buffer.from("--"),Pos=Buffer.from(`--\r +`);function kos(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(Dos,"validateBoundary");function Nos(t,e){ett(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&&ttt(t,Ros,s)||s.position===t.length-4&&ttt(t,Pos,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=Mos(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",kos(f)||(f=""),g=new xos([m],d,{type:f})):g=Cos(Buffer.from(m)),ett(MRn(u)),ett(typeof g=="string"&&MRn(g)||Sos(g)),o.push(Tos(u,g,d))}}a(Nos,"multipartFormDataParser");function Mos(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=wue(l=>l!==10&&l!==13&&l!==58,t,e);if(c=SKt(c,!0,!0,l=>l===9||l===32),!bos.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,wue(l=>l===32||l===9,t,e),vos(c)){case"content-disposition":{if(r=n=null,!ttt(t,wos,e)||(e.position+=17,r=LRn(t,e),r===null))return"failure";if(ttt(t,BRn,e)){let l=e.position+BRn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=LRn(t,e),n===null))return"failure"}break}case"content-type":{let l=wue(u=>u!==10&&u!==13,t,e);l=SKt(l,!1,!0,u=>u===9||u===32),o=ORn(l);break}case"content-transfer-encoding":{let l=wue(u=>u!==10&&u!==13,t,e);l=SKt(l,!1,!0,u=>u===9||u===32),s=ORn(l);break}default:wue(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(Mos,"parseMultipartFormDataHeaders");function LRn(t,e){ett(t[e.position-1]===34);let r=wue(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(LRn,"parseMultipartFormDataName");function wue(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(SKt,"removeChars");function ttt(t,e,r){if(t.length{"use strict";p();var fwe=Ms(),{ReadableStreamFrom:Oos,isBlobLike:QRn,isReadableStreamLike:Bos,readableStreamClose:Los,createDeferredPromise:Fos,fullyReadBody:Uos,extractMimeType:Qos,utf8DecodeBytes:HRn}=FS(),{FormData:qRn}=dwe(),{kState:Pue}=fq(),{webidl:qos}=TA(),{Blob:jos}=require("node:buffer"),TKt=require("node:assert"),{isErrored:GRn,isDisturbed:Hos}=require("node:stream"),{isArrayBuffer:Gos}=require("node:util/types"),{serializeAMimeType:$os}=FC(),{multipartFormDataParser:Vos}=URn(),IKt;try{let t=require("node:crypto");IKt=a(e=>t.randomInt(0,e),"random")}catch{IKt=a(t=>Math.floor(Math.random(t)),"random")}var rtt=new TextEncoder;function Wos(){}a(Wos,"noop");var $Rn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,VRn;$Rn&&(VRn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Hos(e)&&!GRn(e)&&e.cancel("Response object has been garbage collected").catch(Wos)}));function WRn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:QRn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?rtt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>Los(u))},start(){},type:"bytes"}),TKt(Bos(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(Gos(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(fwe.isFormDataLike(t)){let u=`----formdata-undici-0${`${IKt(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=Vtt.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=rtt.encode(d+`; name="${f(h(E))}"\r \r ${h(_)}\r -`);m.push(v),s+=v.byteLength}else{let v=Vtt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r +`);m.push(v),s+=v.byteLength}else{let v=rtt.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=Vtt.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(NPn(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(jwe.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:ius(t)}if((typeof o=="string"||jwe.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(!LPn(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(QPn,"extractBody");function Aus(t,e=!1){return t instanceof ReadableStream&&(BJt(!jwe.isDisturbed(t),"The body has already been consumed."),BJt(!t.locked,"The stream is locked.")),QPn(t,e)}a(Aus,"safelyExtractBody");function yus(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(yus,"cloneBody");function Eus(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(Eus,"throwIfAborted");function _us(t){return{blob(){return Xue(this,r=>{let n=OPn(this);return n===null?n="":n&&(n=hus(n)),new dus([r],{type:n})},t)},arrayBuffer(){return Xue(this,r=>new Uint8Array(r).buffer,t)},text(){return Xue(this,BPn,t)},json(){return Xue(this,vus,t)},formData(){return Xue(this,r=>{let n=OPn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=mus(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new MPn;return s[ede]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new MPn;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 Xue(this,r=>new Uint8Array(r),t)}}}a(_us,"bodyMixinMethods");function Cus(t){Object.assign(t.prototype,_us(t))}a(Cus,"mixinBody");async function Xue(t,e,r){if(uus.brandCheck(t,r),qPn(t))throw new TypeError("Body is unusable: Body has already been read");Eus(t[ede]);let n=aus(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[ede].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await cus(t[ede].body,s,o),n.promise)}a(Xue,"consumeBody");function qPn(t){let e=t[ede].body;return e!=null&&(e.stream.locked||jwe.isDisturbed(e.stream))}a(qPn,"bodyUnusable");function vus(t){return JSON.parse(BPn(t))}a(vus,"parseJSONFromBytes");function OPn(t){let e=t[ede].headersList,r=lus(e);return r==="failure"?null:r}a(OPn,"bodyMimeType");jPn.exports={extractBody:QPn,safelyExtractBody:Aus,cloneBody:yus,mixinBody:Cus,streamRegistry:UPn,hasFinalizationRegistry:FPn,bodyUnusable:qPn}});var XPn=I((eWd,ZPn)=>{"use strict";p();var Gi=require("node:assert"),yo=Ls(),{channels:HPn}=jue(),FJt=EJt(),{RequestContentLengthMismatchError:aJ,ResponseContentLengthMismatchError:bus,RequestAbortedError:YPn,HeadersTimeoutError:Sus,HeadersOverflowError:Tus,SocketError:Ztt,InformationalError:rde,BodyTimeoutError:Ius,HTTPParserError:xus,ResponseExceededMaxSizeError:wus}=mc(),{kUrl:KPn,kReset:$v,kClient:jJt,kParser:ep,kBlocking:$we,kRunning:rE,kPending:Rus,kSize:GPn,kWriting:Dq,kQueue:BP,kNoRef:Hwe,kKeepAliveDefaultTimeout:kus,kHostHeader:Pus,kPendingIdx:Dus,kRunningIdx:ew,kError:tw,kPipelining:Ktt,kSocket:nde,kKeepAliveTimeoutValue:Xtt,kMaxHeadersSize:UJt,kKeepAliveMaxTimeout:Nus,kKeepAliveTimeoutThreshold:Mus,kHeadersTimeout:Ous,kBodyTimeout:Bus,kStrictContentLength:HJt,kMaxRequests:$Pn,kCounter:Lus,kMaxResponseSize:Fus,kOnError:Uus,kResume:Pq,kHTTPContext:JPn}=Od(),NO=Ukn(),Qus=Buffer.alloc(0),Wtt=Buffer[Symbol.species],ztt=yo.addListener,qus=yo.removeAllListeners,QJt;async function jus(){let t=process.env.JEST_WORKER_ID?vJt():void 0,e;try{e=await WebAssembly.compile(jkn())}catch{e=await WebAssembly.compile(t||vJt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onStatus(new Wtt(MO.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Gi(tm.ptr===r),tm.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onHeaderField(new Wtt(MO.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onHeaderValue(new Wtt(MO.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Gi(tm.ptr===r),tm.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onBody(new Wtt(MO.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Gi(tm.ptr===r),tm.onMessageComplete()||0),"wasm_on_message_complete")}})}a(jus,"lazyllhttp");var qJt=null,GJt=jus();GJt.catch();var tm=null,MO=null,Ytt=0,OO=null,Hus=0,Gwe=1,ide=2|Gwe,Jtt=4|Gwe,$Jt=8|Hus,VJt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Gi(Number.isFinite(e[UJt])&&e[UJt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(NO.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[UJt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Fus]}setTimeout(e,r){e!==this.timeoutValue||r&Gwe^this.timeoutType&Gwe?(this.timeout&&(FJt.clearTimeout(this.timeout),this.timeout=null),e&&(r&Gwe?this.timeout=FJt.setFastTimeout(VPn,e,new WeakRef(this)):(this.timeout=setTimeout(VPn,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||(Gi(this.ptr!=null),Gi(tm==null),this.llhttp.llhttp_resume(this.ptr),Gi(this.timeoutType===Jtt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Qus),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Gi(this.ptr!=null),Gi(tm==null),Gi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Ytt&&(OO&&n.free(OO),Ytt=Math.ceil(e.length/4096)*4096,OO=n.malloc(Ytt)),new Uint8Array(n.memory.buffer,OO,Ytt).set(e);try{let o;try{MO=e,tm=this,o=n.llhttp_execute(this.ptr,OO,e.length)}catch(c){throw c}finally{tm=null,MO=null}let s=n.llhttp_get_error_pos(this.ptr)-OO;if(o===NO.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===NO.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==NO.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 xus(l,NO.ERROR[o],e.slice(s))}}catch(o){yo.destroy(r,o)}}destroy(){Gi(this.ptr!=null),Gi(tm==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&FJt.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[BP][r[ew]];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=yo.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&yo.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&yo.destroy(this.socket,new Tus)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Gi(r),Gi(n[nde]===o),Gi(!o.destroyed),Gi(!this.paused),Gi((s.length&1)===0);let l=n[BP][n[ew]];Gi(l),Gi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[ep].destroy(),o[ep]=null,o[jJt]=null,o[tw]=null,qus(o),n[nde]=null,n[JPn]=null,n[BP][n[ew]++]=null,n.emit("disconnect",n[KPn],[n],new rde("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){yo.destroy(o,u)}n[Pq]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[BP][o[ew]];if(!u)return-1;if(Gi(!this.upgrade),Gi(this.statusCode<200),e===100)return yo.destroy(s,new Ztt("bad response",yo.getSocketInfo(s))),-1;if(r&&!u.upgrade)return yo.destroy(s,new Ztt("bad upgrade",yo.getSocketInfo(s))),-1;if(Gi(this.timeoutType===ide),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[$v]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Bus];this.setTimeout(f,Jtt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Gi(o[rE]===1),this.upgrade=!0,2;if(r)return Gi(o[rE]===1),this.upgrade=!0,2;if(Gi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Ktt]){let f=this.keepAlive?yo.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Mus],o[Nus]);h<=0?s[$v]=!0:o[Xtt]=h}else o[Xtt]=o[kus]}else s[$v]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[$we]&&(s[$we]=!1,o[Pq]()),d?NO.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[BP][r[ew]];if(Gi(c),Gi(this.timeoutType===Jtt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Gi(o>=200),s>-1&&this.bytesRead+e.length>s)return yo.destroy(n,new wus),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return NO.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;Gi(n>=100),Gi((this.headers.length&1)===0);let d=e[BP][e[ew]];if(Gi(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 yo.destroy(r,new bus),-1;if(d.onComplete(s),e[BP][e[ew]++]=null,r[Dq])return Gi(e[rE]===0),yo.destroy(r,new rde("reset")),NO.ERROR.PAUSED;if(u){if(r[$v]&&e[rE]===0)return yo.destroy(r,new rde("reset")),NO.ERROR.PAUSED;e[Ktt]==null||e[Ktt]===1?setImmediate(()=>e[Pq]()):e[Pq]()}else return yo.destroy(r,new rde("reset")),NO.ERROR.PAUSED}}};function VPn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===ide?(!e[Dq]||e.writableNeedDrain||n[rE]>1)&&(Gi(!o,"cannot be paused while waiting for headers"),yo.destroy(e,new Sus)):r===Jtt?o||yo.destroy(e,new Ius):r===$Jt&&(Gi(n[rE]===0&&n[Xtt]),yo.destroy(e,new rde("socket idle timeout")))}a(VPn,"onParserTimeout");async function Gus(t,e){t[nde]=e,qJt||(qJt=await GJt,GJt=null),e[Hwe]=!1,e[Dq]=!1,e[$v]=!1,e[$we]=!1,e[ep]=new VJt(t,e,qJt),ztt(e,"error",function(n){Gi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[ep];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[tw]=n,this[jJt][Uus](n)}),ztt(e,"readable",function(){let n=this[ep];n&&n.readMore()}),ztt(e,"end",function(){let n=this[ep];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}yo.destroy(this,new Ztt("other side closed",yo.getSocketInfo(this)))}),ztt(e,"close",function(){let n=this[jJt],o=this[ep];o&&(!this[tw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[ep].destroy(),this[ep]=null);let s=this[tw]||new Ztt("closed",yo.getSocketInfo(this));if(n[nde]=null,n[JPn]=null,n.destroyed){Gi(n[Rus]===0);let c=n[BP].splice(n[ew]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[BP][n[ew]];n[BP][n[ew]++]=null,yo.errorRequest(n,c,s)}n[Dus]=n[ew],Gi(n[rE]===0),n.emit("disconnect",n[KPn],[n],s),n[Pq]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Wus(t,...n)},resume(){$us(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[Dq]||e[$v]||e[$we]||n&&(t[rE]>0&&!n.idempotent||t[rE]>0&&(n.upgrade||n.method==="CONNECT")||t[rE]>0&&yo.bodyLength(n.body)!==0&&(yo.isStream(n.body)||yo.isAsyncIterable(n.body)||yo.isFormDataLike(n.body))))}}}a(Gus,"connectH1");function $us(t){let e=t[nde];if(e&&!e.destroyed){if(t[GPn]===0?!e[Hwe]&&e.unref&&(e.unref(),e[Hwe]=!0):e[Hwe]&&e.ref&&(e.ref(),e[Hwe]=!1),t[GPn]===0)e[ep].timeoutType!==$Jt&&e[ep].setTimeout(t[Xtt],$Jt);else if(t[rE]>0&&e[ep].statusCode<200&&e[ep].timeoutType!==ide){let r=t[BP][t[ew]],n=r.headersTimeout!=null?r.headersTimeout:t[Ous];e[ep].setTimeout(n,ide)}}}a($us,"resumeH1");function Vus(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(Vus,"shouldSendContentLength");function Wus(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(yo.isFormDataLike(u)){QJt||(QJt=tde().extractBody);let[E,_]=QJt(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else yo.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=yo.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),Vus(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[HJt])return yo.errorRequest(t,e,new aJ),!1;process.emitWarning(new aJ)}let g=t[nde],A=a(E=>{e.aborted||e.completed||(yo.errorRequest(t,e,E||new YPn),yo.destroy(u),yo.destroy(g,new rde("aborted")))},"abort");try{e.onConnect(A)}catch(E){yo.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[$v]=!0),(s||r==="CONNECT")&&(g[$v]=!0),l!=null&&(g[$v]=l),t[$Pn]&&g[Lus]++>=t[$Pn]&&(g[$v]=!0),c&&(g[$we]=!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=rtt.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(QRn(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(fwe.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:Oos(t)}if((typeof o=="string"||fwe.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(!GRn(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(WRn,"extractBody");function zos(t,e=!1){return t instanceof ReadableStream&&(TKt(!fwe.isDisturbed(t),"The body has already been consumed."),TKt(!t.locked,"The stream is locked.")),WRn(t,e)}a(zos,"safelyExtractBody");function Yos(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(Yos,"cloneBody");function Kos(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(Kos,"throwIfAborted");function Jos(t){return{blob(){return Rue(this,r=>{let n=jRn(this);return n===null?n="":n&&(n=$os(n)),new jos([r],{type:n})},t)},arrayBuffer(){return Rue(this,r=>new Uint8Array(r).buffer,t)},text(){return Rue(this,HRn,t)},json(){return Rue(this,Xos,t)},formData(){return Rue(this,r=>{let n=jRn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=Vos(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new qRn;return s[Pue]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new qRn;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 Rue(this,r=>new Uint8Array(r),t)}}}a(Jos,"bodyMixinMethods");function Zos(t){Object.assign(t.prototype,Jos(t))}a(Zos,"mixinBody");async function Rue(t,e,r){if(qos.brandCheck(t,r),zRn(t))throw new TypeError("Body is unusable: Body has already been read");Kos(t[Pue]);let n=Fos(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[Pue].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await Uos(t[Pue].body,s,o),n.promise)}a(Rue,"consumeBody");function zRn(t){let e=t[Pue].body;return e!=null&&(e.stream.locked||fwe.isDisturbed(e.stream))}a(zRn,"bodyUnusable");function Xos(t){return JSON.parse(HRn(t))}a(Xos,"parseJSONFromBytes");function jRn(t){let e=t[Pue].headersList,r=Qos(e);return r==="failure"?null:r}a(jRn,"bodyMimeType");YRn.exports={extractBody:WRn,safelyExtractBody:zos,cloneBody:Yos,mixinBody:Zos,streamRegistry:VRn,hasFinalizationRegistry:$Rn,bodyUnusable:zRn}});var sPn=I((EQd,oPn)=>{"use strict";p();var ji=require("node:assert"),Ao=Ms(),{channels:KRn}=yue(),xKt=cKt(),{RequestContentLengthMismatchError:qK,ResponseContentLengthMismatchError:ess,RequestAbortedError:rPn,HeadersTimeoutError:tss,HeadersOverflowError:rss,SocketError:ctt,InformationalError:Due,BodyTimeoutError:nss,HTTPParserError:iss,ResponseExceededMaxSizeError:oss}=pc(),{kUrl:nPn,kReset:UC,kClient:kKt,kParser:tp,kBlocking:mwe,kRunning:rE,kPending:sss,kSize:JRn,kWriting:hq,kQueue:Rk,kNoRef:pwe,kKeepAliveDefaultTimeout:ass,kHostHeader:css,kPendingIdx:lss,kRunningIdx:Wx,kError:zx,kPipelining:stt,kSocket:Nue,kKeepAliveTimeoutValue:ltt,kMaxHeadersSize:wKt,kKeepAliveMaxTimeout:uss,kKeepAliveTimeoutThreshold:dss,kHeadersTimeout:fss,kBodyTimeout:pss,kStrictContentLength:DKt,kMaxRequests:ZRn,kCounter:hss,kMaxResponseSize:mss,kOnError:gss,kResume:pq,kHTTPContext:iPn}=Nd(),vO=Vwn(),Ass=Buffer.alloc(0),ntt=Buffer[Symbol.species],itt=Ao.addListener,yss=Ao.removeAllListeners,RKt;async function Ess(){let t=process.env.JEST_WORKER_ID?dKt():void 0,e;try{e=await WebAssembly.compile(Ywn())}catch{e=await WebAssembly.compile(t||dKt())}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(tm.ptr===r);let s=n-bO+CO.byteOffset;return tm.onStatus(new ntt(CO.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(ji(tm.ptr===r),tm.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{ji(tm.ptr===r);let s=n-bO+CO.byteOffset;return tm.onHeaderField(new ntt(CO.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{ji(tm.ptr===r);let s=n-bO+CO.byteOffset;return tm.onHeaderValue(new ntt(CO.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(ji(tm.ptr===r),tm.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{ji(tm.ptr===r);let s=n-bO+CO.byteOffset;return tm.onBody(new ntt(CO.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(ji(tm.ptr===r),tm.onMessageComplete()||0),"wasm_on_message_complete")}})}a(Ess,"lazyllhttp");var PKt=null,NKt=Ess();NKt.catch();var tm=null,CO=null,ott=0,bO=null,_ss=0,hwe=1,Mue=2|hwe,att=4|hwe,MKt=8|_ss,OKt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){ji(Number.isFinite(e[wKt])&&e[wKt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(vO.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[wKt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[mss]}setTimeout(e,r){e!==this.timeoutValue||r&hwe^this.timeoutType&hwe?(this.timeout&&(xKt.clearTimeout(this.timeout),this.timeout=null),e&&(r&hwe?this.timeout=xKt.setFastTimeout(XRn,e,new WeakRef(this)):(this.timeout=setTimeout(XRn,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(tm==null),this.llhttp.llhttp_resume(this.ptr),ji(this.timeoutType===att),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Ass),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(tm==null),ji(!this.paused);let{socket:r,llhttp:n}=this;e.length>ott&&(bO&&n.free(bO),ott=Math.ceil(e.length/4096)*4096,bO=n.malloc(ott)),new Uint8Array(n.memory.buffer,bO,ott).set(e);try{let o;try{CO=e,tm=this,o=n.llhttp_execute(this.ptr,bO,e.length)}catch(c){throw c}finally{tm=null,CO=null}let s=n.llhttp_get_error_pos(this.ptr)-bO;if(o===vO.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===vO.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==vO.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 iss(l,vO.ERROR[o],e.slice(s))}}catch(o){Ao.destroy(r,o)}}destroy(){ji(this.ptr!=null),ji(tm==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&xKt.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[Rk][r[Wx]];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 rss)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;ji(r),ji(n[Nue]===o),ji(!o.destroyed),ji(!this.paused),ji((s.length&1)===0);let l=n[Rk][n[Wx]];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[tp].destroy(),o[tp]=null,o[kKt]=null,o[zx]=null,yss(o),n[Nue]=null,n[iPn]=null,n[Rk][n[Wx]++]=null,n.emit("disconnect",n[nPn],[n],new Due("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ao.destroy(o,u)}n[pq]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[Rk][o[Wx]];if(!u)return-1;if(ji(!this.upgrade),ji(this.statusCode<200),e===100)return Ao.destroy(s,new ctt("bad response",Ao.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ao.destroy(s,new ctt("bad upgrade",Ao.getSocketInfo(s))),-1;if(ji(this.timeoutType===Mue),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[UC]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[pss];this.setTimeout(f,att)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return ji(o[rE]===1),this.upgrade=!0,2;if(r)return ji(o[rE]===1),this.upgrade=!0,2;if(ji((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[stt]){let f=this.keepAlive?Ao.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[dss],o[uss]);h<=0?s[UC]=!0:o[ltt]=h}else o[ltt]=o[ass]}else s[UC]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[mwe]&&(s[mwe]=!1,o[pq]()),d?vO.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[Rk][r[Wx]];if(ji(c),ji(this.timeoutType===att),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),ji(o>=200),s>-1&&this.bytesRead+e.length>s)return Ao.destroy(n,new oss),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return vO.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[Rk][e[Wx]];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 ess),-1;if(d.onComplete(s),e[Rk][e[Wx]++]=null,r[hq])return ji(e[rE]===0),Ao.destroy(r,new Due("reset")),vO.ERROR.PAUSED;if(u){if(r[UC]&&e[rE]===0)return Ao.destroy(r,new Due("reset")),vO.ERROR.PAUSED;e[stt]==null||e[stt]===1?setImmediate(()=>e[pq]()):e[pq]()}else return Ao.destroy(r,new Due("reset")),vO.ERROR.PAUSED}}};function XRn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===Mue?(!e[hq]||e.writableNeedDrain||n[rE]>1)&&(ji(!o,"cannot be paused while waiting for headers"),Ao.destroy(e,new tss)):r===att?o||Ao.destroy(e,new nss):r===MKt&&(ji(n[rE]===0&&n[ltt]),Ao.destroy(e,new Due("socket idle timeout")))}a(XRn,"onParserTimeout");async function vss(t,e){t[Nue]=e,PKt||(PKt=await NKt,NKt=null),e[pwe]=!1,e[hq]=!1,e[UC]=!1,e[mwe]=!1,e[tp]=new OKt(t,e,PKt),itt(e,"error",function(n){ji(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[tp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[zx]=n,this[kKt][gss](n)}),itt(e,"readable",function(){let n=this[tp];n&&n.readMore()}),itt(e,"end",function(){let n=this[tp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}Ao.destroy(this,new ctt("other side closed",Ao.getSocketInfo(this)))}),itt(e,"close",function(){let n=this[kKt],o=this[tp];o&&(!this[zx]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[tp].destroy(),this[tp]=null);let s=this[zx]||new ctt("closed",Ao.getSocketInfo(this));if(n[Nue]=null,n[iPn]=null,n.destroyed){ji(n[sss]===0);let c=n[Rk].splice(n[Wx]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[Rk][n[Wx]];n[Rk][n[Wx]++]=null,Ao.errorRequest(n,c,s)}n[lss]=n[Wx],ji(n[rE]===0),n.emit("disconnect",n[nPn],[n],s),n[pq]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Sss(t,...n)},resume(){Css(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[hq]||e[UC]||e[mwe]||n&&(t[rE]>0&&!n.idempotent||t[rE]>0&&(n.upgrade||n.method==="CONNECT")||t[rE]>0&&Ao.bodyLength(n.body)!==0&&(Ao.isStream(n.body)||Ao.isAsyncIterable(n.body)||Ao.isFormDataLike(n.body))))}}}a(vss,"connectH1");function Css(t){let e=t[Nue];if(e&&!e.destroyed){if(t[JRn]===0?!e[pwe]&&e.unref&&(e.unref(),e[pwe]=!0):e[pwe]&&e.ref&&(e.ref(),e[pwe]=!1),t[JRn]===0)e[tp].timeoutType!==MKt&&e[tp].setTimeout(t[ltt],MKt);else if(t[rE]>0&&e[tp].statusCode<200&&e[tp].timeoutType!==Mue){let r=t[Rk][t[Wx]],n=r.headersTimeout!=null?r.headersTimeout:t[fss];e[tp].setTimeout(n,Mue)}}}a(Css,"resumeH1");function bss(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(bss,"shouldSendContentLength");function Sss(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)){RKt||(RKt=kue().extractBody);let[E,_]=RKt(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),bss(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[DKt])return Ao.errorRequest(t,e,new qK),!1;process.emitWarning(new qK)}let g=t[Nue],A=a(E=>{e.aborted||e.completed||(Ao.errorRequest(t,e,E||new rPn),Ao.destroy(u),Ao.destroy(g,new Due("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ao.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[UC]=!0),(s||r==="CONNECT")&&(g[UC]=!0),l!=null&&(g[UC]=l),t[ZRn]&&g[hss]++>=t[ZRn]&&(g[UC]=!0),c&&(g[mwe]=!0);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[Pus],s?y+=`connection: upgrade\r +`:y+=t[css],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[Ktt]&&!g[$v]?y+=`connection: keep-alive\r +`:t[stt]&&!g[UC]?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 YPn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Gi(o.destroyed||o[Dq]&&r[rE]<=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")?yo.destroy(e,A):yo.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(zus,"writeStream");function WPn(t,e,r,n,o,s,c,l){try{e?yo.isBuffer(e)&&(Gi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return KRn.sendHeaders.hasSubscribers&&KRn.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?ePn(A,null,t,e,g,f,y,h):Ao.isBuffer(u)?ePn(A,u,t,e,g,f,y,h):Ao.isBlobLike(u)?typeof u.stream=="function"?tPn(A,u.stream(),t,e,g,f,y,h):Iss(A,u,t,e,g,f,y,h):Ao.isStream(u)?Tss(A,u,t,e,g,f,y,h):Ao.isIterable(u)?tPn(A,u,t,e,g,f,y,h):ji(!1),!0}a(Sss,"writeH1");function Tss(t,e,r,n,o,s,c,l){ji(s!==0||r[rE]===0,"stream body cannot be pipelined");let u=!1,d=new utt({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 rPn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,ji(o.destroyed||o[hq]&&r[rE]<=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(Tss,"writeStream");function ePn(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[$v]=!0)):s===0?o.write(`${c}content-length: 0\r +`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[UC]=!0)):s===0?o.write(`${c}content-length: 0\r \r -`,"latin1"):(Gi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[Pq]()}catch(u){t(u)}}a(WPn,"writeBuffer");async function Yus(t,e,r,n,o,s,c,l){Gi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new aJ;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[pq]()}catch(u){t(u)}}a(ePn,"writeBuffer");async function Iss(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 qK;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[$v]=!0),r[Pq]()}catch(u){t(u)}}a(Yus,"writeBlob");async function zPn(t,e,r,n,o,s,c,l){Gi(s!==0||r[rE]===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)=>{Gi(u===null),o[tw]?g(o[tw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new ert({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[tw])throw o[tw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(zPn,"writeIterable");var ert=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[Dq]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[tw])throw r[tw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[HJt])throw new aJ;process.emitWarning(new aJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[$v]=!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[UC]=!0),r[pq]()}catch(u){t(u)}}a(Iss,"writeBlob");async function tPn(t,e,r,n,o,s,c,l){ji(s!==0||r[rE]===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[zx]?g(o[zx]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new utt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[zx])throw o[zx];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(tPn,"writeIterable");var utt=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[hq]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[zx])throw r[zx];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[DKt])throw new qK;process.emitWarning(new qK)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[UC]=!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[ep].timeout&&r[ep].timeoutType===ide&&r[ep].timeout.refresh&&r[ep].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Dq]=!1,e[tw])throw e[tw];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[tp].timeout&&r[tp].timeoutType===Mue&&r[tp].timeout.refresh&&r[tp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[hq]=!1,e[zx])throw e[zx];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[HJt])throw new aJ;process.emitWarning(new aJ)}e[ep].timeout&&e[ep].timeoutType===ide&&e[ep].timeout.refresh&&e[ep].timeout.refresh(),n[Pq]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Dq]=!1,e&&(Gi(n[rE]<=1,"pipeline should only contain this request"),o(e))}};ZPn.exports=Gus});var a2n=I((nWd,s2n)=>{"use strict";p();var rw=require("node:assert"),{pipeline:Kus}=require("node:stream"),ua=Ls(),{RequestContentLengthMismatchError:WJt,RequestAbortedError:e2n,SocketError:Vwe,InformationalError:zJt}=mc(),{kUrl:trt,kReset:nrt,kClient:ode,kRunning:irt,kPending:Jus,kQueue:Nq,kPendingIdx:YJt,kRunningIdx:LP,kError:UP,kSocket:pg,kStrictContentLength:Zus,kOnError:KJt,kMaxConcurrentStreams:o2n,kHTTP2Session:FP,kResume:Mq,kSize:Xus,kHTTPContext:eds}=Od(),Z3=Symbol("open streams"),t2n,r2n=!1,rrt;try{rrt=require("node:http2")}catch{rrt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:tds,HTTP2_HEADER_METHOD:rds,HTTP2_HEADER_PATH:nds,HTTP2_HEADER_SCHEME:ids,HTTP2_HEADER_CONTENT_LENGTH:ods,HTTP2_HEADER_EXPECT:sds,HTTP2_HEADER_STATUS:ads}}=rrt;function cds(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(cds,"parseH2Headers");async function lds(t,e){t[pg]=e,r2n||(r2n=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=rrt.connect(t[trt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[o2n]});r[Z3]=0,r[ode]=t,r[pg]=e,ua.addListener(r,"error",dds),ua.addListener(r,"frameError",fds),ua.addListener(r,"end",pds),ua.addListener(r,"goaway",hds),ua.addListener(r,"close",function(){let{[ode]:o}=this,{[pg]:s}=o,c=this[pg][UP]||this[UP]||new Vwe("closed",ua.getSocketInfo(s));if(o[FP]=null,o.destroyed){rw(o[Jus]===0);let l=o[Nq].splice(o[LP]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return gds(t,...o)},resume(){uds(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(lds,"connectH2");function uds(t){let e=t[pg];e?.destroyed===!1&&(t[Xus]===0&&t[o2n]===0?(e.unref(),t[FP].unref()):(e.ref(),t[FP].ref()))}a(uds,"resumeH2");function dds(t){rw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[pg][UP]=t,this[ode][KJt](t)}a(dds,"onHttp2SessionError");function fds(t,e,r){if(r===0){let n=new zJt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[pg][UP]=n,this[ode][KJt](n)}}a(fds,"onHttp2FrameError");function pds(){let t=new Vwe("other side closed",ua.getSocketInfo(this[pg]));this.destroy(t),ua.destroy(this[pg],t)}a(pds,"onHttp2SessionEnd");function hds(t){let e=this[UP]||new Vwe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ua.getSocketInfo(this)),r=this[ode];if(r[pg]=null,r[eds]=null,this[FP]!=null&&(this[FP].destroy(e),this[FP]=null),ua.destroy(this[pg],e),r[LP]{e.aborted||e.completed||(T=T||new e2n,ua.errorRequest(t,e,T),m!=null&&ua.destroy(m,T),ua.destroy(f,T),t[Nq][t[LP]++]=null,t[Mq]())},"abort");try{e.onConnect(y)}catch(T){ua.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[Z3],t[Nq][t[LP]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[Z3],t[Nq][t[LP]++]=null}),m.once("close",()=>{r[Z3]-=1,r[Z3]===0&&r.unref()}),!0;h[nds]=o,h[ids]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=ua.bodyLength(f);if(ua.isFormDataLike(f)){t2n??=tde().extractBody;let[T,w]=t2n(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),mds(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Zus])return ua.errorRequest(t,e,new WJt),!1;process.emitWarning(new WJt)}_!=null&&(rw(f,"no body must not have content length"),h[ods]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[sds]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[Z3],m.once("response",T=>{let{[ads]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new e2n;ua.errorRequest(t,e,x),ua.destroy(m,x);return}e.onHeaders(Number(w),cds(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[Z3]===0&&r.unref(),y(new zJt("HTTP/2: stream half-closed (remote)")),t[Nq][t[LP]++]=null,t[YJt]=t[LP],t[Mq]()}),m.once("close",()=>{r[Z3]-=1,r[Z3]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new zJt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?n2n(y,m,null,t,e,t[pg],_,E):ua.isBuffer(f)?n2n(y,m,f,t,e,t[pg],_,E):ua.isBlobLike(f)?typeof f.stream=="function"?i2n(y,m,f.stream(),t,e,t[pg],_,E):yds(y,m,f,t,e,t[pg],_,E):ua.isStream(f)?Ads(y,t[pg],E,m,f,t,e,_):ua.isIterable(f)?i2n(y,m,f,t,e,t[pg],_,E):rw(!1)}a(b,"writeBodyH2")}a(gds,"writeH2");function n2n(t,e,r,n,o,s,c,l){try{r!=null&&ua.isBuffer(r)&&(rw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[nrt]=!0),o.onRequestSent(),n[Mq]()}catch(u){t(u)}}a(n2n,"writeBuffer");function Ads(t,e,r,n,o,s,c,l){rw(l!==0||s[irt]===0,"stream body cannot be pipelined");let u=Kus(o,n,f=>{f?(ua.destroy(u,f),t(f)):(ua.removeAllListeners(u),c.onRequestSent(),r||(e[nrt]=!0),s[Mq]())});ua.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(Ads,"writeStream");async function yds(t,e,r,n,o,s,c,l){rw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new WJt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[nrt]=!0),n[Mq]()}catch(u){t(u)}}a(yds,"writeBlob");async function i2n(t,e,r,n,o,s,c,l){rw(c!==0||n[irt]===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)=>{rw(u===null),s[UP]?m(s[UP]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[UP])throw s[UP];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[nrt]=!0),n[Mq]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(i2n,"writeIterable");s2n.exports=lds});var srt=I((sWd,u2n)=>{"use strict";p();var BO=Ls(),{kBodyUsed:Wwe}=Od(),ZJt=require("node:assert"),{InvalidArgumentError:Eds}=mc(),_ds=require("node:events"),Cds=[300,301,302,303,307,308],c2n=Symbol("body"),ort=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[c2n]=e,this[Wwe]=!1}async*[Symbol.asyncIterator](){ZJt(!this[Wwe],"disturbed"),this[Wwe]=!0,yield*this[c2n]}},JJt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Eds("maxRedirections must be a positive number");BO.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,BO.isStream(this.opts.body)?(BO.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){ZJt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Wwe]=!1,_ds.prototype.on.call(this.opts.body,"data",function(){this[Wwe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new ort(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&BO.isIterable(this.opts.body)&&(this.opts.body=new ort(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||BO.isDisturbed(this.opts.body)?null:vds(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}=BO.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=bds(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 vds(t,e){if(Cds.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var Sds=srt();function Tds({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new Sds(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(Tds,"createRedirectInterceptor");d2n.exports=Tds});var cde=I((fWd,C2n)=>{"use strict";p();var X3=require("node:assert"),A2n=require("node:net"),Ids=require("node:http"),cJ=Ls(),{channels:sde}=jue(),xds=Ikn(),wds=Vue(),{InvalidArgumentError:zp,InformationalError:Rds,ClientDestroyedError:kds}=mc(),Pds=Mwe(),{kUrl:LO,kServerName:Oq,kClient:Dds,kBusy:XJt,kConnect:Nds,kResuming:lJ,kRunning:Zwe,kPending:Xwe,kSize:Jwe,kQueue:QP,kConnected:Mds,kConnecting:ade,kNeedDrain:Lq,kKeepAliveDefaultTimeout:f2n,kHostHeader:Ods,kPendingIdx:qP,kRunningIdx:eF,kError:Bds,kPipelining:crt,kKeepAliveTimeoutValue:Lds,kMaxHeadersSize:Fds,kKeepAliveMaxTimeout:Uds,kKeepAliveTimeoutThreshold:Qds,kHeadersTimeout:qds,kBodyTimeout:jds,kStrictContentLength:Hds,kConnector:zwe,kMaxRedirections:Gds,kMaxRequests:eZt,kCounter:$ds,kClose:Vds,kDestroy:Wds,kDispatch:zds,kInterceptors:p2n,kLocalAddress:Ywe,kMaxResponseSize:Yds,kOnError:Kds,kHTTPContext:Yp,kMaxConcurrentStreams:Jds,kResume:Kwe}=Od(),Zds=XPn(),Xds=a2n(),h2n=!1,Bq=Symbol("kClosedResolve"),m2n=a(()=>{},"noop");function y2n(t){return t[crt]??t[Yp]?.defaultPipelining??1}a(y2n,"getPipelining");var tZt=class extends wds{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:k,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:L,allowH2:B}={}){if(super(),f!==void 0)throw new zp("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new zp("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new zp("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new zp("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new zp("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new zp("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new zp("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new zp("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new zp("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new zp("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new zp("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new zp("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new zp("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new zp("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new zp("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new zp("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||A2n.isIP(x)===0))throw new zp("localAddress must be valid string IP address");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new zp("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new zp("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new zp("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new zp("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Pds({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[p2n]=r.Client,h2n||(h2n=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[p2n]=[efs({maxRedirections:T})],this[LO]=cJ.parseOrigin(e),this[zwe]=w,this[crt]=E??1,this[Fds]=n||Ids.maxHeaderSize,this[f2n]=h??4e3,this[Uds]=g??6e5,this[Qds]=A??2e3,this[Lds]=this[f2n],this[Oq]=null,this[Ywe]=x??null,this[lJ]=0,this[Lq]=0,this[Ods]=`host: ${this[LO].hostname}${this[LO].port?`:${this[LO].port}`:""}\r -`,this[jds]=u??3e5,this[qds]=o??3e5,this[Hds]=v??!0,this[Gds]=T,this[eZt]=R,this[Bq]=null,this[Yds]=k>-1?k:-1,this[Jds]=L??100,this[Yp]=null,this[QP]=[],this[eF]=0,this[qP]=0,this[Kwe]=Q=>rZt(this,Q),this[Kds]=Q=>E2n(this,Q)}get pipelining(){return this[crt]}set pipelining(e){this[crt]=e,this[Kwe](!0)}get[Xwe](){return this[QP].length-this[qP]}get[Zwe](){return this[qP]-this[eF]}get[Jwe](){return this[QP].length-this[eF]}get[Mds](){return!!this[Yp]&&!this[ade]&&!this[Yp].destroyed}get[XJt](){return!!(this[Yp]?.busy(null)||this[Jwe]>=(y2n(this)||1)||this[Xwe]>0)}[Nds](e){_2n(this),this.once("connect",e)}[zds](e,r){let n=e.origin||this[LO].origin,o=new xds(n,e,r);return this[QP].push(o),this[lJ]||(cJ.bodyLength(o.body)==null&&cJ.isIterable(o.body)?(this[lJ]=1,queueMicrotask(()=>rZt(this))):this[Kwe](!0)),this[lJ]&&this[Lq]!==2&&this[XJt]&&(this[Lq]=2),this[Lq]<2}async[Vds](){return new Promise(e=>{this[Jwe]?this[Bq]=e:e(null)})}async[Wds](e){return new Promise(r=>{let n=this[QP].splice(this[qP]);for(let s=0;s{this[Bq]&&(this[Bq](),this[Bq]=null),r(null)},"callback");this[Yp]?(this[Yp].destroy(e,o),this[Yp]=null):queueMicrotask(o),this[Kwe]()})}},efs=art();function E2n(t,e){if(t[Zwe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){X3(t[qP]===t[eF]);let r=t[QP].splice(t[eF]);for(let n=0;n{t[zwe]({host:e,hostname:r,protocol:n,port:o,servername:t[Oq],localAddress:t[Ywe]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){cJ.destroy(s.on("error",m2n),new kds);return}X3(s);try{t[Yp]=s.alpnProtocol==="h2"?await Xds(t,s):await Zds(t,s)}catch(c){throw s.destroy().on("error",m2n),c}t[ade]=!1,s[$ds]=0,s[eZt]=t[eZt],s[Dds]=t,s[Bds]=null,sde.connected.hasSubscribers&&sde.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Yp]?.version,servername:t[Oq],localAddress:t[Ywe]},connector:t[zwe],socket:s}),t.emit("connect",t[LO],[t])}catch(s){if(t.destroyed)return;if(t[ade]=!1,sde.connectError.hasSubscribers&&sde.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Yp]?.version,servername:t[Oq],localAddress:t[Ywe]},connector:t[zwe],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(X3(t[Zwe]===0);t[Xwe]>0&&t[QP][t[qP]].servername===t[Oq];){let c=t[QP][t[qP]++];cJ.errorRequest(t,c,s)}else E2n(t,s);t.emit("connectionError",t[LO],[t],s)}t[Kwe]()}a(_2n,"connect");function g2n(t){t[Lq]=0,t.emit("drain",t[LO],[t])}a(g2n,"emitDrain");function rZt(t,e){t[lJ]!==2&&(t[lJ]=2,tfs(t,e),t[lJ]=0,t[eF]>256&&(t[QP].splice(0,t[eF]),t[qP]-=t[eF],t[eF]=0))}a(rZt,"resume");function tfs(t,e){for(;;){if(t.destroyed){X3(t[Xwe]===0);return}if(t[Bq]&&!t[Jwe]){t[Bq](),t[Bq]=null;return}if(t[Yp]&&t[Yp].resume(),t[XJt])t[Lq]=2;else if(t[Lq]===2){e?(t[Lq]=1,queueMicrotask(()=>g2n(t))):g2n(t);continue}if(t[Xwe]===0||t[Zwe]>=(y2n(t)||1))return;let r=t[QP][t[qP]];if(t[LO].protocol==="https:"&&t[Oq]!==r.servername){if(t[Zwe]>0)return;t[Oq]=r.servername,t[Yp]?.destroy(new Rds("servername changed"),()=>{t[Yp]=null,rZt(t)})}if(t[ade])return;if(!t[Yp]){_2n(t);return}if(t[Yp].destroyed||t[Yp].busy(r))return;!r.aborted&&t[Yp].write(r)?t[qP]++:t[QP].splice(t[qP],1)}}a(tfs,"_resume");C2n.exports=tZt});var nZt=I((gWd,v2n)=>{"use strict";p();var lrt=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)}};v2n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new lrt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new lrt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var S2n=I((EWd,b2n)=>{p();var{kFree:rfs,kConnected:nfs,kPending:ifs,kQueued:ofs,kRunning:sfs,kSize:afs}=Od(),uJ=Symbol("pool"),iZt=class{static{a(this,"PoolStats")}constructor(e){this[uJ]=e}get connected(){return this[uJ][nfs]}get free(){return this[uJ][rfs]}get pending(){return this[uJ][ifs]}get queued(){return this[uJ][ofs]}get running(){return this[uJ][sfs]}get size(){return this[uJ][afs]}};b2n.exports=iZt});var uZt=I((vWd,M2n)=>{"use strict";p();var cfs=Vue(),lfs=nZt(),{kConnected:oZt,kSize:T2n,kRunning:I2n,kPending:x2n,kQueued:eRe,kBusy:ufs,kFree:dfs,kUrl:ffs,kClose:pfs,kDestroy:hfs,kDispatch:mfs}=Od(),gfs=S2n(),Vv=Symbol("clients"),j_=Symbol("needDrain"),tRe=Symbol("queue"),sZt=Symbol("closed resolve"),aZt=Symbol("onDrain"),w2n=Symbol("onConnect"),R2n=Symbol("onDisconnect"),k2n=Symbol("onConnectionError"),cZt=Symbol("get dispatcher"),D2n=Symbol("add client"),N2n=Symbol("remove client"),P2n=Symbol("stats"),lZt=class extends cfs{static{a(this,"PoolBase")}constructor(){super(),this[tRe]=new lfs,this[Vv]=[],this[eRe]=0;let e=this;this[aZt]=a(function(n,o){let s=e[tRe],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[eRe]--,c=!this.dispatch(l.opts,l.handler)}this[j_]=c,!this[j_]&&e[j_]&&(e[j_]=!1,e.emit("drain",n,[e,...o])),e[sZt]&&s.isEmpty()&&Promise.all(e[Vv].map(l=>l.close())).then(e[sZt])},"onDrain"),this[w2n]=(r,n)=>{e.emit("connect",r,[e,...n])},this[R2n]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[k2n]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[P2n]=new gfs(this)}get[ufs](){return this[j_]}get[oZt](){return this[Vv].filter(e=>e[oZt]).length}get[dfs](){return this[Vv].filter(e=>e[oZt]&&!e[j_]).length}get[x2n](){let e=this[eRe];for(let{[x2n]:r}of this[Vv])e+=r;return e}get[I2n](){let e=0;for(let{[I2n]:r}of this[Vv])e+=r;return e}get[T2n](){let e=this[eRe];for(let{[T2n]:r}of this[Vv])e+=r;return e}get stats(){return this[P2n]}async[pfs](){this[tRe].isEmpty()?await Promise.all(this[Vv].map(e=>e.close())):await new Promise(e=>{this[sZt]=e})}async[hfs](e){for(;;){let r=this[tRe].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[Vv].map(r=>r.destroy(e)))}[mfs](e,r){let n=this[cZt]();return n?n.dispatch(e,r)||(n[j_]=!0,this[j_]=!this[cZt]()):(this[j_]=!0,this[tRe].push({opts:e,handler:r}),this[eRe]++),!this[j_]}[D2n](e){return e.on("drain",this[aZt]).on("connect",this[w2n]).on("disconnect",this[R2n]).on("connectionError",this[k2n]),this[Vv].push(e),this[j_]&&queueMicrotask(()=>{this[j_]&&this[aZt](e[ffs],[this,e])}),this}[N2n](e){e.close(()=>{let r=this[Vv].indexOf(e);r!==-1&&this[Vv].splice(r,1)}),this[j_]=this[Vv].some(r=>!r[j_]&&r.closed!==!0&&r.destroyed!==!0)}};M2n.exports={PoolBase:lZt,kClients:Vv,kNeedDrain:j_,kAddClient:D2n,kRemoveClient:N2n,kGetDispatcher:cZt}});var lde=I((TWd,F2n)=>{"use strict";p();var{PoolBase:Afs,kClients:urt,kNeedDrain:yfs,kAddClient:Efs,kGetDispatcher:_fs}=uZt(),Cfs=cde(),{InvalidArgumentError:dZt}=mc(),O2n=Ls(),{kUrl:B2n,kInterceptors:vfs}=Od(),bfs=Mwe(),fZt=Symbol("options"),pZt=Symbol("connections"),L2n=Symbol("factory");function Sfs(t,e){return new Cfs(t,e)}a(Sfs,"defaultFactory");var hZt=class extends Afs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Sfs,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 dZt("invalid connections");if(typeof n!="function")throw new dZt("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new dZt("connect must be a function or an object");typeof o!="function"&&(o=bfs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[vfs]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[pZt]=r||null,this[B2n]=O2n.parseOrigin(e),this[fZt]={...O2n.deepClone(m),connect:o,allowH2:h},this[fZt].interceptors=m.interceptors?{...m.interceptors}:void 0,this[L2n]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[urt].indexOf(E);_!==-1&&this[urt].splice(_,1)}})}[_fs](){for(let e of this[urt])if(!e[yfs])return e;if(!this[pZt]||this[urt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Tfs,InvalidArgumentError:Ifs}=mc(),{PoolBase:xfs,kClients:nE,kNeedDrain:rRe,kAddClient:wfs,kRemoveClient:Rfs,kGetDispatcher:kfs}=uZt(),Pfs=lde(),{kUrl:mZt,kInterceptors:Dfs}=Od(),{parseOrigin:U2n}=Ls(),Q2n=Symbol("factory"),drt=Symbol("options"),q2n=Symbol("kGreatestCommonDivisor"),dJ=Symbol("kCurrentWeight"),fJ=Symbol("kIndex"),nw=Symbol("kWeight"),frt=Symbol("kMaxWeightPerServer"),prt=Symbol("kErrorPenalty");function Nfs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Nfs,"getGreatestCommonDivisor");function Mfs(t,e){return new Pfs(t,e)}a(Mfs,"defaultFactory");var gZt=class extends xfs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Mfs,...n}={}){if(super(),this[drt]=n,this[fJ]=-1,this[dJ]=0,this[frt]=this[drt].maxWeightPerServer||100,this[prt]=this[drt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Ifs("factory must be a function.");this[Dfs]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[Q2n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=U2n(e).origin;if(this[nE].find(o=>o[mZt].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[Q2n](r,Object.assign({},this[drt]));this[wfs](n),n.on("connect",()=>{n[nw]=Math.min(this[frt],n[nw]+this[prt])}),n.on("connectionError",()=>{n[nw]=Math.max(1,n[nw]-this[prt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[nw]=Math.max(1,n[nw]-this[prt]),this._updateBalancedPoolStats())});for(let o of this[nE])o[nw]=this[frt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[mZt].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Rfs](n),this}get upstreams(){return this[nE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[mZt].origin)}[kfs](){if(this[nE].length===0)throw new Tfs;if(!this[nE].find(s=>!s[rRe]&&s.closed!==!0&&s.destroyed!==!0)||this[nE].map(s=>s[rRe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[nE].findIndex(s=>!s[rRe]);for(;n++this[nE][o][nw]&&!s[rRe]&&(o=this[fJ]),this[fJ]===0&&(this[dJ]=this[dJ]-this[q2n],this[dJ]<=0&&(this[dJ]=this[frt])),s[nw]>=this[dJ]&&!s[rRe])return s}return this[dJ]=this[nE][o][nw],this[fJ]=o,this[nE][o]}};j2n.exports=gZt});var ude=I((PWd,K2n)=>{"use strict";p();var{InvalidArgumentError:hrt}=mc(),{kClients:Fq,kRunning:G2n,kClose:Ofs,kDestroy:Bfs,kDispatch:Lfs,kInterceptors:Ffs}=Od(),Ufs=Vue(),Qfs=lde(),qfs=cde(),jfs=Ls(),Hfs=art(),$2n=Symbol("onConnect"),V2n=Symbol("onDisconnect"),W2n=Symbol("onConnectionError"),Gfs=Symbol("maxRedirections"),z2n=Symbol("onDrain"),Y2n=Symbol("factory"),AZt=Symbol("options");function $fs(t,e){return e&&e.connections===1?new qfs(t,e):new Qfs(t,e)}a($fs,"defaultFactory");var yZt=class extends Ufs{static{a(this,"Agent")}constructor({factory:e=$fs,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new hrt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new hrt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new hrt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Ffs]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[Hfs({maxRedirections:r})],this[AZt]={...jfs.deepClone(o),connect:n},this[AZt].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Gfs]=r,this[Y2n]=e,this[Fq]=new Map,this[z2n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[$2n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[V2n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[W2n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[G2n](){let e=0;for(let r of this[Fq].values())e+=r[G2n];return e}[Lfs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new hrt("opts.origin must be a non-empty string or URL.");let o=this[Fq].get(n);return o||(o=this[Y2n](e.origin,this[AZt]).on("drain",this[z2n]).on("connect",this[$2n]).on("disconnect",this[V2n]).on("connectionError",this[W2n]),this[Fq].set(n,o)),o.dispatch(e,r)}async[Ofs](){let e=[];for(let r of this[Fq].values())e.push(r.close());this[Fq].clear(),await Promise.all(e)}async[Bfs](e){let r=[];for(let n of this[Fq].values())r.push(n.destroy(e));this[Fq].clear(),await Promise.all(r)}};K2n.exports=yZt});var bZt=I((MWd,aDn)=>{"use strict";p();var{kProxy:EZt,kClose:rDn,kDestroy:nDn,kDispatch:J2n,kInterceptors:Vfs}=Od(),{URL:pJ}=require("node:url"),Wfs=ude(),iDn=lde(),oDn=Vue(),{InvalidArgumentError:dde,RequestAbortedError:zfs,SecureProxyConnectionError:Yfs}=mc(),Z2n=Mwe(),sDn=cde(),mrt=Symbol("proxy agent"),grt=Symbol("proxy client"),Uq=Symbol("proxy headers"),_Zt=Symbol("request tls settings"),X2n=Symbol("proxy tls settings"),eDn=Symbol("connect endpoint function"),tDn=Symbol("tunnel proxy");function Kfs(t){return t==="https:"?443:80}a(Kfs,"defaultProtocolPort");function Jfs(t,e){return new iDn(t,e)}a(Jfs,"defaultFactory");var Zfs=a(()=>{},"noop");function Xfs(t,e){return e.connections===1?new sDn(t,e):new iDn(t,e)}a(Xfs,"defaultAgentFactory");var CZt=class extends oDn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new dde("Proxy URL is mandatory");this[Uq]=r,o?this.#e=o(e,{connect:n}):this.#e=new sDn(e,{connect:n})}[J2n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new dde("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 pJ(o);c.host=l}return e.headers={...this[Uq],...c},this.#e[J2n](e,r)}async[rDn](){return this.#e.close()}async[nDn](e){return this.#e.destroy(e)}},vZt=class extends oDn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof pJ)&&!e.uri)throw new dde("Proxy uri is mandatory");let{clientFactory:r=Jfs}=e;if(typeof r!="function")throw new dde("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[EZt]={uri:s,protocol:u},this[Vfs]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[_Zt]=e.requestTls,this[X2n]=e.proxyTls,this[Uq]=e.headers||{},this[tDn]=n,e.auth&&e.token)throw new dde("opts.auth cannot be used in combination with opts.token");e.auth?this[Uq]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Uq]["proxy-authorization"]=e.token:d&&f&&(this[Uq]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=Z2n({...e.proxyTls});this[eDn]=Z2n({...e.requestTls});let g=e.factory||Xfs,A=a((y,E)=>{let{protocol:_}=new pJ(y);return!this[tDn]&&_==="http:"&&this[EZt].protocol==="http:"?new CZt(this[EZt].uri,{headers:this[Uq],connect:m,factory:g}):g(y,E)},"factory");this[grt]=r(o,{connect:m}),this[mrt]=new Wfs({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${Kfs(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[grt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[Uq],host:y.host},servername:this[X2n]?.servername||h});if(b!==200&&(v.on("error",Zfs).destroy(),E(new zfs(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[_Zt]?T=this[_Zt].servername:T=y.servername,this[eDn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Yfs(v)):E(v)}},"connect")})}dispatch(e,r){let n=eps(e.headers);if(tps(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new pJ(e.origin);n.host=o}return this[mrt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new pJ(e):e instanceof pJ?e:new pJ(e.uri)}async[rDn](){await this[mrt].close(),await this[grt].close()}async[nDn](){await this[mrt].destroy(),await this[grt].destroy()}};function eps(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new dde("Proxy-Authorization should be sent in ProxyAgent constructor")}a(tps,"throwIfProxyAuthIsSent");aDn.exports=vZt});var pDn=I((LWd,fDn)=>{"use strict";p();var rps=Vue(),{kClose:nps,kDestroy:ips,kClosed:cDn,kDestroyed:lDn,kDispatch:ops,kNoProxyAgent:nRe,kHttpProxyAgent:Qq,kHttpsProxyAgent:hJ}=Od(),uDn=bZt(),sps=ude(),aps={"http:":80,"https:":443},dDn=!1,SZt=class extends rps{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,dDn||(dDn=!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[nRe]=new sps(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Qq]=new uDn({...s,uri:c}):this[Qq]=this[nRe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[hJ]=new uDn({...s,uri:l}):this[hJ]=this[Qq],this.#o()}[ops](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[nps](){await this[nRe].close(),this[Qq][cDn]||await this[Qq].close(),this[hJ][cDn]||await this[hJ].close()}async[ips](e){await this[nRe].destroy(e),this[Qq][lDn]||await this[Qq].destroy(e),this[hJ][lDn]||await this[hJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||aps[r]||0,this.#i(n,o)?r==="https:"?this[hJ]:this[Qq]:this[nRe]}#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 fde=require("node:assert"),{kRetryHandlerDefaultRetry:hDn}=Od(),{RequestRetryError:iRe}=mc(),{isDisturbed:mDn,parseHeaders:cps,parseRangeHeader:gDn,wrapRequestBody:lps}=Ls();function ups(t){let e=Date.now();return new Date(t).getTime()-e}a(ups,"calculateRetryAfterHeader");var TZt=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:lps(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[hDn],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[hDn](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)?ups(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=cps(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new iRe("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 iRe("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=gDn(s["content-range"]);if(!l)return this.abort(new iRe("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new iRe("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return fde(this.start===u,"content-range mismatch"),fde(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=gDn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;fde(u!=null&&Number.isFinite(u),"content-range mismatch"),fde(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 fde(Number.isFinite(this.start)),fde(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 iRe("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||mDn(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||mDn(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")}};ADn.exports=TZt});var EDn=I((HWd,yDn)=>{"use strict";p();var dps=Dwe(),fps=Art(),IZt=class extends dps{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 fps({...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()}};yDn.exports=IZt});var DZt=I((VWd,wDn)=>{"use strict";p();var SDn=require("node:assert"),{Readable:pps}=require("node:stream"),{RequestAbortedError:TDn,NotSupportedError:hps,InvalidArgumentError:mps,AbortError:xZt}=mc(),IDn=Ls(),{ReadableStreamFrom:gps}=Ls(),VS=Symbol("kConsume"),oRe=Symbol("kReading"),qq=Symbol("kBody"),_Dn=Symbol("kAbort"),xDn=Symbol("kContentType"),CDn=Symbol("kContentLength"),Aps=a(()=>{},"noop"),wZt=class extends pps{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[_Dn]=r,this[VS]=null,this[qq]=null,this[xDn]=n,this[CDn]=o,this[oRe]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new TDn),e&&this[_Dn](),super.destroy(e)}_destroy(e,r){this[oRe]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[oRe]=!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[oRe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[VS]&&e!==null?(kZt(this[VS],e),this[oRe]?super.push(e):!0):super.push(e)}async text(){return sRe(this,"text")}async json(){return sRe(this,"json")}async blob(){return sRe(this,"blob")}async bytes(){return sRe(this,"bytes")}async arrayBuffer(){return sRe(this,"arrayBuffer")}async formData(){throw new hps}get bodyUsed(){return IDn.isDisturbed(this)}get body(){return this[qq]||(this[qq]=gps(this),this[VS]&&(this[qq].getReader(),SDn(this[qq].locked))),this[qq]}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 mps("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[CDn]>r&&this.destroy(new xZt);let c=a(()=>{this.destroy(n.reason??new xZt)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new xZt):o(null)}).on("error",Aps).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function yps(t){return t[qq]&&t[qq].locked===!0||t[VS]}a(yps,"isLocked");function Eps(t){return IDn.isDisturbed(t)||yps(t)}a(Eps,"isUnusable");async function sRe(t,e){return SDn(!t[VS]),new Promise((r,n)=>{if(Eps(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[VS]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){PZt(this[VS],o)}).on("close",function(){this[VS].body!==null&&PZt(this[VS],new TDn)}),_ps(t[VS])})})}a(sRe,"consume");function _ps(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(RZt,"chunksDecode");function vDn(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 Cps=require("node:assert"),{ResponseStatusCodeError:RDn}=mc(),{chunksDecode:kDn}=DZt(),vps=128*1024;async function bps({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){Cps(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>vps){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new RDn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{PDn(r)?f=JSON.parse(kDn(c,l)):DDn(r)&&(f=kDn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new RDn(u,n,s,f)))}a(bps,"getResolveErrorBodyCallback");var PDn=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"),DDn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");NDn.exports={getResolveErrorBodyCallback:bps,isContentTypeApplicationJson:PDn,isContentTypeText:DDn}});var BDn=I((ZWd,MZt)=>{"use strict";p();var Sps=require("node:assert"),{Readable:Tps}=DZt(),{InvalidArgumentError:pde,RequestAbortedError:MDn}=mc(),WS=Ls(),{getResolveErrorBodyCallback:Ips}=NZt(),{AsyncResource:xps}=require("node:async_hooks"),yrt=class extends xps{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new pde("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 pde("invalid callback");if(f&&(typeof f!="number"||f<0))throw new pde("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new pde("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new pde("invalid method");if(l&&typeof l!="function")throw new pde("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw WS.isStream(c)&&WS.destroy(c.on("error",WS.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,WS.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new MDn:this.removeAbortListener=WS.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new MDn,this.res?WS.destroy(this.res.on("error",WS.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}Sps(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"?WS.parseRawHeaders(r):WS.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?WS.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new Tps({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(Ips,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){WS.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(()=>{WS.destroy(r,e)})),o&&(this.body=null,WS.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function ODn(t,e){if(e===void 0)return new Promise((r,n)=>{ODn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new yrt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(ODn,"request");MZt.exports=ODn;MZt.exports.RequestHandler=yrt});var aRe=I((tzd,UDn)=>{p();var{addAbortListener:wps}=Ls(),{RequestAbortedError:Rps}=mc(),hde=Symbol("kListener"),FO=Symbol("kSignal");function LDn(t){t.abort?t.abort(t[FO]?.reason):t.reason=t[FO]?.reason??new Rps,FDn(t)}a(LDn,"abort");function kps(t,e){if(t.reason=null,t[FO]=null,t[hde]=null,!!e){if(e.aborted){LDn(t);return}t[FO]=e,t[hde]=()=>{LDn(t)},wps(t[FO],t[hde])}}a(kps,"addSignal");function FDn(t){t[FO]&&("removeEventListener"in t[FO]?t[FO].removeEventListener("abort",t[hde]):t[FO].removeListener("abort",t[hde]),t[FO]=null,t[hde]=null)}a(FDn,"removeSignal");UDn.exports={addSignal:kps,removeSignal:FDn}});var HDn=I((izd,jDn)=>{"use strict";p();var Pps=require("node:assert"),{finished:Dps,PassThrough:Nps}=require("node:stream"),{InvalidArgumentError:mde,InvalidReturnValueError:Mps}=mc(),jP=Ls(),{getResolveErrorBodyCallback:Ops}=NZt(),{AsyncResource:Bps}=require("node:async_hooks"),{addSignal:Lps,removeSignal:QDn}=aRe(),OZt=class extends Bps{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new mde("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 mde("invalid callback");if(typeof r!="function")throw new mde("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new mde("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new mde("invalid method");if(u&&typeof u!="function")throw new mde("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw jP.isStream(l)&&jP.destroy(l.on("error",jP.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,jP.isStream(l)&&l.on("error",h=>{this.onError(h)}),Lps(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}Pps(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"?jP.parseRawHeaders(r):jP.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"?jP.parseHeaders(r):f)["content-type"];h=new Nps,this.callback=null,this.runInAsyncScope(Ops,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 Mps("expected Writable");Dps(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&jP.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;QDn(this),r&&(this.trailers=jP.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;QDn(this),this.factory=null,r?(this.res=null,jP.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,jP.destroy(s,e))}};function qDn(t,e,r){if(r===void 0)return new Promise((n,o)=>{qDn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new OZt(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(qDn,"stream");jDn.exports=qDn});var WDn=I((azd,VDn)=>{"use strict";p();var{Readable:$Dn,Duplex:Fps,PassThrough:Ups}=require("node:stream"),{InvalidArgumentError:cRe,InvalidReturnValueError:Qps,RequestAbortedError:BZt}=mc(),iw=Ls(),{AsyncResource:qps}=require("node:async_hooks"),{addSignal:jps,removeSignal:Hps}=aRe(),GDn=require("node:assert"),gde=Symbol("resume"),LZt=class extends $Dn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[gde]=null}_read(){let{[gde]:e}=this;e&&(this[gde]=null,e())}_destroy(e,r){this._read(),r(e)}},FZt=class extends $Dn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[gde]=e}_read(){this[gde]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new BZt),r(e)}},UZt=class extends qps{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new cRe("invalid opts");if(typeof r!="function")throw new cRe("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 cRe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new cRe("invalid method");if(c&&typeof c!="function")throw new cRe("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 LZt().on("error",iw.nop),this.ret=new Fps({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[gde]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new BZt),A&&u&&A(),iw.destroy(f,u),iw.destroy(h,u),iw.destroy(m,u),Hps(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,jps(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}GDn(!o,"pipeline cannot be retried"),GDn(!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"?iw.parseRawHeaders(r):iw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new FZt(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?iw.parseRawHeaders(r):iw.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",iw.nop),u}if(!l||typeof l.on!="function")throw new Qps("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;iw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||iw.destroy(u,new BZt)}),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,iw.destroy(r,e)}};function Gps(t,e){try{let r=new UZt(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new Ups().destroy(r)}}a(Gps,"pipeline");VDn.exports=Gps});var XDn=I((uzd,ZDn)=>{"use strict";p();var{InvalidArgumentError:QZt,SocketError:$ps}=mc(),{AsyncResource:Vps}=require("node:async_hooks"),zDn=Ls(),{addSignal:Wps,removeSignal:YDn}=aRe(),KDn=require("node:assert"),qZt=class extends Vps{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new QZt("invalid opts");if(typeof r!="function")throw new QZt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new QZt("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,Wps(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}KDn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new $ps("bad upgrade",null)}onUpgrade(e,r,n){KDn(e===101);let{callback:o,opaque:s,context:c}=this;YDn(this),this.callback=null;let l=this.responseHeaders==="raw"?zDn.parseRawHeaders(r):zDn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;YDn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function JDn(t,e){if(e===void 0)return new Promise((r,n)=>{JDn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new qZt(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(JDn,"upgrade");ZDn.exports=JDn});var iNn=I((pzd,nNn)=>{"use strict";p();var zps=require("node:assert"),{AsyncResource:Yps}=require("node:async_hooks"),{InvalidArgumentError:jZt,SocketError:Kps}=mc(),eNn=Ls(),{addSignal:Jps,removeSignal:tNn}=aRe(),HZt=class extends Yps{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new jZt("invalid opts");if(typeof r!="function")throw new jZt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new jZt("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,Jps(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}zps(this.callback),this.abort=e,this.context=r}onHeaders(){throw new Kps("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;tNn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?eNn.parseRawHeaders(r):eNn.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;tNn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function rNn(t,e){if(e===void 0)return new Promise((r,n)=>{rNn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new HZt(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(rNn,"connect");nNn.exports=rNn});var oNn=I((gzd,Ade)=>{"use strict";p();Ade.exports.request=BDn();Ade.exports.stream=HDn();Ade.exports.pipeline=WDn();Ade.exports.upgrade=XDn();Ade.exports.connect=iNn()});var $Zt=I((yzd,aNn)=>{"use strict";p();var{UndiciError:Zps}=mc(),sNn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),GZt=class t extends Zps{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[sNn]===!0}[sNn]=!0};aNn.exports={MockNotMatchedError:GZt}});var yde=I((Czd,cNn)=>{"use strict";p();cNn.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 lRe=I((bzd,ENn)=>{"use strict";p();var{MockNotMatchedError:mJ}=$Zt(),{kDispatches:Ert,kMockAgent:Xps,kOriginalDispatch:ehs,kOrigin:ths,kGetNetConnect:rhs}=yde(),{buildURL:nhs}=Ls(),{STATUS_CODES:ihs}=require("node:http"),{types:{isPromise:ohs}}=require("node:util");function tF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(tF,"matchValue");function uNn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(uNn,"lowerCaseEntries");function dNn(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=dNn(e,r);if(!tF(n,o))return!1}return!0}a(fNn,"matchHeaders");function lNn(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(lNn,"safeUrl");function shs(t,{path:e,method:r,body:n,headers:o}){let s=tF(t.path,e),c=tF(t.method,r),l=typeof t.body<"u"?tF(t.body,n):!0,u=fNn(t,o);return s&&c&&l&&u}a(shs,"matchKey");function pNn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(pNn,"getResponseData");function hNn(t,e){let r=e.query?nhs(e.path,e.query):e.path,n=typeof r=="string"?lNn(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>tF(lNn(s),n));if(o.length===0)throw new mJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>tF(s,e.method)),o.length===0)throw new mJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?tF(s,e.body):!0),o.length===0)throw new mJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>fNn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new mJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(hNn,"getMockDispatch");function ahs(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(ahs,"addMockDispatch");function VZt(t,e){let r=t.findIndex(n=>n.consumed?shs(n,e):!1);r!==-1&&t.splice(r,1)}a(VZt,"deleteMockDispatch");function mNn(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(mNn,"buildKey");function WZt(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Ert])},d):g(this[Ert]);function g(y,E=s){let _=Array.isArray(t.headers)?zZt(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(ohs(v)){v.then(R=>g(y,R));return}let b=pNn(v),T=WZt(c),w=WZt(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,gNn(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),VZt(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(ANn,"mockDispatch");function lhs(){let t=this[Xps],e=this[ths],r=this[ehs];return a(function(o,s){if(t.isMockActive)try{ANn.call(this,o,s)}catch(c){if(c instanceof mJ){let l=t[rhs]();if(l===!1)throw new mJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(yNn(l,e))r.call(this,o,s);else throw new mJ(`${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(lhs,"buildMockDispatch");function yNn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>tF(n,r.host)))}a(yNn,"checkNetConnect");function uhs(t){if(t){let{agent:e,...r}=t;return r}}a(uhs,"buildMockOptions");ENn.exports={getResponseData:pNn,getMockDispatch:hNn,addMockDispatch:ahs,deleteMockDispatch:VZt,buildKey:mNn,generateKeyValues:WZt,matchValue:tF,getResponse:chs,getStatusText:gNn,mockDispatch:ANn,buildMockDispatch:lhs,checkNetConnect:yNn,buildMockOptions:uhs,getHeaderByName:dNn,buildHeadersFromArray:zZt}});var tXt=I((Izd,eXt)=>{"use strict";p();var{getResponseData:dhs,buildKey:fhs,addMockDispatch:YZt}=lRe(),{kDispatches:_rt,kDispatchKey:Crt,kDefaultHeaders:KZt,kDefaultTrailers:JZt,kContentLength:ZZt,kMockDispatch:vrt}=yde(),{InvalidArgumentError:UO}=mc(),{buildURL:phs}=Ls(),Ede=class{static{a(this,"MockScope")}constructor(e){this[vrt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new UO("waitInMs must be a valid integer > 0");return this[vrt].delay=e,this}persist(){return this[vrt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new UO("repeatTimes must be a valid integer > 0");return this[vrt].times=e,this}},XZt=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new UO("opts must be an object");if(typeof e.path>"u")throw new UO("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=phs(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[Crt]=fhs(e),this[_rt]=r,this[KZt]={},this[JZt]={},this[ZZt]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=dhs(r),s=this[ZZt]?{"content-length":o.length}:{},c={...this[KZt],...s,...n.headers},l={...this[JZt],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new UO("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new UO("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 UO("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=YZt(this[_rt],this[Crt],s);return new Ede(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=YZt(this[_rt],this[Crt],n);return new Ede(o)}replyWithError(e){if(typeof e>"u")throw new UO("error must be defined");let r=YZt(this[_rt],this[Crt],{error:e});return new Ede(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new UO("headers must be defined");return this[KZt]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new UO("trailers must be defined");return this[JZt]=e,this}replyContentLength(){return this[ZZt]=!0,this}};eXt.exports.MockInterceptor=XZt;eXt.exports.MockScope=Ede});var iXt=I((Rzd,INn)=>{"use strict";p();var{promisify:hhs}=require("node:util"),mhs=cde(),{buildMockDispatch:ghs}=lRe(),{kDispatches:_Nn,kMockAgent:CNn,kClose:vNn,kOriginalClose:bNn,kOrigin:SNn,kOriginalDispatch:Ahs,kConnected:rXt}=yde(),{MockInterceptor:yhs}=tXt(),TNn=Od(),{InvalidArgumentError:Ehs}=mc(),nXt=class extends mhs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Ehs("Argument opts.agent must implement Agent");this[CNn]=r.agent,this[SNn]=e,this[_Nn]=[],this[rXt]=1,this[Ahs]=this.dispatch,this[bNn]=this.close.bind(this),this.dispatch=ghs.call(this),this.close=this[vNn]}get[TNn.kConnected](){return this[rXt]}intercept(e){return new yhs(e,this[_Nn])}async[vNn](){await hhs(this[bNn])(),this[rXt]=0,this[CNn][TNn.kClients].delete(this[SNn])}};INn.exports=nXt});var aXt=I((Dzd,NNn)=>{"use strict";p();var{promisify:_hs}=require("node:util"),Chs=lde(),{buildMockDispatch:vhs}=lRe(),{kDispatches:xNn,kMockAgent:wNn,kClose:RNn,kOriginalClose:kNn,kOrigin:PNn,kOriginalDispatch:bhs,kConnected:oXt}=yde(),{MockInterceptor:Shs}=tXt(),DNn=Od(),{InvalidArgumentError:Ths}=mc(),sXt=class extends Chs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Ths("Argument opts.agent must implement Agent");this[wNn]=r.agent,this[PNn]=e,this[xNn]=[],this[oXt]=1,this[bhs]=this.dispatch,this[kNn]=this.close.bind(this),this.dispatch=vhs.call(this),this.close=this[RNn]}get[DNn.kConnected](){return this[oXt]}intercept(e){return new Shs(e,this[xNn])}async[RNn](){await _hs(this[kNn])(),this[oXt]=0,this[wNn][DNn.kClients].delete(this[PNn])}};NNn.exports=sXt});var ONn=I((Bzd,MNn)=>{"use strict";p();var Ihs={pronoun:"it",is:"is",was:"was",this:"this"},xhs={pronoun:"they",is:"are",was:"were",this:"these"};MNn.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Ihs:xhs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var LNn=I((Qzd,BNn)=>{"use strict";p();var{Transform:whs}=require("node:stream"),{Console:Rhs}=require("node:console"),khs=process.versions.icu?"\u2705":"Y ",Phs=process.versions.icu?"\u274C":"N ";BNn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new whs({transform(r,n,o){o(null,r)}}),this.logger=new Rhs({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?khs:Phs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var qNn=I((Hzd,QNn)=>{"use strict";p();var{kClients:gJ}=Od(),Dhs=ude(),{kAgent:cXt,kMockAgentSet:brt,kMockAgentGet:FNn,kDispatches:lXt,kIsMockActive:Srt,kNetConnect:AJ,kGetNetConnect:Nhs,kOptions:Trt,kFactory:Irt}=yde(),Mhs=iXt(),Ohs=aXt(),{matchValue:Bhs,buildMockOptions:Lhs}=lRe(),{InvalidArgumentError:UNn,UndiciError:Fhs}=mc(),Uhs=Dwe(),Qhs=ONn(),qhs=LNn(),uXt=class extends Uhs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[AJ]=!0,this[Srt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new UNn("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new Dhs(e);this[cXt]=r,this[gJ]=r[gJ],this[Trt]=Lhs(e)}get(e){let r=this[FNn](e);return r||(r=this[Irt](e),this[brt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[cXt].dispatch(e,r)}async close(){await this[cXt].close(),this[gJ].clear()}deactivate(){this[Srt]=!1}activate(){this[Srt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[AJ])?this[AJ].push(e):this[AJ]=[e];else if(typeof e>"u")this[AJ]=!0;else throw new UNn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[AJ]=!1}get isMockActive(){return this[Srt]}[brt](e,r){this[gJ].set(e,r)}[Irt](e){let r=Object.assign({agent:this},this[Trt]);return this[Trt]&&this[Trt].connections===1?new Mhs(e,r):new Ohs(e,r)}[FNn](e){let r=this[gJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Irt]("http://localhost:9999");return this[brt](e,n),n}for(let[n,o]of Array.from(this[gJ]))if(o&&typeof n!="string"&&Bhs(n,e)){let s=this[Irt](e);return this[brt](e,s),s[lXt]=o[lXt],s}}[Nhs](){return this[AJ]}pendingInterceptors(){let e=this[gJ];return Array.from(e.entries()).flatMap(([r,n])=>n[lXt].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new qhs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Qhs("interceptor","interceptors").pluralize(r.length);throw new Fhs(` +`,"latin1"),r!==null&&o!==r){if(n[DKt])throw new qK;process.emitWarning(new qK)}e[tp].timeout&&e[tp].timeoutType===Mue&&e[tp].timeout.refresh&&e[tp].timeout.refresh(),n[pq]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[hq]=!1,e&&(ji(n[rE]<=1,"pipeline should only contain this request"),o(e))}};oPn.exports=vss});var hPn=I((CQd,pPn)=>{"use strict";p();var Yx=require("node:assert"),{pipeline:xss}=require("node:stream"),aa=Ms(),{RequestContentLengthMismatchError:BKt,RequestAbortedError:aPn,SocketError:gwe,InformationalError:LKt}=pc(),{kUrl:dtt,kReset:ptt,kClient:Oue,kRunning:htt,kPending:wss,kQueue:mq,kPendingIdx:FKt,kRunningIdx:Pk,kError:Dk,kSocket:pg,kStrictContentLength:Rss,kOnError:UKt,kMaxConcurrentStreams:fPn,kHTTP2Session:kk,kResume:gq,kSize:Pss,kHTTPContext:kss}=Nd(),F3=Symbol("open streams"),cPn,lPn=!1,ftt;try{ftt=require("node:http2")}catch{ftt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:Dss,HTTP2_HEADER_METHOD:Nss,HTTP2_HEADER_PATH:Mss,HTTP2_HEADER_SCHEME:Oss,HTTP2_HEADER_CONTENT_LENGTH:Bss,HTTP2_HEADER_EXPECT:Lss,HTTP2_HEADER_STATUS:Fss}}=ftt;function Uss(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(Uss,"parseH2Headers");async function Qss(t,e){t[pg]=e,lPn||(lPn=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=ftt.connect(t[dtt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[fPn]});r[F3]=0,r[Oue]=t,r[pg]=e,aa.addListener(r,"error",jss),aa.addListener(r,"frameError",Hss),aa.addListener(r,"end",Gss),aa.addListener(r,"goaway",$ss),aa.addListener(r,"close",function(){let{[Oue]:o}=this,{[pg]:s}=o,c=this[pg][Dk]||this[Dk]||new gwe("closed",aa.getSocketInfo(s));if(o[kk]=null,o.destroyed){Yx(o[wss]===0);let l=o[mq].splice(o[Pk]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return Wss(t,...o)},resume(){qss(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(Qss,"connectH2");function qss(t){let e=t[pg];e?.destroyed===!1&&(t[Pss]===0&&t[fPn]===0?(e.unref(),t[kk].unref()):(e.ref(),t[kk].ref()))}a(qss,"resumeH2");function jss(t){Yx(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[pg][Dk]=t,this[Oue][UKt](t)}a(jss,"onHttp2SessionError");function Hss(t,e,r){if(r===0){let n=new LKt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[pg][Dk]=n,this[Oue][UKt](n)}}a(Hss,"onHttp2FrameError");function Gss(){let t=new gwe("other side closed",aa.getSocketInfo(this[pg]));this.destroy(t),aa.destroy(this[pg],t)}a(Gss,"onHttp2SessionEnd");function $ss(t){let e=this[Dk]||new gwe(`HTTP/2: "GOAWAY" frame received with code ${t}`,aa.getSocketInfo(this)),r=this[Oue];if(r[pg]=null,r[kss]=null,this[kk]!=null&&(this[kk].destroy(e),this[kk]=null),aa.destroy(this[pg],e),r[Pk]{e.aborted||e.completed||(T=T||new aPn,aa.errorRequest(t,e,T),m!=null&&aa.destroy(m,T),aa.destroy(f,T),t[mq][t[Pk]++]=null,t[gq]())},"abort");try{e.onConnect(y)}catch(T){aa.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[F3],t[mq][t[Pk]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[F3],t[mq][t[Pk]++]=null}),m.once("close",()=>{r[F3]-=1,r[F3]===0&&r.unref()}),!0;h[Mss]=o,h[Oss]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=aa.bodyLength(f);if(aa.isFormDataLike(f)){cPn??=kue().extractBody;let[T,w]=cPn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),Vss(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Rss])return aa.errorRequest(t,e,new BKt),!1;process.emitWarning(new BKt)}_!=null&&(Yx(f,"no body must not have content length"),h[Bss]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[Lss]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[F3],m.once("response",T=>{let{[Fss]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new aPn;aa.errorRequest(t,e,x),aa.destroy(m,x);return}e.onHeaders(Number(w),Uss(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[F3]===0&&r.unref(),y(new LKt("HTTP/2: stream half-closed (remote)")),t[mq][t[Pk]++]=null,t[FKt]=t[Pk],t[gq]()}),m.once("close",()=>{r[F3]-=1,r[F3]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new LKt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?uPn(y,m,null,t,e,t[pg],_,E):aa.isBuffer(f)?uPn(y,m,f,t,e,t[pg],_,E):aa.isBlobLike(f)?typeof f.stream=="function"?dPn(y,m,f.stream(),t,e,t[pg],_,E):Yss(y,m,f,t,e,t[pg],_,E):aa.isStream(f)?zss(y,t[pg],E,m,f,t,e,_):aa.isIterable(f)?dPn(y,m,f,t,e,t[pg],_,E):Yx(!1)}a(b,"writeBodyH2")}a(Wss,"writeH2");function uPn(t,e,r,n,o,s,c,l){try{r!=null&&aa.isBuffer(r)&&(Yx(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[ptt]=!0),o.onRequestSent(),n[gq]()}catch(u){t(u)}}a(uPn,"writeBuffer");function zss(t,e,r,n,o,s,c,l){Yx(l!==0||s[htt]===0,"stream body cannot be pipelined");let u=xss(o,n,f=>{f?(aa.destroy(u,f),t(f)):(aa.removeAllListeners(u),c.onRequestSent(),r||(e[ptt]=!0),s[gq]())});aa.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(zss,"writeStream");async function Yss(t,e,r,n,o,s,c,l){Yx(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new BKt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[ptt]=!0),n[gq]()}catch(u){t(u)}}a(Yss,"writeBlob");async function dPn(t,e,r,n,o,s,c,l){Yx(c!==0||n[htt]===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)=>{Yx(u===null),s[Dk]?m(s[Dk]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[Dk])throw s[Dk];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[ptt]=!0),n[gq]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(dPn,"writeIterable");pPn.exports=Qss});var gtt=I((TQd,APn)=>{"use strict";p();var SO=Ms(),{kBodyUsed:Awe}=Nd(),qKt=require("node:assert"),{InvalidArgumentError:Kss}=pc(),Jss=require("node:events"),Zss=[300,301,302,303,307,308],mPn=Symbol("body"),mtt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[mPn]=e,this[Awe]=!1}async*[Symbol.asyncIterator](){qKt(!this[Awe],"disturbed"),this[Awe]=!0,yield*this[mPn]}},QKt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Kss("maxRedirections must be a positive number");SO.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,SO.isStream(this.opts.body)?(SO.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){qKt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Awe]=!1,Jss.prototype.on.call(this.opts.body,"data",function(){this[Awe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new mtt(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&SO.isIterable(this.opts.body)&&(this.opts.body=new mtt(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||SO.isDisturbed(this.opts.body)?null:Xss(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}=SO.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=eas(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 Xss(t,e){if(Zss.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var tas=gtt();function ras({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new tas(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(ras,"createRedirectInterceptor");yPn.exports=ras});var Fue=I((kQd,wPn)=>{"use strict";p();var U3=require("node:assert"),SPn=require("node:net"),nas=require("node:http"),jK=Ms(),{channels:Bue}=yue(),ias=Nwn(),oas=Cue(),{InvalidArgumentError:Yp,InformationalError:sas,ClientDestroyedError:aas}=pc(),cas=iwe(),{kUrl:TO,kServerName:Aq,kClient:las,kBusy:jKt,kConnect:uas,kResuming:HK,kRunning:Cwe,kPending:bwe,kSize:vwe,kQueue:Nk,kConnected:das,kConnecting:Lue,kNeedDrain:Eq,kKeepAliveDefaultTimeout:EPn,kHostHeader:fas,kPendingIdx:Mk,kRunningIdx:Q3,kError:pas,kPipelining:ytt,kKeepAliveTimeoutValue:has,kMaxHeadersSize:mas,kKeepAliveMaxTimeout:gas,kKeepAliveTimeoutThreshold:Aas,kHeadersTimeout:yas,kBodyTimeout:Eas,kStrictContentLength:_as,kConnector:ywe,kMaxRedirections:vas,kMaxRequests:HKt,kCounter:Cas,kClose:bas,kDestroy:Sas,kDispatch:Tas,kInterceptors:_Pn,kLocalAddress:Ewe,kMaxResponseSize:Ias,kOnError:xas,kHTTPContext:Kp,kMaxConcurrentStreams:was,kResume:_we}=Nd(),Ras=sPn(),Pas=hPn(),vPn=!1,yq=Symbol("kClosedResolve"),CPn=a(()=>{},"noop");function TPn(t){return t[ytt]??t[Kp]?.defaultPipelining??1}a(TPn,"getPipelining");var GKt=class extends oas{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 Yp("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new Yp("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new Yp("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new Yp("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new Yp("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new Yp("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new Yp("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new Yp("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new Yp("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new Yp("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new Yp("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new Yp("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new Yp("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new Yp("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new Yp("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new Yp("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||SPn.isIP(x)===0))throw new Yp("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new Yp("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new Yp("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new Yp("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new Yp("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=cas({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[_Pn]=r.Client,vPn||(vPn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[_Pn]=[kas({maxRedirections:T})],this[TO]=jK.parseOrigin(e),this[ywe]=w,this[ytt]=E??1,this[mas]=n||nas.maxHeaderSize,this[EPn]=h??4e3,this[gas]=g??6e5,this[Aas]=A??2e3,this[has]=this[EPn],this[Aq]=null,this[Ewe]=x??null,this[HK]=0,this[Eq]=0,this[fas]=`host: ${this[TO].hostname}${this[TO].port?`:${this[TO].port}`:""}\r +`,this[Eas]=u??3e5,this[yas]=o??3e5,this[_as]=v??!0,this[vas]=T,this[HKt]=R,this[yq]=null,this[Ias]=P>-1?P:-1,this[was]=L??100,this[Kp]=null,this[Nk]=[],this[Q3]=0,this[Mk]=0,this[_we]=j=>$Kt(this,j),this[xas]=j=>IPn(this,j)}get pipelining(){return this[ytt]}set pipelining(e){this[ytt]=e,this[_we](!0)}get[bwe](){return this[Nk].length-this[Mk]}get[Cwe](){return this[Mk]-this[Q3]}get[vwe](){return this[Nk].length-this[Q3]}get[das](){return!!this[Kp]&&!this[Lue]&&!this[Kp].destroyed}get[jKt](){return!!(this[Kp]?.busy(null)||this[vwe]>=(TPn(this)||1)||this[bwe]>0)}[uas](e){xPn(this),this.once("connect",e)}[Tas](e,r){let n=e.origin||this[TO].origin,o=new ias(n,e,r);return this[Nk].push(o),this[HK]||(jK.bodyLength(o.body)==null&&jK.isIterable(o.body)?(this[HK]=1,queueMicrotask(()=>$Kt(this))):this[_we](!0)),this[HK]&&this[Eq]!==2&&this[jKt]&&(this[Eq]=2),this[Eq]<2}async[bas](){return new Promise(e=>{this[vwe]?this[yq]=e:e(null)})}async[Sas](e){return new Promise(r=>{let n=this[Nk].splice(this[Mk]);for(let s=0;s{this[yq]&&(this[yq](),this[yq]=null),r(null)},"callback");this[Kp]?(this[Kp].destroy(e,o),this[Kp]=null):queueMicrotask(o),this[_we]()})}},kas=Att();function IPn(t,e){if(t[Cwe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){U3(t[Mk]===t[Q3]);let r=t[Nk].splice(t[Q3]);for(let n=0;n{t[ywe]({host:e,hostname:r,protocol:n,port:o,servername:t[Aq],localAddress:t[Ewe]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){jK.destroy(s.on("error",CPn),new aas);return}U3(s);try{t[Kp]=s.alpnProtocol==="h2"?await Pas(t,s):await Ras(t,s)}catch(c){throw s.destroy().on("error",CPn),c}t[Lue]=!1,s[Cas]=0,s[HKt]=t[HKt],s[las]=t,s[pas]=null,Bue.connected.hasSubscribers&&Bue.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Kp]?.version,servername:t[Aq],localAddress:t[Ewe]},connector:t[ywe],socket:s}),t.emit("connect",t[TO],[t])}catch(s){if(t.destroyed)return;if(t[Lue]=!1,Bue.connectError.hasSubscribers&&Bue.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Kp]?.version,servername:t[Aq],localAddress:t[Ewe]},connector:t[ywe],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(U3(t[Cwe]===0);t[bwe]>0&&t[Nk][t[Mk]].servername===t[Aq];){let c=t[Nk][t[Mk]++];jK.errorRequest(t,c,s)}else IPn(t,s);t.emit("connectionError",t[TO],[t],s)}t[_we]()}a(xPn,"connect");function bPn(t){t[Eq]=0,t.emit("drain",t[TO],[t])}a(bPn,"emitDrain");function $Kt(t,e){t[HK]!==2&&(t[HK]=2,Das(t,e),t[HK]=0,t[Q3]>256&&(t[Nk].splice(0,t[Q3]),t[Mk]-=t[Q3],t[Q3]=0))}a($Kt,"resume");function Das(t,e){for(;;){if(t.destroyed){U3(t[bwe]===0);return}if(t[yq]&&!t[vwe]){t[yq](),t[yq]=null;return}if(t[Kp]&&t[Kp].resume(),t[jKt])t[Eq]=2;else if(t[Eq]===2){e?(t[Eq]=1,queueMicrotask(()=>bPn(t))):bPn(t);continue}if(t[bwe]===0||t[Cwe]>=(TPn(t)||1))return;let r=t[Nk][t[Mk]];if(t[TO].protocol==="https:"&&t[Aq]!==r.servername){if(t[Cwe]>0)return;t[Aq]=r.servername,t[Kp]?.destroy(new sas("servername changed"),()=>{t[Kp]=null,$Kt(t)})}if(t[Lue])return;if(!t[Kp]){xPn(t);return}if(t[Kp].destroyed||t[Kp].busy(r))return;!r.aborted&&t[Kp].write(r)?t[Mk]++:t[Nk].splice(t[Mk],1)}}a(Das,"_resume");wPn.exports=GKt});var VKt=I((OQd,RPn)=>{"use strict";p();var Ett=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)}};RPn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Ett}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Ett),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var kPn=I((FQd,PPn)=>{p();var{kFree:Nas,kConnected:Mas,kPending:Oas,kQueued:Bas,kRunning:Las,kSize:Fas}=Nd(),GK=Symbol("pool"),WKt=class{static{a(this,"PoolStats")}constructor(e){this[GK]=e}get connected(){return this[GK][Mas]}get free(){return this[GK][Nas]}get pending(){return this[GK][Oas]}get queued(){return this[GK][Bas]}get running(){return this[GK][Las]}get size(){return this[GK][Fas]}};PPn.exports=WKt});var XKt=I((qQd,qPn)=>{"use strict";p();var Uas=Cue(),Qas=VKt(),{kConnected:zKt,kSize:DPn,kRunning:NPn,kPending:MPn,kQueued:Swe,kBusy:qas,kFree:jas,kUrl:Has,kClose:Gas,kDestroy:$as,kDispatch:Vas}=Nd(),Was=kPn(),QC=Symbol("clients"),U_=Symbol("needDrain"),Twe=Symbol("queue"),YKt=Symbol("closed resolve"),KKt=Symbol("onDrain"),OPn=Symbol("onConnect"),BPn=Symbol("onDisconnect"),LPn=Symbol("onConnectionError"),JKt=Symbol("get dispatcher"),UPn=Symbol("add client"),QPn=Symbol("remove client"),FPn=Symbol("stats"),ZKt=class extends Uas{static{a(this,"PoolBase")}constructor(){super(),this[Twe]=new Qas,this[QC]=[],this[Swe]=0;let e=this;this[KKt]=a(function(n,o){let s=e[Twe],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[Swe]--,c=!this.dispatch(l.opts,l.handler)}this[U_]=c,!this[U_]&&e[U_]&&(e[U_]=!1,e.emit("drain",n,[e,...o])),e[YKt]&&s.isEmpty()&&Promise.all(e[QC].map(l=>l.close())).then(e[YKt])},"onDrain"),this[OPn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[BPn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[LPn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[FPn]=new Was(this)}get[qas](){return this[U_]}get[zKt](){return this[QC].filter(e=>e[zKt]).length}get[jas](){return this[QC].filter(e=>e[zKt]&&!e[U_]).length}get[MPn](){let e=this[Swe];for(let{[MPn]:r}of this[QC])e+=r;return e}get[NPn](){let e=0;for(let{[NPn]:r}of this[QC])e+=r;return e}get[DPn](){let e=this[Swe];for(let{[DPn]:r}of this[QC])e+=r;return e}get stats(){return this[FPn]}async[Gas](){this[Twe].isEmpty()?await Promise.all(this[QC].map(e=>e.close())):await new Promise(e=>{this[YKt]=e})}async[$as](e){for(;;){let r=this[Twe].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[QC].map(r=>r.destroy(e)))}[Vas](e,r){let n=this[JKt]();return n?n.dispatch(e,r)||(n[U_]=!0,this[U_]=!this[JKt]()):(this[U_]=!0,this[Twe].push({opts:e,handler:r}),this[Swe]++),!this[U_]}[UPn](e){return e.on("drain",this[KKt]).on("connect",this[OPn]).on("disconnect",this[BPn]).on("connectionError",this[LPn]),this[QC].push(e),this[U_]&&queueMicrotask(()=>{this[U_]&&this[KKt](e[Has],[this,e])}),this}[QPn](e){e.close(()=>{let r=this[QC].indexOf(e);r!==-1&&this[QC].splice(r,1)}),this[U_]=this[QC].some(r=>!r[U_]&&r.closed!==!0&&r.destroyed!==!0)}};qPn.exports={PoolBase:ZKt,kClients:QC,kNeedDrain:U_,kAddClient:UPn,kRemoveClient:QPn,kGetDispatcher:JKt}});var Uue=I((GQd,$Pn)=>{"use strict";p();var{PoolBase:zas,kClients:_tt,kNeedDrain:Yas,kAddClient:Kas,kGetDispatcher:Jas}=XKt(),Zas=Fue(),{InvalidArgumentError:eJt}=pc(),jPn=Ms(),{kUrl:HPn,kInterceptors:Xas}=Nd(),ecs=iwe(),tJt=Symbol("options"),rJt=Symbol("connections"),GPn=Symbol("factory");function tcs(t,e){return new Zas(t,e)}a(tcs,"defaultFactory");var nJt=class extends zas{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=tcs,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 eJt("invalid connections");if(typeof n!="function")throw new eJt("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new eJt("connect must be a function or an object");typeof o!="function"&&(o=ecs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[Xas]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[rJt]=r||null,this[HPn]=jPn.parseOrigin(e),this[tJt]={...jPn.deepClone(m),connect:o,allowH2:h},this[tJt].interceptors=m.interceptors?{...m.interceptors}:void 0,this[GPn]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[_tt].indexOf(E);_!==-1&&this[_tt].splice(_,1)}})}[Jas](){for(let e of this[_tt])if(!e[Yas])return e;if(!this[rJt]||this[_tt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:rcs,InvalidArgumentError:ncs}=pc(),{PoolBase:ics,kClients:nE,kNeedDrain:Iwe,kAddClient:ocs,kRemoveClient:scs,kGetDispatcher:acs}=XKt(),ccs=Uue(),{kUrl:iJt,kInterceptors:lcs}=Nd(),{parseOrigin:VPn}=Ms(),WPn=Symbol("factory"),vtt=Symbol("options"),zPn=Symbol("kGreatestCommonDivisor"),$K=Symbol("kCurrentWeight"),VK=Symbol("kIndex"),Kx=Symbol("kWeight"),Ctt=Symbol("kMaxWeightPerServer"),btt=Symbol("kErrorPenalty");function ucs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(ucs,"getGreatestCommonDivisor");function dcs(t,e){return new ccs(t,e)}a(dcs,"defaultFactory");var oJt=class extends ics{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=dcs,...n}={}){if(super(),this[vtt]=n,this[VK]=-1,this[$K]=0,this[Ctt]=this[vtt].maxWeightPerServer||100,this[btt]=this[vtt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new ncs("factory must be a function.");this[lcs]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[WPn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=VPn(e).origin;if(this[nE].find(o=>o[iJt].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[WPn](r,Object.assign({},this[vtt]));this[ocs](n),n.on("connect",()=>{n[Kx]=Math.min(this[Ctt],n[Kx]+this[btt])}),n.on("connectionError",()=>{n[Kx]=Math.max(1,n[Kx]-this[btt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Kx]=Math.max(1,n[Kx]-this[btt]),this._updateBalancedPoolStats())});for(let o of this[nE])o[Kx]=this[Ctt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[iJt].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[scs](n),this}get upstreams(){return this[nE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[iJt].origin)}[acs](){if(this[nE].length===0)throw new rcs;if(!this[nE].find(s=>!s[Iwe]&&s.closed!==!0&&s.destroyed!==!0)||this[nE].map(s=>s[Iwe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[nE].findIndex(s=>!s[Iwe]);for(;n++this[nE][o][Kx]&&!s[Iwe]&&(o=this[VK]),this[VK]===0&&(this[$K]=this[$K]-this[zPn],this[$K]<=0&&(this[$K]=this[Ctt])),s[Kx]>=this[$K]&&!s[Iwe])return s}return this[$K]=this[nE][o][Kx],this[VK]=o,this[nE][o]}};YPn.exports=oJt});var Que=I((KQd,nkn)=>{"use strict";p();var{InvalidArgumentError:Stt}=pc(),{kClients:_q,kRunning:JPn,kClose:fcs,kDestroy:pcs,kDispatch:hcs,kInterceptors:mcs}=Nd(),gcs=Cue(),Acs=Uue(),ycs=Fue(),Ecs=Ms(),_cs=Att(),ZPn=Symbol("onConnect"),XPn=Symbol("onDisconnect"),ekn=Symbol("onConnectionError"),vcs=Symbol("maxRedirections"),tkn=Symbol("onDrain"),rkn=Symbol("factory"),sJt=Symbol("options");function Ccs(t,e){return e&&e.connections===1?new ycs(t,e):new Acs(t,e)}a(Ccs,"defaultFactory");var aJt=class extends gcs{static{a(this,"Agent")}constructor({factory:e=Ccs,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new Stt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Stt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new Stt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[mcs]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[_cs({maxRedirections:r})],this[sJt]={...Ecs.deepClone(o),connect:n},this[sJt].interceptors=o.interceptors?{...o.interceptors}:void 0,this[vcs]=r,this[rkn]=e,this[_q]=new Map,this[tkn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[ZPn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[XPn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[ekn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[JPn](){let e=0;for(let r of this[_q].values())e+=r[JPn];return e}[hcs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Stt("opts.origin must be a non-empty string or URL.");let o=this[_q].get(n);return o||(o=this[rkn](e.origin,this[sJt]).on("drain",this[tkn]).on("connect",this[ZPn]).on("disconnect",this[XPn]).on("connectionError",this[ekn]),this[_q].set(n,o)),o.dispatch(e,r)}async[fcs](){let e=[];for(let r of this[_q].values())e.push(r.close());this[_q].clear(),await Promise.all(e)}async[pcs](e){let r=[];for(let n of this[_q].values())r.push(n.destroy(e));this[_q].clear(),await Promise.all(r)}};nkn.exports=aJt});var fJt=I((XQd,hkn)=>{"use strict";p();var{kProxy:cJt,kClose:lkn,kDestroy:ukn,kDispatch:ikn,kInterceptors:bcs}=Nd(),{URL:WK}=require("node:url"),Scs=Que(),dkn=Uue(),fkn=Cue(),{InvalidArgumentError:que,RequestAbortedError:Tcs,SecureProxyConnectionError:Ics}=pc(),okn=iwe(),pkn=Fue(),Ttt=Symbol("proxy agent"),Itt=Symbol("proxy client"),vq=Symbol("proxy headers"),lJt=Symbol("request tls settings"),skn=Symbol("proxy tls settings"),akn=Symbol("connect endpoint function"),ckn=Symbol("tunnel proxy");function xcs(t){return t==="https:"?443:80}a(xcs,"defaultProtocolPort");function wcs(t,e){return new dkn(t,e)}a(wcs,"defaultFactory");var Rcs=a(()=>{},"noop");function Pcs(t,e){return e.connections===1?new pkn(t,e):new dkn(t,e)}a(Pcs,"defaultAgentFactory");var uJt=class extends fkn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new que("Proxy URL is mandatory");this[vq]=r,o?this.#e=o(e,{connect:n}):this.#e=new pkn(e,{connect:n})}[ikn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new que("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 WK(o);c.host=l}return e.headers={...this[vq],...c},this.#e[ikn](e,r)}async[lkn](){return this.#e.close()}async[ukn](e){return this.#e.destroy(e)}},dJt=class extends fkn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof WK)&&!e.uri)throw new que("Proxy uri is mandatory");let{clientFactory:r=wcs}=e;if(typeof r!="function")throw new que("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[cJt]={uri:s,protocol:u},this[bcs]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[lJt]=e.requestTls,this[skn]=e.proxyTls,this[vq]=e.headers||{},this[ckn]=n,e.auth&&e.token)throw new que("opts.auth cannot be used in combination with opts.token");e.auth?this[vq]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[vq]["proxy-authorization"]=e.token:d&&f&&(this[vq]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=okn({...e.proxyTls});this[akn]=okn({...e.requestTls});let g=e.factory||Pcs,A=a((y,E)=>{let{protocol:_}=new WK(y);return!this[ckn]&&_==="http:"&&this[cJt].protocol==="http:"?new uJt(this[cJt].uri,{headers:this[vq],connect:m,factory:g}):g(y,E)},"factory");this[Itt]=r(o,{connect:m}),this[Ttt]=new Scs({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${xcs(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[Itt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[vq],host:y.host},servername:this[skn]?.servername||h});if(b!==200&&(v.on("error",Rcs).destroy(),E(new Tcs(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[lJt]?T=this[lJt].servername:T=y.servername,this[akn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Ics(v)):E(v)}},"connect")})}dispatch(e,r){let n=kcs(e.headers);if(Dcs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new WK(e.origin);n.host=o}return this[Ttt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new WK(e):e instanceof WK?e:new WK(e.uri)}async[lkn](){await this[Ttt].close(),await this[Itt].close()}async[ukn](){await this[Ttt].destroy(),await this[Itt].destroy()}};function kcs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new que("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Dcs,"throwIfProxyAuthIsSent");hkn.exports=dJt});var _kn=I((rqd,Ekn)=>{"use strict";p();var Ncs=Cue(),{kClose:Mcs,kDestroy:Ocs,kClosed:mkn,kDestroyed:gkn,kDispatch:Bcs,kNoProxyAgent:xwe,kHttpProxyAgent:Cq,kHttpsProxyAgent:zK}=Nd(),Akn=fJt(),Lcs=Que(),Fcs={"http:":80,"https:":443},ykn=!1,pJt=class extends Ncs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,ykn||(ykn=!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[xwe]=new Lcs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Cq]=new Akn({...s,uri:c}):this[Cq]=this[xwe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[zK]=new Akn({...s,uri:l}):this[zK]=this[Cq],this.#o()}[Bcs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[Mcs](){await this[xwe].close(),this[Cq][mkn]||await this[Cq].close(),this[zK][mkn]||await this[zK].close()}async[Ocs](e){await this[xwe].destroy(e),this[Cq][gkn]||await this[Cq].destroy(e),this[zK][gkn]||await this[zK].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Fcs[r]||0,this.#i(n,o)?r==="https:"?this[zK]:this[Cq]:this[xwe]}#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 jue=require("node:assert"),{kRetryHandlerDefaultRetry:vkn}=Nd(),{RequestRetryError:wwe}=pc(),{isDisturbed:Ckn,parseHeaders:Ucs,parseRangeHeader:bkn,wrapRequestBody:Qcs}=Ms();function qcs(t){let e=Date.now();return new Date(t).getTime()-e}a(qcs,"calculateRetryAfterHeader");var hJt=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:Qcs(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[vkn],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[vkn](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)?qcs(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=Ucs(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new wwe("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 wwe("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=bkn(s["content-range"]);if(!l)return this.abort(new wwe("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new wwe("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return jue(this.start===u,"content-range mismatch"),jue(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=bkn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;jue(u!=null&&Number.isFinite(u),"content-range mismatch"),jue(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 jue(Number.isFinite(this.start)),jue(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 wwe("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||Ckn(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||Ckn(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")}};Skn.exports=hJt});var Ikn=I((cqd,Tkn)=>{"use strict";p();var jcs=rwe(),Hcs=xtt(),mJt=class extends jcs{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 Hcs({...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()}};Tkn.exports=mJt});var vJt=I((dqd,Okn)=>{"use strict";p();var kkn=require("node:assert"),{Readable:Gcs}=require("node:stream"),{RequestAbortedError:Dkn,NotSupportedError:$cs,InvalidArgumentError:Vcs,AbortError:gJt}=pc(),Nkn=Ms(),{ReadableStreamFrom:Wcs}=Ms(),US=Symbol("kConsume"),Rwe=Symbol("kReading"),bq=Symbol("kBody"),xkn=Symbol("kAbort"),Mkn=Symbol("kContentType"),wkn=Symbol("kContentLength"),zcs=a(()=>{},"noop"),AJt=class extends Gcs{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[xkn]=r,this[US]=null,this[bq]=null,this[Mkn]=n,this[wkn]=o,this[Rwe]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new Dkn),e&&this[xkn](),super.destroy(e)}_destroy(e,r){this[Rwe]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[Rwe]=!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[Rwe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[US]&&e!==null?(EJt(this[US],e),this[Rwe]?super.push(e):!0):super.push(e)}async text(){return Pwe(this,"text")}async json(){return Pwe(this,"json")}async blob(){return Pwe(this,"blob")}async bytes(){return Pwe(this,"bytes")}async arrayBuffer(){return Pwe(this,"arrayBuffer")}async formData(){throw new $cs}get bodyUsed(){return Nkn.isDisturbed(this)}get body(){return this[bq]||(this[bq]=Wcs(this),this[US]&&(this[bq].getReader(),kkn(this[bq].locked))),this[bq]}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 Vcs("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[wkn]>r&&this.destroy(new gJt);let c=a(()=>{this.destroy(n.reason??new gJt)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new gJt):o(null)}).on("error",zcs).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function Ycs(t){return t[bq]&&t[bq].locked===!0||t[US]}a(Ycs,"isLocked");function Kcs(t){return Nkn.isDisturbed(t)||Ycs(t)}a(Kcs,"isUnusable");async function Pwe(t,e){return kkn(!t[US]),new Promise((r,n)=>{if(Kcs(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[US]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){_Jt(this[US],o)}).on("close",function(){this[US].body!==null&&_Jt(this[US],new Dkn)}),Jcs(t[US])})})}a(Pwe,"consume");function Jcs(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(yJt,"chunksDecode");function Rkn(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 Zcs=require("node:assert"),{ResponseStatusCodeError:Bkn}=pc(),{chunksDecode:Lkn}=vJt(),Xcs=128*1024;async function els({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){Zcs(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>Xcs){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new Bkn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{Fkn(r)?f=JSON.parse(Lkn(c,l)):Ukn(r)&&(f=Lkn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new Bkn(u,n,s,f)))}a(els,"getResolveErrorBodyCallback");var Fkn=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"),Ukn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");Qkn.exports={getResolveErrorBodyCallback:els,isContentTypeApplicationJson:Fkn,isContentTypeText:Ukn}});var Hkn=I((Aqd,bJt)=>{"use strict";p();var tls=require("node:assert"),{Readable:rls}=vJt(),{InvalidArgumentError:Hue,RequestAbortedError:qkn}=pc(),QS=Ms(),{getResolveErrorBodyCallback:nls}=CJt(),{AsyncResource:ils}=require("node:async_hooks"),wtt=class extends ils{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Hue("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 Hue("invalid callback");if(f&&(typeof f!="number"||f<0))throw new Hue("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Hue("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Hue("invalid method");if(l&&typeof l!="function")throw new Hue("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw QS.isStream(c)&&QS.destroy(c.on("error",QS.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,QS.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new qkn:this.removeAbortListener=QS.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new qkn,this.res?QS.destroy(this.res.on("error",QS.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}tls(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"?QS.parseRawHeaders(r):QS.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?QS.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new rls({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(nls,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){QS.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(()=>{QS.destroy(r,e)})),o&&(this.body=null,QS.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function jkn(t,e){if(e===void 0)return new Promise((r,n)=>{jkn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new wtt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(jkn,"request");bJt.exports=jkn;bJt.exports.RequestHandler=wtt});var kwe=I((_qd,Vkn)=>{p();var{addAbortListener:ols}=Ms(),{RequestAbortedError:sls}=pc(),Gue=Symbol("kListener"),IO=Symbol("kSignal");function Gkn(t){t.abort?t.abort(t[IO]?.reason):t.reason=t[IO]?.reason??new sls,$kn(t)}a(Gkn,"abort");function als(t,e){if(t.reason=null,t[IO]=null,t[Gue]=null,!!e){if(e.aborted){Gkn(t);return}t[IO]=e,t[Gue]=()=>{Gkn(t)},ols(t[IO],t[Gue])}}a(als,"addSignal");function $kn(t){t[IO]&&("removeEventListener"in t[IO]?t[IO].removeEventListener("abort",t[Gue]):t[IO].removeListener("abort",t[Gue]),t[IO]=null,t[Gue]=null)}a($kn,"removeSignal");Vkn.exports={addSignal:als,removeSignal:$kn}});var Kkn=I((bqd,Ykn)=>{"use strict";p();var cls=require("node:assert"),{finished:lls,PassThrough:uls}=require("node:stream"),{InvalidArgumentError:$ue,InvalidReturnValueError:dls}=pc(),Ok=Ms(),{getResolveErrorBodyCallback:fls}=CJt(),{AsyncResource:pls}=require("node:async_hooks"),{addSignal:hls,removeSignal:Wkn}=kwe(),SJt=class extends pls{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new $ue("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 $ue("invalid callback");if(typeof r!="function")throw new $ue("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new $ue("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new $ue("invalid method");if(u&&typeof u!="function")throw new $ue("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw Ok.isStream(l)&&Ok.destroy(l.on("error",Ok.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,Ok.isStream(l)&&l.on("error",h=>{this.onError(h)}),hls(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}cls(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"?Ok.parseRawHeaders(r):Ok.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"?Ok.parseHeaders(r):f)["content-type"];h=new uls,this.callback=null,this.runInAsyncScope(fls,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 dls("expected Writable");lls(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&Ok.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;Wkn(this),r&&(this.trailers=Ok.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;Wkn(this),this.factory=null,r?(this.res=null,Ok.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,Ok.destroy(s,e))}};function zkn(t,e,r){if(r===void 0)return new Promise((n,o)=>{zkn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new SJt(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(zkn,"stream");Ykn.exports=zkn});var e2n=I((Iqd,Xkn)=>{"use strict";p();var{Readable:Zkn,Duplex:mls,PassThrough:gls}=require("node:stream"),{InvalidArgumentError:Dwe,InvalidReturnValueError:Als,RequestAbortedError:TJt}=pc(),Jx=Ms(),{AsyncResource:yls}=require("node:async_hooks"),{addSignal:Els,removeSignal:_ls}=kwe(),Jkn=require("node:assert"),Vue=Symbol("resume"),IJt=class extends Zkn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Vue]=null}_read(){let{[Vue]:e}=this;e&&(this[Vue]=null,e())}_destroy(e,r){this._read(),r(e)}},xJt=class extends Zkn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Vue]=e}_read(){this[Vue]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new TJt),r(e)}},wJt=class extends yls{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Dwe("invalid opts");if(typeof r!="function")throw new Dwe("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 Dwe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Dwe("invalid method");if(c&&typeof c!="function")throw new Dwe("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 IJt().on("error",Jx.nop),this.ret=new mls({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[Vue]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new TJt),A&&u&&A(),Jx.destroy(f,u),Jx.destroy(h,u),Jx.destroy(m,u),_ls(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,Els(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}Jkn(!o,"pipeline cannot be retried"),Jkn(!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"?Jx.parseRawHeaders(r):Jx.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new xJt(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Jx.parseRawHeaders(r):Jx.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",Jx.nop),u}if(!l||typeof l.on!="function")throw new Als("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;Jx.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Jx.destroy(u,new TJt)}),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,Jx.destroy(r,e)}};function vls(t,e){try{let r=new wJt(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new gls().destroy(r)}}a(vls,"pipeline");Xkn.exports=vls});var s2n=I((Rqd,o2n)=>{"use strict";p();var{InvalidArgumentError:RJt,SocketError:Cls}=pc(),{AsyncResource:bls}=require("node:async_hooks"),t2n=Ms(),{addSignal:Sls,removeSignal:r2n}=kwe(),n2n=require("node:assert"),PJt=class extends bls{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new RJt("invalid opts");if(typeof r!="function")throw new RJt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new RJt("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,Sls(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}n2n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new Cls("bad upgrade",null)}onUpgrade(e,r,n){n2n(e===101);let{callback:o,opaque:s,context:c}=this;r2n(this),this.callback=null;let l=this.responseHeaders==="raw"?t2n.parseRawHeaders(r):t2n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;r2n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function i2n(t,e){if(e===void 0)return new Promise((r,n)=>{i2n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new PJt(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(i2n,"upgrade");o2n.exports=i2n});var d2n=I((Dqd,u2n)=>{"use strict";p();var Tls=require("node:assert"),{AsyncResource:Ils}=require("node:async_hooks"),{InvalidArgumentError:kJt,SocketError:xls}=pc(),a2n=Ms(),{addSignal:wls,removeSignal:c2n}=kwe(),DJt=class extends Ils{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new kJt("invalid opts");if(typeof r!="function")throw new kJt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new kJt("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,wls(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}Tls(this.callback),this.abort=e,this.context=r}onHeaders(){throw new xls("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;c2n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?a2n.parseRawHeaders(r):a2n.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;c2n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function l2n(t,e){if(e===void 0)return new Promise((r,n)=>{l2n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new DJt(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(l2n,"connect");u2n.exports=l2n});var f2n=I((Oqd,Wue)=>{"use strict";p();Wue.exports.request=Hkn();Wue.exports.stream=Kkn();Wue.exports.pipeline=e2n();Wue.exports.upgrade=s2n();Wue.exports.connect=d2n()});var MJt=I((Lqd,h2n)=>{"use strict";p();var{UndiciError:Rls}=pc(),p2n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),NJt=class t extends Rls{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[p2n]===!0}[p2n]=!0};h2n.exports={MockNotMatchedError:NJt}});var zue=I((Qqd,m2n)=>{"use strict";p();m2n.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 Nwe=I((jqd,I2n)=>{"use strict";p();var{MockNotMatchedError:YK}=MJt(),{kDispatches:Rtt,kMockAgent:Pls,kOriginalDispatch:kls,kOrigin:Dls,kGetNetConnect:Nls}=zue(),{buildURL:Mls}=Ms(),{STATUS_CODES:Ols}=require("node:http"),{types:{isPromise:Bls}}=require("node:util");function q3(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(q3,"matchValue");function A2n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(A2n,"lowerCaseEntries");function y2n(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=y2n(e,r);if(!q3(n,o))return!1}return!0}a(E2n,"matchHeaders");function g2n(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(g2n,"safeUrl");function Lls(t,{path:e,method:r,body:n,headers:o}){let s=q3(t.path,e),c=q3(t.method,r),l=typeof t.body<"u"?q3(t.body,n):!0,u=E2n(t,o);return s&&c&&l&&u}a(Lls,"matchKey");function _2n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(_2n,"getResponseData");function v2n(t,e){let r=e.query?Mls(e.path,e.query):e.path,n=typeof r=="string"?g2n(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>q3(g2n(s),n));if(o.length===0)throw new YK(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>q3(s,e.method)),o.length===0)throw new YK(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?q3(s,e.body):!0),o.length===0)throw new YK(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>E2n(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new YK(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(v2n,"getMockDispatch");function Fls(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(Fls,"addMockDispatch");function OJt(t,e){let r=t.findIndex(n=>n.consumed?Lls(n,e):!1);r!==-1&&t.splice(r,1)}a(OJt,"deleteMockDispatch");function C2n(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(C2n,"buildKey");function BJt(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Rtt])},d):g(this[Rtt]);function g(y,E=s){let _=Array.isArray(t.headers)?LJt(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(Bls(v)){v.then(R=>g(y,R));return}let b=_2n(v),T=BJt(c),w=BJt(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,b2n(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),OJt(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(S2n,"mockDispatch");function Qls(){let t=this[Pls],e=this[Dls],r=this[kls];return a(function(o,s){if(t.isMockActive)try{S2n.call(this,o,s)}catch(c){if(c instanceof YK){let l=t[Nls]();if(l===!1)throw new YK(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(T2n(l,e))r.call(this,o,s);else throw new YK(`${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(Qls,"buildMockDispatch");function T2n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>q3(n,r.host)))}a(T2n,"checkNetConnect");function qls(t){if(t){let{agent:e,...r}=t;return r}}a(qls,"buildMockOptions");I2n.exports={getResponseData:_2n,getMockDispatch:v2n,addMockDispatch:Fls,deleteMockDispatch:OJt,buildKey:C2n,generateKeyValues:BJt,matchValue:q3,getResponse:Uls,getStatusText:b2n,mockDispatch:S2n,buildMockDispatch:Qls,checkNetConnect:T2n,buildMockOptions:qls,getHeaderByName:y2n,buildHeadersFromArray:LJt}});var GJt=I(($qd,HJt)=>{"use strict";p();var{getResponseData:jls,buildKey:Hls,addMockDispatch:FJt}=Nwe(),{kDispatches:Ptt,kDispatchKey:ktt,kDefaultHeaders:UJt,kDefaultTrailers:QJt,kContentLength:qJt,kMockDispatch:Dtt}=zue(),{InvalidArgumentError:xO}=pc(),{buildURL:Gls}=Ms(),Yue=class{static{a(this,"MockScope")}constructor(e){this[Dtt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new xO("waitInMs must be a valid integer > 0");return this[Dtt].delay=e,this}persist(){return this[Dtt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new xO("repeatTimes must be a valid integer > 0");return this[Dtt].times=e,this}},jJt=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new xO("opts must be an object");if(typeof e.path>"u")throw new xO("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=Gls(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[ktt]=Hls(e),this[Ptt]=r,this[UJt]={},this[QJt]={},this[qJt]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=jls(r),s=this[qJt]?{"content-length":o.length}:{},c={...this[UJt],...s,...n.headers},l={...this[QJt],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new xO("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new xO("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 xO("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=FJt(this[Ptt],this[ktt],s);return new Yue(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=FJt(this[Ptt],this[ktt],n);return new Yue(o)}replyWithError(e){if(typeof e>"u")throw new xO("error must be defined");let r=FJt(this[Ptt],this[ktt],{error:e});return new Yue(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new xO("headers must be defined");return this[UJt]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new xO("trailers must be defined");return this[QJt]=e,this}replyContentLength(){return this[qJt]=!0,this}};HJt.exports.MockInterceptor=jJt;HJt.exports.MockScope=Yue});var WJt=I((zqd,N2n)=>{"use strict";p();var{promisify:$ls}=require("node:util"),Vls=Fue(),{buildMockDispatch:Wls}=Nwe(),{kDispatches:x2n,kMockAgent:w2n,kClose:R2n,kOriginalClose:P2n,kOrigin:k2n,kOriginalDispatch:zls,kConnected:$Jt}=zue(),{MockInterceptor:Yls}=GJt(),D2n=Nd(),{InvalidArgumentError:Kls}=pc(),VJt=class extends Vls{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Kls("Argument opts.agent must implement Agent");this[w2n]=r.agent,this[k2n]=e,this[x2n]=[],this[$Jt]=1,this[zls]=this.dispatch,this[P2n]=this.close.bind(this),this.dispatch=Wls.call(this),this.close=this[R2n]}get[D2n.kConnected](){return this[$Jt]}intercept(e){return new Yls(e,this[x2n])}async[R2n](){await $ls(this[P2n])(),this[$Jt]=0,this[w2n][D2n.kClients].delete(this[k2n])}};N2n.exports=VJt});var KJt=I((Jqd,Q2n)=>{"use strict";p();var{promisify:Jls}=require("node:util"),Zls=Uue(),{buildMockDispatch:Xls}=Nwe(),{kDispatches:M2n,kMockAgent:O2n,kClose:B2n,kOriginalClose:L2n,kOrigin:F2n,kOriginalDispatch:eus,kConnected:zJt}=zue(),{MockInterceptor:tus}=GJt(),U2n=Nd(),{InvalidArgumentError:rus}=pc(),YJt=class extends Zls{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new rus("Argument opts.agent must implement Agent");this[O2n]=r.agent,this[F2n]=e,this[M2n]=[],this[zJt]=1,this[eus]=this.dispatch,this[L2n]=this.close.bind(this),this.dispatch=Xls.call(this),this.close=this[B2n]}get[U2n.kConnected](){return this[zJt]}intercept(e){return new tus(e,this[M2n])}async[B2n](){await Jls(this[L2n])(),this[zJt]=0,this[O2n][U2n.kClients].delete(this[F2n])}};Q2n.exports=YJt});var j2n=I((tjd,q2n)=>{"use strict";p();var nus={pronoun:"it",is:"is",was:"was",this:"this"},ius={pronoun:"they",is:"are",was:"were",this:"these"};q2n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?nus:ius,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var G2n=I((ojd,H2n)=>{"use strict";p();var{Transform:ous}=require("node:stream"),{Console:sus}=require("node:console"),aus=process.versions.icu?"\u2705":"Y ",cus=process.versions.icu?"\u274C":"N ";H2n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new ous({transform(r,n,o){o(null,r)}}),this.logger=new sus({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?aus:cus,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var z2n=I((cjd,W2n)=>{"use strict";p();var{kClients:KK}=Nd(),lus=Que(),{kAgent:JJt,kMockAgentSet:Ntt,kMockAgentGet:$2n,kDispatches:ZJt,kIsMockActive:Mtt,kNetConnect:JK,kGetNetConnect:uus,kOptions:Ott,kFactory:Btt}=zue(),dus=WJt(),fus=KJt(),{matchValue:pus,buildMockOptions:hus}=Nwe(),{InvalidArgumentError:V2n,UndiciError:mus}=pc(),gus=rwe(),Aus=j2n(),yus=G2n(),XJt=class extends gus{static{a(this,"MockAgent")}constructor(e){if(super(e),this[JK]=!0,this[Mtt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new V2n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new lus(e);this[JJt]=r,this[KK]=r[KK],this[Ott]=hus(e)}get(e){let r=this[$2n](e);return r||(r=this[Btt](e),this[Ntt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[JJt].dispatch(e,r)}async close(){await this[JJt].close(),this[KK].clear()}deactivate(){this[Mtt]=!1}activate(){this[Mtt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[JK])?this[JK].push(e):this[JK]=[e];else if(typeof e>"u")this[JK]=!0;else throw new V2n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[JK]=!1}get isMockActive(){return this[Mtt]}[Ntt](e,r){this[KK].set(e,r)}[Btt](e){let r=Object.assign({agent:this},this[Ott]);return this[Ott]&&this[Ott].connections===1?new dus(e,r):new fus(e,r)}[$2n](e){let r=this[KK].get(e);if(r)return r;if(typeof e!="string"){let n=this[Btt]("http://localhost:9999");return this[Ntt](e,n),n}for(let[n,o]of Array.from(this[KK]))if(o&&typeof n!="string"&&pus(n,e)){let s=this[Btt](e);return this[Ntt](e,s),s[ZJt]=o[ZJt],s}}[uus](){return this[JK]}pendingInterceptors(){let e=this[KK];return Array.from(e.entries()).flatMap(([r,n])=>n[ZJt].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new yus}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Aus("interceptor","interceptors").pluralize(r.length);throw new mus(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(r)} -`.trim())}};QNn.exports=uXt});var xrt=I((Vzd,$Nn)=>{"use strict";p();var jNn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:jhs}=mc(),Hhs=ude();GNn()===void 0&&HNn(new Hhs);function HNn(t){if(!t||typeof t.dispatch!="function")throw new jhs("Argument agent must implement Agent");Object.defineProperty(globalThis,jNn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(HNn,"setGlobalDispatcher");function GNn(){return globalThis[jNn]}a(GNn,"getGlobalDispatcher");$Nn.exports={setGlobalDispatcher:HNn,getGlobalDispatcher:GNn}});var wrt=I((Kzd,VNn)=>{"use strict";p();VNn.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 zNn=I((Xzd,WNn)=>{"use strict";p();var Ghs=srt();WNn.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 Ghs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var KNn=I((rYd,YNn)=>{"use strict";p();var $hs=Art();YNn.exports=t=>e=>a(function(n,o){return e(n,new $hs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var ZNn=I((oYd,JNn)=>{"use strict";p();var Vhs=Ls(),{InvalidArgumentError:Whs,RequestAbortedError:zhs}=mc(),Yhs=wrt(),dXt=class extends Yhs{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 Whs("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=Vhs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new zhs(`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 Khs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new dXt({maxSize:s},o);return e(n,c)},"Intercept")}a(Khs,"createDumpInterceptor");JNn.exports=Khs});var tMn=I((cYd,eMn)=>{"use strict";p();var{isIP:Jhs}=require("node:net"),{lookup:Zhs}=require("node:dns"),Xhs=wrt(),{InvalidArgumentError:_de,InformationalError:e0s}=mc(),XNn=Math.pow(2,31)-1,fXt=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 e0s("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){Zhs(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===XNn?(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===XNn?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 pXt(this,e,r)}},pXt=class extends Xhs{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}}};eMn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new _de("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new _de("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new _de("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new _de("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new _de("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new _de("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 fXt(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return Jhs(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 yJ=I((dYd,cMn)=>{"use strict";p();var{kConstruct:t0s}=Od(),{kEnumerableProperty:Cde}=Ls(),{iteratorMixin:r0s,isValidHeaderName:uRe,isValidHeaderValue:nMn}=$S(),{webidl:Ha}=bA(),hXt=require("node:assert"),Rrt=require("node:util"),Kh=Symbol("headers map"),zS=Symbol("headers map sorted");function rMn(t){return t===10||t===13||t===9||t===32}a(rMn,"isHTTPWhiteSpaceCharCode");function iMn(t){let e=0,r=t.length;for(;r>e&&rMn(t.charCodeAt(r-1));)--r;for(;r>e&&rMn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(iMn,"headerValueNormalize");function oMn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(oMn,"fill");function mXt(t,e,r){if(r=iMn(r),uRe(e)){if(!nMn(r))throw Ha.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Ha.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(aMn(t)==="immutable")throw new TypeError("immutable");return gXt(t).append(e,r,!1)}a(mXt,"appendHeader");function sMn(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[Kh])r[n++]=[o,s],hXt(s!==null);return r.sort(sMn)}}},HP=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Ha.util.markAsUncloneable(this),e!==t0s&&(this.#t=new krt,this.#e="none",e!==void 0&&(e=Ha.converters.HeadersInit(e,"Headers contructor","init"),oMn(this,e)))}append(e,r){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Ha.converters.ByteString(e,n,"name"),r=Ha.converters.ByteString(r,n,"value"),mXt(this,e,r)}delete(e){if(Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ha.converters.ByteString(e,"Headers.delete","name"),!uRe(e))throw Ha.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){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Ha.converters.ByteString(e,r,"name"),!uRe(e))throw Ha.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Ha.converters.ByteString(e,r,"name"),!uRe(e))throw Ha.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Ha.converters.ByteString(e,n,"name"),r=Ha.converters.ByteString(r,n,"value"),r=iMn(r),uRe(e)){if(!nMn(r))throw Ha.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Ha.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Ha.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[zS](){if(this.#t[zS])return this.#t[zS];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[zS]=r;for(let o=0;o>"](t,e,r,n.bind(t)):Ha.converters["record"](t,e,r)}throw Ha.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};cMn.exports={fill:oMn,compareHeaderName:sMn,Headers:HP,HeadersList:krt,getHeadersGuard:aMn,setHeadersGuard:n0s,setHeadersList:i0s,getHeadersList:gXt}});var fRe=I((hYd,_Mn)=>{"use strict";p();var{Headers:hMn,HeadersList:lMn,fill:o0s,getHeadersGuard:s0s,setHeadersGuard:mMn,setHeadersList:gMn}=yJ(),{extractBody:uMn,cloneBody:a0s,mixinBody:c0s,hasFinalizationRegistry:AMn,streamRegistry:yMn,bodyUnusable:l0s}=tde(),AXt=Ls(),dMn=require("node:util"),{kEnumerableProperty:YS}=AXt,{isValidReasonPhrase:u0s,isCancelled:d0s,isAborted:f0s,isBlobLike:p0s,serializeJavascriptValueToJSONString:h0s,isErrorLike:m0s,isomorphicEncode:g0s,environmentSettingsObject:A0s}=$S(),{redirectStatusSet:y0s,nullBodyStatus:E0s}=Owe(),{kState:Ld,kHeaders:rF}=kq(),{webidl:ts}=bA(),{FormData:_0s}=qwe(),{URLSerializer:fMn}=Gv(),{kConstruct:Drt}=Od(),yXt=require("node:assert"),{types:C0s}=require("node:util"),v0s=new TextEncoder("utf-8"),EJ=class t{static{a(this,"Response")}static error(){return dRe(Nrt(),"immutable")}static json(e,r={}){ts.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ts.converters.ResponseInit(r));let n=v0s.encode(h0s(e)),o=uMn(n),s=dRe(vde({}),"response");return pMn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ts.argumentLengthCheck(arguments,1,"Response.redirect"),e=ts.converters.USVString(e),r=ts.converters["unsigned short"](r);let n;try{n=new URL(e,A0s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!y0s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=dRe(vde({}),"immutable");o[Ld].status=r;let s=g0s(fMn(n));return o[Ld].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ts.util.markAsUncloneable(this),e===Drt)return;e!==null&&(e=ts.converters.BodyInit(e)),r=ts.converters.ResponseInit(r),this[Ld]=vde({}),this[rF]=new hMn(Drt),mMn(this[rF],"response"),gMn(this[rF],this[Ld].headersList);let n=null;if(e!=null){let[o,s]=uMn(e);n={body:o,type:s}}pMn(this,r,n)}get type(){return ts.brandCheck(this,t),this[Ld].type}get url(){ts.brandCheck(this,t);let e=this[Ld].urlList,r=e[e.length-1]??null;return r===null?"":fMn(r,!0)}get redirected(){return ts.brandCheck(this,t),this[Ld].urlList.length>1}get status(){return ts.brandCheck(this,t),this[Ld].status}get ok(){return ts.brandCheck(this,t),this[Ld].status>=200&&this[Ld].status<=299}get statusText(){return ts.brandCheck(this,t),this[Ld].statusText}get headers(){return ts.brandCheck(this,t),this[rF]}get body(){return ts.brandCheck(this,t),this[Ld].body?this[Ld].body.stream:null}get bodyUsed(){return ts.brandCheck(this,t),!!this[Ld].body&&AXt.isDisturbed(this[Ld].body.stream)}clone(){if(ts.brandCheck(this,t),l0s(this))throw ts.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=EXt(this[Ld]);return AMn&&this[Ld].body?.stream&&yMn.register(this,new WeakRef(this[Ld].body.stream)),dRe(e,s0s(this[rF]))}[dMn.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 ${dMn.formatWithOptions(r,n)}`}};c0s(EJ);Object.defineProperties(EJ.prototype,{type:YS,url:YS,status:YS,ok:YS,redirected:YS,statusText:YS,headers:YS,clone:YS,body:YS,bodyUsed:YS,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(EJ,{json:YS,redirect:YS,error:YS});function EXt(t){if(t.internalResponse)return EMn(EXt(t.internalResponse),t.type);let e=vde({...t,body:null});return t.body!=null&&(e.body=a0s(e,t.body)),e}a(EXt,"cloneResponse");function vde(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new lMn(t?.headersList):new lMn,urlList:t?.urlList?[...t.urlList]:[]}}a(vde,"makeResponse");function Nrt(t){let e=m0s(t);return vde({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Nrt,"makeNetworkError");function b0s(t){return t.type==="error"&&t.status===0}a(b0s,"isNetworkError");function Prt(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 yXt(!(n in e)),r[n]=o,!0}})}a(Prt,"makeFilteredResponse");function EMn(t,e){if(e==="basic")return Prt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Prt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Prt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return Prt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});yXt(!1)}a(EMn,"filterResponse");function S0s(t,e=null){return yXt(d0s(t)),f0s(t)?Nrt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Nrt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(S0s,"makeAppropriateNetworkError");function pMn(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&&!u0s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Ld].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Ld].statusText=e.statusText),"headers"in e&&e.headers!=null&&o0s(t[rF],e.headers),r){if(E0s.includes(t.status))throw ts.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Ld].body=r.body,r.type!=null&&!t[Ld].headersList.contains("content-type",!0)&&t[Ld].headersList.append("content-type",r.type,!0)}}a(pMn,"initializeResponse");function dRe(t,e){let r=new EJ(Drt);return r[Ld]=t,r[rF]=new hMn(Drt),gMn(r[rF],t.headersList),mMn(r[rF],e),AMn&&t.body?.stream&&yMn.register(r,new WeakRef(t.body.stream)),r}a(dRe,"fromInnerResponse");ts.converters.ReadableStream=ts.interfaceConverter(ReadableStream);ts.converters.FormData=ts.interfaceConverter(_0s);ts.converters.URLSearchParams=ts.interfaceConverter(URLSearchParams);ts.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ts.converters.USVString(t,e,r):p0s(t)?ts.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||C0s.isArrayBuffer(t)?ts.converters.BufferSource(t,e,r):AXt.isFormDataLike(t)?ts.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ts.converters.URLSearchParams(t,e,r):ts.converters.DOMString(t,e,r)};ts.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ts.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ts.converters.XMLHttpRequestBodyInit(t,e,r)};ts.converters.ResponseInit=ts.dictionaryConverter([{key:"status",converter:ts.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ts.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ts.converters.HeadersInit}]);_Mn.exports={isNetworkError:b0s,makeNetworkError:Nrt,makeResponse:vde,makeAppropriateNetworkError:S0s,filterResponse:EMn,Response:EJ,cloneResponse:EXt,fromInnerResponse:dRe}});var SMn=I((AYd,bMn)=>{"use strict";p();var{kConnected:CMn,kSize:vMn}=Od(),_Xt=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[CMn]===0&&this.value[vMn]===0?void 0:this.value}},CXt=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[CMn]===0&&e[vMn]===0&&this.finalizer(r)})}unregister(e){}};bMn.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:_Xt,FinalizationRegistry:CXt}):{WeakRef,FinalizationRegistry}}});var bde=I((_Yd,UMn)=>{"use strict";p();var{extractBody:T0s,mixinBody:I0s,cloneBody:x0s,bodyUnusable:TMn}=tde(),{Headers:MMn,fill:w0s,HeadersList:Lrt,setHeadersGuard:bXt,getHeadersGuard:R0s,setHeadersList:OMn,getHeadersList:IMn}=yJ(),{FinalizationRegistry:k0s}=SMn()(),Ort=Ls(),xMn=require("node:util"),{isValidHTTPToken:P0s,sameOrigin:wMn,environmentSettingsObject:Mrt}=$S(),{forbiddenMethodsSet:D0s,corsSafeListedMethodsSet:N0s,referrerPolicy:M0s,requestRedirect:O0s,requestMode:B0s,requestCredentials:L0s,requestCache:F0s,requestDuplex:U0s}=Owe(),{kEnumerableProperty:Jh,normalizedMethodRecordsBase:Q0s,normalizedMethodRecords:q0s}=Ort,{kHeaders:KS,kSignal:Brt,kState:Xu,kDispatcher:vXt}=kq(),{webidl:$i}=bA(),{URLSerializer:j0s}=Gv(),{kConstruct:Frt}=Od(),H0s=require("node:assert"),{getMaxListeners:RMn,setMaxListeners:kMn,getEventListeners:G0s,defaultMaxListeners:PMn}=require("node:events"),$0s=Symbol("abortController"),BMn=new k0s(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Urt=new WeakMap;function DMn(t){return e;function e(){let r=t.deref();if(r!==void 0){BMn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Urt.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()}Urt.delete(r.signal)}}}}a(DMn,"buildAbort");var NMn=!1,jq=class t{static{a(this,"Request")}constructor(e,r={}){if($i.util.markAsUncloneable(this),e===Frt)return;let n="Request constructor";$i.argumentLengthCheck(arguments,1,n),e=$i.converters.RequestInfo(e,n,"input"),r=$i.converters.RequestInit(r,n,"init");let o=null,s=null,c=Mrt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[vXt]=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=Qrt({urlList:[_]}),s="cors"}else this[vXt]=r.dispatcher||e[vXt],H0s(e instanceof t),o=e[Xu],l=e[Brt];let u=Mrt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&wMn(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=Qrt({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Mrt.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&&!wMn(v,Mrt.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 $i.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=q0s[_];if(v!==void 0)o.method=v;else{if(!P0s(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(D0s.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=Q0s[b]??_,o.method=_}!NMn&&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"}),NMn=!0)}r.signal!==void 0&&(l=r.signal),this[Xu]=o;let m=new AbortController;if(this[Brt]=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[$0s]=m;let _=new WeakRef(m),v=DMn(_);try{(typeof RMn=="function"&&RMn(l)===PMn||G0s(l,"abort").length>=PMn)&&kMn(1500,l)}catch{}Ort.addAbortListener(l,v),BMn.register(m,{signal:l,abort:v},v)}}if(this[KS]=new MMn(Frt),OMn(this[KS],o.headersList),bXt(this[KS],"request"),h==="no-cors"){if(!N0s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);bXt(this[KS],"request-no-cors")}if(f){let _=IMn(this[KS]),v=r.headers!==void 0?r.headers:new Lrt(_);if(_.clear(),v instanceof Lrt){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else w0s(this[KS],v)}let g=e instanceof t?e[Xu].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]=T0s(r.body,o.keepalive);A=_,v&&!IMn(this[KS]).contains("content-type",!0)&&this[KS].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(TMn(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[Xu].body=E}get method(){return $i.brandCheck(this,t),this[Xu].method}get url(){return $i.brandCheck(this,t),j0s(this[Xu].url)}get headers(){return $i.brandCheck(this,t),this[KS]}get destination(){return $i.brandCheck(this,t),this[Xu].destination}get referrer(){return $i.brandCheck(this,t),this[Xu].referrer==="no-referrer"?"":this[Xu].referrer==="client"?"about:client":this[Xu].referrer.toString()}get referrerPolicy(){return $i.brandCheck(this,t),this[Xu].referrerPolicy}get mode(){return $i.brandCheck(this,t),this[Xu].mode}get credentials(){return this[Xu].credentials}get cache(){return $i.brandCheck(this,t),this[Xu].cache}get redirect(){return $i.brandCheck(this,t),this[Xu].redirect}get integrity(){return $i.brandCheck(this,t),this[Xu].integrity}get keepalive(){return $i.brandCheck(this,t),this[Xu].keepalive}get isReloadNavigation(){return $i.brandCheck(this,t),this[Xu].reloadNavigation}get isHistoryNavigation(){return $i.brandCheck(this,t),this[Xu].historyNavigation}get signal(){return $i.brandCheck(this,t),this[Brt]}get body(){return $i.brandCheck(this,t),this[Xu].body?this[Xu].body.stream:null}get bodyUsed(){return $i.brandCheck(this,t),!!this[Xu].body&&Ort.isDisturbed(this[Xu].body.stream)}get duplex(){return $i.brandCheck(this,t),"half"}clone(){if($i.brandCheck(this,t),TMn(this))throw new TypeError("unusable");let e=LMn(this[Xu]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Urt.get(this.signal);n===void 0&&(n=new Set,Urt.set(this.signal,n));let o=new WeakRef(r);n.add(o),Ort.addAbortListener(r.signal,DMn(o))}return FMn(e,r.signal,R0s(this[KS]))}[xMn.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 ${xMn.formatWithOptions(r,n)}`}};I0s(jq);function Qrt(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 Lrt(t.headersList):new Lrt}}a(Qrt,"makeRequest");function LMn(t){let e=Qrt({...t,body:null});return t.body!=null&&(e.body=x0s(e,t.body)),e}a(LMn,"cloneRequest");function FMn(t,e,r){let n=new jq(Frt);return n[Xu]=t,n[Brt]=e,n[KS]=new MMn(Frt),OMn(n[KS],t.headersList),bXt(n[KS],r),n}a(FMn,"fromInnerRequest");Object.defineProperties(jq.prototype,{method:Jh,url:Jh,headers:Jh,redirect:Jh,clone:Jh,signal:Jh,duplex:Jh,destination:Jh,body:Jh,bodyUsed:Jh,isHistoryNavigation:Jh,isReloadNavigation:Jh,keepalive:Jh,integrity:Jh,cache:Jh,credentials:Jh,attribute:Jh,referrerPolicy:Jh,referrer:Jh,mode:Jh,[Symbol.toStringTag]:{value:"Request",configurable:!0}});$i.converters.Request=$i.interfaceConverter(jq);$i.converters.RequestInfo=function(t,e,r){return typeof t=="string"?$i.converters.USVString(t,e,r):t instanceof jq?$i.converters.Request(t,e,r):$i.converters.USVString(t,e,r)};$i.converters.AbortSignal=$i.interfaceConverter(AbortSignal);$i.converters.RequestInit=$i.dictionaryConverter([{key:"method",converter:$i.converters.ByteString},{key:"headers",converter:$i.converters.HeadersInit},{key:"body",converter:$i.nullableConverter($i.converters.BodyInit)},{key:"referrer",converter:$i.converters.USVString},{key:"referrerPolicy",converter:$i.converters.DOMString,allowedValues:M0s},{key:"mode",converter:$i.converters.DOMString,allowedValues:B0s},{key:"credentials",converter:$i.converters.DOMString,allowedValues:L0s},{key:"cache",converter:$i.converters.DOMString,allowedValues:F0s},{key:"redirect",converter:$i.converters.DOMString,allowedValues:O0s},{key:"integrity",converter:$i.converters.DOMString},{key:"keepalive",converter:$i.converters.boolean},{key:"signal",converter:$i.nullableConverter(t=>$i.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:$i.converters.any},{key:"duplex",converter:$i.converters.DOMString,allowedValues:U0s},{key:"dispatcher",converter:$i.converters.any}]);UMn.exports={Request:jq,makeRequest:Qrt,fromInnerRequest:FMn,cloneRequest:LMn}});var hRe=I((bYd,eOn)=>{"use strict";p();var{makeNetworkError:rl,makeAppropriateNetworkError:qrt,filterResponse:SXt,makeResponse:jrt,fromInnerResponse:V0s}=fRe(),{HeadersList:QMn}=yJ(),{Request:W0s,cloneRequest:z0s}=bde(),Hq=require("node:zlib"),{bytesMatch:Y0s,makePolicyContainer:K0s,clonePolicyContainer:J0s,requestBadPort:Z0s,TAOCheck:X0s,appendRequestOriginHeader:ems,responseLocationURL:tms,requestCurrentURL:QO,setRequestReferrerPolicyOnRedirect:rms,tryUpgradeRequestToAPotentiallyTrustworthyURL:nms,createOpaqueTimingInfo:RXt,appendFetchMetadata:ims,corsCheck:oms,crossOriginResourcePolicyCheck:sms,determineRequestsReferrer:ams,coarsenedSharedCurrentTime:pRe,createDeferredPromise:cms,isBlobLike:lms,sameOrigin:wXt,isCancelled:_J,isAborted:qMn,isErrorLike:ums,fullyReadBody:dms,readableStreamClose:fms,isomorphicEncode:Hrt,urlIsLocal:pms,urlIsHttpHttpsScheme:kXt,urlHasHttpsScheme:hms,clampAndCoarsenConnectionTimingInfo:mms,simpleRangeHeaderValue:gms,buildContentRange:Ams,createInflate:yms,extractMimeType:Ems}=$S(),{kState:$Mn,kDispatcher:_ms}=kq(),CJ=require("node:assert"),{safelyExtractBody:PXt,extractBody:jMn}=tde(),{redirectStatusSet:VMn,nullBodyStatus:WMn,safeMethodsSet:Cms,requestBodyHeader:vms,subresourceSet:bms}=Owe(),Sms=require("node:events"),{Readable:Tms,pipeline:Ims,finished:xms}=require("node:stream"),{addAbortListener:wms,isErrored:Rms,isReadable:Grt,bufferToLowerCasedHeaderName:HMn}=Ls(),{dataURLProcessor:kms,serializeAMimeType:Pms,minimizeSupportedMimeType:Dms}=Gv(),{getGlobalDispatcher:Nms}=xrt(),{webidl:Mms}=bA(),{STATUS_CODES:Oms}=require("node:http"),Bms=["GET","HEAD"],Lms=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",TXt,$rt=class extends Sms{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 Fms(t){zMn(t,"fetch")}a(Fms,"handleFetchDone");function Ums(t,e=void 0){Mms.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=cms(),n;try{n=new W0s(t,e)}catch(f){return r.reject(f),r.promise}let o=n[$Mn];if(n.signal.aborted)return IXt(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 wms(n.signal,()=>{l=!0,CJ(u!=null),u.abort(n.signal.reason);let f=c?.deref();IXt(r,o,f,n.signal.reason)}),u=KMn({request:o,processResponseEndOfBody:Fms,processResponse:a(f=>{if(!l){if(f.aborted){IXt(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(V0s(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[_ms]}),r.promise}a(Ums,"fetch");function zMn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;kXt(r)&&n!==null&&(t.timingAllowPassed||(n=RXt({startTime:n.startTime}),o=""),n.endTime=pRe(),t.timingInfo=n,YMn(n,r.href,e,globalThis,o))}a(zMn,"finalizeAndReportTiming");var YMn=performance.markResourceTiming;function IXt(t,e,r,n){if(t&&t.reject(n),e.body!=null&&Grt(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[$Mn];o.body!=null&&Grt(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(IXt,"abortFetch");function KMn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=Nms()}){CJ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=pRe(d),h=RXt({startTime:f}),m={controller:new $rt(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return CJ(!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=J0s(t.client.policyContainer):t.policyContainer=K0s()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,bms.has(t.destination),JMn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(KMn,"fetching");async function JMn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!pms(QO(r))&&(n=rl("local URLs only")),nms(r),Z0s(r)==="blocked"&&(n=rl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=ams(r)),n===null&&(n=await(async()=>{let s=QO(r);return wXt(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await GMn(t)):r.mode==="same-origin"?rl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?rl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await GMn(t)):kXt(QO(r))?(r.responseTainting="cors",await ZMn(t)):rl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=SXt(n,"basic"):r.responseTainting==="cors"?n=SXt(n,"cors"):r.responseTainting==="opaque"?n=SXt(n,"opaque"):CJ(!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=rl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||WMn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>xXt(t,rl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!Y0s(l,r.integrity)){s("integrity mismatch");return}n.body=PXt(l)[0],xXt(t,n)},"processBody");await dms(n.body,c,s)}else xXt(t,n)}a(JMn,"mainFetch");function GMn(t){if(_J(t)&&t.request.redirectCount===0)return Promise.resolve(qrt(t));let{request:e}=t,{protocol:r}=QO(e);switch(r){case"about:":return Promise.resolve(rl("about scheme is not supported"));case"blob:":{TXt||(TXt=require("node:buffer").resolveObjectURL);let n=QO(e);if(n.search.length!==0)return Promise.resolve(rl("NetworkError when attempting to fetch resource."));let o=TXt(n.toString());if(e.method!=="GET"||!lms(o))return Promise.resolve(rl("invalid method"));let s=jrt(),c=o.size,l=Hrt(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=gms(d,!0);if(f==="failure")return Promise.resolve(rl("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(rl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=jMn(g);s.body=A[0];let y=Hrt(`${g.size}`),E=Ams(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=jMn(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=QO(e),o=kms(n);if(o==="failure")return Promise.resolve(rl("failed to fetch the data URL"));let s=Pms(o.mimeType);return Promise.resolve(jrt({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:PXt(o.body)[0]}))}case"file:":return Promise.resolve(rl("not implemented... yet..."));case"http:":case"https:":return ZMn(t).catch(n=>rl(n));default:return Promise.resolve(rl("unknown scheme"))}}a(GMn,"schemeFetch");function Qms(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Qms,"finalizeResponse");function xXt(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=RXt(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=Ems(e.headersList);f!=="failure"&&(u.contentType=Dms(f))}t.request.initiatorType!=null&&YMn(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():xms(o.body.stream,()=>{n()})}a(xXt,"fetchFinale");async function ZMn(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 XMn(t),e.responseTainting==="cors"&&oms(e,r)==="failure")return rl("cors failure");X0s(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&sms(e.origin,e.client,e.destination,n)==="blocked"?rl("blocked"):(VMn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=rl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await qms(t,r):CJ(!1)),r.timingInfo=o,r)}a(ZMn,"httpFetch");function qms(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=tms(n,QO(r).hash),o==null)return e}catch(c){return Promise.resolve(rl(c))}if(!kXt(o))return Promise.resolve(rl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(rl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!wXt(r,o))return Promise.resolve(rl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(rl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(rl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!Bms.includes(r.method)){r.method="GET",r.body=null;for(let c of vms)r.headersList.delete(c)}wXt(QO(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&&(CJ(r.body.source!=null),r.body=PXt(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=pRe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),rms(r,n),JMn(t,!0)}a(qms,"httpRedirectFetch");async function XMn(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=z0s(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=Hrt(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Hrt(s.referrer.href),!0),ems(s),ims(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",Lms),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)||(hms(QO(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 rl("only if cached");let m=await jms(o,d,r);!Cms.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"?rl():_J(t)?qrt(t):rl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(_J(t))return qrt(t);t.controller.connection.destroy(),c=await XMn(t,e,!0)}return c}a(XMn,"httpNetworkOrCacheFetch");async function jms(t,e=!1,r=!1){CJ(!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*(_){_J(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{_J(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{_J(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=jrt({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=jrt({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),qrt(t,A)):rl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{_J(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(qMn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){fms(t.controller.controller),Qms(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),Rms(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){qMn(t)?(o.aborted=!0,Grt(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Grt(h)&&t.controller.controller.error(new TypeError("terminated",{cause:ums(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=QO(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=mms(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=pRe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=pRe(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",k=new QMn;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 q=Q[O].trim();if(q==="x-gzip"||q==="gzip")D.push(Hq.createGunzip({flush:Hq.constants.Z_SYNC_FLUSH,finishFlush:Hq.constants.Z_SYNC_FLUSH}));else if(q==="deflate")D.push(yms({flush:Hq.constants.Z_SYNC_FLUSH,finishFlush:Hq.constants.Z_SYNC_FLUSH}));else if(q==="br")D.push(Hq.createBrotliDecompress({flush:Hq.constants.BROTLI_OPERATION_FLUSH,finishFlush:Hq.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:k,body:D.length?Ims(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 QMn;for(let x=0;x{"use strict";p();tOn.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 nOn=I((wYd,rOn)=>{"use strict";p();var{webidl:JS}=bA(),Vrt=Symbol("ProgressEvent state"),NXt=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=JS.converters.DOMString(e,"ProgressEvent constructor","type"),r=JS.converters.ProgressEventInit(r??{}),super(e,r),this[Vrt]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return JS.brandCheck(this,t),this[Vrt].lengthComputable}get loaded(){return JS.brandCheck(this,t),this[Vrt].loaded}get total(){return JS.brandCheck(this,t),this[Vrt].total}};JS.converters.ProgressEventInit=JS.dictionaryConverter([{key:"lengthComputable",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:JS.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:JS.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);rOn.exports={ProgressEvent:NXt}});var oOn=I((PYd,iOn)=>{"use strict";p();function Hms(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(Hms,"getEncoding");iOn.exports={getEncoding:Hms}});var pOn=I((MYd,fOn)=>{"use strict";p();var{kState:Sde,kError:MXt,kResult:sOn,kAborted:mRe,kLastProgressEventFired:OXt}=DXt(),{ProgressEvent:Gms}=nOn(),{getEncoding:aOn}=oOn(),{serializeAMimeType:$ms,parseMIMEType:cOn}=Gv(),{types:Vms}=require("node:util"),{StringDecoder:lOn}=require("string_decoder"),{btoa:uOn}=require("node:buffer"),Wms={enumerable:!0,writable:!1,configurable:!1};function zms(t,e,r,n){if(t[Sde]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[Sde]="loading",t[sOn]=null,t[MXt]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[mRe];)try{let{done:d,value:f}=await l;if(u&&!t[mRe]&&queueMicrotask(()=>{Gq("loadstart",t)}),u=!1,!d&&Vms.isUint8Array(f))c.push(f),(t[OXt]===void 0||Date.now()-t[OXt]>=50)&&!t[mRe]&&(t[OXt]=Date.now(),queueMicrotask(()=>{Gq("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[Sde]="done";try{let h=Yms(c,r,e.type,n);if(t[mRe])return;t[sOn]=h,Gq("load",t)}catch(h){t[MXt]=h,Gq("error",t)}t[Sde]!=="loading"&&Gq("loadend",t)});break}}catch(d){if(t[mRe])return;queueMicrotask(()=>{t[Sde]="done",t[MXt]=d,Gq("error",t),t[Sde]!=="loading"&&Gq("loadend",t)});break}})()}a(zms,"readOperation");function Gq(t,e){let r=new Gms(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Gq,"fireAProgressEvent");function Yms(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=cOn(r||"application/octet-stream");s!=="failure"&&(o+=$ms(s)),o+=";base64,";let c=new lOn("latin1");for(let l of t)o+=uOn(c.write(l));return o+=uOn(c.end()),o}case"Text":{let o="failure";if(n&&(o=aOn(n)),o==="failure"&&r){let s=cOn(r);s!=="failure"&&(o=aOn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),Kms(t,o)}case"ArrayBuffer":return dOn(t).buffer;case"BinaryString":{let o="",s=new lOn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(Yms,"packageData");function Kms(t,e){let r=dOn(t),n=Jms(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(Kms,"decode");function Jms(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(Jms,"BOMSniffing");function dOn(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(dOn,"combineByteSequences");fOn.exports={staticPropertyDescriptors:Wms,readOperation:zms,fireAProgressEvent:Gq}});var AOn=I((LYd,gOn)=>{"use strict";p();var{staticPropertyDescriptors:Tde,readOperation:Wrt,fireAProgressEvent:hOn}=pOn(),{kState:vJ,kError:mOn,kResult:zrt,kEvents:Ic,kAborted:Zms}=DXt(),{webidl:bl}=bA(),{kEnumerableProperty:Wv}=Ls(),GP=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[vJ]="empty",this[zrt]=null,this[mOn]=null,this[Ic]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=bl.converters.Blob(e,{strict:!1}),Wrt(this,e,"ArrayBuffer")}readAsBinaryString(e){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=bl.converters.Blob(e,{strict:!1}),Wrt(this,e,"BinaryString")}readAsText(e,r=void 0){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=bl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=bl.converters.DOMString(r,"FileReader.readAsText","encoding")),Wrt(this,e,"Text",r)}readAsDataURL(e){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=bl.converters.Blob(e,{strict:!1}),Wrt(this,e,"DataURL")}abort(){if(this[vJ]==="empty"||this[vJ]==="done"){this[zrt]=null;return}this[vJ]==="loading"&&(this[vJ]="done",this[zrt]=null),this[Zms]=!0,hOn("abort",this),this[vJ]!=="loading"&&hOn("loadend",this)}get readyState(){switch(bl.brandCheck(this,t),this[vJ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return bl.brandCheck(this,t),this[zrt]}get error(){return bl.brandCheck(this,t),this[mOn]}get onloadend(){return bl.brandCheck(this,t),this[Ic].loadend}set onloadend(e){bl.brandCheck(this,t),this[Ic].loadend&&this.removeEventListener("loadend",this[Ic].loadend),typeof e=="function"?(this[Ic].loadend=e,this.addEventListener("loadend",e)):this[Ic].loadend=null}get onerror(){return bl.brandCheck(this,t),this[Ic].error}set onerror(e){bl.brandCheck(this,t),this[Ic].error&&this.removeEventListener("error",this[Ic].error),typeof e=="function"?(this[Ic].error=e,this.addEventListener("error",e)):this[Ic].error=null}get onloadstart(){return bl.brandCheck(this,t),this[Ic].loadstart}set onloadstart(e){bl.brandCheck(this,t),this[Ic].loadstart&&this.removeEventListener("loadstart",this[Ic].loadstart),typeof e=="function"?(this[Ic].loadstart=e,this.addEventListener("loadstart",e)):this[Ic].loadstart=null}get onprogress(){return bl.brandCheck(this,t),this[Ic].progress}set onprogress(e){bl.brandCheck(this,t),this[Ic].progress&&this.removeEventListener("progress",this[Ic].progress),typeof e=="function"?(this[Ic].progress=e,this.addEventListener("progress",e)):this[Ic].progress=null}get onload(){return bl.brandCheck(this,t),this[Ic].load}set onload(e){bl.brandCheck(this,t),this[Ic].load&&this.removeEventListener("load",this[Ic].load),typeof e=="function"?(this[Ic].load=e,this.addEventListener("load",e)):this[Ic].load=null}get onabort(){return bl.brandCheck(this,t),this[Ic].abort}set onabort(e){bl.brandCheck(this,t),this[Ic].abort&&this.removeEventListener("abort",this[Ic].abort),typeof e=="function"?(this[Ic].abort=e,this.addEventListener("abort",e)):this[Ic].abort=null}};GP.EMPTY=GP.prototype.EMPTY=0;GP.LOADING=GP.prototype.LOADING=1;GP.DONE=GP.prototype.DONE=2;Object.defineProperties(GP.prototype,{EMPTY:Tde,LOADING:Tde,DONE:Tde,readAsArrayBuffer:Wv,readAsBinaryString:Wv,readAsText:Wv,readAsDataURL:Wv,abort:Wv,readyState:Wv,result:Wv,error:Wv,onloadstart:Wv,onprogress:Wv,onload:Wv,onabort:Wv,onerror:Wv,onloadend:Wv,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(GP,{EMPTY:Tde,LOADING:Tde,DONE:Tde});gOn.exports={FileReader:GP}});var Yrt=I((QYd,yOn)=>{"use strict";p();yOn.exports={kConstruct:Od().kConstruct}});var COn=I((jYd,_On)=>{"use strict";p();var Xms=require("node:assert"),{URLSerializer:EOn}=Gv(),{isValidHeaderName:egs}=$S();function tgs(t,e,r=!1){let n=EOn(t,r),o=EOn(e,r);return n===o}a(tgs,"urlEquals");function rgs(t){Xms(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),egs(r)&&e.push(r);return e}a(rgs,"getFieldValues");_On.exports={urlEquals:tgs,getFieldValues:rgs}});var SOn=I(($Yd,bOn)=>{"use strict";p();var{kConstruct:ngs}=Yrt(),{urlEquals:igs,getFieldValues:BXt}=COn(),{kEnumerableProperty:bJ,isDisturbed:ogs}=Ls(),{webidl:Ei}=bA(),{Response:sgs,cloneResponse:ags,fromInnerResponse:cgs}=fRe(),{Request:nF,fromInnerRequest:lgs}=bde(),{kState:$P}=kq(),{fetching:ugs}=hRe(),{urlIsHttpHttpsScheme:Krt,createDeferredPromise:Ide,readAllBytes:dgs}=$S(),LXt=require("node:assert"),Jrt=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==ngs&&Ei.illegalConstructor(),Ei.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Ei.brandCheck(this,t);let n="Cache.match";Ei.argumentLengthCheck(arguments,1,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.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={}){Ei.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Ei.converters.RequestInfo(e,n,"request")),r=Ei.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Ei.brandCheck(this,t);let r="Cache.add";Ei.argumentLengthCheck(arguments,1,r),e=Ei.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){Ei.brandCheck(this,t);let r="Cache.addAll";Ei.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Ei.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Ei.converters.RequestInfo(m),typeof m=="string")continue;let g=m[$P];if(!Krt(g.url)||g.method!=="GET")throw Ei.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new nF(m)[$P];if(!Krt(g.url))throw Ei.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Ide();s.push(ugs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Ei.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=BXt(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Ei.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=Ide(),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){Ei.brandCheck(this,t);let n="Cache.put";Ei.argumentLengthCheck(arguments,2,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.Response(r,n,"response");let o=null;if(e instanceof nF?o=e[$P]:o=new nF(e)[$P],!Krt(o.url)||o.method!=="GET")throw Ei.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[$P];if(s.status===206)throw Ei.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=BXt(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Ei.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(ogs(s.body.stream)||s.body.stream.locked))throw Ei.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=ags(s),l=Ide();if(s.body!=null){let A=s.body.stream.getReader();dgs(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=Ide(),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={}){Ei.brandCheck(this,t);let n="Cache.delete";Ei.argumentLengthCheck(arguments,1,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof nF){if(o=e[$P],o.method!=="GET"&&!r.ignoreMethod)return!1}else LXt(typeof e=="string"),o=new nF(e)[$P];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Ide(),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={}){Ei.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Ei.converters.RequestInfo(e,n,"request")),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof nF){if(o=e[$P],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new nF(e)[$P]);let s=Ide(),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=lgs(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 Ei.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Ei.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);LXt(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Krt(u.url))throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Ei.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);LXt(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=""),!igs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=BXt(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 nF){if(o=e[$P],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new nF(e)[$P]);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=cgs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(Jrt.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:bJ,matchAll:bJ,add:bJ,addAll:bJ,put:bJ,delete:bJ,keys:bJ});var vOn=[{key:"ignoreSearch",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Ei.converters.CacheQueryOptions=Ei.dictionaryConverter(vOn);Ei.converters.MultiCacheQueryOptions=Ei.dictionaryConverter([...vOn,{key:"cacheName",converter:Ei.converters.DOMString}]);Ei.converters.Response=Ei.interfaceConverter(sgs);Ei.converters["sequence"]=Ei.sequenceConverter(Ei.converters.RequestInfo);bOn.exports={Cache:Jrt}});var IOn=I((zYd,TOn)=>{"use strict";p();var{kConstruct:gRe}=Yrt(),{Cache:Zrt}=SOn(),{webidl:iE}=bA(),{kEnumerableProperty:ARe}=Ls(),Xrt=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==gRe&&iE.illegalConstructor(),iE.util.markAsUncloneable(this)}async match(e,r={}){if(iE.brandCheck(this,t),iE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=iE.converters.RequestInfo(e),r=iE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Zrt(gRe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Zrt(gRe,n).match(e,r);if(s!==void 0)return s}}async has(e){iE.brandCheck(this,t);let r="CacheStorage.has";return iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){iE.brandCheck(this,t);let r="CacheStorage.open";if(iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Zrt(gRe,o)}let n=[];return this.#e.set(e,n),new Zrt(gRe,n)}async delete(e){iE.brandCheck(this,t);let r="CacheStorage.delete";return iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return iE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Xrt.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:ARe,has:ARe,open:ARe,delete:ARe,keys:ARe});TOn.exports={CacheStorage:Xrt}});var wOn=I((JYd,xOn)=>{"use strict";p();xOn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var FXt=I((XYd,NOn)=>{"use strict";p();function fgs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(fgs,"isCTLExcludingHtab");function ROn(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(ROn,"validateCookieName");function kOn(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(kOn,"validateCookieValue");function POn(t){for(let e=0;ee.toString().padStart(2,"0"));function DOn(t){return typeof t=="number"&&(t=new Date(t)),`${hgs[t.getUTCDay()]}, ${ent[t.getUTCDate()]} ${mgs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${ent[t.getUTCHours()]}:${ent[t.getUTCMinutes()]}:${ent[t.getUTCSeconds()]} GMT`}a(DOn,"toIMFDate");function ggs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(ggs,"validateCookieMaxAge");function Ags(t){if(t.name.length===0)return null;ROn(t.name),kOn(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"&&(ggs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(pgs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(POn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${DOn(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(Ags,"stringify");NOn.exports={isCTLExcludingHtab:fgs,validateCookieName:ROn,validateCookiePath:POn,validateCookieValue:kOn,toIMFDate:DOn,stringify:Ags}});var OOn=I((rKd,MOn)=>{"use strict";p();var{maxNameValuePairSize:ygs,maxAttributeValueSize:Egs}=wOn(),{isCTLExcludingHtab:_gs}=FXt(),{collectASequenceOfCodePointsFast:tnt}=Gv(),Cgs=require("node:assert");function vgs(t){if(_gs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=tnt(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=tnt("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>ygs?null:{name:n,value:o,...xde(r)}}a(vgs,"parseSetCookie");function xde(t,e={}){if(t.length===0)return e;Cgs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=tnt(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=tnt("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>Egs)return xde(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 xde(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 xde(t,e)}a(xde,"parseUnparsedAttributes");MOn.exports={parseSetCookie:vgs,parseUnparsedAttributes:xde}});var FOn=I((oKd,LOn)=>{"use strict";p();var{parseSetCookie:bgs}=OOn(),{stringify:Sgs}=FXt(),{webidl:da}=bA(),{Headers:rnt}=yJ();function Tgs(t){da.argumentLengthCheck(arguments,1,"getCookies"),da.brandCheck(t,rnt,{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(Tgs,"getCookies");function Igs(t,e,r){da.brandCheck(t,rnt,{strict:!1});let n="deleteCookie";da.argumentLengthCheck(arguments,2,n),e=da.converters.DOMString(e,n,"name"),r=da.converters.DeleteCookieAttributes(r),BOn(t,{name:e,value:"",expires:new Date(0),...r})}a(Igs,"deleteCookie");function xgs(t){da.argumentLengthCheck(arguments,1,"getSetCookies"),da.brandCheck(t,rnt,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>bgs(r)):[]}a(xgs,"getSetCookies");function BOn(t,e){da.argumentLengthCheck(arguments,2,"setCookie"),da.brandCheck(t,rnt,{strict:!1}),e=da.converters.Cookie(e);let r=Sgs(e);r&&t.append("Set-Cookie",r)}a(BOn,"setCookie");da.converters.DeleteCookieAttributes=da.dictionaryConverter([{converter:da.nullableConverter(da.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);da.converters.Cookie=da.dictionaryConverter([{converter:da.converters.DOMString,key:"name"},{converter:da.converters.DOMString,key:"value"},{converter:da.nullableConverter(t=>typeof t=="number"?da.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:da.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:da.sequenceConverter(da.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);LOn.exports={getCookies:Tgs,deleteCookie:Igs,getSetCookies:xgs,setCookie:BOn}});var Rde=I((cKd,QOn)=>{"use strict";p();var{webidl:fi}=bA(),{kEnumerableProperty:zv}=Ls(),{kConstruct:UOn}=Od(),{MessagePort:wgs}=require("node:worker_threads"),wde=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===UOn){super(arguments[1],arguments[2]),fi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get data(){return fi.brandCheck(this,t),this.#e.data}get origin(){return fi.brandCheck(this,t),this.#e.origin}get lastEventId(){return fi.brandCheck(this,t),this.#e.lastEventId}get source(){return fi.brandCheck(this,t),this.#e.source}get ports(){return fi.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 fi.brandCheck(this,t),fi.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(UOn,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:Rgs}=wde;delete wde.createFastMessageEvent;var nnt=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.CloseEventInit(r),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get wasClean(){return fi.brandCheck(this,t),this.#e.wasClean}get code(){return fi.brandCheck(this,t),this.#e.code}get reason(){return fi.brandCheck(this,t),this.#e.reason}},int=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";fi.argumentLengthCheck(arguments,1,n),super(e,r),fi.util.markAsUncloneable(this),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return fi.brandCheck(this,t),this.#e.message}get filename(){return fi.brandCheck(this,t),this.#e.filename}get lineno(){return fi.brandCheck(this,t),this.#e.lineno}get colno(){return fi.brandCheck(this,t),this.#e.colno}get error(){return fi.brandCheck(this,t),this.#e.error}};Object.defineProperties(wde.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:zv,origin:zv,lastEventId:zv,source:zv,ports:zv,initMessageEvent:zv});Object.defineProperties(nnt.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:zv,code:zv,wasClean:zv});Object.defineProperties(int.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:zv,filename:zv,lineno:zv,colno:zv,error:zv});fi.converters.MessagePort=fi.interfaceConverter(wgs);fi.converters["sequence"]=fi.sequenceConverter(fi.converters.MessagePort);var UXt=[{key:"bubbles",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];fi.converters.MessageEventInit=fi.dictionaryConverter([...UXt,{key:"data",converter:fi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:fi.nullableConverter(fi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:fi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);fi.converters.CloseEventInit=fi.dictionaryConverter([...UXt,{key:"wasClean",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:fi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);fi.converters.ErrorEventInit=fi.dictionaryConverter([...UXt,{key:"message",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:fi.converters.any}]);QOn.exports={MessageEvent:wde,CloseEvent:nnt,ErrorEvent:int,createFastMessageEvent:Rgs}});var SJ=I((dKd,qOn)=>{"use strict";p();var kgs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",Pgs={enumerable:!0,writable:!1,configurable:!1},Dgs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Ngs={NOT_SENT:0,PROCESSING:1,SENT:2},Mgs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},Ogs=2**16-1,Bgs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},Lgs=Buffer.allocUnsafe(0),Fgs={string:1,typedArray:2,arrayBuffer:3,blob:4};qOn.exports={uid:kgs,sentCloseFrameState:Ngs,staticPropertyDescriptors:Pgs,states:Dgs,opcodes:Mgs,maxUnsigned16Bit:Ogs,parserStates:Bgs,emptyBuffer:Lgs,sendHints:Fgs}});var yRe=I((pKd,jOn)=>{"use strict";p();jOn.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 CRe=I((mKd,JOn)=>{"use strict";p();var{kReadyState:ERe,kController:Ugs,kResponse:Qgs,kBinaryType:qgs,kWebSocketURL:jgs}=yRe(),{states:_Re,opcodes:$q}=SJ(),{ErrorEvent:Hgs,createFastMessageEvent:Ggs}=Rde(),{isUtf8:$gs}=require("node:buffer"),{collectASequenceOfCodePointsFast:Vgs,removeHTTPWhitespace:HOn}=Gv();function Wgs(t){return t[ERe]===_Re.CONNECTING}a(Wgs,"isConnecting");function zgs(t){return t[ERe]===_Re.OPEN}a(zgs,"isEstablished");function Ygs(t){return t[ERe]===_Re.CLOSING}a(Ygs,"isClosing");function Kgs(t){return t[ERe]===_Re.CLOSED}a(Kgs,"isClosed");function QXt(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(QXt,"fireEvent");function Jgs(t,e,r){if(t[ERe]!==_Re.OPEN)return;let n;if(e===$q.TEXT)try{n=KOn(r)}catch{$On(t,"Received invalid UTF-8 in text frame.");return}else e===$q.BINARY&&(t[qgs]==="blob"?n=new Blob([r]):n=Zgs(r));QXt("message",t,Ggs,{origin:t[jgs].origin,data:n})}a(Jgs,"websocketMessageReceived");function Zgs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(Zgs,"toArrayBuffer");function Xgs(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(Xgs,"isValidSubprotocol");function eAs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(eAs,"isValidStatusCode");function $On(t,e){let{[Ugs]:r,[Qgs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&QXt("error",t,(o,s)=>new Hgs(o,s),{error:new Error(e),message:e})}a($On,"failWebsocketConnection");function VOn(t){return t===$q.CLOSE||t===$q.PING||t===$q.PONG}a(VOn,"isControlFrame");function WOn(t){return t===$q.CONTINUATION}a(WOn,"isContinuationFrame");function zOn(t){return t===$q.TEXT||t===$q.BINARY}a(zOn,"isTextBinaryFrame");function tAs(t){return zOn(t)||WOn(t)||VOn(t)}a(tAs,"isValidOpcode");function rAs(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(nAs,"isValidClientWindowBits");var YOn=typeof process.versions.icu=="string",GOn=YOn?new TextDecoder("utf-8",{fatal:!0}):void 0,KOn=YOn?GOn.decode.bind(GOn):function(t){if($gs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};JOn.exports={isConnecting:Wgs,isEstablished:zgs,isClosing:Ygs,isClosed:Kgs,fireEvent:QXt,isValidSubprotocol:Xgs,isValidStatusCode:eAs,failWebsocketConnection:$On,websocketMessageReceived:Jgs,utf8Decode:KOn,isControlFrame:VOn,isContinuationFrame:WOn,isTextBinaryFrame:zOn,isValidOpcode:tAs,parseExtensions:rAs,isValidClientWindowBits:nAs}});var snt=I((yKd,ZOn)=>{"use strict";p();var{maxUnsigned16Bit:iAs}=SJ(),ont=16386,qXt,vRe=null,kde=ont;try{qXt=require("node:crypto")}catch{qXt={randomFillSync:a(function(e,r,n){for(let o=0;oiAs?(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:sAs,states:bRe,sentCloseFrameState:ant,emptyBuffer:aAs,opcodes:cAs}=SJ(),{kReadyState:SRe,kSentClose:cnt,kByteParser:e5n,kReceivedClose:XOn,kResponse:t5n}=yRe(),{fireEvent:lAs,failWebsocketConnection:Vq,isClosing:uAs,isClosed:dAs,isEstablished:fAs,parseExtensions:pAs}=CRe(),{channels:Pde}=jue(),{CloseEvent:hAs}=Rde(),{makeRequest:mAs}=bde(),{fetching:gAs}=hRe(),{Headers:AAs,getHeadersList:yAs}=yJ(),{getDecodeSplit:EAs}=$S(),{WebsocketFrameSend:_As}=snt(),HXt;try{HXt=require("node:crypto")}catch{}function CAs(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=mAs({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=yAs(new AAs(s.headers));l.headersList=h}let u=HXt.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"),gAs({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){Vq(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){Vq(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Vq(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Vq(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=HXt.createHash("sha1").update(u+sAs).digest("base64");if(m!==g){Vq(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=pAs(A),!y.has("permessage-deflate"))){Vq(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!EAs("sec-websocket-protocol",l.headersList).includes(E)){Vq(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",r5n),h.socket.on("close",n5n),h.socket.on("error",i5n),Pde.open.hasSubscribers&&Pde.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(CAs,"establishWebSocketConnection");function vAs(t,e,r,n){if(!(uAs(t)||dAs(t)))if(!fAs(t))Vq(t,"Connection was closed before it was established."),t[SRe]=bRe.CLOSING;else if(t[cnt]===ant.NOT_SENT){t[cnt]=ant.PROCESSING;let o=new _As;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=aAs,t[t5n].socket.write(o.createFrame(cAs.CLOSE)),t[cnt]=ant.SENT,t[SRe]=bRe.CLOSING}else t[SRe]=bRe.CLOSING}a(vAs,"closeWebSocketConnection");function r5n(t){this.ws[e5n].write(t)||this.pause()}a(r5n,"onSocketData");function n5n(){let{ws:t}=this,{[t5n]:e}=t;e.socket.off("data",r5n),e.socket.off("close",n5n),e.socket.off("error",i5n);let r=t[cnt]===ant.SENT&&t[XOn],n=1005,o="",s=t[e5n].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[XOn]||(n=1006),t[SRe]=bRe.CLOSED,lAs("close",t,(c,l)=>new hAs(c,l),{wasClean:r,code:n,reason:o}),Pde.close.hasSubscribers&&Pde.close.publish({websocket:t,code:n,reason:o})}a(n5n,"onSocketClose");function i5n(t){let{ws:e}=this;e[SRe]=bRe.CLOSING,Pde.socketError.hasSubscribers&&Pde.socketError.publish(t),this.destroy()}a(i5n,"onSocketError");o5n.exports={establishWebSocketConnection:CAs,closeWebSocketConnection:vAs}});var c5n=I((SKd,a5n)=>{"use strict";p();var{createInflateRaw:bAs,Z_DEFAULT_WINDOWBITS:SAs}=require("node:zlib"),{isValidClientWindowBits:TAs}=CRe(),{MessageSizeExceededError:s5n}=mc(),IAs=Buffer.from([0,0,255,255]),lnt=Symbol("kBuffer"),TRe=Symbol("kLength"),xAs=4*1024*1024,$Xt=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 s5n);return}if(!this.#e){let o=SAs;if(this.#t.serverMaxWindowBits){if(!TAs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=bAs({windowBits:o})}catch(s){n(s);return}this.#e[lnt]=[],this.#e[TRe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[TRe]+=s.length,this.#e[TRe]>xAs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new s5n)}return}this.#e[lnt].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(IAs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[lnt],this.#e[TRe]);this.#e[lnt].length=0,this.#e[TRe]=0,this.#n=null,n(null,o)})}};a5n.exports={PerMessageDeflate:$Xt}});var y5n=I((xKd,A5n)=>{"use strict";p();var{Writable:wAs}=require("node:stream"),RAs=require("node:assert"),{parserStates:Yv,opcodes:Dde,states:kAs,emptyBuffer:l5n,sentCloseFrameState:u5n}=SJ(),{kReadyState:PAs,kSentClose:d5n,kResponse:f5n,kReceivedClose:p5n}=yRe(),{channels:unt}=jue(),{isValidStatusCode:DAs,isValidOpcode:NAs,failWebsocketConnection:ZS,websocketMessageReceived:h5n,utf8Decode:MAs,isControlFrame:m5n,isTextBinaryFrame:VXt,isContinuationFrame:OAs}=CRe(),{WebsocketFrameSend:g5n}=snt(),{closeWebSocketConnection:BAs}=GXt(),{PerMessageDeflate:LAs}=c5n(),WXt=class extends wAs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=Yv.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 LAs(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===Yv.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!==Dde.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!NAs(o))return ZS(this.ws,"Invalid opcode received"),e();if(s)return ZS(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){ZS(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){ZS(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!VXt(o)){ZS(this.ws,"Invalid frame type was fragmented.");return}if(VXt(o)&&this.#o.length>0){ZS(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){ZS(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&m5n(o)){ZS(this.ws,"Control frame either too large or fragmented");return}if(OAs(o)&&this.#o.length===0&&!this.#i.compressed){ZS(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=Yv.READ_DATA):l===126?this.#n=Yv.PAYLOADLENGTH_16:l===127&&(this.#n=Yv.PAYLOADLENGTH_64),VXt(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===Yv.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=Yv.READ_DATA}else if(this.#n===Yv.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){ZS(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=Yv.READ_DATA}else if(this.#n===Yv.READ_DATA){if(this.#t{if(n){ZS(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=Yv.INFO,this.#r=!0,this.run(e);return}h5n(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=Yv.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);h5n(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=Yv.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return l5n;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){RAs(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!DAs(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=MAs(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===Dde.CLOSE){if(n===1)return ZS(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 BAs(this.ws,o,s,s.length),ZS(this.ws,s),!1}if(this.ws[d5n]!==u5n.SENT){let o=l5n;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new g5n(o);this.ws[f5n].socket.write(s.createFrame(Dde.CLOSE),c=>{c||(this.ws[d5n]=u5n.SENT)})}return this.ws[PAs]=kAs.CLOSING,this.ws[p5n]=!0,!1}else if(r===Dde.PING){if(!this.ws[p5n]){let o=new g5n(e);this.ws[f5n].socket.write(o.createFrame(Dde.PONG)),unt.ping.hasSubscribers&&unt.ping.publish({payload:e})}}else r===Dde.PONG&&unt.pong.hasSubscribers&&unt.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};A5n.exports={ByteParser:WXt}});var b5n=I((kKd,v5n)=>{"use strict";p();var{WebsocketFrameSend:FAs}=snt(),{opcodes:E5n,sendHints:Nde}=SJ(),UAs=nZt(),_5n=Buffer[Symbol.species],zXt=class{static{a(this,"SendQueue")}#e=new UAs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Nde.blob){let s=C5n(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=C5n(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 C5n(t,e){return new FAs(QAs(t,e)).createFrame(e===Nde.string?E5n.TEXT:E5n.BINARY)}a(C5n,"createFrame");function QAs(t,e){switch(e){case Nde.string:return Buffer.from(t);case Nde.arrayBuffer:case Nde.blob:return new _5n(t);case Nde.typedArray:return new _5n(t.buffer,t.byteOffset,t.byteLength)}}a(QAs,"toBuffer");v5n.exports={SendQueue:zXt}});var D5n=I((NKd,P5n)=>{"use strict";p();var{webidl:so}=bA(),{URLSerializer:qAs}=Gv(),{environmentSettingsObject:S5n}=$S(),{staticPropertyDescriptors:Wq,states:IRe,sentCloseFrameState:jAs,sendHints:dnt}=SJ(),{kWebSocketURL:T5n,kReadyState:YXt,kController:HAs,kBinaryType:fnt,kResponse:I5n,kSentClose:GAs,kByteParser:$As}=yRe(),{isConnecting:VAs,isEstablished:WAs,isClosing:zAs,isValidSubprotocol:YAs,fireEvent:x5n}=CRe(),{establishWebSocketConnection:KAs,closeWebSocketConnection:w5n}=GXt(),{ByteParser:JAs}=y5n(),{kEnumerableProperty:ow,isBlobLike:R5n}=Ls(),{getGlobalDispatcher:ZAs}=xrt(),{types:k5n}=require("node:util"),{ErrorEvent:XAs,CloseEvent:eys}=Rde(),{SendQueue:tys}=b5n(),XS=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=S5n.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=>YAs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[T5n]=new URL(c.href);let l=S5n.settingsObject;this[HAs]=KAs(c,r,l,this,(u,d)=>this.#o(u,d),o),this[YXt]=t.CONNECTING,this[GAs]=jAs.NOT_SENT,this[fnt]="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");w5n(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"),VAs(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!WAs(this)||zAs(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},dnt.string)}else k5n.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},dnt.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},dnt.typedArray)):R5n(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},dnt.blob))}get readyState(){return so.brandCheck(this,t),this[YXt]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),qAs(this[T5n])}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[fnt]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[fnt]="blob":this[fnt]=e}#o(e,r){this[I5n]=e;let n=new JAs(this,r);n.on("drain",rys),n.on("error",nys.bind(this)),e.socket.ws=this,this[$As]=n,this.#i=new tys(e.socket),this[YXt]=IRe.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),x5n("open",this)}};XS.CONNECTING=XS.prototype.CONNECTING=IRe.CONNECTING;XS.OPEN=XS.prototype.OPEN=IRe.OPEN;XS.CLOSING=XS.prototype.CLOSING=IRe.CLOSING;XS.CLOSED=XS.prototype.CLOSED=IRe.CLOSED;Object.defineProperties(XS.prototype,{CONNECTING:Wq,OPEN:Wq,CLOSING:Wq,CLOSED:Wq,url:ow,readyState:ow,bufferedAmount:ow,onopen:ow,onerror:ow,onclose:ow,close:ow,onmessage:ow,binaryType:ow,send:ow,extensions:ow,protocol:ow,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(XS,{CONNECTING:Wq,OPEN:Wq,CLOSING:Wq,CLOSED:Wq});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(()=>ZAs(),"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(R5n(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||k5n.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function rys(){this.ws[I5n].socket.resume()}a(rys,"onParserDrain");function nys(t){let e,r;t instanceof eys?(e=t.reason,r=t.code):e=t.message,x5n("error",this,()=>new XAs("error",{error:t,message:e})),w5n(this,r)}a(nys,"onParserError");P5n.exports={WebSocket:XS}});var KXt=I((BKd,N5n)=>{"use strict";p();function iys(t){return t.indexOf("\0")===-1}a(iys,"isValidLastEventId");function oys(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(oys,"isASCIINumber");function sys(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(sys,"delay");N5n.exports={isValidLastEventId:iys,isASCIINumber:oys,delay:sys}});var L5n=I((UKd,B5n)=>{"use strict";p();var{Transform:ays}=require("node:stream"),{isASCIINumber:M5n,isValidLastEventId:O5n}=KXt(),iF=[239,187,191],JXt=10,pnt=13,cys=58,lys=32,ZXt=class extends ays{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]===iF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===iF[0]&&this.buffer[1]===iF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===iF[0]&&this.buffer[1]===iF[1]&&this.buffer[2]===iF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===iF[0]&&this.buffer[1]===iF[1]&&this.buffer[2]===iF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&M5n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&O5n(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}}};B5n.exports={EventSourceStream:ZXt}});var $5n=I((jKd,G5n)=>{"use strict";p();var{pipeline:uys}=require("node:stream"),{fetching:dys}=hRe(),{makeRequest:fys}=bde(),{webidl:oF}=bA(),{EventSourceStream:pys}=L5n(),{parseMIMEType:hys}=Gv(),{createFastMessageEvent:mys}=Rde(),{isNetworkError:F5n}=fRe(),{delay:gys}=KXt(),{kEnumerableProperty:TJ}=Ls(),{environmentSettingsObject:U5n}=$S(),Q5n=!1,q5n=3e3,xRe=0,j5n=1,wRe=2,Ays="anonymous",yys="use-credentials",Mde=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=xRe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),oF.util.markAsUncloneable(this);let n="EventSource constructor";oF.argumentLengthCheck(arguments,1,n),Q5n||(Q5n=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=oF.converters.USVString(e,n,"url"),r=oF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:q5n};let o=U5n,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=Ays;r.withCredentials&&(c=yys,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=U5n.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=fys(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===wRe)return;this.#n=xRe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{F5n(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(F5n(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?hys(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=j5n,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new pys({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(mys(u.type,u.options))},"push")});uys(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=dys(e)}async#u(){this.#n!==wRe&&(this.#n=xRe,this.dispatchEvent(new Event("error")),await gys(this.#a.reconnectionTime),this.#n===xRe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){oF.brandCheck(this,t),this.#n!==wRe&&(this.#n=wRe,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}},H5n={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:xRe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:j5n,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:wRe,writable:!1}};Object.defineProperties(Mde,H5n);Object.defineProperties(Mde.prototype,H5n);Object.defineProperties(Mde.prototype,{close:TJ,onerror:TJ,onmessage:TJ,onopen:TJ,readyState:TJ,url:TJ,withCredentials:TJ});oF.converters.EventSourceInitDict=oF.dictionaryConverter([{key:"withCredentials",converter:oF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:oF.converters.any}]);G5n.exports={EventSource:Mde,defaultReconnectionTime:q5n}});var Y5n=I(($Kd,Ki)=>{"use strict";p();var Eys=cde(),V5n=Dwe(),_ys=lde(),Cys=H2n(),vys=ude(),bys=bZt(),Sys=pDn(),Tys=EDn(),W5n=mc(),mnt=Ls(),{InvalidArgumentError:hnt}=W5n,Ode=oNn(),Iys=Mwe(),xys=iXt(),wys=qNn(),Rys=aXt(),kys=$Zt(),Pys=Art(),{getGlobalDispatcher:z5n,setGlobalDispatcher:Dys}=xrt(),Nys=wrt(),Mys=srt(),Oys=art();Object.assign(V5n.prototype,Ode);Ki.exports.Dispatcher=V5n;Ki.exports.Client=Eys;Ki.exports.Pool=_ys;Ki.exports.BalancedPool=Cys;Ki.exports.Agent=vys;Ki.exports.ProxyAgent=bys;Ki.exports.EnvHttpProxyAgent=Sys;Ki.exports.RetryAgent=Tys;Ki.exports.RetryHandler=Pys;Ki.exports.DecoratorHandler=Nys;Ki.exports.RedirectHandler=Mys;Ki.exports.createRedirectInterceptor=Oys;Ki.exports.interceptors={redirect:zNn(),retry:KNn(),dump:ZNn(),dns:tMn()};Ki.exports.buildConnector=Iys;Ki.exports.errors=W5n;Ki.exports.util={parseHeaders:mnt.parseHeaders,headerNameToString:mnt.headerNameToString};function RRe(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 hnt("invalid url");if(r!=null&&typeof r!="object")throw new hnt("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new hnt("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(mnt.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=mnt.parseURL(e);let{agent:o,dispatcher:s=z5n()}=r;if(o)throw new hnt("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(RRe,"makeDispatcher");Ki.exports.setGlobalDispatcher=Dys;Ki.exports.getGlobalDispatcher=z5n;var Bys=hRe().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await Bys(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=yJ().Headers;Ki.exports.Response=fRe().Response;Ki.exports.Request=bde().Request;Ki.exports.FormData=qwe().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=AOn().FileReader;var{setGlobalOrigin:Lys,getGlobalOrigin:Fys}=SJt();Ki.exports.setGlobalOrigin=Lys;Ki.exports.getGlobalOrigin=Fys;var{CacheStorage:Uys}=IOn(),{kConstruct:Qys}=Yrt();Ki.exports.caches=new Uys(Qys);var{deleteCookie:qys,getCookies:jys,getSetCookies:Hys,setCookie:Gys}=FOn();Ki.exports.deleteCookie=qys;Ki.exports.getCookies=jys;Ki.exports.getSetCookies=Hys;Ki.exports.setCookie=Gys;var{parseMIMEType:$ys,serializeAMimeType:Vys}=Gv();Ki.exports.parseMIMEType=$ys;Ki.exports.serializeAMimeType=Vys;var{CloseEvent:Wys,ErrorEvent:zys,MessageEvent:Yys}=Rde();Ki.exports.WebSocket=D5n().WebSocket;Ki.exports.CloseEvent=Wys;Ki.exports.ErrorEvent=zys;Ki.exports.MessageEvent=Yys;Ki.exports.request=RRe(Ode.request);Ki.exports.stream=RRe(Ode.stream);Ki.exports.pipeline=RRe(Ode.pipeline);Ki.exports.connect=RRe(Ode.connect);Ki.exports.upgrade=RRe(Ode.upgrade);Ki.exports.MockClient=xys;Ki.exports.MockPool=Rys;Ki.exports.MockAgent=wys;Ki.exports.mockErrors=kys;var{EventSource:Kys}=$5n();Ki.exports.EventSource=Kys});var ds=I((zKd,K5n)=>{p();K5n.exports={options:{usePureJavaScript:!1}}});var X5n=I((KKd,Z5n)=>{p();var XXt={};Z5n.exports=XXt;var J5n={};XXt.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=Jys(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};XXt.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=J5n[e];if(!r){r=J5n[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(Jys,"_encodeWithByteBuffer")});var ic=I((XKd,n4n)=>{p();var e4n=ds(),t4n=X5n(),We=n4n.exports=e4n.util=e4n.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){We.nextTick=process.nextTick,typeof setImmediate=="function"?We.setImmediate=setImmediate:We.setImmediate=We.nextTick;return}if(typeof setImmediate=="function"){We.setImmediate=function(){return setImmediate.apply(void 0,arguments)},We.nextTick=function(l){return setImmediate(l)};return}if(We.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=[];We.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=We.setImmediate;We.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}We.nextTick=We.setImmediate})();We.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;We.globalScope=(function(){return We.isNodejs?global:typeof self>"u"?window:self})();We.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};We.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};We.isArrayBufferView=function(t){return t&&We.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function kRe(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(kRe,"_checkBitsParam");We.ByteBuffer=eer;function eer(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(We.isArrayBuffer(t)||We.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;rZys&&(this.data.substr(0,1),this._constructedStringLength=0)};We.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};We.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};We.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};We.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};We.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};We.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(We.encodeUtf8(t))};We.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};We.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};We.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))};We.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};We.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};We.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))};We.ByteStringBuffer.prototype.putInt=function(t,e){kRe(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};We.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};We.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};We.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};We.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};We.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};We.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};We.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};We.ByteStringBuffer.prototype.copy=function(){var t=We.createBuffer(this.data);return t.read=this.read,t};We.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};We.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};We.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};We.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};We.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};We.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};We.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};We.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};We.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};We.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};We.DataBuffer.prototype.putInt=function(t,e){kRe(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};We.DataBuffer.prototype.putSignedInt=function(t,e){return kRe(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};We.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};We.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};We.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};We.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};We.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};We.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};We.DataBuffer.prototype.copy=function(){return new We.DataBuffer(this)};We.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};We.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};We.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};We.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};We.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};We.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 zq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Yq=[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],r4n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";We.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=zq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=zq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":zq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};We.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};We.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};We.decodeUtf8=function(t){return decodeURIComponent(escape(t))};We.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:t4n.encode,decode:t4n.decode}};We.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};We.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+=zq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=zq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":zq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};We.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)};We.binary.base58.encode=function(t,e){return We.binary.baseN.encode(t,r4n,e)};We.binary.base58.decode=function(t,e){return We.binary.baseN.decode(t,r4n,e)};We.text={utf8:{},utf16:{}};We.text.utf8.encode=function(t,e,r){t=We.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");We.setItem=function(t,e,r,n,o){gnt(eEs,arguments,o)};We.getItem=function(t,e,r,n){return gnt(tEs,arguments,n)};We.removeItem=function(t,e,r,n){gnt(rEs,arguments,n)};We.clearItems=function(t,e,r){gnt(nEs,arguments,r)};We.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};We.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("")};We.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):"")};We.formatSize=function(t){return t>=1073741824?t=We.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=We.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=We.formatNumber(t/1024,0)+" KiB":t=We.formatNumber(t,0)+" bytes",t};We.bytesFromIP=function(t){return t.indexOf(".")!==-1?We.bytesFromIPv4(t):t.indexOf(":")!==-1?We.bytesFromIPv6(t):null};We.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=We.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(":")};We.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in We&&!t.update)return e(null,We.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return We.cores=navigator.hardwareConcurrency,e(null,We.cores);if(typeof Worker>"u")return We.cores=1,e(null,We.cores);if(typeof Blob>"u")return We.cores=2,e(null,We.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 hg=ds();ic();i4n.exports=hg.cipher=hg.cipher||{};hg.cipher.algorithms=hg.cipher.algorithms||{};hg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=hg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new hg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};hg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=hg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new hg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};hg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),hg.cipher.algorithms[t]=e};hg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in hg.cipher.algorithms?hg.cipher.algorithms[t]:null};var ner=hg.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)};ner.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=hg.util.createBuffer(),this.output=t.output||hg.util.createBuffer(),this.mode.start(e)};ner.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()};ner.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 oer=I((iJd,o4n)=>{p();var mg=ds();ic();mg.cipher=mg.cipher||{};var Ys=o4n.exports=mg.cipher.modes=mg.cipher.modes||{};Ys.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)};Ys.ecb.prototype.start=function(t){};Ys.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)};Ys.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)};Ys.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=ynt(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Ys.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)};Ys.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};Ys.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=ynt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.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};Ys.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};Ys.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};Ys.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=ynt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.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};Ys.ofb.prototype.decrypt=Ys.ofb.prototype.encrypt;Ys.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};Ys.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=ynt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.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}Ent(this._inBlock)};Ys.ctr.prototype.decrypt=Ys.ctr.prototype.encrypt;Ys.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};Ys.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(ier(n*8)))}this._inBlock=this._j0.slice(0),Ent(this._inBlock),this._partialBytes=0,r=mg.util.createBuffer(r),this._aDataLength=ier(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()])};Ys.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),Ent(this._inBlock)};Ys.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Ent(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)};Ys.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};Ys.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)};Ys.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 Eu=ds();Ant();oer();ic();l4n.exports=Eu.aes=Eu.aes||{};Eu.aes.startEncrypting=function(t,e,r,n){var o=_nt({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Eu.aes.createEncryptionCipher=function(t,e){return _nt({key:t,output:null,decrypt:!1,mode:e})};Eu.aes.startDecrypting=function(t,e,r,n){var o=_nt({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Eu.aes.createDecryptionCipher=function(t,e){return _nt({key:t,output:null,decrypt:!0,mode:e})};Eu.aes.Algorithm=function(t,e){cer||a4n();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return aer(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return aer(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Eu.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=Eu.util.createBuffer(e);else if(Eu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Eu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,H_[r]=l,ser[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)IJ[h][r]=d,VP[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(a4n,"initialize");function c4n(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Bde*c,u=s;u>>16&255]<<24^H_[n>>>8&255]<<16^H_[n&255]<<8^H_[n>>>24]^s4n[o]<<24,o++):s>6&&u%s===4&&(n=H_[n>>>24]<<24^H_[n>>>16&255]<<16^H_[n>>>8&255]<<8^H_[n&255]),r[u]=r[u-s]^n;if(e){var d,f=VP[0],h=VP[1],m=VP[2],g=VP[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Bde;u>>24]]^h[H_[d>>>16&255]]^m[H_[d>>>8&255]]^g[H_[d&255]];r=A}return r}a(c4n,"_expandKey");function aer(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=VP[0],c=VP[1],l=VP[2],u=VP[3],d=ser):(s=IJ[0],c=IJ[1],l=IJ[2],u=IJ[3],d=H_);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(aer,"_updateBlock");function _nt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Eu.cipher.createDecipher(r,t.key):n=Eu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Eu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(_nt,"_createCipher")});var Jq=I((uJd,u4n)=>{p();var PRe=ds();PRe.pki=PRe.pki||{};var ler=u4n.exports=PRe.pki.oids=PRe.oids=PRe.oids||{};function rr(t,e){ler[t]=e,ler[e]=t}a(rr,"_IN");function Uc(t,e){ler[t]=e}a(Uc,"_I_");rr("1.2.840.113549.1.1.1","rsaEncryption");rr("1.2.840.113549.1.1.4","md5WithRSAEncryption");rr("1.2.840.113549.1.1.5","sha1WithRSAEncryption");rr("1.2.840.113549.1.1.7","RSAES-OAEP");rr("1.2.840.113549.1.1.8","mgf1");rr("1.2.840.113549.1.1.9","pSpecified");rr("1.2.840.113549.1.1.10","RSASSA-PSS");rr("1.2.840.113549.1.1.11","sha256WithRSAEncryption");rr("1.2.840.113549.1.1.12","sha384WithRSAEncryption");rr("1.2.840.113549.1.1.13","sha512WithRSAEncryption");rr("1.3.101.112","EdDSA25519");rr("1.2.840.10040.4.3","dsa-with-sha1");rr("1.3.14.3.2.7","desCBC");rr("1.3.14.3.2.26","sha1");rr("1.3.14.3.2.29","sha1WithRSASignature");rr("2.16.840.1.101.3.4.2.1","sha256");rr("2.16.840.1.101.3.4.2.2","sha384");rr("2.16.840.1.101.3.4.2.3","sha512");rr("2.16.840.1.101.3.4.2.4","sha224");rr("2.16.840.1.101.3.4.2.5","sha512-224");rr("2.16.840.1.101.3.4.2.6","sha512-256");rr("1.2.840.113549.2.2","md2");rr("1.2.840.113549.2.5","md5");rr("1.2.840.113549.1.7.1","data");rr("1.2.840.113549.1.7.2","signedData");rr("1.2.840.113549.1.7.3","envelopedData");rr("1.2.840.113549.1.7.4","signedAndEnvelopedData");rr("1.2.840.113549.1.7.5","digestedData");rr("1.2.840.113549.1.7.6","encryptedData");rr("1.2.840.113549.1.9.1","emailAddress");rr("1.2.840.113549.1.9.2","unstructuredName");rr("1.2.840.113549.1.9.3","contentType");rr("1.2.840.113549.1.9.4","messageDigest");rr("1.2.840.113549.1.9.5","signingTime");rr("1.2.840.113549.1.9.6","counterSignature");rr("1.2.840.113549.1.9.7","challengePassword");rr("1.2.840.113549.1.9.8","unstructuredAddress");rr("1.2.840.113549.1.9.14","extensionRequest");rr("1.2.840.113549.1.9.20","friendlyName");rr("1.2.840.113549.1.9.21","localKeyId");rr("1.2.840.113549.1.9.22.1","x509Certificate");rr("1.2.840.113549.1.12.10.1.1","keyBag");rr("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");rr("1.2.840.113549.1.12.10.1.3","certBag");rr("1.2.840.113549.1.12.10.1.4","crlBag");rr("1.2.840.113549.1.12.10.1.5","secretBag");rr("1.2.840.113549.1.12.10.1.6","safeContentsBag");rr("1.2.840.113549.1.5.13","pkcs5PBES2");rr("1.2.840.113549.1.5.12","pkcs5PBKDF2");rr("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");rr("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");rr("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");rr("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");rr("1.2.840.113549.2.7","hmacWithSHA1");rr("1.2.840.113549.2.8","hmacWithSHA224");rr("1.2.840.113549.2.9","hmacWithSHA256");rr("1.2.840.113549.2.10","hmacWithSHA384");rr("1.2.840.113549.2.11","hmacWithSHA512");rr("1.2.840.113549.3.7","des-EDE3-CBC");rr("2.16.840.1.101.3.4.1.2","aes128-CBC");rr("2.16.840.1.101.3.4.1.22","aes192-CBC");rr("2.16.840.1.101.3.4.1.42","aes256-CBC");rr("2.5.4.3","commonName");rr("2.5.4.4","surname");rr("2.5.4.5","serialNumber");rr("2.5.4.6","countryName");rr("2.5.4.7","localityName");rr("2.5.4.8","stateOrProvinceName");rr("2.5.4.9","streetAddress");rr("2.5.4.10","organizationName");rr("2.5.4.11","organizationalUnitName");rr("2.5.4.12","title");rr("2.5.4.13","description");rr("2.5.4.15","businessCategory");rr("2.5.4.17","postalCode");rr("2.5.4.42","givenName");rr("2.5.4.65","pseudonym");rr("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");rr("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");rr("2.16.840.1.113730.1.1","nsCertType");rr("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");rr("2.5.29.14","subjectKeyIdentifier");rr("2.5.29.15","keyUsage");Uc("2.5.29.16","privateKeyUsagePeriod");rr("2.5.29.17","subjectAltName");rr("2.5.29.18","issuerAltName");rr("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");rr("2.5.29.31","cRLDistributionPoints");rr("2.5.29.32","certificatePolicies");Uc("2.5.29.33","policyMappings");Uc("2.5.29.34","policyConstraints");rr("2.5.29.35","authorityKeyIdentifier");Uc("2.5.29.36","policyConstraints");rr("2.5.29.37","extKeyUsage");Uc("2.5.29.46","freshestCRL");Uc("2.5.29.54","inhibitAnyPolicy");rr("1.3.6.1.4.1.11129.2.4.2","timestampList");rr("1.3.6.1.5.5.7.1.1","authorityInfoAccess");rr("1.3.6.1.5.5.7.3.1","serverAuth");rr("1.3.6.1.5.5.7.3.2","clientAuth");rr("1.3.6.1.5.5.7.3.3","codeSigning");rr("1.3.6.1.5.5.7.3.4","emailProtection");rr("1.3.6.1.5.5.7.3.8","timeStamping")});var WP=I((pJd,f4n)=>{p();var ed=ds();ic();Jq();var tn=f4n.exports=ed.asn1=ed.asn1||{};tn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};tn.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};tn.maxDepth=256;tn.create=function(t,e,r,n,o){if(ed.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(DRe,"_checkBufferLength");var iEs=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;DRe(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");tn.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=tn.maxDepth),typeof t=="string"&&(t=ed.util.createBuffer(t));var r=t.length(),n=Cnt(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 Cnt(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;DRe(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=iEs(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(DRe(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(Cnt(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(Cnt(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===tn.Class.UNIVERSAL&&l===tn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===tn.Class.UNIVERSAL&&l===tn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===tn.Type.BITSTRING&&(DRe(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=Cnt(t,e,r+1,E),v=o-t.length();e-=v,l==tn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===tn.Class.UNIVERSAL||b===tn.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===tn.Type.BMPSTRING)for(f="";u>0;u-=2)DRe(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 tn.create(c,l,m,f,T)}a(Cnt,"_fromDer");tn.toDer=function(t){var e=ed.util.createBuffer(),r=t.tagClass|t.type,n=ed.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=tn.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};tn.oidToDer=function(t){var e=t.split("."),r=ed.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};tn.derToOid=function(t){var e;typeof t=="string"&&(t=ed.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};tn.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};tn.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};tn.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};tn.derToInteger=function(t){typeof t=="string"&&(t=ed.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)};tn.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&&ed.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` +`.trim())}};W2n.exports=XJt});var Ltt=I((djd,Z2n)=>{"use strict";p();var Y2n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Eus}=pc(),_us=Que();J2n()===void 0&&K2n(new _us);function K2n(t){if(!t||typeof t.dispatch!="function")throw new Eus("Argument agent must implement Agent");Object.defineProperty(globalThis,Y2n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(K2n,"setGlobalDispatcher");function J2n(){return globalThis[Y2n]}a(J2n,"getGlobalDispatcher");Z2n.exports={setGlobalDispatcher:K2n,getGlobalDispatcher:J2n}});var Ftt=I((mjd,X2n)=>{"use strict";p();X2n.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 tDn=I((yjd,eDn)=>{"use strict";p();var vus=gtt();eDn.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 vus(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var nDn=I((vjd,rDn)=>{"use strict";p();var Cus=xtt();rDn.exports=t=>e=>a(function(n,o){return e(n,new Cus({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var oDn=I((Sjd,iDn)=>{"use strict";p();var bus=Ms(),{InvalidArgumentError:Sus,RequestAbortedError:Tus}=pc(),Ius=Ftt(),eZt=class extends Ius{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 Sus("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=bus.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new Tus(`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 xus({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new eZt({maxSize:s},o);return e(n,c)},"Intercept")}a(xus,"createDumpInterceptor");iDn.exports=xus});var cDn=I((xjd,aDn)=>{"use strict";p();var{isIP:wus}=require("node:net"),{lookup:Rus}=require("node:dns"),Pus=Ftt(),{InvalidArgumentError:Kue,InformationalError:kus}=pc(),sDn=Math.pow(2,31)-1,tZt=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 kus("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){Rus(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===sDn?(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===sDn?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 rZt(this,e,r)}},rZt=class extends Pus{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}}};aDn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new Kue("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new Kue("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new Kue("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new Kue("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new Kue("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new Kue("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 tZt(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return wus(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 ZK=I((Pjd,mDn)=>{"use strict";p();var{kConstruct:Dus}=Nd(),{kEnumerableProperty:Jue}=Ms(),{iteratorMixin:Nus,isValidHeaderName:Mwe,isValidHeaderValue:uDn}=FS(),{webidl:qa}=TA(),nZt=require("node:assert"),Utt=require("node:util"),Kh=Symbol("headers map"),qS=Symbol("headers map sorted");function lDn(t){return t===10||t===13||t===9||t===32}a(lDn,"isHTTPWhiteSpaceCharCode");function dDn(t){let e=0,r=t.length;for(;r>e&&lDn(t.charCodeAt(r-1));)--r;for(;r>e&&lDn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(dDn,"headerValueNormalize");function fDn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(fDn,"fill");function iZt(t,e,r){if(r=dDn(r),Mwe(e)){if(!uDn(r))throw qa.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw qa.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(hDn(t)==="immutable")throw new TypeError("immutable");return oZt(t).append(e,r,!1)}a(iZt,"appendHeader");function pDn(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[Kh])r[n++]=[o,s],nZt(s!==null);return r.sort(pDn)}}},Bk=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){qa.util.markAsUncloneable(this),e!==Dus&&(this.#t=new Qtt,this.#e="none",e!==void 0&&(e=qa.converters.HeadersInit(e,"Headers contructor","init"),fDn(this,e)))}append(e,r){qa.brandCheck(this,t),qa.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=qa.converters.ByteString(e,n,"name"),r=qa.converters.ByteString(r,n,"value"),iZt(this,e,r)}delete(e){if(qa.brandCheck(this,t),qa.argumentLengthCheck(arguments,1,"Headers.delete"),e=qa.converters.ByteString(e,"Headers.delete","name"),!Mwe(e))throw qa.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){qa.brandCheck(this,t),qa.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=qa.converters.ByteString(e,r,"name"),!Mwe(e))throw qa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){qa.brandCheck(this,t),qa.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=qa.converters.ByteString(e,r,"name"),!Mwe(e))throw qa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){qa.brandCheck(this,t),qa.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=qa.converters.ByteString(e,n,"name"),r=qa.converters.ByteString(r,n,"value"),r=dDn(r),Mwe(e)){if(!uDn(r))throw qa.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw qa.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){qa.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[qS](){if(this.#t[qS])return this.#t[qS];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[qS]=r;for(let o=0;o>"](t,e,r,n.bind(t)):qa.converters["record"](t,e,r)}throw qa.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};mDn.exports={fill:fDn,compareHeaderName:pDn,Headers:Bk,HeadersList:Qtt,getHeadersGuard:hDn,setHeadersGuard:Mus,setHeadersList:Ous,getHeadersList:oZt}});var Bwe=I((Njd,xDn)=>{"use strict";p();var{Headers:vDn,HeadersList:gDn,fill:Bus,getHeadersGuard:Lus,setHeadersGuard:CDn,setHeadersList:bDn}=ZK(),{extractBody:ADn,cloneBody:Fus,mixinBody:Uus,hasFinalizationRegistry:SDn,streamRegistry:TDn,bodyUnusable:Qus}=kue(),sZt=Ms(),yDn=require("node:util"),{kEnumerableProperty:jS}=sZt,{isValidReasonPhrase:qus,isCancelled:jus,isAborted:Hus,isBlobLike:Gus,serializeJavascriptValueToJSONString:$us,isErrorLike:Vus,isomorphicEncode:Wus,environmentSettingsObject:zus}=FS(),{redirectStatusSet:Yus,nullBodyStatus:Kus}=owe(),{kState:Od,kHeaders:j3}=fq(),{webidl:Xo}=TA(),{FormData:Jus}=dwe(),{URLSerializer:EDn}=FC(),{kConstruct:jtt}=Nd(),aZt=require("node:assert"),{types:Zus}=require("node:util"),Xus=new TextEncoder("utf-8"),XK=class t{static{a(this,"Response")}static error(){return Owe(Htt(),"immutable")}static json(e,r={}){Xo.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=Xo.converters.ResponseInit(r));let n=Xus.encode($us(e)),o=ADn(n),s=Owe(Zue({}),"response");return _Dn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){Xo.argumentLengthCheck(arguments,1,"Response.redirect"),e=Xo.converters.USVString(e),r=Xo.converters["unsigned short"](r);let n;try{n=new URL(e,zus.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!Yus.has(r))throw new RangeError(`Invalid status code ${r}`);let o=Owe(Zue({}),"immutable");o[Od].status=r;let s=Wus(EDn(n));return o[Od].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(Xo.util.markAsUncloneable(this),e===jtt)return;e!==null&&(e=Xo.converters.BodyInit(e)),r=Xo.converters.ResponseInit(r),this[Od]=Zue({}),this[j3]=new vDn(jtt),CDn(this[j3],"response"),bDn(this[j3],this[Od].headersList);let n=null;if(e!=null){let[o,s]=ADn(e);n={body:o,type:s}}_Dn(this,r,n)}get type(){return Xo.brandCheck(this,t),this[Od].type}get url(){Xo.brandCheck(this,t);let e=this[Od].urlList,r=e[e.length-1]??null;return r===null?"":EDn(r,!0)}get redirected(){return Xo.brandCheck(this,t),this[Od].urlList.length>1}get status(){return Xo.brandCheck(this,t),this[Od].status}get ok(){return Xo.brandCheck(this,t),this[Od].status>=200&&this[Od].status<=299}get statusText(){return Xo.brandCheck(this,t),this[Od].statusText}get headers(){return Xo.brandCheck(this,t),this[j3]}get body(){return Xo.brandCheck(this,t),this[Od].body?this[Od].body.stream:null}get bodyUsed(){return Xo.brandCheck(this,t),!!this[Od].body&&sZt.isDisturbed(this[Od].body.stream)}clone(){if(Xo.brandCheck(this,t),Qus(this))throw Xo.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=cZt(this[Od]);return SDn&&this[Od].body?.stream&&TDn.register(this,new WeakRef(this[Od].body.stream)),Owe(e,Lus(this[j3]))}[yDn.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 ${yDn.formatWithOptions(r,n)}`}};Uus(XK);Object.defineProperties(XK.prototype,{type:jS,url:jS,status:jS,ok:jS,redirected:jS,statusText:jS,headers:jS,clone:jS,body:jS,bodyUsed:jS,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(XK,{json:jS,redirect:jS,error:jS});function cZt(t){if(t.internalResponse)return IDn(cZt(t.internalResponse),t.type);let e=Zue({...t,body:null});return t.body!=null&&(e.body=Fus(e,t.body)),e}a(cZt,"cloneResponse");function Zue(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new gDn(t?.headersList):new gDn,urlList:t?.urlList?[...t.urlList]:[]}}a(Zue,"makeResponse");function Htt(t){let e=Vus(t);return Zue({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Htt,"makeNetworkError");function eds(t){return t.type==="error"&&t.status===0}a(eds,"isNetworkError");function qtt(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 aZt(!(n in e)),r[n]=o,!0}})}a(qtt,"makeFilteredResponse");function IDn(t,e){if(e==="basic")return qtt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return qtt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return qtt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return qtt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});aZt(!1)}a(IDn,"filterResponse");function tds(t,e=null){return aZt(jus(t)),Hus(t)?Htt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Htt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(tds,"makeAppropriateNetworkError");function _Dn(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&&!qus(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Od].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Od].statusText=e.statusText),"headers"in e&&e.headers!=null&&Bus(t[j3],e.headers),r){if(Kus.includes(t.status))throw Xo.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Od].body=r.body,r.type!=null&&!t[Od].headersList.contains("content-type",!0)&&t[Od].headersList.append("content-type",r.type,!0)}}a(_Dn,"initializeResponse");function Owe(t,e){let r=new XK(jtt);return r[Od]=t,r[j3]=new vDn(jtt),bDn(r[j3],t.headersList),CDn(r[j3],e),SDn&&t.body?.stream&&TDn.register(r,new WeakRef(t.body.stream)),r}a(Owe,"fromInnerResponse");Xo.converters.ReadableStream=Xo.interfaceConverter(ReadableStream);Xo.converters.FormData=Xo.interfaceConverter(Jus);Xo.converters.URLSearchParams=Xo.interfaceConverter(URLSearchParams);Xo.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?Xo.converters.USVString(t,e,r):Gus(t)?Xo.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||Zus.isArrayBuffer(t)?Xo.converters.BufferSource(t,e,r):sZt.isFormDataLike(t)?Xo.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?Xo.converters.URLSearchParams(t,e,r):Xo.converters.DOMString(t,e,r)};Xo.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?Xo.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:Xo.converters.XMLHttpRequestBodyInit(t,e,r)};Xo.converters.ResponseInit=Xo.dictionaryConverter([{key:"status",converter:Xo.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:Xo.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:Xo.converters.HeadersInit}]);xDn.exports={isNetworkError:eds,makeNetworkError:Htt,makeResponse:Zue,makeAppropriateNetworkError:tds,filterResponse:IDn,Response:XK,cloneResponse:cZt,fromInnerResponse:Owe}});var kDn=I((Bjd,PDn)=>{"use strict";p();var{kConnected:wDn,kSize:RDn}=Nd(),lZt=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[wDn]===0&&this.value[RDn]===0?void 0:this.value}},uZt=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[wDn]===0&&e[RDn]===0&&this.finalizer(r)})}unregister(e){}};PDn.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:lZt,FinalizationRegistry:uZt}):{WeakRef,FinalizationRegistry}}});var Xue=I((Ujd,VDn)=>{"use strict";p();var{extractBody:rds,mixinBody:nds,cloneBody:ids,bodyUnusable:DDn}=kue(),{Headers:qDn,fill:ods,HeadersList:Wtt,setHeadersGuard:fZt,getHeadersGuard:sds,setHeadersList:jDn,getHeadersList:NDn}=ZK(),{FinalizationRegistry:ads}=kDn()(),$tt=Ms(),MDn=require("node:util"),{isValidHTTPToken:cds,sameOrigin:ODn,environmentSettingsObject:Gtt}=FS(),{forbiddenMethodsSet:lds,corsSafeListedMethodsSet:uds,referrerPolicy:dds,requestRedirect:fds,requestMode:pds,requestCredentials:hds,requestCache:mds,requestDuplex:gds}=owe(),{kEnumerableProperty:Jh,normalizedMethodRecordsBase:Ads,normalizedMethodRecords:yds}=$tt,{kHeaders:HS,kSignal:Vtt,kState:Xu,kDispatcher:dZt}=fq(),{webidl:Hi}=TA(),{URLSerializer:Eds}=FC(),{kConstruct:ztt}=Nd(),_ds=require("node:assert"),{getMaxListeners:BDn,setMaxListeners:LDn,getEventListeners:vds,defaultMaxListeners:FDn}=require("node:events"),Cds=Symbol("abortController"),HDn=new ads(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Ytt=new WeakMap;function UDn(t){return e;function e(){let r=t.deref();if(r!==void 0){HDn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Ytt.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()}Ytt.delete(r.signal)}}}}a(UDn,"buildAbort");var QDn=!1,Sq=class t{static{a(this,"Request")}constructor(e,r={}){if(Hi.util.markAsUncloneable(this),e===ztt)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=Gtt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[dZt]=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=Ktt({urlList:[_]}),s="cors"}else this[dZt]=r.dispatcher||e[dZt],_ds(e instanceof t),o=e[Xu],l=e[Vtt];let u=Gtt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&ODn(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=Ktt({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Gtt.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&&!ODn(v,Gtt.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=yds[_];if(v!==void 0)o.method=v;else{if(!cds(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(lds.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=Ads[b]??_,o.method=_}!QDn&&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"}),QDn=!0)}r.signal!==void 0&&(l=r.signal),this[Xu]=o;let m=new AbortController;if(this[Vtt]=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[Cds]=m;let _=new WeakRef(m),v=UDn(_);try{(typeof BDn=="function"&&BDn(l)===FDn||vds(l,"abort").length>=FDn)&&LDn(1500,l)}catch{}$tt.addAbortListener(l,v),HDn.register(m,{signal:l,abort:v},v)}}if(this[HS]=new qDn(ztt),jDn(this[HS],o.headersList),fZt(this[HS],"request"),h==="no-cors"){if(!uds.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);fZt(this[HS],"request-no-cors")}if(f){let _=NDn(this[HS]),v=r.headers!==void 0?r.headers:new Wtt(_);if(_.clear(),v instanceof Wtt){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else ods(this[HS],v)}let g=e instanceof t?e[Xu].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]=rds(r.body,o.keepalive);A=_,v&&!NDn(this[HS]).contains("content-type",!0)&&this[HS].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(DDn(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[Xu].body=E}get method(){return Hi.brandCheck(this,t),this[Xu].method}get url(){return Hi.brandCheck(this,t),Eds(this[Xu].url)}get headers(){return Hi.brandCheck(this,t),this[HS]}get destination(){return Hi.brandCheck(this,t),this[Xu].destination}get referrer(){return Hi.brandCheck(this,t),this[Xu].referrer==="no-referrer"?"":this[Xu].referrer==="client"?"about:client":this[Xu].referrer.toString()}get referrerPolicy(){return Hi.brandCheck(this,t),this[Xu].referrerPolicy}get mode(){return Hi.brandCheck(this,t),this[Xu].mode}get credentials(){return this[Xu].credentials}get cache(){return Hi.brandCheck(this,t),this[Xu].cache}get redirect(){return Hi.brandCheck(this,t),this[Xu].redirect}get integrity(){return Hi.brandCheck(this,t),this[Xu].integrity}get keepalive(){return Hi.brandCheck(this,t),this[Xu].keepalive}get isReloadNavigation(){return Hi.brandCheck(this,t),this[Xu].reloadNavigation}get isHistoryNavigation(){return Hi.brandCheck(this,t),this[Xu].historyNavigation}get signal(){return Hi.brandCheck(this,t),this[Vtt]}get body(){return Hi.brandCheck(this,t),this[Xu].body?this[Xu].body.stream:null}get bodyUsed(){return Hi.brandCheck(this,t),!!this[Xu].body&&$tt.isDisturbed(this[Xu].body.stream)}get duplex(){return Hi.brandCheck(this,t),"half"}clone(){if(Hi.brandCheck(this,t),DDn(this))throw new TypeError("unusable");let e=GDn(this[Xu]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Ytt.get(this.signal);n===void 0&&(n=new Set,Ytt.set(this.signal,n));let o=new WeakRef(r);n.add(o),$tt.addAbortListener(r.signal,UDn(o))}return $Dn(e,r.signal,sds(this[HS]))}[MDn.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 ${MDn.formatWithOptions(r,n)}`}};nds(Sq);function Ktt(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 Wtt(t.headersList):new Wtt}}a(Ktt,"makeRequest");function GDn(t){let e=Ktt({...t,body:null});return t.body!=null&&(e.body=ids(e,t.body)),e}a(GDn,"cloneRequest");function $Dn(t,e,r){let n=new Sq(ztt);return n[Xu]=t,n[Vtt]=e,n[HS]=new qDn(ztt),jDn(n[HS],t.headersList),fZt(n[HS],r),n}a($Dn,"fromInnerRequest");Object.defineProperties(Sq.prototype,{method:Jh,url:Jh,headers:Jh,redirect:Jh,clone:Jh,signal:Jh,duplex:Jh,destination:Jh,body:Jh,bodyUsed:Jh,isHistoryNavigation:Jh,isReloadNavigation:Jh,keepalive:Jh,integrity:Jh,cache:Jh,credentials:Jh,attribute:Jh,referrerPolicy:Jh,referrer:Jh,mode:Jh,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Hi.converters.Request=Hi.interfaceConverter(Sq);Hi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Hi.converters.USVString(t,e,r):t instanceof Sq?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:dds},{key:"mode",converter:Hi.converters.DOMString,allowedValues:pds},{key:"credentials",converter:Hi.converters.DOMString,allowedValues:hds},{key:"cache",converter:Hi.converters.DOMString,allowedValues:mds},{key:"redirect",converter:Hi.converters.DOMString,allowedValues:fds},{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:gds},{key:"dispatcher",converter:Hi.converters.any}]);VDn.exports={Request:Sq,makeRequest:Ktt,fromInnerRequest:$Dn,cloneRequest:GDn}});var Fwe=I((jjd,aNn)=>{"use strict";p();var{makeNetworkError:el,makeAppropriateNetworkError:Jtt,filterResponse:pZt,makeResponse:Ztt,fromInnerResponse:bds}=Bwe(),{HeadersList:WDn}=ZK(),{Request:Sds,cloneRequest:Tds}=Xue(),Tq=require("node:zlib"),{bytesMatch:Ids,makePolicyContainer:xds,clonePolicyContainer:wds,requestBadPort:Rds,TAOCheck:Pds,appendRequestOriginHeader:kds,responseLocationURL:Dds,requestCurrentURL:wO,setRequestReferrerPolicyOnRedirect:Nds,tryUpgradeRequestToAPotentiallyTrustworthyURL:Mds,createOpaqueTimingInfo:yZt,appendFetchMetadata:Ods,corsCheck:Bds,crossOriginResourcePolicyCheck:Lds,determineRequestsReferrer:Fds,coarsenedSharedCurrentTime:Lwe,createDeferredPromise:Uds,isBlobLike:Qds,sameOrigin:AZt,isCancelled:eJ,isAborted:zDn,isErrorLike:qds,fullyReadBody:jds,readableStreamClose:Hds,isomorphicEncode:Xtt,urlIsLocal:Gds,urlIsHttpHttpsScheme:EZt,urlHasHttpsScheme:$ds,clampAndCoarsenConnectionTimingInfo:Vds,simpleRangeHeaderValue:Wds,buildContentRange:zds,createInflate:Yds,extractMimeType:Kds}=FS(),{kState:ZDn,kDispatcher:Jds}=fq(),tJ=require("node:assert"),{safelyExtractBody:_Zt,extractBody:YDn}=kue(),{redirectStatusSet:XDn,nullBodyStatus:eNn,safeMethodsSet:Zds,requestBodyHeader:Xds,subresourceSet:efs}=owe(),tfs=require("node:events"),{Readable:rfs,pipeline:nfs,finished:ifs}=require("node:stream"),{addAbortListener:ofs,isErrored:sfs,isReadable:ert,bufferToLowerCasedHeaderName:KDn}=Ms(),{dataURLProcessor:afs,serializeAMimeType:cfs,minimizeSupportedMimeType:lfs}=FC(),{getGlobalDispatcher:ufs}=Ltt(),{webidl:dfs}=TA(),{STATUS_CODES:ffs}=require("node:http"),pfs=["GET","HEAD"],hfs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",hZt,trt=class extends tfs{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 mfs(t){tNn(t,"fetch")}a(mfs,"handleFetchDone");function gfs(t,e=void 0){dfs.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=Uds(),n;try{n=new Sds(t,e)}catch(f){return r.reject(f),r.promise}let o=n[ZDn];if(n.signal.aborted)return mZt(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 ofs(n.signal,()=>{l=!0,tJ(u!=null),u.abort(n.signal.reason);let f=c?.deref();mZt(r,o,f,n.signal.reason)}),u=nNn({request:o,processResponseEndOfBody:mfs,processResponse:a(f=>{if(!l){if(f.aborted){mZt(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(bds(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[Jds]}),r.promise}a(gfs,"fetch");function tNn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;EZt(r)&&n!==null&&(t.timingAllowPassed||(n=yZt({startTime:n.startTime}),o=""),n.endTime=Lwe(),t.timingInfo=n,rNn(n,r.href,e,globalThis,o))}a(tNn,"finalizeAndReportTiming");var rNn=performance.markResourceTiming;function mZt(t,e,r,n){if(t&&t.reject(n),e.body!=null&&ert(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[ZDn];o.body!=null&&ert(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(mZt,"abortFetch");function nNn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=ufs()}){tJ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=Lwe(d),h=yZt({startTime:f}),m={controller:new trt(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return tJ(!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=wds(t.client.policyContainer):t.policyContainer=xds()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,efs.has(t.destination),iNn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(nNn,"fetching");async function iNn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!Gds(wO(r))&&(n=el("local URLs only")),Mds(r),Rds(r)==="blocked"&&(n=el("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=Fds(r)),n===null&&(n=await(async()=>{let s=wO(r);return AZt(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await JDn(t)):r.mode==="same-origin"?el('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?el('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await JDn(t)):EZt(wO(r))?(r.responseTainting="cors",await oNn(t)):el("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=pZt(n,"basic"):r.responseTainting==="cors"?n=pZt(n,"cors"):r.responseTainting==="opaque"?n=pZt(n,"opaque"):tJ(!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=el()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||eNn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>gZt(t,el(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!Ids(l,r.integrity)){s("integrity mismatch");return}n.body=_Zt(l)[0],gZt(t,n)},"processBody");await jds(n.body,c,s)}else gZt(t,n)}a(iNn,"mainFetch");function JDn(t){if(eJ(t)&&t.request.redirectCount===0)return Promise.resolve(Jtt(t));let{request:e}=t,{protocol:r}=wO(e);switch(r){case"about:":return Promise.resolve(el("about scheme is not supported"));case"blob:":{hZt||(hZt=require("node:buffer").resolveObjectURL);let n=wO(e);if(n.search.length!==0)return Promise.resolve(el("NetworkError when attempting to fetch resource."));let o=hZt(n.toString());if(e.method!=="GET"||!Qds(o))return Promise.resolve(el("invalid method"));let s=Ztt(),c=o.size,l=Xtt(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=Wds(d,!0);if(f==="failure")return Promise.resolve(el("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(el("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=YDn(g);s.body=A[0];let y=Xtt(`${g.size}`),E=zds(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=YDn(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=wO(e),o=afs(n);if(o==="failure")return Promise.resolve(el("failed to fetch the data URL"));let s=cfs(o.mimeType);return Promise.resolve(Ztt({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:_Zt(o.body)[0]}))}case"file:":return Promise.resolve(el("not implemented... yet..."));case"http:":case"https:":return oNn(t).catch(n=>el(n));default:return Promise.resolve(el("unknown scheme"))}}a(JDn,"schemeFetch");function Afs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Afs,"finalizeResponse");function gZt(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=yZt(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=Kds(e.headersList);f!=="failure"&&(u.contentType=lfs(f))}t.request.initiatorType!=null&&rNn(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():ifs(o.body.stream,()=>{n()})}a(gZt,"fetchFinale");async function oNn(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 sNn(t),e.responseTainting==="cors"&&Bds(e,r)==="failure")return el("cors failure");Pds(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&Lds(e.origin,e.client,e.destination,n)==="blocked"?el("blocked"):(XDn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=el("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await yfs(t,r):tJ(!1)),r.timingInfo=o,r)}a(oNn,"httpFetch");function yfs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=Dds(n,wO(r).hash),o==null)return e}catch(c){return Promise.resolve(el(c))}if(!EZt(o))return Promise.resolve(el("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(el("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!AZt(r,o))return Promise.resolve(el('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(el('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(el());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!pfs.includes(r.method)){r.method="GET",r.body=null;for(let c of Xds)r.headersList.delete(c)}AZt(wO(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&&(tJ(r.body.source!=null),r.body=_Zt(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Lwe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),Nds(r,n),iNn(t,!0)}a(yfs,"httpRedirectFetch");async function sNn(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=Tds(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=Xtt(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Xtt(s.referrer.href),!0),kds(s),Ods(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",hfs),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)||($ds(wO(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 el("only if cached");let m=await Efs(o,d,r);!Zds.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"?el():eJ(t)?Jtt(t):el("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(eJ(t))return Jtt(t);t.controller.connection.destroy(),c=await sNn(t,e,!0)}return c}a(sNn,"httpNetworkOrCacheFetch");async function Efs(t,e=!1,r=!1){tJ(!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*(_){eJ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{eJ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{eJ(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=Ztt({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Ztt({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),Jtt(t,A)):el(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{eJ(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(zDn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){Hds(t.controller.controller),Afs(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),sfs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){zDn(t)?(o.aborted=!0,ert(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):ert(h)&&t.controller.controller.error(new TypeError("terminated",{cause:qds(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=wO(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=Vds(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=Lwe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Lwe(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new WDn;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 q=j[O].trim();if(q==="x-gzip"||q==="gzip")D.push(Tq.createGunzip({flush:Tq.constants.Z_SYNC_FLUSH,finishFlush:Tq.constants.Z_SYNC_FLUSH}));else if(q==="deflate")D.push(Yds({flush:Tq.constants.Z_SYNC_FLUSH,finishFlush:Tq.constants.Z_SYNC_FLUSH}));else if(q==="br")D.push(Tq.createBrotliDecompress({flush:Tq.constants.BROTLI_OPERATION_FLUSH,finishFlush:Tq.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?nfs(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 WDn;for(let x=0;x{"use strict";p();cNn.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 uNn=I((Wjd,lNn)=>{"use strict";p();var{webidl:GS}=TA(),rrt=Symbol("ProgressEvent state"),CZt=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=GS.converters.DOMString(e,"ProgressEvent constructor","type"),r=GS.converters.ProgressEventInit(r??{}),super(e,r),this[rrt]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return GS.brandCheck(this,t),this[rrt].lengthComputable}get loaded(){return GS.brandCheck(this,t),this[rrt].loaded}get total(){return GS.brandCheck(this,t),this[rrt].total}};GS.converters.ProgressEventInit=GS.dictionaryConverter([{key:"lengthComputable",converter:GS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:GS.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:GS.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:GS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:GS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:GS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);lNn.exports={ProgressEvent:CZt}});var fNn=I((Kjd,dNn)=>{"use strict";p();function _fs(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(_fs,"getEncoding");dNn.exports={getEncoding:_fs}});var _Nn=I((Xjd,ENn)=>{"use strict";p();var{kState:ede,kError:bZt,kResult:pNn,kAborted:Uwe,kLastProgressEventFired:SZt}=vZt(),{ProgressEvent:vfs}=uNn(),{getEncoding:hNn}=fNn(),{serializeAMimeType:Cfs,parseMIMEType:mNn}=FC(),{types:bfs}=require("node:util"),{StringDecoder:gNn}=require("string_decoder"),{btoa:ANn}=require("node:buffer"),Sfs={enumerable:!0,writable:!1,configurable:!1};function Tfs(t,e,r,n){if(t[ede]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[ede]="loading",t[pNn]=null,t[bZt]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[Uwe];)try{let{done:d,value:f}=await l;if(u&&!t[Uwe]&&queueMicrotask(()=>{Iq("loadstart",t)}),u=!1,!d&&bfs.isUint8Array(f))c.push(f),(t[SZt]===void 0||Date.now()-t[SZt]>=50)&&!t[Uwe]&&(t[SZt]=Date.now(),queueMicrotask(()=>{Iq("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[ede]="done";try{let h=Ifs(c,r,e.type,n);if(t[Uwe])return;t[pNn]=h,Iq("load",t)}catch(h){t[bZt]=h,Iq("error",t)}t[ede]!=="loading"&&Iq("loadend",t)});break}}catch(d){if(t[Uwe])return;queueMicrotask(()=>{t[ede]="done",t[bZt]=d,Iq("error",t),t[ede]!=="loading"&&Iq("loadend",t)});break}})()}a(Tfs,"readOperation");function Iq(t,e){let r=new vfs(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Iq,"fireAProgressEvent");function Ifs(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=mNn(r||"application/octet-stream");s!=="failure"&&(o+=Cfs(s)),o+=";base64,";let c=new gNn("latin1");for(let l of t)o+=ANn(c.write(l));return o+=ANn(c.end()),o}case"Text":{let o="failure";if(n&&(o=hNn(n)),o==="failure"&&r){let s=mNn(r);s!=="failure"&&(o=hNn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),xfs(t,o)}case"ArrayBuffer":return yNn(t).buffer;case"BinaryString":{let o="",s=new gNn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(Ifs,"packageData");function xfs(t,e){let r=yNn(t),n=wfs(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(xfs,"decode");function wfs(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(wfs,"BOMSniffing");function yNn(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(yNn,"combineByteSequences");ENn.exports={staticPropertyDescriptors:Sfs,readOperation:Tfs,fireAProgressEvent:Iq}});var SNn=I((rHd,bNn)=>{"use strict";p();var{staticPropertyDescriptors:tde,readOperation:nrt,fireAProgressEvent:vNn}=_Nn(),{kState:rJ,kError:CNn,kResult:irt,kEvents:Sc,kAborted:Rfs}=vZt(),{webidl:vl}=TA(),{kEnumerableProperty:qC}=Ms(),Lk=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[rJ]="empty",this[irt]=null,this[CNn]=null,this[Sc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=vl.converters.Blob(e,{strict:!1}),nrt(this,e,"ArrayBuffer")}readAsBinaryString(e){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=vl.converters.Blob(e,{strict:!1}),nrt(this,e,"BinaryString")}readAsText(e,r=void 0){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=vl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=vl.converters.DOMString(r,"FileReader.readAsText","encoding")),nrt(this,e,"Text",r)}readAsDataURL(e){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=vl.converters.Blob(e,{strict:!1}),nrt(this,e,"DataURL")}abort(){if(this[rJ]==="empty"||this[rJ]==="done"){this[irt]=null;return}this[rJ]==="loading"&&(this[rJ]="done",this[irt]=null),this[Rfs]=!0,vNn("abort",this),this[rJ]!=="loading"&&vNn("loadend",this)}get readyState(){switch(vl.brandCheck(this,t),this[rJ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return vl.brandCheck(this,t),this[irt]}get error(){return vl.brandCheck(this,t),this[CNn]}get onloadend(){return vl.brandCheck(this,t),this[Sc].loadend}set onloadend(e){vl.brandCheck(this,t),this[Sc].loadend&&this.removeEventListener("loadend",this[Sc].loadend),typeof e=="function"?(this[Sc].loadend=e,this.addEventListener("loadend",e)):this[Sc].loadend=null}get onerror(){return vl.brandCheck(this,t),this[Sc].error}set onerror(e){vl.brandCheck(this,t),this[Sc].error&&this.removeEventListener("error",this[Sc].error),typeof e=="function"?(this[Sc].error=e,this.addEventListener("error",e)):this[Sc].error=null}get onloadstart(){return vl.brandCheck(this,t),this[Sc].loadstart}set onloadstart(e){vl.brandCheck(this,t),this[Sc].loadstart&&this.removeEventListener("loadstart",this[Sc].loadstart),typeof e=="function"?(this[Sc].loadstart=e,this.addEventListener("loadstart",e)):this[Sc].loadstart=null}get onprogress(){return vl.brandCheck(this,t),this[Sc].progress}set onprogress(e){vl.brandCheck(this,t),this[Sc].progress&&this.removeEventListener("progress",this[Sc].progress),typeof e=="function"?(this[Sc].progress=e,this.addEventListener("progress",e)):this[Sc].progress=null}get onload(){return vl.brandCheck(this,t),this[Sc].load}set onload(e){vl.brandCheck(this,t),this[Sc].load&&this.removeEventListener("load",this[Sc].load),typeof e=="function"?(this[Sc].load=e,this.addEventListener("load",e)):this[Sc].load=null}get onabort(){return vl.brandCheck(this,t),this[Sc].abort}set onabort(e){vl.brandCheck(this,t),this[Sc].abort&&this.removeEventListener("abort",this[Sc].abort),typeof e=="function"?(this[Sc].abort=e,this.addEventListener("abort",e)):this[Sc].abort=null}};Lk.EMPTY=Lk.prototype.EMPTY=0;Lk.LOADING=Lk.prototype.LOADING=1;Lk.DONE=Lk.prototype.DONE=2;Object.defineProperties(Lk.prototype,{EMPTY:tde,LOADING:tde,DONE:tde,readAsArrayBuffer:qC,readAsBinaryString:qC,readAsText:qC,readAsDataURL:qC,abort:qC,readyState:qC,result:qC,error:qC,onloadstart:qC,onprogress:qC,onload:qC,onabort:qC,onerror:qC,onloadend:qC,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Lk,{EMPTY:tde,LOADING:tde,DONE:tde});bNn.exports={FileReader:Lk}});var ort=I((oHd,TNn)=>{"use strict";p();TNn.exports={kConstruct:Nd().kConstruct}});var wNn=I((aHd,xNn)=>{"use strict";p();var Pfs=require("node:assert"),{URLSerializer:INn}=FC(),{isValidHeaderName:kfs}=FS();function Dfs(t,e,r=!1){let n=INn(t,r),o=INn(e,r);return n===o}a(Dfs,"urlEquals");function Nfs(t){Pfs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),kfs(r)&&e.push(r);return e}a(Nfs,"getFieldValues");xNn.exports={urlEquals:Dfs,getFieldValues:Nfs}});var kNn=I((uHd,PNn)=>{"use strict";p();var{kConstruct:Mfs}=ort(),{urlEquals:Ofs,getFieldValues:TZt}=wNn(),{kEnumerableProperty:nJ,isDisturbed:Bfs}=Ms(),{webidl:yi}=TA(),{Response:Lfs,cloneResponse:Ffs,fromInnerResponse:Ufs}=Bwe(),{Request:H3,fromInnerRequest:Qfs}=Xue(),{kState:Fk}=fq(),{fetching:qfs}=Fwe(),{urlIsHttpHttpsScheme:srt,createDeferredPromise:rde,readAllBytes:jfs}=FS(),IZt=require("node:assert"),art=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==Mfs&&yi.illegalConstructor(),yi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){yi.brandCheck(this,t);let n="Cache.match";yi.argumentLengthCheck(arguments,1,n),e=yi.converters.RequestInfo(e,n,"request"),r=yi.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={}){yi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=yi.converters.RequestInfo(e,n,"request")),r=yi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){yi.brandCheck(this,t);let r="Cache.add";yi.argumentLengthCheck(arguments,1,r),e=yi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){yi.brandCheck(this,t);let r="Cache.addAll";yi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw yi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=yi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[Fk];if(!srt(g.url)||g.method!=="GET")throw yi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new H3(m)[Fk];if(!srt(g.url))throw yi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=rde();s.push(qfs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(yi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=TZt(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(yi.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=rde(),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){yi.brandCheck(this,t);let n="Cache.put";yi.argumentLengthCheck(arguments,2,n),e=yi.converters.RequestInfo(e,n,"request"),r=yi.converters.Response(r,n,"response");let o=null;if(e instanceof H3?o=e[Fk]:o=new H3(e)[Fk],!srt(o.url)||o.method!=="GET")throw yi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[Fk];if(s.status===206)throw yi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=TZt(s.headersList.get("vary"));for(let A of g)if(A==="*")throw yi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(Bfs(s.body.stream)||s.body.stream.locked))throw yi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=Ffs(s),l=rde();if(s.body!=null){let A=s.body.stream.getReader();jfs(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=rde(),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={}){yi.brandCheck(this,t);let n="Cache.delete";yi.argumentLengthCheck(arguments,1,n),e=yi.converters.RequestInfo(e,n,"request"),r=yi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof H3){if(o=e[Fk],o.method!=="GET"&&!r.ignoreMethod)return!1}else IZt(typeof e=="string"),o=new H3(e)[Fk];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=rde(),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={}){yi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=yi.converters.RequestInfo(e,n,"request")),r=yi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof H3){if(o=e[Fk],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new H3(e)[Fk]);let s=rde(),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=Qfs(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 yi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw yi.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);IZt(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw yi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!srt(u.url))throw yi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw yi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw yi.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);IZt(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=""),!Ofs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=TZt(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 H3){if(o=e[Fk],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new H3(e)[Fk]);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=Ufs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(art.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:nJ,matchAll:nJ,add:nJ,addAll:nJ,put:nJ,delete:nJ,keys:nJ});var RNn=[{key:"ignoreSearch",converter:yi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:yi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:yi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];yi.converters.CacheQueryOptions=yi.dictionaryConverter(RNn);yi.converters.MultiCacheQueryOptions=yi.dictionaryConverter([...RNn,{key:"cacheName",converter:yi.converters.DOMString}]);yi.converters.Response=yi.interfaceConverter(Lfs);yi.converters["sequence"]=yi.sequenceConverter(yi.converters.RequestInfo);PNn.exports={Cache:art}});var NNn=I((pHd,DNn)=>{"use strict";p();var{kConstruct:Qwe}=ort(),{Cache:crt}=kNn(),{webidl:iE}=TA(),{kEnumerableProperty:qwe}=Ms(),lrt=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Qwe&&iE.illegalConstructor(),iE.util.markAsUncloneable(this)}async match(e,r={}){if(iE.brandCheck(this,t),iE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=iE.converters.RequestInfo(e),r=iE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new crt(Qwe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new crt(Qwe,n).match(e,r);if(s!==void 0)return s}}async has(e){iE.brandCheck(this,t);let r="CacheStorage.has";return iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){iE.brandCheck(this,t);let r="CacheStorage.open";if(iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new crt(Qwe,o)}let n=[];return this.#e.set(e,n),new crt(Qwe,n)}async delete(e){iE.brandCheck(this,t);let r="CacheStorage.delete";return iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return iE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(lrt.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:qwe,has:qwe,open:qwe,delete:qwe,keys:qwe});DNn.exports={CacheStorage:lrt}});var ONn=I((gHd,MNn)=>{"use strict";p();MNn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var xZt=I((yHd,QNn)=>{"use strict";p();function Hfs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(Hfs,"isCTLExcludingHtab");function BNn(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(BNn,"validateCookieName");function LNn(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(LNn,"validateCookieValue");function FNn(t){for(let e=0;ee.toString().padStart(2,"0"));function UNn(t){return typeof t=="number"&&(t=new Date(t)),`${$fs[t.getUTCDay()]}, ${urt[t.getUTCDate()]} ${Vfs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${urt[t.getUTCHours()]}:${urt[t.getUTCMinutes()]}:${urt[t.getUTCSeconds()]} GMT`}a(UNn,"toIMFDate");function Wfs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(Wfs,"validateCookieMaxAge");function zfs(t){if(t.name.length===0)return null;BNn(t.name),LNn(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"&&(Wfs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(Gfs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(FNn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${UNn(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(zfs,"stringify");QNn.exports={isCTLExcludingHtab:Hfs,validateCookieName:BNn,validateCookiePath:FNn,validateCookieValue:LNn,toIMFDate:UNn,stringify:zfs}});var jNn=I((vHd,qNn)=>{"use strict";p();var{maxNameValuePairSize:Yfs,maxAttributeValueSize:Kfs}=ONn(),{isCTLExcludingHtab:Jfs}=xZt(),{collectASequenceOfCodePointsFast:drt}=FC(),Zfs=require("node:assert");function Xfs(t){if(Jfs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=drt(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=drt("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>Yfs?null:{name:n,value:o,...nde(r)}}a(Xfs,"parseSetCookie");function nde(t,e={}){if(t.length===0)return e;Zfs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=drt(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=drt("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>Kfs)return nde(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 nde(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 nde(t,e)}a(nde,"parseUnparsedAttributes");qNn.exports={parseSetCookie:Xfs,parseUnparsedAttributes:nde}});var $Nn=I((SHd,GNn)=>{"use strict";p();var{parseSetCookie:eps}=jNn(),{stringify:tps}=xZt(),{webidl:ca}=TA(),{Headers:frt}=ZK();function rps(t){ca.argumentLengthCheck(arguments,1,"getCookies"),ca.brandCheck(t,frt,{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(rps,"getCookies");function nps(t,e,r){ca.brandCheck(t,frt,{strict:!1});let n="deleteCookie";ca.argumentLengthCheck(arguments,2,n),e=ca.converters.DOMString(e,n,"name"),r=ca.converters.DeleteCookieAttributes(r),HNn(t,{name:e,value:"",expires:new Date(0),...r})}a(nps,"deleteCookie");function ips(t){ca.argumentLengthCheck(arguments,1,"getSetCookies"),ca.brandCheck(t,frt,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>eps(r)):[]}a(ips,"getSetCookies");function HNn(t,e){ca.argumentLengthCheck(arguments,2,"setCookie"),ca.brandCheck(t,frt,{strict:!1}),e=ca.converters.Cookie(e);let r=tps(e);r&&t.append("Set-Cookie",r)}a(HNn,"setCookie");ca.converters.DeleteCookieAttributes=ca.dictionaryConverter([{converter:ca.nullableConverter(ca.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);ca.converters.Cookie=ca.dictionaryConverter([{converter:ca.converters.DOMString,key:"name"},{converter:ca.converters.DOMString,key:"value"},{converter:ca.nullableConverter(t=>typeof t=="number"?ca.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:ca.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:ca.sequenceConverter(ca.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);GNn.exports={getCookies:rps,deleteCookie:nps,getSetCookies:ips,setCookie:HNn}});var ode=I((xHd,WNn)=>{"use strict";p();var{webidl:fi}=TA(),{kEnumerableProperty:jC}=Ms(),{kConstruct:VNn}=Nd(),{MessagePort:ops}=require("node:worker_threads"),ide=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===VNn){super(arguments[1],arguments[2]),fi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get data(){return fi.brandCheck(this,t),this.#e.data}get origin(){return fi.brandCheck(this,t),this.#e.origin}get lastEventId(){return fi.brandCheck(this,t),this.#e.lastEventId}get source(){return fi.brandCheck(this,t),this.#e.source}get ports(){return fi.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 fi.brandCheck(this,t),fi.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(VNn,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:sps}=ide;delete ide.createFastMessageEvent;var prt=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.CloseEventInit(r),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get wasClean(){return fi.brandCheck(this,t),this.#e.wasClean}get code(){return fi.brandCheck(this,t),this.#e.code}get reason(){return fi.brandCheck(this,t),this.#e.reason}},hrt=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";fi.argumentLengthCheck(arguments,1,n),super(e,r),fi.util.markAsUncloneable(this),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return fi.brandCheck(this,t),this.#e.message}get filename(){return fi.brandCheck(this,t),this.#e.filename}get lineno(){return fi.brandCheck(this,t),this.#e.lineno}get colno(){return fi.brandCheck(this,t),this.#e.colno}get error(){return fi.brandCheck(this,t),this.#e.error}};Object.defineProperties(ide.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:jC,origin:jC,lastEventId:jC,source:jC,ports:jC,initMessageEvent:jC});Object.defineProperties(prt.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:jC,code:jC,wasClean:jC});Object.defineProperties(hrt.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:jC,filename:jC,lineno:jC,colno:jC,error:jC});fi.converters.MessagePort=fi.interfaceConverter(ops);fi.converters["sequence"]=fi.sequenceConverter(fi.converters.MessagePort);var wZt=[{key:"bubbles",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];fi.converters.MessageEventInit=fi.dictionaryConverter([...wZt,{key:"data",converter:fi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:fi.nullableConverter(fi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:fi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);fi.converters.CloseEventInit=fi.dictionaryConverter([...wZt,{key:"wasClean",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:fi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);fi.converters.ErrorEventInit=fi.dictionaryConverter([...wZt,{key:"message",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:fi.converters.any}]);WNn.exports={MessageEvent:ide,CloseEvent:prt,ErrorEvent:hrt,createFastMessageEvent:sps}});var iJ=I((PHd,zNn)=>{"use strict";p();var aps="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",cps={enumerable:!0,writable:!1,configurable:!1},lps={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},ups={NOT_SENT:0,PROCESSING:1,SENT:2},dps={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},fps=2**16-1,pps={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},hps=Buffer.allocUnsafe(0),mps={string:1,typedArray:2,arrayBuffer:3,blob:4};zNn.exports={uid:aps,sentCloseFrameState:ups,staticPropertyDescriptors:cps,states:lps,opcodes:dps,maxUnsigned16Bit:fps,parserStates:pps,emptyBuffer:hps,sendHints:mps}});var jwe=I((DHd,YNn)=>{"use strict";p();YNn.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 $we=I((MHd,iMn)=>{"use strict";p();var{kReadyState:Hwe,kController:gps,kResponse:Aps,kBinaryType:yps,kWebSocketURL:Eps}=jwe(),{states:Gwe,opcodes:xq}=iJ(),{ErrorEvent:_ps,createFastMessageEvent:vps}=ode(),{isUtf8:Cps}=require("node:buffer"),{collectASequenceOfCodePointsFast:bps,removeHTTPWhitespace:KNn}=FC();function Sps(t){return t[Hwe]===Gwe.CONNECTING}a(Sps,"isConnecting");function Tps(t){return t[Hwe]===Gwe.OPEN}a(Tps,"isEstablished");function Ips(t){return t[Hwe]===Gwe.CLOSING}a(Ips,"isClosing");function xps(t){return t[Hwe]===Gwe.CLOSED}a(xps,"isClosed");function RZt(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(RZt,"fireEvent");function wps(t,e,r){if(t[Hwe]!==Gwe.OPEN)return;let n;if(e===xq.TEXT)try{n=nMn(r)}catch{ZNn(t,"Received invalid UTF-8 in text frame.");return}else e===xq.BINARY&&(t[yps]==="blob"?n=new Blob([r]):n=Rps(r));RZt("message",t,vps,{origin:t[Eps].origin,data:n})}a(wps,"websocketMessageReceived");function Rps(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(Rps,"toArrayBuffer");function Pps(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(Pps,"isValidSubprotocol");function kps(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(kps,"isValidStatusCode");function ZNn(t,e){let{[gps]:r,[Aps]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&RZt("error",t,(o,s)=>new _ps(o,s),{error:new Error(e),message:e})}a(ZNn,"failWebsocketConnection");function XNn(t){return t===xq.CLOSE||t===xq.PING||t===xq.PONG}a(XNn,"isControlFrame");function eMn(t){return t===xq.CONTINUATION}a(eMn,"isContinuationFrame");function tMn(t){return t===xq.TEXT||t===xq.BINARY}a(tMn,"isTextBinaryFrame");function Dps(t){return tMn(t)||eMn(t)||XNn(t)}a(Dps,"isValidOpcode");function Nps(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(Mps,"isValidClientWindowBits");var rMn=typeof process.versions.icu=="string",JNn=rMn?new TextDecoder("utf-8",{fatal:!0}):void 0,nMn=rMn?JNn.decode.bind(JNn):function(t){if(Cps(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};iMn.exports={isConnecting:Sps,isEstablished:Tps,isClosing:Ips,isClosed:xps,fireEvent:RZt,isValidSubprotocol:Pps,isValidStatusCode:kps,failWebsocketConnection:ZNn,websocketMessageReceived:wps,utf8Decode:nMn,isControlFrame:XNn,isContinuationFrame:eMn,isTextBinaryFrame:tMn,isValidOpcode:Dps,parseExtensions:Nps,isValidClientWindowBits:Mps}});var grt=I((LHd,oMn)=>{"use strict";p();var{maxUnsigned16Bit:Ops}=iJ(),mrt=16386,PZt,Vwe=null,sde=mrt;try{PZt=require("node:crypto")}catch{PZt={randomFillSync:a(function(e,r,n){for(let o=0;oOps?(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:Lps,states:Wwe,sentCloseFrameState:Art,emptyBuffer:Fps,opcodes:Ups}=iJ(),{kReadyState:zwe,kSentClose:yrt,kByteParser:aMn,kReceivedClose:sMn,kResponse:cMn}=jwe(),{fireEvent:Qps,failWebsocketConnection:wq,isClosing:qps,isClosed:jps,isEstablished:Hps,parseExtensions:Gps}=$we(),{channels:ade}=yue(),{CloseEvent:$ps}=ode(),{makeRequest:Vps}=Xue(),{fetching:Wps}=Fwe(),{Headers:zps,getHeadersList:Yps}=ZK(),{getDecodeSplit:Kps}=FS(),{WebsocketFrameSend:Jps}=grt(),DZt;try{DZt=require("node:crypto")}catch{}function Zps(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=Vps({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=Yps(new zps(s.headers));l.headersList=h}let u=DZt.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"),Wps({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){wq(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){wq(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){wq(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){wq(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=DZt.createHash("sha1").update(u+Lps).digest("base64");if(m!==g){wq(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=Gps(A),!y.has("permessage-deflate"))){wq(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!Kps("sec-websocket-protocol",l.headersList).includes(E)){wq(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",lMn),h.socket.on("close",uMn),h.socket.on("error",dMn),ade.open.hasSubscribers&&ade.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(Zps,"establishWebSocketConnection");function Xps(t,e,r,n){if(!(qps(t)||jps(t)))if(!Hps(t))wq(t,"Connection was closed before it was established."),t[zwe]=Wwe.CLOSING;else if(t[yrt]===Art.NOT_SENT){t[yrt]=Art.PROCESSING;let o=new Jps;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=Fps,t[cMn].socket.write(o.createFrame(Ups.CLOSE)),t[yrt]=Art.SENT,t[zwe]=Wwe.CLOSING}else t[zwe]=Wwe.CLOSING}a(Xps,"closeWebSocketConnection");function lMn(t){this.ws[aMn].write(t)||this.pause()}a(lMn,"onSocketData");function uMn(){let{ws:t}=this,{[cMn]:e}=t;e.socket.off("data",lMn),e.socket.off("close",uMn),e.socket.off("error",dMn);let r=t[yrt]===Art.SENT&&t[sMn],n=1005,o="",s=t[aMn].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[sMn]||(n=1006),t[zwe]=Wwe.CLOSED,Qps("close",t,(c,l)=>new $ps(c,l),{wasClean:r,code:n,reason:o}),ade.close.hasSubscribers&&ade.close.publish({websocket:t,code:n,reason:o})}a(uMn,"onSocketClose");function dMn(t){let{ws:e}=this;e[zwe]=Wwe.CLOSING,ade.socketError.hasSubscribers&&ade.socketError.publish(t),this.destroy()}a(dMn,"onSocketError");fMn.exports={establishWebSocketConnection:Zps,closeWebSocketConnection:Xps}});var mMn=I((HHd,hMn)=>{"use strict";p();var{createInflateRaw:ehs,Z_DEFAULT_WINDOWBITS:ths}=require("node:zlib"),{isValidClientWindowBits:rhs}=$we(),{MessageSizeExceededError:pMn}=pc(),nhs=Buffer.from([0,0,255,255]),Ert=Symbol("kBuffer"),Ywe=Symbol("kLength"),ihs=4*1024*1024,MZt=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 pMn);return}if(!this.#e){let o=ths;if(this.#t.serverMaxWindowBits){if(!rhs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=ehs({windowBits:o})}catch(s){n(s);return}this.#e[Ert]=[],this.#e[Ywe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Ywe]+=s.length,this.#e[Ywe]>ihs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new pMn)}return}this.#e[Ert].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(nhs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Ert],this.#e[Ywe]);this.#e[Ert].length=0,this.#e[Ywe]=0,this.#n=null,n(null,o)})}};hMn.exports={PerMessageDeflate:MZt}});var TMn=I((VHd,SMn)=>{"use strict";p();var{Writable:ohs}=require("node:stream"),shs=require("node:assert"),{parserStates:HC,opcodes:cde,states:ahs,emptyBuffer:gMn,sentCloseFrameState:AMn}=iJ(),{kReadyState:chs,kSentClose:yMn,kResponse:EMn,kReceivedClose:_Mn}=jwe(),{channels:_rt}=yue(),{isValidStatusCode:lhs,isValidOpcode:uhs,failWebsocketConnection:$S,websocketMessageReceived:vMn,utf8Decode:dhs,isControlFrame:CMn,isTextBinaryFrame:OZt,isContinuationFrame:fhs}=$we(),{WebsocketFrameSend:bMn}=grt(),{closeWebSocketConnection:phs}=NZt(),{PerMessageDeflate:hhs}=mMn(),BZt=class extends ohs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=HC.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 hhs(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===HC.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!==cde.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!uhs(o))return $S(this.ws,"Invalid opcode received"),e();if(s)return $S(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){$S(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){$S(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!OZt(o)){$S(this.ws,"Invalid frame type was fragmented.");return}if(OZt(o)&&this.#o.length>0){$S(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){$S(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&CMn(o)){$S(this.ws,"Control frame either too large or fragmented");return}if(fhs(o)&&this.#o.length===0&&!this.#i.compressed){$S(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=HC.READ_DATA):l===126?this.#n=HC.PAYLOADLENGTH_16:l===127&&(this.#n=HC.PAYLOADLENGTH_64),OZt(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===HC.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=HC.READ_DATA}else if(this.#n===HC.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){$S(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=HC.READ_DATA}else if(this.#n===HC.READ_DATA){if(this.#t{if(n){$S(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=HC.INFO,this.#r=!0,this.run(e);return}vMn(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=HC.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);vMn(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=HC.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return gMn;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){shs(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!lhs(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=dhs(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===cde.CLOSE){if(n===1)return $S(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 phs(this.ws,o,s,s.length),$S(this.ws,s),!1}if(this.ws[yMn]!==AMn.SENT){let o=gMn;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new bMn(o);this.ws[EMn].socket.write(s.createFrame(cde.CLOSE),c=>{c||(this.ws[yMn]=AMn.SENT)})}return this.ws[chs]=ahs.CLOSING,this.ws[_Mn]=!0,!1}else if(r===cde.PING){if(!this.ws[_Mn]){let o=new bMn(e);this.ws[EMn].socket.write(o.createFrame(cde.PONG)),_rt.ping.hasSubscribers&&_rt.ping.publish({payload:e})}}else r===cde.PONG&&_rt.pong.hasSubscribers&&_rt.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};SMn.exports={ByteParser:BZt}});var PMn=I((YHd,RMn)=>{"use strict";p();var{WebsocketFrameSend:mhs}=grt(),{opcodes:IMn,sendHints:lde}=iJ(),ghs=VKt(),xMn=Buffer[Symbol.species],LZt=class{static{a(this,"SendQueue")}#e=new ghs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==lde.blob){let s=wMn(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=wMn(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 wMn(t,e){return new mhs(Ahs(t,e)).createFrame(e===lde.string?IMn.TEXT:IMn.BINARY)}a(wMn,"createFrame");function Ahs(t,e){switch(e){case lde.string:return Buffer.from(t);case lde.arrayBuffer:case lde.blob:return new xMn(t);case lde.typedArray:return new xMn(t.buffer,t.byteOffset,t.byteLength)}}a(Ahs,"toBuffer");RMn.exports={SendQueue:LZt}});var UMn=I((ZHd,FMn)=>{"use strict";p();var{webidl:oo}=TA(),{URLSerializer:yhs}=FC(),{environmentSettingsObject:kMn}=FS(),{staticPropertyDescriptors:Rq,states:Kwe,sentCloseFrameState:Ehs,sendHints:vrt}=iJ(),{kWebSocketURL:DMn,kReadyState:FZt,kController:_hs,kBinaryType:Crt,kResponse:NMn,kSentClose:vhs,kByteParser:Chs}=jwe(),{isConnecting:bhs,isEstablished:Shs,isClosing:Ths,isValidSubprotocol:Ihs,fireEvent:MMn}=$we(),{establishWebSocketConnection:xhs,closeWebSocketConnection:OMn}=NZt(),{ByteParser:whs}=TMn(),{kEnumerableProperty:Zx,isBlobLike:BMn}=Ms(),{getGlobalDispatcher:Rhs}=Ltt(),{types:LMn}=require("node:util"),{ErrorEvent:Phs,CloseEvent:khs}=ode(),{SendQueue:Dhs}=PMn(),VS=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=kMn.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=>Ihs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[DMn]=new URL(c.href);let l=kMn.settingsObject;this[_hs]=xhs(c,r,l,this,(u,d)=>this.#o(u,d),o),this[FZt]=t.CONNECTING,this[vhs]=Ehs.NOT_SENT,this[Crt]="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");OMn(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"),bhs(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!Shs(this)||Ths(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},vrt.string)}else LMn.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},vrt.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},vrt.typedArray)):BMn(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},vrt.blob))}get readyState(){return oo.brandCheck(this,t),this[FZt]}get bufferedAmount(){return oo.brandCheck(this,t),this.#t}get url(){return oo.brandCheck(this,t),yhs(this[DMn])}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[Crt]}set binaryType(e){oo.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Crt]="blob":this[Crt]=e}#o(e,r){this[NMn]=e;let n=new whs(this,r);n.on("drain",Nhs),n.on("error",Mhs.bind(this)),e.socket.ws=this,this[Chs]=n,this.#i=new Dhs(e.socket),this[FZt]=Kwe.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),MMn("open",this)}};VS.CONNECTING=VS.prototype.CONNECTING=Kwe.CONNECTING;VS.OPEN=VS.prototype.OPEN=Kwe.OPEN;VS.CLOSING=VS.prototype.CLOSING=Kwe.CLOSING;VS.CLOSED=VS.prototype.CLOSED=Kwe.CLOSED;Object.defineProperties(VS.prototype,{CONNECTING:Rq,OPEN:Rq,CLOSING:Rq,CLOSED:Rq,url:Zx,readyState:Zx,bufferedAmount:Zx,onopen:Zx,onerror:Zx,onclose:Zx,close:Zx,onmessage:Zx,binaryType:Zx,send:Zx,extensions:Zx,protocol:Zx,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(VS,{CONNECTING:Rq,OPEN:Rq,CLOSING:Rq,CLOSED:Rq});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(()=>Rhs(),"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(BMn(t))return oo.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||LMn.isArrayBuffer(t))return oo.converters.BufferSource(t)}return oo.converters.USVString(t)};function Nhs(){this.ws[NMn].socket.resume()}a(Nhs,"onParserDrain");function Mhs(t){let e,r;t instanceof khs?(e=t.reason,r=t.code):e=t.message,MMn("error",this,()=>new Phs("error",{error:t,message:e})),OMn(this,r)}a(Mhs,"onParserError");FMn.exports={WebSocket:VS}});var UZt=I((tGd,QMn)=>{"use strict";p();function Ohs(t){return t.indexOf("\0")===-1}a(Ohs,"isValidLastEventId");function Bhs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(Bhs,"isASCIINumber");function Lhs(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(Lhs,"delay");QMn.exports={isValidLastEventId:Ohs,isASCIINumber:Bhs,delay:Lhs}});var GMn=I((iGd,HMn)=>{"use strict";p();var{Transform:Fhs}=require("node:stream"),{isASCIINumber:qMn,isValidLastEventId:jMn}=UZt(),G3=[239,187,191],QZt=10,brt=13,Uhs=58,Qhs=32,qZt=class extends Fhs{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]===G3[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===G3[0]&&this.buffer[1]===G3[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===G3[0]&&this.buffer[1]===G3[1]&&this.buffer[2]===G3[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===G3[0]&&this.buffer[1]===G3[1]&&this.buffer[2]===G3[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&qMn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&jMn(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}}};HMn.exports={EventSourceStream:qZt}});var ZMn=I((aGd,JMn)=>{"use strict";p();var{pipeline:qhs}=require("node:stream"),{fetching:jhs}=Fwe(),{makeRequest:Hhs}=Xue(),{webidl:$3}=TA(),{EventSourceStream:Ghs}=GMn(),{parseMIMEType:$hs}=FC(),{createFastMessageEvent:Vhs}=ode(),{isNetworkError:$Mn}=Bwe(),{delay:Whs}=UZt(),{kEnumerableProperty:oJ}=Ms(),{environmentSettingsObject:VMn}=FS(),WMn=!1,zMn=3e3,Jwe=0,YMn=1,Zwe=2,zhs="anonymous",Yhs="use-credentials",ude=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=Jwe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),$3.util.markAsUncloneable(this);let n="EventSource constructor";$3.argumentLengthCheck(arguments,1,n),WMn||(WMn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=$3.converters.USVString(e,n,"url"),r=$3.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:zMn};let o=VMn,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=zhs;r.withCredentials&&(c=Yhs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=VMn.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=Hhs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Zwe)return;this.#n=Jwe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{$Mn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if($Mn(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?$hs(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=YMn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new Ghs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(Vhs(u.type,u.options))},"push")});qhs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=jhs(e)}async#u(){this.#n!==Zwe&&(this.#n=Jwe,this.dispatchEvent(new Event("error")),await Whs(this.#a.reconnectionTime),this.#n===Jwe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){$3.brandCheck(this,t),this.#n!==Zwe&&(this.#n=Zwe,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}},KMn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Jwe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:YMn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Zwe,writable:!1}};Object.defineProperties(ude,KMn);Object.defineProperties(ude.prototype,KMn);Object.defineProperties(ude.prototype,{close:oJ,onerror:oJ,onmessage:oJ,onopen:oJ,readyState:oJ,url:oJ,withCredentials:oJ});$3.converters.EventSourceInitDict=$3.dictionaryConverter([{key:"withCredentials",converter:$3.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:$3.converters.any}]);JMn.exports={EventSource:ude,defaultReconnectionTime:zMn}});var rOn=I((uGd,zi)=>{"use strict";p();var Khs=Fue(),XMn=rwe(),Jhs=Uue(),Zhs=KPn(),Xhs=Que(),e0s=fJt(),t0s=_kn(),r0s=Ikn(),eOn=pc(),Trt=Ms(),{InvalidArgumentError:Srt}=eOn,dde=f2n(),n0s=iwe(),i0s=WJt(),o0s=z2n(),s0s=KJt(),a0s=MJt(),c0s=xtt(),{getGlobalDispatcher:tOn,setGlobalDispatcher:l0s}=Ltt(),u0s=Ftt(),d0s=gtt(),f0s=Att();Object.assign(XMn.prototype,dde);zi.exports.Dispatcher=XMn;zi.exports.Client=Khs;zi.exports.Pool=Jhs;zi.exports.BalancedPool=Zhs;zi.exports.Agent=Xhs;zi.exports.ProxyAgent=e0s;zi.exports.EnvHttpProxyAgent=t0s;zi.exports.RetryAgent=r0s;zi.exports.RetryHandler=c0s;zi.exports.DecoratorHandler=u0s;zi.exports.RedirectHandler=d0s;zi.exports.createRedirectInterceptor=f0s;zi.exports.interceptors={redirect:tDn(),retry:nDn(),dump:oDn(),dns:cDn()};zi.exports.buildConnector=n0s;zi.exports.errors=eOn;zi.exports.util={parseHeaders:Trt.parseHeaders,headerNameToString:Trt.headerNameToString};function Xwe(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 Srt("invalid url");if(r!=null&&typeof r!="object")throw new Srt("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new Srt("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Trt.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Trt.parseURL(e);let{agent:o,dispatcher:s=tOn()}=r;if(o)throw new Srt("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(Xwe,"makeDispatcher");zi.exports.setGlobalDispatcher=l0s;zi.exports.getGlobalDispatcher=tOn;var p0s=Fwe().fetch;zi.exports.fetch=a(async function(e,r=void 0){try{return await p0s(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");zi.exports.Headers=ZK().Headers;zi.exports.Response=Bwe().Response;zi.exports.Request=Xue().Request;zi.exports.FormData=dwe().FormData;zi.exports.File=globalThis.File??require("node:buffer").File;zi.exports.FileReader=SNn().FileReader;var{setGlobalOrigin:h0s,getGlobalOrigin:m0s}=pKt();zi.exports.setGlobalOrigin=h0s;zi.exports.getGlobalOrigin=m0s;var{CacheStorage:g0s}=NNn(),{kConstruct:A0s}=ort();zi.exports.caches=new g0s(A0s);var{deleteCookie:y0s,getCookies:E0s,getSetCookies:_0s,setCookie:v0s}=$Nn();zi.exports.deleteCookie=y0s;zi.exports.getCookies=E0s;zi.exports.getSetCookies=_0s;zi.exports.setCookie=v0s;var{parseMIMEType:C0s,serializeAMimeType:b0s}=FC();zi.exports.parseMIMEType=C0s;zi.exports.serializeAMimeType=b0s;var{CloseEvent:S0s,ErrorEvent:T0s,MessageEvent:I0s}=ode();zi.exports.WebSocket=UMn().WebSocket;zi.exports.CloseEvent=S0s;zi.exports.ErrorEvent=T0s;zi.exports.MessageEvent=I0s;zi.exports.request=Xwe(dde.request);zi.exports.stream=Xwe(dde.stream);zi.exports.pipeline=Xwe(dde.pipeline);zi.exports.connect=Xwe(dde.connect);zi.exports.upgrade=Xwe(dde.upgrade);zi.exports.MockClient=i0s;zi.exports.MockPool=s0s;zi.exports.MockAgent=o0s;zi.exports.mockErrors=a0s;var{EventSource:x0s}=ZMn();zi.exports.EventSource=x0s});var ls=I((pGd,nOn)=>{p();nOn.exports={options:{usePureJavaScript:!1}}});var sOn=I((mGd,oOn)=>{p();var jZt={};oOn.exports=jZt;var iOn={};jZt.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=w0s(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};jZt.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=iOn[e];if(!r){r=iOn[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(w0s,"_encodeWithByteBuffer")});var rc=I((yGd,uOn)=>{p();var aOn=ls(),cOn=sOn(),rt=uOn.exports=aOn.util=aOn.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){rt.nextTick=process.nextTick,typeof setImmediate=="function"?rt.setImmediate=setImmediate:rt.setImmediate=rt.nextTick;return}if(typeof setImmediate=="function"){rt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},rt.nextTick=function(l){return setImmediate(l)};return}if(rt.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=[];rt.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=rt.setImmediate;rt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}rt.nextTick=rt.setImmediate})();rt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;rt.globalScope=(function(){return rt.isNodejs?global:typeof self>"u"?window:self})();rt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};rt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};rt.isArrayBufferView=function(t){return t&&rt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function eRe(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(eRe,"_checkBitsParam");rt.ByteBuffer=HZt;function HZt(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(rt.isArrayBuffer(t)||rt.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;rR0s&&(this.data.substr(0,1),this._constructedStringLength=0)};rt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};rt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};rt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};rt.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};rt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};rt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(rt.encodeUtf8(t))};rt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};rt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};rt.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))};rt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};rt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};rt.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))};rt.ByteStringBuffer.prototype.putInt=function(t,e){eRe(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};rt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};rt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};rt.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};rt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};rt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};rt.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};rt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};rt.ByteStringBuffer.prototype.copy=function(){var t=rt.createBuffer(this.data);return t.read=this.read,t};rt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};rt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};rt.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};rt.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};rt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};rt.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};rt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};rt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};rt.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};rt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};rt.DataBuffer.prototype.putInt=function(t,e){eRe(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};rt.DataBuffer.prototype.putSignedInt=function(t,e){return eRe(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};rt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};rt.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};rt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};rt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};rt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};rt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};rt.DataBuffer.prototype.copy=function(){return new rt.DataBuffer(this)};rt.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};rt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};rt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};rt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};rt.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};rt.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 Pq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",kq=[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],lOn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";rt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=Pq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Pq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Pq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};rt.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};rt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};rt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};rt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:cOn.encode,decode:cOn.decode}};rt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};rt.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+=Pq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Pq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Pq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};rt.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)};rt.binary.base58.encode=function(t,e){return rt.binary.baseN.encode(t,lOn,e)};rt.binary.base58.decode=function(t,e){return rt.binary.baseN.decode(t,lOn,e)};rt.text={utf8:{},utf16:{}};rt.text.utf8.encode=function(t,e,r){t=rt.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");rt.setItem=function(t,e,r,n,o){Irt(k0s,arguments,o)};rt.getItem=function(t,e,r,n){return Irt(D0s,arguments,n)};rt.removeItem=function(t,e,r,n){Irt(N0s,arguments,n)};rt.clearItems=function(t,e,r){Irt(M0s,arguments,r)};rt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};rt.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("")};rt.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):"")};rt.formatSize=function(t){return t>=1073741824?t=rt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=rt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=rt.formatNumber(t/1024,0)+" KiB":t=rt.formatNumber(t,0)+" bytes",t};rt.bytesFromIP=function(t){return t.indexOf(".")!==-1?rt.bytesFromIPv4(t):t.indexOf(":")!==-1?rt.bytesFromIPv6(t):null};rt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=rt.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(":")};rt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in rt&&!t.update)return e(null,rt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return rt.cores=navigator.hardwareConcurrency,e(null,rt.cores);if(typeof Worker>"u")return rt.cores=1,e(null,rt.cores);if(typeof Blob>"u")return rt.cores=2,e(null,rt.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 hg=ls();rc();dOn.exports=hg.cipher=hg.cipher||{};hg.cipher.algorithms=hg.cipher.algorithms||{};hg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=hg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new hg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};hg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=hg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new hg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};hg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),hg.cipher.algorithms[t]=e};hg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in hg.cipher.algorithms?hg.cipher.algorithms[t]:null};var VZt=hg.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)};VZt.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=hg.util.createBuffer(),this.output=t.output||hg.util.createBuffer(),this.mode.start(e)};VZt.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()};VZt.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 zZt=I((bGd,fOn)=>{p();var mg=ls();rc();mg.cipher=mg.cipher||{};var $s=fOn.exports=mg.cipher.modes=mg.cipher.modes||{};$s.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)};$s.ecb.prototype.start=function(t){};$s.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)};$s.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)};$s.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=wrt(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};$s.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)};$s.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};$s.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=wrt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};$s.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};$s.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};$s.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};$s.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=wrt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};$s.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};$s.ofb.prototype.decrypt=$s.ofb.prototype.encrypt;$s.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};$s.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=wrt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};$s.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}Rrt(this._inBlock)};$s.ctr.prototype.decrypt=$s.ctr.prototype.encrypt;$s.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};$s.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(WZt(n*8)))}this._inBlock=this._j0.slice(0),Rrt(this._inBlock),this._partialBytes=0,r=mg.util.createBuffer(r),this._aDataLength=WZt(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()])};$s.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),Rrt(this._inBlock)};$s.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Rrt(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)};$s.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};$s.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)};$s.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 yu=ls();xrt();zZt();rc();gOn.exports=yu.aes=yu.aes||{};yu.aes.startEncrypting=function(t,e,r,n){var o=Prt({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};yu.aes.createEncryptionCipher=function(t,e){return Prt({key:t,output:null,decrypt:!1,mode:e})};yu.aes.startDecrypting=function(t,e,r,n){var o=Prt({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};yu.aes.createDecryptionCipher=function(t,e){return Prt({key:t,output:null,decrypt:!0,mode:e})};yu.aes.Algorithm=function(t,e){JZt||hOn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return KZt(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return KZt(r._w,n,o,!0)},"decrypt")}}),r._init=!1};yu.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=yu.util.createBuffer(e);else if(yu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=yu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,Q_[r]=l,YZt[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)sJ[h][r]=d,Uk[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(hOn,"initialize");function mOn(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=fde*c,u=s;u>>16&255]<<24^Q_[n>>>8&255]<<16^Q_[n&255]<<8^Q_[n>>>24]^pOn[o]<<24,o++):s>6&&u%s===4&&(n=Q_[n>>>24]<<24^Q_[n>>>16&255]<<16^Q_[n>>>8&255]<<8^Q_[n&255]),r[u]=r[u-s]^n;if(e){var d,f=Uk[0],h=Uk[1],m=Uk[2],g=Uk[3],A=r.slice(0);l=r.length;for(var u=0,y=l-fde;u>>24]]^h[Q_[d>>>16&255]]^m[Q_[d>>>8&255]]^g[Q_[d&255]];r=A}return r}a(mOn,"_expandKey");function KZt(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=Uk[0],c=Uk[1],l=Uk[2],u=Uk[3],d=YZt):(s=sJ[0],c=sJ[1],l=sJ[2],u=sJ[3],d=Q_);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(KZt,"_updateBlock");function Prt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=yu.cipher.createDecipher(r,t.key):n=yu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof yu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Prt,"_createCipher")});var Nq=I((RGd,AOn)=>{p();var tRe=ls();tRe.pki=tRe.pki||{};var ZZt=AOn.exports=tRe.pki.oids=tRe.oids=tRe.oids||{};function rr(t,e){ZZt[t]=e,ZZt[e]=t}a(rr,"_IN");function Bc(t,e){ZZt[t]=e}a(Bc,"_I_");rr("1.2.840.113549.1.1.1","rsaEncryption");rr("1.2.840.113549.1.1.4","md5WithRSAEncryption");rr("1.2.840.113549.1.1.5","sha1WithRSAEncryption");rr("1.2.840.113549.1.1.7","RSAES-OAEP");rr("1.2.840.113549.1.1.8","mgf1");rr("1.2.840.113549.1.1.9","pSpecified");rr("1.2.840.113549.1.1.10","RSASSA-PSS");rr("1.2.840.113549.1.1.11","sha256WithRSAEncryption");rr("1.2.840.113549.1.1.12","sha384WithRSAEncryption");rr("1.2.840.113549.1.1.13","sha512WithRSAEncryption");rr("1.3.101.112","EdDSA25519");rr("1.2.840.10040.4.3","dsa-with-sha1");rr("1.3.14.3.2.7","desCBC");rr("1.3.14.3.2.26","sha1");rr("1.3.14.3.2.29","sha1WithRSASignature");rr("2.16.840.1.101.3.4.2.1","sha256");rr("2.16.840.1.101.3.4.2.2","sha384");rr("2.16.840.1.101.3.4.2.3","sha512");rr("2.16.840.1.101.3.4.2.4","sha224");rr("2.16.840.1.101.3.4.2.5","sha512-224");rr("2.16.840.1.101.3.4.2.6","sha512-256");rr("1.2.840.113549.2.2","md2");rr("1.2.840.113549.2.5","md5");rr("1.2.840.113549.1.7.1","data");rr("1.2.840.113549.1.7.2","signedData");rr("1.2.840.113549.1.7.3","envelopedData");rr("1.2.840.113549.1.7.4","signedAndEnvelopedData");rr("1.2.840.113549.1.7.5","digestedData");rr("1.2.840.113549.1.7.6","encryptedData");rr("1.2.840.113549.1.9.1","emailAddress");rr("1.2.840.113549.1.9.2","unstructuredName");rr("1.2.840.113549.1.9.3","contentType");rr("1.2.840.113549.1.9.4","messageDigest");rr("1.2.840.113549.1.9.5","signingTime");rr("1.2.840.113549.1.9.6","counterSignature");rr("1.2.840.113549.1.9.7","challengePassword");rr("1.2.840.113549.1.9.8","unstructuredAddress");rr("1.2.840.113549.1.9.14","extensionRequest");rr("1.2.840.113549.1.9.20","friendlyName");rr("1.2.840.113549.1.9.21","localKeyId");rr("1.2.840.113549.1.9.22.1","x509Certificate");rr("1.2.840.113549.1.12.10.1.1","keyBag");rr("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");rr("1.2.840.113549.1.12.10.1.3","certBag");rr("1.2.840.113549.1.12.10.1.4","crlBag");rr("1.2.840.113549.1.12.10.1.5","secretBag");rr("1.2.840.113549.1.12.10.1.6","safeContentsBag");rr("1.2.840.113549.1.5.13","pkcs5PBES2");rr("1.2.840.113549.1.5.12","pkcs5PBKDF2");rr("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");rr("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");rr("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");rr("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");rr("1.2.840.113549.2.7","hmacWithSHA1");rr("1.2.840.113549.2.8","hmacWithSHA224");rr("1.2.840.113549.2.9","hmacWithSHA256");rr("1.2.840.113549.2.10","hmacWithSHA384");rr("1.2.840.113549.2.11","hmacWithSHA512");rr("1.2.840.113549.3.7","des-EDE3-CBC");rr("2.16.840.1.101.3.4.1.2","aes128-CBC");rr("2.16.840.1.101.3.4.1.22","aes192-CBC");rr("2.16.840.1.101.3.4.1.42","aes256-CBC");rr("2.5.4.3","commonName");rr("2.5.4.4","surname");rr("2.5.4.5","serialNumber");rr("2.5.4.6","countryName");rr("2.5.4.7","localityName");rr("2.5.4.8","stateOrProvinceName");rr("2.5.4.9","streetAddress");rr("2.5.4.10","organizationName");rr("2.5.4.11","organizationalUnitName");rr("2.5.4.12","title");rr("2.5.4.13","description");rr("2.5.4.15","businessCategory");rr("2.5.4.17","postalCode");rr("2.5.4.42","givenName");rr("2.5.4.65","pseudonym");rr("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");rr("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");rr("2.16.840.1.113730.1.1","nsCertType");rr("2.16.840.1.113730.1.13","nsComment");Bc("2.5.29.1","authorityKeyIdentifier");Bc("2.5.29.2","keyAttributes");Bc("2.5.29.3","certificatePolicies");Bc("2.5.29.4","keyUsageRestriction");Bc("2.5.29.5","policyMapping");Bc("2.5.29.6","subtreesConstraint");Bc("2.5.29.7","subjectAltName");Bc("2.5.29.8","issuerAltName");Bc("2.5.29.9","subjectDirectoryAttributes");Bc("2.5.29.10","basicConstraints");Bc("2.5.29.11","nameConstraints");Bc("2.5.29.12","policyConstraints");Bc("2.5.29.13","basicConstraints");rr("2.5.29.14","subjectKeyIdentifier");rr("2.5.29.15","keyUsage");Bc("2.5.29.16","privateKeyUsagePeriod");rr("2.5.29.17","subjectAltName");rr("2.5.29.18","issuerAltName");rr("2.5.29.19","basicConstraints");Bc("2.5.29.20","cRLNumber");Bc("2.5.29.21","cRLReason");Bc("2.5.29.22","expirationDate");Bc("2.5.29.23","instructionCode");Bc("2.5.29.24","invalidityDate");Bc("2.5.29.25","cRLDistributionPoints");Bc("2.5.29.26","issuingDistributionPoint");Bc("2.5.29.27","deltaCRLIndicator");Bc("2.5.29.28","issuingDistributionPoint");Bc("2.5.29.29","certificateIssuer");Bc("2.5.29.30","nameConstraints");rr("2.5.29.31","cRLDistributionPoints");rr("2.5.29.32","certificatePolicies");Bc("2.5.29.33","policyMappings");Bc("2.5.29.34","policyConstraints");rr("2.5.29.35","authorityKeyIdentifier");Bc("2.5.29.36","policyConstraints");rr("2.5.29.37","extKeyUsage");Bc("2.5.29.46","freshestCRL");Bc("2.5.29.54","inhibitAnyPolicy");rr("1.3.6.1.4.1.11129.2.4.2","timestampList");rr("1.3.6.1.5.5.7.1.1","authorityInfoAccess");rr("1.3.6.1.5.5.7.3.1","serverAuth");rr("1.3.6.1.5.5.7.3.2","clientAuth");rr("1.3.6.1.5.5.7.3.3","codeSigning");rr("1.3.6.1.5.5.7.3.4","emailProtection");rr("1.3.6.1.5.5.7.3.8","timeStamping")});var Qk=I((DGd,EOn)=>{p();var ed=ls();rc();Nq();var tn=EOn.exports=ed.asn1=ed.asn1||{};tn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};tn.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};tn.maxDepth=256;tn.create=function(t,e,r,n,o){if(ed.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(rRe,"_checkBufferLength");var O0s=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;rRe(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");tn.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=tn.maxDepth),typeof t=="string"&&(t=ed.util.createBuffer(t));var r=t.length(),n=krt(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 krt(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;rRe(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=O0s(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(rRe(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(krt(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(krt(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===tn.Class.UNIVERSAL&&l===tn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===tn.Class.UNIVERSAL&&l===tn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===tn.Type.BITSTRING&&(rRe(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=krt(t,e,r+1,E),v=o-t.length();e-=v,l==tn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===tn.Class.UNIVERSAL||b===tn.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===tn.Type.BMPSTRING)for(f="";u>0;u-=2)rRe(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 tn.create(c,l,m,f,T)}a(krt,"_fromDer");tn.toDer=function(t){var e=ed.util.createBuffer(),r=t.tagClass|t.type,n=ed.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=tn.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};tn.oidToDer=function(t){var e=t.split("."),r=ed.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};tn.derToOid=function(t){var e;typeof t=="string"&&(t=ed.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};tn.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};tn.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};tn.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};tn.derToInteger=function(t){typeof t=="string"&&(t=ed.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)};tn.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&&ed.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` `);for(var o="",s=0;s1?n+="0x"+ed.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===tn.Type.OCTETSTRING)d4n.test(t.value)||(n+="("+t.value+") "),n+="0x"+ed.util.bytesToHex(t.value);else if(t.type===tn.Type.UTF8)try{n+=ed.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+ed.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===tn.Type.PRINTABLESTRING||t.type===tn.Type.IA5String?n+=t.value:d4n.test(t.value)?n+="0x"+ed.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var qO=I((gJd,p4n)=>{p();var vnt=ds();p4n.exports=vnt.md=vnt.md||{};vnt.md.algorithms=vnt.md.algorithms||{}});var Fde=I((yJd,h4n)=>{p();var sF=ds();qO();ic();var oEs=h4n.exports=sF.hmac=sF.hmac||{};oEs.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 sF.md.algorithms)e=sF.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=sF.util.createBuffer(c);else if(sF.util.isArray(c)){var l=c;c=sF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=sF.util.createBuffer(),n=sF.util.createBuffer(),d=c.length();for(var u=0;u{p();var jO=ds();qO();ic();var g4n=y4n.exports=jO.md5=jO.md5||{};jO.md.md5=jO.md.algorithms.md5=g4n;g4n.create=function(){A4n||sEs();var t=null,e=jO.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),m4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=jO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(uer.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};m4n(f,r,o);var h=jO.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var uer=null,bnt=null,NRe=null,Ude=null,A4n=!1;function sEs(){uer="\x80",uer+=jO.util.fillString("\0",64),bnt=[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],NRe=[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],Ude=new Array(64);for(var t=0;t<64;++t)Ude[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);A4n=!0}a(sEs,"_init");function m4n(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+Ude[f]+e[f],d=NRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+Ude[f]+e[bnt[f]],d=NRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+Ude[f]+e[bnt[f]],d=NRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+Ude[f]+e[bnt[f]],d=NRe[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(m4n,"_update")});var xJ=I((bJd,_4n)=>{p();var Int=ds();ic();var E4n=_4n.exports=Int.pem=Int.pem||{};E4n.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+=Tnt(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Tnt(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Tnt(n)),t.headers)for(var o=0;o1?n+="0x"+ed.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===tn.Type.OCTETSTRING)yOn.test(t.value)||(n+="("+t.value+") "),n+="0x"+ed.util.bytesToHex(t.value);else if(t.type===tn.Type.UTF8)try{n+=ed.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+ed.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===tn.Type.PRINTABLESTRING||t.type===tn.Type.IA5String?n+=t.value:yOn.test(t.value)?n+="0x"+ed.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var RO=I((OGd,_On)=>{p();var Drt=ls();_On.exports=Drt.md=Drt.md||{};Drt.md.algorithms=Drt.md.algorithms||{}});var hde=I((LGd,vOn)=>{p();var V3=ls();RO();rc();var B0s=vOn.exports=V3.hmac=V3.hmac||{};B0s.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 V3.md.algorithms)e=V3.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=V3.util.createBuffer(c);else if(V3.util.isArray(c)){var l=c;c=V3.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=V3.util.createBuffer(),n=V3.util.createBuffer(),d=c.length();for(var u=0;u{p();var PO=ls();RO();rc();var bOn=TOn.exports=PO.md5=PO.md5||{};PO.md.md5=PO.md.algorithms.md5=bOn;bOn.create=function(){SOn||L0s();var t=null,e=PO.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),COn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=PO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(XZt.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};COn(f,r,o);var h=PO.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var XZt=null,Nrt=null,nRe=null,mde=null,SOn=!1;function L0s(){XZt="\x80",XZt+=PO.util.fillString("\0",64),Nrt=[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],nRe=[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],mde=new Array(64);for(var t=0;t<64;++t)mde[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);SOn=!0}a(L0s,"_init");function COn(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+mde[f]+e[f],d=nRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+mde[f]+e[Nrt[f]],d=nRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+mde[f]+e[Nrt[f]],d=nRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+mde[f]+e[Nrt[f]],d=nRe[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(COn,"_update")});var aJ=I((jGd,xOn)=>{p();var Brt=ls();rc();var IOn=xOn.exports=Brt.pem=Brt.pem||{};IOn.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+=Ort(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Ort(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Ort(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(Tnt,"foldHeader");function aEs(t){return t.replace(/^\s+/,"")}a(aEs,"ltrim")});var MRe=I((IJd,v4n)=>{p();var Fd=ds();Ant();oer();ic();v4n.exports=Fd.des=Fd.des||{};Fd.des.startEncrypting=function(t,e,r,n){var o=xnt({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Fd.des.createEncryptionCipher=function(t,e){return xnt({key:t,output:null,decrypt:!1,mode:e})};Fd.des.startDecrypting=function(t,e,r,n){var o=xnt({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Fd.des.createDecryptionCipher=function(t,e){return xnt({key:t,output:null,decrypt:!0,mode:e})};Fd.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return C4n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return C4n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};Fd.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=Fd.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=gEs(e),this._init=!0}};HO("DES-ECB",Fd.cipher.modes.ecb);HO("DES-CBC",Fd.cipher.modes.cbc);HO("DES-CFB",Fd.cipher.modes.cfb);HO("DES-OFB",Fd.cipher.modes.ofb);HO("DES-CTR",Fd.cipher.modes.ctr);HO("3DES-ECB",Fd.cipher.modes.ecb);HO("3DES-CBC",Fd.cipher.modes.cbc);HO("3DES-CFB",Fd.cipher.modes.cfb);HO("3DES-OFB",Fd.cipher.modes.ofb);HO("3DES-CTR",Fd.cipher.modes.ctr);function HO(t,e){var r=a(function(){return new Fd.des.Algorithm(t,e)},"factory");Fd.cipher.registerAlgorithm(t,r)}a(HO,"registerAlgorithm");var cEs=[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],lEs=[-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],uEs=[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],dEs=[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],fEs=[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],pEs=[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],hEs=[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],mEs=[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 gEs(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 k=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^k)&65535,E[v++]=k^b,E[v++]=D^b<<16}}return E}a(gEs,"_createKeys");function C4n(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^(lEs[g>>>24&63]|dEs[g>>>16&63]|pEs[g>>>8&63]|mEs[g&63]|cEs[A>>>24&63]|uEs[A>>>16&63]|fEs[A>>>8&63]|hEs[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(C4n,"_updateBlock");function xnt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=Fd.cipher.createDecipher(r,t.key):n=Fd.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Fd.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(xnt,"_createCipher")});var wnt=I((RJd,b4n)=>{p();var G_=ds();Fde();qO();ic();var AEs=G_.pkcs5=G_.pkcs5||{},aF;G_.util.isNodejs&&!G_.options.usePureJavaScript&&(aF=require("crypto"));b4n.exports=G_.pbkdf2=AEs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),G_.util.isNodejs&&!G_.options.usePureJavaScript&&aF.pbkdf2&&(o===null||typeof o!="object")&&(aF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?aF.pbkdf2Sync.length===4?aF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):aF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):aF.pbkdf2Sync.length===4?aF.pbkdf2Sync(t,e,r,n).toString("binary"):aF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in G_.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=G_.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=G_.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(G_.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=G_.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(G_.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=G_.util.xorBytes(m,g,c),A=g,++E,G_.util.setImmediate(v);h+=y{p();var GO=ds();qO();ic();var T4n=w4n.exports=GO.sha256=GO.sha256||{};GO.md.sha256=GO.md.algorithms.sha256=T4n;T4n.create=function(){I4n||yEs();var t=null,e=GO.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),S4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=GO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(der.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};S4n(h,r,o);var m=GO.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 der=null,I4n=!1,x4n=null;function yEs(){der="\x80",der+=GO.util.fillString("\0",64),x4n=[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],I4n=!0}a(yEs,"_init");function S4n(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+x4n[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(S4n,"_update")});var per=I((OJd,R4n)=>{p();var $O=ds();ic();var Rnt=null;$O.util.isNodejs&&!$O.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Rnt=require("crypto"));var EEs=R4n.exports=$O.prng=$O.prng||{};EEs.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=$O.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 $O.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)),$O.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=$O.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=$O.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=$O.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"),Rnt?(e.seedFile=function(d,f){Rnt.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Rnt.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 sw=I((FJd,her)=>{p();var gg=ds();Kq();fer();per();ic();(function(){if(gg.random&&gg.random.getBytes){her.exports=gg.random;return}(function(t){var e={},r=new Array(4),n=gg.util.createBuffer();e.formatKey=function(h){var m=gg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),gg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=gg.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 gg.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=gg.md.sha256;function o(){var h=gg.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=gg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),gg.options.usePureJavaScript||!gg.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(!gg.random)gg.random=s;else for(var f in s)gg.random[f]=s[f];gg.random.createInstance=o,her.exports=gg.random})(typeof jQuery<"u"?jQuery:null)})()});var ger=I((qJd,D4n)=>{p();var Kv=ds();ic();var mer=[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],k4n=[1,2,3,5],_Es=a(function(t,e){return t<>16-e},"rol"),CEs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");D4n.exports=Kv.rc2=Kv.rc2||{};Kv.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Kv.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(mer[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,mer[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,mer[r.at(l+1)^r.at(l+s)]);return r};var P4n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=Kv.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]=_Es(A[d],k4n[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]=CEs(A[d],k4n[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");Kv.rc2.startEncrypting=function(t,e,r){var n=Kv.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Kv.rc2.createEncryptionCipher=function(t,e){return P4n(t,e,!0)};Kv.rc2.startDecrypting=function(t,e,r){var n=Kv.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Kv.rc2.createDecryptionCipher=function(t,e){return P4n(t,e,!1)}});var BRe=I((GJd,Q4n)=>{p();var Aer=ds();Q4n.exports=Aer.jsbn=Aer.jsbn||{};var cF,vEs=0xdeadbeefcafe,N4n=(vEs&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");Aer.jsbn.BigInteger=Wt;function Ga(){return new Wt(null)}a(Ga,"nbi");function bEs(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(bEs,"am1");function SEs(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(SEs,"am2");function M4n(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(M4n,"am3");typeof navigator>"u"?(Wt.prototype.am=M4n,cF=28):N4n&&navigator.appName=="Microsoft Internet Explorer"?(Wt.prototype.am=SEs,cF=30):N4n&&navigator.appName!="Netscape"?(Wt.prototype.am=bEs,cF=26):(Wt.prototype.am=M4n,cF=28);Wt.prototype.DB=cF;Wt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(IEs,"bnpCopyTo");function xEs(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(xEs,"bnpFromInt");function Zq(t){var e=Ga();return e.fromInt(t),e}a(Zq,"nbv");function wEs(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:B4n(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(REs,"bnpClamp");function kEs(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=O4n(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+=O4n(n));return o?s:"0"}a(kEs,"bnToString");function PEs(){var t=Ga();return Wt.ZERO.subTo(this,t),t}a(PEs,"bnNegate");function DEs(){return this.s<0?this.negate():this}a(DEs,"bnAbs");function NEs(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(NEs,"bnCompareTo");function Pnt(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(Pnt,"nbits");function MEs(){return this.t<=0?0:this.DB*(this.t-1)+Pnt(this.data[this.t-1]^this.s&this.DM)}a(MEs,"bnBitLength");function OEs(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(OEs,"bnpDLShiftTo");function BEs(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(LEs,"bnpLShiftTo");function FEs(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(UEs,"bnpSubTo");function QEs(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(qEs,"bnpSquareTo");function jEs(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(jEs,"bnpDivRemTo");function HEs(t){var e=Ga();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Wt.ZERO)>0&&t.subTo(e,e),e}a(HEs,"bnMod");function wJ(t){this.m=t}a(wJ,"Classic");function GEs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(GEs,"cConvert");function $Es(t){return t}a($Es,"cRevert");function VEs(t){t.divRemTo(this.m,null,t)}a(VEs,"cReduce");function WEs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(WEs,"cMulTo");function zEs(t,e){t.squareTo(e),this.reduce(e)}a(zEs,"cSqrTo");wJ.prototype.convert=GEs;wJ.prototype.revert=$Es;wJ.prototype.reduce=VEs;wJ.prototype.mulTo=WEs;wJ.prototype.sqrTo=zEs;function YEs(){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(YEs,"bnpInvDigit");function RJ(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(KEs,"montConvert");function JEs(t){var e=Ga();return t.copyTo(e),this.reduce(e),e}a(JEs,"montRevert");function ZEs(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(ZEs,"montReduce");function XEs(t,e){t.squareTo(e),this.reduce(e)}a(XEs,"montSqrTo");function e_s(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(e_s,"montMulTo");RJ.prototype.convert=KEs;RJ.prototype.revert=JEs;RJ.prototype.reduce=ZEs;RJ.prototype.mulTo=e_s;RJ.prototype.sqrTo=XEs;function t_s(){return(this.t>0?this.data[0]&1:this.s)==0}a(t_s,"bnpIsEven");function r_s(t,e){if(t>4294967295||t<1)return Wt.ONE;var r=Ga(),n=Ga(),o=e.convert(this),s=Pnt(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(r_s,"bnpExp");function n_s(t,e){var r;return t<256||e.isEven()?r=new wJ(e):r=new RJ(e),this.exp(t,r)}a(n_s,"bnModPowInt");Wt.prototype.copyTo=IEs;Wt.prototype.fromInt=xEs;Wt.prototype.fromString=wEs;Wt.prototype.clamp=REs;Wt.prototype.dlShiftTo=OEs;Wt.prototype.drShiftTo=BEs;Wt.prototype.lShiftTo=LEs;Wt.prototype.rShiftTo=FEs;Wt.prototype.subTo=UEs;Wt.prototype.multiplyTo=QEs;Wt.prototype.squareTo=qEs;Wt.prototype.divRemTo=jEs;Wt.prototype.invDigit=YEs;Wt.prototype.isEven=t_s;Wt.prototype.exp=r_s;Wt.prototype.toString=kEs;Wt.prototype.negate=PEs;Wt.prototype.abs=DEs;Wt.prototype.compareTo=NEs;Wt.prototype.bitLength=MEs;Wt.prototype.mod=HEs;Wt.prototype.modPowInt=n_s;Wt.ZERO=Zq(0);Wt.ONE=Zq(1);function i_s(){var t=Ga();return this.copyTo(t),t}a(i_s,"bnClone");function o_s(){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(s_s,"bnByteValue");function a_s(){return this.t==0?this.s:this.data[0]<<16>>16}a(a_s,"bnShortValue");function c_s(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(c_s,"bnpChunkSize");function l_s(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(l_s,"bnSigNum");function u_s(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=Zq(r),o=Ga(),s=Ga(),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(u_s,"bnpToRadix");function d_s(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(d_s,"bnpFromRadix");function f_s(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),Eer,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(p_s,"bnToByteArray");function h_s(t){return this.compareTo(t)==0}a(h_s,"bnEquals");function m_s(t){return this.compareTo(t)<0?this:t}a(m_s,"bnMin");function g_s(t){return this.compareTo(t)>0?this:t}a(g_s,"bnMax");function A_s(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(I_s,"lbit");function x_s(){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(O_s,"bnpAddTo");function B_s(t){var e=Ga();return this.addTo(t,e),e}a(B_s,"bnAdd");function L_s(t){var e=Ga();return this.subTo(t,e),e}a(L_s,"bnSubtract");function F_s(t){var e=Ga();return this.multiplyTo(t,e),e}a(F_s,"bnMultiply");function U_s(){var t=Ga();return this.squareTo(t),t}a(U_s,"bnSquare");function Q_s(t){var e=Ga();return this.divRemTo(t,e,null),e}a(Q_s,"bnDivide");function q_s(t){var e=Ga();return this.divRemTo(t,null,e),e}a(q_s,"bnRemainder");function j_s(t){var e=Ga(),r=Ga();return this.divRemTo(t,e,r),new Array(e,r)}a(j_s,"bnDivideAndRemainder");function H_s(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(H_s,"bnpDMultiply");function G_s(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(G_s,"bnpDAddOffset");function ORe(){}a(ORe,"NullExp");function U4n(t){return t}a(U4n,"nNop");function $_s(t,e,r){t.multiplyTo(e,r)}a($_s,"nMulTo");function V_s(t,e){t.squareTo(e)}a(V_s,"nSqrTo");ORe.prototype.convert=U4n;ORe.prototype.revert=U4n;ORe.prototype.mulTo=$_s;ORe.prototype.sqrTo=V_s;function W_s(t){return this.exp(t,new ORe)}a(W_s,"bnPow");function z_s(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=Ga();return t.copyTo(e),this.reduce(e),e}a(K_s,"barrettConvert");function J_s(t){return t}a(J_s,"barrettRevert");function Z_s(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(Z_s,"barrettReduce");function X_s(t,e){t.squareTo(e),this.reduce(e)}a(X_s,"barrettSqrTo");function eCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(eCs,"barrettMulTo");qde.prototype.convert=K_s;qde.prototype.revert=J_s;qde.prototype.reduce=Z_s;qde.prototype.mulTo=eCs;qde.prototype.sqrTo=X_s;function tCs(t,e){var r=t.bitLength(),n,o=Zq(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 wJ(e):e.isEven()?s=new qde(e):s=new RJ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Ga();for(s.sqrTo(c[1],f);l<=d;)c[l]=Ga(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Ga(),y;for(r=Pnt(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(rCs,"bnGCD");function nCs(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(nCs,"bnpModInt");function iCs(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=Zq(1),s=Zq(0),c=Zq(0),l=Zq(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(iCs,"bnModInverse");var zP=[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],oCs=(1<<26)/zP[zP.length-1];function sCs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=zP[zP.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 VO=ds();qO();ic();var j4n=G4n.exports=VO.sha1=VO.sha1||{};VO.md.sha1=VO.md.algorithms.sha1=j4n;j4n.create=function(){H4n||lCs();var t=null,e=VO.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),q4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=VO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(_er.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};q4n(h,r,o);var m=VO.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 _er=null,H4n=!1;function lCs(){_er="\x80",_er+=VO.util.fillString("\0",64),H4n=!0}a(lCs,"_init");function q4n(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(q4n,"_update")});var Cer=I((KJd,V4n)=>{p();var WO=ds();ic();sw();jde();var $4n=V4n.exports=WO.pkcs1=WO.pkcs1||{};$4n.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=WO.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(Dnt,"rsa_mgf1")});var ber=I((XJd,ver)=>{p();var Xq=ds();ic();BRe();sw();(function(){if(Xq.prime){ver.exports=Xq.prime;return}var t=ver.exports=Xq.prime=Xq.prime||{},e=Xq.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||Xq.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 Xq.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 LRe=I((rZd,X4n)=>{p();var _i=ds();WP();BRe();Jq();Cer();ber();sw();ic();typeof $a>"u"&&($a=_i.jsbn.BigInteger);var $a,Ser=_i.util.isNodejs?require("crypto"):null,lt=_i.asn1,cw=_i.util;_i.pki=_i.pki||{};X4n.exports=_i.pki.rsa=_i.rsa=_i.rsa||{};var Qo=_i.pki,uCs=[6,4,2,4,2,4,6,2],dCs={name:"PrivateKeyInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},fCs={name:"RSAPrivateKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},pCs={name:"RSAPublicKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},hCs=_i.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},mCs={name:"DigestInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:lt.Class.UNIVERSAL,type:lt.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},gCs=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=lt.oidToDer(e).getBytes(),o=lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[]),s=lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[]);s.value.push(lt.create(lt.Class.UNIVERSAL,lt.Type.OID,!1,n)),s.value.push(lt.create(lt.Class.UNIVERSAL,lt.Type.NULL,!1,""));var c=lt.create(lt.Class.UNIVERSAL,lt.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),lt.toDer(o).getBytes()},"emsaPkcs1v15encode"),J4n=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($a.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract($a.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new $a(_i.util.bytesToHex(_i.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals($a.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=Z4n(t,e,r)):(o=_i.util.createBuffer(),o.putBytes(t));for(var c=new $a(o.toHex(),16),l=J4n(c,e,n),u=l.toString(16),d=_i.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(_i.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 $a(_i.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=J4n(c,e,r),u=l.toString(16),d=_i.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(_i.util.hexToBytes(u)),n!==!1?Nnt(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||_i.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 $a(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(yCs(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(uCs[n++%8],0):t.pqState===2?t.pqState=t.num.subtract($a.ONE).gcd(t.e).compareTo($a.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($a.ONE),t.q1=t.q.subtract($a.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo($a.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),!_i.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(W4n("generateKeyPair"))return Ser.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(z4n("generateKey")&&z4n("exportKey"))return cw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:K4n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return cw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=Qo.privateKeyFromAsn1(lt.fromDer(_i.util.createBuffer(l)));n(null,{privateKey:u,publicKey:Qo.setRsaPublicKey(u.n,u.e)})}});if(Y4n("generateKey")&&Y4n("exportKey")){var o=cw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:K4n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=cw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=Qo.privateKeyFromAsn1(lt.fromDer(_i.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(W4n("generateKeyPairSync")){var s=Ser.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;ACs(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 Z4n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return _i.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=Nnt(d,r,!0,void 0,c);var f=lt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!lt.validate(f,mCs,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=lt.derToOid(h.algorithmIdentifier);if(!(A===_i.oids.md2||A===_i.oids.md5||A===_i.oids.sha1||A===_i.oids.sha224||A===_i.oids.sha256||A===_i.oids.sha384||A===_i.oids.sha512||A===_i.oids["sha512-224"]||A===_i.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===_i.oids.md2||A===_i.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=Nnt(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:Nnt};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return _i.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:gCs},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 lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,lt.integerToDer(0).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.OID,!1,lt.oidToDer(Qo.oids.rsaEncryption).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.NULL,!1,"")]),lt.create(lt.Class.UNIVERSAL,lt.Type.OCTETSTRING,!1,lt.toDer(t).getBytes())])};Qo.privateKeyFromAsn1=function(t){var e={},r=[];if(lt.validate(t,dCs,e,r)&&(t=lt.fromDer(_i.util.createBuffer(e.privateKey))),e={},r=[],!lt.validate(t,fCs,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=_i.util.createBuffer(e.privateKeyModulus).toHex(),s=_i.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=_i.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=_i.util.createBuffer(e.privateKeyPrime1).toHex(),u=_i.util.createBuffer(e.privateKeyPrime2).toHex(),d=_i.util.createBuffer(e.privateKeyExponent1).toHex(),f=_i.util.createBuffer(e.privateKeyExponent2).toHex(),h=_i.util.createBuffer(e.privateKeyCoefficient).toHex(),Qo.setRsaPrivateKey(new $a(o,16),new $a(s,16),new $a(c,16),new $a(l,16),new $a(u,16),new $a(d,16),new $a(f,16),new $a(h,16))};Qo.privateKeyToAsn1=Qo.privateKeyToRSAPrivateKey=function(t){return lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,lt.integerToDer(0).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.n)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.e)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.d)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.p)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.q)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.dP)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.dQ)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.qInv))])};Qo.publicKeyFromAsn1=function(t){var e={},r=[];if(lt.validate(t,hCs,e,r)){var n=lt.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=[],!lt.validate(t,pCs,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=_i.util.createBuffer(e.publicKeyModulus).toHex(),c=_i.util.createBuffer(e.publicKeyExponent).toHex();return Qo.setRsaPublicKey(new $a(s,16),new $a(c,16))};Qo.publicKeyToAsn1=Qo.publicKeyToSubjectPublicKeyInfo=function(t){return lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.OID,!1,lt.oidToDer(Qo.oids.rsaEncryption).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.NULL,!1,"")]),lt.create(lt.Class.UNIVERSAL,lt.Type.BITSTRING,!1,[Qo.publicKeyToRSAPublicKey(t)])])};Qo.publicKeyToRSAPublicKey=function(t){return lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.n)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.e))])};function Z4n(t,e,r){var n=_i.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=_i.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(Nnt,"_decodePkcs1_v1_5");function ACs(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){_i.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($a.ONE).gcd(t.e).compareTo($a.ONE)!==0){t.p=null,o();return}if(t.q.subtract($a.ONE).gcd(t.e).compareTo($a.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract($a.ONE),t.q1=t.q.subtract($a.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo($a.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(ACs,"_generateKeyPair");function zO(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=_i.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(zO,"_bnToBytes");function yCs(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(yCs,"_getMillerRabinTests");function W4n(t){return _i.util.isNodejs&&typeof Ser[t]=="function"}a(W4n,"_detectNodeCrypto");function z4n(t){return typeof cw.globalScope<"u"&&typeof cw.globalScope.crypto=="object"&&typeof cw.globalScope.crypto.subtle=="object"&&typeof cw.globalScope.crypto.subtle[t]=="function"}a(z4n,"_detectSubtleCrypto");function Y4n(t){return typeof cw.globalScope<"u"&&typeof cw.globalScope.msCrypto=="object"&&typeof cw.globalScope.msCrypto.subtle=="object"&&typeof cw.globalScope.msCrypto.subtle[t]=="function"}a(Y4n,"_detectSubtleMsCrypto");function K4n(t){for(var e=_i.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var An=ds();Kq();WP();MRe();qO();Jq();wnt();xJ();sw();ger();LRe();ic();typeof eBn>"u"&&(eBn=An.jsbn.BigInteger);var eBn,Rt=An.asn1,rs=An.pki=An.pki||{};iBn.exports=rs.pbe=An.pbe=An.pbe||{};var kJ=rs.oids,ECs={name:"EncryptedPrivateKeyInfo",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},_Cs={name:"PBES2Algorithms",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},CCs={name:"pkcs-12PbeParams",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.INTEGER,constructed:!1,capture:"iterations"}]};rs.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=An.random.getBytesSync(r.saltSize),o=r.count,s=Rt.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=kJ["aes128-CBC"],h=An.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=kJ["aes192-CBC"],h=An.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=kJ["aes256-CBC"],h=An.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=kJ.desCBC,h=An.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=nBn(g),y=An.pkcs5.pbkdf2(e,n,o,c,A),E=An.random.getBytesSync(d),_=h(y);_.start(E),_.update(Rt.toDer(t)),_.finish(),u=_.output.getBytes();var v=vCs(n,s,c,g);l=Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(kJ.pkcs5PBES2).getBytes()),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(kJ.pkcs5PBKDF2).getBytes()),v]),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(f).getBytes()),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new An.util.ByteBuffer(n),y=rs.pbe.generatePkcs12Key(e,b,1,o,c),E=rs.pbe.generatePkcs12Key(e,b,2,o,c),_=An.des.createEncryptionCipher(y);_.start(E),_.update(Rt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(kJ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OCTETSTRING,!1,n),Rt.create(Rt.Class.UNIVERSAL,Rt.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=Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[l,Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OCTETSTRING,!1,u)]);return T};rs.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Rt.validate(t,ECs,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=Rt.derToOid(n.encryptionOid),l=rs.pbe.getCipher(c,n.encryptionParams,e),u=An.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Rt.fromDer(l.output)),r};rs.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Rt.toDer(t).getBytes()};return An.pem.encode(r,{maxline:e})};rs.encryptedPrivateKeyFromPem=function(t){var e=An.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 Rt.fromDer(e.body)};rs.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=rs.wrapRsaPrivateKey(rs.privateKeyToAsn1(t));return n=rs.encryptPrivateKeyInfo(n,e,r),rs.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=An.random.getBytesSync(8),l=An.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=An.random.getBytesSync(8),l=An.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=An.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Rt.toDer(rs.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:An.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return An.pem.encode(h)};rs.decryptRsaPrivateKey=function(t,e){var r=null,n=An.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=An.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=An.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=An.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=An.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=An.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return An.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return An.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return An.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=An.util.hexToBytes(n.dekInfo.parameters),u=An.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(An.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=rs.decryptPrivateKeyInfo(Rt.fromDer(r),e):r=Rt.fromDer(r),r!==null&&(r=rs.privateKeyFromAsn1(r)),r};rs.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in An.md))throw new Error('"sha1" hash algorithm unavailable.');s=An.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new An.util.ByteBuffer,h=new An.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=k.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};rs.pbe.getCipher=function(t,e,r){switch(t){case rs.oids.pkcs5PBES2:return rs.pbe.getCipherForPBES2(t,e,r);case rs.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case rs.oids["pbewithSHAAnd40BitRC2-CBC"]:return rs.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}};rs.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Rt.validate(e,_Cs,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=Rt.derToOid(n.kdfOid),t!==rs.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=Rt.derToOid(n.encOid),t!==rs.oids["aes128-CBC"]&&t!==rs.oids["aes192-CBC"]&&t!==rs.oids["aes256-CBC"]&&t!==rs.oids["des-EDE3-CBC"]&&t!==rs.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=An.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(rs.oids[t]){case"aes128-CBC":u=16,d=An.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=An.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=An.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=An.des.createDecryptionCipher;break;case"desCBC":u=8,d=An.des.createDecryptionCipher;break}var f=rBn(n.prfOid),h=An.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};rs.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Rt.validate(e,CCs,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=An.util.createBuffer(n.salt),l=An.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case rs.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=An.des.startDecrypting;break;case rs.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=An.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=rBn(n.prfOid),m=rs.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=rs.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};rs.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in An.md))throw new Error('"md5" hash algorithm unavailable.');n=An.md.md5.create()}e===null&&(e="");for(var o=[tBn(n,t+e)],s=16,c=1;s{p();var Hde=ds();WP();ic();var dn=Hde.asn1,Gde=aBn.exports=Hde.pkcs7asn1=Hde.pkcs7asn1||{};Hde.pkcs7=Hde.pkcs7||{};Hde.pkcs7.asn1=Gde;var oBn={name:"ContentInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Gde.contentInfoValidator=oBn;var sBn={name:"EncryptedContentInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:dn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Gde.envelopedDataValidator={name:"EnvelopedData",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(sBn)};Gde.encryptedDataValidator={name:"EncryptedData",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"}].concat(sBn)};var bCs={name:"SignerInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:dn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:dn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Gde.signedDataValidator={name:"SignedData",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},oBn,{name:"SignedData.Certificates",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:dn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SET,capture:"signerInfos",optional:!0,value:[bCs]}]};Gde.recipientInfoValidator={name:"RecipientInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:dn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var xer=I((uZd,cBn)=>{p();var PJ=ds();ic();PJ.mgf=PJ.mgf||{};var SCs=cBn.exports=PJ.mgf.mgf1=PJ.mgf1=PJ.mgf1||{};SCs.create=function(t){var e={generate:a(function(r,n){for(var o=new PJ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var Mnt=ds();xer();lBn.exports=Mnt.mgf=Mnt.mgf||{};Mnt.mgf.mgf1=Mnt.mgf1});var Ont=I((mZd,dBn)=>{p();var DJ=ds();sw();ic();var TCs=dBn.exports=DJ.pss=DJ.pss||{};TCs.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=DJ.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||DJ.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 Ci=ds();Kq();WP();MRe();qO();uBn();Jq();xJ();Ont();LRe();ic();var ue=Ci.asn1,Pr=gBn.exports=Ci.pki=Ci.pki||{},Va=Pr.oids,tp={};tp.CN=Va.commonName;tp.commonName="CN";tp.C=Va.countryName;tp.countryName="C";tp.L=Va.localityName;tp.localityName="L";tp.ST=Va.stateOrProvinceName;tp.stateOrProvinceName="ST";tp.O=Va.organizationName;tp.organizationName="O";tp.OU=Va.organizationalUnitName;tp.organizationalUnitName="OU";tp.E=Va.emailAddress;tp.emailAddress="E";var pBn=Ci.pki.rsa.publicKeyValidator,ICs={name:"Certificate",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:ue.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:ue.Class.UNIVERSAL,type:ue.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:ue.Class.UNIVERSAL,type:ue.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:ue.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},pBn,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:ue.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:ue.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:ue.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:ue.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},xCs={name:"rsapss",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:ue.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:ue.Class.UNIVERSAL,type:ue.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:ue.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:ue.Class.UNIVERSAL,type:ue.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:ue.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:ue.Class.UNIVERSAL,type:ue.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:ue.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:ue.Class.UNIVERSAL,type:ue.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},wCs={name:"CertificationRequestInfo",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:ue.Class.UNIVERSAL,type:ue.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},pBn,{name:"CertificationRequestInfo.attributes",tagClass:ue.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SET,constructed:!0}]}]}]},RCs={name:"CertificationRequest",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[wCs,{name:"CertificationRequest.signatureAlgorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:ue.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Pr.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=Lnt({signatureOid:c.signatureOid,type:"certificate"});var d=ue.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=Ci.md.sha1.create(),h=ue.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return ej(c.issuer,A)},c.issuer.addField=function(A){lw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Pr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=Ci.md.sha1.create(),g=ue.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return ej(c.subject,A)},c.subject.addField=function(A){lw([A]),c.subject.attributes.push(A)},c.subject.attributes=Pr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Pr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Pr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Pr.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=ue.fromDer(e.value);r.value.length>0&&r.value[0].type===ue.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===ue.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=ue.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=ue.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=ue.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Pr.oids?e.name=Pr.oids[e.type]:e.shortName&&e.shortName in tp&&(e.name=Pr.oids[tp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Pr.oids)e.type=Pr.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 tp&&(e.shortName=tp[e.name]),e.type===Va.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=ue.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(lw,"_fillMissingFields");function mBn(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Pr.oids&&(t.name=Pr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Pr.oids)t.id=Pr.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=ue.create(ue.Class.UNIVERSAL,ue.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(ue.create(ue.Class.UNIVERSAL,ue.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(ue.create(ue.Class.UNIVERSAL,ue.Type.INTEGER,!1,ue.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in Va?l.push(ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(Va[u]).getBytes())):u.indexOf(".")!==-1&&l.push(ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.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=ue.create(ue.Class.UNIVERSAL,ue.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(ue.create(ue.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[ue.create(ue.Class.CONTEXT_SPECIFIC,4,!0,[$de(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(ue.create(ue.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=Ci.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(ue.create(ue.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]),E=ue.create(ue.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(mBn,"_fillMissingExtensionFields");function wer(t,e){if(t===Va["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(ue.create(ue.Class.CONTEXT_SPECIFIC,0,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(e.hash.algorithmOid).getBytes()),ue.create(ue.Class.UNIVERSAL,ue.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(ue.create(ue.Class.CONTEXT_SPECIFIC,1,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(e.mgf.algorithmOid).getBytes()),ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(e.mgf.hash.algorithmOid).getBytes()),ue.create(ue.Class.UNIVERSAL,ue.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(ue.create(ue.Class.CONTEXT_SPECIFIC,2,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.INTEGER,!1,ue.integerToDer(e.saltLength).getBytes())])),ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,r)}else return ue.create(ue.Class.UNIVERSAL,ue.Type.NULL,!1,"")}a(wer,"_signatureParametersToAsn1");function kCs(t){var e=ue.create(ue.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=PCs&&t0&&n.value.push(Pr.certificateExtensionsToAsn1(t.extensions)),n};Pr.getCertificationRequestInfo=function(t){var e=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.INTEGER,!1,ue.integerToDer(t.version).getBytes()),$de(t.subject),Pr.publicKeyToAsn1(t.publicKey),kCs(t)]);return e};Pr.distinguishedNameToAsn1=function(t){return $de(t)};Pr.certificateToAsn1=function(t){var e=t.tbsCertificate||Pr.getTBSCertificate(t);return ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[e,ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(t.signatureOid).getBytes()),wer(t.signatureOid,t.signatureParameters)]),ue.create(ue.Class.UNIVERSAL,ue.Type.BITSTRING,!1,"\0"+t.signature)])};Pr.certificateExtensionsToAsn1=function(t){var e=ue.create(ue.Class.CONTEXT_SPECIFIC,3,!0,[]),r=ue.create(ue.Class.UNIVERSAL,ue.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:Pr.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;Ci.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:Pr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Pr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Pr.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:Pr.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:Pr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!Ci.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 ker=I((_Zd,yBn)=>{p();var _u=ds();WP();Fde();Jq();Ier();Ter();sw();LRe();jde();ic();Fnt();var Ue=_u.asn1,Ks=_u.pki,URe=yBn.exports=_u.pkcs12=_u.pkcs12||{},ABn={name:"ContentInfo",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ue.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},NCs={name:"PFX",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.INTEGER,constructed:!1,capture:"version"},ABn,{name:"PFX.macData",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ue.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},MCs={name:"SafeBag",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ue.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},OCs={name:"Attribute",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SET,constructed:!0,capture:"values"}]},BCs={name:"CertBag",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ue.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ue.Class.UNIVERSAL,type:Ue.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function FRe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(FRe,"_getBagsByAttribute");URe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ue.validate(t,NCs,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=_u.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=FRe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=FRe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=FRe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return FRe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return FRe(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(Ue.derToOid(n.contentType)!==Ks.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ue.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ue.Class.UNIVERSAL||l.type!==Ue.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=Rer(l),n.mac){var u=null,d=0,f=Ue.derToOid(n.macAlgorithm);switch(f){case Ks.oids.sha1:u=_u.md.sha1.create(),d=20;break;case Ks.oids.sha256:u=_u.md.sha256.create(),d=32;break;case Ks.oids.sha384:u=_u.md.sha384.create(),d=48;break;case Ks.oids.sha512:u=_u.md.sha512.create(),d=64;break;case Ks.oids.md5:u=_u.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new _u.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(_u.util.bytesToHex(n.macIterations),16):1,g=URe.generateKey(r,h,3,m,d,u),A=_u.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 LCs(c,l.value,e,r),c};function Rer(t){if(t.composed||t.constructed){for(var e=_u.util.createBuffer(),r=0;r0&&(s=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SET,!0,u));var d=[],f=[];e!==null&&(_u.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,h),_=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.data).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,Ue.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=Ks.wrapRsaPrivateKey(Ks.privateKeyToAsn1(t));r===null?v=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.keyBag).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.pkcs8ShroudedKeyBag).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ks.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[v]),w=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.data).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,Ue.toDer(T).getBytes())])]);d.push(w)}var R=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=_u.md.sha1.create(),k=new _u.util.ByteBuffer(_u.random.getBytes(n.saltSize)),D=n.count,t=URe.generateKey(r,k,3,D,20),N=_u.hmac.create();N.start(l,t),N.update(Ue.toDer(R).getBytes());var L=N.getMac();x=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.sha1).getBytes()),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.NULL,!1,"")]),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,L.getBytes())]),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,k.getBytes()),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.INTEGER,!1,Ue.integerToDer(D).getBytes())])}return Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.INTEGER,!1,Ue.integerToDer(3).getBytes()),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.data).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,Ue.toDer(R).getBytes())])]),x])};URe.generateKey=_u.pbe.generatePkcs12Key});var Der=I((bZd,EBn)=>{p();var tj=ds();WP();Jq();Ter();xJ();wnt();ker();Ont();LRe();ic();Fnt();var Per=tj.asn1,Vde=EBn.exports=tj.pki=tj.pki||{};Vde.pemToDer=function(t){var e=tj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return tj.util.createBuffer(e.body)};Vde.privateKeyFromPem=function(t){var e=tj.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=Per.fromDer(e.body);return Vde.privateKeyFromAsn1(n)};Vde.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Per.toDer(Vde.privateKeyToAsn1(t)).getBytes()};return tj.pem.encode(r,{maxline:e})};Vde.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Per.toDer(t).getBytes()};return tj.pem.encode(r,{maxline:e})}});var Fer=I((TZd,xBn)=>{p();var Kt=ds();WP();Fde();Snt();xJ();Der();sw();jde();ic();var jnt=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&&(he.queue(t,he.createAlert(t,{level:he.Alert.Level.warning,description:he.Alert.Description.no_renegotiation})),he.flush(t)),t.process()};he.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===he.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:he.Alert.Level.fatal,description:he.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:eT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=eT(s,2),n.compression_methods=eT(s,1)),c=r-(c-s.length()),c>0){for(var l=eT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:eT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(eT(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:he.Alert.Level.fatal,description:he.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=he.getCipherSuite(n.cipher_suite);else for(var m=Kt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=he.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:he.Alert.Level.fatal,description:he.Alert.Description.handshake_failure},cipherSuite:Kt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=he.CompressionMethod.none}return n};he.createSecurityParameters=function(t,e){var r=t.entity===he.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:he.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:he.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}};he.handleServerHello=function(t,e,r){var n=he.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:he.Alert.Level.fatal,description:he.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=vBn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=$Cs,t.session.resuming=!1,he.createSecurityParameters(t,n)),t.session.id=o,t.process()}};he.handleClientHello=function(t,e,r){var n=he.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;l0;)s=eT(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:he.Alert.Level.fatal,description:he.Alert.Description.bad_certificate}})}var u=t.entity===he.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:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?_Bn:Oer:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],he.verifyCertificateChain(t,l)&&(t.expect=u?_Bn:Oer)),t.process()};he.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.unsupported_certificate}});t.expect=VCs,t.process()};he.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:eT(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:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.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=Ber,t.session.clientCertificate!==null&&(t.expect=XCs),t.process()};he.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:eT(n,1),certificate_authorities:eT(n,2)};t.session.certificateRequest=o,t.expect=WCs,t.process()};he.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:eT(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:he.Alert.Level.fatal,description:he.Alert.Description.handshake_failure}})}t.expect=Ber,t.process()};he.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.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=he.createRecord(t,{type:he.ContentType.handshake,data:he.createCertificate(t)}),he.queue(t,e)),e=he.createRecord(t,{type:he.ContentType.handshake,data:he.createClientKeyExchange(t)}),he.queue(t,e),t.expect=KCs;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&he.queue(l,he.createRecord(l,{type:he.ContentType.handshake,data:he.createCertificateVerify(l,u)})),he.queue(l,he.createRecord(l,{type:he.ContentType.change_cipher_spec,data:he.createChangeCipherSpec()})),l.state.pending=he.createConnectionState(l),l.state.current.write=l.state.pending.write,he.queue(l,he.createRecord(l,{type:he.ContentType.handshake,data:he.createFinished(l)})),l.expect=vBn,he.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);he.getClientSignature(t,c)};he.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}});var r=t.entity===he.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=he.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?zCs:evs,t.process()};he.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===he.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=jnt;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:he.Alert.Level.fatal,description:he.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(he.queue(t,he.createRecord(t,{type:he.ContentType.change_cipher_spec,data:he.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,he.queue(t,he.createRecord(t,{type:he.ContentType.handshake,data:he.createFinished(t)}))),t.expect=c?YCs:tvs,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,he.flush(t),t.isConnected=!0,t.connected(t),t.process()};he.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case he.Alert.Description.close_notify:o="Connection closed.";break;case he.Alert.Description.unexpected_message:o="Unexpected message.";break;case he.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case he.Alert.Description.decryption_failed:o="Decryption failed.";break;case he.Alert.Description.record_overflow:o="Record overflow.";break;case he.Alert.Description.decompression_failure:o="Decompression failed.";break;case he.Alert.Description.handshake_failure:o="Handshake failure.";break;case he.Alert.Description.bad_certificate:o="Bad certificate.";break;case he.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case he.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case he.Alert.Description.certificate_expired:o="Certificate expired.";break;case he.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case he.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case he.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case he.Alert.Description.access_denied:o="Access denied.";break;case he.Alert.Description.decode_error:o="Decode error.";break;case he.Alert.Description.decrypt_error:o="Decrypt error.";break;case he.Alert.Description.export_restriction:o="Export restriction.";break;case he.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case he.Alert.Description.insufficient_security:o="Insufficient security.";break;case he.Alert.Description.internal_error:o="Internal error.";break;case he.Alert.Description.user_canceled:o="User canceled.";break;case he.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===he.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===he.ConnectionEnd.client?"server":"client",alert:n}),t.process()};he.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 qnt[t.entity][t.expect]?(t.entity===he.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!==he.HandshakeType.hello_request&&n!==he.HandshakeType.certificate_verify&&n!==he.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),qnt[t.entity][t.expect][n](t,e,o)):he.handleUnexpected(t,e)};he.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};he.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===he.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();he.queue(t,he.createRecord(t,{type:he.ContentType.heartbeat,data:he.createHeartbeat(he.HeartbeatMessageType.heartbeat_response,s)})),he.flush(t)}else if(n===he.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Kt.util.createBuffer(s))}t.process()};var GCs=0,$Cs=1,_Bn=2,VCs=3,WCs=4,vBn=5,zCs=6,YCs=7,KCs=8,JCs=0,ZCs=1,Oer=2,XCs=3,Ber=4,evs=5,tvs=6,fe=he.handleUnexpected,bBn=he.handleChangeCipherSpec,SA=he.handleAlert,$_=he.handleHandshake,SBn=he.handleApplicationData,TA=he.handleHeartbeat,Ler=[];Ler[he.ConnectionEnd.client]=[[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[bBn,SA,fe,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,SBn,TA],[fe,SA,$_,fe,TA]];Ler[he.ConnectionEnd.server]=[[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[bBn,SA,fe,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,SBn,TA],[fe,SA,$_,fe,TA]];var rj=he.handleHelloRequest,rvs=he.handleServerHello,TBn=he.handleCertificate,CBn=he.handleServerKeyExchange,Ner=he.handleCertificateRequest,Unt=he.handleServerHelloDone,IBn=he.handleFinished,qnt=[];qnt[he.ConnectionEnd.client]=[[fe,fe,rvs,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,TBn,CBn,Ner,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,CBn,Ner,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,Ner,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,IBn],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe]];var nvs=he.handleClientHello,ivs=he.handleClientKeyExchange,ovs=he.handleCertificateVerify;qnt[he.ConnectionEnd.server]=[[fe,nvs,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,TBn,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,ivs,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,ovs,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,IBn],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe]];he.generateKeys=function(t,e){var r=jnt,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===he.Versions.TLS_1_0.major&&t.version.minor===he.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};he.createConnectionState=function(t){var e=t.entity===he.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:he.Alert.Level.fatal,description:he.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.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:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=he.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 he.CompressionMethod.none:break;case he.CompressionMethod.deflate:n.read.compressFunction=HCs,n.write.compressFunction=jCs;break;default:throw new Error("Unsupported compression algorithm.")}}return n};he.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};he.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};he.createAlert=function(t,e){var r=Kt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),he.createRecord(t,{type:he.ContentType.alert,data:r})};he.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(he.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};he.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Kt.util.createBuffer();return n.putByte(he.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};he.createCertificate=function(t){var e=t.entity===he.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(he.HandshakeType.server_key_exchange),r.putInt24(e)),r};he.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:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};he.createCertificateVerify=function(t,e){var r=e.length+2,n=Kt.util.createBuffer();return n.putByte(he.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};he.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(he.HandshakeType.certificate_request),u.putInt24(l),uw(u,1,e),uw(u,2,r),u};he.createServerHelloDone=function(t){var e=Kt.util.createBuffer();return e.putByte(he.HandshakeType.server_hello_done),e.putInt24(0),e};he.createChangeCipherSpec=function(){var t=Kt.util.createBuffer();return t.putByte(1),t};he.createFinished=function(t){var e=Kt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===he.ConnectionEnd.client,n=t.session.sp,o=12,s=jnt,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Kt.util.createBuffer();return l.putByte(he.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};he.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};he.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===he.ContentType.handshake||e.type===he.ContentType.alert||e.type===he.ContentType.change_cipher_spec))){if(e.type===he.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()<=he.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>he.MaxFragment;)n.push(he.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o.slice(0,he.MaxFragment))})),o=o.slice(he.MaxFragment);o.length>0&&n.push(he.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};he.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 he.CipherSuites)r.push(he.CipherSuites[n])}var o=t.server?he.ConnectionEnd.server:he.ConnectionEnd.client,s=t.sessionCache?he.createSessionCache(t.sessionCache):null,c={version:{major:he.Version.major,minor:he.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===he.ConnectionEnd.client?"client":"server"),h.send&&(he.queue(f,he.createAlert(f,h.alert)),he.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:he.Version.major,minor:he.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===he.ConnectionEnd.client?GCs:JCs,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=he.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-he.ContentType.change_cipher_spec,g=Ler[f.entity][f.expect];m in g?g[m](f,h):he.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:he.Alert.Level.fatal,description:he.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=he.createRandom().getBytes(),c.open=!0,he.queue(c,he.createRecord(c,{type:he.ContentType.handshake,data:he.createClientHello(c)})),he.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 he.queue(c,he.createRecord(c,{type:he.ContentType.application_data,data:Kt.util.createBuffer(f)})),he.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,he.queue(c,he.createRecord(c,{type:he.ContentType.heartbeat,data:he.createHeartbeat(he.HeartbeatMessageType.heartbeat_request,f,h)})),he.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,he.queue(c,he.createAlert(c,{level:he.Alert.Level.warning,description:he.Alert.Description.close_notify})),he.flush(c)),c.closed(c)),c.reset(f)},c};xBn.exports=Kt.tls=Kt.tls||{};for(Qnt in he)typeof he[Qnt]!="function"&&(Kt.tls[Qnt]=he[Qnt]);var Qnt;Kt.tls.prf_tls1=jnt;Kt.tls.hmac_sha1=qCs;Kt.tls.createSessionCache=he.createSessionCache;Kt.tls.createConnection=he.createConnection});var kBn=I((wZd,RBn)=>{p();var nj=ds();Kq();Fer();var dw=RBn.exports=nj.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:wBn};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:wBn};function wBn(t,e,r){var n=e.entity===nj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:nj.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:nj.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=uvs,t.write.cipherFunction=avs,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=dw.hmac_sha1}a(wBn,"initConnectionState");function avs(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=nj.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(cvs)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(avs,"encrypt_aes_cbc_sha1");function cvs(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(cvs,"encrypt_aes_cbc_sha1_padding");function lvs(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=nj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=dvs(e.macKey,c,u)&&r,r}a(uvs,"decrypt_aes_cbc_sha1");function dvs(t,e,r){var n=nj.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(dvs,"compareMacs")});var qer=I((PZd,MBn)=>{p();var td=ds();qO();ic();var QRe=MBn.exports=td.sha512=td.sha512||{};td.md.sha512=td.md.algorithms.sha512=QRe;var DBn=td.sha384=td.sha512.sha384=td.sha512.sha384||{};DBn.create=function(){return QRe.create("SHA-384")};td.md.sha384=td.md.algorithms.sha384=DBn;td.sha512.sha256=td.sha512.sha256||{create:a(function(){return QRe.create("SHA-512/256")},"create")};td.md["sha512/256"]=td.md.algorithms["sha512/256"]=td.sha512.sha256;td.sha512.sha224=td.sha512.sha224||{create:a(function(){return QRe.create("SHA-512/224")},"create")};td.md["sha512/224"]=td.md.algorithms["sha512/224"]=td.sha512.sha224;QRe.create=function(t){if(NBn||fvs(),typeof t>"u"&&(t="SHA-512"),!(t in NJ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=NJ[t],r=null,n=td.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),PBn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=td.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Uer.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],q=U[0],F=U[1],n=((q>>>19|F<<13)^(F>>>29|q<<3)^q>>>6)>>>0,o=((q<<13|F>>>19)^(F<<3|q>>>29)^(q<<26|F>>>6))>>>0,V=e[O-15],q=V[0],F=V[1],s=((q>>>1|F<<31)^(q>>>8|F<<24)^q>>>7)>>>0,c=((q<<31|F>>>1)^(q<<24|F>>>8)^(q<<25|F>>>7))>>>0,W=e[O-7],G=e[O-16],F=o+W[1]+c+G[1],e[O][0]=n+W[0]+s+G[0]+(F/4294967296>>>0)>>>0,e[O][1]=F>>>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],k=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|k<<18)^(x>>>18|k<<14)^(k>>>9|x<<23))>>>0,f=((x<<18|k>>>14)^(x<<14|k>>>18)^(k<<23|x>>>9))>>>0,h=(L^x&(D^L))>>>0,m=(B^k&(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,F=M+f+m+Qer[O][1]+e[O][1],n=Q+d+h+Qer[O][0]+e[O][0]+(F/4294967296>>>0)>>>0,o=F>>>0,F=u+A,s=l+g+(F/4294967296>>>0)>>>0,c=F>>>0,Q=L,M=B,L=D,B=N,D=x,N=k,F=R+o,x=w+n+(F/4294967296>>>0)>>>0,k=F>>>0,w=b,R=T,b=_,T=v,_=y,v=E,F=o+c,y=n+s+(F/4294967296>>>0)>>>0,E=F>>>0;F=t[0][1]+E,t[0][0]=t[0][0]+y+(F/4294967296>>>0)>>>0,t[0][1]=F>>>0,F=t[1][1]+v,t[1][0]=t[1][0]+_+(F/4294967296>>>0)>>>0,t[1][1]=F>>>0,F=t[2][1]+T,t[2][0]=t[2][0]+b+(F/4294967296>>>0)>>>0,t[2][1]=F>>>0,F=t[3][1]+R,t[3][0]=t[3][0]+w+(F/4294967296>>>0)>>>0,t[3][1]=F>>>0,F=t[4][1]+k,t[4][0]=t[4][0]+x+(F/4294967296>>>0)>>>0,t[4][1]=F>>>0,F=t[5][1]+N,t[5][0]=t[5][0]+D+(F/4294967296>>>0)>>>0,t[5][1]=F>>>0,F=t[6][1]+B,t[6][0]=t[6][0]+L+(F/4294967296>>>0)>>>0,t[6][1]=F>>>0,F=t[7][1]+M,t[7][0]=t[7][0]+Q+(F/4294967296>>>0)>>>0,t[7][1]=F>>>0,Y-=128}}a(PBn,"_update")});var OBn=I(jer=>{p();var pvs=ds();WP();var Ag=pvs.asn1;jer.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};jer.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var zBn=I((BZd,WBn)=>{p();var IA=ds();BRe();sw();qer();ic();var qBn=OBn(),hvs=qBn.publicKeyValidator,mvs=qBn.privateKeyValidator;typeof BBn>"u"&&(BBn=IA.jsbn.BigInteger);var BBn,Ger=IA.util.ByteBuffer,Jv=typeof Buffer>"u"?Uint8Array:Buffer;IA.pki=IA.pki||{};WBn.exports=IA.pki.ed25519=IA.ed25519=IA.ed25519||{};var Js=IA.ed25519;Js.constants={};Js.constants.PUBLIC_KEY_BYTE_LENGTH=32;Js.constants.PRIVATE_KEY_BYTE_LENGTH=64;Js.constants.SEED_BYTE_LENGTH=32;Js.constants.SIGN_BYTE_LENGTH=64;Js.constants.HASH_BYTE_LENGTH=64;Js.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=IA.random.getBytesSync(Js.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Js.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Js.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=lF({message:e,encoding:"binary"});for(var r=new Jv(Js.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Jv(Js.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return Evs(r,n),{publicKey:r,privateKey:n}};Js.privateKeyFromAsn1=function(t){var e={},r=[],n=IA.asn1.validate(t,mvs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=IA.asn1.derToOid(e.privateKeyOid),c=IA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=lF({message:IA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};Js.publicKeyFromAsn1=function(t){var e={},r=[],n=IA.asn1.validate(t,hvs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=IA.asn1.derToOid(e.publicKeyOid),c=IA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==Js.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return lF({message:l,encoding:"binary"})};Js.publicKeyFromPrivateKey=function(t){t=t||{};var e=lF({message:t.privateKey,encoding:"binary"});if(e.length!==Js.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Js.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new Jv(Js.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function lF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof Jv)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 Ger(e,r)}else if(!(e instanceof Ger))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 Jv(e.length()),o=0;o=0;--r){if(t[e+r]qRe[r])return!1}return!1}a(vvs,"_isCanonicalSignatureScalar");function jBn(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)*qRe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*qRe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(jBn,"modL");function Ver(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;jBn(t,e)}a(Ver,"reduce");function Wer(t,e){var r=Vi(),n=Vi(),o=Vi(),s=Vi(),c=Vi(),l=Vi(),u=Vi(),d=Vi(),f=Vi();zde(r,t[1],t[0]),zde(f,e[1],e[0]),jl(r,r,f),Wde(n,t[0],t[1]),Wde(f,e[0],e[1]),jl(n,n,f),jl(o,t[3],e[3]),jl(o,o,Avs),jl(s,t[2],e[2]),Wde(s,s,s),zde(c,n,r),zde(l,s,o),Wde(u,s,o),Wde(d,n,r),jl(t[0],c,l),jl(t[1],d,u),jl(t[2],u,l),jl(t[3],c,d)}a(Wer,"add");function UBn(t,e,r){for(var n=0;n<4;++n)VBn(t[n],e[n],r)}a(UBn,"cswap");function zer(t,e){var r=Vi(),n=Vi(),o=Vi();xvs(o,e[2]),jl(r,e[0],o),jl(n,e[1],o),Gnt(t,n),t[31]^=GBn(r)<<7}a(zer,"pack");function Gnt(t,e){var r,n,o,s=Vi(),c=Vi();for(r=0;r<16;++r)c[r]=e[r];for(Her(c),Her(c),Her(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,VBn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(Gnt,"pack25519");function bvs(t,e){var r=Vi(),n=Vi(),o=Vi(),s=Vi(),c=Vi(),l=Vi(),u=Vi();return ij(t[2],Hnt),Svs(t[1],e),MJ(o,t[1]),jl(s,o,gvs),zde(o,o,t[2]),Wde(s,t[2],s),MJ(c,s),MJ(l,c),jl(u,l,c),jl(r,u,o),jl(r,r,s),Tvs(r,r),jl(r,r,o),jl(r,r,s),jl(r,r,s),jl(t[0],r,s),MJ(n,t[0]),jl(n,n,s),QBn(n,o)&&jl(t[0],t[0],yvs),MJ(n,t[0]),jl(n,n,s),QBn(n,o)?-1:(GBn(t[0])===e[31]>>7&&zde(t[0],$er,t[0]),jl(t[3],t[0],t[1]),0)}a(bvs,"unpackneg");function Svs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(Svs,"unpack25519");function Tvs(t,e){var r=Vi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)MJ(r,r),n!==1&&jl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(Tvs,"pow2523");function QBn(t,e){var r=new Jv(32),n=new Jv(32);return Gnt(r,t),Gnt(n,e),HBn(r,0,n,0)}a(QBn,"neq25519");function HBn(t,e,r,n){return Ivs(t,e,r,n,32)}a(HBn,"crypto_verify_32");function Ivs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(Ivs,"vn");function GBn(t){var e=new Jv(32);return Gnt(e,t),e[0]&1}a(GBn,"par25519");function $Bn(t,e,r){var n,o;for(ij(t[0],$er),ij(t[1],Hnt),ij(t[2],Hnt),ij(t[3],$er),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,UBn(t,e,n),Wer(e,t),Wer(t,t),UBn(t,e,n)}a($Bn,"scalarmult");function Yer(t,e){var r=[Vi(),Vi(),Vi(),Vi()];ij(r[0],LBn),ij(r[1],FBn),ij(r[2],Hnt),jl(r[3],LBn,FBn),$Bn(t,r,e)}a(Yer,"scalarbase");function ij(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(ij,"set25519");function xvs(t,e){var r=Vi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)MJ(r,r),n!==2&&n!==4&&jl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(xvs,"inv25519");function Her(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(Her,"car25519");function VBn(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(VBn,"sel25519");function Vi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var tT=ds();ic();sw();BRe();JBn.exports=tT.kem=tT.kem||{};var YBn=tT.jsbn.BigInteger;tT.kem.rsa={};tT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||tT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new YBn(tT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(YBn.ONE)<=0);l=tT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=tT.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};tT.kem.kdf1=function(t,e){KBn(this,t,0,e||t.digestLength)};tT.kem.kdf2=function(t,e){KBn(this,t,1,e||t.digestLength)};function KBn(t,e,r,n){t.generate=function(o,s){for(var c=new tT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new tT.util.ByteBuffer,d=r;d{p();var fa=ds();ic();tLn.exports=fa.log=fa.log||{};fa.log.levels=["none","error","warning","info","debug","verbose","max"];var $nt={},Zer=[],GRe=null;fa.log.LEVEL_LOCKED=2;fa.log.NO_LEVEL_CHECK=4;fa.log.INTERPOLATE=8;for(YO=0;YO"u"||e?t.flags|=fa.log.LEVEL_LOCKED:t.flags&=~fa.log.LEVEL_LOCKED};fa.log.addLogger=function(t){Zer.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(XBn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},$Re=a(function(t,e){fa.log.prepareStandard(e);var r=XBn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Yde=fa.log.makeLogger($Re)):($Re=a(function(e,r){fa.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Yde=fa.log.makeLogger($Re)),fa.log.setLevel(Yde,"debug"),fa.log.addLogger(Yde),GRe=Yde):console={log:a(function(){},"log")};var Yde,XBn,$Re;GRe!==null&&typeof window<"u"&&window.location&&(HRe=new URL(window.location.href).searchParams,HRe.has("console.level")&&fa.log.setLevel(GRe,HRe.get("console.level").slice(-1)[0]),HRe.has("console.lock")&&(eLn=HRe.get("console.lock").slice(-1)[0],eLn=="true"&&fa.log.lock(GRe)));var HRe,eLn;fa.log.consoleLogger=GRe});var iLn=I(($Zd,nLn)=>{p();nLn.exports=qO();Snt();jde();fer();qer()});var aLn=I((WZd,sLn)=>{p();var Zr=ds();Kq();WP();MRe();Jq();xJ();Ier();sw();ic();Fnt();var Ge=Zr.asn1,V_=sLn.exports=Zr.pkcs7=Zr.pkcs7||{};V_.messageFromPem=function(t){var e=Zr.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=Ge.fromDer(e.body);return V_.messageFromAsn1(n)};V_.messageToPem=function(t,e){var r={type:"PKCS7",body:Ge.toDer(t.toAsn1()).getBytes()};return Zr.pem.encode(r,{maxline:e})};V_.messageFromAsn1=function(t){var e={},r=[];if(!Ge.validate(t,V_.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=Ge.derToOid(e.contentType),s;switch(o){case Zr.pki.oids.envelopedData:s=V_.createEnvelopedData();break;case Zr.pki.oids.encryptedData:s=V_.createEncryptedData();break;case Zr.pki.oids.signedData:s=V_.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};V_.createSignedData=function(){var t=null;return t={type:Zr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(etr(t,n,V_.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(Ge.create(Ge.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Ge.create(Ge.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Ge.create(Ge.Class.UNIVERSAL,Ge.Type.SET,!0,t.signerInfos)),Ge.create(Ge.Class.UNIVERSAL,Ge.Type.SEQUENCE,!0,[Ge.create(Ge.Class.UNIVERSAL,Ge.Type.OID,!1,Ge.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=Zr.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=Zr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Zr.pki.oids.sha1;switch(u){case Zr.pki.oids.sha1:case Zr.pki.oids.sha256:case Zr.pki.oids.sha384:case Zr.pki.oids.sha512:case Zr.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=Ge.create(Ge.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var Zh=ds();Kq();Fde();Snt();jde();ic();var Wnt=cLn.exports=Zh.ssh=Zh.ssh||{};Wnt.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(Ort,"foldHeader");function F0s(t){return t.replace(/^\s+/,"")}a(F0s,"ltrim")});var iRe=I(($Gd,ROn)=>{p();var Bd=ls();xrt();zZt();rc();ROn.exports=Bd.des=Bd.des||{};Bd.des.startEncrypting=function(t,e,r,n){var o=Lrt({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Bd.des.createEncryptionCipher=function(t,e){return Lrt({key:t,output:null,decrypt:!1,mode:e})};Bd.des.startDecrypting=function(t,e,r,n){var o=Lrt({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Bd.des.createDecryptionCipher=function(t,e){return Lrt({key:t,output:null,decrypt:!0,mode:e})};Bd.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return wOn(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return wOn(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};Bd.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=Bd.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=W0s(e),this._init=!0}};kO("DES-ECB",Bd.cipher.modes.ecb);kO("DES-CBC",Bd.cipher.modes.cbc);kO("DES-CFB",Bd.cipher.modes.cfb);kO("DES-OFB",Bd.cipher.modes.ofb);kO("DES-CTR",Bd.cipher.modes.ctr);kO("3DES-ECB",Bd.cipher.modes.ecb);kO("3DES-CBC",Bd.cipher.modes.cbc);kO("3DES-CFB",Bd.cipher.modes.cfb);kO("3DES-OFB",Bd.cipher.modes.ofb);kO("3DES-CTR",Bd.cipher.modes.ctr);function kO(t,e){var r=a(function(){return new Bd.des.Algorithm(t,e)},"factory");Bd.cipher.registerAlgorithm(t,r)}a(kO,"registerAlgorithm");var U0s=[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],Q0s=[-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],q0s=[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],j0s=[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],H0s=[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],G0s=[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],$0s=[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],V0s=[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 W0s(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(W0s,"_createKeys");function wOn(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^(Q0s[g>>>24&63]|j0s[g>>>16&63]|G0s[g>>>8&63]|V0s[g&63]|U0s[A>>>24&63]|q0s[A>>>16&63]|H0s[A>>>8&63]|$0s[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(wOn,"_updateBlock");function Lrt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=Bd.cipher.createDecipher(r,t.key):n=Bd.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Bd.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Lrt,"_createCipher")});var Frt=I((zGd,POn)=>{p();var q_=ls();hde();RO();rc();var z0s=q_.pkcs5=q_.pkcs5||{},W3;q_.util.isNodejs&&!q_.options.usePureJavaScript&&(W3=require("crypto"));POn.exports=q_.pbkdf2=z0s.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),q_.util.isNodejs&&!q_.options.usePureJavaScript&&W3.pbkdf2&&(o===null||typeof o!="object")&&(W3.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?W3.pbkdf2Sync.length===4?W3.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):W3.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):W3.pbkdf2Sync.length===4?W3.pbkdf2Sync(t,e,r,n).toString("binary"):W3.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in q_.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=q_.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=q_.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(q_.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=q_.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(q_.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=q_.util.xorBytes(m,g,c),A=g,++E,q_.util.setImmediate(v);h+=y{p();var DO=ls();RO();rc();var DOn=OOn.exports=DO.sha256=DO.sha256||{};DO.md.sha256=DO.md.algorithms.sha256=DOn;DOn.create=function(){NOn||Y0s();var t=null,e=DO.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),kOn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=DO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(eXt.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};kOn(h,r,o);var m=DO.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 eXt=null,NOn=!1,MOn=null;function Y0s(){eXt="\x80",eXt+=DO.util.fillString("\0",64),MOn=[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],NOn=!0}a(Y0s,"_init");function kOn(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+MOn[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(kOn,"_update")});var rXt=I((e$d,BOn)=>{p();var NO=ls();rc();var Urt=null;NO.util.isNodejs&&!NO.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Urt=require("crypto"));var K0s=BOn.exports=NO.prng=NO.prng||{};K0s.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=NO.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 NO.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)),NO.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=NO.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=NO.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=NO.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"),Urt?(e.seedFile=function(d,f){Urt.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Urt.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 Xx=I((n$d,nXt)=>{p();var gg=ls();Dq();tXt();rXt();rc();(function(){if(gg.random&&gg.random.getBytes){nXt.exports=gg.random;return}(function(t){var e={},r=new Array(4),n=gg.util.createBuffer();e.formatKey=function(h){var m=gg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),gg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=gg.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 gg.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=gg.md.sha256;function o(){var h=gg.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=gg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),gg.options.usePureJavaScript||!gg.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(!gg.random)gg.random=s;else for(var f in s)gg.random[f]=s[f];gg.random.createInstance=o,nXt.exports=gg.random})(typeof jQuery<"u"?jQuery:null)})()});var oXt=I((s$d,UOn)=>{p();var GC=ls();rc();var iXt=[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],LOn=[1,2,3,5],J0s=a(function(t,e){return t<>16-e},"rol"),Z0s=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");UOn.exports=GC.rc2=GC.rc2||{};GC.rc2.expandKey=function(t,e){typeof t=="string"&&(t=GC.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(iXt[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,iXt[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,iXt[r.at(l+1)^r.at(l+s)]);return r};var FOn=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=GC.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]=J0s(A[d],LOn[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]=Z0s(A[d],LOn[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");GC.rc2.startEncrypting=function(t,e,r){var n=GC.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};GC.rc2.createEncryptionCipher=function(t,e){return FOn(t,e,!0)};GC.rc2.startDecrypting=function(t,e,r){var n=GC.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};GC.rc2.createDecryptionCipher=function(t,e){return FOn(t,e,!1)}});var sRe=I((l$d,WOn)=>{p();var sXt=ls();WOn.exports=sXt.jsbn=sXt.jsbn||{};var z3,X0s=0xdeadbeefcafe,QOn=(X0s&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");sXt.jsbn.BigInteger=Wt;function ja(){return new Wt(null)}a(ja,"nbi");function ems(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(ems,"am1");function tms(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(tms,"am2");function qOn(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(qOn,"am3");typeof navigator>"u"?(Wt.prototype.am=qOn,z3=28):QOn&&navigator.appName=="Microsoft Internet Explorer"?(Wt.prototype.am=tms,z3=30):QOn&&navigator.appName!="Netscape"?(Wt.prototype.am=ems,z3=26):(Wt.prototype.am=qOn,z3=28);Wt.prototype.DB=z3;Wt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(nms,"bnpCopyTo");function ims(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(ims,"bnpFromInt");function Mq(t){var e=ja();return e.fromInt(t),e}a(Mq,"nbv");function oms(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:HOn(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(sms,"bnpClamp");function ams(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=jOn(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+=jOn(n));return o?s:"0"}a(ams,"bnToString");function cms(){var t=ja();return Wt.ZERO.subTo(this,t),t}a(cms,"bnNegate");function lms(){return this.s<0?this.negate():this}a(lms,"bnAbs");function ums(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(ums,"bnCompareTo");function qrt(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(qrt,"nbits");function dms(){return this.t<=0?0:this.DB*(this.t-1)+qrt(this.data[this.t-1]^this.s&this.DM)}a(dms,"bnBitLength");function fms(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(fms,"bnpDLShiftTo");function pms(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(hms,"bnpLShiftTo");function mms(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(gms,"bnpSubTo");function Ams(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(yms,"bnpSquareTo");function Ems(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(Ems,"bnpDivRemTo");function _ms(t){var e=ja();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Wt.ZERO)>0&&t.subTo(e,e),e}a(_ms,"bnMod");function cJ(t){this.m=t}a(cJ,"Classic");function vms(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(vms,"cConvert");function Cms(t){return t}a(Cms,"cRevert");function bms(t){t.divRemTo(this.m,null,t)}a(bms,"cReduce");function Sms(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(Sms,"cMulTo");function Tms(t,e){t.squareTo(e),this.reduce(e)}a(Tms,"cSqrTo");cJ.prototype.convert=vms;cJ.prototype.revert=Cms;cJ.prototype.reduce=bms;cJ.prototype.mulTo=Sms;cJ.prototype.sqrTo=Tms;function Ims(){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(Ims,"bnpInvDigit");function lJ(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(xms,"montConvert");function wms(t){var e=ja();return t.copyTo(e),this.reduce(e),e}a(wms,"montRevert");function Rms(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(Rms,"montReduce");function Pms(t,e){t.squareTo(e),this.reduce(e)}a(Pms,"montSqrTo");function kms(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(kms,"montMulTo");lJ.prototype.convert=xms;lJ.prototype.revert=wms;lJ.prototype.reduce=Rms;lJ.prototype.mulTo=kms;lJ.prototype.sqrTo=Pms;function Dms(){return(this.t>0?this.data[0]&1:this.s)==0}a(Dms,"bnpIsEven");function Nms(t,e){if(t>4294967295||t<1)return Wt.ONE;var r=ja(),n=ja(),o=e.convert(this),s=qrt(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(Nms,"bnpExp");function Mms(t,e){var r;return t<256||e.isEven()?r=new cJ(e):r=new lJ(e),this.exp(t,r)}a(Mms,"bnModPowInt");Wt.prototype.copyTo=nms;Wt.prototype.fromInt=ims;Wt.prototype.fromString=oms;Wt.prototype.clamp=sms;Wt.prototype.dlShiftTo=fms;Wt.prototype.drShiftTo=pms;Wt.prototype.lShiftTo=hms;Wt.prototype.rShiftTo=mms;Wt.prototype.subTo=gms;Wt.prototype.multiplyTo=Ams;Wt.prototype.squareTo=yms;Wt.prototype.divRemTo=Ems;Wt.prototype.invDigit=Ims;Wt.prototype.isEven=Dms;Wt.prototype.exp=Nms;Wt.prototype.toString=ams;Wt.prototype.negate=cms;Wt.prototype.abs=lms;Wt.prototype.compareTo=ums;Wt.prototype.bitLength=dms;Wt.prototype.mod=_ms;Wt.prototype.modPowInt=Mms;Wt.ZERO=Mq(0);Wt.ONE=Mq(1);function Oms(){var t=ja();return this.copyTo(t),t}a(Oms,"bnClone");function Bms(){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(Lms,"bnByteValue");function Fms(){return this.t==0?this.s:this.data[0]<<16>>16}a(Fms,"bnShortValue");function Ums(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(Ums,"bnpChunkSize");function Qms(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(Qms,"bnSigNum");function qms(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=Mq(r),o=ja(),s=ja(),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(qms,"bnpToRadix");function jms(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(jms,"bnpFromRadix");function Hms(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),cXt,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(Gms,"bnToByteArray");function $ms(t){return this.compareTo(t)==0}a($ms,"bnEquals");function Vms(t){return this.compareTo(t)<0?this:t}a(Vms,"bnMin");function Wms(t){return this.compareTo(t)>0?this:t}a(Wms,"bnMax");function zms(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(ngs,"lbit");function igs(){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(fgs,"bnpAddTo");function pgs(t){var e=ja();return this.addTo(t,e),e}a(pgs,"bnAdd");function hgs(t){var e=ja();return this.subTo(t,e),e}a(hgs,"bnSubtract");function mgs(t){var e=ja();return this.multiplyTo(t,e),e}a(mgs,"bnMultiply");function ggs(){var t=ja();return this.squareTo(t),t}a(ggs,"bnSquare");function Ags(t){var e=ja();return this.divRemTo(t,e,null),e}a(Ags,"bnDivide");function ygs(t){var e=ja();return this.divRemTo(t,null,e),e}a(ygs,"bnRemainder");function Egs(t){var e=ja(),r=ja();return this.divRemTo(t,e,r),new Array(e,r)}a(Egs,"bnDivideAndRemainder");function _gs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(_gs,"bnpDMultiply");function vgs(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(vgs,"bnpDAddOffset");function oRe(){}a(oRe,"NullExp");function VOn(t){return t}a(VOn,"nNop");function Cgs(t,e,r){t.multiplyTo(e,r)}a(Cgs,"nMulTo");function bgs(t,e){t.squareTo(e)}a(bgs,"nSqrTo");oRe.prototype.convert=VOn;oRe.prototype.revert=VOn;oRe.prototype.mulTo=Cgs;oRe.prototype.sqrTo=bgs;function Sgs(t){return this.exp(t,new oRe)}a(Sgs,"bnPow");function Tgs(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=ja();return t.copyTo(e),this.reduce(e),e}a(xgs,"barrettConvert");function wgs(t){return t}a(wgs,"barrettRevert");function Rgs(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(Rgs,"barrettReduce");function Pgs(t,e){t.squareTo(e),this.reduce(e)}a(Pgs,"barrettSqrTo");function kgs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(kgs,"barrettMulTo");Ade.prototype.convert=xgs;Ade.prototype.revert=wgs;Ade.prototype.reduce=Rgs;Ade.prototype.mulTo=kgs;Ade.prototype.sqrTo=Pgs;function Dgs(t,e){var r=t.bitLength(),n,o=Mq(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 cJ(e):e.isEven()?s=new Ade(e):s=new lJ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=ja();for(s.sqrTo(c[1],f);l<=d;)c[l]=ja(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=ja(),y;for(r=qrt(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(Ngs,"bnGCD");function Mgs(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(Mgs,"bnpModInt");function Ogs(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=Mq(1),s=Mq(0),c=Mq(0),l=Mq(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(Ogs,"bnModInverse");var qk=[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],Bgs=(1<<26)/qk[qk.length-1];function Lgs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=qk[qk.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 MO=ls();RO();rc();var YOn=JOn.exports=MO.sha1=MO.sha1||{};MO.md.sha1=MO.md.algorithms.sha1=YOn;YOn.create=function(){KOn||Qgs();var t=null,e=MO.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),zOn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=MO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(lXt.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};zOn(h,r,o);var m=MO.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 lXt=null,KOn=!1;function Qgs(){lXt="\x80",lXt+=MO.util.fillString("\0",64),KOn=!0}a(Qgs,"_init");function zOn(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(zOn,"_update")});var uXt=I((m$d,XOn)=>{p();var OO=ls();rc();Xx();yde();var ZOn=XOn.exports=OO.pkcs1=OO.pkcs1||{};ZOn.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=OO.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(jrt,"rsa_mgf1")});var fXt=I((y$d,dXt)=>{p();var Oq=ls();rc();sRe();Xx();(function(){if(Oq.prime){dXt.exports=Oq.prime;return}var t=dXt.exports=Oq.prime=Oq.prime||{},e=Oq.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||Oq.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 Oq.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 aRe=I((v$d,s5n)=>{p();var Ei=ls();Qk();sRe();Nq();uXt();fXt();Xx();rc();typeof Ha>"u"&&(Ha=Ei.jsbn.BigInteger);var Ha,pXt=Ei.util.isNodejs?require("crypto"):null,pt=Ei.asn1,tw=Ei.util;Ei.pki=Ei.pki||{};s5n.exports=Ei.pki.rsa=Ei.rsa=Ei.rsa||{};var Lo=Ei.pki,qgs=[6,4,2,4,2,4,6,2],jgs={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"}]},Hgs={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"}]},Ggs={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"}]},$gs=Ei.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"}]}]},Vgs={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"}]},Wgs=a(function(t){var e;if(t.algorithm in Lo.oids)e=Lo.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"),i5n=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(Ha.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Ha.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Ha(Ei.util.bytesToHex(Ei.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Ha.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");Lo.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=o5n(t,e,r)):(o=Ei.util.createBuffer(),o.putBytes(t));for(var c=new Ha(o.toHex(),16),l=i5n(c,e,n),u=l.toString(16),d=Ei.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ei.util.hexToBytes(u)),d.getBytes()};Lo.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 Ha(Ei.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=i5n(c,e,r),u=l.toString(16),d=Ei.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ei.util.hexToBytes(u)),n!==!1?Hrt(d.getBytes(),e,r):d.getBytes()};Lo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||Ei.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};Lo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Ha(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(Ygs(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(qgs[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Ha.ONE).gcd(t.e).compareTo(Ha.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(Ha.ONE),t.q1=t.q.subtract(Ha.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Ha.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:Lo.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:Lo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};Lo.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),!Ei.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(e5n("generateKeyPair"))return pXt.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:Lo.privateKeyFromPem(d),publicKey:Lo.publicKeyFromPem(u)})});if(t5n("generateKey")&&t5n("exportKey"))return tw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:n5n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return tw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=Lo.privateKeyFromAsn1(pt.fromDer(Ei.util.createBuffer(l)));n(null,{privateKey:u,publicKey:Lo.setRsaPublicKey(u.n,u.e)})}});if(r5n("generateKey")&&r5n("exportKey")){var o=tw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:n5n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=tw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=Lo.privateKeyFromAsn1(pt.fromDer(Ei.util.createBuffer(h)));n(null,{privateKey:m,publicKey:Lo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(e5n("generateKeyPairSync")){var s=pXt.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Lo.privateKeyFromPem(s.privateKey),publicKey:Lo.publicKeyFromPem(s.publicKey)}}}var c=Lo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Lo.rsa.stepKeyPairGenerationState(c,0),c.keys;zgs(c,r,n)};Lo.setRsaPublicKey=Lo.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 o5n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return Ei.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 Lo.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=Hrt(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,Vgs,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===Ei.oids.md2||A===Ei.oids.md5||A===Ei.oids.sha1||A===Ei.oids.sha224||A===Ei.oids.sha256||A===Ei.oids.sha384||A===Ei.oids.sha512||A===Ei.oids["sha512-224"]||A===Ei.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===Ei.oids.md2||A===Ei.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=Hrt(d,r,!0,void 0,c),u===d},"verify")});var l=Lo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};Lo.setRsaPrivateKey=Lo.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=Lo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:Hrt};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return Ei.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:Wgs},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 Lo.rsa.encrypt(m,u,h)},u};Lo.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(Lo.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())])};Lo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,jgs,e,r)&&(t=pt.fromDer(Ei.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,Hgs,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=Ei.util.createBuffer(e.privateKeyModulus).toHex(),s=Ei.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=Ei.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=Ei.util.createBuffer(e.privateKeyPrime1).toHex(),u=Ei.util.createBuffer(e.privateKeyPrime2).toHex(),d=Ei.util.createBuffer(e.privateKeyExponent1).toHex(),f=Ei.util.createBuffer(e.privateKeyExponent2).toHex(),h=Ei.util.createBuffer(e.privateKeyCoefficient).toHex(),Lo.setRsaPrivateKey(new Ha(o,16),new Ha(s,16),new Ha(c,16),new Ha(l,16),new Ha(u,16),new Ha(d,16),new Ha(f,16),new Ha(h,16))};Lo.privateKeyToAsn1=Lo.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,BO(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.qInv))])};Lo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,$gs,e,r)){var n=pt.derToOid(e.publicKeyOid);if(n!==Lo.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,Ggs,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=Ei.util.createBuffer(e.publicKeyModulus).toHex(),c=Ei.util.createBuffer(e.publicKeyExponent).toHex();return Lo.setRsaPublicKey(new Ha(s,16),new Ha(c,16))};Lo.publicKeyToAsn1=Lo.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(Lo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[Lo.publicKeyToRSAPublicKey(t)])])};Lo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,BO(t.e))])};function o5n(t,e,r){var n=Ei.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=Ei.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(Hrt,"_decodePkcs1_v1_5");function zgs(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){Ei.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(Ha.ONE).gcd(t.e).compareTo(Ha.ONE)!==0){t.p=null,o();return}if(t.q.subtract(Ha.ONE).gcd(t.e).compareTo(Ha.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(Ha.ONE),t.q1=t.q.subtract(Ha.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Ha.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:Lo.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:Lo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(zgs,"_generateKeyPair");function BO(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=Ei.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(BO,"_bnToBytes");function Ygs(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(Ygs,"_getMillerRabinTests");function e5n(t){return Ei.util.isNodejs&&typeof pXt[t]=="function"}a(e5n,"_detectNodeCrypto");function t5n(t){return typeof tw.globalScope<"u"&&typeof tw.globalScope.crypto=="object"&&typeof tw.globalScope.crypto.subtle=="object"&&typeof tw.globalScope.crypto.subtle[t]=="function"}a(t5n,"_detectSubtleCrypto");function r5n(t){return typeof tw.globalScope<"u"&&typeof tw.globalScope.msCrypto=="object"&&typeof tw.globalScope.msCrypto.subtle=="object"&&typeof tw.globalScope.msCrypto.subtle[t]=="function"}a(r5n,"_detectSubtleMsCrypto");function n5n(t){for(var e=Ei.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var gn=ls();Dq();Qk();iRe();RO();Nq();Frt();aJ();Xx();oXt();aRe();rc();typeof a5n>"u"&&(a5n=gn.jsbn.BigInteger);var a5n,Dt=gn.asn1,es=gn.pki=gn.pki||{};d5n.exports=es.pbe=gn.pbe=gn.pbe||{};var uJ=es.oids,Kgs={name:"EncryptedPrivateKeyInfo",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Jgs={name:"PBES2Algorithms",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Zgs={name:"pkcs-12PbeParams",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,capture:"iterations"}]};es.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=gn.random.getBytesSync(r.saltSize),o=r.count,s=Dt.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=uJ["aes128-CBC"],h=gn.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=uJ["aes192-CBC"],h=gn.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=uJ["aes256-CBC"],h=gn.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=uJ.desCBC,h=gn.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=u5n(g),y=gn.pkcs5.pbkdf2(e,n,o,c,A),E=gn.random.getBytesSync(d),_=h(y);_.start(E),_.update(Dt.toDer(t)),_.finish(),u=_.output.getBytes();var v=Xgs(n,s,c,g);l=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(uJ.pkcs5PBES2).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(uJ.pkcs5PBKDF2).getBytes()),v]),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(f).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new gn.util.ByteBuffer(n),y=es.pbe.generatePkcs12Key(e,b,1,o,c),E=es.pbe.generatePkcs12Key(e,b,2,o,c),_=gn.des.createEncryptionCipher(y);_.start(E),_.update(Dt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(uJ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,n),Dt.create(Dt.Class.UNIVERSAL,Dt.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=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[l,Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,u)]);return T};es.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Dt.validate(t,Kgs,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=Dt.derToOid(n.encryptionOid),l=es.pbe.getCipher(c,n.encryptionParams,e),u=gn.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Dt.fromDer(l.output)),r};es.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Dt.toDer(t).getBytes()};return gn.pem.encode(r,{maxline:e})};es.encryptedPrivateKeyFromPem=function(t){var e=gn.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 Dt.fromDer(e.body)};es.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=es.wrapRsaPrivateKey(es.privateKeyToAsn1(t));return n=es.encryptPrivateKeyInfo(n,e,r),es.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=gn.random.getBytesSync(16),l=gn.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=gn.random.getBytesSync(16),l=gn.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=gn.random.getBytesSync(16),l=gn.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=gn.random.getBytesSync(8),l=gn.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=gn.random.getBytesSync(8),l=gn.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=gn.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Dt.toDer(es.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:gn.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return gn.pem.encode(h)};es.decryptRsaPrivateKey=function(t,e){var r=null,n=gn.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=gn.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=gn.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=gn.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=gn.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=gn.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return gn.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return gn.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return gn.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=gn.util.hexToBytes(n.dekInfo.parameters),u=gn.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(gn.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=es.decryptPrivateKeyInfo(Dt.fromDer(r),e):r=Dt.fromDer(r),r!==null&&(r=es.privateKeyFromAsn1(r)),r};es.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in gn.md))throw new Error('"sha1" hash algorithm unavailable.');s=gn.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new gn.util.ByteBuffer,h=new gn.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};es.pbe.getCipher=function(t,e,r){switch(t){case es.oids.pkcs5PBES2:return es.pbe.getCipherForPBES2(t,e,r);case es.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case es.oids["pbewithSHAAnd40BitRC2-CBC"]:return es.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}};es.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Dt.validate(e,Jgs,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=Dt.derToOid(n.kdfOid),t!==es.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=Dt.derToOid(n.encOid),t!==es.oids["aes128-CBC"]&&t!==es.oids["aes192-CBC"]&&t!==es.oids["aes256-CBC"]&&t!==es.oids["des-EDE3-CBC"]&&t!==es.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=gn.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(es.oids[t]){case"aes128-CBC":u=16,d=gn.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=gn.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=gn.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=gn.des.createDecryptionCipher;break;case"desCBC":u=8,d=gn.des.createDecryptionCipher;break}var f=l5n(n.prfOid),h=gn.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};es.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Dt.validate(e,Zgs,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=gn.util.createBuffer(n.salt),l=gn.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case es.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=gn.des.startDecrypting;break;case es.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=gn.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=l5n(n.prfOid),m=es.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=es.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};es.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in gn.md))throw new Error('"md5" hash algorithm unavailable.');n=gn.md.md5.create()}e===null&&(e="");for(var o=[c5n(n,t+e)],s=16,c=1;s{p();var Ede=ls();Qk();rc();var un=Ede.asn1,_de=h5n.exports=Ede.pkcs7asn1=Ede.pkcs7asn1||{};Ede.pkcs7=Ede.pkcs7||{};Ede.pkcs7.asn1=_de;var f5n={name:"ContentInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};_de.contentInfoValidator=f5n;var p5n={name:"EncryptedContentInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};_de.envelopedDataValidator={name:"EnvelopedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(p5n)};_de.encryptedDataValidator={name:"EncryptedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"}].concat(p5n)};var eAs={name:"SignerInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:un.Class.UNIVERSAL,type:un.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:un.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};_de.signedDataValidator={name:"SignedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},f5n,{name:"SignedData.Certificates",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:un.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,capture:"signerInfos",optional:!0,value:[eAs]}]};_de.recipientInfoValidator={name:"RecipientInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:un.Class.UNIVERSAL,type:un.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var gXt=I((R$d,m5n)=>{p();var dJ=ls();rc();dJ.mgf=dJ.mgf||{};var tAs=m5n.exports=dJ.mgf.mgf1=dJ.mgf1=dJ.mgf1||{};tAs.create=function(t){var e={generate:a(function(r,n){for(var o=new dJ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var Grt=ls();gXt();g5n.exports=Grt.mgf=Grt.mgf||{};Grt.mgf.mgf1=Grt.mgf1});var $rt=I((M$d,y5n)=>{p();var fJ=ls();Xx();rc();var rAs=y5n.exports=fJ.pss=fJ.pss||{};rAs.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=fJ.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||fJ.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 _i=ls();Dq();Qk();iRe();RO();A5n();Nq();aJ();$rt();aRe();rc();var me=_i.asn1,kr=b5n.exports=_i.pki=_i.pki||{},Ga=kr.oids,rp={};rp.CN=Ga.commonName;rp.commonName="CN";rp.C=Ga.countryName;rp.countryName="C";rp.L=Ga.localityName;rp.localityName="L";rp.ST=Ga.stateOrProvinceName;rp.stateOrProvinceName="ST";rp.O=Ga.organizationName;rp.organizationName="O";rp.OU=Ga.organizationalUnitName;rp.organizationalUnitName="OU";rp.E=Ga.emailAddress;rp.emailAddress="E";var _5n=_i.pki.rsa.publicKeyValidator,nAs={name:"Certificate",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:me.Class.UNIVERSAL,type:me.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:me.Class.UNIVERSAL,type:me.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:me.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:me.Class.UNIVERSAL,type:me.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:me.Class.UNIVERSAL,type:me.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:me.Class.UNIVERSAL,type:me.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:me.Class.UNIVERSAL,type:me.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},_5n,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:me.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:me.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:me.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:me.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},iAs={name:"rsapss",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:me.Class.UNIVERSAL,type:me.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:me.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:me.Class.UNIVERSAL,type:me.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:me.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:me.Class.UNIVERSAL,type:me.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:me.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:me.Class.UNIVERSAL,type:me.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},oAs={name:"CertificationRequestInfo",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:me.Class.UNIVERSAL,type:me.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},_5n,{name:"CertificationRequestInfo.attributes",tagClass:me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:me.Class.UNIVERSAL,type:me.Type.SET,constructed:!0}]}]}]},sAs={name:"CertificationRequest",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[oAs,{name:"CertificationRequest.signatureAlgorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:me.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};kr.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=Wrt({signatureOid:c.signatureOid,type:"certificate"});var d=me.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=_i.md.sha1.create(),h=me.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return Bq(c.issuer,A)},c.issuer.addField=function(A){rw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=kr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=_i.md.sha1.create(),g=me.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return Bq(c.subject,A)},c.subject.addField=function(A){rw([A]),c.subject.attributes.push(A)},c.subject.attributes=kr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=kr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=kr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};kr.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=me.fromDer(e.value);r.value.length>0&&r.value[0].type===me.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===me.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=me.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=me.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=me.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in kr.oids?e.name=kr.oids[e.type]:e.shortName&&e.shortName in rp&&(e.name=kr.oids[rp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in kr.oids)e.type=kr.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 rp&&(e.shortName=rp[e.name]),e.type===Ga.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=me.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(rw,"_fillMissingFields");function C5n(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in kr.oids&&(t.name=kr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in kr.oids)t.id=kr.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=me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(me.create(me.Class.UNIVERSAL,me.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,me.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in Ga?l.push(me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(Ga[u]).getBytes())):u.indexOf(".")!==-1&&l.push(me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.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=me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=me.create(me.Class.UNIVERSAL,me.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=me.create(me.Class.UNIVERSAL,me.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(me.create(me.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[me.create(me.Class.CONTEXT_SPECIFIC,4,!0,[vde(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(me.create(me.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=_i.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(me.create(me.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]),E=me.create(me.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(C5n,"_fillMissingExtensionFields");function AXt(t,e){if(t===Ga["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(me.create(me.Class.CONTEXT_SPECIFIC,0,!0,[me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(e.hash.algorithmOid).getBytes()),me.create(me.Class.UNIVERSAL,me.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(me.create(me.Class.CONTEXT_SPECIFIC,1,!0,[me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(e.mgf.algorithmOid).getBytes()),me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(e.mgf.hash.algorithmOid).getBytes()),me.create(me.Class.UNIVERSAL,me.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(me.create(me.Class.CONTEXT_SPECIFIC,2,!0,[me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,me.integerToDer(e.saltLength).getBytes())])),me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,r)}else return me.create(me.Class.UNIVERSAL,me.Type.NULL,!1,"")}a(AXt,"_signatureParametersToAsn1");function aAs(t){var e=me.create(me.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=cAs&&t0&&n.value.push(kr.certificateExtensionsToAsn1(t.extensions)),n};kr.getCertificationRequestInfo=function(t){var e=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,me.integerToDer(t.version).getBytes()),vde(t.subject),kr.publicKeyToAsn1(t.publicKey),aAs(t)]);return e};kr.distinguishedNameToAsn1=function(t){return vde(t)};kr.certificateToAsn1=function(t){var e=t.tbsCertificate||kr.getTBSCertificate(t);return me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[e,me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(t.signatureOid).getBytes()),AXt(t.signatureOid,t.signatureParameters)]),me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,"\0"+t.signature)])};kr.certificateExtensionsToAsn1=function(t){var e=me.create(me.Class.CONTEXT_SPECIFIC,3,!0,[]),r=me.create(me.Class.UNIVERSAL,me.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:kr.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;_i.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:kr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:kr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:kr.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:kr.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:kr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!_i.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 EXt=I((U$d,T5n)=>{p();var Eu=ls();Qk();hde();Nq();mXt();hXt();Xx();aRe();yde();rc();zrt();var Ye=Eu.asn1,Vs=Eu.pki,lRe=T5n.exports=Eu.pkcs12=Eu.pkcs12||{},S5n={name:"ContentInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},uAs={name:"PFX",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,capture:"version"},S5n,{name:"PFX.macData",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ye.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},dAs={name:"SafeBag",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},fAs={name:"Attribute",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SET,constructed:!0,capture:"values"}]},pAs={name:"CertBag",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ye.Class.UNIVERSAL,type:Ye.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function cRe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(cRe,"_getBagsByAttribute");lRe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ye.validate(t,uAs,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=Eu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=cRe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=cRe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=cRe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return cRe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return cRe(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(Ye.derToOid(n.contentType)!==Vs.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ye.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ye.Class.UNIVERSAL||l.type!==Ye.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=yXt(l),n.mac){var u=null,d=0,f=Ye.derToOid(n.macAlgorithm);switch(f){case Vs.oids.sha1:u=Eu.md.sha1.create(),d=20;break;case Vs.oids.sha256:u=Eu.md.sha256.create(),d=32;break;case Vs.oids.sha384:u=Eu.md.sha384.create(),d=48;break;case Vs.oids.sha512:u=Eu.md.sha512.create(),d=64;break;case Vs.oids.md5:u=Eu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new Eu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(Eu.util.bytesToHex(n.macIterations),16):1,g=lRe.generateKey(r,h,3,m,d,u),A=Eu.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 hAs(c,l.value,e,r),c};function yXt(t){if(t.composed||t.constructed){for(var e=Eu.util.createBuffer(),r=0;r0&&(s=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SET,!0,u));var d=[],f=[];e!==null&&(Eu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,h),_=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Vs.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=Vs.wrapRsaPrivateKey(Vs.privateKeyToAsn1(t));r===null?v=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Vs.oids.keyBag).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Vs.oids.pkcs8ShroudedKeyBag).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Vs.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[v]),w=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Vs.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(T).getBytes())])]);d.push(w)}var R=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=Eu.md.sha1.create(),P=new Eu.util.ByteBuffer(Eu.random.getBytes(n.saltSize)),D=n.count,t=lRe.generateKey(r,P,3,D,20),N=Eu.hmac.create();N.start(l,t),N.update(Ye.toDer(R).getBytes());var L=N.getMac();x=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Vs.oids.sha1).getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.NULL,!1,"")]),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,L.getBytes())]),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,P.getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.INTEGER,!1,Ye.integerToDer(D).getBytes())])}return Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.INTEGER,!1,Ye.integerToDer(3).getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Vs.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(R).getBytes())])]),x])};lRe.generateKey=Eu.pbe.generatePkcs12Key});var vXt=I((j$d,I5n)=>{p();var Lq=ls();Qk();Nq();hXt();aJ();Frt();EXt();$rt();aRe();rc();zrt();var _Xt=Lq.asn1,Cde=I5n.exports=Lq.pki=Lq.pki||{};Cde.pemToDer=function(t){var e=Lq.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Lq.util.createBuffer(e.body)};Cde.privateKeyFromPem=function(t){var e=Lq.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=_Xt.fromDer(e.body);return Cde.privateKeyFromAsn1(n)};Cde.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:_Xt.toDer(Cde.privateKeyToAsn1(t)).getBytes()};return Lq.pem.encode(r,{maxline:e})};Cde.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:_Xt.toDer(t).getBytes()};return Lq.pem.encode(r,{maxline:e})}});var xXt=I((G$d,M5n)=>{p();var Kt=ls();Qk();hde();Mrt();aJ();vXt();Xx();yde();rc();var Zrt=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&&(ye.queue(t,ye.createAlert(t,{level:ye.Alert.Level.warning,description:ye.Alert.Description.no_renegotiation})),ye.flush(t)),t.process()};ye.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===ye.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:ye.Alert.Level.fatal,description:ye.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:WS(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=WS(s,2),n.compression_methods=WS(s,1)),c=r-(c-s.length()),c>0){for(var l=WS(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:WS(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(WS(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:ye.Alert.Level.fatal,description:ye.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=ye.getCipherSuite(n.cipher_suite);else for(var m=Kt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=ye.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:ye.Alert.Level.fatal,description:ye.Alert.Description.handshake_failure},cipherSuite:Kt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=ye.CompressionMethod.none}return n};ye.createSecurityParameters=function(t,e){var r=t.entity===ye.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:ye.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:ye.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}};ye.handleServerHello=function(t,e,r){var n=ye.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:ye.Alert.Level.fatal,description:ye.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=R5n,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=CAs,t.session.resuming=!1,ye.createSecurityParameters(t,n)),t.session.id=o,t.process()}};ye.handleClientHello=function(t,e,r){var n=ye.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;l0;)s=WS(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:ye.Alert.Level.fatal,description:ye.Alert.Description.bad_certificate}})}var u=t.entity===ye.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:ye.Alert.Level.fatal,description:ye.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?x5n:SXt:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],ye.verifyCertificateChain(t,l)&&(t.expect=u?x5n:SXt)),t.process()};ye.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.unsupported_certificate}});t.expect=bAs,t.process()};ye.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:WS(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:ye.Alert.Level.fatal,description:ye.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.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=TXt,t.session.clientCertificate!==null&&(t.expect=PAs),t.process()};ye.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:WS(n,1),certificate_authorities:WS(n,2)};t.session.certificateRequest=o,t.expect=SAs,t.process()};ye.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:WS(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:ye.Alert.Level.fatal,description:ye.Alert.Description.handshake_failure}})}t.expect=TXt,t.process()};ye.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.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=ye.createRecord(t,{type:ye.ContentType.handshake,data:ye.createCertificate(t)}),ye.queue(t,e)),e=ye.createRecord(t,{type:ye.ContentType.handshake,data:ye.createClientKeyExchange(t)}),ye.queue(t,e),t.expect=xAs;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&ye.queue(l,ye.createRecord(l,{type:ye.ContentType.handshake,data:ye.createCertificateVerify(l,u)})),ye.queue(l,ye.createRecord(l,{type:ye.ContentType.change_cipher_spec,data:ye.createChangeCipherSpec()})),l.state.pending=ye.createConnectionState(l),l.state.current.write=l.state.pending.write,ye.queue(l,ye.createRecord(l,{type:ye.ContentType.handshake,data:ye.createFinished(l)})),l.expect=R5n,ye.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);ye.getClientSignature(t,c)};ye.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.illegal_parameter}});var r=t.entity===ye.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=ye.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?TAs:kAs,t.process()};ye.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===ye.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=Zrt;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:ye.Alert.Level.fatal,description:ye.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(ye.queue(t,ye.createRecord(t,{type:ye.ContentType.change_cipher_spec,data:ye.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,ye.queue(t,ye.createRecord(t,{type:ye.ContentType.handshake,data:ye.createFinished(t)}))),t.expect=c?IAs:DAs,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,ye.flush(t),t.isConnected=!0,t.connected(t),t.process()};ye.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case ye.Alert.Description.close_notify:o="Connection closed.";break;case ye.Alert.Description.unexpected_message:o="Unexpected message.";break;case ye.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case ye.Alert.Description.decryption_failed:o="Decryption failed.";break;case ye.Alert.Description.record_overflow:o="Record overflow.";break;case ye.Alert.Description.decompression_failure:o="Decompression failed.";break;case ye.Alert.Description.handshake_failure:o="Handshake failure.";break;case ye.Alert.Description.bad_certificate:o="Bad certificate.";break;case ye.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case ye.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case ye.Alert.Description.certificate_expired:o="Certificate expired.";break;case ye.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case ye.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case ye.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case ye.Alert.Description.access_denied:o="Access denied.";break;case ye.Alert.Description.decode_error:o="Decode error.";break;case ye.Alert.Description.decrypt_error:o="Decrypt error.";break;case ye.Alert.Description.export_restriction:o="Export restriction.";break;case ye.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case ye.Alert.Description.insufficient_security:o="Insufficient security.";break;case ye.Alert.Description.internal_error:o="Internal error.";break;case ye.Alert.Description.user_canceled:o="User canceled.";break;case ye.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===ye.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===ye.ConnectionEnd.client?"server":"client",alert:n}),t.process()};ye.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 Jrt[t.entity][t.expect]?(t.entity===ye.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!==ye.HandshakeType.hello_request&&n!==ye.HandshakeType.certificate_verify&&n!==ye.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),Jrt[t.entity][t.expect][n](t,e,o)):ye.handleUnexpected(t,e)};ye.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};ye.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===ye.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();ye.queue(t,ye.createRecord(t,{type:ye.ContentType.heartbeat,data:ye.createHeartbeat(ye.HeartbeatMessageType.heartbeat_response,s)})),ye.flush(t)}else if(n===ye.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Kt.util.createBuffer(s))}t.process()};var vAs=0,CAs=1,x5n=2,bAs=3,SAs=4,R5n=5,TAs=6,IAs=7,xAs=8,wAs=0,RAs=1,SXt=2,PAs=3,TXt=4,kAs=5,DAs=6,Ae=ye.handleUnexpected,P5n=ye.handleChangeCipherSpec,IA=ye.handleAlert,j_=ye.handleHandshake,k5n=ye.handleApplicationData,xA=ye.handleHeartbeat,IXt=[];IXt[ye.ConnectionEnd.client]=[[Ae,IA,j_,Ae,xA],[Ae,IA,j_,Ae,xA],[Ae,IA,j_,Ae,xA],[Ae,IA,j_,Ae,xA],[Ae,IA,j_,Ae,xA],[P5n,IA,Ae,Ae,xA],[Ae,IA,j_,Ae,xA],[Ae,IA,j_,k5n,xA],[Ae,IA,j_,Ae,xA]];IXt[ye.ConnectionEnd.server]=[[Ae,IA,j_,Ae,xA],[Ae,IA,j_,Ae,xA],[Ae,IA,j_,Ae,xA],[Ae,IA,j_,Ae,xA],[P5n,IA,Ae,Ae,xA],[Ae,IA,j_,Ae,xA],[Ae,IA,j_,k5n,xA],[Ae,IA,j_,Ae,xA]];var Fq=ye.handleHelloRequest,NAs=ye.handleServerHello,D5n=ye.handleCertificate,w5n=ye.handleServerKeyExchange,CXt=ye.handleCertificateRequest,Yrt=ye.handleServerHelloDone,N5n=ye.handleFinished,Jrt=[];Jrt[ye.ConnectionEnd.client]=[[Ae,Ae,NAs,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,D5n,w5n,CXt,Yrt,Ae,Ae,Ae,Ae,Ae,Ae],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,w5n,CXt,Yrt,Ae,Ae,Ae,Ae,Ae,Ae],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,CXt,Yrt,Ae,Ae,Ae,Ae,Ae,Ae],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Yrt,Ae,Ae,Ae,Ae,Ae,Ae],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,N5n],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae],[Fq,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae]];var MAs=ye.handleClientHello,OAs=ye.handleClientKeyExchange,BAs=ye.handleCertificateVerify;Jrt[ye.ConnectionEnd.server]=[[Ae,MAs,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae],[Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,D5n,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae],[Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,OAs,Ae,Ae,Ae,Ae],[Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,BAs,Ae,Ae,Ae,Ae,Ae],[Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae],[Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,N5n],[Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae],[Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae,Ae]];ye.generateKeys=function(t,e){var r=Zrt,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===ye.Versions.TLS_1_0.major&&t.version.minor===ye.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};ye.createConnectionState=function(t){var e=t.entity===ye.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:ye.Alert.Level.fatal,description:ye.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.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:ye.Alert.Level.fatal,description:ye.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=ye.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 ye.CompressionMethod.none:break;case ye.CompressionMethod.deflate:n.read.compressFunction=_As,n.write.compressFunction=EAs;break;default:throw new Error("Unsupported compression algorithm.")}}return n};ye.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};ye.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};ye.createAlert=function(t,e){var r=Kt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),ye.createRecord(t,{type:ye.ContentType.alert,data:r})};ye.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(ye.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),nw(A,1,Kt.util.createBuffer(m)),nw(A,2,e),nw(A,1,s),h>0&&nw(A,2,l),A};ye.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Kt.util.createBuffer();return n.putByte(ye.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),nw(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};ye.createCertificate=function(t){var e=t.entity===ye.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(ye.HandshakeType.server_key_exchange),r.putInt24(e)),r};ye.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:ye.Alert.Level.fatal,description:ye.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:ye.Alert.Level.fatal,description:ye.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};ye.createCertificateVerify=function(t,e){var r=e.length+2,n=Kt.util.createBuffer();return n.putByte(ye.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};ye.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(ye.HandshakeType.certificate_request),u.putInt24(l),nw(u,1,e),nw(u,2,r),u};ye.createServerHelloDone=function(t){var e=Kt.util.createBuffer();return e.putByte(ye.HandshakeType.server_hello_done),e.putInt24(0),e};ye.createChangeCipherSpec=function(){var t=Kt.util.createBuffer();return t.putByte(1),t};ye.createFinished=function(t){var e=Kt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===ye.ConnectionEnd.client,n=t.session.sp,o=12,s=Zrt,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Kt.util.createBuffer();return l.putByte(ye.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};ye.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};ye.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===ye.ContentType.handshake||e.type===ye.ContentType.alert||e.type===ye.ContentType.change_cipher_spec))){if(e.type===ye.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()<=ye.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>ye.MaxFragment;)n.push(ye.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o.slice(0,ye.MaxFragment))})),o=o.slice(ye.MaxFragment);o.length>0&&n.push(ye.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};ye.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 ye.CipherSuites)r.push(ye.CipherSuites[n])}var o=t.server?ye.ConnectionEnd.server:ye.ConnectionEnd.client,s=t.sessionCache?ye.createSessionCache(t.sessionCache):null,c={version:{major:ye.Version.major,minor:ye.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===ye.ConnectionEnd.client?"client":"server"),h.send&&(ye.queue(f,ye.createAlert(f,h.alert)),ye.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:ye.Version.major,minor:ye.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===ye.ConnectionEnd.client?vAs:wAs,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=ye.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-ye.ContentType.change_cipher_spec,g=IXt[f.entity][f.expect];m in g?g[m](f,h):ye.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:ye.Alert.Level.fatal,description:ye.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=ye.createRandom().getBytes(),c.open=!0,ye.queue(c,ye.createRecord(c,{type:ye.ContentType.handshake,data:ye.createClientHello(c)})),ye.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 ye.queue(c,ye.createRecord(c,{type:ye.ContentType.application_data,data:Kt.util.createBuffer(f)})),ye.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,ye.queue(c,ye.createRecord(c,{type:ye.ContentType.heartbeat,data:ye.createHeartbeat(ye.HeartbeatMessageType.heartbeat_request,f,h)})),ye.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,ye.queue(c,ye.createAlert(c,{level:ye.Alert.Level.warning,description:ye.Alert.Description.close_notify})),ye.flush(c)),c.closed(c)),c.reset(f)},c};M5n.exports=Kt.tls=Kt.tls||{};for(Krt in ye)typeof ye[Krt]!="function"&&(Kt.tls[Krt]=ye[Krt]);var Krt;Kt.tls.prf_tls1=Zrt;Kt.tls.hmac_sha1=yAs;Kt.tls.createSessionCache=ye.createSessionCache;Kt.tls.createConnection=ye.createConnection});var L5n=I((W$d,B5n)=>{p();var Uq=ls();Dq();xXt();var iw=B5n.exports=Uq.tls;iw.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=iw.BulkCipherAlgorithm.aes,t.cipher_type=iw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=iw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:O5n};iw.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=iw.BulkCipherAlgorithm.aes,t.cipher_type=iw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=iw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:O5n};function O5n(t,e,r){var n=e.entity===Uq.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Uq.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:Uq.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=qAs,t.write.cipherFunction=FAs,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=iw.hmac_sha1}a(O5n,"initConnectionState");function FAs(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===iw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=Uq.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=iw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(UAs)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(FAs,"encrypt_aes_cbc_sha1");function UAs(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(UAs,"encrypt_aes_cbc_sha1_padding");function QAs(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=Uq.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=jAs(e.macKey,c,u)&&r,r}a(qAs,"decrypt_aes_cbc_sha1");function jAs(t,e,r){var n=Uq.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(jAs,"compareMacs")});var PXt=I((K$d,q5n)=>{p();var td=ls();RO();rc();var uRe=q5n.exports=td.sha512=td.sha512||{};td.md.sha512=td.md.algorithms.sha512=uRe;var U5n=td.sha384=td.sha512.sha384=td.sha512.sha384||{};U5n.create=function(){return uRe.create("SHA-384")};td.md.sha384=td.md.algorithms.sha384=U5n;td.sha512.sha256=td.sha512.sha256||{create:a(function(){return uRe.create("SHA-512/256")},"create")};td.md["sha512/256"]=td.md.algorithms["sha512/256"]=td.sha512.sha256;td.sha512.sha224=td.sha512.sha224||{create:a(function(){return uRe.create("SHA-512/224")},"create")};td.md["sha512/224"]=td.md.algorithms["sha512/224"]=td.sha512.sha224;uRe.create=function(t){if(Q5n||HAs(),typeof t>"u"&&(t="SHA-512"),!(t in pJ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=pJ[t],r=null,n=td.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),F5n(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=td.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(wXt.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],q=U[0],Q=U[1],n=((q>>>19|Q<<13)^(Q>>>29|q<<3)^q>>>6)>>>0,o=((q<<13|Q>>>19)^(Q<<3|q>>>29)^(q<<26|Q>>>6))>>>0,W=e[O-15],q=W[0],Q=W[1],s=((q>>>1|Q<<31)^(q>>>8|Q<<24)^q>>>7)>>>0,c=((q<<31|Q>>>1)^(q<<24|Q>>>8)^(q<<25|Q>>>7))>>>0,z=e[O-7],$=e[O-16],Q=o+z[1]+c+$[1],e[O][0]=n+z[0]+s+$[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+RXt[O][1]+e[O][1],n=j+d+h+RXt[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,J-=128}}a(F5n,"_update")});var j5n=I(kXt=>{p();var GAs=ls();Qk();var Ag=GAs.asn1;kXt.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};kXt.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var t4n=I((tVd,e4n)=>{p();var wA=ls();sRe();Xx();PXt();rc();var z5n=j5n(),$As=z5n.publicKeyValidator,VAs=z5n.privateKeyValidator;typeof H5n>"u"&&(H5n=wA.jsbn.BigInteger);var H5n,NXt=wA.util.ByteBuffer,$C=typeof Buffer>"u"?Uint8Array:Buffer;wA.pki=wA.pki||{};e4n.exports=wA.pki.ed25519=wA.ed25519=wA.ed25519||{};var Ws=wA.ed25519;Ws.constants={};Ws.constants.PUBLIC_KEY_BYTE_LENGTH=32;Ws.constants.PRIVATE_KEY_BYTE_LENGTH=64;Ws.constants.SEED_BYTE_LENGTH=32;Ws.constants.SIGN_BYTE_LENGTH=64;Ws.constants.HASH_BYTE_LENGTH=64;Ws.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=wA.random.getBytesSync(Ws.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Ws.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Ws.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=Y3({message:e,encoding:"binary"});for(var r=new $C(Ws.constants.PUBLIC_KEY_BYTE_LENGTH),n=new $C(Ws.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return KAs(r,n),{publicKey:r,privateKey:n}};Ws.privateKeyFromAsn1=function(t){var e={},r=[],n=wA.asn1.validate(t,VAs,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=Y3({message:wA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};Ws.publicKeyFromAsn1=function(t){var e={},r=[],n=wA.asn1.validate(t,$As,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!==Ws.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Y3({message:l,encoding:"binary"})};Ws.publicKeyFromPrivateKey=function(t){t=t||{};var e=Y3({message:t.privateKey,encoding:"binary"});if(e.length!==Ws.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ws.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new $C(Ws.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function Y3(t){var e=t.message;if(e instanceof Uint8Array||e instanceof $C)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 NXt(e,r)}else if(!(e instanceof NXt))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 $C(e.length()),o=0;o=0;--r){if(t[e+r]dRe[r])return!1}return!1}a(XAs,"_isCanonicalSignatureScalar");function Y5n(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)*dRe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*dRe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(Y5n,"modL");function OXt(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;Y5n(t,e)}a(OXt,"reduce");function BXt(t,e){var r=Gi(),n=Gi(),o=Gi(),s=Gi(),c=Gi(),l=Gi(),u=Gi(),d=Gi(),f=Gi();Sde(r,t[1],t[0]),Sde(f,e[1],e[0]),Ul(r,r,f),bde(n,t[0],t[1]),bde(f,e[0],e[1]),Ul(n,n,f),Ul(o,t[3],e[3]),Ul(o,o,zAs),Ul(s,t[2],e[2]),bde(s,s,s),Sde(c,n,r),Sde(l,s,o),bde(u,s,o),bde(d,n,r),Ul(t[0],c,l),Ul(t[1],d,u),Ul(t[2],u,l),Ul(t[3],c,d)}a(BXt,"add");function V5n(t,e,r){for(var n=0;n<4;++n)X5n(t[n],e[n],r)}a(V5n,"cswap");function LXt(t,e){var r=Gi(),n=Gi(),o=Gi();iys(o,e[2]),Ul(r,e[0],o),Ul(n,e[1],o),ent(t,n),t[31]^=J5n(r)<<7}a(LXt,"pack");function ent(t,e){var r,n,o,s=Gi(),c=Gi();for(r=0;r<16;++r)c[r]=e[r];for(DXt(c),DXt(c),DXt(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,X5n(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(ent,"pack25519");function eys(t,e){var r=Gi(),n=Gi(),o=Gi(),s=Gi(),c=Gi(),l=Gi(),u=Gi();return Qq(t[2],Xrt),tys(t[1],e),hJ(o,t[1]),Ul(s,o,WAs),Sde(o,o,t[2]),bde(s,t[2],s),hJ(c,s),hJ(l,c),Ul(u,l,c),Ul(r,u,o),Ul(r,r,s),rys(r,r),Ul(r,r,o),Ul(r,r,s),Ul(r,r,s),Ul(t[0],r,s),hJ(n,t[0]),Ul(n,n,s),W5n(n,o)&&Ul(t[0],t[0],YAs),hJ(n,t[0]),Ul(n,n,s),W5n(n,o)?-1:(J5n(t[0])===e[31]>>7&&Sde(t[0],MXt,t[0]),Ul(t[3],t[0],t[1]),0)}a(eys,"unpackneg");function tys(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(tys,"unpack25519");function rys(t,e){var r=Gi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)hJ(r,r),n!==1&&Ul(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(rys,"pow2523");function W5n(t,e){var r=new $C(32),n=new $C(32);return ent(r,t),ent(n,e),K5n(r,0,n,0)}a(W5n,"neq25519");function K5n(t,e,r,n){return nys(t,e,r,n,32)}a(K5n,"crypto_verify_32");function nys(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(nys,"vn");function J5n(t){var e=new $C(32);return ent(e,t),e[0]&1}a(J5n,"par25519");function Z5n(t,e,r){var n,o;for(Qq(t[0],MXt),Qq(t[1],Xrt),Qq(t[2],Xrt),Qq(t[3],MXt),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,V5n(t,e,n),BXt(e,t),BXt(t,t),V5n(t,e,n)}a(Z5n,"scalarmult");function FXt(t,e){var r=[Gi(),Gi(),Gi(),Gi()];Qq(r[0],G5n),Qq(r[1],$5n),Qq(r[2],Xrt),Ul(r[3],G5n,$5n),Z5n(t,r,e)}a(FXt,"scalarbase");function Qq(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Qq,"set25519");function iys(t,e){var r=Gi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)hJ(r,r),n!==2&&n!==4&&Ul(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(iys,"inv25519");function DXt(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(DXt,"car25519");function X5n(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(X5n,"sel25519");function Gi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var zS=ls();rc();Xx();sRe();i4n.exports=zS.kem=zS.kem||{};var r4n=zS.jsbn.BigInteger;zS.kem.rsa={};zS.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||zS.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new r4n(zS.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(r4n.ONE)<=0);l=zS.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=zS.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};zS.kem.kdf1=function(t,e){n4n(this,t,0,e||t.digestLength)};zS.kem.kdf2=function(t,e){n4n(this,t,1,e||t.digestLength)};function n4n(t,e,r,n){t.generate=function(o,s){for(var c=new zS.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new zS.util.ByteBuffer,d=r;d{p();var la=ls();rc();c4n.exports=la.log=la.log||{};la.log.levels=["none","error","warning","info","debug","verbose","max"];var tnt={},qXt=[],hRe=null;la.log.LEVEL_LOCKED=2;la.log.NO_LEVEL_CHECK=4;la.log.INTERPOLATE=8;for(LO=0;LO"u"||e?t.flags|=la.log.LEVEL_LOCKED:t.flags&=~la.log.LEVEL_LOCKED};la.log.addLogger=function(t){qXt.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(s4n={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},mRe=a(function(t,e){la.log.prepareStandard(e);var r=s4n[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Tde=la.log.makeLogger(mRe)):(mRe=a(function(e,r){la.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Tde=la.log.makeLogger(mRe)),la.log.setLevel(Tde,"debug"),la.log.addLogger(Tde),hRe=Tde):console={log:a(function(){},"log")};var Tde,s4n,mRe;hRe!==null&&typeof window<"u"&&window.location&&(pRe=new URL(window.location.href).searchParams,pRe.has("console.level")&&la.log.setLevel(hRe,pRe.get("console.level").slice(-1)[0]),pRe.has("console.lock")&&(a4n=pRe.get("console.lock").slice(-1)[0],a4n=="true"&&la.log.lock(hRe)));var pRe,a4n;la.log.consoleLogger=hRe});var d4n=I((uVd,u4n)=>{p();u4n.exports=RO();Mrt();yde();tXt();PXt()});var h4n=I((fVd,p4n)=>{p();var Zr=ls();Dq();Qk();iRe();Nq();aJ();mXt();Xx();rc();zrt();var Ze=Zr.asn1,H_=p4n.exports=Zr.pkcs7=Zr.pkcs7||{};H_.messageFromPem=function(t){var e=Zr.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=Ze.fromDer(e.body);return H_.messageFromAsn1(n)};H_.messageToPem=function(t,e){var r={type:"PKCS7",body:Ze.toDer(t.toAsn1()).getBytes()};return Zr.pem.encode(r,{maxline:e})};H_.messageFromAsn1=function(t){var e={},r=[];if(!Ze.validate(t,H_.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=Ze.derToOid(e.contentType),s;switch(o){case Zr.pki.oids.envelopedData:s=H_.createEnvelopedData();break;case Zr.pki.oids.encryptedData:s=H_.createEncryptedData();break;case Zr.pki.oids.signedData:s=H_.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};H_.createSignedData=function(){var t=null;return t={type:Zr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(HXt(t,n,H_.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(Ze.create(Ze.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Ze.create(Ze.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Ze.create(Ze.Class.UNIVERSAL,Ze.Type.SET,!0,t.signerInfos)),Ze.create(Ze.Class.UNIVERSAL,Ze.Type.SEQUENCE,!0,[Ze.create(Ze.Class.UNIVERSAL,Ze.Type.OID,!1,Ze.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=Zr.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=Zr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Zr.pki.oids.sha1;switch(u){case Zr.pki.oids.sha1:case Zr.pki.oids.sha256:case Zr.pki.oids.sha384:case Zr.pki.oids.sha512:case Zr.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=Ze.create(Ze.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var Zh=ls();Dq();hde();Mrt();yde();rc();var nnt=m4n.exports=Zh.ssh=Zh.ssh||{};nnt.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=Zh.util.createBuffer();Kde(c,n),KO(c,t.e),KO(c,t.n);var l=Zh.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r -`,s+=l;var d=Zh.util.createBuffer();KO(d,t.d),KO(d,t.p),KO(d,t.q),KO(d,t.qInv);var f;if(!e)f=Zh.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=Vnt(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=Zh.util.createBuffer();g.putBuffer(Vnt("\0\0\0\0",e)),g.putBuffer(Vnt("\0\0\0",e));var A=Zh.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(Zh.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=Zh.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r +`;var c=Zh.util.createBuffer();Ide(c,n),FO(c,t.e),FO(c,t.n);var l=Zh.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r +`,s+=l;var d=Zh.util.createBuffer();FO(d,t.d),FO(d,t.p),FO(d,t.q),FO(d,t.qInv);var f;if(!e)f=Zh.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=rnt(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=Zh.util.createBuffer();g.putBuffer(rnt("\0\0\0\0",e)),g.putBuffer(rnt("\0\0\0",e));var A=Zh.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(Zh.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=Zh.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r Private-Lines: `+u+`\r -`,s+=f;var E=Vnt("putty-private-key-file-mac-key",e),_=Zh.util.createBuffer();Kde(_,n),Kde(_,o),Kde(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=Zh.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r +`,s+=f;var E=rnt("putty-private-key-file-mac-key",e),_=Zh.util.createBuffer();Ide(_,n),Ide(_,o),Ide(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=Zh.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r Private-MAC: `+v.digest().toHex()+`\r -`,s};Wnt.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=Zh.util.createBuffer();return Kde(n,r),KO(n,t.e),KO(n,t.n),r+" "+Zh.util.encode64(n.bytes())+" "+e};Wnt.privateKeyToOpenSSH=function(t,e){return e?Zh.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):Zh.pki.privateKeyToPem(t)};Wnt.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||Zh.md.md5.create(),n="ssh-rsa",o=Zh.util.createBuffer();Kde(o,n),KO(o,t.e),KO(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 KO(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=Zh.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(KO,"_addBigIntegerToBuffer");function Kde(t,e){t.putInt32(e.length),t.putString(e)}a(Kde,"_addStringToBuffer");function Vnt(){for(var t=Zh.md.sha1.create(),e=arguments.length,r=0;r{p();uLn.exports=ds();Kq();kBn();WP();Ant();MRe();zBn();Fde();ZBn();rLn();iLn();xer();wnt();xJ();Cer();ker();aLn();Der();ber();per();Ont();sw();ger();lLn();Fer();ic()});var hLn=I(OJ=>{"use strict";p();Object.defineProperty(OJ,"__esModule",{value:!0});OJ.convert=OJ.Format=void 0;var VRe=dLn(),oj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(oj=OJ.Format||(OJ.Format={}));function fLn(t){var e=VRe.pki.pemToDer(t),r=VRe.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(fLn,"myASN");function Ovs(t){var e=fLn(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(Ovs,"txtFormat");function pLn(t,e){switch(e){case oj.der:return VRe.pki.pemToDer(t);case oj.pem:return t;case oj.txt:return Ovs(t);case oj.asn1:return fLn(t);case oj.fingerprint:var r=VRe.md.sha1.create(),n=pLn(t,oj.der);return r.update(n.getBytes()),r.digest().toHex();case oj.x509:return VRe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(pLn,"convert");OJ.convert=pLn});var _Ln=I(Zv=>{"use strict";p();var sj=Zv&&Zv.__assign||function(){return sj=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})(ttr.Agent),(0,gLn.setGlobalDispatcher)(new gLn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");Zv.addToGlobalAgent=Lvs});var CLn=I((aXd,rtr)=>{p();function Fvs(){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(Fvs,"all");process.platform!=="win32"?rtr.exports.all=()=>[]:rtr.exports.all=Fvs});var nl=I((hXd,xLn)=>{"use strict";p();xLn.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 Atr=I((gXd,PLn)=>{"use strict";p();var Zde=0,dtr=1e3,ftr=(dtr>>1)-1,aj,ptr=Symbol("kFastTimer"),dF=[],htr=-2,mtr=-1,RLn=0,wLn=1;function gtr(){Zde+=ftr;let t=0,e=dF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=mtr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===mtr?(r._state=htr,--e!==0&&(dF[t]=dF[e])):++t}dF.length=e,dF.length!==0&&kLn()}a(gtr,"onTick");function kLn(){aj?.refresh?aj.refresh():(clearTimeout(aj),aj=setTimeout(gtr,ftr),aj?.unref())}a(kLn,"refreshTimeout");var Xnt=class{static{a(this,"FastTimer")}[ptr]=!0;_state=htr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===htr&&dF.push(this),(!aj||dF.length===1)&&kLn(),this._state=RLn}clear(){this._state=mtr,this._idleStart=-1}};PLn.exports={setTimeout(t,e,r){return e<=dtr?setTimeout(t,e,r):new Xnt(t,e,r)},clearTimeout(t){t[ptr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Xnt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Zde},tick(t=0){Zde+=t-dtr+1,gtr(),gtr()},reset(){Zde=0,dF.length=0,clearTimeout(aj),aj=null},kFastTimer:ptr}});var ao=I((EXd,r3n)=>{"use strict";p();var DLn=Symbol.for("undici.error.UND_ERR"),rd=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[DLn]===!0}get[DLn](){return!0}},NLn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),ytr=class extends rd{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[NLn]===!0}get[NLn](){return!0}},MLn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),Etr=class extends rd{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[MLn]===!0}get[MLn](){return!0}},OLn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),_tr=class extends rd{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[OLn]===!0}get[OLn](){return!0}},BLn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Ctr=class extends rd{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[BLn]===!0}get[BLn](){return!0}},LLn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),vtr=class extends rd{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[LLn]===!0}get[LLn](){return!0}},FLn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),btr=class extends rd{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[FLn]===!0}get[FLn](){return!0}},ULn=Symbol.for("undici.error.UND_ERR_ABORT"),eit=class extends rd{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[ULn]===!0}get[ULn](){return!0}},QLn=Symbol.for("undici.error.UND_ERR_ABORTED"),Str=class extends eit{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[QLn]===!0}get[QLn](){return!0}},qLn=Symbol.for("undici.error.UND_ERR_INFO"),Ttr=class extends rd{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[qLn]===!0}get[qLn](){return!0}},jLn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),Itr=class extends rd{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[jLn]===!0}get[jLn](){return!0}},HLn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),xtr=class extends rd{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[HLn]===!0}get[HLn](){return!0}},GLn=Symbol.for("undici.error.UND_ERR_DESTROYED"),wtr=class extends rd{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[GLn]===!0}get[GLn](){return!0}},$Ln=Symbol.for("undici.error.UND_ERR_CLOSED"),Rtr=class extends rd{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[$Ln]===!0}get[$Ln](){return!0}},VLn=Symbol.for("undici.error.UND_ERR_SOCKET"),ktr=class extends rd{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[VLn]===!0}get[VLn](){return!0}},WLn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Ptr=class extends rd{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[WLn]===!0}get[WLn](){return!0}},zLn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Dtr=class extends rd{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[zLn]===!0}get[zLn](){return!0}},YLn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Ntr=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[YLn]===!0}get[YLn](){return!0}},KLn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Mtr=class extends rd{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[KLn]===!0}get[KLn](){return!0}},JLn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Otr=class extends rd{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[JLn]===!0}get[JLn](){return!0}},ZLn=Symbol.for("undici.error.UND_ERR_RESPONSE"),Btr=class extends rd{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[ZLn]===!0}get[ZLn](){return!0}},XLn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Ltr=class extends rd{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[XLn]===!0}get[XLn](){return!0}},e3n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Ftr=class extends rd{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[e3n]===!0}get[e3n](){return!0}},Utr=class extends rd{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},t3n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),Qtr=class extends rd{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[t3n]===!0}get[t3n](){return!0}};r3n.exports={AbortError:eit,HTTPParserError:Ntr,UndiciError:rd,HeadersTimeoutError:Etr,HeadersOverflowError:_tr,BodyTimeoutError:Ctr,RequestContentLengthMismatchError:Itr,ConnectTimeoutError:ytr,InvalidArgumentError:vtr,InvalidReturnValueError:btr,RequestAbortedError:Str,ClientDestroyedError:wtr,ClientClosedError:Rtr,InformationalError:Ttr,SocketError:ktr,NotSupportedError:Ptr,ResponseContentLengthMismatchError:xtr,BalancedPoolMissingUpstreamError:Dtr,ResponseExceededMaxSizeError:Mtr,RequestRetryError:Otr,ResponseError:Btr,SecureProxyConnectionError:Ltr,MaxOriginsReachedError:Ftr,Socks5ProxyError:Utr,MessageSizeExceededError:Qtr}});var rit=I((vXd,i3n)=>{"use strict";p();var qtr=["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"],tit={};Object.setPrototypeOf(tit,null);var n3n={};Object.setPrototypeOf(n3n,null);function Qvs(t){let e=n3n[t];return e===void 0&&(e=Buffer.from(t)),e}a(Qvs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:o3n,headerNameLowerCasedRecord:qvs}=rit(),jtr=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 WRe=require("node:assert"),{kDestroyed:f3n,kBodyUsed:Xde,kListeners:oit,kBody:l3n}=nl(),{IncomingMessage:jvs}=require("node:http"),p3n=require("node:stream"),Hvs=require("node:net"),{stringify:Gvs}=require("node:querystring"),{EventEmitter:$vs}=require("node:events"),iit=Atr(),{InvalidArgumentError:yg,ConnectTimeoutError:Vvs}=ao(),{headerNameLowerCasedRecord:Wvs}=rit(),{tree:h3n}=c3n(),[zvs,Yvs]=process.versions.node.split(".",2).map(t=>Number(t)),ait=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[l3n]=e,this[Xde]=!1}async*[Symbol.asyncIterator](){WRe(!this[Xde],"disturbed"),this[Xde]=!0,yield*this[l3n]}};function u3n(){}a(u3n,"noop");function Kvs(t){return cit(t)?(_3n(t)===0&&t.on("data",function(){WRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Xde]=!1,$vs.prototype.on.call(t,"data",function(){this[Xde]=!0})),t):t&&typeof t.pipeTo=="function"?new ait(t):t&&T3n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&E3n(t)?new ait(t):t}a(Kvs,"wrapRequestBody");function cit(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(cit,"isStream");function m3n(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(m3n,"isBlobLike");function g3n(t){return t.includes("?")||t.includes("#")}a(g3n,"pathHasQueryOrFragment");function Jvs(t,e){if(g3n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Gvs(e);return r&&(t+="?"+r),t}a(Jvs,"serializePathWithQuery");function A3n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(A3n,"isValidPort");function sit(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(sit,"isHttpOrHttpsPrefixed");function y3n(t){if(typeof t=="string"){if(t=new URL(t),!sit(t.origin||t.protocol))throw new yg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new yg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&A3n(t.port)===!1)throw new yg("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 yg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new yg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new yg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new yg("Invalid URL origin: the origin must be a string or null/undefined.");if(!sit(t.origin||t.protocol))throw new yg("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(!sit(t.origin||t.protocol))throw new yg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(y3n,"parseURL");function Zvs(t){if(t=y3n(t),t.pathname!=="/"||t.search||t.hash)throw new yg("invalid url");return t}a(Zvs,"parseOrigin");function Xvs(t){if(t[0]==="["){let r=t.indexOf("]");return WRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Xvs,"getHostname");function ebs(t){if(!t)return null;WRe(typeof t=="string");let e=Xvs(t);return Hvs.isIP(e)?"":e}a(ebs,"getServerName");function tbs(t){return JSON.parse(JSON.stringify(t))}a(tbs,"deepClone");function rbs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(rbs,"isAsyncIterable");function E3n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(E3n,"isIterable");function nbs(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(nbs,"hasSafeIterator");function _3n(t){if(t==null)return 0;if(cit(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(m3n(t))return t.size!=null?t.size:null;if(S3n(t))return t.byteLength}return null}a(_3n,"bodyLength");function C3n(t){return t&&!!(t.destroyed||t[f3n]||p3n.isDestroyed?.(t))}a(C3n,"isDestroyed");function v3n(t,e){t==null||!cit(t)||C3n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===jvs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[f3n]=!0))}a(v3n,"destroy");var ibs=/timeout=(\d+)/;function obs(t){let e=t.match(ibs);return e?parseInt(e[1],10)*1e3:null}a(obs,"parseKeepAliveTimeout");function b3n(t){return typeof t=="string"?Wvs[t]??t.toLowerCase():h3n.lookup(t)??t.toString("latin1").toLowerCase()}a(b3n,"headerNameToString");function sbs(t){return h3n.lookup(t)??t.toString("latin1").toLowerCase()}a(sbs,"bufferToLowerCasedHeaderName");function abs(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(abs,"parseHeaders");function cbs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(lbs,"encodeRawHeaders");function S3n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(S3n,"isBuffer");function ubs(t,e,r){if(!t||typeof t!="object")throw new yg("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new yg("invalid onConnect method");if(typeof t.onError!="function")throw new yg("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new yg("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new yg("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new yg("invalid onHeaders method");if(typeof t.onData!="function")throw new yg("invalid onData method");if(typeof t.onComplete!="function")throw new yg("invalid onComplete method")}}}a(ubs,"assertRequestHandler");function dbs(t){return!!(t&&(p3n.isDisturbed(t)||t[Xde]))}a(dbs,"isDisturbed");function fbs(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(fbs,"getSocketInfo");function pbs(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(pbs,"ReadableStreamFrom");function T3n(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(T3n,"isFormDataLike");function hbs(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(hbs,"addAbortListener");var I3n=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 mbs(t){return I3n[t]===1}a(mbs,"isTokenCharCode");var gbs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function Abs(t){if(t.length>=12)return gbs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return u3n;let r=null,n=null,o=iit.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>d3n(t.deref(),e))})},e.timeout);return()=>{iit.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return u3n;let r=null,n=iit.setFastTimeout(()=>{r=setImmediate(()=>{d3n(t.deref(),e)})},e.timeout);return()=>{iit.clearFastTimeout(n),clearImmediate(r)}};function d3n(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)`,v3n(t,new Vvs(r))}a(d3n,"onConnectTimeout");function Ibs(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(Ibs,"getProtocolFromUrlString");var x3n=Object.create(null);x3n.enumerable=!0;var Htr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},w3n={...Htr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Htr,null);Object.setPrototypeOf(w3n,null);R3n.exports={kEnumerableProperty:x3n,isDisturbed:dbs,isBlobLike:m3n,parseOrigin:Zvs,parseURL:y3n,getServerName:ebs,isStream:cit,isIterable:E3n,hasSafeIterator:nbs,isAsyncIterable:rbs,isDestroyed:C3n,headerNameToString:b3n,bufferToLowerCasedHeaderName:sbs,addListener:vbs,removeAllListeners:bbs,errorRequest:Sbs,parseRawHeaders:cbs,encodeRawHeaders:lbs,parseHeaders:abs,parseKeepAliveTimeout:obs,destroy:v3n,bodyLength:_3n,deepClone:tbs,ReadableStreamFrom:pbs,isBuffer:S3n,assertRequestHandler:ubs,getSocketInfo:fbs,isFormDataLike:T3n,pathHasQueryOrFragment:g3n,serializePathWithQuery:Jvs,addAbortListener:hbs,isValidHTTPToken:Abs,isValidHeaderValue:Ebs,isTokenCharCode:mbs,parseRangeHeader:Cbs,normalizedMethodRecordsBase:Htr,normalizedMethodRecords:w3n,isValidPort:A3n,isHttpOrHttpsPrefixed:sit,nodeMajor:zvs,nodeMinor:Yvs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:Kvs,setupConnectTimeout:Tbs,getProtocolFromUrlString:Ibs}});var Vtr=I((PXd,M3n)=>{"use strict";p();var{kConnected:k3n,kPending:P3n,kRunning:D3n,kSize:N3n,kFree:xbs,kQueued:wbs}=nl(),Gtr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[k3n],this.pending=e[P3n],this.running=e[D3n],this.size=e[N3n]}},$tr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[k3n],this.free=e[xbs],this.pending=e[P3n],this.queued=e[wbs],this.running=e[D3n],this.size=e[N3n]}};M3n.exports={ClientStats:Gtr,PoolStats:$tr}});var cj=I((MXd,B3n)=>{"use strict";p();var il=require("node:diagnostics_channel"),Ktr=require("node:util"),BJ=Ktr.debuglog("undici"),zRe=Ktr.debuglog("fetch"),lit=Ktr.debuglog("websocket"),rT={beforeConnect:il.channel("undici:client:beforeConnect"),connected:il.channel("undici:client:connected"),connectError:il.channel("undici:client:connectError"),sendHeaders:il.channel("undici:client:sendHeaders"),create:il.channel("undici:request:create"),bodySent:il.channel("undici:request:bodySent"),bodyChunkSent:il.channel("undici:request:bodyChunkSent"),bodyChunkReceived:il.channel("undici:request:bodyChunkReceived"),headers:il.channel("undici:request:headers"),trailers:il.channel("undici:request:trailers"),error:il.channel("undici:request:error"),open:il.channel("undici:websocket:open"),close:il.channel("undici:websocket:close"),socketError:il.channel("undici:websocket:socket_error"),ping:il.channel("undici:websocket:ping"),pong:il.channel("undici:websocket:pong"),proxyConnected:il.channel("undici:proxy:connected")},Wtr=!1;function O3n(t=BJ){if(!Wtr){if(rT.beforeConnect.hasSubscribers||rT.connected.hasSubscribers||rT.connectError.hasSubscribers||rT.sendHeaders.hasSubscribers){Wtr=!0;return}Wtr=!0,il.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)}),il.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)}),il.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)}),il.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(O3n,"trackClientEvents");var ztr=!1;function Rbs(t=BJ){if(!ztr){if(rT.headers.hasSubscribers||rT.trailers.hasSubscribers||rT.error.hasSubscribers){ztr=!0;return}ztr=!0,il.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)}),il.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),il.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(Rbs,"trackRequestEvents");var Ytr=!1;function kbs(t=lit){if(!Ytr){if(rT.open.hasSubscribers||rT.close.hasSubscribers||rT.socketError.hasSubscribers||rT.ping.hasSubscribers||rT.pong.hasSubscribers){Ytr=!0;return}Ytr=!0,il.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")}),il.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),il.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),il.subscribe("undici:websocket:ping",e=>{t("ping received")}),il.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(kbs,"trackWebSocketEvents");(BJ.enabled||zRe.enabled)&&(O3n(zRe.enabled?zRe:BJ),Rbs(zRe.enabled?zRe:BJ));lit.enabled&&(O3n(BJ.enabled?BJ:lit),kbs(lit));B3n.exports={channels:rT}});var U3n=I((LXd,F3n)=>{"use strict";p();var{InvalidArgumentError:Qc,NotSupportedError:Pbs}=ao(),JO=require("node:assert"),{isValidHTTPToken:Jtr,isValidHeaderValue:Ztr,isStream:Dbs,destroy:Nbs,isBuffer:Mbs,isFormDataLike:Obs,isIterable:Bbs,hasSafeIterator:Lbs,isBlobLike:Fbs,serializePathWithQuery:Ubs,assertRequestHandler:Qbs,getServerName:qbs,normalizedMethodRecords:jbs,getProtocolFromUrlString:Hbs}=Do(),{channels:Xv}=cj(),{headerNameLowerCasedRecord:L3n}=rit(),Gbs=/[^\u0021-\u00ff]/;function $bs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a($bs,"isValidContentLengthHeaderValue");var fw=Symbol("handler"),Xtr=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(Gbs.test(r))throw new Qc("invalid request path");if(typeof n!="string")throw new Qc("method must be a string");if(jbs[n]===void 0&&!Jtr(n))throw new Qc("invalid request method");if(d&&typeof d!="string")throw new Qc("upgrade must be a string");if(d&&!Ztr(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(Dbs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){Nbs(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(Mbs(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(Obs(o)||Bbs(o)||Fbs(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?Ubs(r,c):r,this.origin=e,this.protocol=Hbs(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:Vbs}=ao();q3n.exports=class Q3n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new Q3n(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"),trr(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"),trr(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"),trr(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new Vbs("invalid onError method");this.#e.onError?.(r)}};function trr(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(trr,"toRawHeaderValue")});var KRe=I((HXd,j3n)=>{"use strict";p();var Wbs=require("node:events"),zbs=YRe(),Ybs=a(t=>(e,r)=>t(e,zbs.wrap(r)),"wrapInterceptor"),rrr=class extends Wbs{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=Ybs(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")})}};j3n.exports=rrr});var $3n=I((VXd,G3n)=>{"use strict";p();var{parseHeaders:nrr}=Do(),{InvalidArgumentError:Kbs}=ao(),irr=Symbol("resume"),orr=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[irr]=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[irr]?.())}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}};G3n.exports=class H3n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new H3n(e):e}onConnect(e,r){this.#t=new orr(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#e.onRequestUpgrade?.(this.#t,e,nrr(r),n)}onHeaders(e,r,n,o){return this.#t[irr]=n,this.#e.onResponseStart?.(this.#t,e,nrr(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#e.onResponseEnd?.(this.#t,nrr(e))}onError(e){if(!this.#e.onResponseError)throw new Kbs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var FJ=I((YXd,V3n)=>{"use strict";p();var Jbs=KRe(),Zbs=$3n(),{ClientDestroyedError:srr,ClientClosedError:Xbs,InvalidArgumentError:dit}=ao(),{kDestroy:e1s,kClose:t1s,kClosed:JRe,kDestroyed:efe,kDispatch:r1s}=nl(),lj=Symbol("onDestroyed"),LJ=Symbol("onClosed"),arr=class extends Jbs{static{a(this,"DispatcherBase")}[efe]=!1;[lj]=null;[JRe]=!1;[LJ]=null;get destroyed(){return this[efe]}get closed(){return this[JRe]}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 dit("invalid callback");if(this[efe]){let n=new srr;queueMicrotask(()=>e(n,null));return}if(this[JRe]){this[LJ]?this[LJ].push(e):queueMicrotask(()=>e(null,null));return}this[JRe]=!0,this[LJ]??=[],this[LJ].push(e);let r=a(()=>{let n=this[LJ];this[LJ]=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 dit("invalid callback");if(this[efe]){this[lj]?this[lj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new srr),this[efe]=!0,this[lj]??=[],this[lj].push(r);let n=a(()=>{let o=this[lj];this[lj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new dit("handler must be an object");r=Zbs.unwrap(r);try{if(!e||typeof e!="object")throw new dit("opts must be an object.");if(this[efe]||this[lj])throw new srr;if(this[JRe])throw new Xbs;return this[r1s](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};V3n.exports=arr});var UJ=I((XXd,Y3n)=>{"use strict";p();var n1s=require("node:net"),W3n=require("node:assert"),z3n=Do(),{InvalidArgumentError:i1s}=ao(),crr,o1s=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 s1s({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new i1s("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new o1s(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:"){crr||(crr=require("node:tls")),A=A||l.servername||z3n.getServerName(h)||null;let T=A||f;W3n(T);let w=s||u.get(T)||null;g=g||443,v=crr.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 W3n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=n1s.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=z3n.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(s1s,"buildConnector");Y3n.exports=s1s});var K3n=I(lrr=>{"use strict";p();Object.defineProperty(lrr,"__esModule",{value:!0});lrr.enumToMap=a1s;function a1s(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(a1s,"enumToMap")});var J3n=I(Pe=>{"use strict";p();Object.defineProperty(Pe,"__esModule",{value:!0});Pe.SPECIAL_HEADERS=Pe.MINOR=Pe.MAJOR=Pe.HTAB_SP_VCHAR_OBS_TEXT=Pe.QUOTED_STRING=Pe.CONNECTION_TOKEN_CHARS=Pe.HEADER_CHARS=Pe.TOKEN=Pe.HEX=Pe.URL_CHAR=Pe.USERINFO_CHARS=Pe.MARK=Pe.ALPHANUM=Pe.NUM=Pe.HEX_MAP=Pe.NUM_MAP=Pe.ALPHA=Pe.STATUSES_HTTP=Pe.H_METHOD_MAP=Pe.METHOD_MAP=Pe.METHODS_RTSP=Pe.METHODS_ICE=Pe.METHODS_HTTP=Pe.HEADER_STATE=Pe.FINISH=Pe.STATUSES=Pe.METHODS=Pe.LENIENT_FLAGS=Pe.FLAGS=Pe.TYPE=Pe.ERROR=void 0;var c1s=K3n();Pe.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};Pe.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};Pe.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};Pe.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};Pe.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};Pe.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};Pe.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};Pe.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};Pe.METHODS_HTTP=[Pe.METHODS.DELETE,Pe.METHODS.GET,Pe.METHODS.HEAD,Pe.METHODS.POST,Pe.METHODS.PUT,Pe.METHODS.CONNECT,Pe.METHODS.OPTIONS,Pe.METHODS.TRACE,Pe.METHODS.COPY,Pe.METHODS.LOCK,Pe.METHODS.MKCOL,Pe.METHODS.MOVE,Pe.METHODS.PROPFIND,Pe.METHODS.PROPPATCH,Pe.METHODS.SEARCH,Pe.METHODS.UNLOCK,Pe.METHODS.BIND,Pe.METHODS.REBIND,Pe.METHODS.UNBIND,Pe.METHODS.ACL,Pe.METHODS.REPORT,Pe.METHODS.MKACTIVITY,Pe.METHODS.CHECKOUT,Pe.METHODS.MERGE,Pe.METHODS["M-SEARCH"],Pe.METHODS.NOTIFY,Pe.METHODS.SUBSCRIBE,Pe.METHODS.UNSUBSCRIBE,Pe.METHODS.PATCH,Pe.METHODS.PURGE,Pe.METHODS.MKCALENDAR,Pe.METHODS.LINK,Pe.METHODS.UNLINK,Pe.METHODS.PRI,Pe.METHODS.SOURCE,Pe.METHODS.QUERY];Pe.METHODS_ICE=[Pe.METHODS.SOURCE];Pe.METHODS_RTSP=[Pe.METHODS.OPTIONS,Pe.METHODS.DESCRIBE,Pe.METHODS.ANNOUNCE,Pe.METHODS.SETUP,Pe.METHODS.PLAY,Pe.METHODS.PAUSE,Pe.METHODS.TEARDOWN,Pe.METHODS.GET_PARAMETER,Pe.METHODS.SET_PARAMETER,Pe.METHODS.REDIRECT,Pe.METHODS.RECORD,Pe.METHODS.FLUSH,Pe.METHODS.GET,Pe.METHODS.POST];Pe.METHOD_MAP=(0,c1s.enumToMap)(Pe.METHODS);Pe.H_METHOD_MAP=Object.fromEntries(Object.entries(Pe.METHODS).filter(([t])=>t.startsWith("H")));Pe.STATUSES_HTTP=[Pe.STATUSES.CONTINUE,Pe.STATUSES.SWITCHING_PROTOCOLS,Pe.STATUSES.PROCESSING,Pe.STATUSES.EARLY_HINTS,Pe.STATUSES.RESPONSE_IS_STALE,Pe.STATUSES.REVALIDATION_FAILED,Pe.STATUSES.DISCONNECTED_OPERATION,Pe.STATUSES.HEURISTIC_EXPIRATION,Pe.STATUSES.MISCELLANEOUS_WARNING,Pe.STATUSES.OK,Pe.STATUSES.CREATED,Pe.STATUSES.ACCEPTED,Pe.STATUSES.NON_AUTHORITATIVE_INFORMATION,Pe.STATUSES.NO_CONTENT,Pe.STATUSES.RESET_CONTENT,Pe.STATUSES.PARTIAL_CONTENT,Pe.STATUSES.MULTI_STATUS,Pe.STATUSES.ALREADY_REPORTED,Pe.STATUSES.TRANSFORMATION_APPLIED,Pe.STATUSES.IM_USED,Pe.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,Pe.STATUSES.MULTIPLE_CHOICES,Pe.STATUSES.MOVED_PERMANENTLY,Pe.STATUSES.FOUND,Pe.STATUSES.SEE_OTHER,Pe.STATUSES.NOT_MODIFIED,Pe.STATUSES.USE_PROXY,Pe.STATUSES.SWITCH_PROXY,Pe.STATUSES.TEMPORARY_REDIRECT,Pe.STATUSES.PERMANENT_REDIRECT,Pe.STATUSES.BAD_REQUEST,Pe.STATUSES.UNAUTHORIZED,Pe.STATUSES.PAYMENT_REQUIRED,Pe.STATUSES.FORBIDDEN,Pe.STATUSES.NOT_FOUND,Pe.STATUSES.METHOD_NOT_ALLOWED,Pe.STATUSES.NOT_ACCEPTABLE,Pe.STATUSES.PROXY_AUTHENTICATION_REQUIRED,Pe.STATUSES.REQUEST_TIMEOUT,Pe.STATUSES.CONFLICT,Pe.STATUSES.GONE,Pe.STATUSES.LENGTH_REQUIRED,Pe.STATUSES.PRECONDITION_FAILED,Pe.STATUSES.PAYLOAD_TOO_LARGE,Pe.STATUSES.URI_TOO_LONG,Pe.STATUSES.UNSUPPORTED_MEDIA_TYPE,Pe.STATUSES.RANGE_NOT_SATISFIABLE,Pe.STATUSES.EXPECTATION_FAILED,Pe.STATUSES.IM_A_TEAPOT,Pe.STATUSES.PAGE_EXPIRED,Pe.STATUSES.ENHANCE_YOUR_CALM,Pe.STATUSES.MISDIRECTED_REQUEST,Pe.STATUSES.UNPROCESSABLE_ENTITY,Pe.STATUSES.LOCKED,Pe.STATUSES.FAILED_DEPENDENCY,Pe.STATUSES.TOO_EARLY,Pe.STATUSES.UPGRADE_REQUIRED,Pe.STATUSES.PRECONDITION_REQUIRED,Pe.STATUSES.TOO_MANY_REQUESTS,Pe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,Pe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,Pe.STATUSES.LOGIN_TIMEOUT,Pe.STATUSES.NO_RESPONSE,Pe.STATUSES.RETRY_WITH,Pe.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,Pe.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,Pe.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,Pe.STATUSES.INVALID_X_FORWARDED_FOR,Pe.STATUSES.REQUEST_HEADER_TOO_LARGE,Pe.STATUSES.SSL_CERTIFICATE_ERROR,Pe.STATUSES.SSL_CERTIFICATE_REQUIRED,Pe.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,Pe.STATUSES.INVALID_TOKEN,Pe.STATUSES.CLIENT_CLOSED_REQUEST,Pe.STATUSES.INTERNAL_SERVER_ERROR,Pe.STATUSES.NOT_IMPLEMENTED,Pe.STATUSES.BAD_GATEWAY,Pe.STATUSES.SERVICE_UNAVAILABLE,Pe.STATUSES.GATEWAY_TIMEOUT,Pe.STATUSES.HTTP_VERSION_NOT_SUPPORTED,Pe.STATUSES.VARIANT_ALSO_NEGOTIATES,Pe.STATUSES.INSUFFICIENT_STORAGE,Pe.STATUSES.LOOP_DETECTED,Pe.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,Pe.STATUSES.NOT_EXTENDED,Pe.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,Pe.STATUSES.WEB_SERVER_UNKNOWN_ERROR,Pe.STATUSES.WEB_SERVER_IS_DOWN,Pe.STATUSES.CONNECTION_TIMEOUT,Pe.STATUSES.ORIGIN_IS_UNREACHABLE,Pe.STATUSES.TIMEOUT_OCCURED,Pe.STATUSES.SSL_HANDSHAKE_FAILED,Pe.STATUSES.INVALID_SSL_CERTIFICATE,Pe.STATUSES.RAILGUN_ERROR,Pe.STATUSES.SITE_IS_OVERLOADED,Pe.STATUSES.SITE_IS_FROZEN,Pe.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,Pe.STATUSES.NETWORK_READ_TIMEOUT,Pe.STATUSES.NETWORK_CONNECT_TIMEOUT];Pe.ALPHA=[];for(let t=65;t<=90;t++)Pe.ALPHA.push(String.fromCharCode(t)),Pe.ALPHA.push(String.fromCharCode(t+32));Pe.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Pe.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};Pe.NUM=["0","1","2","3","4","5","6","7","8","9"];Pe.ALPHANUM=Pe.ALPHA.concat(Pe.NUM);Pe.MARK=["-","_",".","!","~","*","'","(",")"];Pe.USERINFO_CHARS=Pe.ALPHANUM.concat(Pe.MARK).concat(["%",";",":","&","=","+","$",","]);Pe.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Pe.ALPHANUM);Pe.HEX=Pe.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Pe.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Pe.ALPHANUM);Pe.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Pe.HEADER_CHARS.push(t);Pe.CONNECTION_TOKEN_CHARS=Pe.HEADER_CHARS.filter(t=>t!==44);Pe.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&Pe.QUOTED_STRING.push(t);Pe.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)Pe.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)Pe.HTAB_SP_VCHAR_OBS_TEXT.push(t);Pe.MAJOR=Pe.NUM_MAP;Pe.MINOR=Pe.MAJOR;Pe.SPECIAL_HEADERS={connection:Pe.HEADER_STATE.CONNECTION,"content-length":Pe.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":Pe.HEADER_STATE.CONNECTION,"transfer-encoding":Pe.HEADER_STATE.TRANSFER_ENCODING,upgrade:Pe.HEADER_STATE.UPGRADE};Pe.default={ERROR:Pe.ERROR,TYPE:Pe.TYPE,FLAGS:Pe.FLAGS,LENIENT_FLAGS:Pe.LENIENT_FLAGS,METHODS:Pe.METHODS,STATUSES:Pe.STATUSES,FINISH:Pe.FINISH,HEADER_STATE:Pe.HEADER_STATE,ALPHA:Pe.ALPHA,NUM_MAP:Pe.NUM_MAP,HEX_MAP:Pe.HEX_MAP,NUM:Pe.NUM,ALPHANUM:Pe.ALPHANUM,MARK:Pe.MARK,USERINFO_CHARS:Pe.USERINFO_CHARS,URL_CHAR:Pe.URL_CHAR,HEX:Pe.HEX,TOKEN:Pe.TOKEN,HEADER_CHARS:Pe.HEADER_CHARS,CONNECTION_TOKEN_CHARS:Pe.CONNECTION_TOKEN_CHARS,QUOTED_STRING:Pe.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:Pe.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:Pe.MAJOR,MINOR:Pe.MINOR,SPECIAL_HEADERS:Pe.SPECIAL_HEADERS,METHODS_HTTP:Pe.METHODS_HTTP,METHODS_ICE:Pe.METHODS_ICE,METHODS_RTSP:Pe.METHODS_RTSP,METHOD_MAP:Pe.METHOD_MAP,H_METHOD_MAP:Pe.H_METHOD_MAP,STATUSES_HTTP:Pe.STATUSES_HTTP}});var drr=I((aef,Z3n)=>{"use strict";p();var{Buffer:l1s}=require("node:buffer"),u1s="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==",urr;Object.defineProperty(Z3n,"exports",{get:a(()=>urr||(urr=l1s.from(u1s,"base64")),"get")})});var eFn=I((uef,X3n)=>{"use strict";p();var{Buffer:d1s}=require("node:buffer"),f1s="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==",frr;Object.defineProperty(X3n,"exports",{get:a(()=>frr||(frr=d1s.from(f1s,"base64")),"get")})});var ZRe=I((pef,cFn)=>{"use strict";p();var tFn=["GET","HEAD","POST"],p1s=new Set(tFn),h1s=[101,204,205,304],rFn=[301,302,303,307,308],m1s=new Set(rFn),nFn=["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"],g1s=new Set(nFn),iFn=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],A1s=["",...iFn],y1s=new Set(iFn),E1s=["follow","manual","error"],oFn=["GET","HEAD","OPTIONS","TRACE"],_1s=new Set(oFn),C1s=["navigate","same-origin","no-cors","cors"],v1s=["omit","same-origin","include"],b1s=["default","no-store","reload","no-cache","force-cache","only-if-cached"],S1s=["content-encoding","content-language","content-location","content-type","content-length"],T1s=["half"],sFn=["CONNECT","TRACE","TRACK"],I1s=new Set(sFn),aFn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],x1s=new Set(aFn);cFn.exports={subresource:aFn,forbiddenMethods:sFn,requestBodyHeader:S1s,referrerPolicy:A1s,requestRedirect:E1s,requestMode:C1s,requestCredentials:v1s,requestCache:b1s,redirectStatus:rFn,corsSafeListedMethods:tFn,nullBodyStatus:h1s,safeMethods:oFn,badPorts:nFn,requestDuplex:T1s,subresourceSet:x1s,badPortsSet:g1s,redirectStatusSet:m1s,corsSafeListedMethodsSet:p1s,safeMethodsSet:_1s,forbiddenMethodsSet:I1s,referrerPolicyTokens:y1s}});var hrr=I((mef,lFn)=>{"use strict";p();var prr=Symbol.for("undici.globalOrigin.1");function w1s(){return globalThis[prr]}a(w1s,"getGlobalOrigin");function R1s(t){if(t===void 0){Object.defineProperty(globalThis,prr,{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,prr,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(R1s,"setGlobalOrigin");lFn.exports={getGlobalOrigin:w1s,setGlobalOrigin:R1s}});var fit=I((yef,uFn)=>{"use strict";p();var k1s=new TextDecoder;function P1s(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),k1s.decode(t))}a(P1s,"utf8DecodeBytes");uFn.exports={utf8DecodeBytes:P1s}});var fF=I((Cef,hFn)=>{"use strict";p();var dFn=require("node:assert"),{utf8DecodeBytes:D1s}=fit();function N1s(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(L1s,"isomorphicDecode");var F1s=/[^\x00-\xFF]/;function U1s(t){return dFn(!F1s.test(t)),t}a(U1s,"isomorphicEncode");function Q1s(t){return JSON.parse(D1s(t))}a(Q1s,"parseJSONFromBytes");function q1s(t,e=!0,r=!0){return pFn(t,e,r,fFn)}a(q1s,"removeASCIIWhitespace");function pFn(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(pFn,"removeChars");function j1s(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return dFn(typeof e=="string"),e}a(j1s,"serializeJavascriptValueToJSONString");hFn.exports={collectASequenceOfCodePoints:N1s,collectASequenceOfCodePointsFast:M1s,forgivingBase64:B1s,isASCIIWhitespace:fFn,isomorphicDecode:L1s,isomorphicEncode:U1s,parseJSONFromBytes:Q1s,removeASCIIWhitespace:q1s,removeChars:pFn,serializeJavascriptValueToJSONString:j1s}});var pw=I((Sef,_Fn)=>{"use strict";p();var hit=require("node:assert"),{forgivingBase64:H1s,collectASequenceOfCodePoints:mrr,collectASequenceOfCodePointsFast:XRe,isomorphicDecode:G1s,removeASCIIWhitespace:$1s,removeChars:V1s}=fF(),W1s=new TextEncoder,eke=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,z1s=/[\u000A\u000D\u0009\u0020]/u,Y1s=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function K1s(t){hit(t.protocol==="data:");let e=AFn(t,!0);e=e.slice(5);let r={position:0},n=XRe(",",e,r),o=n.length;if(n=$1s(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=yFn(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=G1s(c);if(c=H1s(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=grr(n);return l==="failure"&&(l=grr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(K1s,"dataURLProcessor");function AFn(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(AFn,"URLSerializer");function yFn(t){let e=W1s.encode(t);return J1s(e)}a(yFn,"stringPercentDecode");function mFn(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(mFn,"isHexCharByte");function gFn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(gFn,"hexByteToNumber");function J1s(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=XRe(";",t,e);if(n=pit(n,!1,!0),n.length===0||!eke.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionz1s.test(d),t,e);let l=mrr(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=EFn(t,e,!0),XRe(";",t,e);else if(u=XRe(";",t,e),u=pit(u,!1,!0),u.length===0)continue;l.length!==0&&eke.test(l)&&(u.length===0||Y1s.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(grr,"parseMIMEType");function EFn(t,e,r=!1){let n=e.position,o="";for(hit(t[e.position]==='"'),e.position++;o+=mrr(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{hit(s==='"');break}}return r?o:t.slice(n,e.position)}a(EFn,"collectAnHTTPQuotedString");function Z1s(t){hit(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",eke.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(Z1s,"serializeAMimeType");function X1s(t){return t===13||t===10||t===9||t===32}a(X1s,"isHTTPWhiteSpace");function pit(t,e=!0,r=!0){return V1s(t,e,r,X1s)}a(pit,"removeHTTPWhitespace");function eSs(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(eSs,"minimizeSupportedMimeType");_Fn.exports={dataURLProcessor:K1s,URLSerializer:AFn,stringPercentDecode:yFn,parseMIMEType:grr,collectAnHTTPQuotedString:EFn,serializeAMimeType:Z1s,removeHTTPWhitespace:pit,minimizeSupportedMimeType:eSs,HTTP_TOKEN_CODEPOINTS:eke}});var pF=I((xef,yrr)=>{"use strict";p();var CFn={__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 tSs(t){try{return CFn[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(tSs,"detectRuntimeFeatureByNodeModule");function rSs(t,e){return typeof CFn[t]()[e]<"u"}a(rSs,"detectRuntimeFeatureByExportedProperty");var vFn=["markAsUncloneable","zstd"],nSs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},bFn=["crypto","sqlite"],iSs=[...bFn,...vFn];function oSs(t){if(bFn.includes(t))return tSs(`node:${t}`);if(vFn.includes(t)){let[e,r]=nSs[t];return rSs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(oSs,"detectRuntimeFeature");var Arr=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(iSs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=oSs(e);return this.#e.set(e,r),r}},SFn=new Arr;yrr.exports.runtimeFeatures=SFn;yrr.exports.default=SFn});var xA=I((kef,IFn)=>{"use strict";p();var sSs=require("node:assert"),{types:np,inspect:aSs}=require("node:util"),{runtimeFeatures:cSs}=pF(),Err=1,_rr=2,mit=3,git=4,Crr=5,Ait=6,vrr=7,nT=8,TFn=Function.call.bind(Function.prototype[Symbol.hasInstance]),rt={converters:{},util:{},errors:{},is:{}};rt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};rt.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 rt.errors.exception({header:t.prefix,message:r})};rt.errors.invalidArgument=function(t){return rt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};rt.brandCheck=function(t,e){if(!TFn(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};rt.brandCheckMultiple=function(t){let e=t.map(r=>rt.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};rt.argumentLengthCheck=function({length:t},e,r){if(tTFn(t,e)};rt.util.Type=function(t){switch(typeof t){case"undefined":return Err;case"boolean":return _rr;case"string":return mit;case"symbol":return git;case"number":return Crr;case"bigint":return Ait;case"function":case"object":return t===null?vrr:nT}};rt.util.Types={UNDEFINED:Err,BOOLEAN:_rr,STRING:mit,SYMBOL:git,NUMBER:Crr,BIGINT:Ait,NULL:vrr,OBJECT:nT};rt.util.TypeValueToString=function(t){switch(rt.util.Type(t)){case Err:return"Undefined";case _rr:return"Boolean";case mit:return"String";case git:return"Symbol";case Crr:return"Number";case Ait:return"BigInt";case vrr:return"Null";case nT:return"Object"}};rt.util.markAsUncloneable=cSs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};rt.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),rt.util.HasFlag(n,rt.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw rt.errors.exception({header:"Integer conversion",message:`Could not convert ${rt.util.Stringify(t)} to an integer.`});if(c=rt.util.IntegerPart(c),co)throw rt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&rt.util.HasFlag(n,rt.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=rt.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};rt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};rt.util.Stringify=function(t){switch(rt.util.Type(t)){case git:return`Symbol(${t.description})`;case nT:return aSs(t);case mit:return`"${t}"`;case Ait:return`${t}n`;default:return`${t}`}};rt.util.IsResizableArrayBuffer=function(t){if(np.isArrayBuffer(t))return t.resizable;if(np.isSharedArrayBuffer(t))return t.growable;throw rt.errors.exception({header:"IsResizableArrayBuffer",message:`"${rt.util.Stringify(t)}" is not an array buffer.`})};rt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};rt.sequenceConverter=function(t){return(e,r,n,o)=>{if(rt.util.Type(e)!==nT)throw rt.errors.exception({header:r,message:`${n} (${rt.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 rt.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}};rt.recordConverter=function(t,e){return(r,n,o)=>{if(rt.util.Type(r)!==nT)throw rt.errors.exception({header:n,message:`${o} ("${rt.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!np.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=rt.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}};rt.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw rt.errors.exception({header:n,message:`Expected ${o} ("${rt.util.Stringify(r)}") to be an instance of ${e}.`});return r}};rt.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&rt.util.Type(e)!==nT)throw rt.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 rt.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 rt.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};rt.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};rt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};rt.is.ReadableStream=rt.util.MakeTypeAssertion(ReadableStream);rt.is.Blob=rt.util.MakeTypeAssertion(Blob);rt.is.URLSearchParams=rt.util.MakeTypeAssertion(URLSearchParams);rt.is.File=rt.util.MakeTypeAssertion(File);rt.is.URL=rt.util.MakeTypeAssertion(URL);rt.is.AbortSignal=rt.util.MakeTypeAssertion(AbortSignal);rt.is.MessagePort=rt.util.MakeTypeAssertion(MessagePort);rt.is.BufferSource=function(t){return np.isArrayBuffer(t)||ArrayBuffer.isView(t)&&np.isArrayBuffer(t.buffer)};rt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(np.isTypedArray(e)||np.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(sSs(np.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};rt.converters.DOMString=function(t,e,r,n){if(t===null&&rt.util.HasFlag(n,rt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw rt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};rt.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw rt.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};rt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};rt.converters.boolean=function(t){return!!t};rt.converters.any=function(t){return t};rt.converters["long long"]=function(t,e,r){return rt.util.ConvertToInt(t,64,"signed",0,e,r)};rt.converters["unsigned long long"]=function(t,e,r){return rt.util.ConvertToInt(t,64,"unsigned",0,e,r)};rt.converters["unsigned long"]=function(t,e,r){return rt.util.ConvertToInt(t,32,"unsigned",0,e,r)};rt.converters["unsigned short"]=function(t,e,r,n){return rt.util.ConvertToInt(t,16,"unsigned",n,e,r)};rt.converters.ArrayBuffer=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isArrayBuffer(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t))throw rt.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};rt.converters.SharedArrayBuffer=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isSharedArrayBuffer(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t))throw rt.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};rt.converters.TypedArray=function(t,e,r,n,o){if(rt.util.Type(t)!==nT||!np.isTypedArray(t)||t.constructor.name!==e.name)throw rt.errors.conversionFailed({prefix:r,argument:`${n} ("${rt.util.Stringify(t)}")`,types:[e.name]});if(!rt.util.HasFlag(o,rt.attributes.AllowShared)&&np.isSharedArrayBuffer(t.buffer))throw rt.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!rt.util.HasFlag(o,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t.buffer))throw rt.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};rt.converters.DataView=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isDataView(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["DataView"]});if(!rt.util.HasFlag(n,rt.attributes.AllowShared)&&np.isSharedArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};rt.converters.ArrayBufferView=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isArrayBufferView(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!rt.util.HasFlag(n,rt.attributes.AllowShared)&&np.isSharedArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};rt.converters.BufferSource=function(t,e,r,n){if(np.isArrayBuffer(t))return rt.converters.ArrayBuffer(t,e,r,n);if(np.isArrayBufferView(t))return n&=~rt.attributes.AllowShared,rt.converters.ArrayBufferView(t,e,r,n);throw np.isSharedArrayBuffer(t)?rt.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};rt.converters.AllowSharedBufferSource=function(t,e,r,n){if(np.isArrayBuffer(t))return rt.converters.ArrayBuffer(t,e,r,n);if(np.isSharedArrayBuffer(t))return rt.converters.SharedArrayBuffer(t,e,r,n);if(np.isArrayBufferView(t))return n|=rt.attributes.AllowShared,rt.converters.ArrayBufferView(t,e,r,n);throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};rt.converters["sequence"]=rt.sequenceConverter(rt.converters.ByteString);rt.converters["sequence>"]=rt.sequenceConverter(rt.converters["sequence"]);rt.converters["record"]=rt.recordConverter(rt.converters.ByteString,rt.converters.ByteString);rt.converters.Blob=rt.interfaceConverter(rt.is.Blob,"Blob");rt.converters.AbortSignal=rt.interfaceConverter(rt.is.AbortSignal,"AbortSignal");rt.converters.EventHandlerNonNull=function(t){return rt.util.Type(t)!==nT?null:typeof t=="function"?t:()=>{}};rt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};IFn.exports={webidl:rt}});var iT=I((Def,QFn)=>{"use strict";p();var{Transform:lSs}=require("node:stream"),xFn=require("node:zlib"),{redirectStatusSet:uSs,referrerPolicyTokens:dSs,badPortsSet:fSs}=ZRe(),{getGlobalOrigin:wFn}=hrr(),{collectAnHTTPQuotedString:pSs,parseMIMEType:hSs}=pw(),{performance:mSs}=require("node:perf_hooks"),{ReadableStreamFrom:gSs,isValidHTTPToken:RFn,normalizedMethodRecordsBase:ASs}=Do(),rke=require("node:assert"),{isUint8Array:ySs}=require("node:util/types"),{webidl:uj}=xA(),{isomorphicEncode:brr,collectASequenceOfCodePoints:QJ,removeChars:ESs}=fF();function kFn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(kFn,"responseURL");function _Ss(t,e){if(!uSs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&DFn(r)&&(PFn(r)||(r=CSs(r)),r=new URL(r,kFn(t))),r&&!r.hash&&(r.hash=e),r}a(_Ss,"responseLocationURL");function PFn(t){for(let e=0;e126||r<32)return!1}return!0}a(PFn,"isValidEncodedURL");function CSs(t){return Buffer.from(t,"binary").toString("utf8")}a(CSs,"normalizeBinaryStringToUtf8");function jJ(t){return t.urlList[t.urlList.length-1]}a(jJ,"requestCurrentURL");function vSs(t){let e=jJ(t);return FFn(e)&&fSs.has(e.port)?"blocked":"allowed"}a(vSs,"requestBadPort");function bSs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(bSs,"isErrorLike");function SSs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(SSs,"isValidReasonPhrase");var TSs=RFn;function DFn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(DFn,"isValidHeaderValue");function ISs(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(dSs.has(o)){r=o;break}}return r}a(ISs,"parseReferrerPolicy");function xSs(t,e){let r=ISs(e);r!==""&&(t.referrerPolicy=r)}a(xSs,"setRequestReferrerPolicyOnRedirect");function wSs(){return"allowed"}a(wSs,"crossOriginResourcePolicyCheck");function RSs(){return"success"}a(RSs,"corsCheck");function kSs(){return"success"}a(kSs,"TAOCheck");function PSs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(PSs,"appendFetchMetadata");function DSs(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&&Trr(t.origin)&&!Trr(jJ(t))&&(e=null);break;case"same-origin":tke(t,jJ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(DSs,"appendRequestOriginHeader");function tfe(t,e){return t}a(tfe,"coarsenTime");function NSs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Srr(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=jJ(t);return qJ(n)&&!qJ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=jJ(t);return tke(n,s)?n:qJ(n)&&!qJ(s)?"no-referrer":o}case"same-origin":return tke(t,n)?n:"no-referrer";case"origin-when-cross-origin":return tke(t,n)?n:o;case"no-referrer-when-downgrade":{let s=jJ(t);return qJ(n)&&!qJ(s)?"no-referrer":n}}}a(LSs,"determineRequestsReferrer");function Srr(t,e=!1){return rke(uj.is.URL(t)),t=new URL(t),LFn(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Srr,"stripURLForReferrer");var FSs=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)$/),USs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function MFn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),USs(t)):FSs(t)}a(MFn,"isOriginIPPotentiallyTrustworthy");function QSs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||MFn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(QSs,"isOriginPotentiallyTrustworthy");function qJ(t){return uj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:QSs(t.origin):!1}a(qJ,"isURLPotentiallyTrustworthy");function qSs(t){}a(qSs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function tke(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(tke,"sameOrigin");function jSs(t){return t.controller.state==="aborted"}a(jSs,"isAborted");function HSs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(HSs,"isCancelled");function GSs(t){return ASs[t.toLowerCase()]??t}a(GSs,"normalizeMethod");var $Ss=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function OFn(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,$Ss),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(OFn,"createIterator");function VSs(t,e,r,n=0,o=1){let s=OFn(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(VSs,"iteratorMixin");function WSs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();BFn(s,n,o)}catch(s){o(s)}}a(WSs,"fullyReadBody");function zSs(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(zSs,"readableStreamClose");async function BFn(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(!ySs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(BFn,"readAllBytes");function LFn(t){rke("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(LFn,"urlIsLocal");function Trr(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(Trr,"urlHasHttpsScheme");function FFn(t){rke("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(FFn,"urlIsHttpHttpsScheme");function YSs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&QJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&QJ(u=>u===" "||u===" ",r,n);let o=QJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&QJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&QJ(u=>u===" "||u===" ",r,n);let c=QJ(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(YSs,"simpleRangeHeaderValue");function KSs(t,e,r){let n="bytes ";return n+=brr(`${t}`),n+="-",n+=brr(`${e}`),n+="/",n+=brr(`${r}`),n}a(KSs,"buildContentRange");var Irr=class extends lSs{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?xFn.createInflate(this.#e):xFn.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 JSs(t){return new Irr(t)}a(JSs,"createInflate");function ZSs(t){let e=null,r=null,n=null,o=UFn("content-type",t);if(o===null)return"failure";for(let s of o){let c=hSs(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(ZSs,"extractMimeType");function XSs(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(XSs,"gettingDecodingSplitting");function UFn(t,e){let r=e.get(t,!0);return r===null?null:XSs(r)}a(UFn,"getDecodeSplit");function eTs(t){return!1}a(eTs,"hasAuthenticationEntry");function tTs(t){return!!(t.username||t.password)}a(tTs,"includesCredentials");function rTs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(rTs,"isTraversableNavigable");var xrr=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return wFn()}get origin(){return this.baseUrl?.origin}policyContainer=NFn()},wrr=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new xrr},nTs=new wrr;QFn.exports={isAborted:jSs,isCancelled:HSs,isValidEncodedURL:PFn,ReadableStreamFrom:gSs,tryUpgradeRequestToAPotentiallyTrustworthyURL:qSs,clampAndCoarsenConnectionTimingInfo:NSs,coarsenedSharedCurrentTime:MSs,determineRequestsReferrer:LSs,makePolicyContainer:NFn,clonePolicyContainer:BSs,appendFetchMetadata:PSs,appendRequestOriginHeader:DSs,TAOCheck:kSs,corsCheck:RSs,crossOriginResourcePolicyCheck:wSs,createOpaqueTimingInfo:OSs,setRequestReferrerPolicyOnRedirect:xSs,isValidHTTPToken:RFn,requestBadPort:vSs,requestCurrentURL:jJ,responseURL:kFn,responseLocationURL:_Ss,isURLPotentiallyTrustworthy:qJ,isValidReasonPhrase:SSs,sameOrigin:tke,normalizeMethod:GSs,iteratorMixin:VSs,createIterator:OFn,isValidHeaderName:TSs,isValidHeaderValue:DFn,isErrorLike:bSs,fullyReadBody:WSs,readableStreamClose:zSs,urlIsLocal:LFn,urlHasHttpsScheme:Trr,urlIsHttpHttpsScheme:FFn,readAllBytes:BFn,simpleRangeHeaderValue:YSs,buildContentRange:KSs,createInflate:JSs,extractMimeType:ZSs,getDecodeSplit:UFn,environmentSettingsObject:nTs,isOriginIPPotentiallyTrustworthy:MFn,hasAuthenticationEntry:eTs,includesCredentials:tTs,isTraversableNavigable:rTs}});var yit=I((Oef,jFn)=>{"use strict";p();var{iteratorMixin:iTs}=iT(),{kEnumerableProperty:rfe}=Do(),{webidl:xc}=xA(),qFn=require("node:util"),hF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(xc.util.markAsUncloneable(this),e!==void 0)throw xc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){xc.brandCheck(this,t);let o="FormData.append";xc.argumentLengthCheck(arguments,2,o),e=xc.converters.USVString(e),arguments.length===3||xc.is.Blob(r)?(r=xc.converters.Blob(r,o,"value"),n!==void 0&&(n=xc.converters.USVString(n))):r=xc.converters.USVString(r);let s=Rrr(e,r,n);this.#e.push(s)}delete(e){xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.delete"),e=xc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.get"),e=xc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=xc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.has"),e=xc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){xc.brandCheck(this,t);let o="FormData.set";xc.argumentLengthCheck(arguments,2,o),e=xc.converters.USVString(e),arguments.length===3||xc.is.Blob(r)?(r=xc.converters.Blob(r,o,"value"),n!==void 0&&(n=xc.converters.USVString(n))):r=xc.converters.USVString(r);let s=Rrr(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)}[qFn.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=qFn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:oTs,setFormDataState:sTs}=hF;Reflect.deleteProperty(hF,"getFormDataState");Reflect.deleteProperty(hF,"setFormDataState");iTs("FormData",hF,oTs,"name","value");Object.defineProperties(hF.prototype,{append:rfe,delete:rfe,get:rfe,getAll:rfe,has:rfe,set:rfe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Rrr(t,e,r){if(typeof e!="string"){if(xc.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(Rrr,"makeEntry");xc.is.FormData=xc.util.MakeTypeAssertion(hF);jFn.exports={FormData:hF,makeEntry:Rrr,setFormDataState:sTs}});var $Fn=I((Fef,GFn)=>{"use strict";p();var{bufferToLowerCasedHeaderName:aTs}=Do(),{HTTP_TOKEN_CODEPOINTS:cTs}=pw(),{makeEntry:lTs}=yit(),{webidl:krr}=xA(),Prr=require("node:assert"),{isomorphicDecode:HFn}=fF(),uTs=Buffer.from("--"),Drr=new TextDecoder,dTs=new TextDecoder("utf-8",{ignoreBOM:!0});function fTs(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(pTs,"validateBoundary");function hTs(t,e){Prr(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw eb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw eb("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 eb("expected a value starting with -- and the boundary");if(ATs(t,uTs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw eb("expected CRLF");s.position+=2;let l=gTs(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 eb("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 eb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",fTs(f)||(f=""),g=new File([m],d,{type:f})):g=dTs.decode(Buffer.from(m)),Prr(krr.is.USVString(u)),Prr(typeof g=="string"&&krr.is.USVString(g)||krr.is.File(g)),o.push(lTs(u,g,d))}}a(hTs,"multipartFormDataParser");function mTs(t,e){t[e.position]===59&&e.position++,hw(c=>c===32||c===9,t,e);let r=hw(c=>Mrr(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 eb("unknown encoding, expected utf-8''");s=decodeURIComponent(Drr.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 eb("Closing quote not found");e.position++,s=Drr.decode(c).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=hw(l=>Mrr(l)&&l!==59,t,e);s=Drr.decode(c)}return{name:n,value:s,extended:o}}a(mTs,"parseContentDispositionAttribute");function gTs(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 eb("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=Nrr(c,!0,!0,l=>l===9||l===32),!cTs.test(c.toString()))throw eb("header name does not match the field-name token production");if(t[e.position]!==58)throw eb("expected :");switch(e.position++,hw(l=>l===32||l===9,t,e),aTs(c)){case"content-disposition":{r=n=null;let l=!1;if(hw(d=>Mrr(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw eb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Nrr(l,!1,!0,u=>u===9||u===32),o=HFn(l);break}case"content-transfer-encoding":{let l=hw(u=>u!==10&&u!==13,t,e);l=Nrr(l,!1,!0,u=>u===9||u===32),s=HFn(l);break}default:hw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw eb("expected CRLF");e.position+=2}}a(gTs,"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(Nrr,"removeChars");function ATs(t,e,r){if(t.length{"use strict";p();function _Ts(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(_Ts,"createDeferredPromise");VFn.exports={createDeferredPromise:_Ts}});var ife=I((Gef,JFn)=>{"use strict";p();var Lrr=Do(),{ReadableStreamFrom:CTs,readableStreamClose:vTs,fullyReadBody:bTs,extractMimeType:STs}=iT(),{FormData:WFn,setFormDataState:TTs}=yit(),{webidl:YP}=xA(),Orr=require("node:assert"),{isErrored:Brr,isDisturbed:ITs}=require("node:stream"),{isUint8Array:xTs}=require("node:util/types"),{serializeAMimeType:wTs}=pw(),{multipartFormDataParser:RTs}=$Fn(),{createDeferredPromise:kTs}=nke(),{parseJSONFromBytes:PTs}=fF(),{utf8DecodeBytes:DTs}=fit(),{runtimeFeatures:NTs}=pF(),MTs=NTs.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Eit=new TextEncoder;function OTs(){}a(OTs,"noop");var BTs=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!ITs(e)&&!Brr(e)&&e.cancel("Response object has been garbage collected").catch(OTs)});function YFn(t,e=!1){let r=null,n=null;YP.is.ReadableStream(t)?r=t:YP.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Orr(YP.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(YP.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(YP.is.BufferSource(t))s=YP.util.getCopyOfBytesHeldByBufferSource(t);else if(YP.is.FormData(t)){let d=`----formdata-undici-0${`${MTs(1e11)}`.padStart(11,"0")}`,f=`--${d}\r +`,s};nnt.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=Zh.util.createBuffer();return Ide(n,r),FO(n,t.e),FO(n,t.n),r+" "+Zh.util.encode64(n.bytes())+" "+e};nnt.privateKeyToOpenSSH=function(t,e){return e?Zh.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):Zh.pki.privateKeyToPem(t)};nnt.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||Zh.md.md5.create(),n="ssh-rsa",o=Zh.util.createBuffer();Ide(o,n),FO(o,t.e),FO(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 FO(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=Zh.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(FO,"_addBigIntegerToBuffer");function Ide(t,e){t.putInt32(e.length),t.putString(e)}a(Ide,"_addStringToBuffer");function rnt(){for(var t=Zh.md.sha1.create(),e=arguments.length,r=0;r{p();A4n.exports=ls();Dq();L5n();Qk();xrt();iRe();t4n();hde();o4n();l4n();d4n();gXt();Frt();aJ();uXt();EXt();h4n();vXt();fXt();rXt();$rt();Xx();oXt();g4n();xXt();rc()});var v4n=I(mJ=>{"use strict";p();Object.defineProperty(mJ,"__esModule",{value:!0});mJ.convert=mJ.Format=void 0;var gRe=y4n(),qq;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(qq=mJ.Format||(mJ.Format={}));function E4n(t){var e=gRe.pki.pemToDer(t),r=gRe.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(E4n,"myASN");function fys(t){var e=E4n(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(fys,"txtFormat");function _4n(t,e){switch(e){case qq.der:return gRe.pki.pemToDer(t);case qq.pem:return t;case qq.txt:return fys(t);case qq.asn1:return E4n(t);case qq.fingerprint:var r=gRe.md.sha1.create(),n=_4n(t,qq.der);return r.update(n.getBytes()),r.digest().toHex();case qq.x509:return gRe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(_4n,"convert");mJ.convert=_4n});var x4n=I(VC=>{"use strict";p();var jq=VC&&VC.__assign||function(){return jq=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})(GXt.Agent),(0,b4n.setGlobalDispatcher)(new b4n.Agent({connect:{ca:e}}))}},"addToGlobalAgent");VC.addToGlobalAgent=hys});var w4n=I((IVd,$Xt)=>{p();function mys(){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(mys,"all");process.platform!=="win32"?$Xt.exports.all=()=>[]:$Xt.exports.all=mys});var tl=I((NVd,M4n)=>{"use strict";p();M4n.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 ser=I((OVd,F4n)=>{"use strict";p();var wde=0,eer=1e3,ter=(eer>>1)-1,Hq,rer=Symbol("kFastTimer"),J3=[],ner=-2,ier=-1,B4n=0,O4n=1;function oer(){wde+=ter;let t=0,e=J3.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=ier,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===ier?(r._state=ner,--e!==0&&(J3[t]=J3[e])):++t}J3.length=e,J3.length!==0&&L4n()}a(oer,"onTick");function L4n(){Hq?.refresh?Hq.refresh():(clearTimeout(Hq),Hq=setTimeout(oer,ter),Hq?.unref())}a(L4n,"refreshTimeout");var lnt=class{static{a(this,"FastTimer")}[rer]=!0;_state=ner;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===ner&&J3.push(this),(!Hq||J3.length===1)&&L4n(),this._state=B4n}clear(){this._state=ier,this._idleStart=-1}};F4n.exports={setTimeout(t,e,r){return e<=eer?setTimeout(t,e,r):new lnt(t,e,r)},clearTimeout(t){t[rer]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new lnt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return wde},tick(t=0){wde+=t-eer+1,oer(),oer()},reset(){wde=0,J3.length=0,clearTimeout(Hq),Hq=null},kFastTimer:rer}});var so=I((FVd,lBn)=>{"use strict";p();var U4n=Symbol.for("undici.error.UND_ERR"),rd=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[U4n]===!0}get[U4n](){return!0}},Q4n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),aer=class extends rd{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[Q4n]===!0}get[Q4n](){return!0}},q4n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),cer=class extends rd{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[q4n]===!0}get[q4n](){return!0}},j4n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),ler=class extends rd{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[j4n]===!0}get[j4n](){return!0}},H4n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),uer=class extends rd{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[H4n]===!0}get[H4n](){return!0}},G4n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),der=class extends rd{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[G4n]===!0}get[G4n](){return!0}},$4n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),fer=class extends rd{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[$4n]===!0}get[$4n](){return!0}},V4n=Symbol.for("undici.error.UND_ERR_ABORT"),unt=class extends rd{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[V4n]===!0}get[V4n](){return!0}},W4n=Symbol.for("undici.error.UND_ERR_ABORTED"),per=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[W4n]===!0}get[W4n](){return!0}},z4n=Symbol.for("undici.error.UND_ERR_INFO"),her=class extends rd{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[z4n]===!0}get[z4n](){return!0}},Y4n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),mer=class extends rd{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[Y4n]===!0}get[Y4n](){return!0}},K4n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),ger=class extends rd{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[K4n]===!0}get[K4n](){return!0}},J4n=Symbol.for("undici.error.UND_ERR_DESTROYED"),Aer=class extends rd{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[J4n]===!0}get[J4n](){return!0}},Z4n=Symbol.for("undici.error.UND_ERR_CLOSED"),yer=class extends rd{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[Z4n]===!0}get[Z4n](){return!0}},X4n=Symbol.for("undici.error.UND_ERR_SOCKET"),Eer=class extends rd{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[X4n]===!0}get[X4n](){return!0}},eBn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),_er=class extends rd{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[eBn]===!0}get[eBn](){return!0}},tBn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),ver=class extends rd{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[tBn]===!0}get[tBn](){return!0}},rBn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Cer=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[rBn]===!0}get[rBn](){return!0}},nBn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),ber=class extends rd{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[nBn]===!0}get[nBn](){return!0}},iBn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Ser=class extends rd{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[iBn]===!0}get[iBn](){return!0}},oBn=Symbol.for("undici.error.UND_ERR_RESPONSE"),Ter=class extends rd{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[oBn]===!0}get[oBn](){return!0}},sBn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Ier=class extends rd{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[sBn]===!0}get[sBn](){return!0}},aBn=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),xer=class extends rd{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[aBn]===!0}get[aBn](){return!0}},wer=class extends rd{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},cBn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),Rer=class extends rd{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[cBn]===!0}get[cBn](){return!0}};lBn.exports={AbortError:unt,HTTPParserError:Cer,UndiciError:rd,HeadersTimeoutError:cer,HeadersOverflowError:ler,BodyTimeoutError:uer,RequestContentLengthMismatchError:mer,ConnectTimeoutError:aer,InvalidArgumentError:der,InvalidReturnValueError:fer,RequestAbortedError:per,ClientDestroyedError:Aer,ClientClosedError:yer,InformationalError:her,SocketError:Eer,NotSupportedError:_er,ResponseContentLengthMismatchError:ger,BalancedPoolMissingUpstreamError:ver,ResponseExceededMaxSizeError:ber,RequestRetryError:Ser,ResponseError:Ter,SecureProxyConnectionError:Ier,MaxOriginsReachedError:xer,Socks5ProxyError:wer,MessageSizeExceededError:Rer}});var fnt=I((qVd,dBn)=>{"use strict";p();var Per=["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"],dnt={};Object.setPrototypeOf(dnt,null);var uBn={};Object.setPrototypeOf(uBn,null);function Ays(t){let e=uBn[t];return e===void 0&&(e=Buffer.from(t)),e}a(Ays,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:fBn,headerNameLowerCasedRecord:yys}=fnt(),ker=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 ARe=require("node:assert"),{kDestroyed:EBn,kBodyUsed:Rde,kListeners:mnt,kBody:gBn}=tl(),{IncomingMessage:Eys}=require("node:http"),_Bn=require("node:stream"),_ys=require("node:net"),{stringify:vys}=require("node:querystring"),{EventEmitter:Cys}=require("node:events"),hnt=ser(),{InvalidArgumentError:yg,ConnectTimeoutError:bys}=so(),{headerNameLowerCasedRecord:Sys}=fnt(),{tree:vBn}=mBn(),[Tys,Iys]=process.versions.node.split(".",2).map(t=>Number(t)),Ant=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[gBn]=e,this[Rde]=!1}async*[Symbol.asyncIterator](){ARe(!this[Rde],"disturbed"),this[Rde]=!0,yield*this[gBn]}};function ABn(){}a(ABn,"noop");function xys(t){return ynt(t)?(xBn(t)===0&&t.on("data",function(){ARe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Rde]=!1,Cys.prototype.on.call(t,"data",function(){this[Rde]=!0})),t):t&&typeof t.pipeTo=="function"?new Ant(t):t&&DBn(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&IBn(t)?new Ant(t):t}a(xys,"wrapRequestBody");function ynt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(ynt,"isStream");function CBn(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(CBn,"isBlobLike");function bBn(t){return t.includes("?")||t.includes("#")}a(bBn,"pathHasQueryOrFragment");function wys(t,e){if(bBn(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=vys(e);return r&&(t+="?"+r),t}a(wys,"serializePathWithQuery");function SBn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(SBn,"isValidPort");function gnt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(gnt,"isHttpOrHttpsPrefixed");function TBn(t){if(typeof t=="string"){if(t=new URL(t),!gnt(t.origin||t.protocol))throw new yg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new yg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&SBn(t.port)===!1)throw new yg("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 yg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new yg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new yg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new yg("Invalid URL origin: the origin must be a string or null/undefined.");if(!gnt(t.origin||t.protocol))throw new yg("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(!gnt(t.origin||t.protocol))throw new yg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(TBn,"parseURL");function Rys(t){if(t=TBn(t),t.pathname!=="/"||t.search||t.hash)throw new yg("invalid url");return t}a(Rys,"parseOrigin");function Pys(t){if(t[0]==="["){let r=t.indexOf("]");return ARe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Pys,"getHostname");function kys(t){if(!t)return null;ARe(typeof t=="string");let e=Pys(t);return _ys.isIP(e)?"":e}a(kys,"getServerName");function Dys(t){return JSON.parse(JSON.stringify(t))}a(Dys,"deepClone");function Nys(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Nys,"isAsyncIterable");function IBn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(IBn,"isIterable");function Mys(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(Mys,"hasSafeIterator");function xBn(t){if(t==null)return 0;if(ynt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(CBn(t))return t.size!=null?t.size:null;if(kBn(t))return t.byteLength}return null}a(xBn,"bodyLength");function wBn(t){return t&&!!(t.destroyed||t[EBn]||_Bn.isDestroyed?.(t))}a(wBn,"isDestroyed");function RBn(t,e){t==null||!ynt(t)||wBn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Eys&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[EBn]=!0))}a(RBn,"destroy");var Oys=/timeout=(\d+)/;function Bys(t){let e=t.match(Oys);return e?parseInt(e[1],10)*1e3:null}a(Bys,"parseKeepAliveTimeout");function PBn(t){return typeof t=="string"?Sys[t]??t.toLowerCase():vBn.lookup(t)??t.toString("latin1").toLowerCase()}a(PBn,"headerNameToString");function Lys(t){return vBn.lookup(t)??t.toString("latin1").toLowerCase()}a(Lys,"bufferToLowerCasedHeaderName");function Fys(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(Fys,"parseHeaders");function Uys(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(Qys,"encodeRawHeaders");function kBn(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(kBn,"isBuffer");function qys(t,e,r){if(!t||typeof t!="object")throw new yg("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new yg("invalid onConnect method");if(typeof t.onError!="function")throw new yg("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new yg("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new yg("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new yg("invalid onHeaders method");if(typeof t.onData!="function")throw new yg("invalid onData method");if(typeof t.onComplete!="function")throw new yg("invalid onComplete method")}}}a(qys,"assertRequestHandler");function jys(t){return!!(t&&(_Bn.isDisturbed(t)||t[Rde]))}a(jys,"isDisturbed");function Hys(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(Hys,"getSocketInfo");function Gys(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(Gys,"ReadableStreamFrom");function DBn(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(DBn,"isFormDataLike");function $ys(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($ys,"addAbortListener");var NBn=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 Vys(t){return NBn[t]===1}a(Vys,"isTokenCharCode");var Wys=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function zys(t){if(t.length>=12)return Wys.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return ABn;let r=null,n=null,o=hnt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>yBn(t.deref(),e))})},e.timeout);return()=>{hnt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return ABn;let r=null,n=hnt.setFastTimeout(()=>{r=setImmediate(()=>{yBn(t.deref(),e)})},e.timeout);return()=>{hnt.clearFastTimeout(n),clearImmediate(r)}};function yBn(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)`,RBn(t,new bys(r))}a(yBn,"onConnectTimeout");function nEs(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(nEs,"getProtocolFromUrlString");var MBn=Object.create(null);MBn.enumerable=!0;var Der={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},OBn={...Der,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Der,null);Object.setPrototypeOf(OBn,null);BBn.exports={kEnumerableProperty:MBn,isDisturbed:jys,isBlobLike:CBn,parseOrigin:Rys,parseURL:TBn,getServerName:kys,isStream:ynt,isIterable:IBn,hasSafeIterator:Mys,isAsyncIterable:Nys,isDestroyed:wBn,headerNameToString:PBn,bufferToLowerCasedHeaderName:Lys,addListener:Xys,removeAllListeners:eEs,errorRequest:tEs,parseRawHeaders:Uys,encodeRawHeaders:Qys,parseHeaders:Fys,parseKeepAliveTimeout:Bys,destroy:RBn,bodyLength:xBn,deepClone:Dys,ReadableStreamFrom:Gys,isBuffer:kBn,assertRequestHandler:qys,getSocketInfo:Hys,isFormDataLike:DBn,pathHasQueryOrFragment:bBn,serializePathWithQuery:wys,addAbortListener:$ys,isValidHTTPToken:zys,isValidHeaderValue:Kys,isTokenCharCode:Vys,parseRangeHeader:Zys,normalizedMethodRecordsBase:Der,normalizedMethodRecords:OBn,isValidPort:SBn,isHttpOrHttpsPrefixed:gnt,nodeMajor:Tys,nodeMinor:Iys,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:xys,setupConnectTimeout:rEs,getProtocolFromUrlString:nEs}});var Oer=I((KVd,qBn)=>{"use strict";p();var{kConnected:LBn,kPending:FBn,kRunning:UBn,kSize:QBn,kFree:iEs,kQueued:oEs}=tl(),Ner=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[LBn],this.pending=e[FBn],this.running=e[UBn],this.size=e[QBn]}},Mer=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[LBn],this.free=e[iEs],this.pending=e[FBn],this.queued=e[oEs],this.running=e[UBn],this.size=e[QBn]}};qBn.exports={ClientStats:Ner,PoolStats:Mer}});var Gq=I((XVd,HBn)=>{"use strict";p();var rl=require("node:diagnostics_channel"),Uer=require("node:util"),gJ=Uer.debuglog("undici"),yRe=Uer.debuglog("fetch"),Ent=Uer.debuglog("websocket"),YS={beforeConnect:rl.channel("undici:client:beforeConnect"),connected:rl.channel("undici:client:connected"),connectError:rl.channel("undici:client:connectError"),sendHeaders:rl.channel("undici:client:sendHeaders"),create:rl.channel("undici:request:create"),bodySent:rl.channel("undici:request:bodySent"),bodyChunkSent:rl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:rl.channel("undici:request:bodyChunkReceived"),headers:rl.channel("undici:request:headers"),trailers:rl.channel("undici:request:trailers"),error:rl.channel("undici:request:error"),open:rl.channel("undici:websocket:open"),close:rl.channel("undici:websocket:close"),socketError:rl.channel("undici:websocket:socket_error"),ping:rl.channel("undici:websocket:ping"),pong:rl.channel("undici:websocket:pong"),proxyConnected:rl.channel("undici:proxy:connected")},Ber=!1;function jBn(t=gJ){if(!Ber){if(YS.beforeConnect.hasSubscribers||YS.connected.hasSubscribers||YS.connectError.hasSubscribers||YS.sendHeaders.hasSubscribers){Ber=!0;return}Ber=!0,rl.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)}),rl.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)}),rl.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)}),rl.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(jBn,"trackClientEvents");var Ler=!1;function sEs(t=gJ){if(!Ler){if(YS.headers.hasSubscribers||YS.trailers.hasSubscribers||YS.error.hasSubscribers){Ler=!0;return}Ler=!0,rl.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)}),rl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),rl.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(sEs,"trackRequestEvents");var Fer=!1;function aEs(t=Ent){if(!Fer){if(YS.open.hasSubscribers||YS.close.hasSubscribers||YS.socketError.hasSubscribers||YS.ping.hasSubscribers||YS.pong.hasSubscribers){Fer=!0;return}Fer=!0,rl.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")}),rl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),rl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),rl.subscribe("undici:websocket:ping",e=>{t("ping received")}),rl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(aEs,"trackWebSocketEvents");(gJ.enabled||yRe.enabled)&&(jBn(yRe.enabled?yRe:gJ),sEs(yRe.enabled?yRe:gJ));Ent.enabled&&(jBn(gJ.enabled?gJ:Ent),aEs(Ent));HBn.exports={channels:YS}});var VBn=I((rWd,$Bn)=>{"use strict";p();var{InvalidArgumentError:Lc,NotSupportedError:cEs}=so(),UO=require("node:assert"),{isValidHTTPToken:Qer,isValidHeaderValue:qer,isStream:lEs,destroy:uEs,isBuffer:dEs,isFormDataLike:fEs,isIterable:pEs,hasSafeIterator:hEs,isBlobLike:mEs,serializePathWithQuery:gEs,assertRequestHandler:AEs,getServerName:yEs,normalizedMethodRecords:EEs,getProtocolFromUrlString:_Es}=Po(),{channels:WC}=Gq(),{headerNameLowerCasedRecord:GBn}=fnt(),vEs=/[^\u0021-\u00ff]/;function CEs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(CEs,"isValidContentLengthHeaderValue");var ow=Symbol("handler"),jer=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 Lc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Lc("path must be an absolute URL or start with a slash");if(vEs.test(r))throw new Lc("invalid request path");if(typeof n!="string")throw new Lc("method must be a string");if(EEs[n]===void 0&&!Qer(n))throw new Lc("invalid request method");if(d&&typeof d!="string")throw new Lc("upgrade must be a string");if(d&&!qer(d))throw new Lc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Lc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Lc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Lc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Lc("invalid expectContinue");if(y!=null)throw new Lc("invalid throwOnError");if(E!=null&&E!==0)throw new Lc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Lc("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(lEs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){uEs(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(dEs(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(fEs(o)||pEs(o)||mEs(o))this.body=o;else throw new Lc("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?gEs(r,c):r,this.origin=e,this.protocol=_Es(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 Lc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:bEs}=so();zBn.exports=class WBn{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new WBn(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"),Her(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"),Her(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"),Her(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new bEs("invalid onError method");this.#e.onError?.(r)}};function Her(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(Her,"toRawHeaderValue")});var _Re=I((cWd,YBn)=>{"use strict";p();var SEs=require("node:events"),TEs=ERe(),IEs=a(t=>(e,r)=>t(e,TEs.wrap(r)),"wrapInterceptor"),Ger=class extends SEs{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=IEs(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")})}};YBn.exports=Ger});var ZBn=I((dWd,JBn)=>{"use strict";p();var{parseHeaders:$er}=Po(),{InvalidArgumentError:xEs}=so(),Ver=Symbol("resume"),Wer=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[Ver]=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[Ver]?.())}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}};JBn.exports=class KBn{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new KBn(e):e}onConnect(e,r){this.#t=new Wer(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#e.onRequestUpgrade?.(this.#t,e,$er(r),n)}onHeaders(e,r,n,o){return this.#t[Ver]=n,this.#e.onResponseStart?.(this.#t,e,$er(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#e.onResponseEnd?.(this.#t,$er(e))}onError(e){if(!this.#e.onResponseError)throw new xEs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var yJ=I((hWd,XBn)=>{"use strict";p();var wEs=_Re(),REs=ZBn(),{ClientDestroyedError:zer,ClientClosedError:PEs,InvalidArgumentError:vnt}=so(),{kDestroy:kEs,kClose:DEs,kClosed:vRe,kDestroyed:Pde,kDispatch:NEs}=tl(),$q=Symbol("onDestroyed"),AJ=Symbol("onClosed"),Yer=class extends wEs{static{a(this,"DispatcherBase")}[Pde]=!1;[$q]=null;[vRe]=!1;[AJ]=null;get destroyed(){return this[Pde]}get closed(){return this[vRe]}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 vnt("invalid callback");if(this[Pde]){let n=new zer;queueMicrotask(()=>e(n,null));return}if(this[vRe]){this[AJ]?this[AJ].push(e):queueMicrotask(()=>e(null,null));return}this[vRe]=!0,this[AJ]??=[],this[AJ].push(e);let r=a(()=>{let n=this[AJ];this[AJ]=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 vnt("invalid callback");if(this[Pde]){this[$q]?this[$q].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new zer),this[Pde]=!0,this[$q]??=[],this[$q].push(r);let n=a(()=>{let o=this[$q];this[$q]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new vnt("handler must be an object");r=REs.unwrap(r);try{if(!e||typeof e!="object")throw new vnt("opts must be an object.");if(this[Pde]||this[$q])throw new zer;if(this[vRe])throw new PEs;return this[NEs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};XBn.exports=Yer});var EJ=I((yWd,rLn)=>{"use strict";p();var MEs=require("node:net"),eLn=require("node:assert"),tLn=Po(),{InvalidArgumentError:OEs}=so(),Ker,BEs=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 LEs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new OEs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new BEs(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:"){Ker||(Ker=require("node:tls")),A=A||l.servername||tLn.getServerName(h)||null;let T=A||f;eLn(T);let w=s||u.get(T)||null;g=g||443,v=Ker.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 eLn(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=MEs.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=tLn.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(LEs,"buildConnector");rLn.exports=LEs});var nLn=I(Jer=>{"use strict";p();Object.defineProperty(Jer,"__esModule",{value:!0});Jer.enumToMap=FEs;function FEs(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(FEs,"enumToMap")});var iLn=I(Qe=>{"use strict";p();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.SPECIAL_HEADERS=Qe.MINOR=Qe.MAJOR=Qe.HTAB_SP_VCHAR_OBS_TEXT=Qe.QUOTED_STRING=Qe.CONNECTION_TOKEN_CHARS=Qe.HEADER_CHARS=Qe.TOKEN=Qe.HEX=Qe.URL_CHAR=Qe.USERINFO_CHARS=Qe.MARK=Qe.ALPHANUM=Qe.NUM=Qe.HEX_MAP=Qe.NUM_MAP=Qe.ALPHA=Qe.STATUSES_HTTP=Qe.H_METHOD_MAP=Qe.METHOD_MAP=Qe.METHODS_RTSP=Qe.METHODS_ICE=Qe.METHODS_HTTP=Qe.HEADER_STATE=Qe.FINISH=Qe.STATUSES=Qe.METHODS=Qe.LENIENT_FLAGS=Qe.FLAGS=Qe.TYPE=Qe.ERROR=void 0;var UEs=nLn();Qe.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};Qe.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};Qe.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};Qe.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};Qe.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};Qe.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};Qe.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};Qe.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};Qe.METHODS_HTTP=[Qe.METHODS.DELETE,Qe.METHODS.GET,Qe.METHODS.HEAD,Qe.METHODS.POST,Qe.METHODS.PUT,Qe.METHODS.CONNECT,Qe.METHODS.OPTIONS,Qe.METHODS.TRACE,Qe.METHODS.COPY,Qe.METHODS.LOCK,Qe.METHODS.MKCOL,Qe.METHODS.MOVE,Qe.METHODS.PROPFIND,Qe.METHODS.PROPPATCH,Qe.METHODS.SEARCH,Qe.METHODS.UNLOCK,Qe.METHODS.BIND,Qe.METHODS.REBIND,Qe.METHODS.UNBIND,Qe.METHODS.ACL,Qe.METHODS.REPORT,Qe.METHODS.MKACTIVITY,Qe.METHODS.CHECKOUT,Qe.METHODS.MERGE,Qe.METHODS["M-SEARCH"],Qe.METHODS.NOTIFY,Qe.METHODS.SUBSCRIBE,Qe.METHODS.UNSUBSCRIBE,Qe.METHODS.PATCH,Qe.METHODS.PURGE,Qe.METHODS.MKCALENDAR,Qe.METHODS.LINK,Qe.METHODS.UNLINK,Qe.METHODS.PRI,Qe.METHODS.SOURCE,Qe.METHODS.QUERY];Qe.METHODS_ICE=[Qe.METHODS.SOURCE];Qe.METHODS_RTSP=[Qe.METHODS.OPTIONS,Qe.METHODS.DESCRIBE,Qe.METHODS.ANNOUNCE,Qe.METHODS.SETUP,Qe.METHODS.PLAY,Qe.METHODS.PAUSE,Qe.METHODS.TEARDOWN,Qe.METHODS.GET_PARAMETER,Qe.METHODS.SET_PARAMETER,Qe.METHODS.REDIRECT,Qe.METHODS.RECORD,Qe.METHODS.FLUSH,Qe.METHODS.GET,Qe.METHODS.POST];Qe.METHOD_MAP=(0,UEs.enumToMap)(Qe.METHODS);Qe.H_METHOD_MAP=Object.fromEntries(Object.entries(Qe.METHODS).filter(([t])=>t.startsWith("H")));Qe.STATUSES_HTTP=[Qe.STATUSES.CONTINUE,Qe.STATUSES.SWITCHING_PROTOCOLS,Qe.STATUSES.PROCESSING,Qe.STATUSES.EARLY_HINTS,Qe.STATUSES.RESPONSE_IS_STALE,Qe.STATUSES.REVALIDATION_FAILED,Qe.STATUSES.DISCONNECTED_OPERATION,Qe.STATUSES.HEURISTIC_EXPIRATION,Qe.STATUSES.MISCELLANEOUS_WARNING,Qe.STATUSES.OK,Qe.STATUSES.CREATED,Qe.STATUSES.ACCEPTED,Qe.STATUSES.NON_AUTHORITATIVE_INFORMATION,Qe.STATUSES.NO_CONTENT,Qe.STATUSES.RESET_CONTENT,Qe.STATUSES.PARTIAL_CONTENT,Qe.STATUSES.MULTI_STATUS,Qe.STATUSES.ALREADY_REPORTED,Qe.STATUSES.TRANSFORMATION_APPLIED,Qe.STATUSES.IM_USED,Qe.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,Qe.STATUSES.MULTIPLE_CHOICES,Qe.STATUSES.MOVED_PERMANENTLY,Qe.STATUSES.FOUND,Qe.STATUSES.SEE_OTHER,Qe.STATUSES.NOT_MODIFIED,Qe.STATUSES.USE_PROXY,Qe.STATUSES.SWITCH_PROXY,Qe.STATUSES.TEMPORARY_REDIRECT,Qe.STATUSES.PERMANENT_REDIRECT,Qe.STATUSES.BAD_REQUEST,Qe.STATUSES.UNAUTHORIZED,Qe.STATUSES.PAYMENT_REQUIRED,Qe.STATUSES.FORBIDDEN,Qe.STATUSES.NOT_FOUND,Qe.STATUSES.METHOD_NOT_ALLOWED,Qe.STATUSES.NOT_ACCEPTABLE,Qe.STATUSES.PROXY_AUTHENTICATION_REQUIRED,Qe.STATUSES.REQUEST_TIMEOUT,Qe.STATUSES.CONFLICT,Qe.STATUSES.GONE,Qe.STATUSES.LENGTH_REQUIRED,Qe.STATUSES.PRECONDITION_FAILED,Qe.STATUSES.PAYLOAD_TOO_LARGE,Qe.STATUSES.URI_TOO_LONG,Qe.STATUSES.UNSUPPORTED_MEDIA_TYPE,Qe.STATUSES.RANGE_NOT_SATISFIABLE,Qe.STATUSES.EXPECTATION_FAILED,Qe.STATUSES.IM_A_TEAPOT,Qe.STATUSES.PAGE_EXPIRED,Qe.STATUSES.ENHANCE_YOUR_CALM,Qe.STATUSES.MISDIRECTED_REQUEST,Qe.STATUSES.UNPROCESSABLE_ENTITY,Qe.STATUSES.LOCKED,Qe.STATUSES.FAILED_DEPENDENCY,Qe.STATUSES.TOO_EARLY,Qe.STATUSES.UPGRADE_REQUIRED,Qe.STATUSES.PRECONDITION_REQUIRED,Qe.STATUSES.TOO_MANY_REQUESTS,Qe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,Qe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,Qe.STATUSES.LOGIN_TIMEOUT,Qe.STATUSES.NO_RESPONSE,Qe.STATUSES.RETRY_WITH,Qe.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,Qe.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,Qe.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,Qe.STATUSES.INVALID_X_FORWARDED_FOR,Qe.STATUSES.REQUEST_HEADER_TOO_LARGE,Qe.STATUSES.SSL_CERTIFICATE_ERROR,Qe.STATUSES.SSL_CERTIFICATE_REQUIRED,Qe.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,Qe.STATUSES.INVALID_TOKEN,Qe.STATUSES.CLIENT_CLOSED_REQUEST,Qe.STATUSES.INTERNAL_SERVER_ERROR,Qe.STATUSES.NOT_IMPLEMENTED,Qe.STATUSES.BAD_GATEWAY,Qe.STATUSES.SERVICE_UNAVAILABLE,Qe.STATUSES.GATEWAY_TIMEOUT,Qe.STATUSES.HTTP_VERSION_NOT_SUPPORTED,Qe.STATUSES.VARIANT_ALSO_NEGOTIATES,Qe.STATUSES.INSUFFICIENT_STORAGE,Qe.STATUSES.LOOP_DETECTED,Qe.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,Qe.STATUSES.NOT_EXTENDED,Qe.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,Qe.STATUSES.WEB_SERVER_UNKNOWN_ERROR,Qe.STATUSES.WEB_SERVER_IS_DOWN,Qe.STATUSES.CONNECTION_TIMEOUT,Qe.STATUSES.ORIGIN_IS_UNREACHABLE,Qe.STATUSES.TIMEOUT_OCCURED,Qe.STATUSES.SSL_HANDSHAKE_FAILED,Qe.STATUSES.INVALID_SSL_CERTIFICATE,Qe.STATUSES.RAILGUN_ERROR,Qe.STATUSES.SITE_IS_OVERLOADED,Qe.STATUSES.SITE_IS_FROZEN,Qe.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,Qe.STATUSES.NETWORK_READ_TIMEOUT,Qe.STATUSES.NETWORK_CONNECT_TIMEOUT];Qe.ALPHA=[];for(let t=65;t<=90;t++)Qe.ALPHA.push(String.fromCharCode(t)),Qe.ALPHA.push(String.fromCharCode(t+32));Qe.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Qe.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};Qe.NUM=["0","1","2","3","4","5","6","7","8","9"];Qe.ALPHANUM=Qe.ALPHA.concat(Qe.NUM);Qe.MARK=["-","_",".","!","~","*","'","(",")"];Qe.USERINFO_CHARS=Qe.ALPHANUM.concat(Qe.MARK).concat(["%",";",":","&","=","+","$",","]);Qe.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Qe.ALPHANUM);Qe.HEX=Qe.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Qe.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Qe.ALPHANUM);Qe.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Qe.HEADER_CHARS.push(t);Qe.CONNECTION_TOKEN_CHARS=Qe.HEADER_CHARS.filter(t=>t!==44);Qe.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&Qe.QUOTED_STRING.push(t);Qe.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)Qe.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)Qe.HTAB_SP_VCHAR_OBS_TEXT.push(t);Qe.MAJOR=Qe.NUM_MAP;Qe.MINOR=Qe.MAJOR;Qe.SPECIAL_HEADERS={connection:Qe.HEADER_STATE.CONNECTION,"content-length":Qe.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":Qe.HEADER_STATE.CONNECTION,"transfer-encoding":Qe.HEADER_STATE.TRANSFER_ENCODING,upgrade:Qe.HEADER_STATE.UPGRADE};Qe.default={ERROR:Qe.ERROR,TYPE:Qe.TYPE,FLAGS:Qe.FLAGS,LENIENT_FLAGS:Qe.LENIENT_FLAGS,METHODS:Qe.METHODS,STATUSES:Qe.STATUSES,FINISH:Qe.FINISH,HEADER_STATE:Qe.HEADER_STATE,ALPHA:Qe.ALPHA,NUM_MAP:Qe.NUM_MAP,HEX_MAP:Qe.HEX_MAP,NUM:Qe.NUM,ALPHANUM:Qe.ALPHANUM,MARK:Qe.MARK,USERINFO_CHARS:Qe.USERINFO_CHARS,URL_CHAR:Qe.URL_CHAR,HEX:Qe.HEX,TOKEN:Qe.TOKEN,HEADER_CHARS:Qe.HEADER_CHARS,CONNECTION_TOKEN_CHARS:Qe.CONNECTION_TOKEN_CHARS,QUOTED_STRING:Qe.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:Qe.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:Qe.MAJOR,MINOR:Qe.MINOR,SPECIAL_HEADERS:Qe.SPECIAL_HEADERS,METHODS_HTTP:Qe.METHODS_HTTP,METHODS_ICE:Qe.METHODS_ICE,METHODS_RTSP:Qe.METHODS_RTSP,METHOD_MAP:Qe.METHOD_MAP,H_METHOD_MAP:Qe.H_METHOD_MAP,STATUSES_HTTP:Qe.STATUSES_HTTP}});var Xer=I((IWd,oLn)=>{"use strict";p();var{Buffer:QEs}=require("node:buffer"),qEs="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==",Zer;Object.defineProperty(oLn,"exports",{get:a(()=>Zer||(Zer=QEs.from(qEs,"base64")),"get")})});var aLn=I((RWd,sLn)=>{"use strict";p();var{Buffer:jEs}=require("node:buffer"),HEs="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==",etr;Object.defineProperty(sLn,"exports",{get:a(()=>etr||(etr=jEs.from(HEs,"base64")),"get")})});var CRe=I((DWd,mLn)=>{"use strict";p();var cLn=["GET","HEAD","POST"],GEs=new Set(cLn),$Es=[101,204,205,304],lLn=[301,302,303,307,308],VEs=new Set(lLn),uLn=["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"],WEs=new Set(uLn),dLn=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],zEs=["",...dLn],YEs=new Set(dLn),KEs=["follow","manual","error"],fLn=["GET","HEAD","OPTIONS","TRACE"],JEs=new Set(fLn),ZEs=["navigate","same-origin","no-cors","cors"],XEs=["omit","same-origin","include"],e_s=["default","no-store","reload","no-cache","force-cache","only-if-cached"],t_s=["content-encoding","content-language","content-location","content-type","content-length"],r_s=["half"],pLn=["CONNECT","TRACE","TRACK"],n_s=new Set(pLn),hLn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],i_s=new Set(hLn);mLn.exports={subresource:hLn,forbiddenMethods:pLn,requestBodyHeader:t_s,referrerPolicy:zEs,requestRedirect:KEs,requestMode:ZEs,requestCredentials:XEs,requestCache:e_s,redirectStatus:lLn,corsSafeListedMethods:cLn,nullBodyStatus:$Es,safeMethods:fLn,badPorts:uLn,requestDuplex:r_s,subresourceSet:i_s,badPortsSet:WEs,redirectStatusSet:VEs,corsSafeListedMethodsSet:GEs,safeMethodsSet:JEs,forbiddenMethodsSet:n_s,referrerPolicyTokens:YEs}});var rtr=I((MWd,gLn)=>{"use strict";p();var ttr=Symbol.for("undici.globalOrigin.1");function o_s(){return globalThis[ttr]}a(o_s,"getGlobalOrigin");function s_s(t){if(t===void 0){Object.defineProperty(globalThis,ttr,{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,ttr,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(s_s,"setGlobalOrigin");gLn.exports={getGlobalOrigin:o_s,setGlobalOrigin:s_s}});var Cnt=I((LWd,ALn)=>{"use strict";p();var a_s=new TextDecoder;function c_s(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),a_s.decode(t))}a(c_s,"utf8DecodeBytes");ALn.exports={utf8DecodeBytes:c_s}});var Z3=I((QWd,vLn)=>{"use strict";p();var yLn=require("node:assert"),{utf8DecodeBytes:l_s}=Cnt();function u_s(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(h_s,"isomorphicDecode");var m_s=/[^\x00-\xFF]/;function g_s(t){return yLn(!m_s.test(t)),t}a(g_s,"isomorphicEncode");function A_s(t){return JSON.parse(l_s(t))}a(A_s,"parseJSONFromBytes");function y_s(t,e=!0,r=!0){return _Ln(t,e,r,ELn)}a(y_s,"removeASCIIWhitespace");function _Ln(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(_Ln,"removeChars");function E_s(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return yLn(typeof e=="string"),e}a(E_s,"serializeJavascriptValueToJSONString");vLn.exports={collectASequenceOfCodePoints:u_s,collectASequenceOfCodePointsFast:d_s,forgivingBase64:p_s,isASCIIWhitespace:ELn,isomorphicDecode:h_s,isomorphicEncode:g_s,parseJSONFromBytes:A_s,removeASCIIWhitespace:y_s,removeChars:_Ln,serializeJavascriptValueToJSONString:E_s}});var sw=I((HWd,xLn)=>{"use strict";p();var Snt=require("node:assert"),{forgivingBase64:__s,collectASequenceOfCodePoints:ntr,collectASequenceOfCodePointsFast:bRe,isomorphicDecode:v_s,removeASCIIWhitespace:C_s,removeChars:b_s}=Z3(),S_s=new TextEncoder,SRe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,T_s=/[\u000A\u000D\u0009\u0020]/u,I_s=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function x_s(t){Snt(t.protocol==="data:");let e=SLn(t,!0);e=e.slice(5);let r={position:0},n=bRe(",",e,r),o=n.length;if(n=C_s(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=TLn(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=v_s(c);if(c=__s(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=itr(n);return l==="failure"&&(l=itr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(x_s,"dataURLProcessor");function SLn(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(SLn,"URLSerializer");function TLn(t){let e=S_s.encode(t);return w_s(e)}a(TLn,"stringPercentDecode");function CLn(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(CLn,"isHexCharByte");function bLn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(bLn,"hexByteToNumber");function w_s(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=bRe(";",t,e);if(n=bnt(n,!1,!0),n.length===0||!SRe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionT_s.test(d),t,e);let l=ntr(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=ILn(t,e,!0),bRe(";",t,e);else if(u=bRe(";",t,e),u=bnt(u,!1,!0),u.length===0)continue;l.length!==0&&SRe.test(l)&&(u.length===0||I_s.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(itr,"parseMIMEType");function ILn(t,e,r=!1){let n=e.position,o="";for(Snt(t[e.position]==='"'),e.position++;o+=ntr(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{Snt(s==='"');break}}return r?o:t.slice(n,e.position)}a(ILn,"collectAnHTTPQuotedString");function R_s(t){Snt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",SRe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(R_s,"serializeAMimeType");function P_s(t){return t===13||t===10||t===9||t===32}a(P_s,"isHTTPWhiteSpace");function bnt(t,e=!0,r=!0){return b_s(t,e,r,P_s)}a(bnt,"removeHTTPWhitespace");function k_s(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(k_s,"minimizeSupportedMimeType");xLn.exports={dataURLProcessor:x_s,URLSerializer:SLn,stringPercentDecode:TLn,parseMIMEType:itr,collectAnHTTPQuotedString:ILn,serializeAMimeType:R_s,removeHTTPWhitespace:bnt,minimizeSupportedMimeType:k_s,HTTP_TOKEN_CODEPOINTS:SRe}});var X3=I((VWd,str)=>{"use strict";p();var wLn={__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 D_s(t){try{return wLn[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(D_s,"detectRuntimeFeatureByNodeModule");function N_s(t,e){return typeof wLn[t]()[e]<"u"}a(N_s,"detectRuntimeFeatureByExportedProperty");var RLn=["markAsUncloneable","zstd"],M_s={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},PLn=["crypto","sqlite"],O_s=[...PLn,...RLn];function B_s(t){if(PLn.includes(t))return D_s(`node:${t}`);if(RLn.includes(t)){let[e,r]=M_s[t];return N_s(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(B_s,"detectRuntimeFeature");var otr=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(O_s.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=B_s(e);return this.#e.set(e,r),r}},kLn=new otr;str.exports.runtimeFeatures=kLn;str.exports.default=kLn});var RA=I((YWd,NLn)=>{"use strict";p();var L_s=require("node:assert"),{types:ip,inspect:F_s}=require("node:util"),{runtimeFeatures:U_s}=X3(),atr=1,ctr=2,Tnt=3,Int=4,ltr=5,xnt=6,utr=7,KS=8,DLn=Function.call.bind(Function.prototype[Symbol.hasInstance]),lt={converters:{},util:{},errors:{},is:{}};lt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};lt.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 lt.errors.exception({header:t.prefix,message:r})};lt.errors.invalidArgument=function(t){return lt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};lt.brandCheck=function(t,e){if(!DLn(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};lt.brandCheckMultiple=function(t){let e=t.map(r=>lt.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};lt.argumentLengthCheck=function({length:t},e,r){if(tDLn(t,e)};lt.util.Type=function(t){switch(typeof t){case"undefined":return atr;case"boolean":return ctr;case"string":return Tnt;case"symbol":return Int;case"number":return ltr;case"bigint":return xnt;case"function":case"object":return t===null?utr:KS}};lt.util.Types={UNDEFINED:atr,BOOLEAN:ctr,STRING:Tnt,SYMBOL:Int,NUMBER:ltr,BIGINT:xnt,NULL:utr,OBJECT:KS};lt.util.TypeValueToString=function(t){switch(lt.util.Type(t)){case atr:return"Undefined";case ctr:return"Boolean";case Tnt:return"String";case Int:return"Symbol";case ltr:return"Number";case xnt:return"BigInt";case utr:return"Null";case KS:return"Object"}};lt.util.markAsUncloneable=U_s.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};lt.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),lt.util.HasFlag(n,lt.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw lt.errors.exception({header:"Integer conversion",message:`Could not convert ${lt.util.Stringify(t)} to an integer.`});if(c=lt.util.IntegerPart(c),co)throw lt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&<.util.HasFlag(n,lt.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=lt.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};lt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};lt.util.Stringify=function(t){switch(lt.util.Type(t)){case Int:return`Symbol(${t.description})`;case KS:return F_s(t);case Tnt:return`"${t}"`;case xnt:return`${t}n`;default:return`${t}`}};lt.util.IsResizableArrayBuffer=function(t){if(ip.isArrayBuffer(t))return t.resizable;if(ip.isSharedArrayBuffer(t))return t.growable;throw lt.errors.exception({header:"IsResizableArrayBuffer",message:`"${lt.util.Stringify(t)}" is not an array buffer.`})};lt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};lt.sequenceConverter=function(t){return(e,r,n,o)=>{if(lt.util.Type(e)!==KS)throw lt.errors.exception({header:r,message:`${n} (${lt.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 lt.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}};lt.recordConverter=function(t,e){return(r,n,o)=>{if(lt.util.Type(r)!==KS)throw lt.errors.exception({header:n,message:`${o} ("${lt.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!ip.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=lt.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}};lt.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw lt.errors.exception({header:n,message:`Expected ${o} ("${lt.util.Stringify(r)}") to be an instance of ${e}.`});return r}};lt.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&<.util.Type(e)!==KS)throw lt.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 lt.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 lt.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};lt.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};lt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};lt.is.ReadableStream=lt.util.MakeTypeAssertion(ReadableStream);lt.is.Blob=lt.util.MakeTypeAssertion(Blob);lt.is.URLSearchParams=lt.util.MakeTypeAssertion(URLSearchParams);lt.is.File=lt.util.MakeTypeAssertion(File);lt.is.URL=lt.util.MakeTypeAssertion(URL);lt.is.AbortSignal=lt.util.MakeTypeAssertion(AbortSignal);lt.is.MessagePort=lt.util.MakeTypeAssertion(MessagePort);lt.is.BufferSource=function(t){return ip.isArrayBuffer(t)||ArrayBuffer.isView(t)&&ip.isArrayBuffer(t.buffer)};lt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(ip.isTypedArray(e)||ip.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(L_s(ip.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};lt.converters.DOMString=function(t,e,r,n){if(t===null&<.util.HasFlag(n,lt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw lt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};lt.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw lt.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};lt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};lt.converters.boolean=function(t){return!!t};lt.converters.any=function(t){return t};lt.converters["long long"]=function(t,e,r){return lt.util.ConvertToInt(t,64,"signed",0,e,r)};lt.converters["unsigned long long"]=function(t,e,r){return lt.util.ConvertToInt(t,64,"unsigned",0,e,r)};lt.converters["unsigned long"]=function(t,e,r){return lt.util.ConvertToInt(t,32,"unsigned",0,e,r)};lt.converters["unsigned short"]=function(t,e,r,n){return lt.util.ConvertToInt(t,16,"unsigned",n,e,r)};lt.converters.ArrayBuffer=function(t,e,r,n){if(lt.util.Type(t)!==KS||!ip.isArrayBuffer(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t))throw lt.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};lt.converters.SharedArrayBuffer=function(t,e,r,n){if(lt.util.Type(t)!==KS||!ip.isSharedArrayBuffer(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t))throw lt.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};lt.converters.TypedArray=function(t,e,r,n,o){if(lt.util.Type(t)!==KS||!ip.isTypedArray(t)||t.constructor.name!==e.name)throw lt.errors.conversionFailed({prefix:r,argument:`${n} ("${lt.util.Stringify(t)}")`,types:[e.name]});if(!lt.util.HasFlag(o,lt.attributes.AllowShared)&&ip.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(o,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};lt.converters.DataView=function(t,e,r,n){if(lt.util.Type(t)!==KS||!ip.isDataView(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["DataView"]});if(!lt.util.HasFlag(n,lt.attributes.AllowShared)&&ip.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};lt.converters.ArrayBufferView=function(t,e,r,n){if(lt.util.Type(t)!==KS||!ip.isArrayBufferView(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!lt.util.HasFlag(n,lt.attributes.AllowShared)&&ip.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};lt.converters.BufferSource=function(t,e,r,n){if(ip.isArrayBuffer(t))return lt.converters.ArrayBuffer(t,e,r,n);if(ip.isArrayBufferView(t))return n&=~lt.attributes.AllowShared,lt.converters.ArrayBufferView(t,e,r,n);throw ip.isSharedArrayBuffer(t)?lt.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};lt.converters.AllowSharedBufferSource=function(t,e,r,n){if(ip.isArrayBuffer(t))return lt.converters.ArrayBuffer(t,e,r,n);if(ip.isSharedArrayBuffer(t))return lt.converters.SharedArrayBuffer(t,e,r,n);if(ip.isArrayBufferView(t))return n|=lt.attributes.AllowShared,lt.converters.ArrayBufferView(t,e,r,n);throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};lt.converters["sequence"]=lt.sequenceConverter(lt.converters.ByteString);lt.converters["sequence>"]=lt.sequenceConverter(lt.converters["sequence"]);lt.converters["record"]=lt.recordConverter(lt.converters.ByteString,lt.converters.ByteString);lt.converters.Blob=lt.interfaceConverter(lt.is.Blob,"Blob");lt.converters.AbortSignal=lt.interfaceConverter(lt.is.AbortSignal,"AbortSignal");lt.converters.EventHandlerNonNull=function(t){return lt.util.Type(t)!==KS?null:typeof t=="function"?t:()=>{}};lt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};NLn.exports={webidl:lt}});var JS=I((JWd,WLn)=>{"use strict";p();var{Transform:Q_s}=require("node:stream"),MLn=require("node:zlib"),{redirectStatusSet:q_s,referrerPolicyTokens:j_s,badPortsSet:H_s}=CRe(),{getGlobalOrigin:OLn}=rtr(),{collectAnHTTPQuotedString:G_s,parseMIMEType:$_s}=sw(),{performance:V_s}=require("node:perf_hooks"),{ReadableStreamFrom:W_s,isValidHTTPToken:BLn,normalizedMethodRecordsBase:z_s}=Po(),IRe=require("node:assert"),{isUint8Array:Y_s}=require("node:util/types"),{webidl:Vq}=RA(),{isomorphicEncode:dtr,collectASequenceOfCodePoints:_J,removeChars:K_s}=Z3();function LLn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(LLn,"responseURL");function J_s(t,e){if(!q_s.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&ULn(r)&&(FLn(r)||(r=Z_s(r)),r=new URL(r,LLn(t))),r&&!r.hash&&(r.hash=e),r}a(J_s,"responseLocationURL");function FLn(t){for(let e=0;e126||r<32)return!1}return!0}a(FLn,"isValidEncodedURL");function Z_s(t){return Buffer.from(t,"binary").toString("utf8")}a(Z_s,"normalizeBinaryStringToUtf8");function CJ(t){return t.urlList[t.urlList.length-1]}a(CJ,"requestCurrentURL");function X_s(t){let e=CJ(t);return $Ln(e)&&H_s.has(e.port)?"blocked":"allowed"}a(X_s,"requestBadPort");function evs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(evs,"isErrorLike");function tvs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(tvs,"isValidReasonPhrase");var rvs=BLn;function ULn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(ULn,"isValidHeaderValue");function nvs(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(j_s.has(o)){r=o;break}}return r}a(nvs,"parseReferrerPolicy");function ivs(t,e){let r=nvs(e);r!==""&&(t.referrerPolicy=r)}a(ivs,"setRequestReferrerPolicyOnRedirect");function ovs(){return"allowed"}a(ovs,"crossOriginResourcePolicyCheck");function svs(){return"success"}a(svs,"corsCheck");function avs(){return"success"}a(avs,"TAOCheck");function cvs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(cvs,"appendFetchMetadata");function lvs(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&&ptr(t.origin)&&!ptr(CJ(t))&&(e=null);break;case"same-origin":TRe(t,CJ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(lvs,"appendRequestOriginHeader");function kde(t,e){return t}a(kde,"coarsenTime");function uvs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??ftr(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=CJ(t);return vJ(n)&&!vJ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=CJ(t);return TRe(n,s)?n:vJ(n)&&!vJ(s)?"no-referrer":o}case"same-origin":return TRe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return TRe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=CJ(t);return vJ(n)&&!vJ(s)?"no-referrer":n}}}a(hvs,"determineRequestsReferrer");function ftr(t,e=!1){return IRe(Vq.is.URL(t)),t=new URL(t),GLn(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(ftr,"stripURLForReferrer");var mvs=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)$/),gvs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function qLn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),gvs(t)):mvs(t)}a(qLn,"isOriginIPPotentiallyTrustworthy");function Avs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||qLn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(Avs,"isOriginPotentiallyTrustworthy");function vJ(t){return Vq.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:Avs(t.origin):!1}a(vJ,"isURLPotentiallyTrustworthy");function yvs(t){}a(yvs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function TRe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(TRe,"sameOrigin");function Evs(t){return t.controller.state==="aborted"}a(Evs,"isAborted");function _vs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(_vs,"isCancelled");function vvs(t){return z_s[t.toLowerCase()]??t}a(vvs,"normalizeMethod");var Cvs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function jLn(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,Cvs),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(jLn,"createIterator");function bvs(t,e,r,n=0,o=1){let s=jLn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Vq.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Vq.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Vq.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Vq.brandCheck(this,e),Vq.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(bvs,"iteratorMixin");function Svs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();HLn(s,n,o)}catch(s){o(s)}}a(Svs,"fullyReadBody");function Tvs(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(Tvs,"readableStreamClose");async function HLn(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(!Y_s(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(HLn,"readAllBytes");function GLn(t){IRe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(GLn,"urlIsLocal");function ptr(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(ptr,"urlHasHttpsScheme");function $Ln(t){IRe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a($Ln,"urlIsHttpHttpsScheme");function Ivs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&_J(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&_J(u=>u===" "||u===" ",r,n);let o=_J(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&_J(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&_J(u=>u===" "||u===" ",r,n);let c=_J(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(Ivs,"simpleRangeHeaderValue");function xvs(t,e,r){let n="bytes ";return n+=dtr(`${t}`),n+="-",n+=dtr(`${e}`),n+="/",n+=dtr(`${r}`),n}a(xvs,"buildContentRange");var htr=class extends Q_s{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?MLn.createInflate(this.#e):MLn.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 wvs(t){return new htr(t)}a(wvs,"createInflate");function Rvs(t){let e=null,r=null,n=null,o=VLn("content-type",t);if(o===null)return"failure";for(let s of o){let c=$_s(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(Rvs,"extractMimeType");function Pvs(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(Pvs,"gettingDecodingSplitting");function VLn(t,e){let r=e.get(t,!0);return r===null?null:Pvs(r)}a(VLn,"getDecodeSplit");function kvs(t){return!1}a(kvs,"hasAuthenticationEntry");function Dvs(t){return!!(t.username||t.password)}a(Dvs,"includesCredentials");function Nvs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(Nvs,"isTraversableNavigable");var mtr=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return OLn()}get origin(){return this.baseUrl?.origin}policyContainer=QLn()},gtr=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new mtr},Mvs=new gtr;WLn.exports={isAborted:Evs,isCancelled:_vs,isValidEncodedURL:FLn,ReadableStreamFrom:W_s,tryUpgradeRequestToAPotentiallyTrustworthyURL:yvs,clampAndCoarsenConnectionTimingInfo:uvs,coarsenedSharedCurrentTime:dvs,determineRequestsReferrer:hvs,makePolicyContainer:QLn,clonePolicyContainer:pvs,appendFetchMetadata:cvs,appendRequestOriginHeader:lvs,TAOCheck:avs,corsCheck:svs,crossOriginResourcePolicyCheck:ovs,createOpaqueTimingInfo:fvs,setRequestReferrerPolicyOnRedirect:ivs,isValidHTTPToken:BLn,requestBadPort:X_s,requestCurrentURL:CJ,responseURL:LLn,responseLocationURL:J_s,isURLPotentiallyTrustworthy:vJ,isValidReasonPhrase:tvs,sameOrigin:TRe,normalizeMethod:vvs,iteratorMixin:bvs,createIterator:jLn,isValidHeaderName:rvs,isValidHeaderValue:ULn,isErrorLike:evs,fullyReadBody:Svs,readableStreamClose:Tvs,urlIsLocal:GLn,urlHasHttpsScheme:ptr,urlIsHttpHttpsScheme:$Ln,readAllBytes:HLn,simpleRangeHeaderValue:Ivs,buildContentRange:xvs,createInflate:wvs,extractMimeType:Rvs,getDecodeSplit:VLn,environmentSettingsObject:Mvs,isOriginIPPotentiallyTrustworthy:qLn,hasAuthenticationEntry:kvs,includesCredentials:Dvs,isTraversableNavigable:Nvs}});var wnt=I((ezd,YLn)=>{"use strict";p();var{iteratorMixin:Ovs}=JS(),{kEnumerableProperty:Dde}=Po(),{webidl:Tc}=RA(),zLn=require("node:util"),eF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Tc.util.markAsUncloneable(this),e!==void 0)throw Tc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Tc.brandCheck(this,t);let o="FormData.append";Tc.argumentLengthCheck(arguments,2,o),e=Tc.converters.USVString(e),arguments.length===3||Tc.is.Blob(r)?(r=Tc.converters.Blob(r,o,"value"),n!==void 0&&(n=Tc.converters.USVString(n))):r=Tc.converters.USVString(r);let s=Atr(e,r,n);this.#e.push(s)}delete(e){Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Tc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.get"),e=Tc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Tc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.has"),e=Tc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Tc.brandCheck(this,t);let o="FormData.set";Tc.argumentLengthCheck(arguments,2,o),e=Tc.converters.USVString(e),arguments.length===3||Tc.is.Blob(r)?(r=Tc.converters.Blob(r,o,"value"),n!==void 0&&(n=Tc.converters.USVString(n))):r=Tc.converters.USVString(r);let s=Atr(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)}[zLn.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=zLn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:Bvs,setFormDataState:Lvs}=eF;Reflect.deleteProperty(eF,"getFormDataState");Reflect.deleteProperty(eF,"setFormDataState");Ovs("FormData",eF,Bvs,"name","value");Object.defineProperties(eF.prototype,{append:Dde,delete:Dde,get:Dde,getAll:Dde,has:Dde,set:Dde,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Atr(t,e,r){if(typeof e!="string"){if(Tc.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(Atr,"makeEntry");Tc.is.FormData=Tc.util.MakeTypeAssertion(eF);YLn.exports={FormData:eF,makeEntry:Atr,setFormDataState:Lvs}});var ZLn=I((nzd,JLn)=>{"use strict";p();var{bufferToLowerCasedHeaderName:Fvs}=Po(),{HTTP_TOKEN_CODEPOINTS:Uvs}=sw(),{makeEntry:Qvs}=wnt(),{webidl:ytr}=RA(),Etr=require("node:assert"),{isomorphicDecode:KLn}=Z3(),qvs=Buffer.from("--"),_tr=new TextDecoder,jvs=new TextDecoder("utf-8",{ignoreBOM:!0});function Hvs(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(Gvs,"validateBoundary");function $vs(t,e){Etr(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw zC("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw zC("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 zC("expected a value starting with -- and the boundary");if(zvs(t,qvs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw zC("expected CRLF");s.position+=2;let l=Wvs(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 zC("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 zC("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",Hvs(f)||(f=""),g=new File([m],d,{type:f})):g=jvs.decode(Buffer.from(m)),Etr(ytr.is.USVString(u)),Etr(typeof g=="string"&&ytr.is.USVString(g)||ytr.is.File(g)),o.push(Qvs(u,g,d))}}a($vs,"multipartFormDataParser");function Vvs(t,e){t[e.position]===59&&e.position++,aw(c=>c===32||c===9,t,e);let r=aw(c=>Ctr(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++,aw(c=>c===32||c===9,t,e);let s;if(o){let c=aw(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 zC("unknown encoding, expected utf-8''");s=decodeURIComponent(_tr.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=aw(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw zC("Closing quote not found");e.position++,s=_tr.decode(c).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=aw(l=>Ctr(l)&&l!==59,t,e);s=_tr.decode(c)}return{name:n,value:s,extended:o}}a(Vvs,"parseContentDispositionAttribute");function Wvs(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 zC("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=aw(l=>l!==10&&l!==13&&l!==58,t,e);if(c=vtr(c,!0,!0,l=>l===9||l===32),!Uvs.test(c.toString()))throw zC("header name does not match the field-name token production");if(t[e.position]!==58)throw zC("expected :");switch(e.position++,aw(l=>l===32||l===9,t,e),Fvs(c)){case"content-disposition":{r=n=null;let l=!1;if(aw(d=>Ctr(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw zC("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=vtr(l,!1,!0,u=>u===9||u===32),o=KLn(l);break}case"content-transfer-encoding":{let l=aw(u=>u!==10&&u!==13,t,e);l=vtr(l,!1,!0,u=>u===9||u===32),s=KLn(l);break}default:aw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw zC("expected CRLF");e.position+=2}}a(Wvs,"parseMultipartFormDataHeaders");function aw(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(vtr,"removeChars");function zvs(t,e,r){if(t.length{"use strict";p();function Jvs(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(Jvs,"createDeferredPromise");XLn.exports={createDeferredPromise:Jvs}});var Mde=I((lzd,i3n)=>{"use strict";p();var Ttr=Po(),{ReadableStreamFrom:Zvs,readableStreamClose:Xvs,fullyReadBody:eCs,extractMimeType:tCs}=JS(),{FormData:e3n,setFormDataState:rCs}=wnt(),{webidl:jk}=RA(),btr=require("node:assert"),{isErrored:Str,isDisturbed:nCs}=require("node:stream"),{isUint8Array:iCs}=require("node:util/types"),{serializeAMimeType:oCs}=sw(),{multipartFormDataParser:sCs}=ZLn(),{createDeferredPromise:aCs}=xRe(),{parseJSONFromBytes:cCs}=Z3(),{utf8DecodeBytes:lCs}=Cnt(),{runtimeFeatures:uCs}=X3(),dCs=uCs.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Rnt=new TextEncoder;function fCs(){}a(fCs,"noop");var pCs=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!nCs(e)&&!Str(e)&&e.cancel("Response object has been garbage collected").catch(fCs)});function r3n(t,e=!1){let r=null,n=null;jk.is.ReadableStream(t)?r=t:jk.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),btr(jk.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(jk.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(jk.is.BufferSource(t))s=jk.util.getCopyOfBytesHeldByBufferSource(t);else if(jk.is.FormData(t)){let d=`----formdata-undici-0${`${dCs(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=Eit.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=Rnt.encode(f+`; name="${h(m(_))}"\r \r ${m(v)}\r -`);g.push(b),c+=b.byteLength}else{let b=Eit.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r +`);g.push(b),c+=b.byteLength}else{let b=Rnt.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=Eit.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(YP.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(Lrr.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=YP.is.ReadableStream(t)?t:CTs(t)}return(typeof s=="string"||xTs(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(Brr(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!Brr(r)&&n.enqueue(typeof d=="string"?Eit.encode(d):new Uint8Array(d));queueMicrotask(()=>vTs(n))})(),[{stream:r,source:s,length:c},l]}a(YFn,"extractBody");function LTs(t,e=!1){return YP.is.ReadableStream(t)&&(Orr(!Lrr.isDisturbed(t),"The body has already been consumed."),Orr(!t.locked,"The stream is locked.")),YFn(t,e)}a(LTs,"safelyExtractBody");function FTs(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(FTs,"cloneBody");function UTs(t,e){return{blob(){return nfe(this,n=>{let o=zFn(e(this));return o===null?o="":o&&(o=wTs(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return nfe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return nfe(this,DTs,t,e)},json(){return nfe(this,PTs,t,e)},formData(){return nfe(this,n=>{let o=zFn(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=RTs(n,o),c=new WFn;return TTs(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new WFn;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 nfe(this,n=>new Uint8Array(n),t,e)}}}a(UTs,"bodyMixinMethods");function QTs(t,e){Object.assign(t.prototype,UTs(t,e))}a(QTs,"mixinBody");function nfe(t,e,r,n){try{YP.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),KFn(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=kTs(),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):(bTs(t.body,c,s),o.promise)}a(nfe,"consumeBody");function KFn(t){let e=t.body;return e!=null&&(e.stream.locked||Lrr.isDisturbed(e.stream))}a(KFn,"bodyUnusable");function zFn(t){let e=t.headersList,r=STs(e);return r==="failure"?null:r}a(zFn,"bodyMimeType");JFn.exports={extractBody:YFn,safelyExtractBody:LTs,cloneBody:FTs,mixinBody:QTs,streamRegistry:BTs,bodyUnusable:KFn}});var d8n=I((Wef,u8n)=>{"use strict";p();var Ni=require("node:assert"),Ji=Do(),{channels:ZFn}=cj(),Frr=Atr(),{RequestContentLengthMismatchError:HJ,ResponseContentLengthMismatchError:XFn,RequestAbortedError:a8n,HeadersTimeoutError:qTs,HeadersOverflowError:jTs,SocketError:ske,InformationalError:ofe,BodyTimeoutError:HTs,HTTPParserError:GTs,ResponseExceededMaxSizeError:$Ts}=ao(),{kUrl:c8n,kReset:tb,kClient:Sit,kParser:op,kBlocking:ake,kRunning:oE,kPending:VTs,kSize:e8n,kWriting:fj,kQueue:KP,kNoRef:ike,kKeepAliveDefaultTimeout:WTs,kHostHeader:zTs,kPendingIdx:YTs,kRunningIdx:mw,kError:W_,kPipelining:vit,kSocket:sfe,kKeepAliveTimeoutValue:Tit,kMaxHeadersSize:KTs,kKeepAliveMaxTimeout:JTs,kKeepAliveTimeoutThreshold:ZTs,kHeadersTimeout:XTs,kBodyTimeout:eIs,kStrictContentLength:qrr,kMaxRequests:t8n,kCounter:tIs,kMaxResponseSize:rIs,kOnError:r8n,kResume:dj,kHTTPContext:l8n,kClosed:jrr}=nl(),oT=J3n(),n8n=Buffer.alloc(0),_it=Buffer[Symbol.species],nIs=Ji.removeAllListeners,Urr;function iIs(){let t=process.env.JEST_WORKER_ID?drr():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(eFn())}catch{}return e||(e=new WebAssembly.Module(t||drr())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onStatus(new _it(ZO.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Ni(ip.ptr===n),ip.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onHeaderField(new _it(ZO.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onHeaderValue(new _it(ZO.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Ni(ip.ptr===n),ip.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onBody(new _it(ZO.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Ni(ip.ptr===n),ip.onMessageComplete()),"wasm_on_message_complete")}})}a(iIs,"lazyllhttp");var Qrr=null,ip=null,ZO=null,Cit=0,XO=null,oIs=0,oke=1,afe=2|oke,bit=4|oke,Hrr=8|oIs,Grr=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(oT.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[KTs],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[rIs]}setTimeout(e,r){e!==this.timeoutValue||r&oke^this.timeoutType&oke?(this.timeout&&(Frr.clearTimeout(this.timeout),this.timeout=null),e&&(r&oke?this.timeout=Frr.setFastTimeout(i8n,e,this.timeoutWeakRef):(this.timeout=setTimeout(i8n,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||(Ni(this.ptr!=null),Ni(ip===null),this.llhttp.llhttp_resume(this.ptr),Ni(this.timeoutType===bit),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||n8n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Ni(ip===null),Ni(this.ptr!=null),Ni(!this.paused);let{socket:r,llhttp:n}=this;e.length>Cit&&(XO&&n.free(XO),Cit=Math.ceil(e.length/4096)*4096,XO=n.malloc(Cit)),new Uint8Array(n.memory.buffer,XO,Cit).set(e);try{let o;try{ZO=e,ip=this,o=n.llhttp_execute(this.ptr,XO,e.length)}finally{ip=null,ZO=null}if(o!==oT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-XO);if(o===oT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===oT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ji.destroy(r,o)}}finish(){Ni(ip===null),Ni(this.ptr!=null),Ni(!this.paused);let{llhttp:e}=this,r;try{ip=this,r=e.llhttp_finish(this.ptr)}finally{ip=null}return r===oT.ERROR.OK?null:r===oT.ERROR.PAUSED||r===oT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,n8n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new XFn;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 GTs(l,oT.ERROR[e],r)}destroy(){Ni(ip===null),Ni(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Frr.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;let n=r[KP][r[mw]];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=Ji.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ji.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ji.destroy(this.socket,new jTs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Ni(r),Ni(n[sfe]===o),Ni(!o.destroyed),Ni(!this.paused),Ni((s.length&1)===0);let l=n[KP][n[mw]];Ni(l),Ni(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[op].destroy(),o[op]=null,o[Sit]=null,o[W_]=null,nIs(o),n[sfe]=null,n[l8n]=null,n[KP][n[mw]++]=null,n.emit("disconnect",n[c8n],[n],new ofe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ji.destroy(o,u)}n[dj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[KP][o[mw]];if(!u)return-1;if(Ni(!this.upgrade),Ni(this.statusCode<200),e===100)return Ji.destroy(s,new ske("bad response",Ji.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ji.destroy(s,new ske("bad upgrade",Ji.getSocketInfo(s))),-1;if(Ni(this.timeoutType===afe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[tb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[eIs];this.setTimeout(f,bit)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Ni(o[oE]===1),this.upgrade=!0,2;if(r)return Ni(o[oE]===1),this.upgrade=!0,2;if(Ni((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[vit]){let f=this.keepAlive?Ji.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[ZTs],o[JTs]);h<=0?s[tb]=!0:o[Tit]=h}else o[Tit]=o[WTs]}else s[tb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[ake]&&(s[ake]=!1,o[dj]()),d?oT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[KP][r[mw]];return Ni(c),Ni(this.timeoutType===bit),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Ni(o>=200),s>-1&&this.bytesRead+e.length>s?(Ji.destroy(n,new $Ts),-1):(this.bytesRead+=e.length,c.onData(e)===!1?oT.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;Ni(n>=100),Ni((this.headers.length&1)===0);let d=e[KP][e[mw]];if(Ni(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 Ji.destroy(r,new XFn),-1;if(d.onComplete(s),e[KP][e[mw]++]=null,r[fj])return Ni(e[oE]===0),Ji.destroy(r,new ofe("reset")),oT.ERROR.PAUSED;if(u){if(r[tb]&&e[oE]===0)return Ji.destroy(r,new ofe("reset")),oT.ERROR.PAUSED;e[vit]==null||e[vit]===1?setImmediate(e[dj]):e[dj]()}else return Ji.destroy(r,new ofe("reset")),oT.ERROR.PAUSED;return 0}};function i8n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===afe?(!r[fj]||r.writableNeedDrain||o[oE]>1)&&(Ni(!s,"cannot be paused while waiting for headers"),Ji.destroy(r,new qTs)):n===bit?s||Ji.destroy(r,new HTs):n===Hrr&&(Ni(o[oE]===0&&o[Tit]),Ji.destroy(r,new ofe("socket idle timeout")))}a(i8n,"onParserTimeout");function sIs(t,e){if(t[sfe]=e,Qrr||(Qrr=iIs()),e.errored)throw e.errored;if(e.destroyed)throw new ske("destroyed");return e[ike]=!1,e[fj]=!1,e[tb]=!1,e[ake]=!1,e[op]=new Grr(t,e,Qrr),Ji.addListener(e,"error",aIs),Ji.addListener(e,"readable",cIs),Ji.addListener(e,"end",lIs),Ji.addListener(e,"close",uIs),e[jrr]=!1,e.on("close",dIs),{version:"h1",defaultPipelining:1,write(r){return hIs(t,r)},resume(){fIs(t)},destroy(r,n){e[jrr]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[fj]||e[tb]||e[ake]||r&&(t[oE]>0&&!r.idempotent||t[oE]>0&&(r.upgrade||r.method==="CONNECT")||t[oE]>0&&Ji.bodyLength(r.body)!==0&&(Ji.isStream(r.body)||Ji.isAsyncIterable(r.body)||Ji.isFormDataLike(r.body))))}}}a(sIs,"connectH1");function aIs(t){Ni(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[op];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[W_]=r,this[Sit][r8n](r));return}this[W_]=t,this[Sit][r8n](t)}a(aIs,"onHttpSocketError");function cIs(){this[op]?.readMore()}a(cIs,"onHttpSocketReadable");function lIs(){let t=this[op];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ji.destroy(this,e);return}Ji.destroy(this,new ske("other side closed",Ji.getSocketInfo(this)))}a(lIs,"onHttpSocketEnd");function uIs(){let t=this[op];t&&(!this[W_]&&t.statusCode&&!t.shouldKeepAlive&&(this[W_]=t.finish()||this[W_]),this[op].destroy(),this[op]=null);let e=this[W_]||new ske("closed",Ji.getSocketInfo(this)),r=this[Sit];if(r[sfe]=null,r[l8n]=null,r.destroyed){Ni(r[VTs]===0);let n=r[KP].splice(r[mw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[KP][r[mw]];r[KP][r[mw]++]=null,Ji.errorRequest(r,n,e)}r[YTs]=r[mw],Ni(r[oE]===0),r.emit("disconnect",r[c8n],[r],e),r[dj]()}a(uIs,"onHttpSocketClose");function dIs(){this[jrr]=!0}a(dIs,"onSocketClose");function fIs(t){let e=t[sfe];if(e&&!e.destroyed){if(t[e8n]===0?!e[ike]&&e.unref&&(e.unref(),e[ike]=!0):e[ike]&&e.ref&&(e.ref(),e[ike]=!1),t[e8n]===0)e[op].timeoutType!==Hrr&&e[op].setTimeout(t[Tit],Hrr);else if(t[oE]>0&&e[op].statusCode<200&&e[op].timeoutType!==afe){let r=t[KP][t[mw]],n=r.headersTimeout!=null?r.headersTimeout:t[XTs];e[op].setTimeout(n,afe)}}}a(fIs,"resumeH1");function pIs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(pIs,"shouldSendContentLength");function hIs(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(Ji.isFormDataLike(u)){Urr||(Urr=ife().extractBody);let[E,_]=Urr(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ji.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ji.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),pIs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[qrr])return Ji.errorRequest(t,e,new HJ),!1;process.emitWarning(new HJ)}let g=t[sfe],A=a(E=>{e.aborted||e.completed||(Ji.errorRequest(t,e,E||new a8n),Ji.destroy(u),Ji.destroy(g,new ofe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ji.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[tb]=!0),(s||r==="CONNECT")&&(g[tb]=!0),l!=null&&(g[tb]=l),t[t8n]&&g[tIs]++>=t[t8n]&&(g[tb]=!0),c&&(g[ake]=!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=Rnt.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(jk.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(Ttr.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=jk.is.ReadableStream(t)?t:Zvs(t)}return(typeof s=="string"||iCs(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(Str(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!Str(r)&&n.enqueue(typeof d=="string"?Rnt.encode(d):new Uint8Array(d));queueMicrotask(()=>Xvs(n))})(),[{stream:r,source:s,length:c},l]}a(r3n,"extractBody");function hCs(t,e=!1){return jk.is.ReadableStream(t)&&(btr(!Ttr.isDisturbed(t),"The body has already been consumed."),btr(!t.locked,"The stream is locked.")),r3n(t,e)}a(hCs,"safelyExtractBody");function mCs(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(mCs,"cloneBody");function gCs(t,e){return{blob(){return Nde(this,n=>{let o=t3n(e(this));return o===null?o="":o&&(o=oCs(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return Nde(this,n=>new Uint8Array(n).buffer,t,e)},text(){return Nde(this,lCs,t,e)},json(){return Nde(this,cCs,t,e)},formData(){return Nde(this,n=>{let o=t3n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=sCs(n,o),c=new e3n;return rCs(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new e3n;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 Nde(this,n=>new Uint8Array(n),t,e)}}}a(gCs,"bodyMixinMethods");function ACs(t,e){Object.assign(t.prototype,gCs(t,e))}a(ACs,"mixinBody");function Nde(t,e,r,n){try{jk.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),n3n(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=aCs(),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):(eCs(t.body,c,s),o.promise)}a(Nde,"consumeBody");function n3n(t){let e=t.body;return e!=null&&(e.stream.locked||Ttr.isDisturbed(e.stream))}a(n3n,"bodyUnusable");function t3n(t){let e=t.headersList,r=tCs(e);return r==="failure"?null:r}a(t3n,"bodyMimeType");i3n.exports={extractBody:r3n,safelyExtractBody:hCs,cloneBody:mCs,mixinBody:ACs,streamRegistry:pCs,bodyUnusable:n3n}});var y3n=I((fzd,A3n)=>{"use strict";p();var Di=require("node:assert"),Yi=Po(),{channels:o3n}=Gq(),Itr=ser(),{RequestContentLengthMismatchError:bJ,ResponseContentLengthMismatchError:s3n,RequestAbortedError:h3n,HeadersTimeoutError:yCs,HeadersOverflowError:ECs,SocketError:PRe,InformationalError:Ode,BodyTimeoutError:_Cs,HTTPParserError:vCs,ResponseExceededMaxSizeError:CCs}=so(),{kUrl:m3n,kReset:YC,kClient:Mnt,kParser:sp,kBlocking:kRe,kRunning:oE,kPending:bCs,kSize:a3n,kWriting:zq,kQueue:Hk,kNoRef:wRe,kKeepAliveDefaultTimeout:SCs,kHostHeader:TCs,kPendingIdx:ICs,kRunningIdx:cw,kError:G_,kPipelining:Dnt,kSocket:Bde,kKeepAliveTimeoutValue:Ont,kMaxHeadersSize:xCs,kKeepAliveMaxTimeout:wCs,kKeepAliveTimeoutThreshold:RCs,kHeadersTimeout:PCs,kBodyTimeout:kCs,kStrictContentLength:Rtr,kMaxRequests:c3n,kCounter:DCs,kMaxResponseSize:NCs,kOnError:l3n,kResume:Wq,kHTTPContext:g3n,kClosed:Ptr}=tl(),ZS=iLn(),u3n=Buffer.alloc(0),Pnt=Buffer[Symbol.species],MCs=Yi.removeAllListeners,xtr;function OCs(){let t=process.env.JEST_WORKER_ID?Xer():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(aLn())}catch{}return e||(e=new WebAssembly.Module(t||Xer())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Di(op.ptr===n);let c=o-qO+QO.byteOffset;return op.onStatus(new Pnt(QO.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Di(op.ptr===n),op.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Di(op.ptr===n);let c=o-qO+QO.byteOffset;return op.onHeaderField(new Pnt(QO.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Di(op.ptr===n);let c=o-qO+QO.byteOffset;return op.onHeaderValue(new Pnt(QO.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Di(op.ptr===n),op.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Di(op.ptr===n);let c=o-qO+QO.byteOffset;return op.onBody(new Pnt(QO.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Di(op.ptr===n),op.onMessageComplete()),"wasm_on_message_complete")}})}a(OCs,"lazyllhttp");var wtr=null,op=null,QO=null,knt=0,qO=null,BCs=0,RRe=1,Lde=2|RRe,Nnt=4|RRe,ktr=8|BCs,Dtr=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(ZS.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[xCs],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[NCs]}setTimeout(e,r){e!==this.timeoutValue||r&RRe^this.timeoutType&RRe?(this.timeout&&(Itr.clearTimeout(this.timeout),this.timeout=null),e&&(r&RRe?this.timeout=Itr.setFastTimeout(d3n,e,this.timeoutWeakRef):(this.timeout=setTimeout(d3n,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||(Di(this.ptr!=null),Di(op===null),this.llhttp.llhttp_resume(this.ptr),Di(this.timeoutType===Nnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||u3n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Di(op===null),Di(this.ptr!=null),Di(!this.paused);let{socket:r,llhttp:n}=this;e.length>knt&&(qO&&n.free(qO),knt=Math.ceil(e.length/4096)*4096,qO=n.malloc(knt)),new Uint8Array(n.memory.buffer,qO,knt).set(e);try{let o;try{QO=e,op=this,o=n.llhttp_execute(this.ptr,qO,e.length)}finally{op=null,QO=null}if(o!==ZS.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-qO);if(o===ZS.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===ZS.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Yi.destroy(r,o)}}finish(){Di(op===null),Di(this.ptr!=null),Di(!this.paused);let{llhttp:e}=this,r;try{op=this,r=e.llhttp_finish(this.ptr)}finally{op=null}return r===ZS.ERROR.OK?null:r===ZS.ERROR.PAUSED||r===ZS.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,u3n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new s3n;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 vCs(l,ZS.ERROR[e],r)}destroy(){Di(op===null),Di(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Itr.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;let n=r[Hk][r[cw]];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=Yi.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Yi.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Yi.destroy(this.socket,new ECs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Di(r),Di(n[Bde]===o),Di(!o.destroyed),Di(!this.paused),Di((s.length&1)===0);let l=n[Hk][n[cw]];Di(l),Di(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[sp].destroy(),o[sp]=null,o[Mnt]=null,o[G_]=null,MCs(o),n[Bde]=null,n[g3n]=null,n[Hk][n[cw]++]=null,n.emit("disconnect",n[m3n],[n],new Ode("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Yi.destroy(o,u)}n[Wq]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[Hk][o[cw]];if(!u)return-1;if(Di(!this.upgrade),Di(this.statusCode<200),e===100)return Yi.destroy(s,new PRe("bad response",Yi.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Yi.destroy(s,new PRe("bad upgrade",Yi.getSocketInfo(s))),-1;if(Di(this.timeoutType===Lde),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[YC]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[kCs];this.setTimeout(f,Nnt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Di(o[oE]===1),this.upgrade=!0,2;if(r)return Di(o[oE]===1),this.upgrade=!0,2;if(Di((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Dnt]){let f=this.keepAlive?Yi.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[RCs],o[wCs]);h<=0?s[YC]=!0:o[Ont]=h}else o[Ont]=o[SCs]}else s[YC]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[kRe]&&(s[kRe]=!1,o[Wq]()),d?ZS.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[Hk][r[cw]];return Di(c),Di(this.timeoutType===Nnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Di(o>=200),s>-1&&this.bytesRead+e.length>s?(Yi.destroy(n,new CCs),-1):(this.bytesRead+=e.length,c.onData(e)===!1?ZS.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;Di(n>=100),Di((this.headers.length&1)===0);let d=e[Hk][e[cw]];if(Di(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 Yi.destroy(r,new s3n),-1;if(d.onComplete(s),e[Hk][e[cw]++]=null,r[zq])return Di(e[oE]===0),Yi.destroy(r,new Ode("reset")),ZS.ERROR.PAUSED;if(u){if(r[YC]&&e[oE]===0)return Yi.destroy(r,new Ode("reset")),ZS.ERROR.PAUSED;e[Dnt]==null||e[Dnt]===1?setImmediate(e[Wq]):e[Wq]()}else return Yi.destroy(r,new Ode("reset")),ZS.ERROR.PAUSED;return 0}};function d3n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===Lde?(!r[zq]||r.writableNeedDrain||o[oE]>1)&&(Di(!s,"cannot be paused while waiting for headers"),Yi.destroy(r,new yCs)):n===Nnt?s||Yi.destroy(r,new _Cs):n===ktr&&(Di(o[oE]===0&&o[Ont]),Yi.destroy(r,new Ode("socket idle timeout")))}a(d3n,"onParserTimeout");function LCs(t,e){if(t[Bde]=e,wtr||(wtr=OCs()),e.errored)throw e.errored;if(e.destroyed)throw new PRe("destroyed");return e[wRe]=!1,e[zq]=!1,e[YC]=!1,e[kRe]=!1,e[sp]=new Dtr(t,e,wtr),Yi.addListener(e,"error",FCs),Yi.addListener(e,"readable",UCs),Yi.addListener(e,"end",QCs),Yi.addListener(e,"close",qCs),e[Ptr]=!1,e.on("close",jCs),{version:"h1",defaultPipelining:1,write(r){return $Cs(t,r)},resume(){HCs(t)},destroy(r,n){e[Ptr]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[zq]||e[YC]||e[kRe]||r&&(t[oE]>0&&!r.idempotent||t[oE]>0&&(r.upgrade||r.method==="CONNECT")||t[oE]>0&&Yi.bodyLength(r.body)!==0&&(Yi.isStream(r.body)||Yi.isAsyncIterable(r.body)||Yi.isFormDataLike(r.body))))}}}a(LCs,"connectH1");function FCs(t){Di(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[sp];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[G_]=r,this[Mnt][l3n](r));return}this[G_]=t,this[Mnt][l3n](t)}a(FCs,"onHttpSocketError");function UCs(){this[sp]?.readMore()}a(UCs,"onHttpSocketReadable");function QCs(){let t=this[sp];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Yi.destroy(this,e);return}Yi.destroy(this,new PRe("other side closed",Yi.getSocketInfo(this)))}a(QCs,"onHttpSocketEnd");function qCs(){let t=this[sp];t&&(!this[G_]&&t.statusCode&&!t.shouldKeepAlive&&(this[G_]=t.finish()||this[G_]),this[sp].destroy(),this[sp]=null);let e=this[G_]||new PRe("closed",Yi.getSocketInfo(this)),r=this[Mnt];if(r[Bde]=null,r[g3n]=null,r.destroyed){Di(r[bCs]===0);let n=r[Hk].splice(r[cw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[Hk][r[cw]];r[Hk][r[cw]++]=null,Yi.errorRequest(r,n,e)}r[ICs]=r[cw],Di(r[oE]===0),r.emit("disconnect",r[m3n],[r],e),r[Wq]()}a(qCs,"onHttpSocketClose");function jCs(){this[Ptr]=!0}a(jCs,"onSocketClose");function HCs(t){let e=t[Bde];if(e&&!e.destroyed){if(t[a3n]===0?!e[wRe]&&e.unref&&(e.unref(),e[wRe]=!0):e[wRe]&&e.ref&&(e.ref(),e[wRe]=!1),t[a3n]===0)e[sp].timeoutType!==ktr&&e[sp].setTimeout(t[Ont],ktr);else if(t[oE]>0&&e[sp].statusCode<200&&e[sp].timeoutType!==Lde){let r=t[Hk][t[cw]],n=r.headersTimeout!=null?r.headersTimeout:t[PCs];e[sp].setTimeout(n,Lde)}}}a(HCs,"resumeH1");function GCs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(GCs,"shouldSendContentLength");function $Cs(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(Yi.isFormDataLike(u)){xtr||(xtr=Mde().extractBody);let[E,_]=xtr(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Yi.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Yi.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),GCs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Rtr])return Yi.errorRequest(t,e,new bJ),!1;process.emitWarning(new bJ)}let g=t[Bde],A=a(E=>{e.aborted||e.completed||(Yi.errorRequest(t,e,E||new h3n),Yi.destroy(u),Yi.destroy(g,new Ode("aborted")))},"abort");try{e.onConnect(A)}catch(E){Yi.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[YC]=!0),(s||r==="CONNECT")&&(g[YC]=!0),l!=null&&(g[YC]=l),t[c3n]&&g[DCs]++>=t[c3n]&&(g[YC]=!0),c&&(g[kRe]=!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[zTs],s?y+=`connection: upgrade\r +`:y+=t[TCs],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[vit]&&!g[tb]?y+=`connection: keep-alive\r +`:t[Dnt]&&!g[YC]?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 a8n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Ni(o.destroyed||o[fj]&&r[oE]<=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")?Ji.destroy(e,A):Ji.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(mIs,"writeStream");function o8n(t,e,r,n,o,s,c,l){try{e?Ji.isBuffer(e)&&(Ni(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return o3n.sendHeaders.hasSubscribers&&o3n.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?f3n(A,null,t,e,g,f,y,h):Yi.isBuffer(u)?f3n(A,u,t,e,g,f,y,h):Yi.isBlobLike(u)?typeof u.stream=="function"?p3n(A,u.stream(),t,e,g,f,y,h):WCs(A,u,t,e,g,f,y,h):Yi.isStream(u)?VCs(A,u,t,e,g,f,y,h):Yi.isIterable(u)?p3n(A,u,t,e,g,f,y,h):Di(!1),!0}a($Cs,"writeH1");function VCs(t,e,r,n,o,s,c,l){Di(s!==0||r[oE]===0,"stream body cannot be pipelined");let u=!1,d=new Bnt({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){Yi.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 h3n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Di(o.destroyed||o[zq]&&r[oE]<=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")?Yi.destroy(e,A):Yi.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(VCs,"writeStream");function f3n(t,e,r,n,o,s,c,l){try{e?Yi.isBuffer(e)&&(Di(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[tb]=!0)):s===0?o.write(`${c}content-length: 0\r +`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[YC]=!0)):s===0?o.write(`${c}content-length: 0\r \r -`,"latin1"):(Ni(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[dj]()}catch(u){t(u)}}a(o8n,"writeBuffer");async function gIs(t,e,r,n,o,s,c,l){Ni(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new HJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1"):(Di(s===null,"no body must not have content length"),o.write(`${c}\r +`,"latin1")),n.onRequestSent(),r[Wq]()}catch(u){t(u)}}a(f3n,"writeBuffer");async function WCs(t,e,r,n,o,s,c,l){Di(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new bJ;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[tb]=!0),r[dj]()}catch(u){t(u)}}a(gIs,"writeBlob");async function s8n(t,e,r,n,o,s,c,l){Ni(s!==0||r[oE]===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)=>{Ni(u===null),o[W_]?g(o[W_]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Iit({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[W_])throw o[W_];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(s8n,"writeIterable");var Iit=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[fj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[W_])throw r[W_];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[qrr])throw new HJ;process.emitWarning(new HJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[tb]=!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[YC]=!0),r[Wq]()}catch(u){t(u)}}a(WCs,"writeBlob");async function p3n(t,e,r,n,o,s,c,l){Di(s!==0||r[oE]===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)=>{Di(u===null),o[G_]?g(o[G_]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Bnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[G_])throw o[G_];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(p3n,"writeIterable");var Bnt=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[zq]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[G_])throw r[G_];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Rtr])throw new bJ;process.emitWarning(new bJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[YC]=!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[op].timeout&&r[op].timeoutType===afe&&r[op].timeout.refresh&&r[op].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[fj]=!1,e[W_])throw e[W_];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[sp].timeout&&r[sp].timeoutType===Lde&&r[sp].timeout.refresh&&r[sp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[zq]=!1,e[G_])throw e[G_];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[qrr])throw new HJ;process.emitWarning(new HJ)}e[op].timeout&&e[op].timeoutType===afe&&e[op].timeout.refresh&&e[op].timeout.refresh(),n[dj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[fj]=!1,e&&(Ni(n[oE]<=1,"pipeline should only contain this request"),o(e))}};u8n.exports=sIs});var _8n=I((Kef,E8n)=>{"use strict";p();var Aw=require("node:assert"),{pipeline:AIs}=require("node:stream"),ps=Do(),{RequestContentLengthMismatchError:zrr,RequestAbortedError:yIs,SocketError:dke,InformationalError:pj,InvalidArgumentError:EIs}=ao(),{kUrl:uke,kReset:kit,kClient:sT,kRunning:fke,kPending:_Is,kQueue:hj,kPendingIdx:Krr,kRunningIdx:JP,kError:aT,kSocket:Af,kStrictContentLength:CIs,kOnError:cfe,kMaxConcurrentStreams:wit,kPingInterval:f8n,kHTTP2Session:mF,kHTTP2InitialWindowSize:vIs,kHTTP2ConnectionWindowSize:bIs,kResume:e5,kSize:SIs,kHTTPContext:Jrr,kClosed:Yrr,kBodyTimeout:TIs,kEnableConnectProtocol:cke,kRemoteSettings:lke,kHTTP2Stream:xit,kHTTP2SessionState:Zrr}=nl(),{channels:p8n}=cj(),gw=Symbol("open streams"),h8n,Rit;try{Rit=require("node:http2")}catch{Rit={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:IIs,HTTP2_HEADER_METHOD:m8n,HTTP2_HEADER_PATH:g8n,HTTP2_HEADER_SCHEME:$rr,HTTP2_HEADER_CONTENT_LENGTH:xIs,HTTP2_HEADER_EXPECT:wIs,HTTP2_HEADER_STATUS:Vrr,HTTP2_HEADER_PROTOCOL:RIs,NGHTTP2_REFUSED_STREAM:kIs,NGHTTP2_CANCEL:PIs}}=Rit;function Wrr(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(Wrr,"parseH2Headers");function DIs(t,e){t[Af]=e;let r=t[vIs],n=t[bIs],o=Rit.connect(t[uke],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[wit],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[Af]=e,o[gw]=0,o[sT]=t,o[Af]=e,o[Zrr]={ping:{interval:t[f8n]===0?null:setInterval(BIs,t[f8n],o).unref()}},o[cke]=!1,o[lke]=!1,n&&ps.addListener(o,"connect",MIs.bind(o,n)),ps.addListener(o,"error",LIs),ps.addListener(o,"frameError",FIs),ps.addListener(o,"end",UIs),ps.addListener(o,"goaway",QIs),ps.addListener(o,"close",qIs),ps.addListener(o,"remoteSettings",OIs),o.unref(),t[mF]=o,e[mF]=o,ps.addListener(e,"error",HIs),ps.addListener(e,"end",GIs),ps.addListener(e,"close",jIs),e[Yrr]=!1,e.on("close",$Is),{version:"h2",defaultPipelining:1/0,write(s){return WIs(t,s)},resume(){NIs(t)},destroy(s,c){e[Yrr]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[fke]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[lke]===!1||ps.bodyLength(s.body)!==0&&(ps.isStream(s.body)||ps.isAsyncIterable(s.body)||ps.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[lke]===!1;return!1}}}a(DIs,"connectH2");function NIs(t){let e=t[Af];e?.destroyed===!1&&(t[SIs]===0||t[wit]===0?(e.unref(),t[mF].unref()):(e.ref(),t[mF].ref()))}a(NIs,"resumeH2");function MIs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(MIs,"applyConnectionWindowSize");function OIs(t){if(this[sT][wit]=t.maxConcurrentStreams??this[sT][wit],this[lke]===!0&&this[cke]===!0&&t.enableConnectProtocol===!1){let e=new pj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[Af][aT]=e,this[sT][cfe](e);return}this[cke]=t.enableConnectProtocol??this[cke],this[lke]=!0,this[sT][e5]()}a(OIs,"onHttp2RemoteSettings");function BIs(t){let e=t[Zrr];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[sT],c=this[sT];if(n!=null){let l=new pj(`HTTP/2: "PING" errored - type ${n.message}`);c[aT]=l,s[cfe](l)}else s.emit("ping",o)}a(r,"onPing")}a(BIs,"onHttp2SendPing");function LIs(t){Aw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Af][aT]=t,this[sT][cfe](t)}a(LIs,"onHttp2SessionError");function FIs(t,e,r){if(r===0){let n=new pj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Af][aT]=n,this[sT][cfe](n)}}a(FIs,"onHttp2FrameError");function UIs(){let t=new dke("other side closed",ps.getSocketInfo(this[Af]));this.destroy(t),ps.destroy(this[Af],t)}a(UIs,"onHttp2SessionEnd");function QIs(t){let e=this[aT]||new dke(`HTTP/2: "GOAWAY" frame received with code ${t}`,ps.getSocketInfo(this[Af])),r=this[sT];if(r[Af]=null,r[Jrr]=null,this.close(),this[mF]=null,ps.destroy(this[Af],e),r[JP]{e.aborted||e.completed||(x=x||new yIs,ps.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[cfe](x),t[e5]()),ps.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ps.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[cke]===!1?(ps.errorRequest(t,e,new pj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[m8n]="CONNECT",g[RIs]="websocket",g[g8n]=s,f==="ws:"||f==="wss:"?g[$rr]=f==="ws:"?"http":"https":g[$rr]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[xit]=!0,A.once("response",(x,k)=>{let{[Vrr]:D,...N}=x;e.onUpgrade(D,Wrr(N),A),++n[gw],t[hj][t[JP]++]=null}),A.on("error",()=>{(A.rstCode===kIs||A.rstCode===PIs)&&_(new pj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[gw]-=1,n[gw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[xit]=!0,A.on("response",x=>{let{[Vrr]:k,...D}=x;e.onUpgrade(k,Wrr(D),A),++n[gw],t[hj][t[JP]++]=null}),A.once("close",()=>{n[gw]-=1,n[gw]===0&&n.unref()}),A.setTimeout(r),!0);g[g8n]=s,g[$rr]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ps.bodyLength(m);if(ps.isFormDataLike(m)){h8n??=ife().extractBody;let[x,k]=h8n(m);g["content-type"]=k,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),VIs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[CIs])return ps.errorRequest(t,e,new zrr),!1;process.emitWarning(new zrr)}if(b!=null&&(Aw(m||b===0,"no body must not have content length"),g[xIs]=`${b}`),n.ref(),p8n.sendHeaders.hasSubscribers){let x="";for(let k in g)x+=`${k}: ${g[k]}\r -`;p8n.sendHeaders.publish({request:e,headers:x,socket:n[Af]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[wIs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[xit]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[xit]=!0,R()),++n[gw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Vrr]:k,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(k),Wrr(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[hj][t[JP]++]=null,t[e5]()):(_(new pj("HTTP/2: stream half-closed (remote)")),t[hj][t[JP]++]=null,t[Krr]=t[JP],t[e5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[gw]-=1,n[gw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,k)=>{A.removeAllListeners("data"),_(new pj(`HTTP/2: "frameError" received - type ${x}, code ${k}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new pj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[gw]-=1,n[gw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?A8n(_,A,null,t,e,t[Af],b,v):ps.isBuffer(m)?A8n(_,A,m,t,e,t[Af],b,v):ps.isBlobLike(m)?typeof m.stream=="function"?y8n(_,A,m.stream(),t,e,t[Af],b,v):YIs(_,A,m,t,e,t[Af],b,v):ps.isStream(m)?zIs(_,t[Af],v,A,m,t,e,b):ps.isIterable(m)?y8n(_,A,m,t,e,t[Af],b,v):Aw(!1)}a(R,"writeBodyH2")}a(WIs,"writeH2");function A8n(t,e,r,n,o,s,c,l){try{r!=null&&ps.isBuffer(r)&&(Aw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[kit]=!0),o.onRequestSent(),n[e5]()}catch(u){t(u)}}a(A8n,"writeBuffer");function zIs(t,e,r,n,o,s,c,l){Aw(l!==0||s[fke]===0,"stream body cannot be pipelined");let u=AIs(o,n,f=>{f?(ps.destroy(u,f),t(f)):(ps.removeAllListeners(u),c.onRequestSent(),r||(e[kit]=!0),s[e5]())});ps.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(zIs,"writeStream");async function YIs(t,e,r,n,o,s,c,l){Aw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new zrr;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[kit]=!0),n[e5]()}catch(u){t(u)}}a(YIs,"writeBlob");async function y8n(t,e,r,n,o,s,c,l){Aw(c!==0||n[fke]===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)=>{Aw(u===null),s[aT]?m(s[aT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[aT])throw s[aT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[kit]=!0),n[e5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(y8n,"writeIterable");E8n.exports=DIs});var yj=I((Xef,w8n)=>{"use strict";p();var gF=require("node:assert"),S8n=require("node:net"),pke=require("node:http"),GJ=Do(),{ClientStats:KIs}=Vtr(),{channels:lfe}=cj(),JIs=U3n(),ZIs=FJ(),{InvalidArgumentError:nd,InformationalError:XIs,ClientDestroyedError:exs}=ao(),txs=UJ(),{kUrl:t5,kServerName:Aj,kClient:rxs,kBusy:enr,kConnect:nxs,kResuming:$J,kRunning:Ake,kPending:yke,kSize:hke,kQueue:ZP,kConnected:ixs,kConnecting:ufe,kNeedDrain:gj,kKeepAliveDefaultTimeout:C8n,kHostHeader:oxs,kPendingIdx:XP,kRunningIdx:yF,kError:sxs,kPipelining:Pit,kKeepAliveTimeoutValue:axs,kMaxHeadersSize:cxs,kKeepAliveMaxTimeout:lxs,kKeepAliveTimeoutThreshold:uxs,kHeadersTimeout:dxs,kBodyTimeout:fxs,kStrictContentLength:pxs,kConnector:mke,kMaxRequests:tnr,kCounter:hxs,kClose:mxs,kDestroy:gxs,kDispatch:Axs,kLocalAddress:gke,kMaxResponseSize:yxs,kOnError:Exs,kHTTPContext:Kp,kMaxConcurrentStreams:_xs,kHTTP2InitialWindowSize:Cxs,kHTTP2ConnectionWindowSize:vxs,kResume:AF,kPingInterval:bxs}=nl(),Sxs=d8n(),Txs=_8n(),mj=Symbol("kClosedResolve"),Ixs=pke&&pke.maxHeaderSize&&Number.isInteger(pke.maxHeaderSize)&&pke.maxHeaderSize>0?()=>pke.maxHeaderSize:()=>{throw new nd("http module not available or http.maxHeaderSize invalid")},v8n=a(()=>{},"noop");function T8n(t){return t[Pit]??t[Kp]?.defaultPipelining??1}a(T8n,"getPipelining");var rnr=class extends ZIs{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:k,maxConcurrentStreams:D,allowH2:N,useH2c:L,initialWindowSize:B,connectionWindowSize:Q,pingInterval:M}={}){if(d!==void 0)throw new nd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new nd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new nd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new nd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new nd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new nd("invalid maxHeaderSize")}else r=Ixs();if(A!=null&&typeof A!="string")throw new nd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new nd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new nd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new nd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new nd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new nd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new nd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new nd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new nd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||S8n.isIP(w)===0))throw new nd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new nd("maxResponseSize must be a positive number");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new nd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new nd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new nd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new nd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new nd("initialWindowSize must be a positive integer, greater than 0");if(Q!=null&&(!Number.isInteger(Q)||Q<1))throw new nd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new nd("pingInterval must be a positive integer, greater or equal to 0");if(super(),typeof b!="function")b=txs({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:k}:void 0,...b});else{let O=b;b=a((q,F)=>O({...q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},F),"connect")}this[t5]=GJ.parseOrigin(e),this[mke]=b,this[Pit]=y??1,this[cxs]=r,this[C8n]=f??4e3,this[lxs]=m??6e5,this[uxs]=g??2e3,this[axs]=this[C8n],this[Aj]=null,this[gke]=w??null,this[$J]=0,this[gj]=0,this[oxs]=`host: ${this[t5].hostname}${this[t5].port?`:${this[t5].port}`:""}\r -`,this[fxs]=l??3e5,this[dxs]=n??3e5,this[pxs]=_??!0,this[tnr]=T,this[mj]=null,this[yxs]=R>-1?R:-1,this[Kp]=null,this[_xs]=D??100,this[Cxs]=B??262144,this[vxs]=Q??524288,this[bxs]=M??6e4,this[ZP]=[],this[yF]=0,this[XP]=0,this[AF]=O=>nnr(this,O),this[Exs]=O=>I8n(this,O)}get pipelining(){return this[Pit]}set pipelining(e){this[Pit]=e,this[AF](!0)}get stats(){return new KIs(this)}get[yke](){return this[ZP].length-this[XP]}get[Ake](){return this[XP]-this[yF]}get[hke](){return this[ZP].length-this[yF]}get[ixs](){return!!this[Kp]&&!this[ufe]&&!this[Kp].destroyed}get[enr](){return!!(this[Kp]?.busy(null)||this[hke]>=(T8n(this)||1)||this[yke]>0)}[nxs](e){x8n(this),this.once("connect",e)}[Axs](e,r){let n=new JIs(this[t5].origin,e,r);return this[ZP].push(n),this[$J]||(GJ.bodyLength(n.body)==null&&GJ.isIterable(n.body)?(this[$J]=1,queueMicrotask(()=>nnr(this))):this[AF](!0)),this[$J]&&this[gj]!==2&&this[enr]&&(this[gj]=2),this[gj]<2}[mxs](){return new Promise(e=>{this[hke]?this[mj]=e:e(null)})}[gxs](e){return new Promise(r=>{let n=this[ZP].splice(this[XP]);for(let s=0;s{this[mj]&&(this[mj](),this[mj]=null),r(null)},"callback");this[Kp]?(this[Kp].destroy(e,o),this[Kp]=null):queueMicrotask(o),this[AF]()})}};function I8n(t,e){if(t[Ake]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){gF(t[XP]===t[yF]);let r=t[ZP].splice(t[yF]);for(let n=0;n{if(s){Xrr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[AF]();return}if(t.destroyed){GJ.destroy(c.on("error",v8n),new exs),t[AF]();return}gF(c);try{t[Kp]=c.alpnProtocol==="h2"?Txs(t,c):Sxs(t,c)}catch(l){c.destroy().on("error",v8n),Xrr(t,l,{host:e,hostname:r,protocol:n,port:o}),t[AF]();return}t[ufe]=!1,c[hxs]=0,c[tnr]=t[tnr],c[rxs]=t,c[sxs]=null,lfe.connected.hasSubscribers&&lfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Kp]?.version,servername:t[Aj],localAddress:t[gke]},connector:t[mke],socket:c}),t.emit("connect",t[t5],[t]),t[AF]()})}catch(s){Xrr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[AF]()}}a(x8n,"connect");function Xrr(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[ufe]=!1,lfe.connectError.hasSubscribers&&lfe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[Kp]?.version,servername:t[Aj],localAddress:t[gke]},connector:t[mke],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(gF(t[Ake]===0);t[yke]>0&&t[ZP][t[XP]].servername===t[Aj];){let c=t[ZP][t[XP]++];GJ.errorRequest(t,c,e)}else I8n(t,e);t.emit("connectionError",t[t5],[t],e)}}a(Xrr,"handleConnectError");function b8n(t){t[gj]=0,t.emit("drain",t[t5],[t])}a(b8n,"emitDrain");function nnr(t,e){t[$J]!==2&&(t[$J]=2,xxs(t,e),t[$J]=0,t[yF]>256&&(t[ZP].splice(0,t[yF]),t[XP]-=t[yF],t[yF]=0))}a(nnr,"resume");function xxs(t,e){for(;;){if(t.destroyed){gF(t[yke]===0);return}if(t[mj]&&!t[hke]){t[mj](),t[mj]=null;return}if(t[Kp]&&t[Kp].resume(),t[enr])t[gj]=2;else if(t[gj]===2){e?(t[gj]=1,queueMicrotask(()=>b8n(t))):b8n(t);continue}if(t[yke]===0||t[Ake]>=(T8n(t)||1))return;let r=t[ZP][t[XP]];if(r===null)return;if(t[t5].protocol==="https:"&&t[Aj]!==r.servername){if(t[Ake]>0)return;t[Aj]=r.servername,t[Kp]?.destroy(new XIs("servername changed"),()=>{t[Kp]=null,nnr(t)})}if(t[ufe])return;if(!t[Kp]){x8n(t);return}if(t[Kp].destroyed||t[Kp].busy(r))return;!r.aborted&&t[Kp].write(r)?t[XP]++:t[ZP].splice(t[XP],1)}}a(xxs,"_resume");w8n.exports=rnr});var inr=I((ntf,R8n)=>{"use strict";p();var Dit=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)}};R8n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Dit}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Dit),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 Nit=I((stf,F8n)=>{"use strict";p();var{PoolStats:wxs}=Vtr(),Rxs=FJ(),kxs=inr(),{kConnected:onr,kSize:k8n,kRunning:P8n,kPending:D8n,kQueued:Eke,kBusy:Pxs,kFree:Dxs,kUrl:Nxs,kClose:Mxs,kDestroy:Oxs,kDispatch:Bxs}=nl(),Eg=Symbol("clients"),z_=Symbol("needDrain"),_ke=Symbol("queue"),snr=Symbol("closed resolve"),anr=Symbol("onDrain"),N8n=Symbol("onConnect"),M8n=Symbol("onDisconnect"),O8n=Symbol("onConnectionError"),cnr=Symbol("get dispatcher"),B8n=Symbol("add client"),L8n=Symbol("remove client"),lnr=class extends Rxs{static{a(this,"PoolBase")}[_ke]=new kxs;[Eke]=0;[Eg]=[];[z_]=!1;[anr](e,r,n){let o=this[_ke],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[Eke]--,s=!e.dispatch(c.opts,c.handler)}if(e[z_]=s,!s&&this[z_]&&(this[z_]=!1,this.emit("drain",r,[this,...n])),this[snr]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[M8n]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[O8n]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[Pxs](){return this[z_]}get[onr](){let e=0;for(let{[onr]:r}of this[Eg])e+=r;return e}get[Dxs](){let e=0;for(let{[onr]:r,[z_]:n}of this[Eg])e+=r&&!n;return e}get[D8n](){let e=this[Eke];for(let{[D8n]:r}of this[Eg])e+=r;return e}get[P8n](){let e=0;for(let{[P8n]:r}of this[Eg])e+=r;return e}get[k8n](){let e=this[Eke];for(let{[k8n]:r}of this[Eg])e+=r;return e}get stats(){return new wxs(this)}[Mxs](){if(this[_ke].isEmpty()){let e=[];for(let r=0;r{this[snr]=e})}[Oxs](e){for(;;){let n=this[_ke].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Eg].length);for(let n=0;n{this[z_]&&this[anr](e,e[Nxs],[e,this])}),this}[L8n](e){e.close(()=>{let r=this[Eg].indexOf(e);r!==-1&&this[Eg].splice(r,1)}),this[z_]=this[Eg].some(r=>!r[z_]&&r.closed!==!0&&r.destroyed!==!0)}};F8n.exports={PoolBase:lnr,kClients:Eg,kNeedDrain:z_,kAddClient:B8n,kRemoveClient:L8n,kGetDispatcher:cnr}});var VJ=I((ltf,j8n)=>{"use strict";p();var{PoolBase:Lxs,kClients:Mit,kNeedDrain:Fxs,kAddClient:Uxs,kGetDispatcher:Qxs,kRemoveClient:qxs}=Nit(),jxs=yj(),{InvalidArgumentError:unr}=ao(),U8n=Do(),{kUrl:Q8n}=nl(),Hxs=UJ(),Oit=Symbol("options"),dnr=Symbol("connections"),q8n=Symbol("factory");function Gxs(t,e){return new jxs(t,e)}a(Gxs,"defaultFactory");var fnr=class extends Lxs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Gxs,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 unr("invalid connections");if(typeof n!="function")throw new unr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new unr("connect must be a function or an object");typeof o!="function"&&(o=Hxs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[dnr]=r||null,this[Q8n]=U8n.parseOrigin(e),this[Oit]={...U8n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Oit].interceptors=g.interceptors?{...g.interceptors}:void 0,this[q8n]=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[Mit].indexOf(_);v!==-1&&this[Mit].splice(v,1)}})}[Qxs](){let e=this[Oit].clientTtl;for(let r of this[Mit])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[qxs](r);else if(!r[Fxs])return r;if(!this[dnr]||this[Mit].length{"use strict";p();var{BalancedPoolMissingUpstreamError:$xs,InvalidArgumentError:Vxs}=ao(),{PoolBase:Wxs,kClients:wA,kNeedDrain:Cke,kAddClient:zxs,kRemoveClient:Yxs,kGetDispatcher:Kxs}=Nit(),Jxs=VJ(),{kUrl:Bit}=nl(),Lit=Do(),H8n=Symbol("factory"),vke=Symbol("options"),G8n=Symbol("kGreatestCommonDivisor"),WJ=Symbol("kCurrentWeight"),zJ=Symbol("kIndex"),yw=Symbol("kWeight"),Fit=Symbol("kMaxWeightPerServer"),Uit=Symbol("kErrorPenalty");function Zxs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Zxs,"getGreatestCommonDivisor");function Xxs(t,e){return new Jxs(t,e)}a(Xxs,"defaultFactory");var pnr=class extends Wxs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Xxs,...n}={}){if(typeof r!="function")throw new Vxs("factory must be a function.");super(),this[vke]={...Lit.deepClone(n)},this[vke].interceptors=n.interceptors?{...n.interceptors}:void 0,this[zJ]=-1,this[WJ]=0,this[Fit]=this[vke].maxWeightPerServer||100,this[Uit]=this[vke].errorPenalty||15,Array.isArray(e)||(e=[e]),this[H8n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Lit.parseOrigin(e).origin;if(this[wA].find(o=>o[Bit].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[H8n](r,this[vke]);this[zxs](n),n.on("connect",()=>{n[yw]=Math.min(this[Fit],n[yw]+this[Uit])}),n.on("connectionError",()=>{n[yw]=Math.max(1,n[yw]-this[Uit]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[yw]=Math.max(1,n[yw]-this[Uit]),this._updateBalancedPoolStats())});for(let o of this[wA])o[yw]=this[Fit];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Bit].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Yxs](n),this}getUpstream(e){let r=Lit.parseOrigin(e).origin;return this[wA].find(n=>n[Bit].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[wA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Bit].origin)}[Kxs](){if(this[wA].length===0)throw new $xs;if(!this[wA].find(s=>!s[Cke]&&s.closed!==!0&&s.destroyed!==!0)||this[wA].map(s=>s[Cke]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[wA].findIndex(s=>!s[Cke]);for(;n++this[wA][o][yw]&&!s[Cke]&&(o=this[zJ]),this[zJ]===0&&(this[WJ]=this[WJ]-this[G8n],this[WJ]<=0&&(this[WJ]=this[Fit])),s[yw]>=this[WJ]&&!s[Cke])return s}return this[WJ]=this[wA][o][yw],this[zJ]=o,this[wA][o]}};$8n.exports=pnr});var K8n=I((mtf,Y8n)=>{"use strict";p();var{PoolBase:ews,kClients:Qit,kNeedDrain:tws,kAddClient:W8n,kGetDispatcher:rws,kRemoveClient:nws}=Nit(),iws=yj(),{InvalidArgumentError:hnr}=ao(),z8n=Do(),{kUrl:mnr}=nl(),ows=UJ(),bke=Symbol("options"),gnr=Symbol("connections"),Anr=Symbol("factory"),qit=Symbol("index");function sws(t,e){return new iws(t,e)}a(sws,"defaultFactory");var ynr=class extends ews{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=sws,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 hnr("invalid connections");if(typeof n!="function")throw new hnr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new hnr("connect must be a function or an object");typeof o!="function"&&(o=ows({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[gnr]=r||null,this[mnr]=z8n.parseOrigin(e),this[bke]={...z8n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[bke].interceptors=g.interceptors?{...g.interceptors}:void 0,this[Anr]=n,this[qit]=-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[Qit].indexOf(_);v!==-1&&this[Qit].splice(v,1)}})}[rws](){let e=this[bke].clientTtl,r=this[Qit].length;if(r===0){let o=this[Anr](this[mnr],this[bke]);return this[W8n](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[nws](o),n++;continue}if(!o[tws])return o;n++}if(!this[gnr]||r{"use strict";p();var{InvalidArgumentError:jit,MaxOriginsReachedError:aws}=ao(),{kClients:Ew,kRunning:J8n,kClose:cws,kDestroy:lws,kDispatch:uws,kUrl:dws}=nl(),fws=FJ(),pws=VJ(),hws=yj(),mws=Do(),Z8n=Symbol("onConnect"),X8n=Symbol("onDisconnect"),e6n=Symbol("onConnectionError"),t6n=Symbol("onDrain"),r6n=Symbol("factory"),Enr=Symbol("options"),Ske=Symbol("origins");function gws(t,e){return e&&e.connections===1?new hws(t,e):new pws(t,e)}a(gws,"defaultFactory");var _nr=class extends fws{static{a(this,"Agent")}constructor({factory:e=gws,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new jit("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new jit("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new jit("maxOrigins must be a number greater than 0");super(),n&&typeof n!="function"&&(n={...n}),this[Enr]={...mws.deepClone(o),maxOrigins:r,connect:n},this[r6n]=e,this[Ew]=new Map,this[Ske]=new Set,this[t6n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[Z8n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[X8n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[e6n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[J8n](){let e=0;for(let{dispatcher:r}of this[Ew].values())e+=r[J8n];return e}[uws](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new jit("opts.origin must be a non-empty string or URL.");if(this[Ske].size>=this[Enr].maxOrigins&&!this[Ske].has(n))throw new aws;let o=this[Ew].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[Ew].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[Ew].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[Ske].delete(n))},"closeClientIfUnused");s=this[r6n](e.origin,this[Enr]).on("drain",this[t6n]).on("connect",(l,u)=>{let d=this[Ew].get(n);d&&(d.count+=1),this[Z8n](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[X8n](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[e6n](l,u,d)}),this[Ew].set(n,{count:0,dispatcher:s}),this[Ske].add(n)}return s.dispatch(e,r)}[cws](){let e=[];for(let{dispatcher:r}of this[Ew].values())e.push(r.close());return this[Ew].clear(),Promise.all(e)}[lws](e){let r=[];for(let{dispatcher:n}of this[Ew].values())r.push(n.destroy(e));return this[Ew].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[Ew].values())r.stats&&(e[r[dws].origin]=r.stats);return e}};n6n.exports=_nr});var a6n=I((Ctf,s6n)=>{"use strict";p();var{Buffer:_j}=require("node:buffer"),i6n=require("node:net"),{InvalidArgumentError:Ej}=ao();function Aws(t){if(i6n.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:_j.from(r)}}if(i6n.isIPv6(t))return{type:4,buffer:o6n(t)};let e=_j.from(t,"utf8");if(e.length>255)throw new Ej("Domain name too long (max 255 bytes)");return{type:3,buffer:_j.concat([_j.from([e.length]),e])}}a(Aws,"parseAddress");function o6n(t){let e=_j.alloc(16),r=t.indexOf("::");if(r!==-1){let n=t.slice(0,r),o=t.slice(r+2),s=n===""?[]:n.split(":"),c=o===""?[]:o.split(":"),l=0;for(let u of s)e.writeUInt16BE(parseInt(u,16),l),l+=2;l=16-c.length*2;for(let u of c)e.writeUInt16BE(parseInt(u,16),l),l+=2}else{let n=t.split(":");for(let o=0;o{"use strict";p();var{EventEmitter:Cws}=require("node:events"),{Buffer:KJ}=require("node:buffer"),{InvalidArgumentError:Tke,Socks5ProxyError:Cj}=ao(),{debuglog:vws}=require("node:util"),{parseAddress:bws}=a6n(),EF=vws("undici:socks5"),c6n=KJ.alloc(0),Hit=5,dfe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},l6n={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},JJ={IPV4:1,DOMAIN:3,IPV6:4},r5={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},cT={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Cnr=class extends Cws{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new Tke("socket is required");this.socket=e,this.options=r,this.state=cT.INITIAL,this.buffer=c6n,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(dfe.USERNAME_PASSWORD),this.authMethods.push(dfe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){EF("received data",e.length,"bytes in state",this.state),this.buffer=KJ.concat([this.buffer,e]);try{switch(this.state){case cT.HANDSHAKING:this.handleHandshakeResponse();break;case cT.AUTHENTICATING:this.handleAuthResponse();break;case cT.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){EF("socket error",e),this.state=cT.ERROR,this.emit("error",e),this.destroy()}onClose(){EF("socket closed"),this.state=cT.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}handshake(){if(this.state!==cT.INITIAL)throw new Tke("Handshake already started");EF("starting handshake with",this.authMethods.length,"auth methods"),this.state=cT.HANDSHAKING;let e=KJ.alloc(2+this.authMethods.length);e[0]=Hit,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!==Hit)throw new Cj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===dfe.NO_ACCEPTABLE)throw new Cj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),EF("server selected auth method",r),r===dfe.NO_AUTH)this.emit("authenticated");else if(r===dfe.USERNAME_PASSWORD)this.state=cT.AUTHENTICATING,this.sendAuthRequest();else throw new Cj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new Tke("Username and password required for authentication");EF("sending username/password auth");let n=KJ.from(e),o=KJ.from(r);if(n.length>255||o.length>255)throw new Tke("Username or password too long");let s=KJ.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 Cj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new Cj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),EF("authentication successful"),this.emit("authenticated")}connect(e,r){if(this.state===cT.CONNECTED)throw new Tke("Already connected");EF("connecting to",e,r),this.state=cT.CONNECTING;let n=this.buildConnectRequest(l6n.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=bws(r),c=KJ.alloc(4+s.length+2);return c[0]=Hit,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!==Hit)throw new Cj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===JJ.IPV4)o+=6;else if(n===JJ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===JJ.IPV6)o+=18;else throw new Cj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var Sws=require("node:net"),{URL:f6n}=require("node:url"),vnr,Tws=FJ(),{InvalidArgumentError:p6n}=ao(),{Socks5Client:Iws}=d6n(),{kDispatch:h6n,kClose:xws,kDestroy:wws}=nl(),Rws=VJ(),kws=UJ(),{debuglog:Pws}=require("node:util"),vj=Pws("undici:socks5-proxy"),bnr=Symbol("proxy url"),Dws=Symbol("proxy headers"),m6n=Symbol("proxy auth"),n5=Symbol("pool"),Nws=Symbol("connector"),g6n=!1,Snr=class extends Tws{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),g6n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),g6n=!0),!e)throw new p6n("Proxy URL is mandatory");let n=typeof e=="string"?new f6n(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new p6n("Proxy URL must use socks5:// or socks:// protocol");this[bnr]=n,this[Dws]=r.headers||{},this[m6n]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[Nws]=r.connect||kws({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[n5]=null}async createSocks5Connection(e,r){let n=this[bnr].hostname,o=parseInt(this[bnr].port)||1080;vj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{let d=a(()=>{h.removeListener("error",f),l(h)},"onConnect"),f=a(m=>{h.removeListener("connect",d),u(m)},"onError"),h=Sws.connect({host:n,port:o});h.once("connect",d),h.once("error",f)}),c=new Iws(s,this[m6n]);return c.on("error",l=>{vj("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==="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=>{vj("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}async[h6n](e,r){let{origin:n}=e;vj("dispatching request to",n,"via SOCKS5");try{return(!this[n5]||this[n5].destroyed||this[n5].closed)&&(this[n5]=new Rws(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(o,s)=>{try{let c=new f6n(n),l=c.hostname,u=parseInt(c.port)||(c.protocol==="https:"?443:80);vj("establishing SOCKS5 connection to",l,u);let d=await this.createSocks5Connection(l,u),f=d;c.protocol==="https:"&&(vnr||(vnr=require("node:tls")),vj("upgrading to TLS"),f=vnr.connect({socket:d,servername:l,...o.tls||{}}),await new Promise((h,m)=>{f.once("secureConnect",h),f.once("error",m)})),s(null,f)}catch(c){vj("SOCKS5 connection error:",c),s(c)}},"connect")})),this[n5][h6n](e,r)}catch(o){if(vj("dispatch error:",o),typeof r.onError=="function")r.onError(o);else throw o}}async[xws](){this[n5]&&await this[n5].close()}async[wws](e){this[n5]&&await this[n5].destroy(e)}};A6n.exports=Snr});var Rnr=I((ktf,R6n)=>{"use strict";p();var{kProxy:ffe,kClose:S6n,kDestroy:T6n,kDispatch:y6n}=nl(),Mws=YJ(),I6n=VJ(),x6n=FJ(),{InvalidArgumentError:ZJ,RequestAbortedError:Ows,SecureProxyConnectionError:Bws}=ao(),E6n=UJ(),w6n=yj(),{channels:_6n}=cj(),Lws=Tnr(),Git=Symbol("proxy agent"),bj=Symbol("proxy client"),_F=Symbol("proxy headers"),Inr=Symbol("request tls settings"),C6n=Symbol("proxy tls settings"),v6n=Symbol("connect endpoint function"),b6n=Symbol("tunnel proxy");function Fws(t){return t==="https:"?443:80}a(Fws,"defaultProtocolPort");function Uws(t,e){return new I6n(t,e)}a(Uws,"defaultFactory");var Qws=a(()=>{},"noop");function qws(t,e){return e.connections===1?new w6n(t,e):new I6n(t,e)}a(qws,"defaultAgentFactory");var xnr=class extends x6n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new ZJ("Proxy URL is mandatory");super(),this[_F]=r,o?this.#e=o(e,{connect:n}):this.#e=new w6n(e,{connect:n})}[y6n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new ZJ("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[_F],...c},this.#e[y6n](e,r)}[S6n](){return this.#e.close()}[T6n](e){return this.#e.destroy(e)}},wnr=class extends x6n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new ZJ("Proxy uri is mandatory");let{clientFactory:r=Uws}=e;if(typeof r!="function")throw new ZJ("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[ffe]={uri:s,protocol:u},this[Inr]=e.requestTls,this[C6n]=e.proxyTls,this[_F]=e.headers||{},this[b6n]=n,e.auth&&e.token)throw new ZJ("opts.auth cannot be used in combination with opts.token");e.auth?this[_F]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[_F]["proxy-authorization"]=e.token:d&&f&&(this[_F]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=E6n({...e.proxyTls});this[v6n]=E6n({...e.requestTls});let g=e.factory||qws,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[ffe].protocol==="socks5:"||this[ffe].protocol==="socks:"?new Lws(this[ffe].uri,{headers:this[_F],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls}):!this[b6n]&&_==="http:"&&this[ffe].protocol==="http:"?new xnr(this[ffe].uri,{headers:this[_F],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[bj]=null:this[bj]=r(o,{connect:m}),this[Git]=new Mws({...e,factory:A,connect:a(async(y,E)=>{if(!this[bj]){E(new ZJ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${Fws(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[_F],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[C6n]?.servername||h},{socket:b,statusCode:T}=await this[bj].connect(v);if(T!==200){b.on("error",Qws).destroy(),E(new Ows(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(_6n.proxyConnected.hasSubscribers&&_6n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Inr]?w=this[Inr].servername:w=y.servername,this[v6n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Bws(v)):E(v)}},"connect")})}dispatch(e,r){let n=jws(e.headers);if(Hws(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[Git].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[S6n](){let e=[this[Git].close()];return this[bj]&&e.push(this[bj].close()),Promise.all(e)}[T6n](){let e=[this[Git].destroy()];return this[bj]&&e.push(this[bj].destroy()),Promise.all(e)}};function jws(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new ZJ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Hws,"throwIfProxyAuthIsSent");R6n.exports=wnr});var M6n=I((Ntf,N6n)=>{"use strict";p();var Gws=FJ(),{kClose:$ws,kDestroy:Vws,kClosed:k6n,kDestroyed:P6n,kDispatch:Wws,kNoProxyAgent:Ike,kHttpProxyAgent:Sj,kHttpsProxyAgent:XJ}=nl(),D6n=Rnr(),zws=YJ(),Yws={"http:":80,"https:":443},knr=class extends Gws{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[Ike]=new zws(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Sj]=new D6n({...s,uri:c}):this[Sj]=this[Ike];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[XJ]=new D6n({...s,uri:l}):this[XJ]=this[Sj],this.#o()}[Wws](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[$ws](){return Promise.all([this[Ike].close(),!this[Sj][k6n]&&this[Sj].close(),!this[XJ][k6n]&&this[XJ].close()])}[Vws](e){return Promise.all([this[Ike].destroy(e),!this[Sj][P6n]&&this[Sj].destroy(e),!this[XJ][P6n]&&this[XJ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Yws[r]||0,this.#i(n,o)?r==="https:"?this[XJ]:this[Sj]:this[Ike]}#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 pfe=require("node:assert"),{kRetryHandlerDefaultRetry:O6n}=nl(),{RequestRetryError:xke}=ao(),Kws=YRe(),{isDisturbed:B6n,parseRangeHeader:L6n,wrapRequestBody:Jws}=Do();function Zws(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(Zws,"calculateRetryAfterHeader");var Pnr=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=Kws.wrap(n),this.opts={...s,body:Jws(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[O6n],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(B6n(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[O6n](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)?Zws(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 xke("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 xke("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=L6n(n["content-range"]);if(!s)throw new xke("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new xke("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;pfe(this.start===c,"content-range mismatch"),pfe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=L6n(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;pfe(c!=null&&Number.isFinite(c),"content-range mismatch"),pfe(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}pfe(Number.isFinite(this.start)),pfe(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 xke("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||B6n(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))}};F6n.exports=Pnr});var Q6n=I((Utf,U6n)=>{"use strict";p();var Xws=KRe(),eRs=$it(),Dnr=class extends Xws{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 eRs({...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()}};U6n.exports=Dnr});var H6n=I((jtf,j6n)=>{"use strict";p();var{InvalidArgumentError:q6n}=ao(),tRs=yj(),Nnr=class extends tRs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new q6n("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 q6n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};j6n.exports=Nnr});var Z6n=I(($tf,J6n)=>{"use strict";p();var W6n=require("node:assert"),{Readable:rRs}=require("node:stream"),{RequestAbortedError:z6n,NotSupportedError:nRs,InvalidArgumentError:iRs,AbortError:Vit}=ao(),Y6n=Do(),{ReadableStreamFrom:oRs}=Do(),lT=Symbol("kConsume"),Wit=Symbol("kReading"),eZ=Symbol("kBody"),G6n=Symbol("kAbort"),K6n=Symbol("kContentType"),Mnr=Symbol("kContentLength"),Onr=Symbol("kUsed"),zit=Symbol("kBytesRead"),sRs=a(()=>{},"noop"),Bnr=class extends rRs{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[G6n]=r,this[lT]=null,this[zit]=0,this[eZ]=null,this[Onr]=!1,this[K6n]=n,this[Mnr]=Number.isFinite(o)?o:null,this[Wit]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new z6n),e&&this[G6n](),this[Onr]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[Wit]=!0,this[Onr]=!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[Wit]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[zit]+=e.length,this[lT])?(Fnr(this[lT],e),this[Wit]?super.push(e):!0):super.push(e)}text(){return wke(this,"text")}json(){return wke(this,"json")}blob(){return wke(this,"blob")}bytes(){return wke(this,"bytes")}arrayBuffer(){return wke(this,"arrayBuffer")}async formData(){throw new nRs}get bodyUsed(){return Y6n.isDisturbed(this)}get body(){return this[eZ]||(this[eZ]=oRs(this),this[lT]&&(this[eZ].getReader(),W6n(this[eZ].locked))),this[eZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new iRs("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 Vit):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Mnr]&&this[Mnr]>n||this[zit]>n)&&this.destroy(new Vit),r){let c=a(()=>{this.destroy(r.reason??new Vit)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new Vit):o(null)})}else this.on("close",o);this.on("error",sRs).on("data",()=>{this[zit]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function aRs(t){return t[eZ]?.locked===!0||t[lT]!==null}a(aRs,"isLocked");function cRs(t){return Y6n.isDisturbed(t)||aRs(t)}a(cRs,"isUnusable");function wke(t,e){return W6n(!t[lT]),new Promise((r,n)=>{if(cRs(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[lT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Unr(this[lT],o)}).on("close",function(){this[lT].body!==null&&Unr(this[lT],new z6n)}),lRs(t[lT])})})}a(wke,"consume");function lRs(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(Lnr,"chunksDecode");function $6n(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 uRs=require("node:assert"),{AsyncResource:dRs}=require("node:async_hooks"),{Readable:fRs}=Z6n(),{InvalidArgumentError:hfe,RequestAbortedError:X6n}=ao(),_w=Do();function Rke(){}a(Rke,"noop");var Yit=class extends dRs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new hfe("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 hfe("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new hfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new hfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new hfe("invalid method");if(l&&typeof l!="function")throw new hfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw _w.isStream(c)&&_w.destroy(c.on("error",Rke),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 X6n:n&&(this.removeAbortListener=_w.addAbortListener(n,()=>{this.reason=n.reason??new X6n,this.res?_w.destroy(this.res.on("error",Rke),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}uRs(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"?_w.parseRawHeaders(r):_w.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?_w.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new fRs({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,_w.destroy(y.on("error",Rke),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){_w.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(()=>{_w.destroy(r.on("error",Rke),e)})),o&&(this.body=null,_w.isStream(o)&&(o.on("error",Rke),_w.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function e9n(t,e){if(e===void 0)return new Promise((r,n)=>{e9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Yit(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(e9n,"request");Qnr.exports=e9n;Qnr.exports.RequestHandler=Yit});var kke=I((Jtf,i9n)=>{"use strict";p();var{addAbortListener:pRs}=Do(),{RequestAbortedError:hRs}=ao(),mfe=Symbol("kListener"),i5=Symbol("kSignal");function r9n(t){t.abort?t.abort(t[i5]?.reason):t.reason=t[i5]?.reason??new hRs,n9n(t)}a(r9n,"abort");function mRs(t,e){if(t.reason=null,t[i5]=null,t[mfe]=null,!!e){if(e.aborted){r9n(t);return}t[i5]=e,t[mfe]=()=>{r9n(t)},pRs(t[i5],t[mfe])}}a(mRs,"addSignal");function n9n(t){t[i5]&&("removeEventListener"in t[i5]?t[i5].removeEventListener("abort",t[mfe]):t[i5].removeListener("abort",t[mfe]),t[i5]=null,t[mfe]=null)}a(n9n,"removeSignal");i9n.exports={addSignal:mRs,removeSignal:n9n}});var c9n=I((erf,a9n)=>{"use strict";p();var gRs=require("node:assert"),{finished:ARs}=require("node:stream"),{AsyncResource:yRs}=require("node:async_hooks"),{InvalidArgumentError:gfe,InvalidReturnValueError:ERs}=ao(),CF=Do(),{addSignal:_Rs,removeSignal:o9n}=kke();function CRs(){}a(CRs,"noop");var qnr=class extends yRs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new gfe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new gfe("invalid callback");if(typeof r!="function")throw new gfe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new gfe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new gfe("invalid method");if(u&&typeof u!="function")throw new gfe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw CF.isStream(l)&&CF.destroy(l.on("error",CRs),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,CF.isStream(l)&&l.on("error",f=>{this.onError(f)}),_Rs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}gRs(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"?CF.parseRawHeaders(r):CF.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 ERs("expected Writable");return ARs(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&CF.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;o9n(this),r&&(this.trailers=CF.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;o9n(this),this.factory=null,r?(this.res=null,CF.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,CF.destroy(s,e))}};function s9n(t,e,r){if(r===void 0)return new Promise((n,o)=>{s9n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new qnr(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(s9n,"stream");a9n.exports=s9n});var f9n=I((nrf,d9n)=>{"use strict";p();var{Readable:u9n,Duplex:vRs,PassThrough:bRs}=require("node:stream"),SRs=require("node:assert"),{AsyncResource:TRs}=require("node:async_hooks"),{InvalidArgumentError:Pke,InvalidReturnValueError:IRs,RequestAbortedError:jnr}=ao(),s5=Do(),{addSignal:xRs,removeSignal:wRs}=kke();function l9n(){}a(l9n,"noop");var Afe=Symbol("resume"),Hnr=class extends u9n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Afe]=null}_read(){let{[Afe]:e}=this;e&&(this[Afe]=null,e())}_destroy(e,r){this._read(),r(e)}},Gnr=class extends u9n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Afe]=e}_read(){this[Afe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new jnr),r(e)}},$nr=class extends TRs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Pke("invalid opts");if(typeof r!="function")throw new Pke("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 Pke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Pke("invalid method");if(c&&typeof c!="function")throw new Pke("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 Hnr().on("error",l9n),this.ret=new vRs({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[Afe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new jnr),A&&u&&A(),s5.destroy(f,u),s5.destroy(h,u),s5.destroy(m,u),wRs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,xRs(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}SRs(!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"?s5.parseRawHeaders(r):s5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Gnr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?s5.parseRawHeaders(r):s5.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",l9n),u}if(!l||typeof l.on!="function")throw new IRs("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;s5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||s5.destroy(u,new jnr)}),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,s5.destroy(r,e)}};function RRs(t,e){try{let r=new $nr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new bRs().destroy(r)}}a(RRs,"pipeline");d9n.exports=RRs});var y9n=I((srf,A9n)=>{"use strict";p();var{InvalidArgumentError:Vnr,SocketError:kRs}=ao(),{AsyncResource:PRs}=require("node:async_hooks"),p9n=require("node:assert"),h9n=Do(),{kHTTP2Stream:DRs}=nl(),{addSignal:NRs,removeSignal:m9n}=kke(),Wnr=class extends PRs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Vnr("invalid opts");if(typeof r!="function")throw new Vnr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Vnr("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,NRs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}p9n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new kRs("bad upgrade",null)}onUpgrade(e,r,n){p9n(n[DRs]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;m9n(this),this.callback=null;let l=this.responseHeaders==="raw"?h9n.parseRawHeaders(r):h9n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;m9n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function g9n(t,e){if(e===void 0)return new Promise((r,n)=>{g9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Wnr(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(g9n,"upgrade");A9n.exports=g9n});var b9n=I((lrf,v9n)=>{"use strict";p();var MRs=require("node:assert"),{AsyncResource:ORs}=require("node:async_hooks"),{InvalidArgumentError:znr,SocketError:BRs}=ao(),E9n=Do(),{addSignal:LRs,removeSignal:_9n}=kke(),Ynr=class extends ORs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new znr("invalid opts");if(typeof r!="function")throw new znr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new znr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,LRs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}MRs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new BRs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;_9n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?E9n.parseRawHeaders(r):E9n.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;_9n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function C9n(t,e){if(e===void 0)return new Promise((r,n)=>{C9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Ynr(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(C9n,"connect");v9n.exports=C9n});var S9n=I((frf,yfe)=>{"use strict";p();yfe.exports.request=t9n();yfe.exports.stream=c9n();yfe.exports.pipeline=f9n();yfe.exports.upgrade=y9n();yfe.exports.connect=b9n()});var Jnr=I((hrf,I9n)=>{"use strict";p();var{UndiciError:FRs}=ao(),T9n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Knr=class extends FRs{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[T9n]===!0}get[T9n](){return!0}};I9n.exports={MockNotMatchedError:Knr}});var tZ=I((Arf,x9n)=>{"use strict";p();x9n.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 Dke=I((Erf,F9n)=>{"use strict";p();var{MockNotMatchedError:Efe}=Jnr(),{kDispatches:rZ,kMockAgent:URs,kOriginalDispatch:QRs,kOrigin:qRs,kGetNetConnect:jRs,kTotalDispatchCount:eir}=tZ(),{serializePathWithQuery:HRs}=Do(),{STATUS_CODES:GRs}=require("node:http"),{types:{isPromise:$Rs}}=require("node:util"),{InvalidArgumentError:Znr}=ao();function c5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(c5,"matchValue");function R9n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(R9n,"lowerCaseEntries");function k9n(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=k9n(e,r);if(!c5(n,o))return!1}return!0}a(P9n,"matchHeaders");function VRs(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(VRs,"normalizeSearchParams");function Xnr(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(Xnr,"safeUrl");function WRs(t,{path:e,method:r,body:n,headers:o}){let s=c5(t.path,e),c=c5(t.method,r),l=typeof t.body<"u"?c5(t.body,n):!0,u=P9n(t,o);return s&&c&&l&&u}a(WRs,"matchKey");function D9n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(D9n,"getResponseData");function N9n(t,e){let r=e.query?HRs(e.path,e.query):e.path,n=typeof r=="string"?Xnr(r):r,o=w9n(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?c5(w9n(Xnr(c)),o):c5(Xnr(c),n));if(s.length===0)throw new Efe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>c5(c,e.method)),s.length===0)throw new Efe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?c5(c,e.body):!0),s.length===0)throw new Efe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>P9n(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Efe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(N9n,"getMockDispatch");function zRs(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[eir]=(t[eir]||0)+1,c}a(zRs,"addMockDispatch");function tir(t,e){let r=t.findIndex(n=>n.consumed?WRs(n,e):!1);r!==-1&&t.splice(r,1)}a(tir,"deleteMockDispatch");function w9n(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(w9n,"removeTrailingSlash");function M9n(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(M9n,"buildKey");function rir(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[rZ])},d):E(this[rZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?nir(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if($Rs(w))return w.then(D=>E(v,D));if(g)return;let R=D9n(w),x=rir(c),k=rir(l);e.onHeaders?.(o,x,_,O9n(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(k),tir(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(B9n,"mockDispatch");function KRs(){let t=this[URs],e=this[qRs],r=this[QRs];return a(function(o,s){if(t.isMockActive)try{B9n.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[jRs](),u=this[rZ][eir]||this[rZ].length,f=`, ${this[rZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Efe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(L9n(l,e))r.call(this,o,s);else throw new Efe(`${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(KRs,"buildMockDispatch");function L9n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>c5(n,r.host)))}a(L9n,"checkNetConnect");function JRs(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(JRs,"normalizeOrigin");function ZRs(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new Znr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new Znr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new Znr("options.ignoreTrailingSlash must to be a boolean");return r}a(ZRs,"buildAndValidateMockOptions");F9n.exports={getResponseData:D9n,getMockDispatch:N9n,addMockDispatch:zRs,deleteMockDispatch:tir,buildKey:M9n,generateKeyValues:rir,matchValue:c5,getResponse:YRs,getStatusText:O9n,mockDispatch:B9n,buildMockDispatch:KRs,checkNetConnect:L9n,buildAndValidateMockOptions:ZRs,getHeaderByName:k9n,buildHeadersFromArray:nir,normalizeSearchParams:VRs,normalizeOrigin:JRs}});var uir=I((vrf,lir)=>{"use strict";p();var{getResponseData:XRs,buildKey:eks,addMockDispatch:iir}=Dke(),{kDispatches:Kit,kDispatchKey:Jit,kDefaultHeaders:oir,kDefaultTrailers:sir,kContentLength:air,kMockDispatch:Zit,kIgnoreTrailingSlash:Xit}=tZ(),{InvalidArgumentError:l5}=ao(),{serializePathWithQuery:tks}=Do(),_fe=class{static{a(this,"MockScope")}constructor(e){this[Zit]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new l5("waitInMs must be a valid integer > 0");return this[Zit].delay=e,this}persist(){return this[Zit].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new l5("repeatTimes must be a valid integer > 0");return this[Zit].times=e,this}},cir=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new l5("opts must be an object");if(typeof e.path>"u")throw new l5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=tks(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[Jit]=eks(e),this[Kit]=r,this[Xit]=e.ignoreTrailingSlash??!1,this[oir]={},this[sir]={},this[air]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=XRs(r),s=this[air]?{"content-length":o.length}:{},c={...this[oir],...s,...n.headers},l={...this[sir],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new l5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new l5("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 l5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=iir(this[Kit],this[Jit],s,{ignoreTrailingSlash:this[Xit]});return new _fe(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=iir(this[Kit],this[Jit],n,{ignoreTrailingSlash:this[Xit]});return new _fe(o)}replyWithError(e){if(typeof e>"u")throw new l5("error must be defined");let r=iir(this[Kit],this[Jit],{error:e},{ignoreTrailingSlash:this[Xit]});return new _fe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new l5("headers must be defined");return this[oir]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new l5("trailers must be defined");return this[sir]=e,this}replyContentLength(){return this[air]=!0,this}};lir.exports.MockInterceptor=cir;lir.exports.MockScope=_fe});var hir=I((Trf,$9n)=>{"use strict";p();var{promisify:rks}=require("node:util"),nks=yj(),{buildMockDispatch:iks}=Dke(),{kDispatches:dir,kMockAgent:U9n,kClose:Q9n,kOriginalClose:q9n,kOrigin:j9n,kOriginalDispatch:oks,kConnected:fir,kIgnoreTrailingSlash:H9n}=tZ(),{MockInterceptor:sks}=uir(),G9n=nl(),{InvalidArgumentError:aks}=ao(),pir=class extends nks{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new aks("Argument opts.agent must implement Agent");super(e,r),this[U9n]=r.agent,this[j9n]=e,this[H9n]=r.ignoreTrailingSlash??!1,this[dir]=[],this[fir]=1,this[oks]=this.dispatch,this[q9n]=this.close.bind(this),this.dispatch=iks.call(this),this.close=this[Q9n]}get[G9n.kConnected](){return this[fir]}intercept(e){return new sks(e&&{ignoreTrailingSlash:this[H9n],...e},this[dir])}cleanMocks(){this[dir]=[]}async[Q9n](){await rks(this[q9n])(),this[fir]=0,this[U9n][G9n.kClients].delete(this[j9n])}};$9n.exports=pir});var Air=I((wrf,gir)=>{"use strict";p();var{kMockCallHistoryAddLog:cks}=tZ(),{InvalidArgumentError:xj}=ao();function Tj(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 xj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(Tj,"handleFilterCallsWithOptions");function lks(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new xj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(lks,"buildAndValidateFilterCallsOptions");function Ij(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 xj(`${t} parameter should be one of string, regexp, undefined or null`)}}a(Ij,"makeFilterCalls");function uks(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 xj("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(uks,"computeUrlWithMaybeSearchParameters");var eot=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=uks(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)}},mir=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 xj("nthCall must be called with a number");if(!Number.isInteger(e))throw new xj("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new xj("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",...lks(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=Tj(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=Tj(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=Tj(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=Tj(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=Tj(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=Tj(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=Tj(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=Tj(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new xj("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=Ij.call(this,"protocol");filterCallsByHost=Ij.call(this,"host");filterCallsByPort=Ij.call(this,"port");filterCallsByOrigin=Ij.call(this,"origin");filterCallsByPath=Ij.call(this,"path");filterCallsByHash=Ij.call(this,"hash");filterCallsByFullUrl=Ij.call(this,"fullUrl");filterCallsByMethod=Ij.call(this,"method");clear(){this.logs=[]}[cks](e){let r=new eot(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};gir.exports.MockCallHistory=mir;gir.exports.MockCallHistoryLog=eot});var Cir=I((Prf,Z9n)=>{"use strict";p();var{promisify:dks}=require("node:util"),fks=VJ(),{buildMockDispatch:pks}=Dke(),{kDispatches:yir,kMockAgent:V9n,kClose:W9n,kOriginalClose:z9n,kOrigin:Y9n,kOriginalDispatch:hks,kConnected:Eir,kIgnoreTrailingSlash:K9n}=tZ(),{MockInterceptor:mks}=uir(),J9n=nl(),{InvalidArgumentError:gks}=ao(),_ir=class extends fks{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new gks("Argument opts.agent must implement Agent");super(e,r),this[V9n]=r.agent,this[Y9n]=e,this[K9n]=r.ignoreTrailingSlash??!1,this[yir]=[],this[Eir]=1,this[hks]=this.dispatch,this[z9n]=this.close.bind(this),this.dispatch=pks.call(this),this.close=this[W9n]}get[J9n.kConnected](){return this[Eir]}intercept(e){return new mks(e&&{ignoreTrailingSlash:this[K9n],...e},this[yir])}cleanMocks(){this[yir]=[]}async[W9n](){await dks(this[z9n])(),this[Eir]=0,this[V9n][J9n.kClients].delete(this[Y9n])}};Z9n.exports=_ir});var eUn=I((Orf,X9n)=>{"use strict";p();var{Transform:Aks}=require("node:stream"),{Console:yks}=require("node:console"),Eks=process.versions.icu?"\u2705":"Y ",_ks=process.versions.icu?"\u274C":"N ";X9n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new Aks({transform(r,n,o){o(null,r)}}),this.logger=new yks({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?Eks:_ks,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Iir=I((Frf,aUn)=>{"use strict";p();var{kClients:nZ}=nl(),Cks=YJ(),{kAgent:vir,kMockAgentSet:tot,kMockAgentGet:tUn,kDispatches:bir,kIsMockActive:rot,kNetConnect:iZ,kGetNetConnect:vks,kOptions:not,kFactory:iot,kMockAgentRegisterCallHistory:Sir,kMockAgentIsCallHistoryEnabled:Nke,kMockAgentAddCallHistoryLog:rUn,kMockAgentMockCallHistoryInstance:Cfe,kMockAgentAcceptsNonStandardSearchParameters:nUn,kMockCallHistoryAddLog:bks,kIgnoreTrailingSlash:iUn}=tZ(),Sks=hir(),Tks=Cir(),{matchValue:Iks,normalizeSearchParams:xks,buildAndValidateMockOptions:wks,normalizeOrigin:oUn}=Dke(),{InvalidArgumentError:sUn,UndiciError:Rks}=ao(),kks=KRe(),Pks=eUn(),{MockCallHistory:Dks}=Air(),Tir=class extends kks{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=wks(e);if(this[iZ]=!0,this[rot]=!0,this[Nke]=r.enableCallHistory??!1,this[nUn]=r.acceptNonStandardSearchParameters??!1,this[iUn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new sUn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new Cks(e);this[vir]=n,this[nZ]=n[nZ],this[not]=r,this[Nke]&&this[Sir]()}get(e){let r=oUn(e),n=this[iUn]?r.replace(/\/$/,""):r,o=this[tUn](n);return o||(o=this[iot](n),this[tot](n,o)),o}dispatch(e,r){e.origin=oUn(e.origin),this.get(e.origin),this[rUn](e);let n=this[nUn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=xks(c,n);o.path=`${s}?${l}`}return this[vir].dispatch(o,r)}async close(){this.clearCallHistory(),await this[vir].close(),this[nZ].clear()}deactivate(){this[rot]=!1}activate(){this[rot]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[iZ])?this[iZ].push(e):this[iZ]=[e];else if(typeof e>"u")this[iZ]=!0;else throw new sUn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[iZ]=!1}enableCallHistory(){return this[Nke]=!0,this}disableCallHistory(){return this[Nke]=!1,this}getCallHistory(){return this[Cfe]}clearCallHistory(){this[Cfe]!==void 0&&this[Cfe].clear()}get isMockActive(){return this[rot]}[Sir](){this[Cfe]===void 0&&(this[Cfe]=new Dks)}[rUn](e){this[Nke]&&(this[Sir](),this[Cfe][bks](e))}[tot](e,r){this[nZ].set(e,{count:0,dispatcher:r})}[iot](e){let r=Object.assign({agent:this},this[not]);return this[not]&&this[not].connections===1?new Sks(e,r):new Tks(e,r)}[tUn](e){let r=this[nZ].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[iot]("http://localhost:9999");return this[tot](e,n),n}for(let[n,o]of Array.from(this[nZ]))if(o&&typeof n!="string"&&Iks(n,e)){let s=this[iot](e);return this[tot](e,s),s[bir]=o.dispatcher[bir],s}}[vks](){return this[iZ]}pendingInterceptors(){let e=this[nZ];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[bir].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Pks}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new Rks(r.length===1?`1 interceptor is pending: +`,"latin1"),r!==null&&o!==r){if(n[Rtr])throw new bJ;process.emitWarning(new bJ)}e[sp].timeout&&e[sp].timeoutType===Lde&&e[sp].timeout.refresh&&e[sp].timeout.refresh(),n[Wq]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[zq]=!1,e&&(Di(n[oE]<=1,"pipeline should only contain this request"),o(e))}};A3n.exports=LCs});var x3n=I((mzd,I3n)=>{"use strict";p();var uw=require("node:assert"),{pipeline:zCs}=require("node:stream"),us=Po(),{RequestContentLengthMismatchError:Btr,RequestAbortedError:YCs,SocketError:ORe,InformationalError:Yq,InvalidArgumentError:KCs}=so(),{kUrl:MRe,kReset:Qnt,kClient:XS,kRunning:BRe,kPending:JCs,kQueue:Kq,kPendingIdx:Ftr,kRunningIdx:Gk,kError:eT,kSocket:mf,kStrictContentLength:ZCs,kOnError:Fde,kMaxConcurrentStreams:Fnt,kPingInterval:E3n,kHTTP2Session:tF,kHTTP2InitialWindowSize:XCs,kHTTP2ConnectionWindowSize:ebs,kResume:jO,kSize:tbs,kHTTPContext:Utr,kClosed:Ltr,kBodyTimeout:rbs,kEnableConnectProtocol:DRe,kRemoteSettings:NRe,kHTTP2Stream:Lnt,kHTTP2SessionState:Qtr}=tl(),{channels:_3n}=Gq(),lw=Symbol("open streams"),v3n,Unt;try{Unt=require("node:http2")}catch{Unt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:nbs,HTTP2_HEADER_METHOD:C3n,HTTP2_HEADER_PATH:b3n,HTTP2_HEADER_SCHEME:Ntr,HTTP2_HEADER_CONTENT_LENGTH:ibs,HTTP2_HEADER_EXPECT:obs,HTTP2_HEADER_STATUS:Mtr,HTTP2_HEADER_PROTOCOL:sbs,NGHTTP2_REFUSED_STREAM:abs,NGHTTP2_CANCEL:cbs}}=Unt;function Otr(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(Otr,"parseH2Headers");function lbs(t,e){t[mf]=e;let r=t[XCs],n=t[ebs],o=Unt.connect(t[MRe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[Fnt],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[mf]=e,o[lw]=0,o[XS]=t,o[mf]=e,o[Qtr]={ping:{interval:t[E3n]===0?null:setInterval(pbs,t[E3n],o).unref()}},o[DRe]=!1,o[NRe]=!1,n&&us.addListener(o,"connect",dbs.bind(o,n)),us.addListener(o,"error",hbs),us.addListener(o,"frameError",mbs),us.addListener(o,"end",gbs),us.addListener(o,"goaway",Abs),us.addListener(o,"close",ybs),us.addListener(o,"remoteSettings",fbs),o.unref(),t[tF]=o,e[tF]=o,us.addListener(e,"error",_bs),us.addListener(e,"end",vbs),us.addListener(e,"close",Ebs),e[Ltr]=!1,e.on("close",Cbs),{version:"h2",defaultPipelining:1/0,write(s){return Sbs(t,s)},resume(){ubs(t)},destroy(s,c){e[Ltr]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[BRe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[NRe]===!1||us.bodyLength(s.body)!==0&&(us.isStream(s.body)||us.isAsyncIterable(s.body)||us.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[NRe]===!1;return!1}}}a(lbs,"connectH2");function ubs(t){let e=t[mf];e?.destroyed===!1&&(t[tbs]===0||t[Fnt]===0?(e.unref(),t[tF].unref()):(e.ref(),t[tF].ref()))}a(ubs,"resumeH2");function dbs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(dbs,"applyConnectionWindowSize");function fbs(t){if(this[XS][Fnt]=t.maxConcurrentStreams??this[XS][Fnt],this[NRe]===!0&&this[DRe]===!0&&t.enableConnectProtocol===!1){let e=new Yq("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[mf][eT]=e,this[XS][Fde](e);return}this[DRe]=t.enableConnectProtocol??this[DRe],this[NRe]=!0,this[XS][jO]()}a(fbs,"onHttp2RemoteSettings");function pbs(t){let e=t[Qtr];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[XS],c=this[XS];if(n!=null){let l=new Yq(`HTTP/2: "PING" errored - type ${n.message}`);c[eT]=l,s[Fde](l)}else s.emit("ping",o)}a(r,"onPing")}a(pbs,"onHttp2SendPing");function hbs(t){uw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[mf][eT]=t,this[XS][Fde](t)}a(hbs,"onHttp2SessionError");function mbs(t,e,r){if(r===0){let n=new Yq(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[mf][eT]=n,this[XS][Fde](n)}}a(mbs,"onHttp2FrameError");function gbs(){let t=new ORe("other side closed",us.getSocketInfo(this[mf]));this.destroy(t),us.destroy(this[mf],t)}a(gbs,"onHttp2SessionEnd");function Abs(t){let e=this[eT]||new ORe(`HTTP/2: "GOAWAY" frame received with code ${t}`,us.getSocketInfo(this[mf])),r=this[XS];if(r[mf]=null,r[Utr]=null,this.close(),this[tF]=null,us.destroy(this[mf],e),r[Gk]{e.aborted||e.completed||(x=x||new YCs,us.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[Fde](x),t[jO]()),us.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){us.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[DRe]===!1?(us.errorRequest(t,e,new Yq("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[C3n]="CONNECT",g[sbs]="websocket",g[b3n]=s,f==="ws:"||f==="wss:"?g[Ntr]=f==="ws:"?"http":"https":g[Ntr]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[Lnt]=!0,A.once("response",(x,P)=>{let{[Mtr]:D,...N}=x;e.onUpgrade(D,Otr(N),A),++n[lw],t[Kq][t[Gk]++]=null}),A.on("error",()=>{(A.rstCode===abs||A.rstCode===cbs)&&_(new Yq(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[lw]-=1,n[lw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[Lnt]=!0,A.on("response",x=>{let{[Mtr]:P,...D}=x;e.onUpgrade(P,Otr(D),A),++n[lw],t[Kq][t[Gk]++]=null}),A.once("close",()=>{n[lw]-=1,n[lw]===0&&n.unref()}),A.setTimeout(r),!0);g[b3n]=s,g[Ntr]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=us.bodyLength(m);if(us.isFormDataLike(m)){v3n??=Mde().extractBody;let[x,P]=v3n(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),bbs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[ZCs])return us.errorRequest(t,e,new Btr),!1;process.emitWarning(new Btr)}if(b!=null&&(uw(m||b===0,"no body must not have content length"),g[ibs]=`${b}`),n.ref(),_3n.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r +`;_3n.sendHeaders.publish({request:e,headers:x,socket:n[mf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[obs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[Lnt]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[Lnt]=!0,R()),++n[lw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Mtr]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),Otr(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[Kq][t[Gk]++]=null,t[jO]()):(_(new Yq("HTTP/2: stream half-closed (remote)")),t[Kq][t[Gk]++]=null,t[Ftr]=t[Gk],t[jO]())}),A.once("close",()=>{A.removeAllListeners("data"),n[lw]-=1,n[lw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new Yq(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new Yq(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[lw]-=1,n[lw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?S3n(_,A,null,t,e,t[mf],b,v):us.isBuffer(m)?S3n(_,A,m,t,e,t[mf],b,v):us.isBlobLike(m)?typeof m.stream=="function"?T3n(_,A,m.stream(),t,e,t[mf],b,v):Ibs(_,A,m,t,e,t[mf],b,v):us.isStream(m)?Tbs(_,t[mf],v,A,m,t,e,b):us.isIterable(m)?T3n(_,A,m,t,e,t[mf],b,v):uw(!1)}a(R,"writeBodyH2")}a(Sbs,"writeH2");function S3n(t,e,r,n,o,s,c,l){try{r!=null&&us.isBuffer(r)&&(uw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Qnt]=!0),o.onRequestSent(),n[jO]()}catch(u){t(u)}}a(S3n,"writeBuffer");function Tbs(t,e,r,n,o,s,c,l){uw(l!==0||s[BRe]===0,"stream body cannot be pipelined");let u=zCs(o,n,f=>{f?(us.destroy(u,f),t(f)):(us.removeAllListeners(u),c.onRequestSent(),r||(e[Qnt]=!0),s[jO]())});us.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(Tbs,"writeStream");async function Ibs(t,e,r,n,o,s,c,l){uw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Btr;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Qnt]=!0),n[jO]()}catch(u){t(u)}}a(Ibs,"writeBlob");async function T3n(t,e,r,n,o,s,c,l){uw(c!==0||n[BRe]===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)=>{uw(u===null),s[eT]?m(s[eT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[eT])throw s[eT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Qnt]=!0),n[jO]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(T3n,"writeIterable");I3n.exports=lbs});var ej=I((yzd,O3n)=>{"use strict";p();var rF=require("node:assert"),k3n=require("node:net"),LRe=require("node:http"),SJ=Po(),{ClientStats:xbs}=Oer(),{channels:Ude}=Gq(),wbs=VBn(),Rbs=yJ(),{InvalidArgumentError:nd,InformationalError:Pbs,ClientDestroyedError:kbs}=so(),Dbs=EJ(),{kUrl:HO,kServerName:Xq,kClient:Nbs,kBusy:jtr,kConnect:Mbs,kResuming:TJ,kRunning:qRe,kPending:jRe,kSize:FRe,kQueue:$k,kConnected:Obs,kConnecting:Qde,kNeedDrain:Zq,kKeepAliveDefaultTimeout:w3n,kHostHeader:Bbs,kPendingIdx:Vk,kRunningIdx:iF,kError:Lbs,kPipelining:qnt,kKeepAliveTimeoutValue:Fbs,kMaxHeadersSize:Ubs,kKeepAliveMaxTimeout:Qbs,kKeepAliveTimeoutThreshold:qbs,kHeadersTimeout:jbs,kBodyTimeout:Hbs,kStrictContentLength:Gbs,kConnector:URe,kMaxRequests:Htr,kCounter:$bs,kClose:Vbs,kDestroy:Wbs,kDispatch:zbs,kLocalAddress:QRe,kMaxResponseSize:Ybs,kOnError:Kbs,kHTTPContext:Jp,kMaxConcurrentStreams:Jbs,kHTTP2InitialWindowSize:Zbs,kHTTP2ConnectionWindowSize:Xbs,kResume:nF,kPingInterval:e1s}=tl(),t1s=y3n(),r1s=x3n(),Jq=Symbol("kClosedResolve"),n1s=LRe&&LRe.maxHeaderSize&&Number.isInteger(LRe.maxHeaderSize)&&LRe.maxHeaderSize>0?()=>LRe.maxHeaderSize:()=>{throw new nd("http module not available or http.maxHeaderSize invalid")},R3n=a(()=>{},"noop");function D3n(t){return t[qnt]??t[Jp]?.defaultPipelining??1}a(D3n,"getPipelining");var Gtr=class extends Rbs{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}={}){if(d!==void 0)throw new nd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new nd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new nd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new nd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new nd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new nd("invalid maxHeaderSize")}else r=n1s();if(A!=null&&typeof A!="string")throw new nd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new nd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new nd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new nd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new nd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new nd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new nd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new nd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new nd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||k3n.isIP(w)===0))throw new nd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new nd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new nd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new nd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new nd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new nd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new nd("initialWindowSize must be a positive integer, greater than 0");if(j!=null&&(!Number.isInteger(j)||j<1))throw new nd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new nd("pingInterval must be a positive integer, greater or equal to 0");if(super(),typeof b!="function")b=Dbs({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let O=b;b=a((q,Q)=>O({...q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},Q),"connect")}this[HO]=SJ.parseOrigin(e),this[URe]=b,this[qnt]=y??1,this[Ubs]=r,this[w3n]=f??4e3,this[Qbs]=m??6e5,this[qbs]=g??2e3,this[Fbs]=this[w3n],this[Xq]=null,this[QRe]=w??null,this[TJ]=0,this[Zq]=0,this[Bbs]=`host: ${this[HO].hostname}${this[HO].port?`:${this[HO].port}`:""}\r +`,this[Hbs]=l??3e5,this[jbs]=n??3e5,this[Gbs]=_??!0,this[Htr]=T,this[Jq]=null,this[Ybs]=R>-1?R:-1,this[Jp]=null,this[Jbs]=D??100,this[Zbs]=B??262144,this[Xbs]=j??524288,this[e1s]=M??6e4,this[$k]=[],this[iF]=0,this[Vk]=0,this[nF]=O=>$tr(this,O),this[Kbs]=O=>N3n(this,O)}get pipelining(){return this[qnt]}set pipelining(e){this[qnt]=e,this[nF](!0)}get stats(){return new xbs(this)}get[jRe](){return this[$k].length-this[Vk]}get[qRe](){return this[Vk]-this[iF]}get[FRe](){return this[$k].length-this[iF]}get[Obs](){return!!this[Jp]&&!this[Qde]&&!this[Jp].destroyed}get[jtr](){return!!(this[Jp]?.busy(null)||this[FRe]>=(D3n(this)||1)||this[jRe]>0)}[Mbs](e){M3n(this),this.once("connect",e)}[zbs](e,r){let n=new wbs(this[HO].origin,e,r);return this[$k].push(n),this[TJ]||(SJ.bodyLength(n.body)==null&&SJ.isIterable(n.body)?(this[TJ]=1,queueMicrotask(()=>$tr(this))):this[nF](!0)),this[TJ]&&this[Zq]!==2&&this[jtr]&&(this[Zq]=2),this[Zq]<2}[Vbs](){return new Promise(e=>{this[FRe]?this[Jq]=e:e(null)})}[Wbs](e){return new Promise(r=>{let n=this[$k].splice(this[Vk]);for(let s=0;s{this[Jq]&&(this[Jq](),this[Jq]=null),r(null)},"callback");this[Jp]?(this[Jp].destroy(e,o),this[Jp]=null):queueMicrotask(o),this[nF]()})}};function N3n(t,e){if(t[qRe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){rF(t[Vk]===t[iF]);let r=t[$k].splice(t[iF]);for(let n=0;n{if(s){qtr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[nF]();return}if(t.destroyed){SJ.destroy(c.on("error",R3n),new kbs),t[nF]();return}rF(c);try{t[Jp]=c.alpnProtocol==="h2"?r1s(t,c):t1s(t,c)}catch(l){c.destroy().on("error",R3n),qtr(t,l,{host:e,hostname:r,protocol:n,port:o}),t[nF]();return}t[Qde]=!1,c[$bs]=0,c[Htr]=t[Htr],c[Nbs]=t,c[Lbs]=null,Ude.connected.hasSubscribers&&Ude.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Jp]?.version,servername:t[Xq],localAddress:t[QRe]},connector:t[URe],socket:c}),t.emit("connect",t[HO],[t]),t[nF]()})}catch(s){qtr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[nF]()}}a(M3n,"connect");function qtr(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[Qde]=!1,Ude.connectError.hasSubscribers&&Ude.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[Jp]?.version,servername:t[Xq],localAddress:t[QRe]},connector:t[URe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(rF(t[qRe]===0);t[jRe]>0&&t[$k][t[Vk]].servername===t[Xq];){let c=t[$k][t[Vk]++];SJ.errorRequest(t,c,e)}else N3n(t,e);t.emit("connectionError",t[HO],[t],e)}}a(qtr,"handleConnectError");function P3n(t){t[Zq]=0,t.emit("drain",t[HO],[t])}a(P3n,"emitDrain");function $tr(t,e){t[TJ]!==2&&(t[TJ]=2,i1s(t,e),t[TJ]=0,t[iF]>256&&(t[$k].splice(0,t[iF]),t[Vk]-=t[iF],t[iF]=0))}a($tr,"resume");function i1s(t,e){for(;;){if(t.destroyed){rF(t[jRe]===0);return}if(t[Jq]&&!t[FRe]){t[Jq](),t[Jq]=null;return}if(t[Jp]&&t[Jp].resume(),t[jtr])t[Zq]=2;else if(t[Zq]===2){e?(t[Zq]=1,queueMicrotask(()=>P3n(t))):P3n(t);continue}if(t[jRe]===0||t[qRe]>=(D3n(t)||1))return;let r=t[$k][t[Vk]];if(r===null)return;if(t[HO].protocol==="https:"&&t[Xq]!==r.servername){if(t[qRe]>0)return;t[Xq]=r.servername,t[Jp]?.destroy(new Pbs("servername changed"),()=>{t[Jp]=null,$tr(t)})}if(t[Qde])return;if(!t[Jp]){M3n(t);return}if(t[Jp].destroyed||t[Jp].busy(r))return;!r.aborted&&t[Jp].write(r)?t[Vk]++:t[$k].splice(t[Vk],1)}}a(i1s,"_resume");O3n.exports=Gtr});var Vtr=I((Czd,B3n)=>{"use strict";p();var jnt=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)}};B3n.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,e.next=null),r}}});var Hnt=I((Tzd,$3n)=>{"use strict";p();var{PoolStats:o1s}=Oer(),s1s=yJ(),a1s=Vtr(),{kConnected:Wtr,kSize:L3n,kRunning:F3n,kPending:U3n,kQueued:HRe,kBusy:c1s,kFree:l1s,kUrl:u1s,kClose:d1s,kDestroy:f1s,kDispatch:p1s}=tl(),Eg=Symbol("clients"),$_=Symbol("needDrain"),GRe=Symbol("queue"),ztr=Symbol("closed resolve"),Ytr=Symbol("onDrain"),Q3n=Symbol("onConnect"),q3n=Symbol("onDisconnect"),j3n=Symbol("onConnectionError"),Ktr=Symbol("get dispatcher"),H3n=Symbol("add client"),G3n=Symbol("remove client"),Jtr=class extends s1s{static{a(this,"PoolBase")}[GRe]=new a1s;[HRe]=0;[Eg]=[];[$_]=!1;[Ytr](e,r,n){let o=this[GRe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[HRe]--,s=!e.dispatch(c.opts,c.handler)}if(e[$_]=s,!s&&this[$_]&&(this[$_]=!1,this.emit("drain",r,[this,...n])),this[ztr]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[q3n]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[j3n]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[c1s](){return this[$_]}get[Wtr](){let e=0;for(let{[Wtr]:r}of this[Eg])e+=r;return e}get[l1s](){let e=0;for(let{[Wtr]:r,[$_]:n}of this[Eg])e+=r&&!n;return e}get[U3n](){let e=this[HRe];for(let{[U3n]:r}of this[Eg])e+=r;return e}get[F3n](){let e=0;for(let{[F3n]:r}of this[Eg])e+=r;return e}get[L3n](){let e=this[HRe];for(let{[L3n]:r}of this[Eg])e+=r;return e}get stats(){return new o1s(this)}[d1s](){if(this[GRe].isEmpty()){let e=[];for(let r=0;r{this[ztr]=e})}[f1s](e){for(;;){let n=this[GRe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Eg].length);for(let n=0;n{this[$_]&&this[Ytr](e,e[u1s],[e,this])}),this}[G3n](e){e.close(()=>{let r=this[Eg].indexOf(e);r!==-1&&this[Eg].splice(r,1)}),this[$_]=this[Eg].some(r=>!r[$_]&&r.closed!==!0&&r.destroyed!==!0)}};$3n.exports={PoolBase:Jtr,kClients:Eg,kNeedDrain:$_,kAddClient:H3n,kRemoveClient:G3n,kGetDispatcher:Ktr}});var IJ=I((wzd,Y3n)=>{"use strict";p();var{PoolBase:h1s,kClients:Gnt,kNeedDrain:m1s,kAddClient:g1s,kGetDispatcher:A1s,kRemoveClient:y1s}=Hnt(),E1s=ej(),{InvalidArgumentError:Ztr}=so(),V3n=Po(),{kUrl:W3n}=tl(),_1s=EJ(),$nt=Symbol("options"),Xtr=Symbol("connections"),z3n=Symbol("factory");function v1s(t,e){return new E1s(t,e)}a(v1s,"defaultFactory");var trr=class extends h1s{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=v1s,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 Ztr("invalid connections");if(typeof n!="function")throw new Ztr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Ztr("connect must be a function or an object");typeof o!="function"&&(o=_1s({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[Xtr]=r||null,this[W3n]=V3n.parseOrigin(e),this[$nt]={...V3n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[$nt].interceptors=g.interceptors?{...g.interceptors}:void 0,this[z3n]=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[Gnt].indexOf(_);v!==-1&&this[Gnt].splice(v,1)}})}[A1s](){let e=this[$nt].clientTtl;for(let r of this[Gnt])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[y1s](r);else if(!r[m1s])return r;if(!this[Xtr]||this[Gnt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:C1s,InvalidArgumentError:b1s}=so(),{PoolBase:S1s,kClients:PA,kNeedDrain:$Re,kAddClient:T1s,kRemoveClient:I1s,kGetDispatcher:x1s}=Hnt(),w1s=IJ(),{kUrl:Vnt}=tl(),Wnt=Po(),K3n=Symbol("factory"),VRe=Symbol("options"),J3n=Symbol("kGreatestCommonDivisor"),xJ=Symbol("kCurrentWeight"),wJ=Symbol("kIndex"),dw=Symbol("kWeight"),znt=Symbol("kMaxWeightPerServer"),Ynt=Symbol("kErrorPenalty");function R1s(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(R1s,"getGreatestCommonDivisor");function P1s(t,e){return new w1s(t,e)}a(P1s,"defaultFactory");var rrr=class extends S1s{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=P1s,...n}={}){if(typeof r!="function")throw new b1s("factory must be a function.");super(),this[VRe]={...Wnt.deepClone(n)},this[VRe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[wJ]=-1,this[xJ]=0,this[znt]=this[VRe].maxWeightPerServer||100,this[Ynt]=this[VRe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[K3n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Wnt.parseOrigin(e).origin;if(this[PA].find(o=>o[Vnt].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[K3n](r,this[VRe]);this[T1s](n),n.on("connect",()=>{n[dw]=Math.min(this[znt],n[dw]+this[Ynt])}),n.on("connectionError",()=>{n[dw]=Math.max(1,n[dw]-this[Ynt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[dw]=Math.max(1,n[dw]-this[Ynt]),this._updateBalancedPoolStats())});for(let o of this[PA])o[dw]=this[znt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Vnt].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[I1s](n),this}getUpstream(e){let r=Wnt.parseOrigin(e).origin;return this[PA].find(n=>n[Vnt].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[PA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Vnt].origin)}[x1s](){if(this[PA].length===0)throw new C1s;if(!this[PA].find(s=>!s[$Re]&&s.closed!==!0&&s.destroyed!==!0)||this[PA].map(s=>s[$Re]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[PA].findIndex(s=>!s[$Re]);for(;n++this[PA][o][dw]&&!s[$Re]&&(o=this[wJ]),this[wJ]===0&&(this[xJ]=this[xJ]-this[J3n],this[xJ]<=0&&(this[xJ]=this[znt])),s[dw]>=this[xJ]&&!s[$Re])return s}return this[xJ]=this[PA][o][dw],this[wJ]=o,this[PA][o]}};Z3n.exports=rrr});var nFn=I((Mzd,rFn)=>{"use strict";p();var{PoolBase:k1s,kClients:Knt,kNeedDrain:D1s,kAddClient:eFn,kGetDispatcher:N1s,kRemoveClient:M1s}=Hnt(),O1s=ej(),{InvalidArgumentError:nrr}=so(),tFn=Po(),{kUrl:irr}=tl(),B1s=EJ(),WRe=Symbol("options"),orr=Symbol("connections"),srr=Symbol("factory"),Jnt=Symbol("index");function L1s(t,e){return new O1s(t,e)}a(L1s,"defaultFactory");var arr=class extends k1s{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=L1s,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 nrr("invalid connections");if(typeof n!="function")throw new nrr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new nrr("connect must be a function or an object");typeof o!="function"&&(o=B1s({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[orr]=r||null,this[irr]=tFn.parseOrigin(e),this[WRe]={...tFn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[WRe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[srr]=n,this[Jnt]=-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[Knt].indexOf(_);v!==-1&&this[Knt].splice(v,1)}})}[N1s](){let e=this[WRe].clientTtl,r=this[Knt].length;if(r===0){let o=this[srr](this[irr],this[WRe]);return this[eFn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[M1s](o),n++;continue}if(!o[D1s])return o;n++}if(!this[orr]||r{"use strict";p();var{InvalidArgumentError:Znt,MaxOriginsReachedError:F1s}=so(),{kClients:fw,kRunning:iFn,kClose:U1s,kDestroy:Q1s,kDispatch:q1s,kUrl:j1s}=tl(),H1s=yJ(),G1s=IJ(),$1s=ej(),V1s=Po(),oFn=Symbol("onConnect"),sFn=Symbol("onDisconnect"),aFn=Symbol("onConnectionError"),cFn=Symbol("onDrain"),lFn=Symbol("factory"),crr=Symbol("options"),zRe=Symbol("origins");function W1s(t,e){return e&&e.connections===1?new $1s(t,e):new G1s(t,e)}a(W1s,"defaultFactory");var lrr=class extends H1s{static{a(this,"Agent")}constructor({factory:e=W1s,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new Znt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Znt("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new Znt("maxOrigins must be a number greater than 0");super(),n&&typeof n!="function"&&(n={...n}),this[crr]={...V1s.deepClone(o),maxOrigins:r,connect:n},this[lFn]=e,this[fw]=new Map,this[zRe]=new Set,this[cFn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[oFn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[sFn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[aFn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[iFn](){let e=0;for(let{dispatcher:r}of this[fw].values())e+=r[iFn];return e}[q1s](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Znt("opts.origin must be a non-empty string or URL.");if(this[zRe].size>=this[crr].maxOrigins&&!this[zRe].has(n))throw new F1s;let o=this[fw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[fw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[fw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[zRe].delete(n))},"closeClientIfUnused");s=this[lFn](e.origin,this[crr]).on("drain",this[cFn]).on("connect",(l,u)=>{let d=this[fw].get(n);d&&(d.count+=1),this[oFn](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[sFn](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[aFn](l,u,d)}),this[fw].set(n,{count:0,dispatcher:s}),this[zRe].add(n)}return s.dispatch(e,r)}[U1s](){let e=[];for(let{dispatcher:r}of this[fw].values())e.push(r.close());return this[fw].clear(),Promise.all(e)}[Q1s](e){let r=[];for(let{dispatcher:n}of this[fw].values())r.push(n.destroy(e));return this[fw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[fw].values())r.stats&&(e[r[j1s].origin]=r.stats);return e}};uFn.exports=lrr});var hFn=I((Qzd,pFn)=>{"use strict";p();var{Buffer:rj}=require("node:buffer"),dFn=require("node:net"),{InvalidArgumentError:tj}=so();function z1s(t){if(dFn.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:rj.from(r)}}if(dFn.isIPv6(t))return{type:4,buffer:fFn(t)};let e=rj.from(t,"utf8");if(e.length>255)throw new tj("Domain name too long (max 255 bytes)");return{type:3,buffer:rj.concat([rj.from([e.length]),e])}}a(z1s,"parseAddress");function fFn(t){let e=rj.alloc(16),r=t.indexOf("::");if(r!==-1){let n=t.slice(0,r),o=t.slice(r+2),s=n===""?[]:n.split(":"),c=o===""?[]:o.split(":"),l=0;for(let u of s)e.writeUInt16BE(parseInt(u,16),l),l+=2;l=16-c.length*2;for(let u of c)e.writeUInt16BE(parseInt(u,16),l),l+=2}else{let n=t.split(":");for(let o=0;o{"use strict";p();var{EventEmitter:Z1s}=require("node:events"),{Buffer:PJ}=require("node:buffer"),{InvalidArgumentError:YRe,Socks5ProxyError:nj}=so(),{debuglog:X1s}=require("node:util"),{parseAddress:eSs}=hFn(),oF=X1s("undici:socks5"),mFn=PJ.alloc(0),Xnt=5,qde={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},gFn={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},kJ={IPV4:1,DOMAIN:3,IPV6:4},GO={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},tT={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},urr=class extends Z1s{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new YRe("socket is required");this.socket=e,this.options=r,this.state=tT.INITIAL,this.buffer=mFn,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(qde.USERNAME_PASSWORD),this.authMethods.push(qde.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){oF("received data",e.length,"bytes in state",this.state),this.buffer=PJ.concat([this.buffer,e]);try{switch(this.state){case tT.HANDSHAKING:this.handleHandshakeResponse();break;case tT.AUTHENTICATING:this.handleAuthResponse();break;case tT.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){oF("socket error",e),this.state=tT.ERROR,this.emit("error",e),this.destroy()}onClose(){oF("socket closed"),this.state=tT.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}handshake(){if(this.state!==tT.INITIAL)throw new YRe("Handshake already started");oF("starting handshake with",this.authMethods.length,"auth methods"),this.state=tT.HANDSHAKING;let e=PJ.alloc(2+this.authMethods.length);e[0]=Xnt,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!==Xnt)throw new nj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===qde.NO_ACCEPTABLE)throw new nj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),oF("server selected auth method",r),r===qde.NO_AUTH)this.emit("authenticated");else if(r===qde.USERNAME_PASSWORD)this.state=tT.AUTHENTICATING,this.sendAuthRequest();else throw new nj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new YRe("Username and password required for authentication");oF("sending username/password auth");let n=PJ.from(e),o=PJ.from(r);if(n.length>255||o.length>255)throw new YRe("Username or password too long");let s=PJ.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 nj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new nj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),oF("authentication successful"),this.emit("authenticated")}connect(e,r){if(this.state===tT.CONNECTED)throw new YRe("Already connected");oF("connecting to",e,r),this.state=tT.CONNECTING;let n=this.buildConnectRequest(gFn.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=eSs(r),c=PJ.alloc(4+s.length+2);return c[0]=Xnt,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!==Xnt)throw new nj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===kJ.IPV4)o+=6;else if(n===kJ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===kJ.IPV6)o+=18;else throw new nj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var tSs=require("node:net"),{URL:EFn}=require("node:url"),drr,rSs=yJ(),{InvalidArgumentError:_Fn}=so(),{Socks5Client:nSs}=yFn(),{kDispatch:vFn,kClose:iSs,kDestroy:oSs}=tl(),sSs=IJ(),aSs=EJ(),{debuglog:cSs}=require("node:util"),ij=cSs("undici:socks5-proxy"),frr=Symbol("proxy url"),lSs=Symbol("proxy headers"),CFn=Symbol("proxy auth"),$O=Symbol("pool"),uSs=Symbol("connector"),bFn=!1,prr=class extends rSs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),bFn||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),bFn=!0),!e)throw new _Fn("Proxy URL is mandatory");let n=typeof e=="string"?new EFn(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new _Fn("Proxy URL must use socks5:// or socks:// protocol");this[frr]=n,this[lSs]=r.headers||{},this[CFn]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[uSs]=r.connect||aSs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[$O]=null}async createSocks5Connection(e,r){let n=this[frr].hostname,o=parseInt(this[frr].port)||1080;ij("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{let d=a(()=>{h.removeListener("error",f),l(h)},"onConnect"),f=a(m=>{h.removeListener("connect",d),u(m)},"onError"),h=tSs.connect({host:n,port:o});h.once("connect",d),h.once("error",f)}),c=new nSs(s,this[CFn]);return c.on("error",l=>{ij("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==="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=>{ij("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}async[vFn](e,r){let{origin:n}=e;ij("dispatching request to",n,"via SOCKS5");try{return(!this[$O]||this[$O].destroyed||this[$O].closed)&&(this[$O]=new sSs(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(o,s)=>{try{let c=new EFn(n),l=c.hostname,u=parseInt(c.port)||(c.protocol==="https:"?443:80);ij("establishing SOCKS5 connection to",l,u);let d=await this.createSocks5Connection(l,u),f=d;c.protocol==="https:"&&(drr||(drr=require("node:tls")),ij("upgrading to TLS"),f=drr.connect({socket:d,servername:l,...o.tls||{}}),await new Promise((h,m)=>{f.once("secureConnect",h),f.once("error",m)})),s(null,f)}catch(c){ij("SOCKS5 connection error:",c),s(c)}},"connect")})),this[$O][vFn](e,r)}catch(o){if(ij("dispatch error:",o),typeof r.onError=="function")r.onError(o);else throw o}}async[iSs](){this[$O]&&await this[$O].close()}async[oSs](e){this[$O]&&await this[$O].destroy(e)}};SFn.exports=prr});var yrr=I((Yzd,BFn)=>{"use strict";p();var{kProxy:jde,kClose:kFn,kDestroy:DFn,kDispatch:TFn}=tl(),dSs=RJ(),NFn=IJ(),MFn=yJ(),{InvalidArgumentError:DJ,RequestAbortedError:fSs,SecureProxyConnectionError:pSs}=so(),IFn=EJ(),OFn=ej(),{channels:xFn}=Gq(),hSs=hrr(),eit=Symbol("proxy agent"),oj=Symbol("proxy client"),sF=Symbol("proxy headers"),mrr=Symbol("request tls settings"),wFn=Symbol("proxy tls settings"),RFn=Symbol("connect endpoint function"),PFn=Symbol("tunnel proxy");function mSs(t){return t==="https:"?443:80}a(mSs,"defaultProtocolPort");function gSs(t,e){return new NFn(t,e)}a(gSs,"defaultFactory");var ASs=a(()=>{},"noop");function ySs(t,e){return e.connections===1?new OFn(t,e):new NFn(t,e)}a(ySs,"defaultAgentFactory");var grr=class extends MFn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new DJ("Proxy URL is mandatory");super(),this[sF]=r,o?this.#e=o(e,{connect:n}):this.#e=new OFn(e,{connect:n})}[TFn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new DJ("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[sF],...c},this.#e[TFn](e,r)}[kFn](){return this.#e.close()}[DFn](e){return this.#e.destroy(e)}},Arr=class extends MFn{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new DJ("Proxy uri is mandatory");let{clientFactory:r=gSs}=e;if(typeof r!="function")throw new DJ("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[jde]={uri:s,protocol:u},this[mrr]=e.requestTls,this[wFn]=e.proxyTls,this[sF]=e.headers||{},this[PFn]=n,e.auth&&e.token)throw new DJ("opts.auth cannot be used in combination with opts.token");e.auth?this[sF]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[sF]["proxy-authorization"]=e.token:d&&f&&(this[sF]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=IFn({...e.proxyTls});this[RFn]=IFn({...e.requestTls});let g=e.factory||ySs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[jde].protocol==="socks5:"||this[jde].protocol==="socks:"?new hSs(this[jde].uri,{headers:this[sF],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls}):!this[PFn]&&_==="http:"&&this[jde].protocol==="http:"?new grr(this[jde].uri,{headers:this[sF],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[oj]=null:this[oj]=r(o,{connect:m}),this[eit]=new dSs({...e,factory:A,connect:a(async(y,E)=>{if(!this[oj]){E(new DJ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${mSs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[sF],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[wFn]?.servername||h},{socket:b,statusCode:T}=await this[oj].connect(v);if(T!==200){b.on("error",ASs).destroy(),E(new fSs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(xFn.proxyConnected.hasSubscribers&&xFn.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[mrr]?w=this[mrr].servername:w=y.servername,this[RFn]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new pSs(v)):E(v)}},"connect")})}dispatch(e,r){let n=ESs(e.headers);if(_Ss(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[eit].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[kFn](){let e=[this[eit].close()];return this[oj]&&e.push(this[oj].close()),Promise.all(e)}[DFn](){let e=[this[eit].destroy()];return this[oj]&&e.push(this[oj].destroy()),Promise.all(e)}};function ESs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new DJ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(_Ss,"throwIfProxyAuthIsSent");BFn.exports=Arr});var qFn=I((Zzd,QFn)=>{"use strict";p();var vSs=yJ(),{kClose:CSs,kDestroy:bSs,kClosed:LFn,kDestroyed:FFn,kDispatch:SSs,kNoProxyAgent:KRe,kHttpProxyAgent:sj,kHttpsProxyAgent:NJ}=tl(),UFn=yrr(),TSs=RJ(),ISs={"http:":80,"https:":443},Err=class extends vSs{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[KRe]=new TSs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[sj]=new UFn({...s,uri:c}):this[sj]=this[KRe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[NJ]=new UFn({...s,uri:l}):this[NJ]=this[sj],this.#o()}[SSs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[CSs](){return Promise.all([this[KRe].close(),!this[sj][LFn]&&this[sj].close(),!this[NJ][LFn]&&this[NJ].close()])}[bSs](e){return Promise.all([this[KRe].destroy(e),!this[sj][FFn]&&this[sj].destroy(e),!this[NJ][FFn]&&this[NJ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||ISs[r]||0,this.#i(n,o)?r==="https:"?this[NJ]:this[sj]:this[KRe]}#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 Hde=require("node:assert"),{kRetryHandlerDefaultRetry:jFn}=tl(),{RequestRetryError:JRe}=so(),xSs=ERe(),{isDisturbed:HFn,parseRangeHeader:GFn,wrapRequestBody:wSs}=Po();function RSs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(RSs,"calculateRetryAfterHeader");var _rr=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=xSs.wrap(n),this.opts={...s,body:wSs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[jFn],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(HFn(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[jFn](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)?RSs(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 JRe("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 JRe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=GFn(n["content-range"]);if(!s)throw new JRe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new JRe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;Hde(this.start===c,"content-range mismatch"),Hde(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=GFn(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;Hde(c!=null&&Number.isFinite(c),"content-range mismatch"),Hde(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}Hde(Number.isFinite(this.start)),Hde(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 JRe("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||HFn(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))}};$Fn.exports=_rr});var WFn=I((iYd,VFn)=>{"use strict";p();var PSs=_Re(),kSs=tit(),vrr=class extends PSs{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 kSs({...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()}};VFn.exports=vrr});var KFn=I((aYd,YFn)=>{"use strict";p();var{InvalidArgumentError:zFn}=so(),DSs=ej(),Crr=class extends DSs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new zFn("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 zFn("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};YFn.exports=Crr});var o8n=I((uYd,i8n)=>{"use strict";p();var e8n=require("node:assert"),{Readable:NSs}=require("node:stream"),{RequestAbortedError:t8n,NotSupportedError:MSs,InvalidArgumentError:OSs,AbortError:rit}=so(),r8n=Po(),{ReadableStreamFrom:BSs}=Po(),rT=Symbol("kConsume"),nit=Symbol("kReading"),MJ=Symbol("kBody"),JFn=Symbol("kAbort"),n8n=Symbol("kContentType"),brr=Symbol("kContentLength"),Srr=Symbol("kUsed"),iit=Symbol("kBytesRead"),LSs=a(()=>{},"noop"),Trr=class extends NSs{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[JFn]=r,this[rT]=null,this[iit]=0,this[MJ]=null,this[Srr]=!1,this[n8n]=n,this[brr]=Number.isFinite(o)?o:null,this[nit]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new t8n),e&&this[JFn](),this[Srr]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[nit]=!0,this[Srr]=!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[nit]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[iit]+=e.length,this[rT])?(xrr(this[rT],e),this[nit]?super.push(e):!0):super.push(e)}text(){return ZRe(this,"text")}json(){return ZRe(this,"json")}blob(){return ZRe(this,"blob")}bytes(){return ZRe(this,"bytes")}arrayBuffer(){return ZRe(this,"arrayBuffer")}async formData(){throw new MSs}get bodyUsed(){return r8n.isDisturbed(this)}get body(){return this[MJ]||(this[MJ]=BSs(this),this[rT]&&(this[MJ].getReader(),e8n(this[MJ].locked))),this[MJ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new OSs("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 rit):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[brr]&&this[brr]>n||this[iit]>n)&&this.destroy(new rit),r){let c=a(()=>{this.destroy(r.reason??new rit)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new rit):o(null)})}else this.on("close",o);this.on("error",LSs).on("data",()=>{this[iit]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function FSs(t){return t[MJ]?.locked===!0||t[rT]!==null}a(FSs,"isLocked");function USs(t){return r8n.isDisturbed(t)||FSs(t)}a(USs,"isUnusable");function ZRe(t,e){return e8n(!t[rT]),new Promise((r,n)=>{if(USs(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[rT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){wrr(this[rT],o)}).on("close",function(){this[rT].body!==null&&wrr(this[rT],new t8n)}),QSs(t[rT])})})}a(ZRe,"consume");function QSs(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(Irr,"chunksDecode");function ZFn(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 qSs=require("node:assert"),{AsyncResource:jSs}=require("node:async_hooks"),{Readable:HSs}=o8n(),{InvalidArgumentError:Gde,RequestAbortedError:s8n}=so(),pw=Po();function XRe(){}a(XRe,"noop");var oit=class extends jSs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Gde("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 Gde("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Gde("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Gde("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Gde("invalid method");if(l&&typeof l!="function")throw new Gde("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw pw.isStream(c)&&pw.destroy(c.on("error",XRe),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 s8n:n&&(this.removeAbortListener=pw.addAbortListener(n,()=>{this.reason=n.reason??new s8n,this.res?pw.destroy(this.res.on("error",XRe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}qSs(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"?pw.parseRawHeaders(r):pw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?pw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new HSs({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,pw.destroy(y.on("error",XRe),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){pw.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(()=>{pw.destroy(r.on("error",XRe),e)})),o&&(this.body=null,pw.isStream(o)&&(o.on("error",XRe),pw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function a8n(t,e){if(e===void 0)return new Promise((r,n)=>{a8n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new oit(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(a8n,"request");Rrr.exports=a8n;Rrr.exports.RequestHandler=oit});var ePe=I((gYd,d8n)=>{"use strict";p();var{addAbortListener:GSs}=Po(),{RequestAbortedError:$Ss}=so(),$de=Symbol("kListener"),VO=Symbol("kSignal");function l8n(t){t.abort?t.abort(t[VO]?.reason):t.reason=t[VO]?.reason??new $Ss,u8n(t)}a(l8n,"abort");function VSs(t,e){if(t.reason=null,t[VO]=null,t[$de]=null,!!e){if(e.aborted){l8n(t);return}t[VO]=e,t[$de]=()=>{l8n(t)},GSs(t[VO],t[$de])}}a(VSs,"addSignal");function u8n(t){t[VO]&&("removeEventListener"in t[VO]?t[VO].removeEventListener("abort",t[$de]):t[VO].removeListener("abort",t[$de]),t[VO]=null,t[$de]=null)}a(u8n,"removeSignal");d8n.exports={addSignal:VSs,removeSignal:u8n}});var m8n=I((EYd,h8n)=>{"use strict";p();var WSs=require("node:assert"),{finished:zSs}=require("node:stream"),{AsyncResource:YSs}=require("node:async_hooks"),{InvalidArgumentError:Vde,InvalidReturnValueError:KSs}=so(),aF=Po(),{addSignal:JSs,removeSignal:f8n}=ePe();function ZSs(){}a(ZSs,"noop");var Prr=class extends YSs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Vde("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Vde("invalid callback");if(typeof r!="function")throw new Vde("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Vde("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Vde("invalid method");if(u&&typeof u!="function")throw new Vde("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw aF.isStream(l)&&aF.destroy(l.on("error",ZSs),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,aF.isStream(l)&&l.on("error",f=>{this.onError(f)}),JSs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}WSs(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"?aF.parseRawHeaders(r):aF.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 KSs("expected Writable");return zSs(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&aF.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;f8n(this),r&&(this.trailers=aF.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;f8n(this),this.factory=null,r?(this.res=null,aF.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,aF.destroy(s,e))}};function p8n(t,e,r){if(r===void 0)return new Promise((n,o)=>{p8n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Prr(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(p8n,"stream");h8n.exports=p8n});var E8n=I((CYd,y8n)=>{"use strict";p();var{Readable:A8n,Duplex:XSs,PassThrough:eTs}=require("node:stream"),tTs=require("node:assert"),{AsyncResource:rTs}=require("node:async_hooks"),{InvalidArgumentError:tPe,InvalidReturnValueError:nTs,RequestAbortedError:krr}=so(),WO=Po(),{addSignal:iTs,removeSignal:oTs}=ePe();function g8n(){}a(g8n,"noop");var Wde=Symbol("resume"),Drr=class extends A8n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Wde]=null}_read(){let{[Wde]:e}=this;e&&(this[Wde]=null,e())}_destroy(e,r){this._read(),r(e)}},Nrr=class extends A8n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Wde]=e}_read(){this[Wde]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new krr),r(e)}},Mrr=class extends rTs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new tPe("invalid opts");if(typeof r!="function")throw new tPe("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 tPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new tPe("invalid method");if(c&&typeof c!="function")throw new tPe("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 Drr().on("error",g8n),this.ret=new XSs({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[Wde]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new krr),A&&u&&A(),WO.destroy(f,u),WO.destroy(h,u),WO.destroy(m,u),oTs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,iTs(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}tTs(!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"?WO.parseRawHeaders(r):WO.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Nrr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?WO.parseRawHeaders(r):WO.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",g8n),u}if(!l||typeof l.on!="function")throw new nTs("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;WO.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||WO.destroy(u,new krr)}),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,WO.destroy(r,e)}};function sTs(t,e){try{let r=new Mrr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new eTs().destroy(r)}}a(sTs,"pipeline");y8n.exports=sTs});var T8n=I((TYd,S8n)=>{"use strict";p();var{InvalidArgumentError:Orr,SocketError:aTs}=so(),{AsyncResource:cTs}=require("node:async_hooks"),_8n=require("node:assert"),v8n=Po(),{kHTTP2Stream:lTs}=tl(),{addSignal:uTs,removeSignal:C8n}=ePe(),Brr=class extends cTs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Orr("invalid opts");if(typeof r!="function")throw new Orr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Orr("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,uTs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}_8n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new aTs("bad upgrade",null)}onUpgrade(e,r,n){_8n(n[lTs]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;C8n(this),this.callback=null;let l=this.responseHeaders==="raw"?v8n.parseRawHeaders(r):v8n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;C8n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function b8n(t,e){if(e===void 0)return new Promise((r,n)=>{b8n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Brr(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(b8n,"upgrade");S8n.exports=b8n});var P8n=I((wYd,R8n)=>{"use strict";p();var dTs=require("node:assert"),{AsyncResource:fTs}=require("node:async_hooks"),{InvalidArgumentError:Lrr,SocketError:pTs}=so(),I8n=Po(),{addSignal:hTs,removeSignal:x8n}=ePe(),Frr=class extends fTs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Lrr("invalid opts");if(typeof r!="function")throw new Lrr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Lrr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,hTs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}dTs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new pTs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;x8n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?I8n.parseRawHeaders(r):I8n.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;x8n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function w8n(t,e){if(e===void 0)return new Promise((r,n)=>{w8n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Frr(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(w8n,"connect");R8n.exports=w8n});var k8n=I((kYd,zde)=>{"use strict";p();zde.exports.request=c8n();zde.exports.stream=m8n();zde.exports.pipeline=E8n();zde.exports.upgrade=T8n();zde.exports.connect=P8n()});var Qrr=I((NYd,N8n)=>{"use strict";p();var{UndiciError:mTs}=so(),D8n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Urr=class extends mTs{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[D8n]===!0}get[D8n](){return!0}};N8n.exports={MockNotMatchedError:Urr}});var OJ=I((BYd,M8n)=>{"use strict";p();M8n.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 rPe=I((FYd,$8n)=>{"use strict";p();var{MockNotMatchedError:Yde}=Qrr(),{kDispatches:BJ,kMockAgent:gTs,kOriginalDispatch:ATs,kOrigin:yTs,kGetNetConnect:ETs,kTotalDispatchCount:Hrr}=OJ(),{serializePathWithQuery:_Ts}=Po(),{STATUS_CODES:vTs}=require("node:http"),{types:{isPromise:CTs}}=require("node:util"),{InvalidArgumentError:qrr}=so();function zO(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(zO,"matchValue");function B8n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(B8n,"lowerCaseEntries");function L8n(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=L8n(e,r);if(!zO(n,o))return!1}return!0}a(F8n,"matchHeaders");function bTs(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(bTs,"normalizeSearchParams");function jrr(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(jrr,"safeUrl");function STs(t,{path:e,method:r,body:n,headers:o}){let s=zO(t.path,e),c=zO(t.method,r),l=typeof t.body<"u"?zO(t.body,n):!0,u=F8n(t,o);return s&&c&&l&&u}a(STs,"matchKey");function U8n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(U8n,"getResponseData");function Q8n(t,e){let r=e.query?_Ts(e.path,e.query):e.path,n=typeof r=="string"?jrr(r):r,o=O8n(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?zO(O8n(jrr(c)),o):zO(jrr(c),n));if(s.length===0)throw new Yde(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>zO(c,e.method)),s.length===0)throw new Yde(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?zO(c,e.body):!0),s.length===0)throw new Yde(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>F8n(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Yde(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(Q8n,"getMockDispatch");function TTs(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[Hrr]=(t[Hrr]||0)+1,c}a(TTs,"addMockDispatch");function Grr(t,e){let r=t.findIndex(n=>n.consumed?STs(n,e):!1);r!==-1&&t.splice(r,1)}a(Grr,"deleteMockDispatch");function O8n(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(O8n,"removeTrailingSlash");function q8n(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(q8n,"buildKey");function $rr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[BJ])},d):E(this[BJ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?Vrr(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(CTs(w))return w.then(D=>E(v,D));if(g)return;let R=U8n(w),x=$rr(c),P=$rr(l);e.onHeaders?.(o,x,_,j8n(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),Grr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(H8n,"mockDispatch");function xTs(){let t=this[gTs],e=this[yTs],r=this[ATs];return a(function(o,s){if(t.isMockActive)try{H8n.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[ETs](),u=this[BJ][Hrr]||this[BJ].length,f=`, ${this[BJ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Yde(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(G8n(l,e))r.call(this,o,s);else throw new Yde(`${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(xTs,"buildMockDispatch");function G8n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>zO(n,r.host)))}a(G8n,"checkNetConnect");function wTs(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(wTs,"normalizeOrigin");function RTs(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new qrr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new qrr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new qrr("options.ignoreTrailingSlash must to be a boolean");return r}a(RTs,"buildAndValidateMockOptions");$8n.exports={getResponseData:U8n,getMockDispatch:Q8n,addMockDispatch:TTs,deleteMockDispatch:Grr,buildKey:q8n,generateKeyValues:$rr,matchValue:zO,getResponse:ITs,getStatusText:j8n,mockDispatch:H8n,buildMockDispatch:xTs,checkNetConnect:G8n,buildAndValidateMockOptions:RTs,getHeaderByName:L8n,buildHeadersFromArray:Vrr,normalizeSearchParams:bTs,normalizeOrigin:wTs}});var Xrr=I((qYd,Zrr)=>{"use strict";p();var{getResponseData:PTs,buildKey:kTs,addMockDispatch:Wrr}=rPe(),{kDispatches:sit,kDispatchKey:ait,kDefaultHeaders:zrr,kDefaultTrailers:Yrr,kContentLength:Krr,kMockDispatch:cit,kIgnoreTrailingSlash:lit}=OJ(),{InvalidArgumentError:YO}=so(),{serializePathWithQuery:DTs}=Po(),Kde=class{static{a(this,"MockScope")}constructor(e){this[cit]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new YO("waitInMs must be a valid integer > 0");return this[cit].delay=e,this}persist(){return this[cit].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new YO("repeatTimes must be a valid integer > 0");return this[cit].times=e,this}},Jrr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new YO("opts must be an object");if(typeof e.path>"u")throw new YO("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=DTs(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[ait]=kTs(e),this[sit]=r,this[lit]=e.ignoreTrailingSlash??!1,this[zrr]={},this[Yrr]={},this[Krr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=PTs(r),s=this[Krr]?{"content-length":o.length}:{},c={...this[zrr],...s,...n.headers},l={...this[Yrr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new YO("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new YO("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 YO("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Wrr(this[sit],this[ait],s,{ignoreTrailingSlash:this[lit]});return new Kde(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=Wrr(this[sit],this[ait],n,{ignoreTrailingSlash:this[lit]});return new Kde(o)}replyWithError(e){if(typeof e>"u")throw new YO("error must be defined");let r=Wrr(this[sit],this[ait],{error:e},{ignoreTrailingSlash:this[lit]});return new Kde(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new YO("headers must be defined");return this[zrr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new YO("trailers must be defined");return this[Yrr]=e,this}replyContentLength(){return this[Krr]=!0,this}};Zrr.exports.MockInterceptor=Jrr;Zrr.exports.MockScope=Kde});var nnr=I((GYd,Z8n)=>{"use strict";p();var{promisify:NTs}=require("node:util"),MTs=ej(),{buildMockDispatch:OTs}=rPe(),{kDispatches:enr,kMockAgent:V8n,kClose:W8n,kOriginalClose:z8n,kOrigin:Y8n,kOriginalDispatch:BTs,kConnected:tnr,kIgnoreTrailingSlash:K8n}=OJ(),{MockInterceptor:LTs}=Xrr(),J8n=tl(),{InvalidArgumentError:FTs}=so(),rnr=class extends MTs{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new FTs("Argument opts.agent must implement Agent");super(e,r),this[V8n]=r.agent,this[Y8n]=e,this[K8n]=r.ignoreTrailingSlash??!1,this[enr]=[],this[tnr]=1,this[BTs]=this.dispatch,this[z8n]=this.close.bind(this),this.dispatch=OTs.call(this),this.close=this[W8n]}get[J8n.kConnected](){return this[tnr]}intercept(e){return new LTs(e&&{ignoreTrailingSlash:this[K8n],...e},this[enr])}cleanMocks(){this[enr]=[]}async[W8n](){await NTs(this[z8n])(),this[tnr]=0,this[V8n][J8n.kClients].delete(this[Y8n])}};Z8n.exports=rnr});var snr=I((WYd,onr)=>{"use strict";p();var{kMockCallHistoryAddLog:UTs}=OJ(),{InvalidArgumentError:lj}=so();function aj(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 lj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(aj,"handleFilterCallsWithOptions");function QTs(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new lj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(QTs,"buildAndValidateFilterCallsOptions");function cj(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 lj(`${t} parameter should be one of string, regexp, undefined or null`)}}a(cj,"makeFilterCalls");function qTs(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 lj("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(qTs,"computeUrlWithMaybeSearchParameters");var uit=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=qTs(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)}},inr=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 lj("nthCall must be called with a number");if(!Number.isInteger(e))throw new lj("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new lj("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",...QTs(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=aj(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=aj(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=aj(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=aj(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=aj(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=aj(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=aj(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=aj(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new lj("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=cj.call(this,"protocol");filterCallsByHost=cj.call(this,"host");filterCallsByPort=cj.call(this,"port");filterCallsByOrigin=cj.call(this,"origin");filterCallsByPath=cj.call(this,"path");filterCallsByHash=cj.call(this,"hash");filterCallsByFullUrl=cj.call(this,"fullUrl");filterCallsByMethod=cj.call(this,"method");clear(){this.logs=[]}[UTs](e){let r=new uit(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};onr.exports.MockCallHistory=inr;onr.exports.MockCallHistoryLog=uit});var unr=I((KYd,o6n)=>{"use strict";p();var{promisify:jTs}=require("node:util"),HTs=IJ(),{buildMockDispatch:GTs}=rPe(),{kDispatches:anr,kMockAgent:X8n,kClose:e6n,kOriginalClose:t6n,kOrigin:r6n,kOriginalDispatch:$Ts,kConnected:cnr,kIgnoreTrailingSlash:n6n}=OJ(),{MockInterceptor:VTs}=Xrr(),i6n=tl(),{InvalidArgumentError:WTs}=so(),lnr=class extends HTs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new WTs("Argument opts.agent must implement Agent");super(e,r),this[X8n]=r.agent,this[r6n]=e,this[n6n]=r.ignoreTrailingSlash??!1,this[anr]=[],this[cnr]=1,this[$Ts]=this.dispatch,this[t6n]=this.close.bind(this),this.dispatch=GTs.call(this),this.close=this[e6n]}get[i6n.kConnected](){return this[cnr]}intercept(e){return new VTs(e&&{ignoreTrailingSlash:this[n6n],...e},this[anr])}cleanMocks(){this[anr]=[]}async[e6n](){await jTs(this[t6n])(),this[cnr]=0,this[X8n][i6n.kClients].delete(this[r6n])}};o6n.exports=lnr});var a6n=I((eKd,s6n)=>{"use strict";p();var{Transform:zTs}=require("node:stream"),{Console:YTs}=require("node:console"),KTs=process.versions.icu?"\u2705":"Y ",JTs=process.versions.icu?"\u274C":"N ";s6n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new zTs({transform(r,n,o){o(null,r)}}),this.logger=new YTs({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?KTs:JTs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var mnr=I((nKd,h6n)=>{"use strict";p();var{kClients:LJ}=tl(),ZTs=RJ(),{kAgent:dnr,kMockAgentSet:dit,kMockAgentGet:c6n,kDispatches:fnr,kIsMockActive:fit,kNetConnect:FJ,kGetNetConnect:XTs,kOptions:pit,kFactory:hit,kMockAgentRegisterCallHistory:pnr,kMockAgentIsCallHistoryEnabled:nPe,kMockAgentAddCallHistoryLog:l6n,kMockAgentMockCallHistoryInstance:Jde,kMockAgentAcceptsNonStandardSearchParameters:u6n,kMockCallHistoryAddLog:eIs,kIgnoreTrailingSlash:d6n}=OJ(),tIs=nnr(),rIs=unr(),{matchValue:nIs,normalizeSearchParams:iIs,buildAndValidateMockOptions:oIs,normalizeOrigin:f6n}=rPe(),{InvalidArgumentError:p6n,UndiciError:sIs}=so(),aIs=_Re(),cIs=a6n(),{MockCallHistory:lIs}=snr(),hnr=class extends aIs{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=oIs(e);if(this[FJ]=!0,this[fit]=!0,this[nPe]=r.enableCallHistory??!1,this[u6n]=r.acceptNonStandardSearchParameters??!1,this[d6n]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new p6n("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new ZTs(e);this[dnr]=n,this[LJ]=n[LJ],this[pit]=r,this[nPe]&&this[pnr]()}get(e){let r=f6n(e),n=this[d6n]?r.replace(/\/$/,""):r,o=this[c6n](n);return o||(o=this[hit](n),this[dit](n,o)),o}dispatch(e,r){e.origin=f6n(e.origin),this.get(e.origin),this[l6n](e);let n=this[u6n],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=iIs(c,n);o.path=`${s}?${l}`}return this[dnr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[dnr].close(),this[LJ].clear()}deactivate(){this[fit]=!1}activate(){this[fit]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[FJ])?this[FJ].push(e):this[FJ]=[e];else if(typeof e>"u")this[FJ]=!0;else throw new p6n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[FJ]=!1}enableCallHistory(){return this[nPe]=!0,this}disableCallHistory(){return this[nPe]=!1,this}getCallHistory(){return this[Jde]}clearCallHistory(){this[Jde]!==void 0&&this[Jde].clear()}get isMockActive(){return this[fit]}[pnr](){this[Jde]===void 0&&(this[Jde]=new lIs)}[l6n](e){this[nPe]&&(this[pnr](),this[Jde][eIs](e))}[dit](e,r){this[LJ].set(e,{count:0,dispatcher:r})}[hit](e){let r=Object.assign({agent:this},this[pit]);return this[pit]&&this[pit].connections===1?new tIs(e,r):new rIs(e,r)}[c6n](e){let r=this[LJ].get(e);if(r?.dispatcher)return r.dispatcher;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[LJ]))if(o&&typeof n!="string"&&nIs(n,e)){let s=this[hit](e);return this[dit](e,s),s[fnr]=o.dispatcher[fnr],s}}[XTs](){return this[FJ]}pendingInterceptors(){let e=this[LJ];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[fnr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new cIs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new sIs(r.length===1?`1 interceptor is pending: ${e.format(r)}`.trim():`${r.length} interceptors are pending: -${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p();var{InvalidArgumentError:Nks}=ao(),{runtimeFeatures:Mks}=pF();function Oks(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(Oks,"createHeaderFilters");var cUn=Mks.has("crypto")?require("node:crypto"):null,Bks=cUn?.hash?t=>cUn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function uUn(t){return Array.isArray(t)&&(t.length&1)===0}a(uUn,"isUndiciHeaders");function Lks(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(Lks,"isUrlExcludedFactory");function Fks(t){let e={};if(!t)return e;if(uUn(t)){for(let r=0;r{"use strict";p();var{writeFile:Qks,readFile:qks,mkdir:jks}=require("node:fs/promises"),{dirname:Hks,resolve:fUn}=require("node:path"),{setTimeout:Gks,clearTimeout:pUn}=require("node:timers"),{InvalidArgumentError:hUn,UndiciError:$ks}=ao(),{hashId:Vks,isUrlExcludedFactory:Wks,normalizeHeaders:mUn,createHeaderFilters:gUn}=xir();function Mke(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||mUn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:AUn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(Mke,"formatRequestKey");function AUn(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(AUn,"filterHeadersForMatching");function yUn(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(yUn,"filterHeadersForStorage");function Oke(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 Vks(r)}a(Oke,"createRequestHash");var wir=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=gUn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=Wks(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=Mke(e,this.#s,this.matchOptions),o=Oke(n),s=mUn(r.headers),c={statusCode:r.statusCode,headers:yUn(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=Mke(e,this.#s,this.matchOptions),n=Oke(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 hUn("Snapshot path is required");try{let n=await qks(fUn(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 $ks(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new hUn("Snapshot path is required");let n=fUn(r);await jks(Hks(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await Qks(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=Mke(e,this.#s,this.matchOptions),n=Oke(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=Mke(e,this.#s,this.matchOptions),n=Oke(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&&(pUn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=Gks(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(pUn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};EUn.exports={SnapshotRecorder:wir,formatRequestKey:Mke,createRequestHash:Oke,filterHeadersForMatching:AUn,filterHeadersForStorage:yUn,createHeaderFilters:gUn}});var bUn=I((Wrf,vUn)=>{"use strict";p();var zks=YJ(),Yks=Iir(),{SnapshotRecorder:Kks}=_Un(),Jks=YRe(),{InvalidArgumentError:Zks,UndiciError:Xks}=ao(),{validateSnapshotMode:ePs}=xir(),rb=Symbol("kSnapshotRecorder"),u5=Symbol("kSnapshotMode"),Bke=Symbol("kSnapshotPath"),Rir=Symbol("kSnapshotLoaded"),oot=Symbol("kRealAgent"),CUn=!1,kir=class extends Yks{static{a(this,"SnapshotAgent")}constructor(e={}){CUn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),CUn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),ePs(r),(r==="playback"||r==="update")&&!n)throw new Zks(`snapshotPath is required when mode is '${r}'`);this[u5]=r,this[Bke]=n,this[rb]=new Kks({snapshotPath:this[Bke],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[Rir]=!1,(this[u5]==="record"||this[u5]==="update"||this[u5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[oot]=new zks(e)),(this[u5]==="playback"||this[u5]==="update")&&this[Bke]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=Jks.wrap(r);let n=this[u5];if(this[rb].isUrlExcluded(e))return this[oot].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Rir])return this.#e(e,r);let o=this[rb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new Xks(`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[rb].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[oot].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[rb].loadSnapshots(e||this[Bke]),this[Rir]=!0,this[u5]==="playback"&&this.#n()}async saveSnapshots(e){return this[rb].saveSnapshots(e||this[Bke])}#n(){for(let e of this[rb].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[rb]}getMode(){return this[u5]}clearSnapshots(){this[rb].clear()}resetCallCounts(){this[rb].resetCallCounts()}deleteSnapshot(e){return this[rb].deleteSnapshot(e)}getSnapshotInfo(e){return this[rb].getSnapshotInfo(e)}replaceSnapshots(e){this[rb].replaceSnapshots(e)}async close(){await this[rb].close(),await this[oot]?.close(),await super.close()}};vUn.exports=kir});var sot=I((Krf,xUn)=>{"use strict";p();var SUn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:tPs}=ao(),rPs=YJ();IUn()===void 0&&TUn(new rPs);function TUn(t){if(!t||typeof t.dispatch!="function")throw new tPs("Argument agent must implement Agent");Object.defineProperty(globalThis,SUn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(TUn,"setGlobalDispatcher");function IUn(){return globalThis[SUn]}a(IUn,"getGlobalDispatcher");var nPs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];xUn.exports={setGlobalDispatcher:TUn,getGlobalDispatcher:IUn,installedExports:nPs}});var vfe=I((enf,wUn)=>{"use strict";p();var vF=require("node:assert"),iPs=YRe();wUn.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=iPs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return vF(!this.#t),vF(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return vF(!this.#t),vF(!this.#r),vF(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return vF(!this.#t),vF(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return vF(!this.#t),vF(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Mir=I((nnf,DUn)=>{"use strict";p();var nb=Do(),{kBodyUsed:Lke}=nl(),Nir=require("node:assert"),{InvalidArgumentError:Pir}=ao(),oPs=require("node:events"),sPs=[300,301,302,303,307,308],RUn=Symbol("body"),kUn=a(()=>{},"noop"),aot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[RUn]=e,this[Lke]=!1}async*[Symbol.asyncIterator](){Nir(!this[Lke],"disturbed"),this[Lke]=!0,yield*this[RUn]}},Dir=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Pir("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 Pir("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=[],nb.isStream(this.opts.body)?(nb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Nir(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Lke]=!1,oPs.prototype.on.call(this.opts.body,"data",function(){this[Lke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new aot(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&nb.isIterable(this.opts.body)&&!nb.isFormDataLike(this.opts.body)&&(this.opts.body=new aot(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",nb.isStream(this.opts.body)&&nb.destroy(this.opts.body.on("error",kUn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",nb.isStream(this.opts.body)&&nb.destroy(this.opts.body.on("error",kUn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||nb.isDisturbed(this.opts.body)||sPs.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}=nb.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 Pir(`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=aPs(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 PUn(t,e,r){if(t.length===4)return nb.headerNameToString(t)==="host";if(e&&nb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=nb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(PUn,"shouldRemoveHeader");function aPs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var cPs=Mir();function lPs({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 cPs(e,s,l,o);return e(l,u)},"Intercept")}a(lPs,"createRedirectInterceptor");NUn.exports=lPs});var BUn=I((lnf,OUn)=>{"use strict";p();var uPs=vfe(),{ResponseError:dPs}=ao(),Oir=class extends uPs{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 dPs("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)}};OUn.exports=()=>t=>a(function(r,n){return t(r,new Oir(r,{handler:n}))},"Intercept")});var FUn=I((fnf,LUn)=>{"use strict";p();var fPs=$it();LUn.exports=t=>e=>a(function(n,o){return e(n,new fPs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var QUn=I((mnf,UUn)=>{"use strict";p();var{InvalidArgumentError:pPs,RequestAbortedError:hPs}=ao(),mPs=vfe(),Bir=class extends mPs{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 pPs("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 hPs(`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 gPs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Bir({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(gPs,"createDumpInterceptor");UUn.exports=gPs});var GUn=I((ynf,HUn)=>{"use strict";p();var{isIP:APs}=require("node:net"),{lookup:yPs}=require("node:dns"),EPs=vfe(),{InvalidArgumentError:oZ,InformationalError:_Ps}=ao(),Lir=Math.pow(2,31)-1;function CPs(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(CPs,"hasSafeIterator");function qUn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(qUn,"isHostHeader");function vPs(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"&&CPs(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(vPs,"normalizeHeaders");function bPs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},Uir=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 Fir(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 _Ps("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){yPs(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===Lir?(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===Lir?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===Lir?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 Qir(this,e,r)}},Qir=class extends EPs{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:jUn(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}}};HUn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new oZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new oZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new oZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new oZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new oZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new oZ("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 oZ("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 Uir(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return APs(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:jUn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var bfe=I((Cnf,VUn)=>{"use strict";p();var{safeHTTPMethods:$Un,pathHasQueryOrFragment:SPs,hasSafeIterator:TPs}=Do(),{serializePathWithQuery:IPs}=Do();function xPs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!SPs(e)&&(e=IPs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(xPs,"makeCacheKey");function wPs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},TPs(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(wPs,"normalizeHeaders");function RPs(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(RPs,"assertCacheKey");function kPs(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(kPs,"assertCacheValue");function PPs(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 LPs(t){switch(t[3]){case",":return FPs(t);case" ":return UPs(t);default:return QPs(t)}}a(LPs,"parseHttpDate");function FPs(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(FPs,"parseImfDate");function UPs(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(UPs,"parseAscTimeDate");function QPs(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(QPs,"parseRfc850Date");WUn.exports={parseHttpDate:LPs}});var ZUn=I((xnf,JUn)=>{"use strict";p();var qPs=Do(),{parseCacheControlHeader:jPs,parseVaryHeader:HPs,isEtagUsable:GPs}=bfe(),{parseHttpDate:YUn}=zUn();function $Ps(){}a($Ps,"noop");var KUn=[200,203,204,206,300,301,308,404,405,410,414,501],VPs=[206],WPs=2147483647e3,qir=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(!qPs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.($Ps)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&KUn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?jPs(l):{};if(!zPs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?YPs(n.age):void 0;if(h&&h>=WPs)return s();let m=typeof n.date=="string"?YUn(n.date):void 0,g=KPs(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=HPs(n.vary,this.#e.headers),!E))return s();let _=JPs(A,d,y),v=ZPs(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(),k=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",()=>{k()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),k()}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"&&GPs(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 zPs(t,e,r,n,o){return!(e<200||VPs.includes(e)||!KUn.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(zPs,"canCacheResponse");function YPs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(YPs,"getAge");function KPs(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=YUn(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(XPs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(KPs,"determineStaleAt");function JPs(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(JPs,"determineDeleteAt");function ZPs(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(ZPs,"stripNecessaryHeaders");function XPs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(XPs,"isValidDate");JUn.exports=qir});var Hir=I((knf,t7n)=>{"use strict";p();var{Writable:e2s}=require("node:stream"),{EventEmitter:t2s}=require("node:events"),{assertCacheKey:XUn,assertCacheValue:r2s}=bfe(),jir=class extends t2s{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){XUn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?e7n(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){XUn(e),r2s(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new e2s({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=e7n(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(e7n,"findEntry");t7n.exports=jir});var n7n=I((Nnf,r7n)=>{"use strict";p();var n2s=require("node:assert"),Gir=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(n2s(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}};r7n.exports=Gir});var a7n=I((Bnf,s7n)=>{"use strict";p();var i7n=require("node:assert"),{Readable:i2s}=require("node:stream"),Sfe=Do(),Fke=ZUn(),o2s=Hir(),s2s=n7n(),{assertCacheStore:a2s,assertCacheMethods:c2s,makeCacheKey:l2s,normalizeHeaders:u2s,parseCacheControlHeader:d2s}=bfe(),{AbortError:f2s}=ao();function p2s(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 h2s(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(h2s,"needsRevalidation");function m2s(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(m2s,"isStale");function g2s(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(g2s,"withinStaleWhileRevalidateWindow");function A2s(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,[],Vir,"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 Fke(e,r,n))}a(A2s,"handleUncachedResponse");function $ir(t,e,r,n,o,s){let c=Sfe.isStream(r.body)?r.body:i2s.from(r.body??[]);i7n(!c.destroyed,"stream should not be destroyed"),i7n(!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 f2s)}};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($ir,"sendCachedValue");function o7n(t,e,r,n,o,s,c){if(!c)return A2s(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new Fke(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=m2s(c,s),f=h2s(c,s,o);if(d||f){if(Sfe.isStream(o.body)&&Sfe.bodyLength(o.body)!==0)return t(o,new Fke(e,r,n));if(!f&&g2s(c))return $ir(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 Fke(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?$ir(n,o,c,u,y,d):Sfe.isStream(c.body)&&c.body.on("error",Vir).destroy()},new Fke(e,r,n),h))}Sfe.isStream(o.body)&&o.body.on("error",Vir).destroy(),$ir(n,o,c,u,null,!1)}a(o7n,"handleResult");s7n.exports=(t={})=>{let{store:e=new o2s,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(a2s(e,"opts.store"),c2s(r,"opts.methods"),p2s(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=Sfe.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;Eo7n(u,c,m,f,d,h,A)):o7n(u,c,m,f,d,h,g)}}});var f7n=I((Unf,d7n)=>{"use strict";p();var{createInflate:Wir,createGunzip:c7n,createBrotliDecompress:y2s,createZstdDecompress:E2s}=require("node:zlib"),{pipeline:_2s}=require("node:stream"),C2s=vfe(),{runtimeFeatures:v2s}=pF(),l7n={gzip:c7n,"x-gzip":c7n,br:y2s,deflate:Wir,compress:Wir,"x-compress":Wir,...v2s.has("zstd")?{zstd:E2s}:{}},b2s=[204,304],u7n=!1,zir=class extends C2s{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=b2s,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(!l7n[c])return o.length=0,o;o.push(l7n[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),_2s(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 S2s(t={}){return u7n||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),u7n=!0),e=>(r,n)=>{let o=new zir(n,t);return e(r,o)}}a(S2s,"createDecompressInterceptor");d7n.exports=S2s});var m7n=I((jnf,h7n)=>{"use strict";p();var{RequestAbortedError:T2s}=ao(),p7n=5*1024*1024,Yir=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=p7n;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=p7n){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.#C(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 T2s(`Deduplicated waiting handler exceeded maxBufferSize (${this.#r} bytes) while paused`);this.#C(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}}}#C(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)}};h7n.exports=Yir});var A7n=I(($nf,g7n)=>{"use strict";p();var I2s=require("node:diagnostics_channel"),x2s=Do(),w2s=m7n(),{normalizeHeaders:R2s,makeCacheKey:k2s,makeDeduplicationKey:P2s}=bfe(),cot=I2s.channel("undici:request:pending-requests");g7n.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(!x2s.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:R2s(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=k2s(d),m=P2s(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new w2s(f,()=>{l.delete(m),cot.hasSubscribers&&cot.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),cot.hasSubscribers&&cot.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var _7n=I((znf,E7n)=>{"use strict";p();var{Writable:D2s}=require("node:stream"),{assertCacheKey:Kir,assertCacheValue:N2s}=bfe(),Jir,uT=3,y7n=2*1e3*1e3*1e3;E7n.exports=class{static{a(this,"SqliteCacheStore")}#e=y7n;#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>y7n)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}}Jir||(Jir=require("node:sqlite").DatabaseSync),this.#r=new Jir(e?.location??":memory:"),this.#r.exec(` +${e.format(r)}`.trim())}};h6n.exports=hnr});var gnr=I((sKd,y6n)=>{"use strict";p();var{InvalidArgumentError:uIs}=so(),{runtimeFeatures:dIs}=X3();function fIs(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(fIs,"createHeaderFilters");var m6n=dIs.has("crypto")?require("node:crypto"):null,pIs=m6n?.hash?t=>m6n.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function A6n(t){return Array.isArray(t)&&(t.length&1)===0}a(A6n,"isUndiciHeaders");function hIs(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(hIs,"isUrlExcludedFactory");function mIs(t){let e={};if(!t)return e;if(A6n(t)){for(let r=0;r{"use strict";p();var{writeFile:AIs,readFile:yIs,mkdir:EIs}=require("node:fs/promises"),{dirname:_Is,resolve:E6n}=require("node:path"),{setTimeout:vIs,clearTimeout:_6n}=require("node:timers"),{InvalidArgumentError:v6n,UndiciError:CIs}=so(),{hashId:bIs,isUrlExcludedFactory:SIs,normalizeHeaders:C6n,createHeaderFilters:b6n}=gnr();function iPe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||C6n(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:S6n(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(iPe,"formatRequestKey");function S6n(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(S6n,"filterHeadersForMatching");function T6n(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(T6n,"filterHeadersForStorage");function oPe(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 bIs(r)}a(oPe,"createRequestHash");var Anr=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=b6n(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=SIs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=iPe(e,this.#s,this.matchOptions),o=oPe(n),s=C6n(r.headers),c={statusCode:r.statusCode,headers:T6n(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=iPe(e,this.#s,this.matchOptions),n=oPe(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 v6n("Snapshot path is required");try{let n=await yIs(E6n(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 CIs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new v6n("Snapshot path is required");let n=E6n(r);await EIs(_Is(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await AIs(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=iPe(e,this.#s,this.matchOptions),n=oPe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=iPe(e,this.#s,this.matchOptions),n=oPe(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&&(_6n(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=vIs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(_6n(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};I6n.exports={SnapshotRecorder:Anr,formatRequestKey:iPe,createRequestHash:oPe,filterHeadersForMatching:S6n,filterHeadersForStorage:T6n,createHeaderFilters:b6n}});var P6n=I((fKd,R6n)=>{"use strict";p();var TIs=RJ(),IIs=mnr(),{SnapshotRecorder:xIs}=x6n(),wIs=ERe(),{InvalidArgumentError:RIs,UndiciError:PIs}=so(),{validateSnapshotMode:kIs}=gnr(),KC=Symbol("kSnapshotRecorder"),KO=Symbol("kSnapshotMode"),sPe=Symbol("kSnapshotPath"),ynr=Symbol("kSnapshotLoaded"),mit=Symbol("kRealAgent"),w6n=!1,Enr=class extends IIs{static{a(this,"SnapshotAgent")}constructor(e={}){w6n||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),w6n=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),kIs(r),(r==="playback"||r==="update")&&!n)throw new RIs(`snapshotPath is required when mode is '${r}'`);this[KO]=r,this[sPe]=n,this[KC]=new xIs({snapshotPath:this[sPe],mode:this[KO],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[ynr]=!1,(this[KO]==="record"||this[KO]==="update"||this[KO]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[mit]=new TIs(e)),(this[KO]==="playback"||this[KO]==="update")&&this[sPe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=wIs.wrap(r);let n=this[KO];if(this[KC].isUrlExcluded(e))return this[mit].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[ynr])return this.#e(e,r);let o=this[KC].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new PIs(`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[KC].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[mit].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[KC].loadSnapshots(e||this[sPe]),this[ynr]=!0,this[KO]==="playback"&&this.#n()}async saveSnapshots(e){return this[KC].saveSnapshots(e||this[sPe])}#n(){for(let e of this[KC].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[KC]}getMode(){return this[KO]}clearSnapshots(){this[KC].clear()}resetCallCounts(){this[KC].resetCallCounts()}deleteSnapshot(e){return this[KC].deleteSnapshot(e)}getSnapshotInfo(e){return this[KC].getSnapshotInfo(e)}replaceSnapshots(e){this[KC].replaceSnapshots(e)}async close(){await this[KC].close(),await this[mit]?.close(),await super.close()}};R6n.exports=Enr});var git=I((mKd,M6n)=>{"use strict";p();var k6n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:DIs}=so(),NIs=RJ();N6n()===void 0&&D6n(new NIs);function D6n(t){if(!t||typeof t.dispatch!="function")throw new DIs("Argument agent must implement Agent");Object.defineProperty(globalThis,k6n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(D6n,"setGlobalDispatcher");function N6n(){return globalThis[k6n]}a(N6n,"getGlobalDispatcher");var MIs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];M6n.exports={setGlobalDispatcher:D6n,getGlobalDispatcher:N6n,installedExports:MIs}});var Zde=I((EKd,O6n)=>{"use strict";p();var cF=require("node:assert"),OIs=ERe();O6n.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=OIs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return cF(!this.#t),cF(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return cF(!this.#t),cF(!this.#r),cF(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return cF(!this.#t),cF(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return cF(!this.#t),cF(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var bnr=I((CKd,U6n)=>{"use strict";p();var JC=Po(),{kBodyUsed:aPe}=tl(),Cnr=require("node:assert"),{InvalidArgumentError:_nr}=so(),BIs=require("node:events"),LIs=[300,301,302,303,307,308],B6n=Symbol("body"),L6n=a(()=>{},"noop"),Ait=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[B6n]=e,this[aPe]=!1}async*[Symbol.asyncIterator](){Cnr(!this[aPe],"disturbed"),this[aPe]=!0,yield*this[B6n]}},vnr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new _nr("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 _nr("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=[],JC.isStream(this.opts.body)?(JC.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Cnr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[aPe]=!1,BIs.prototype.on.call(this.opts.body,"data",function(){this[aPe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Ait(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&JC.isIterable(this.opts.body)&&!JC.isFormDataLike(this.opts.body)&&(this.opts.body=new Ait(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",JC.isStream(this.opts.body)&&JC.destroy(this.opts.body.on("error",L6n)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",JC.isStream(this.opts.body)&&JC.destroy(this.opts.body.on("error",L6n)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||JC.isDisturbed(this.opts.body)||LIs.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}=JC.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 _nr(`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=FIs(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 F6n(t,e,r){if(t.length===4)return JC.headerNameToString(t)==="host";if(e&&JC.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=JC.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(F6n,"shouldRemoveHeader");function FIs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var UIs=bnr();function QIs({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 UIs(e,s,l,o);return e(l,u)},"Intercept")}a(QIs,"createRedirectInterceptor");Q6n.exports=QIs});var H6n=I((wKd,j6n)=>{"use strict";p();var qIs=Zde(),{ResponseError:jIs}=so(),Snr=class extends qIs{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 jIs("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)}};j6n.exports=()=>t=>a(function(r,n){return t(r,new Snr(r,{handler:n}))},"Intercept")});var $6n=I((kKd,G6n)=>{"use strict";p();var HIs=tit();G6n.exports=t=>e=>a(function(n,o){return e(n,new HIs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var W6n=I((MKd,V6n)=>{"use strict";p();var{InvalidArgumentError:GIs,RequestAbortedError:$Is}=so(),VIs=Zde(),Tnr=class extends VIs{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 GIs("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 $Is(`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 WIs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Tnr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(WIs,"createDumpInterceptor");V6n.exports=WIs});var J6n=I((LKd,K6n)=>{"use strict";p();var{isIP:zIs}=require("node:net"),{lookup:YIs}=require("node:dns"),KIs=Zde(),{InvalidArgumentError:UJ,InformationalError:JIs}=so(),Inr=Math.pow(2,31)-1;function ZIs(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(ZIs,"hasSafeIterator");function z6n(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(z6n,"isHostHeader");function XIs(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"&&ZIs(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(XIs,"normalizeHeaders");function exs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},wnr=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 xnr(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 JIs("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){YIs(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===Inr?(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===Inr?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===Inr?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 Rnr(this,e,r)}},Rnr=class extends KIs{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:Y6n(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}}};K6n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new UJ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new UJ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new UJ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new UJ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new UJ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new UJ("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 UJ("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 wnr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return zIs(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:Y6n(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Xde=I((QKd,X6n)=>{"use strict";p();var{safeHTTPMethods:Z6n,pathHasQueryOrFragment:txs,hasSafeIterator:rxs}=Po(),{serializePathWithQuery:nxs}=Po();function ixs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!txs(e)&&(e=nxs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(ixs,"makeCacheKey");function oxs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},rxs(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(oxs,"normalizeHeaders");function sxs(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(sxs,"assertCacheKey");function axs(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(axs,"assertCacheValue");function cxs(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 hxs(t){switch(t[3]){case",":return mxs(t);case" ":return gxs(t);default:return Axs(t)}}a(hxs,"parseHttpDate");function mxs(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(mxs,"parseImfDate");function gxs(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(gxs,"parseAscTimeDate");function Axs(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(Axs,"parseRfc850Date");e9n.exports={parseHttpDate:hxs}});var o9n=I((VKd,i9n)=>{"use strict";p();var yxs=Po(),{parseCacheControlHeader:Exs,parseVaryHeader:_xs,isEtagUsable:vxs}=Xde(),{parseHttpDate:r9n}=t9n();function Cxs(){}a(Cxs,"noop");var n9n=[200,203,204,206,300,301,308,404,405,410,414,501],bxs=[206],Sxs=2147483647e3,Pnr=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(!yxs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(Cxs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&n9n.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?Exs(l):{};if(!Txs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?Ixs(n.age):void 0;if(h&&h>=Sxs)return s();let m=typeof n.date=="string"?r9n(n.date):void 0,g=xxs(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=_xs(n.vary,this.#e.headers),!E))return s();let _=wxs(A,d,y),v=Rxs(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"&&vxs(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 Txs(t,e,r,n,o){return!(e<200||bxs.includes(e)||!n9n.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(Txs,"canCacheResponse");function Ixs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(Ixs,"getAge");function xxs(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=r9n(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(Pxs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(xxs,"determineStaleAt");function wxs(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(wxs,"determineDeleteAt");function Rxs(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(Rxs,"stripNecessaryHeaders");function Pxs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(Pxs,"isValidDate");i9n.exports=Pnr});var Dnr=I((YKd,c9n)=>{"use strict";p();var{Writable:kxs}=require("node:stream"),{EventEmitter:Dxs}=require("node:events"),{assertCacheKey:s9n,assertCacheValue:Nxs}=Xde(),knr=class extends Dxs{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){s9n(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?a9n(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){s9n(e),Nxs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new kxs({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=a9n(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(a9n,"findEntry");c9n.exports=knr});var u9n=I((ZKd,l9n)=>{"use strict";p();var Mxs=require("node:assert"),Nnr=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(Mxs(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}};l9n.exports=Nnr});var h9n=I((tJd,p9n)=>{"use strict";p();var d9n=require("node:assert"),{Readable:Oxs}=require("node:stream"),efe=Po(),cPe=o9n(),Bxs=Dnr(),Lxs=u9n(),{assertCacheStore:Fxs,assertCacheMethods:Uxs,makeCacheKey:Qxs,normalizeHeaders:qxs,parseCacheControlHeader:jxs}=Xde(),{AbortError:Hxs}=so();function Gxs(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 $xs(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($xs,"needsRevalidation");function Vxs(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(Vxs,"isStale");function Wxs(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(Wxs,"withinStaleWhileRevalidateWindow");function zxs(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,[],Onr,"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 cPe(e,r,n))}a(zxs,"handleUncachedResponse");function Mnr(t,e,r,n,o,s){let c=efe.isStream(r.body)?r.body:Oxs.from(r.body??[]);d9n(!c.destroyed,"stream should not be destroyed"),d9n(!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 Hxs)}};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(Mnr,"sendCachedValue");function f9n(t,e,r,n,o,s,c){if(!c)return zxs(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new cPe(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=Vxs(c,s),f=$xs(c,s,o);if(d||f){if(efe.isStream(o.body)&&efe.bodyLength(o.body)!==0)return t(o,new cPe(e,r,n));if(!f&&Wxs(c))return Mnr(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 cPe(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?Mnr(n,o,c,u,y,d):efe.isStream(c.body)&&c.body.on("error",Onr).destroy()},new cPe(e,r,n),h))}efe.isStream(o.body)&&o.body.on("error",Onr).destroy(),Mnr(n,o,c,u,null,!1)}a(f9n,"handleResult");p9n.exports=(t={})=>{let{store:e=new Bxs,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(Fxs(e,"opts.store"),Uxs(r,"opts.methods"),Gxs(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=efe.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;Ef9n(u,c,m,f,d,h,A)):f9n(u,c,m,f,d,h,g)}}});var E9n=I((iJd,y9n)=>{"use strict";p();var{createInflate:Bnr,createGunzip:m9n,createBrotliDecompress:Yxs,createZstdDecompress:Kxs}=require("node:zlib"),{pipeline:Jxs}=require("node:stream"),Zxs=Zde(),{runtimeFeatures:Xxs}=X3(),g9n={gzip:m9n,"x-gzip":m9n,br:Yxs,deflate:Bnr,compress:Bnr,"x-compress":Bnr,...Xxs.has("zstd")?{zstd:Kxs}:{}},ews=[204,304],A9n=!1,Lnr=class extends Zxs{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=ews,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(!g9n[c])return o.length=0,o;o.push(g9n[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),Jxs(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 tws(t={}){return A9n||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),A9n=!0),e=>(r,n)=>{let o=new Lnr(n,t);return e(r,o)}}a(tws,"createDecompressInterceptor");y9n.exports=tws});var C9n=I((aJd,v9n)=>{"use strict";p();var{RequestAbortedError:rws}=so(),_9n=5*1024*1024,Fnr=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=_9n;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=_9n){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 rws(`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)}};v9n.exports=Fnr});var S9n=I((uJd,b9n)=>{"use strict";p();var nws=require("node:diagnostics_channel"),iws=Po(),ows=C9n(),{normalizeHeaders:sws,makeCacheKey:aws,makeDeduplicationKey:cws}=Xde(),yit=nws.channel("undici:request:pending-requests");b9n.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(!iws.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:sws(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=aws(d),m=cws(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new ows(f,()=>{l.delete(m),yit.hasSubscribers&&yit.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),yit.hasSubscribers&&yit.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var x9n=I((pJd,I9n)=>{"use strict";p();var{Writable:lws}=require("node:stream"),{assertCacheKey:Unr,assertCacheValue:uws}=Xde(),Qnr,nT=3,T9n=2*1e3*1e3*1e3;I9n.exports=class{static{a(this,"SqliteCacheStore")}#e=T9n;#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>T9n)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}}Qnr||(Qnr=require("node:sqlite").DatabaseSync),this.#r=new Qnr(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${uT} ( + CREATE TABLE IF NOT EXISTS cacheInterceptorV${nT} ( -- Data specific to us id INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT NOT NULL, @@ -287,8 +243,8 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p staleAt INTEGER NOT NULL ); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${uT}_getValuesQuery ON cacheInterceptorV${uT}(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${uT}_deleteByUrlQuery ON cacheInterceptorV${uT}(deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${nT}_getValuesQuery ON cacheInterceptorV${nT}(url, method, deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${nT}_deleteByUrlQuery ON cacheInterceptorV${nT}(deleteAt); `),this.#n=this.#r.prepare(` SELECT id, @@ -302,14 +258,14 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p vary, cachedAt, staleAt - FROM cacheInterceptorV${uT} + FROM cacheInterceptorV${nT} WHERE url = ? AND method = ? ORDER BY deleteAt ASC `),this.#i=this.#r.prepare(` - UPDATE cacheInterceptorV${uT} SET + UPDATE cacheInterceptorV${nT} SET body = ?, deleteAt = ?, statusCode = ?, @@ -322,7 +278,7 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p WHERE id = ? `),this.#o=this.#r.prepare(` - INSERT INTO cacheInterceptorV${uT} ( + INSERT INTO cacheInterceptorV${nT} ( url, method, body, @@ -336,107 +292,107 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p cachedAt, staleAt ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${uT} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${uT}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${uT} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` - DELETE FROM cacheInterceptorV${uT} + `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${nT} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${nT}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${nT} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` + DELETE FROM cacheInterceptorV${nT} WHERE id IN ( SELECT id - FROM cacheInterceptorV${uT} + FROM cacheInterceptorV${nT} ORDER BY cachedAt ASC LIMIT ? ) - `)}close(){this.#r.close()}get(e){Kir(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){Kir(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){Kir(e),N2s(r);let n=0,o=[],s=this;return new D2s({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(!M2s(o[h],f[h])){d=!1;break}}if(d)return u}}};function M2s(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(M2s,"headerValueEquals")});var sZ=I((Jnf,x7n)=>{"use strict";p();var{kConstruct:O2s}=nl(),{kEnumerableProperty:Tfe}=Do(),{iteratorMixin:B2s,isValidHeaderName:Uke,isValidHeaderValue:v7n}=iT(),{webidl:ka}=xA(),Zir=require("node:assert"),lot=require("node:util");function C7n(t){return t===10||t===13||t===9||t===32}a(C7n,"isHTTPWhiteSpaceCharCode");function b7n(t){let e=0,r=t.length;for(;r>e&&C7n(t.charCodeAt(r-1));)--r;for(;r>e&&C7n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(b7n,"headerValueNormalize");function S7n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(S7n,"fill");function Xir(t,e,r){if(r=b7n(r),Uke(e)){if(!v7n(r))throw ka.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ka.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(I7n(t)==="immutable")throw new TypeError("immutable");return dot(t).append(e,r,!1)}a(Xir,"appendHeader");function L2s(t){let e=dot(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],Zir(s!==null);return r.sort(T7n)}}},e2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){ka.util.markAsUncloneable(this),e!==O2s&&(this.#t=new uot,this.#e="none",e!==void 0&&(e=ka.converters.HeadersInit(e,"Headers constructor","init"),S7n(this,e)))}append(e,r){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=ka.converters.ByteString(e,n,"name"),r=ka.converters.ByteString(r,n,"value"),Xir(this,e,r)}delete(e){if(ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.delete"),e=ka.converters.ByteString(e,"Headers.delete","name"),!Uke(e))throw ka.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){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=ka.converters.ByteString(e,r,"name"),!Uke(e))throw ka.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=ka.converters.ByteString(e,r,"name"),!Uke(e))throw ka.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=ka.converters.ByteString(e,n,"name"),r=ka.converters.ByteString(r,n,"value"),r=b7n(r),Uke(e)){if(!v7n(r))throw ka.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw ka.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){ka.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[lot.inspect.custom](e,r){return r.depth??=e,`Headers ${lot.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:I7n,setHeadersGuard:F2s,getHeadersList:dot,setHeadersList:U2s}=e2;Reflect.deleteProperty(e2,"getHeadersGuard");Reflect.deleteProperty(e2,"setHeadersGuard");Reflect.deleteProperty(e2,"getHeadersList");Reflect.deleteProperty(e2,"setHeadersList");B2s("Headers",e2,L2s,0,1);Object.defineProperties(e2.prototype,{append:Tfe,delete:Tfe,get:Tfe,has:Tfe,set:Tfe,getSetCookie:Tfe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[lot.inspect.custom]:{enumerable:!1}});ka.converters.HeadersInit=function(t,e,r){if(ka.util.Type(t)===ka.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!lot.types.isProxy(t)&&n===e2.prototype.entries)try{return dot(t).entriesList}catch{}return typeof n=="function"?ka.converters["sequence>"](t,e,r,n.bind(t)):ka.converters["record"](t,e,r)}throw ka.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};x7n.exports={fill:S7n,compareHeaderName:T7n,Headers:e2,HeadersList:uot,getHeadersGuard:I7n,setHeadersGuard:F2s,setHeadersList:U2s,getHeadersList:dot}});var qke=I((eif,U7n)=>{"use strict";p();var{Headers:N7n,HeadersList:w7n,fill:Q2s,getHeadersGuard:q2s,setHeadersGuard:M7n,setHeadersList:O7n}=sZ(),{extractBody:R7n,cloneBody:j2s,mixinBody:H2s,streamRegistry:B7n,bodyUnusable:G2s}=ife(),L7n=Do(),k7n=require("node:util"),{kEnumerableProperty:dT}=L7n,{isValidReasonPhrase:$2s,isCancelled:V2s,isAborted:W2s,isErrorLike:z2s,environmentSettingsObject:Y2s}=iT(),{redirectStatusSet:K2s,nullBodyStatus:J2s}=ZRe(),{webidl:Zs}=xA(),{URLSerializer:P7n}=pw(),{kConstruct:pot}=nl(),eor=require("node:assert"),{isomorphicEncode:Z2s,serializeJavascriptValueToJSONString:X2s}=fF(),eDs=new TextEncoder("utf-8"),fT=class t{static{a(this,"Response")}#e;#t;static error(){return Qke(hot(),"immutable")}static json(e,r=void 0){Zs.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=Zs.converters.ResponseInit(r));let n=eDs.encode(X2s(e)),o=R7n(n),s=Qke(Ife({}),"response");return D7n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){Zs.argumentLengthCheck(arguments,1,"Response.redirect"),e=Zs.converters.USVString(e),r=Zs.converters["unsigned short"](r);let n;try{n=new URL(e,Y2s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!K2s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=Qke(Ife({}),"immutable");o.#t.status=r;let s=Z2s(P7n(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(Zs.util.markAsUncloneable(this),e===pot)return;e!==null&&(e=Zs.converters.BodyInit(e,"Response","body")),r=Zs.converters.ResponseInit(r),this.#t=Ife({}),this.#e=new N7n(pot),M7n(this.#e,"response"),O7n(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=R7n(e);n={body:o,type:s}}D7n(this,r,n)}get type(){return Zs.brandCheck(this,t),this.#t.type}get url(){Zs.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":P7n(r,!0)}get redirected(){return Zs.brandCheck(this,t),this.#t.urlList.length>1}get status(){return Zs.brandCheck(this,t),this.#t.status}get ok(){return Zs.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return Zs.brandCheck(this,t),this.#t.statusText}get headers(){return Zs.brandCheck(this,t),this.#e}get body(){return Zs.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return Zs.brandCheck(this,t),!!this.#t.body&&L7n.isDisturbed(this.#t.body.stream)}clone(){if(Zs.brandCheck(this,t),G2s(this.#t))throw Zs.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=tor(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&B7n.register(this,new WeakRef(this.#t.body.stream)),Qke(e,q2s(this.#e))}[k7n.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 ${k7n.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:tDs,setResponseHeaders:rDs,getResponseState:aZ,setResponseState:nDs}=fT;Reflect.deleteProperty(fT,"getResponseHeaders");Reflect.deleteProperty(fT,"setResponseHeaders");Reflect.deleteProperty(fT,"getResponseState");Reflect.deleteProperty(fT,"setResponseState");H2s(fT,aZ);Object.defineProperties(fT.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(fT,{json:dT,redirect:dT,error:dT});function tor(t){if(t.internalResponse)return F7n(tor(t.internalResponse),t.type);let e=Ife({...t,body:null});return t.body!=null&&(e.body=j2s(t.body)),e}a(tor,"cloneResponse");function Ife(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new w7n(t?.headersList):new w7n,urlList:t?.urlList?[...t.urlList]:[]}}a(Ife,"makeResponse");function hot(t){let e=z2s(t);return Ife({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(hot,"makeNetworkError");function iDs(t){return t.type==="error"&&t.status===0}a(iDs,"isNetworkError");function fot(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 eor(!(n in e)),r[n]=o,!0}})}a(fot,"makeFilteredResponse");function F7n(t,e){if(e==="basic")return fot(t,{type:"basic",headersList:t.headersList});if(e==="cors")return fot(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return fot(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return fot(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});eor(!1)}a(F7n,"filterResponse");function oDs(t,e=null){return eor(V2s(t)),W2s(t)?hot(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):hot(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(oDs,"makeAppropriateNetworkError");function D7n(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&&!$2s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(aZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(aZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&Q2s(tDs(t),e.headers),r){if(J2s.includes(t.status))throw Zs.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});aZ(t).body=r.body,r.type!=null&&!aZ(t).headersList.contains("content-type",!0)&&aZ(t).headersList.append("content-type",r.type,!0)}}a(D7n,"initializeResponse");function Qke(t,e){let r=new fT(pot);nDs(r,t);let n=new N7n(pot);return rDs(r,n),O7n(n,t.headersList),M7n(n,e),t.urlList.length!==0&&t.body?.stream&&B7n.register(r,new WeakRef(t.body.stream)),r}a(Qke,"fromInnerResponse");Zs.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?Zs.converters.USVString(t,e,r):Zs.is.Blob(t)||Zs.is.BufferSource(t)||Zs.is.FormData(t)||Zs.is.URLSearchParams(t)?t:Zs.converters.DOMString(t,e,r)};Zs.converters.BodyInit=function(t,e,r){return Zs.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:Zs.converters.XMLHttpRequestBodyInit(t,e,r)};Zs.converters.ResponseInit=Zs.dictionaryConverter([{key:"status",converter:Zs.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:Zs.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:Zs.converters.HeadersInit}]);Zs.is.Response=Zs.util.MakeTypeAssertion(fT);U7n.exports={isNetworkError:iDs,makeNetworkError:hot,makeResponse:Ife,makeAppropriateNetworkError:oDs,filterResponse:F7n,Response:fT,cloneResponse:tor,fromInnerResponse:Qke,getResponseState:aZ}});var xfe=I((nif,X7n)=>{"use strict";p();var{extractBody:sDs,mixinBody:aDs,cloneBody:cDs,bodyUnusable:Q7n}=ife(),{Headers:V7n,fill:lDs,HeadersList:Aot,setHeadersGuard:ror,getHeadersGuard:uDs,setHeadersList:W7n,getHeadersList:q7n}=sZ(),got=Do(),j7n=require("node:util"),{isValidHTTPToken:dDs,sameOrigin:H7n,environmentSettingsObject:mot}=iT(),{forbiddenMethodsSet:fDs,corsSafeListedMethodsSet:pDs,referrerPolicy:hDs,requestRedirect:mDs,requestMode:gDs,requestCredentials:ADs,requestCache:yDs,requestDuplex:EDs}=ZRe(),{kEnumerableProperty:Xh,normalizedMethodRecordsBase:_Ds,normalizedMethodRecords:CDs}=got,{webidl:Mi}=xA(),{URLSerializer:vDs}=pw(),{kConstruct:yot}=nl(),bDs=require("node:assert"),{getMaxListeners:z7n,setMaxListeners:SDs,defaultMaxListeners:TDs}=require("node:events"),IDs=Symbol("abortController"),Y7n=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Eot=new WeakMap,nor;try{nor=z7n(new AbortController().signal)>0}catch{nor=!1}function G7n(t){return e;function e(){let r=t.deref();if(r!==void 0){Y7n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Eot.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()}Eot.delete(r.signal)}}}}a(G7n,"buildAbort");var $7n=!1,ib=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Mi.util.markAsUncloneable(this),e===yot)return;Mi.argumentLengthCheck(arguments,1,"Request constructor"),e=Mi.converters.RequestInfo(e),r=Mi.converters.RequestInit(r);let o=null,s=null,c=mot.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=_ot({urlList:[_]}),s="cors"}else bDs(Mi.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=mot.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&H7n(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=_ot({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:mot.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&&!H7n(v,mot.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 Mi.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=CDs[_];if(v!==void 0)o.method=v;else{if(!dDs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(fDs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=_Ds[b]??_,o.method=_}!$7n&&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"}),$7n=!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[IDs]=m;let _=new WeakRef(m),v=G7n(_);nor&&z7n(l)===TDs&&SDs(1500,l),got.addAbortListener(l,v),Y7n.register(m,{signal:l,abort:v},v)}if(this.#r=new V7n(yot),W7n(this.#r,o.headersList),ror(this.#r,"request"),h==="no-cors"){if(!pDs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);ror(this.#r,"request-no-cors")}if(f){let _=q7n(this.#r),v=r.headers!==void 0?r.headers:new Aot(_);if(_.clear(),v instanceof Aot){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else lDs(this.#r,v)}let g=Mi.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]=sDs(r.body,o.keepalive);A=_,v&&!q7n(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(Q7n(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 Mi.brandCheck(this,t),this.#n.method}get url(){return Mi.brandCheck(this,t),vDs(this.#n.url)}get headers(){return Mi.brandCheck(this,t),this.#r}get destination(){return Mi.brandCheck(this,t),this.#n.destination}get referrer(){return Mi.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Mi.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Mi.brandCheck(this,t),this.#n.mode}get credentials(){return Mi.brandCheck(this,t),this.#n.credentials}get cache(){return Mi.brandCheck(this,t),this.#n.cache}get redirect(){return Mi.brandCheck(this,t),this.#n.redirect}get integrity(){return Mi.brandCheck(this,t),this.#n.integrity}get keepalive(){return Mi.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Mi.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Mi.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Mi.brandCheck(this,t),this.#e}get body(){return Mi.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Mi.brandCheck(this,t),!!this.#n.body&&got.isDisturbed(this.#n.body.stream)}get duplex(){return Mi.brandCheck(this,t),"half"}clone(){if(Mi.brandCheck(this,t),Q7n(this.#n))throw new TypeError("unusable");let e=J7n(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Eot.get(this.signal);n===void 0&&(n=new Set,Eot.set(this.signal,n));let o=new WeakRef(r);n.add(o),got.addAbortListener(r.signal,G7n(o))}return Z7n(e,this.#t,r.signal,uDs(this.#r))}[j7n.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 ${j7n.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:xDs,getRequestDispatcher:wDs,setRequestDispatcher:RDs,setRequestHeaders:kDs,getRequestState:K7n,setRequestState:PDs}=ib;Reflect.deleteProperty(ib,"setRequestSignal");Reflect.deleteProperty(ib,"getRequestDispatcher");Reflect.deleteProperty(ib,"setRequestDispatcher");Reflect.deleteProperty(ib,"setRequestHeaders");Reflect.deleteProperty(ib,"getRequestState");Reflect.deleteProperty(ib,"setRequestState");aDs(ib,K7n);function _ot(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 Aot(t.headersList):new Aot}}a(_ot,"makeRequest");function J7n(t){let e=_ot({...t,body:null});return t.body!=null&&(e.body=cDs(t.body)),e}a(J7n,"cloneRequest");function Z7n(t,e,r,n){let o=new ib(yot);PDs(o,t),RDs(o,e),xDs(o,r);let s=new V7n(yot);return kDs(o,s),W7n(s,t.headersList),ror(s,n),o}a(Z7n,"fromInnerRequest");Object.defineProperties(ib.prototype,{method:Xh,url:Xh,headers:Xh,redirect:Xh,clone:Xh,signal:Xh,duplex:Xh,destination:Xh,body:Xh,bodyUsed:Xh,isHistoryNavigation:Xh,isReloadNavigation:Xh,keepalive:Xh,integrity:Xh,cache:Xh,credentials:Xh,attribute:Xh,referrerPolicy:Xh,referrer:Xh,mode:Xh,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Mi.is.Request=Mi.util.MakeTypeAssertion(ib);Mi.converters.RequestInfo=function(t){return typeof t=="string"?Mi.converters.USVString(t):Mi.is.Request(t)?t:Mi.converters.USVString(t)};Mi.converters.RequestInit=Mi.dictionaryConverter([{key:"method",converter:Mi.converters.ByteString},{key:"headers",converter:Mi.converters.HeadersInit},{key:"body",converter:Mi.nullableConverter(Mi.converters.BodyInit)},{key:"referrer",converter:Mi.converters.USVString},{key:"referrerPolicy",converter:Mi.converters.DOMString,allowedValues:hDs},{key:"mode",converter:Mi.converters.DOMString,allowedValues:gDs},{key:"credentials",converter:Mi.converters.DOMString,allowedValues:ADs},{key:"cache",converter:Mi.converters.DOMString,allowedValues:yDs},{key:"redirect",converter:Mi.converters.DOMString,allowedValues:mDs},{key:"integrity",converter:Mi.converters.DOMString},{key:"keepalive",converter:Mi.converters.boolean},{key:"signal",converter:Mi.nullableConverter(t=>Mi.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Mi.converters.any},{key:"duplex",converter:Mi.converters.DOMString,allowedValues:EDs},{key:"dispatcher",converter:Mi.converters.any},{key:"priority",converter:Mi.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);X7n.exports={Request:ib,makeRequest:_ot,fromInnerRequest:Z7n,cloneRequest:J7n,getRequestDispatcher:wDs,getRequestState:K7n}});var aQn=I((sif,sQn)=>{"use strict";p();var DDs=require("node:assert"),{runtimeFeatures:tQn}=pF(),cZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),ior;if(tQn.has("crypto")){ior=require("node:crypto");let t=ior.getHashes();t.length===0&&cZ.clear();for(let e of cZ.keys())t.includes(e)===!1&&cZ.delete(e)}else cZ.clear();var eQn=Map.prototype.get.bind(cZ),oor=Map.prototype.has.bind(cZ),NDs=tQn.has("crypto")===!1||cZ.size===0?()=>!0:(t,e)=>{let r=nQn(e);if(r.length===0)return!0;let n=rQn(r);for(let o of n){let s=o.alg,c=o.val,l=iQn(s,t);if(oQn(l,c))return!0}return!1};function rQn(t){let e=[],r=null;for(let n of t){if(DDs(oor(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=eQn(o),c=n.alg,l=eQn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(rQn,"getStrongestMetadata");function nQn(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(!oor(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(nQn,"parseMetadata");var iQn=a((t,e)=>ior.hash(t,e,"base64"),"applyAlgorithmToBytes");function oQn(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:ol,makeAppropriateNetworkError:jke,filterResponse:sor,makeResponse:Cot,fromInnerResponse:MDs,getResponseState:ODs}=qke(),{HeadersList:aor}=sZ(),{Request:BDs,cloneRequest:LDs,getRequestDispatcher:FDs,getRequestState:UDs}=xfe(),t2=require("node:zlib"),{makePolicyContainer:QDs,clonePolicyContainer:qDs,requestBadPort:jDs,TAOCheck:HDs,appendRequestOriginHeader:GDs,responseLocationURL:$Ds,requestCurrentURL:pT,setRequestReferrerPolicyOnRedirect:VDs,tryUpgradeRequestToAPotentiallyTrustworthyURL:WDs,createOpaqueTimingInfo:hor,appendFetchMetadata:zDs,corsCheck:YDs,crossOriginResourcePolicyCheck:KDs,determineRequestsReferrer:JDs,coarsenedSharedCurrentTime:Hke,sameOrigin:dor,isCancelled:wj,isAborted:cQn,isErrorLike:ZDs,fullyReadBody:XDs,readableStreamClose:eNs,urlIsLocal:tNs,urlIsHttpHttpsScheme:Tot,urlHasHttpsScheme:rNs,clampAndCoarsenConnectionTimingInfo:nNs,simpleRangeHeaderValue:iNs,buildContentRange:oNs,createInflate:sNs,extractMimeType:aNs,hasAuthenticationEntry:cNs,includesCredentials:lQn,isTraversableNavigable:lNs}=iT(),lZ=require("node:assert"),{safelyExtractBody:Iot,extractBody:uQn}=ife(),{redirectStatusSet:hQn,nullBodyStatus:mQn,safeMethodsSet:uNs,requestBodyHeader:dNs,subresourceSet:fNs}=ZRe(),pNs=require("node:events"),{Readable:hNs,pipeline:mNs,finished:gNs,isErrored:ANs,isReadable:vot}=require("node:stream"),{addAbortListener:yNs,bufferToLowerCasedHeaderName:dQn}=Do(),{dataURLProcessor:ENs,serializeAMimeType:_Ns,minimizeSupportedMimeType:CNs}=pw(),{getGlobalDispatcher:vNs}=sot(),{webidl:mor}=xA(),{STATUS_CODES:fQn}=require("node:http"),{bytesMatch:bNs}=aQn(),{createDeferredPromise:SNs}=nke(),{isomorphicEncode:bot}=fF(),{runtimeFeatures:TNs}=pF(),INs=TNs.has("zstd"),xNs=["GET","HEAD"],wNs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",cor,Sot=class extends pNs{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 RNs(t){gQn(t,"fetch")}a(RNs,"handleFetchDone");function kNs(t,e=void 0){mor.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=SNs(),n;try{n=new BDs(t,e)}catch(f){return r.reject(f),r.promise}let o=UDs(n);if(n.signal.aborted)return lor(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 yNs(n.signal,()=>{l=!0,lZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();lor(r,o,f,n.signal.reason,u.controller)}),u=yQn({request:o,processResponseEndOfBody:RNs,processResponse:a(f=>{if(!l){if(f.aborted){lor(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(MDs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:FDs(n),requestObject:n}),r.promise}a(kNs,"fetch");function gQn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Tot(r)&&n!==null&&(t.timingAllowPassed||(n=hor({startTime:n.startTime}),o=""),n.endTime=Hke(),t.timingInfo=n,AQn(n,r.href,e,globalThis,o,"",t.status))}a(gQn,"finalizeAndReportTiming");var AQn=performance.markResourceTiming;function lor(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&vot(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=ODs(r);s.body?.stream!=null&&vot(s.body.stream)&&o.error(n)}a(lor,"abortFetch");function yQn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=vNs(),requestObject:u=null}){lZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=Hke(f),m=hor({startTime:h}),g={controller:new Sot(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return lZ(!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=qDs(t.client.policyContainer):t.policyContainer=QDs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,fNs.has(t.destination),EQn(g,!1),g.controller}a(yQn,"fetching");async function EQn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!tNs(pT(r))&&(n=ol("local URLs only")),WDs(r),jDs(r)==="blocked"&&(n=ol("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=JDs(r)),n===null){let s=pT(r);dor(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await pQn(t)):r.mode==="same-origin"?n=ol('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ol('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await pQn(t)):Tot(pT(r))?(r.responseTainting="cors",n=await _Qn(t)):n=ol("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=sor(n,"basic"):r.responseTainting==="cors"?n=sor(n,"cors"):r.responseTainting==="opaque"?n=sor(n,"opaque"):lZ(!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=ol()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||mQn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>uor(t,ol(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!bNs(l,r.integrity)){s("integrity mismatch");return}n.body=Iot(l)[0],uor(t,n)},"processBody");XDs(n.body,c,s)}else uor(t,n)}catch(r){t.controller.terminate(r)}}a(EQn,"mainFetch");function pQn(t){if(wj(t)&&t.request.redirectCount===0)return Promise.resolve(jke(t));let{request:e}=t,{protocol:r}=pT(e);switch(r){case"about:":return Promise.resolve(ol("about scheme is not supported"));case"blob:":{cor||(cor=require("node:buffer").resolveObjectURL);let n=pT(e);if(n.search.length!==0)return Promise.resolve(ol("NetworkError when attempting to fetch resource."));let o=cor(n.toString());if(e.method!=="GET"||!mor.is.Blob(o))return Promise.resolve(ol("invalid method"));let s=Cot(),c=o.size,l=bot(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=iNs(d,!0);if(f==="failure")return Promise.resolve(ol("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(ol("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=uQn(g);s.body=A[0];let y=bot(`${g.size}`),E=oNs(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=uQn(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=pT(e),o=ENs(n);if(o==="failure")return Promise.resolve(ol("failed to fetch the data URL"));let s=_Ns(o.mimeType);return Promise.resolve(Cot({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Iot(o.body)[0]}))}case"file:":return Promise.resolve(ol("not implemented... yet..."));case"http:":case"https:":return _Qn(t).catch(n=>ol(n));default:return Promise.resolve(ol("unknown scheme"))}}a(pQn,"schemeFetch");function PNs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(PNs,"finalizeResponse");function uor(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Tot(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=hor(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=aNs(e.headersList);f!=="failure"&&(u.contentType=CNs(f))}t.request.initiatorType!=null&&AQn(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():gNs(o.body.stream,()=>{n()})}a(uor,"fetchFinale");async function _Qn(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 por(t),e.responseTainting==="cors"&&YDs(e,r)==="failure")return ol("cors failure");HDs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&KDs(e.origin,e.client,e.destination,n)==="blocked"?ol("blocked"):(hQn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ol("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await DNs(t,r):lZ(!1)),r.timingInfo=o,r)}a(_Qn,"httpFetch");function DNs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=$Ds(n,pT(r).hash),o==null)return e}catch(c){return Promise.resolve(ol(c))}if(!Tot(o))return Promise.resolve(ol("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ol("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!dor(r,o))return Promise.resolve(ol('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ol('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ol());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!xNs.includes(r.method)){r.method="GET",r.body=null;for(let c of dNs)r.headersList.delete(c)}dor(pT(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&&(lZ(r.body.source!=null),r.body=Iot(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Hke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),VDs(r,n),EQn(t,!0)}a(DNs,"httpRedirectFetch");async function por(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=LDs(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=bot(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,mor.is.URL(s.referrer)&&s.headersList.append("referer",bot(s.referrer.href),!0),GDs(s),zDs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",wNs,!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)||(rNs(pT(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(!(cNs(s)&&(s.useURLCredentials===void 0||!lQn(pT(s))))){if(lQn(pT(s))&&e){let{username:g,password:A}=pT(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 ol("only if cached");let m=await NNs(o,d,r);!uNs.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||lNs(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Iot(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return wj(t)?jke(t):c;t.controller.connection.destroy(),c=await por(t,!0)}if(c.status===407)return n.window==="no-window"?ol():wj(t)?jke(t):ol("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(wj(t))return jke(t);t.controller.connection.destroy(),c=await por(t,e,!0)}return c}a(por,"httpNetworkOrCacheFetch");async function NNs(t,e=!1,r=!1){lZ(!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*(_){wj(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{wj(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{wj(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=Cot({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Cot({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),jke(t,A)):ol(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{wj(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(cQn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){eNs(t.controller.controller),PNs(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),ANs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){cQn(t)?(o.aborted=!0,vot(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):vot(h)&&t.controller.controller.error(new TypeError("terminated",{cause:ZDs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=pT(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=nNs(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=Hke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Hke(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,k){if(w<200)return!1;let D=new aor;for(let M=0;Mq)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${q}`)),!0;for(let F=O.length-1;F>=0;--F){let U=O[F].trim();if(U==="x-gzip"||U==="gzip")B.push(t2.createGunzip({flush:t2.constants.Z_SYNC_FLUSH,finishFlush:t2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(sNs({flush:t2.constants.Z_SYNC_FLUSH,finishFlush:t2.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(t2.createBrotliDecompress({flush:t2.constants.BROTLI_OPERATION_FLUSH,finishFlush:t2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&INs)B.push(t2.createZstdDecompress({flush:t2.constants.ZSTD_e_continue,finishFlush:t2.constants.ZSTD_e_end}));else{B.length=0;break}}}let Q=this.onError.bind(this);return b({status:w,statusText:k,headersList:D,body:B.length?mNs(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,k){if(k.session!=null&&R!==200||k.session==null&&R!==101)return!1;let D=new aor;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:fQn[R],headersList:D,socket:k}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let k=new aor;for(let D=0;D{"use strict";p();var MNs=require("node:assert"),{URLSerializer:vQn}=pw(),{isValidHeaderName:ONs}=iT();function BNs(t,e,r=!1){let n=vQn(t,r),o=vQn(e,r);return n===o}a(BNs,"urlEquals");function LNs(t){MNs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),ONs(r)&&e.push(r);return e}a(LNs,"getFieldValues");bQn.exports={urlEquals:BNs,getFieldValues:LNs}});var wQn=I((mif,xQn)=>{"use strict";p();var gor=require("node:assert"),{kConstruct:FNs}=nl(),{urlEquals:UNs,getFieldValues:Aor}=SQn(),{kEnumerableProperty:uZ,isDisturbed:QNs}=Do(),{webidl:Zn}=xA(),{cloneResponse:TQn,fromInnerResponse:qNs,getResponseState:jNs}=qke(),{Request:$ke,fromInnerRequest:HNs,getRequestState:d5}=xfe(),{fetching:GNs}=Gke(),{urlIsHttpHttpsScheme:xot,readAllBytes:$Ns}=iT(),{createDeferredPromise:wfe}=nke(),wot=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==FNs&&Zn.illegalConstructor(),Zn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Zn.brandCheck(this,t);let n="Cache.match";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.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={}){Zn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Zn.brandCheck(this,t),Zn.argumentLengthCheck(arguments,1,"Cache.add"),e=Zn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Zn.brandCheck(this,t);let r="Cache.addAll";Zn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Zn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Zn.converters.RequestInfo(m),typeof m=="string")continue;let g=d5(m);if(!xot(g.url)||g.method!=="GET")throw Zn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=d5(new $ke(m));if(!xot(g.url))throw Zn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=wfe();s.push(GNs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Zn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Aor(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Zn.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=wfe(),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){Zn.brandCheck(this,t);let n="Cache.put";Zn.argumentLengthCheck(arguments,2,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.Response(r,n,"response");let o=null;if(Zn.is.Request(e)?o=d5(e):o=d5(new $ke(e)),!xot(o.url)||o.method!=="GET")throw Zn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=jNs(r);if(s.status===206)throw Zn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Aor(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Zn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(QNs(s.body.stream)||s.body.stream.locked))throw Zn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=TQn(s),l=wfe();if(s.body!=null){let A=s.body.stream.getReader();$Ns(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=wfe(),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={}){Zn.brandCheck(this,t);let n="Cache.delete";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Zn.is.Request(e)){if(o=d5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else gor(typeof e=="string"),o=d5(new $ke(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=wfe(),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={}){Zn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Zn.is.Request(e)){if(o=d5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=d5(new $ke(e)));let s=wfe(),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=HNs(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 Zn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Zn.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);gor(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!xot(u.url))throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Zn.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);gor(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=""),!UNs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Aor(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(Zn.is.Request(e)){if(o=d5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=d5(new $ke(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=qNs(TQn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(wot.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:uZ,matchAll:uZ,add:uZ,addAll:uZ,put:uZ,delete:uZ,keys:uZ});var IQn=[{key:"ignoreSearch",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Zn.converters.CacheQueryOptions=Zn.dictionaryConverter(IQn);Zn.converters.MultiCacheQueryOptions=Zn.dictionaryConverter([...IQn,{key:"cacheName",converter:Zn.converters.DOMString}]);Zn.converters.Response=Zn.interfaceConverter(Zn.is.Response,"Response");Zn.converters["sequence"]=Zn.sequenceConverter(Zn.converters.RequestInfo);xQn.exports={Cache:wot}});var kQn=I((yif,RQn)=>{"use strict";p();var{Cache:Rot}=wQn(),{webidl:sE}=xA(),{kEnumerableProperty:Vke}=Do(),{kConstruct:Wke}=nl(),kot=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Wke&&sE.illegalConstructor(),sE.util.markAsUncloneable(this)}async match(e,r={}){if(sE.brandCheck(this,t),sE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=sE.converters.RequestInfo(e),r=sE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Rot(Wke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Rot(Wke,n).match(e,r);if(s!==void 0)return s}}async has(e){sE.brandCheck(this,t);let r="CacheStorage.has";return sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){sE.brandCheck(this,t);let r="CacheStorage.open";if(sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Rot(Wke,o)}let n=[];return this.#e.set(e,n),new Rot(Wke,n)}async delete(e){sE.brandCheck(this,t);let r="CacheStorage.delete";return sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return sE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(kot.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Vke,has:Vke,open:Vke,delete:Vke,keys:Vke});RQn.exports={CacheStorage:kot}});var DQn=I((Cif,PQn)=>{"use strict";p();PQn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var yor=I((bif,LQn)=>{"use strict";p();function VNs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(VNs,"isCTLExcludingHtab");function NQn(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(NQn,"validateCookieName");function MQn(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(MQn,"validateCookieValue");function OQn(t){for(let e=0;ee.toString().padStart(2,"0"));function BQn(t){return typeof t=="number"&&(t=new Date(t)),`${zNs[t.getUTCDay()]}, ${Pot[t.getUTCDate()]} ${YNs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Pot[t.getUTCHours()]}:${Pot[t.getUTCMinutes()]}:${Pot[t.getUTCSeconds()]} GMT`}a(BQn,"toIMFDate");function KNs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(KNs,"validateCookieMaxAge");function JNs(t){if(t.name.length===0)return null;NQn(t.name),MQn(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"&&(KNs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(WNs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(OQn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${BQn(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(JNs,"stringify");LQn.exports={isCTLExcludingHtab:VNs,validateCookieName:NQn,validateCookiePath:OQn,validateCookieValue:MQn,toIMFDate:BQn,stringify:JNs}});var UQn=I((Iif,FQn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Dot}=fF(),{maxNameValuePairSize:ZNs,maxAttributeValueSize:XNs}=DQn(),{isCTLExcludingHtab:eMs}=yor(),tMs=require("node:assert"),{unescape:rMs}=require("node:querystring");function nMs(t){if(eMs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Dot(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Dot("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>ZNs?null:{name:n,value:rMs(o),...Rfe(r)}}a(nMs,"parseSetCookie");function Rfe(t,e={}){if(t.length===0)return e;tMs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Dot(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Dot("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>XNs)return Rfe(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 Rfe(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 Rfe(t,e)}a(Rfe,"parseUnparsedAttributes");FQn.exports={parseSetCookie:nMs,parseUnparsedAttributes:Rfe}});var HQn=I((Rif,jQn)=>{"use strict";p();var{parseSetCookie:QQn}=UQn(),{stringify:iMs}=yor(),{webidl:Wa}=xA(),{Headers:oMs}=sZ(),Not=Wa.brandCheckMultiple([oMs,globalThis.Headers].filter(Boolean));function sMs(t){Wa.argumentLengthCheck(arguments,1,"getCookies"),Not(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(sMs,"getCookies");function aMs(t,e,r){Not(t);let n="deleteCookie";Wa.argumentLengthCheck(arguments,2,n),e=Wa.converters.DOMString(e,n,"name"),r=Wa.converters.DeleteCookieAttributes(r),qQn(t,{name:e,value:"",expires:new Date(0),...r})}a(aMs,"deleteCookie");function cMs(t){Wa.argumentLengthCheck(arguments,1,"getSetCookies"),Not(t);let e=t.getSetCookie();return e?e.map(r=>QQn(r)):[]}a(cMs,"getSetCookies");function lMs(t){return t=Wa.converters.DOMString(t),QQn(t)}a(lMs,"parseCookie");function qQn(t,e){Wa.argumentLengthCheck(arguments,2,"setCookie"),Not(t),e=Wa.converters.Cookie(e);let r=iMs(e);r&&t.append("set-cookie",r,!0)}a(qQn,"setCookie");Wa.converters.DeleteCookieAttributes=Wa.dictionaryConverter([{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Wa.converters.Cookie=Wa.dictionaryConverter([{converter:Wa.converters.DOMString,key:"name"},{converter:Wa.converters.DOMString,key:"value"},{converter:Wa.nullableConverter(t=>typeof t=="number"?Wa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Wa.sequenceConverter(Wa.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);jQn.exports={getCookies:sMs,deleteCookie:aMs,getSetCookies:cMs,setCookie:qQn,parseCookie:lMs}});var Bot=I((Dif,$Qn)=>{"use strict";p();var{webidl:ai}=xA(),{kEnumerableProperty:ob}=Do(),{kConstruct:GQn}=nl(),kfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===GQn){super(arguments[1],arguments[2]),ai.util.markAsUncloneable(this);return}let n="MessageEvent constructor";ai.argumentLengthCheck(arguments,1,n),e=ai.converters.DOMString(e,n,"type"),r=ai.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,ai.util.markAsUncloneable(this)}get data(){return ai.brandCheck(this,t),this.#e.data}get origin(){return ai.brandCheck(this,t),this.#e.origin}get lastEventId(){return ai.brandCheck(this,t),this.#e.lastEventId}get source(){return ai.brandCheck(this,t),this.#e.source}get ports(){return ai.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 ai.brandCheck(this,t),ai.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(GQn,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:uMs}=kfe;delete kfe.createFastMessageEvent;var Mot=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";ai.argumentLengthCheck(arguments,1,n),e=ai.converters.DOMString(e,n,"type"),r=ai.converters.CloseEventInit(r),super(e,r),this.#e=r,ai.util.markAsUncloneable(this)}get wasClean(){return ai.brandCheck(this,t),this.#e.wasClean}get code(){return ai.brandCheck(this,t),this.#e.code}get reason(){return ai.brandCheck(this,t),this.#e.reason}},Oot=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";ai.argumentLengthCheck(arguments,1,n),super(e,r),ai.util.markAsUncloneable(this),e=ai.converters.DOMString(e,n,"type"),r=ai.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return ai.brandCheck(this,t),this.#e.message}get filename(){return ai.brandCheck(this,t),this.#e.filename}get lineno(){return ai.brandCheck(this,t),this.#e.lineno}get colno(){return ai.brandCheck(this,t),this.#e.colno}get error(){return ai.brandCheck(this,t),this.#e.error}};Object.defineProperties(kfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ob,origin:ob,lastEventId:ob,source:ob,ports:ob,initMessageEvent:ob});Object.defineProperties(Mot.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ob,code:ob,wasClean:ob});Object.defineProperties(Oot.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ob,filename:ob,lineno:ob,colno:ob,error:ob});ai.converters.MessagePort=ai.interfaceConverter(ai.is.MessagePort,"MessagePort");ai.converters["sequence"]=ai.sequenceConverter(ai.converters.MessagePort);var Eor=[{key:"bubbles",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];ai.converters.MessageEventInit=ai.dictionaryConverter([...Eor,{key:"data",converter:ai.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:ai.nullableConverter(ai.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:ai.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);ai.converters.CloseEventInit=ai.dictionaryConverter([...Eor,{key:"wasClean",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:ai.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:ai.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);ai.converters.ErrorEventInit=ai.dictionaryConverter([...Eor,{key:"message",converter:ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:ai.converters.any}]);$Qn.exports={MessageEvent:kfe,CloseEvent:Mot,ErrorEvent:Oot,createFastMessageEvent:uMs}});var Rj=I((Oif,VQn)=>{"use strict";p();var dMs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",fMs={enumerable:!0,writable:!1,configurable:!1},pMs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},hMs={SENT:1,RECEIVED:2},mMs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},gMs=65535,AMs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},yMs=Buffer.allocUnsafe(0),EMs={text:1,typedArray:2,arrayBuffer:3,blob:4};VQn.exports={uid:dMs,sentCloseFrameState:hMs,staticPropertyDescriptors:fMs,states:pMs,opcodes:mMs,maxUnsigned16Bit:gMs,parserStates:AMs,emptyBuffer:yMs,sendHints:EMs}});var dZ=I((Lif,JQn)=>{"use strict";p();var{states:Lot,opcodes:Pfe}=Rj(),{isUtf8:_Ms}=require("node:buffer"),{removeHTTPWhitespace:WQn}=pw(),{collectASequenceOfCodePointsFast:CMs}=fF();function vMs(t){return t===Lot.CONNECTING}a(vMs,"isConnecting");function bMs(t){return t===Lot.OPEN}a(bMs,"isEstablished");function SMs(t){return t===Lot.CLOSING}a(SMs,"isClosing");function TMs(t){return t===Lot.CLOSED}a(TMs,"isClosed");function IMs(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(IMs,"fireEvent");function xMs(t,e,r){t.onMessage(e,r)}a(xMs,"websocketMessageReceived");function wMs(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(wMs,"toArrayBuffer");function RMs(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(RMs,"isValidSubprotocol");function kMs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(kMs,"isValidStatusCode");function zQn(t){return t===Pfe.CLOSE||t===Pfe.PING||t===Pfe.PONG}a(zQn,"isControlFrame");function YQn(t){return t===Pfe.CONTINUATION}a(YQn,"isContinuationFrame");function KQn(t){return t===Pfe.TEXT||t===Pfe.BINARY}a(KQn,"isTextBinaryFrame");function PMs(t){return KQn(t)||YQn(t)||zQn(t)}a(PMs,"isValidOpcode");function DMs(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(NMs,"isValidClientWindowBits");function MMs(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(MMs,"getURLRecord");function OMs(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(OMs,"validateCloseCodeAndReason");var BMs=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(_Ms(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();JQn.exports={isConnecting:vMs,isEstablished:bMs,isClosing:SMs,isClosed:TMs,fireEvent:IMs,isValidSubprotocol:RMs,isValidStatusCode:kMs,websocketMessageReceived:xMs,utf8Decode:BMs,isControlFrame:zQn,isContinuationFrame:YQn,isTextBinaryFrame:KQn,isValidOpcode:PMs,parseExtensions:DMs,isValidClientWindowBits:NMs,toArrayBuffer:wMs,getURLRecord:MMs,validateCloseCodeAndReason:OMs}});var Nfe=I((Qif,XQn)=>{"use strict";p();var{runtimeFeatures:LMs}=pF(),{maxUnsigned16Bit:ZQn,opcodes:FMs}=Rj(),Fot=8*1024,zke=null,Dfe=Fot,UMs=LMs.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oZQn?(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;uZQn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|FMs.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]}};XQn.exports={WebsocketFrameSend:Cor,generateMask:_or}});var Uot=I((Hif,oqn)=>{"use strict";p();var{uid:QMs,states:vor,sentCloseFrameState:bor,emptyBuffer:eqn,opcodes:qMs}=Rj(),{parseExtensions:jMs,isClosed:HMs,isClosing:GMs,isEstablished:nqn,isConnecting:$Ms,validateCloseCodeAndReason:VMs}=dZ(),{makeRequest:WMs}=xfe(),{fetching:zMs}=Gke(),{Headers:YMs,getHeadersList:KMs}=sZ(),{getDecodeSplit:JMs}=iT(),{WebsocketFrameSend:ZMs}=Nfe(),XMs=require("node:assert"),{runtimeFeatures:eOs}=pF(),tqn=eOs.has("crypto")?require("node:crypto"):null,rqn=!1;function tOs(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=WMs({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=KMs(new YMs(o.headers));c.headersList=f}let l=tqn.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),zMs({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){f5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){f5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(rqn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),rqn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){f5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){f5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){f5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=tqn.hash("sha1",l+QMs,"base64");if(h!==m){f5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=jMs(g),!A.has("permessage-deflate"))){f5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!JMs("sec-websocket-protocol",c.headersList).includes(y)){f5(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(tOs,"establishWebSocketConnection");function iqn(t,e,r,n=!1){if(e??=null,r??="",n&&VMs(e,r),!(HMs(t.readyState)||GMs(t.readyState)))if(!nqn(t.readyState))f5(t),t.readyState=vor.CLOSING;else if(!t.closeState.has(bor.SENT)&&!t.closeState.has(bor.RECEIVED)){let o=new ZMs;r.length!==0&&e===null&&(e=1e3),XMs(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=eqn: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=eqn,t.socket.write(o.createFrame(qMs.CLOSE)),t.closeState.add(bor.SENT),t.readyState=vor.CLOSING}else t.readyState=vor.CLOSING}a(iqn,"closeWebSocketConnection");function f5(t,e,r,n){nqn(t.readyState)&&iqn(t,e,r,!1),t.controller.abort(),$Ms(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(f5,"failWebsocketConnection");oqn.exports={establishWebSocketConnection:tOs,failWebsocketConnection:f5,closeWebSocketConnection:iqn}});var cqn=I((Vif,aqn)=>{"use strict";p();var{createInflateRaw:rOs,Z_DEFAULT_WINDOWBITS:nOs}=require("node:zlib"),{isValidClientWindowBits:iOs}=dZ(),{MessageSizeExceededError:sqn}=ao(),oOs=Buffer.from([0,0,255,255]),Qot=Symbol("kBuffer"),Yke=Symbol("kLength"),sOs=4*1024*1024,Sor=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 sqn);return}if(!this.#e){let o=nOs;if(this.#t.serverMaxWindowBits){if(!iOs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=rOs({windowBits:o})}catch(s){n(s);return}this.#e[Qot]=[],this.#e[Yke]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Yke]+=s.length,this.#e[Yke]>sOs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new sqn)}return}this.#e[Qot].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(oOs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Qot],this.#e[Yke]);this.#e[Qot].length=0,this.#e[Yke]=0,this.#n=null,n(null,o)})}};aqn.exports={PerMessageDeflate:Sor}});var xor=I((Yif,pqn)=>{"use strict";p();var{Writable:aOs}=require("node:stream"),cOs=require("node:assert"),{parserStates:sb,opcodes:Mfe,states:lOs,emptyBuffer:lqn,sentCloseFrameState:Kke}=Rj(),{isValidStatusCode:uOs,isValidOpcode:dOs,websocketMessageReceived:uqn,utf8Decode:fOs,isControlFrame:dqn,isTextBinaryFrame:Tor,isContinuationFrame:pOs}=dZ(),{failWebsocketConnection:hT}=Uot(),{WebsocketFrameSend:fqn}=Nfe(),{PerMessageDeflate:hOs}=cqn(),{MessageSizeExceededError:mOs}=ao(),Ior=class extends aOs{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=sb.INFO;#o={};#s=[];#a;#c;constructor(e,r){super(),this.#c=e,this.#a=r??new Map,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new hOs(r))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}run(e){for(;this.#n;)if(this.#i===sb.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!==Mfe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!dOs(o))return hT(this.#c,1002,"Invalid opcode received"),e();if(s)return hT(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){hT(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){hT(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Tor(o)){hT(this.#c,1002,"Invalid frame type was fragmented.");return}if(Tor(o)&&this.#s.length>0){hT(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){hT(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&dqn(o)){hT(this.#c,1002,"Control frame either too large or fragmented");return}if(pOs(o)&&this.#s.length===0&&!this.#o.compressed){hT(this.#c,1002,"Unexpected continuation frame");return}l<=125?(this.#o.payloadLength=l,this.#i=sb.READ_DATA):l===126?this.#i=sb.PAYLOADLENGTH_16:l===127&&(this.#i=sb.PAYLOADLENGTH_64),Tor(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===sb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);this.#o.payloadLength=r.readUInt16BE(0),this.#i=sb.READ_DATA}else if(this.#i===sb.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){hT(this.#c,1009,"Received payload length > 2^31 bytes.");return}this.#o.payloadLength=o,this.#i=sb.READ_DATA}else if(this.#i===sb.READ_DATA){if(this.#r{if(n){let s=n instanceof mOs?1009:1007;hT(this.#c,s,n.message);return}if(this.writeFragments(o),!this.#o.fin){this.#i=sb.INFO,this.#n=!0,this.run(e);return}uqn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=sb.INFO,this.run(e)}),this.#n=!1;break}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return lqn;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){this.#t+=e.length,this.#s.push(e)}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&&!uOs(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=fOs(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===Mfe.CLOSE){if(n===1)return hT(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 hT(this.#c,o,s),!1}if(!this.#c.closeState.has(Kke.SENT)&&!this.#c.closeState.has(Kke.RECEIVED)){let o=lqn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new fqn(o);this.#c.socket.write(s.createFrame(Mfe.CLOSE)),this.#c.closeState.add(Kke.SENT)}return this.#c.readyState=lOs.CLOSING,this.#c.closeState.add(Kke.RECEIVED),!1}else if(r===Mfe.PING){if(!this.#c.closeState.has(Kke.RECEIVED)){let o=new fqn(e);this.#c.socket.write(o.createFrame(Mfe.PONG)),this.#c.onPing(e)}}else r===Mfe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};pqn.exports={ByteParser:Ior}});var Aqn=I((Zif,gqn)=>{"use strict";p();var{WebsocketFrameSend:mqn}=Nfe(),{opcodes:hqn,sendHints:fZ}=Rj(),gOs=inr(),Ror=class{static{a(this,"SendQueue")}#e=new gOs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==fZ.blob){if(this.#t){let s={promise:null,callback:r,frame:wor(e,n)};this.#e.push(s)}else if(n===fZ.text){let{0:s,1:c}=mqn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(wor(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=wor(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 wor(t,e){return new mqn(AOs(t,e)).createFrame(e===fZ.text?hqn.TEXT:hqn.BINARY)}a(wor,"createFrame");function AOs(t,e){switch(e){case fZ.text:case fZ.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case fZ.arrayBuffer:case fZ.blob:return new Uint8Array(t)}}a(AOs,"toBuffer");gqn.exports={SendQueue:Ror}});var bqn=I((tof,vqn)=>{"use strict";p();var{isArrayBuffer:yOs}=require("node:util/types"),{webidl:pi}=xA(),{URLSerializer:EOs}=pw(),{environmentSettingsObject:yqn}=iT(),{staticPropertyDescriptors:kj,states:bF,sentCloseFrameState:kor,sendHints:qot,opcodes:Por}=Rj(),{isConnecting:_Os,isEstablished:Eqn,isClosing:_qn,isClosed:COs,isValidSubprotocol:vOs,fireEvent:jot,utf8Decode:bOs,toArrayBuffer:SOs,getURLRecord:TOs}=dZ(),{establishWebSocketConnection:IOs,closeWebSocketConnection:xOs,failWebsocketConnection:Cqn}=Uot(),{ByteParser:wOs}=xor(),{kEnumerableProperty:Cw}=Do(),{getGlobalDispatcher:ROs}=sot(),{ErrorEvent:kOs,CloseEvent:POs,createFastMessageEvent:DOs}=Bot(),{SendQueue:NOs}=Aqn(),{WebsocketFrameSend:MOs}=Nfe(),{channels:p5}=cj();function OOs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(OOs,"getSocketAddress");var Y_=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=>Cqn(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=bF.CLOSING,p5.socketError.hasSubscribers&&p5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{p5.ping.hasSubscribers&&p5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{p5.pong.hasSubscribers&&p5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:bF.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),pi.util.markAsUncloneable(this);let n="WebSocket constructor";pi.argumentLengthCheck(arguments,1,n);let o=pi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=pi.converters.USVString(e),r=o.protocols;let s=yqn.settingsObject.baseUrl,c=TOs(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=>vOs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=yqn.settingsObject;this.#o.controller=IOs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){pi.brandCheck(this,t),e!==void 0&&(e=pi.converters["unsigned short"](e,"WebSocket.close","code",pi.attributes.Clamp)),r!==void 0&&(r=pi.converters.USVString(r)),e??=null,r??="",xOs(this.#o,e,r,!0)}send(e){pi.brandCheck(this,t);let r="WebSocket.send";if(pi.argumentLengthCheck(arguments,1,r),e=pi.converters.WebSocketSendData(e,r,"data"),_Os(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!Eqn(this.#o.readyState)||_qn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},qot.text)}else yOs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},qot.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},qot.typedArray)):pi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},qot.blob))}get readyState(){return pi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return pi.brandCheck(this,t),this.#t}get url(){return pi.brandCheck(this,t),EOs(this.#s)}get extensions(){return pi.brandCheck(this,t),this.#n}get protocol(){return pi.brandCheck(this,t),this.#r}get onopen(){return pi.brandCheck(this,t),this.#e.open}set onopen(e){pi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return pi.brandCheck(this,t),this.#e.error}set onerror(e){pi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return pi.brandCheck(this,t),this.#e.close}set onclose(e){pi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return pi.brandCheck(this,t),this.#e.message}set onmessage(e){pi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return pi.brandCheck(this,t),this.#a}set binaryType(e){pi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=new wOs(this.#o,r);n.on("drain",()=>this.#o.onParserDrain()),n.on("error",c=>this.#o.onParserError(c)),this.#c=n,this.#i=new NOs(e.socket),this.#o.readyState=bF.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");if(s!==null&&(this.#r=s),jot("open",this),p5.open.hasSubscribers){let c=e.headersList.entries;p5.open.publish({address:OOs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:c}})}}#l(e,r){if(this.#o.readyState!==bF.OPEN)return;let n;if(e===Por.TEXT)try{n=bOs(r)}catch{Cqn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Por.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=SOs(r));jot("message",this,DOs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(kor.SENT)&&this.#o.closeState.has(kor.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=bF.CLOSED,this.#o.closeState.has(kor.RECEIVED)||(r=1006,jot("error",this,(s,c)=>new kOs(s,c),{error:new TypeError(n)})),jot("close",this,(s,c)=>new POs(s,c),{wasClean:e,code:r,reason:n}),p5.close.hasSubscribers&&p5.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(Eqn(n)&&!_qn(n)&&!COs(n)){let o=new MOs(r);e.#o.socket.write(o.createFrame(Por.PING))}}},{ping:BOs}=Y_;Reflect.deleteProperty(Y_,"ping");Y_.CONNECTING=Y_.prototype.CONNECTING=bF.CONNECTING;Y_.OPEN=Y_.prototype.OPEN=bF.OPEN;Y_.CLOSING=Y_.prototype.CLOSING=bF.CLOSING;Y_.CLOSED=Y_.prototype.CLOSED=bF.CLOSED;Object.defineProperties(Y_.prototype,{CONNECTING:kj,OPEN:kj,CLOSING:kj,CLOSED:kj,url:Cw,readyState:Cw,bufferedAmount:Cw,onopen:Cw,onerror:Cw,onclose:Cw,close:Cw,onmessage:Cw,binaryType:Cw,send:Cw,extensions:Cw,protocol:Cw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Y_,{CONNECTING:kj,OPEN:kj,CLOSING:kj,CLOSED:kj});pi.converters["sequence"]=pi.sequenceConverter(pi.converters.DOMString);pi.converters["DOMString or sequence"]=function(t,e,r){return pi.util.Type(t)===pi.util.Types.OBJECT&&Symbol.iterator in t?pi.converters["sequence"](t):pi.converters.DOMString(t,e,r)};pi.converters.WebSocketInit=pi.dictionaryConverter([{key:"protocols",converter:pi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:pi.converters.any,defaultValue:a(()=>ROs(),"defaultValue")},{key:"headers",converter:pi.nullableConverter(pi.converters.HeadersInit)}]);pi.converters["DOMString or sequence or WebSocketInit"]=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&!(Symbol.iterator in t)?pi.converters.WebSocketInit(t):{protocols:pi.converters["DOMString or sequence"](t)}};pi.converters.WebSocketSendData=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&(pi.is.Blob(t)||pi.is.BufferSource(t))?t:pi.converters.USVString(t)};vqn.exports={WebSocket:Y_,ping:BOs}});var Dor=I((iof,Iqn)=>{"use strict";p();var{webidl:Hot}=xA(),{validateCloseCodeAndReason:LOs}=dZ(),{kConstruct:Sqn}=nl(),{kEnumerableProperty:Tqn}=Do();function FOs(){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(FOs,"createInheritableDOMException");var pZ=class t extends FOs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=Hot.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===Sqn)return;r!==null&&(r=Hot.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";LOs(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,Sqn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:UOs}=pZ;delete pZ.createUnvalidatedWebSocketError;Object.defineProperties(pZ.prototype,{closeCode:Tqn,reason:Tqn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Hot.is.WebSocketError=Hot.util.MakeTypeAssertion(pZ);Iqn.exports={WebSocketError:pZ,createUnvalidatedWebSocketError:UOs}});var Pqn=I((aof,kqn)=>{"use strict";p();var{createDeferredPromise:Nor}=nke(),{environmentSettingsObject:xqn}=iT(),{states:Ofe,opcodes:Got,sentCloseFrameState:Bfe}=Rj(),{webidl:sp}=xA(),{getURLRecord:QOs,isValidSubprotocol:qOs,isEstablished:jOs,utf8Decode:HOs}=dZ(),{establishWebSocketConnection:GOs,failWebsocketConnection:Mor,closeWebSocketConnection:Oor}=Uot(),{channels:wqn}=cj(),{WebsocketFrameSend:$Os}=Nfe(),{ByteParser:VOs}=xor(),{WebSocketError:WOs,createUnvalidatedWebSocketError:zOs}=Dor(),{kEnumerableProperty:$ot}=Do(),{utf8DecodeBytes:YOs}=fit(),Rqn=!1,Vot=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=>Mor(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=Ofe.CLOSING,wqn.socketError.hasSubscribers&&wqn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Ofe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){Rqn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),Rqn=!0),sp.argumentLengthCheck(arguments,1,"WebSocket"),e=sp.converters.USVString(e),r!==null&&(r=sp.converters.WebSocketStreamOptions(r));let n=xqn.settingsObject.baseUrl,o=QOs(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=>qOs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Nor(),this.#r=Nor(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{jOs(this.#a.readyState)||(Mor(this.#a),this.#a.readyState=Ofe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=xqn.settingsObject;this.#a.controller=GOs(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=sp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;Oor(this.#a,r,n,!0)}#u(e){e=sp.converters.WebSocketStreamWrite(e);let r=Nor(),n=null,o=null;if(sp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=Got.BINARY;else{let s;try{s=sp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=Got.TEXT}if(!this.#a.closeState.has(Bfe.SENT)&&!this.#a.closeState.has(Bfe.RECEIVED)){let s=new $Os(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=new VOs(this.#a,r);n.on("drain",()=>this.#a.onParserDrain()),n.on("error",u=>this.#a.onParserError(u)),this.#c=n,this.#a.readyState=Ofe.OPEN;let o=r??"",s=e.headersList.get("sec-websocket-protocol")??"",c=new ReadableStream({start:a(u=>{this.#i=u},"start"),cancel:a(u=>this.#h(u),"cancel")}),l=new WritableStream({write:a(u=>this.#u(u),"write"),close:a(()=>Oor(this.#a,null,null),"close"),abort:a(u=>this.#A(u),"abort")});this.#n=c,this.#o=l,this.#t.resolve({extensions:o,protocol:s,readable:c,writable:l})}#p(e,r){if(this.#a.readyState!==Ofe.OPEN)return;let n;if(e===Got.TEXT)try{n=HOs(r)}catch{Mor(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===Got.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Bfe.SENT)&&this.#a.closeState.has(Bfe.RECEIVED);if(this.#a.readyState=Ofe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new WOs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Bfe.SENT)&&!this.#a.closeState.has(Bfe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":YOs(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=zOs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";sp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),Oor(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(Vot.prototype,{url:$ot,opened:$ot,closed:$ot,close:$ot,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});sp.converters.WebSocketStreamOptions=sp.dictionaryConverter([{key:"protocols",converter:sp.sequenceConverter(sp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:sp.nullableConverter(sp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);sp.converters.WebSocketCloseInfo=sp.dictionaryConverter([{key:"closeCode",converter:a(t=>sp.converters["unsigned short"](t,sp.attributes.EnforceRange),"converter")},{key:"reason",converter:sp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);sp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?sp.converters.USVString(t):sp.converters.BufferSource(t)};kqn.exports={WebSocketStream:Vot}});var Nqn=I((uof,Dqn)=>{"use strict";p();function KOs(t){return t.indexOf("\0")===-1}a(KOs,"isValidLastEventId");function JOs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(JOs,"isASCIINumber");Dqn.exports={isValidLastEventId:KOs,isASCIINumber:JOs}});var Lqn=I((pof,Bqn)=>{"use strict";p();var{Transform:ZOs}=require("node:stream"),{isASCIINumber:Mqn,isValidLastEventId:Oqn}=Nqn(),SF=[239,187,191],Bor=10,Wot=13,XOs=58,e5s=32,Lor=class extends ZOs{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]===SF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]&&this.buffer[2]===SF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]&&this.buffer[2]===SF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&Mqn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&Oqn(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}}};Bqn.exports={EventSourceStream:Lor}});var $qn=I((gof,Gqn)=>{"use strict";p();var{pipeline:t5s}=require("node:stream"),{fetching:r5s}=Gke(),{makeRequest:n5s}=xfe(),{webidl:K_}=xA(),{EventSourceStream:i5s}=Lqn(),{parseMIMEType:o5s}=pw(),{createFastMessageEvent:s5s}=Bot(),{isNetworkError:Fqn}=qke(),{kEnumerableProperty:hZ}=Do(),{environmentSettingsObject:Uqn}=iT(),Qqn=!1,qqn=3e3,Jke=0,jqn=1,Zke=2,a5s="anonymous",c5s="use-credentials",Lfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=Jke;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),K_.util.markAsUncloneable(this);let n="EventSource constructor";K_.argumentLengthCheck(arguments,1,n),Qqn||(Qqn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=K_.converters.USVString(e),r=K_.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=Uqn,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=a5s;r.withCredentials===!0&&(c=c5s,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=Uqn.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=n5s(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Zke)return;this.#n=Jke;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!Fqn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(Fqn(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?o5s(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=jqn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new i5s({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(s5s(u.type,u.options))},"push")});t5s(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=r5s(e)}#u(){this.#n!==Zke&&(this.#n=Jke,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===Jke&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){K_.brandCheck(this,t),this.#n!==Zke&&(this.#n=Zke,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=K_.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=K_.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=K_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},Hqn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Jke,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:jqn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Zke,writable:!1}};Object.defineProperties(Lfe,Hqn);Object.defineProperties(Lfe.prototype,Hqn);Object.defineProperties(Lfe.prototype,{close:hZ,onerror:hZ,onmessage:hZ,onopen:hZ,readyState:hZ,url:hZ,withCredentials:hZ});K_.converters.EventSourceInitDict=K_.dictionaryConverter([{key:"withCredentials",converter:K_.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:K_.converters.any},{key:"node",converter:K_.dictionaryConverter([{key:"reconnectionTime",converter:K_.converters["unsigned long"],defaultValue:a(()=>qqn,"defaultValue")},{key:"dispatcher",converter:K_.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);Gqn.exports={EventSource:Lfe,defaultReconnectionTime:qqn}});var For=I((Eof,yn)=>{"use strict";p();var l5s=yj(),Wqn=KRe(),u5s=VJ(),d5s=V8n(),f5s=K8n(),p5s=YJ(),h5s=Rnr(),m5s=Tnr(),g5s=M6n(),A5s=Q6n(),y5s=H6n(),zqn=ao(),Yot=Do(),{InvalidArgumentError:zot}=zqn,Ffe=S9n(),E5s=UJ(),_5s=hir(),{MockCallHistory:C5s,MockCallHistoryLog:v5s}=Air(),b5s=Iir(),S5s=Cir(),T5s=bUn(),I5s=Jnr(),x5s=$it(),{getGlobalDispatcher:Yqn,setGlobalDispatcher:w5s}=sot(),R5s=vfe(),k5s=Mir();Object.assign(Wqn.prototype,Ffe);yn.exports.Dispatcher=Wqn;yn.exports.Client=l5s;yn.exports.Pool=u5s;yn.exports.BalancedPool=d5s;yn.exports.RoundRobinPool=f5s;yn.exports.Agent=p5s;yn.exports.ProxyAgent=h5s;yn.exports.Socks5ProxyAgent=m5s;yn.exports.EnvHttpProxyAgent=g5s;yn.exports.RetryAgent=A5s;yn.exports.H2CClient=y5s;yn.exports.RetryHandler=x5s;yn.exports.DecoratorHandler=R5s;yn.exports.RedirectHandler=k5s;yn.exports.interceptors={redirect:MUn(),responseError:BUn(),retry:FUn(),dump:QUn(),dns:GUn(),cache:a7n(),decompress:f7n(),deduplicate:A7n()};yn.exports.cacheStores={MemoryCacheStore:Hir()};var P5s=_7n();yn.exports.cacheStores.SqliteCacheStore=P5s;yn.exports.buildConnector=E5s;yn.exports.errors=zqn;yn.exports.util={parseHeaders:Yot.parseHeaders,headerNameToString:Yot.headerNameToString};function Xke(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 zot("invalid url");if(r!=null&&typeof r!="object")throw new zot("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new zot("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Yot.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Yot.parseURL(e);let{agent:o,dispatcher:s=Yqn()}=r;if(o)throw new zot("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(Xke,"makeDispatcher");yn.exports.setGlobalDispatcher=w5s;yn.exports.getGlobalDispatcher=Yqn;var D5s=Gke().fetch,Vqn=typeof __filename<"u"?__filename:void 0;function Kqn(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,Kqn),!o.stack)return;let s=o.stack.split(` + `)}close(){this.#r.close()}get(e){Unr(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){Unr(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){Unr(e),uws(r);let n=0,o=[],s=this;return new lws({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(!dws(o[h],f[h])){d=!1;break}}if(d)return u}}};function dws(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(dws,"headerValueEquals")});var QJ=I((gJd,M9n)=>{"use strict";p();var{kConstruct:fws}=tl(),{kEnumerableProperty:tfe}=Po(),{iteratorMixin:pws,isValidHeaderName:lPe,isValidHeaderValue:R9n}=JS(),{webidl:xa}=RA(),qnr=require("node:assert"),Eit=require("node:util");function w9n(t){return t===10||t===13||t===9||t===32}a(w9n,"isHTTPWhiteSpaceCharCode");function P9n(t){let e=0,r=t.length;for(;r>e&&w9n(t.charCodeAt(r-1));)--r;for(;r>e&&w9n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(P9n,"headerValueNormalize");function k9n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(k9n,"fill");function jnr(t,e,r){if(r=P9n(r),lPe(e)){if(!R9n(r))throw xa.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw xa.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(N9n(t)==="immutable")throw new TypeError("immutable");return vit(t).append(e,r,!1)}a(jnr,"appendHeader");function hws(t){let e=vit(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],qnr(s!==null);return r.sort(D9n)}}},Wk=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){xa.util.markAsUncloneable(this),e!==fws&&(this.#t=new _it,this.#e="none",e!==void 0&&(e=xa.converters.HeadersInit(e,"Headers constructor","init"),k9n(this,e)))}append(e,r){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=xa.converters.ByteString(e,n,"name"),r=xa.converters.ByteString(r,n,"value"),jnr(this,e,r)}delete(e){if(xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,1,"Headers.delete"),e=xa.converters.ByteString(e,"Headers.delete","name"),!lPe(e))throw xa.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){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=xa.converters.ByteString(e,r,"name"),!lPe(e))throw xa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=xa.converters.ByteString(e,r,"name"),!lPe(e))throw xa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=xa.converters.ByteString(e,n,"name"),r=xa.converters.ByteString(r,n,"value"),r=P9n(r),lPe(e)){if(!R9n(r))throw xa.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw xa.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){xa.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[Eit.inspect.custom](e,r){return r.depth??=e,`Headers ${Eit.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:N9n,setHeadersGuard:mws,getHeadersList:vit,setHeadersList:gws}=Wk;Reflect.deleteProperty(Wk,"getHeadersGuard");Reflect.deleteProperty(Wk,"setHeadersGuard");Reflect.deleteProperty(Wk,"getHeadersList");Reflect.deleteProperty(Wk,"setHeadersList");pws("Headers",Wk,hws,0,1);Object.defineProperties(Wk.prototype,{append:tfe,delete:tfe,get:tfe,has:tfe,set:tfe,getSetCookie:tfe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[Eit.inspect.custom]:{enumerable:!1}});xa.converters.HeadersInit=function(t,e,r){if(xa.util.Type(t)===xa.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!Eit.types.isProxy(t)&&n===Wk.prototype.entries)try{return vit(t).entriesList}catch{}return typeof n=="function"?xa.converters["sequence>"](t,e,r,n.bind(t)):xa.converters["record"](t,e,r)}throw xa.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};M9n.exports={fill:k9n,compareHeaderName:D9n,Headers:Wk,HeadersList:_it,getHeadersGuard:N9n,setHeadersGuard:mws,setHeadersList:gws,getHeadersList:vit}});var dPe=I((EJd,V9n)=>{"use strict";p();var{Headers:Q9n,HeadersList:O9n,fill:Aws,getHeadersGuard:yws,setHeadersGuard:q9n,setHeadersList:j9n}=QJ(),{extractBody:B9n,cloneBody:Ews,mixinBody:_ws,streamRegistry:H9n,bodyUnusable:vws}=Mde(),G9n=Po(),L9n=require("node:util"),{kEnumerableProperty:iT}=G9n,{isValidReasonPhrase:Cws,isCancelled:bws,isAborted:Sws,isErrorLike:Tws,environmentSettingsObject:Iws}=JS(),{redirectStatusSet:xws,nullBodyStatus:wws}=CRe(),{webidl:zs}=RA(),{URLSerializer:F9n}=sw(),{kConstruct:bit}=tl(),Hnr=require("node:assert"),{isomorphicEncode:Rws,serializeJavascriptValueToJSONString:Pws}=Z3(),kws=new TextEncoder("utf-8"),oT=class t{static{a(this,"Response")}#e;#t;static error(){return uPe(Sit(),"immutable")}static json(e,r=void 0){zs.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=zs.converters.ResponseInit(r));let n=kws.encode(Pws(e)),o=B9n(n),s=uPe(rfe({}),"response");return U9n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){zs.argumentLengthCheck(arguments,1,"Response.redirect"),e=zs.converters.USVString(e),r=zs.converters["unsigned short"](r);let n;try{n=new URL(e,Iws.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!xws.has(r))throw new RangeError(`Invalid status code ${r}`);let o=uPe(rfe({}),"immutable");o.#t.status=r;let s=Rws(F9n(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(zs.util.markAsUncloneable(this),e===bit)return;e!==null&&(e=zs.converters.BodyInit(e,"Response","body")),r=zs.converters.ResponseInit(r),this.#t=rfe({}),this.#e=new Q9n(bit),q9n(this.#e,"response"),j9n(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=B9n(e);n={body:o,type:s}}U9n(this,r,n)}get type(){return zs.brandCheck(this,t),this.#t.type}get url(){zs.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":F9n(r,!0)}get redirected(){return zs.brandCheck(this,t),this.#t.urlList.length>1}get status(){return zs.brandCheck(this,t),this.#t.status}get ok(){return zs.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return zs.brandCheck(this,t),this.#t.statusText}get headers(){return zs.brandCheck(this,t),this.#e}get body(){return zs.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return zs.brandCheck(this,t),!!this.#t.body&&G9n.isDisturbed(this.#t.body.stream)}clone(){if(zs.brandCheck(this,t),vws(this.#t))throw zs.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Gnr(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&H9n.register(this,new WeakRef(this.#t.body.stream)),uPe(e,yws(this.#e))}[L9n.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 ${L9n.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:Dws,setResponseHeaders:Nws,getResponseState:qJ,setResponseState:Mws}=oT;Reflect.deleteProperty(oT,"getResponseHeaders");Reflect.deleteProperty(oT,"setResponseHeaders");Reflect.deleteProperty(oT,"getResponseState");Reflect.deleteProperty(oT,"setResponseState");_ws(oT,qJ);Object.defineProperties(oT.prototype,{type:iT,url:iT,status:iT,ok:iT,redirected:iT,statusText:iT,headers:iT,clone:iT,body:iT,bodyUsed:iT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(oT,{json:iT,redirect:iT,error:iT});function Gnr(t){if(t.internalResponse)return $9n(Gnr(t.internalResponse),t.type);let e=rfe({...t,body:null});return t.body!=null&&(e.body=Ews(t.body)),e}a(Gnr,"cloneResponse");function rfe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new O9n(t?.headersList):new O9n,urlList:t?.urlList?[...t.urlList]:[]}}a(rfe,"makeResponse");function Sit(t){let e=Tws(t);return rfe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Sit,"makeNetworkError");function Ows(t){return t.type==="error"&&t.status===0}a(Ows,"isNetworkError");function Cit(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 Hnr(!(n in e)),r[n]=o,!0}})}a(Cit,"makeFilteredResponse");function $9n(t,e){if(e==="basic")return Cit(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Cit(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Cit(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return Cit(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Hnr(!1)}a($9n,"filterResponse");function Bws(t,e=null){return Hnr(bws(t)),Sws(t)?Sit(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Sit(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(Bws,"makeAppropriateNetworkError");function U9n(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&&!Cws(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(qJ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(qJ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&Aws(Dws(t),e.headers),r){if(wws.includes(t.status))throw zs.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});qJ(t).body=r.body,r.type!=null&&!qJ(t).headersList.contains("content-type",!0)&&qJ(t).headersList.append("content-type",r.type,!0)}}a(U9n,"initializeResponse");function uPe(t,e){let r=new oT(bit);Mws(r,t);let n=new Q9n(bit);return Nws(r,n),j9n(n,t.headersList),q9n(n,e),t.urlList.length!==0&&t.body?.stream&&H9n.register(r,new WeakRef(t.body.stream)),r}a(uPe,"fromInnerResponse");zs.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?zs.converters.USVString(t,e,r):zs.is.Blob(t)||zs.is.BufferSource(t)||zs.is.FormData(t)||zs.is.URLSearchParams(t)?t:zs.converters.DOMString(t,e,r)};zs.converters.BodyInit=function(t,e,r){return zs.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:zs.converters.XMLHttpRequestBodyInit(t,e,r)};zs.converters.ResponseInit=zs.dictionaryConverter([{key:"status",converter:zs.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:zs.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:zs.converters.HeadersInit}]);zs.is.Response=zs.util.MakeTypeAssertion(oT);V9n.exports={isNetworkError:Ows,makeNetworkError:Sit,makeResponse:rfe,makeAppropriateNetworkError:Bws,filterResponse:$9n,Response:oT,cloneResponse:Gnr,fromInnerResponse:uPe,getResponseState:qJ}});var nfe=I((CJd,sUn)=>{"use strict";p();var{extractBody:Lws,mixinBody:Fws,cloneBody:Uws,bodyUnusable:W9n}=Mde(),{Headers:X9n,fill:Qws,HeadersList:xit,setHeadersGuard:$nr,getHeadersGuard:qws,setHeadersList:eUn,getHeadersList:z9n}=QJ(),Iit=Po(),Y9n=require("node:util"),{isValidHTTPToken:jws,sameOrigin:K9n,environmentSettingsObject:Tit}=JS(),{forbiddenMethodsSet:Hws,corsSafeListedMethodsSet:Gws,referrerPolicy:$ws,requestRedirect:Vws,requestMode:Wws,requestCredentials:zws,requestCache:Yws,requestDuplex:Kws}=CRe(),{kEnumerableProperty:Xh,normalizedMethodRecordsBase:Jws,normalizedMethodRecords:Zws}=Iit,{webidl:Ni}=RA(),{URLSerializer:Xws}=sw(),{kConstruct:wit}=tl(),eRs=require("node:assert"),{getMaxListeners:tUn,setMaxListeners:tRs,defaultMaxListeners:rRs}=require("node:events"),nRs=Symbol("abortController"),rUn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Rit=new WeakMap,Vnr;try{Vnr=tUn(new AbortController().signal)>0}catch{Vnr=!1}function J9n(t){return e;function e(){let r=t.deref();if(r!==void 0){rUn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Rit.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()}Rit.delete(r.signal)}}}}a(J9n,"buildAbort");var Z9n=!1,ZC=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Ni.util.markAsUncloneable(this),e===wit)return;Ni.argumentLengthCheck(arguments,1,"Request constructor"),e=Ni.converters.RequestInfo(e),r=Ni.converters.RequestInit(r);let o=null,s=null,c=Tit.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=Pit({urlList:[_]}),s="cors"}else eRs(Ni.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=Tit.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&K9n(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=Pit({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Tit.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&&!K9n(v,Tit.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 Ni.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=Zws[_];if(v!==void 0)o.method=v;else{if(!jws(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(Hws.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=Jws[b]??_,o.method=_}!Z9n&&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"}),Z9n=!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[nRs]=m;let _=new WeakRef(m),v=J9n(_);Vnr&&tUn(l)===rRs&&tRs(1500,l),Iit.addAbortListener(l,v),rUn.register(m,{signal:l,abort:v},v)}if(this.#r=new X9n(wit),eUn(this.#r,o.headersList),$nr(this.#r,"request"),h==="no-cors"){if(!Gws.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);$nr(this.#r,"request-no-cors")}if(f){let _=z9n(this.#r),v=r.headers!==void 0?r.headers:new xit(_);if(_.clear(),v instanceof xit){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else Qws(this.#r,v)}let g=Ni.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]=Lws(r.body,o.keepalive);A=_,v&&!z9n(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(W9n(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 Ni.brandCheck(this,t),this.#n.method}get url(){return Ni.brandCheck(this,t),Xws(this.#n.url)}get headers(){return Ni.brandCheck(this,t),this.#r}get destination(){return Ni.brandCheck(this,t),this.#n.destination}get referrer(){return Ni.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Ni.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Ni.brandCheck(this,t),this.#n.mode}get credentials(){return Ni.brandCheck(this,t),this.#n.credentials}get cache(){return Ni.brandCheck(this,t),this.#n.cache}get redirect(){return Ni.brandCheck(this,t),this.#n.redirect}get integrity(){return Ni.brandCheck(this,t),this.#n.integrity}get keepalive(){return Ni.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Ni.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Ni.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Ni.brandCheck(this,t),this.#e}get body(){return Ni.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Ni.brandCheck(this,t),!!this.#n.body&&Iit.isDisturbed(this.#n.body.stream)}get duplex(){return Ni.brandCheck(this,t),"half"}clone(){if(Ni.brandCheck(this,t),W9n(this.#n))throw new TypeError("unusable");let e=iUn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Rit.get(this.signal);n===void 0&&(n=new Set,Rit.set(this.signal,n));let o=new WeakRef(r);n.add(o),Iit.addAbortListener(r.signal,J9n(o))}return oUn(e,this.#t,r.signal,qws(this.#r))}[Y9n.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 ${Y9n.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:iRs,getRequestDispatcher:oRs,setRequestDispatcher:sRs,setRequestHeaders:aRs,getRequestState:nUn,setRequestState:cRs}=ZC;Reflect.deleteProperty(ZC,"setRequestSignal");Reflect.deleteProperty(ZC,"getRequestDispatcher");Reflect.deleteProperty(ZC,"setRequestDispatcher");Reflect.deleteProperty(ZC,"setRequestHeaders");Reflect.deleteProperty(ZC,"getRequestState");Reflect.deleteProperty(ZC,"setRequestState");Fws(ZC,nUn);function Pit(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 xit(t.headersList):new xit}}a(Pit,"makeRequest");function iUn(t){let e=Pit({...t,body:null});return t.body!=null&&(e.body=Uws(t.body)),e}a(iUn,"cloneRequest");function oUn(t,e,r,n){let o=new ZC(wit);cRs(o,t),sRs(o,e),iRs(o,r);let s=new X9n(wit);return aRs(o,s),eUn(s,t.headersList),$nr(s,n),o}a(oUn,"fromInnerRequest");Object.defineProperties(ZC.prototype,{method:Xh,url:Xh,headers:Xh,redirect:Xh,clone:Xh,signal:Xh,duplex:Xh,destination:Xh,body:Xh,bodyUsed:Xh,isHistoryNavigation:Xh,isReloadNavigation:Xh,keepalive:Xh,integrity:Xh,cache:Xh,credentials:Xh,attribute:Xh,referrerPolicy:Xh,referrer:Xh,mode:Xh,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Ni.is.Request=Ni.util.MakeTypeAssertion(ZC);Ni.converters.RequestInfo=function(t){return typeof t=="string"?Ni.converters.USVString(t):Ni.is.Request(t)?t:Ni.converters.USVString(t)};Ni.converters.RequestInit=Ni.dictionaryConverter([{key:"method",converter:Ni.converters.ByteString},{key:"headers",converter:Ni.converters.HeadersInit},{key:"body",converter:Ni.nullableConverter(Ni.converters.BodyInit)},{key:"referrer",converter:Ni.converters.USVString},{key:"referrerPolicy",converter:Ni.converters.DOMString,allowedValues:$ws},{key:"mode",converter:Ni.converters.DOMString,allowedValues:Wws},{key:"credentials",converter:Ni.converters.DOMString,allowedValues:zws},{key:"cache",converter:Ni.converters.DOMString,allowedValues:Yws},{key:"redirect",converter:Ni.converters.DOMString,allowedValues:Vws},{key:"integrity",converter:Ni.converters.DOMString},{key:"keepalive",converter:Ni.converters.boolean},{key:"signal",converter:Ni.nullableConverter(t=>Ni.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Ni.converters.any},{key:"duplex",converter:Ni.converters.DOMString,allowedValues:Kws},{key:"dispatcher",converter:Ni.converters.any},{key:"priority",converter:Ni.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);sUn.exports={Request:ZC,makeRequest:Pit,fromInnerRequest:oUn,cloneRequest:iUn,getRequestDispatcher:oRs,getRequestState:nUn}});var hUn=I((TJd,pUn)=>{"use strict";p();var lRs=require("node:assert"),{runtimeFeatures:cUn}=X3(),jJ=new Map([["sha256",0],["sha384",1],["sha512",2]]),Wnr;if(cUn.has("crypto")){Wnr=require("node:crypto");let t=Wnr.getHashes();t.length===0&&jJ.clear();for(let e of jJ.keys())t.includes(e)===!1&&jJ.delete(e)}else jJ.clear();var aUn=Map.prototype.get.bind(jJ),znr=Map.prototype.has.bind(jJ),uRs=cUn.has("crypto")===!1||jJ.size===0?()=>!0:(t,e)=>{let r=uUn(e);if(r.length===0)return!0;let n=lUn(r);for(let o of n){let s=o.alg,c=o.val,l=dUn(s,t);if(fUn(l,c))return!0}return!1};function lUn(t){let e=[],r=null;for(let n of t){if(lRs(znr(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=aUn(o),c=n.alg,l=aUn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(lUn,"getStrongestMetadata");function uUn(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(!znr(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(uUn,"parseMetadata");var dUn=a((t,e)=>Wnr.hash(t,e,"base64"),"applyAlgorithmToBytes");function fUn(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:nl,makeAppropriateNetworkError:fPe,filterResponse:Ynr,makeResponse:kit,fromInnerResponse:dRs,getResponseState:fRs}=dPe(),{HeadersList:Knr}=QJ(),{Request:pRs,cloneRequest:hRs,getRequestDispatcher:mRs,getRequestState:gRs}=nfe(),zk=require("node:zlib"),{makePolicyContainer:ARs,clonePolicyContainer:yRs,requestBadPort:ERs,TAOCheck:_Rs,appendRequestOriginHeader:vRs,responseLocationURL:CRs,requestCurrentURL:sT,setRequestReferrerPolicyOnRedirect:bRs,tryUpgradeRequestToAPotentiallyTrustworthyURL:SRs,createOpaqueTimingInfo:rir,appendFetchMetadata:TRs,corsCheck:IRs,crossOriginResourcePolicyCheck:xRs,determineRequestsReferrer:wRs,coarsenedSharedCurrentTime:pPe,sameOrigin:eir,isCancelled:uj,isAborted:mUn,isErrorLike:RRs,fullyReadBody:PRs,readableStreamClose:kRs,urlIsLocal:DRs,urlIsHttpHttpsScheme:Oit,urlHasHttpsScheme:NRs,clampAndCoarsenConnectionTimingInfo:MRs,simpleRangeHeaderValue:ORs,buildContentRange:BRs,createInflate:LRs,extractMimeType:FRs,hasAuthenticationEntry:URs,includesCredentials:gUn,isTraversableNavigable:QRs}=JS(),HJ=require("node:assert"),{safelyExtractBody:Bit,extractBody:AUn}=Mde(),{redirectStatusSet:vUn,nullBodyStatus:CUn,safeMethodsSet:qRs,requestBodyHeader:jRs,subresourceSet:HRs}=CRe(),GRs=require("node:events"),{Readable:$Rs,pipeline:VRs,finished:WRs,isErrored:zRs,isReadable:Dit}=require("node:stream"),{addAbortListener:YRs,bufferToLowerCasedHeaderName:yUn}=Po(),{dataURLProcessor:KRs,serializeAMimeType:JRs,minimizeSupportedMimeType:ZRs}=sw(),{getGlobalDispatcher:XRs}=git(),{webidl:nir}=RA(),{STATUS_CODES:EUn}=require("node:http"),{bytesMatch:ePs}=hUn(),{createDeferredPromise:tPs}=xRe(),{isomorphicEncode:Nit}=Z3(),{runtimeFeatures:rPs}=X3(),nPs=rPs.has("zstd"),iPs=["GET","HEAD"],oPs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Jnr,Mit=class extends GRs{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 sPs(t){bUn(t,"fetch")}a(sPs,"handleFetchDone");function aPs(t,e=void 0){nir.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=tPs(),n;try{n=new pRs(t,e)}catch(f){return r.reject(f),r.promise}let o=gRs(n);if(n.signal.aborted)return Znr(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 YRs(n.signal,()=>{l=!0,HJ(u!=null),u.abort(n.signal.reason);let f=c?.deref();Znr(r,o,f,n.signal.reason,u.controller)}),u=TUn({request:o,processResponseEndOfBody:sPs,processResponse:a(f=>{if(!l){if(f.aborted){Znr(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(dRs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:mRs(n),requestObject:n}),r.promise}a(aPs,"fetch");function bUn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Oit(r)&&n!==null&&(t.timingAllowPassed||(n=rir({startTime:n.startTime}),o=""),n.endTime=pPe(),t.timingInfo=n,SUn(n,r.href,e,globalThis,o,"",t.status))}a(bUn,"finalizeAndReportTiming");var SUn=performance.markResourceTiming;function Znr(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&Dit(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=fRs(r);s.body?.stream!=null&&Dit(s.body.stream)&&o.error(n)}a(Znr,"abortFetch");function TUn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=XRs(),requestObject:u=null}){HJ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=pPe(f),m=rir({startTime:h}),g={controller:new Mit(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return HJ(!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=yRs(t.client.policyContainer):t.policyContainer=ARs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,HRs.has(t.destination),IUn(g,!1),g.controller}a(TUn,"fetching");async function IUn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!DRs(sT(r))&&(n=nl("local URLs only")),SRs(r),ERs(r)==="blocked"&&(n=nl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=wRs(r)),n===null){let s=sT(r);eir(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await _Un(t)):r.mode==="same-origin"?n=nl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=nl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await _Un(t)):Oit(sT(r))?(r.responseTainting="cors",n=await xUn(t)):n=nl("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Ynr(n,"basic"):r.responseTainting==="cors"?n=Ynr(n,"cors"):r.responseTainting==="opaque"?n=Ynr(n,"opaque"):HJ(!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=nl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||CUn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>Xnr(t,nl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!ePs(l,r.integrity)){s("integrity mismatch");return}n.body=Bit(l)[0],Xnr(t,n)},"processBody");PRs(n.body,c,s)}else Xnr(t,n)}catch(r){t.controller.terminate(r)}}a(IUn,"mainFetch");function _Un(t){if(uj(t)&&t.request.redirectCount===0)return Promise.resolve(fPe(t));let{request:e}=t,{protocol:r}=sT(e);switch(r){case"about:":return Promise.resolve(nl("about scheme is not supported"));case"blob:":{Jnr||(Jnr=require("node:buffer").resolveObjectURL);let n=sT(e);if(n.search.length!==0)return Promise.resolve(nl("NetworkError when attempting to fetch resource."));let o=Jnr(n.toString());if(e.method!=="GET"||!nir.is.Blob(o))return Promise.resolve(nl("invalid method"));let s=kit(),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=ORs(d,!0);if(f==="failure")return Promise.resolve(nl("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(nl("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=AUn(g);s.body=A[0];let y=Nit(`${g.size}`),E=BRs(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=AUn(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=sT(e),o=KRs(n);if(o==="failure")return Promise.resolve(nl("failed to fetch the data URL"));let s=JRs(o.mimeType);return Promise.resolve(kit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Bit(o.body)[0]}))}case"file:":return Promise.resolve(nl("not implemented... yet..."));case"http:":case"https:":return xUn(t).catch(n=>nl(n));default:return Promise.resolve(nl("unknown scheme"))}}a(_Un,"schemeFetch");function cPs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(cPs,"finalizeResponse");function Xnr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Oit(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=rir(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=FRs(e.headersList);f!=="failure"&&(u.contentType=ZRs(f))}t.request.initiatorType!=null&&SUn(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():WRs(o.body.stream,()=>{n()})}a(Xnr,"fetchFinale");async function xUn(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 tir(t),e.responseTainting==="cors"&&IRs(e,r)==="failure")return nl("cors failure");_Rs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&xRs(e.origin,e.client,e.destination,n)==="blocked"?nl("blocked"):(vUn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=nl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await lPs(t,r):HJ(!1)),r.timingInfo=o,r)}a(xUn,"httpFetch");function lPs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=CRs(n,sT(r).hash),o==null)return e}catch(c){return Promise.resolve(nl(c))}if(!Oit(o))return Promise.resolve(nl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(nl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!eir(r,o))return Promise.resolve(nl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(nl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(nl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!iPs.includes(r.method)){r.method="GET",r.body=null;for(let c of jRs)r.headersList.delete(c)}eir(sT(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&&(HJ(r.body.source!=null),r.body=Bit(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=pPe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),bRs(r,n),IUn(t,!0)}a(lPs,"httpRedirectFetch");async function tir(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=hRs(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.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,nir.is.URL(s.referrer)&&s.headersList.append("referer",Nit(s.referrer.href),!0),vRs(s),TRs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",oPs,!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)||(NRs(sT(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(!(URs(s)&&(s.useURLCredentials===void 0||!gUn(sT(s))))){if(gUn(sT(s))&&e){let{username:g,password:A}=sT(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 nl("only if cached");let m=await uPs(o,d,r);!qRs.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||QRs(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Bit(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return uj(t)?fPe(t):c;t.controller.connection.destroy(),c=await tir(t,!0)}if(c.status===407)return n.window==="no-window"?nl():uj(t)?fPe(t):nl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(uj(t))return fPe(t);t.controller.connection.destroy(),c=await tir(t,e,!0)}return c}a(tir,"httpNetworkOrCacheFetch");async function uPs(t,e=!1,r=!1){HJ(!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*(_){uj(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{uj(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{uj(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(),fPe(t,A)):nl(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{uj(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(mUn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){kRs(t.controller.controller),cPs(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),zRs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){mUn(t)?(o.aborted=!0,Dit(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Dit(h)&&t.controller.controller.error(new TypeError("terminated",{cause:RRs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=sT(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=MRs(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=pPe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=pPe(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new Knr;for(let M=0;Mq)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${q}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")B.push(zk.createGunzip({flush:zk.constants.Z_SYNC_FLUSH,finishFlush:zk.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(LRs({flush:zk.constants.Z_SYNC_FLUSH,finishFlush:zk.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(zk.createBrotliDecompress({flush:zk.constants.BROTLI_OPERATION_FLUSH,finishFlush:zk.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&nPs)B.push(zk.createZstdDecompress({flush:zk.constants.ZSTD_e_continue,finishFlush:zk.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?VRs(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 Knr;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:EUn[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 Knr;for(let D=0;D{"use strict";p();var dPs=require("node:assert"),{URLSerializer:RUn}=sw(),{isValidHeaderName:fPs}=JS();function pPs(t,e,r=!1){let n=RUn(t,r),o=RUn(e,r);return n===o}a(pPs,"urlEquals");function hPs(t){dPs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),fPs(r)&&e.push(r);return e}a(hPs,"getFieldValues");PUn.exports={urlEquals:pPs,getFieldValues:hPs}});var OUn=I((MJd,MUn)=>{"use strict";p();var iir=require("node:assert"),{kConstruct:mPs}=tl(),{urlEquals:gPs,getFieldValues:oir}=kUn(),{kEnumerableProperty:GJ,isDisturbed:APs}=Po(),{webidl:Zn}=RA(),{cloneResponse:DUn,fromInnerResponse:yPs,getResponseState:EPs}=dPe(),{Request:mPe,fromInnerRequest:_Ps,getRequestState:JO}=nfe(),{fetching:vPs}=hPe(),{urlIsHttpHttpsScheme:Lit,readAllBytes:CPs}=JS(),{createDeferredPromise:ife}=xRe(),Fit=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==mPs&&Zn.illegalConstructor(),Zn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Zn.brandCheck(this,t);let n="Cache.match";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.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={}){Zn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Zn.brandCheck(this,t),Zn.argumentLengthCheck(arguments,1,"Cache.add"),e=Zn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Zn.brandCheck(this,t);let r="Cache.addAll";Zn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Zn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Zn.converters.RequestInfo(m),typeof m=="string")continue;let g=JO(m);if(!Lit(g.url)||g.method!=="GET")throw Zn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=JO(new mPe(m));if(!Lit(g.url))throw Zn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=ife();s.push(vPs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Zn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=oir(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Zn.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=ife(),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){Zn.brandCheck(this,t);let n="Cache.put";Zn.argumentLengthCheck(arguments,2,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.Response(r,n,"response");let o=null;if(Zn.is.Request(e)?o=JO(e):o=JO(new mPe(e)),!Lit(o.url)||o.method!=="GET")throw Zn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=EPs(r);if(s.status===206)throw Zn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=oir(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Zn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(APs(s.body.stream)||s.body.stream.locked))throw Zn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=DUn(s),l=ife();if(s.body!=null){let A=s.body.stream.getReader();CPs(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=ife(),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={}){Zn.brandCheck(this,t);let n="Cache.delete";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Zn.is.Request(e)){if(o=JO(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else iir(typeof e=="string"),o=JO(new mPe(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=ife(),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={}){Zn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Zn.is.Request(e)){if(o=JO(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=JO(new mPe(e)));let s=ife(),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=_Ps(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 Zn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Zn.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);iir(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Lit(u.url))throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Zn.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);iir(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=""),!gPs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=oir(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(Zn.is.Request(e)){if(o=JO(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=JO(new mPe(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=yPs(DUn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(Fit.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:GJ,matchAll:GJ,add:GJ,addAll:GJ,put:GJ,delete:GJ,keys:GJ});var NUn=[{key:"ignoreSearch",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Zn.converters.CacheQueryOptions=Zn.dictionaryConverter(NUn);Zn.converters.MultiCacheQueryOptions=Zn.dictionaryConverter([...NUn,{key:"cacheName",converter:Zn.converters.DOMString}]);Zn.converters.Response=Zn.interfaceConverter(Zn.is.Response,"Response");Zn.converters["sequence"]=Zn.sequenceConverter(Zn.converters.RequestInfo);MUn.exports={Cache:Fit}});var LUn=I((LJd,BUn)=>{"use strict";p();var{Cache:Uit}=OUn(),{webidl:sE}=RA(),{kEnumerableProperty:gPe}=Po(),{kConstruct:APe}=tl(),Qit=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==APe&&sE.illegalConstructor(),sE.util.markAsUncloneable(this)}async match(e,r={}){if(sE.brandCheck(this,t),sE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=sE.converters.RequestInfo(e),r=sE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Uit(APe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Uit(APe,n).match(e,r);if(s!==void 0)return s}}async has(e){sE.brandCheck(this,t);let r="CacheStorage.has";return sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){sE.brandCheck(this,t);let r="CacheStorage.open";if(sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Uit(APe,o)}let n=[];return this.#e.set(e,n),new Uit(APe,n)}async delete(e){sE.brandCheck(this,t);let r="CacheStorage.delete";return sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return sE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Qit.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:gPe,has:gPe,open:gPe,delete:gPe,keys:gPe});BUn.exports={CacheStorage:Qit}});var UUn=I((QJd,FUn)=>{"use strict";p();FUn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var sir=I((jJd,GUn)=>{"use strict";p();function bPs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(bPs,"isCTLExcludingHtab");function QUn(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(QUn,"validateCookieName");function qUn(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(qUn,"validateCookieValue");function jUn(t){for(let e=0;ee.toString().padStart(2,"0"));function HUn(t){return typeof t=="number"&&(t=new Date(t)),`${TPs[t.getUTCDay()]}, ${qit[t.getUTCDate()]} ${IPs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${qit[t.getUTCHours()]}:${qit[t.getUTCMinutes()]}:${qit[t.getUTCSeconds()]} GMT`}a(HUn,"toIMFDate");function xPs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(xPs,"validateCookieMaxAge");function wPs(t){if(t.name.length===0)return null;QUn(t.name),qUn(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"&&(xPs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(SPs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(jUn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${HUn(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(wPs,"stringify");GUn.exports={isCTLExcludingHtab:bPs,validateCookieName:QUn,validateCookiePath:jUn,validateCookieValue:qUn,toIMFDate:HUn,stringify:wPs}});var VUn=I(($Jd,$Un)=>{"use strict";p();var{collectASequenceOfCodePointsFast:jit}=Z3(),{maxNameValuePairSize:RPs,maxAttributeValueSize:PPs}=UUn(),{isCTLExcludingHtab:kPs}=sir(),DPs=require("node:assert"),{unescape:NPs}=require("node:querystring");function MPs(t){if(kPs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=jit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=jit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>RPs?null:{name:n,value:NPs(o),...ofe(r)}}a(MPs,"parseSetCookie");function ofe(t,e={}){if(t.length===0)return e;DPs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=jit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=jit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>PPs)return ofe(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 ofe(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 ofe(t,e)}a(ofe,"parseUnparsedAttributes");$Un.exports={parseSetCookie:MPs,parseUnparsedAttributes:ofe}});var KUn=I((zJd,YUn)=>{"use strict";p();var{parseSetCookie:WUn}=VUn(),{stringify:OPs}=sir(),{webidl:$a}=RA(),{Headers:BPs}=QJ(),Hit=$a.brandCheckMultiple([BPs,globalThis.Headers].filter(Boolean));function LPs(t){$a.argumentLengthCheck(arguments,1,"getCookies"),Hit(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(LPs,"getCookies");function FPs(t,e,r){Hit(t);let n="deleteCookie";$a.argumentLengthCheck(arguments,2,n),e=$a.converters.DOMString(e,n,"name"),r=$a.converters.DeleteCookieAttributes(r),zUn(t,{name:e,value:"",expires:new Date(0),...r})}a(FPs,"deleteCookie");function UPs(t){$a.argumentLengthCheck(arguments,1,"getSetCookies"),Hit(t);let e=t.getSetCookie();return e?e.map(r=>WUn(r)):[]}a(UPs,"getSetCookies");function QPs(t){return t=$a.converters.DOMString(t),WUn(t)}a(QPs,"parseCookie");function zUn(t,e){$a.argumentLengthCheck(arguments,2,"setCookie"),Hit(t),e=$a.converters.Cookie(e);let r=OPs(e);r&&t.append("set-cookie",r,!0)}a(zUn,"setCookie");$a.converters.DeleteCookieAttributes=$a.dictionaryConverter([{converter:$a.nullableConverter($a.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:$a.nullableConverter($a.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);$a.converters.Cookie=$a.dictionaryConverter([{converter:$a.converters.DOMString,key:"name"},{converter:$a.converters.DOMString,key:"value"},{converter:$a.nullableConverter(t=>typeof t=="number"?$a.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:$a.nullableConverter($a.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:$a.nullableConverter($a.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:$a.nullableConverter($a.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:$a.nullableConverter($a.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:$a.nullableConverter($a.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:$a.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:$a.sequenceConverter($a.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);YUn.exports={getCookies:LPs,deleteCookie:FPs,getSetCookies:UPs,setCookie:zUn,parseCookie:QPs}});var Vit=I((JJd,ZUn)=>{"use strict";p();var{webidl:ci}=RA(),{kEnumerableProperty:XC}=Po(),{kConstruct:JUn}=tl(),sfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===JUn){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(JUn,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:qPs}=sfe;delete sfe.createFastMessageEvent;var Git=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}},$it=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(sfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:XC,origin:XC,lastEventId:XC,source:XC,ports:XC,initMessageEvent:XC});Object.defineProperties(Git.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:XC,code:XC,wasClean:XC});Object.defineProperties($it.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:XC,filename:XC,lineno:XC,colno:XC,error:XC});ci.converters.MessagePort=ci.interfaceConverter(ci.is.MessagePort,"MessagePort");ci.converters["sequence"]=ci.sequenceConverter(ci.converters.MessagePort);var air=[{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([...air,{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([...air,{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([...air,{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}]);ZUn.exports={MessageEvent:sfe,CloseEvent:Git,ErrorEvent:$it,createFastMessageEvent:qPs}});var dj=I((eZd,XUn)=>{"use strict";p();var jPs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",HPs={enumerable:!0,writable:!1,configurable:!1},GPs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},$Ps={SENT:1,RECEIVED:2},VPs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},WPs=65535,zPs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},YPs=Buffer.allocUnsafe(0),KPs={text:1,typedArray:2,arrayBuffer:3,blob:4};XUn.exports={uid:jPs,sentCloseFrameState:$Ps,staticPropertyDescriptors:HPs,states:GPs,opcodes:VPs,maxUnsigned16Bit:WPs,parserStates:zPs,emptyBuffer:YPs,sendHints:KPs}});var $J=I((rZd,i7n)=>{"use strict";p();var{states:Wit,opcodes:afe}=dj(),{isUtf8:JPs}=require("node:buffer"),{removeHTTPWhitespace:e7n}=sw(),{collectASequenceOfCodePointsFast:ZPs}=Z3();function XPs(t){return t===Wit.CONNECTING}a(XPs,"isConnecting");function eks(t){return t===Wit.OPEN}a(eks,"isEstablished");function tks(t){return t===Wit.CLOSING}a(tks,"isClosing");function rks(t){return t===Wit.CLOSED}a(rks,"isClosed");function nks(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(nks,"fireEvent");function iks(t,e,r){t.onMessage(e,r)}a(iks,"websocketMessageReceived");function oks(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(oks,"toArrayBuffer");function sks(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(sks,"isValidSubprotocol");function aks(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(aks,"isValidStatusCode");function t7n(t){return t===afe.CLOSE||t===afe.PING||t===afe.PONG}a(t7n,"isControlFrame");function r7n(t){return t===afe.CONTINUATION}a(r7n,"isContinuationFrame");function n7n(t){return t===afe.TEXT||t===afe.BINARY}a(n7n,"isTextBinaryFrame");function cks(t){return n7n(t)||r7n(t)||t7n(t)}a(cks,"isValidOpcode");function lks(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(uks,"isValidClientWindowBits");function dks(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(dks,"getURLRecord");function fks(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(fks,"validateCloseCodeAndReason");var pks=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(JPs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();i7n.exports={isConnecting:XPs,isEstablished:eks,isClosing:tks,isClosed:rks,fireEvent:nks,isValidSubprotocol:sks,isValidStatusCode:aks,websocketMessageReceived:iks,utf8Decode:pks,isControlFrame:t7n,isContinuationFrame:r7n,isTextBinaryFrame:n7n,isValidOpcode:cks,parseExtensions:lks,isValidClientWindowBits:uks,toArrayBuffer:oks,getURLRecord:dks,validateCloseCodeAndReason:fks}});var lfe=I((oZd,s7n)=>{"use strict";p();var{runtimeFeatures:hks}=X3(),{maxUnsigned16Bit:o7n,opcodes:mks}=dj(),zit=8*1024,yPe=null,cfe=zit,gks=hks.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oo7n?(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;uo7n?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|mks.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]}};s7n.exports={WebsocketFrameSend:lir,generateMask:cir}});var Yit=I((cZd,f7n)=>{"use strict";p();var{uid:Aks,states:uir,sentCloseFrameState:dir,emptyBuffer:a7n,opcodes:yks}=dj(),{parseExtensions:Eks,isClosed:_ks,isClosing:vks,isEstablished:u7n,isConnecting:Cks,validateCloseCodeAndReason:bks}=$J(),{makeRequest:Sks}=nfe(),{fetching:Tks}=hPe(),{Headers:Iks,getHeadersList:xks}=QJ(),{getDecodeSplit:wks}=JS(),{WebsocketFrameSend:Rks}=lfe(),Pks=require("node:assert"),{runtimeFeatures:kks}=X3(),c7n=kks.has("crypto")?require("node:crypto"):null,l7n=!1;function Dks(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=Sks({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=xks(new Iks(o.headers));c.headersList=f}let l=c7n.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),Tks({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){ZO(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){ZO(n,1002,"Received network error or non-200 status code.",f.error);return}}if(l7n===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),l7n=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){ZO(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){ZO(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){ZO(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=c7n.hash("sha1",l+Aks,"base64");if(h!==m){ZO(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=Eks(g),!A.has("permessage-deflate"))){ZO(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!wks("sec-websocket-protocol",c.headersList).includes(y)){ZO(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(Dks,"establishWebSocketConnection");function d7n(t,e,r,n=!1){if(e??=null,r??="",n&&bks(e,r),!(_ks(t.readyState)||vks(t.readyState)))if(!u7n(t.readyState))ZO(t),t.readyState=uir.CLOSING;else if(!t.closeState.has(dir.SENT)&&!t.closeState.has(dir.RECEIVED)){let o=new Rks;r.length!==0&&e===null&&(e=1e3),Pks(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=a7n: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=a7n,t.socket.write(o.createFrame(yks.CLOSE)),t.closeState.add(dir.SENT),t.readyState=uir.CLOSING}else t.readyState=uir.CLOSING}a(d7n,"closeWebSocketConnection");function ZO(t,e,r,n){u7n(t.readyState)&&d7n(t,e,r,!1),t.controller.abort(),Cks(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(ZO,"failWebsocketConnection");f7n.exports={establishWebSocketConnection:Dks,failWebsocketConnection:ZO,closeWebSocketConnection:d7n}});var m7n=I((dZd,h7n)=>{"use strict";p();var{createInflateRaw:Nks,Z_DEFAULT_WINDOWBITS:Mks}=require("node:zlib"),{isValidClientWindowBits:Oks}=$J(),{MessageSizeExceededError:p7n}=so(),Bks=Buffer.from([0,0,255,255]),Kit=Symbol("kBuffer"),EPe=Symbol("kLength"),Lks=4*1024*1024,fir=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 p7n);return}if(!this.#e){let o=Mks;if(this.#t.serverMaxWindowBits){if(!Oks(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=Nks({windowBits:o})}catch(s){n(s);return}this.#e[Kit]=[],this.#e[EPe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[EPe]+=s.length,this.#e[EPe]>Lks){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new p7n)}return}this.#e[Kit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(Bks),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Kit],this.#e[EPe]);this.#e[Kit].length=0,this.#e[EPe]=0,this.#n=null,n(null,o)})}};h7n.exports={PerMessageDeflate:fir}});var mir=I((hZd,_7n)=>{"use strict";p();var{Writable:Fks}=require("node:stream"),Uks=require("node:assert"),{parserStates:eb,opcodes:ufe,states:Qks,emptyBuffer:g7n,sentCloseFrameState:_Pe}=dj(),{isValidStatusCode:qks,isValidOpcode:jks,websocketMessageReceived:A7n,utf8Decode:Hks,isControlFrame:y7n,isTextBinaryFrame:pir,isContinuationFrame:Gks}=$J(),{failWebsocketConnection:aT}=Yit(),{WebsocketFrameSend:E7n}=lfe(),{PerMessageDeflate:$ks}=m7n(),{MessageSizeExceededError:Vks}=so(),hir=class extends Fks{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=eb.INFO;#o={};#s=[];#a;#c;constructor(e,r){super(),this.#c=e,this.#a=r??new Map,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new $ks(r))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}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!==ufe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!jks(o))return aT(this.#c,1002,"Invalid opcode received"),e();if(s)return aT(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){aT(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){aT(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!pir(o)){aT(this.#c,1002,"Invalid frame type was fragmented.");return}if(pir(o)&&this.#s.length>0){aT(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){aT(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&y7n(o)){aT(this.#c,1002,"Control frame either too large or fragmented");return}if(Gks(o)&&this.#s.length===0&&!this.#o.compressed){aT(this.#c,1002,"Unexpected continuation frame");return}l<=125?(this.#o.payloadLength=l,this.#i=eb.READ_DATA):l===126?this.#i=eb.PAYLOADLENGTH_16:l===127&&(this.#i=eb.PAYLOADLENGTH_64),pir(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);this.#o.payloadLength=r.readUInt16BE(0),this.#i=eb.READ_DATA}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){aT(this.#c,1009,"Received payload length > 2^31 bytes.");return}this.#o.payloadLength=o,this.#i=eb.READ_DATA}else if(this.#i===eb.READ_DATA){if(this.#r{if(n){let s=n instanceof Vks?1009:1007;aT(this.#c,s,n.message);return}if(this.writeFragments(o),!this.#o.fin){this.#i=eb.INFO,this.#n=!0,this.run(e);return}A7n(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=eb.INFO,this.run(e)}),this.#n=!1;break}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return g7n;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){this.#t+=e.length,this.#s.push(e)}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&&!qks(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=Hks(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===ufe.CLOSE){if(n===1)return aT(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 aT(this.#c,o,s),!1}if(!this.#c.closeState.has(_Pe.SENT)&&!this.#c.closeState.has(_Pe.RECEIVED)){let o=g7n;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new E7n(o);this.#c.socket.write(s.createFrame(ufe.CLOSE)),this.#c.closeState.add(_Pe.SENT)}return this.#c.readyState=Qks.CLOSING,this.#c.closeState.add(_Pe.RECEIVED),!1}else if(r===ufe.PING){if(!this.#c.closeState.has(_Pe.RECEIVED)){let o=new E7n(e);this.#c.socket.write(o.createFrame(ufe.PONG)),this.#c.onPing(e)}}else r===ufe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};_7n.exports={ByteParser:hir}});var S7n=I((AZd,b7n)=>{"use strict";p();var{WebsocketFrameSend:C7n}=lfe(),{opcodes:v7n,sendHints:VJ}=dj(),Wks=Vtr(),Air=class{static{a(this,"SendQueue")}#e=new Wks;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==VJ.blob){if(this.#t){let s={promise:null,callback:r,frame:gir(e,n)};this.#e.push(s)}else if(n===VJ.text){let{0:s,1:c}=C7n.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(gir(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=gir(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 gir(t,e){return new C7n(zks(t,e)).createFrame(e===VJ.text?v7n.TEXT:v7n.BINARY)}a(gir,"createFrame");function zks(t,e){switch(e){case VJ.text:case VJ.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case VJ.arrayBuffer:case VJ.blob:return new Uint8Array(t)}}a(zks,"toBuffer");b7n.exports={SendQueue:Air}});var P7n=I((_Zd,R7n)=>{"use strict";p();var{isArrayBuffer:Yks}=require("node:util/types"),{webidl:pi}=RA(),{URLSerializer:Kks}=sw(),{environmentSettingsObject:T7n}=JS(),{staticPropertyDescriptors:fj,states:lF,sentCloseFrameState:yir,sendHints:Jit,opcodes:Eir}=dj(),{isConnecting:Jks,isEstablished:I7n,isClosing:x7n,isClosed:Zks,isValidSubprotocol:Xks,fireEvent:Zit,utf8Decode:e2s,toArrayBuffer:t2s,getURLRecord:r2s}=$J(),{establishWebSocketConnection:n2s,closeWebSocketConnection:i2s,failWebsocketConnection:w7n}=Yit(),{ByteParser:o2s}=mir(),{kEnumerableProperty:hw}=Po(),{getGlobalDispatcher:s2s}=git(),{ErrorEvent:a2s,CloseEvent:c2s,createFastMessageEvent:l2s}=Vit(),{SendQueue:u2s}=S7n(),{WebsocketFrameSend:d2s}=lfe(),{channels:XO}=Gq();function f2s(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(f2s,"getSocketAddress");var V_=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=>w7n(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=lF.CLOSING,XO.socketError.hasSubscribers&&XO.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{XO.ping.hasSubscribers&&XO.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{XO.pong.hasSubscribers&&XO.pong.publish({payload:e,websocket:this})},"onPong"),readyState:lF.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),pi.util.markAsUncloneable(this);let n="WebSocket constructor";pi.argumentLengthCheck(arguments,1,n);let o=pi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=pi.converters.USVString(e),r=o.protocols;let s=T7n.settingsObject.baseUrl,c=r2s(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=>Xks(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=T7n.settingsObject;this.#o.controller=n2s(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){pi.brandCheck(this,t),e!==void 0&&(e=pi.converters["unsigned short"](e,"WebSocket.close","code",pi.attributes.Clamp)),r!==void 0&&(r=pi.converters.USVString(r)),e??=null,r??="",i2s(this.#o,e,r,!0)}send(e){pi.brandCheck(this,t);let r="WebSocket.send";if(pi.argumentLengthCheck(arguments,1,r),e=pi.converters.WebSocketSendData(e,r,"data"),Jks(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!I7n(this.#o.readyState)||x7n(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},Jit.text)}else Yks(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Jit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Jit.typedArray)):pi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Jit.blob))}get readyState(){return pi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return pi.brandCheck(this,t),this.#t}get url(){return pi.brandCheck(this,t),Kks(this.#s)}get extensions(){return pi.brandCheck(this,t),this.#n}get protocol(){return pi.brandCheck(this,t),this.#r}get onopen(){return pi.brandCheck(this,t),this.#e.open}set onopen(e){pi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return pi.brandCheck(this,t),this.#e.error}set onerror(e){pi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return pi.brandCheck(this,t),this.#e.close}set onclose(e){pi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return pi.brandCheck(this,t),this.#e.message}set onmessage(e){pi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return pi.brandCheck(this,t),this.#a}set binaryType(e){pi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=new o2s(this.#o,r);n.on("drain",()=>this.#o.onParserDrain()),n.on("error",c=>this.#o.onParserError(c)),this.#c=n,this.#i=new u2s(e.socket),this.#o.readyState=lF.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");if(s!==null&&(this.#r=s),Zit("open",this),XO.open.hasSubscribers){let c=e.headersList.entries;XO.open.publish({address:f2s(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:c}})}}#l(e,r){if(this.#o.readyState!==lF.OPEN)return;let n;if(e===Eir.TEXT)try{n=e2s(r)}catch{w7n(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Eir.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=t2s(r));Zit("message",this,l2s,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(yir.SENT)&&this.#o.closeState.has(yir.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=lF.CLOSED,this.#o.closeState.has(yir.RECEIVED)||(r=1006,Zit("error",this,(s,c)=>new a2s(s,c),{error:new TypeError(n)})),Zit("close",this,(s,c)=>new c2s(s,c),{wasClean:e,code:r,reason:n}),XO.close.hasSubscribers&&XO.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(I7n(n)&&!x7n(n)&&!Zks(n)){let o=new d2s(r);e.#o.socket.write(o.createFrame(Eir.PING))}}},{ping:p2s}=V_;Reflect.deleteProperty(V_,"ping");V_.CONNECTING=V_.prototype.CONNECTING=lF.CONNECTING;V_.OPEN=V_.prototype.OPEN=lF.OPEN;V_.CLOSING=V_.prototype.CLOSING=lF.CLOSING;V_.CLOSED=V_.prototype.CLOSED=lF.CLOSED;Object.defineProperties(V_.prototype,{CONNECTING:fj,OPEN:fj,CLOSING:fj,CLOSED:fj,url:hw,readyState:hw,bufferedAmount:hw,onopen:hw,onerror:hw,onclose:hw,close:hw,onmessage:hw,binaryType:hw,send:hw,extensions:hw,protocol:hw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(V_,{CONNECTING:fj,OPEN:fj,CLOSING:fj,CLOSED:fj});pi.converters["sequence"]=pi.sequenceConverter(pi.converters.DOMString);pi.converters["DOMString or sequence"]=function(t,e,r){return pi.util.Type(t)===pi.util.Types.OBJECT&&Symbol.iterator in t?pi.converters["sequence"](t):pi.converters.DOMString(t,e,r)};pi.converters.WebSocketInit=pi.dictionaryConverter([{key:"protocols",converter:pi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:pi.converters.any,defaultValue:a(()=>s2s(),"defaultValue")},{key:"headers",converter:pi.nullableConverter(pi.converters.HeadersInit)}]);pi.converters["DOMString or sequence or WebSocketInit"]=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&!(Symbol.iterator in t)?pi.converters.WebSocketInit(t):{protocols:pi.converters["DOMString or sequence"](t)}};pi.converters.WebSocketSendData=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&(pi.is.Blob(t)||pi.is.BufferSource(t))?t:pi.converters.USVString(t)};R7n.exports={WebSocket:V_,ping:p2s}});var _ir=I((bZd,N7n)=>{"use strict";p();var{webidl:Xit}=RA(),{validateCloseCodeAndReason:h2s}=$J(),{kConstruct:k7n}=tl(),{kEnumerableProperty:D7n}=Po();function m2s(){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(m2s,"createInheritableDOMException");var WJ=class t extends m2s(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=Xit.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===k7n)return;r!==null&&(r=Xit.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";h2s(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,k7n);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:g2s}=WJ;delete WJ.createUnvalidatedWebSocketError;Object.defineProperties(WJ.prototype,{closeCode:D7n,reason:D7n,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Xit.is.WebSocketError=Xit.util.MakeTypeAssertion(WJ);N7n.exports={WebSocketError:WJ,createUnvalidatedWebSocketError:g2s}});var F7n=I((IZd,L7n)=>{"use strict";p();var{createDeferredPromise:vir}=xRe(),{environmentSettingsObject:M7n}=JS(),{states:dfe,opcodes:eot,sentCloseFrameState:ffe}=dj(),{webidl:ap}=RA(),{getURLRecord:A2s,isValidSubprotocol:y2s,isEstablished:E2s,utf8Decode:_2s}=$J(),{establishWebSocketConnection:v2s,failWebsocketConnection:Cir,closeWebSocketConnection:bir}=Yit(),{channels:O7n}=Gq(),{WebsocketFrameSend:C2s}=lfe(),{ByteParser:b2s}=mir(),{WebSocketError:S2s,createUnvalidatedWebSocketError:T2s}=_ir(),{kEnumerableProperty:tot}=Po(),{utf8DecodeBytes:I2s}=Cnt(),B7n=!1,rot=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=>Cir(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=dfe.CLOSING,O7n.socketError.hasSubscribers&&O7n.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:dfe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){B7n||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),B7n=!0),ap.argumentLengthCheck(arguments,1,"WebSocket"),e=ap.converters.USVString(e),r!==null&&(r=ap.converters.WebSocketStreamOptions(r));let n=M7n.settingsObject.baseUrl,o=A2s(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=>y2s(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=vir(),this.#r=vir(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{E2s(this.#a.readyState)||(Cir(this.#a),this.#a.readyState=dfe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=M7n.settingsObject;this.#a.controller=v2s(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=ap.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;bir(this.#a,r,n,!0)}#u(e){e=ap.converters.WebSocketStreamWrite(e);let r=vir(),n=null,o=null;if(ap.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=eot.BINARY;else{let s;try{s=ap.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=eot.TEXT}if(!this.#a.closeState.has(ffe.SENT)&&!this.#a.closeState.has(ffe.RECEIVED)){let s=new C2s(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=new b2s(this.#a,r);n.on("drain",()=>this.#a.onParserDrain()),n.on("error",u=>this.#a.onParserError(u)),this.#c=n,this.#a.readyState=dfe.OPEN;let o=r??"",s=e.headersList.get("sec-websocket-protocol")??"",c=new ReadableStream({start:a(u=>{this.#i=u},"start"),cancel:a(u=>this.#h(u),"cancel")}),l=new WritableStream({write:a(u=>this.#u(u),"write"),close:a(()=>bir(this.#a,null,null),"close"),abort:a(u=>this.#A(u),"abort")});this.#n=c,this.#o=l,this.#t.resolve({extensions:o,protocol:s,readable:c,writable:l})}#p(e,r){if(this.#a.readyState!==dfe.OPEN)return;let n;if(e===eot.TEXT)try{n=_2s(r)}catch{Cir(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===eot.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(ffe.SENT)&&this.#a.closeState.has(ffe.RECEIVED);if(this.#a.readyState=dfe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new S2s("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(ffe.SENT)&&!this.#a.closeState.has(ffe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":I2s(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=T2s("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";ap.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),bir(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(rot.prototype,{url:tot,opened:tot,closed:tot,close:tot,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});ap.converters.WebSocketStreamOptions=ap.dictionaryConverter([{key:"protocols",converter:ap.sequenceConverter(ap.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:ap.nullableConverter(ap.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);ap.converters.WebSocketCloseInfo=ap.dictionaryConverter([{key:"closeCode",converter:a(t=>ap.converters["unsigned short"](t,ap.attributes.EnforceRange),"converter")},{key:"reason",converter:ap.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);ap.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?ap.converters.USVString(t):ap.converters.BufferSource(t)};L7n.exports={WebSocketStream:rot}});var Q7n=I((RZd,U7n)=>{"use strict";p();function x2s(t){return t.indexOf("\0")===-1}a(x2s,"isValidLastEventId");function w2s(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(w2s,"isASCIINumber");U7n.exports={isValidLastEventId:x2s,isASCIINumber:w2s}});var G7n=I((DZd,H7n)=>{"use strict";p();var{Transform:R2s}=require("node:stream"),{isASCIINumber:q7n,isValidLastEventId:j7n}=Q7n(),uF=[239,187,191],Sir=10,not=13,P2s=58,k2s=32,Tir=class extends R2s{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]===uF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===uF[0]&&this.buffer[1]===uF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===uF[0]&&this.buffer[1]===uF[1]&&this.buffer[2]===uF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===uF[0]&&this.buffer[1]===uF[1]&&this.buffer[2]===uF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&q7n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&j7n(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}}};H7n.exports={EventSourceStream:Tir}});var Z7n=I((OZd,J7n)=>{"use strict";p();var{pipeline:D2s}=require("node:stream"),{fetching:N2s}=hPe(),{makeRequest:M2s}=nfe(),{webidl:W_}=RA(),{EventSourceStream:O2s}=G7n(),{parseMIMEType:B2s}=sw(),{createFastMessageEvent:L2s}=Vit(),{isNetworkError:$7n}=dPe(),{kEnumerableProperty:zJ}=Po(),{environmentSettingsObject:V7n}=JS(),W7n=!1,z7n=3e3,vPe=0,Y7n=1,CPe=2,F2s="anonymous",U2s="use-credentials",pfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=vPe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),W_.util.markAsUncloneable(this);let n="EventSource constructor";W_.argumentLengthCheck(arguments,1,n),W7n||(W7n=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=W_.converters.USVString(e),r=W_.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=V7n,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=F2s;r.withCredentials===!0&&(c=U2s,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=V7n.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=M2s(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===CPe)return;this.#n=vPe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!$7n(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if($7n(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?B2s(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=Y7n,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new O2s({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(L2s(u.type,u.options))},"push")});D2s(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=N2s(e)}#u(){this.#n!==CPe&&(this.#n=vPe,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===vPe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){W_.brandCheck(this,t),this.#n!==CPe&&(this.#n=CPe,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=W_.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=W_.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=W_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},K7n={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:vPe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:Y7n,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:CPe,writable:!1}};Object.defineProperties(pfe,K7n);Object.defineProperties(pfe.prototype,K7n);Object.defineProperties(pfe.prototype,{close:zJ,onerror:zJ,onmessage:zJ,onopen:zJ,readyState:zJ,url:zJ,withCredentials:zJ});W_.converters.EventSourceInitDict=W_.dictionaryConverter([{key:"withCredentials",converter:W_.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:W_.converters.any},{key:"node",converter:W_.dictionaryConverter([{key:"reconnectionTime",converter:W_.converters["unsigned long"],defaultValue:a(()=>z7n,"defaultValue")},{key:"dispatcher",converter:W_.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);J7n.exports={EventSource:pfe,defaultReconnectionTime:z7n}});var Iir=I((FZd,An)=>{"use strict";p();var Q2s=ej(),eQn=_Re(),q2s=IJ(),j2s=X3n(),H2s=nFn(),G2s=RJ(),$2s=yrr(),V2s=hrr(),W2s=qFn(),z2s=WFn(),Y2s=KFn(),tQn=so(),oot=Po(),{InvalidArgumentError:iot}=tQn,hfe=k8n(),K2s=EJ(),J2s=nnr(),{MockCallHistory:Z2s,MockCallHistoryLog:X2s}=snr(),eDs=mnr(),tDs=unr(),rDs=P6n(),nDs=Qrr(),iDs=tit(),{getGlobalDispatcher:rQn,setGlobalDispatcher:oDs}=git(),sDs=Zde(),aDs=bnr();Object.assign(eQn.prototype,hfe);An.exports.Dispatcher=eQn;An.exports.Client=Q2s;An.exports.Pool=q2s;An.exports.BalancedPool=j2s;An.exports.RoundRobinPool=H2s;An.exports.Agent=G2s;An.exports.ProxyAgent=$2s;An.exports.Socks5ProxyAgent=V2s;An.exports.EnvHttpProxyAgent=W2s;An.exports.RetryAgent=z2s;An.exports.H2CClient=Y2s;An.exports.RetryHandler=iDs;An.exports.DecoratorHandler=sDs;An.exports.RedirectHandler=aDs;An.exports.interceptors={redirect:q6n(),responseError:H6n(),retry:$6n(),dump:W6n(),dns:J6n(),cache:h9n(),decompress:E9n(),deduplicate:S9n()};An.exports.cacheStores={MemoryCacheStore:Dnr()};var cDs=x9n();An.exports.cacheStores.SqliteCacheStore=cDs;An.exports.buildConnector=K2s;An.exports.errors=tQn;An.exports.util={parseHeaders:oot.parseHeaders,headerNameToString:oot.headerNameToString};function bPe(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 iot("invalid url");if(r!=null&&typeof r!="object")throw new iot("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new iot("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(oot.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=oot.parseURL(e);let{agent:o,dispatcher:s=rQn()}=r;if(o)throw new iot("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(bPe,"makeDispatcher");An.exports.setGlobalDispatcher=oDs;An.exports.getGlobalDispatcher=rQn;var lDs=hPe().fetch,X7n=typeof __filename<"u"?__filename:void 0;function nQn(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,nQn),!o.stack)return;let s=o.stack.split(` `).slice(1).join(` `);t.stack=r?`${r} -${s}`:o.stack}a(Kqn,"appendFetchStackTrace");yn.exports.fetch=a(function(e,r=void 0){return D5s(e,r).catch(n=>{throw Vqn?Kqn(n,Vqn):n&&typeof n=="object"&&Error.captureStackTrace(n,yn.exports.fetch),n})},"fetch");yn.exports.Headers=sZ().Headers;yn.exports.Response=qke().Response;yn.exports.Request=xfe().Request;yn.exports.FormData=yit().FormData;var{setGlobalOrigin:N5s,getGlobalOrigin:M5s}=hrr();yn.exports.setGlobalOrigin=N5s;yn.exports.getGlobalOrigin=M5s;var{CacheStorage:O5s}=kQn(),{kConstruct:B5s}=nl();yn.exports.caches=new O5s(B5s);var{deleteCookie:L5s,getCookies:F5s,getSetCookies:U5s,setCookie:Q5s,parseCookie:q5s}=HQn();yn.exports.deleteCookie=L5s;yn.exports.getCookies=F5s;yn.exports.getSetCookies=U5s;yn.exports.setCookie=Q5s;yn.exports.parseCookie=q5s;var{parseMIMEType:j5s,serializeAMimeType:H5s}=pw();yn.exports.parseMIMEType=j5s;yn.exports.serializeAMimeType=H5s;var{CloseEvent:G5s,ErrorEvent:$5s,MessageEvent:V5s}=Bot(),{WebSocket:W5s,ping:z5s}=bqn();yn.exports.WebSocket=W5s;yn.exports.CloseEvent=G5s;yn.exports.ErrorEvent=$5s;yn.exports.MessageEvent=V5s;yn.exports.ping=z5s;yn.exports.WebSocketStream=Pqn().WebSocketStream;yn.exports.WebSocketError=Dor().WebSocketError;yn.exports.request=Xke(Ffe.request);yn.exports.stream=Xke(Ffe.stream);yn.exports.pipeline=Xke(Ffe.pipeline);yn.exports.connect=Xke(Ffe.connect);yn.exports.upgrade=Xke(Ffe.upgrade);yn.exports.MockClient=_5s;yn.exports.MockCallHistory=C5s;yn.exports.MockCallHistoryLog=v5s;yn.exports.MockPool=S5s;yn.exports.MockAgent=b5s;yn.exports.SnapshotAgent=T5s;yn.exports.mockErrors=I5s;var{EventSource:Y5s}=$qn();yn.exports.EventSource=Y5s;function K5s(){globalThis.fetch=yn.exports.fetch,globalThis.Headers=yn.exports.Headers,globalThis.Response=yn.exports.Response,globalThis.Request=yn.exports.Request,globalThis.FormData=yn.exports.FormData,globalThis.WebSocket=yn.exports.WebSocket,globalThis.CloseEvent=yn.exports.CloseEvent,globalThis.ErrorEvent=yn.exports.ErrorEvent,globalThis.MessageEvent=yn.exports.MessageEvent,globalThis.EventSource=yn.exports.EventSource}a(K5s,"install");yn.exports.install=K5s});var kPe=I(oc=>{"use strict";p();Object.defineProperty(oc,"__esModule",{value:!0});oc.regexpCode=oc.getEsmExportName=oc.getProperty=oc.safeStringify=oc.stringify=oc.strConcat=oc.addCodeArg=oc.str=oc._=oc.nil=oc._Code=oc.Name=oc.IDENTIFIER=oc._CodeOrName=void 0;var wPe=class{static{a(this,"_CodeOrName")}};oc._CodeOrName=wPe;oc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var IZ=class extends wPe{static{a(this,"Name")}constructor(e){if(super(),!oc.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}}};oc.Name=IZ;var xw=class extends wPe{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 IZ&&(r[n.str]=(r[n.str]||0)+1),r),{})}};oc._Code=xw;oc.nil=new xw("");function Wjn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(cb,"__esModule",{value:!0});cb.ValueScope=cb.ValueScopeName=cb.Scope=cb.varKinds=cb.UsedValueState=void 0;var ab=kPe(),Psr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},_st;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(_st||(cb.UsedValueState=_st={}));cb.varKinds={const:new ab.Name("const"),let:new ab.Name("let"),var:new ab.Name("var")};var Cst=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ab.Name?e:this.name(e)}name(e){return new ab.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}}};cb.Scope=Cst;var vst=class extends ab.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,ab._)`.${new ab.Name(r)}[${n}]`}};cb.ValueScopeName=vst;var ELs=(0,ab._)`\n`,Dsr=class extends Cst{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ELs:ab.nil}}get(){return this._scope}name(e){return new vst(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,ab._)`${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=ab.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,_st.Started);let f=r(d);if(f){let h=this.opts.es5?cb.varKinds.var:cb.varKinds.const;s=(0,ab._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,ab._)`${s}${f}${this.opts._n}`;else throw new Psr(d);u.set(d,_st.Completed)})}return s}};cb.ValueScope=Dsr});var hs=I(xs=>{"use strict";p();Object.defineProperty(xs,"__esModule",{value:!0});xs.or=xs.and=xs.not=xs.CodeGen=xs.operators=xs.varKinds=xs.ValueScopeName=xs.ValueScope=xs.Scope=xs.Name=xs.regexpCode=xs.stringify=xs.getProperty=xs.nil=xs.strConcat=xs.str=xs._=void 0;var Pa=kPe(),o2=Nsr(),Fj=kPe();Object.defineProperty(xs,"_",{enumerable:!0,get:a(function(){return Fj._},"get")});Object.defineProperty(xs,"str",{enumerable:!0,get:a(function(){return Fj.str},"get")});Object.defineProperty(xs,"strConcat",{enumerable:!0,get:a(function(){return Fj.strConcat},"get")});Object.defineProperty(xs,"nil",{enumerable:!0,get:a(function(){return Fj.nil},"get")});Object.defineProperty(xs,"getProperty",{enumerable:!0,get:a(function(){return Fj.getProperty},"get")});Object.defineProperty(xs,"stringify",{enumerable:!0,get:a(function(){return Fj.stringify},"get")});Object.defineProperty(xs,"regexpCode",{enumerable:!0,get:a(function(){return Fj.regexpCode},"get")});Object.defineProperty(xs,"Name",{enumerable:!0,get:a(function(){return Fj.Name},"get")});var Ist=Nsr();Object.defineProperty(xs,"Scope",{enumerable:!0,get:a(function(){return Ist.Scope},"get")});Object.defineProperty(xs,"ValueScope",{enumerable:!0,get:a(function(){return Ist.ValueScope},"get")});Object.defineProperty(xs,"ValueScopeName",{enumerable:!0,get:a(function(){return Ist.ValueScopeName},"get")});Object.defineProperty(xs,"varKinds",{enumerable:!0,get:a(function(){return Ist.varKinds},"get")});xs.operators={GT:new Pa._Code(">"),GTE:new Pa._Code(">="),LT:new Pa._Code("<"),LTE:new Pa._Code("<="),EQ:new Pa._Code("==="),NEQ:new Pa._Code("!=="),NOT:new Pa._Code("!"),OR:new Pa._Code("||"),AND:new Pa._Code("&&"),ADD:new Pa._Code("+")};var PF=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},Msr=class extends PF{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?o2.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=$fe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Pa._CodeOrName?this.rhs.names:{}}},bst=class extends PF{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 Pa.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=$fe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Pa.Name?{}:{...this.lhs.names};return Tst(e,this.rhs)}},Osr=class extends bst{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}},Bsr=class extends PF{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Lsr=class extends PF{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Fsr=class extends PF{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Usr=class extends PF{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=$fe(this.code,e,r),this}get names(){return this.code instanceof Pa._CodeOrName?this.code.names:{}}},PPe=class extends PF{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)||(_Ls(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>RZ(e,r.names),{})}},DF=class extends PPe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qsr=class extends PPe{static{a(this,"Root")}},Gfe=class extends DF{static{a(this,"Else")}};Gfe.kind="else";var xZ=class t extends DF{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 Gfe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Yjn(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=$fe(this.condition,e,r),this}get names(){let e=super.names;return Tst(e,this.condition),this.else&&RZ(e,this.else.names),e}};xZ.kind="if";var wZ=class extends DF{static{a(this,"For")}};wZ.kind="for";var qsr=class extends wZ{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=$fe(this.iteration,e,r),this}get names(){return RZ(super.names,this.iteration.names)}},jsr=class extends wZ{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?o2.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=Tst(super.names,this.from);return Tst(e,this.to)}},Sst=class extends wZ{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=$fe(this.iterable,e,r),this}get names(){return RZ(super.names,this.iterable.names)}},DPe=class extends DF{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)}};DPe.kind="func";var NPe=class extends PPe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};NPe.kind="return";var Hsr=class extends DF{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&&RZ(e,this.catch.names),this.finally&&RZ(e,this.finally.names),e}},MPe=class extends DF{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};MPe.kind="catch";var OPe=class extends DF{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};OPe.kind="finally";var Gsr=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 o2.Scope({parent:e}),this._nodes=[new Qsr]}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 Msr(e,s,n)),s}const(e,r,n){return this._def(o2.varKinds.const,e,r,n)}let(e,r,n){return this._def(o2.varKinds.let,e,r,n)}var(e,r,n){return this._def(o2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new bst(e,r,n))}add(e,r){return this._leafNode(new Osr(e,xs.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Pa.nil&&this._leafNode(new Usr(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,Pa.addCodeArg)(r,o));return r.push("}"),new Pa._Code(r)}if(e,r,n){if(this._blockNode(new xZ(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 xZ(e))}else(){return this._elseNode(new Gfe)}endIf(){return this._endBlockNode(xZ,Gfe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new qsr(e),r)}forRange(e,r,n,o,s=this.opts.es5?o2.varKinds.var:o2.varKinds.let){let c=this._scope.toName(e);return this._for(new jsr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=o2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Pa.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Pa._)`${c}.length`,l=>{this.var(s,(0,Pa._)`${c}[${l}]`),n(s)})}return this._for(new Sst("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?o2.varKinds.var:o2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Pa._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Sst("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(wZ)}label(e){return this._leafNode(new Bsr(e))}break(e){return this._leafNode(new Lsr(e))}return(e){let r=new NPe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(NPe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Hsr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new MPe(s),r(s)}return n&&(this._currNode=o.finally=new OPe,this.code(n)),this._endBlockNode(MPe,OPe)}throw(e){return this._leafNode(new Fsr(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=Pa.nil,n,o){return this._blockNode(new DPe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(DPe)}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 xZ))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}};xs.CodeGen=Gsr;function RZ(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(RZ,"addNames");function Tst(t,e){return e instanceof Pa._CodeOrName?RZ(t,e.names):t}a(Tst,"addExprNames");function $fe(t,e,r){if(t instanceof Pa.Name)return n(t);if(!o(t))return t;return new Pa._Code(t._items.reduce((s,c)=>(c instanceof Pa.Name&&(c=n(c)),c instanceof Pa._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 Pa._Code&&s._items.some(c=>c instanceof Pa.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a($fe,"optimizeExpr");function _Ls(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(_Ls,"subtractNames");function Yjn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Pa._)`!${$sr(t)}`}a(Yjn,"not");xs.not=Yjn;var CLs=Kjn(xs.operators.AND);function vLs(...t){return t.reduce(CLs)}a(vLs,"and");xs.and=vLs;var bLs=Kjn(xs.operators.OR);function SLs(...t){return t.reduce(bLs)}a(SLs,"or");xs.or=SLs;function Kjn(t){return(e,r)=>e===Pa.nil?r:r===Pa.nil?e:(0,Pa._)`${$sr(e)} ${t} ${$sr(r)}`}a(Kjn,"mappend");function $sr(t){return t instanceof Pa.Name?t:(0,Pa._)`(${t})`}a($sr,"par")});var za=I(Fs=>{"use strict";p();Object.defineProperty(Fs,"__esModule",{value:!0});Fs.checkStrictMode=Fs.getErrorPath=Fs.Type=Fs.useFunc=Fs.setEvaluated=Fs.evaluatedPropsToName=Fs.mergeEvaluated=Fs.eachItem=Fs.unescapeJsonPointer=Fs.escapeJsonPointer=Fs.escapeFragment=Fs.unescapeFragment=Fs.schemaRefOrVal=Fs.schemaHasRulesButRef=Fs.schemaHasRules=Fs.checkUnknownRules=Fs.alwaysValidSchema=Fs.toHash=void 0;var Gl=hs(),TLs=kPe();function ILs(t){let e={};for(let r of t)e[r]=!0;return e}a(ILs,"toHash");Fs.toHash=ILs;function xLs(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Xjn(t,e),!eHn(e,t.self.RULES.all))}a(xLs,"alwaysValidSchema");Fs.alwaysValidSchema=xLs;function Xjn(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]||nHn(t,`unknown keyword: "${s}"`)}a(Xjn,"checkUnknownRules");Fs.checkUnknownRules=Xjn;function eHn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(eHn,"schemaHasRules");Fs.schemaHasRules=eHn;function wLs(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(wLs,"schemaHasRulesButRef");Fs.schemaHasRulesButRef=wLs;function RLs({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Gl._)`${r}`}return(0,Gl._)`${t}${e}${(0,Gl.getProperty)(n)}`}a(RLs,"schemaRefOrVal");Fs.schemaRefOrVal=RLs;function kLs(t){return tHn(decodeURIComponent(t))}a(kLs,"unescapeFragment");Fs.unescapeFragment=kLs;function PLs(t){return encodeURIComponent(Wsr(t))}a(PLs,"escapeFragment");Fs.escapeFragment=PLs;function Wsr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Wsr,"escapeJsonPointer");Fs.escapeJsonPointer=Wsr;function tHn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(tHn,"unescapeJsonPointer");Fs.unescapeJsonPointer=tHn;function DLs(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(DLs,"eachItem");Fs.eachItem=DLs;function Jjn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Gl.Name?(s instanceof Gl.Name?t(o,s,c):e(o,s,c),c):s instanceof Gl.Name?(e(o,c,s),s):r(s,c);return l===Gl.Name&&!(u instanceof Gl.Name)?n(o,u):u}}a(Jjn,"makeMergeEvaluated");Fs.mergeEvaluated={props:Jjn({mergeNames:a((t,e,r)=>t.if((0,Gl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Gl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Gl._)`${r} || {}`).code((0,Gl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Gl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Gl._)`${r} || {}`),zsr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:rHn}),items:Jjn({mergeNames:a((t,e,r)=>t.if((0,Gl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Gl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Gl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Gl._)`${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 rHn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Gl._)`{}`);return e!==void 0&&zsr(t,r,e),r}a(rHn,"evaluatedPropsToName");Fs.evaluatedPropsToName=rHn;function zsr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Gl._)`${e}${(0,Gl.getProperty)(n)}`,!0))}a(zsr,"setEvaluated");Fs.setEvaluated=zsr;var Zjn={};function NLs(t,e){return t.scopeValue("func",{ref:e,code:Zjn[e.code]||(Zjn[e.code]=new TLs._Code(e.code))})}a(NLs,"useFunc");Fs.useFunc=NLs;var Vsr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Vsr||(Fs.Type=Vsr={}));function MLs(t,e,r){if(t instanceof Gl.Name){let n=e===Vsr.Num;return r?n?(0,Gl._)`"[" + ${t} + "]"`:(0,Gl._)`"['" + ${t} + "']"`:n?(0,Gl._)`"/" + ${t}`:(0,Gl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Gl.getProperty)(t).toString():"/"+Wsr(t)}a(MLs,"getErrorPath");Fs.getErrorPath=MLs;function nHn(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(nHn,"checkStrictMode");Fs.checkStrictMode=nHn});var NF=I(Ysr=>{"use strict";p();Object.defineProperty(Ysr,"__esModule",{value:!0});var aE=hs(),OLs={data:new aE.Name("data"),valCxt:new aE.Name("valCxt"),instancePath:new aE.Name("instancePath"),parentData:new aE.Name("parentData"),parentDataProperty:new aE.Name("parentDataProperty"),rootData:new aE.Name("rootData"),dynamicAnchors:new aE.Name("dynamicAnchors"),vErrors:new aE.Name("vErrors"),errors:new aE.Name("errors"),this:new aE.Name("this"),self:new aE.Name("self"),scope:new aE.Name("scope"),json:new aE.Name("json"),jsonPos:new aE.Name("jsonPos"),jsonLen:new aE.Name("jsonLen"),jsonPart:new aE.Name("jsonPart")};Ysr.default=OLs});var BPe=I(cE=>{"use strict";p();Object.defineProperty(cE,"__esModule",{value:!0});cE.extendErrors=cE.resetErrorsCount=cE.reportExtraError=cE.reportError=cE.keyword$DataError=cE.keywordError=void 0;var Ya=hs(),xst=za(),J_=NF();cE.keywordError={message:a(({keyword:t})=>(0,Ya.str)`must pass "${t}" keyword validation`,"message")};cE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Ya.str)`"${t}" keyword must be ${e} ($data)`:(0,Ya.str)`"${t}" keyword is invalid ($data)`,"message")};function BLs(t,e=cE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=sHn(t,e,r);n??(c||l)?iHn(s,u):oHn(o,(0,Ya._)`[${u}]`)}a(BLs,"reportError");cE.reportError=BLs;function LLs(t,e=cE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=sHn(t,e,r);iHn(o,l),s||c||oHn(n,J_.default.vErrors)}a(LLs,"reportExtraError");cE.reportExtraError=LLs;function FLs(t,e){t.assign(J_.default.errors,e),t.if((0,Ya._)`${J_.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ya._)`${J_.default.vErrors}.length`,e),()=>t.assign(J_.default.vErrors,null)))}a(FLs,"resetErrorsCount");cE.resetErrorsCount=FLs;function ULs({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,J_.default.errors,l=>{t.const(c,(0,Ya._)`${J_.default.vErrors}[${l}]`),t.if((0,Ya._)`${c}.instancePath === undefined`,()=>t.assign((0,Ya._)`${c}.instancePath`,(0,Ya.strConcat)(J_.default.instancePath,s.errorPath))),t.assign((0,Ya._)`${c}.schemaPath`,(0,Ya.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ya._)`${c}.schema`,r),t.assign((0,Ya._)`${c}.data`,n))})}a(ULs,"extendErrors");cE.extendErrors=ULs;function iHn(t,e){let r=t.const("err",e);t.if((0,Ya._)`${J_.default.vErrors} === null`,()=>t.assign(J_.default.vErrors,(0,Ya._)`[${r}]`),(0,Ya._)`${J_.default.vErrors}.push(${r})`),t.code((0,Ya._)`${J_.default.errors}++`)}a(iHn,"addError");function oHn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Ya._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ya._)`${n}.errors`,e),r.return(!1))}a(oHn,"returnErrors");var kZ={keyword:new Ya.Name("keyword"),schemaPath:new Ya.Name("schemaPath"),params:new Ya.Name("params"),propertyName:new Ya.Name("propertyName"),message:new Ya.Name("message"),schema:new Ya.Name("schema"),parentSchema:new Ya.Name("parentSchema")};function sHn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ya._)`{}`:QLs(t,e,r)}a(sHn,"errorObjectCode");function QLs(t,e,r={}){let{gen:n,it:o}=t,s=[qLs(o,r),jLs(t,r)];return HLs(t,e,s),n.object(...s)}a(QLs,"errorObject");function qLs({errorPath:t},{instancePath:e}){let r=e?(0,Ya.str)`${t}${(0,xst.getErrorPath)(e,xst.Type.Str)}`:t;return[J_.default.instancePath,(0,Ya.strConcat)(J_.default.instancePath,r)]}a(qLs,"errorInstancePath");function jLs({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Ya.str)`${e}/${t}`;return r&&(o=(0,Ya.str)`${o}${(0,xst.getErrorPath)(r,xst.Type.Str)}`),[kZ.schemaPath,o]}a(jLs,"errorSchemaPath");function HLs(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([kZ.keyword,o],[kZ.params,typeof e=="function"?e(t):e||(0,Ya._)`{}`]),u.messages&&n.push([kZ.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([kZ.schema,c],[kZ.parentSchema,(0,Ya._)`${f}${h}`],[J_.default.data,s]),d&&n.push([kZ.propertyName,d])}a(HLs,"extraErrorProps")});var cHn=I(Vfe=>{"use strict";p();Object.defineProperty(Vfe,"__esModule",{value:!0});Vfe.boolOrEmptySchema=Vfe.topBoolOrEmptySchema=void 0;var GLs=BPe(),$Ls=hs(),VLs=NF(),WLs={message:"boolean schema is false"};function zLs(t){let{gen:e,schema:r,validateName:n}=t;r===!1?aHn(t,!1):typeof r=="object"&&r.$async===!0?e.return(VLs.default.data):(e.assign((0,$Ls._)`${n}.errors`,null),e.return(!0))}a(zLs,"topBoolOrEmptySchema");Vfe.topBoolOrEmptySchema=zLs;function YLs(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),aHn(t)):r.var(e,!0)}a(YLs,"boolOrEmptySchema");Vfe.boolOrEmptySchema=YLs;function aHn(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,GLs.reportError)(o,WLs,void 0,e)}a(aHn,"falseSchemaError")});var Ksr=I(Wfe=>{"use strict";p();Object.defineProperty(Wfe,"__esModule",{value:!0});Wfe.getRules=Wfe.isJSONType=void 0;var KLs=["string","number","integer","boolean","null","object","array"],JLs=new Set(KLs);function ZLs(t){return typeof t=="string"&&JLs.has(t)}a(ZLs,"isJSONType");Wfe.isJSONType=ZLs;function XLs(){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(XLs,"getRules");Wfe.getRules=XLs});var Jsr=I(Uj=>{"use strict";p();Object.defineProperty(Uj,"__esModule",{value:!0});Uj.shouldUseRule=Uj.shouldUseGroup=Uj.schemaHasRulesForType=void 0;function e3s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&lHn(t,n)}a(e3s,"schemaHasRulesForType");Uj.schemaHasRulesForType=e3s;function lHn(t,e){return e.rules.some(r=>uHn(t,r))}a(lHn,"shouldUseGroup");Uj.shouldUseGroup=lHn;function uHn(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(uHn,"shouldUseRule");Uj.shouldUseRule=uHn});var LPe=I(lE=>{"use strict";p();Object.defineProperty(lE,"__esModule",{value:!0});lE.reportTypeError=lE.checkDataTypes=lE.checkDataType=lE.coerceAndCheckDataType=lE.getJSONTypes=lE.getSchemaTypes=lE.DataType=void 0;var t3s=Ksr(),r3s=Jsr(),n3s=BPe(),ns=hs(),dHn=za(),zfe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(zfe||(lE.DataType=zfe={}));function i3s(t){let e=fHn(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(i3s,"getSchemaTypes");lE.getSchemaTypes=i3s;function fHn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(t3s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(fHn,"getJSONTypes");lE.getJSONTypes=fHn;function o3s(t,e){let{gen:r,data:n,opts:o}=t,s=s3s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,r3s.schemaHasRulesForType)(t,e[0]));if(c){let l=Xsr(e,n,o.strictNumbers,zfe.Wrong);r.if(l,()=>{s.length?a3s(t,e,s):ear(t)})}return c}a(o3s,"coerceAndCheckDataType");lE.coerceAndCheckDataType=o3s;var pHn=new Set(["string","number","integer","boolean","null"]);function s3s(t,e){return e?t.filter(r=>pHn.has(r)||e==="array"&&r==="array"):[]}a(s3s,"coerceToTypes");function a3s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,ns._)`typeof ${o}`),l=n.let("coerced",(0,ns._)`undefined`);s.coerceTypes==="array"&&n.if((0,ns._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,ns._)`${o}[0]`).assign(c,(0,ns._)`typeof ${o}`).if(Xsr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,ns._)`${l} !== undefined`);for(let d of r)(pHn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),ear(t),n.endIf(),n.if((0,ns._)`${l} !== undefined`,()=>{n.assign(o,l),c3s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,ns._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,ns._)`"" + ${o}`).elseIf((0,ns._)`${o} === null`).assign(l,(0,ns._)`""`);return;case"number":n.elseIf((0,ns._)`${c} == "boolean" || ${o} === null - || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,ns._)`+${o}`);return;case"integer":n.elseIf((0,ns._)`${c} === "boolean" || ${o} === null - || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,ns._)`+${o}`);return;case"boolean":n.elseIf((0,ns._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,ns._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,ns._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,ns._)`${c} === "string" || ${c} === "number" - || ${c} === "boolean" || ${o} === null`).assign(l,(0,ns._)`[${o}]`)}}a(u,"coerceSpecificType")}a(a3s,"coerceData");function c3s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ns._)`${e} !== undefined`,()=>t.assign((0,ns._)`${e}[${r}]`,n))}a(c3s,"assignParentData");function Zsr(t,e,r,n=zfe.Correct){let o=n===zfe.Correct?ns.operators.EQ:ns.operators.NEQ,s;switch(t){case"null":return(0,ns._)`${e} ${o} null`;case"array":s=(0,ns._)`Array.isArray(${e})`;break;case"object":s=(0,ns._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,ns._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,ns._)`typeof ${e} ${o} ${t}`}return n===zfe.Correct?s:(0,ns.not)(s);function c(l=ns.nil){return(0,ns.and)((0,ns._)`typeof ${e} == "number"`,l,r?(0,ns._)`isFinite(${e})`:ns.nil)}}a(Zsr,"checkDataType");lE.checkDataType=Zsr;function Xsr(t,e,r,n){if(t.length===1)return Zsr(t[0],e,r,n);let o,s=(0,dHn.toHash)(t);if(s.array&&s.object){let c=(0,ns._)`typeof ${e} != "object"`;o=s.null?c:(0,ns._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=ns.nil;s.number&&delete s.integer;for(let c in s)o=(0,ns.and)(o,Zsr(c,e,r,n));return o}a(Xsr,"checkDataTypes");lE.checkDataTypes=Xsr;var l3s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,ns._)`{type: ${t}}`:(0,ns._)`{type: ${e}}`,"params")};function ear(t){let e=u3s(t);(0,n3s.reportError)(e,l3s)}a(ear,"reportTypeError");lE.reportTypeError=ear;function u3s(t){let{gen:e,data:r,schema:n}=t,o=(0,dHn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(u3s,"getTypeErrorContext")});var mHn=I(wst=>{"use strict";p();Object.defineProperty(wst,"__esModule",{value:!0});wst.assignDefaults=void 0;var Yfe=hs(),d3s=za();function f3s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)hHn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>hHn(t,s,o.default))}a(f3s,"assignDefaults");wst.assignDefaults=f3s;function hHn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,Yfe._)`${s}${(0,Yfe.getProperty)(e)}`;if(o){(0,d3s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,Yfe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,Yfe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,Yfe._)`${l} = ${(0,Yfe.stringify)(r)}`)}a(hHn,"assignDefault")});var ww=I(Sl=>{"use strict";p();Object.defineProperty(Sl,"__esModule",{value:!0});Sl.validateUnion=Sl.validateArray=Sl.usePattern=Sl.callValidateCode=Sl.schemaProperties=Sl.allSchemaProperties=Sl.noPropertyInData=Sl.propertyInData=Sl.isOwnProperty=Sl.hasPropFunc=Sl.reportMissingProp=Sl.checkMissingProp=Sl.checkReportMissingProp=void 0;var id=hs(),tar=za(),Qj=NF(),p3s=za();function h3s(t,e){let{gen:r,data:n,it:o}=t;r.if(nar(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,id._)`${e}`},!0),t.error()})}a(h3s,"checkReportMissingProp");Sl.checkReportMissingProp=h3s;function m3s({gen:t,data:e,it:{opts:r}},n,o){return(0,id.or)(...n.map(s=>(0,id.and)(nar(t,e,s,r.ownProperties),(0,id._)`${o} = ${s}`)))}a(m3s,"checkMissingProp");Sl.checkMissingProp=m3s;function g3s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(g3s,"reportMissingProp");Sl.reportMissingProp=g3s;function gHn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,id._)`Object.prototype.hasOwnProperty`})}a(gHn,"hasPropFunc");Sl.hasPropFunc=gHn;function rar(t,e,r){return(0,id._)`${gHn(t)}.call(${e}, ${r})`}a(rar,"isOwnProperty");Sl.isOwnProperty=rar;function A3s(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} !== undefined`;return n?(0,id._)`${o} && ${rar(t,e,r)}`:o}a(A3s,"propertyInData");Sl.propertyInData=A3s;function nar(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} === undefined`;return n?(0,id.or)(o,(0,id.not)(rar(t,e,r))):o}a(nar,"noPropertyInData");Sl.noPropertyInData=nar;function AHn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(AHn,"allSchemaProperties");Sl.allSchemaProperties=AHn;function y3s(t,e){return AHn(e).filter(r=>!(0,tar.alwaysValidSchema)(t,e[r]))}a(y3s,"schemaProperties");Sl.schemaProperties=y3s;function E3s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,id._)`${t}, ${e}, ${n}${o}`:e,h=[[Qj.default.instancePath,(0,id.strConcat)(Qj.default.instancePath,s)],[Qj.default.parentData,c.parentData],[Qj.default.parentDataProperty,c.parentDataProperty],[Qj.default.rootData,Qj.default.rootData]];c.opts.dynamicRef&&h.push([Qj.default.dynamicAnchors,Qj.default.dynamicAnchors]);let m=(0,id._)`${f}, ${r.object(...h)}`;return u!==id.nil?(0,id._)`${l}.call(${u}, ${m})`:(0,id._)`${l}(${m})`}a(E3s,"callValidateCode");Sl.callValidateCode=E3s;var _3s=(0,id._)`new RegExp`;function C3s({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,id._)`${o.code==="new RegExp"?_3s:(0,p3s.useFunc)(t,o)}(${r}, ${n})`})}a(C3s,"usePattern");Sl.usePattern=C3s;function v3s(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,id._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:tar.Type.Num},s),e.if((0,id.not)(s),l)})}a(c,"validateItems")}a(v3s,"validateArray");Sl.validateArray=v3s;function b3s(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,tar.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,id._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,id.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(b3s,"validateUnion");Sl.validateUnion=b3s});var _Hn=I(h5=>{"use strict";p();Object.defineProperty(h5,"__esModule",{value:!0});h5.validateKeywordUsage=h5.validSchemaType=h5.funcKeywordCode=h5.macroKeywordCode=void 0;var Z_=hs(),PZ=NF(),S3s=ww(),T3s=BPe();function I3s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=EHn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Z_.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(I3s,"macroKeywordCode");h5.macroKeywordCode=I3s;function x3s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;R3s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=EHn(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&&yHn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&yHn(t),E(()=>w3s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,Z_._)`await `),v=>n.assign(h,!1).if((0,Z_._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,Z_._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,Z_._)`${f}.errors`;return n.assign(_,null),y(Z_.nil),_}a(A,"validateSync");function y(_=e.async?(0,Z_._)`await `:Z_.nil){let v=u.opts.passContext?PZ.default.this:PZ.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Z_._)`${_}${(0,S3s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,Z_.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(x3s,"funcKeywordCode");h5.funcKeywordCode=x3s;function yHn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Z_._)`${n.parentData}[${n.parentDataProperty}]`))}a(yHn,"modifyData");function w3s(t,e){let{gen:r}=t;r.if((0,Z_._)`Array.isArray(${e})`,()=>{r.assign(PZ.default.vErrors,(0,Z_._)`${PZ.default.vErrors} === null ? ${e} : ${PZ.default.vErrors}.concat(${e})`).assign(PZ.default.errors,(0,Z_._)`${PZ.default.vErrors}.length`),(0,T3s.extendErrors)(t)},()=>t.error())}a(w3s,"addErrs");function R3s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(R3s,"checkAsyncKeyword");function EHn(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,Z_.stringify)(r)})}a(EHn,"useKeyword");function k3s(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(k3s,"validSchemaType");h5.validSchemaType=k3s;function P3s({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(P3s,"validateKeywordUsage");h5.validateKeywordUsage=P3s});var vHn=I(qj=>{"use strict";p();Object.defineProperty(qj,"__esModule",{value:!0});qj.extendSubschemaMode=qj.extendSubschemaData=qj.getSubschema=void 0;var m5=hs(),CHn=za();function D3s(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,m5._)`${t.schemaPath}${(0,m5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,m5._)`${t.schemaPath}${(0,m5.getProperty)(e)}${(0,m5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,CHn.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(D3s,"getSubschema");qj.getSubschema=D3s;function N3s(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,m5._)`${e.data}${(0,m5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,m5.str)`${d}${(0,CHn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,m5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof m5.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(N3s,"extendSubschemaData");qj.extendSubschemaData=N3s;function M3s(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(M3s,"extendSubschemaMode");qj.extendSubschemaMode=M3s});var iar=I((kpf,bHn)=>{"use strict";p();bHn.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 THn=I((Npf,SHn)=>{"use strict";p();var jj=SHn.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(){};Rst(e,n,o,t,"",t)};jj.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};jj.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};jj.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};jj.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 Rst(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 jj.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(lb,"__esModule",{value:!0});lb.getSchemaRefs=lb.resolveUrl=lb.normalizeId=lb._getFullPath=lb.getFullPath=lb.inlineRef=void 0;var B3s=za(),L3s=iar(),F3s=THn(),U3s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Q3s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!oar(t):e?IHn(t)<=e:!1}a(Q3s,"inlineRef");lb.inlineRef=Q3s;var q3s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function oar(t){for(let e in t){if(q3s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(oar)||typeof r=="object"&&oar(r))return!0}return!1}a(oar,"hasRef");function IHn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!U3s.has(r)&&(typeof t[r]=="object"&&(0,B3s.eachItem)(t[r],n=>e+=IHn(n)),e===1/0))return 1/0}return e}a(IHn,"countKeys");function xHn(t,e="",r){r!==!1&&(e=Kfe(e));let n=t.parse(e);return wHn(t,n)}a(xHn,"getFullPath");lb.getFullPath=xHn;function wHn(t,e){return t.serialize(e).split("#")[0]+"#"}a(wHn,"_getFullPath");lb._getFullPath=wHn;var j3s=/#\/?$/;function Kfe(t){return t?t.replace(j3s,""):""}a(Kfe,"normalizeId");lb.normalizeId=Kfe;function H3s(t,e,r){return r=Kfe(r),t.resolve(e,r)}a(H3s,"resolveUrl");lb.resolveUrl=H3s;var G3s=/^[a-z_][-a-z0-9._]*$/i;function $3s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Kfe(t[r]||e),s={"":o},c=xHn(n,o,!1),l={},u=new Set;return F3s(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=Kfe(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!==Kfe(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(!G3s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!L3s(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($3s,"getSchemaRefs");lb.getSchemaRefs=$3s});var qPe=I(Hj=>{"use strict";p();Object.defineProperty(Hj,"__esModule",{value:!0});Hj.getData=Hj.KeywordCxt=Hj.validateFunctionCode=void 0;var NHn=cHn(),RHn=LPe(),aar=Jsr(),kst=LPe(),V3s=mHn(),QPe=_Hn(),sar=vHn(),ni=hs(),po=NF(),W3s=FPe(),MF=za(),UPe=BPe();function z3s(t){if(BHn(t)&&(LHn(t),OHn(t))){J3s(t);return}MHn(t,()=>(0,NHn.topBoolOrEmptySchema)(t))}a(z3s,"validateFunctionCode");Hj.validateFunctionCode=z3s;function MHn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ni._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,ni._)`"use strict"; ${kHn(r,o)}`),K3s(t,o),t.code(s)}):t.func(e,(0,ni._)`${po.default.data}, ${Y3s(o)}`,n.$async,()=>t.code(kHn(r,o)).code(s))}a(MHn,"validateFunction");function Y3s(t){return(0,ni._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,ni._)`, ${po.default.dynamicAnchors}={}`:ni.nil}}={}`}a(Y3s,"destructureValCxt");function K3s(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,ni._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,ni._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,ni._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,ni._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ni._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,ni._)`""`),t.var(po.default.parentData,(0,ni._)`undefined`),t.var(po.default.parentDataProperty,(0,ni._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ni._)`{}`)})}a(K3s,"destructureValCxtES5");function J3s(t){let{schema:e,opts:r,gen:n}=t;MHn(t,()=>{r.$comment&&e.$comment&&UHn(t),rFs(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&Z3s(t),FHn(t),oFs(t)})}a(J3s,"topSchemaObjCode");function Z3s(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ni._)`${r}.evaluated`),e.if((0,ni._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ni._)`${t.evaluated}.props`,(0,ni._)`undefined`)),e.if((0,ni._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ni._)`${t.evaluated}.items`,(0,ni._)`undefined`))}a(Z3s,"resetEvaluated");function kHn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ni._)`/*# sourceURL=${r} */`:ni.nil}a(kHn,"funcSourceUrl");function X3s(t,e){if(BHn(t)&&(LHn(t),OHn(t))){eFs(t,e);return}(0,NHn.boolOrEmptySchema)(t,e)}a(X3s,"subschemaCode");function OHn({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(OHn,"schemaCxtHasRules");function BHn(t){return typeof t.schema!="boolean"}a(BHn,"isSchemaObj");function eFs(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&UHn(t),nFs(t),iFs(t);let s=n.const("_errs",po.default.errors);FHn(t,s),n.var(e,(0,ni._)`${s} === ${po.default.errors}`)}a(eFs,"subSchemaObjCode");function LHn(t){(0,MF.checkUnknownRules)(t),tFs(t)}a(LHn,"checkKeywords");function FHn(t,e){if(t.opts.jtd)return PHn(t,[],!1,e);let r=(0,RHn.getSchemaTypes)(t.schema),n=(0,RHn.coerceAndCheckDataType)(t,r);PHn(t,r,!n,e)}a(FHn,"typeAndKeywords");function tFs(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,MF.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(tFs,"checkRefsAndKeywords");function rFs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,MF.checkStrictMode)(t,"default is ignored in the schema root")}a(rFs,"checkNoDefault");function nFs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,W3s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(nFs,"updateContext");function iFs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(iFs,"checkAsyncSchema");function UHn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ni._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,ni.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ni._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(UHn,"commentKeyword");function oFs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ni._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,ni._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,ni._)`${n}.errors`,po.default.vErrors),s.unevaluated&&sFs(t),e.return((0,ni._)`${po.default.errors} === 0`))}a(oFs,"returnResults");function sFs({gen:t,evaluated:e,props:r,items:n}){r instanceof ni.Name&&t.assign((0,ni._)`${e}.props`,r),n instanceof ni.Name&&t.assign((0,ni._)`${e}.items`,n)}a(sFs,"assignEvaluated");function PHn(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,MF.schemaHasRulesButRef)(s,f))){o.block(()=>qHn(t,"$ref",f.all.$ref.definition));return}u.jtd||aFs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,aar.shouldUseGroup)(s,m)&&(m.type?(o.if((0,kst.checkDataType)(m.type,c,u.strictNumbers)),DHn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,kst.reportTypeError)(t)),o.endIf()):DHn(t,m),l||o.if((0,ni._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(PHn,"schemaKeywords");function DHn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,V3s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,aar.shouldUseRule)(n,s)&&qHn(t,s.keyword,s.definition,e.type)})}a(DHn,"iterateKeywords");function aFs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(cFs(t,e),t.opts.allowUnionTypes||lFs(t,e),uFs(t,t.dataTypes))}a(aFs,"checkStrictTypes");function cFs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{QHn(t.dataTypes,r)||car(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),fFs(t,e)}}a(cFs,"checkContextTypes");function lFs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&car(t,"use allowUnionTypes to allow union type keyword")}a(lFs,"checkMultipleTypes");function uFs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,aar.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>dFs(e,c))&&car(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(uFs,"checkKeywordTypes");function dFs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(dFs,"hasApplicableType");function QHn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(QHn,"includesType");function fFs(t,e){let r=[];for(let n of t.dataTypes)QHn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(fFs,"narrowSchemaTypes");function car(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,MF.checkStrictMode)(t,e,t.opts.strictTypes)}a(car,"strictTypesError");var Pst=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,QPe.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,MF.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",jHn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,QPe.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,ni.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,ni.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,ni._)`${r} !== undefined && (${(0,ni.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?UPe.reportExtraError:UPe.reportError)(this,this.def.error,r)}$dataError(){(0,UPe.reportError)(this,this.def.$dataError||UPe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,UPe.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=ni.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ni.nil,r=ni.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,ni.or)((0,ni._)`${o} === undefined`,r)),e!==ni.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ni.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,ni.or)(c(),l());function c(){if(n.length){if(!(r instanceof ni.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,ni._)`${(0,kst.checkDataTypes)(u,r,s.opts.strictNumbers,kst.DataType.Wrong)}`}return ni.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,ni._)`!${u}(${r})`}return ni.nil}}subschema(e,r){let n=(0,sar.getSubschema)(this.it,e);(0,sar.extendSubschemaData)(n,this.it,e),(0,sar.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return X3s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=MF.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=MF.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,ni.Name)),!0}};Hj.KeywordCxt=Pst;function qHn(t,e,r,n){let o=new Pst(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,QPe.funcKeywordCode)(o,r):"macro"in r?(0,QPe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,QPe.funcKeywordCode)(o,r)}a(qHn,"keywordCode");var pFs=/^\/(?:[^~]|~0|~1)*$/,hFs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jHn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!pFs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=hFs.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,ni._)`${s}${(0,ni.getProperty)((0,MF.unescapeJsonPointer)(d))}`,c=(0,ni._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(jHn,"getData");Hj.getData=jHn});var Dst=I(uar=>{"use strict";p();Object.defineProperty(uar,"__esModule",{value:!0});var lar=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};uar.default=lar});var jPe=I(par=>{"use strict";p();Object.defineProperty(par,"__esModule",{value:!0});var dar=FPe(),far=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,dar.resolveUrl)(e,r,n),this.missingSchema=(0,dar.normalizeId)((0,dar.getFullPath)(e,this.missingRef))}};par.default=far});var Mst=I(Rw=>{"use strict";p();Object.defineProperty(Rw,"__esModule",{value:!0});Rw.resolveSchema=Rw.getCompilingSchema=Rw.resolveRef=Rw.compileSchema=Rw.SchemaEnv=void 0;var s2=hs(),mFs=Dst(),DZ=NF(),a2=FPe(),HHn=za(),gFs=qPe(),Jfe=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,a2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Rw.SchemaEnv=Jfe;function mar(t){let e=GHn.call(this,t);if(e)return e;let r=(0,a2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new s2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:mFs.default,code:(0,s2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:DZ.default.data,parentData:DZ.default.parentData,parentDataProperty:DZ.default.parentDataProperty,dataNames:[DZ.default.data],dataPathArr:[s2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,s2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:s2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,s2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,gFs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(DZ.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${DZ.default.self}`,`${DZ.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 s2.Name?void 0:A,items:y instanceof s2.Name?void 0:y,dynamicProps:A instanceof s2.Name,dynamicItems:y instanceof s2.Name},g.source&&(g.source.evaluated=(0,s2.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(mar,"compileSchema");Rw.compileSchema=mar;function AFs(t,e,r){var n;r=(0,a2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=_Fs.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 Jfe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=yFs.call(this,s)}a(AFs,"resolveRef");Rw.resolveRef=AFs;function yFs(t){return(0,a2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:mar.call(this,t)}a(yFs,"inlineOrCompile");function GHn(t){for(let e of this._compilations)if(EFs(e,t))return e}a(GHn,"getCompilingSchema");Rw.getCompilingSchema=GHn;function EFs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(EFs,"sameSchemaEnv");function _Fs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Nst.call(this,t,e)}a(_Fs,"resolve");function Nst(t,e){let r=this.opts.uriResolver.parse(e),n=(0,a2._getFullPath)(this.opts.uriResolver,r),o=(0,a2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return har.call(this,r,t);let s=(0,a2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=Nst.call(this,t,c);return typeof l?.schema!="object"?void 0:har.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||mar.call(this,c),s===(0,a2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,a2.resolveUrl)(this.opts.uriResolver,o,d)),new Jfe({schema:l,schemaId:u,root:t,baseId:o})}return har.call(this,r,c)}}a(Nst,"resolveSchema");Rw.resolveSchema=Nst;var CFs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function har(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,HHn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!CFs.has(l)&&d&&(e=(0,a2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,HHn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,a2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Nst.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Jfe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(har,"getJsonPointer")});var $Hn=I((Jpf,vFs)=>{vFs.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 yar=I((Zpf,JHn)=>{"use strict";p();var bFs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),WHn=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),gar=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),zHn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),SFs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Aar(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(Aar,"stringArrayToHexStripped");var TFs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function VHn(t){return t.length=0,!0}a(VHn,"consumeIsZone");function IFs(t,e,r){if(t.length){let n=Aar(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(IFs,"consumeHextets");function xFs(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=IFs;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=VHn}else{o.push(d);continue}}return o.length&&(l===VHn?r.zone=o.join(""):c?n.push(o.join("")):n.push(Aar(o))),r.address=n.join(""),r}a(xFs,"getIPV6");function YHn(t){if(wFs(t,":")<2)return{host:t,isIPV6:!1};let e=xFs(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(YHn,"normalizeIPv6");function wFs(t,e){let r=0;for(let n=0;nkFs[n])}a(KHn,"reescapeHostDelimiters");function NFs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:LFs}=yar(),FFs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UFs=["http","https","ws","wss","urn","urn:uuid"];function QFs(t){return UFs.indexOf(t)!==-1}a(QFs,"isValidSchemeName");function Ear(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(Ear,"wsIsSecure");function ZHn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(ZHn,"httpParse");function XHn(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(XHn,"httpSerialize");function qFs(t){return t.secure=Ear(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(qFs,"wsParse");function jFs(t){if((t.port===(Ear(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(jFs,"wsSerialize");function HFs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(FFs);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=_ar(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(HFs,"urnParse");function GFs(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=_ar(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(GFs,"urnSerialize");function $Fs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LFs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a($Fs,"urnuuidParse");function VFs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(VFs,"urnuuidSerialize");var eGn={scheme:"http",domainHost:!0,parse:ZHn,serialize:XHn},WFs={scheme:"https",domainHost:eGn.domainHost,parse:ZHn,serialize:XHn},Ost={scheme:"ws",domainHost:!0,parse:qFs,serialize:jFs},zFs={scheme:"wss",domainHost:Ost.domainHost,parse:Ost.parse,serialize:Ost.serialize},YFs={scheme:"urn",parse:HFs,serialize:GFs,skipNormalize:!0},KFs={scheme:"urn:uuid",parse:$Fs,serialize:VFs,skipNormalize:!0},Bst={http:eGn,https:WFs,ws:Ost,wss:zFs,urn:YFs,"urn:uuid":KFs};Object.setPrototypeOf(Bst,null);function _ar(t){return t&&(Bst[t]||Bst[t.toLowerCase()])||void 0}a(_ar,"getSchemeHandler");tGn.exports={wsIsSecure:Ear,SCHEMES:Bst,isValidSchemeName:QFs,getSchemeHandler:_ar}});var cGn=I((ihf,Lst)=>{"use strict";p();var{normalizeIPv6:JFs,removeDotSegments:HPe,recomposeAuthority:ZFs,normalizePercentEncoding:XFs,normalizePathEncoding:e8s,escapePreservingEscapes:t8s,reescapeHostDelimiters:r8s,isIPv4:n8s,nonSimpleDomain:i8s}=yar(),{SCHEMES:o8s,getSchemeHandler:iGn}=rGn();function s8s(t,e){return typeof t=="string"?t=d8s(t,e):typeof t=="object"&&(t=Zfe(NZ(t,e),e)),t}a(s8s,"normalize");function a8s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=oGn(Zfe(t,n),Zfe(e,n),n,!0);return n.skipEscape=!0,NZ(o,n)}a(a8s,"resolve");function oGn(t,e,r,n){let o={};return n||(t=Zfe(NZ(t,r),r),e=Zfe(NZ(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=HPe(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=HPe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=HPe(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=HPe(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(oGn,"resolveComponent");function c8s(t,e,r){let n=nGn(t,r),o=nGn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(c8s,"equal");function NZ(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=iGn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=XFs(r.path):(r.path=t8s(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=ZFs(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=HPe(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(NZ,"serialize");var l8s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function u8s(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(u8s,"getParseError");function sGn(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(l8s);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=u8s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(n8s(n.host)===!1){let f=JFs(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=iGn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&i8s(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=r8s(unescape(n.host),s))),n.path&&(n.path=e8s(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(sGn,"parseWithStatus");function Zfe(t,e){return sGn(t,e).parsed}a(Zfe,"parse");function d8s(t,e){return aGn(t,e).normalized}a(d8s,"normalizeString");function aGn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=sGn(t,e);return{normalized:n?t:NZ(r,e),malformedAuthorityOrPort:n}}a(aGn,"normalizeStringWithStatus");function nGn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=aGn(t,e);return n?void 0:r}if(typeof t=="object")return NZ(t,e)}a(nGn,"normalizeComparableURI");var Car={SCHEMES:o8s,normalize:s8s,resolve:a8s,resolveComponent:oGn,equal:c8s,serialize:NZ,parse:Zfe};Lst.exports=Car;Lst.exports.default=Car;Lst.exports.fastUri=Car});var uGn=I(bar=>{"use strict";p();Object.defineProperty(bar,"__esModule",{value:!0});var lGn=cGn();lGn.code='require("ajv/dist/runtime/uri").default';bar.default=lGn});var yGn=I(MA=>{"use strict";p();Object.defineProperty(MA,"__esModule",{value:!0});MA.CodeGen=MA.Name=MA.nil=MA.stringify=MA.str=MA._=MA.KeywordCxt=void 0;var f8s=qPe();Object.defineProperty(MA,"KeywordCxt",{enumerable:!0,get:a(function(){return f8s.KeywordCxt},"get")});var Xfe=hs();Object.defineProperty(MA,"_",{enumerable:!0,get:a(function(){return Xfe._},"get")});Object.defineProperty(MA,"str",{enumerable:!0,get:a(function(){return Xfe.str},"get")});Object.defineProperty(MA,"stringify",{enumerable:!0,get:a(function(){return Xfe.stringify},"get")});Object.defineProperty(MA,"nil",{enumerable:!0,get:a(function(){return Xfe.nil},"get")});Object.defineProperty(MA,"Name",{enumerable:!0,get:a(function(){return Xfe.Name},"get")});Object.defineProperty(MA,"CodeGen",{enumerable:!0,get:a(function(){return Xfe.CodeGen},"get")});var p8s=Dst(),mGn=jPe(),h8s=Ksr(),GPe=Mst(),m8s=hs(),$Pe=FPe(),Fst=LPe(),Tar=za(),dGn=$Hn(),g8s=uGn(),gGn=a((t,e)=>new RegExp(t,e),"defaultRegExp");gGn.code="new RegExp";var A8s=["removeAdditional","useDefaults","coerceTypes"],y8s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E8s={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."},_8s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},fGn=200;function C8s(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,k,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:gGn,M=(o=t.uriResolver)!==null&&o!==void 0?o:g8s.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:fGn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:fGn,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:(k=t.unicodeRegExp)!==null&&k!==void 0?k:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(C8s,"requiredOptions");var VPe=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,...C8s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new m8s.ValueScope({scope:{},prefixes:y8s,es5:r,lines:n}),this.logger=x8s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,h8s.getRules)(),pGn.call(this,E8s,e,"NOT SUPPORTED"),pGn.call(this,_8s,e,"DEPRECATED","warn"),this._metaOpts=T8s.call(this),e.formats&&b8s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S8s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),v8s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=dGn;n==="id"&&(o={...dGn},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 mGn.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,$Pe.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=hGn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new GPe.SchemaEnv({schema:{},schemaId:n});if(r=GPe.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=hGn.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,$Pe.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(R8s.call(this,n,r),!r)return(0,Tar.eachItem)(n,s=>Sar.call(this,s)),this;P8s.call(this,r);let o={...r,type:(0,Fst.getJSONTypes)(r.type),schemaType:(0,Fst.getJSONTypes)(r.schemaType)};return(0,Tar.eachItem)(n,o.type.length===0?s=>Sar.call(this,s,o):s=>o.type.forEach(c=>Sar.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]=AGn(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,$Pe.normalizeId)(c||n);let d=$Pe.getSchemaRefs.call(this,e,n);return u=new GPe.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):GPe.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{GPe.compileSchema.call(this,e)}finally{this.opts=r}}};VPe.ValidationError=p8s.default;VPe.MissingRefError=mGn.default;MA.default=VPe;function pGn(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(pGn,"checkOptions");function hGn(t){return t=(0,$Pe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(hGn,"getSchEnv");function v8s(){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(v8s,"addInitialSchemas");function b8s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(b8s,"addInitialFormats");function S8s(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(S8s,"addInitialKeywords");function T8s(){let t={...this.opts};for(let e of A8s)delete t[e];return t}a(T8s,"getMetaSchemaOptions");var I8s={log(){},warn(){},error(){}};function x8s(t){if(t===!1)return I8s;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(x8s,"getLogger");var w8s=/^[a-z_$][a-z0-9_$:-]*$/i;function R8s(t,e){let{RULES:r}=this;if((0,Tar.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!w8s.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(R8s,"checkKeyword");function Sar(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,Fst.getJSONTypes)(e.type),schemaType:(0,Fst.getJSONTypes)(e.schemaType)}};e.before?k8s.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(Sar,"addRule");function k8s(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(k8s,"addBeforeRule");function P8s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=AGn(e)),t.validateSchema=this.compile(e,!0))}a(P8s,"keywordMetaschema");var D8s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function AGn(t){return{anyOf:[t,D8s]}}a(AGn,"schemaOrData")});var EGn=I(Iar=>{"use strict";p();Object.defineProperty(Iar,"__esModule",{value:!0});var N8s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Iar.default=N8s});var bGn=I(MZ=>{"use strict";p();Object.defineProperty(MZ,"__esModule",{value:!0});MZ.callRef=MZ.getValidate=void 0;var M8s=jPe(),_Gn=ww(),ub=hs(),epe=NF(),CGn=Mst(),Ust=za(),O8s={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=CGn.resolveRef.call(u,d,o,r);if(f===void 0)throw new M8s.default(n.opts.uriResolver,o,r);if(f instanceof CGn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return Qst(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return Qst(t,(0,ub._)`${A}.validate`,d,d.$async)}function m(A){let y=vGn(t,A);Qst(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,ub.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:ub.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function vGn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ub._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(vGn,"getValidate");MZ.getValidate=vGn;function Qst(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?epe.default.this:ub.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,ub._)`await ${(0,_Gn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,ub._)`!(${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,_Gn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,ub._)`${A}.errors`;o.assign(epe.default.vErrors,(0,ub._)`${epe.default.vErrors} === null ? ${y} : ${epe.default.vErrors}.concat(${y})`),o.assign(epe.default.errors,(0,ub._)`${epe.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=Ust.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,ub._)`${A}.evaluated.props`);s.props=Ust.mergeEvaluated.props(o,_,s.props,ub.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=Ust.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,ub._)`${A}.evaluated.items`);s.items=Ust.mergeEvaluated.items(o,_,s.items,ub.Name)}}a(g,"addEvaluatedFrom")}a(Qst,"callRef");MZ.callRef=Qst;MZ.default=O8s});var SGn=I(xar=>{"use strict";p();Object.defineProperty(xar,"__esModule",{value:!0});var B8s=EGn(),L8s=bGn(),F8s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",B8s.default,L8s.default];xar.default=F8s});var TGn=I(war=>{"use strict";p();Object.defineProperty(war,"__esModule",{value:!0});var qst=hs(),Gj=qst.operators,jst={maximum:{okStr:"<=",ok:Gj.LTE,fail:Gj.GT},minimum:{okStr:">=",ok:Gj.GTE,fail:Gj.LT},exclusiveMaximum:{okStr:"<",ok:Gj.LT,fail:Gj.GTE},exclusiveMinimum:{okStr:">",ok:Gj.GT,fail:Gj.LTE}},U8s={message:a(({keyword:t,schemaCode:e})=>(0,qst.str)`must be ${jst[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,qst._)`{comparison: ${jst[t].okStr}, limit: ${e}}`,"params")},Q8s={keyword:Object.keys(jst),type:"number",schemaType:"number",$data:!0,error:U8s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,qst._)`${r} ${jst[e].fail} ${n} || isNaN(${r})`)}};war.default=Q8s});var IGn=I(Rar=>{"use strict";p();Object.defineProperty(Rar,"__esModule",{value:!0});var WPe=hs(),q8s={message:a(({schemaCode:t})=>(0,WPe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,WPe._)`{multipleOf: ${t}}`,"params")},j8s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:q8s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,WPe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,WPe._)`${c} !== parseInt(${c})`;t.fail$data((0,WPe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};Rar.default=j8s});var wGn=I(kar=>{"use strict";p();Object.defineProperty(kar,"__esModule",{value:!0});function xGn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(Par,"__esModule",{value:!0});var OZ=hs(),H8s=za(),G8s=wGn(),$8s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,OZ.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,OZ._)`{limit: ${t}}`,"params")},V8s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:$8s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?OZ.operators.GT:OZ.operators.LT,c=o.opts.unicode===!1?(0,OZ._)`${r}.length`:(0,OZ._)`${(0,H8s.useFunc)(t.gen,G8s.default)}(${r})`;t.fail$data((0,OZ._)`${c} ${s} ${n}`)}};Par.default=V8s});var kGn=I(Dar=>{"use strict";p();Object.defineProperty(Dar,"__esModule",{value:!0});var W8s=ww(),z8s=za(),tpe=hs(),Y8s={message:a(({schemaCode:t})=>(0,tpe.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,tpe._)`{pattern: ${t}}`,"params")},K8s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Y8s,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,tpe._)`new RegExp`:(0,z8s.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,tpe._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,tpe._)`!${f}`)}else{let u=(0,W8s.usePattern)(t,o);t.fail$data((0,tpe._)`!${u}.test(${r})`)}}};Dar.default=K8s});var PGn=I(Nar=>{"use strict";p();Object.defineProperty(Nar,"__esModule",{value:!0});var zPe=hs(),J8s={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,zPe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,zPe._)`{limit: ${t}}`,"params")},Z8s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:J8s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?zPe.operators.GT:zPe.operators.LT;t.fail$data((0,zPe._)`Object.keys(${r}).length ${o} ${n}`)}};Nar.default=Z8s});var DGn=I(Mar=>{"use strict";p();Object.defineProperty(Mar,"__esModule",{value:!0});var YPe=ww(),KPe=hs(),X8s=za(),e6s={message:a(({params:{missingProperty:t}})=>(0,KPe.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,KPe._)`{missingProperty: ${t}}`,"params")},t6s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:e6s,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,X8s.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(KPe.nil,h);else for(let g of r)(0,YPe.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,YPe.checkMissingProp)(t,r,g)),(0,YPe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,YPe.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,YPe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,KPe.not)(A),()=>{t.error(),e.break()})},KPe.nil)}a(m,"loopUntilMissing")}};Mar.default=t6s});var NGn=I(Oar=>{"use strict";p();Object.defineProperty(Oar,"__esModule",{value:!0});var JPe=hs(),r6s={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,JPe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,JPe._)`{limit: ${t}}`,"params")},n6s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r6s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?JPe.operators.GT:JPe.operators.LT;t.fail$data((0,JPe._)`${r}.length ${o} ${n}`)}};Oar.default=n6s});var Hst=I(Bar=>{"use strict";p();Object.defineProperty(Bar,"__esModule",{value:!0});var MGn=iar();MGn.code='require("ajv/dist/runtime/equal").default';Bar.default=MGn});var OGn=I(Far=>{"use strict";p();Object.defineProperty(Far,"__esModule",{value:!0});var Lar=LPe(),OA=hs(),i6s=za(),o6s=Hst(),s6s={message:a(({params:{i:t,j:e}})=>(0,OA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,OA._)`{i: ${t}, j: ${e}}`,"params")},a6s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s6s,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,Lar.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,OA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,OA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,OA._)`${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,Lar.checkDataTypes)(d,E,l.opts.strictNumbers,Lar.DataType.Wrong),v=e.const("indices",(0,OA._)`{}`);e.for((0,OA._)`;${A}--;`,()=>{e.let(E,(0,OA._)`${r}[${A}]`),e.if(_,(0,OA._)`continue`),d.length>1&&e.if((0,OA._)`typeof ${E} == "string"`,(0,OA._)`${E} += "_"`),e.if((0,OA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,OA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,OA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,i6s.useFunc)(e,o6s.default),_=e.name("outer");e.label(_).for((0,OA._)`;${A}--;`,()=>e.for((0,OA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,OA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};Far.default=a6s});var BGn=I(Qar=>{"use strict";p();Object.defineProperty(Qar,"__esModule",{value:!0});var Uar=hs(),c6s=za(),l6s=Hst(),u6s={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,Uar._)`{allowedValue: ${t}}`,"params")},d6s={keyword:"const",$data:!0,error:u6s,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Uar._)`!${(0,c6s.useFunc)(e,l6s.default)}(${r}, ${o})`):t.fail((0,Uar._)`${s} !== ${r}`)}};Qar.default=d6s});var LGn=I(qar=>{"use strict";p();Object.defineProperty(qar,"__esModule",{value:!0});var ZPe=hs(),f6s=za(),p6s=Hst(),h6s={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,ZPe._)`{allowedValues: ${t}}`,"params")},m6s={keyword:"enum",schemaType:"array",$data:!0,error:h6s,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,f6s.useFunc)(e,p6s.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,ZPe.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,ZPe._)`${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,ZPe._)`${d()}(${r}, ${g}[${A}])`:(0,ZPe._)`${r} === ${y}`}a(m,"equalCode")}};qar.default=m6s});var FGn=I(jar=>{"use strict";p();Object.defineProperty(jar,"__esModule",{value:!0});var g6s=TGn(),A6s=IGn(),y6s=RGn(),E6s=kGn(),_6s=PGn(),C6s=DGn(),v6s=NGn(),b6s=OGn(),S6s=BGn(),T6s=LGn(),I6s=[g6s.default,A6s.default,y6s.default,E6s.default,_6s.default,C6s.default,v6s.default,b6s.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},S6s.default,T6s.default];jar.default=I6s});var Gar=I(XPe=>{"use strict";p();Object.defineProperty(XPe,"__esModule",{value:!0});XPe.validateAdditionalItems=void 0;var BZ=hs(),Har=za(),x6s={message:a(({params:{len:t}})=>(0,BZ.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,BZ._)`{limit: ${t}}`,"params")},w6s={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:x6s,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Har.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}UGn(t,n)}};function UGn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,BZ._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,BZ._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Har.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,BZ._)`${l} <= ${e.length}`);r.if((0,BZ.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Har.Type.Num},d),c.allErrors||r.if((0,BZ.not)(d),()=>r.break())})}a(u,"validateItems")}a(UGn,"validateAdditionalItems");XPe.validateAdditionalItems=UGn;XPe.default=w6s});var $ar=I(e2e=>{"use strict";p();Object.defineProperty(e2e,"__esModule",{value:!0});e2e.validateTuple=void 0;var QGn=hs(),Gst=za(),R6s=ww(),k6s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return qGn(t,"additionalItems",e);r.items=!0,!(0,Gst.alwaysValidSchema)(r,e)&&t.ok((0,R6s.validateArray)(t))}};function qGn(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=Gst.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,QGn._)`${s}.length`);r.forEach((h,m)=>{(0,Gst.alwaysValidSchema)(l,h)||(n.if((0,QGn._)`${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,Gst.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(qGn,"validateTuple");e2e.validateTuple=qGn;e2e.default=k6s});var jGn=I(Var=>{"use strict";p();Object.defineProperty(Var,"__esModule",{value:!0});var P6s=$ar(),D6s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,P6s.validateTuple)(t,"items"),"code")};Var.default=D6s});var GGn=I(War=>{"use strict";p();Object.defineProperty(War,"__esModule",{value:!0});var HGn=hs(),N6s=za(),M6s=ww(),O6s=Gar(),B6s={message:a(({params:{len:t}})=>(0,HGn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,HGn._)`{limit: ${t}}`,"params")},L6s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:B6s,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,N6s.alwaysValidSchema)(n,e)&&(o?(0,O6s.validateAdditionalItems)(t,o):t.ok((0,M6s.validateArray)(t)))}};War.default=L6s});var $Gn=I(zar=>{"use strict";p();Object.defineProperty(zar,"__esModule",{value:!0});var kw=hs(),$st=za(),F6s={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")},U6s={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:F6s,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,$st.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,$st.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,$st.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:$st.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")}};zar.default=U6s});var zGn=I(g5=>{"use strict";p();Object.defineProperty(g5,"__esModule",{value:!0});g5.validateSchemaDeps=g5.validatePropertyDeps=g5.error=void 0;var Yar=hs(),Q6s=za(),t2e=ww();g5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Yar.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Yar._)`{property: ${t}, +${s}`:o.stack}a(nQn,"appendFetchStackTrace");An.exports.fetch=a(function(e,r=void 0){return lDs(e,r).catch(n=>{throw X7n?nQn(n,X7n):n&&typeof n=="object"&&Error.captureStackTrace(n,An.exports.fetch),n})},"fetch");An.exports.Headers=QJ().Headers;An.exports.Response=dPe().Response;An.exports.Request=nfe().Request;An.exports.FormData=wnt().FormData;var{setGlobalOrigin:uDs,getGlobalOrigin:dDs}=rtr();An.exports.setGlobalOrigin=uDs;An.exports.getGlobalOrigin=dDs;var{CacheStorage:fDs}=LUn(),{kConstruct:pDs}=tl();An.exports.caches=new fDs(pDs);var{deleteCookie:hDs,getCookies:mDs,getSetCookies:gDs,setCookie:ADs,parseCookie:yDs}=KUn();An.exports.deleteCookie=hDs;An.exports.getCookies=mDs;An.exports.getSetCookies=gDs;An.exports.setCookie=ADs;An.exports.parseCookie=yDs;var{parseMIMEType:EDs,serializeAMimeType:_Ds}=sw();An.exports.parseMIMEType=EDs;An.exports.serializeAMimeType=_Ds;var{CloseEvent:vDs,ErrorEvent:CDs,MessageEvent:bDs}=Vit(),{WebSocket:SDs,ping:TDs}=P7n();An.exports.WebSocket=SDs;An.exports.CloseEvent=vDs;An.exports.ErrorEvent=CDs;An.exports.MessageEvent=bDs;An.exports.ping=TDs;An.exports.WebSocketStream=F7n().WebSocketStream;An.exports.WebSocketError=_ir().WebSocketError;An.exports.request=bPe(hfe.request);An.exports.stream=bPe(hfe.stream);An.exports.pipeline=bPe(hfe.pipeline);An.exports.connect=bPe(hfe.connect);An.exports.upgrade=bPe(hfe.upgrade);An.exports.MockClient=J2s;An.exports.MockCallHistory=Z2s;An.exports.MockCallHistoryLog=X2s;An.exports.MockPool=tDs;An.exports.MockAgent=eDs;An.exports.SnapshotAgent=rDs;An.exports.mockErrors=nDs;var{EventSource:IDs}=Z7n();An.exports.EventSource=IDs;function xDs(){globalThis.fetch=An.exports.fetch,globalThis.Headers=An.exports.Headers,globalThis.Response=An.exports.Response,globalThis.Request=An.exports.Request,globalThis.FormData=An.exports.FormData,globalThis.WebSocket=An.exports.WebSocket,globalThis.CloseEvent=An.exports.CloseEvent,globalThis.ErrorEvent=An.exports.ErrorEvent,globalThis.MessageEvent=An.exports.MessageEvent,globalThis.EventSource=An.exports.EventSource}a(xDs,"install");An.exports.install=xDs});var dQn,fQn=_e(()=>{p();dQn=typeof globalThis=="object"?globalThis:global});var pQn=_e(()=>{p();fQn()});var hQn=_e(()=>{p();pQn()});var fF,Bir=_e(()=>{p();fF="1.9.0"});function MDs(t){var e=new Set([t]),r=new Set,n=t.match(mQn);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(mQn);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 mQn,gQn,AQn=_e(()=>{p();Bir();mQn=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(MDs,"_makeCompatibilityCheck");gQn=MDs(fF)});function e5(t,e,r,n){var o;n===void 0&&(n=!1);var s=IPe[TPe]=(o=IPe[TPe])!==null&&o!==void 0?o:{version:fF};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!==fF){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+fF);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+fF+"."),!0}function cT(t){var e,r,n=(e=IPe[TPe])===null||e===void 0?void 0:e.version;if(!(!n||!gQn(n)))return(r=IPe[TPe])===null||r===void 0?void 0:r[t]}function t5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+fF+".");var r=IPe[TPe];r&&delete r[t]}var ODs,TPe,IPe,YJ=_e(()=>{p();hQn();Bir();AQn();ODs=fF.split(".")[0],TPe=Symbol.for("opentelemetry.js.api."+ODs),IPe=dQn;a(e5,"registerGlobal");a(cT,"getGlobal");a(t5,"unregisterGlobal")});function xPe(t,e,r){var n=cT("diag");if(n)return r.unshift(e),n[t].apply(n,LDs([],BDs(r),!1))}var BDs,LDs,yQn,EQn=_e(()=>{p();YJ();BDs=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},LDs=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"})(wa||(wa={}))});function _Qn(t,e){twa.ALL&&(t=wa.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",wa.ERROR),warn:r("warn",wa.WARN),info:r("info",wa.INFO),debug:r("debug",wa.DEBUG),verbose:r("verbose",wa.VERBOSE)}}var vQn=_e(()=>{p();lot();a(_Qn,"createLogLevelDiagLogger")});var FDs,UDs,QDs,aE,KJ=_e(()=>{p();EQn();vQn();lot();YJ();FDs=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},UDs=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 e5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){t5(QDs,r)},r.createComponentLogger=function(o){return new yQn(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 qDs,jDs,CQn,bQn=_e(()=>{p();qDs=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},jDs=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.")},CQn=(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=qDs(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();SQn=Symbol("BaggageEntryMetadata")});function IQn(t){return t===void 0&&(t={}),new CQn(new Map(Object.entries(t)))}function mfe(t){return typeof t!="string"&&(HDs.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:SQn,toString:a(function(){return t},"toString")}}var HDs,Lir=_e(()=>{p();KJ();bQn();TQn();HDs=aE.instance();a(IQn,"createBaggage");a(mfe,"baggageEntryMetadataFromString")});function tb(t){return Symbol.for(t)}var GDs,uot,wPe=_e(()=>{p();a(tb,"createContextKey");GDs=(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})(),uot=new GDs});var Fir,xQn,wQn=_e(()=>{p();Fir=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],xQn=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();JJ=(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)}})(),$Ds=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return eNs},t.prototype.createHistogram=function(e,r){return tNs},t.prototype.createCounter=function(e,r){return XDs},t.prototype.createUpDownCounter=function(e,r){return rNs},t.prototype.createObservableGauge=function(e,r){return iNs},t.prototype.createObservableCounter=function(e,r){return nNs},t.prototype.createObservableUpDownCounter=function(e,r){return oNs},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),dot=(function(){function t(){}return a(t,"NoopMetric"),t})(),VDs=(function(t){JJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(dot),WDs=(function(t){JJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(dot),zDs=(function(t){JJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(dot),YDs=(function(t){JJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(dot),Uir=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),KDs=(function(t){JJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(Uir),JDs=(function(t){JJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(Uir),ZDs=(function(t){JJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(Uir),Qir=new $Ds,XDs=new VDs,eNs=new zDs,tNs=new YDs,rNs=new WDs,nNs=new KDs,iNs=new JDs,oNs=new ZDs;a(RQn,"createNoopMeter")});var fot,PQn=_e(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(fot||(fot={}))});var pot,hot,jir=_e(()=>{p();pot={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},hot={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var sNs,aNs,kQn,DQn=_e(()=>{p();wPe();sNs=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},aNs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();DQn();YJ();KJ();cNs=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},lNs=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"})(gf||(gf={}))});var PPe,kPe,gfe,mot=_e(()=>{p();Gir();PPe="0000000000000000",kPe="00000000000000000000000000000000",gfe={traceId:kPe,spanId:PPe,traceFlags:gf.NONE}});var mj,got=_e(()=>{p();mot();mj=(function(){function t(e){e===void 0&&(e=gfe),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 Aot(t){return t.getValue($ir)||void 0}function NQn(){return Aot(hj.getInstance().active())}function DPe(t,e){return t.setValue($ir,e)}function MQn(t){return t.deleteValue($ir)}function OQn(t,e){return DPe(t,new mj(e))}function yot(t){var e;return(e=Aot(t))===null||e===void 0?void 0:e.spanContext()}var $ir,Vir=_e(()=>{p();wPe();got();RPe();$ir=tb("OpenTelemetry Context Key SPAN");a(Aot,"getSpan");a(NQn,"getActiveSpan");a(DPe,"setSpan");a(MQn,"deleteSpan");a(OQn,"setSpanContext");a(yot,"getSpanContext")});function ZJ(t){return dNs.test(t)&&t!==kPe}function Wir(t){return fNs.test(t)&&t!==PPe}function rb(t){return ZJ(t.traceId)&&Wir(t.spanId)}function BQn(t){return new mj(t)}var dNs,fNs,Eot=_e(()=>{p();mot();got();dNs=/^([0-9a-f]{32})$/i,fNs=/^[0-9a-f]{16}$/i;a(ZJ,"isValidTraceId");a(Wir,"isValidSpanId");a(rb,"isSpanContextValid");a(BQn,"wrapSpanContext")});function pNs(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var zir,_ot,Yir=_e(()=>{p();RPe();Vir();got();Eot();zir=hj.getInstance(),_ot=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=zir.active());var o=!!r?.root;if(o)return new mj;var s=n&&yot(n);return pNs(s)&&rb(s)?new mj(s):new mj},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??zir.active(),d=this.startSpan(e,s,u),f=DPe(u,d);return zir.with(f,l,void 0,d)}},t})();a(pNs,"isSpanContext")});var hNs,vot,Kir=_e(()=>{p();Yir();hNs=new _ot,vot=(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):hNs},t})()});var LQn,FQn=_e(()=>{p();Yir();LQn=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new _ot},t})()});var mNs,NPe,Jir=_e(()=>{p();Kir();FQn();mNs=new LQn,NPe=(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 vot(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:mNs},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 nb,UQn=_e(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(nb||(nb={}))});var Afe,QQn=_e(()=>{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"})(Afe||(Afe={}))});var yfe,qQn=_e(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(yfe||(yfe={}))});function jQn(t){return yNs.test(t)}function HQn(t){return ENs.test(t)&&!_Ns.test(t)}var Zir,gNs,ANs,yNs,ENs,_Ns,GQn=_e(()=>{p();Zir="[_0-9a-z-*/]",gNs="[a-z]"+Zir+"{0,255}",ANs="[a-z0-9]"+Zir+"{0,240}@[a-z]"+Zir+"{0,13}",yNs=new RegExp("^(?:"+gNs+"|"+ANs+")$"),ENs=/^[ -~]{0,255}[!-~]$/,_Ns=/,|=/;a(jQn,"validateKey");a(HQn,"validateValue")});var $Qn,vNs,VQn,WQn,zQn,YQn=_e(()=>{p();GQn();$Qn=32,vNs=512,VQn=",",WQn="=",zQn=(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+WQn+e.get(n)),r},[]).join(VQn)},t.prototype._parse=function(e){e.length>vNs||(this._internalState=e.split(VQn).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(WQn);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);jQn(c)&&HQn(l)&&r.set(c,l)}return r},new Map),this._internalState.size>$Qn&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,$Qn))))},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 KQn(t){return new zQn(t)}var JQn=_e(()=>{p();YQn();a(KQn,"createTraceState")});var _g,ZQn=_e(()=>{p();RPe();_g=hj.getInstance()});var Pn,XQn=_e(()=>{p();KJ();Pn=aE.instance()});var CNs,eqn,tqn=_e(()=>{p();qir();CNs=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return Qir},t})(),eqn=new CNs});var Xir,rqn,nqn=_e(()=>{p();tqn();YJ();KJ();Xir="metrics",rqn=(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 e5(Xir,e,aE.instance())},t.prototype.getMeterProvider=function(){return cT(Xir)||eqn},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){t5(Xir,aE.instance())},t})()});var XJ,iqn=_e(()=>{p();nqn();XJ=rqn.getInstance()});var oqn,sqn=_e(()=>{p();oqn=(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 tor(t){return t.getValue(eor)||void 0}function aqn(){return tor(hj.getInstance().active())}function cqn(t,e){return t.setValue(eor,e)}function lqn(t){return t.deleteValue(eor)}var eor,uqn=_e(()=>{p();RPe();wPe();eor=tb("OpenTelemetry Baggage Key");a(tor,"getBaggage");a(aqn,"getActiveBaggage");a(cqn,"setBaggage");a(lqn,"deleteBaggage")});var ror,bNs,dqn,fqn=_e(()=>{p();YJ();sqn();jir();uqn();Lir();KJ();ror="propagation",bNs=new oqn,dqn=(function(){function t(){this.createBaggage=IQn,this.getBaggage=tor,this.getActiveBaggage=aqn,this.setBaggage=cqn,this.deleteBaggage=lqn}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return e5(ror,e,aE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=hot),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=pot),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){t5(ror,aE.instance())},t.prototype._getGlobalPropagator=function(){return cT(ror)||bNs},t})()});var lT,pqn=_e(()=>{p();fqn();lT=dqn.getInstance()});var nor,hqn,mqn=_e(()=>{p();YJ();Jir();Eot();Vir();KJ();nor="trace",hqn=(function(){function t(){this._proxyTracerProvider=new NPe,this.wrapSpanContext=BQn,this.isSpanContextValid=rb,this.deleteSpan=MQn,this.getSpan=Aot,this.getActiveSpan=NQn,this.getSpanContext=yot,this.setSpan=DPe,this.setSpanContext=OQn}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=e5(nor,this._proxyTracerProvider,aE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return cT(nor)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){t5(nor,aE.instance()),this._proxyTracerProvider=new NPe},t})()});var _u,gqn=_e(()=>{p();mqn();_u=hqn.getInstance()});var r5={};xi(r5,{DiagConsoleLogger:()=>xQn,DiagLogLevel:()=>wa,INVALID_SPANID:()=>PPe,INVALID_SPAN_CONTEXT:()=>gfe,INVALID_TRACEID:()=>kPe,ProxyTracer:()=>vot,ProxyTracerProvider:()=>NPe,ROOT_CONTEXT:()=>uot,SamplingDecision:()=>nb,SpanKind:()=>Afe,SpanStatusCode:()=>yfe,TraceFlags:()=>gf,ValueType:()=>fot,baggageEntryMetadataFromString:()=>mfe,context:()=>_g,createContextKey:()=>tb,createNoopMeter:()=>RQn,createTraceState:()=>KQn,default:()=>SNs,defaultTextMapGetter:()=>pot,defaultTextMapSetter:()=>hot,diag:()=>Pn,isSpanContextValid:()=>rb,isValidSpanId:()=>Wir,isValidTraceId:()=>ZJ,metrics:()=>XJ,propagation:()=>lT,trace:()=>_u});var SNs,ao=_e(()=>{p();Lir();wPe();wQn();lot();qir();PQn();jir();Kir();Jir();UQn();QQn();qQn();Gir();JQn();Eot();mot();ZQn();XQn();iqn();pqn();gqn();SNs={context:_g,diag:Pn,metrics:XJ,propagation:lT,trace:_u}});var uke=I(nc=>{"use strict";p();Object.defineProperty(nc,"__esModule",{value:!0});nc.regexpCode=nc.getEsmExportName=nc.getProperty=nc.safeStringify=nc.stringify=nc.strConcat=nc.addCodeArg=nc.str=nc._=nc.nil=nc._Code=nc.Name=nc.IDENTIFIER=nc._CodeOrName=void 0;var cke=class{static{a(this,"_CodeOrName")}};nc._CodeOrName=cke;nc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var lZ=class extends cke{static{a(this,"Name")}constructor(e){if(super(),!nc.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}}};nc.Name=lZ;var _w=class extends cke{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 lZ&&(r[n.str]=(r[n.str]||0)+1),r),{})}};nc._Code=_w;nc.nil=new _w("");function ijn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(ob,"__esModule",{value:!0});ob.ValueScope=ob.ValueScopeName=ob.Scope=ob.varKinds=ob.UsedValueState=void 0;var ib=uke(),qor=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Qot;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Qot||(ob.UsedValueState=Qot={}));ob.varKinds={const:new ib.Name("const"),let:new ib.Name("let"),var:new ib.Name("var")};var qot=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ib.Name?e:this.name(e)}name(e){return new ib.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}}};ob.Scope=qot;var jot=class extends ib.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,ib._)`.${new ib.Name(r)}[${n}]`}};ob.ValueScopeName=jot;var LOs=(0,ib._)`\n`,jor=class extends qot{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?LOs:ib.nil}}get(){return this._scope}name(e){return new jot(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,ib._)`${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=ib.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,Qot.Started);let f=r(d);if(f){let h=this.opts.es5?ob.varKinds.var:ob.varKinds.const;s=(0,ib._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,ib._)`${s}${f}${this.opts._n}`;else throw new qor(d);u.set(d,Qot.Completed)})}return s}};ob.ValueScope=jor});var ds=I(Ss=>{"use strict";p();Object.defineProperty(Ss,"__esModule",{value:!0});Ss.or=Ss.and=Ss.not=Ss.CodeGen=Ss.operators=Ss.varKinds=Ss.ValueScopeName=Ss.ValueScope=Ss.Scope=Ss.Name=Ss.regexpCode=Ss.stringify=Ss.getProperty=Ss.nil=Ss.strConcat=Ss.str=Ss._=void 0;var Ra=uke(),Jk=Hor(),Cj=uke();Object.defineProperty(Ss,"_",{enumerable:!0,get:a(function(){return Cj._},"get")});Object.defineProperty(Ss,"str",{enumerable:!0,get:a(function(){return Cj.str},"get")});Object.defineProperty(Ss,"strConcat",{enumerable:!0,get:a(function(){return Cj.strConcat},"get")});Object.defineProperty(Ss,"nil",{enumerable:!0,get:a(function(){return Cj.nil},"get")});Object.defineProperty(Ss,"getProperty",{enumerable:!0,get:a(function(){return Cj.getProperty},"get")});Object.defineProperty(Ss,"stringify",{enumerable:!0,get:a(function(){return Cj.stringify},"get")});Object.defineProperty(Ss,"regexpCode",{enumerable:!0,get:a(function(){return Cj.regexpCode},"get")});Object.defineProperty(Ss,"Name",{enumerable:!0,get:a(function(){return Cj.Name},"get")});var Vot=Hor();Object.defineProperty(Ss,"Scope",{enumerable:!0,get:a(function(){return Vot.Scope},"get")});Object.defineProperty(Ss,"ValueScope",{enumerable:!0,get:a(function(){return Vot.ValueScope},"get")});Object.defineProperty(Ss,"ValueScopeName",{enumerable:!0,get:a(function(){return Vot.ValueScopeName},"get")});Object.defineProperty(Ss,"varKinds",{enumerable:!0,get:a(function(){return Vot.varKinds},"get")});Ss.operators={GT:new Ra._Code(">"),GTE:new Ra._Code(">="),LT:new Ra._Code("<"),LTE:new Ra._Code("<="),EQ:new Ra._Code("==="),NEQ:new Ra._Code("!=="),NOT:new Ra._Code("!"),OR:new Ra._Code("||"),AND:new Ra._Code("&&"),ADD:new Ra._Code("+")};var EF=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},Gor=class extends EF{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?Jk.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=Sfe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ra._CodeOrName?this.rhs.names:{}}},Hot=class extends EF{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 Ra.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Sfe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ra.Name?{}:{...this.lhs.names};return $ot(e,this.rhs)}},$or=class extends Hot{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}},Vor=class extends EF{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Wor=class extends EF{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},zor=class extends EF{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Yor=class extends EF{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=Sfe(this.code,e,r),this}get names(){return this.code instanceof Ra._CodeOrName?this.code.names:{}}},dke=class extends EF{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)||(FOs(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>fZ(e,r.names),{})}},_F=class extends dke{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Kor=class extends dke{static{a(this,"Root")}},bfe=class extends _F{static{a(this,"Else")}};bfe.kind="else";var uZ=class t extends _F{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 bfe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(sjn(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=Sfe(this.condition,e,r),this}get names(){let e=super.names;return $ot(e,this.condition),this.else&&fZ(e,this.else.names),e}};uZ.kind="if";var dZ=class extends _F{static{a(this,"For")}};dZ.kind="for";var Jor=class extends dZ{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=Sfe(this.iteration,e,r),this}get names(){return fZ(super.names,this.iteration.names)}},Zor=class extends dZ{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?Jk.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=$ot(super.names,this.from);return $ot(e,this.to)}},Got=class extends dZ{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=Sfe(this.iterable,e,r),this}get names(){return fZ(super.names,this.iterable.names)}},fke=class extends _F{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)}};fke.kind="func";var pke=class extends dke{static{a(this,"Return")}render(e){return"return "+super.render(e)}};pke.kind="return";var Xor=class extends _F{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&&fZ(e,this.catch.names),this.finally&&fZ(e,this.finally.names),e}},hke=class extends _F{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};hke.kind="catch";var mke=class extends _F{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};mke.kind="finally";var esr=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 Jk.Scope({parent:e}),this._nodes=[new Kor]}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 Gor(e,s,n)),s}const(e,r,n){return this._def(Jk.varKinds.const,e,r,n)}let(e,r,n){return this._def(Jk.varKinds.let,e,r,n)}var(e,r,n){return this._def(Jk.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Hot(e,r,n))}add(e,r){return this._leafNode(new $or(e,Ss.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ra.nil&&this._leafNode(new Yor(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,Ra.addCodeArg)(r,o));return r.push("}"),new Ra._Code(r)}if(e,r,n){if(this._blockNode(new uZ(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 uZ(e))}else(){return this._elseNode(new bfe)}endIf(){return this._endBlockNode(uZ,bfe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Jor(e),r)}forRange(e,r,n,o,s=this.opts.es5?Jk.varKinds.var:Jk.varKinds.let){let c=this._scope.toName(e);return this._for(new Zor(s,c,r,n),()=>o(c))}forOf(e,r,n,o=Jk.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Ra.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ra._)`${c}.length`,l=>{this.var(s,(0,Ra._)`${c}[${l}]`),n(s)})}return this._for(new Got("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?Jk.varKinds.var:Jk.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ra._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Got("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(dZ)}label(e){return this._leafNode(new Vor(e))}break(e){return this._leafNode(new Wor(e))}return(e){let r=new pke;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(pke)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Xor;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new hke(s),r(s)}return n&&(this._currNode=o.finally=new mke,this.code(n)),this._endBlockNode(hke,mke)}throw(e){return this._leafNode(new zor(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=Ra.nil,n,o){return this._blockNode(new fke(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(fke)}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 uZ))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}};Ss.CodeGen=esr;function fZ(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(fZ,"addNames");function $ot(t,e){return e instanceof Ra._CodeOrName?fZ(t,e.names):t}a($ot,"addExprNames");function Sfe(t,e,r){if(t instanceof Ra.Name)return n(t);if(!o(t))return t;return new Ra._Code(t._items.reduce((s,c)=>(c instanceof Ra.Name&&(c=n(c)),c instanceof Ra._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 Ra._Code&&s._items.some(c=>c instanceof Ra.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Sfe,"optimizeExpr");function FOs(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(FOs,"subtractNames");function sjn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ra._)`!${tsr(t)}`}a(sjn,"not");Ss.not=sjn;var UOs=ajn(Ss.operators.AND);function QOs(...t){return t.reduce(UOs)}a(QOs,"and");Ss.and=QOs;var qOs=ajn(Ss.operators.OR);function jOs(...t){return t.reduce(qOs)}a(jOs,"or");Ss.or=jOs;function ajn(t){return(e,r)=>e===Ra.nil?r:r===Ra.nil?e:(0,Ra._)`${tsr(e)} ${t} ${tsr(r)}`}a(ajn,"mappend");function tsr(t){return t instanceof Ra.Name?t:(0,Ra._)`(${t})`}a(tsr,"par")});var Va=I(Os=>{"use strict";p();Object.defineProperty(Os,"__esModule",{value:!0});Os.checkStrictMode=Os.getErrorPath=Os.Type=Os.useFunc=Os.setEvaluated=Os.evaluatedPropsToName=Os.mergeEvaluated=Os.eachItem=Os.unescapeJsonPointer=Os.escapeJsonPointer=Os.escapeFragment=Os.unescapeFragment=Os.schemaRefOrVal=Os.schemaHasRulesButRef=Os.schemaHasRules=Os.checkUnknownRules=Os.alwaysValidSchema=Os.toHash=void 0;var ql=ds(),HOs=uke();function GOs(t){let e={};for(let r of t)e[r]=!0;return e}a(GOs,"toHash");Os.toHash=GOs;function $Os(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(ujn(t,e),!djn(e,t.self.RULES.all))}a($Os,"alwaysValidSchema");Os.alwaysValidSchema=$Os;function ujn(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]||hjn(t,`unknown keyword: "${s}"`)}a(ujn,"checkUnknownRules");Os.checkUnknownRules=ujn;function djn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(djn,"schemaHasRules");Os.schemaHasRules=djn;function VOs(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(VOs,"schemaHasRulesButRef");Os.schemaHasRulesButRef=VOs;function WOs({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ql._)`${r}`}return(0,ql._)`${t}${e}${(0,ql.getProperty)(n)}`}a(WOs,"schemaRefOrVal");Os.schemaRefOrVal=WOs;function zOs(t){return fjn(decodeURIComponent(t))}a(zOs,"unescapeFragment");Os.unescapeFragment=zOs;function YOs(t){return encodeURIComponent(nsr(t))}a(YOs,"escapeFragment");Os.escapeFragment=YOs;function nsr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(nsr,"escapeJsonPointer");Os.escapeJsonPointer=nsr;function fjn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(fjn,"unescapeJsonPointer");Os.unescapeJsonPointer=fjn;function KOs(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(KOs,"eachItem");Os.eachItem=KOs;function cjn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof ql.Name?(s instanceof ql.Name?t(o,s,c):e(o,s,c),c):s instanceof ql.Name?(e(o,c,s),s):r(s,c);return l===ql.Name&&!(u instanceof ql.Name)?n(o,u):u}}a(cjn,"makeMergeEvaluated");Os.mergeEvaluated={props:cjn({mergeNames:a((t,e,r)=>t.if((0,ql._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ql._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ql._)`${r} || {}`).code((0,ql._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,ql._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ql._)`${r} || {}`),isr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:pjn}),items:cjn({mergeNames:a((t,e,r)=>t.if((0,ql._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ql._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,ql._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ql._)`${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 pjn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ql._)`{}`);return e!==void 0&&isr(t,r,e),r}a(pjn,"evaluatedPropsToName");Os.evaluatedPropsToName=pjn;function isr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ql._)`${e}${(0,ql.getProperty)(n)}`,!0))}a(isr,"setEvaluated");Os.setEvaluated=isr;var ljn={};function JOs(t,e){return t.scopeValue("func",{ref:e,code:ljn[e.code]||(ljn[e.code]=new HOs._Code(e.code))})}a(JOs,"useFunc");Os.useFunc=JOs;var rsr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(rsr||(Os.Type=rsr={}));function ZOs(t,e,r){if(t instanceof ql.Name){let n=e===rsr.Num;return r?n?(0,ql._)`"[" + ${t} + "]"`:(0,ql._)`"['" + ${t} + "']"`:n?(0,ql._)`"/" + ${t}`:(0,ql._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ql.getProperty)(t).toString():"/"+nsr(t)}a(ZOs,"getErrorPath");Os.getErrorPath=ZOs;function hjn(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(hjn,"checkStrictMode");Os.checkStrictMode=hjn});var vF=I(osr=>{"use strict";p();Object.defineProperty(osr,"__esModule",{value:!0});var cE=ds(),XOs={data:new cE.Name("data"),valCxt:new cE.Name("valCxt"),instancePath:new cE.Name("instancePath"),parentData:new cE.Name("parentData"),parentDataProperty:new cE.Name("parentDataProperty"),rootData:new cE.Name("rootData"),dynamicAnchors:new cE.Name("dynamicAnchors"),vErrors:new cE.Name("vErrors"),errors:new cE.Name("errors"),this:new cE.Name("this"),self:new cE.Name("self"),scope:new cE.Name("scope"),json:new cE.Name("json"),jsonPos:new cE.Name("jsonPos"),jsonLen:new cE.Name("jsonLen"),jsonPart:new cE.Name("jsonPart")};osr.default=XOs});var gke=I(lE=>{"use strict";p();Object.defineProperty(lE,"__esModule",{value:!0});lE.extendErrors=lE.resetErrorsCount=lE.reportExtraError=lE.reportError=lE.keyword$DataError=lE.keywordError=void 0;var Wa=ds(),Wot=Va(),z_=vF();lE.keywordError={message:a(({keyword:t})=>(0,Wa.str)`must pass "${t}" keyword validation`,"message")};lE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Wa.str)`"${t}" keyword must be ${e} ($data)`:(0,Wa.str)`"${t}" keyword is invalid ($data)`,"message")};function e5s(t,e=lE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=Ajn(t,e,r);n??(c||l)?mjn(s,u):gjn(o,(0,Wa._)`[${u}]`)}a(e5s,"reportError");lE.reportError=e5s;function t5s(t,e=lE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=Ajn(t,e,r);mjn(o,l),s||c||gjn(n,z_.default.vErrors)}a(t5s,"reportExtraError");lE.reportExtraError=t5s;function r5s(t,e){t.assign(z_.default.errors,e),t.if((0,Wa._)`${z_.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Wa._)`${z_.default.vErrors}.length`,e),()=>t.assign(z_.default.vErrors,null)))}a(r5s,"resetErrorsCount");lE.resetErrorsCount=r5s;function n5s({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,z_.default.errors,l=>{t.const(c,(0,Wa._)`${z_.default.vErrors}[${l}]`),t.if((0,Wa._)`${c}.instancePath === undefined`,()=>t.assign((0,Wa._)`${c}.instancePath`,(0,Wa.strConcat)(z_.default.instancePath,s.errorPath))),t.assign((0,Wa._)`${c}.schemaPath`,(0,Wa.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Wa._)`${c}.schema`,r),t.assign((0,Wa._)`${c}.data`,n))})}a(n5s,"extendErrors");lE.extendErrors=n5s;function mjn(t,e){let r=t.const("err",e);t.if((0,Wa._)`${z_.default.vErrors} === null`,()=>t.assign(z_.default.vErrors,(0,Wa._)`[${r}]`),(0,Wa._)`${z_.default.vErrors}.push(${r})`),t.code((0,Wa._)`${z_.default.errors}++`)}a(mjn,"addError");function gjn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Wa._)`new ${t.ValidationError}(${e})`):(r.assign((0,Wa._)`${n}.errors`,e),r.return(!1))}a(gjn,"returnErrors");var pZ={keyword:new Wa.Name("keyword"),schemaPath:new Wa.Name("schemaPath"),params:new Wa.Name("params"),propertyName:new Wa.Name("propertyName"),message:new Wa.Name("message"),schema:new Wa.Name("schema"),parentSchema:new Wa.Name("parentSchema")};function Ajn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Wa._)`{}`:i5s(t,e,r)}a(Ajn,"errorObjectCode");function i5s(t,e,r={}){let{gen:n,it:o}=t,s=[o5s(o,r),s5s(t,r)];return a5s(t,e,s),n.object(...s)}a(i5s,"errorObject");function o5s({errorPath:t},{instancePath:e}){let r=e?(0,Wa.str)`${t}${(0,Wot.getErrorPath)(e,Wot.Type.Str)}`:t;return[z_.default.instancePath,(0,Wa.strConcat)(z_.default.instancePath,r)]}a(o5s,"errorInstancePath");function s5s({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Wa.str)`${e}/${t}`;return r&&(o=(0,Wa.str)`${o}${(0,Wot.getErrorPath)(r,Wot.Type.Str)}`),[pZ.schemaPath,o]}a(s5s,"errorSchemaPath");function a5s(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([pZ.keyword,o],[pZ.params,typeof e=="function"?e(t):e||(0,Wa._)`{}`]),u.messages&&n.push([pZ.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([pZ.schema,c],[pZ.parentSchema,(0,Wa._)`${f}${h}`],[z_.default.data,s]),d&&n.push([pZ.propertyName,d])}a(a5s,"extraErrorProps")});var Ejn=I(Tfe=>{"use strict";p();Object.defineProperty(Tfe,"__esModule",{value:!0});Tfe.boolOrEmptySchema=Tfe.topBoolOrEmptySchema=void 0;var c5s=gke(),l5s=ds(),u5s=vF(),d5s={message:"boolean schema is false"};function f5s(t){let{gen:e,schema:r,validateName:n}=t;r===!1?yjn(t,!1):typeof r=="object"&&r.$async===!0?e.return(u5s.default.data):(e.assign((0,l5s._)`${n}.errors`,null),e.return(!0))}a(f5s,"topBoolOrEmptySchema");Tfe.topBoolOrEmptySchema=f5s;function p5s(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),yjn(t)):r.var(e,!0)}a(p5s,"boolOrEmptySchema");Tfe.boolOrEmptySchema=p5s;function yjn(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,c5s.reportError)(o,d5s,void 0,e)}a(yjn,"falseSchemaError")});var ssr=I(Ife=>{"use strict";p();Object.defineProperty(Ife,"__esModule",{value:!0});Ife.getRules=Ife.isJSONType=void 0;var h5s=["string","number","integer","boolean","null","object","array"],m5s=new Set(h5s);function g5s(t){return typeof t=="string"&&m5s.has(t)}a(g5s,"isJSONType");Ife.isJSONType=g5s;function A5s(){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(A5s,"getRules");Ife.getRules=A5s});var asr=I(bj=>{"use strict";p();Object.defineProperty(bj,"__esModule",{value:!0});bj.shouldUseRule=bj.shouldUseGroup=bj.schemaHasRulesForType=void 0;function y5s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&_jn(t,n)}a(y5s,"schemaHasRulesForType");bj.schemaHasRulesForType=y5s;function _jn(t,e){return e.rules.some(r=>vjn(t,r))}a(_jn,"shouldUseGroup");bj.shouldUseGroup=_jn;function vjn(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(vjn,"shouldUseRule");bj.shouldUseRule=vjn});var Ake=I(uE=>{"use strict";p();Object.defineProperty(uE,"__esModule",{value:!0});uE.reportTypeError=uE.checkDataTypes=uE.checkDataType=uE.coerceAndCheckDataType=uE.getJSONTypes=uE.getSchemaTypes=uE.DataType=void 0;var E5s=ssr(),_5s=asr(),v5s=gke(),ts=ds(),Cjn=Va(),xfe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(xfe||(uE.DataType=xfe={}));function C5s(t){let e=bjn(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(C5s,"getSchemaTypes");uE.getSchemaTypes=C5s;function bjn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(E5s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(bjn,"getJSONTypes");uE.getJSONTypes=bjn;function b5s(t,e){let{gen:r,data:n,opts:o}=t,s=S5s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,_5s.schemaHasRulesForType)(t,e[0]));if(c){let l=lsr(e,n,o.strictNumbers,xfe.Wrong);r.if(l,()=>{s.length?T5s(t,e,s):usr(t)})}return c}a(b5s,"coerceAndCheckDataType");uE.coerceAndCheckDataType=b5s;var Sjn=new Set(["string","number","integer","boolean","null"]);function S5s(t,e){return e?t.filter(r=>Sjn.has(r)||e==="array"&&r==="array"):[]}a(S5s,"coerceToTypes");function T5s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,ts._)`typeof ${o}`),l=n.let("coerced",(0,ts._)`undefined`);s.coerceTypes==="array"&&n.if((0,ts._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,ts._)`${o}[0]`).assign(c,(0,ts._)`typeof ${o}`).if(lsr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,ts._)`${l} !== undefined`);for(let d of r)(Sjn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),usr(t),n.endIf(),n.if((0,ts._)`${l} !== undefined`,()=>{n.assign(o,l),I5s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,ts._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,ts._)`"" + ${o}`).elseIf((0,ts._)`${o} === null`).assign(l,(0,ts._)`""`);return;case"number":n.elseIf((0,ts._)`${c} == "boolean" || ${o} === null + || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,ts._)`+${o}`);return;case"integer":n.elseIf((0,ts._)`${c} === "boolean" || ${o} === null + || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,ts._)`+${o}`);return;case"boolean":n.elseIf((0,ts._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,ts._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,ts._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,ts._)`${c} === "string" || ${c} === "number" + || ${c} === "boolean" || ${o} === null`).assign(l,(0,ts._)`[${o}]`)}}a(u,"coerceSpecificType")}a(T5s,"coerceData");function I5s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ts._)`${e} !== undefined`,()=>t.assign((0,ts._)`${e}[${r}]`,n))}a(I5s,"assignParentData");function csr(t,e,r,n=xfe.Correct){let o=n===xfe.Correct?ts.operators.EQ:ts.operators.NEQ,s;switch(t){case"null":return(0,ts._)`${e} ${o} null`;case"array":s=(0,ts._)`Array.isArray(${e})`;break;case"object":s=(0,ts._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,ts._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,ts._)`typeof ${e} ${o} ${t}`}return n===xfe.Correct?s:(0,ts.not)(s);function c(l=ts.nil){return(0,ts.and)((0,ts._)`typeof ${e} == "number"`,l,r?(0,ts._)`isFinite(${e})`:ts.nil)}}a(csr,"checkDataType");uE.checkDataType=csr;function lsr(t,e,r,n){if(t.length===1)return csr(t[0],e,r,n);let o,s=(0,Cjn.toHash)(t);if(s.array&&s.object){let c=(0,ts._)`typeof ${e} != "object"`;o=s.null?c:(0,ts._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=ts.nil;s.number&&delete s.integer;for(let c in s)o=(0,ts.and)(o,csr(c,e,r,n));return o}a(lsr,"checkDataTypes");uE.checkDataTypes=lsr;var x5s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,ts._)`{type: ${t}}`:(0,ts._)`{type: ${e}}`,"params")};function usr(t){let e=w5s(t);(0,v5s.reportError)(e,x5s)}a(usr,"reportTypeError");uE.reportTypeError=usr;function w5s(t){let{gen:e,data:r,schema:n}=t,o=(0,Cjn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(w5s,"getTypeErrorContext")});var Ijn=I(zot=>{"use strict";p();Object.defineProperty(zot,"__esModule",{value:!0});zot.assignDefaults=void 0;var wfe=ds(),R5s=Va();function P5s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Tjn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Tjn(t,s,o.default))}a(P5s,"assignDefaults");zot.assignDefaults=P5s;function Tjn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,wfe._)`${s}${(0,wfe.getProperty)(e)}`;if(o){(0,R5s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,wfe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,wfe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,wfe._)`${l} = ${(0,wfe.stringify)(r)}`)}a(Tjn,"assignDefault")});var vw=I(Cl=>{"use strict";p();Object.defineProperty(Cl,"__esModule",{value:!0});Cl.validateUnion=Cl.validateArray=Cl.usePattern=Cl.callValidateCode=Cl.schemaProperties=Cl.allSchemaProperties=Cl.noPropertyInData=Cl.propertyInData=Cl.isOwnProperty=Cl.hasPropFunc=Cl.reportMissingProp=Cl.checkMissingProp=Cl.checkReportMissingProp=void 0;var id=ds(),dsr=Va(),Sj=vF(),k5s=Va();function D5s(t,e){let{gen:r,data:n,it:o}=t;r.if(psr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,id._)`${e}`},!0),t.error()})}a(D5s,"checkReportMissingProp");Cl.checkReportMissingProp=D5s;function N5s({gen:t,data:e,it:{opts:r}},n,o){return(0,id.or)(...n.map(s=>(0,id.and)(psr(t,e,s,r.ownProperties),(0,id._)`${o} = ${s}`)))}a(N5s,"checkMissingProp");Cl.checkMissingProp=N5s;function M5s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(M5s,"reportMissingProp");Cl.reportMissingProp=M5s;function xjn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,id._)`Object.prototype.hasOwnProperty`})}a(xjn,"hasPropFunc");Cl.hasPropFunc=xjn;function fsr(t,e,r){return(0,id._)`${xjn(t)}.call(${e}, ${r})`}a(fsr,"isOwnProperty");Cl.isOwnProperty=fsr;function O5s(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} !== undefined`;return n?(0,id._)`${o} && ${fsr(t,e,r)}`:o}a(O5s,"propertyInData");Cl.propertyInData=O5s;function psr(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} === undefined`;return n?(0,id.or)(o,(0,id.not)(fsr(t,e,r))):o}a(psr,"noPropertyInData");Cl.noPropertyInData=psr;function wjn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(wjn,"allSchemaProperties");Cl.allSchemaProperties=wjn;function B5s(t,e){return wjn(e).filter(r=>!(0,dsr.alwaysValidSchema)(t,e[r]))}a(B5s,"schemaProperties");Cl.schemaProperties=B5s;function L5s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,id._)`${t}, ${e}, ${n}${o}`:e,h=[[Sj.default.instancePath,(0,id.strConcat)(Sj.default.instancePath,s)],[Sj.default.parentData,c.parentData],[Sj.default.parentDataProperty,c.parentDataProperty],[Sj.default.rootData,Sj.default.rootData]];c.opts.dynamicRef&&h.push([Sj.default.dynamicAnchors,Sj.default.dynamicAnchors]);let m=(0,id._)`${f}, ${r.object(...h)}`;return u!==id.nil?(0,id._)`${l}.call(${u}, ${m})`:(0,id._)`${l}(${m})`}a(L5s,"callValidateCode");Cl.callValidateCode=L5s;var F5s=(0,id._)`new RegExp`;function U5s({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,id._)`${o.code==="new RegExp"?F5s:(0,k5s.useFunc)(t,o)}(${r}, ${n})`})}a(U5s,"usePattern");Cl.usePattern=U5s;function Q5s(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,id._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:dsr.Type.Num},s),e.if((0,id.not)(s),l)})}a(c,"validateItems")}a(Q5s,"validateArray");Cl.validateArray=Q5s;function q5s(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,dsr.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,id._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,id.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(q5s,"validateUnion");Cl.validateUnion=q5s});var kjn=I(n5=>{"use strict";p();Object.defineProperty(n5,"__esModule",{value:!0});n5.validateKeywordUsage=n5.validSchemaType=n5.funcKeywordCode=n5.macroKeywordCode=void 0;var Y_=ds(),hZ=vF(),j5s=vw(),H5s=gke();function G5s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=Pjn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Y_.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(G5s,"macroKeywordCode");n5.macroKeywordCode=G5s;function $5s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;W5s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=Pjn(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&&Rjn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&Rjn(t),E(()=>V5s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,Y_._)`await `),v=>n.assign(h,!1).if((0,Y_._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,Y_._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,Y_._)`${f}.errors`;return n.assign(_,null),y(Y_.nil),_}a(A,"validateSync");function y(_=e.async?(0,Y_._)`await `:Y_.nil){let v=u.opts.passContext?hZ.default.this:hZ.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Y_._)`${_}${(0,j5s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,Y_.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a($5s,"funcKeywordCode");n5.funcKeywordCode=$5s;function Rjn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Y_._)`${n.parentData}[${n.parentDataProperty}]`))}a(Rjn,"modifyData");function V5s(t,e){let{gen:r}=t;r.if((0,Y_._)`Array.isArray(${e})`,()=>{r.assign(hZ.default.vErrors,(0,Y_._)`${hZ.default.vErrors} === null ? ${e} : ${hZ.default.vErrors}.concat(${e})`).assign(hZ.default.errors,(0,Y_._)`${hZ.default.vErrors}.length`),(0,H5s.extendErrors)(t)},()=>t.error())}a(V5s,"addErrs");function W5s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(W5s,"checkAsyncKeyword");function Pjn(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,Y_.stringify)(r)})}a(Pjn,"useKeyword");function z5s(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(z5s,"validSchemaType");n5.validSchemaType=z5s;function Y5s({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(Y5s,"validateKeywordUsage");n5.validateKeywordUsage=Y5s});var Njn=I(Tj=>{"use strict";p();Object.defineProperty(Tj,"__esModule",{value:!0});Tj.extendSubschemaMode=Tj.extendSubschemaData=Tj.getSubschema=void 0;var i5=ds(),Djn=Va();function K5s(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,i5._)`${t.schemaPath}${(0,i5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,i5._)`${t.schemaPath}${(0,i5.getProperty)(e)}${(0,i5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Djn.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(K5s,"getSubschema");Tj.getSubschema=K5s;function J5s(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,i5._)`${e.data}${(0,i5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,i5.str)`${d}${(0,Djn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,i5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof i5.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(J5s,"extendSubschemaData");Tj.extendSubschemaData=J5s;function Z5s(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(Z5s,"extendSubschemaMode");Tj.extendSubschemaMode=Z5s});var hsr=I((buf,Mjn)=>{"use strict";p();Mjn.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 Bjn=I((Iuf,Ojn)=>{"use strict";p();var Ij=Ojn.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(){};Yot(e,n,o,t,"",t)};Ij.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ij.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ij.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ij.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 Yot(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 Ij.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(sb,"__esModule",{value:!0});sb.getSchemaRefs=sb.resolveUrl=sb.normalizeId=sb._getFullPath=sb.getFullPath=sb.inlineRef=void 0;var e4s=Va(),t4s=hsr(),r4s=Bjn(),n4s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i4s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!msr(t):e?Ljn(t)<=e:!1}a(i4s,"inlineRef");sb.inlineRef=i4s;var o4s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function msr(t){for(let e in t){if(o4s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(msr)||typeof r=="object"&&msr(r))return!0}return!1}a(msr,"hasRef");function Ljn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!n4s.has(r)&&(typeof t[r]=="object"&&(0,e4s.eachItem)(t[r],n=>e+=Ljn(n)),e===1/0))return 1/0}return e}a(Ljn,"countKeys");function Fjn(t,e="",r){r!==!1&&(e=Rfe(e));let n=t.parse(e);return Ujn(t,n)}a(Fjn,"getFullPath");sb.getFullPath=Fjn;function Ujn(t,e){return t.serialize(e).split("#")[0]+"#"}a(Ujn,"_getFullPath");sb._getFullPath=Ujn;var s4s=/#\/?$/;function Rfe(t){return t?t.replace(s4s,""):""}a(Rfe,"normalizeId");sb.normalizeId=Rfe;function a4s(t,e,r){return r=Rfe(r),t.resolve(e,r)}a(a4s,"resolveUrl");sb.resolveUrl=a4s;var c4s=/^[a-z_][-a-z0-9._]*$/i;function l4s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Rfe(t[r]||e),s={"":o},c=Fjn(n,o,!1),l={},u=new Set;return r4s(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=Rfe(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!==Rfe(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(!c4s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!t4s(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(l4s,"getSchemaRefs");sb.getSchemaRefs=l4s});var vke=I(xj=>{"use strict";p();Object.defineProperty(xj,"__esModule",{value:!0});xj.getData=xj.KeywordCxt=xj.validateFunctionCode=void 0;var Gjn=Ejn(),Qjn=Ake(),Asr=asr(),Kot=Ake(),u4s=Ijn(),_ke=kjn(),gsr=Njn(),ii=ds(),fo=vF(),d4s=yke(),CF=Va(),Eke=gke();function f4s(t){if(Wjn(t)&&(zjn(t),Vjn(t))){m4s(t);return}$jn(t,()=>(0,Gjn.topBoolOrEmptySchema)(t))}a(f4s,"validateFunctionCode");xj.validateFunctionCode=f4s;function $jn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ii._)`${fo.default.data}, ${fo.default.valCxt}`,n.$async,()=>{t.code((0,ii._)`"use strict"; ${qjn(r,o)}`),h4s(t,o),t.code(s)}):t.func(e,(0,ii._)`${fo.default.data}, ${p4s(o)}`,n.$async,()=>t.code(qjn(r,o)).code(s))}a($jn,"validateFunction");function p4s(t){return(0,ii._)`{${fo.default.instancePath}="", ${fo.default.parentData}, ${fo.default.parentDataProperty}, ${fo.default.rootData}=${fo.default.data}${t.dynamicRef?(0,ii._)`, ${fo.default.dynamicAnchors}={}`:ii.nil}}={}`}a(p4s,"destructureValCxt");function h4s(t,e){t.if(fo.default.valCxt,()=>{t.var(fo.default.instancePath,(0,ii._)`${fo.default.valCxt}.${fo.default.instancePath}`),t.var(fo.default.parentData,(0,ii._)`${fo.default.valCxt}.${fo.default.parentData}`),t.var(fo.default.parentDataProperty,(0,ii._)`${fo.default.valCxt}.${fo.default.parentDataProperty}`),t.var(fo.default.rootData,(0,ii._)`${fo.default.valCxt}.${fo.default.rootData}`),e.dynamicRef&&t.var(fo.default.dynamicAnchors,(0,ii._)`${fo.default.valCxt}.${fo.default.dynamicAnchors}`)},()=>{t.var(fo.default.instancePath,(0,ii._)`""`),t.var(fo.default.parentData,(0,ii._)`undefined`),t.var(fo.default.parentDataProperty,(0,ii._)`undefined`),t.var(fo.default.rootData,fo.default.data),e.dynamicRef&&t.var(fo.default.dynamicAnchors,(0,ii._)`{}`)})}a(h4s,"destructureValCxtES5");function m4s(t){let{schema:e,opts:r,gen:n}=t;$jn(t,()=>{r.$comment&&e.$comment&&Kjn(t),_4s(t),n.let(fo.default.vErrors,null),n.let(fo.default.errors,0),r.unevaluated&&g4s(t),Yjn(t),b4s(t)})}a(m4s,"topSchemaObjCode");function g4s(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(g4s,"resetEvaluated");function qjn(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(qjn,"funcSourceUrl");function A4s(t,e){if(Wjn(t)&&(zjn(t),Vjn(t))){y4s(t,e);return}(0,Gjn.boolOrEmptySchema)(t,e)}a(A4s,"subschemaCode");function Vjn({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(Vjn,"schemaCxtHasRules");function Wjn(t){return typeof t.schema!="boolean"}a(Wjn,"isSchemaObj");function y4s(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&Kjn(t),v4s(t),C4s(t);let s=n.const("_errs",fo.default.errors);Yjn(t,s),n.var(e,(0,ii._)`${s} === ${fo.default.errors}`)}a(y4s,"subSchemaObjCode");function zjn(t){(0,CF.checkUnknownRules)(t),E4s(t)}a(zjn,"checkKeywords");function Yjn(t,e){if(t.opts.jtd)return jjn(t,[],!1,e);let r=(0,Qjn.getSchemaTypes)(t.schema),n=(0,Qjn.coerceAndCheckDataType)(t,r);jjn(t,r,!n,e)}a(Yjn,"typeAndKeywords");function E4s(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,CF.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(E4s,"checkRefsAndKeywords");function _4s(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,CF.checkStrictMode)(t,"default is ignored in the schema root")}a(_4s,"checkNoDefault");function v4s(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,d4s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(v4s,"updateContext");function C4s(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(C4s,"checkAsyncSchema");function Kjn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ii._)`${fo.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._)`${fo.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(Kjn,"commentKeyword");function b4s(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ii._)`${fo.default.errors} === 0`,()=>e.return(fo.default.data),()=>e.throw((0,ii._)`new ${o}(${fo.default.vErrors})`)):(e.assign((0,ii._)`${n}.errors`,fo.default.vErrors),s.unevaluated&&S4s(t),e.return((0,ii._)`${fo.default.errors} === 0`))}a(b4s,"returnResults");function S4s({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(S4s,"assignEvaluated");function jjn(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,CF.schemaHasRulesButRef)(s,f))){o.block(()=>Zjn(t,"$ref",f.all.$ref.definition));return}u.jtd||T4s(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Asr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,Kot.checkDataType)(m.type,c,u.strictNumbers)),Hjn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,Kot.reportTypeError)(t)),o.endIf()):Hjn(t,m),l||o.if((0,ii._)`${fo.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(jjn,"schemaKeywords");function Hjn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,u4s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Asr.shouldUseRule)(n,s)&&Zjn(t,s.keyword,s.definition,e.type)})}a(Hjn,"iterateKeywords");function T4s(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(I4s(t,e),t.opts.allowUnionTypes||x4s(t,e),w4s(t,t.dataTypes))}a(T4s,"checkStrictTypes");function I4s(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Jjn(t.dataTypes,r)||ysr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),P4s(t,e)}}a(I4s,"checkContextTypes");function x4s(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&ysr(t,"use allowUnionTypes to allow union type keyword")}a(x4s,"checkMultipleTypes");function w4s(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Asr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>R4s(e,c))&&ysr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(w4s,"checkKeywordTypes");function R4s(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(R4s,"hasApplicableType");function Jjn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(Jjn,"includesType");function P4s(t,e){let r=[];for(let n of t.dataTypes)Jjn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(P4s,"narrowSchemaTypes");function ysr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,CF.checkStrictMode)(t,e,t.opts.strictTypes)}a(ysr,"strictTypesError");var Jot=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,_ke.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,CF.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",Xjn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,_ke.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",fo.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?Eke.reportExtraError:Eke.reportError)(this,this.def.error,r)}$dataError(){(0,Eke.reportError)(this,this.def.$dataError||Eke.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Eke.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,Kot.checkDataTypes)(u,r,s.opts.strictNumbers,Kot.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,gsr.getSubschema)(this.it,e);(0,gsr.extendSubschemaData)(n,this.it,e),(0,gsr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return A4s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=CF.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=CF.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}};xj.KeywordCxt=Jot;function Zjn(t,e,r,n){let o=new Jot(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,_ke.funcKeywordCode)(o,r):"macro"in r?(0,_ke.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,_ke.funcKeywordCode)(o,r)}a(Zjn,"keywordCode");var k4s=/^\/(?:[^~]|~0|~1)*$/,D4s=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Xjn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return fo.default.rootData;if(t[0]==="/"){if(!k4s.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=fo.default.rootData}else{let d=D4s.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,CF.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(Xjn,"getData");xj.getData=Xjn});var Zot=I(_sr=>{"use strict";p();Object.defineProperty(_sr,"__esModule",{value:!0});var Esr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};_sr.default=Esr});var Cke=I(bsr=>{"use strict";p();Object.defineProperty(bsr,"__esModule",{value:!0});var vsr=yke(),Csr=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,vsr.resolveUrl)(e,r,n),this.missingSchema=(0,vsr.normalizeId)((0,vsr.getFullPath)(e,this.missingRef))}};bsr.default=Csr});var est=I(Cw=>{"use strict";p();Object.defineProperty(Cw,"__esModule",{value:!0});Cw.resolveSchema=Cw.getCompilingSchema=Cw.resolveRef=Cw.compileSchema=Cw.SchemaEnv=void 0;var Zk=ds(),N4s=Zot(),mZ=vF(),Xk=yke(),eHn=Va(),M4s=vke(),Pfe=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,Xk.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Cw.SchemaEnv=Pfe;function Tsr(t){let e=tHn.call(this,t);if(e)return e;let r=(0,Xk.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new Zk.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:N4s.default,code:(0,Zk._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:mZ.default.data,parentData:mZ.default.parentData,parentDataProperty:mZ.default.parentDataProperty,dataNames:[mZ.default.data],dataPathArr:[Zk.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Zk.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Zk.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Zk._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,M4s.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(mZ.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${mZ.default.self}`,`${mZ.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 Zk.Name?void 0:A,items:y instanceof Zk.Name?void 0:y,dynamicProps:A instanceof Zk.Name,dynamicItems:y instanceof Zk.Name},g.source&&(g.source.evaluated=(0,Zk.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(Tsr,"compileSchema");Cw.compileSchema=Tsr;function O4s(t,e,r){var n;r=(0,Xk.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=F4s.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 Pfe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=B4s.call(this,s)}a(O4s,"resolveRef");Cw.resolveRef=O4s;function B4s(t){return(0,Xk.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Tsr.call(this,t)}a(B4s,"inlineOrCompile");function tHn(t){for(let e of this._compilations)if(L4s(e,t))return e}a(tHn,"getCompilingSchema");Cw.getCompilingSchema=tHn;function L4s(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(L4s,"sameSchemaEnv");function F4s(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Xot.call(this,t,e)}a(F4s,"resolve");function Xot(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Xk._getFullPath)(this.opts.uriResolver,r),o=(0,Xk.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Ssr.call(this,r,t);let s=(0,Xk.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=Xot.call(this,t,c);return typeof l?.schema!="object"?void 0:Ssr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||Tsr.call(this,c),s===(0,Xk.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,Xk.resolveUrl)(this.opts.uriResolver,o,d)),new Pfe({schema:l,schemaId:u,root:t,baseId:o})}return Ssr.call(this,r,c)}}a(Xot,"resolveSchema");Cw.resolveSchema=Xot;var U4s=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ssr(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,eHn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!U4s.has(l)&&d&&(e=(0,Xk.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,eHn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,Xk.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Xot.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Pfe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(Ssr,"getJsonPointer")});var rHn=I((Guf,Q4s)=>{Q4s.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 wsr=I(($uf,cHn)=>{"use strict";p();var q4s=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),iHn=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),Isr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),oHn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),j4s=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function xsr(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(xsr,"stringArrayToHexStripped");var H4s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function nHn(t){return t.length=0,!0}a(nHn,"consumeIsZone");function G4s(t,e,r){if(t.length){let n=xsr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(G4s,"consumeHextets");function $4s(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=G4s;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=nHn}else{o.push(d);continue}}return o.length&&(l===nHn?r.zone=o.join(""):c?n.push(o.join("")):n.push(xsr(o))),r.address=n.join(""),r}a($4s,"getIPV6");function sHn(t){if(V4s(t,":")<2)return{host:t,isIPV6:!1};let e=$4s(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(sHn,"normalizeIPv6");function V4s(t,e){let r=0;for(let n=0;nz4s[n])}a(aHn,"reescapeHostDelimiters");function J4s(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:tBs}=wsr(),rBs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,nBs=["http","https","ws","wss","urn","urn:uuid"];function iBs(t){return nBs.indexOf(t)!==-1}a(iBs,"isValidSchemeName");function Rsr(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(Rsr,"wsIsSecure");function lHn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(lHn,"httpParse");function uHn(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(uHn,"httpSerialize");function oBs(t){return t.secure=Rsr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(oBs,"wsParse");function sBs(t){if((t.port===(Rsr(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(sBs,"wsSerialize");function aBs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(rBs);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=Psr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(aBs,"urnParse");function cBs(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=Psr(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(cBs,"urnSerialize");function lBs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!tBs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(lBs,"urnuuidParse");function uBs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(uBs,"urnuuidSerialize");var dHn={scheme:"http",domainHost:!0,parse:lHn,serialize:uHn},dBs={scheme:"https",domainHost:dHn.domainHost,parse:lHn,serialize:uHn},tst={scheme:"ws",domainHost:!0,parse:oBs,serialize:sBs},fBs={scheme:"wss",domainHost:tst.domainHost,parse:tst.parse,serialize:tst.serialize},pBs={scheme:"urn",parse:aBs,serialize:cBs,skipNormalize:!0},hBs={scheme:"urn:uuid",parse:lBs,serialize:uBs,skipNormalize:!0},rst={http:dHn,https:dBs,ws:tst,wss:fBs,urn:pBs,"urn:uuid":hBs};Object.setPrototypeOf(rst,null);function Psr(t){return t&&(rst[t]||rst[t.toLowerCase()])||void 0}a(Psr,"getSchemeHandler");fHn.exports={wsIsSecure:Rsr,SCHEMES:rst,isValidSchemeName:iBs,getSchemeHandler:Psr}});var EHn=I((Juf,nst)=>{"use strict";p();var{normalizeIPv6:mBs,removeDotSegments:bke,recomposeAuthority:gBs,normalizePercentEncoding:ABs,normalizePathEncoding:yBs,escapePreservingEscapes:EBs,reescapeHostDelimiters:_Bs,isIPv4:vBs,nonSimpleDomain:CBs}=wsr(),{SCHEMES:bBs,getSchemeHandler:mHn}=pHn();function SBs(t,e){return typeof t=="string"?t=RBs(t,e):typeof t=="object"&&(t=kfe(gZ(t,e),e)),t}a(SBs,"normalize");function TBs(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=gHn(kfe(t,n),kfe(e,n),n,!0);return n.skipEscape=!0,gZ(o,n)}a(TBs,"resolve");function gHn(t,e,r,n){let o={};return n||(t=kfe(gZ(t,r),r),e=kfe(gZ(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=bke(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=bke(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=bke(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=bke(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(gHn,"resolveComponent");function IBs(t,e,r){let n=hHn(t,r),o=hHn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(IBs,"equal");function gZ(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=mHn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=ABs(r.path):(r.path=EBs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=gBs(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=bke(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(gZ,"serialize");var xBs=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function wBs(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(wBs,"getParseError");function AHn(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(xBs);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=wBs(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(vBs(n.host)===!1){let f=mBs(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=mHn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&CBs(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=_Bs(unescape(n.host),s))),n.path&&(n.path=yBs(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(AHn,"parseWithStatus");function kfe(t,e){return AHn(t,e).parsed}a(kfe,"parse");function RBs(t,e){return yHn(t,e).normalized}a(RBs,"normalizeString");function yHn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=AHn(t,e);return{normalized:n?t:gZ(r,e),malformedAuthorityOrPort:n}}a(yHn,"normalizeStringWithStatus");function hHn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=yHn(t,e);return n?void 0:r}if(typeof t=="object")return gZ(t,e)}a(hHn,"normalizeComparableURI");var ksr={SCHEMES:bBs,normalize:SBs,resolve:TBs,resolveComponent:gHn,equal:IBs,serialize:gZ,parse:kfe};nst.exports=ksr;nst.exports.default=ksr;nst.exports.fastUri=ksr});var vHn=I(Dsr=>{"use strict";p();Object.defineProperty(Dsr,"__esModule",{value:!0});var _Hn=EHn();_Hn.code='require("ajv/dist/runtime/uri").default';Dsr.default=_Hn});var RHn=I(BA=>{"use strict";p();Object.defineProperty(BA,"__esModule",{value:!0});BA.CodeGen=BA.Name=BA.nil=BA.stringify=BA.str=BA._=BA.KeywordCxt=void 0;var PBs=vke();Object.defineProperty(BA,"KeywordCxt",{enumerable:!0,get:a(function(){return PBs.KeywordCxt},"get")});var Dfe=ds();Object.defineProperty(BA,"_",{enumerable:!0,get:a(function(){return Dfe._},"get")});Object.defineProperty(BA,"str",{enumerable:!0,get:a(function(){return Dfe.str},"get")});Object.defineProperty(BA,"stringify",{enumerable:!0,get:a(function(){return Dfe.stringify},"get")});Object.defineProperty(BA,"nil",{enumerable:!0,get:a(function(){return Dfe.nil},"get")});Object.defineProperty(BA,"Name",{enumerable:!0,get:a(function(){return Dfe.Name},"get")});Object.defineProperty(BA,"CodeGen",{enumerable:!0,get:a(function(){return Dfe.CodeGen},"get")});var kBs=Zot(),IHn=Cke(),DBs=ssr(),Ske=est(),NBs=ds(),Tke=yke(),ist=Ake(),Msr=Va(),CHn=rHn(),MBs=vHn(),xHn=a((t,e)=>new RegExp(t,e),"defaultRegExp");xHn.code="new RegExp";var OBs=["removeAdditional","useDefaults","coerceTypes"],BBs=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),LBs={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."},FBs={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},bHn=200;function UBs(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:xHn,M=(o=t.uriResolver)!==null&&o!==void 0?o:MBs.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:bHn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:bHn,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(UBs,"requiredOptions");var Ike=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,...UBs(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new NBs.ValueScope({scope:{},prefixes:BBs,es5:r,lines:n}),this.logger=$Bs(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,DBs.getRules)(),SHn.call(this,LBs,e,"NOT SUPPORTED"),SHn.call(this,FBs,e,"DEPRECATED","warn"),this._metaOpts=HBs.call(this),e.formats&&qBs.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&jBs.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),QBs.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=CHn;n==="id"&&(o={...CHn},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 IHn.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,Tke.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=THn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Ske.SchemaEnv({schema:{},schemaId:n});if(r=Ske.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=THn.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,Tke.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(WBs.call(this,n,r),!r)return(0,Msr.eachItem)(n,s=>Nsr.call(this,s)),this;YBs.call(this,r);let o={...r,type:(0,ist.getJSONTypes)(r.type),schemaType:(0,ist.getJSONTypes)(r.schemaType)};return(0,Msr.eachItem)(n,o.type.length===0?s=>Nsr.call(this,s,o):s=>o.type.forEach(c=>Nsr.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]=wHn(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,Tke.normalizeId)(c||n);let d=Tke.getSchemaRefs.call(this,e,n);return u=new Ske.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):Ske.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{Ske.compileSchema.call(this,e)}finally{this.opts=r}}};Ike.ValidationError=kBs.default;Ike.MissingRefError=IHn.default;BA.default=Ike;function SHn(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(SHn,"checkOptions");function THn(t){return t=(0,Tke.normalizeId)(t),this.schemas[t]||this.refs[t]}a(THn,"getSchEnv");function QBs(){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(QBs,"addInitialSchemas");function qBs(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(qBs,"addInitialFormats");function jBs(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(jBs,"addInitialKeywords");function HBs(){let t={...this.opts};for(let e of OBs)delete t[e];return t}a(HBs,"getMetaSchemaOptions");var GBs={log(){},warn(){},error(){}};function $Bs(t){if(t===!1)return GBs;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($Bs,"getLogger");var VBs=/^[a-z_$][a-z0-9_$:-]*$/i;function WBs(t,e){let{RULES:r}=this;if((0,Msr.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!VBs.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(WBs,"checkKeyword");function Nsr(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,ist.getJSONTypes)(e.type),schemaType:(0,ist.getJSONTypes)(e.schemaType)}};e.before?zBs.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(Nsr,"addRule");function zBs(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(zBs,"addBeforeRule");function YBs(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=wHn(e)),t.validateSchema=this.compile(e,!0))}a(YBs,"keywordMetaschema");var KBs={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function wHn(t){return{anyOf:[t,KBs]}}a(wHn,"schemaOrData")});var PHn=I(Osr=>{"use strict";p();Object.defineProperty(Osr,"__esModule",{value:!0});var JBs={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Osr.default=JBs});var MHn=I(AZ=>{"use strict";p();Object.defineProperty(AZ,"__esModule",{value:!0});AZ.callRef=AZ.getValidate=void 0;var ZBs=Cke(),kHn=vw(),ab=ds(),Nfe=vF(),DHn=est(),ost=Va(),XBs={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=DHn.resolveRef.call(u,d,o,r);if(f===void 0)throw new ZBs.default(n.opts.uriResolver,o,r);if(f instanceof DHn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return sst(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return sst(t,(0,ab._)`${A}.validate`,d,d.$async)}function m(A){let y=NHn(t,A);sst(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,ab.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:ab.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function NHn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ab._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(NHn,"getValidate");AZ.getValidate=NHn;function sst(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?Nfe.default.this:ab.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,ab._)`await ${(0,kHn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,ab._)`!(${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,kHn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,ab._)`${A}.errors`;o.assign(Nfe.default.vErrors,(0,ab._)`${Nfe.default.vErrors} === null ? ${y} : ${Nfe.default.vErrors}.concat(${y})`),o.assign(Nfe.default.errors,(0,ab._)`${Nfe.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=ost.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,ab._)`${A}.evaluated.props`);s.props=ost.mergeEvaluated.props(o,_,s.props,ab.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=ost.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,ab._)`${A}.evaluated.items`);s.items=ost.mergeEvaluated.items(o,_,s.items,ab.Name)}}a(g,"addEvaluatedFrom")}a(sst,"callRef");AZ.callRef=sst;AZ.default=XBs});var OHn=I(Bsr=>{"use strict";p();Object.defineProperty(Bsr,"__esModule",{value:!0});var eLs=PHn(),tLs=MHn(),rLs=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",eLs.default,tLs.default];Bsr.default=rLs});var BHn=I(Lsr=>{"use strict";p();Object.defineProperty(Lsr,"__esModule",{value:!0});var ast=ds(),wj=ast.operators,cst={maximum:{okStr:"<=",ok:wj.LTE,fail:wj.GT},minimum:{okStr:">=",ok:wj.GTE,fail:wj.LT},exclusiveMaximum:{okStr:"<",ok:wj.LT,fail:wj.GTE},exclusiveMinimum:{okStr:">",ok:wj.GT,fail:wj.LTE}},nLs={message:a(({keyword:t,schemaCode:e})=>(0,ast.str)`must be ${cst[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,ast._)`{comparison: ${cst[t].okStr}, limit: ${e}}`,"params")},iLs={keyword:Object.keys(cst),type:"number",schemaType:"number",$data:!0,error:nLs,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ast._)`${r} ${cst[e].fail} ${n} || isNaN(${r})`)}};Lsr.default=iLs});var LHn=I(Fsr=>{"use strict";p();Object.defineProperty(Fsr,"__esModule",{value:!0});var xke=ds(),oLs={message:a(({schemaCode:t})=>(0,xke.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,xke._)`{multipleOf: ${t}}`,"params")},sLs={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:oLs,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,xke._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,xke._)`${c} !== parseInt(${c})`;t.fail$data((0,xke._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};Fsr.default=sLs});var UHn=I(Usr=>{"use strict";p();Object.defineProperty(Usr,"__esModule",{value:!0});function FHn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(Qsr,"__esModule",{value:!0});var yZ=ds(),aLs=Va(),cLs=UHn(),lLs={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,yZ.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,yZ._)`{limit: ${t}}`,"params")},uLs={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:lLs,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?yZ.operators.GT:yZ.operators.LT,c=o.opts.unicode===!1?(0,yZ._)`${r}.length`:(0,yZ._)`${(0,aLs.useFunc)(t.gen,cLs.default)}(${r})`;t.fail$data((0,yZ._)`${c} ${s} ${n}`)}};Qsr.default=uLs});var qHn=I(qsr=>{"use strict";p();Object.defineProperty(qsr,"__esModule",{value:!0});var dLs=vw(),fLs=Va(),Mfe=ds(),pLs={message:a(({schemaCode:t})=>(0,Mfe.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,Mfe._)`{pattern: ${t}}`,"params")},hLs={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:pLs,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,Mfe._)`new RegExp`:(0,fLs.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,Mfe._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,Mfe._)`!${f}`)}else{let u=(0,dLs.usePattern)(t,o);t.fail$data((0,Mfe._)`!${u}.test(${r})`)}}};qsr.default=hLs});var jHn=I(jsr=>{"use strict";p();Object.defineProperty(jsr,"__esModule",{value:!0});var wke=ds(),mLs={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,wke.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,wke._)`{limit: ${t}}`,"params")},gLs={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:mLs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?wke.operators.GT:wke.operators.LT;t.fail$data((0,wke._)`Object.keys(${r}).length ${o} ${n}`)}};jsr.default=gLs});var HHn=I(Hsr=>{"use strict";p();Object.defineProperty(Hsr,"__esModule",{value:!0});var Rke=vw(),Pke=ds(),ALs=Va(),yLs={message:a(({params:{missingProperty:t}})=>(0,Pke.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,Pke._)`{missingProperty: ${t}}`,"params")},ELs={keyword:"required",type:"object",schemaType:"array",$data:!0,error:yLs,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,ALs.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(Pke.nil,h);else for(let g of r)(0,Rke.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,Rke.checkMissingProp)(t,r,g)),(0,Rke.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,Rke.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,Rke.propertyInData)(e,o,g,l.ownProperties)),e.if((0,Pke.not)(A),()=>{t.error(),e.break()})},Pke.nil)}a(m,"loopUntilMissing")}};Hsr.default=ELs});var GHn=I(Gsr=>{"use strict";p();Object.defineProperty(Gsr,"__esModule",{value:!0});var kke=ds(),_Ls={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,kke.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,kke._)`{limit: ${t}}`,"params")},vLs={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:_Ls,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?kke.operators.GT:kke.operators.LT;t.fail$data((0,kke._)`${r}.length ${o} ${n}`)}};Gsr.default=vLs});var lst=I($sr=>{"use strict";p();Object.defineProperty($sr,"__esModule",{value:!0});var $Hn=hsr();$Hn.code='require("ajv/dist/runtime/equal").default';$sr.default=$Hn});var VHn=I(Wsr=>{"use strict";p();Object.defineProperty(Wsr,"__esModule",{value:!0});var Vsr=Ake(),LA=ds(),CLs=Va(),bLs=lst(),SLs={message:a(({params:{i:t,j:e}})=>(0,LA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,LA._)`{i: ${t}, j: ${e}}`,"params")},TLs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:SLs,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,Vsr.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,LA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,LA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,LA._)`${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,Vsr.checkDataTypes)(d,E,l.opts.strictNumbers,Vsr.DataType.Wrong),v=e.const("indices",(0,LA._)`{}`);e.for((0,LA._)`;${A}--;`,()=>{e.let(E,(0,LA._)`${r}[${A}]`),e.if(_,(0,LA._)`continue`),d.length>1&&e.if((0,LA._)`typeof ${E} == "string"`,(0,LA._)`${E} += "_"`),e.if((0,LA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,LA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,LA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,CLs.useFunc)(e,bLs.default),_=e.name("outer");e.label(_).for((0,LA._)`;${A}--;`,()=>e.for((0,LA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,LA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};Wsr.default=TLs});var WHn=I(Ysr=>{"use strict";p();Object.defineProperty(Ysr,"__esModule",{value:!0});var zsr=ds(),ILs=Va(),xLs=lst(),wLs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,zsr._)`{allowedValue: ${t}}`,"params")},RLs={keyword:"const",$data:!0,error:wLs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,zsr._)`!${(0,ILs.useFunc)(e,xLs.default)}(${r}, ${o})`):t.fail((0,zsr._)`${s} !== ${r}`)}};Ysr.default=RLs});var zHn=I(Ksr=>{"use strict";p();Object.defineProperty(Ksr,"__esModule",{value:!0});var Dke=ds(),PLs=Va(),kLs=lst(),DLs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,Dke._)`{allowedValues: ${t}}`,"params")},NLs={keyword:"enum",schemaType:"array",$data:!0,error:DLs,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,PLs.useFunc)(e,kLs.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,Dke.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,Dke._)`${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,Dke._)`${d()}(${r}, ${g}[${A}])`:(0,Dke._)`${r} === ${y}`}a(m,"equalCode")}};Ksr.default=NLs});var YHn=I(Jsr=>{"use strict";p();Object.defineProperty(Jsr,"__esModule",{value:!0});var MLs=BHn(),OLs=LHn(),BLs=QHn(),LLs=qHn(),FLs=jHn(),ULs=HHn(),QLs=GHn(),qLs=VHn(),jLs=WHn(),HLs=zHn(),GLs=[MLs.default,OLs.default,BLs.default,LLs.default,FLs.default,ULs.default,QLs.default,qLs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},jLs.default,HLs.default];Jsr.default=GLs});var Xsr=I(Nke=>{"use strict";p();Object.defineProperty(Nke,"__esModule",{value:!0});Nke.validateAdditionalItems=void 0;var EZ=ds(),Zsr=Va(),$Ls={message:a(({params:{len:t}})=>(0,EZ.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,EZ._)`{limit: ${t}}`,"params")},VLs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:$Ls,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Zsr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}KHn(t,n)}};function KHn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,EZ._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,EZ._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Zsr.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,EZ._)`${l} <= ${e.length}`);r.if((0,EZ.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Zsr.Type.Num},d),c.allErrors||r.if((0,EZ.not)(d),()=>r.break())})}a(u,"validateItems")}a(KHn,"validateAdditionalItems");Nke.validateAdditionalItems=KHn;Nke.default=VLs});var ear=I(Mke=>{"use strict";p();Object.defineProperty(Mke,"__esModule",{value:!0});Mke.validateTuple=void 0;var JHn=ds(),ust=Va(),WLs=vw(),zLs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return ZHn(t,"additionalItems",e);r.items=!0,!(0,ust.alwaysValidSchema)(r,e)&&t.ok((0,WLs.validateArray)(t))}};function ZHn(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=ust.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,JHn._)`${s}.length`);r.forEach((h,m)=>{(0,ust.alwaysValidSchema)(l,h)||(n.if((0,JHn._)`${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,ust.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(ZHn,"validateTuple");Mke.validateTuple=ZHn;Mke.default=zLs});var XHn=I(tar=>{"use strict";p();Object.defineProperty(tar,"__esModule",{value:!0});var YLs=ear(),KLs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,YLs.validateTuple)(t,"items"),"code")};tar.default=KLs});var tGn=I(rar=>{"use strict";p();Object.defineProperty(rar,"__esModule",{value:!0});var eGn=ds(),JLs=Va(),ZLs=vw(),XLs=Xsr(),e3s={message:a(({params:{len:t}})=>(0,eGn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,eGn._)`{limit: ${t}}`,"params")},t3s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:e3s,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,JLs.alwaysValidSchema)(n,e)&&(o?(0,XLs.validateAdditionalItems)(t,o):t.ok((0,ZLs.validateArray)(t)))}};rar.default=t3s});var rGn=I(nar=>{"use strict";p();Object.defineProperty(nar,"__esModule",{value:!0});var bw=ds(),dst=Va(),r3s={message:a(({params:{min:t,max:e}})=>e===void 0?(0,bw.str)`must contain at least ${t} valid item(s)`:(0,bw.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,bw._)`{minContains: ${t}}`:(0,bw._)`{minContains: ${t}, maxContains: ${e}}`,"params")},n3s={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:r3s,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,bw._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,dst.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,dst.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,dst.alwaysValidSchema)(s,r)){let y=(0,bw._)`${f} >= ${c}`;l!==void 0&&(y=(0,bw._)`${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,bw._)`${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:dst.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,bw._)`${y}++`),l===void 0?e.if((0,bw._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,bw._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,bw._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};nar.default=n3s});var oGn=I(s5=>{"use strict";p();Object.defineProperty(s5,"__esModule",{value:!0});s5.validateSchemaDeps=s5.validatePropertyDeps=s5.error=void 0;var iar=ds(),i3s=Va(),Oke=vw();s5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,iar.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,iar._)`{property: ${t}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`,"params")};var q6s={keyword:"dependencies",type:"object",schemaType:"object",error:g5.error,code(t){let[e,r]=j6s(t);VGn(t,e),WGn(t,r)}};function j6s({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(j6s,"splitDependencies");function VGn(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,t2e.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,t2e.checkReportMissingProp)(t,d)}):(r.if((0,Yar._)`${u} && (${(0,t2e.checkMissingProp)(t,l,s)})`),(0,t2e.reportMissingProp)(t,s),r.else())}}a(VGn,"validatePropertyDeps");g5.validatePropertyDeps=VGn;function WGn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,Q6s.alwaysValidSchema)(s,e[l])||(r.if((0,t2e.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(WGn,"validateSchemaDeps");g5.validateSchemaDeps=WGn;g5.default=q6s});var KGn=I(Kar=>{"use strict";p();Object.defineProperty(Kar,"__esModule",{value:!0});var YGn=hs(),H6s=za(),G6s={message:"property name must be valid",params:a(({params:t})=>(0,YGn._)`{propertyName: ${t.propertyName}}`,"params")},$6s={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:G6s,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,H6s.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,YGn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Kar.default=$6s});var Zar=I(Jar=>{"use strict";p();Object.defineProperty(Jar,"__esModule",{value:!0});var Vst=ww(),c2=hs(),V6s=NF(),Wst=za(),W6s={message:"must NOT have additional properties",params:a(({params:t})=>(0,c2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},z6s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:W6s,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,Wst.alwaysValidSchema)(c,r))return;let d=(0,Vst.allSchemaProperties)(n.properties),f=(0,Vst.allSchemaProperties)(n.patternProperties);h(),t.ok((0,c2._)`${s} === ${V6s.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,Wst.schemaRefOrVal)(c,n.properties,"properties");_=(0,Vst.isOwnProperty)(e,v,E)}else d.length?_=(0,c2.or)(...d.map(v=>(0,c2._)`${E} === ${v}`)):_=c2.nil;return f.length&&(_=(0,c2.or)(_,...f.map(v=>(0,c2._)`${(0,Vst.usePattern)(t,v)}.test(${E})`))),(0,c2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,c2._)`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,Wst.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,c2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,c2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:Wst.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};Jar.default=z6s});var XGn=I(ecr=>{"use strict";p();Object.defineProperty(ecr,"__esModule",{value:!0});var Y6s=qPe(),JGn=ww(),Xar=za(),ZGn=Zar(),K6s={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&&ZGn.default.code(new Y6s.KeywordCxt(s,ZGn.default,"additionalProperties"));let c=(0,JGn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Xar.mergeEvaluated.props(e,(0,Xar.toHash)(c),s.props));let l=c.filter(h=>!(0,Xar.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,JGn.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")}};ecr.default=K6s});var n$n=I(tcr=>{"use strict";p();Object.defineProperty(tcr,"__esModule",{value:!0});var e$n=ww(),zst=hs(),t$n=za(),r$n=za(),J6s={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,e$n.allSchemaProperties)(r),u=l.filter(y=>(0,t$n.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 zst.Name)&&(s.props=(0,r$n.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,t$n.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,zst._)`${(0,e$n.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:r$n.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,zst._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,zst.not)(f),()=>e.break())})})}a(A,"validateProperties")}};tcr.default=J6s});var i$n=I(rcr=>{"use strict";p();Object.defineProperty(rcr,"__esModule",{value:!0});var Z6s=za(),X6s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Z6s.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"}};rcr.default=X6s});var o$n=I(ncr=>{"use strict";p();Object.defineProperty(ncr,"__esModule",{value:!0});var e9s=ww(),t9s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e9s.validateUnion,error:{message:"must match a schema in anyOf"}};ncr.default=t9s});var s$n=I(icr=>{"use strict";p();Object.defineProperty(icr,"__esModule",{value:!0});var Yst=hs(),r9s=za(),n9s={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,Yst._)`{passingSchemas: ${t.passing}}`,"params")},i9s={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n9s,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,r9s.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Yst._)`${u} && ${c}`).assign(c,!1).assign(l,(0,Yst._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,Yst.Name)})})}a(d,"validateOneOf")}};icr.default=i9s});var a$n=I(ocr=>{"use strict";p();Object.defineProperty(ocr,"__esModule",{value:!0});var o9s=za(),s9s={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,o9s.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};ocr.default=s9s});var u$n=I(scr=>{"use strict";p();Object.defineProperty(scr,"__esModule",{value:!0});var Kst=hs(),l$n=za(),a9s={message:a(({params:t})=>(0,Kst.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Kst._)`{failingKeyword: ${t.ifClause}}`,"params")},c9s={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:a9s,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,l$n.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=c$n(n,"then"),s=c$n(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,Kst.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,Kst._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function c$n(t,e){let r=t.schema[e];return r!==void 0&&!(0,l$n.alwaysValidSchema)(t,r)}a(c$n,"hasSchema");scr.default=c9s});var d$n=I(acr=>{"use strict";p();Object.defineProperty(acr,"__esModule",{value:!0});var l9s=za(),u9s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,l9s.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};acr.default=u9s});var f$n=I(ccr=>{"use strict";p();Object.defineProperty(ccr,"__esModule",{value:!0});var d9s=Gar(),f9s=jGn(),p9s=$ar(),h9s=GGn(),m9s=$Gn(),g9s=zGn(),A9s=KGn(),y9s=Zar(),E9s=XGn(),_9s=n$n(),C9s=i$n(),v9s=o$n(),b9s=s$n(),S9s=a$n(),T9s=u$n(),I9s=d$n();function x9s(t=!1){let e=[C9s.default,v9s.default,b9s.default,S9s.default,T9s.default,I9s.default,A9s.default,y9s.default,g9s.default,E9s.default,_9s.default];return t?e.push(f9s.default,h9s.default):e.push(d9s.default,p9s.default),e.push(m9s.default),e}a(x9s,"getApplicator");ccr.default=x9s});var p$n=I(lcr=>{"use strict";p();Object.defineProperty(lcr,"__esModule",{value:!0});var Zp=hs(),w9s={message:a(({schemaCode:t})=>(0,Zp.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,Zp._)`{format: ${t}}`,"params")},R9s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:w9s,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,Zp._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,Zp._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,Zp._)`${y}.type || "string"`).assign(_,(0,Zp._)`${y}.validate`),()=>r.assign(E,(0,Zp._)`"string"`).assign(_,y)),t.fail$data((0,Zp.or)(v(),b()));function v(){return u.strictSchema===!1?Zp.nil:(0,Zp._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,Zp._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,Zp._)`${_}(${n})`,w=(0,Zp._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,Zp._)`${_} && ${_} !== 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,Zp.regexpCode)(w):u.code.formats?(0,Zp._)`${u.code.formats}${(0,Zp.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,Zp._)`${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,Zp._)`await ${_}(${n})`}return typeof E=="function"?(0,Zp._)`${_}(${n})`:(0,Zp._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};lcr.default=R9s});var h$n=I(ucr=>{"use strict";p();Object.defineProperty(ucr,"__esModule",{value:!0});var k9s=p$n(),P9s=[k9s.default];ucr.default=P9s});var m$n=I(rpe=>{"use strict";p();Object.defineProperty(rpe,"__esModule",{value:!0});rpe.contentVocabulary=rpe.metadataVocabulary=void 0;rpe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];rpe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var A$n=I(dcr=>{"use strict";p();Object.defineProperty(dcr,"__esModule",{value:!0});var D9s=SGn(),N9s=FGn(),M9s=f$n(),O9s=h$n(),g$n=m$n(),B9s=[D9s.default,N9s.default,(0,M9s.default)(),O9s.default,g$n.metadataVocabulary,g$n.contentVocabulary];dcr.default=B9s});var E$n=I(Jst=>{"use strict";p();Object.defineProperty(Jst,"__esModule",{value:!0});Jst.DiscrError=void 0;var y$n;(function(t){t.Tag="tag",t.Mapping="mapping"})(y$n||(Jst.DiscrError=y$n={}))});var C$n=I(pcr=>{"use strict";p();Object.defineProperty(pcr,"__esModule",{value:!0});var npe=hs(),fcr=E$n(),_$n=Mst(),L9s=jPe(),F9s=za(),U9s={message:a(({params:{discrError:t,tagName:e}})=>t===fcr.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,npe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Q9s={keyword:"discriminator",type:"object",schemaType:"object",error:U9s,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,npe._)`${r}${(0,npe.getProperty)(l)}`);e.if((0,npe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:fcr.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,npe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:fcr.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,npe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{q9s.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 mcr=I((od,hcr)=>{"use strict";p();Object.defineProperty(od,"__esModule",{value:!0});od.MissingRefError=od.ValidationError=od.CodeGen=od.Name=od.nil=od.stringify=od.str=od._=od.KeywordCxt=od.Ajv=void 0;var j9s=yGn(),H9s=A$n(),G9s=C$n(),b$n=v$n(),$9s=["/properties"],Zst="http://json-schema.org/draft-07/schema",ipe=class extends j9s.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),H9s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(G9s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(b$n,$9s):b$n;this.addMetaSchema(e,Zst,!1),this.refs["http://json-schema.org/schema"]=Zst}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Zst)?Zst:void 0)}};od.Ajv=ipe;hcr.exports=od=ipe;hcr.exports.Ajv=ipe;Object.defineProperty(od,"__esModule",{value:!0});od.default=ipe;var V9s=qPe();Object.defineProperty(od,"KeywordCxt",{enumerable:!0,get:a(function(){return V9s.KeywordCxt},"get")});var ope=hs();Object.defineProperty(od,"_",{enumerable:!0,get:a(function(){return ope._},"get")});Object.defineProperty(od,"str",{enumerable:!0,get:a(function(){return ope.str},"get")});Object.defineProperty(od,"stringify",{enumerable:!0,get:a(function(){return ope.stringify},"get")});Object.defineProperty(od,"nil",{enumerable:!0,get:a(function(){return ope.nil},"get")});Object.defineProperty(od,"Name",{enumerable:!0,get:a(function(){return ope.Name},"get")});Object.defineProperty(od,"CodeGen",{enumerable:!0,get:a(function(){return ope.CodeGen},"get")});var W9s=Dst();Object.defineProperty(od,"ValidationError",{enumerable:!0,get:a(function(){return W9s.default},"get")});var z9s=jPe();Object.defineProperty(od,"MissingRefError",{enumerable:!0,get:a(function(){return z9s.default},"get")})});var P$n=I(y5=>{"use strict";p();Object.defineProperty(y5,"__esModule",{value:!0});y5.formatNames=y5.fastFormats=y5.fullFormats=void 0;function A5(t,e){return{validate:t,compare:e}}a(A5,"fmtDef");y5.fullFormats={date:A5(x$n,Ecr),time:A5(Acr(!0),_cr),"date-time":A5(S$n(!0),R$n),"iso-time":A5(Acr(),w$n),"iso-date-time":A5(S$n(),k$n),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:eUs,"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:aUs,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:tUs,int32:{type:"number",validate:iUs},int64:{type:"number",validate:oUs},float:{type:"number",validate:I$n},double:{type:"number",validate:I$n},password:!0,binary:!0};y5.fastFormats={...y5.fullFormats,date:A5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ecr),time:A5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_cr),"date-time":A5(/^\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,R$n),"iso-time":A5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w$n),"iso-date-time":A5(/^\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,k$n),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};y5.formatNames=Object.keys(y5.fullFormats);function Y9s(t){return t%4===0&&(t%100!==0||t%400===0)}a(Y9s,"isLeapYear");var K9s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,J9s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function x$n(t){let e=K9s.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&&Y9s(r)?29:J9s[n])}a(x$n,"date");function Ecr(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(Acr,"getTime");function _cr(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(_cr,"compareTime");function w$n(t,e){if(!(t&&e))return;let r=gcr.exec(t),n=gcr.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=rUs}a(iUs,"validateInt32");function oUs(t){return Number.isInteger(t)}a(oUs,"validateInt64");function I$n(){return!0}a(I$n,"validateNumber");var sUs=/[^\\]\\Z/;function aUs(t){if(sUs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(aUs,"regex")});var D$n=I(spe=>{"use strict";p();Object.defineProperty(spe,"__esModule",{value:!0});spe.formatLimitDefinition=void 0;var cUs=mcr(),l2=hs(),$j=l2.operators,Xst={formatMaximum:{okStr:"<=",ok:$j.LTE,fail:$j.GT},formatMinimum:{okStr:">=",ok:$j.GTE,fail:$j.LT},formatExclusiveMaximum:{okStr:"<",ok:$j.LT,fail:$j.GTE},formatExclusiveMinimum:{okStr:">",ok:$j.GT,fail:$j.LTE}},lUs={message:a(({keyword:t,schemaCode:e})=>(0,l2.str)`should be ${Xst[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,l2._)`{comparison: ${Xst[t].okStr}, limit: ${e}}`,"params")};spe.formatLimitDefinition={keyword:Object.keys(Xst),type:"string",schemaType:"string",$data:!0,error:lUs,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 cUs.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}) ${Xst[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var uUs=a(t=>(t.addKeyword(spe.formatLimitDefinition),t),"formatLimitPlugin");spe.default=uUs});var B$n=I((r2e,O$n)=>{"use strict";p();Object.defineProperty(r2e,"__esModule",{value:!0});var ape=P$n(),dUs=D$n(),Ccr=hs(),N$n=new Ccr.Name("fullFormats"),fUs=new Ccr.Name("fastFormats"),vcr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return M$n(t,e,ape.fullFormats,N$n),t;let[r,n]=e.mode==="fast"?[ape.fastFormats,fUs]:[ape.fullFormats,N$n],o=e.formats||ape.formatNames;return M$n(t,o,r,n),e.keywords&&(0,dUs.default)(t),t},"formatsPlugin");vcr.get=(t,e="full")=>{let n=(e==="fast"?ape.fastFormats:ape.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function M$n(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Ccr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(M$n,"addFormats");O$n.exports=r2e=vcr;Object.defineProperty(r2e,"__esModule",{value:!0});r2e.default=vcr});var lVn=I((vAf,cVn)=>{p();cVn.exports=aVn;aVn.sync=vUs;var oVn=require("fs");function CUs(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();pVn.exports=dVn;dVn.sync=bUs;var uVn=require("fs");function dVn(t,e,r){uVn.stat(t,function(n,o){r(n,n?!1:fVn(o,e))})}a(dVn,"isexe");function bUs(t,e){return fVn(uVn.statSync(t),e)}a(bUs,"sync");function fVn(t,e){return t.isFile()&&SUs(t,e)}a(fVn,"checkStat");function SUs(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(SUs,"checkMode")});var gVn=I((RAf,mVn)=>{p();var wAf=require("fs"),hat;process.platform==="win32"||global.TESTING_WINDOWS?hat=lVn():hat=hVn();mVn.exports=Fcr;Fcr.sync=TUs;function Fcr(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){Fcr(t,e||{},function(s,c){s?o(s):n(c)})})}hat(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(Fcr,"isexe");function TUs(t,e){try{return hat.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(TUs,"sync")});var bVn=I((DAf,vVn)=>{p();var ype=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",AVn=require("path"),IUs=ype?";":":",yVn=gVn(),EVn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),_Vn=a((t,e)=>{let r=e.colon||IUs,n=t.match(/\//)||ype&&t.match(/\\/)?[""]:[...ype?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=ype?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=ype?o.split(r):[""];return ype&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),CVn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=_Vn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(EVn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=AVn.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];yVn(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"),xUs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=_Vn(t,e),s=[];for(let c=0;c{"use strict";p();var SVn=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");Ucr.exports=SVn;Ucr.exports.default=SVn});var RVn=I((FAf,wVn)=>{"use strict";p();var IVn=require("path"),wUs=bVn(),RUs=TVn();function xVn(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=wUs.sync(t.command,{path:r[RUs({env:r})],pathExt:e?IVn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=IVn.resolve(o?t.options.cwd:"",c)),c}a(xVn,"resolveCommandAttempt");function kUs(t){return xVn(t)||xVn(t,!0)}a(kUs,"resolveCommand");wVn.exports=kUs});var kVn=I((qAf,qcr)=>{"use strict";p();var Qcr=/([()\][%!^"`<>&|;, *?])/g;function PUs(t){return t=t.replace(Qcr,"^$1"),t}a(PUs,"escapeCommand");function DUs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Qcr,"^$1"),e&&(t=t.replace(Qcr,"^$1")),t}a(DUs,"escapeArgument");qcr.exports.command=PUs;qcr.exports.argument=DUs});var DVn=I((GAf,PVn)=>{"use strict";p();PVn.exports=/^#!(.*)/});var MVn=I((VAf,NVn)=>{"use strict";p();var NUs=DVn();NVn.exports=(t="")=>{let e=t.match(NUs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var BVn=I((zAf,OVn)=>{"use strict";p();var jcr=require("fs"),MUs=MVn();function OUs(t){let r=Buffer.alloc(150),n;try{n=jcr.openSync(t,"r"),jcr.readSync(n,r,0,150,0),jcr.closeSync(n)}catch{}return MUs(r.toString())}a(OUs,"readShebang");OVn.exports=OUs});var QVn=I((JAf,UVn)=>{"use strict";p();var BUs=require("path"),LVn=RVn(),FVn=kVn(),LUs=BVn(),FUs=process.platform==="win32",UUs=/\.(?:com|exe)$/i,QUs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qUs(t){t.file=LVn(t);let e=t.file&&LUs(t.file);return e?(t.args.unshift(t.file),t.command=e,LVn(t)):t.file}a(qUs,"detectShebang");function jUs(t){if(!FUs)return t;let e=qUs(t),r=!UUs.test(e);if(t.options.forceShell||r){let n=QUs.test(e);t.command=BUs.normalize(t.command),t.command=FVn.command(t.command),t.args=t.args.map(s=>FVn.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(jUs,"parseNonShell");function HUs(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:jUs(n)}a(HUs,"parse");UVn.exports=HUs});var HVn=I((eyf,jVn)=>{"use strict";p();var Hcr=process.platform==="win32";function Gcr(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(Gcr,"notFoundError");function GUs(t,e){if(!Hcr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=qVn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(GUs,"hookChildProcess");function qVn(t,e){return Hcr&&t===1&&!e.file?Gcr(e.original,"spawn"):null}a(qVn,"verifyENOENT");function $Us(t,e){return Hcr&&t===1&&!e.file?Gcr(e.original,"spawnSync"):null}a($Us,"verifyENOENTSync");jVn.exports={hookChildProcess:GUs,verifyENOENT:qVn,verifyENOENTSync:$Us,notFoundError:Gcr}});var VVn=I((nyf,Epe)=>{"use strict";p();var GVn=require("child_process"),$cr=QVn(),Vcr=HVn();function $Vn(t,e,r){let n=$cr(t,e,r),o=GVn.spawn(n.command,n.args,n.options);return Vcr.hookChildProcess(o,n),o}a($Vn,"spawn");function VUs(t,e,r){let n=$cr(t,e,r),o=GVn.spawnSync(n.command,n.args,n.options);return o.error=o.error||Vcr.verifyENOENTSync(o.status,n),o}a(VUs,"spawnSync");Epe.exports=$Vn;Epe.exports.spawn=$Vn;Epe.exports.sync=VUs;Epe.exports._parse=$cr;Epe.exports._enoent=Vcr});var rWn,nWn=me(()=>{p();rWn=typeof globalThis=="object"?globalThis:global});var iWn=me(()=>{p();nWn()});var oWn=me(()=>{p();iWn()});var LF,Kcr=me(()=>{p();LF="1.9.0"});function i7s(t){var e=new Set([t]),r=new Set,n=t.match(sWn);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(sWn);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 sWn,aWn,cWn=me(()=>{p();Kcr();sWn=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(i7s,"_makeCompatibilityCheck");aWn=i7s(LF)});function _5(t,e,r,n){var o;n===void 0&&(n=!1);var s=d2e[u2e]=(o=d2e[u2e])!==null&&o!==void 0?o:{version:LF};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!==LF){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+LF);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+LF+"."),!0}function AT(t){var e,r,n=(e=d2e[u2e])===null||e===void 0?void 0:e.version;if(!(!n||!aWn(n)))return(r=d2e[u2e])===null||r===void 0?void 0:r[t]}function C5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+LF+".");var r=d2e[u2e];r&&delete r[t]}var o7s,u2e,d2e,jZ=me(()=>{p();oWn();Kcr();cWn();o7s=LF.split(".")[0],u2e=Symbol.for("opentelemetry.js.api."+o7s),d2e=rWn;a(_5,"registerGlobal");a(AT,"getGlobal");a(C5,"unregisterGlobal")});function f2e(t,e,r){var n=AT("diag");if(n)return r.unshift(e),n[t].apply(n,a7s([],s7s(r),!1))}var s7s,a7s,lWn,uWn=me(()=>{p();jZ();s7s=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},a7s=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 dWn(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 fWn=me(()=>{p();Eat();a(dWn,"createLogLevelDiagLogger")});var c7s,l7s,u7s,uE,HZ=me(()=>{p();uWn();fWn();Eat();jZ();c7s=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},l7s=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 _5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){C5(u7s,r)},r.createComponentLogger=function(o){return new lWn(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 d7s,f7s,pWn,hWn=me(()=>{p();d7s=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},f7s=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.")},pWn=(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=d7s(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();mWn=Symbol("BaggageEntryMetadata")});function AWn(t){return t===void 0&&(t={}),new pWn(new Map(Object.entries(t)))}function Cpe(t){return typeof t!="string"&&(p7s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:mWn,toString:a(function(){return t},"toString")}}var p7s,Jcr=me(()=>{p();HZ();hWn();gWn();p7s=uE.instance();a(AWn,"createBaggage");a(Cpe,"baggageEntryMetadataFromString")});function hb(t){return Symbol.for(t)}var h7s,_at,p2e=me(()=>{p();a(hb,"createContextKey");h7s=(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})(),_at=new h7s});var Zcr,yWn,EWn=me(()=>{p();Zcr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],yWn=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();GZ=(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)}})(),m7s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return S7s},t.prototype.createHistogram=function(e,r){return T7s},t.prototype.createCounter=function(e,r){return b7s},t.prototype.createUpDownCounter=function(e,r){return I7s},t.prototype.createObservableGauge=function(e,r){return w7s},t.prototype.createObservableCounter=function(e,r){return x7s},t.prototype.createObservableUpDownCounter=function(e,r){return R7s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Cat=(function(){function t(){}return a(t,"NoopMetric"),t})(),g7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Cat),A7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Cat),y7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Cat),E7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Cat),Xcr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),_7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(Xcr),C7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(Xcr),v7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(Xcr),elr=new m7s,b7s=new g7s,S7s=new y7s,T7s=new E7s,I7s=new A7s,x7s=new _7s,w7s=new C7s,R7s=new v7s;a(_Wn,"createNoopMeter")});var vat,CWn=me(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(vat||(vat={}))});var bat,Sat,rlr=me(()=>{p();bat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Sat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var k7s,P7s,vWn,bWn=me(()=>{p();p2e();k7s=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},P7s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();bWn();jZ();HZ();D7s=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},N7s=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"})(yf||(yf={}))});var m2e,g2e,vpe,Tat=me(()=>{p();ilr();m2e="0000000000000000",g2e="00000000000000000000000000000000",vpe={traceId:g2e,spanId:m2e,traceFlags:yf.NONE}});var Kj,Iat=me(()=>{p();Tat();Kj=(function(){function t(e){e===void 0&&(e=vpe),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 xat(t){return t.getValue(olr)||void 0}function SWn(){return xat(Yj.getInstance().active())}function A2e(t,e){return t.setValue(olr,e)}function TWn(t){return t.deleteValue(olr)}function IWn(t,e){return A2e(t,new Kj(e))}function wat(t){var e;return(e=xat(t))===null||e===void 0?void 0:e.spanContext()}var olr,slr=me(()=>{p();p2e();Iat();h2e();olr=hb("OpenTelemetry Context Key SPAN");a(xat,"getSpan");a(SWn,"getActiveSpan");a(A2e,"setSpan");a(TWn,"deleteSpan");a(IWn,"setSpanContext");a(wat,"getSpanContext")});function $Z(t){return O7s.test(t)&&t!==g2e}function alr(t){return B7s.test(t)&&t!==m2e}function mb(t){return $Z(t.traceId)&&alr(t.spanId)}function xWn(t){return new Kj(t)}var O7s,B7s,Rat=me(()=>{p();Tat();Iat();O7s=/^([0-9a-f]{32})$/i,B7s=/^[0-9a-f]{16}$/i;a($Z,"isValidTraceId");a(alr,"isValidSpanId");a(mb,"isSpanContextValid");a(xWn,"wrapSpanContext")});function L7s(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var clr,kat,llr=me(()=>{p();h2e();slr();Iat();Rat();clr=Yj.getInstance(),kat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=clr.active());var o=!!r?.root;if(o)return new Kj;var s=n&&wat(n);return L7s(s)&&mb(s)?new Kj(s):new Kj},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??clr.active(),d=this.startSpan(e,s,u),f=A2e(u,d);return clr.with(f,l,void 0,d)}},t})();a(L7s,"isSpanContext")});var F7s,Pat,ulr=me(()=>{p();llr();F7s=new kat,Pat=(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):F7s},t})()});var wWn,RWn=me(()=>{p();llr();wWn=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new kat},t})()});var U7s,y2e,dlr=me(()=>{p();ulr();RWn();U7s=new wWn,y2e=(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 Pat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:U7s},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 gb,kWn=me(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(gb||(gb={}))});var bpe,PWn=me(()=>{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"})(bpe||(bpe={}))});var Spe,DWn=me(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Spe||(Spe={}))});function NWn(t){return j7s.test(t)}function MWn(t){return H7s.test(t)&&!G7s.test(t)}var flr,Q7s,q7s,j7s,H7s,G7s,OWn=me(()=>{p();flr="[_0-9a-z-*/]",Q7s="[a-z]"+flr+"{0,255}",q7s="[a-z0-9]"+flr+"{0,240}@[a-z]"+flr+"{0,13}",j7s=new RegExp("^(?:"+Q7s+"|"+q7s+")$"),H7s=/^[ -~]{0,255}[!-~]$/,G7s=/,|=/;a(NWn,"validateKey");a(MWn,"validateValue")});var BWn,$7s,LWn,FWn,UWn,QWn=me(()=>{p();OWn();BWn=32,$7s=512,LWn=",",FWn="=",UWn=(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+FWn+e.get(n)),r},[]).join(LWn)},t.prototype._parse=function(e){e.length>$7s||(this._internalState=e.split(LWn).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(FWn);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);NWn(c)&&MWn(l)&&r.set(c,l)}return r},new Map),this._internalState.size>BWn&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BWn))))},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 qWn(t){return new UWn(t)}var jWn=me(()=>{p();QWn();a(qWn,"createTraceState")});var _g,HWn=me(()=>{p();h2e();_g=Yj.getInstance()});var kn,GWn=me(()=>{p();HZ();kn=uE.instance()});var V7s,$Wn,VWn=me(()=>{p();tlr();V7s=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return elr},t})(),$Wn=new V7s});var plr,WWn,zWn=me(()=>{p();VWn();jZ();HZ();plr="metrics",WWn=(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 _5(plr,e,uE.instance())},t.prototype.getMeterProvider=function(){return AT(plr)||$Wn},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){C5(plr,uE.instance())},t})()});var VZ,YWn=me(()=>{p();zWn();VZ=WWn.getInstance()});var KWn,JWn=me(()=>{p();KWn=(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 mlr(t){return t.getValue(hlr)||void 0}function ZWn(){return mlr(Yj.getInstance().active())}function XWn(t,e){return t.setValue(hlr,e)}function ezn(t){return t.deleteValue(hlr)}var hlr,tzn=me(()=>{p();h2e();p2e();hlr=hb("OpenTelemetry Baggage Key");a(mlr,"getBaggage");a(ZWn,"getActiveBaggage");a(XWn,"setBaggage");a(ezn,"deleteBaggage")});var glr,W7s,rzn,nzn=me(()=>{p();jZ();JWn();rlr();tzn();Jcr();HZ();glr="propagation",W7s=new KWn,rzn=(function(){function t(){this.createBaggage=AWn,this.getBaggage=mlr,this.getActiveBaggage=ZWn,this.setBaggage=XWn,this.deleteBaggage=ezn}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return _5(glr,e,uE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Sat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=bat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){C5(glr,uE.instance())},t.prototype._getGlobalPropagator=function(){return AT(glr)||W7s},t})()});var yT,izn=me(()=>{p();nzn();yT=rzn.getInstance()});var Alr,ozn,szn=me(()=>{p();jZ();dlr();Rat();slr();HZ();Alr="trace",ozn=(function(){function t(){this._proxyTracerProvider=new y2e,this.wrapSpanContext=xWn,this.isSpanContextValid=mb,this.deleteSpan=TWn,this.getSpan=xat,this.getActiveSpan=SWn,this.getSpanContext=wat,this.setSpan=A2e,this.setSpanContext=IWn}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=_5(Alr,this._proxyTracerProvider,uE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return AT(Alr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){C5(Alr,uE.instance()),this._proxyTracerProvider=new y2e},t})()});var Cu,azn=me(()=>{p();szn();Cu=ozn.getInstance()});var v5={};wi(v5,{DiagConsoleLogger:()=>yWn,DiagLogLevel:()=>Da,INVALID_SPANID:()=>m2e,INVALID_SPAN_CONTEXT:()=>vpe,INVALID_TRACEID:()=>g2e,ProxyTracer:()=>Pat,ProxyTracerProvider:()=>y2e,ROOT_CONTEXT:()=>_at,SamplingDecision:()=>gb,SpanKind:()=>bpe,SpanStatusCode:()=>Spe,TraceFlags:()=>yf,ValueType:()=>vat,baggageEntryMetadataFromString:()=>Cpe,context:()=>_g,createContextKey:()=>hb,createNoopMeter:()=>_Wn,createTraceState:()=>qWn,default:()=>z7s,defaultTextMapGetter:()=>bat,defaultTextMapSetter:()=>Sat,diag:()=>kn,isSpanContextValid:()=>mb,isValidSpanId:()=>alr,isValidTraceId:()=>$Z,metrics:()=>VZ,propagation:()=>yT,trace:()=>Cu});var z7s,co=me(()=>{p();Jcr();p2e();EWn();Eat();tlr();CWn();rlr();ulr();dlr();kWn();PWn();DWn();ilr();jWn();Rat();Tat();HWn();GWn();YWn();izn();azn();z7s={context:_g,diag:kn,metrics:VZ,propagation:yT,trace:Cu}});var ET=I(KZ=>{"use strict";p();Object.defineProperty(KZ,"__esModule",{value:!0});KZ.DebugNameData=void 0;KZ.getDebugName=NYn;KZ.getClassName=MYn;KZ.getFunctionName=OYn;var Klr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return NYn(e,this)}};KZ.DebugNameData=Klr;var kYn=new Map,Jlr=new WeakMap;function NYn(t,e){let r=Jlr.get(t);if(r)return r;let n=Bqs(t,e);if(n){let o=kYn.get(n)??0;o++,kYn.set(n,o);let s=o===1?n:`${n}#${o}`;return Jlr.set(t,s),s}}a(NYn,"getDebugName");function Bqs(t,e){let r=Jlr.get(t);if(r)return r;let n=e.owner?Fqs(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=OYn(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=Lqs(e.owner,t);if(l!==void 0)return n+l}}a(Bqs,"computeDebugName");function Lqs(t,e){for(let r in t)if(t[r]===e)return r}a(Lqs,"findKey");var PYn=new Map,DYn=new WeakMap;function Fqs(t){let e=DYn.get(t);if(e)return e;let r=MYn(t)??"Object",n=PYn.get(r)??0;n++,PYn.set(r,n);let o=n===1?r:`${r}#${n}`;return DYn.set(t,o),o}a(Fqs,"formatOwner");function MYn(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(MYn,"getClassName");function OYn(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(OYn,"getFunctionName")});var zYn=I(lp=>{"use strict";p();var Uqs=lp&&lp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qqs=lp&&lp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qqs=lp&&lp.__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(UYn,"strictEqualsC");function QYn(t,e,r){return FYn.equals(t,e,r??lct)}a(QYn,"arrayEquals");function qYn(t){return(e,r)=>FYn.equals(e,r,t??lct)}a(qYn,"arrayEqualsC");function O2e(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;rO2e(t,e)}a(jYn,"structuralEqualsC");function jqs(t){return JSON.stringify(Zlr(t))}a(jqs,"getStructuralKey");var Hqs=0,BYn=new WeakMap;function Zlr(t){if(Array.isArray(t))return t.map(Zlr);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]=Zlr(e[n]);return r}else{let e=BYn.get(t);return e===void 0&&(e=Hqs++,BYn.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(Zlr,"toNormalizedJsonStructure");function HYn(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(HYn,"jsonStringifyEquals");function GYn(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(GYn,"jsonStringifyEqualsC");function $Yn(){return(t,e)=>t.equals(e)}a($Yn,"thisEqualsC");function VYn(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(VYn,"equalsIfDefined");function WYn(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(WYn,"equalsIfDefinedC");var LYn;(function(t){t.strict=lct,t.strictC=UYn,t.array=QYn,t.arrayC=qYn,t.structural=O2e,t.structuralC=jYn,t.jsonStringify=HYn,t.jsonStringifyC=GYn,t.thisC=$Yn,t.ifDefined=VYn,t.ifDefinedC=WYn})(LYn||(lp.equals=LYn={}))});var eC=I(up=>{"use strict";p();Object.defineProperty(up,"__esModule",{value:!0});up.trackDisposable=up.toDisposable=up.markAsDisposed=up.DisposableStore=up.Event=up.onUnexpectedError=up.onBugIndicatingError=up.BugIndicatingError=up.strictEquals=up.assertFn=void 0;var Gqs=Yu();Object.defineProperty(up,"assertFn",{enumerable:!0,get:a(function(){return Gqs.assertFn},"get")});var $qs=zYn();Object.defineProperty(up,"strictEquals",{enumerable:!0,get:a(function(){return $qs.strictEquals},"get")});var Xlr=Ts();Object.defineProperty(up,"BugIndicatingError",{enumerable:!0,get:a(function(){return Xlr.BugIndicatingError},"get")});Object.defineProperty(up,"onBugIndicatingError",{enumerable:!0,get:a(function(){return Xlr.onBugIndicatingError},"get")});Object.defineProperty(up,"onUnexpectedError",{enumerable:!0,get:a(function(){return Xlr.onUnexpectedError},"get")});var Vqs=Sc();Object.defineProperty(up,"Event",{enumerable:!0,get:a(function(){return Vqs.Event},"get")});var uct=ko();Object.defineProperty(up,"DisposableStore",{enumerable:!0,get:a(function(){return uct.DisposableStore},"get")});Object.defineProperty(up,"markAsDisposed",{enumerable:!0,get:a(function(){return uct.markAsDisposed},"get")});Object.defineProperty(up,"toDisposable",{enumerable:!0,get:a(function(){return uct.toDisposable},"get")});Object.defineProperty(up,"trackDisposable",{enumerable:!0,get:a(function(){return uct.trackDisposable},"get")})});var YYn=I(eur=>{"use strict";p();Object.defineProperty(eur,"__esModule",{value:!0});eur.handleBugIndicatingErrorRecovery=zqs;var Wqs=eC();function zqs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,Wqs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(zqs,"handleBugIndicatingErrorRecovery")});var x5=I(Ope=>{"use strict";p();Object.defineProperty(Ope,"__esModule",{value:!0});Ope.addLogger=Yqs;Ope.getLogger=Kqs;Ope.setLogObservableFn=Jqs;Ope.logObservable=Zqs;var JZ;function Yqs(t){JZ?JZ instanceof dct?JZ.loggers.push(t):JZ=new dct([JZ,t]):JZ=t}a(Yqs,"addLogger");function Kqs(){return JZ}a(Kqs,"getLogger");var tur;function Jqs(t){tur=t}a(Jqs,"setLogObservableFn");function Zqs(t){tur&&tur(t)}a(Zqs,"logObservable");var dct=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 qF=I(Xj=>{"use strict";p();Object.defineProperty(Xj,"__esModule",{value:!0});Xj.TransactionImpl=void 0;Xj.transaction=rur;Xj.globalTransaction=ejs;Xj.asyncTransaction=tjs;Xj.subtransaction=rjs;var KYn=YYn(),Xqs=ET(),JYn=x5();function rur(t,e){let r=new Bpe(t,e);try{t(r)}finally{r.finish()}}a(rur,"transaction");var fct;function ejs(t){if(fct)t(fct);else{let e=new Bpe(t,void 0);fct=e;try{t(e)}finally{e.finish(),fct=void 0}}}a(ejs,"globalTransaction");async function tjs(t,e){let r=new Bpe(t,e);try{await t(r)}finally{r.finish()}}a(tjs,"asyncTransaction");function rjs(t,e,r){t?e(t):rur(e,r)}a(rjs,"subtransaction");var Bpe=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,JYn.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,Xqs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,KYn.handleBugIndicatingErrorRecovery)("Transaction already finished!"),rur(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,KYn.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(pct,"__esModule",{value:!0});pct.DebugLocation=void 0;var ZYn;(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,nur.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(ZYn||(pct.DebugLocation=ZYn={}));var nur=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` -`),o=njs(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 njs(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(njs,"parseLine")});var h2=I(w5=>{"use strict";p();Object.defineProperty(w5,"__esModule",{value:!0});w5.BaseObservable=w5.ConvenientObservable=void 0;w5._setDerivedOpts=ojs;w5._setRecomputeInitiallyAndOnChange=sjs;w5._setKeepObserved=ajs;w5._setDebugGetObservableGraph=cjs;var XYn=_T(),ijs=ET(),Lpe=x5(),iur;function ojs(t){iur=t}a(ojs,"_setDerivedOpts");var eKn;function sjs(t){eKn=t}a(sjs,"_setRecomputeInitiallyAndOnChange");var tKn;function ajs(t){tKn=t}a(ajs,"_setKeepObserved");var our;function cjs(t){our=t}a(cjs,"_setDebugGetObservableGraph");var hct=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=XYn.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return iur({owner:o,debugName:a(()=>{let c=(0,ijs.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 iur({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(eKn(this,r)),this}keepObserved(e){return e.add(tKn(this)),this}get debugValue(){return this.get()}get debug(){return new sur(this)}};w5.ConvenientObservable=hct;var sur=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return our(this.observable,{type:"dependencies"})}getObserverGraph(){return our(this.observable,{type:"observers"})}},aur=class extends hct{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,Lpe.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,Lpe.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,Lpe.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,Lpe.getLogger)();return(0,Lpe.logObservable)(this),e||(0,Lpe.getLogger)()?.handleObservableCreated(this,XYn.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};w5.BaseObservable=aur});var jF=I(eH=>{"use strict";p();Object.defineProperty(eH,"__esModule",{value:!0});eH.DisposableObservableValue=eH.ObservableValue=void 0;eH.observableValue=djs;eH.disposableObservableValue=fjs;var ljs=qF(),ujs=h2(),nKn=eC(),mct=ET(),rKn=x5(),iKn=_T();function djs(t,e,r=iKn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new mct.DebugNameData(void 0,t,void 0):n=new mct.DebugNameData(t,void 0,void 0),new B2e(n,e,nKn.strictEquals,r)}a(djs,"observableValue");var B2e=class extends ujs.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,rKn.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 ljs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,rKn.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}};eH.ObservableValue=B2e;function fjs(t,e,r=iKn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new mct.DebugNameData(void 0,t,void 0):n=new mct.DebugNameData(t,void 0,void 0),new gct(n,e,nKn.strictEquals,r)}a(fjs,"disposableObservableValue");var gct=class extends B2e{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};eH.DisposableObservableValue=gct});var sKn=I(Act=>{"use strict";p();Object.defineProperty(Act,"__esModule",{value:!0});Act.LazyObservableValue=void 0;var pjs=qF(),oKn=x5(),hjs=h2(),cur=class extends hjs.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,oKn.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,oKn.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 pjs.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}};Act.LazyObservableValue=cur});var yct=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});lur.observableValueOpts=yjs;var aKn=ET(),cKn=eC(),mjs=jF(),gjs=sKn(),Ajs=_T();function yjs(t,e,r=Ajs.DebugLocation.ofCaller()){return t.lazy?new gjs.LazyObservableValue(new aKn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??cKn.strictEquals,r):new mjs.ObservableValue(new aKn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??cKn.strictEquals,r)}a(yjs,"observableValueOpts")});var _ct=I(Ect=>{"use strict";p();Object.defineProperty(Ect,"__esModule",{value:!0});Ect.AutorunObserver=void 0;var Dw=eC(),L2e=x5();function Ejs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Ejs,"autorunStateToString");var uur=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,L2e.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,Dw.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,L2e.getLogger)()?.handleAutorunDisposed(this),(0,Dw.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,L2e.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,Dw.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,L2e.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,Dw.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,L2e.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,Dw.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Dw.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 Dw.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new Dw.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new Dw.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new Dw.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Ejs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,Dw.onBugIndicatingError)(new Dw.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Ect.AutorunObserver=uur});var ZZ=I(Nw=>{"use strict";p();Object.defineProperty(Nw,"__esModule",{value:!0});Nw.autorun=pur;Nw.autorunOpts=F2e;Nw.autorunHandleChanges=lKn;Nw.autorunWithStoreHandleChanges=vjs;Nw.autorunWithStore=bjs;Nw.autorunDelta=Sjs;Nw.autorunIterableDelta=Tjs;Nw.autorunPerKeyedItem=Ijs;Nw.autorunSelfDisposable=xjs;Nw.registerAutorunSelfDisposable=wjs;var Fpe=eC(),dur=ET(),fur=_ct(),Upe=_T(),_js=jF(),Cjs=qF();function pur(t,e=Upe.DebugLocation.ofCaller()){return new fur.AutorunObserver(new dur.DebugNameData(void 0,void 0,t),t,void 0,e)}a(pur,"autorun");function F2e(t,e,r=Upe.DebugLocation.ofCaller()){return new fur.AutorunObserver(new dur.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(F2e,"autorunOpts");function lKn(t,e,r=Upe.DebugLocation.ofCaller()){return new fur.AutorunObserver(new dur.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(lKn,"autorunHandleChanges");function vjs(t,e){let r=new Fpe.DisposableStore,n=lKn({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,Fpe.toDisposable)(()=>{n.dispose(),r.dispose()})}a(vjs,"autorunWithStoreHandleChanges");function bjs(t){let e=new Fpe.DisposableStore,r=F2e({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,Fpe.toDisposable)(()=>{r.dispose(),e.dispose()})}a(bjs,"autorunWithStore");function Sjs(t,e){let r;return F2e({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(Sjs,"autorunDelta");function Tjs(t,e,r=n=>n){let n=new Map;return F2e({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(Tjs,"autorunIterableDelta");function Ijs(t,e,r,n=Upe.DebugLocation.ofCaller()){let o=new Map,s=F2e({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,Cjs.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 Fpe.DisposableStore,E={value:(0,_js.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,Fpe.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(Ijs,"autorunPerKeyedItem");function xjs(t,e=Upe.DebugLocation.ofCaller()){let r,n=!1;return r=pur(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(xjs,"autorunSelfDisposable");function wjs(t,e,r=Upe.DebugLocation.ofCaller()){let n,o=!1;n=pur(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(wjs,"registerAutorunSelfDisposable")});var qpe=I(Qpe=>{"use strict";p();Object.defineProperty(Qpe,"__esModule",{value:!0});Qpe.DerivedWithSetter=Qpe.Derived=void 0;var Rjs=h2(),XZ=eC(),hur=x5();function kjs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(kjs,"derivedStateToString");var Cct=class extends Rjs.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,hur.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,hur.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,XZ.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 XZ.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,XZ.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,hur.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,XZ.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 XZ.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 XZ.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new XZ.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:kjs(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)}};Qpe.Derived=Cct;var mur=class extends Cct{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};Qpe.DerivedWithSetter=mur});var vct=I(tH=>{"use strict";p();Object.defineProperty(tH,"__esModule",{value:!0});tH.derived=Djs;tH.derivedWithSetter=Njs;tH.derivedOpts=uKn;tH.derivedHandleChanges=Mjs;tH.derivedWithStore=Ojs;tH.derivedDisposable=Bjs;var R5=eC(),jpe=_T(),eX=ET(),Pjs=h2(),tX=qpe();function Djs(t,e,r=jpe.DebugLocation.ofCaller()){return e!==void 0?new tX.Derived(new eX.DebugNameData(t,void 0,e),e,void 0,void 0,R5.strictEquals,r):new tX.Derived(new eX.DebugNameData(void 0,void 0,t),t,void 0,void 0,R5.strictEquals,r)}a(Djs,"derived");function Njs(t,e,r,n=jpe.DebugLocation.ofCaller()){return new tX.DerivedWithSetter(new eX.DebugNameData(t,void 0,e),e,void 0,void 0,R5.strictEquals,r,n)}a(Njs,"derivedWithSetter");function uKn(t,e,r=jpe.DebugLocation.ofCaller()){return new tX.Derived(new eX.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??R5.strictEquals,r)}a(uKn,"derivedOpts");(0,Pjs._setDerivedOpts)(uKn);function Mjs(t,e,r=jpe.DebugLocation.ofCaller()){return new tX.Derived(new eX.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??R5.strictEquals,r)}a(Mjs,"derivedHandleChanges");function Ojs(t,e,r=jpe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new R5.DisposableStore;return new tX.Derived(new eX.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new R5.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),R5.strictEquals,r)}a(Ojs,"derivedWithStore");function Bjs(t,e,r=jpe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new tX.Derived(new eX.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new R5.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},R5.strictEquals,r)}a(Bjs,"derivedDisposable")});var pKn=I(Mw=>{"use strict";p();Object.defineProperty(Mw,"__esModule",{value:!0});Mw.ObservableLazyPromise=Mw.ObservableResolvedPromise=Mw.PromiseResult=Mw.ObservablePromise=Mw.ObservableLazy=void 0;var Ljs=ZZ(),dKn=qF(),fKn=vct(),bct=jF(),Sct=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,bct.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};Mw.ObservableLazy=Sct;var Tct=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,bct.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,fKn.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,dKn.transaction)(n=>{this._value.set(new U2e(r,void 0),n)}),r),r=>{throw(0,dKn.transaction)(n=>{this._value.set(new U2e(void 0,r),n)}),r})}};Mw.ObservablePromise=Tct;var U2e=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};Mw.PromiseResult=U2e;var gur=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,bct.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,bct.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Ljs.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)}))}};Mw.ObservableResolvedPromise=gur;var Aur=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new Sct(()=>new Tct(this._computePromise())),this.cachedPromiseResult=(0,fKn.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};Mw.ObservableLazyPromise=Aur});var Eur=I(k5=>{"use strict";p();Object.defineProperty(k5,"__esModule",{value:!0});k5.cancelOnDispose=k5.CancellationTokenSource=k5.CancellationToken=k5.CancellationError=void 0;var Fjs=Ts();Object.defineProperty(k5,"CancellationError",{enumerable:!0,get:a(function(){return Fjs.CancellationError},"get")});var yur=SP();Object.defineProperty(k5,"CancellationToken",{enumerable:!0,get:a(function(){return yur.CancellationToken},"get")});Object.defineProperty(k5,"CancellationTokenSource",{enumerable:!0,get:a(function(){return yur.CancellationTokenSource},"get")});Object.defineProperty(k5,"cancelOnDispose",{enumerable:!0,get:a(function(){return yur.cancelOnDispose},"get")})});var hKn=I(Ict=>{"use strict";p();Object.defineProperty(Ict,"__esModule",{value:!0});Ict.waitForState=Gjs;Ict.derivedWithCancellationToken=$js;var Ujs=ET(),_ur=Eur(),Qjs=eC(),qjs=ZZ(),jjs=qpe(),Hjs=_T();function Gjs(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,qjs.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 _ur.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new _ur.CancellationError);return}}c=!1,l&&d.dispose()})}a(Gjs,"waitForState");function $js(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new jjs.Derived(new Ujs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new _ur.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),Qjs.strictEquals,Hjs.DebugLocation.ofCaller())}a($js,"derivedWithCancellationToken")});var rH=I(rX=>{"use strict";p();Object.defineProperty(rX,"__esModule",{value:!0});rX.FromEventObservable=void 0;rX.observableFromEvent=Cur;rX.observableFromEventOpts=zjs;var Vjs=qF(),gKn=eC(),AKn=ET(),mKn=x5(),Wjs=h2(),yKn=_T();function Cur(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new m2(new AKn.DebugNameData(e,void 0,n),r,n,()=>m2.globalTransaction,gKn.strictEquals,o??yKn.DebugLocation.ofCaller())}a(Cur,"observableFromEvent");function zjs(t,e,r,n=yKn.DebugLocation.ofCaller()){return new m2(new AKn.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??m2.globalTransaction,t.equalsFn??gKn.strictEquals,n)}a(zjs,"observableFromEventOpts");var m2=class extends Wjs.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,Vjs.subtransaction)(this._getTransaction(),m=>{(0,mKn.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,mKn.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}}};rX.FromEventObservable=m2;(function(t){t.Observer=m2;function e(r,n){let o=!1;m2.globalTransaction===void 0&&(m2.globalTransaction=r,o=!0);try{n()}finally{o&&(m2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Cur||(rX.observableFromEvent=Cur={}))});var bur=I(vur=>{"use strict";p();Object.defineProperty(vur,"__esModule",{value:!0});vur.observableSignal=Xjs;var Yjs=qF(),Kjs=ET(),Jjs=h2(),Zjs=_T();function Xjs(t,e=Zjs.DebugLocation.ofCaller()){return typeof t=="string"?new xct(t,void 0,e):new xct(void 0,t,e)}a(Xjs,"observableSignal");var xct=class extends Jjs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Kjs.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,Yjs.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 Rct=I(mE=>{"use strict";p();Object.defineProperty(mE,"__esModule",{value:!0});mE.KeepAliveObserver=void 0;mE.observableFromPromise=eHs;mE.signalFromObservable=tHs;mE.debouncedObservable=rHs;mE.throttledObservable=nHs;mE.debouncedObservable2=iHs;mE.wasEventTriggeredRecently=oHs;mE.keepObserved=SKn;mE.recomputeInitiallyAndOnChange=TKn;mE.derivedObservableWithCache=sHs;mE.derivedObservableWithWritableCache=aHs;mE.mapObservableArrayCached=cHs;mE.isObservable=lHs;var EKn=ZZ(),_Kn=jF(),Sur=eC(),q2e=vct(),CKn=rH(),vKn=bur(),bKn=h2(),Tur=_T();function eHs(t){let e=(0,_Kn.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(eHs,"observableFromPromise");function tHs(t,e){return(0,q2e.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(tHs,"signalFromObservable");function rHs(t,e,r=Tur.DebugLocation.ofCaller()){let n=!1,o,s;return(0,CKn.observableFromEvent)(void 0,c=>{let l=(0,EKn.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(rHs,"debouncedObservable");function nHs(t,e,r=Tur.DebugLocation.ofCaller()){let n=!1,o,s;return(0,CKn.observableFromEvent)(void 0,c=>{let l=(0,EKn.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(nHs,"throttledObservable");function iHs(t,e,r=Tur.DebugLocation.ofCaller()){let n=(0,vKn.observableSignal)("handleTimeout"),o,s;return(0,q2e.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(iHs,"debouncedObservable2");function oHs(t,e,r){let n=(0,_Kn.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(oHs,"wasEventTriggeredRecently");function SKn(t){let e=new Q2e(!1,void 0);return t.addObserver(e),(0,Sur.toDisposable)(()=>{t.removeObserver(e)})}a(SKn,"keepObserved");(0,bKn._setKeepObserved)(SKn);function TKn(t,e){let r=new Q2e(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Sur.toDisposable)(()=>{t.removeObserver(r)})}a(TKn,"recomputeInitiallyAndOnChange");(0,bKn._setRecomputeInitiallyAndOnChange)(TKn);var Q2e=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){}};mE.KeepAliveObserver=Q2e;function sHs(t,e){let r;return(0,q2e.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(sHs,"derivedObservableWithCache");function aHs(t,e){let r,n=(0,vKn.observableSignal)("derivedObservableWithWritableCache"),o=(0,q2e.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(aHs,"derivedObservableWithWritableCache");function cHs(t,e,r,n){let o=new wct(r,n);return(0,q2e.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new wct(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(cHs,"mapObservableArrayCached");var wct=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 Sur.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 lHs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(lHs,"isObservable")});var xKn=I(kct=>{"use strict";p();Object.defineProperty(kct,"__esModule",{value:!0});kct.recordChanges=uHs;kct.recordChangesLazy=dHs;var IKn=eC();function uHs(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 IKn.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(uHs,"recordChanges");function dHs(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 IKn.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(dHs,"recordChangesLazy")});var wKn=I(xur=>{"use strict";p();Object.defineProperty(xur,"__esModule",{value:!0});xur.constObservable=pHs;var fHs=h2();function pHs(t){return new Iur(t)}a(pHs,"constObservable");var Iur=class extends fHs.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 RKn=I(Rur=>{"use strict";p();Object.defineProperty(Rur,"__esModule",{value:!0});Rur.observableSignalFromEvent=yHs;var hHs=qF(),mHs=ET(),gHs=h2(),AHs=_T();function yHs(t,e,r=AHs.DebugLocation.ofCaller()){return new wur(typeof t=="string"?t:new mHs.DebugNameData(t,void 0,void 0),e,r)}a(yHs,"observableSignalFromEvent");var wur=class extends gHs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,hHs.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 kKn=I(j2e=>{"use strict";p();Object.defineProperty(j2e,"__esModule",{value:!0});j2e.ValueWithChangeEventFromObservable=void 0;j2e.observableFromValueWithChangeEvent=CHs;var EHs=eC(),_Hs=rH(),Pct=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return EHs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};j2e.ValueWithChangeEventFromObservable=Pct;function CHs(t,e){return e instanceof Pct?e.observable:(0,_Hs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(CHs,"observableFromValueWithChangeEvent")});var NKn=I(H2e=>{"use strict";p();Object.defineProperty(H2e,"__esModule",{value:!0});H2e.runOnChange=PKn;H2e.runOnChangeWithStore=DKn;H2e.runOnChangeWithCancellationToken=THs;var vHs=Eur(),bHs=eC(),SHs=ZZ();function PKn(t,e){let r,n=!0;return(0,SHs.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(PKn,"runOnChange");function DKn(t,e){let r=new bHs.DisposableStore,n=PKn(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(DKn,"runOnChangeWithStore");function THs(t,e){return DKn(t,(r,n,o,s)=>{e(r,n,o,(0,vHs.cancelOnDispose)(s))})}a(THs,"runOnChangeWithCancellationToken")});var BKn=I(Dct=>{"use strict";p();Object.defineProperty(Dct,"__esModule",{value:!0});Dct.latestChangedValue=RHs;Dct.derivedConstOnceDefined=kHs;var MKn=eC(),OKn=ET(),IHs=rH(),xHs=ZZ(),wHs=Rct();function RHs(t,e){if(e.length===0)throw new MKn.BugIndicatingError;let r=!1,n,o=(0,IHs.observableFromEvent)(t,s=>{let c=new MKn.DisposableStore;for(let l of e)c.add((0,xHs.autorunOpts)({debugName:a(()=>(0,OKn.getDebugName)(o,new OKn.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(RHs,"latestChangedValue");function kHs(t,e){return(0,wHs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(kHs,"derivedConstOnceDefined")});var LKn=I(Nct=>{"use strict";p();Object.defineProperty(Nct,"__esModule",{value:!0});Nct.ObservableSet=void 0;var PHs=yct(),kur=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,PHs.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"}};Nct.ObservableSet=kur});var FKn=I(Mct=>{"use strict";p();Object.defineProperty(Mct,"__esModule",{value:!0});Mct.ObservableMap=void 0;var DHs=yct(),Pur=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,DHs.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"}};Mct.ObservableMap=Pur});var Lct=I(Vpe=>{"use strict";p();Object.defineProperty(Vpe,"__esModule",{value:!0});Vpe.ConsoleObservableLogger=void 0;Vpe.logObservableToConsole=OHs;Vpe.formatValue=$pe;var NHs=x5(),MHs=ET(),UKn=qpe(),Oct;function OHs(t){Oct||(Oct=new Bct,(0,NHs.addLogger)(Oct)),Oct.addFilteredObj(t)}a(OHs,"logObservableToConsole");var Bct=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 BHs([Hpe(UHs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Hpe(" "),Ow($pe(e.oldValue,70),{color:"red",strikeThrough:!0}),Hpe(" "),Ow($pe(e.newValue,60),{color:"green"})]:[Hpe(" (unchanged)")]:[Hpe(" "),Ow($pe(e.newValue,60),{color:"green"}),Hpe(" (initial)")]}handleObservableCreated(e){if(e instanceof UKn.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 UKn.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Gpe("observable value changed"),Ow(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return Ow(" (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([Gpe("derived recomputed"),Ow(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([Gpe("derived cleared"),Ow(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Gpe("observable from event triggered"),Ow(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([Gpe("autorun"),Ow(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([Gpe("transaction"),Ow(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Vpe.ConsoleObservableLogger=Bct;function BHs(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(BHs,"consoleTextToArgs");function Hpe(t){return Ow(t,{color:"black"})}a(Hpe,"normalText");function Gpe(t){return Ow(QHs(`${t}: `,10),{color:"black",bold:!0})}a(Gpe,"formatKind");function Ow(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(Ow,"styled");function $pe(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)?LHs(t,e):FHs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a($pe,"formatValue");function LHs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${$pe(o,e-r.length)}`}return r+=" ]",r}a(LHs,"formatArray");function FHs(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,MHs.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}: ${$pe(c,e-n.length)}`}return n+=r?")":" }",n}a(FHs,"formatObject");function UHs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(UHs,"repeat");function QHs(t,e){for(;t.length{"use strict";p();Object.defineProperty(Fct,"__esModule",{value:!0});Fct.SimpleTypedRpcConnection=void 0;var Dur=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}}};Fct.SimpleTypedRpcConnection=Dur});var qKn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});Nur.registerDebugChannel=jHs;var qHs=QKn();function jHs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=HHs({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},qHs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(jHs,"registerDebugChannel");function HHs(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(HHs,"createChannelFactoryFromDebugChannel")});var GKn=I(nH=>{"use strict";p();Object.defineProperty(nH,"__esModule",{value:!0});nH.Throttler=nH.Debouncer=void 0;nH.deepAssign=jKn;nH.deepAssignDeleteNulls=HKn;var Mur=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)}};nH.Debouncer=Mur;var Our=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)}};nH.Throttler=Our;function jKn(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?jKn(t[r],e[r]):t[r]=e[r]}a(jKn,"deepAssign");function HKn(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"?HKn(t[r],e[r]):t[r]=e[r]}a(HKn,"deepAssignDeleteNulls")});var WKn=I(Qct=>{"use strict";p();Object.defineProperty(Qct,"__esModule",{value:!0});Qct.DevToolsLogger=void 0;var $Kn=_ct(),Uct=Lct(),GHs=qKn(),Bur=GKn(),G2e=BS(),$Hs=rH(),nX=Ts(),iX=qpe(),VKn=jF(),VHs=_T(),Lur=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,nX.onUnexpectedError)(new nX.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nX.onUnexpectedError)(new nX.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof iX.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(G2e.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 $Kn.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 iX.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,GHs.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(G2e.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(G2e.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(G2e.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(G2e.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof iX.Derived)n.debugSetValue(r);else if(n instanceof VKn.ObservableValue)n.debugSetValue(r);else if(n instanceof $Hs.FromEventObservable)n.debugSetValue(r);else throw new nX.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 iX.Derived)return(0,Uct.formatValue)(r.debugGetState().value,200);if(r instanceof VKn.ObservableValue)return(0,Uct.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 nX.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iX.Derived)r.debugRecompute();else if(r instanceof $Kn.AutorunObserver)r.debugRerun();else throw new nX.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new Bur.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},VHs.DebugLocation.enable()}_handleChange(e){(0,Bur.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,Bur.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 iX.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 iX.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,Uct.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,Uct.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)}};Qct.DevToolsLogger=Lur});var JKn=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});Fur.debugGetObservableGraph=JHs;var WHs=qpe(),zHs=rH(),YHs=jF(),KHs=_ct(),zKn=Lct();function JHs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=oX.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?KKn(n,0,o,e).trim():YKn(n,0,o,e).trim()}a(JHs,"debugGetObservableGraph");function YKn(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,zKn.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=oX.from(l,n.debugNamePostProcessor??(d=>d))??oX.unknown(l);s.push(YKn(u,e+1,r,n))}}return s.join(` -`)}a(YKn,"formatObservableInfoWithDependencies");function KKn(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,zKn.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=oX.from(l,n.debugNamePostProcessor??(d=>d))??oX.unknown(l);s.push(KKn(u,e+1,r,n))}}return s.join(` -`)}a(KKn,"formatObservableInfoWithObservers");var oX=class t{static{a(this,"Info")}static from(e,r){if(e instanceof KHs.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 WHs.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 YHs.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof zHs.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 HF=I(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ValueWithChangeEventFromObservable=Bt.observableFromValueWithChangeEvent=Bt.TransactionImpl=Bt.transaction=Bt.subtransaction=Bt.globalTransaction=Bt.asyncTransaction=Bt.observableSignalFromEvent=Bt.observableFromEventOpts=Bt.observableSignal=Bt.constObservable=Bt.recordChangesLazy=Bt.recordChanges=Bt.isObservable=Bt.wasEventTriggeredRecently=Bt.throttledObservable=Bt.signalFromObservable=Bt.recomputeInitiallyAndOnChange=Bt.observableFromPromise=Bt.mapObservableArrayCached=Bt.keepObserved=Bt.derivedObservableWithWritableCache=Bt.derivedObservableWithCache=Bt.debouncedObservable2=Bt.debouncedObservable=Bt.waitForState=Bt.derivedWithCancellationToken=Bt.PromiseResult=Bt.ObservableResolvedPromise=Bt.ObservablePromise=Bt.ObservableLazyPromise=Bt.ObservableLazy=Bt.derivedWithStore=Bt.derivedWithSetter=Bt.derivedOpts=Bt.derivedHandleChanges=Bt.derivedDisposable=Bt.derived=Bt.disposableObservableValue=Bt.registerAutorunSelfDisposable=Bt.autorunSelfDisposable=Bt.autorunPerKeyedItem=Bt.autorunIterableDelta=Bt.autorunWithStoreHandleChanges=Bt.autorunWithStore=Bt.autorunOpts=Bt.autorunHandleChanges=Bt.autorunDelta=Bt.autorun=Bt.observableValueOpts=void 0;Bt.DebugLocation=Bt.ObservableMap=Bt.ObservableSet=Bt.observableValue=Bt.observableFromEvent=Bt.latestChangedValue=Bt.derivedConstOnceDefined=Bt.runOnChangeWithStore=Bt.runOnChangeWithCancellationToken=Bt.runOnChange=void 0;var ZHs=yct();Object.defineProperty(Bt,"observableValueOpts",{enumerable:!0,get:a(function(){return ZHs.observableValueOpts},"get")});var P5=ZZ();Object.defineProperty(Bt,"autorun",{enumerable:!0,get:a(function(){return P5.autorun},"get")});Object.defineProperty(Bt,"autorunDelta",{enumerable:!0,get:a(function(){return P5.autorunDelta},"get")});Object.defineProperty(Bt,"autorunHandleChanges",{enumerable:!0,get:a(function(){return P5.autorunHandleChanges},"get")});Object.defineProperty(Bt,"autorunOpts",{enumerable:!0,get:a(function(){return P5.autorunOpts},"get")});Object.defineProperty(Bt,"autorunWithStore",{enumerable:!0,get:a(function(){return P5.autorunWithStore},"get")});Object.defineProperty(Bt,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return P5.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Bt,"autorunIterableDelta",{enumerable:!0,get:a(function(){return P5.autorunIterableDelta},"get")});Object.defineProperty(Bt,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return P5.autorunPerKeyedItem},"get")});Object.defineProperty(Bt,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return P5.autorunSelfDisposable},"get")});Object.defineProperty(Bt,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return P5.registerAutorunSelfDisposable},"get")});var XHs=jF();Object.defineProperty(Bt,"disposableObservableValue",{enumerable:!0,get:a(function(){return XHs.disposableObservableValue},"get")});var Wpe=vct();Object.defineProperty(Bt,"derived",{enumerable:!0,get:a(function(){return Wpe.derived},"get")});Object.defineProperty(Bt,"derivedDisposable",{enumerable:!0,get:a(function(){return Wpe.derivedDisposable},"get")});Object.defineProperty(Bt,"derivedHandleChanges",{enumerable:!0,get:a(function(){return Wpe.derivedHandleChanges},"get")});Object.defineProperty(Bt,"derivedOpts",{enumerable:!0,get:a(function(){return Wpe.derivedOpts},"get")});Object.defineProperty(Bt,"derivedWithSetter",{enumerable:!0,get:a(function(){return Wpe.derivedWithSetter},"get")});Object.defineProperty(Bt,"derivedWithStore",{enumerable:!0,get:a(function(){return Wpe.derivedWithStore},"get")});var $2e=pKn();Object.defineProperty(Bt,"ObservableLazy",{enumerable:!0,get:a(function(){return $2e.ObservableLazy},"get")});Object.defineProperty(Bt,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return $2e.ObservableLazyPromise},"get")});Object.defineProperty(Bt,"ObservablePromise",{enumerable:!0,get:a(function(){return $2e.ObservablePromise},"get")});Object.defineProperty(Bt,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return $2e.ObservableResolvedPromise},"get")});Object.defineProperty(Bt,"PromiseResult",{enumerable:!0,get:a(function(){return $2e.PromiseResult},"get")});var XKn=hKn();Object.defineProperty(Bt,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return XKn.derivedWithCancellationToken},"get")});Object.defineProperty(Bt,"waitForState",{enumerable:!0,get:a(function(){return XKn.waitForState},"get")});var Bw=Rct();Object.defineProperty(Bt,"debouncedObservable",{enumerable:!0,get:a(function(){return Bw.debouncedObservable},"get")});Object.defineProperty(Bt,"debouncedObservable2",{enumerable:!0,get:a(function(){return Bw.debouncedObservable2},"get")});Object.defineProperty(Bt,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return Bw.derivedObservableWithCache},"get")});Object.defineProperty(Bt,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return Bw.derivedObservableWithWritableCache},"get")});Object.defineProperty(Bt,"keepObserved",{enumerable:!0,get:a(function(){return Bw.keepObserved},"get")});Object.defineProperty(Bt,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return Bw.mapObservableArrayCached},"get")});Object.defineProperty(Bt,"observableFromPromise",{enumerable:!0,get:a(function(){return Bw.observableFromPromise},"get")});Object.defineProperty(Bt,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return Bw.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Bt,"signalFromObservable",{enumerable:!0,get:a(function(){return Bw.signalFromObservable},"get")});Object.defineProperty(Bt,"throttledObservable",{enumerable:!0,get:a(function(){return Bw.throttledObservable},"get")});Object.defineProperty(Bt,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return Bw.wasEventTriggeredRecently},"get")});Object.defineProperty(Bt,"isObservable",{enumerable:!0,get:a(function(){return Bw.isObservable},"get")});var eJn=xKn();Object.defineProperty(Bt,"recordChanges",{enumerable:!0,get:a(function(){return eJn.recordChanges},"get")});Object.defineProperty(Bt,"recordChangesLazy",{enumerable:!0,get:a(function(){return eJn.recordChangesLazy},"get")});var eGs=wKn();Object.defineProperty(Bt,"constObservable",{enumerable:!0,get:a(function(){return eGs.constObservable},"get")});var tGs=bur();Object.defineProperty(Bt,"observableSignal",{enumerable:!0,get:a(function(){return tGs.observableSignal},"get")});var rGs=rH();Object.defineProperty(Bt,"observableFromEventOpts",{enumerable:!0,get:a(function(){return rGs.observableFromEventOpts},"get")});var nGs=RKn();Object.defineProperty(Bt,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return nGs.observableSignalFromEvent},"get")});var V2e=qF();Object.defineProperty(Bt,"asyncTransaction",{enumerable:!0,get:a(function(){return V2e.asyncTransaction},"get")});Object.defineProperty(Bt,"globalTransaction",{enumerable:!0,get:a(function(){return V2e.globalTransaction},"get")});Object.defineProperty(Bt,"subtransaction",{enumerable:!0,get:a(function(){return V2e.subtransaction},"get")});Object.defineProperty(Bt,"transaction",{enumerable:!0,get:a(function(){return V2e.transaction},"get")});Object.defineProperty(Bt,"TransactionImpl",{enumerable:!0,get:a(function(){return V2e.TransactionImpl},"get")});var tJn=kKn();Object.defineProperty(Bt,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return tJn.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Bt,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return tJn.ValueWithChangeEventFromObservable},"get")});var Uur=NKn();Object.defineProperty(Bt,"runOnChange",{enumerable:!0,get:a(function(){return Uur.runOnChange},"get")});Object.defineProperty(Bt,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return Uur.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Bt,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return Uur.runOnChangeWithStore},"get")});var rJn=BKn();Object.defineProperty(Bt,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return rJn.derivedConstOnceDefined},"get")});Object.defineProperty(Bt,"latestChangedValue",{enumerable:!0,get:a(function(){return rJn.latestChangedValue},"get")});var iGs=rH();Object.defineProperty(Bt,"observableFromEvent",{enumerable:!0,get:a(function(){return iGs.observableFromEvent},"get")});var oGs=jF();Object.defineProperty(Bt,"observableValue",{enumerable:!0,get:a(function(){return oGs.observableValue},"get")});var sGs=LKn();Object.defineProperty(Bt,"ObservableSet",{enumerable:!0,get:a(function(){return sGs.ObservableSet},"get")});var aGs=FKn();Object.defineProperty(Bt,"ObservableMap",{enumerable:!0,get:a(function(){return aGs.ObservableMap},"get")});var cGs=_T();Object.defineProperty(Bt,"DebugLocation",{enumerable:!0,get:a(function(){return cGs.DebugLocation},"get")});var Qur=x5(),nJn=Lct(),lGs=WKn(),ZKn=QIe(),uGs=h2(),dGs=JKn();(0,uGs._setDebugGetObservableGraph)(dGs.debugGetObservableGraph);(0,Qur.setLogObservableFn)(nJn.logObservableToConsole);var fGs=!1;fGs&&(0,Qur.addLogger)(new nJn.ConsoleObservableLogger);ZKn.env&&ZKn.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,Qur.addLogger)(lGs.DevToolsLogger.getInstance())});var sd=I(zpe=>{"use strict";p();Object.defineProperty(zpe,"__esModule",{value:!0});zpe.OffsetRangeSet=zpe.OffsetRange=void 0;var qct=Ts(),jct=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 qct.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 qct.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new qct.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)}};zpe.OffsetRangeSet=qur});var g2=I(Jpe=>{"use strict";p();Object.defineProperty(Jpe,"__esModule",{value:!0});Jpe.LineRangeSet=Jpe.LineRange=void 0;var iJn=Ts(),pGs=sd(),oJn=qp(),Ype=ZQ(),sJn=El(),Kpe=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,sJn.compareBy)(e=>e.startLineNumber,sJn.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new iJn.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,Ype.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,Ype.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Ype.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 Kpe(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,Ype.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Ype.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 Kpe(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Jpe.LineRangeSet=W2e});var Zpe=I(Gct=>{"use strict";p();Object.defineProperty(Gct,"__esModule",{value:!0});Gct.TextLength=void 0;var hGs=g2(),aJn=I_(),Hct=qp(),jur=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 Hct.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Hct.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Hct.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return hGs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new aJn.Position(e.lineNumber,e.column+this.columnCount):new aJn.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Hct.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};Gct.TextLength=jur});var Vct=I(sX=>{"use strict";p();Object.defineProperty(sX,"__esModule",{value:!0});sX.PositionOffsetTransformer=sX.PositionOffsetTransformerBase=void 0;sX._setPositionOffsetTransformerDependencies=yGs;var mGs=ZQ(),gGs=sd(),z2e=I_(),AGs=qp(),$ct=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new gGs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return AGs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new GF.deps.StringEdit(r)}getStringReplacement(e){return new GF.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new GF.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new GF.deps.TextEdit(r)}};sX.PositionOffsetTransformerBase=$ct;var GF=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 yGs(t){GF._deps=t}a(yGs,"_setPositionOffsetTransformerDependencies");var Hur=class extends $ct{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 z2e.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new z2e.Position(r,o+1)}if(e.column<1)return new z2e.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new z2e.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,mGs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new z2e.Position(n,o)}getTextLength(e){return GF.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new GF.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};sX.PositionOffsetTransformer=Hur});var CT=I(D5=>{"use strict";p();Object.defineProperty(D5,"__esModule",{value:!0});D5.StringText=D5.ArrayText=D5.LineBasedText=D5.AbstractText=void 0;var EGs=Yu(),_Gs=Gh(),CGs=I_(),cJn=qp(),vGs=Zpe(),lJn=Vct(),Y2e=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new CGs.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 cJn.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new lJn.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new cJn.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,_Gs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};D5.AbstractText=Y2e;var Wct=class extends Y2e{static{a(this,"LineBasedText")}constructor(e,r){(0,EGs.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{for(let d of l)(0,Oke.checkReportMissingProp)(t,d)}):(r.if((0,iar._)`${u} && (${(0,Oke.checkMissingProp)(t,l,s)})`),(0,Oke.reportMissingProp)(t,s),r.else())}}a(nGn,"validatePropertyDeps");s5.validatePropertyDeps=nGn;function iGn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,i3s.alwaysValidSchema)(s,e[l])||(r.if((0,Oke.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(iGn,"validateSchemaDeps");s5.validateSchemaDeps=iGn;s5.default=o3s});var aGn=I(oar=>{"use strict";p();Object.defineProperty(oar,"__esModule",{value:!0});var sGn=ds(),a3s=Va(),c3s={message:"property name must be valid",params:a(({params:t})=>(0,sGn._)`{propertyName: ${t.propertyName}}`,"params")},l3s={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:c3s,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,a3s.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,sGn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};oar.default=l3s});var aar=I(sar=>{"use strict";p();Object.defineProperty(sar,"__esModule",{value:!0});var fst=vw(),e2=ds(),u3s=vF(),pst=Va(),d3s={message:"must NOT have additional properties",params:a(({params:t})=>(0,e2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},f3s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:d3s,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,pst.alwaysValidSchema)(c,r))return;let d=(0,fst.allSchemaProperties)(n.properties),f=(0,fst.allSchemaProperties)(n.patternProperties);h(),t.ok((0,e2._)`${s} === ${u3s.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,pst.schemaRefOrVal)(c,n.properties,"properties");_=(0,fst.isOwnProperty)(e,v,E)}else d.length?_=(0,e2.or)(...d.map(v=>(0,e2._)`${E} === ${v}`)):_=e2.nil;return f.length&&(_=(0,e2.or)(_,...f.map(v=>(0,e2._)`${(0,fst.usePattern)(t,v)}.test(${E})`))),(0,e2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,e2._)`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,pst.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,e2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,e2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:pst.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};sar.default=f3s});var uGn=I(lar=>{"use strict";p();Object.defineProperty(lar,"__esModule",{value:!0});var p3s=vke(),cGn=vw(),car=Va(),lGn=aar(),h3s={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&&lGn.default.code(new p3s.KeywordCxt(s,lGn.default,"additionalProperties"));let c=(0,cGn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=car.mergeEvaluated.props(e,(0,car.toHash)(c),s.props));let l=c.filter(h=>!(0,car.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,cGn.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")}};lar.default=h3s});var hGn=I(uar=>{"use strict";p();Object.defineProperty(uar,"__esModule",{value:!0});var dGn=vw(),hst=ds(),fGn=Va(),pGn=Va(),m3s={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,dGn.allSchemaProperties)(r),u=l.filter(y=>(0,fGn.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 hst.Name)&&(s.props=(0,pGn.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,fGn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,hst._)`${(0,dGn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:pGn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,hst._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,hst.not)(f),()=>e.break())})})}a(A,"validateProperties")}};uar.default=m3s});var mGn=I(dar=>{"use strict";p();Object.defineProperty(dar,"__esModule",{value:!0});var g3s=Va(),A3s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,g3s.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"}};dar.default=A3s});var gGn=I(far=>{"use strict";p();Object.defineProperty(far,"__esModule",{value:!0});var y3s=vw(),E3s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:y3s.validateUnion,error:{message:"must match a schema in anyOf"}};far.default=E3s});var AGn=I(par=>{"use strict";p();Object.defineProperty(par,"__esModule",{value:!0});var mst=ds(),_3s=Va(),v3s={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,mst._)`{passingSchemas: ${t.passing}}`,"params")},C3s={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:v3s,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,_3s.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,mst._)`${u} && ${c}`).assign(c,!1).assign(l,(0,mst._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,mst.Name)})})}a(d,"validateOneOf")}};par.default=C3s});var yGn=I(har=>{"use strict";p();Object.defineProperty(har,"__esModule",{value:!0});var b3s=Va(),S3s={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,b3s.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};har.default=S3s});var vGn=I(mar=>{"use strict";p();Object.defineProperty(mar,"__esModule",{value:!0});var gst=ds(),_Gn=Va(),T3s={message:a(({params:t})=>(0,gst.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,gst._)`{failingKeyword: ${t.ifClause}}`,"params")},I3s={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:T3s,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,_Gn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=EGn(n,"then"),s=EGn(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,gst.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,gst._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function EGn(t,e){let r=t.schema[e];return r!==void 0&&!(0,_Gn.alwaysValidSchema)(t,r)}a(EGn,"hasSchema");mar.default=I3s});var CGn=I(gar=>{"use strict";p();Object.defineProperty(gar,"__esModule",{value:!0});var x3s=Va(),w3s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,x3s.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};gar.default=w3s});var bGn=I(Aar=>{"use strict";p();Object.defineProperty(Aar,"__esModule",{value:!0});var R3s=Xsr(),P3s=XHn(),k3s=ear(),D3s=tGn(),N3s=rGn(),M3s=oGn(),O3s=aGn(),B3s=aar(),L3s=uGn(),F3s=hGn(),U3s=mGn(),Q3s=gGn(),q3s=AGn(),j3s=yGn(),H3s=vGn(),G3s=CGn();function $3s(t=!1){let e=[U3s.default,Q3s.default,q3s.default,j3s.default,H3s.default,G3s.default,O3s.default,B3s.default,M3s.default,L3s.default,F3s.default];return t?e.push(P3s.default,D3s.default):e.push(R3s.default,k3s.default),e.push(N3s.default),e}a($3s,"getApplicator");Aar.default=$3s});var SGn=I(yar=>{"use strict";p();Object.defineProperty(yar,"__esModule",{value:!0});var Xp=ds(),V3s={message:a(({schemaCode:t})=>(0,Xp.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,Xp._)`{format: ${t}}`,"params")},W3s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:V3s,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,Xp._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,Xp._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,Xp._)`${y}.type || "string"`).assign(_,(0,Xp._)`${y}.validate`),()=>r.assign(E,(0,Xp._)`"string"`).assign(_,y)),t.fail$data((0,Xp.or)(v(),b()));function v(){return u.strictSchema===!1?Xp.nil:(0,Xp._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,Xp._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,Xp._)`${_}(${n})`,w=(0,Xp._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,Xp._)`${_} && ${_} !== 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,Xp.regexpCode)(w):u.code.formats?(0,Xp._)`${u.code.formats}${(0,Xp.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,Xp._)`${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,Xp._)`await ${_}(${n})`}return typeof E=="function"?(0,Xp._)`${_}(${n})`:(0,Xp._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};yar.default=W3s});var TGn=I(Ear=>{"use strict";p();Object.defineProperty(Ear,"__esModule",{value:!0});var z3s=SGn(),Y3s=[z3s.default];Ear.default=Y3s});var IGn=I(Ofe=>{"use strict";p();Object.defineProperty(Ofe,"__esModule",{value:!0});Ofe.contentVocabulary=Ofe.metadataVocabulary=void 0;Ofe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ofe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var wGn=I(_ar=>{"use strict";p();Object.defineProperty(_ar,"__esModule",{value:!0});var K3s=OHn(),J3s=YHn(),Z3s=bGn(),X3s=TGn(),xGn=IGn(),eFs=[K3s.default,J3s.default,(0,Z3s.default)(),X3s.default,xGn.metadataVocabulary,xGn.contentVocabulary];_ar.default=eFs});var PGn=I(Ast=>{"use strict";p();Object.defineProperty(Ast,"__esModule",{value:!0});Ast.DiscrError=void 0;var RGn;(function(t){t.Tag="tag",t.Mapping="mapping"})(RGn||(Ast.DiscrError=RGn={}))});var DGn=I(bar=>{"use strict";p();Object.defineProperty(bar,"__esModule",{value:!0});var Bfe=ds(),Car=PGn(),kGn=est(),tFs=Cke(),rFs=Va(),nFs={message:a(({params:{discrError:t,tagName:e}})=>t===Car.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,Bfe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},iFs={keyword:"discriminator",type:"object",schemaType:"object",error:nFs,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,Bfe._)`${r}${(0,Bfe.getProperty)(l)}`);e.if((0,Bfe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:Car.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,Bfe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:Car.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,Bfe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{oFs.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 Tar=I((od,Sar)=>{"use strict";p();Object.defineProperty(od,"__esModule",{value:!0});od.MissingRefError=od.ValidationError=od.CodeGen=od.Name=od.nil=od.stringify=od.str=od._=od.KeywordCxt=od.Ajv=void 0;var sFs=RHn(),aFs=wGn(),cFs=DGn(),MGn=NGn(),lFs=["/properties"],yst="http://json-schema.org/draft-07/schema",Lfe=class extends sFs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),aFs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(cFs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(MGn,lFs):MGn;this.addMetaSchema(e,yst,!1),this.refs["http://json-schema.org/schema"]=yst}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(yst)?yst:void 0)}};od.Ajv=Lfe;Sar.exports=od=Lfe;Sar.exports.Ajv=Lfe;Object.defineProperty(od,"__esModule",{value:!0});od.default=Lfe;var uFs=vke();Object.defineProperty(od,"KeywordCxt",{enumerable:!0,get:a(function(){return uFs.KeywordCxt},"get")});var Ffe=ds();Object.defineProperty(od,"_",{enumerable:!0,get:a(function(){return Ffe._},"get")});Object.defineProperty(od,"str",{enumerable:!0,get:a(function(){return Ffe.str},"get")});Object.defineProperty(od,"stringify",{enumerable:!0,get:a(function(){return Ffe.stringify},"get")});Object.defineProperty(od,"nil",{enumerable:!0,get:a(function(){return Ffe.nil},"get")});Object.defineProperty(od,"Name",{enumerable:!0,get:a(function(){return Ffe.Name},"get")});Object.defineProperty(od,"CodeGen",{enumerable:!0,get:a(function(){return Ffe.CodeGen},"get")});var dFs=Zot();Object.defineProperty(od,"ValidationError",{enumerable:!0,get:a(function(){return dFs.default},"get")});var fFs=Cke();Object.defineProperty(od,"MissingRefError",{enumerable:!0,get:a(function(){return fFs.default},"get")})});var jGn=I(l5=>{"use strict";p();Object.defineProperty(l5,"__esModule",{value:!0});l5.formatNames=l5.fastFormats=l5.fullFormats=void 0;function c5(t,e){return{validate:t,compare:e}}a(c5,"fmtDef");l5.fullFormats={date:c5(FGn,Rar),time:c5(xar(!0),Par),"date-time":c5(OGn(!0),QGn),"iso-time":c5(xar(),UGn),"iso-date-time":c5(OGn(),qGn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:yFs,"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:TFs,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:EFs,int32:{type:"number",validate:CFs},int64:{type:"number",validate:bFs},float:{type:"number",validate:LGn},double:{type:"number",validate:LGn},password:!0,binary:!0};l5.fastFormats={...l5.fullFormats,date:c5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Rar),time:c5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Par),"date-time":c5(/^\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,QGn),"iso-time":c5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,UGn),"iso-date-time":c5(/^\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,qGn),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};l5.formatNames=Object.keys(l5.fullFormats);function pFs(t){return t%4===0&&(t%100!==0||t%400===0)}a(pFs,"isLeapYear");var hFs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,mFs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function FGn(t){let e=hFs.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&&pFs(r)?29:mFs[n])}a(FGn,"date");function Rar(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(xar,"getTime");function Par(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(Par,"compareTime");function UGn(t,e){if(!(t&&e))return;let r=Iar.exec(t),n=Iar.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=_Fs}a(CFs,"validateInt32");function bFs(t){return Number.isInteger(t)}a(bFs,"validateInt64");function LGn(){return!0}a(LGn,"validateNumber");var SFs=/[^\\]\\Z/;function TFs(t){if(SFs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(TFs,"regex")});var HGn=I(Ufe=>{"use strict";p();Object.defineProperty(Ufe,"__esModule",{value:!0});Ufe.formatLimitDefinition=void 0;var IFs=Tar(),t2=ds(),Rj=t2.operators,Est={formatMaximum:{okStr:"<=",ok:Rj.LTE,fail:Rj.GT},formatMinimum:{okStr:">=",ok:Rj.GTE,fail:Rj.LT},formatExclusiveMaximum:{okStr:"<",ok:Rj.LT,fail:Rj.GTE},formatExclusiveMinimum:{okStr:">",ok:Rj.GT,fail:Rj.LTE}},xFs={message:a(({keyword:t,schemaCode:e})=>(0,t2.str)`should be ${Est[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,t2._)`{comparison: ${Est[t].okStr}, limit: ${e}}`,"params")};Ufe.formatLimitDefinition={keyword:Object.keys(Est),type:"string",schemaType:"string",$data:!0,error:xFs,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 IFs.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,t2._)`${m}[${u.schemaCode}]`);t.fail$data((0,t2.or)((0,t2._)`typeof ${g} != "object"`,(0,t2._)`${g} instanceof RegExp`,(0,t2._)`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,t2._)`${c.code.formats}${(0,t2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,t2._)`${m}.compare(${r}, ${n}) ${Est[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var wFs=a(t=>(t.addKeyword(Ufe.formatLimitDefinition),t),"formatLimitPlugin");Ufe.default=wFs});var WGn=I((Bke,VGn)=>{"use strict";p();Object.defineProperty(Bke,"__esModule",{value:!0});var Qfe=jGn(),RFs=HGn(),kar=ds(),GGn=new kar.Name("fullFormats"),PFs=new kar.Name("fastFormats"),Dar=a((t,e={keywords:!0})=>{if(Array.isArray(e))return $Gn(t,e,Qfe.fullFormats,GGn),t;let[r,n]=e.mode==="fast"?[Qfe.fastFormats,PFs]:[Qfe.fullFormats,GGn],o=e.formats||Qfe.formatNames;return $Gn(t,o,r,n),e.keywords&&(0,RFs.default)(t),t},"formatsPlugin");Dar.get=(t,e="full")=>{let n=(e==="fast"?Qfe.fastFormats:Qfe.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function $Gn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,kar._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a($Gn,"addFormats");VGn.exports=Bke=Dar;Object.defineProperty(Bke,"__esModule",{value:!0});Bke.default=Dar});var _$n=I((m0f,E$n)=>{p();E$n.exports=y$n;y$n.sync=QFs;var g$n=require("fs");function UFs(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();S$n.exports=C$n;C$n.sync=qFs;var v$n=require("fs");function C$n(t,e,r){v$n.stat(t,function(n,o){r(n,n?!1:b$n(o,e))})}a(C$n,"isexe");function qFs(t,e){return b$n(v$n.statSync(t),e)}a(qFs,"sync");function b$n(t,e){return t.isFile()&&jFs(t,e)}a(b$n,"checkStat");function jFs(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(jFs,"checkMode")});var x$n=I((C0f,I$n)=>{p();var v0f=require("fs"),Mst;process.platform==="win32"||global.TESTING_WINDOWS?Mst=_$n():Mst=T$n();I$n.exports=zar;zar.sync=HFs;function zar(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){zar(t,e||{},function(s,c){s?o(s):n(c)})})}Mst(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(zar,"isexe");function HFs(t,e){try{return Mst.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(HFs,"sync")});var M$n=I((T0f,N$n)=>{p();var Jfe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",w$n=require("path"),GFs=Jfe?";":":",R$n=x$n(),P$n=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),k$n=a((t,e)=>{let r=e.colon||GFs,n=t.match(/\//)||Jfe&&t.match(/\\/)?[""]:[...Jfe?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=Jfe?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Jfe?o.split(r):[""];return Jfe&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),D$n=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=k$n(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(P$n(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=w$n.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];R$n(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"),$Fs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=k$n(t,e),s=[];for(let c=0;c{"use strict";p();var O$n=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");Yar.exports=O$n;Yar.exports.default=O$n});var Q$n=I((k0f,U$n)=>{"use strict";p();var L$n=require("path"),VFs=M$n(),WFs=B$n();function F$n(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=VFs.sync(t.command,{path:r[WFs({env:r})],pathExt:e?L$n.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=L$n.resolve(o?t.options.cwd:"",c)),c}a(F$n,"resolveCommandAttempt");function zFs(t){return F$n(t)||F$n(t,!0)}a(zFs,"resolveCommand");U$n.exports=zFs});var q$n=I((M0f,Jar)=>{"use strict";p();var Kar=/([()\][%!^"`<>&|;, *?])/g;function YFs(t){return t=t.replace(Kar,"^$1"),t}a(YFs,"escapeCommand");function KFs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Kar,"^$1"),e&&(t=t.replace(Kar,"^$1")),t}a(KFs,"escapeArgument");Jar.exports.command=YFs;Jar.exports.argument=KFs});var H$n=I((L0f,j$n)=>{"use strict";p();j$n.exports=/^#!(.*)/});var $$n=I((U0f,G$n)=>{"use strict";p();var JFs=H$n();G$n.exports=(t="")=>{let e=t.match(JFs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var W$n=I((q0f,V$n)=>{"use strict";p();var Zar=require("fs"),ZFs=$$n();function XFs(t){let r=Buffer.alloc(150),n;try{n=Zar.openSync(t,"r"),Zar.readSync(n,r,0,150,0),Zar.closeSync(n)}catch{}return ZFs(r.toString())}a(XFs,"readShebang");V$n.exports=XFs});var J$n=I((G0f,K$n)=>{"use strict";p();var e8s=require("path"),z$n=Q$n(),Y$n=q$n(),t8s=W$n(),r8s=process.platform==="win32",n8s=/\.(?:com|exe)$/i,i8s=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function o8s(t){t.file=z$n(t);let e=t.file&&t8s(t.file);return e?(t.args.unshift(t.file),t.command=e,z$n(t)):t.file}a(o8s,"detectShebang");function s8s(t){if(!r8s)return t;let e=o8s(t),r=!n8s.test(e);if(t.options.forceShell||r){let n=i8s.test(e);t.command=e8s.normalize(t.command),t.command=Y$n.command(t.command),t.args=t.args.map(s=>Y$n.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(s8s,"parseNonShell");function a8s(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:s8s(n)}a(a8s,"parse");K$n.exports=a8s});var eVn=I((W0f,X$n)=>{"use strict";p();var Xar=process.platform==="win32";function ecr(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(ecr,"notFoundError");function c8s(t,e){if(!Xar)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=Z$n(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(c8s,"hookChildProcess");function Z$n(t,e){return Xar&&t===1&&!e.file?ecr(e.original,"spawn"):null}a(Z$n,"verifyENOENT");function l8s(t,e){return Xar&&t===1&&!e.file?ecr(e.original,"spawnSync"):null}a(l8s,"verifyENOENTSync");X$n.exports={hookChildProcess:c8s,verifyENOENT:Z$n,verifyENOENTSync:l8s,notFoundError:ecr}});var nVn=I((K0f,Zfe)=>{"use strict";p();var tVn=require("child_process"),tcr=J$n(),rcr=eVn();function rVn(t,e,r){let n=tcr(t,e,r),o=tVn.spawn(n.command,n.args,n.options);return rcr.hookChildProcess(o,n),o}a(rVn,"spawn");function u8s(t,e,r){let n=tcr(t,e,r),o=tVn.spawnSync(n.command,n.args,n.options);return o.error=o.error||rcr.verifyENOENTSync(o.status,n),o}a(u8s,"spawnSync");Zfe.exports=rVn;Zfe.exports.spawn=rVn;Zfe.exports.sync=u8s;Zfe.exports._parse=tcr;Zfe.exports._enoent=rcr});var pT=I(NZ=>{"use strict";p();Object.defineProperty(NZ,"__esModule",{value:!0});NZ.DebugNameData=void 0;NZ.getDebugName=lzn;NZ.getClassName=uzn;NZ.getFunctionName=dzn;var Vcr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return lzn(e,this)}};NZ.DebugNameData=Vcr;var szn=new Map,Wcr=new WeakMap;function lzn(t,e){let r=Wcr.get(t);if(r)return r;let n=M9s(t,e);if(n){let o=szn.get(n)??0;o++,szn.set(n,o);let s=o===1?n:`${n}#${o}`;return Wcr.set(t,s),s}}a(lzn,"getDebugName");function M9s(t,e){let r=Wcr.get(t);if(r)return r;let n=e.owner?B9s(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=dzn(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=O9s(e.owner,t);if(l!==void 0)return n+l}}a(M9s,"computeDebugName");function O9s(t,e){for(let r in t)if(t[r]===e)return r}a(O9s,"findKey");var azn=new Map,czn=new WeakMap;function B9s(t){let e=czn.get(t);if(e)return e;let r=uzn(t)??"Object",n=azn.get(r)??0;n++,azn.set(r,n);let o=n===1?r:`${r}#${n}`;return czn.set(t,o),o}a(B9s,"formatOwner");function uzn(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(uzn,"getClassName");function dzn(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(dzn,"getFunctionName")});var Szn=I(up=>{"use strict";p();var L9s=up&&up.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F9s=up&&up.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U9s=up&&up.__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(mzn,"strictEqualsC");function gzn(t,e,r){return hzn.equals(t,e,r??xat)}a(gzn,"arrayEquals");function Azn(t){return(e,r)=>hzn.equals(e,r,t??xat)}a(Azn,"arrayEqualsC");function c2e(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;rc2e(t,e)}a(yzn,"structuralEqualsC");function Q9s(t){return JSON.stringify(zcr(t))}a(Q9s,"getStructuralKey");var q9s=0,fzn=new WeakMap;function zcr(t){if(Array.isArray(t))return t.map(zcr);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]=zcr(e[n]);return r}else{let e=fzn.get(t);return e===void 0&&(e=q9s++,fzn.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(zcr,"toNormalizedJsonStructure");function Ezn(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Ezn,"jsonStringifyEquals");function _zn(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(_zn,"jsonStringifyEqualsC");function vzn(){return(t,e)=>t.equals(e)}a(vzn,"thisEqualsC");function Czn(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(Czn,"equalsIfDefined");function bzn(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(bzn,"equalsIfDefinedC");var pzn;(function(t){t.strict=xat,t.strictC=mzn,t.array=gzn,t.arrayC=Azn,t.structural=c2e,t.structuralC=yzn,t.jsonStringify=Ezn,t.jsonStringifyC=_zn,t.thisC=vzn,t.ifDefined=Czn,t.ifDefinedC=bzn})(pzn||(up.equals=pzn={}))});var K_=I(dp=>{"use strict";p();Object.defineProperty(dp,"__esModule",{value:!0});dp.trackDisposable=dp.toDisposable=dp.markAsDisposed=dp.DisposableStore=dp.Event=dp.onUnexpectedError=dp.onBugIndicatingError=dp.BugIndicatingError=dp.strictEquals=dp.assertFn=void 0;var j9s=Yu();Object.defineProperty(dp,"assertFn",{enumerable:!0,get:a(function(){return j9s.assertFn},"get")});var H9s=Szn();Object.defineProperty(dp,"strictEquals",{enumerable:!0,get:a(function(){return H9s.strictEquals},"get")});var Ycr=Cs();Object.defineProperty(dp,"BugIndicatingError",{enumerable:!0,get:a(function(){return Ycr.BugIndicatingError},"get")});Object.defineProperty(dp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return Ycr.onBugIndicatingError},"get")});Object.defineProperty(dp,"onUnexpectedError",{enumerable:!0,get:a(function(){return Ycr.onUnexpectedError},"get")});var G9s=Cc();Object.defineProperty(dp,"Event",{enumerable:!0,get:a(function(){return G9s.Event},"get")});var wat=wo();Object.defineProperty(dp,"DisposableStore",{enumerable:!0,get:a(function(){return wat.DisposableStore},"get")});Object.defineProperty(dp,"markAsDisposed",{enumerable:!0,get:a(function(){return wat.markAsDisposed},"get")});Object.defineProperty(dp,"toDisposable",{enumerable:!0,get:a(function(){return wat.toDisposable},"get")});Object.defineProperty(dp,"trackDisposable",{enumerable:!0,get:a(function(){return wat.trackDisposable},"get")})});var Tzn=I(Kcr=>{"use strict";p();Object.defineProperty(Kcr,"__esModule",{value:!0});Kcr.handleBugIndicatingErrorRecovery=V9s;var $9s=K_();function V9s(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,$9s.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(V9s,"handleBugIndicatingErrorRecovery")});var m5=I(fpe=>{"use strict";p();Object.defineProperty(fpe,"__esModule",{value:!0});fpe.addLogger=W9s;fpe.getLogger=z9s;fpe.setLogObservableFn=Y9s;fpe.logObservable=K9s;var MZ;function W9s(t){MZ?MZ instanceof Rat?MZ.loggers.push(t):MZ=new Rat([MZ,t]):MZ=t}a(W9s,"addLogger");function z9s(){return MZ}a(z9s,"getLogger");var Jcr;function Y9s(t){Jcr=t}a(Y9s,"setLogObservableFn");function K9s(t){Jcr&&Jcr(t)}a(K9s,"logObservable");var Rat=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 IF=I(Oj=>{"use strict";p();Object.defineProperty(Oj,"__esModule",{value:!0});Oj.TransactionImpl=void 0;Oj.transaction=Zcr;Oj.globalTransaction=Z9s;Oj.asyncTransaction=X9s;Oj.subtransaction=eUs;var Izn=Tzn(),J9s=pT(),xzn=m5();function Zcr(t,e){let r=new ppe(t,e);try{t(r)}finally{r.finish()}}a(Zcr,"transaction");var Pat;function Z9s(t){if(Pat)t(Pat);else{let e=new ppe(t,void 0);Pat=e;try{t(e)}finally{e.finish(),Pat=void 0}}}a(Z9s,"globalTransaction");async function X9s(t,e){let r=new ppe(t,e);try{await t(r)}finally{r.finish()}}a(X9s,"asyncTransaction");function eUs(t,e,r){t?e(t):Zcr(e,r)}a(eUs,"subtransaction");var ppe=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,xzn.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,J9s.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Izn.handleBugIndicatingErrorRecovery)("Transaction already finished!"),Zcr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Izn.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(kat,"__esModule",{value:!0});kat.DebugLocation=void 0;var wzn;(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,Xcr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(wzn||(kat.DebugLocation=wzn={}));var Xcr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` +`),o=tUs(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 tUs(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(tUs,"parseLine")});var s2=I(g5=>{"use strict";p();Object.defineProperty(g5,"__esModule",{value:!0});g5.BaseObservable=g5.ConvenientObservable=void 0;g5._setDerivedOpts=nUs;g5._setRecomputeInitiallyAndOnChange=iUs;g5._setKeepObserved=oUs;g5._setDebugGetObservableGraph=sUs;var Rzn=hT(),rUs=pT(),hpe=m5(),elr;function nUs(t){elr=t}a(nUs,"_setDerivedOpts");var Pzn;function iUs(t){Pzn=t}a(iUs,"_setRecomputeInitiallyAndOnChange");var kzn;function oUs(t){kzn=t}a(oUs,"_setKeepObserved");var tlr;function sUs(t){tlr=t}a(sUs,"_setDebugGetObservableGraph");var Dat=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=Rzn.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return elr({owner:o,debugName:a(()=>{let c=(0,rUs.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 elr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(Pzn(this,r)),this}keepObserved(e){return e.add(kzn(this)),this}get debugValue(){return this.get()}get debug(){return new rlr(this)}};g5.ConvenientObservable=Dat;var rlr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return tlr(this.observable,{type:"dependencies"})}getObserverGraph(){return tlr(this.observable,{type:"observers"})}},nlr=class extends Dat{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,hpe.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,hpe.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,hpe.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,hpe.getLogger)();return(0,hpe.logObservable)(this),e||(0,hpe.getLogger)()?.handleObservableCreated(this,Rzn.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};g5.BaseObservable=nlr});var xF=I(Bj=>{"use strict";p();Object.defineProperty(Bj,"__esModule",{value:!0});Bj.DisposableObservableValue=Bj.ObservableValue=void 0;Bj.observableValue=lUs;Bj.disposableObservableValue=uUs;var aUs=IF(),cUs=s2(),Nzn=K_(),Nat=pT(),Dzn=m5(),Mzn=hT();function lUs(t,e,r=Mzn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Nat.DebugNameData(void 0,t,void 0):n=new Nat.DebugNameData(t,void 0,void 0),new l2e(n,e,Nzn.strictEquals,r)}a(lUs,"observableValue");var l2e=class extends cUs.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,Dzn.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 aUs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,Dzn.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}};Bj.ObservableValue=l2e;function uUs(t,e,r=Mzn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Nat.DebugNameData(void 0,t,void 0):n=new Nat.DebugNameData(t,void 0,void 0),new Mat(n,e,Nzn.strictEquals,r)}a(uUs,"disposableObservableValue");var Mat=class extends l2e{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};Bj.DisposableObservableValue=Mat});var Bzn=I(Oat=>{"use strict";p();Object.defineProperty(Oat,"__esModule",{value:!0});Oat.LazyObservableValue=void 0;var dUs=IF(),Ozn=m5(),fUs=s2(),ilr=class extends fUs.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,Ozn.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,Ozn.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 dUs.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}};Oat.LazyObservableValue=ilr});var Bat=I(olr=>{"use strict";p();Object.defineProperty(olr,"__esModule",{value:!0});olr.observableValueOpts=gUs;var Lzn=pT(),Fzn=K_(),pUs=xF(),hUs=Bzn(),mUs=hT();function gUs(t,e,r=mUs.DebugLocation.ofCaller()){return t.lazy?new hUs.LazyObservableValue(new Lzn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Fzn.strictEquals,r):new pUs.ObservableValue(new Lzn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Fzn.strictEquals,r)}a(gUs,"observableValueOpts")});var Fat=I(Lat=>{"use strict";p();Object.defineProperty(Lat,"__esModule",{value:!0});Lat.AutorunObserver=void 0;var Tw=K_(),u2e=m5();function AUs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(AUs,"autorunStateToString");var slr=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,u2e.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,Tw.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,u2e.getLogger)()?.handleAutorunDisposed(this),(0,Tw.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,u2e.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,Tw.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,u2e.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,Tw.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,u2e.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,Tw.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Tw.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 Tw.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new Tw.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new Tw.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new Tw.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:AUs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,Tw.onBugIndicatingError)(new Tw.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Lat.AutorunObserver=slr});var OZ=I(Iw=>{"use strict";p();Object.defineProperty(Iw,"__esModule",{value:!0});Iw.autorun=llr;Iw.autorunOpts=d2e;Iw.autorunHandleChanges=Uzn;Iw.autorunWithStoreHandleChanges=_Us;Iw.autorunWithStore=vUs;Iw.autorunDelta=CUs;Iw.autorunIterableDelta=bUs;Iw.autorunPerKeyedItem=SUs;Iw.autorunSelfDisposable=TUs;Iw.registerAutorunSelfDisposable=IUs;var mpe=K_(),alr=pT(),clr=Fat(),gpe=hT(),yUs=xF(),EUs=IF();function llr(t,e=gpe.DebugLocation.ofCaller()){return new clr.AutorunObserver(new alr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(llr,"autorun");function d2e(t,e,r=gpe.DebugLocation.ofCaller()){return new clr.AutorunObserver(new alr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(d2e,"autorunOpts");function Uzn(t,e,r=gpe.DebugLocation.ofCaller()){return new clr.AutorunObserver(new alr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(Uzn,"autorunHandleChanges");function _Us(t,e){let r=new mpe.DisposableStore,n=Uzn({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,mpe.toDisposable)(()=>{n.dispose(),r.dispose()})}a(_Us,"autorunWithStoreHandleChanges");function vUs(t){let e=new mpe.DisposableStore,r=d2e({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,mpe.toDisposable)(()=>{r.dispose(),e.dispose()})}a(vUs,"autorunWithStore");function CUs(t,e){let r;return d2e({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(CUs,"autorunDelta");function bUs(t,e,r=n=>n){let n=new Map;return d2e({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(bUs,"autorunIterableDelta");function SUs(t,e,r,n=gpe.DebugLocation.ofCaller()){let o=new Map,s=d2e({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,EUs.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 mpe.DisposableStore,E={value:(0,yUs.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,mpe.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(SUs,"autorunPerKeyedItem");function TUs(t,e=gpe.DebugLocation.ofCaller()){let r,n=!1;return r=llr(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(TUs,"autorunSelfDisposable");function IUs(t,e,r=gpe.DebugLocation.ofCaller()){let n,o=!1;n=llr(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(IUs,"registerAutorunSelfDisposable")});var ype=I(Ape=>{"use strict";p();Object.defineProperty(Ape,"__esModule",{value:!0});Ape.DerivedWithSetter=Ape.Derived=void 0;var xUs=s2(),BZ=K_(),ulr=m5();function wUs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(wUs,"derivedStateToString");var Uat=class extends xUs.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,ulr.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,ulr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,BZ.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 BZ.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,BZ.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,ulr.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,BZ.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 BZ.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 BZ.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new BZ.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:wUs(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)}};Ape.Derived=Uat;var dlr=class extends Uat{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};Ape.DerivedWithSetter=dlr});var Qat=I(Lj=>{"use strict";p();Object.defineProperty(Lj,"__esModule",{value:!0});Lj.derived=PUs;Lj.derivedWithSetter=kUs;Lj.derivedOpts=Qzn;Lj.derivedHandleChanges=DUs;Lj.derivedWithStore=NUs;Lj.derivedDisposable=MUs;var A5=K_(),Epe=hT(),LZ=pT(),RUs=s2(),FZ=ype();function PUs(t,e,r=Epe.DebugLocation.ofCaller()){return e!==void 0?new FZ.Derived(new LZ.DebugNameData(t,void 0,e),e,void 0,void 0,A5.strictEquals,r):new FZ.Derived(new LZ.DebugNameData(void 0,void 0,t),t,void 0,void 0,A5.strictEquals,r)}a(PUs,"derived");function kUs(t,e,r,n=Epe.DebugLocation.ofCaller()){return new FZ.DerivedWithSetter(new LZ.DebugNameData(t,void 0,e),e,void 0,void 0,A5.strictEquals,r,n)}a(kUs,"derivedWithSetter");function Qzn(t,e,r=Epe.DebugLocation.ofCaller()){return new FZ.Derived(new LZ.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??A5.strictEquals,r)}a(Qzn,"derivedOpts");(0,RUs._setDerivedOpts)(Qzn);function DUs(t,e,r=Epe.DebugLocation.ofCaller()){return new FZ.Derived(new LZ.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??A5.strictEquals,r)}a(DUs,"derivedHandleChanges");function NUs(t,e,r=Epe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new A5.DisposableStore;return new FZ.Derived(new LZ.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new A5.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),A5.strictEquals,r)}a(NUs,"derivedWithStore");function MUs(t,e,r=Epe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new FZ.Derived(new LZ.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new A5.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},A5.strictEquals,r)}a(MUs,"derivedDisposable")});var Hzn=I(xw=>{"use strict";p();Object.defineProperty(xw,"__esModule",{value:!0});xw.ObservableLazyPromise=xw.ObservableResolvedPromise=xw.PromiseResult=xw.ObservablePromise=xw.ObservableLazy=void 0;var OUs=OZ(),qzn=IF(),jzn=Qat(),qat=xF(),jat=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,qat.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};xw.ObservableLazy=jat;var Hat=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,qat.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,jzn.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,qzn.transaction)(n=>{this._value.set(new f2e(r,void 0),n)}),r),r=>{throw(0,qzn.transaction)(n=>{this._value.set(new f2e(void 0,r),n)}),r})}};xw.ObservablePromise=Hat;var f2e=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};xw.PromiseResult=f2e;var flr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,qat.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,qat.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,OUs.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)}))}};xw.ObservableResolvedPromise=flr;var plr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new jat(()=>new Hat(this._computePromise())),this.cachedPromiseResult=(0,jzn.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};xw.ObservableLazyPromise=plr});var mlr=I(y5=>{"use strict";p();Object.defineProperty(y5,"__esModule",{value:!0});y5.cancelOnDispose=y5.CancellationTokenSource=y5.CancellationToken=y5.CancellationError=void 0;var BUs=Cs();Object.defineProperty(y5,"CancellationError",{enumerable:!0,get:a(function(){return BUs.CancellationError},"get")});var hlr=Ak();Object.defineProperty(y5,"CancellationToken",{enumerable:!0,get:a(function(){return hlr.CancellationToken},"get")});Object.defineProperty(y5,"CancellationTokenSource",{enumerable:!0,get:a(function(){return hlr.CancellationTokenSource},"get")});Object.defineProperty(y5,"cancelOnDispose",{enumerable:!0,get:a(function(){return hlr.cancelOnDispose},"get")})});var Gzn=I(Gat=>{"use strict";p();Object.defineProperty(Gat,"__esModule",{value:!0});Gat.waitForState=jUs;Gat.derivedWithCancellationToken=HUs;var LUs=pT(),glr=mlr(),FUs=K_(),UUs=OZ(),QUs=ype(),qUs=hT();function jUs(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,UUs.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 glr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new glr.CancellationError);return}}c=!1,l&&d.dispose()})}a(jUs,"waitForState");function HUs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new QUs.Derived(new LUs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new glr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),FUs.strictEquals,qUs.DebugLocation.ofCaller())}a(HUs,"derivedWithCancellationToken")});var Fj=I(UZ=>{"use strict";p();Object.defineProperty(UZ,"__esModule",{value:!0});UZ.FromEventObservable=void 0;UZ.observableFromEvent=Alr;UZ.observableFromEventOpts=VUs;var GUs=IF(),Vzn=K_(),Wzn=pT(),$zn=m5(),$Us=s2(),zzn=hT();function Alr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new a2(new Wzn.DebugNameData(e,void 0,n),r,n,()=>a2.globalTransaction,Vzn.strictEquals,o??zzn.DebugLocation.ofCaller())}a(Alr,"observableFromEvent");function VUs(t,e,r,n=zzn.DebugLocation.ofCaller()){return new a2(new Wzn.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??a2.globalTransaction,t.equalsFn??Vzn.strictEquals,n)}a(VUs,"observableFromEventOpts");var a2=class extends $Us.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,GUs.subtransaction)(this._getTransaction(),m=>{(0,$zn.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,$zn.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}}};UZ.FromEventObservable=a2;(function(t){t.Observer=a2;function e(r,n){let o=!1;a2.globalTransaction===void 0&&(a2.globalTransaction=r,o=!0);try{n()}finally{o&&(a2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Alr||(UZ.observableFromEvent=Alr={}))});var Elr=I(ylr=>{"use strict";p();Object.defineProperty(ylr,"__esModule",{value:!0});ylr.observableSignal=JUs;var WUs=IF(),zUs=pT(),YUs=s2(),KUs=hT();function JUs(t,e=KUs.DebugLocation.ofCaller()){return typeof t=="string"?new $at(t,void 0,e):new $at(void 0,t,e)}a(JUs,"observableSignal");var $at=class extends YUs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new zUs.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,WUs.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 Wat=I(fE=>{"use strict";p();Object.defineProperty(fE,"__esModule",{value:!0});fE.KeepAliveObserver=void 0;fE.observableFromPromise=ZUs;fE.signalFromObservable=XUs;fE.debouncedObservable=e7s;fE.throttledObservable=t7s;fE.debouncedObservable2=r7s;fE.wasEventTriggeredRecently=n7s;fE.keepObserved=eYn;fE.recomputeInitiallyAndOnChange=tYn;fE.derivedObservableWithCache=i7s;fE.derivedObservableWithWritableCache=o7s;fE.mapObservableArrayCached=s7s;fE.isObservable=a7s;var Yzn=OZ(),Kzn=xF(),_lr=K_(),h2e=Qat(),Jzn=Fj(),Zzn=Elr(),Xzn=s2(),vlr=hT();function ZUs(t){let e=(0,Kzn.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(ZUs,"observableFromPromise");function XUs(t,e){return(0,h2e.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(XUs,"signalFromObservable");function e7s(t,e,r=vlr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,Jzn.observableFromEvent)(void 0,c=>{let l=(0,Yzn.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(e7s,"debouncedObservable");function t7s(t,e,r=vlr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,Jzn.observableFromEvent)(void 0,c=>{let l=(0,Yzn.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(t7s,"throttledObservable");function r7s(t,e,r=vlr.DebugLocation.ofCaller()){let n=(0,Zzn.observableSignal)("handleTimeout"),o,s;return(0,h2e.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(r7s,"debouncedObservable2");function n7s(t,e,r){let n=(0,Kzn.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(n7s,"wasEventTriggeredRecently");function eYn(t){let e=new p2e(!1,void 0);return t.addObserver(e),(0,_lr.toDisposable)(()=>{t.removeObserver(e)})}a(eYn,"keepObserved");(0,Xzn._setKeepObserved)(eYn);function tYn(t,e){let r=new p2e(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,_lr.toDisposable)(()=>{t.removeObserver(r)})}a(tYn,"recomputeInitiallyAndOnChange");(0,Xzn._setRecomputeInitiallyAndOnChange)(tYn);var p2e=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){}};fE.KeepAliveObserver=p2e;function i7s(t,e){let r;return(0,h2e.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(i7s,"derivedObservableWithCache");function o7s(t,e){let r,n=(0,Zzn.observableSignal)("derivedObservableWithWritableCache"),o=(0,h2e.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(o7s,"derivedObservableWithWritableCache");function s7s(t,e,r,n){let o=new Vat(r,n);return(0,h2e.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Vat(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(s7s,"mapObservableArrayCached");var Vat=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 _lr.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 a7s(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(a7s,"isObservable")});var nYn=I(zat=>{"use strict";p();Object.defineProperty(zat,"__esModule",{value:!0});zat.recordChanges=c7s;zat.recordChangesLazy=l7s;var rYn=K_();function c7s(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 rYn.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(c7s,"recordChanges");function l7s(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 rYn.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(l7s,"recordChangesLazy")});var iYn=I(blr=>{"use strict";p();Object.defineProperty(blr,"__esModule",{value:!0});blr.constObservable=d7s;var u7s=s2();function d7s(t){return new Clr(t)}a(d7s,"constObservable");var Clr=class extends u7s.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 oYn=I(Tlr=>{"use strict";p();Object.defineProperty(Tlr,"__esModule",{value:!0});Tlr.observableSignalFromEvent=g7s;var f7s=IF(),p7s=pT(),h7s=s2(),m7s=hT();function g7s(t,e,r=m7s.DebugLocation.ofCaller()){return new Slr(typeof t=="string"?t:new p7s.DebugNameData(t,void 0,void 0),e,r)}a(g7s,"observableSignalFromEvent");var Slr=class extends h7s.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,f7s.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 sYn=I(m2e=>{"use strict";p();Object.defineProperty(m2e,"__esModule",{value:!0});m2e.ValueWithChangeEventFromObservable=void 0;m2e.observableFromValueWithChangeEvent=E7s;var A7s=K_(),y7s=Fj(),Yat=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return A7s.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};m2e.ValueWithChangeEventFromObservable=Yat;function E7s(t,e){return e instanceof Yat?e.observable:(0,y7s.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(E7s,"observableFromValueWithChangeEvent")});var lYn=I(g2e=>{"use strict";p();Object.defineProperty(g2e,"__esModule",{value:!0});g2e.runOnChange=aYn;g2e.runOnChangeWithStore=cYn;g2e.runOnChangeWithCancellationToken=b7s;var _7s=mlr(),v7s=K_(),C7s=OZ();function aYn(t,e){let r,n=!0;return(0,C7s.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(aYn,"runOnChange");function cYn(t,e){let r=new v7s.DisposableStore,n=aYn(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(cYn,"runOnChangeWithStore");function b7s(t,e){return cYn(t,(r,n,o,s)=>{e(r,n,o,(0,_7s.cancelOnDispose)(s))})}a(b7s,"runOnChangeWithCancellationToken")});var fYn=I(Kat=>{"use strict";p();Object.defineProperty(Kat,"__esModule",{value:!0});Kat.latestChangedValue=x7s;Kat.derivedConstOnceDefined=w7s;var uYn=K_(),dYn=pT(),S7s=Fj(),T7s=OZ(),I7s=Wat();function x7s(t,e){if(e.length===0)throw new uYn.BugIndicatingError;let r=!1,n,o=(0,S7s.observableFromEvent)(t,s=>{let c=new uYn.DisposableStore;for(let l of e)c.add((0,T7s.autorunOpts)({debugName:a(()=>(0,dYn.getDebugName)(o,new dYn.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(x7s,"latestChangedValue");function w7s(t,e){return(0,I7s.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(w7s,"derivedConstOnceDefined")});var pYn=I(Jat=>{"use strict";p();Object.defineProperty(Jat,"__esModule",{value:!0});Jat.ObservableSet=void 0;var R7s=Bat(),Ilr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,R7s.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"}};Jat.ObservableSet=Ilr});var hYn=I(Zat=>{"use strict";p();Object.defineProperty(Zat,"__esModule",{value:!0});Zat.ObservableMap=void 0;var P7s=Bat(),xlr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,P7s.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"}};Zat.ObservableMap=xlr});var tct=I(bpe=>{"use strict";p();Object.defineProperty(bpe,"__esModule",{value:!0});bpe.ConsoleObservableLogger=void 0;bpe.logObservableToConsole=N7s;bpe.formatValue=Cpe;var k7s=m5(),D7s=pT(),mYn=ype(),Xat;function N7s(t){Xat||(Xat=new ect,(0,k7s.addLogger)(Xat)),Xat.addFilteredObj(t)}a(N7s,"logObservableToConsole");var ect=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 M7s([_pe(L7s("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[_pe(" "),ww(Cpe(e.oldValue,70),{color:"red",strikeThrough:!0}),_pe(" "),ww(Cpe(e.newValue,60),{color:"green"})]:[_pe(" (unchanged)")]:[_pe(" "),ww(Cpe(e.newValue,60),{color:"green"}),_pe(" (initial)")]}handleObservableCreated(e){if(e instanceof mYn.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 mYn.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([vpe("observable value changed"),ww(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return ww(" (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([vpe("derived recomputed"),ww(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([vpe("derived cleared"),ww(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([vpe("observable from event triggered"),ww(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([vpe("autorun"),ww(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([vpe("transaction"),ww(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};bpe.ConsoleObservableLogger=ect;function M7s(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(M7s,"consoleTextToArgs");function _pe(t){return ww(t,{color:"black"})}a(_pe,"normalText");function vpe(t){return ww(F7s(`${t}: `,10),{color:"black",bold:!0})}a(vpe,"formatKind");function ww(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(ww,"styled");function Cpe(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)?O7s(t,e):B7s(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(Cpe,"formatValue");function O7s(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${Cpe(o,e-r.length)}`}return r+=" ]",r}a(O7s,"formatArray");function B7s(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,D7s.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}: ${Cpe(c,e-n.length)}`}return n+=r?")":" }",n}a(B7s,"formatObject");function L7s(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(L7s,"repeat");function F7s(t,e){for(;t.length{"use strict";p();Object.defineProperty(rct,"__esModule",{value:!0});rct.SimpleTypedRpcConnection=void 0;var wlr=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}}};rct.SimpleTypedRpcConnection=wlr});var AYn=I(Rlr=>{"use strict";p();Object.defineProperty(Rlr,"__esModule",{value:!0});Rlr.registerDebugChannel=Q7s;var U7s=gYn();function Q7s(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=q7s({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},U7s.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(Q7s,"registerDebugChannel");function q7s(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(q7s,"createChannelFactoryFromDebugChannel")});var _Yn=I(Uj=>{"use strict";p();Object.defineProperty(Uj,"__esModule",{value:!0});Uj.Throttler=Uj.Debouncer=void 0;Uj.deepAssign=yYn;Uj.deepAssignDeleteNulls=EYn;var Plr=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)}};Uj.Debouncer=Plr;var klr=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)}};Uj.Throttler=klr;function yYn(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?yYn(t[r],e[r]):t[r]=e[r]}a(yYn,"deepAssign");function EYn(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"?EYn(t[r],e[r]):t[r]=e[r]}a(EYn,"deepAssignDeleteNulls")});var bYn=I(ict=>{"use strict";p();Object.defineProperty(ict,"__esModule",{value:!0});ict.DevToolsLogger=void 0;var vYn=Fat(),nct=tct(),j7s=AYn(),Dlr=_Yn(),A2e=RS(),H7s=Fj(),QZ=Cs(),qZ=ype(),CYn=xF(),G7s=hT(),Nlr=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,QZ.onUnexpectedError)(new QZ.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,QZ.onUnexpectedError)(new QZ.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof qZ.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(A2e.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 vYn.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 qZ.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,j7s.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(A2e.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(A2e.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(A2e.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(A2e.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof qZ.Derived)n.debugSetValue(r);else if(n instanceof CYn.ObservableValue)n.debugSetValue(r);else if(n instanceof H7s.FromEventObservable)n.debugSetValue(r);else throw new QZ.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 qZ.Derived)return(0,nct.formatValue)(r.debugGetState().value,200);if(r instanceof CYn.ObservableValue)return(0,nct.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 QZ.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof qZ.Derived)r.debugRecompute();else if(r instanceof vYn.AutorunObserver)r.debugRerun();else throw new QZ.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new Dlr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},G7s.DebugLocation.enable()}_handleChange(e){(0,Dlr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,Dlr.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 qZ.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 qZ.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,nct.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,nct.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)}};ict.DevToolsLogger=Nlr});var xYn=I(Mlr=>{"use strict";p();Object.defineProperty(Mlr,"__esModule",{value:!0});Mlr.debugGetObservableGraph=Y7s;var $7s=ype(),V7s=Fj(),W7s=xF(),z7s=Fat(),SYn=tct();function Y7s(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=jZ.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?IYn(n,0,o,e).trim():TYn(n,0,o,e).trim()}a(Y7s,"debugGetObservableGraph");function TYn(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,SYn.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=jZ.from(l,n.debugNamePostProcessor??(d=>d))??jZ.unknown(l);s.push(TYn(u,e+1,r,n))}}return s.join(` +`)}a(TYn,"formatObservableInfoWithDependencies");function IYn(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,SYn.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=jZ.from(l,n.debugNamePostProcessor??(d=>d))??jZ.unknown(l);s.push(IYn(u,e+1,r,n))}}return s.join(` +`)}a(IYn,"formatObservableInfoWithObservers");var jZ=class t{static{a(this,"Info")}static from(e,r){if(e instanceof z7s.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 $7s.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 W7s.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof V7s.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 wF=I(Lt=>{"use strict";p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ValueWithChangeEventFromObservable=Lt.observableFromValueWithChangeEvent=Lt.TransactionImpl=Lt.transaction=Lt.subtransaction=Lt.globalTransaction=Lt.asyncTransaction=Lt.observableSignalFromEvent=Lt.observableFromEventOpts=Lt.observableSignal=Lt.constObservable=Lt.recordChangesLazy=Lt.recordChanges=Lt.isObservable=Lt.wasEventTriggeredRecently=Lt.throttledObservable=Lt.signalFromObservable=Lt.recomputeInitiallyAndOnChange=Lt.observableFromPromise=Lt.mapObservableArrayCached=Lt.keepObserved=Lt.derivedObservableWithWritableCache=Lt.derivedObservableWithCache=Lt.debouncedObservable2=Lt.debouncedObservable=Lt.waitForState=Lt.derivedWithCancellationToken=Lt.PromiseResult=Lt.ObservableResolvedPromise=Lt.ObservablePromise=Lt.ObservableLazyPromise=Lt.ObservableLazy=Lt.derivedWithStore=Lt.derivedWithSetter=Lt.derivedOpts=Lt.derivedHandleChanges=Lt.derivedDisposable=Lt.derived=Lt.disposableObservableValue=Lt.registerAutorunSelfDisposable=Lt.autorunSelfDisposable=Lt.autorunPerKeyedItem=Lt.autorunIterableDelta=Lt.autorunWithStoreHandleChanges=Lt.autorunWithStore=Lt.autorunOpts=Lt.autorunHandleChanges=Lt.autorunDelta=Lt.autorun=Lt.observableValueOpts=void 0;Lt.DebugLocation=Lt.ObservableMap=Lt.ObservableSet=Lt.observableValue=Lt.observableFromEvent=Lt.latestChangedValue=Lt.derivedConstOnceDefined=Lt.runOnChangeWithStore=Lt.runOnChangeWithCancellationToken=Lt.runOnChange=void 0;var K7s=Bat();Object.defineProperty(Lt,"observableValueOpts",{enumerable:!0,get:a(function(){return K7s.observableValueOpts},"get")});var E5=OZ();Object.defineProperty(Lt,"autorun",{enumerable:!0,get:a(function(){return E5.autorun},"get")});Object.defineProperty(Lt,"autorunDelta",{enumerable:!0,get:a(function(){return E5.autorunDelta},"get")});Object.defineProperty(Lt,"autorunHandleChanges",{enumerable:!0,get:a(function(){return E5.autorunHandleChanges},"get")});Object.defineProperty(Lt,"autorunOpts",{enumerable:!0,get:a(function(){return E5.autorunOpts},"get")});Object.defineProperty(Lt,"autorunWithStore",{enumerable:!0,get:a(function(){return E5.autorunWithStore},"get")});Object.defineProperty(Lt,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return E5.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Lt,"autorunIterableDelta",{enumerable:!0,get:a(function(){return E5.autorunIterableDelta},"get")});Object.defineProperty(Lt,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return E5.autorunPerKeyedItem},"get")});Object.defineProperty(Lt,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return E5.autorunSelfDisposable},"get")});Object.defineProperty(Lt,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return E5.registerAutorunSelfDisposable},"get")});var J7s=xF();Object.defineProperty(Lt,"disposableObservableValue",{enumerable:!0,get:a(function(){return J7s.disposableObservableValue},"get")});var Spe=Qat();Object.defineProperty(Lt,"derived",{enumerable:!0,get:a(function(){return Spe.derived},"get")});Object.defineProperty(Lt,"derivedDisposable",{enumerable:!0,get:a(function(){return Spe.derivedDisposable},"get")});Object.defineProperty(Lt,"derivedHandleChanges",{enumerable:!0,get:a(function(){return Spe.derivedHandleChanges},"get")});Object.defineProperty(Lt,"derivedOpts",{enumerable:!0,get:a(function(){return Spe.derivedOpts},"get")});Object.defineProperty(Lt,"derivedWithSetter",{enumerable:!0,get:a(function(){return Spe.derivedWithSetter},"get")});Object.defineProperty(Lt,"derivedWithStore",{enumerable:!0,get:a(function(){return Spe.derivedWithStore},"get")});var y2e=Hzn();Object.defineProperty(Lt,"ObservableLazy",{enumerable:!0,get:a(function(){return y2e.ObservableLazy},"get")});Object.defineProperty(Lt,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return y2e.ObservableLazyPromise},"get")});Object.defineProperty(Lt,"ObservablePromise",{enumerable:!0,get:a(function(){return y2e.ObservablePromise},"get")});Object.defineProperty(Lt,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return y2e.ObservableResolvedPromise},"get")});Object.defineProperty(Lt,"PromiseResult",{enumerable:!0,get:a(function(){return y2e.PromiseResult},"get")});var RYn=Gzn();Object.defineProperty(Lt,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return RYn.derivedWithCancellationToken},"get")});Object.defineProperty(Lt,"waitForState",{enumerable:!0,get:a(function(){return RYn.waitForState},"get")});var Rw=Wat();Object.defineProperty(Lt,"debouncedObservable",{enumerable:!0,get:a(function(){return Rw.debouncedObservable},"get")});Object.defineProperty(Lt,"debouncedObservable2",{enumerable:!0,get:a(function(){return Rw.debouncedObservable2},"get")});Object.defineProperty(Lt,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return Rw.derivedObservableWithCache},"get")});Object.defineProperty(Lt,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return Rw.derivedObservableWithWritableCache},"get")});Object.defineProperty(Lt,"keepObserved",{enumerable:!0,get:a(function(){return Rw.keepObserved},"get")});Object.defineProperty(Lt,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return Rw.mapObservableArrayCached},"get")});Object.defineProperty(Lt,"observableFromPromise",{enumerable:!0,get:a(function(){return Rw.observableFromPromise},"get")});Object.defineProperty(Lt,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return Rw.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Lt,"signalFromObservable",{enumerable:!0,get:a(function(){return Rw.signalFromObservable},"get")});Object.defineProperty(Lt,"throttledObservable",{enumerable:!0,get:a(function(){return Rw.throttledObservable},"get")});Object.defineProperty(Lt,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return Rw.wasEventTriggeredRecently},"get")});Object.defineProperty(Lt,"isObservable",{enumerable:!0,get:a(function(){return Rw.isObservable},"get")});var PYn=nYn();Object.defineProperty(Lt,"recordChanges",{enumerable:!0,get:a(function(){return PYn.recordChanges},"get")});Object.defineProperty(Lt,"recordChangesLazy",{enumerable:!0,get:a(function(){return PYn.recordChangesLazy},"get")});var Z7s=iYn();Object.defineProperty(Lt,"constObservable",{enumerable:!0,get:a(function(){return Z7s.constObservable},"get")});var X7s=Elr();Object.defineProperty(Lt,"observableSignal",{enumerable:!0,get:a(function(){return X7s.observableSignal},"get")});var eQs=Fj();Object.defineProperty(Lt,"observableFromEventOpts",{enumerable:!0,get:a(function(){return eQs.observableFromEventOpts},"get")});var tQs=oYn();Object.defineProperty(Lt,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return tQs.observableSignalFromEvent},"get")});var E2e=IF();Object.defineProperty(Lt,"asyncTransaction",{enumerable:!0,get:a(function(){return E2e.asyncTransaction},"get")});Object.defineProperty(Lt,"globalTransaction",{enumerable:!0,get:a(function(){return E2e.globalTransaction},"get")});Object.defineProperty(Lt,"subtransaction",{enumerable:!0,get:a(function(){return E2e.subtransaction},"get")});Object.defineProperty(Lt,"transaction",{enumerable:!0,get:a(function(){return E2e.transaction},"get")});Object.defineProperty(Lt,"TransactionImpl",{enumerable:!0,get:a(function(){return E2e.TransactionImpl},"get")});var kYn=sYn();Object.defineProperty(Lt,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return kYn.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Lt,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return kYn.ValueWithChangeEventFromObservable},"get")});var Olr=lYn();Object.defineProperty(Lt,"runOnChange",{enumerable:!0,get:a(function(){return Olr.runOnChange},"get")});Object.defineProperty(Lt,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return Olr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Lt,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return Olr.runOnChangeWithStore},"get")});var DYn=fYn();Object.defineProperty(Lt,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return DYn.derivedConstOnceDefined},"get")});Object.defineProperty(Lt,"latestChangedValue",{enumerable:!0,get:a(function(){return DYn.latestChangedValue},"get")});var rQs=Fj();Object.defineProperty(Lt,"observableFromEvent",{enumerable:!0,get:a(function(){return rQs.observableFromEvent},"get")});var nQs=xF();Object.defineProperty(Lt,"observableValue",{enumerable:!0,get:a(function(){return nQs.observableValue},"get")});var iQs=pYn();Object.defineProperty(Lt,"ObservableSet",{enumerable:!0,get:a(function(){return iQs.ObservableSet},"get")});var oQs=hYn();Object.defineProperty(Lt,"ObservableMap",{enumerable:!0,get:a(function(){return oQs.ObservableMap},"get")});var sQs=hT();Object.defineProperty(Lt,"DebugLocation",{enumerable:!0,get:a(function(){return sQs.DebugLocation},"get")});var Blr=m5(),NYn=tct(),aQs=bYn(),wYn=uIe(),cQs=s2(),lQs=xYn();(0,cQs._setDebugGetObservableGraph)(lQs.debugGetObservableGraph);(0,Blr.setLogObservableFn)(NYn.logObservableToConsole);var uQs=!1;uQs&&(0,Blr.addLogger)(new NYn.ConsoleObservableLogger);wYn.env&&wYn.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,Blr.addLogger)(aQs.DevToolsLogger.getInstance())});var sd=I(Tpe=>{"use strict";p();Object.defineProperty(Tpe,"__esModule",{value:!0});Tpe.OffsetRangeSet=Tpe.OffsetRange=void 0;var oct=Cs(),sct=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 oct.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 oct.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new oct.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)}};Tpe.OffsetRangeSet=Llr});var c2=I(wpe=>{"use strict";p();Object.defineProperty(wpe,"__esModule",{value:!0});wpe.LineRangeSet=wpe.LineRange=void 0;var MYn=Cs(),dQs=sd(),OYn=jp(),Ipe=MQ(),BYn=Al(),xpe=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,BYn.compareBy)(e=>e.startLineNumber,BYn.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new MYn.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,Ipe.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,Ipe.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Ipe.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 xpe(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,Ipe.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Ipe.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 xpe(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};wpe.LineRangeSet=_2e});var Rpe=I(cct=>{"use strict";p();Object.defineProperty(cct,"__esModule",{value:!0});cct.TextLength=void 0;var fQs=c2(),LYn=b_(),act=jp(),Flr=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 act.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new act.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new act.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return fQs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new LYn.Position(e.lineNumber,e.column+this.columnCount):new LYn.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return act.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};cct.TextLength=Flr});var uct=I(HZ=>{"use strict";p();Object.defineProperty(HZ,"__esModule",{value:!0});HZ.PositionOffsetTransformer=HZ.PositionOffsetTransformerBase=void 0;HZ._setPositionOffsetTransformerDependencies=gQs;var pQs=MQ(),hQs=sd(),v2e=b_(),mQs=jp(),lct=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new hQs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return mQs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new RF.deps.StringEdit(r)}getStringReplacement(e){return new RF.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new RF.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new RF.deps.TextEdit(r)}};HZ.PositionOffsetTransformerBase=lct;var RF=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 gQs(t){RF._deps=t}a(gQs,"_setPositionOffsetTransformerDependencies");var Ulr=class extends lct{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 v2e.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new v2e.Position(r,o+1)}if(e.column<1)return new v2e.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new v2e.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,pQs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new v2e.Position(n,o)}getTextLength(e){return RF.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new RF.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};HZ.PositionOffsetTransformer=Ulr});var mT=I(_5=>{"use strict";p();Object.defineProperty(_5,"__esModule",{value:!0});_5.StringText=_5.ArrayText=_5.LineBasedText=_5.AbstractText=void 0;var AQs=Yu(),yQs=Gh(),EQs=b_(),FYn=jp(),_Qs=Rpe(),UYn=uct(),C2e=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new EQs.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 FYn.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new UYn.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new FYn.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,yQs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};_5.AbstractText=C2e;var dct=class extends C2e{static{a(this,"LineBasedText")}constructor(e,r){(0,AQs.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)}};D5.ArrayText=Gur;var $ur=class extends Y2e{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new lJn.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};D5.StringText=$ur});var dJn=I(N5=>{"use strict";p();Object.defineProperty(N5,"__esModule",{value:!0});N5.AnnotationReplacement=N5.Edit=N5.BaseReplacement=N5.BaseEdit=void 0;var bGs=El(),uJn=Ts(),Lw=sd(),zct=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 uJn.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(Lw.OffsetRange.emptyAt(h),new Lw.OffsetRange(0,m));s.push(E)}if(!f)throw new uJn.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(Lw.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new Lw.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new Lw.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new Lw.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 Lw.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(Lw.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,bGs.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 Lw.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};N5.BaseReplacement=Yct;var Vur=class t extends zct{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)}};N5.Edit=Vur;var Wur=class t extends Yct{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)}};N5.AnnotationReplacement=Wur});var gE=I(LA=>{"use strict";p();Object.defineProperty(LA,"__esModule",{value:!0});LA.AnnotatedStringReplacement=LA.AnnotatedStringEdit=LA.VoidEditData=LA.StringReplacement=LA.StringEdit=LA.BaseStringReplacement=LA.BaseStringEdit=void 0;LA.applyEditsToRanges=TGs;var Kct=Gh(),A2=sd(),SGs=CT(),pJn=dJn(),K2e=class extends pJn.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(tC.replace(A2.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 M5(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 M5(r)}normalizeEOL(e){return new M5(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=tC.replace(A2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?M5.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new SGs.StringText(this.apply(e.value))}mapData(e){return new Jct(this.replacements.map(r=>new aX(r.replaceRange,r.newText,e(r))))}};LA.BaseStringEdit=K2e;var J2e=class extends pJn.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,Kct.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,Kct.commonSuffixLength)(r,this.newText)),s=new A2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new tC(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new tC(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,Kct.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new A2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,Kct.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new A2.OffsetRange(0,this.newText.length-n))}toEdit(){return new M5([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};LA.BaseStringReplacement=J2e;var M5=class t extends K2e{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 tC(new A2.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 tC(e,r)])}static insert(e,r){return new t([new tC(A2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new tC(e,"")])}static fromJson(e){return new t(e.map(tC.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(TGs,"applyEditsToRanges");var zur=class{static{a(this,"VoidEditData")}join(e){return this}};LA.VoidEditData=zur;var Jct=class t extends K2e{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 aX(e,r,n)])}static insert(e,r,n){return new t([new aX(A2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new aX(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(Zct,"__esModule",{value:!0});Zct.LanguageId=void 0;var hJn;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(hJn||(Zct.LanguageId=hJn={}))});var gJn=I(iH=>{"use strict";p();Object.defineProperty(iH,"__esModule",{value:!0});iH.EditReasons=iH.TextModelEditReason=iH.EditReason=void 0;var Yur=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 Z2e(this.metadata,mJn).toKey(e)}};iH.EditReason=Yur;var mJn=Symbol("TextModelEditReason"),Z2e=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("-")}};iH.TextModelEditReason=Z2e;function Fw(t){return new Z2e(t,mJn)}a(Fw,"createEditReason");iH.EditReasons={unknown(t){return Fw({source:"unknown",name:t.name})},chatApplyEdits(t){return Fw({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return Fw({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return Fw({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return Fw({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>Fw({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return Fw({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>Fw({source:"setValue"}),"setValue"),eolChange:a(()=>Fw({source:"eolChange"}),"eolChange"),applyEdits:a(()=>Fw({source:"applyEdits"}),"applyEdits"),snippet:a(()=>Fw({source:"snippet"}),"snippet"),suggest:a(t=>Fw({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var cX=I(O5=>{"use strict";p();Object.defineProperty(O5,"__esModule",{value:!0});O5.MutableObservableDocument=O5.MutableObservableWorkspace=O5.StringEditWithReason=O5.ObservableWorkspace=void 0;var xGs=Yu(),AJn=ko(),rC=HF(),EJn=gE(),wGs=sd(),RGs=CT(),kGs=Xct(),yJn=gJn(),elt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,rC.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,rC.derivedWithStore)((e,r)=>{let n=(0,rC.observableValue)("lastActiveDocument",void 0);return r.add((0,rC.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,rC.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)}};O5.ObservableWorkspace=elt;var Xpe=class extends EJn.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};O5.StringEditWithReason=Xpe;var Kur=class extends elt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,rC.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,xGs.assert)(!this._documents.has(e.id));let n=new tlt(e.id,new RGs.StringText(e.initialValue??""),[],e.languageId??kGs.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}};O5.MutableObservableWorkspace=Kur;var tlt=class extends AJn.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,rC.observableValue)(this,r),this._selection=(0,rC.observableValue)(this,n),this._primarySelectionLine=(0,rC.observableValue)(this,void 0),this._visibleRanges=(0,rC.observableValue)(this,[]),this._languageId=(0,rC.observableValue)(this,o),this._version=(0,rC.observableValue)(this,c),this._diagnostics=(0,rC.observableValue)(this,[]),this._register((0,AJn.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 Xpe?e:new Xpe(e.replacements,yJn.EditReason.unknown);(0,rC.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=yJn.EditReason.unknown,s=new Xpe([EJn.StringReplacement.replace(new wGs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,rC.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)}};O5.MutableObservableDocument=tlt});var y2=I(lX=>{"use strict";p();var PGs=lX&&lX.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DGs=lX&&lX.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PGs(e,t,r)};Object.defineProperty(lX,"__esModule",{value:!0});DGs(HF(),lX)});var B5=I(Jur=>{"use strict";p();Object.defineProperty(Jur,"__esModule",{value:!0});Jur.autorunWithChanges=MGs;var NGs=y2();function MGs(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,NGs.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(MGs,"autorunWithChanges")});var Ka=I(UA=>{"use strict";p();var Idr=Symbol.for("yaml.alias"),kZn=Symbol.for("yaml.document"),jlt=Symbol.for("yaml.map"),PZn=Symbol.for("yaml.pair"),xdr=Symbol.for("yaml.scalar"),Hlt=Symbol.for("yaml.seq"),zF=Symbol.for("yaml.node.type"),mVs=a(t=>!!t&&typeof t=="object"&&t[zF]===Idr,"isAlias"),gVs=a(t=>!!t&&typeof t=="object"&&t[zF]===kZn,"isDocument"),AVs=a(t=>!!t&&typeof t=="object"&&t[zF]===jlt,"isMap"),yVs=a(t=>!!t&&typeof t=="object"&&t[zF]===PZn,"isPair"),DZn=a(t=>!!t&&typeof t=="object"&&t[zF]===xdr,"isScalar"),EVs=a(t=>!!t&&typeof t=="object"&&t[zF]===Hlt,"isSeq");function NZn(t){if(t&&typeof t=="object")switch(t[zF]){case jlt:case Hlt:return!0}return!1}a(NZn,"isCollection");function _Vs(t){if(t&&typeof t=="object")switch(t[zF]){case Idr:case jlt:case xdr:case Hlt:return!0}return!1}a(_Vs,"isNode");var CVs=a(t=>(DZn(t)||NZn(t))&&!!t.anchor,"hasAnchor");UA.ALIAS=Idr;UA.DOC=kZn;UA.MAP=jlt;UA.NODE_TYPE=zF;UA.PAIR=PZn;UA.SCALAR=xdr;UA.SEQ=Hlt;UA.hasAnchor=CVs;UA.isAlias=mVs;UA.isCollection=NZn;UA.isDocument=gVs;UA.isMap=AVs;UA.isNode=_Vs;UA.isPair=yVs;UA.isScalar=DZn;UA.isSeq=EVs});var lDe=I(wdr=>{"use strict";p();var am=Ka(),Sb=Symbol("break visit"),MZn=Symbol("skip children"),Q5=Symbol("remove node");function Glt(t,e){let r=OZn(e);am.isDocument(t)?ahe(null,t.contents,r,Object.freeze([t]))===Q5&&(t.contents=null):ahe(null,t,r,Object.freeze([]))}a(Glt,"visit");Glt.BREAK=Sb;Glt.SKIP=MZn;Glt.REMOVE=Q5;function ahe(t,e,r,n){let o=BZn(t,e,r,n);if(am.isNode(o)||am.isPair(o))return LZn(t,n,o),ahe(t,o,r,n);if(typeof o!="symbol"){if(am.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var FZn=Ka(),vVs=lDe(),bVs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},SVs=a(t=>t.replace(/[!,[\]{}]/g,e=>bVs[e]),"escapeTagName"),uDe=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+SVs(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&&FZn.isNode(e.contents)){let s={};vVs.visit(e.contents,(c,l)=>{FZn.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(` -`)}};uDe.defaultYaml={explicit:!1,version:"1.2"};uDe.defaultTags={"!!":"tag:yaml.org,2002:"};UZn.Directives=uDe});var Vlt=I(dDe=>{"use strict";p();var QZn=Ka(),TVs=lDe();function IVs(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(IVs,"anchorIsValid");function qZn(t){let e=new Set;return TVs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(qZn,"anchorNames");function jZn(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(jZn,"findNewAnchor");function xVs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=qZn(t));let c=jZn(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&&(QZn.isScalar(c.node)||QZn.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(xVs,"createNodeAnchors");dDe.anchorIsValid=IVs;dDe.anchorNames=qZn;dDe.createNodeAnchors=xVs;dDe.findNewAnchor=jZn});var kdr=I(HZn=>{"use strict";p();function fDe(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 wVs=Ka();function GZn(t,e,r){if(Array.isArray(t))return t.map((n,o)=>GZn(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!wVs.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(GZn,"toJS");$Zn.toJS=GZn});var Wlt=I(WZn=>{"use strict";p();var RVs=kdr(),VZn=Ka(),kVs=cH(),Pdr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,VZn.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(!VZn.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=kVs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?RVs.applyReviver(s,{"":l},"",l):l}};WZn.NodeBase=Pdr});var pDe=I(zZn=>{"use strict";p();var PVs=Vlt(),DVs=lDe(),lhe=Ka(),NVs=Wlt(),MVs=cH(),Ddr=class extends NVs.NodeBase{static{a(this,"Alias")}constructor(e){super(lhe.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=[],DVs.visit(e,{Node:a((s,c)=>{(lhe.isAlias(c)||lhe.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||(MVs.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=zlt(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(PVs.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 zlt(t,e,r){if(lhe.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(lhe.isCollection(e)){let n=0;for(let o of e.items){let s=zlt(t,o,r);s>n&&(n=s)}return n}else if(lhe.isPair(e)){let n=zlt(t,e.key,r),o=zlt(t,e.value,r);return Math.max(n,o)}return 1}a(zlt,"getAliasCount");zZn.Alias=Ddr});var i0=I(Ndr=>{"use strict";p();var OVs=Ka(),BVs=Wlt(),LVs=cH(),FVs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),lH=class extends BVs.NodeBase{static{a(this,"Scalar")}constructor(e){super(OVs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:LVs.toJS(this.value,e,r)}toString(){return String(this.value)}};lH.BLOCK_FOLDED="BLOCK_FOLDED";lH.BLOCK_LITERAL="BLOCK_LITERAL";lH.PLAIN="PLAIN";lH.QUOTE_DOUBLE="QUOTE_DOUBLE";lH.QUOTE_SINGLE="QUOTE_SINGLE";Ndr.Scalar=lH;Ndr.isScalarValue=FVs});var hDe=I(KZn=>{"use strict";p();var UVs=pDe(),mX=Ka(),YZn=i0(),QVs="tag:yaml.org,2002:";function qVs(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(qVs,"findTagObject");function jVs(t,e,r){if(mX.isDocument(t)&&(t=t.contents),mX.isNode(t))return t;if(mX.isPair(t)){let h=r.schema[mX.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 UVs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=QVs+e.slice(2));let d=qVs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new YZn.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[mX.MAP]:Symbol.iterator in Object(t)?c[mX.SEQ]:c[mX.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 YZn.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(jVs,"createNode");KZn.createNode=jVs});var Klt=I(Ylt=>{"use strict";p();var HVs=hDe(),q5=Ka(),GVs=Wlt();function Mdr(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 HVs.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(Mdr,"collectionFromPath");var JZn=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),Odr=class extends GVs.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=>q5.isNode(n)||q5.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(JZn(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(q5.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Mdr(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(q5.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&&q5.isScalar(s)?s.value:s:q5.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!q5.isPair(r))return!1;let n=r.value;return n==null||e&&q5.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 q5.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(q5.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Mdr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};Ylt.Collection=Odr;Ylt.collectionFromPath=Mdr;Ylt.isEmptyPath=JZn});var mDe=I(Jlt=>{"use strict";p();var $Vs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function Bdr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(Bdr,"indentComment");var VVs=a((t,e,r)=>t.endsWith(` -`)?Bdr(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 _Qs.TextLength(this._lineCount-1,e.length)}};_5.LineBasedText=dct;var Qlr=class extends dct{static{a(this,"ArrayText")}constructor(e){super(r=>e[r-1],e.length)}};_5.ArrayText=Qlr;var qlr=class extends C2e{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new UYn.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};_5.StringText=qlr});var qYn=I(v5=>{"use strict";p();Object.defineProperty(v5,"__esModule",{value:!0});v5.AnnotationReplacement=v5.Edit=v5.BaseReplacement=v5.BaseEdit=void 0;var vQs=Al(),QYn=Cs(),Pw=sd(),fct=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 QYn.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(Pw.OffsetRange.emptyAt(h),new Pw.OffsetRange(0,m));s.push(E)}if(!f)throw new QYn.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(Pw.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new Pw.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new Pw.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new Pw.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 Pw.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(Pw.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,vQs.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 Pw.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};v5.BaseReplacement=pct;var jlr=class t extends fct{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)}};v5.Edit=jlr;var Hlr=class t extends pct{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)}};v5.AnnotationReplacement=Hlr});var pE=I(jA=>{"use strict";p();Object.defineProperty(jA,"__esModule",{value:!0});jA.AnnotatedStringReplacement=jA.AnnotatedStringEdit=jA.VoidEditData=jA.StringReplacement=jA.StringEdit=jA.BaseStringReplacement=jA.BaseStringEdit=void 0;jA.applyEditsToRanges=bQs;var hct=Gh(),l2=sd(),CQs=mT(),HYn=qYn(),b2e=class extends HYn.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(J_.replace(l2.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 C5(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 C5(r)}normalizeEOL(e){return new C5(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=J_.replace(l2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?C5.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new CQs.StringText(this.apply(e.value))}mapData(e){return new mct(this.replacements.map(r=>new GZ(r.replaceRange,r.newText,e(r))))}};jA.BaseStringEdit=b2e;var S2e=class extends HYn.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,hct.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,hct.commonSuffixLength)(r,this.newText)),s=new l2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new J_(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new J_(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,hct.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new l2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,hct.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new l2.OffsetRange(0,this.newText.length-n))}toEdit(){return new C5([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};jA.BaseStringReplacement=S2e;var C5=class t extends b2e{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 J_(new l2.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 J_(e,r)])}static insert(e,r){return new t([new J_(l2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new J_(e,"")])}static fromJson(e){return new t(e.map(J_.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(bQs,"applyEditsToRanges");var Glr=class{static{a(this,"VoidEditData")}join(e){return this}};jA.VoidEditData=Glr;var mct=class t extends b2e{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 GZ(e,r,n)])}static insert(e,r,n){return new t([new GZ(l2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new GZ(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(gct,"__esModule",{value:!0});gct.LanguageId=void 0;var GYn;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(GYn||(gct.LanguageId=GYn={}))});var VYn=I(Qj=>{"use strict";p();Object.defineProperty(Qj,"__esModule",{value:!0});Qj.EditReasons=Qj.TextModelEditReason=Qj.EditReason=void 0;var $lr=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 T2e(this.metadata,$Yn).toKey(e)}};Qj.EditReason=$lr;var $Yn=Symbol("TextModelEditReason"),T2e=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("-")}};Qj.TextModelEditReason=T2e;function kw(t){return new T2e(t,$Yn)}a(kw,"createEditReason");Qj.EditReasons={unknown(t){return kw({source:"unknown",name:t.name})},chatApplyEdits(t){return kw({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return kw({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return kw({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return kw({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>kw({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return kw({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>kw({source:"setValue"}),"setValue"),eolChange:a(()=>kw({source:"eolChange"}),"eolChange"),applyEdits:a(()=>kw({source:"applyEdits"}),"applyEdits"),snippet:a(()=>kw({source:"snippet"}),"snippet"),suggest:a(t=>kw({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var $Z=I(b5=>{"use strict";p();Object.defineProperty(b5,"__esModule",{value:!0});b5.MutableObservableDocument=b5.MutableObservableWorkspace=b5.StringEditWithReason=b5.ObservableWorkspace=void 0;var TQs=Yu(),WYn=wo(),Z_=wF(),YYn=pE(),IQs=sd(),xQs=mT(),wQs=Act(),zYn=VYn(),yct=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,Z_.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,Z_.derivedWithStore)((e,r)=>{let n=(0,Z_.observableValue)("lastActiveDocument",void 0);return r.add((0,Z_.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,Z_.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)}};b5.ObservableWorkspace=yct;var Ppe=class extends YYn.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};b5.StringEditWithReason=Ppe;var Vlr=class extends yct{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,Z_.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,TQs.assert)(!this._documents.has(e.id));let n=new Ect(e.id,new xQs.StringText(e.initialValue??""),[],e.languageId??wQs.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}};b5.MutableObservableWorkspace=Vlr;var Ect=class extends WYn.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,Z_.observableValue)(this,r),this._selection=(0,Z_.observableValue)(this,n),this._primarySelectionLine=(0,Z_.observableValue)(this,void 0),this._visibleRanges=(0,Z_.observableValue)(this,[]),this._languageId=(0,Z_.observableValue)(this,o),this._version=(0,Z_.observableValue)(this,c),this._diagnostics=(0,Z_.observableValue)(this,[]),this._register((0,WYn.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 Ppe?e:new Ppe(e.replacements,zYn.EditReason.unknown);(0,Z_.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=zYn.EditReason.unknown,s=new Ppe([YYn.StringReplacement.replace(new IQs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,Z_.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)}};b5.MutableObservableDocument=Ect});var u2=I(VZ=>{"use strict";p();var RQs=VZ&&VZ.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PQs=VZ&&VZ.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RQs(e,t,r)};Object.defineProperty(VZ,"__esModule",{value:!0});PQs(wF(),VZ)});var S5=I(Wlr=>{"use strict";p();Object.defineProperty(Wlr,"__esModule",{value:!0});Wlr.autorunWithChanges=DQs;var kQs=u2();function DQs(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,kQs.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(DQs,"autorunWithChanges")});var za=I(GA=>{"use strict";p();var Cur=Symbol.for("yaml.alias"),sJn=Symbol.for("yaml.document"),slt=Symbol.for("yaml.map"),aJn=Symbol.for("yaml.pair"),bur=Symbol.for("yaml.scalar"),alt=Symbol.for("yaml.seq"),NF=Symbol.for("yaml.node.type"),pjs=a(t=>!!t&&typeof t=="object"&&t[NF]===Cur,"isAlias"),hjs=a(t=>!!t&&typeof t=="object"&&t[NF]===sJn,"isDocument"),mjs=a(t=>!!t&&typeof t=="object"&&t[NF]===slt,"isMap"),gjs=a(t=>!!t&&typeof t=="object"&&t[NF]===aJn,"isPair"),cJn=a(t=>!!t&&typeof t=="object"&&t[NF]===bur,"isScalar"),Ajs=a(t=>!!t&&typeof t=="object"&&t[NF]===alt,"isSeq");function lJn(t){if(t&&typeof t=="object")switch(t[NF]){case slt:case alt:return!0}return!1}a(lJn,"isCollection");function yjs(t){if(t&&typeof t=="object")switch(t[NF]){case Cur:case slt:case bur:case alt:return!0}return!1}a(yjs,"isNode");var Ejs=a(t=>(cJn(t)||lJn(t))&&!!t.anchor,"hasAnchor");GA.ALIAS=Cur;GA.DOC=sJn;GA.MAP=slt;GA.NODE_TYPE=NF;GA.PAIR=aJn;GA.SCALAR=bur;GA.SEQ=alt;GA.hasAnchor=Ejs;GA.isAlias=pjs;GA.isCollection=lJn;GA.isDocument=hjs;GA.isMap=mjs;GA.isNode=yjs;GA.isPair=gjs;GA.isScalar=cJn;GA.isSeq=Ajs});var B2e=I(Sur=>{"use strict";p();var am=za(),gb=Symbol("break visit"),uJn=Symbol("skip children"),w5=Symbol("remove node");function clt(t,e){let r=dJn(e);am.isDocument(t)?Fpe(null,t.contents,r,Object.freeze([t]))===w5&&(t.contents=null):Fpe(null,t,r,Object.freeze([]))}a(clt,"visit");clt.BREAK=gb;clt.SKIP=uJn;clt.REMOVE=w5;function Fpe(t,e,r,n){let o=fJn(t,e,r,n);if(am.isNode(o)||am.isPair(o))return pJn(t,n,o),Fpe(t,o,r,n);if(typeof o!="symbol"){if(am.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var hJn=za(),_js=B2e(),vjs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Cjs=a(t=>t.replace(/[!,[\]{}]/g,e=>vjs[e]),"escapeTagName"),L2e=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+Cjs(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&&hJn.isNode(e.contents)){let s={};_js.visit(e.contents,(c,l)=>{hJn.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(` +`)}};L2e.defaultYaml={explicit:!1,version:"1.2"};L2e.defaultTags={"!!":"tag:yaml.org,2002:"};mJn.Directives=L2e});var ult=I(F2e=>{"use strict";p();var gJn=za(),bjs=B2e();function Sjs(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(Sjs,"anchorIsValid");function AJn(t){let e=new Set;return bjs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(AJn,"anchorNames");function yJn(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(yJn,"findNewAnchor");function Tjs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=AJn(t));let c=yJn(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&&(gJn.isScalar(c.node)||gJn.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(Tjs,"createNodeAnchors");F2e.anchorIsValid=Sjs;F2e.anchorNames=AJn;F2e.createNodeAnchors=Tjs;F2e.findNewAnchor=yJn});var Iur=I(EJn=>{"use strict";p();function U2e(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 Ijs=za();function _Jn(t,e,r){if(Array.isArray(t))return t.map((n,o)=>_Jn(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!Ijs.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(_Jn,"toJS");vJn.toJS=_Jn});var dlt=I(bJn=>{"use strict";p();var xjs=Iur(),CJn=za(),wjs=Gj(),xur=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,CJn.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(!CJn.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=wjs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?xjs.applyReviver(s,{"":l},"",l):l}};bJn.NodeBase=xur});var Q2e=I(SJn=>{"use strict";p();var Rjs=ult(),Pjs=B2e(),Qpe=za(),kjs=dlt(),Djs=Gj(),wur=class extends kjs.NodeBase{static{a(this,"Alias")}constructor(e){super(Qpe.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=[],Pjs.visit(e,{Node:a((s,c)=>{(Qpe.isAlias(c)||Qpe.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||(Djs.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=flt(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(Rjs.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 flt(t,e,r){if(Qpe.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Qpe.isCollection(e)){let n=0;for(let o of e.items){let s=flt(t,o,r);s>n&&(n=s)}return n}else if(Qpe.isPair(e)){let n=flt(t,e.key,r),o=flt(t,e.value,r);return Math.max(n,o)}return 1}a(flt,"getAliasCount");SJn.Alias=wur});var i0=I(Rur=>{"use strict";p();var Njs=za(),Mjs=dlt(),Ojs=Gj(),Bjs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),$j=class extends Mjs.NodeBase{static{a(this,"Scalar")}constructor(e){super(Njs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Ojs.toJS(this.value,e,r)}toString(){return String(this.value)}};$j.BLOCK_FOLDED="BLOCK_FOLDED";$j.BLOCK_LITERAL="BLOCK_LITERAL";$j.PLAIN="PLAIN";$j.QUOTE_DOUBLE="QUOTE_DOUBLE";$j.QUOTE_SINGLE="QUOTE_SINGLE";Rur.Scalar=$j;Rur.isScalarValue=Bjs});var q2e=I(IJn=>{"use strict";p();var Ljs=Q2e(),ZZ=za(),TJn=i0(),Fjs="tag:yaml.org,2002:";function Ujs(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(Ujs,"findTagObject");function Qjs(t,e,r){if(ZZ.isDocument(t)&&(t=t.contents),ZZ.isNode(t))return t;if(ZZ.isPair(t)){let h=r.schema[ZZ.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 Ljs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=Fjs+e.slice(2));let d=Ujs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new TJn.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[ZZ.MAP]:Symbol.iterator in Object(t)?c[ZZ.SEQ]:c[ZZ.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 TJn.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(Qjs,"createNode");IJn.createNode=Qjs});var hlt=I(plt=>{"use strict";p();var qjs=q2e(),R5=za(),jjs=dlt();function Pur(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 qjs.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(Pur,"collectionFromPath");var xJn=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),kur=class extends jjs.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=>R5.isNode(n)||R5.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(xJn(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(R5.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Pur(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(R5.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&&R5.isScalar(s)?s.value:s:R5.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!R5.isPair(r))return!1;let n=r.value;return n==null||e&&R5.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 R5.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(R5.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Pur(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};plt.Collection=kur;plt.collectionFromPath=Pur;plt.isEmptyPath=xJn});var j2e=I(mlt=>{"use strict";p();var Hjs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function Dur(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(Dur,"indentComment");var Gjs=a((t,e,r)=>t.endsWith(` +`)?Dur(r,e):r.includes(` `)?` -`+Bdr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");Jlt.indentComment=Bdr;Jlt.lineComment=VVs;Jlt.stringifyComment=$Vs});var XZn=I(gDe=>{"use strict";p();var WVs="flow",Ldr="block",Zlt="quoted";function zVs(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===Ldr&&(y=ZZn(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===Zlt&&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===Ldr&&(y=ZZn(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` +`+Dur(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");mlt.indentComment=Dur;mlt.lineComment=Gjs;mlt.stringifyComment=Hjs});var RJn=I(H2e=>{"use strict";p();var $js="flow",Nur="block",glt="quoted";function Vjs(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===Nur&&(y=wJn(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===glt&&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===Nur&&(y=wJn(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===Zlt){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 b2=i0(),uH=XZn(),eut=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),tut=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function YVs(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(YVs,"lineLengthOverLimit");function ADe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(tut(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===glt){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 m2=i0(),Vj=RJn(),ylt=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),Elt=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function Wjs(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(Wjs,"lineLengthOverLimit");function G2e(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Elt(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(Udr,`$&${d}`));let y=!1,E,_=-1;for(E=0;E{R=!0});let k=uH.foldFlowLines(`${v}${w}${g}`,d,uH.FOLD_BLOCK,x);if(!R)return`>${T} -${d}${k}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} -${d}${v}${r}${g}`}a(Xlt,"blockString");function KVs(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 uhe(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` -`)?uhe(s,e):Xlt(t,e,r,n);if(!l&&!f&&o!==b2.Scalar.PLAIN&&s.includes(` -`))return Xlt(t,e,r,n);if(tut(s)){if(u==="")return e.forceBlockIndent=!0,Xlt(t,e,r,n);if(l&&u===d)return uhe(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 uhe(s,e)}return l?h:uH.foldFlowLines(h,u,uH.FOLD_FLOW,eut(e,!1))}a(KVs,"plainString");function JVs(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!==b2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=b2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case b2.Scalar.BLOCK_FOLDED:case b2.Scalar.BLOCK_LITERAL:return o||s?uhe(c.value,e):Xlt(c,e,r,n);case b2.Scalar.QUOTE_DOUBLE:return ADe(c.value,e);case b2.Scalar.QUOTE_SINGLE:return Fdr(c.value,e);case b2.Scalar.PLAIN:return KVs(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(JVs,"stringifyString");eXn.stringifyString=JVs});var EDe=I(Qdr=>{"use strict";p();var ZVs=Vlt(),dH=Ka(),XVs=mDe(),eWs=yDe();function tWs(t,e){let r=Object.assign({blockQuote:!0,commentString:XVs.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(tWs,"createStringifyContext");function rWs(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(dH.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(rWs,"getTagObject");function nWs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(dH.isScalar(t)||dH.isCollection(t))&&t.anchor;s&&ZVs.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(nWs,"stringifyProps");function iWs(t,e,r,n){if(dH.isPair(t))return t.toString(e,r,n);if(dH.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=dH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=rWs(e.doc.schema.tags,s));let c=nWs(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):dH.isScalar(s)?eWs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?dH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} -${e.indent}${l}`:l}a(iWs,"stringify");Qdr.createStringifyContext=tWs;Qdr.stringify=iWs});var iXn=I(nXn=>{"use strict";p();var YF=Ka(),tXn=i0(),rXn=EDe(),_De=mDe();function oWs({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=YF.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(YF.isCollection(t)||!YF.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||YF.isCollection(t)||(YF.isScalar(t)?t.type===tXn.Scalar.BLOCK_FOLDED||t.type===tXn.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=rXn.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+=_De.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=_De.lineComment(E,r.indent,d(m))),E=`? ${E} -${l}:`):(E=`${E}:`,m&&(E+=_De.lineComment(E,r.indent,d(m))));let _,v,b;YF.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&&YF.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&YF.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=rXn.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),R=!1,x=ylt(n,!0);c!=="folded"&&e!==m2.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{R=!0});let P=Vj.foldFlowLines(`${v}${w}${g}`,d,Vj.FOLD_BLOCK,x);if(!R)return`>${T} +${d}${P}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} +${d}${v}${r}${g}`}a(Alt,"blockString");function zjs(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 qpe(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` +`)?qpe(s,e):Alt(t,e,r,n);if(!l&&!f&&o!==m2.Scalar.PLAIN&&s.includes(` +`))return Alt(t,e,r,n);if(Elt(s)){if(u==="")return e.forceBlockIndent=!0,Alt(t,e,r,n);if(l&&u===d)return qpe(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 qpe(s,e)}return l?h:Vj.foldFlowLines(h,u,Vj.FOLD_FLOW,ylt(e,!1))}a(zjs,"plainString");function Yjs(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!==m2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=m2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case m2.Scalar.BLOCK_FOLDED:case m2.Scalar.BLOCK_LITERAL:return o||s?qpe(c.value,e):Alt(c,e,r,n);case m2.Scalar.QUOTE_DOUBLE:return G2e(c.value,e);case m2.Scalar.QUOTE_SINGLE:return Mur(c.value,e);case m2.Scalar.PLAIN:return zjs(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(Yjs,"stringifyString");PJn.stringifyString=Yjs});var V2e=I(Bur=>{"use strict";p();var Kjs=ult(),Wj=za(),Jjs=j2e(),Zjs=$2e();function Xjs(t,e){let r=Object.assign({blockQuote:!0,commentString:Jjs.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(Xjs,"createStringifyContext");function eHs(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(Wj.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(eHs,"getTagObject");function tHs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(Wj.isScalar(t)||Wj.isCollection(t))&&t.anchor;s&&Kjs.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(tHs,"stringifyProps");function rHs(t,e,r,n){if(Wj.isPair(t))return t.toString(e,r,n);if(Wj.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=Wj.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=eHs(e.doc.schema.tags,s));let c=tHs(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):Wj.isScalar(s)?Zjs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?Wj.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} +${e.indent}${l}`:l}a(rHs,"stringify");Bur.createStringifyContext=Xjs;Bur.stringify=rHs});var MJn=I(NJn=>{"use strict";p();var MF=za(),kJn=i0(),DJn=V2e(),W2e=j2e();function nHs({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=MF.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(MF.isCollection(t)||!MF.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||MF.isCollection(t)||(MF.isScalar(t)?t.type===kJn.Scalar.BLOCK_FOLDED||t.type===kJn.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=DJn.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+=W2e.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=W2e.lineComment(E,r.indent,d(m))),E=`? ${E} +${l}:`):(E=`${E}:`,m&&(E+=W2e.lineComment(E,r.indent,d(m))));let _,v,b;MF.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&&MF.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&MF.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=DJn.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` `:"",v){let x=d(v);R+=` -${_De.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` +${W2e.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` `&&b&&(R=` `):R+=` -${r.indent}`}else if(!g&&YF.isCollection(e)){let x=w[0],k=w.indexOf(` -`),D=k!==-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 oXn=require("process");function sWs(t,...e){t==="debug"&&console.log(...e)}a(sWs,"debug");function aWs(t,e){(t==="debug"||t==="warn")&&(typeof oXn.emitWarning=="function"?oXn.emitWarning(e):console.warn(e))}a(aWs,"warn");qdr.debug=sWs;qdr.warn=aWs});var sut=I(iut=>{"use strict";p();var CDe=Ka(),sXn=i0(),rut="<<",nut={identify:a(t=>t===rut||typeof t=="symbol"&&t.description===rut,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new sXn.Scalar(Symbol(rut)),{addToJSMap:aXn}),"resolve"),stringify:a(()=>rut,"stringify")},cWs=a((t,e)=>(nut.identify(e)||CDe.isScalar(e)&&(!e.type||e.type===sXn.Scalar.PLAIN)&&nut.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===nut.tag&&r.default),"isMergeKey");function aXn(t,e,r){if(r=t&&CDe.isAlias(r)?r.resolve(t.doc):r,CDe.isSeq(r))for(let n of r.items)Hdr(t,e,n);else if(Array.isArray(r))for(let n of r)Hdr(t,e,n);else Hdr(t,e,r)}a(aXn,"addMergeToJSMap");function Hdr(t,e,r){let n=t&&CDe.isAlias(r)?r.resolve(t.doc):r;if(!CDe.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(Hdr,"mergeValue");iut.addMergeToJSMap=aXn;iut.isMergeKey=cWs;iut.merge=nut});var $dr=I(uXn=>{"use strict";p();var lWs=jdr(),cXn=sut(),uWs=EDe(),lXn=Ka(),Gdr=cH();function dWs(t,e,{key:r,value:n}){if(lXn.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(cXn.isMergeKey(t,r))cXn.addMergeToJSMap(t,e,n);else{let o=Gdr.toJS(r,"",t);if(e instanceof Map)e.set(o,Gdr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=fWs(r,o,t),c=Gdr.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(dWs,"addPairToJSMap");function fWs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(lXn.isNode(t)&&r?.doc){let n=uWs.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)+'..."'),lWs.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(fWs,"stringifyKey");uXn.addPairToJSMap=dWs});var fH=I(Vdr=>{"use strict";p();var dXn=hDe(),pWs=iXn(),hWs=$dr(),aut=Ka();function mWs(t,e,r){let n=dXn.createNode(t,void 0,r),o=dXn.createNode(e,void 0,r);return new cut(n,o)}a(mWs,"createPair");var cut=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,aut.NODE_TYPE,{value:aut.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return aut.isNode(r)&&(r=r.clone(e)),aut.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return hWs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?pWs.stringifyPair(this,e,r,n):JSON.stringify(this)}};Vdr.Pair=cut;Vdr.createPair=mWs});var Wdr=I(pXn=>{"use strict";p();var gX=Ka(),fXn=EDe(),lut=mDe();function gWs(t,e,r){return(e.inFlow??t.flow?yWs:AWs)(t,e,r)}a(gWs,"stringifyCollection");function AWs({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&&(_+=lut.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 OJn=require("process");function iHs(t,...e){t==="debug"&&console.log(...e)}a(iHs,"debug");function oHs(t,e){(t==="debug"||t==="warn")&&(typeof OJn.emitWarning=="function"?OJn.emitWarning(e):console.warn(e))}a(oHs,"warn");Lur.debug=iHs;Lur.warn=oHs});var blt=I(Clt=>{"use strict";p();var z2e=za(),BJn=i0(),_lt="<<",vlt={identify:a(t=>t===_lt||typeof t=="symbol"&&t.description===_lt,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new BJn.Scalar(Symbol(_lt)),{addToJSMap:LJn}),"resolve"),stringify:a(()=>_lt,"stringify")},sHs=a((t,e)=>(vlt.identify(e)||z2e.isScalar(e)&&(!e.type||e.type===BJn.Scalar.PLAIN)&&vlt.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===vlt.tag&&r.default),"isMergeKey");function LJn(t,e,r){if(r=t&&z2e.isAlias(r)?r.resolve(t.doc):r,z2e.isSeq(r))for(let n of r.items)Uur(t,e,n);else if(Array.isArray(r))for(let n of r)Uur(t,e,n);else Uur(t,e,r)}a(LJn,"addMergeToJSMap");function Uur(t,e,r){let n=t&&z2e.isAlias(r)?r.resolve(t.doc):r;if(!z2e.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(Uur,"mergeValue");Clt.addMergeToJSMap=LJn;Clt.isMergeKey=sHs;Clt.merge=vlt});var qur=I(QJn=>{"use strict";p();var aHs=Fur(),FJn=blt(),cHs=V2e(),UJn=za(),Qur=Gj();function lHs(t,e,{key:r,value:n}){if(UJn.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(FJn.isMergeKey(t,r))FJn.addMergeToJSMap(t,e,n);else{let o=Qur.toJS(r,"",t);if(e instanceof Map)e.set(o,Qur.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=uHs(r,o,t),c=Qur.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(lHs,"addPairToJSMap");function uHs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(UJn.isNode(t)&&r?.doc){let n=cHs.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)+'..."'),aHs.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(uHs,"stringifyKey");QJn.addPairToJSMap=lHs});var zj=I(jur=>{"use strict";p();var qJn=q2e(),dHs=MJn(),fHs=qur(),Slt=za();function pHs(t,e,r){let n=qJn.createNode(t,void 0,r),o=qJn.createNode(e,void 0,r);return new Tlt(n,o)}a(pHs,"createPair");var Tlt=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,Slt.NODE_TYPE,{value:Slt.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Slt.isNode(r)&&(r=r.clone(e)),Slt.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return fHs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?dHs.stringifyPair(this,e,r,n):JSON.stringify(this)}};jur.Pair=Tlt;jur.createPair=pHs});var Hur=I(HJn=>{"use strict";p();var XZ=za(),jJn=V2e(),Ilt=j2e();function hHs(t,e,r){return(e.inFlow??t.flow?gHs:mHs)(t,e,r)}a(hHs,"stringifyCollection");function mHs({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&&(_+=Ilt.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&&(_+=lut.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?` +`+Ilt.indentComment(d(t),u),l&&l()):h&&c&&c(),g}a(mHs,"stringifyBlockCollection");function gHs({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&&(_+=Ilt.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(yWs,"stringifyFlowCollection");function uut({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=lut.indentComment(e(n),t);r.push(s.trimStart())}}a(uut,"addCommentBefore");pXn.stringifyCollection=gWs});var hH=I(Ydr=>{"use strict";p();var EWs=Wdr(),_Ws=$dr(),CWs=Klt(),pH=Ka(),dut=fH(),vWs=i0();function vDe(t,e){let r=pH.isScalar(e)?e.value:e;for(let n of t)if(pH.isPair(n)&&(n.key===e||n.key===r||pH.isScalar(n.key)&&n.key.value===r))return n}a(vDe,"findPair");var zdr=class extends CWs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(pH.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(dut.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;pH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new dut.Pair(e,e?.value):n=new dut.Pair(e.key,e.value);let o=vDe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);pH.isScalar(o.value)&&vWs.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=vDe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=vDe(this.items,e)?.value;return(!r&&pH.isScalar(o)?o.value:o)??void 0}has(e){return!!vDe(this.items,e)}set(e,r){this.add(new dut.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)_Ws.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!pH.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})),EWs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Ydr.YAMLMap=zdr;Ydr.findPair=vDe});var dhe=I(mXn=>{"use strict";p();var bWs=Ka(),hXn=hH(),SWs={collection:"map",default:!0,nodeClass:hXn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return bWs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>hXn.YAMLMap.from(t,e,r),"createNode")};mXn.map=SWs});var mH=I(gXn=>{"use strict";p();var TWs=hDe(),IWs=Wdr(),xWs=Klt(),put=Ka(),wWs=i0(),RWs=cH(),Kdr=class extends xWs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(put.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=fut(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=fut(e);if(typeof n!="number")return;let o=this.items[n];return!r&&put.isScalar(o)?o.value:o}has(e){let r=fut(e);return typeof r=="number"&&r=0?e:null}a(fut,"asItemIndex");gXn.YAMLSeq=Kdr});var fhe=I(yXn=>{"use strict";p();var kWs=Ka(),AXn=mH(),PWs={collection:"seq",default:!0,nodeClass:AXn.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return kWs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>AXn.YAMLSeq.from(t,e,r),"createNode")};yXn.seq=PWs});var bDe=I(EXn=>{"use strict";p();var DWs=yDe(),NWs={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),DWs.stringifyString(t,e,r,n)}};EXn.string=NWs});var hut=I(vXn=>{"use strict";p();var _Xn=i0(),CXn={identify:a(t=>t==null,"identify"),createNode:a(()=>new _Xn.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new _Xn.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&CXn.test.test(t)?t:e.options.nullStr,"stringify")};vXn.nullTag=CXn});var Jdr=I(SXn=>{"use strict";p();var MWs=i0(),bXn={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 MWs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&bXn.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};SXn.boolTag=bXn});var phe=I(TXn=>{"use strict";p();function OWs({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(OWs,"stringifyNumber");TXn.stringifyNumber=OWs});var Xdr=I(mut=>{"use strict";p();var BWs=i0(),Zdr=phe(),LWs={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:Zdr.stringifyNumber},FWs={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():Zdr.stringifyNumber(t)}},UWs={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 BWs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Zdr.stringifyNumber};mut.float=UWs;mut.floatExp=FWs;mut.floatNaN=LWs});var tfr=I(Aut=>{"use strict";p();var IXn=phe(),gut=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),efr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function xXn(t,e,r){let{value:n}=t;return gut(n)&&n>=0?r+n.toString(e):IXn.stringifyNumber(t)}a(xXn,"intStringify");var QWs={identify:a(t=>gut(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>efr(t,2,8,r),"resolve"),stringify:a(t=>xXn(t,8,"0o"),"stringify")},qWs={identify:gut,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>efr(t,0,10,r),"resolve"),stringify:IXn.stringifyNumber},jWs={identify:a(t=>gut(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)=>efr(t,2,16,r),"resolve"),stringify:a(t=>xXn(t,16,"0x"),"stringify")};Aut.int=qWs;Aut.intHex=jWs;Aut.intOct=QWs});var RXn=I(wXn=>{"use strict";p();var HWs=dhe(),GWs=hut(),$Ws=fhe(),VWs=bDe(),WWs=Jdr(),rfr=Xdr(),nfr=tfr(),zWs=[HWs.map,$Ws.seq,VWs.string,GWs.nullTag,WWs.boolTag,nfr.intOct,nfr.int,nfr.intHex,rfr.floatNaN,rfr.floatExp,rfr.float];wXn.schema=zWs});var DXn=I(PXn=>{"use strict";p();var YWs=i0(),KWs=dhe(),JWs=fhe();function kXn(t){return typeof t=="bigint"||Number.isInteger(t)}a(kXn,"intIdentify");var yut=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),ZWs=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:yut},{identify:a(t=>t==null,"identify"),createNode:a(()=>new YWs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:yut},{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:yut},{identify:kXn,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})=>kXn(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:yut}],XWs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},ezs=[KWs.map,JWs.seq].concat(ZWs,XWs);PXn.schema=ezs});var ofr=I(NXn=>{"use strict";p();var SDe=require("buffer"),ifr=i0(),tzs=yDe(),rzs={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof SDe.Buffer=="function")return SDe.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 Eut=Ka(),sfr=fH(),nzs=i0(),izs=mH();function MXn(t,e){if(Eut.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new sfr.Pair(new nzs.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} +${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(gHs,"stringifyFlowCollection");function xlt({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=Ilt.indentComment(e(n),t);r.push(s.trimStart())}}a(xlt,"addCommentBefore");HJn.stringifyCollection=hHs});var Kj=I($ur=>{"use strict";p();var AHs=Hur(),yHs=qur(),EHs=hlt(),Yj=za(),wlt=zj(),_Hs=i0();function Y2e(t,e){let r=Yj.isScalar(e)?e.value:e;for(let n of t)if(Yj.isPair(n)&&(n.key===e||n.key===r||Yj.isScalar(n.key)&&n.key.value===r))return n}a(Y2e,"findPair");var Gur=class extends EHs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yj.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(wlt.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;Yj.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new wlt.Pair(e,e?.value):n=new wlt.Pair(e.key,e.value);let o=Y2e(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);Yj.isScalar(o.value)&&_Hs.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=Y2e(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=Y2e(this.items,e)?.value;return(!r&&Yj.isScalar(o)?o.value:o)??void 0}has(e){return!!Y2e(this.items,e)}set(e,r){this.add(new wlt.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)yHs.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!Yj.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})),AHs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};$ur.YAMLMap=Gur;$ur.findPair=Y2e});var jpe=I($Jn=>{"use strict";p();var vHs=za(),GJn=Kj(),CHs={collection:"map",default:!0,nodeClass:GJn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return vHs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>GJn.YAMLMap.from(t,e,r),"createNode")};$Jn.map=CHs});var Jj=I(VJn=>{"use strict";p();var bHs=q2e(),SHs=Hur(),THs=hlt(),Plt=za(),IHs=i0(),xHs=Gj(),Vur=class extends THs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Plt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Rlt(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Rlt(e);if(typeof n!="number")return;let o=this.items[n];return!r&&Plt.isScalar(o)?o.value:o}has(e){let r=Rlt(e);return typeof r=="number"&&r=0?e:null}a(Rlt,"asItemIndex");VJn.YAMLSeq=Vur});var Hpe=I(zJn=>{"use strict";p();var wHs=za(),WJn=Jj(),RHs={collection:"seq",default:!0,nodeClass:WJn.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return wHs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>WJn.YAMLSeq.from(t,e,r),"createNode")};zJn.seq=RHs});var K2e=I(YJn=>{"use strict";p();var PHs=$2e(),kHs={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),PHs.stringifyString(t,e,r,n)}};YJn.string=kHs});var klt=I(ZJn=>{"use strict";p();var KJn=i0(),JJn={identify:a(t=>t==null,"identify"),createNode:a(()=>new KJn.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new KJn.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&JJn.test.test(t)?t:e.options.nullStr,"stringify")};ZJn.nullTag=JJn});var Wur=I(eZn=>{"use strict";p();var DHs=i0(),XJn={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 DHs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&XJn.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};eZn.boolTag=XJn});var Gpe=I(tZn=>{"use strict";p();function NHs({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(NHs,"stringifyNumber");tZn.stringifyNumber=NHs});var Yur=I(Dlt=>{"use strict";p();var MHs=i0(),zur=Gpe(),OHs={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:zur.stringifyNumber},BHs={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():zur.stringifyNumber(t)}},LHs={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 MHs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:zur.stringifyNumber};Dlt.float=LHs;Dlt.floatExp=BHs;Dlt.floatNaN=OHs});var Jur=I(Mlt=>{"use strict";p();var rZn=Gpe(),Nlt=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),Kur=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function nZn(t,e,r){let{value:n}=t;return Nlt(n)&&n>=0?r+n.toString(e):rZn.stringifyNumber(t)}a(nZn,"intStringify");var FHs={identify:a(t=>Nlt(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>Kur(t,2,8,r),"resolve"),stringify:a(t=>nZn(t,8,"0o"),"stringify")},UHs={identify:Nlt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>Kur(t,0,10,r),"resolve"),stringify:rZn.stringifyNumber},QHs={identify:a(t=>Nlt(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)=>Kur(t,2,16,r),"resolve"),stringify:a(t=>nZn(t,16,"0x"),"stringify")};Mlt.int=UHs;Mlt.intHex=QHs;Mlt.intOct=FHs});var oZn=I(iZn=>{"use strict";p();var qHs=jpe(),jHs=klt(),HHs=Hpe(),GHs=K2e(),$Hs=Wur(),Zur=Yur(),Xur=Jur(),VHs=[qHs.map,HHs.seq,GHs.string,jHs.nullTag,$Hs.boolTag,Xur.intOct,Xur.int,Xur.intHex,Zur.floatNaN,Zur.floatExp,Zur.float];iZn.schema=VHs});var cZn=I(aZn=>{"use strict";p();var WHs=i0(),zHs=jpe(),YHs=Hpe();function sZn(t){return typeof t=="bigint"||Number.isInteger(t)}a(sZn,"intIdentify");var Olt=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),KHs=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:Olt},{identify:a(t=>t==null,"identify"),createNode:a(()=>new WHs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:Olt},{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:Olt},{identify:sZn,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})=>sZn(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:Olt}],JHs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},ZHs=[zHs.map,YHs.seq].concat(KHs,JHs);aZn.schema=ZHs});var tdr=I(lZn=>{"use strict";p();var J2e=require("buffer"),edr=i0(),XHs=$2e(),eGs={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof J2e.Buffer=="function")return J2e.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 Blt=za(),rdr=zj(),tGs=i0(),rGs=Jj();function uZn(t,e){if(Blt.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new rdr.Pair(new tGs.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]=Eut.isPair(n)?n:new sfr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(MXn,"resolvePairs");function OXn(t,e,r){let{replacer:n}=r,o=new izs.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(sfr.createPair(l,u,r))}return o}a(OXn,"createPairs");var ozs={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:MXn,createNode:OXn};_ut.createPairs=OXn;_ut.pairs=ozs;_ut.resolvePairs=MXn});var lfr=I(cfr=>{"use strict";p();var BXn=Ka(),afr=cH(),TDe=hH(),szs=mH(),LXn=Cut(),AX=class t extends szs.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=TDe.YAMLMap.prototype.add.bind(this),this.delete=TDe.YAMLMap.prototype.delete.bind(this),this.get=TDe.YAMLMap.prototype.get.bind(this),this.has=TDe.YAMLMap.prototype.has.bind(this),this.set=TDe.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(BXn.isPair(o)?(s=afr.toJS(o.key,"",r),c=afr.toJS(o.value,s,r)):s=afr.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=LXn.createPairs(e,r,n),s=new this;return s.items=o.items,s}};AX.tag="tag:yaml.org,2002:omap";var azs={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:AX,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=LXn.resolvePairs(t,e),n=[];for(let{key:o}of r.items)BXn.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new AX,r)},createNode:a((t,e,r)=>AX.from(t,e,r),"createNode")};cfr.YAMLOMap=AX;cfr.omap=azs});var jXn=I(ufr=>{"use strict";p();var FXn=i0();function UXn({value:t,source:e},r){return e&&(t?QXn:qXn).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(UXn,"boolStringify");var QXn={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 FXn.Scalar(!0),"resolve"),stringify:UXn},qXn={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 FXn.Scalar(!1),"resolve"),stringify:UXn};ufr.falseTag=qXn;ufr.trueTag=QXn});var HXn=I(vut=>{"use strict";p();var czs=i0(),dfr=phe(),lzs={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:dfr.stringifyNumber},uzs={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():dfr.stringifyNumber(t)}},dzs={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 czs.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:dfr.stringifyNumber};vut.float=dzs;vut.floatExp=uzs;vut.floatNaN=lzs});var $Xn=I(xDe=>{"use strict";p();var GXn=phe(),IDe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function but(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(but,"intResolve");function ffr(t,e,r){let{value:n}=t;if(IDe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return GXn.stringifyNumber(t)}a(ffr,"intStringify");var fzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>but(t,2,2,r),"resolve"),stringify:a(t=>ffr(t,2,"0b"),"stringify")},pzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>but(t,1,8,r),"resolve"),stringify:a(t=>ffr(t,8,"0"),"stringify")},hzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>but(t,0,10,r),"resolve"),stringify:GXn.stringifyNumber},mzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>but(t,2,16,r),"resolve"),stringify:a(t=>ffr(t,16,"0x"),"stringify")};xDe.int=hzs;xDe.intBin=fzs;xDe.intHex=mzs;xDe.intOct=pzs});var hfr=I(pfr=>{"use strict";p();var Iut=Ka(),Sut=fH(),Tut=hH(),yX=class t extends Tut.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Iut.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Sut.Pair(e.key,null):r=new Sut.Pair(e,null),Tut.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Tut.findPair(this.items,e);return!r&&Iut.isPair(n)?Iut.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=Tut.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Sut.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(Sut.createPair(c,null,n));return s}};yX.tag="tag:yaml.org,2002:set";var gzs={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:yX,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>yX.from(t,e,r),"createNode"),resolve(t,e){if(Iut.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new yX,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};pfr.YAMLSet=yX;pfr.set=gzs});var gfr=I(xut=>{"use strict";p();var Azs=phe();function mfr(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(mfr,"parseSexagesimal");function VXn(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 Azs.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(VXn,"stringifySexagesimal");var yzs={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})=>mfr(t,r),"resolve"),stringify:VXn},Ezs={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=>mfr(t,!1),"resolve"),stringify:VXn},WXn={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(WXn.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=mfr(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")};xut.floatTime=Ezs;xut.intTime=yzs;xut.timestamp=WXn});var KXn=I(YXn=>{"use strict";p();var _zs=dhe(),Czs=hut(),vzs=fhe(),bzs=bDe(),Szs=ofr(),zXn=jXn(),Afr=HXn(),wut=$Xn(),Tzs=sut(),Izs=lfr(),xzs=Cut(),wzs=hfr(),yfr=gfr(),Rzs=[_zs.map,vzs.seq,bzs.string,Czs.nullTag,zXn.trueTag,zXn.falseTag,wut.intBin,wut.intOct,wut.int,wut.intHex,Afr.floatNaN,Afr.floatExp,Afr.float,Szs.binary,Tzs.merge,Izs.omap,xzs.pairs,wzs.set,yfr.intTime,yfr.floatTime,yfr.timestamp];YXn.schema=Rzs});var sei=I(Cfr=>{"use strict";p();var eei=dhe(),kzs=hut(),tei=fhe(),Pzs=bDe(),Dzs=Jdr(),Efr=Xdr(),_fr=tfr(),Nzs=RXn(),Mzs=DXn(),rei=ofr(),wDe=sut(),nei=lfr(),iei=Cut(),JXn=KXn(),oei=hfr(),Rut=gfr(),ZXn=new Map([["core",Nzs.schema],["failsafe",[eei.map,tei.seq,Pzs.string]],["json",Mzs.schema],["yaml11",JXn.schema],["yaml-1.1",JXn.schema]]),XXn={binary:rei.binary,bool:Dzs.boolTag,float:Efr.float,floatExp:Efr.floatExp,floatNaN:Efr.floatNaN,floatTime:Rut.floatTime,int:_fr.int,intHex:_fr.intHex,intOct:_fr.intOct,intTime:Rut.intTime,map:eei.map,merge:wDe.merge,null:kzs.nullTag,omap:nei.omap,pairs:iei.pairs,seq:tei.seq,set:oei.set,timestamp:Rut.timestamp},Ozs={"tag:yaml.org,2002:binary":rei.binary,"tag:yaml.org,2002:merge":wDe.merge,"tag:yaml.org,2002:omap":nei.omap,"tag:yaml.org,2002:pairs":iei.pairs,"tag:yaml.org,2002:set":oei.set,"tag:yaml.org,2002:timestamp":Rut.timestamp};function Bzs(t,e,r){let n=ZXn.get(e);if(n&&!t)return r&&!n.includes(wDe.merge)?n.concat(wDe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(ZXn.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(wDe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?XXn[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(XXn).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(Bzs,"getTags");Cfr.coreKnownTags=Ozs;Cfr.getTags=Bzs});var Sfr=I(aei=>{"use strict";p();var vfr=Ka(),Lzs=dhe(),Fzs=fhe(),Uzs=bDe(),kut=sei(),Qzs=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),bfr=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)?kut.getTags(e,"compat"):e?kut.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?kut.coreKnownTags:{},this.tags=kut.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,vfr.MAP,{value:Lzs.map}),Object.defineProperty(this,vfr.SCALAR,{value:Uzs.string}),Object.defineProperty(this,vfr.SEQ,{value:Fzs.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?Qzs:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};aei.Schema=bfr});var lei=I(cei=>{"use strict";p();var qzs=Ka(),Tfr=EDe(),RDe=mDe();function jzs(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=Tfr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(RDe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(qzs.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(RDe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=Tfr.stringify(t.contents,o,()=>l=null,u);l&&(d+=RDe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Tfr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` -`)?(r.push("..."),r.push(RDe.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(RDe.indentComment(s(u),"")))}return r.join(` +${s.comment}`:n.comment}n=o}t.items[r]=Blt.isPair(n)?n:new rdr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(uZn,"resolvePairs");function dZn(t,e,r){let{replacer:n}=r,o=new rGs.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(rdr.createPair(l,u,r))}return o}a(dZn,"createPairs");var nGs={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:uZn,createNode:dZn};Llt.createPairs=dZn;Llt.pairs=nGs;Llt.resolvePairs=uZn});var odr=I(idr=>{"use strict";p();var fZn=za(),ndr=Gj(),Z2e=Kj(),iGs=Jj(),pZn=Flt(),eX=class t extends iGs.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=Z2e.YAMLMap.prototype.add.bind(this),this.delete=Z2e.YAMLMap.prototype.delete.bind(this),this.get=Z2e.YAMLMap.prototype.get.bind(this),this.has=Z2e.YAMLMap.prototype.has.bind(this),this.set=Z2e.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(fZn.isPair(o)?(s=ndr.toJS(o.key,"",r),c=ndr.toJS(o.value,s,r)):s=ndr.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=pZn.createPairs(e,r,n),s=new this;return s.items=o.items,s}};eX.tag="tag:yaml.org,2002:omap";var oGs={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:eX,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=pZn.resolvePairs(t,e),n=[];for(let{key:o}of r.items)fZn.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new eX,r)},createNode:a((t,e,r)=>eX.from(t,e,r),"createNode")};idr.YAMLOMap=eX;idr.omap=oGs});var yZn=I(sdr=>{"use strict";p();var hZn=i0();function mZn({value:t,source:e},r){return e&&(t?gZn:AZn).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(mZn,"boolStringify");var gZn={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 hZn.Scalar(!0),"resolve"),stringify:mZn},AZn={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 hZn.Scalar(!1),"resolve"),stringify:mZn};sdr.falseTag=AZn;sdr.trueTag=gZn});var EZn=I(Ult=>{"use strict";p();var sGs=i0(),adr=Gpe(),aGs={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:adr.stringifyNumber},cGs={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():adr.stringifyNumber(t)}},lGs={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 sGs.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:adr.stringifyNumber};Ult.float=lGs;Ult.floatExp=cGs;Ult.floatNaN=aGs});var vZn=I(eDe=>{"use strict";p();var _Zn=Gpe(),X2e=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Qlt(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(Qlt,"intResolve");function cdr(t,e,r){let{value:n}=t;if(X2e(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return _Zn.stringifyNumber(t)}a(cdr,"intStringify");var uGs={identify:X2e,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Qlt(t,2,2,r),"resolve"),stringify:a(t=>cdr(t,2,"0b"),"stringify")},dGs={identify:X2e,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Qlt(t,1,8,r),"resolve"),stringify:a(t=>cdr(t,8,"0"),"stringify")},fGs={identify:X2e,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Qlt(t,0,10,r),"resolve"),stringify:_Zn.stringifyNumber},pGs={identify:X2e,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Qlt(t,2,16,r),"resolve"),stringify:a(t=>cdr(t,16,"0x"),"stringify")};eDe.int=fGs;eDe.intBin=uGs;eDe.intHex=pGs;eDe.intOct=dGs});var udr=I(ldr=>{"use strict";p();var Hlt=za(),qlt=zj(),jlt=Kj(),tX=class t extends jlt.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Hlt.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new qlt.Pair(e.key,null):r=new qlt.Pair(e,null),jlt.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=jlt.findPair(this.items,e);return!r&&Hlt.isPair(n)?Hlt.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=jlt.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new qlt.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(qlt.createPair(c,null,n));return s}};tX.tag="tag:yaml.org,2002:set";var hGs={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:tX,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>tX.from(t,e,r),"createNode"),resolve(t,e){if(Hlt.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new tX,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ldr.YAMLSet=tX;ldr.set=hGs});var fdr=I(Glt=>{"use strict";p();var mGs=Gpe();function ddr(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(ddr,"parseSexagesimal");function CZn(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 mGs.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(CZn,"stringifySexagesimal");var gGs={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})=>ddr(t,r),"resolve"),stringify:CZn},AGs={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=>ddr(t,!1),"resolve"),stringify:CZn},bZn={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(bZn.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=ddr(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")};Glt.floatTime=AGs;Glt.intTime=gGs;Glt.timestamp=bZn});var IZn=I(TZn=>{"use strict";p();var yGs=jpe(),EGs=klt(),_Gs=Hpe(),vGs=K2e(),CGs=tdr(),SZn=yZn(),pdr=EZn(),$lt=vZn(),bGs=blt(),SGs=odr(),TGs=Flt(),IGs=udr(),hdr=fdr(),xGs=[yGs.map,_Gs.seq,vGs.string,EGs.nullTag,SZn.trueTag,SZn.falseTag,$lt.intBin,$lt.intOct,$lt.int,$lt.intHex,pdr.floatNaN,pdr.floatExp,pdr.float,CGs.binary,bGs.merge,SGs.omap,TGs.pairs,IGs.set,hdr.intTime,hdr.floatTime,hdr.timestamp];TZn.schema=xGs});var BZn=I(Adr=>{"use strict";p();var PZn=jpe(),wGs=klt(),kZn=Hpe(),RGs=K2e(),PGs=Wur(),mdr=Yur(),gdr=Jur(),kGs=oZn(),DGs=cZn(),DZn=tdr(),tDe=blt(),NZn=odr(),MZn=Flt(),xZn=IZn(),OZn=udr(),Vlt=fdr(),wZn=new Map([["core",kGs.schema],["failsafe",[PZn.map,kZn.seq,RGs.string]],["json",DGs.schema],["yaml11",xZn.schema],["yaml-1.1",xZn.schema]]),RZn={binary:DZn.binary,bool:PGs.boolTag,float:mdr.float,floatExp:mdr.floatExp,floatNaN:mdr.floatNaN,floatTime:Vlt.floatTime,int:gdr.int,intHex:gdr.intHex,intOct:gdr.intOct,intTime:Vlt.intTime,map:PZn.map,merge:tDe.merge,null:wGs.nullTag,omap:NZn.omap,pairs:MZn.pairs,seq:kZn.seq,set:OZn.set,timestamp:Vlt.timestamp},NGs={"tag:yaml.org,2002:binary":DZn.binary,"tag:yaml.org,2002:merge":tDe.merge,"tag:yaml.org,2002:omap":NZn.omap,"tag:yaml.org,2002:pairs":MZn.pairs,"tag:yaml.org,2002:set":OZn.set,"tag:yaml.org,2002:timestamp":Vlt.timestamp};function MGs(t,e,r){let n=wZn.get(e);if(n&&!t)return r&&!n.includes(tDe.merge)?n.concat(tDe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(wZn.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(tDe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?RZn[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(RZn).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(MGs,"getTags");Adr.coreKnownTags=NGs;Adr.getTags=MGs});var _dr=I(LZn=>{"use strict";p();var ydr=za(),OGs=jpe(),BGs=Hpe(),LGs=K2e(),Wlt=BZn(),FGs=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),Edr=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)?Wlt.getTags(e,"compat"):e?Wlt.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Wlt.coreKnownTags:{},this.tags=Wlt.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,ydr.MAP,{value:OGs.map}),Object.defineProperty(this,ydr.SCALAR,{value:LGs.string}),Object.defineProperty(this,ydr.SEQ,{value:BGs.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?FGs:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};LZn.Schema=Edr});var UZn=I(FZn=>{"use strict";p();var UGs=za(),vdr=V2e(),rDe=j2e();function QGs(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=vdr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(rDe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(UGs.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(rDe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=vdr.stringify(t.contents,o,()=>l=null,u);l&&(d+=rDe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(vdr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` +`)?(r.push("..."),r.push(rDe.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(rDe.indentComment(s(u),"")))}return r.join(` `)+` -`}a(jzs,"stringifyDocument");cei.stringifyDocument=jzs});var kDe=I(uei=>{"use strict";p();var Hzs=pDe(),hhe=Klt(),Qw=Ka(),Gzs=fH(),$zs=cH(),Vzs=Sfr(),Wzs=lei(),Ifr=Vlt(),zzs=kdr(),Yzs=hDe(),xfr=Rdr(),wfr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qw.NODE_TYPE,{value:Qw.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 xfr.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,{[Qw.NODE_TYPE]:{value:Qw.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=Qw.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){mhe(this.contents)&&this.contents.add(e)}addIn(e,r){mhe(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Ifr.anchorNames(this);e.anchor=!r||n.has(r)?Ifr.findNewAnchor(r||"a",n):r}return new Hzs.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}=Ifr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Yzs.createNode(e,f,A);return l&&Qw.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 Gzs.Pair(o,s)}delete(e){return mhe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return hhe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):mhe(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Qw.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return hhe.isEmptyPath(e)?!r&&Qw.isScalar(this.contents)?this.contents.value:this.contents:Qw.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Qw.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return hhe.isEmptyPath(e)?this.contents!==void 0:Qw.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=hhe.collectionFromPath(this.schema,[e],r):mhe(this.contents)&&this.contents.set(e,r)}setIn(e,r){hhe.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=hhe.collectionFromPath(this.schema,Array.from(e),r):mhe(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 xfr.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 xfr.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 Vzs.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=$zs.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"?zzs.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 Wzs.stringifyDocument(this,e)}};function mhe(t){if(Qw.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(mhe,"assertCollection");uei.Document=wfr});var NDe=I(DDe=>{"use strict";p();var PDe=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}},Rfr=class extends PDe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},kfr=class extends PDe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Kzs=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(QGs,"stringifyDocument");FZn.stringifyDocument=QGs});var nDe=I(QZn=>{"use strict";p();var qGs=Q2e(),$pe=hlt(),Nw=za(),jGs=zj(),HGs=Gj(),GGs=_dr(),$Gs=UZn(),Cdr=ult(),VGs=Iur(),WGs=q2e(),bdr=Tur(),Sdr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Nw.NODE_TYPE,{value:Nw.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 bdr.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,{[Nw.NODE_TYPE]:{value:Nw.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=Nw.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Vpe(this.contents)&&this.contents.add(e)}addIn(e,r){Vpe(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Cdr.anchorNames(this);e.anchor=!r||n.has(r)?Cdr.findNewAnchor(r||"a",n):r}return new qGs.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}=Cdr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=WGs.createNode(e,f,A);return l&&Nw.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 jGs.Pair(o,s)}delete(e){return Vpe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return $pe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Vpe(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Nw.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return $pe.isEmptyPath(e)?!r&&Nw.isScalar(this.contents)?this.contents.value:this.contents:Nw.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Nw.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return $pe.isEmptyPath(e)?this.contents!==void 0:Nw.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=$pe.collectionFromPath(this.schema,[e],r):Vpe(this.contents)&&this.contents.set(e,r)}setIn(e,r){$pe.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=$pe.collectionFromPath(this.schema,Array.from(e),r):Vpe(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 bdr.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 bdr.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 GGs.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=HGs.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"?VGs.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 $Gs.stringifyDocument(this,e)}};function Vpe(t){if(Nw.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(Vpe,"assertCollection");QZn.Document=Sdr});var sDe=I(oDe=>{"use strict";p();var iDe=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}},Tdr=class extends iDe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Idr=class extends iDe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},zGs=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");DDe.YAMLError=PDe;DDe.YAMLParseError=Rfr;DDe.YAMLWarning=kfr;DDe.prettifyError=Kzs});var MDe=I(dei=>{"use strict";p();function Jzs(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 k of t)switch(A&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&k.type!=="comment"&&k.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),k.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&k.source.includes(" ")&&(y=k),f=!0;break;case"comment":{f||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=k.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=k.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=k.source,d=!0,g=!0,(E||_)&&(v=k),f=!0;break;case"anchor":E&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=k,w??(w=k.offset),d=!1,f=!1,A=!0;break;case"tag":{_&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),_=k,w??(w=k.offset),d=!1,f=!1,A=!0;break}case r:(E||_)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),T&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),T=k,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=k,d=!1,f=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.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(Jzs,"resolveProps");dei.resolveProps=Jzs});var Put=I(fei=>{"use strict";p();function Pfr(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(Pfr(e.key)||Pfr(e.value))return!0}return!1;default:return!0}}a(Pfr,"containsNewline");fei.containsNewline=Pfr});var Dfr=I(pei=>{"use strict";p();var Zzs=Put();function Xzs(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Zzs.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Xzs,"flowIndentCheck");pei.flowIndentCheck=Xzs});var Nfr=I(mei=>{"use strict";p();var hei=Ka();function eYs(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||hei.isScalar(s)&&hei.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(eYs,"mapIncludes");mei.mapIncludes=eYs});var Cei=I(_ei=>{"use strict";p();var gei=fH(),tYs=hH(),Aei=MDe(),rYs=Put(),yei=Dfr(),nYs=Nfr(),Eei="All mapping items must start at the same column";function iYs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??tYs.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=Aei.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",Eei)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` -`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||rYs.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",Eei);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&yei.flowIndentCheck(n.indent,m,o),r.atKey=!1,nYs.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=Aei.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 oYs=mH(),sYs=MDe(),aYs=Dfr();function cYs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??oYs.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=sYs.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&&aYs.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(cYs,"resolveBlockSeq");vei.resolveBlockSeq=cYs});var ghe=I(Sei=>{"use strict";p();function lYs(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(lYs,"resolveEnd");Sei.resolveEnd=lYs});var wei=I(xei=>{"use strict";p();var uYs=Ka(),dYs=fH(),Tei=hH(),fYs=mH(),pYs=ghe(),Iei=MDe(),hYs=Put(),mYs=Nfr(),Mfr="Block collections are not allowed within flow collections",Ofr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function gYs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?Tei.YAMLMap:fYs.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=pYs.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(gYs,"resolveFlowCollection");xei.resolveFlowCollection=gYs});var kei=I(Rei=>{"use strict";p();var AYs=Ka(),yYs=i0(),EYs=hH(),_Ys=mH(),CYs=Cei(),vYs=bei(),bYs=wei();function Bfr(t,e,r,n,o,s){let c=r.type==="block-map"?CYs.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?vYs.resolveBlockSeq(t,e,r,n,s):bYs.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(Bfr,"resolveCollection");function SYs(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),Bfr(t,e,r,o,c)}let d=Bfr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=AYs.isNode(f)?f:new yYs.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(SYs,"composeCollection");Rei.composeCollection=SYs});var Ffr=I(Pei=>{"use strict";p();var Lfr=i0();function TYs(t,e,r){let n=e.offset,o=IYs(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?Lfr.Scalar.BLOCK_FOLDED:Lfr.Scalar.BLOCK_LITERAL,c=e.source?xYs(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");oDe.YAMLError=iDe;oDe.YAMLParseError=Tdr;oDe.YAMLWarning=Idr;oDe.prettifyError=zGs});var aDe=I(qZn=>{"use strict";p();function YGs(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(YGs,"resolveProps");qZn.resolveProps=YGs});var zlt=I(jZn=>{"use strict";p();function xdr(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(xdr(e.key)||xdr(e.value))return!0}return!1;default:return!0}}a(xdr,"containsNewline");jZn.containsNewline=xdr});var wdr=I(HZn=>{"use strict";p();var KGs=zlt();function JGs(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&KGs.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(JGs,"flowIndentCheck");HZn.flowIndentCheck=JGs});var Rdr=I($Zn=>{"use strict";p();var GZn=za();function ZGs(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||GZn.isScalar(s)&&GZn.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(ZGs,"mapIncludes");$Zn.mapIncludes=ZGs});var JZn=I(KZn=>{"use strict";p();var VZn=zj(),XGs=Kj(),WZn=aDe(),e$s=zlt(),zZn=wdr(),t$s=Rdr(),YZn="All mapping items must start at the same column";function r$s({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??XGs.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=WZn.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",YZn)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` +`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||e$s.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",YZn);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&zZn.flowIndentCheck(n.indent,m,o),r.atKey=!1,t$s.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=WZn.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 n$s=Jj(),i$s=aDe(),o$s=wdr();function s$s({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??n$s.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=i$s.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&&o$s.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(s$s,"resolveBlockSeq");ZZn.resolveBlockSeq=s$s});var Wpe=I(eXn=>{"use strict";p();function a$s(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(a$s,"resolveEnd");eXn.resolveEnd=a$s});var iXn=I(nXn=>{"use strict";p();var c$s=za(),l$s=zj(),tXn=Kj(),u$s=Jj(),d$s=Wpe(),rXn=aDe(),f$s=zlt(),p$s=Rdr(),Pdr="Block collections are not allowed within flow collections",kdr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function h$s({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?tXn.YAMLMap:u$s.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=d$s.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(h$s,"resolveFlowCollection");nXn.resolveFlowCollection=h$s});var sXn=I(oXn=>{"use strict";p();var m$s=za(),g$s=i0(),A$s=Kj(),y$s=Jj(),E$s=JZn(),_$s=XZn(),v$s=iXn();function Ddr(t,e,r,n,o,s){let c=r.type==="block-map"?E$s.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?_$s.resolveBlockSeq(t,e,r,n,s):v$s.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(Ddr,"resolveCollection");function C$s(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),Ddr(t,e,r,o,c)}let d=Ddr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=m$s.isNode(f)?f:new g$s.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(C$s,"composeCollection");oXn.composeCollection=C$s});var Mdr=I(aXn=>{"use strict";p();var Ndr=i0();function b$s(t,e,r){let n=e.offset,o=S$s(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?Ndr.Scalar.BLOCK_FOLDED:Ndr.Scalar.BLOCK_LITERAL,c=e.source?T$s(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=` @@ -449,84 +405,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(TYs,"resolveBlockScalar");function IYs({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 Ufr=i0(),wYs=ghe();function RYs(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=Ufr.Scalar.PLAIN,u=kYs(s,d);break;case"single-quoted-scalar":l=Ufr.Scalar.QUOTE_SINGLE,u=PYs(s,d);break;case"double-quoted-scalar":l=Ufr.Scalar.QUOTE_DOUBLE,u=DYs(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=wYs.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(RYs,"resolveFlowScalar");function kYs(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}`),Dei(t)}a(kYs,"plainValue");function PYs(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Dei(t.slice(1,-1)).replace(/''/g,"'")}a(PYs,"singleQuotedValue");function Dei(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";p();var Odr=i0(),I$s=Wpe();function x$s(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=Odr.Scalar.PLAIN,u=w$s(s,d);break;case"single-quoted-scalar":l=Odr.Scalar.QUOTE_SINGLE,u=R$s(s,d);break;case"double-quoted-scalar":l=Odr.Scalar.QUOTE_DOUBLE,u=P$s(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=I$s.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(x$s,"resolveFlowScalar");function w$s(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}`),cXn(t)}a(w$s,"plainValue");function R$s(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),cXn(t.slice(1,-1)).replace(/''/g,"'")}a(R$s,"singleQuotedValue");function cXn(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(DYs,"doubleQuotedValue");function NYs(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(P$s,"doubleQuotedValue");function k$s(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(NYs,"foldNewline");var MYs={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function OYs(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(OYs,"parseCharCode");Nei.resolveFlowScalar=RYs});var Bei=I(Oei=>{"use strict";p();var EX=Ka(),Mei=i0(),BYs=Ffr(),LYs=Qfr();function FYs(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?BYs.resolveBlockScalar(t,e,n):LYs.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[EX.SCALAR]:u?d=UYs(t.schema,o,u,r,n):e.type==="scalar"?d=QYs(t,o,e,n):d=t.schema[EX.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=EX.isScalar(h)?h:new Mei.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new Mei.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(FYs,"composeScalar");function UYs(t,e,r,n,o){if(r==="!")return t[EX.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[EX.SCALAR])}a(UYs,"findScalarTagByName");function QYs({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[EX.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[EX.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(QYs,"findScalarTagByTest");Oei.composeScalar=FYs});var Fei=I(Lei=>{"use strict";p();function qYs(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(qYs,"emptyScalarPosition");Lei.emptyScalarPosition=qYs});var qei=I(jfr=>{"use strict";p();var jYs=pDe(),HYs=Ka(),GYs=kei(),Uei=Bei(),$Ys=ghe(),VYs=Fei(),WYs={composeNode:Qei,composeEmptyNode:qfr};function Qei(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=zYs(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=Uei.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=GYs.composeCollection(WYs,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=qfr(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&&(!HYs.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(Qei,"composeNode");function qfr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:VYs.emptyScalarPosition(e,r,n),indent:-1,source:""},h=Uei.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(qfr,"composeEmptyNode");function zYs({options:t},{offset:e,source:r,end:n},o){let s=new jYs.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=$Ys.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(zYs,"composeAlias");jfr.composeEmptyNode=qfr;jfr.composeNode=Qei});var Gei=I(Hei=>{"use strict";p();var YYs=kDe(),jei=qei(),KYs=ghe(),JYs=MDe();function ZYs(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new YYs.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=JYs.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?jei.composeNode(d,o,f,c):jei.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=KYs.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(ZYs,"composeDoc");Hei.composeDoc=ZYs});var Gfr=I(Wei=>{"use strict";p();var XYs=require("process"),eKs=Rdr(),tKs=kDe(),ODe=NDe(),$ei=Ka(),rKs=Gei(),nKs=ghe();function BDe(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(BDe,"getErrorPos");function Vei(t){let e="",r=!1,n=!1;for(let o=0;o{"use strict";p();var rX=za(),uXn=i0(),M$s=Mdr(),O$s=Bdr();function B$s(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?M$s.resolveBlockScalar(t,e,n):O$s.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[rX.SCALAR]:u?d=L$s(t.schema,o,u,r,n):e.type==="scalar"?d=F$s(t,o,e,n):d=t.schema[rX.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=rX.isScalar(h)?h:new uXn.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new uXn.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(B$s,"composeScalar");function L$s(t,e,r,n,o){if(r==="!")return t[rX.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[rX.SCALAR])}a(L$s,"findScalarTagByName");function F$s({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[rX.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[rX.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(F$s,"findScalarTagByTest");dXn.composeScalar=B$s});var hXn=I(pXn=>{"use strict";p();function U$s(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(U$s,"emptyScalarPosition");pXn.emptyScalarPosition=U$s});var AXn=I(Fdr=>{"use strict";p();var Q$s=Q2e(),q$s=za(),j$s=sXn(),mXn=fXn(),H$s=Wpe(),G$s=hXn(),$$s={composeNode:gXn,composeEmptyNode:Ldr};function gXn(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=V$s(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=mXn.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=j$s.composeCollection($$s,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=Ldr(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&&(!q$s.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(gXn,"composeNode");function Ldr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:G$s.emptyScalarPosition(e,r,n),indent:-1,source:""},h=mXn.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(Ldr,"composeEmptyNode");function V$s({options:t},{offset:e,source:r,end:n},o){let s=new Q$s.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=H$s.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(V$s,"composeAlias");Fdr.composeEmptyNode=Ldr;Fdr.composeNode=gXn});var _Xn=I(EXn=>{"use strict";p();var W$s=nDe(),yXn=AXn(),z$s=Wpe(),Y$s=aDe();function K$s(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new W$s.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Y$s.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?yXn.composeNode(d,o,f,c):yXn.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=z$s.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(K$s,"composeDoc");EXn.composeDoc=K$s});var Qdr=I(bXn=>{"use strict";p();var J$s=require("process"),Z$s=Tur(),X$s=nDe(),cDe=sDe(),vXn=za(),eVs=_Xn(),tVs=Wpe();function lDe(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(lDe,"getErrorPos");function CXn(t){let e="",r=!1,n=!1;for(let o=0;o{let c=BDe(r);s?this.warnings.push(new ODe.YAMLWarning(c,n,o)):this.errors.push(new ODe.YAMLParseError(c,n,o))},this.directives=new eKs.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=Vei(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($ei.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];$ei.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(CXn,"parsePrelude");var Udr=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=lDe(r);s?this.warnings.push(new cDe.YAMLWarning(c,n,o)):this.errors.push(new cDe.YAMLParseError(c,n,o))},this.directives=new Z$s.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=CXn(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(vXn.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];vXn.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:Vei(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(XYs.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=BDe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=rKs.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 ODe.YAMLParseError(BDe(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 ODe.YAMLParseError(BDe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=nKs.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 ODe.YAMLParseError(BDe(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 tKs.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}}};Wei.Composer=Hfr});var Kei=I(Dut=>{"use strict";p();var iKs=Ffr(),oKs=Qfr(),sKs=NDe(),zei=yDe();function aKs(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 sKs.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return oKs.resolveFlowScalar(t,e,n);case"block-scalar":return iKs.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(aKs,"resolveAsScalar");function cKs(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=zei.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:CXn(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(J$s.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=lDe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=eVs.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 cDe.YAMLParseError(lDe(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 cDe.YAMLParseError(lDe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=tVs.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 cDe.YAMLParseError(lDe(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 X$s.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}}};bXn.Composer=Udr});var IXn=I(Ylt=>{"use strict";p();var rVs=Mdr(),nVs=Bdr(),iVs=sDe(),SXn=$2e();function oVs(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 iVs.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return nVs.resolveFlowScalar(t,e,n);case"block-scalar":return rVs.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(oVs,"resolveAsScalar");function sVs(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=SXn.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 Yei(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(cKs,"createScalarToken");function lKs(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=zei.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">":uKs(t,u);break;case'"':$fr(t,u,"double-quoted-scalar");break;case"'":$fr(t,u,"single-quoted-scalar");break;default:$fr(t,u,"scalar")}}a(lKs,"setScalarValue");function uKs(t,e){let r=e.indexOf(` +`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return TXn(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(sVs,"createScalarToken");function aVs(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=SXn.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">":cVs(t,u);break;case'"':qdr(t,u,"double-quoted-scalar");break;case"'":qdr(t,u,"single-quoted-scalar");break;default:qdr(t,u,"scalar")}}a(aVs,"setScalarValue");function cVs(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}];Yei(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(uKs,"setBlockScalarValue");function Yei(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(Yei,"addEndtoBlockProps");function $fr(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($fr,"setFlowScalarValue");Dut.createScalarToken=cKs;Dut.resolveAsScalar=aKs;Dut.setScalarValue=lKs});var Zei=I(Jei=>{"use strict";p();var dKs=a(t=>"type"in t?Mut(t):Nut(t),"stringify");function Mut(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Mut(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Nut(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Nut(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Nut(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(Mut,"stringifyToken");function Nut({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Mut(e)),r)for(let s of r)o+=s.source;return n&&(o+=Mut(n)),o}a(Nut,"stringifyItem");Jei.stringify=dKs});var rti=I(tti=>{"use strict";p();var Vfr=Symbol("break visit"),fKs=Symbol("skip children"),Xei=Symbol("remove item");function _X(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),eti(Object.freeze([]),t,e)}a(_X,"visit");_X.BREAK=Vfr;_X.SKIP=fKs;_X.REMOVE=Xei;_X.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};_X.parentCollection=(t,e)=>{let r=_X.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 eti(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 Wfr=Kei(),pKs=Zei(),hKs=rti(),zfr="\uFEFF",Yfr="",Kfr="",Jfr="",mKs=a(t=>!!t&&"items"in t,"isCollection"),gKs=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function AKs(t){switch(t){case zfr:return"";case Yfr:return"";case Kfr:return"";case Jfr:return"";default:return JSON.stringify(t)}}a(AKs,"prettyToken");function yKs(t){switch(t){case zfr:return"byte-order-mark";case Yfr:return"doc-mode";case Kfr:return"flow-error-end";case Jfr: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}];TXn(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(cVs,"setBlockScalarValue");function TXn(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(TXn,"addEndtoBlockProps");function qdr(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(qdr,"setFlowScalarValue");Ylt.createScalarToken=sVs;Ylt.resolveAsScalar=oVs;Ylt.setScalarValue=aVs});var wXn=I(xXn=>{"use strict";p();var lVs=a(t=>"type"in t?Jlt(t):Klt(t),"stringify");function Jlt(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Jlt(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Klt(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Klt(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Klt(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(Jlt,"stringifyToken");function Klt({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Jlt(e)),r)for(let s of r)o+=s.source;return n&&(o+=Jlt(n)),o}a(Klt,"stringifyItem");xXn.stringify=lVs});var DXn=I(kXn=>{"use strict";p();var jdr=Symbol("break visit"),uVs=Symbol("skip children"),RXn=Symbol("remove item");function nX(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),PXn(Object.freeze([]),t,e)}a(nX,"visit");nX.BREAK=jdr;nX.SKIP=uVs;nX.REMOVE=RXn;nX.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};nX.parentCollection=(t,e)=>{let r=nX.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 PXn(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 Hdr=IXn(),dVs=wXn(),fVs=DXn(),Gdr="\uFEFF",$dr="",Vdr="",Wdr="",pVs=a(t=>!!t&&"items"in t,"isCollection"),hVs=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function mVs(t){switch(t){case Gdr:return"";case $dr:return"";case Vdr:return"";case Wdr:return"";default:return JSON.stringify(t)}}a(mVs,"prettyToken");function gVs(t){switch(t){case Gdr:return"byte-order-mark";case $dr:return"doc-mode";case Vdr:return"flow-error-end";case Wdr: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(yKs,"tokenType");Tb.createScalarToken=Wfr.createScalarToken;Tb.resolveAsScalar=Wfr.resolveAsScalar;Tb.setScalarValue=Wfr.setScalarValue;Tb.stringify=pKs.stringify;Tb.visit=hKs.visit;Tb.BOM=zfr;Tb.DOCUMENT=Yfr;Tb.FLOW_END=Kfr;Tb.SCALAR=Jfr;Tb.isCollection=mKs;Tb.isScalar=gKs;Tb.prettyToken=AKs;Tb.tokenType=yKs});var epr=I(iti=>{"use strict";p();var LDe=Out();function S2(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}a(S2,"isEmpty");var nti=new Set("0123456789ABCDEFabcdef"),EKs=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),But=new Set(",[]{}"),_Ks=new Set(` ,[]{} -\r `),Zfr=a(t=>!t||_Ks.has(t),"isNotAnchorChar"),Xfr=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(gVs,"tokenType");Ab.createScalarToken=Hdr.createScalarToken;Ab.resolveAsScalar=Hdr.resolveAsScalar;Ab.setScalarValue=Hdr.setScalarValue;Ab.stringify=dVs.stringify;Ab.visit=fVs.visit;Ab.BOM=Gdr;Ab.DOCUMENT=$dr;Ab.FLOW_END=Vdr;Ab.SCALAR=Wdr;Ab.isCollection=pVs;Ab.isScalar=hVs;Ab.prettyToken=mVs;Ab.tokenType=gVs});var Kdr=I(MXn=>{"use strict";p();var uDe=Zlt();function g2(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}a(g2,"isEmpty");var NXn=new Set("0123456789ABCDEFabcdef"),AVs=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xlt=new Set(",[]{}"),yVs=new Set(` ,[]{} +\r `),zdr=a(t=>!t||yVs.has(t),"isNotAnchorChar"),Ydr=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==="...")&&S2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!S2(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===":")&&S2(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(Zfr),"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==="...")&&g2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!g2(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===":")&&g2(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(zdr),"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=>S2(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=>g2(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 LDe.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(S2(s)||e&&But.has(s))break;r=n}else if(S2(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 uDe.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(g2(s)||e&&Xlt.has(s))break;r=n}else if(g2(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` `?(n+=1,o=` -`,s=this.buffer[n+1]):r=n),s==="#"||e&&But.has(s))break;if(o===` -`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&But.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield LDe.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(Zfr))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(S2(r)||e&&But.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(;!S2(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(EKs.has(r))r=this.buffer[++e];else if(r==="%"&&nti.has(this.buffer[e+1])&&nti.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&&Xlt.has(s))break;if(o===` +`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&Xlt.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield uDe.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(zdr))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(g2(r)||e&&Xlt.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(;!g2(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(AVs.has(r))r=this.buffer[++e];else if(r==="%"&&NXn.has(this.buffer[e+1])&&NXn.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)}};iti.Lexer=Xfr});var rpr=I(oti=>{"use strict";p();var tpr=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 CKs=require("process"),sti=Out(),vKs=epr();function gH(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(Ahe,"getFirstKeyStartProps");function cti(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!gH(e.start,"explicit-key-ind")&&!gH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,lti(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(cti,"fixFlowSeqItems");var npr=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 vKs.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,CKs.env.LOG_TOKENS&&console.log("|",sti.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=sti.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"&&cti(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&&ati(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)}};MXn.Lexer=Ydr});var Zdr=I(OXn=>{"use strict";p();var Jdr=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 EVs=require("process"),BXn=Zlt(),_Vs=Kdr();function Zj(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(zpe,"getFirstKeyStartProps");function FXn(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Zj(e.start,"explicit-key-ind")&&!Zj(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,UXn(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(FXn,"fixFlowSeqItems");var Xdr=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 _Vs.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,EVs.env.LOG_TOKENS&&console.log("|",BXn.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=BXn.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"&&FXn(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&&LXn(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(gH(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(lti(r.key)&&!gH(r.sep,"newline")){let c=Ahe(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(gH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=Ahe(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]}):gH(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&&!gH(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||gH(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=Lut(n),s=Ahe(o);cti(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(Zj(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(UXn(r.key)&&!Zj(r.sep,"newline")){let c=zpe(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(Zj(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=zpe(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]}):Zj(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&&!Zj(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||Zj(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=eut(n),s=zpe(o);FXn(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=Lut(e),n=Ahe(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=Lut(e),n=Ahe(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())}}};uti.Parser=npr});var mti=I(UDe=>{"use strict";p();var dti=Gfr(),bKs=kDe(),FDe=NDe(),SKs=jdr(),TKs=Ka(),IKs=rpr(),fti=ipr();function pti(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new IKs.LineCounter||null,prettyErrors:e}}a(pti,"parseOptions");function xKs(t,e={}){let{lineCounter:r,prettyErrors:n}=pti(e),o=new fti.Parser(r?.addNewLine),s=new dti.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(FDe.prettifyError(t,r)),l.warnings.forEach(FDe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(xKs,"parseAllDocuments");function hti(t,e={}){let{lineCounter:r,prettyErrors:n}=pti(e),o=new fti.Parser(r?.addNewLine),s=new dti.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 FDe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(FDe.prettifyError(t,r)),c.warnings.forEach(FDe.prettifyError(t,r))),c}a(hti,"parseDocument");function wKs(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=hti(t,r);if(!o)return null;if(o.warnings.forEach(s=>SKs.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(wKs,"parse");function RKs(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 TKs.isDocument(t)&&!n?t.toString(r):new bKs.Document(t,n,r).toString(r)}a(RKs,"stringify");UDe.parse=wKs;UDe.parseAllDocuments=xKs;UDe.parseDocument=hti;UDe.stringify=RKs});var Ati=I(qc=>{"use strict";p();var kKs=Gfr(),PKs=kDe(),DKs=Sfr(),opr=NDe(),NKs=pDe(),AH=Ka(),MKs=fH(),OKs=i0(),BKs=hH(),LKs=mH(),FKs=Out(),UKs=epr(),QKs=rpr(),qKs=ipr(),Fut=mti(),gti=lDe();qc.Composer=kKs.Composer;qc.Document=PKs.Document;qc.Schema=DKs.Schema;qc.YAMLError=opr.YAMLError;qc.YAMLParseError=opr.YAMLParseError;qc.YAMLWarning=opr.YAMLWarning;qc.Alias=NKs.Alias;qc.isAlias=AH.isAlias;qc.isCollection=AH.isCollection;qc.isDocument=AH.isDocument;qc.isMap=AH.isMap;qc.isNode=AH.isNode;qc.isPair=AH.isPair;qc.isScalar=AH.isScalar;qc.isSeq=AH.isSeq;qc.Pair=MKs.Pair;qc.Scalar=OKs.Scalar;qc.YAMLMap=BKs.YAMLMap;qc.YAMLSeq=LKs.YAMLSeq;qc.CST=FKs;qc.Lexer=UKs.Lexer;qc.LineCounter=QKs.LineCounter;qc.Parser=qKs.Parser;qc.parse=Fut.parse;qc.parseAllDocuments=Fut.parseAllDocuments;qc.parseDocument=Fut.parseDocument;qc.stringify=Fut.stringify;qc.visit=gti.visit;qc.visitAsync=gti.visitAsync});var yti=I(Uut=>{"use strict";p();Object.defineProperty(Uut,"__esModule",{value:!0});Uut.FetchCancellationError=void 0;var jKs=Ts(),spr=class extends jKs.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};Uut.FetchCancellationError=spr});var Qs=I(yH=>{"use strict";p();Object.defineProperty(yH,"__esModule",{value:!0});yH.IInstantiationService=yH._util=void 0;yH.createDecorator=Eti;yH.refineServiceDecorator=GKs;var KF;(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})(KF||(yH._util=KF={}));yH.IInstantiationService=Eti("instantiationService");function HKs(t,e,r){e[KF.DI_TARGET]===e?e[KF.DI_DEPENDENCIES].push({id:t,index:r}):(e[KF.DI_DEPENDENCIES]=[{id:t,index:r}],e[KF.DI_TARGET]=e)}a(HKs,"storeServiceDependency");function Eti(t){if(KF.serviceIds.has(t))return KF.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");HKs(e,r,o)},"id");return e.toString=()=>t,KF.serviceIds.set(t,e),e}a(Eti,"createDecorator");function GKs(t){return t}a(GKs,"refineServiceDecorator")});var qut=I(Qut=>{"use strict";p();Object.defineProperty(Qut,"__esModule",{value:!0});Qut.SyncDescriptor=void 0;var apr=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};Qut.SyncDescriptor=apr});var _ti=I(yhe=>{"use strict";p();Object.defineProperty(yhe,"__esModule",{value:!0});yhe.Graph=yhe.Node=void 0;var jut=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};yhe.Node=jut;var cpr=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 jut(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=eut(e),n=zpe(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=eut(e),n=zpe(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())}}};QXn.Parser=Xdr});var $Xn=I(fDe=>{"use strict";p();var qXn=Qdr(),vVs=nDe(),dDe=sDe(),CVs=Fur(),bVs=za(),SVs=Zdr(),jXn=efr();function HXn(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new SVs.LineCounter||null,prettyErrors:e}}a(HXn,"parseOptions");function TVs(t,e={}){let{lineCounter:r,prettyErrors:n}=HXn(e),o=new jXn.Parser(r?.addNewLine),s=new qXn.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(dDe.prettifyError(t,r)),l.warnings.forEach(dDe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(TVs,"parseAllDocuments");function GXn(t,e={}){let{lineCounter:r,prettyErrors:n}=HXn(e),o=new jXn.Parser(r?.addNewLine),s=new qXn.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 dDe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(dDe.prettifyError(t,r)),c.warnings.forEach(dDe.prettifyError(t,r))),c}a(GXn,"parseDocument");function IVs(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=GXn(t,r);if(!o)return null;if(o.warnings.forEach(s=>CVs.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(IVs,"parse");function xVs(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 bVs.isDocument(t)&&!n?t.toString(r):new vVs.Document(t,n,r).toString(r)}a(xVs,"stringify");fDe.parse=IVs;fDe.parseAllDocuments=TVs;fDe.parseDocument=GXn;fDe.stringify=xVs});var WXn=I(Fc=>{"use strict";p();var wVs=Qdr(),RVs=nDe(),PVs=_dr(),tfr=sDe(),kVs=Q2e(),Xj=za(),DVs=zj(),NVs=i0(),MVs=Kj(),OVs=Jj(),BVs=Zlt(),LVs=Kdr(),FVs=Zdr(),UVs=efr(),tut=$Xn(),VXn=B2e();Fc.Composer=wVs.Composer;Fc.Document=RVs.Document;Fc.Schema=PVs.Schema;Fc.YAMLError=tfr.YAMLError;Fc.YAMLParseError=tfr.YAMLParseError;Fc.YAMLWarning=tfr.YAMLWarning;Fc.Alias=kVs.Alias;Fc.isAlias=Xj.isAlias;Fc.isCollection=Xj.isCollection;Fc.isDocument=Xj.isDocument;Fc.isMap=Xj.isMap;Fc.isNode=Xj.isNode;Fc.isPair=Xj.isPair;Fc.isScalar=Xj.isScalar;Fc.isSeq=Xj.isSeq;Fc.Pair=DVs.Pair;Fc.Scalar=NVs.Scalar;Fc.YAMLMap=MVs.YAMLMap;Fc.YAMLSeq=OVs.YAMLSeq;Fc.CST=BVs;Fc.Lexer=LVs.Lexer;Fc.LineCounter=FVs.LineCounter;Fc.Parser=UVs.Parser;Fc.parse=tut.parse;Fc.parseAllDocuments=tut.parseAllDocuments;Fc.parseDocument=tut.parseDocument;Fc.stringify=tut.stringify;Fc.visit=VXn.visit;Fc.visitAsync=VXn.visitAsync});var zXn=I(rut=>{"use strict";p();Object.defineProperty(rut,"__esModule",{value:!0});rut.FetchCancellationError=void 0;var QVs=Cs(),rfr=class extends QVs.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};rut.FetchCancellationError=rfr});var Ls=I(eH=>{"use strict";p();Object.defineProperty(eH,"__esModule",{value:!0});eH.IInstantiationService=eH._util=void 0;eH.createDecorator=YXn;eH.refineServiceDecorator=jVs;var OF;(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})(OF||(eH._util=OF={}));eH.IInstantiationService=YXn("instantiationService");function qVs(t,e,r){e[OF.DI_TARGET]===e?e[OF.DI_DEPENDENCIES].push({id:t,index:r}):(e[OF.DI_DEPENDENCIES]=[{id:t,index:r}],e[OF.DI_TARGET]=e)}a(qVs,"storeServiceDependency");function YXn(t){if(OF.serviceIds.has(t))return OF.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");qVs(e,r,o)},"id");return e.toString=()=>t,OF.serviceIds.set(t,e),e}a(YXn,"createDecorator");function jVs(t){return t}a(jVs,"refineServiceDecorator")});var iut=I(nut=>{"use strict";p();Object.defineProperty(nut,"__esModule",{value:!0});nut.SyncDescriptor=void 0;var nfr=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};nut.SyncDescriptor=nfr});var KXn=I(Ype=>{"use strict";p();Object.defineProperty(Ype,"__esModule",{value:!0});Ype.Graph=Ype.Node=void 0;var sut=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};Ype.Node=sut;var ifr=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 sut(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)}}};yhe.Graph=cpr});var upr=I(Hut=>{"use strict";p();Object.defineProperty(Hut,"__esModule",{value:!0});Hut.ServiceCollection=void 0;var lpr=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)}};Hut.ServiceCollection=lpr});var vti=I(Che=>{"use strict";p();Object.defineProperty(Che,"__esModule",{value:!0});Che.Trace=Che.InstantiationService=void 0;var $Ks=Xc(),VKs=Ts(),dpr=ko(),Ehe=qut(),Cti=_ti(),fpr=Qs(),WKs=upr(),zKs=Ele(),YKs=!1,Gut=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()}`}},ppr=class t{static{a(this,"InstantiationService")}constructor(e=new WKs.ServiceCollection,r=!1,n,o=YKs){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(fpr.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new Cti.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,dpr.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,dpr.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=_he.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,VKs.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 Ehe.SyncDescriptor?(n=_he.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=_he.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=fpr._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 Ehe.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 Ehe.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 Cti.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 Gut(o);for(let d of fpr._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 Ehe.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 Gut(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Ehe.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 Ehe.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 $Ks.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 zKs.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,dpr.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)}};Che.InstantiationService=ppr;var _he=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)}}};Ype.Graph=ifr});var sfr=I(aut=>{"use strict";p();Object.defineProperty(aut,"__esModule",{value:!0});aut.ServiceCollection=void 0;var ofr=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)}};aut.ServiceCollection=ofr});var ZXn=I(Zpe=>{"use strict";p();Object.defineProperty(Zpe,"__esModule",{value:!0});Zpe.Trace=Zpe.InstantiationService=void 0;var HVs=Jc(),GVs=Cs(),afr=wo(),Kpe=iut(),JXn=KXn(),cfr=Ls(),$Vs=sfr(),VVs=Kce(),WVs=!1,cut=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()}`}},lfr=class t{static{a(this,"InstantiationService")}constructor(e=new $Vs.ServiceCollection,r=!1,n,o=WVs){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(cfr.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new JXn.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,afr.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,afr.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=Jpe.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,GVs.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 Kpe.SyncDescriptor?(n=Jpe.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=Jpe.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=cfr._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 Kpe.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 Kpe.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 JXn.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 cut(o);for(let d of cfr._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 Kpe.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 cut(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Kpe.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 Kpe.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 HVs.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 VVs.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,afr.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)}};Zpe.InstantiationService=lfr;var Jpe=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(` -`))}};Che.Trace=_he});var rn=I(vhe=>{"use strict";p();Object.defineProperty(vhe,"__esModule",{value:!0});vhe.InstantiationServiceBuilder=vhe.createServiceIdentifier=void 0;var KKs=Qs();Object.defineProperty(vhe,"createServiceIdentifier",{enumerable:!0,get:a(function(){return KKs.createDecorator},"get")});var JKs=vti(),bti=upr(),hpr=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new bti.ServiceCollection(...e):e??new bti.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 JKs.InstantiationService(this._collection,!0)}};vhe.InstantiationServiceBuilder=hpr});var QDe=I(qw=>{"use strict";p();Object.defineProperty(qw,"__esModule",{value:!0});qw.NullLanguageContextService=qw.TriggerKind=qw.KnownSources=qw.ContextKind=qw.ILanguageContextService=void 0;var ZKs=rn();qw.ILanguageContextService=(0,ZKs.createServiceIdentifier)("ILanguageContextService");var Sti;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(Sti||(qw.ContextKind=Sti={}));var Tti;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(Tti||(qw.KnownSources=Tti={}));var Iti;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(Iti||(qw.TriggerKind=Iti={}));var mpr=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};qw.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new mpr,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var wti=I($ut=>{"use strict";p();Object.defineProperty($ut,"__esModule",{value:!0});$ut.serializeLanguageContext=eJs;$ut.serializeFileDiagnostics=oJs;var XKs=qp(),gpr=QDe();function eJs(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:tJs(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(eJs,"serializeLanguageContext");function tJs(t){switch(t.kind){case gpr.ContextKind.Snippet:return rJs(t);case gpr.ContextKind.Trait:return nJs(t);case gpr.ContextKind.DiagnosticBag:return iJs(t)}}a(tJs,"serializeLanguageContextItem");function rJs(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(rJs,"serializeSnippetContext");function nJs(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(nJs,"serializeTraitContext");function iJs(t){let e=t.values.map(r=>xti(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(iJs,"serializeDiagnosticBagContext");function xti(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 XKs.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(xti,"serializeDiagnostic");function oJs(t){return t.flatMap(([e,r])=>r.map(n=>xti(n,e)))}a(oJs,"serializeFileDiagnostics")});var ypr=I(Apr=>{"use strict";p();Object.defineProperty(Apr,"__esModule",{value:!0});Apr.stringifyChatMessages=sJs;var Vut=wo();function sJs(t){return t.map(aJs).join(` -`)}a(sJs,"stringifyChatMessages");function aJs({role:t,content:e}){if(t!==Vut.Raw.ChatRole.User&&t!==Vut.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===Vut.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==Vut.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} +`))}};Zpe.Trace=Jpe});var rn=I(Xpe=>{"use strict";p();Object.defineProperty(Xpe,"__esModule",{value:!0});Xpe.InstantiationServiceBuilder=Xpe.createServiceIdentifier=void 0;var zVs=Ls();Object.defineProperty(Xpe,"createServiceIdentifier",{enumerable:!0,get:a(function(){return zVs.createDecorator},"get")});var YVs=ZXn(),XXn=sfr(),ufr=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new XXn.ServiceCollection(...e):e??new XXn.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 YVs.InstantiationService(this._collection,!0)}};Xpe.InstantiationServiceBuilder=ufr});var pDe=I(Mw=>{"use strict";p();Object.defineProperty(Mw,"__esModule",{value:!0});Mw.NullLanguageContextService=Mw.TriggerKind=Mw.KnownSources=Mw.ContextKind=Mw.ILanguageContextService=void 0;var KVs=rn();Mw.ILanguageContextService=(0,KVs.createServiceIdentifier)("ILanguageContextService");var eei;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(eei||(Mw.ContextKind=eei={}));var tei;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(tei||(Mw.KnownSources=tei={}));var rei;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(rei||(Mw.TriggerKind=rei={}));var dfr=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};Mw.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new dfr,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var iei=I(lut=>{"use strict";p();Object.defineProperty(lut,"__esModule",{value:!0});lut.serializeLanguageContext=ZVs;lut.serializeFileDiagnostics=nWs;var JVs=jp(),ffr=pDe();function ZVs(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:XVs(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(ZVs,"serializeLanguageContext");function XVs(t){switch(t.kind){case ffr.ContextKind.Snippet:return eWs(t);case ffr.ContextKind.Trait:return tWs(t);case ffr.ContextKind.DiagnosticBag:return rWs(t)}}a(XVs,"serializeLanguageContextItem");function eWs(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(eWs,"serializeSnippetContext");function tWs(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(tWs,"serializeTraitContext");function rWs(t){let e=t.values.map(r=>nei(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(rWs,"serializeDiagnosticBagContext");function nei(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 JVs.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(nei,"serializeDiagnostic");function nWs(t){return t.flatMap(([e,r])=>r.map(n=>nei(n,e)))}a(nWs,"serializeFileDiagnostics")});var hfr=I(pfr=>{"use strict";p();Object.defineProperty(pfr,"__esModule",{value:!0});pfr.stringifyChatMessages=iWs;var uut=Io();function iWs(t){return t.map(oWs).join(` +`)}a(iWs,"stringifyChatMessages");function oWs({role:t,content:e}){if(t!==uut.Raw.ChatRole.User&&t!==uut.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===uut.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==uut.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} ------ ${n.text} -==================`}a(aJs,"stringifyMessage")});var _pr=I(Wut=>{"use strict";p();Object.defineProperty(Wut,"__esModule",{value:!0});Wut.register=lJs;Wut.getCodiconFontCharacters=uJs;var cJs=BS(),Epr=Object.create(null);function lJs(t,e){if((0,cJs.isString)(e)){let r=Epr[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return Epr[t]=e,{id:t}}a(lJs,"register");function uJs(){return Epr}a(uJs,"getCodiconFontCharacters")});var Rti=I(zut=>{"use strict";p();Object.defineProperty(zut,"__esModule",{value:!0});zut.codiconsLibrary=void 0;var $=_pr();zut.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 Cpr=I(JF=>{"use strict";p();Object.defineProperty(JF,"__esModule",{value:!0});JF.Codicon=JF.codiconsDerived=void 0;JF.getAllCodicons=fJs;var jc=_pr(),dJs=Rti();function fJs(){return Object.values(JF.Codicon)}a(fJs,"getAllCodicons");JF.codiconsDerived={dialogError:(0,jc.register)("dialog-error","error"),dialogWarning:(0,jc.register)("dialog-warning","warning"),dialogInfo:(0,jc.register)("dialog-info","info"),dialogClose:(0,jc.register)("dialog-close","close"),treeItemExpanded:(0,jc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,jc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,jc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,jc.register)("tree-filter-clear","close"),treeItemLoading:(0,jc.register)("tree-item-loading","loading"),menuSelection:(0,jc.register)("menu-selection","check"),menuSubmenu:(0,jc.register)("menu-submenu","chevron-right"),menuBarMore:(0,jc.register)("menubar-more","more"),scrollbarButtonLeft:(0,jc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,jc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,jc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,jc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,jc.register)("toolbar-more","more"),quickInputBack:(0,jc.register)("quick-input-back","arrow-left"),dropDownButton:(0,jc.register)("drop-down-button",60084),symbolCustomColor:(0,jc.register)("symbol-customcolor",60252),exportIcon:(0,jc.register)("export",60332),workspaceUnspecified:(0,jc.register)("workspace-unspecified",60355),newLine:(0,jc.register)("newline",60394),thumbsDownFilled:(0,jc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,jc.register)("thumbsup-filled",60436),gitFetch:(0,jc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,jc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,jc.register)("debug-breakpoint-pending",60377),chatImport:(0,jc.register)("chat-import",60550),chatExport:(0,jc.register)("chat-export",60551)};JF.Codicon={...dJs.codiconsLibrary,...JF.codiconsDerived}});var Spr=I(CX=>{"use strict";p();Object.defineProperty(CX,"__esModule",{value:!0});CX.ThemeIcon=CX.ThemeColor=void 0;CX.themeColorFromId=pJs;var vpr=Cpr(),bpr;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(bpr||(CX.ThemeColor=bpr={}));function pJs(t){return{id:t}}a(pJs,"themeColorFromId");var kti;(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(vpr.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"||bpr.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===vpr.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===vpr.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(kti||(CX.ThemeIcon=kti={}))});var qDe=I(EH=>{"use strict";p();Object.defineProperty(EH,"__esModule",{value:!0});EH.Icon=void 0;EH.overrideNowValue=hJs;EH.now=mJs;EH.shortenOpportunityId=gJs;EH.checkIfCursorAtEndOfLine=AJs;var ZF=Spr(),Tpr=-1;function hJs(t){Tpr=t}a(hJs,"overrideNowValue");function mJs(){return Tpr!==-1?Tpr:Date.now()}a(mJs,"now");var Pti;(function(t){t.circleSlash={themeIcon:ZF.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:ZF.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:ZF.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:ZF.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:ZF.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:ZF.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:ZF.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:ZF.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:ZF.ThemeIcon.fromId("thumbsdown"),svg:''}})(Pti||(EH.Icon=Pti={}));function gJs(t){return t.substring(4,8)}a(gJs,"shortenOpportunityId");function AJs(t,e){return t.substring(e).match(/^\s*$/)!==null}a(AJs,"checkIfCursorAtEndOfLine")});var Kut=I(j5=>{"use strict";p();var yJs=j5&&j5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EJs=j5&&j5.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_Js=j5&&j5.__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(dut,"__esModule",{value:!0});dut.register=aWs;dut.getCodiconFontCharacters=cWs;var sWs=RS(),mfr=Object.create(null);function aWs(t,e){if((0,sWs.isString)(e)){let r=mfr[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return mfr[t]=e,{id:t}}a(aWs,"register");function cWs(){return mfr}a(cWs,"getCodiconFontCharacters")});var oei=I(fut=>{"use strict";p();Object.defineProperty(fut,"__esModule",{value:!0});fut.codiconsLibrary=void 0;var V=gfr();fut.codiconsLibrary={add:(0,V.register)("add",6e4),plus:(0,V.register)("plus",6e4),gistNew:(0,V.register)("gist-new",6e4),repoCreate:(0,V.register)("repo-create",6e4),lightbulb:(0,V.register)("lightbulb",60001),lightBulb:(0,V.register)("light-bulb",60001),repo:(0,V.register)("repo",60002),repoDelete:(0,V.register)("repo-delete",60002),gistFork:(0,V.register)("gist-fork",60003),repoForked:(0,V.register)("repo-forked",60003),gitPullRequest:(0,V.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,V.register)("git-pull-request-abandoned",60004),recordKeys:(0,V.register)("record-keys",60005),keyboard:(0,V.register)("keyboard",60005),tag:(0,V.register)("tag",60006),gitPullRequestLabel:(0,V.register)("git-pull-request-label",60006),tagAdd:(0,V.register)("tag-add",60006),tagRemove:(0,V.register)("tag-remove",60006),person:(0,V.register)("person",60007),personFollow:(0,V.register)("person-follow",60007),personOutline:(0,V.register)("person-outline",60007),personFilled:(0,V.register)("person-filled",60007),sourceControl:(0,V.register)("source-control",60008),mirror:(0,V.register)("mirror",60009),mirrorPublic:(0,V.register)("mirror-public",60009),star:(0,V.register)("star",60010),starAdd:(0,V.register)("star-add",60010),starDelete:(0,V.register)("star-delete",60010),starEmpty:(0,V.register)("star-empty",60010),comment:(0,V.register)("comment",60011),commentAdd:(0,V.register)("comment-add",60011),alert:(0,V.register)("alert",60012),warning:(0,V.register)("warning",60012),search:(0,V.register)("search",60013),searchSave:(0,V.register)("search-save",60013),logOut:(0,V.register)("log-out",60014),signOut:(0,V.register)("sign-out",60014),logIn:(0,V.register)("log-in",60015),signIn:(0,V.register)("sign-in",60015),eye:(0,V.register)("eye",60016),eyeUnwatch:(0,V.register)("eye-unwatch",60016),eyeWatch:(0,V.register)("eye-watch",60016),circleFilled:(0,V.register)("circle-filled",60017),primitiveDot:(0,V.register)("primitive-dot",60017),closeDirty:(0,V.register)("close-dirty",60017),debugBreakpoint:(0,V.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,V.register)("debug-breakpoint-disabled",60017),debugHint:(0,V.register)("debug-hint",60017),terminalDecorationSuccess:(0,V.register)("terminal-decoration-success",60017),primitiveSquare:(0,V.register)("primitive-square",60018),edit:(0,V.register)("edit",60019),pencil:(0,V.register)("pencil",60019),info:(0,V.register)("info",60020),issueOpened:(0,V.register)("issue-opened",60020),gistPrivate:(0,V.register)("gist-private",60021),gitForkPrivate:(0,V.register)("git-fork-private",60021),lock:(0,V.register)("lock",60021),mirrorPrivate:(0,V.register)("mirror-private",60021),close:(0,V.register)("close",60022),removeClose:(0,V.register)("remove-close",60022),x:(0,V.register)("x",60022),repoSync:(0,V.register)("repo-sync",60023),sync:(0,V.register)("sync",60023),clone:(0,V.register)("clone",60024),desktopDownload:(0,V.register)("desktop-download",60024),beaker:(0,V.register)("beaker",60025),microscope:(0,V.register)("microscope",60025),vm:(0,V.register)("vm",60026),deviceDesktop:(0,V.register)("device-desktop",60026),file:(0,V.register)("file",60027),more:(0,V.register)("more",60028),ellipsis:(0,V.register)("ellipsis",60028),kebabHorizontal:(0,V.register)("kebab-horizontal",60028),mailReply:(0,V.register)("mail-reply",60029),reply:(0,V.register)("reply",60029),organization:(0,V.register)("organization",60030),organizationFilled:(0,V.register)("organization-filled",60030),organizationOutline:(0,V.register)("organization-outline",60030),newFile:(0,V.register)("new-file",60031),fileAdd:(0,V.register)("file-add",60031),newFolder:(0,V.register)("new-folder",60032),fileDirectoryCreate:(0,V.register)("file-directory-create",60032),trash:(0,V.register)("trash",60033),trashcan:(0,V.register)("trashcan",60033),history:(0,V.register)("history",60034),clock:(0,V.register)("clock",60034),folder:(0,V.register)("folder",60035),fileDirectory:(0,V.register)("file-directory",60035),symbolFolder:(0,V.register)("symbol-folder",60035),logoGithub:(0,V.register)("logo-github",60036),markGithub:(0,V.register)("mark-github",60036),github:(0,V.register)("github",60036),terminal:(0,V.register)("terminal",60037),console:(0,V.register)("console",60037),repl:(0,V.register)("repl",60037),zap:(0,V.register)("zap",60038),symbolEvent:(0,V.register)("symbol-event",60038),error:(0,V.register)("error",60039),stop:(0,V.register)("stop",60039),variable:(0,V.register)("variable",60040),symbolVariable:(0,V.register)("symbol-variable",60040),array:(0,V.register)("array",60042),symbolArray:(0,V.register)("symbol-array",60042),symbolModule:(0,V.register)("symbol-module",60043),symbolPackage:(0,V.register)("symbol-package",60043),symbolNamespace:(0,V.register)("symbol-namespace",60043),symbolObject:(0,V.register)("symbol-object",60043),symbolMethod:(0,V.register)("symbol-method",60044),symbolFunction:(0,V.register)("symbol-function",60044),symbolConstructor:(0,V.register)("symbol-constructor",60044),symbolBoolean:(0,V.register)("symbol-boolean",60047),symbolNull:(0,V.register)("symbol-null",60047),symbolNumeric:(0,V.register)("symbol-numeric",60048),symbolNumber:(0,V.register)("symbol-number",60048),symbolStructure:(0,V.register)("symbol-structure",60049),symbolStruct:(0,V.register)("symbol-struct",60049),symbolParameter:(0,V.register)("symbol-parameter",60050),symbolTypeParameter:(0,V.register)("symbol-type-parameter",60050),symbolKey:(0,V.register)("symbol-key",60051),symbolText:(0,V.register)("symbol-text",60051),symbolReference:(0,V.register)("symbol-reference",60052),goToFile:(0,V.register)("go-to-file",60052),symbolEnum:(0,V.register)("symbol-enum",60053),symbolValue:(0,V.register)("symbol-value",60053),symbolRuler:(0,V.register)("symbol-ruler",60054),symbolUnit:(0,V.register)("symbol-unit",60054),activateBreakpoints:(0,V.register)("activate-breakpoints",60055),archive:(0,V.register)("archive",60056),arrowBoth:(0,V.register)("arrow-both",60057),arrowDown:(0,V.register)("arrow-down",60058),arrowLeft:(0,V.register)("arrow-left",60059),arrowRight:(0,V.register)("arrow-right",60060),arrowSmallDown:(0,V.register)("arrow-small-down",60061),arrowSmallLeft:(0,V.register)("arrow-small-left",60062),arrowSmallRight:(0,V.register)("arrow-small-right",60063),arrowSmallUp:(0,V.register)("arrow-small-up",60064),arrowUp:(0,V.register)("arrow-up",60065),bell:(0,V.register)("bell",60066),bold:(0,V.register)("bold",60067),book:(0,V.register)("book",60068),bookmark:(0,V.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,V.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,V.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,V.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,V.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,V.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,V.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,V.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,V.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,V.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,V.register)("briefcase",60076),broadcast:(0,V.register)("broadcast",60077),browser:(0,V.register)("browser",60078),bug:(0,V.register)("bug",60079),calendar:(0,V.register)("calendar",60080),caseSensitive:(0,V.register)("case-sensitive",60081),check:(0,V.register)("check",60082),checklist:(0,V.register)("checklist",60083),chevronDown:(0,V.register)("chevron-down",60084),chevronLeft:(0,V.register)("chevron-left",60085),chevronRight:(0,V.register)("chevron-right",60086),chevronUp:(0,V.register)("chevron-up",60087),chromeClose:(0,V.register)("chrome-close",60088),chromeMaximize:(0,V.register)("chrome-maximize",60089),chromeMinimize:(0,V.register)("chrome-minimize",60090),chromeRestore:(0,V.register)("chrome-restore",60091),circleOutline:(0,V.register)("circle-outline",60092),circle:(0,V.register)("circle",60092),debugBreakpointUnverified:(0,V.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,V.register)("terminal-decoration-incomplete",60092),circleSlash:(0,V.register)("circle-slash",60093),circuitBoard:(0,V.register)("circuit-board",60094),clearAll:(0,V.register)("clear-all",60095),clippy:(0,V.register)("clippy",60096),closeAll:(0,V.register)("close-all",60097),cloudDownload:(0,V.register)("cloud-download",60098),cloudUpload:(0,V.register)("cloud-upload",60099),code:(0,V.register)("code",60100),collapseAll:(0,V.register)("collapse-all",60101),colorMode:(0,V.register)("color-mode",60102),commentDiscussion:(0,V.register)("comment-discussion",60103),creditCard:(0,V.register)("credit-card",60105),dash:(0,V.register)("dash",60108),dashboard:(0,V.register)("dashboard",60109),database:(0,V.register)("database",60110),debugContinue:(0,V.register)("debug-continue",60111),debugDisconnect:(0,V.register)("debug-disconnect",60112),debugPause:(0,V.register)("debug-pause",60113),debugRestart:(0,V.register)("debug-restart",60114),debugStart:(0,V.register)("debug-start",60115),debugStepInto:(0,V.register)("debug-step-into",60116),debugStepOut:(0,V.register)("debug-step-out",60117),debugStepOver:(0,V.register)("debug-step-over",60118),debugStop:(0,V.register)("debug-stop",60119),debug:(0,V.register)("debug",60120),deviceCameraVideo:(0,V.register)("device-camera-video",60121),deviceCamera:(0,V.register)("device-camera",60122),deviceMobile:(0,V.register)("device-mobile",60123),diffAdded:(0,V.register)("diff-added",60124),diffIgnored:(0,V.register)("diff-ignored",60125),diffModified:(0,V.register)("diff-modified",60126),diffRemoved:(0,V.register)("diff-removed",60127),diffRenamed:(0,V.register)("diff-renamed",60128),diff:(0,V.register)("diff",60129),diffSidebyside:(0,V.register)("diff-sidebyside",60129),discard:(0,V.register)("discard",60130),editorLayout:(0,V.register)("editor-layout",60131),emptyWindow:(0,V.register)("empty-window",60132),exclude:(0,V.register)("exclude",60133),extensions:(0,V.register)("extensions",60134),eyeClosed:(0,V.register)("eye-closed",60135),fileBinary:(0,V.register)("file-binary",60136),fileCode:(0,V.register)("file-code",60137),fileMedia:(0,V.register)("file-media",60138),filePdf:(0,V.register)("file-pdf",60139),fileSubmodule:(0,V.register)("file-submodule",60140),fileSymlinkDirectory:(0,V.register)("file-symlink-directory",60141),fileSymlinkFile:(0,V.register)("file-symlink-file",60142),fileZip:(0,V.register)("file-zip",60143),files:(0,V.register)("files",60144),filter:(0,V.register)("filter",60145),flame:(0,V.register)("flame",60146),foldDown:(0,V.register)("fold-down",60147),foldUp:(0,V.register)("fold-up",60148),fold:(0,V.register)("fold",60149),folderActive:(0,V.register)("folder-active",60150),folderOpened:(0,V.register)("folder-opened",60151),gear:(0,V.register)("gear",60152),gift:(0,V.register)("gift",60153),gistSecret:(0,V.register)("gist-secret",60154),gist:(0,V.register)("gist",60155),gitCommit:(0,V.register)("git-commit",60156),gitCompare:(0,V.register)("git-compare",60157),compareChanges:(0,V.register)("compare-changes",60157),gitMerge:(0,V.register)("git-merge",60158),githubAction:(0,V.register)("github-action",60159),githubAlt:(0,V.register)("github-alt",60160),globe:(0,V.register)("globe",60161),grabber:(0,V.register)("grabber",60162),graph:(0,V.register)("graph",60163),gripper:(0,V.register)("gripper",60164),heart:(0,V.register)("heart",60165),home:(0,V.register)("home",60166),horizontalRule:(0,V.register)("horizontal-rule",60167),hubot:(0,V.register)("hubot",60168),inbox:(0,V.register)("inbox",60169),issueReopened:(0,V.register)("issue-reopened",60171),issues:(0,V.register)("issues",60172),italic:(0,V.register)("italic",60173),jersey:(0,V.register)("jersey",60174),json:(0,V.register)("json",60175),bracket:(0,V.register)("bracket",60175),kebabVertical:(0,V.register)("kebab-vertical",60176),key:(0,V.register)("key",60177),law:(0,V.register)("law",60178),lightbulbAutofix:(0,V.register)("lightbulb-autofix",60179),linkExternal:(0,V.register)("link-external",60180),link:(0,V.register)("link",60181),listOrdered:(0,V.register)("list-ordered",60182),listUnordered:(0,V.register)("list-unordered",60183),liveShare:(0,V.register)("live-share",60184),loading:(0,V.register)("loading",60185),location:(0,V.register)("location",60186),mailRead:(0,V.register)("mail-read",60187),mail:(0,V.register)("mail",60188),markdown:(0,V.register)("markdown",60189),megaphone:(0,V.register)("megaphone",60190),mention:(0,V.register)("mention",60191),milestone:(0,V.register)("milestone",60192),gitPullRequestMilestone:(0,V.register)("git-pull-request-milestone",60192),mortarBoard:(0,V.register)("mortar-board",60193),move:(0,V.register)("move",60194),multipleWindows:(0,V.register)("multiple-windows",60195),mute:(0,V.register)("mute",60196),noNewline:(0,V.register)("no-newline",60197),note:(0,V.register)("note",60198),octoface:(0,V.register)("octoface",60199),openPreview:(0,V.register)("open-preview",60200),package:(0,V.register)("package",60201),paintcan:(0,V.register)("paintcan",60202),pin:(0,V.register)("pin",60203),play:(0,V.register)("play",60204),run:(0,V.register)("run",60204),plug:(0,V.register)("plug",60205),preserveCase:(0,V.register)("preserve-case",60206),preview:(0,V.register)("preview",60207),project:(0,V.register)("project",60208),pulse:(0,V.register)("pulse",60209),question:(0,V.register)("question",60210),quote:(0,V.register)("quote",60211),radioTower:(0,V.register)("radio-tower",60212),reactions:(0,V.register)("reactions",60213),references:(0,V.register)("references",60214),refresh:(0,V.register)("refresh",60215),regex:(0,V.register)("regex",60216),remoteExplorer:(0,V.register)("remote-explorer",60217),remote:(0,V.register)("remote",60218),remove:(0,V.register)("remove",60219),replaceAll:(0,V.register)("replace-all",60220),replace:(0,V.register)("replace",60221),repoClone:(0,V.register)("repo-clone",60222),repoForcePush:(0,V.register)("repo-force-push",60223),repoPull:(0,V.register)("repo-pull",60224),repoPush:(0,V.register)("repo-push",60225),report:(0,V.register)("report",60226),requestChanges:(0,V.register)("request-changes",60227),rocket:(0,V.register)("rocket",60228),rootFolderOpened:(0,V.register)("root-folder-opened",60229),rootFolder:(0,V.register)("root-folder",60230),rss:(0,V.register)("rss",60231),ruby:(0,V.register)("ruby",60232),saveAll:(0,V.register)("save-all",60233),saveAs:(0,V.register)("save-as",60234),save:(0,V.register)("save",60235),screenFull:(0,V.register)("screen-full",60236),screenNormal:(0,V.register)("screen-normal",60237),searchStop:(0,V.register)("search-stop",60238),server:(0,V.register)("server",60240),settingsGear:(0,V.register)("settings-gear",60241),settings:(0,V.register)("settings",60242),shield:(0,V.register)("shield",60243),smiley:(0,V.register)("smiley",60244),sortPrecedence:(0,V.register)("sort-precedence",60245),splitHorizontal:(0,V.register)("split-horizontal",60246),splitVertical:(0,V.register)("split-vertical",60247),squirrel:(0,V.register)("squirrel",60248),starFull:(0,V.register)("star-full",60249),starHalf:(0,V.register)("star-half",60250),symbolClass:(0,V.register)("symbol-class",60251),symbolColor:(0,V.register)("symbol-color",60252),symbolConstant:(0,V.register)("symbol-constant",60253),symbolEnumMember:(0,V.register)("symbol-enum-member",60254),symbolField:(0,V.register)("symbol-field",60255),symbolFile:(0,V.register)("symbol-file",60256),symbolInterface:(0,V.register)("symbol-interface",60257),symbolKeyword:(0,V.register)("symbol-keyword",60258),symbolMisc:(0,V.register)("symbol-misc",60259),symbolOperator:(0,V.register)("symbol-operator",60260),symbolProperty:(0,V.register)("symbol-property",60261),wrench:(0,V.register)("wrench",60261),wrenchSubaction:(0,V.register)("wrench-subaction",60261),symbolSnippet:(0,V.register)("symbol-snippet",60262),tasklist:(0,V.register)("tasklist",60263),telescope:(0,V.register)("telescope",60264),textSize:(0,V.register)("text-size",60265),threeBars:(0,V.register)("three-bars",60266),thumbsdown:(0,V.register)("thumbsdown",60267),thumbsup:(0,V.register)("thumbsup",60268),tools:(0,V.register)("tools",60269),triangleDown:(0,V.register)("triangle-down",60270),triangleLeft:(0,V.register)("triangle-left",60271),triangleRight:(0,V.register)("triangle-right",60272),triangleUp:(0,V.register)("triangle-up",60273),twitter:(0,V.register)("twitter",60274),unfold:(0,V.register)("unfold",60275),unlock:(0,V.register)("unlock",60276),unmute:(0,V.register)("unmute",60277),unverified:(0,V.register)("unverified",60278),verified:(0,V.register)("verified",60279),versions:(0,V.register)("versions",60280),vmActive:(0,V.register)("vm-active",60281),vmOutline:(0,V.register)("vm-outline",60282),vmRunning:(0,V.register)("vm-running",60283),watch:(0,V.register)("watch",60284),whitespace:(0,V.register)("whitespace",60285),wholeWord:(0,V.register)("whole-word",60286),window:(0,V.register)("window",60287),wordWrap:(0,V.register)("word-wrap",60288),zoomIn:(0,V.register)("zoom-in",60289),zoomOut:(0,V.register)("zoom-out",60290),listFilter:(0,V.register)("list-filter",60291),listFlat:(0,V.register)("list-flat",60292),listSelection:(0,V.register)("list-selection",60293),selection:(0,V.register)("selection",60293),listTree:(0,V.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,V.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,V.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,V.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,V.register)("debug-stackframe-active",60297),circleSmallFilled:(0,V.register)("circle-small-filled",60298),debugStackframeDot:(0,V.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,V.register)("terminal-decoration-mark",60298),debugStackframe:(0,V.register)("debug-stackframe",60299),debugStackframeFocused:(0,V.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,V.register)("debug-breakpoint-unsupported",60300),symbolString:(0,V.register)("symbol-string",60301),debugReverseContinue:(0,V.register)("debug-reverse-continue",60302),debugStepBack:(0,V.register)("debug-step-back",60303),debugRestartFrame:(0,V.register)("debug-restart-frame",60304),debugAlt:(0,V.register)("debug-alt",60305),callIncoming:(0,V.register)("call-incoming",60306),callOutgoing:(0,V.register)("call-outgoing",60307),menu:(0,V.register)("menu",60308),expandAll:(0,V.register)("expand-all",60309),feedback:(0,V.register)("feedback",60310),gitPullRequestReviewer:(0,V.register)("git-pull-request-reviewer",60310),groupByRefType:(0,V.register)("group-by-ref-type",60311),ungroupByRefType:(0,V.register)("ungroup-by-ref-type",60312),account:(0,V.register)("account",60313),gitPullRequestAssignee:(0,V.register)("git-pull-request-assignee",60313),bellDot:(0,V.register)("bell-dot",60314),debugConsole:(0,V.register)("debug-console",60315),library:(0,V.register)("library",60316),output:(0,V.register)("output",60317),runAll:(0,V.register)("run-all",60318),syncIgnored:(0,V.register)("sync-ignored",60319),pinned:(0,V.register)("pinned",60320),githubInverted:(0,V.register)("github-inverted",60321),serverProcess:(0,V.register)("server-process",60322),serverEnvironment:(0,V.register)("server-environment",60323),pass:(0,V.register)("pass",60324),issueClosed:(0,V.register)("issue-closed",60324),stopCircle:(0,V.register)("stop-circle",60325),playCircle:(0,V.register)("play-circle",60326),record:(0,V.register)("record",60327),debugAltSmall:(0,V.register)("debug-alt-small",60328),vmConnect:(0,V.register)("vm-connect",60329),cloud:(0,V.register)("cloud",60330),merge:(0,V.register)("merge",60331),export:(0,V.register)("export",60332),graphLeft:(0,V.register)("graph-left",60333),magnet:(0,V.register)("magnet",60334),notebook:(0,V.register)("notebook",60335),redo:(0,V.register)("redo",60336),checkAll:(0,V.register)("check-all",60337),pinnedDirty:(0,V.register)("pinned-dirty",60338),passFilled:(0,V.register)("pass-filled",60339),circleLargeFilled:(0,V.register)("circle-large-filled",60340),circleLarge:(0,V.register)("circle-large",60341),circleLargeOutline:(0,V.register)("circle-large-outline",60341),combine:(0,V.register)("combine",60342),gather:(0,V.register)("gather",60342),table:(0,V.register)("table",60343),variableGroup:(0,V.register)("variable-group",60344),typeHierarchy:(0,V.register)("type-hierarchy",60345),typeHierarchySub:(0,V.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,V.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,V.register)("git-pull-request-create",60348),runAbove:(0,V.register)("run-above",60349),runBelow:(0,V.register)("run-below",60350),notebookTemplate:(0,V.register)("notebook-template",60351),debugRerun:(0,V.register)("debug-rerun",60352),workspaceTrusted:(0,V.register)("workspace-trusted",60353),workspaceUntrusted:(0,V.register)("workspace-untrusted",60354),workspaceUnknown:(0,V.register)("workspace-unknown",60355),terminalCmd:(0,V.register)("terminal-cmd",60356),terminalDebian:(0,V.register)("terminal-debian",60357),terminalLinux:(0,V.register)("terminal-linux",60358),terminalPowershell:(0,V.register)("terminal-powershell",60359),terminalTmux:(0,V.register)("terminal-tmux",60360),terminalUbuntu:(0,V.register)("terminal-ubuntu",60361),terminalBash:(0,V.register)("terminal-bash",60362),arrowSwap:(0,V.register)("arrow-swap",60363),copy:(0,V.register)("copy",60364),personAdd:(0,V.register)("person-add",60365),filterFilled:(0,V.register)("filter-filled",60366),wand:(0,V.register)("wand",60367),debugLineByLine:(0,V.register)("debug-line-by-line",60368),inspect:(0,V.register)("inspect",60369),layers:(0,V.register)("layers",60370),layersDot:(0,V.register)("layers-dot",60371),layersActive:(0,V.register)("layers-active",60372),compass:(0,V.register)("compass",60373),compassDot:(0,V.register)("compass-dot",60374),compassActive:(0,V.register)("compass-active",60375),azure:(0,V.register)("azure",60376),issueDraft:(0,V.register)("issue-draft",60377),gitPullRequestClosed:(0,V.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,V.register)("git-pull-request-draft",60379),debugAll:(0,V.register)("debug-all",60380),debugCoverage:(0,V.register)("debug-coverage",60381),runErrors:(0,V.register)("run-errors",60382),folderLibrary:(0,V.register)("folder-library",60383),debugContinueSmall:(0,V.register)("debug-continue-small",60384),beakerStop:(0,V.register)("beaker-stop",60385),graphLine:(0,V.register)("graph-line",60386),graphScatter:(0,V.register)("graph-scatter",60387),pieChart:(0,V.register)("pie-chart",60388),bracketDot:(0,V.register)("bracket-dot",60389),bracketError:(0,V.register)("bracket-error",60390),lockSmall:(0,V.register)("lock-small",60391),azureDevops:(0,V.register)("azure-devops",60392),verifiedFilled:(0,V.register)("verified-filled",60393),newline:(0,V.register)("newline",60394),layout:(0,V.register)("layout",60395),layoutActivitybarLeft:(0,V.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,V.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,V.register)("layout-panel-left",60398),layoutPanelCenter:(0,V.register)("layout-panel-center",60399),layoutPanelJustify:(0,V.register)("layout-panel-justify",60400),layoutPanelRight:(0,V.register)("layout-panel-right",60401),layoutPanel:(0,V.register)("layout-panel",60402),layoutSidebarLeft:(0,V.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,V.register)("layout-sidebar-right",60404),layoutStatusbar:(0,V.register)("layout-statusbar",60405),layoutMenubar:(0,V.register)("layout-menubar",60406),layoutCentered:(0,V.register)("layout-centered",60407),target:(0,V.register)("target",60408),indent:(0,V.register)("indent",60409),recordSmall:(0,V.register)("record-small",60410),errorSmall:(0,V.register)("error-small",60411),terminalDecorationError:(0,V.register)("terminal-decoration-error",60411),arrowCircleDown:(0,V.register)("arrow-circle-down",60412),arrowCircleLeft:(0,V.register)("arrow-circle-left",60413),arrowCircleRight:(0,V.register)("arrow-circle-right",60414),arrowCircleUp:(0,V.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,V.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,V.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,V.register)("layout-sidebar-left-off",60418),blank:(0,V.register)("blank",60419),heartFilled:(0,V.register)("heart-filled",60420),map:(0,V.register)("map",60421),mapHorizontal:(0,V.register)("map-horizontal",60421),foldHorizontal:(0,V.register)("fold-horizontal",60421),mapFilled:(0,V.register)("map-filled",60422),mapHorizontalFilled:(0,V.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,V.register)("fold-horizontal-filled",60422),circleSmall:(0,V.register)("circle-small",60423),bellSlash:(0,V.register)("bell-slash",60424),bellSlashDot:(0,V.register)("bell-slash-dot",60425),commentUnresolved:(0,V.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,V.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,V.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,V.register)("search-fuzzy",60429),commentDraft:(0,V.register)("comment-draft",60430),send:(0,V.register)("send",60431),sparkle:(0,V.register)("sparkle",60432),insert:(0,V.register)("insert",60433),mic:(0,V.register)("mic",60434),thumbsdownFilled:(0,V.register)("thumbsdown-filled",60435),thumbsupFilled:(0,V.register)("thumbsup-filled",60436),coffee:(0,V.register)("coffee",60437),snake:(0,V.register)("snake",60438),game:(0,V.register)("game",60439),vr:(0,V.register)("vr",60440),chip:(0,V.register)("chip",60441),piano:(0,V.register)("piano",60442),music:(0,V.register)("music",60443),micFilled:(0,V.register)("mic-filled",60444),repoFetch:(0,V.register)("repo-fetch",60445),copilot:(0,V.register)("copilot",60446),lightbulbSparkle:(0,V.register)("lightbulb-sparkle",60447),robot:(0,V.register)("robot",60448),sparkleFilled:(0,V.register)("sparkle-filled",60449),diffSingle:(0,V.register)("diff-single",60450),diffMultiple:(0,V.register)("diff-multiple",60451),surroundWith:(0,V.register)("surround-with",60452),share:(0,V.register)("share",60453),gitStash:(0,V.register)("git-stash",60454),gitStashApply:(0,V.register)("git-stash-apply",60455),gitStashPop:(0,V.register)("git-stash-pop",60456),vscode:(0,V.register)("vscode",60457),vscodeInsiders:(0,V.register)("vscode-insiders",60458),codeOss:(0,V.register)("code-oss",60459),runCoverage:(0,V.register)("run-coverage",60460),runAllCoverage:(0,V.register)("run-all-coverage",60461),coverage:(0,V.register)("coverage",60462),githubProject:(0,V.register)("github-project",60463),mapVertical:(0,V.register)("map-vertical",60464),foldVertical:(0,V.register)("fold-vertical",60464),mapVerticalFilled:(0,V.register)("map-vertical-filled",60465),foldVerticalFilled:(0,V.register)("fold-vertical-filled",60465),goToSearch:(0,V.register)("go-to-search",60466),percentage:(0,V.register)("percentage",60467),sortPercentage:(0,V.register)("sort-percentage",60467),attach:(0,V.register)("attach",60468),goToEditingSession:(0,V.register)("go-to-editing-session",60469),editSession:(0,V.register)("edit-session",60470),codeReview:(0,V.register)("code-review",60471),copilotWarning:(0,V.register)("copilot-warning",60472),python:(0,V.register)("python",60473),copilotLarge:(0,V.register)("copilot-large",60474),copilotWarningLarge:(0,V.register)("copilot-warning-large",60475),keyboardTab:(0,V.register)("keyboard-tab",60476),copilotBlocked:(0,V.register)("copilot-blocked",60477),copilotNotConnected:(0,V.register)("copilot-not-connected",60478),flag:(0,V.register)("flag",60479),lightbulbEmpty:(0,V.register)("lightbulb-empty",60480),symbolMethodArrow:(0,V.register)("symbol-method-arrow",60481),copilotUnavailable:(0,V.register)("copilot-unavailable",60482),repoPinned:(0,V.register)("repo-pinned",60483),keyboardTabAbove:(0,V.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,V.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,V.register)("git-pull-request-done",60486),mcp:(0,V.register)("mcp",60487),extensionsLarge:(0,V.register)("extensions-large",60488),layoutPanelDock:(0,V.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,V.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,V.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,V.register)("copilot-in-progress",60492),copilotError:(0,V.register)("copilot-error",60493),copilotSuccess:(0,V.register)("copilot-success",60494),chatSparkle:(0,V.register)("chat-sparkle",60495),searchSparkle:(0,V.register)("search-sparkle",60496),editSparkle:(0,V.register)("edit-sparkle",60497),copilotSnooze:(0,V.register)("copilot-snooze",60498),sendToRemoteAgent:(0,V.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,V.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,V.register)("chat-sparkle-warning",60501),chatSparkleError:(0,V.register)("chat-sparkle-error",60502),collection:(0,V.register)("collection",60503),newCollection:(0,V.register)("new-collection",60504),thinking:(0,V.register)("thinking",60505),build:(0,V.register)("build",60506),commentDiscussionQuote:(0,V.register)("comment-discussion-quote",60507),cursor:(0,V.register)("cursor",60508),eraser:(0,V.register)("eraser",60509),fileText:(0,V.register)("file-text",60510),quotes:(0,V.register)("quotes",60512),rename:(0,V.register)("rename",60513),runWithDeps:(0,V.register)("run-with-deps",60514),debugConnected:(0,V.register)("debug-connected",60515),strikethrough:(0,V.register)("strikethrough",60516),openInProduct:(0,V.register)("open-in-product",60517),indexZero:(0,V.register)("index-zero",60518),agent:(0,V.register)("agent",60519),editCode:(0,V.register)("edit-code",60520),repoSelected:(0,V.register)("repo-selected",60521),skip:(0,V.register)("skip",60522),mergeInto:(0,V.register)("merge-into",60523),gitBranchChanges:(0,V.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,V.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,V.register)("git-branch-conflicts",60526),gitBranch:(0,V.register)("git-branch",60527),gitBranchCreate:(0,V.register)("git-branch-create",60527),gitBranchDelete:(0,V.register)("git-branch-delete",60527),searchLarge:(0,V.register)("search-large",60528),terminalGitBash:(0,V.register)("terminal-git-bash",60529),windowActive:(0,V.register)("window-active",60530),forward:(0,V.register)("forward",60531),download:(0,V.register)("download",60532),clockface:(0,V.register)("clockface",60533),unarchive:(0,V.register)("unarchive",60534),sessionInProgress:(0,V.register)("session-in-progress",60535),collectionSmall:(0,V.register)("collection-small",60536),vmSmall:(0,V.register)("vm-small",60537),cloudSmall:(0,V.register)("cloud-small",60538),addSmall:(0,V.register)("add-small",60539),removeSmall:(0,V.register)("remove-small",60540),worktreeSmall:(0,V.register)("worktree-small",60541),worktree:(0,V.register)("worktree",60542),screenCut:(0,V.register)("screen-cut",60543),ask:(0,V.register)("ask",60544),openai:(0,V.register)("openai",60545),claude:(0,V.register)("claude",60546),openInWindow:(0,V.register)("open-in-window",60547),newSession:(0,V.register)("new-session",60548),terminalSecure:(0,V.register)("terminal-secure",60549),chatImport:(0,V.register)("chat-import",60550),chatExport:(0,V.register)("chat-export",60551),shareWindow:(0,V.register)("share-window",60552)}});var Afr=I(BF=>{"use strict";p();Object.defineProperty(BF,"__esModule",{value:!0});BF.Codicon=BF.codiconsDerived=void 0;BF.getAllCodicons=uWs;var Uc=gfr(),lWs=oei();function uWs(){return Object.values(BF.Codicon)}a(uWs,"getAllCodicons");BF.codiconsDerived={dialogError:(0,Uc.register)("dialog-error","error"),dialogWarning:(0,Uc.register)("dialog-warning","warning"),dialogInfo:(0,Uc.register)("dialog-info","info"),dialogClose:(0,Uc.register)("dialog-close","close"),treeItemExpanded:(0,Uc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Uc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Uc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Uc.register)("tree-filter-clear","close"),treeItemLoading:(0,Uc.register)("tree-item-loading","loading"),menuSelection:(0,Uc.register)("menu-selection","check"),menuSubmenu:(0,Uc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Uc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Uc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Uc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Uc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Uc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Uc.register)("toolbar-more","more"),quickInputBack:(0,Uc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Uc.register)("drop-down-button",60084),symbolCustomColor:(0,Uc.register)("symbol-customcolor",60252),exportIcon:(0,Uc.register)("export",60332),workspaceUnspecified:(0,Uc.register)("workspace-unspecified",60355),newLine:(0,Uc.register)("newline",60394),thumbsDownFilled:(0,Uc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Uc.register)("thumbsup-filled",60436),gitFetch:(0,Uc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Uc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Uc.register)("debug-breakpoint-pending",60377),chatImport:(0,Uc.register)("chat-import",60550),chatExport:(0,Uc.register)("chat-export",60551)};BF.Codicon={...lWs.codiconsLibrary,...BF.codiconsDerived}});var _fr=I(iX=>{"use strict";p();Object.defineProperty(iX,"__esModule",{value:!0});iX.ThemeIcon=iX.ThemeColor=void 0;iX.themeColorFromId=dWs;var yfr=Afr(),Efr;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(Efr||(iX.ThemeColor=Efr={}));function dWs(t){return{id:t}}a(dWs,"themeColorFromId");var sei;(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(yfr.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"||Efr.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===yfr.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===yfr.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(sei||(iX.ThemeIcon=sei={}))});var hDe=I(tH=>{"use strict";p();Object.defineProperty(tH,"__esModule",{value:!0});tH.Icon=void 0;tH.overrideNowValue=fWs;tH.now=pWs;tH.shortenOpportunityId=hWs;tH.checkIfCursorAtEndOfLine=mWs;var LF=_fr(),vfr=-1;function fWs(t){vfr=t}a(fWs,"overrideNowValue");function pWs(){return vfr!==-1?vfr:Date.now()}a(pWs,"now");var aei;(function(t){t.circleSlash={themeIcon:LF.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:LF.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:LF.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:LF.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:LF.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:LF.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:LF.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:LF.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:LF.ThemeIcon.fromId("thumbsdown"),svg:''}})(aei||(tH.Icon=aei={}));function hWs(t){return t.substring(4,8)}a(hWs,"shortenOpportunityId");function mWs(t,e){return t.substring(e).match(/^\s*$/)!==null}a(mWs,"checkIfCursorAtEndOfLine")});var hut=I(P5=>{"use strict";p();var gWs=P5&&P5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AWs=P5&&P5.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yWs=P5&&P5.__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(`- ${AE.Icon.lightbulbFull.svg} - model had suggestions -`),e.push(`- ${AE.Icon.circleSlash.svg} - model had NO suggestions -`),e.push(`- ${AE.Icon.database.svg} - response is from cache -`),e.push(`- ${AE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) -`),e.push(`- ${AE.Icon.error.svg} - error happened -`),e.push(`- ${AE.Icon.skipped.svg} - fetching started but got cancelled +`),e.push(`- ${hE.Icon.lightbulbFull.svg} - model had suggestions +`),e.push(`- ${hE.Icon.circleSlash.svg} - model had NO suggestions +`),e.push(`- ${hE.Icon.database.svg} - response is from cache +`),e.push(`- ${hE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) +`),e.push(`- ${hE.Icon.error.svg} - error happened +`),e.push(`- ${hE.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 @@ -542,11 +498,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(Yut.ErrorUtils.toString(Yut.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(put.ErrorUtils.toString(put.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(Dti.stringify(this._responseResults,null," ")),e.push("```"),e.push(` +`),e.push("```"),e.push(cei.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(` @@ -558,8 +514,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(Yut.ErrorUtils.toString(Yut.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,TJs.stringifyChatMessages)(e)),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?AE.Icon.check:AE.Icon.loading;case"succeeded":return AE.Icon.lightbulbFull;case"noSuggestions":return AE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return AE.Icon.database;case"reusedInFlight":return AE.Icon.gitMerge;case"skipped":case"cancelled":return AE.Icon.skipped;case"errored":return AE.Icon.error;case"previouslyRejected":return AE.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 bJs.FetchCancellationError?this._setOutcome("skipped"):(0,CJs.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 | ${IJs(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(put.ErrorUtils.toString(put.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,bWs.stringifyChatMessages)(e)),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?hE.Icon.check:hE.Icon.loading;case"succeeded":return hE.Icon.lightbulbFull;case"noSuggestions":return hE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return hE.Icon.database;case"reusedInFlight":return hE.Icon.gitMerge;case"skipped":case"cancelled":return hE.Icon.skipped;case"errored":return hE.Icon.error;case"previouslyRejected":return hE.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 vWs.FetchCancellationError?this._setOutcome("skipped"):(0,EWs.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 | ${SWs(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:Dti.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,SJs.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};j5.InlineEditRequestLogContext=Ipr;function IJs(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(IJs,"basename")});var Nti=I(Jut=>{"use strict";p();Object.defineProperty(Jut,"__esModule",{value:!0});Jut.GhostTextLogContext=void 0;var xJs=Kut(),wJs=hA(),xpr=class extends xJs.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,wJs.basename)(this.filePath)} (v${this.version})`}};Jut.GhostTextLogContext=xpr});var _H=I(bhe=>{"use strict";p();Object.defineProperty(bhe,"__esModule",{value:!0});bhe.CopilotTokenStore=bhe.ICopilotTokenStore=void 0;var RJs=rn(),kJs=Sc(),PJs=ko();bhe.ICopilotTokenStore=(0,RJs.createServiceIdentifier)("ICopilotTokenStore");var wpr=class extends PJs.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new kJs.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()}};bhe.CopilotTokenStore=wpr});var o0=I(QA=>{"use strict";p();var DJs=QA&&QA.__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},NJs=QA&&QA.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(QA,"__esModule",{value:!0});QA.TelemetryTrustedValue=QA.ITelemetryService=QA.TelemetryUserConfigImpl=QA.ITelemetryUserConfig=void 0;QA.createTrackingIdGetter=OJs;QA.multiplexProperties=LJs;var Mti=rn(),MJs=_H();QA.ITelemetryUserConfig=(0,Mti.createServiceIdentifier)("ITelemetryUserConfig");var Rpr=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)}};QA.TelemetryUserConfigImpl=Rpr;QA.TelemetryUserConfigImpl=Rpr=DJs([NJs(2,MJs.ICopilotTokenStore)],Rpr);function OJs(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(OJs,"createTrackingIdGetter");QA.ITelemetryService=(0,Mti.createServiceIdentifier)("ITelemetryService");var kpr=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};QA.TelemetryTrustedValue=kpr;var jDe=8192,BJs=50;function LJs(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>jDe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+jDe;o{"use strict";p();var FJs=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]})),UJs=jo&&jo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QJs=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)&&FJs(e,t,r);return UJs(e,t),e},Ppr=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())})},Dpr=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 Opr=bX&&bX.__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())})},Bpr=bX&&bX.__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,H5.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 Opr(this,void 0,void 0,function(){var r,n,o;return Bpr(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,H5.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=vX.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,H5.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 H5.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return Opr(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return Bpr(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,H5.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return vX.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 Uti=Fti(),zJs="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",YJs="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",KJs=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{JJs.exports={}});var Xut=I(She=>{"use strict";p();var ZJs=She&&She.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(She,"__esModule",{value:!0});She.JsonConfig=void 0;var XJs=require("fs"),Zut=require("path"),Lpr=$l(),eZs=ZJs(qti()),tZs="APPLICATIONINSIGHTS_CONFIGURATION_FILE",rZs="APPLICATIONINSIGHTS_CONNECTION_STRING",jti="APPSETTING_",Hti="APPINSIGHTS_INSTRUMENTATIONKEY",Gti="APPINSIGHTS_INSTRUMENTATION_KEY",nZs="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",iZs="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",oZs="http_proxy",sZs="https_proxy",aZs="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",cZs="APPLICATION_INSIGHTS_NO_STATSBEAT",lZs="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",uZs="APPLICATION_INSIGHTS_NO_PATCH_MODULES",dZs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",fZs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",pZs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",hZs="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",mZs="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",gZs=(function(){function t(){this.connectionString=process.env[rZs],this.instrumentationKey=process.env[Hti]||process.env[jti+Hti]||process.env[Gti]||process.env[jti+Gti],!this.connectionString&&this.instrumentationKey&&Lpr.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[iZs],this.extendedMetricDisablers=process.env[nZs],this.proxyHttpUrl=process.env[oZs],this.proxyHttpsUrl=process.env[sZs],this.noDiagnosticChannel=!!process.env[aZs],this.disableStatsbeat=!!process.env[cZs],this.noHttpAgentKeepAlive=!!process.env[lZs],this.noPatchModules=process.env[uZs]||"",this.enableWebInstrumentation=!!process.env[dZs]||!!process.env[hZs],this.webInstrumentationSrc=process.env[pZs]||"",this.webInstrumentationConnectionString=process.env[fZs]||process.env[mZs]||"",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=Zut.join(__dirname,"../../");this._tempDir=Zut.join(o,n);var s=process.env[tZs];if(s){Zut.isAbsolute(s)?this._tempDir=s:this._tempDir=Zut.join(o,s);try{e=XJs.readFileSync(this._tempDir,"utf8")}catch(l){Lpr.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(eZs.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){Lpr.warn("Invalid JSON config file: ",l)}},t})();She.JsonConfig=gZs});var Fpr=I(edt=>{"use strict";p();Object.defineProperty(edt,"__esModule",{value:!0});edt.makePatchingRequire=void 0;var AZs=require("path"),yZs=DL(),$ti=dp(),Wti=require("module"),EZs=Object.keys(process.binding("natives")),Vti=Wti.prototype.require;function _Zs(t){var e={};return a(function(n){var o=Vti.apply(this,arguments);if(t[n]){var s=Wti._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(EZs.indexOf(n)<0)try{c=Vti.call(this,AZs.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{CZs.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 dp=I(jw=>{"use strict";p();Object.defineProperty(jw,"__esModule",{value:!0});jw.channel=jw.ContextPreservingEventEmitter=jw.trueFilter=jw.makePatchingRequire=void 0;var vZs=Fpr(),bZs=Fpr();Object.defineProperty(jw,"makePatchingRequire",{enumerable:!0,get:a(function(){return bZs.makePatchingRequire},"get")});var SZs=a(function(t){return!0},"trueFilter");jw.trueFilter=SZs;var Kti=(function(){function t(){this.version=zti().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=jw.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=jw.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();Upr=hb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(The,"suppressTracing");a(Jti,"unsuppressTracing");a(CH,"isTracingSuppressed")});var Zti,tdt,Ihe,rdt,Xti,eri,tri,Qpr=me(()=>{p();Zti="=",tdt=";",Ihe=",",rdt="baggage",Xti=180,eri=4096,tri=8192});function ndt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?Ihe:"")+r;return n.length>tri?e:n},"")}function idt(t){return t.getAllEntries().map(function(e){var r=TZs(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=tdt+o.metadata.toString()),s})}function GDe(t){var e=t.split(tdt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Zti);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Cpe(e.join(tdt))),{key:o,value:s,metadata:c}}}}}function rri(t){return typeof t!="string"||t.length===0?{}:t.split(Ihe).map(function(e){return GDe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var TZs,qpr=me(()=>{p();co();Qpr();TZs=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(ndt,"serializeKeyPairs");a(idt,"getKeyPairs");a(GDe,"parsePairKeyValue");a(rri,"parseKeyPairsIntoRecord")});var odt,nri=me(()=>{p();co();HDe();Qpr();qpr();odt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=yT.getBaggage(e);if(!(!o||CH(e))){var s=idt(o).filter(function(l){return l.length<=eri}).slice(0,Xti),c=ndt(s);c.length>0&&n.set(r,rdt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,rdt),s=Array.isArray(o)?o.join(Ihe):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(Ihe);return l.forEach(function(u){var d=GDe(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[rdt]},t})()});var iri,ori=me(()=>{p();iri=(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 vH(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=sri(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=IZs(s.value,2),l=c[0],u=c[1];if(!jpr(l)){kn.warn("Invalid attribute key: "+l);continue}if(!$De(u)){kn.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 jpr(t){return typeof t=="string"&&t.length>0}function $De(t){return t==null?!0:Array.isArray(t)?xZs(t):ari(t)}function xZs(t){var e,r,n;try{for(var o=sri(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(ari(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 ari(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var sri,IZs,cri=me(()=>{p();co();sri=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.")},IZs=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(vH,"sanitizeAttributes");a(jpr,"isAttributeKey");a($De,"isAttributeValue");a(xZs,"isHomogeneousAttributeValueArray");a(ari,"isValidPrimitiveAttributeValue")});function sdt(){return function(t){kn.error(wZs(t))}}function wZs(t){return typeof t=="string"?t:JSON.stringify(RZs(t))}function RZs(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 Hpr=me(()=>{p();co();a(sdt,"loggingErrorHandler");a(wZs,"stringifyException");a(RZs,"flattenException")});function uri(t){lri=t}function nC(t){try{lri(t)}catch{}}var lri,Gpr=me(()=>{p();Hpr();lri=sdt();a(uri,"setGlobalErrorHandler");a(nC,"globalErrorHandler")});var Ib,$pr=me(()=>{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"})(Ib||(Ib={}))});function DZs(t){return PZs.indexOf(t)>-1}function MZs(t){return NZs.indexOf(t)>-1}function BZs(t){return OZs.indexOf(t)>-1}function LZs(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function FZs(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 UZs(t,e,r,n){n===void 0&&(n=kZs);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function qZs(t,e,r){var n=r[t];if(typeof n=="string"){var o=QZs[n.toUpperCase()];o!=null&&(e[t]=o)}}function WDe(t){var e={};for(var r in VDe){var n=r;switch(n){case"OTEL_LOG_LEVEL":qZs(n,e,t);break;default:if(DZs(n))LZs(n,e,t);else if(MZs(n))FZs(n,e,t);else if(BZs(n))UZs(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var kZs,PZs,NZs,OZs,SX,TX,Vpr,Wpr,VDe,QZs,zpr=me(()=>{p();co();$pr();kZs=",",PZs=["OTEL_SDK_DISABLED"];a(DZs,"isEnvVarABoolean");NZs=["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(MZs,"isEnvVarANumber");OZs=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(BZs,"isEnvVarAList");SX=1/0,TX=128,Vpr=128,Wpr=128,VDe={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:SX,OTEL_ATTRIBUTE_COUNT_LIMIT:TX,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SX,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:TX,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SX,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:TX,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Vpr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Wpr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Ib.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(LZs,"parseBoolean");a(FZs,"parseNumber");a(UZs,"parseStringList");QZs={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(qZs,"setLogLevelFromEnv");a(WDe,"parseEnvironment")});function Hw(){var t=WDe(process.env);return Object.assign({},VDe,t)}function xhe(){return WDe(process.env)}var dri=me(()=>{p();zpr();a(Hw,"getEnv");a(xhe,"getEnvWithoutDefaults")});var adt,fri=me(()=>{p();adt=typeof globalThis=="object"?globalThis:global});function pri(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function cdt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(pri,"intValue");a(cdt,"hexToBinary")});function ldt(t){return Buffer.from(cdt(t)).toString("base64")}var hri=me(()=>{p();Ypr();a(ldt,"hexToBase64")});function mri(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(udt[t-1]=1);return udt.toString("hex",0,t)},"generateId")}var jZs,gri,ddt,udt,Ari=me(()=>{p();jZs=8,gri=16,ddt=(function(){function t(){this.generateTraceId=mri(gri),this.generateSpanId=mri(jZs)}return a(t,"RandomIdGenerator"),t})(),udt=Buffer.allocUnsafe(gri);a(mri,"getIdGenerator")});var yri,Gw,Eri=me(()=>{p();yri=require("perf_hooks"),Gw=yri.performance});var fdt,Kpr=me(()=>{p();fdt="1.30.1"});var _ri=me(()=>{p()});var Cri=me(()=>{p();_ri()});var HZs,GZs,$Zs,VZs,vri,bri,Sri,Tri,WZs,Iri,xri=me(()=>{p();HZs="process.runtime.name",GZs="telemetry.sdk.name",$Zs="telemetry.sdk.language",VZs="telemetry.sdk.version",vri=HZs,bri=GZs,Sri=$Zs,Tri=VZs,WZs="nodejs",Iri=WZs});var wri=me(()=>{p();xri()});var Rri=me(()=>{p()});var kri=me(()=>{p()});var Pri=me(()=>{p();Cri();wri();Rri();kri()});var whe,bH,Dri=me(()=>{p();Kpr();Pri();bH=(whe={},whe[bri]="opentelemetry",whe[vri]="node",whe[Sri]=Iri,whe[Tri]=fdt,whe)});function Rhe(t){t.unref()}var Nri=me(()=>{p();a(Rhe,"unrefTimer")});var Mri=me(()=>{p();dri();fri();hri();Ari();Eri();Dri();Nri()});var Jpr=me(()=>{p();Mri()});function I2(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*YZs);return[r,n]}function khe(){var t=Gw.timeOrigin;if(typeof t!="number"){var e=Gw;t=e.timing&&e.timing.fetchStart}return t}function zDe(t){var e=I2(khe()),r=I2(typeof t=="number"?t:Gw.now());return JDe(e,r)}function Bri(t){if(Phe(t))return t;if(typeof t=="number")return t=pdt&&(r[1]-=pdt,r[0]+=1),r}var Ori,zZs,YZs,pdt,Qri=me(()=>{p();Jpr();Ori=9,zZs=6,YZs=Math.pow(10,zZs),pdt=Math.pow(10,Ori);a(I2,"millisToHrTime");a(khe,"getTimeOrigin");a(zDe,"hrTime");a(Bri,"timeInputToHrTime");a(hdt,"hrTimeDuration");a(Lri,"hrTimeToTimeStamp");a(Fri,"hrTimeToNanoseconds");a(Uri,"hrTimeToMilliseconds");a(YDe,"hrTimeToMicroseconds");a(Phe,"isTimeInputHrTime");a(KDe,"isTimeInput");a(JDe,"addHrTimes")});var ST,qri=me(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(ST||(ST={}))});var KZs,mdt,jri=me(()=>{p();co();KZs=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.")},mdt=(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=KZs(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){kn.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){kn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function Hri(t){return XZs.test(t)}function Gri(t){return eXs.test(t)&&!tXs.test(t)}var Zpr,JZs,ZZs,XZs,eXs,tXs,$ri=me(()=>{p();Zpr="[_0-9a-z-*/]",JZs="[a-z]"+Zpr+"{0,255}",ZZs="[a-z0-9]"+Zpr+"{0,240}@[a-z]"+Zpr+"{0,13}",XZs=new RegExp("^(?:"+JZs+"|"+ZZs+")$"),eXs=/^[ -~]{0,255}[!-~]$/,tXs=/,|=/;a(Hri,"validateKey");a(Gri,"validateValue")});var Vri,rXs,Wri,zri,gdt,Xpr=me(()=>{p();$ri();Vri=32,rXs=512,Wri=",",zri="=",gdt=(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+zri+e.get(n)),r},[]).join(Wri)},t.prototype._parse=function(e){e.length>rXs||(this._internalState=e.split(Wri).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(zri);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Hri(c)&&Gri(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Vri&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Vri))))},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 ehr(t){var e=cXs.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var ZDe,XDe,nXs,iXs,oXs,sXs,aXs,cXs,Adt,Yri=me(()=>{p();co();HDe();Xpr();ZDe="traceparent",XDe="tracestate",nXs="00",iXs="(?!ff)[\\da-f]{2}",oXs="(?![0]{32})[\\da-f]{32}",sXs="(?![0]{16})[\\da-f]{16}",aXs="[\\da-f]{2}",cXs=new RegExp("^\\s?("+iXs+")-("+oXs+")-("+sXs+")-("+aXs+")(-.*)?\\s?$");a(ehr,"parseTraceParent");Adt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=Cu.getSpanContext(e);if(!(!o||CH(e)||!mb(o))){var s=nXs+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||yf.NONE).toString(16);n.set(r,ZDe,s),o.traceState&&n.set(r,XDe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,ZDe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=ehr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,XDe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new gdt(typeof u=="string"?u:void 0)}return Cu.setSpanContext(e,c)},t.prototype.fields=function(){return[ZDe,XDe]},t})()});function Kri(t,e){return t.setValue(thr,e)}function Jri(t){return t.deleteValue(thr)}function Zri(t){return t.getValue(thr)}var thr,ydt,Xri=me(()=>{p();co();thr=hb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(ydt||(ydt={}));a(Kri,"setRPCMetadata");a(Jri,"deleteRPCMetadata");a(Zri,"getRPCMetadata")});var eNe,rhr=me(()=>{p();co();eNe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:gb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var Dhe,nhr=me(()=>{p();co();Dhe=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:gb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var eni,tni=me(()=>{p();co();Gpr();rhr();nhr();eni=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(nC(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Dhe),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new Dhe,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new eNe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new Dhe,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new eNe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Cu.getSpanContext(e);return!l||!mb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&yf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&yf.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 rni,nni=me(()=>{p();co();rni=(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:$Z(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 mXs(t,e){return function(r){return t(e(r))}}function ihr(t){if(!gXs(t)||AXs(t)!==lXs)return!1;var e=hXs(t);if(e===null)return!0;var r=sni.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ini.call(r)===pXs}function gXs(t){return t!=null&&typeof t=="object"}function AXs(t){return t==null?t===void 0?dXs:uXs:IX&&IX in Object(t)?yXs(t):EXs(t)}function yXs(t){var e=sni.call(t,IX),r=t[IX],n=!1;try{t[IX]=void 0,n=!0}catch{}var o=ani.call(t);return n&&(e?t[IX]=r:delete t[IX]),o}function EXs(t){return ani.call(t)}var lXs,uXs,dXs,fXs,ini,pXs,hXs,oni,sni,IX,ani,cni=me(()=>{p();lXs="[object Object]",uXs="[object Null]",dXs="[object Undefined]",fXs=Function.prototype,ini=fXs.toString,pXs=ini.call(Object),hXs=mXs(Object.getPrototypeOf,Object),oni=Object.prototype,sni=oni.hasOwnProperty,IX=Symbol?Symbol.toStringTag:void 0,ani=oni.toString;a(mXs,"overArg");a(ihr,"isPlainObject");a(gXs,"isObjectLike");a(AXs,"baseGetTag");a(yXs,"getRawTag");a(EXs,"objectToString")});function Cdt(){for(var t=[],e=0;e0;)r=uni(r,t.shift(),0,n);return r}function ohr(t){return _dt(t)?t.slice():t}function uni(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>_Xs)){if(r++,Edt(t)||Edt(e)||dni(e))o=ohr(e);else if(_dt(t)){if(o=t.slice(),_dt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(lni(t,u,n)||lni(e,u,n))delete o[u];else{if(tNe(f)&&tNe(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]=uni(o[u],d,r,n)}}}}else o=e;return o}}function lni(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 CXs(t,e){return!(!ihr(t)||!ihr(e))}var _Xs,fni=me(()=>{p();cni();_Xs=20;a(Cdt,"merge");a(ohr,"takeValue");a(uni,"mergeTwoObjects");a(lni,"wasObjectReferenced");a(_dt,"isArray");a(dni,"isFunction");a(tNe,"isObject");a(Edt,"isPrimitive");a(CXs,"shouldMerge")});function pni(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new shr("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 vXs,shr,hni=me(()=>{p();vXs=(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)}})(),shr=(function(t){vXs(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(pni,"callWithTimeout")});function ahr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function mni(t,e){var r,n;if(!e)return!1;try{for(var o=bXs(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(ahr(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 bXs,gni=me(()=>{p();bXs=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(ahr,"urlMatches");a(mni,"isUrlIgnored")});function Ani(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var yni=me(()=>{p();a(Ani,"isWrapped")});var Eni,_ni=me(()=>{p();Eni=(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 SXs,TXs,Nhe,Cni=me(()=>{p();_ni();SXs=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},TXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();HDe();a(vni,"_export")});var Sni={};wi(Sni,{AlwaysOffSampler:()=>eNe,AlwaysOnSampler:()=>Dhe,AnchoredClock:()=>iri,BindOnceFuture:()=>Nhe,CompositePropagator:()=>mdt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>TX,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>SX,DEFAULT_ENVIRONMENT:()=>VDe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>Vpr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>Wpr,ExportResultCode:()=>ST,ParentBasedSampler:()=>eni,RPCType:()=>ydt,RandomIdGenerator:()=>ddt,SDK_INFO:()=>bH,TRACE_PARENT_HEADER:()=>ZDe,TRACE_STATE_HEADER:()=>XDe,TimeoutError:()=>shr,TraceIdRatioBasedSampler:()=>rni,TraceState:()=>gdt,TracesSamplerValues:()=>Ib,VERSION:()=>fdt,W3CBaggagePropagator:()=>odt,W3CTraceContextPropagator:()=>Adt,_globalThis:()=>adt,addHrTimes:()=>JDe,baggageUtils:()=>IXs,callWithTimeout:()=>pni,deleteRPCMetadata:()=>Jri,getEnv:()=>Hw,getEnvWithoutDefaults:()=>xhe,getRPCMetadata:()=>Zri,getTimeOrigin:()=>khe,globalErrorHandler:()=>nC,hexToBase64:()=>ldt,hexToBinary:()=>cdt,hrTime:()=>zDe,hrTimeDuration:()=>hdt,hrTimeToMicroseconds:()=>YDe,hrTimeToMilliseconds:()=>Uri,hrTimeToNanoseconds:()=>Fri,hrTimeToTimeStamp:()=>Lri,internal:()=>chr,isAttributeKey:()=>jpr,isAttributeValue:()=>$De,isTimeInput:()=>KDe,isTimeInputHrTime:()=>Phe,isTracingSuppressed:()=>CH,isUrlIgnored:()=>mni,isWrapped:()=>Ani,loggingErrorHandler:()=>sdt,merge:()=>Cdt,millisToHrTime:()=>I2,otperformance:()=>Gw,parseEnvironment:()=>WDe,parseTraceParent:()=>ehr,sanitizeAttributes:()=>vH,setGlobalErrorHandler:()=>uri,setRPCMetadata:()=>Kri,suppressTracing:()=>The,timeInputToHrTime:()=>Bri,unrefTimer:()=>Rhe,unsuppressTracing:()=>Jti,urlMatches:()=>ahr});var IXs,chr,xb=me(()=>{p();nri();ori();cri();Gpr();Hpr();Qri();Ypr();qri();qpr();Jpr();jri();Yri();Xri();rhr();nhr();tni();nni();HDe();Xpr();zpr();fni();$pr();hni();gni();yni();Cni();Kpr();bni();IXs={getKeyPairs:idt,serializeKeyPairs:ndt,parseKeyPairsIntoRecord:rri,parsePairKeyValue:GDe},chr={_export:vni}});var xXs,wXs,RXs,vdt,bdt,Tni,Ini=me(()=>{p();xXs="exception.type",wXs="exception.message",RXs="exception.stacktrace",vdt=xXs,bdt=wXs,Tni=RXs});var xni=me(()=>{p();Ini()});var wni=me(()=>{p()});var Rni=me(()=>{p();wni()});var kni=me(()=>{p()});var Pni=me(()=>{p()});var Dni=me(()=>{p();xni();Rni();kni();Pni()});var Nni,Mni=me(()=>{p();Nni="exception"});var lhr,kXs,Oni,PXs,Sdt,uhr=me(()=>{p();co();xb();Dni();Mni();lhr=function(){return lhr=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.")},Oni=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},PXs=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):(kn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=kXs(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=Oni(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 kn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&kn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),KDe(r)&&(KDe(n)||(n=r),r=void 0);var o=vH(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,PXs([],Oni(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=lhr({},e),this.status.message!=null&&typeof e.message!="string"&&(kn.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()){kn.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=hdt(this.startTime,this.endTime),this._duration[0]<0&&(kn.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&&kn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=Gw.now())return zDe(e+this._performanceOffset);if(typeof e=="number")return I2(e);if(e instanceof Date)return I2(e.getTime());if(Phe(e))return e;if(this._startTimeProvided)return I2(Date.now());var r=Gw.now()-this._performanceStartTime;return JDe(this.startTime,I2(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[bdt]=e:e&&(e.code?n[vdt]=e.code.toString():e.name&&(n[vdt]=e.name),e.message&&(n[bdt]=e.message),e.stack&&(n[Tni]=e.stack)),n[vdt]||n[bdt]?this.addEvent(Nni,n,r):kn.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&&kn.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?(kn.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 x2,rNe=me(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(x2||(x2={}))});var SH,Tdt=me(()=>{p();rNe();SH=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:x2.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var G5,Idt=me(()=>{p();rNe();G5=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:x2.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Mhe,dhr=me(()=>{p();co();xb();Tdt();Idt();Mhe=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(nC(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new G5),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new G5,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new SH,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new G5,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new SH}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Cu.getSpanContext(e);return!l||!mb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&yf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&yf.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 nNe,fhr=me(()=>{p();co();rNe();nNe=(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:$Z(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 xdt(){var t=Hw();return{sampler:phr(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 phr(t){switch(t===void 0&&(t=Hw()),t.OTEL_TRACES_SAMPLER){case Ib.AlwaysOn:return new G5;case Ib.AlwaysOff:return new SH;case Ib.ParentBasedAlwaysOn:return new Mhe({root:new G5});case Ib.ParentBasedAlwaysOff:return new Mhe({root:new SH});case Ib.TraceIdRatio:return new nNe(Bni(t));case Ib.ParentBasedTraceIdRatio:return new Mhe({root:new nNe(Bni(t))});default:return kn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+DXs+'".'),new G5}}function Bni(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return kn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+Ohe+"."),Ohe;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(kn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+Ohe+"."),Ohe):e<0||e>1?(kn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+Ohe+"."),Ohe):e}var DXs,Ohe,hhr=me(()=>{p();co();xb();Tdt();Idt();dhr();fhr();DXs=Ib.AlwaysOn,Ohe=1;a(xdt,"loadDefaultConfig");a(phr,"buildSamplerFromEnv");a(Bni,"getSamplerProbabilityFromEnv")});function Lni(t){var e={sampler:phr()},r=xdt(),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 Fni(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=xhe();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:TX,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:SX,Object.assign({},t,{spanLimits:g})}var mhr=me(()=>{p();hhr();xb();a(Lni,"mergeConfig");a(Fni,"reconfigureLimits")});var Uni,Qni=me(()=>{p();co();xb();Uni=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=Hw();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 Nhe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(kn.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&yf.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&&kn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(kn.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,nC(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),Rhe(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var NXs,Bhe,qni=me(()=>{p();Qni();NXs=(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)}})(),Bhe=(function(t){NXs(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(Uni)});function jni(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(wdt[t-1]=1);return wdt.toString("hex",0,t)},"generateId")}var MXs,Hni,Lhe,wdt,Gni=me(()=>{p();MXs=8,Hni=16,Lhe=(function(){function t(){this.generateTraceId=jni(Hni),this.generateSpanId=jni(MXs)}return a(t,"RandomIdGenerator"),t})(),wdt=Buffer.allocUnsafe(Hni);a(jni,"getIdGenerator")});var $ni=me(()=>{p();qni();Gni()});var Rdt=me(()=>{p();$ni()});var kdt,ghr=me(()=>{p();co();xb();uhr();mhr();Rdt();kdt=(function(){function t(e,r,n){this._tracerProvider=n;var o=Lni(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new Lhe,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=Cu.deleteSpan(n));var l=Cu.getSpan(n);if(CH(n)){kn.debug("Instrumentation suppressed, returning Noop Span");var u=Cu.wrapSpanContext(vpe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!Cu.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:bpe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:vH(R.attributes)}}),E=vH(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===gb.RECORD_AND_SAMPLED?yf.SAMPLED:yf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===gb.NOT_RECORD){kn.debug("Recording is off, propagating context in a non-recording span");var u=Cu.wrapSpanContext(b);return u}var T=vH(Object.assign(E,_.attributes)),w=new Sdt(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=Cu.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 Vni=me(()=>{p()});var Wni=me(()=>{p();Vni()});var OXs,BXs,LXs,FXs,zni,Ahr,yhr,Ehr,Yni=me(()=>{p();OXs="service.name",BXs="telemetry.sdk.name",LXs="telemetry.sdk.language",FXs="telemetry.sdk.version",zni=OXs,Ahr=BXs,yhr=LXs,Ehr=FXs});var Kni=me(()=>{p();Yni()});var Jni=me(()=>{p()});var Zni=me(()=>{p()});var Xni=me(()=>{p();Wni();Kni();Jni();Zni()});function Pdt(){return"unknown_service:"+process.argv0}var eii=me(()=>{p();a(Pdt,"defaultServiceName")});var tii=me(()=>{p();eii()});var rii=me(()=>{p();tii()});var TH,UXs,QXs,qXs,Ddt,nii=me(()=>{p();co();Xni();xb();rii();TH=function(){return TH=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},Ddt=(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 kn.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[zni]=Pdt(),e[yhr]=bH[yhr],e[Ahr]=bH[Ahr],e[Ehr]=bH[Ehr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&kn.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 UXs(this,void 0,void 0,function(){return QXs(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=TH(TH({},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=qXs(c,2),d=u[0],f=u[1];return TH(TH(TH(TH({},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 iii=me(()=>{p();nii()});var Ndt,_hr,oii=me(()=>{p();xb();Ndt=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.")},_hr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Ndt(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){nC(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Ndt(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=Ndt(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=Ndt(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 Mdt,Chr=me(()=>{p();Mdt=(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 jXs,HXs,e8,sii,aii=me(()=>{p();co();xb();iii();ghr();hhr();oii();Chr();Rdt();mhr();jXs=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},HXs=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(Hw().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||kn.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 mdt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=Hw().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||kn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Adt}],["baggage",function(){return new odt}]]),t._registeredExporters=new Map,t})()});var GXs,cii,lii=me(()=>{p();xb();GXs=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.")},cii=(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:YDe(e.startTime),duration:YDe(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=GXs(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:ST.SUCCESS})},t})()});var $Xs,VXs,uii,dii=me(()=>{p();xb();$Xs=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},VXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();xb();WXs=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())})},zXs=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]SH,AlwaysOnSampler:()=>G5,BasicTracerProvider:()=>sii,BatchSpanProcessor:()=>Bhe,ConsoleSpanExporter:()=>cii,ForceFlushState:()=>e8,InMemorySpanExporter:()=>uii,NoopSpanProcessor:()=>Mdt,ParentBasedSampler:()=>Mhe,RandomIdGenerator:()=>Lhe,SamplingDecision:()=>x2,SimpleSpanProcessor:()=>fii,Span:()=>Sdt,TraceIdRatioBasedSampler:()=>nNe,Tracer:()=>kdt});var mii=me(()=>{p();ghr();aii();Rdt();lii();dii();pii();Chr();Tdt();Idt();dhr();fhr();rNe();uhr()});var iNe,gii,vhr=me(()=>{p();iNe=class{static{a(this,"NoopLogger")}emit(e){}},gii=new iNe});var bhr,Odt,Shr=me(()=>{p();vhr();bhr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new iNe}},Odt=new bhr});var Bdt,Aii=me(()=>{p();vhr();Bdt=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):gii}}});var oNe,yii=me(()=>{p();Shr();Aii();oNe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Bdt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Odt}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 Ldt,Eii=me(()=>{p();Ldt=typeof globalThis=="object"?globalThis:global});var _ii=me(()=>{p();Eii()});var Cii=me(()=>{p();_ii()});function vii(t,e,r){return n=>n===t?e:r}var sNe,Fhe,Thr,bii=me(()=>{p();Cii();sNe=Symbol.for("io.opentelemetry.js.api.logs"),Fhe=Ldt;a(vii,"makeGetter");Thr=1});var Fdt,Sii=me(()=>{p();bii();Shr();yii();Fdt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new oNe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Fhe[sNe]?this.getLoggerProvider():(Fhe[sNe]=vii(Thr,e,Odt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Fhe[sNe])===null||e===void 0?void 0:e.call(Fhe,Thr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Fhe[sNe],this._proxyLoggerProvider=new oNe}}});var Udt,Ihr=me(()=>{p();Sii();Udt=Fdt.getInstance()});function Tii(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var xii=me(()=>{p();a(Tii,"enableInstrumentations");a(Iii,"disableInstrumentations")});function wii(t){let e=t.tracerProvider||Cu.getTracerProvider(),r=t.meterProvider||VZ.getMeterProvider(),n=t.loggerProvider||Udt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return Tii(o,e,r,n),()=>{Iii(o)}}var Rii=me(()=>{p();co();Ihr();xii();a(wii,"registerInstrumentations")});function Oii(t,e,r){if(!JXs(t))return kn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=tea(t);if(!n)return!1;let o=[],s=Bii(n,e,o,r);return s&&!r?.includePrerelease?XXs(n,o):s}function JXs(t){return typeof t=="string"&&Mii.test(t)}function Bii(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(xhr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=vea(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!xhr(t,s,r,n))return!1;return!0}return xhr(t,e,r,n)}function xhr(t,e,r,n){if(e=eea(e,n),e.includes(" "))return Bii(t,e,r,n);{let o=rea(e);return r.push(o),ZXs(t,o)}}function ZXs(t,e){if(e.invalid)return!1;if(!e.version||Rhr(e.version))return!0;let r=Pii(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=Pii(n,o)}return KXs[e.op]?.includes(r)}function XXs(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function eea(t,e){return t=t.trim(),t=_ea(t,e),t=Eea(t),t=Cea(t,e),t=t.trim(),t}function iC(t){return!t||t.toLowerCase()==="x"||t==="*"}function tea(t){let e=t.match(Mii);if(!e){kn.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 rea(t){if(!t)return{};let e=t.match(YXs);if(!e)return kn.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 Rhr(t){return t==="*"||t==="x"||t==="X"}function kii(t){let e=parseInt(t,10);return isNaN(e)?t:e}function nea(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 iea(t,e){if(Rhr(t)||Rhr(e))return 0;let[r,n]=nea(kii(t),kii(e));return r>n?1:r{let l;return iC(n)?l="":iC(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:iC(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 _ea(t,e){let r=yea,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return iC(s)?d="":iC(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:iC(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 Cea(t,e){let r=uea;return t.replace(r,(n,o,s,c,l,u)=>{let d=iC(s),f=d||iC(c),h=f||iC(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 vea(t,e){let r=fea;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(iC(s)?o="":iC(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:iC(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,iC(h)?f="":iC(m)?f=`<${+h+1}.0.0-0`:iC(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 Mii,YXs,KXs,Lii,Fii,oea,sea,Dii,aea,Nii,cea,whr,aNe,lea,uea,dea,fea,pea,hea,mea,gea,Aea,yea,Uii=me(()=>{p();co();Mii=/^(?: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-]+)*))?$/,YXs=/^(?<|>|=|==|<=|>=|~|\^|~>)?\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-]+)*))?$/,KXs={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(Oii,"satisfies");a(JXs,"_validateVersion");a(Bii,"_doSatisfies");a(xhr,"_checkRange");a(ZXs,"_satisfies");a(XXs,"_doPreleaseCheck");a(eea,"_normalizeRange");a(iC,"isX");a(tea,"_parseVersion");a(rea,"_parseRange");a(Rhr,"_isWildcard");a(kii,"_parseVersionString");a(nea,"_normalizeVersionType");a(iea,"_compareVersionStrings");a(Pii,"_compareVersionSegments");Lii="[a-zA-Z0-9-]",Fii="0|[1-9]\\d*",oea=`\\d*[a-zA-Z-]${Lii}*`,sea="((?:<|>)?=?)",Dii=`(?:${Fii}|${oea})`,aea=`(?:-(${Dii}(?:\\.${Dii})*))`,Nii=`${Lii}+`,cea=`(?:\\+(${Nii}(?:\\.${Nii})*))`,whr=`${Fii}|x|X|\\*`,aNe=`[v=\\s]*(${whr})(?:\\.(${whr})(?:\\.(${whr})(?:${aea})?${cea}?)?)?`,lea=`^${sea}\\s*${aNe}$`,uea=new RegExp(lea),dea=`^\\s*(${aNe})\\s+-\\s+(${aNe})\\s*$`,fea=new RegExp(dea),pea="(?:~>?)",hea=`^${pea}${aNe}$`,mea=new RegExp(hea),gea="(?:\\^)",Aea=`^${gea}${aNe}$`,yea=new RegExp(Aea);a(Eea,"replaceTilde");a(_ea,"replaceCaret");a(Cea,"replaceXRange");a(vea,"replaceHyphen")});var Uhe=I((lWf,jii)=>{"use strict";p();function khr(t){return typeof t=="function"}a(khr,"isFunction");var oC=console.error.bind(console);function cNe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(cNe,"defineProperty");function lNe(t){t&&t.logger&&(khr(t.logger)?oC=t.logger:oC("new logger isn't a function, not replacing"))}a(lNe,"shimmer");function Qii(t,e,r){if(!t||!t[e]){oC("no original function "+e+" to wrap");return}if(!r){oC("no wrapper function"),oC(new Error().stack);return}if(!khr(t[e])||!khr(r)){oC("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return cNe(o,"__original",n),cNe(o,"__unwrap",function(){t[e]===o&&cNe(t,e,n)}),cNe(o,"__wrapped",!0),cNe(t,e,o),o}a(Qii,"wrap");function bea(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{oC("must provide one or more modules to patch"),oC(new Error().stack);return}if(!(e&&Array.isArray(e))){oC("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Qii(n,o,r)})})}a(bea,"massWrap");function qii(t,e){if(!t||!t[e]){oC("no function to unwrap."),oC(new Error().stack);return}if(!t[e].__unwrap)oC("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(qii,"unwrap");function Sea(t,e){if(t)Array.isArray(t)||(t=[t]);else{oC("must provide one or more modules to patch"),oC(new Error().stack);return}if(!(e&&Array.isArray(e))){oC("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){qii(r,n)})})}a(Sea,"massUnwrap");lNe.wrap=Qii;lNe.massWrap=bea;lNe.unwrap=qii;lNe.massUnwrap=Sea;jii.exports=lNe});var IH,Qdt,Hii=me(()=>{p();co();Ihr();IH=ce(Uhe()),Qdt=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=kn.createComponentLogger({namespace:e}),this._tracer=Cu.getTracer(e,r),this._meter=VZ.getMeter(e,r),this._logger=Udt.getLogger(e,r),this._updateMetricInstruments()}_wrap=IH.wrap;_unwrap=IH.unwrap;_massWrap=IH.massWrap;_massUnwrap=IH.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 $ii=I((AWf,Gii)=>{p();var Qhe=1e3,qhe=Qhe*60,jhe=qhe*60,xX=jhe*24,Tea=xX*7,Iea=xX*365.25;Gii.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return xea(t);if(r==="number"&&isFinite(t))return e.long?Rea(t):wea(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function xea(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*Iea;case"weeks":case"week":case"w":return r*Tea;case"days":case"day":case"d":return r*xX;case"hours":case"hour":case"hrs":case"hr":case"h":return r*jhe;case"minutes":case"minute":case"mins":case"min":case"m":return r*qhe;case"seconds":case"second":case"secs":case"sec":case"s":return r*Qhe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(xea,"parse");function wea(t){var e=Math.abs(t);return e>=xX?Math.round(t/xX)+"d":e>=jhe?Math.round(t/jhe)+"h":e>=qhe?Math.round(t/qhe)+"m":e>=Qhe?Math.round(t/Qhe)+"s":t+"ms"}a(wea,"fmtShort");function Rea(t){var e=Math.abs(t);return e>=xX?qdt(t,e,xX,"day"):e>=jhe?qdt(t,e,jhe,"hour"):e>=qhe?qdt(t,e,qhe,"minute"):e>=Qhe?qdt(t,e,Qhe,"second"):t+" ms"}a(Rea,"fmtLong");function qdt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(qdt,"plural")});var Phr=I((_Wf,Vii)=>{p();function kea(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=$ii(),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 k=r.formatters[x];if(typeof k=="function"){let D=E[T];R=k.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(kea,"setup");Vii.exports=kea});var Wii=I((wb,jdt)=>{p();wb.formatArgs=Dea;wb.save=Nea;wb.load=Mea;wb.useColors=Pea;wb.storage=Oea();wb.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`."))}})();wb.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 Pea(){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(Pea,"useColors");function Dea(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+jdt.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(Dea,"formatArgs");wb.log=console.debug||console.log||(()=>{});function Nea(t){try{t?wb.storage.setItem("debug",t):wb.storage.removeItem("debug")}catch{}}a(Nea,"save");function Mea(){let t;try{t=wb.storage.getItem("debug")||wb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Mea,"load");function Oea(){try{return localStorage}catch{}}a(Oea,"localstorage");jdt.exports=Phr()(wb);var{formatters:Bea}=jdt.exports;Bea.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Yii=I((vg,Gdt)=>{p();var Lea=require("tty"),Hdt=require("util");vg.init=Gea;vg.log=qea;vg.formatArgs=Uea;vg.save=jea;vg.load=Hea;vg.useColors=Fea;vg.destroy=Hdt.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=sHe();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 Fea(){return"colors"in vg.inspectOpts?!!vg.inspectOpts.colors:Lea.isatty(process.stderr.fd)}a(Fea,"useColors");function Uea(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:cei.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,CWs.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};P5.InlineEditRequestLogContext=Cfr;function SWs(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(SWs,"basename")});var lei=I(mut=>{"use strict";p();Object.defineProperty(mut,"__esModule",{value:!0});mut.GhostTextLogContext=void 0;var TWs=hut(),IWs=AA(),bfr=class extends TWs.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,IWs.basename)(this.filePath)} (v${this.version})`}};mut.GhostTextLogContext=bfr});var rH=I(ehe=>{"use strict";p();Object.defineProperty(ehe,"__esModule",{value:!0});ehe.CopilotTokenStore=ehe.ICopilotTokenStore=void 0;var xWs=rn(),wWs=Cc(),RWs=wo();ehe.ICopilotTokenStore=(0,xWs.createServiceIdentifier)("ICopilotTokenStore");var Sfr=class extends RWs.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new wWs.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()}};ehe.CopilotTokenStore=Sfr});var o0=I($A=>{"use strict";p();var PWs=$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},kWs=$A&&$A.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($A,"__esModule",{value:!0});$A.TelemetryTrustedValue=$A.ITelemetryService=$A.TelemetryUserConfigImpl=$A.ITelemetryUserConfig=void 0;$A.createTrackingIdGetter=NWs;$A.multiplexProperties=OWs;var uei=rn(),DWs=rH();$A.ITelemetryUserConfig=(0,uei.createServiceIdentifier)("ITelemetryUserConfig");var Tfr=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)}};$A.TelemetryUserConfigImpl=Tfr;$A.TelemetryUserConfigImpl=Tfr=PWs([kWs(2,DWs.ICopilotTokenStore)],Tfr);function NWs(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(NWs,"createTrackingIdGetter");$A.ITelemetryService=(0,uei.createServiceIdentifier)("ITelemetryService");var Ifr=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};$A.TelemetryTrustedValue=Ifr;var mDe=8192,MWs=50;function OWs(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>mDe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+mDe;o{"use strict";p();var BWs=Fo&&Fo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Fo&&Fo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FWs=Fo&&Fo.__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)&&BWs(e,t,r);return LWs(e,t),e},xfr=Fo&&Fo.__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())})},wfr=Fo&&Fo.__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 kfr=sX&&sX.__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())})},Dfr=sX&&sX.__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,k5.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 kfr(this,void 0,void 0,function(){var r,n,o;return Dfr(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,k5.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=oX.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,k5.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 k5.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return kfr(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return Dfr(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,k5.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return oX.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 mei=hei(),VWs="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",WWs="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",zWs=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{YWs.exports={}});var Aut=I(the=>{"use strict";p();var KWs=the&&the.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(the,"__esModule",{value:!0});the.JsonConfig=void 0;var JWs=require("fs"),gut=require("path"),Nfr=jl(),ZWs=KWs(Aei()),XWs="APPLICATIONINSIGHTS_CONFIGURATION_FILE",ezs="APPLICATIONINSIGHTS_CONNECTION_STRING",yei="APPSETTING_",Eei="APPINSIGHTS_INSTRUMENTATIONKEY",_ei="APPINSIGHTS_INSTRUMENTATION_KEY",tzs="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",rzs="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",nzs="http_proxy",izs="https_proxy",ozs="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",szs="APPLICATION_INSIGHTS_NO_STATSBEAT",azs="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",czs="APPLICATION_INSIGHTS_NO_PATCH_MODULES",lzs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",uzs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",dzs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",fzs="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",pzs="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",hzs=(function(){function t(){this.connectionString=process.env[ezs],this.instrumentationKey=process.env[Eei]||process.env[yei+Eei]||process.env[_ei]||process.env[yei+_ei],!this.connectionString&&this.instrumentationKey&&Nfr.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[rzs],this.extendedMetricDisablers=process.env[tzs],this.proxyHttpUrl=process.env[nzs],this.proxyHttpsUrl=process.env[izs],this.noDiagnosticChannel=!!process.env[ozs],this.disableStatsbeat=!!process.env[szs],this.noHttpAgentKeepAlive=!!process.env[azs],this.noPatchModules=process.env[czs]||"",this.enableWebInstrumentation=!!process.env[lzs]||!!process.env[fzs],this.webInstrumentationSrc=process.env[dzs]||"",this.webInstrumentationConnectionString=process.env[uzs]||process.env[pzs]||"",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=gut.join(__dirname,"../../");this._tempDir=gut.join(o,n);var s=process.env[XWs];if(s){gut.isAbsolute(s)?this._tempDir=s:this._tempDir=gut.join(o,s);try{e=JWs.readFileSync(this._tempDir,"utf8")}catch(l){Nfr.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(ZWs.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){Nfr.warn("Invalid JSON config file: ",l)}},t})();the.JsonConfig=hzs});var Mfr=I(yut=>{"use strict";p();Object.defineProperty(yut,"__esModule",{value:!0});yut.makePatchingRequire=void 0;var mzs=require("path"),gzs=_L(),vei=fp(),bei=require("module"),Azs=Object.keys(process.binding("natives")),Cei=bei.prototype.require;function yzs(t){var e={};return a(function(n){var o=Cei.apply(this,arguments);if(t[n]){var s=bei._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(Azs.indexOf(n)<0)try{c=Cei.call(this,mzs.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{Ezs.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 fp=I(Ow=>{"use strict";p();Object.defineProperty(Ow,"__esModule",{value:!0});Ow.channel=Ow.ContextPreservingEventEmitter=Ow.trueFilter=Ow.makePatchingRequire=void 0;var _zs=Mfr(),vzs=Mfr();Object.defineProperty(Ow,"makePatchingRequire",{enumerable:!0,get:a(function(){return vzs.makePatchingRequire},"get")});var Czs=a(function(t){return!0},"trueFilter");Ow.trueFilter=Czs;var Iei=(function(){function t(){this.version=Sei().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=Ow.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=Ow.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();ao();Ofr=tb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(rhe,"suppressTracing");a(xei,"unsuppressTracing");a(nH,"isTracingSuppressed")});var wei,Eut,nhe,_ut,Rei,Pei,kei,Bfr=_e(()=>{p();wei="=",Eut=";",nhe=",",_ut="baggage",Rei=180,Pei=4096,kei=8192});function vut(t){return t.reduce(function(e,r){var n=""+e+(e!==""?nhe:"")+r;return n.length>kei?e:n},"")}function Cut(t){return t.getAllEntries().map(function(e){var r=bzs(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=Eut+o.metadata.toString()),s})}function ADe(t){var e=t.split(Eut);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(wei);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=mfe(e.join(Eut))),{key:o,value:s,metadata:c}}}}}function Dei(t){return typeof t!="string"||t.length===0?{}:t.split(nhe).map(function(e){return ADe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var bzs,Lfr=_e(()=>{p();ao();Bfr();bzs=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(vut,"serializeKeyPairs");a(Cut,"getKeyPairs");a(ADe,"parsePairKeyValue");a(Dei,"parseKeyPairsIntoRecord")});var but,Nei=_e(()=>{p();ao();gDe();Bfr();Lfr();but=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=lT.getBaggage(e);if(!(!o||nH(e))){var s=Cut(o).filter(function(l){return l.length<=Pei}).slice(0,Rei),c=vut(s);c.length>0&&n.set(r,_ut,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,_ut),s=Array.isArray(o)?o.join(nhe):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(nhe);return l.forEach(function(u){var d=ADe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:lT.setBaggage(e,lT.createBaggage(c))},t.prototype.fields=function(){return[_ut]},t})()});var Mei,Oei=_e(()=>{p();Mei=(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 iH(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=Bei(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=Szs(s.value,2),l=c[0],u=c[1];if(!Ffr(l)){Pn.warn("Invalid attribute key: "+l);continue}if(!yDe(u)){Pn.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 Ffr(t){return typeof t=="string"&&t.length>0}function yDe(t){return t==null?!0:Array.isArray(t)?Tzs(t):Lei(t)}function Tzs(t){var e,r,n;try{for(var o=Bei(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(Lei(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 Lei(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var Bei,Szs,Fei=_e(()=>{p();ao();Bei=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.")},Szs=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(iH,"sanitizeAttributes");a(Ffr,"isAttributeKey");a(yDe,"isAttributeValue");a(Tzs,"isHomogeneousAttributeValueArray");a(Lei,"isValidPrimitiveAttributeValue")});function Sut(){return function(t){Pn.error(Izs(t))}}function Izs(t){return typeof t=="string"?t:JSON.stringify(xzs(t))}function xzs(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 Ufr=_e(()=>{p();ao();a(Sut,"loggingErrorHandler");a(Izs,"stringifyException");a(xzs,"flattenException")});function Qei(t){Uei=t}function X_(t){try{Uei(t)}catch{}}var Uei,Qfr=_e(()=>{p();Ufr();Uei=Sut();a(Qei,"setGlobalErrorHandler");a(X_,"globalErrorHandler")});var yb,qfr=_e(()=>{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"})(yb||(yb={}))});function Pzs(t){return Rzs.indexOf(t)>-1}function Dzs(t){return kzs.indexOf(t)>-1}function Mzs(t){return Nzs.indexOf(t)>-1}function Ozs(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Bzs(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 Lzs(t,e,r,n){n===void 0&&(n=wzs);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function Uzs(t,e,r){var n=r[t];if(typeof n=="string"){var o=Fzs[n.toUpperCase()];o!=null&&(e[t]=o)}}function _De(t){var e={};for(var r in EDe){var n=r;switch(n){case"OTEL_LOG_LEVEL":Uzs(n,e,t);break;default:if(Pzs(n))Ozs(n,e,t);else if(Dzs(n))Bzs(n,e,t);else if(Mzs(n))Lzs(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var wzs,Rzs,kzs,Nzs,aX,cX,jfr,Hfr,EDe,Fzs,Gfr=_e(()=>{p();ao();qfr();wzs=",",Rzs=["OTEL_SDK_DISABLED"];a(Pzs,"isEnvVarABoolean");kzs=["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(Dzs,"isEnvVarANumber");Nzs=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(Mzs,"isEnvVarAList");aX=1/0,cX=128,jfr=128,Hfr=128,EDe={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:wa.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:aX,OTEL_ATTRIBUTE_COUNT_LIMIT:cX,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:aX,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:cX,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:aX,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:cX,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:jfr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Hfr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:yb.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(Ozs,"parseBoolean");a(Bzs,"parseNumber");a(Lzs,"parseStringList");Fzs={ALL:wa.ALL,VERBOSE:wa.VERBOSE,DEBUG:wa.DEBUG,INFO:wa.INFO,WARN:wa.WARN,ERROR:wa.ERROR,NONE:wa.NONE};a(Uzs,"setLogLevelFromEnv");a(_De,"parseEnvironment")});function Bw(){var t=_De(process.env);return Object.assign({},EDe,t)}function ihe(){return _De(process.env)}var qei=_e(()=>{p();Gfr();a(Bw,"getEnv");a(ihe,"getEnvWithoutDefaults")});var Tut,jei=_e(()=>{p();Tut=typeof globalThis=="object"?globalThis:global});function Hei(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Iut(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(Hei,"intValue");a(Iut,"hexToBinary")});function xut(t){return Buffer.from(Iut(t)).toString("base64")}var Gei=_e(()=>{p();$fr();a(xut,"hexToBase64")});function $ei(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(wut[t-1]=1);return wut.toString("hex",0,t)},"generateId")}var Qzs,Vei,Rut,wut,Wei=_e(()=>{p();Qzs=8,Vei=16,Rut=(function(){function t(){this.generateTraceId=$ei(Vei),this.generateSpanId=$ei(Qzs)}return a(t,"RandomIdGenerator"),t})(),wut=Buffer.allocUnsafe(Vei);a($ei,"getIdGenerator")});var zei,Lw,Yei=_e(()=>{p();zei=require("perf_hooks"),Lw=zei.performance});var Put,Vfr=_e(()=>{p();Put="1.30.1"});var Kei=_e(()=>{p()});var Jei=_e(()=>{p();Kei()});var qzs,jzs,Hzs,Gzs,Zei,Xei,eti,tti,$zs,rti,nti=_e(()=>{p();qzs="process.runtime.name",jzs="telemetry.sdk.name",Hzs="telemetry.sdk.language",Gzs="telemetry.sdk.version",Zei=qzs,Xei=jzs,eti=Hzs,tti=Gzs,$zs="nodejs",rti=$zs});var iti=_e(()=>{p();nti()});var oti=_e(()=>{p()});var sti=_e(()=>{p()});var ati=_e(()=>{p();Jei();iti();oti();sti()});var ohe,oH,cti=_e(()=>{p();Vfr();ati();oH=(ohe={},ohe[Xei]="opentelemetry",ohe[Zei]="node",ohe[eti]=rti,ohe[tti]=Put,ohe)});function she(t){t.unref()}var lti=_e(()=>{p();a(she,"unrefTimer")});var uti=_e(()=>{p();qei();jei();Gei();Wei();Yei();cti();lti()});var Wfr=_e(()=>{p();uti()});function y2(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Wzs);return[r,n]}function ahe(){var t=Lw.timeOrigin;if(typeof t!="number"){var e=Lw;t=e.timing&&e.timing.fetchStart}return t}function vDe(t){var e=y2(ahe()),r=y2(typeof t=="number"?t:Lw.now());return SDe(e,r)}function fti(t){if(che(t))return t;if(typeof t=="number")return t=kut&&(r[1]-=kut,r[0]+=1),r}var dti,Vzs,Wzs,kut,gti=_e(()=>{p();Wfr();dti=9,Vzs=6,Wzs=Math.pow(10,Vzs),kut=Math.pow(10,dti);a(y2,"millisToHrTime");a(ahe,"getTimeOrigin");a(vDe,"hrTime");a(fti,"timeInputToHrTime");a(Dut,"hrTimeDuration");a(pti,"hrTimeToTimeStamp");a(hti,"hrTimeToNanoseconds");a(mti,"hrTimeToMilliseconds");a(CDe,"hrTimeToMicroseconds");a(che,"isTimeInputHrTime");a(bDe,"isTimeInput");a(SDe,"addHrTimes")});var yT,Ati=_e(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(yT||(yT={}))});var zzs,Nut,yti=_e(()=>{p();ao();zzs=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.")},Nut=(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=zzs(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Pn.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){Pn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function Eti(t){return Jzs.test(t)}function _ti(t){return Zzs.test(t)&&!Xzs.test(t)}var zfr,Yzs,Kzs,Jzs,Zzs,Xzs,vti=_e(()=>{p();zfr="[_0-9a-z-*/]",Yzs="[a-z]"+zfr+"{0,255}",Kzs="[a-z0-9]"+zfr+"{0,240}@[a-z]"+zfr+"{0,13}",Jzs=new RegExp("^(?:"+Yzs+"|"+Kzs+")$"),Zzs=/^[ -~]{0,255}[!-~]$/,Xzs=/,|=/;a(Eti,"validateKey");a(_ti,"validateValue")});var Cti,eYs,bti,Sti,Mut,Yfr=_e(()=>{p();vti();Cti=32,eYs=512,bti=",",Sti="=",Mut=(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+Sti+e.get(n)),r},[]).join(bti)},t.prototype._parse=function(e){e.length>eYs||(this._internalState=e.split(bti).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Sti);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Eti(c)&&_ti(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Cti&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Cti))))},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 Kfr(t){var e=sYs.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var TDe,IDe,tYs,rYs,nYs,iYs,oYs,sYs,Out,Tti=_e(()=>{p();ao();gDe();Yfr();TDe="traceparent",IDe="tracestate",tYs="00",rYs="(?!ff)[\\da-f]{2}",nYs="(?![0]{32})[\\da-f]{32}",iYs="(?![0]{16})[\\da-f]{16}",oYs="[\\da-f]{2}",sYs=new RegExp("^\\s?("+rYs+")-("+nYs+")-("+iYs+")-("+oYs+")(-.*)?\\s?$");a(Kfr,"parseTraceParent");Out=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=_u.getSpanContext(e);if(!(!o||nH(e)||!rb(o))){var s=tYs+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||gf.NONE).toString(16);n.set(r,TDe,s),o.traceState&&n.set(r,IDe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,TDe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=Kfr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,IDe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new Mut(typeof u=="string"?u:void 0)}return _u.setSpanContext(e,c)},t.prototype.fields=function(){return[TDe,IDe]},t})()});function Iti(t,e){return t.setValue(Jfr,e)}function xti(t){return t.deleteValue(Jfr)}function wti(t){return t.getValue(Jfr)}var Jfr,But,Rti=_e(()=>{p();ao();Jfr=tb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(But||(But={}));a(Iti,"setRPCMetadata");a(xti,"deleteRPCMetadata");a(wti,"getRPCMetadata")});var xDe,Zfr=_e(()=>{p();ao();xDe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:nb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var lhe,Xfr=_e(()=>{p();ao();lhe=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:nb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Pti,kti=_e(()=>{p();ao();Qfr();Zfr();Xfr();Pti=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(X_(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new lhe),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new lhe,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new xDe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new lhe,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new xDe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=_u.getSpanContext(e);return!l||!rb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&gf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&gf.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 Dti,Nti=_e(()=>{p();ao();Dti=(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:ZJ(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 pYs(t,e){return function(r){return t(e(r))}}function epr(t){if(!hYs(t)||mYs(t)!==aYs)return!1;var e=fYs(t);if(e===null)return!0;var r=Bti.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Mti.call(r)===dYs}function hYs(t){return t!=null&&typeof t=="object"}function mYs(t){return t==null?t===void 0?lYs:cYs:lX&&lX in Object(t)?gYs(t):AYs(t)}function gYs(t){var e=Bti.call(t,lX),r=t[lX],n=!1;try{t[lX]=void 0,n=!0}catch{}var o=Lti.call(t);return n&&(e?t[lX]=r:delete t[lX]),o}function AYs(t){return Lti.call(t)}var aYs,cYs,lYs,uYs,Mti,dYs,fYs,Oti,Bti,lX,Lti,Fti=_e(()=>{p();aYs="[object Object]",cYs="[object Null]",lYs="[object Undefined]",uYs=Function.prototype,Mti=uYs.toString,dYs=Mti.call(Object),fYs=pYs(Object.getPrototypeOf,Object),Oti=Object.prototype,Bti=Oti.hasOwnProperty,lX=Symbol?Symbol.toStringTag:void 0,Lti=Oti.toString;a(pYs,"overArg");a(epr,"isPlainObject");a(hYs,"isObjectLike");a(mYs,"baseGetTag");a(gYs,"getRawTag");a(AYs,"objectToString")});function Uut(){for(var t=[],e=0;e0;)r=Qti(r,t.shift(),0,n);return r}function tpr(t){return Fut(t)?t.slice():t}function Qti(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>yYs)){if(r++,Lut(t)||Lut(e)||qti(e))o=tpr(e);else if(Fut(t)){if(o=t.slice(),Fut(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Uti(t,u,n)||Uti(e,u,n))delete o[u];else{if(wDe(f)&&wDe(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]=Qti(o[u],d,r,n)}}}}else o=e;return o}}function Uti(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 EYs(t,e){return!(!epr(t)||!epr(e))}var yYs,jti=_e(()=>{p();Fti();yYs=20;a(Uut,"merge");a(tpr,"takeValue");a(Qti,"mergeTwoObjects");a(Uti,"wasObjectReferenced");a(Fut,"isArray");a(qti,"isFunction");a(wDe,"isObject");a(Lut,"isPrimitive");a(EYs,"shouldMerge")});function Hti(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new rpr("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 _Ys,rpr,Gti=_e(()=>{p();_Ys=(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)}})(),rpr=(function(t){_Ys(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(Hti,"callWithTimeout")});function npr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function $ti(t,e){var r,n;if(!e)return!1;try{for(var o=vYs(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(npr(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 vYs,Vti=_e(()=>{p();vYs=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(npr,"urlMatches");a($ti,"isUrlIgnored")});function Wti(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var zti=_e(()=>{p();a(Wti,"isWrapped")});var Yti,Kti=_e(()=>{p();Yti=(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 CYs,bYs,uhe,Jti=_e(()=>{p();Kti();CYs=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},bYs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();ao();gDe();a(Zti,"_export")});var eri={};xi(eri,{AlwaysOffSampler:()=>xDe,AlwaysOnSampler:()=>lhe,AnchoredClock:()=>Mei,BindOnceFuture:()=>uhe,CompositePropagator:()=>Nut,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>cX,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>aX,DEFAULT_ENVIRONMENT:()=>EDe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>jfr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>Hfr,ExportResultCode:()=>yT,ParentBasedSampler:()=>Pti,RPCType:()=>But,RandomIdGenerator:()=>Rut,SDK_INFO:()=>oH,TRACE_PARENT_HEADER:()=>TDe,TRACE_STATE_HEADER:()=>IDe,TimeoutError:()=>rpr,TraceIdRatioBasedSampler:()=>Dti,TraceState:()=>Mut,TracesSamplerValues:()=>yb,VERSION:()=>Put,W3CBaggagePropagator:()=>but,W3CTraceContextPropagator:()=>Out,_globalThis:()=>Tut,addHrTimes:()=>SDe,baggageUtils:()=>SYs,callWithTimeout:()=>Hti,deleteRPCMetadata:()=>xti,getEnv:()=>Bw,getEnvWithoutDefaults:()=>ihe,getRPCMetadata:()=>wti,getTimeOrigin:()=>ahe,globalErrorHandler:()=>X_,hexToBase64:()=>xut,hexToBinary:()=>Iut,hrTime:()=>vDe,hrTimeDuration:()=>Dut,hrTimeToMicroseconds:()=>CDe,hrTimeToMilliseconds:()=>mti,hrTimeToNanoseconds:()=>hti,hrTimeToTimeStamp:()=>pti,internal:()=>ipr,isAttributeKey:()=>Ffr,isAttributeValue:()=>yDe,isTimeInput:()=>bDe,isTimeInputHrTime:()=>che,isTracingSuppressed:()=>nH,isUrlIgnored:()=>$ti,isWrapped:()=>Wti,loggingErrorHandler:()=>Sut,merge:()=>Uut,millisToHrTime:()=>y2,otperformance:()=>Lw,parseEnvironment:()=>_De,parseTraceParent:()=>Kfr,sanitizeAttributes:()=>iH,setGlobalErrorHandler:()=>Qei,setRPCMetadata:()=>Iti,suppressTracing:()=>rhe,timeInputToHrTime:()=>fti,unrefTimer:()=>she,unsuppressTracing:()=>xei,urlMatches:()=>npr});var SYs,ipr,Eb=_e(()=>{p();Nei();Oei();Fei();Qfr();Ufr();gti();$fr();Ati();Lfr();Wfr();yti();Tti();Rti();Zfr();Xfr();kti();Nti();gDe();Yfr();Gfr();jti();qfr();Gti();Vti();zti();Jti();Vfr();Xti();SYs={getKeyPairs:Cut,serializeKeyPairs:vut,parseKeyPairsIntoRecord:Dei,parsePairKeyValue:ADe},ipr={_export:Zti}});var TYs,IYs,xYs,Qut,qut,tri,rri=_e(()=>{p();TYs="exception.type",IYs="exception.message",xYs="exception.stacktrace",Qut=TYs,qut=IYs,tri=xYs});var nri=_e(()=>{p();rri()});var iri=_e(()=>{p()});var ori=_e(()=>{p();iri()});var sri=_e(()=>{p()});var ari=_e(()=>{p()});var cri=_e(()=>{p();nri();ori();sri();ari()});var lri,uri=_e(()=>{p();lri="exception"});var opr,wYs,dri,RYs,jut,spr=_e(()=>{p();ao();Eb();cri();uri();opr=function(){return opr=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.")},dri=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},RYs=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):(Pn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=wYs(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=dri(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 Pn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Pn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),bDe(r)&&(bDe(n)||(n=r),r=void 0);var o=iH(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,RYs([],dri(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=opr({},e),this.status.message!=null&&typeof e.message!="string"&&(Pn.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()){Pn.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=Dut(this.startTime,this.endTime),this._duration[0]<0&&(Pn.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&&Pn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=Lw.now())return vDe(e+this._performanceOffset);if(typeof e=="number")return y2(e);if(e instanceof Date)return y2(e.getTime());if(che(e))return e;if(this._startTimeProvided)return y2(Date.now());var r=Lw.now()-this._performanceStartTime;return SDe(this.startTime,y2(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[qut]=e:e&&(e.code?n[Qut]=e.code.toString():e.name&&(n[Qut]=e.name),e.message&&(n[qut]=e.message),e.stack&&(n[tri]=e.stack)),n[Qut]||n[qut]?this.addEvent(lri,n,r):Pn.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&&Pn.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?(Pn.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 E2,RDe=_e(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(E2||(E2={}))});var sH,Hut=_e(()=>{p();RDe();sH=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:E2.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var D5,Gut=_e(()=>{p();RDe();D5=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:E2.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var dhe,apr=_e(()=>{p();ao();Eb();Hut();Gut();dhe=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(X_(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new D5),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new D5,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new sH,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new D5,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new sH}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=_u.getSpanContext(e);return!l||!rb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&gf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&gf.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 PDe,cpr=_e(()=>{p();ao();RDe();PDe=(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:ZJ(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 $ut(){var t=Bw();return{sampler:lpr(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 lpr(t){switch(t===void 0&&(t=Bw()),t.OTEL_TRACES_SAMPLER){case yb.AlwaysOn:return new D5;case yb.AlwaysOff:return new sH;case yb.ParentBasedAlwaysOn:return new dhe({root:new D5});case yb.ParentBasedAlwaysOff:return new dhe({root:new sH});case yb.TraceIdRatio:return new PDe(fri(t));case yb.ParentBasedTraceIdRatio:return new dhe({root:new PDe(fri(t))});default:return Pn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+PYs+'".'),new D5}}function fri(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Pn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+fhe+"."),fhe;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Pn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+fhe+"."),fhe):e<0||e>1?(Pn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+fhe+"."),fhe):e}var PYs,fhe,upr=_e(()=>{p();ao();Eb();Hut();Gut();apr();cpr();PYs=yb.AlwaysOn,fhe=1;a($ut,"loadDefaultConfig");a(lpr,"buildSamplerFromEnv");a(fri,"getSamplerProbabilityFromEnv")});function pri(t){var e={sampler:lpr()},r=$ut(),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 hri(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=ihe();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:cX,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:aX,Object.assign({},t,{spanLimits:g})}var dpr=_e(()=>{p();upr();Eb();a(pri,"mergeConfig");a(hri,"reconfigureLimits")});var mri,gri=_e(()=>{p();ao();Eb();mri=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=Bw();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 uhe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Pn.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&gf.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&&Pn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Pn.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,X_(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),she(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var kYs,phe,Ari=_e(()=>{p();gri();kYs=(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)}})(),phe=(function(t){kYs(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(mri)});function yri(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Vut[t-1]=1);return Vut.toString("hex",0,t)},"generateId")}var DYs,Eri,hhe,Vut,_ri=_e(()=>{p();DYs=8,Eri=16,hhe=(function(){function t(){this.generateTraceId=yri(Eri),this.generateSpanId=yri(DYs)}return a(t,"RandomIdGenerator"),t})(),Vut=Buffer.allocUnsafe(Eri);a(yri,"getIdGenerator")});var vri=_e(()=>{p();Ari();_ri()});var Wut=_e(()=>{p();vri()});var zut,fpr=_e(()=>{p();ao();Eb();spr();dpr();Wut();zut=(function(){function t(e,r,n){this._tracerProvider=n;var o=pri(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new hhe,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=_u.deleteSpan(n));var l=_u.getSpan(n);if(nH(n)){Pn.debug("Instrumentation suppressed, returning Noop Span");var u=_u.wrapSpanContext(gfe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!_u.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:Afe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:iH(R.attributes)}}),E=iH(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===nb.RECORD_AND_SAMPLED?gf.SAMPLED:gf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===nb.NOT_RECORD){Pn.debug("Recording is off, propagating context in a non-recording span");var u=_u.wrapSpanContext(b);return u}var T=iH(Object.assign(E,_.attributes)),w=new jut(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=_u.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 Cri=_e(()=>{p()});var bri=_e(()=>{p();Cri()});var NYs,MYs,OYs,BYs,Sri,ppr,hpr,mpr,Tri=_e(()=>{p();NYs="service.name",MYs="telemetry.sdk.name",OYs="telemetry.sdk.language",BYs="telemetry.sdk.version",Sri=NYs,ppr=MYs,hpr=OYs,mpr=BYs});var Iri=_e(()=>{p();Tri()});var xri=_e(()=>{p()});var wri=_e(()=>{p()});var Rri=_e(()=>{p();bri();Iri();xri();wri()});function Yut(){return"unknown_service:"+process.argv0}var Pri=_e(()=>{p();a(Yut,"defaultServiceName")});var kri=_e(()=>{p();Pri()});var Dri=_e(()=>{p();kri()});var aH,LYs,FYs,UYs,Kut,Nri=_e(()=>{p();ao();Rri();Eb();Dri();aH=function(){return aH=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},Kut=(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 Pn.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[Sri]=Yut(),e[hpr]=oH[hpr],e[ppr]=oH[ppr],e[mpr]=oH[mpr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Pn.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 LYs(this,void 0,void 0,function(){return FYs(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=aH(aH({},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=UYs(c,2),d=u[0],f=u[1];return aH(aH(aH(aH({},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 Mri=_e(()=>{p();Nri()});var Jut,gpr,Ori=_e(()=>{p();Eb();Jut=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.")},gpr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Jut(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){X_(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Jut(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=Jut(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=Jut(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 Zut,Apr=_e(()=>{p();Zut=(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 QYs,qYs,UF,Bri,Lri=_e(()=>{p();ao();Eb();Mri();fpr();upr();Ori();Apr();Wut();dpr();QYs=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},qYs=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(Bw().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Pn.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 Nut({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=Bw().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Pn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Out}],["baggage",function(){return new but}]]),t._registeredExporters=new Map,t})()});var jYs,Fri,Uri=_e(()=>{p();Eb();jYs=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.")},Fri=(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:CDe(e.startTime),duration:CDe(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=jYs(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:yT.SUCCESS})},t})()});var HYs,GYs,Qri,qri=_e(()=>{p();Eb();HYs=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},GYs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();ao();Eb();$Ys=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())})},VYs=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]sH,AlwaysOnSampler:()=>D5,BasicTracerProvider:()=>Bri,BatchSpanProcessor:()=>phe,ConsoleSpanExporter:()=>Fri,ForceFlushState:()=>UF,InMemorySpanExporter:()=>Qri,NoopSpanProcessor:()=>Zut,ParentBasedSampler:()=>dhe,RandomIdGenerator:()=>hhe,SamplingDecision:()=>E2,SimpleSpanProcessor:()=>jri,Span:()=>jut,TraceIdRatioBasedSampler:()=>PDe,Tracer:()=>zut});var $ri=_e(()=>{p();fpr();Lri();Wut();Uri();qri();Hri();Apr();Hut();Gut();apr();cpr();RDe();spr()});var kDe,Vri,ypr=_e(()=>{p();kDe=class{static{a(this,"NoopLogger")}emit(e){}},Vri=new kDe});var Epr,Xut,_pr=_e(()=>{p();ypr();Epr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new kDe}},Xut=new Epr});var edt,Wri=_e(()=>{p();ypr();edt=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):Vri}}});var DDe,zri=_e(()=>{p();_pr();Wri();DDe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new edt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Xut}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 tdt,Yri=_e(()=>{p();tdt=typeof globalThis=="object"?globalThis:global});var Kri=_e(()=>{p();Yri()});var Jri=_e(()=>{p();Kri()});function Zri(t,e,r){return n=>n===t?e:r}var NDe,mhe,vpr,Xri=_e(()=>{p();Jri();NDe=Symbol.for("io.opentelemetry.js.api.logs"),mhe=tdt;a(Zri,"makeGetter");vpr=1});var rdt,eni=_e(()=>{p();Xri();_pr();zri();rdt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new DDe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return mhe[NDe]?this.getLoggerProvider():(mhe[NDe]=Zri(vpr,e,Xut),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=mhe[NDe])===null||e===void 0?void 0:e.call(mhe,vpr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete mhe[NDe],this._proxyLoggerProvider=new DDe}}});var ndt,Cpr=_e(()=>{p();eni();ndt=rdt.getInstance()});function tni(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var nni=_e(()=>{p();a(tni,"enableInstrumentations");a(rni,"disableInstrumentations")});function ini(t){let e=t.tracerProvider||_u.getTracerProvider(),r=t.meterProvider||XJ.getMeterProvider(),n=t.loggerProvider||ndt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return tni(o,e,r,n),()=>{rni(o)}}var oni=_e(()=>{p();ao();Cpr();nni();a(ini,"registerInstrumentations")});function dni(t,e,r){if(!YYs(t))return Pn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=XYs(t);if(!n)return!1;let o=[],s=fni(n,e,o,r);return s&&!r?.includePrerelease?JYs(n,o):s}function YYs(t){return typeof t=="string"&&uni.test(t)}function fni(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(bpr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=_Ks(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!bpr(t,s,r,n))return!1;return!0}return bpr(t,e,r,n)}function bpr(t,e,r,n){if(e=ZYs(e,n),e.includes(" "))return fni(t,e,r,n);{let o=eKs(e);return r.push(o),KYs(t,o)}}function KYs(t,e){if(e.invalid)return!1;if(!e.version||Tpr(e.version))return!0;let r=ani(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=ani(n,o)}return zYs[e.op]?.includes(r)}function JYs(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function ZYs(t,e){return t=t.trim(),t=yKs(t,e),t=AKs(t),t=EKs(t,e),t=t.trim(),t}function ev(t){return!t||t.toLowerCase()==="x"||t==="*"}function XYs(t){let e=t.match(uni);if(!e){Pn.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 eKs(t){if(!t)return{};let e=t.match(WYs);if(!e)return Pn.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 Tpr(t){return t==="*"||t==="x"||t==="X"}function sni(t){let e=parseInt(t,10);return isNaN(e)?t:e}function tKs(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 rKs(t,e){if(Tpr(t)||Tpr(e))return 0;let[r,n]=tKs(sni(t),sni(e));return r>n?1:r{let l;return ev(n)?l="":ev(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:ev(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 yKs(t,e){let r=gKs,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return ev(s)?d="":ev(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:ev(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 EKs(t,e){let r=cKs;return t.replace(r,(n,o,s,c,l,u)=>{let d=ev(s),f=d||ev(c),h=f||ev(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 _Ks(t,e){let r=uKs;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(ev(s)?o="":ev(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:ev(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,ev(h)?f="":ev(m)?f=`<${+h+1}.0.0-0`:ev(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 uni,WYs,zYs,pni,hni,nKs,iKs,cni,oKs,lni,sKs,Spr,MDe,aKs,cKs,lKs,uKs,dKs,fKs,pKs,hKs,mKs,gKs,mni=_e(()=>{p();ao();uni=/^(?: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-]+)*))?$/,WYs=/^(?<|>|=|==|<=|>=|~|\^|~>)?\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-]+)*))?$/,zYs={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(dni,"satisfies");a(YYs,"_validateVersion");a(fni,"_doSatisfies");a(bpr,"_checkRange");a(KYs,"_satisfies");a(JYs,"_doPreleaseCheck");a(ZYs,"_normalizeRange");a(ev,"isX");a(XYs,"_parseVersion");a(eKs,"_parseRange");a(Tpr,"_isWildcard");a(sni,"_parseVersionString");a(tKs,"_normalizeVersionType");a(rKs,"_compareVersionStrings");a(ani,"_compareVersionSegments");pni="[a-zA-Z0-9-]",hni="0|[1-9]\\d*",nKs=`\\d*[a-zA-Z-]${pni}*`,iKs="((?:<|>)?=?)",cni=`(?:${hni}|${nKs})`,oKs=`(?:-(${cni}(?:\\.${cni})*))`,lni=`${pni}+`,sKs=`(?:\\+(${lni}(?:\\.${lni})*))`,Spr=`${hni}|x|X|\\*`,MDe=`[v=\\s]*(${Spr})(?:\\.(${Spr})(?:\\.(${Spr})(?:${oKs})?${sKs}?)?)?`,aKs=`^${iKs}\\s*${MDe}$`,cKs=new RegExp(aKs),lKs=`^\\s*(${MDe})\\s+-\\s+(${MDe})\\s*$`,uKs=new RegExp(lKs),dKs="(?:~>?)",fKs=`^${dKs}${MDe}$`,pKs=new RegExp(fKs),hKs="(?:\\^)",mKs=`^${hKs}${MDe}$`,gKs=new RegExp(mKs);a(AKs,"replaceTilde");a(yKs,"replaceCaret");a(EKs,"replaceXRange");a(_Ks,"replaceHyphen")});var ghe=I((Cjf,yni)=>{"use strict";p();function Ipr(t){return typeof t=="function"}a(Ipr,"isFunction");var tv=console.error.bind(console);function ODe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(ODe,"defineProperty");function BDe(t){t&&t.logger&&(Ipr(t.logger)?tv=t.logger:tv("new logger isn't a function, not replacing"))}a(BDe,"shimmer");function gni(t,e,r){if(!t||!t[e]){tv("no original function "+e+" to wrap");return}if(!r){tv("no wrapper function"),tv(new Error().stack);return}if(!Ipr(t[e])||!Ipr(r)){tv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return ODe(o,"__original",n),ODe(o,"__unwrap",function(){t[e]===o&&ODe(t,e,n)}),ODe(o,"__wrapped",!0),ODe(t,e,o),o}a(gni,"wrap");function vKs(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{tv("must provide one or more modules to patch"),tv(new Error().stack);return}if(!(e&&Array.isArray(e))){tv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){gni(n,o,r)})})}a(vKs,"massWrap");function Ani(t,e){if(!t||!t[e]){tv("no function to unwrap."),tv(new Error().stack);return}if(!t[e].__unwrap)tv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Ani,"unwrap");function CKs(t,e){if(t)Array.isArray(t)||(t=[t]);else{tv("must provide one or more modules to patch"),tv(new Error().stack);return}if(!(e&&Array.isArray(e))){tv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Ani(r,n)})})}a(CKs,"massUnwrap");BDe.wrap=gni;BDe.massWrap=vKs;BDe.unwrap=Ani;BDe.massUnwrap=CKs;yni.exports=BDe});var cH,idt,Eni=_e(()=>{p();ao();Cpr();cH=he(ghe()),idt=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=Pn.createComponentLogger({namespace:e}),this._tracer=_u.getTracer(e,r),this._meter=XJ.getMeter(e,r),this._logger=ndt.getLogger(e,r),this._updateMetricInstruments()}_wrap=cH.wrap;_unwrap=cH.unwrap;_massWrap=cH.massWrap;_massUnwrap=cH.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 vni=I((Pjf,_ni)=>{p();var Ahe=1e3,yhe=Ahe*60,Ehe=yhe*60,uX=Ehe*24,bKs=uX*7,SKs=uX*365.25;_ni.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return TKs(t);if(r==="number"&&isFinite(t))return e.long?xKs(t):IKs(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function TKs(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*SKs;case"weeks":case"week":case"w":return r*bKs;case"days":case"day":case"d":return r*uX;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ehe;case"minutes":case"minute":case"mins":case"min":case"m":return r*yhe;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ahe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(TKs,"parse");function IKs(t){var e=Math.abs(t);return e>=uX?Math.round(t/uX)+"d":e>=Ehe?Math.round(t/Ehe)+"h":e>=yhe?Math.round(t/yhe)+"m":e>=Ahe?Math.round(t/Ahe)+"s":t+"ms"}a(IKs,"fmtShort");function xKs(t){var e=Math.abs(t);return e>=uX?odt(t,e,uX,"day"):e>=Ehe?odt(t,e,Ehe,"hour"):e>=yhe?odt(t,e,yhe,"minute"):e>=Ahe?odt(t,e,Ahe,"second"):t+" ms"}a(xKs,"fmtLong");function odt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(odt,"plural")});var xpr=I((Njf,Cni)=>{p();function wKs(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=vni(),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(wKs,"setup");Cni.exports=wKs});var bni=I((_b,sdt)=>{p();_b.formatArgs=PKs;_b.save=kKs;_b.load=DKs;_b.useColors=RKs;_b.storage=NKs();_b.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`."))}})();_b.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 RKs(){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(RKs,"useColors");function PKs(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+sdt.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(PKs,"formatArgs");_b.log=console.debug||console.log||(()=>{});function kKs(t){try{t?_b.storage.setItem("debug",t):_b.storage.removeItem("debug")}catch{}}a(kKs,"save");function DKs(){let t;try{t=_b.storage.getItem("debug")||_b.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(DKs,"load");function NKs(){try{return localStorage}catch{}}a(NKs,"localstorage");sdt.exports=xpr()(_b);var{formatters:MKs}=sdt.exports;MKs.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Tni=I((Sg,cdt)=>{p();var OKs=require("tty"),adt=require("util");Sg.init=jKs;Sg.log=UKs;Sg.formatArgs=LKs;Sg.save=QKs;Sg.load=qKs;Sg.useColors=BKs;Sg.destroy=adt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Sg.colors=[6,2,3,4,5,1];try{let t=Dje();t&&(t.stderr||t).level>=2&&(Sg.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{}Sg.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 BKs(){return"colors"in Sg.inspectOpts?!!Sg.inspectOpts.colors:OKs.isatty(process.stderr.fd)}a(BKs,"useColors");function LKs(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+"+Gdt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Qea()+e+" "+t[0]}a(Uea,"formatArgs");function Qea(){return vg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Qea,"getDate");function qea(...t){return process.stderr.write(Hdt.formatWithOptions(vg.inspectOpts,...t)+` -`)}a(qea,"log");function jea(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(jea,"save");function Hea(){return process.env.DEBUG}a(Hea,"load");function Gea(t){t.inspectOpts={};let e=Object.keys(vg.inspectOpts);for(let r=0;re.trim()).join(" ")};zii.O=function(t){return this.inspectOpts.colors=this.useColors,Hdt.inspect(t,this.inspectOpts)}});var Kii=I((xWf,Dhr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Dhr.exports=Wii():Dhr.exports=Yii()});var Mhr=I((RWf,Jii)=>{"use strict";p();var Nhr=require("path").sep;Jii.exports=function(t){var e=t.split(Nhr),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]+Nhr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Nhr;return{name:o,basedir:c,path:d}}}});var Ohr=I((PWf,Zii)=>{"use strict";p();var $ea=require("os");Zii.exports=$ea.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 Bhr=I((MWf,Xii)=>{p();Xii.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 eoi=I((BWf,uNe)=>{"use strict";p();var Vea=process.platform==="win32",Wea=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Lhr={};function zea(t){return Wea.exec(t).slice(1)}a(zea,"win32SplitPath");Lhr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=zea(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 Yea=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Fhr={};function Kea(t){return Yea.exec(t).slice(1)}a(Kea,"posixSplitPath");Fhr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Kea(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]}};Vea?uNe.exports=Lhr.parse:uNe.exports=Fhr.parse;uNe.exports.posix=Fhr.parse;uNe.exports.win32=Lhr.parse});var Uhr=I((UWf,ioi)=>{p();var noi=require("path"),toi=noi.parse||eoi(),roi=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=toi(e);s.dir!==o[o.length-1];)o.push(s.dir),s=toi(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return noi.resolve(n,l,u)}))},[])},"getNodeModulesDirs");ioi.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 roi(e,o)},r);var s=roi(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Qhr=I((jWf,ooi)=>{p();ooi.exports=function(t,e){return e||{}}});var coi=I((GWf,aoi)=>{"use strict";p();var Jea="Function.prototype.bind called on incompatible ",Zea=Object.prototype.toString,Xea=Math.max,eta="[object Function]",soi=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var nta=coi();loi.exports=Function.prototype.bind||nta});var foi=I((YWf,doi)=>{"use strict";p();var ita=Function.prototype.call,ota=Object.prototype.hasOwnProperty,sta=uoi();doi.exports=sta.call(ita,ota)});var poi=I((JWf,ata)=>{ata.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 dNe=I((ZWf,goi)=>{"use strict";p();var cta=foi();function lta(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(lta,"specifierIncluded");function hoi(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 wX=require("fs"),dta=Ohr(),s0=require("path"),fta=Bhr(),pta=Uhr(),hta=Qhr(),mta=dNe(),gta=process.platform!=="win32"&&wX.realpath&&typeof wX.realpath.native=="function"?wX.realpath.native:wX.realpath,Aoi=dta(),Ata=a(function(){return[s0.join(Aoi,".node_modules"),s0.join(Aoi,".node_libraries")]},"defaultPaths"),yta=a(function(e,r){wX.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"),Eta=a(function(e,r){wX.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),_ta=a(function(e,r){gta(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),fNe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Cta=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"),vta=a(function(e,r,n){for(var o=pta(r,n,e),s=0;s{bta.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 Soi=I((ozf,boi)=>{"use strict";p();var Sta=dNe(),Coi=_oi(),voi={};for($dt in Coi)Object.prototype.hasOwnProperty.call(Coi,$dt)&&(voi[$dt]=Sta($dt));var $dt;boi.exports=voi});var Ioi=I((azf,Toi)=>{p();var Tta=dNe();Toi.exports=a(function(e){return Tta(e)},"isCore")});var Roi=I((uzf,woi)=>{p();var Ita=dNe(),RX=require("fs"),yE=require("path"),xta=Ohr(),wta=Bhr(),Rta=Uhr(),kta=Qhr(),Pta=process.platform!=="win32"&&RX.realpathSync&&typeof RX.realpathSync.native=="function"?RX.realpathSync.native:RX.realpathSync,xoi=xta(),Dta=a(function(){return[yE.join(xoi,".node_modules"),yE.join(xoi,".node_libraries")]},"defaultPaths"),Nta=a(function(e){try{var r=RX.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"),Mta=a(function(e){try{var r=RX.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),Ota=a(function(e){try{return Pta(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),pNe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),Bta=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),Lta=a(function(e,r,n){for(var o=Rta(r,n,e),s=0;s{p();var Vdt=Eoi();Vdt.core=Soi();Vdt.isCore=Ioi();Vdt.sync=Roi();koi.exports=Vdt});var Poi=I((mzf,Fta)=>{Fta.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 $hr=I((gzf,Ghr)=>{"use strict";p();var Ghe=require("path"),w2=require("module"),Xp=Kii()("require-in-the-middle"),Uta=Mhr();Ghr.exports=hNe;Ghr.exports.Hook=hNe;var jhr,Hhe;if(w2.isBuiltin)Hhe=w2.isBuiltin;else if(w2.builtinModules)Hhe=a(t=>t.startsWith("node:")?!0:(jhr===void 0&&(jhr=new Set(w2.builtinModules)),jhr.has(t)),"isCore");else{let t=qhr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?Hhe=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):Hhe=a(n=>!!t.core[n],"isCore")}var Wdt;function Qta(t,e){if(!Wdt)if(require.resolve&&require.resolve.paths)Wdt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=qhr();Wdt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Wdt(t,e)}a(Qta,"resolve");var qta=/([/\\]index)?(\.js)?$/,Hhr=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:(Xp('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function hNe(t,e,r){if(!(this instanceof hNe))return new hNe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof w2._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof w2._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,Poi().bugs.url);return}this._cache=new Hhr,this._unhooked=!1,this._origRequire=w2.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);Xp("registering require hook"),this._require=w2.prototype.require=function(u){return n._unhooked===!0?(Xp("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?(Xp("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=Hhe(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);Hhe(v)&&(m=v)}}else{if(d)return Xp("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=w2._resolveFilename(f,this)}catch(v){return Xp('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(Xp("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return Xp("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 Xp("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 Xp("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=Ghe.parse(m);g=v.name,A=v.dir}else{let v=Uta(m);if(v===void 0)return Xp("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=jta(v);Xp("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=Qta(g,A)}catch{return Xp("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+Ghe.sep+Ghe.relative(A,m),Xp("preparing to process require of internal file: %s",g);else return Xp("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),Xp("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),Xp("returning module: %s",g),_}a(l,"patchedRequire")}a(hNe,"Hook");hNe.prototype.unhook=function(){this._unhooked=!0,this._require===w2.prototype.require?(w2.prototype.require=this._origRequire,Xp("require unhook successful")):Xp("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Xp("process.getBuiltinModule unhook successful")):Xp("process.getBuiltinModule unhook unsuccessful"))};function jta(t){let e=Ghe.sep!=="/"?t.path.split(Ghe.sep).join("/"):t.path;return Ghe.posix.join(t.name,e).replace(qta,"")}a(jta,"resolveModuleName")});var zdt,Ydt,Doi=me(()=>{p();zdt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Ydt=class{static{a(this,"ModuleNameTrie")}_trie=new zdt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new zdt,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 Gta(t){return Vhr.sep!=="/"?t.split(Vhr.sep).join("/"):t}var Moi,Vhr,Hta,Kdt,Ooi=me(()=>{p();Moi=ce($hr()),Vhr=ce(require("path"));Doi();Hta=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Kdt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Ydt;static _instance;constructor(){this._initialize()}_initialize(){new Moi.Hook(null,{internals:!0},(e,r,n)=>{let o=Gta(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 Hta?new t:this._instance=this._instance??new t}};a(Gta,"normalizePathSeparators")});var qoi=I(kX=>{p();var Boi=[],Whr=new WeakMap,Loi=new WeakMap,Foi=new Map,Uoi=[],$ta={set(t,e,r){return Whr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=Loi.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 Whr.get(t)[e](r.value)}};function Vta(t,e,r,n,o){Foi.set(t,o),Whr.set(e,r),Loi.set(e,n);let s=new Proxy(e,$ta);Boi.forEach(c=>c(t,s)),Uoi.push([t,s])}a(Vta,"register");var Qoi=!1;function Wta(){return Qoi}a(Wta,"getExperimentalPatchInternals");function zta(t){Qoi=t}a(zta,"setExperimentalPatchInternals");kX.register=Vta;kX.importHooks=Boi;kX.specifiers=Foi;kX.toHook=Uoi;kX.getExperimentalPatchInternals=Wta;kX.setExperimentalPatchInternals=zta});var Woi=I((Rzf,$he)=>{p();var joi=require("path"),Yta=Mhr(),{fileURLToPath:Hoi}=require("url"),{MessageChannel:Kta}=require("worker_threads"),{importHooks:zhr,specifiers:Jta,toHook:Zta,getExperimentalPatchInternals:Xta}=qoi();function $oi(t){zhr.push(t),Zta.forEach(([e,r])=>t(e,r))}a($oi,"addHook");function Voi(t){let e=zhr.indexOf(t);e>-1&&zhr.splice(e,1)}a(Voi,"removeHook");function Goi(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(Goi,"callHookFn");var Yhr;function era(){let{port1:t,port2:e}=new Kta,r=0,n;Yhr=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(era,"createAddHookMessageChannel");function mNe(t,e,r){if(!(this instanceof mNe))return new mNe(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;Yhr&&Array.isArray(t)&&Yhr(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=Hoi(o)}catch{}let d=Yta(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+joi.sep+joi.relative(u,Hoi(c));else if(!Xta()&&!u.endsWith(Jta.get(c)))continue}Goi(r,s,o,u)}}else Goi(r,s,o,u)},$oi(this._iitmHook)}a(mNe,"Hook");mNe.prototype.unhook=function(){Voi(this._iitmHook)};$he.exports=mNe;$he.exports.Hook=mNe;$he.exports.addHook=$oi;$he.exports.removeHook=Voi;$he.exports.createAddHookMessageChannel=era});function zoi(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 Yoi(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 Jdt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var Khr=me(()=>{p();a(zoi,"safeExecuteInTheMiddle");a(Yoi,"safeExecuteInTheMiddleAsync");a(Jdt,"isWrapped")});function Koi(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>Oii(e,n,{includePrerelease:r}))}var t8,Jhr,gNe,Joi,Zoi,Xoi,Vhe,esi=me(()=>{p();t8=ce(require("path")),Jhr=require("util");Uii();gNe=ce(Uhe());Hii();Ooi();Joi=ce(Woi());co();Zoi=ce($hr()),Xoi=require("fs");Khr();Vhe=class extends Qdt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Kdt.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(Jdt(e[r])&&this._unwrap(e,r),Jhr.types.isProxy(e)){let o=(0,gNe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,gNe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>Jhr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,gNe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{kn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){kn.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{kn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){kn.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,Xoi.readFileSync)(t8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{kn.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 Koi(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=t8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Koi(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&&t8.isAbsolute(l)){let d=t8.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=t8.isAbsolute(e.name)?new Zoi.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new Joi.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(Koi,"isSupported")});var ANe,tsi=me(()=>{p();ANe=require("path")});var rsi=me(()=>{p();esi();tsi()});var Zhr=me(()=>{p();rsi()});var Zdt,nsi=me(()=>{p();Zdt=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 Xdt,isi=me(()=>{p();Zhr();Xdt=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,ANe.normalize)(e)}}});var Xhr={};wi(Xhr,{InstrumentationBase:()=>Vhe,InstrumentationNodeModuleDefinition:()=>Zdt,InstrumentationNodeModuleFile:()=>Xdt,isWrapped:()=>Jdt,registerInstrumentations:()=>wii,safeExecuteInTheMiddle:()=>zoi,safeExecuteInTheMiddleAsync:()=>Yoi});var e0r=me(()=>{p();Rii();Zhr();nsi();isi();Khr()});var ssi=I(t0r=>{"use strict";p();Object.defineProperty(t0r,"__esModule",{value:!0});t0r.log=ira;var osi=(OL(),Ca(E7)),tra=require("node:os"),rra=osi.__importDefault(require("node:util")),nra=osi.__importStar(require("node:process"));function ira(t,...e){nra.stderr.write(`${rra.default.format(t,...e)}${tra.EOL}`)}a(ira,"log")});var dsi=I(s0r=>{"use strict";p();Object.defineProperty(s0r,"__esModule",{value:!0});var ora=ssi(),asi=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,csi,r0r=[],n0r=[],eft=[];asi&&i0r(asi);var lsi=Object.assign(t=>usi(t),{enable:i0r,enabled:o0r,disable:sra,log:ora.log});function i0r(t){csi=t,r0r=[],n0r=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?n0r.push(new RegExp(`^${n.substr(1)}$`)):r0r.push(new RegExp(`^${n}$`));for(let n of eft)n.enabled=o0r(n.namespace)}a(i0r,"enable");function o0r(t){if(t.endsWith("*"))return!0;for(let e of n0r)if(e.test(t))return!1;for(let e of r0r)if(e.test(t))return!0;return!1}a(o0r,"enabled");function sra(){let t=csi||"";return i0r(""),t}a(sra,"disable");function usi(t){let e=Object.assign(r,{enabled:o0r(t),destroy:ara,log:lsi.log,namespace:t,extend:cra});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),eft.push(e),e}a(usi,"createDebugger");function ara(){let t=eft.indexOf(this);return t>=0?(eft.splice(t,1),!0):!1}a(ara,"destroy");function cra(t){let e=usi(`${this.namespace}:${t}`);return e.log=this.log,e}a(cra,"extend");s0r.default=lsi});var ift=I($5=>{"use strict";p();Object.defineProperty($5,"__esModule",{value:!0});$5.AzureLogger=void 0;$5.setLogLevel=hsi;$5.getLogLevel=ura;$5.createClientLogger=dra;var lra=(OL(),Ca(E7)),yNe=lra.__importDefault(dsi()),psi=new Set,tft=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,nft;$5.AzureLogger=(0,yNe.default)("azure");$5.AzureLogger.log=(...t)=>{yNe.default.log(...t)};var a0r=["verbose","info","warning","error"];tft&&(Asi(tft)?hsi(tft):console.error(`AZURE_LOG_LEVEL set to unknown log level '${tft}'; logging is not enabled. Acceptable values: ${a0r.join(", ")}.`));function hsi(t){if(t&&!Asi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${a0r.join(",")}`);nft=t;let e=[];for(let r of psi)gsi(r)&&e.push(r.namespace);yNe.default.enable(e.join(","))}a(hsi,"setLogLevel");function ura(){return nft}a(ura,"getLogLevel");var fsi={verbose:400,info:300,warning:200,error:100};function dra(t){let e=$5.AzureLogger.extend(t);return msi($5.AzureLogger,e),{error:rft(e,"error"),warning:rft(e,"warning"),info:rft(e,"info"),verbose:rft(e,"verbose")}}a(dra,"createClientLogger");function msi(t,e){e.log=(...r)=>{t.log(...r)}}a(msi,"patchLogMethod");function rft(t,e){let r=Object.assign(t.extend(e),{level:e});if(msi(t,r),gsi(r)){let n=yNe.default.disable();yNe.default.enable(n+","+r.namespace)}return psi.add(r),r}a(rft,"createLogger");function gsi(t){return!!(nft&&fsi[t.level]<=fsi[nft])}a(gsi,"shouldEnable");function Asi(t){return a0r.includes(t)}a(Asi,"isAzureLogLevel")});var c0r=I(oft=>{"use strict";p();Object.defineProperty(oft,"__esModule",{value:!0});oft.logger=void 0;var fra=ift();oft.logger=(0,fra.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function sft(t){return t.setValue(l0r,!0)}function ysi(t){return t.deleteValue(l0r)}function Whe(t){return t.getValue(l0r)===!0}var l0r,ENe=me(()=>{p();co();l0r=hb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(sft,"suppressTracing");a(ysi,"unsuppressTracing");a(Whe,"isTracingSuppressed")});var aft,Esi=me(()=>{p();aft="baggage"});function Csi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function vsi(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 u0r(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=Cpe(e.join(";"))),{key:o,value:s,metadata:c}}function bsi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=u0r(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var d0r=me(()=>{p();co();a(Csi,"serializeKeyPairs");a(vsi,"getKeyPairs");a(u0r,"parsePairKeyValue");a(bsi,"parseKeyPairsIntoRecord")});var lft,Ssi=me(()=>{p();co();ENe();Esi();d0r();lft=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=yT.getBaggage(e);if(!o||Whe(e))return;let s=vsi(o).filter(l=>l.length<=4096).slice(0,180),c=Csi(s);c.length>0&&n.set(r,aft,c)}extract(e,r,n){let o=n.get(r,aft),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=u0r(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[aft]}}});var uft,Tsi=me(()=>{p();uft=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 Isi(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(!mra(r)){kn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!f0r(n)){kn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function mra(t){return typeof t=="string"&&t!==""}function f0r(t){return t==null?!0:Array.isArray(t)?gra(t):xsi(typeof t)}function gra(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(xsi(n)){e=n;continue}return!1}return!1}}return!0}function xsi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var wsi=me(()=>{p();co();a(Isi,"sanitizeAttributes");a(mra,"isAttributeKey");a(f0r,"isAttributeValue");a(gra,"isHomogeneousAttributeValueArray");a(xsi,"isValidPrimitiveAttributeValueType")});function dft(){return t=>{kn.error(Ara(t))}}function Ara(t){return typeof t=="string"?t:JSON.stringify(yra(t))}function yra(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 p0r=me(()=>{p();co();a(dft,"loggingErrorHandler");a(Ara,"stringifyException");a(yra,"flattenException")});function ksi(t){Rsi=t}function Psi(t){try{Rsi(t)}catch{}}var Rsi,Dsi=me(()=>{p();p0r();Rsi=dft();a(ksi,"setGlobalErrorHandler");a(Psi,"globalErrorHandler")});function fft(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){kn.warn(`Unknown value ${(0,h0r.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function _Ne(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function pft(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||kn.warn(`Unknown value ${(0,h0r.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function hft(t){return _Ne(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var h0r,Nsi=me(()=>{p();co();h0r=require("util");a(fft,"getNumberFromEnv");a(_Ne,"getStringFromEnv");a(pft,"getBooleanFromEnv");a(hft,"getStringListFromEnv")});var mft,Msi=me(()=>{p();mft=typeof globalThis=="object"?globalThis:global});var Osi,xH,Bsi=me(()=>{p();Osi=require("perf_hooks"),xH=Osi.performance});var Lsi,Fsi=me(()=>{p();Lsi="2.2.0"});function eh(t){let e={},r=t.length;for(let n=0;n{p();a(eh,"createConstMap")});var Usi,Qsi,qsi,jsi,Hsi,Gsi,$si,Vsi,Wsi,zsi,Ysi,Ksi,Jsi,Zsi,Xsi,eai,tai,rai,nai,iai,oai,sai,aai,cai,lai,uai,dai,fai,pai,hai,mai,gai,Aai,yai,Eai,_ai,Cai,vai,bai,Sai,Tai,Iai,xai,wai,Rai,kai,Pai,Dai,Nai,Mai,Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,Cci,vci,bci,Sci,Tci,Ici,xci,wci,Rci,kci,Pci,Dci,Nci,Mci,Oci,Bci,Lci,Fci,Uci,Qci,qci,jci,Hci,Gci,$ci,Vci,Wci,zci,Yci,Kci,Jci,Zci,Xci,eli,tli,rli,nli,ili,Era,_ra,Cra,vra,bra,Sra,Tra,Ira,xra,wra,Rra,kra,Pra,Dra,Nra,Mra,Ora,Bra,Lra,Fra,Ura,Qra,qra,jra,Hra,Gra,$ra,Vra,Wra,zra,Yra,Kra,Jra,Zra,Xra,ena,tna,rna,nna,ina,ona,sna,ana,cna,lna,una,dna,fna,pna,hna,mna,gna,Ana,yna,Ena,_na,Cna,vna,bna,Sna,Tna,Ina,xna,wna,Rna,kna,Pna,Dna,Nna,Mna,Ona,Bna,Lna,Fna,Una,Qna,qna,jna,Hna,Gna,$na,Vna,Wna,zna,Yna,Kna,Jna,Zna,Xna,eia,tia,ria,nia,iia,oia,sia,aia,cia,lia,uia,dia,fia,pia,hia,mia,gia,Aia,yia,Eia,_ia,Cia,via,bia,Sia,Tia,Iia,xia,wia,Ria,kia,Pia,Dia,Nia,Mia,Oia,Bia,Lia,Fia,Uia,oli,sli,ali,cli,lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,Cli,vli,bli,Sli,Tli,Ili,xli,wli,Rli,kli,Pli,Dli,Nli,Mli,Oli,Bli,Lli,Fli,Uli,Qli,qli,jli,Hli,Gli,$li,Vli,Wli,zli,Yli,Kli,Jli,Qia,qia,jia,Hia,Gia,$ia,Via,Wia,zia,Yia,Kia,Jia,Zia,Xia,eoa,toa,roa,noa,ioa,ooa,soa,aoa,coa,loa,uoa,doa,foa,poa,hoa,moa,goa,Aoa,yoa,Eoa,_oa,Coa,voa,boa,Soa,Toa,Ioa,xoa,woa,Roa,koa,Poa,Doa,Noa,Zli,Xli,eui,tui,rui,nui,iui,oui,sui,aui,cui,Moa,Ooa,Boa,Loa,Foa,Uoa,Qoa,qoa,joa,Hoa,Goa,$oa,lui,uui,dui,fui,pui,Voa,Woa,zoa,Yoa,Koa,Joa,hui,mui,gui,Zoa,Xoa,esa,tsa,Aui,yui,Eui,_ui,rsa,nsa,isa,osa,ssa,Cui,vui,bui,Sui,Tui,Iui,xui,asa,csa,lsa,usa,dsa,fsa,psa,hsa,wui,Rui,kui,Pui,Dui,msa,gsa,Asa,ysa,Esa,_sa,Nui,Mui,Oui,Bui,Lui,Fui,Uui,Qui,qui,jui,Hui,Gui,$ui,Vui,Wui,zui,Yui,Kui,Jui,Zui,Xui,Csa,vsa,bsa,Ssa,Tsa,Isa,xsa,wsa,Rsa,ksa,Psa,Dsa,Nsa,Msa,Osa,Bsa,Lsa,Fsa,Usa,Qsa,qsa,jsa,edi,tdi,rdi,ndi,idi,Hsa,Gsa,$sa,Vsa,Wsa,zsa,odi,sdi,Ysa,Ksa,Jsa,adi,cdi,Zsa,Xsa,eaa,ldi,udi,ddi,fdi,pdi,hdi,mdi,gdi,Adi,ydi,Edi,_di,Cdi,vdi,bdi,Sdi,Tdi,taa,raa,naa,iaa,oaa,saa,aaa,caa,laa,uaa,daa,faa,paa,haa,maa,gaa,Aaa,yaa,Idi,xdi,Eaa,_aa,Caa,wdi=me(()=>{p();m0r();Usi="aws.lambda.invoked_arn",Qsi="db.system",qsi="db.connection_string",jsi="db.user",Hsi="db.jdbc.driver_classname",Gsi="db.name",$si="db.statement",Vsi="db.operation",Wsi="db.mssql.instance_name",zsi="db.cassandra.keyspace",Ysi="db.cassandra.page_size",Ksi="db.cassandra.consistency_level",Jsi="db.cassandra.table",Zsi="db.cassandra.idempotence",Xsi="db.cassandra.speculative_execution_count",eai="db.cassandra.coordinator.id",tai="db.cassandra.coordinator.dc",rai="db.hbase.namespace",nai="db.redis.database_index",iai="db.mongodb.collection",oai="db.sql.table",sai="exception.type",aai="exception.message",cai="exception.stacktrace",lai="exception.escaped",uai="faas.trigger",dai="faas.execution",fai="faas.document.collection",pai="faas.document.operation",hai="faas.document.time",mai="faas.document.name",gai="faas.time",Aai="faas.cron",yai="faas.coldstart",Eai="faas.invoked_name",_ai="faas.invoked_provider",Cai="faas.invoked_region",vai="net.transport",bai="net.peer.ip",Sai="net.peer.port",Tai="net.peer.name",Iai="net.host.ip",xai="net.host.port",wai="net.host.name",Rai="net.host.connection.type",kai="net.host.connection.subtype",Pai="net.host.carrier.name",Dai="net.host.carrier.mcc",Nai="net.host.carrier.mnc",Mai="net.host.carrier.icc",Oai="peer.service",Bai="enduser.id",Lai="enduser.role",Fai="enduser.scope",Uai="thread.id",Qai="thread.name",qai="code.function",jai="code.namespace",Hai="code.filepath",Gai="code.lineno",$ai="http.method",Vai="http.url",Wai="http.target",zai="http.host",Yai="http.scheme",Kai="http.status_code",Jai="http.flavor",Zai="http.user_agent",Xai="http.request_content_length",eci="http.request_content_length_uncompressed",tci="http.response_content_length",rci="http.response_content_length_uncompressed",nci="http.server_name",ici="http.route",oci="http.client_ip",sci="aws.dynamodb.table_names",aci="aws.dynamodb.consumed_capacity",cci="aws.dynamodb.item_collection_metrics",lci="aws.dynamodb.provisioned_read_capacity",uci="aws.dynamodb.provisioned_write_capacity",dci="aws.dynamodb.consistent_read",fci="aws.dynamodb.projection",pci="aws.dynamodb.limit",hci="aws.dynamodb.attributes_to_get",mci="aws.dynamodb.index_name",gci="aws.dynamodb.select",Aci="aws.dynamodb.global_secondary_indexes",yci="aws.dynamodb.local_secondary_indexes",Eci="aws.dynamodb.exclusive_start_table",_ci="aws.dynamodb.table_count",Cci="aws.dynamodb.scan_forward",vci="aws.dynamodb.segment",bci="aws.dynamodb.total_segments",Sci="aws.dynamodb.count",Tci="aws.dynamodb.scanned_count",Ici="aws.dynamodb.attribute_definitions",xci="aws.dynamodb.global_secondary_index_updates",wci="messaging.system",Rci="messaging.destination",kci="messaging.destination_kind",Pci="messaging.temp_destination",Dci="messaging.protocol",Nci="messaging.protocol_version",Mci="messaging.url",Oci="messaging.message_id",Bci="messaging.conversation_id",Lci="messaging.message_payload_size_bytes",Fci="messaging.message_payload_compressed_size_bytes",Uci="messaging.operation",Qci="messaging.consumer_id",qci="messaging.rabbitmq.routing_key",jci="messaging.kafka.message_key",Hci="messaging.kafka.consumer_group",Gci="messaging.kafka.client_id",$ci="messaging.kafka.partition",Vci="messaging.kafka.tombstone",Wci="rpc.system",zci="rpc.service",Yci="rpc.method",Kci="rpc.grpc.status_code",Jci="rpc.jsonrpc.version",Zci="rpc.jsonrpc.request_id",Xci="rpc.jsonrpc.error_code",eli="rpc.jsonrpc.error_message",tli="message.type",rli="message.id",nli="message.compressed_size",ili="message.uncompressed_size",Era=Usi,_ra=Qsi,Cra=qsi,vra=jsi,bra=Hsi,Sra=Gsi,Tra=$si,Ira=Vsi,xra=Wsi,wra=zsi,Rra=Ysi,kra=Ksi,Pra=Jsi,Dra=Zsi,Nra=Xsi,Mra=eai,Ora=tai,Bra=rai,Lra=nai,Fra=iai,Ura=oai,Qra=sai,qra=aai,jra=cai,Hra=lai,Gra=uai,$ra=dai,Vra=fai,Wra=pai,zra=hai,Yra=mai,Kra=gai,Jra=Aai,Zra=yai,Xra=Eai,ena=_ai,tna=Cai,rna=vai,nna=bai,ina=Sai,ona=Tai,sna=Iai,ana=xai,cna=wai,lna=Rai,una=kai,dna=Pai,fna=Dai,pna=Nai,hna=Mai,mna=Oai,gna=Bai,Ana=Lai,yna=Fai,Ena=Uai,_na=Qai,Cna=qai,vna=jai,bna=Hai,Sna=Gai,Tna=$ai,Ina=Vai,xna=Wai,wna=zai,Rna=Yai,kna=Kai,Pna=Jai,Dna=Zai,Nna=Xai,Mna=eci,Ona=tci,Bna=rci,Lna=nci,Fna=ici,Una=oci,Qna=sci,qna=aci,jna=cci,Hna=lci,Gna=uci,$na=dci,Vna=fci,Wna=pci,zna=hci,Yna=mci,Kna=gci,Jna=Aci,Zna=yci,Xna=Eci,eia=_ci,tia=Cci,ria=vci,nia=bci,iia=Sci,oia=Tci,sia=Ici,aia=xci,cia=wci,lia=Rci,uia=kci,dia=Pci,fia=Dci,pia=Nci,hia=Mci,mia=Oci,gia=Bci,Aia=Lci,yia=Fci,Eia=Uci,_ia=Qci,Cia=qci,via=jci,bia=Hci,Sia=Gci,Tia=$ci,Iia=Vci,xia=Wci,wia=zci,Ria=Yci,kia=Kci,Pia=Jci,Dia=Zci,Nia=Xci,Mia=eli,Oia=tli,Bia=rli,Lia=nli,Fia=ili,Uia=eh([Usi,Qsi,qsi,jsi,Hsi,Gsi,$si,Vsi,Wsi,zsi,Ysi,Ksi,Jsi,Zsi,Xsi,eai,tai,rai,nai,iai,oai,sai,aai,cai,lai,uai,dai,fai,pai,hai,mai,gai,Aai,yai,Eai,_ai,Cai,vai,bai,Sai,Tai,Iai,xai,wai,Rai,kai,Pai,Dai,Nai,Mai,Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,Cci,vci,bci,Sci,Tci,Ici,xci,wci,Rci,kci,Pci,Dci,Nci,Mci,Oci,Bci,Lci,Fci,Uci,Qci,qci,jci,Hci,Gci,$ci,Vci,Wci,zci,Yci,Kci,Jci,Zci,Xci,eli,tli,rli,nli,ili]),oli="other_sql",sli="mssql",ali="mysql",cli="oracle",lli="db2",uli="postgresql",dli="redshift",fli="hive",pli="cloudscape",hli="hsqldb",mli="progress",gli="maxdb",Ali="hanadb",yli="ingres",Eli="firstsql",_li="edb",Cli="cache",vli="adabas",bli="firebird",Sli="derby",Tli="filemaker",Ili="informix",xli="instantdb",wli="interbase",Rli="mariadb",kli="netezza",Pli="pervasive",Dli="pointbase",Nli="sqlite",Mli="sybase",Oli="teradata",Bli="vertica",Lli="h2",Fli="coldfusion",Uli="cassandra",Qli="hbase",qli="mongodb",jli="redis",Hli="couchbase",Gli="couchdb",$li="cosmosdb",Vli="dynamodb",Wli="neo4j",zli="geode",Yli="elasticsearch",Kli="memcached",Jli="cockroachdb",Qia=oli,qia=sli,jia=ali,Hia=cli,Gia=lli,$ia=uli,Via=dli,Wia=fli,zia=pli,Yia=hli,Kia=mli,Jia=gli,Zia=Ali,Xia=yli,eoa=Eli,toa=_li,roa=Cli,noa=vli,ioa=bli,ooa=Sli,soa=Tli,aoa=Ili,coa=xli,loa=wli,uoa=Rli,doa=kli,foa=Pli,poa=Dli,hoa=Nli,moa=Mli,goa=Oli,Aoa=Bli,yoa=Lli,Eoa=Fli,_oa=Uli,Coa=Qli,voa=qli,boa=jli,Soa=Hli,Toa=Gli,Ioa=$li,xoa=Vli,woa=Wli,Roa=zli,koa=Yli,Poa=Kli,Doa=Jli,Noa=eh([oli,sli,ali,cli,lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,Cli,vli,bli,Sli,Tli,Ili,xli,wli,Rli,kli,Pli,Dli,Nli,Mli,Oli,Bli,Lli,Fli,Uli,Qli,qli,jli,Hli,Gli,$li,Vli,Wli,zli,Yli,Kli,Jli]),Zli="all",Xli="each_quorum",eui="quorum",tui="local_quorum",rui="one",nui="two",iui="three",oui="local_one",sui="any",aui="serial",cui="local_serial",Moa=Zli,Ooa=Xli,Boa=eui,Loa=tui,Foa=rui,Uoa=nui,Qoa=iui,qoa=oui,joa=sui,Hoa=aui,Goa=cui,$oa=eh([Zli,Xli,eui,tui,rui,nui,iui,oui,sui,aui,cui]),lui="datasource",uui="http",dui="pubsub",fui="timer",pui="other",Voa=lui,Woa=uui,zoa=dui,Yoa=fui,Koa=pui,Joa=eh([lui,uui,dui,fui,pui]),hui="insert",mui="edit",gui="delete",Zoa=hui,Xoa=mui,esa=gui,tsa=eh([hui,mui,gui]),Aui="alibaba_cloud",yui="aws",Eui="azure",_ui="gcp",rsa=Aui,nsa=yui,isa=Eui,osa=_ui,ssa=eh([Aui,yui,Eui,_ui]),Cui="ip_tcp",vui="ip_udp",bui="ip",Sui="unix",Tui="pipe",Iui="inproc",xui="other",asa=Cui,csa=vui,lsa=bui,usa=Sui,dsa=Tui,fsa=Iui,psa=xui,hsa=eh([Cui,vui,bui,Sui,Tui,Iui,xui]),wui="wifi",Rui="wired",kui="cell",Pui="unavailable",Dui="unknown",msa=wui,gsa=Rui,Asa=kui,ysa=Pui,Esa=Dui,_sa=eh([wui,Rui,kui,Pui,Dui]),Nui="gprs",Mui="edge",Oui="umts",Bui="cdma",Lui="evdo_0",Fui="evdo_a",Uui="cdma2000_1xrtt",Qui="hsdpa",qui="hsupa",jui="hspa",Hui="iden",Gui="evdo_b",$ui="lte",Vui="ehrpd",Wui="hspap",zui="gsm",Yui="td_scdma",Kui="iwlan",Jui="nr",Zui="nrnsa",Xui="lte_ca",Csa=Nui,vsa=Mui,bsa=Oui,Ssa=Bui,Tsa=Lui,Isa=Fui,xsa=Uui,wsa=Qui,Rsa=qui,ksa=jui,Psa=Hui,Dsa=Gui,Nsa=$ui,Msa=Vui,Osa=Wui,Bsa=zui,Lsa=Yui,Fsa=Kui,Usa=Jui,Qsa=Zui,qsa=Xui,jsa=eh([Nui,Mui,Oui,Bui,Lui,Fui,Uui,Qui,qui,jui,Hui,Gui,$ui,Vui,Wui,zui,Yui,Kui,Jui,Zui,Xui]),edi="1.0",tdi="1.1",rdi="2.0",ndi="SPDY",idi="QUIC",Hsa=edi,Gsa=tdi,$sa=rdi,Vsa=ndi,Wsa=idi,zsa={HTTP_1_0:edi,HTTP_1_1:tdi,HTTP_2_0:rdi,SPDY:ndi,QUIC:idi},odi="queue",sdi="topic",Ysa=odi,Ksa=sdi,Jsa=eh([odi,sdi]),adi="receive",cdi="process",Zsa=adi,Xsa=cdi,eaa=eh([adi,cdi]),ldi=0,udi=1,ddi=2,fdi=3,pdi=4,hdi=5,mdi=6,gdi=7,Adi=8,ydi=9,Edi=10,_di=11,Cdi=12,vdi=13,bdi=14,Sdi=15,Tdi=16,taa=ldi,raa=udi,naa=ddi,iaa=fdi,oaa=pdi,saa=hdi,aaa=mdi,caa=gdi,laa=Adi,uaa=ydi,daa=Edi,faa=_di,paa=Cdi,haa=vdi,maa=bdi,gaa=Sdi,Aaa=Tdi,yaa={OK:ldi,CANCELLED:udi,UNKNOWN:ddi,INVALID_ARGUMENT:fdi,DEADLINE_EXCEEDED:pdi,NOT_FOUND:hdi,ALREADY_EXISTS:mdi,PERMISSION_DENIED:gdi,RESOURCE_EXHAUSTED:Adi,FAILED_PRECONDITION:ydi,ABORTED:Edi,OUT_OF_RANGE:_di,UNIMPLEMENTED:Cdi,INTERNAL:vdi,UNAVAILABLE:bdi,DATA_LOSS:Sdi,UNAUTHENTICATED:Tdi},Idi="SENT",xdi="RECEIVED",Eaa=Idi,_aa=xdi,Caa=eh([Idi,xdi])});var Rdi=me(()=>{p();wdi()});var kdi,Pdi,Ddi,Ndi,Mdi,Odi,Bdi,Ldi,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,Cfi,vfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,vaa,baa,Saa,Taa,Iaa,xaa,waa,Raa,kaa,Paa,Daa,Naa,Maa,Oaa,Baa,Laa,Faa,Uaa,Qaa,qaa,jaa,Haa,Gaa,$aa,Vaa,Waa,zaa,Yaa,Kaa,Jaa,Zaa,Xaa,eca,tca,rca,nca,ica,oca,sca,aca,cca,lca,uca,dca,fca,pca,hca,mca,gca,Aca,yca,Eca,_ca,Cca,vca,bca,Sca,Tca,Ica,xca,wca,Rca,kca,Pca,Dca,Nca,Mca,Oca,Bca,Lca,Fca,Uca,Qca,qca,jca,Hca,Gca,$ca,Vca,Wca,zca,Yca,npi,ipi,opi,spi,Kca,Jca,Zca,Xca,ela,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,Cpi,vpi,bpi,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,dla,fla,pla,hla,mla,gla,Ala,yla,Spi,Tpi,Ela,_la,Cla,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,vla,bla,Sla,Tla,Ila,xla,wla,Rla,Npi,Mpi,Opi,Bpi,Lpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,kla,Pla,Dla,Nla,Mla,Ola,Bla,Lla,Fla,Ula,Qla,qla,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,jla,Hla,Gla,$la,Vla,Wla,zla,Yla,Kla,Jla,Zla,ehi=me(()=>{p();m0r();kdi="cloud.provider",Pdi="cloud.account.id",Ddi="cloud.region",Ndi="cloud.availability_zone",Mdi="cloud.platform",Odi="aws.ecs.container.arn",Bdi="aws.ecs.cluster.arn",Ldi="aws.ecs.launchtype",Fdi="aws.ecs.task.arn",Udi="aws.ecs.task.family",Qdi="aws.ecs.task.revision",qdi="aws.eks.cluster.arn",jdi="aws.log.group.names",Hdi="aws.log.group.arns",Gdi="aws.log.stream.names",$di="aws.log.stream.arns",Vdi="container.name",Wdi="container.id",zdi="container.runtime",Ydi="container.image.name",Kdi="container.image.tag",Jdi="deployment.environment",Zdi="device.id",Xdi="device.model.identifier",efi="device.model.name",tfi="faas.name",rfi="faas.id",nfi="faas.version",ifi="faas.instance",ofi="faas.max_memory",sfi="host.id",afi="host.name",cfi="host.type",lfi="host.arch",ufi="host.image.name",dfi="host.image.id",ffi="host.image.version",pfi="k8s.cluster.name",hfi="k8s.node.name",mfi="k8s.node.uid",gfi="k8s.namespace.name",Afi="k8s.pod.uid",yfi="k8s.pod.name",Efi="k8s.container.name",_fi="k8s.replicaset.uid",Cfi="k8s.replicaset.name",vfi="k8s.deployment.uid",bfi="k8s.deployment.name",Sfi="k8s.statefulset.uid",Tfi="k8s.statefulset.name",Ifi="k8s.daemonset.uid",xfi="k8s.daemonset.name",wfi="k8s.job.uid",Rfi="k8s.job.name",kfi="k8s.cronjob.uid",Pfi="k8s.cronjob.name",Dfi="os.type",Nfi="os.description",Mfi="os.name",Ofi="os.version",Bfi="process.pid",Lfi="process.executable.name",Ffi="process.executable.path",Ufi="process.command",Qfi="process.command_line",qfi="process.command_args",jfi="process.owner",Hfi="process.runtime.name",Gfi="process.runtime.version",$fi="process.runtime.description",Vfi="service.name",Wfi="service.namespace",zfi="service.instance.id",Yfi="service.version",Kfi="telemetry.sdk.name",Jfi="telemetry.sdk.language",Zfi="telemetry.sdk.version",Xfi="telemetry.auto.version",epi="webengine.name",tpi="webengine.version",rpi="webengine.description",vaa=kdi,baa=Pdi,Saa=Ddi,Taa=Ndi,Iaa=Mdi,xaa=Odi,waa=Bdi,Raa=Ldi,kaa=Fdi,Paa=Udi,Daa=Qdi,Naa=qdi,Maa=jdi,Oaa=Hdi,Baa=Gdi,Laa=$di,Faa=Vdi,Uaa=Wdi,Qaa=zdi,qaa=Ydi,jaa=Kdi,Haa=Jdi,Gaa=Zdi,$aa=Xdi,Vaa=efi,Waa=tfi,zaa=rfi,Yaa=nfi,Kaa=ifi,Jaa=ofi,Zaa=sfi,Xaa=afi,eca=cfi,tca=lfi,rca=ufi,nca=dfi,ica=ffi,oca=pfi,sca=hfi,aca=mfi,cca=gfi,lca=Afi,uca=yfi,dca=Efi,fca=_fi,pca=Cfi,hca=vfi,mca=bfi,gca=Sfi,Aca=Tfi,yca=Ifi,Eca=xfi,_ca=wfi,Cca=Rfi,vca=kfi,bca=Pfi,Sca=Dfi,Tca=Nfi,Ica=Mfi,xca=Ofi,wca=Bfi,Rca=Lfi,kca=Ffi,Pca=Ufi,Dca=Qfi,Nca=qfi,Mca=jfi,Oca=Hfi,Bca=Gfi,Lca=$fi,Fca=Vfi,Uca=Wfi,Qca=zfi,qca=Yfi,jca=Kfi,Hca=Jfi,Gca=Zfi,$ca=Xfi,Vca=epi,Wca=tpi,zca=rpi,Yca=eh([kdi,Pdi,Ddi,Ndi,Mdi,Odi,Bdi,Ldi,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,Cfi,vfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi]),npi="alibaba_cloud",ipi="aws",opi="azure",spi="gcp",Kca=npi,Jca=ipi,Zca=opi,Xca=spi,ela=eh([npi,ipi,opi,spi]),api="alibaba_cloud_ecs",cpi="alibaba_cloud_fc",lpi="aws_ec2",upi="aws_ecs",dpi="aws_eks",fpi="aws_lambda",ppi="aws_elastic_beanstalk",hpi="azure_vm",mpi="azure_container_instances",gpi="azure_aks",Api="azure_functions",ypi="azure_app_service",Epi="gcp_compute_engine",_pi="gcp_cloud_run",Cpi="gcp_kubernetes_engine",vpi="gcp_cloud_functions",bpi="gcp_app_engine",tla=api,rla=cpi,nla=lpi,ila=upi,ola=dpi,sla=fpi,ala=ppi,cla=hpi,lla=mpi,ula=gpi,dla=Api,fla=ypi,pla=Epi,hla=_pi,mla=Cpi,gla=vpi,Ala=bpi,yla=eh([api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,Cpi,vpi,bpi]),Spi="ec2",Tpi="fargate",Ela=Spi,_la=Tpi,Cla=eh([Spi,Tpi]),Ipi="amd64",xpi="arm32",wpi="arm64",Rpi="ia64",kpi="ppc32",Ppi="ppc64",Dpi="x86",vla=Ipi,bla=xpi,Sla=wpi,Tla=Rpi,Ila=kpi,xla=Ppi,wla=Dpi,Rla=eh([Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi]),Npi="windows",Mpi="linux",Opi="darwin",Bpi="freebsd",Lpi="netbsd",Fpi="openbsd",Upi="dragonflybsd",Qpi="hpux",qpi="aix",jpi="solaris",Hpi="z_os",kla=Npi,Pla=Mpi,Dla=Opi,Nla=Bpi,Mla=Lpi,Ola=Fpi,Bla=Upi,Lla=Qpi,Fla=qpi,Ula=jpi,Qla=Hpi,qla=eh([Npi,Mpi,Opi,Bpi,Lpi,Fpi,Upi,Qpi,qpi,jpi,Hpi]),Gpi="cpp",$pi="dotnet",Vpi="erlang",Wpi="go",zpi="java",Ypi="nodejs",Kpi="php",Jpi="python",Zpi="ruby",Xpi="webjs",jla=Gpi,Hla=$pi,Gla=Vpi,$la=Wpi,Vla=zpi,Wla=Ypi,zla=Kpi,Yla=Jpi,Kla=Zpi,Jla=Xpi,Zla=eh([Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi])});var thi=me(()=>{p();ehi()});var Xla,eua,tua,rua,nua,iua,oua,sua,aua,cua,lua,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,Cua,vua,bua,Sua,Tua,Iua,xua,wua,Rua,kua,Pua,Dua,Nua,Mua,Oua,Bua,Lua,Fua,Uua,Qua,xKf,wKf,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,Cda,vda,bda,Sda,Tda,Ida,xda,wda,Rda,kda,Pda,Dda,Nda,Mda,Oda,Bda,Lda,Fda,Uda,Qda,qda,jda,Hda,Gda,$da,Vda,Wda,zda,Yda,Kda,Jda,Zda,Xda,efa,tfa,rfa,g0r,nfa,ifa,ofa,sfa,afa,A0r,cfa,lfa,ufa,dfa,ffa,pfa,y0r,E0r,hfa,mfa,gfa,Afa,yfa,Efa,rhi=me(()=>{p();Xla="aspnetcore.diagnostics.exception.result",eua="aborted",tua="handled",rua="skipped",nua="unhandled",iua="aspnetcore.diagnostics.handler.type",oua="aspnetcore.rate_limiting.policy",sua="aspnetcore.rate_limiting.result",aua="acquired",cua="endpoint_limiter",lua="global_limiter",uua="request_canceled",dua="aspnetcore.request.is_unhandled",fua="aspnetcore.routing.is_fallback",pua="aspnetcore.routing.match_status",hua="failure",mua="success",gua="aspnetcore.user.is_authenticated",Aua="client.address",yua="client.port",Eua="code.column.number",_ua="code.file.path",Cua="code.function.name",vua="code.line.number",bua="code.stacktrace",Sua="db.collection.name",Tua="db.namespace",Iua="db.operation.batch.size",xua="db.operation.name",wua="db.query.summary",Rua="db.query.text",kua="db.response.status_code",Pua="db.stored_procedure.name",Dua="db.system.name",Nua="mariadb",Mua="microsoft.sql_server",Oua="mysql",Bua="postgresql",Lua="dotnet.gc.heap.generation",Fua="gen0",Uua="gen1",Qua="gen2",xKf="loh",wKf="poh",qua="error.type",jua="_OTHER",Hua="exception.escaped",Gua="exception.message",$ua="exception.stacktrace",Vua="exception.type",Wua=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),zua="http.request.method",Yua="_OTHER",Kua="CONNECT",Jua="DELETE",Zua="GET",Xua="HEAD",eda="OPTIONS",tda="PATCH",rda="POST",nda="PUT",ida="TRACE",oda="http.request.method_original",sda="http.request.resend_count",ada=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),cda="http.response.status_code",lda="http.route",uda="jvm.gc.action",dda="jvm.gc.name",fda="jvm.memory.pool.name",pda="jvm.memory.type",hda="heap",mda="non_heap",gda="jvm.thread.daemon",Ada="jvm.thread.state",yda="blocked",Eda="new",_da="runnable",Cda="terminated",vda="timed_waiting",bda="waiting",Sda="network.local.address",Tda="network.local.port",Ida="network.peer.address",xda="network.peer.port",wda="network.protocol.name",Rda="network.protocol.version",kda="network.transport",Pda="pipe",Dda="quic",Nda="tcp",Mda="udp",Oda="unix",Bda="network.type",Lda="ipv4",Fda="ipv6",Uda="otel.scope.name",Qda="otel.scope.version",qda="otel.status_code",jda="ERROR",Hda="OK",Gda="otel.status_description",$da="server.address",Vda="server.port",Wda="service.name",zda="service.version",Yda="signalr.connection.status",Kda="app_shutdown",Jda="normal_closure",Zda="timeout",Xda="signalr.transport",efa="long_polling",tfa="server_sent_events",rfa="web_sockets",g0r="telemetry.sdk.language",nfa="cpp",ifa="dotnet",ofa="erlang",sfa="go",afa="java",A0r="nodejs",cfa="php",lfa="python",ufa="ruby",dfa="rust",ffa="swift",pfa="webjs",y0r="telemetry.sdk.name",E0r="telemetry.sdk.version",hfa="url.fragment",mfa="url.full",gfa="url.path",Afa="url.query",yfa="url.scheme",Efa="user_agent.original"});var _fa,Cfa,vfa,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,kfa,Pfa,Dfa,Nfa,Mfa,Ofa,Bfa,Lfa,Ffa,Ufa,Qfa,qfa,jfa,Hfa,Gfa,$fa,Vfa,Wfa,zfa,Yfa,Kfa,Jfa,Zfa,Xfa,epa,tpa,rpa,npa,ipa,opa,spa,apa,cpa,lpa,upa,dpa,fpa,ppa,hpa,mpa,gpa,nhi=me(()=>{p();_fa="aspnetcore.diagnostics.exceptions",Cfa="aspnetcore.rate_limiting.active_request_leases",vfa="aspnetcore.rate_limiting.queued_requests",bfa="aspnetcore.rate_limiting.request.time_in_queue",Sfa="aspnetcore.rate_limiting.request_lease.duration",Tfa="aspnetcore.rate_limiting.requests",Ifa="aspnetcore.routing.match_attempts",xfa="db.client.operation.duration",wfa="dotnet.assembly.count",Rfa="dotnet.exceptions",kfa="dotnet.gc.collections",Pfa="dotnet.gc.heap.total_allocated",Dfa="dotnet.gc.last_collection.heap.fragmentation.size",Nfa="dotnet.gc.last_collection.heap.size",Mfa="dotnet.gc.last_collection.memory.committed_size",Ofa="dotnet.gc.pause.time",Bfa="dotnet.jit.compilation.time",Lfa="dotnet.jit.compiled_il.size",Ffa="dotnet.jit.compiled_methods",Ufa="dotnet.monitor.lock_contentions",Qfa="dotnet.process.cpu.count",qfa="dotnet.process.cpu.time",jfa="dotnet.process.memory.working_set",Hfa="dotnet.thread_pool.queue.length",Gfa="dotnet.thread_pool.thread.count",$fa="dotnet.thread_pool.work_item.count",Vfa="dotnet.timer.count",Wfa="http.client.request.duration",zfa="http.server.request.duration",Yfa="jvm.class.count",Kfa="jvm.class.loaded",Jfa="jvm.class.unloaded",Zfa="jvm.cpu.count",Xfa="jvm.cpu.recent_utilization",epa="jvm.cpu.time",tpa="jvm.gc.duration",rpa="jvm.memory.committed",npa="jvm.memory.limit",ipa="jvm.memory.used",opa="jvm.memory.used_after_last_gc",spa="jvm.thread.count",apa="kestrel.active_connections",cpa="kestrel.active_tls_handshakes",lpa="kestrel.connection.duration",upa="kestrel.queued_connections",dpa="kestrel.queued_requests",fpa="kestrel.rejected_connections",ppa="kestrel.tls_handshake.duration",hpa="kestrel.upgraded_connections",mpa="signalr.server.active_connections",gpa="signalr.server.connection.duration"});var Apa,ihi=me(()=>{p();Apa="exception"});var _0r={};wi(_0r,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>eua,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>tua,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>rua,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>nua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>aua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>cua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>lua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>uua,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>hua,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>mua,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Xla,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>iua,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>oua,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>sua,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>dua,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>fua,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>pua,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>gua,ATTR_CLIENT_ADDRESS:()=>Aua,ATTR_CLIENT_PORT:()=>yua,ATTR_CODE_COLUMN_NUMBER:()=>Eua,ATTR_CODE_FILE_PATH:()=>_ua,ATTR_CODE_FUNCTION_NAME:()=>Cua,ATTR_CODE_LINE_NUMBER:()=>vua,ATTR_CODE_STACKTRACE:()=>bua,ATTR_DB_COLLECTION_NAME:()=>Sua,ATTR_DB_NAMESPACE:()=>Tua,ATTR_DB_OPERATION_BATCH_SIZE:()=>Iua,ATTR_DB_OPERATION_NAME:()=>xua,ATTR_DB_QUERY_SUMMARY:()=>wua,ATTR_DB_QUERY_TEXT:()=>Rua,ATTR_DB_RESPONSE_STATUS_CODE:()=>kua,ATTR_DB_STORED_PROCEDURE_NAME:()=>Pua,ATTR_DB_SYSTEM_NAME:()=>Dua,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Lua,ATTR_ERROR_TYPE:()=>qua,ATTR_EXCEPTION_ESCAPED:()=>Hua,ATTR_EXCEPTION_MESSAGE:()=>Gua,ATTR_EXCEPTION_STACKTRACE:()=>$ua,ATTR_EXCEPTION_TYPE:()=>Vua,ATTR_HTTP_REQUEST_HEADER:()=>Wua,ATTR_HTTP_REQUEST_METHOD:()=>zua,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>oda,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>sda,ATTR_HTTP_RESPONSE_HEADER:()=>ada,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>cda,ATTR_HTTP_ROUTE:()=>lda,ATTR_JVM_GC_ACTION:()=>uda,ATTR_JVM_GC_NAME:()=>dda,ATTR_JVM_MEMORY_POOL_NAME:()=>fda,ATTR_JVM_MEMORY_TYPE:()=>pda,ATTR_JVM_THREAD_DAEMON:()=>gda,ATTR_JVM_THREAD_STATE:()=>Ada,ATTR_NETWORK_LOCAL_ADDRESS:()=>Sda,ATTR_NETWORK_LOCAL_PORT:()=>Tda,ATTR_NETWORK_PEER_ADDRESS:()=>Ida,ATTR_NETWORK_PEER_PORT:()=>xda,ATTR_NETWORK_PROTOCOL_NAME:()=>wda,ATTR_NETWORK_PROTOCOL_VERSION:()=>Rda,ATTR_NETWORK_TRANSPORT:()=>kda,ATTR_NETWORK_TYPE:()=>Bda,ATTR_OTEL_SCOPE_NAME:()=>Uda,ATTR_OTEL_SCOPE_VERSION:()=>Qda,ATTR_OTEL_STATUS_CODE:()=>qda,ATTR_OTEL_STATUS_DESCRIPTION:()=>Gda,ATTR_SERVER_ADDRESS:()=>$da,ATTR_SERVER_PORT:()=>Vda,ATTR_SERVICE_NAME:()=>Wda,ATTR_SERVICE_VERSION:()=>zda,ATTR_SIGNALR_CONNECTION_STATUS:()=>Yda,ATTR_SIGNALR_TRANSPORT:()=>Xda,ATTR_TELEMETRY_SDK_LANGUAGE:()=>g0r,ATTR_TELEMETRY_SDK_NAME:()=>y0r,ATTR_TELEMETRY_SDK_VERSION:()=>E0r,ATTR_URL_FRAGMENT:()=>hfa,ATTR_URL_FULL:()=>mfa,ATTR_URL_PATH:()=>gfa,ATTR_URL_QUERY:()=>Afa,ATTR_URL_SCHEME:()=>yfa,ATTR_USER_AGENT_ORIGINAL:()=>Efa,AWSECSLAUNCHTYPEVALUES_EC2:()=>Ela,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>_la,AwsEcsLaunchtypeValues:()=>Cla,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>tla,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>rla,CLOUDPLATFORMVALUES_AWS_EC2:()=>nla,CLOUDPLATFORMVALUES_AWS_ECS:()=>ila,CLOUDPLATFORMVALUES_AWS_EKS:()=>ola,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>ala,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>sla,CLOUDPLATFORMVALUES_AZURE_AKS:()=>ula,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>fla,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>lla,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>dla,CLOUDPLATFORMVALUES_AZURE_VM:()=>cla,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Ala,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>gla,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>hla,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>pla,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>mla,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Kca,CLOUDPROVIDERVALUES_AWS:()=>Jca,CLOUDPROVIDERVALUES_AZURE:()=>Zca,CLOUDPROVIDERVALUES_GCP:()=>Xca,CloudPlatformValues:()=>yla,CloudProviderValues:()=>ela,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Moa,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>joa,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Ooa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>qoa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Loa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Goa,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Foa,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Boa,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Hoa,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Qoa,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Uoa,DBSYSTEMVALUES_ADABAS:()=>noa,DBSYSTEMVALUES_CACHE:()=>roa,DBSYSTEMVALUES_CASSANDRA:()=>_oa,DBSYSTEMVALUES_CLOUDSCAPE:()=>zia,DBSYSTEMVALUES_COCKROACHDB:()=>Doa,DBSYSTEMVALUES_COLDFUSION:()=>Eoa,DBSYSTEMVALUES_COSMOSDB:()=>Ioa,DBSYSTEMVALUES_COUCHBASE:()=>Soa,DBSYSTEMVALUES_COUCHDB:()=>Toa,DBSYSTEMVALUES_DB2:()=>Gia,DBSYSTEMVALUES_DERBY:()=>ooa,DBSYSTEMVALUES_DYNAMODB:()=>xoa,DBSYSTEMVALUES_EDB:()=>toa,DBSYSTEMVALUES_ELASTICSEARCH:()=>koa,DBSYSTEMVALUES_FILEMAKER:()=>soa,DBSYSTEMVALUES_FIREBIRD:()=>ioa,DBSYSTEMVALUES_FIRSTSQL:()=>eoa,DBSYSTEMVALUES_GEODE:()=>Roa,DBSYSTEMVALUES_H2:()=>yoa,DBSYSTEMVALUES_HANADB:()=>Zia,DBSYSTEMVALUES_HBASE:()=>Coa,DBSYSTEMVALUES_HIVE:()=>Wia,DBSYSTEMVALUES_HSQLDB:()=>Yia,DBSYSTEMVALUES_INFORMIX:()=>aoa,DBSYSTEMVALUES_INGRES:()=>Xia,DBSYSTEMVALUES_INSTANTDB:()=>coa,DBSYSTEMVALUES_INTERBASE:()=>loa,DBSYSTEMVALUES_MARIADB:()=>uoa,DBSYSTEMVALUES_MAXDB:()=>Jia,DBSYSTEMVALUES_MEMCACHED:()=>Poa,DBSYSTEMVALUES_MONGODB:()=>voa,DBSYSTEMVALUES_MSSQL:()=>qia,DBSYSTEMVALUES_MYSQL:()=>jia,DBSYSTEMVALUES_NEO4J:()=>woa,DBSYSTEMVALUES_NETEZZA:()=>doa,DBSYSTEMVALUES_ORACLE:()=>Hia,DBSYSTEMVALUES_OTHER_SQL:()=>Qia,DBSYSTEMVALUES_PERVASIVE:()=>foa,DBSYSTEMVALUES_POINTBASE:()=>poa,DBSYSTEMVALUES_POSTGRESQL:()=>$ia,DBSYSTEMVALUES_PROGRESS:()=>Kia,DBSYSTEMVALUES_REDIS:()=>boa,DBSYSTEMVALUES_REDSHIFT:()=>Via,DBSYSTEMVALUES_SQLITE:()=>hoa,DBSYSTEMVALUES_SYBASE:()=>moa,DBSYSTEMVALUES_TERADATA:()=>goa,DBSYSTEMVALUES_VERTICA:()=>Aoa,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Nua,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Mua,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Oua,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Bua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Fua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Uua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Qua,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>xKf,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>wKf,DbCassandraConsistencyLevelValues:()=>$oa,DbSystemValues:()=>Noa,ERROR_TYPE_VALUE_OTHER:()=>jua,EVENT_EXCEPTION:()=>Apa,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>esa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Xoa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Zoa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>rsa,FAASINVOKEDPROVIDERVALUES_AWS:()=>nsa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>isa,FAASINVOKEDPROVIDERVALUES_GCP:()=>osa,FAASTRIGGERVALUES_DATASOURCE:()=>Voa,FAASTRIGGERVALUES_HTTP:()=>Woa,FAASTRIGGERVALUES_OTHER:()=>Koa,FAASTRIGGERVALUES_PUBSUB:()=>zoa,FAASTRIGGERVALUES_TIMER:()=>Yoa,FaasDocumentOperationValues:()=>tsa,FaasInvokedProviderValues:()=>ssa,FaasTriggerValues:()=>Joa,HOSTARCHVALUES_AMD64:()=>vla,HOSTARCHVALUES_ARM32:()=>bla,HOSTARCHVALUES_ARM64:()=>Sla,HOSTARCHVALUES_IA64:()=>Tla,HOSTARCHVALUES_PPC32:()=>Ila,HOSTARCHVALUES_PPC64:()=>xla,HOSTARCHVALUES_X86:()=>wla,HTTPFLAVORVALUES_HTTP_1_0:()=>Hsa,HTTPFLAVORVALUES_HTTP_1_1:()=>Gsa,HTTPFLAVORVALUES_HTTP_2_0:()=>$sa,HTTPFLAVORVALUES_QUIC:()=>Wsa,HTTPFLAVORVALUES_SPDY:()=>Vsa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Kua,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Jua,HTTP_REQUEST_METHOD_VALUE_GET:()=>Zua,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Xua,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>eda,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Yua,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>tda,HTTP_REQUEST_METHOD_VALUE_POST:()=>rda,HTTP_REQUEST_METHOD_VALUE_PUT:()=>nda,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>ida,HostArchValues:()=>Rla,HttpFlavorValues:()=>zsa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>hda,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>mda,JVM_THREAD_STATE_VALUE_BLOCKED:()=>yda,JVM_THREAD_STATE_VALUE_NEW:()=>Eda,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>_da,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Cda,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>vda,JVM_THREAD_STATE_VALUE_WAITING:()=>bda,MESSAGETYPEVALUES_RECEIVED:()=>_aa,MESSAGETYPEVALUES_SENT:()=>Eaa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Ysa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Ksa,MESSAGINGOPERATIONVALUES_PROCESS:()=>Xsa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Zsa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>_fa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Cfa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>vfa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Tfa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Sfa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>bfa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Ifa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>xfa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>wfa,METRIC_DOTNET_EXCEPTIONS:()=>Rfa,METRIC_DOTNET_GC_COLLECTIONS:()=>kfa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>Pfa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>Dfa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Nfa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Mfa,METRIC_DOTNET_GC_PAUSE_TIME:()=>Ofa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Bfa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Lfa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Ffa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Ufa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>Qfa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>qfa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>jfa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>Hfa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Gfa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>$fa,METRIC_DOTNET_TIMER_COUNT:()=>Vfa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Wfa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>zfa,METRIC_JVM_CLASS_COUNT:()=>Yfa,METRIC_JVM_CLASS_LOADED:()=>Kfa,METRIC_JVM_CLASS_UNLOADED:()=>Jfa,METRIC_JVM_CPU_COUNT:()=>Zfa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Xfa,METRIC_JVM_CPU_TIME:()=>epa,METRIC_JVM_GC_DURATION:()=>tpa,METRIC_JVM_MEMORY_COMMITTED:()=>rpa,METRIC_JVM_MEMORY_LIMIT:()=>npa,METRIC_JVM_MEMORY_USED:()=>ipa,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>opa,METRIC_JVM_THREAD_COUNT:()=>spa,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>apa,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>cpa,METRIC_KESTREL_CONNECTION_DURATION:()=>lpa,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>upa,METRIC_KESTREL_QUEUED_REQUESTS:()=>dpa,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>fpa,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>ppa,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>hpa,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>mpa,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>gpa,MessageTypeValues:()=>Caa,MessagingDestinationKindValues:()=>Jsa,MessagingOperationValues:()=>eaa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Ssa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>xsa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>vsa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Msa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Tsa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Isa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Dsa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Csa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Bsa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>wsa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>ksa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Osa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Rsa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Psa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Fsa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Nsa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>qsa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Usa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Qsa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Lsa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>bsa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Asa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>ysa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Esa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>msa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>gsa,NETTRANSPORTVALUES_INPROC:()=>fsa,NETTRANSPORTVALUES_IP:()=>lsa,NETTRANSPORTVALUES_IP_TCP:()=>asa,NETTRANSPORTVALUES_IP_UDP:()=>csa,NETTRANSPORTVALUES_OTHER:()=>psa,NETTRANSPORTVALUES_PIPE:()=>dsa,NETTRANSPORTVALUES_UNIX:()=>usa,NETWORK_TRANSPORT_VALUE_PIPE:()=>Pda,NETWORK_TRANSPORT_VALUE_QUIC:()=>Dda,NETWORK_TRANSPORT_VALUE_TCP:()=>Nda,NETWORK_TRANSPORT_VALUE_UDP:()=>Mda,NETWORK_TRANSPORT_VALUE_UNIX:()=>Oda,NETWORK_TYPE_VALUE_IPV4:()=>Lda,NETWORK_TYPE_VALUE_IPV6:()=>Fda,NetHostConnectionSubtypeValues:()=>jsa,NetHostConnectionTypeValues:()=>_sa,NetTransportValues:()=>hsa,OSTYPEVALUES_AIX:()=>Fla,OSTYPEVALUES_DARWIN:()=>Dla,OSTYPEVALUES_DRAGONFLYBSD:()=>Bla,OSTYPEVALUES_FREEBSD:()=>Nla,OSTYPEVALUES_HPUX:()=>Lla,OSTYPEVALUES_LINUX:()=>Pla,OSTYPEVALUES_NETBSD:()=>Mla,OSTYPEVALUES_OPENBSD:()=>Ola,OSTYPEVALUES_SOLARIS:()=>Ula,OSTYPEVALUES_WINDOWS:()=>kla,OSTYPEVALUES_Z_OS:()=>Qla,OTEL_STATUS_CODE_VALUE_ERROR:()=>jda,OTEL_STATUS_CODE_VALUE_OK:()=>Hda,OsTypeValues:()=>qla,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>daa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>aaa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>raa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>gaa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>oaa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>uaa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>haa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>iaa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>saa,RPCGRPCSTATUSCODEVALUES_OK:()=>taa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>faa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>caa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>laa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Aaa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>maa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>paa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>naa,RpcGrpcStatusCodeValues:()=>yaa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>zna,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>sia,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>$na,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>qna,SEMATTRS_AWS_DYNAMODB_COUNT:()=>iia,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Xna,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Jna,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>aia,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Yna,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>jna,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Wna,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Zna,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Vna,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Hna,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Gna,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>oia,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>tia,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>ria,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Kna,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>eia,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Qna,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>nia,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Era,SEMATTRS_CODE_FILEPATH:()=>bna,SEMATTRS_CODE_FUNCTION:()=>Cna,SEMATTRS_CODE_LINENO:()=>Sna,SEMATTRS_CODE_NAMESPACE:()=>vna,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>kra,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Ora,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Mra,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Dra,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>wra,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Rra,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Nra,SEMATTRS_DB_CASSANDRA_TABLE:()=>Pra,SEMATTRS_DB_CONNECTION_STRING:()=>Cra,SEMATTRS_DB_HBASE_NAMESPACE:()=>Bra,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>bra,SEMATTRS_DB_MONGODB_COLLECTION:()=>Fra,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>xra,SEMATTRS_DB_NAME:()=>Sra,SEMATTRS_DB_OPERATION:()=>Ira,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Lra,SEMATTRS_DB_SQL_TABLE:()=>Ura,SEMATTRS_DB_STATEMENT:()=>Tra,SEMATTRS_DB_SYSTEM:()=>_ra,SEMATTRS_DB_USER:()=>vra,SEMATTRS_ENDUSER_ID:()=>gna,SEMATTRS_ENDUSER_ROLE:()=>Ana,SEMATTRS_ENDUSER_SCOPE:()=>yna,SEMATTRS_EXCEPTION_ESCAPED:()=>Hra,SEMATTRS_EXCEPTION_MESSAGE:()=>qra,SEMATTRS_EXCEPTION_STACKTRACE:()=>jra,SEMATTRS_EXCEPTION_TYPE:()=>Qra,SEMATTRS_FAAS_COLDSTART:()=>Zra,SEMATTRS_FAAS_CRON:()=>Jra,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Vra,SEMATTRS_FAAS_DOCUMENT_NAME:()=>Yra,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Wra,SEMATTRS_FAAS_DOCUMENT_TIME:()=>zra,SEMATTRS_FAAS_EXECUTION:()=>$ra,SEMATTRS_FAAS_INVOKED_NAME:()=>Xra,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>ena,SEMATTRS_FAAS_INVOKED_REGION:()=>tna,SEMATTRS_FAAS_TIME:()=>Kra,SEMATTRS_FAAS_TRIGGER:()=>Gra,SEMATTRS_HTTP_CLIENT_IP:()=>Una,SEMATTRS_HTTP_FLAVOR:()=>Pna,SEMATTRS_HTTP_HOST:()=>wna,SEMATTRS_HTTP_METHOD:()=>Tna,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Nna,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Mna,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Ona,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Bna,SEMATTRS_HTTP_ROUTE:()=>Fna,SEMATTRS_HTTP_SCHEME:()=>Rna,SEMATTRS_HTTP_SERVER_NAME:()=>Lna,SEMATTRS_HTTP_STATUS_CODE:()=>kna,SEMATTRS_HTTP_TARGET:()=>xna,SEMATTRS_HTTP_URL:()=>Ina,SEMATTRS_HTTP_USER_AGENT:()=>Dna,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Lia,SEMATTRS_MESSAGE_ID:()=>Bia,SEMATTRS_MESSAGE_TYPE:()=>Oia,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Fia,SEMATTRS_MESSAGING_CONSUMER_ID:()=>_ia,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>gia,SEMATTRS_MESSAGING_DESTINATION:()=>lia,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>uia,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Sia,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>bia,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>via,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Tia,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Iia,SEMATTRS_MESSAGING_MESSAGE_ID:()=>mia,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>yia,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Aia,SEMATTRS_MESSAGING_OPERATION:()=>Eia,SEMATTRS_MESSAGING_PROTOCOL:()=>fia,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>pia,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Cia,SEMATTRS_MESSAGING_SYSTEM:()=>cia,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>dia,SEMATTRS_MESSAGING_URL:()=>hia,SEMATTRS_NET_HOST_CARRIER_ICC:()=>hna,SEMATTRS_NET_HOST_CARRIER_MCC:()=>fna,SEMATTRS_NET_HOST_CARRIER_MNC:()=>pna,SEMATTRS_NET_HOST_CARRIER_NAME:()=>dna,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>una,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>lna,SEMATTRS_NET_HOST_IP:()=>sna,SEMATTRS_NET_HOST_NAME:()=>cna,SEMATTRS_NET_HOST_PORT:()=>ana,SEMATTRS_NET_PEER_IP:()=>nna,SEMATTRS_NET_PEER_NAME:()=>ona,SEMATTRS_NET_PEER_PORT:()=>ina,SEMATTRS_NET_TRANSPORT:()=>rna,SEMATTRS_PEER_SERVICE:()=>mna,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>kia,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Nia,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Mia,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Dia,SEMATTRS_RPC_JSONRPC_VERSION:()=>Pia,SEMATTRS_RPC_METHOD:()=>Ria,SEMATTRS_RPC_SERVICE:()=>wia,SEMATTRS_RPC_SYSTEM:()=>xia,SEMATTRS_THREAD_ID:()=>Ena,SEMATTRS_THREAD_NAME:()=>_na,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>waa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>xaa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Raa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>kaa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Paa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Daa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Naa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Oaa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Maa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Laa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Baa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>baa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Taa,SEMRESATTRS_CLOUD_PLATFORM:()=>Iaa,SEMRESATTRS_CLOUD_PROVIDER:()=>vaa,SEMRESATTRS_CLOUD_REGION:()=>Saa,SEMRESATTRS_CONTAINER_ID:()=>Uaa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>qaa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>jaa,SEMRESATTRS_CONTAINER_NAME:()=>Faa,SEMRESATTRS_CONTAINER_RUNTIME:()=>Qaa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Haa,SEMRESATTRS_DEVICE_ID:()=>Gaa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>$aa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Vaa,SEMRESATTRS_FAAS_ID:()=>zaa,SEMRESATTRS_FAAS_INSTANCE:()=>Kaa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Jaa,SEMRESATTRS_FAAS_NAME:()=>Waa,SEMRESATTRS_FAAS_VERSION:()=>Yaa,SEMRESATTRS_HOST_ARCH:()=>tca,SEMRESATTRS_HOST_ID:()=>Zaa,SEMRESATTRS_HOST_IMAGE_ID:()=>nca,SEMRESATTRS_HOST_IMAGE_NAME:()=>rca,SEMRESATTRS_HOST_IMAGE_VERSION:()=>ica,SEMRESATTRS_HOST_NAME:()=>Xaa,SEMRESATTRS_HOST_TYPE:()=>eca,SEMRESATTRS_K8S_CLUSTER_NAME:()=>oca,SEMRESATTRS_K8S_CONTAINER_NAME:()=>dca,SEMRESATTRS_K8S_CRONJOB_NAME:()=>bca,SEMRESATTRS_K8S_CRONJOB_UID:()=>vca,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Eca,SEMRESATTRS_K8S_DAEMONSET_UID:()=>yca,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>mca,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>hca,SEMRESATTRS_K8S_JOB_NAME:()=>Cca,SEMRESATTRS_K8S_JOB_UID:()=>_ca,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>cca,SEMRESATTRS_K8S_NODE_NAME:()=>sca,SEMRESATTRS_K8S_NODE_UID:()=>aca,SEMRESATTRS_K8S_POD_NAME:()=>uca,SEMRESATTRS_K8S_POD_UID:()=>lca,SEMRESATTRS_K8S_REPLICASET_NAME:()=>pca,SEMRESATTRS_K8S_REPLICASET_UID:()=>fca,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Aca,SEMRESATTRS_K8S_STATEFULSET_UID:()=>gca,SEMRESATTRS_OS_DESCRIPTION:()=>Tca,SEMRESATTRS_OS_NAME:()=>Ica,SEMRESATTRS_OS_TYPE:()=>Sca,SEMRESATTRS_OS_VERSION:()=>xca,SEMRESATTRS_PROCESS_COMMAND:()=>Pca,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Nca,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Dca,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Rca,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>kca,SEMRESATTRS_PROCESS_OWNER:()=>Mca,SEMRESATTRS_PROCESS_PID:()=>wca,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Lca,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Oca,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Bca,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Qca,SEMRESATTRS_SERVICE_NAME:()=>Fca,SEMRESATTRS_SERVICE_NAMESPACE:()=>Uca,SEMRESATTRS_SERVICE_VERSION:()=>qca,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>$ca,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Hca,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>jca,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Gca,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>zca,SEMRESATTRS_WEBENGINE_NAME:()=>Vca,SEMRESATTRS_WEBENGINE_VERSION:()=>Wca,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Kda,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Jda,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Zda,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>efa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>tfa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>rfa,SemanticAttributes:()=>Uia,SemanticResourceAttributes:()=>Yca,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>jla,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Hla,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Gla,TELEMETRYSDKLANGUAGEVALUES_GO:()=>$la,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Vla,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Wla,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>zla,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Yla,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Kla,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Jla,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>nfa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>ifa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>ofa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>sfa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>afa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>A0r,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>cfa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>lfa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>ufa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>dfa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>ffa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>pfa,TelemetrySdkLanguageValues:()=>Zla});var gft=me(()=>{p();Rdi();thi();rhi();nhi();ihi()});var ohi,shi=me(()=>{p();ohi="process.runtime.name"});var Aft,ahi=me(()=>{p();Fsi();gft();shi();Aft={[y0r]:"opentelemetry",[ohi]:"node",[g0r]:A0r,[E0r]:Lsi}});var chi=me(()=>{p();Nsi();Msi();Bsi();ahi()});var C0r=me(()=>{p();chi()});function zhe(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Epa);return[r,n]}function Eft(){let t=xH.timeOrigin;if(typeof t!="number"){let e=xH;t=e.timing&&e.timing.fetchStart}return t}function v0r(t){let e=zhe(Eft()),r=zhe(typeof t=="number"?t:xH.now());return b0r(e,r)}function uhi(t){if(_ft(t))return t;if(typeof t=="number")return t=yft&&(r[1]-=yft,r[0]+=1),r}var lhi,ypa,Epa,yft,Ahi=me(()=>{p();C0r();lhi=9,ypa=6,Epa=Math.pow(10,ypa),yft=Math.pow(10,lhi);a(zhe,"millisToHrTime");a(Eft,"getTimeOrigin");a(v0r,"hrTime");a(uhi,"timeInputToHrTime");a(dhi,"hrTimeDuration");a(fhi,"hrTimeToTimeStamp");a(phi,"hrTimeToNanoseconds");a(hhi,"hrTimeToMilliseconds");a(mhi,"hrTimeToMicroseconds");a(_ft,"isTimeInputHrTime");a(ghi,"isTimeInput");a(b0r,"addHrTimes")});function yhi(t){typeof t!="number"&&t.unref()}var Ehi=me(()=>{p();a(yhi,"unrefTimer")});var Cft,_hi=me(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Cft||(Cft={}))});var vft,Chi=me(()=>{p();co();vft=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){kn.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){kn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function vhi(t){return vpa.test(t)}function bhi(t){return bpa.test(t)&&!Spa.test(t)}var S0r,_pa,Cpa,vpa,bpa,Spa,Shi=me(()=>{p();S0r="[_0-9a-z-*/]",_pa=`[a-z]${S0r}{0,255}`,Cpa=`[a-z0-9]${S0r}{0,240}@[a-z]${S0r}{0,13}`,vpa=new RegExp(`^(?:${_pa}|${Cpa})$`),bpa=/^[ -~]{0,255}[!-~]$/,Spa=/,|=/;a(vhi,"validateKey");a(bhi,"validateValue")});var Thi,Tpa,Ihi,xhi,Yhe,T0r=me(()=>{p();Shi();Thi=32,Tpa=512,Ihi=",",xhi="=",Yhe=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+xhi+this.get(r)),e),[]).join(Ihi)}_parse(e){e.length>Tpa||(this._internalState=e.split(Ihi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(xhi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);vhi(c)&&bhi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Thi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Thi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function I0r(t){let e=Ppa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var CNe,vNe,Ipa,xpa,wpa,Rpa,kpa,Ppa,bft,whi=me(()=>{p();co();ENe();T0r();CNe="traceparent",vNe="tracestate",Ipa="00",xpa="(?!ff)[\\da-f]{2}",wpa="(?![0]{32})[\\da-f]{32}",Rpa="(?![0]{16})[\\da-f]{16}",kpa="[\\da-f]{2}",Ppa=new RegExp(`^\\s?(${xpa})-(${wpa})-(${Rpa})-(${kpa})(-.*)?\\s?$`);a(I0r,"parseTraceParent");bft=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=Cu.getSpanContext(e);if(!o||Whe(e)||!mb(o))return;let s=`${Ipa}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||yf.NONE).toString(16)}`;n.set(r,CNe,s),o.traceState&&n.set(r,vNe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,CNe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=I0r(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,vNe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new Yhe(typeof u=="string"?u:void 0)}return Cu.setSpanContext(e,c)}fields(){return[CNe,vNe]}}});function Rhi(t,e){return t.setValue(x0r,e)}function khi(t){return t.deleteValue(x0r)}function Phi(t){return t.getValue(x0r)}var x0r,Sft,Dhi=me(()=>{p();co();x0r=hb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Sft||(Sft={}));a(Rhi,"setRPCMetadata");a(khi,"deleteRPCMetadata");a(Phi,"getRPCMetadata")});function w0r(t){if(!Fpa(t)||Upa(t)!==Dpa)return!1;let e=Lpa(t);if(e===null)return!0;let r=Ohi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Nhi.call(r)===Bpa}function Fpa(t){return t!=null&&typeof t=="object"}function Upa(t){return t==null?t===void 0?Mpa:Npa:PX&&PX in Object(t)?Qpa(t):qpa(t)}function Qpa(t){let e=Ohi.call(t,PX),r=t[PX],n=!1;try{t[PX]=void 0,n=!0}catch{}let o=Bhi.call(t);return n&&(e?t[PX]=r:delete t[PX]),o}function qpa(t){return Bhi.call(t)}var Dpa,Npa,Mpa,Opa,Nhi,Bpa,Lpa,Mhi,Ohi,PX,Bhi,Lhi=me(()=>{p();Dpa="[object Object]",Npa="[object Null]",Mpa="[object Undefined]",Opa=Function.prototype,Nhi=Opa.toString,Bpa=Nhi.call(Object),Lpa=Object.getPrototypeOf,Mhi=Object.prototype,Ohi=Mhi.hasOwnProperty,PX=Symbol?Symbol.toStringTag:void 0,Bhi=Mhi.toString;a(w0r,"isPlainObject");a(Fpa,"isObjectLike");a(Upa,"baseGetTag");a(Qpa,"getRawTag");a(qpa,"objectToString")});function Uhi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Qhi(e,t.shift(),0,r);return e}function R0r(t){return Ift(t)?t.slice():t}function Qhi(t,e,r=0,n){let o;if(!(r>jpa)){if(r++,Tft(t)||Tft(e)||qhi(e))o=R0r(e);else if(Ift(t)){if(o=t.slice(),Ift(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(Fhi(t,u,n)||Fhi(e,u,n))delete o[u];else{if(bNe(f)&&bNe(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]=Qhi(o[u],d,r,n)}}}}else o=e;return o}}function Fhi(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 Hpa(t,e){return!(!w0r(t)||!w0r(e))}var jpa,jhi=me(()=>{p();Lhi();jpa=20;a(Uhi,"merge");a(R0r,"takeValue");a(Qhi,"mergeTwoObjects");a(Fhi,"wasObjectReferenced");a(Ift,"isArray");a(qhi,"isFunction");a(bNe,"isObject");a(Tft,"isPrimitive");a(Hpa,"shouldMerge")});function Hhi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new SNe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var SNe,Ghi=me(()=>{p();SNe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(Hhi,"callWithTimeout")});function k0r(t,e){return typeof e=="string"?t===e:!!t.match(e)}function $hi(t,e){if(!e)return!1;for(let r of e)if(k0r(t,r))return!0;return!1}var Vhi=me(()=>{p();a(k0r,"urlMatches");a($hi,"isUrlIgnored")});var xft,Whi=me(()=>{p();xft=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 wft,zhi=me(()=>{p();Whi();wft=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new xft;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 Khi(t){if(t==null)return;let e=Yhi[t.toUpperCase()];return e??(kn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Yhi)}, using default`),Da.INFO)}var Yhi,Jhi=me(()=>{p();co();Yhi={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Khi,"diagLogLevelFromString")});function Zhi(t,e){return new Promise(r=>{_g.with(sft(_g.active()),()=>{t.export(e,n=>{r(n)})})})}var Xhi=me(()=>{p();co();ENe();a(Zhi,"_export")});var Rft={};wi(Rft,{AnchoredClock:()=>uft,BindOnceFuture:()=>wft,CompositePropagator:()=>vft,ExportResultCode:()=>Cft,RPCType:()=>Sft,SDK_INFO:()=>Aft,TRACE_PARENT_HEADER:()=>CNe,TRACE_STATE_HEADER:()=>vNe,TimeoutError:()=>SNe,TraceState:()=>Yhe,W3CBaggagePropagator:()=>lft,W3CTraceContextPropagator:()=>bft,_globalThis:()=>mft,addHrTimes:()=>b0r,callWithTimeout:()=>Hhi,deleteRPCMetadata:()=>khi,diagLogLevelFromString:()=>Khi,getBooleanFromEnv:()=>pft,getNumberFromEnv:()=>fft,getRPCMetadata:()=>Phi,getStringFromEnv:()=>_Ne,getStringListFromEnv:()=>hft,getTimeOrigin:()=>Eft,globalErrorHandler:()=>Psi,hrTime:()=>v0r,hrTimeDuration:()=>dhi,hrTimeToMicroseconds:()=>mhi,hrTimeToMilliseconds:()=>hhi,hrTimeToNanoseconds:()=>phi,hrTimeToTimeStamp:()=>fhi,internal:()=>Gpa,isAttributeValue:()=>f0r,isTimeInput:()=>ghi,isTimeInputHrTime:()=>_ft,isTracingSuppressed:()=>Whe,isUrlIgnored:()=>$hi,loggingErrorHandler:()=>dft,merge:()=>Uhi,millisToHrTime:()=>zhe,otperformance:()=>xH,parseKeyPairsIntoRecord:()=>bsi,parseTraceParent:()=>I0r,sanitizeAttributes:()=>Isi,setGlobalErrorHandler:()=>ksi,setRPCMetadata:()=>Rhi,suppressTracing:()=>sft,timeInputToHrTime:()=>uhi,unrefTimer:()=>yhi,unsuppressTracing:()=>ysi,urlMatches:()=>k0r});var Gpa,kft=me(()=>{p();Ssi();Tsi();wsi();Dsi();p0r();Ahi();Ehi();_hi();d0r();C0r();Chi();whi();Dhi();ENe();T0r();jhi();Ghi();Vhi();zhi();Jhi();Xhi();Gpa={_export:Zhi}});var r0i=I(Pft=>{"use strict";p();Object.defineProperty(Pft,"__esModule",{value:!0});Pft.OpenTelemetrySpanWrapper=void 0;var e0i=(co(),Ca(v5)),t0i=(kft(),Ca(Rft)),$pa=c0r(),P0r=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&Vpa(e.error)?e.error?(this._span.setStatus({code:e0i.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:e0i.SpanStatusCode.ERROR}):e.status==="success"&&$pa.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,t0i.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,t0i.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Pft.OpenTelemetrySpanWrapper=P0r;function Vpa(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(Vpa,"isRecordableError")});var D0r=I(V5=>{"use strict";p();Object.defineProperty(V5,"__esModule",{value:!0});V5.environmentCache=V5.SDK_VERSION=void 0;V5.envVarToBoolean=Wpa;V5.SDK_VERSION="1.0.0-beta.9";V5.environmentCache=new Map;function Wpa(t){var e;V5.environmentCache.has(t)||zpa(t);let r=((e=V5.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(Wpa,"envVarToBoolean");function zpa(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];V5.environmentCache.set(t,r)}}a(zpa,"loadEnvironmentVariable")});var s0i=I(Dft=>{"use strict";p();Object.defineProperty(Dft,"__esModule",{value:!0});Dft.toOpenTelemetrySpanKind=o0i;Dft.toSpanOptions=Kpa;var n0i=(co(),Ca(v5)),i0i=(kft(),Ca(Rft));function o0i(t){let e=(t||"internal").toUpperCase();return n0i.SpanKind[e]}a(o0i,"toOpenTelemetrySpanKind");function Ypa(t=[]){return t.reduce((e,r)=>{let n=n0i.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,i0i.sanitizeAttributes)(r.attributes)}),e},[])}a(Ypa,"toOpenTelemetryLinks");function Kpa(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,i0i.sanitizeAttributes)(e),s=o0i(n),c=Ypa(r);return{attributes:o,kind:s,links:c}}a(Kpa,"toSpanOptions")});var l0i=I(wH=>{"use strict";p();Object.defineProperty(wH,"__esModule",{value:!0});wH.OpenTelemetryInstrumenter=wH.propagator=void 0;var W5=(co(),Ca(v5)),c0i=(kft(),Ca(Rft)),Jpa=r0i(),a0i=D0r(),Zpa=s0i();wH.propagator=new c0i.W3CTraceContextPropagator;var N0r=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||W5.context.active(),o;return(0,a0i.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=W5.trace.wrapSpanContext(W5.INVALID_SPAN_CONTEXT):(o=W5.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,Zpa.toSpanOptions)(r),n),(0,a0i.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,c0i.suppressTracing)(n))),{span:new Jpa.OpenTelemetrySpanWrapper(o),tracingContext:W5.trace.setSpan(n,o)}}withContext(e,r,...n){return W5.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return wH.propagator.extract(W5.context.active(),{traceparent:e},W5.defaultTextMapGetter)}createRequestHeaders(e){let r={};return wH.propagator.inject(e||W5.context.active(),r,W5.defaultTextMapSetter),r}};wH.OpenTelemetryInstrumenter=N0r});var d0i=I(TNe=>{"use strict";p();Object.defineProperty(TNe,"__esModule",{value:!0});TNe.AzureSdkInstrumentation=void 0;TNe.createAzureSdkInstrumentation=tha;var u0i=(e0r(),Ca(Xhr)),Xpa=l0i(),eha=D0r(),Nft=class extends u0i.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",eha.SDK_VERSION,Object.assign({},e))}init(){let e=new u0i.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Xpa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};TNe.AzureSdkInstrumentation=Nft;function tha(t={}){return new Nft(t)}a(tha,"createAzureSdkInstrumentation")});var p0i=I(Mft=>{"use strict";p();Object.defineProperty(Mft,"__esModule",{value:!0});var f0i=(OL(),Ca(E7));f0i.__exportStar(c0r(),Mft);f0i.__exportStar(d0i(),Mft)});var m0i=I($w=>{"use strict";p();Object.defineProperty($w,"__esModule",{value:!0});$w.enable=$w.azureCoreTracing=$w.AzureMonitorSymbol=void 0;var M0r=dp();$w.AzureMonitorSymbol="Azure_Monitor_Tracer";var O0r="azure-coretracing",h0i=!1,rha=a(function(t){if(h0i)return t;try{var e=(mii(),Ca(hii)),r=(co(),Ca(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 M0r.channel.publish(O0r,A),E},A},d[$w.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[$w.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 M0r.channel.publish(O0r,v),T},v},g[$w.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(e0r(),Ca(Xhr)),u=p0i();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}h0i=!0}catch{}return t},"azureCoreTracingPatchFunction");$w.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:rha,publisherName:O0r};function nha(){M0r.channel.registerMonkeyPatch("@azure/core-tracing",$w.azureCoreTracing)}a(nha,"enable");$w.enable=nha});var A0i=I(DX=>{"use strict";p();Object.defineProperty(DX,"__esModule",{value:!0});DX.enable=DX.bunyan=void 0;var g0i=dp(),iha=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)),g0i.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");DX.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:iha};function oha(){g0i.channel.registerMonkeyPatch("bunyan",DX.bunyan)}a(oha,"enable");DX.enable=oha});var E0i=I(NX=>{"use strict";p();Object.defineProperty(NX,"__esModule",{value:!0});NX.enable=NX.console=void 0;var B0r=dp(),y0i=require("stream"),sha=a(function(t){var e=new y0i.Writable,r=new y0i.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return B0r.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return B0r.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:sha};function aha(){B0r.channel.registerMonkeyPatch("console",NX.console),require("console")}a(aha,"enable");NX.enable=aha});var _0i=I(MX=>{"use strict";p();Object.defineProperty(MX,"__esModule",{value:!0});MX.enable=MX.mongoCore=void 0;var L0r=dp(),cha=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]=L0r.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]=L0r.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");MX.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:cha};function lha(){L0r.channel.registerMonkeyPatch("mongodb-core",MX.mongoCore)}a(lha,"enable");MX.enable=lha});var C0i=I(sC=>{"use strict";p();var Khe=sC&&sC.__assign||function(){return Khe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:uha};sC.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:dha};sC.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:pha};function hha(){EE.channel.registerMonkeyPatch("mongodb",sC.mongo2),EE.channel.registerMonkeyPatch("mongodb",sC.mongo3),EE.channel.registerMonkeyPatch("mongodb",sC.mongo330)}a(hha,"enable");sC.enable=hha});var b0i=I(OX=>{"use strict";p();Object.defineProperty(OX,"__esModule",{value:!0});OX.enable=OX.mysql=void 0;var Oft=dp(),v0i=require("path"),mha=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]=Oft.channel.bindToContext(h(_,E))):arguments[A]=Oft.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(v0i.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;Oft.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(v0i.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");OX.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:mha};function gha(){Oft.channel.registerMonkeyPatch("mysql",OX.mysql)}a(gha,"enable");OX.enable=gha});var T0i=I(BX=>{"use strict";p();Object.defineProperty(BX,"__esModule",{value:!0});BX.enable=BX.postgresPool1=void 0;var S0i=dp();function Aha(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=S0i.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(Aha,"postgresPool1PatchFunction");BX.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:Aha};function yha(){S0i.channel.registerMonkeyPatch("pg-pool",BX.postgresPool1)}a(yha,"enable");BX.enable=yha});var x0i=I(z5=>{"use strict";p();Object.defineProperty(z5,"__esModule",{value:!0});z5.enable=z5.postgres=z5.postgres6=void 0;var Jhe=dp(),I0i=require("events"),F0r="postgres";function Eha(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=Jhe.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),Jhe.channel.publish(F0r,u),A){if(m)return m.apply(this,arguments);f&&f instanceof I0i.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(Eha,"postgres6PatchFunction");function _ha(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=Jhe.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),Jhe.channel.publish(F0r,m),T){if(v)return v.apply(this,arguments);g&&g instanceof I0i.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(_ha,"postgresLatestPatchFunction");z5.postgres6={versionSpecifier:"6.*",patch:Eha};z5.postgres={versionSpecifier:">=7.* <=8.*",patch:_ha,publisherName:F0r};function Cha(){Jhe.channel.registerMonkeyPatch("pg",z5.postgres6),Jhe.channel.registerMonkeyPatch("pg",z5.postgres)}a(Cha,"enable");z5.enable=Cha});var w0i=I(LX=>{"use strict";p();Object.defineProperty(LX,"__esModule",{value:!0});LX.enable=LX.redis=void 0;var U0r=dp(),vha=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=U0r.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;U0r.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");LX.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:vha};function bha(){U0r.channel.registerMonkeyPatch("redis",LX.redis)}a(bha,"enable");LX.enable=bha});var R0i=I(r8=>{"use strict";p();var Bft=r8&&r8.__assign||function(){return Bft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:Sha};function Tha(){Q0r.channel.registerMonkeyPatch("tedious",r8.tedious)}a(Tha,"enable");r8.enable=Tha});var k0i=I(Rb=>{"use strict";p();var Iha=Rb&&Rb.__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)}})(),xha=Rb&&Rb.__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");Rb.winston3={versionSpecifier:"3.x",patch:Rha};Rb.winston2={versionSpecifier:"2.x",patch:wha};function kha(){Lft.channel.registerMonkeyPatch("winston",Rb.winston2),Lft.channel.registerMonkeyPatch("winston",Rb.winston3)}a(kha,"enable");Rb.enable=kha});var j0i=I(bu=>{"use strict";p();Object.defineProperty(bu,"__esModule",{value:!0});bu.enable=bu.tedious=bu.pgPool=bu.pg=bu.winston=bu.redis=bu.mysql=bu.mongodb=bu.mongodbCore=bu.console=bu.bunyan=bu.azuresdk=void 0;var P0i=m0i();bu.azuresdk=P0i;var D0i=A0i();bu.bunyan=D0i;var N0i=E0i();bu.console=N0i;var M0i=_0i();bu.mongodbCore=M0i;var O0i=C0i();bu.mongodb=O0i;var B0i=b0i();bu.mysql=B0i;var L0i=T0i();bu.pgPool=L0i;var F0i=x0i();bu.pg=F0i;var U0i=w0i();bu.redis=U0i;var Q0i=R0i();bu.tedious=Q0i;var q0i=k0i();bu.winston=q0i;function Pha(){D0i.enable(),N0i.enable(),M0i.enable(),O0i.enable(),B0i.enable(),F0i.enable(),L0i.enable(),U0i.enable(),q0i.enable(),P0i.enable(),Q0i.enable()}a(Pha,"enable");bu.enable=Pha});var Qft=I(FX=>{"use strict";p();Object.defineProperty(FX,"__esModule",{value:!0});FX.IsInitialized=void 0;FX.registerContextPreservation=Dha;var q0r=$l(),G0i=Xut();FX.IsInitialized=!G0i.JsonConfig.getInstance().noDiagnosticChannel;var j0r="DiagnosticChannel";if(FX.IsInitialized){R2=j0i(),H0i=G0i.JsonConfig.getInstance().noPatchModules,Fft=H0i.split(","),H0r={bunyan:R2.bunyan,console:R2.console,mongodb:R2.mongodb,mongodbCore:R2.mongodbCore,mysql:R2.mysql,redis:R2.redis,pg:R2.pg,pgPool:R2.pgPool,winston:R2.winston,azuresdk:R2.azuresdk};for(Uft in H0r)Fft.indexOf(Uft)===-1&&(H0r[Uft].enable(),q0r.info(j0r,"Subscribed to ".concat(Uft," events")));Fft.length>0&&q0r.info(j0r,"Some modules will not be patched",Fft)}else q0r.info(j0r,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var R2,H0i,Fft,H0r,Uft;function Dha(t){if(FX.IsInitialized){var e=dp();e.channel.addContextPreservation(t)}}a(Dha,"registerContextPreservation")});var Zhe=I((NXf,$0i)=>{"use strict";p();$0i.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 qA=I((V0r,V0i)=>{"use strict";p();var kH=V0r&&V0r.__assign||function(){return kH=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"){UX.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"){UX.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+")",UX.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 W0r=qA(),Bha=(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"|"+W0r.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=W0r.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=W0r.randomu32(),t})();W0i.exports=Bha});var qft=I((QXf,z0i)=>{"use strict";p();var jA=qA(),Lha=QX(),Fha=(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=jA.w3cTraceId(),this.spanId=jA.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=jA.w3cTraceId(),this.spanId=jA.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=jA.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=jA.w3cTraceId(),this.spanId=jA.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=jA.w3cTraceId(),this.spanId=jA.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=jA.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=jA.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=jA.w3cTraceId().substr(0,16),this.traceId=jA.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=Lha.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=jA.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=jA.w3cTraceId(),this.spanId=jA.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=jA.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();z0i.exports=Fha});var z0r=I((HXf,Y0i)=>{"use strict";p();var Uha=(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 Qha=(function(){function t(){}return a(t,"Domain"),t})();K0i.exports=Qha});var Z0i=I((Y0r,J0i)=>{"use strict";p();var qha=Y0r&&Y0r.__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)}})(),jha=n8(),Hha=(function(t){qha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(jha);J0i.exports=Hha});var K0r=I((JXf,X0i)=>{"use strict";p();var Gha=(function(){function t(){}return a(t,"Base"),t})();X0i.exports=Gha});var tmi=I((eep,emi)=>{"use strict";p();var $ha=(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})();emi.exports=$ha});var nmi=I((J0r,rmi)=>{"use strict";p();var Vha=J0r&&J0r.__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)}})(),Wha=K0r(),zha=(function(t){Vha(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(Wha);rmi.exports=zha});var X0r=I((oep,imi)=>{"use strict";p();var Z0r;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(Z0r||(Z0r={}));imi.exports=Z0r});var smi=I((aep,omi)=>{"use strict";p();var Yha=X0r(),Kha=(function(){function t(){this.kind=Yha.Measurement}return a(t,"DataPoint"),t})();omi.exports=Kha});var cmi=I((uep,ami)=>{"use strict";p();var Jha=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();ami.exports=Jha});var tmr=I((emr,lmi)=>{"use strict";p();var Zha=emr&&emr.__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)}})(),Xha=n8(),e0a=(function(t){Zha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(Xha);lmi.exports=e0a});var dmi=I((rmr,umi)=>{"use strict";p();var t0a=rmr&&rmr.__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)}})(),r0a=n8(),n0a=(function(t){t0a(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})(r0a);umi.exports=n0a});var pmi=I((Aep,fmi)=>{"use strict";p();var i0a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();fmi.exports=i0a});var mmi=I((nmr,hmi)=>{"use strict";p();var o0a=nmr&&nmr.__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)}})(),s0a=n8(),a0a=(function(t){o0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(s0a);hmi.exports=a0a});var Ami=I((imr,gmi)=>{"use strict";p();var c0a=imr&&imr.__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)}})(),l0a=n8(),u0a=(function(t){c0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(l0a);gmi.exports=u0a});var Emi=I((omr,ymi)=>{"use strict";p();var d0a=omr&&omr.__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)}})(),f0a=tmr(),p0a=(function(t){d0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(f0a);ymi.exports=p0a});var Cmi=I((smr,_mi)=>{"use strict";p();var h0a=smr&&smr.__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)}})(),m0a=n8(),g0a=(function(t){h0a(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})(m0a);_mi.exports=g0a});var bmi=I((amr,vmi)=>{"use strict";p();var A0a=amr&&amr.__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)}})(),y0a=n8(),E0a=(function(t){A0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(y0a);vmi.exports=E0a});var Tmi=I((kep,Smi)=>{"use strict";p();var cmr;(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"})(cmr||(cmr={}));Smi.exports=cmr});var xmi=I((Dep,Imi)=>{"use strict";p();var _0a=(function(){function t(){}return a(t,"StackFrame"),t})();Imi.exports=_0a});var lmr=I(a0=>{"use strict";p();Object.defineProperty(a0,"__esModule",{value:!0});a0.AvailabilityData=Z0i();a0.Base=K0r();a0.ContextTagKeys=tmi();a0.Data=nmi();a0.DataPoint=smi();a0.DataPointType=X0r();a0.Domain=n8();a0.Envelope=cmi();a0.EventData=tmr();a0.ExceptionData=dmi();a0.ExceptionDetails=pmi();a0.MessageData=mmi();a0.MetricData=Ami();a0.PageViewData=Emi();a0.RemoteDependencyData=Cmi();a0.RequestData=bmi();a0.SeverityLevel=Tmi();a0.StackFrame=xmi()});var wmi=I(INe=>{"use strict";p();Object.defineProperty(INe,"__esModule",{value:!0});INe.RemoteDependencyDataConstants=void 0;INe.domainSupportsProperties=v0a;var qX=lmr(),C0a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();INe.RemoteDependencyDataConstants=C0a;function v0a(t){return"properties"in t||t instanceof qX.EventData||t instanceof qX.ExceptionData||t instanceof qX.MessageData||t instanceof qX.MetricData||t instanceof qX.PageViewData||t instanceof qX.RemoteDependencyData||t instanceof qX.RequestData}a(v0a,"domainSupportsProperties")});var kmi=I(Rmi=>{"use strict";p();Object.defineProperty(Rmi,"__esModule",{value:!0})});var Dmi=I(Pmi=>{"use strict";p();Object.defineProperty(Pmi,"__esModule",{value:!0})});var Mmi=I(Nmi=>{"use strict";p();Object.defineProperty(Nmi,"__esModule",{value:!0})});var Bmi=I(Omi=>{"use strict";p();Object.defineProperty(Omi,"__esModule",{value:!0})});var Fmi=I(Lmi=>{"use strict";p();Object.defineProperty(Lmi,"__esModule",{value:!0})});var Qmi=I(Umi=>{"use strict";p();Object.defineProperty(Umi,"__esModule",{value:!0})});var jmi=I(qmi=>{"use strict";p();Object.defineProperty(qmi,"__esModule",{value:!0})});var Gmi=I(Hmi=>{"use strict";p();Object.defineProperty(Hmi,"__esModule",{value:!0})});var Vmi=I($mi=>{"use strict";p();Object.defineProperty($mi,"__esModule",{value:!0})});var zmi=I(Wmi=>{"use strict";p();Object.defineProperty(Wmi,"__esModule",{value:!0})});var Kmi=I(Ymi=>{"use strict";p();Object.defineProperty(Ymi,"__esModule",{value:!0})});var Zmi=I(Jmi=>{"use strict";p();Object.defineProperty(Jmi,"__esModule",{value:!0})});var Xmi=I(PH=>{"use strict";p();Object.defineProperty(PH,"__esModule",{value:!0});PH.TelemetryType=PH.TelemetryTypeString=void 0;PH.telemetryTypeToBaseType=b0a;PH.baseTypeToTelemetryType=S0a;function b0a(t){switch(t){case bg.Event:return"EventData";case bg.Exception:return"ExceptionData";case bg.Trace:return"MessageData";case bg.Metric:return"MetricData";case bg.Request:return"RequestData";case bg.Dependency:return"RemoteDependencyData";case bg.Availability:return"AvailabilityData";case bg.PageView:return"PageViewData"}}a(b0a,"telemetryTypeToBaseType");function S0a(t){switch(t){case"EventData":return bg.Event;case"ExceptionData":return bg.Exception;case"MessageData":return bg.Trace;case"MetricData":return bg.Metric;case"RequestData":return bg.Request;case"RemoteDependencyData":return bg.Dependency;case"AvailabilityData":return bg.Availability;case"PageViewData":return bg.PageView}}a(S0a,"baseTypeToTelemetryType");PH.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var bg;(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"})(bg||(PH.TelemetryType=bg={}))});var egi=I(cm=>{"use strict";p();var T0a=cm&&cm.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TT=cm&&cm.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T0a(e,t,r)};Object.defineProperty(cm,"__esModule",{value:!0});TT(kmi(),cm);TT(Dmi(),cm);TT(Mmi(),cm);TT(Bmi(),cm);TT(Fmi(),cm);TT(Qmi(),cm);TT(jmi(),cm);TT(Gmi(),cm);TT(Vmi(),cm);TT(zmi(),cm);TT(Kmi(),cm);TT(Zmi(),cm);TT(Xmi(),cm)});var rgi=I(tgi=>{"use strict";p();Object.defineProperty(tgi,"__esModule",{value:!0})});var igi=I(ngi=>{"use strict";p();Object.defineProperty(ngi,"__esModule",{value:!0})});var sgi=I(ogi=>{"use strict";p();Object.defineProperty(ogi,"__esModule",{value:!0})});var cgi=I(agi=>{"use strict";p();Object.defineProperty(agi,"__esModule",{value:!0})});var ugi=I(lgi=>{"use strict";p();Object.defineProperty(lgi,"__esModule",{value:!0})});var fgi=I(dgi=>{"use strict";p();Object.defineProperty(dgi,"__esModule",{value:!0})});var hgi=I(pgi=>{"use strict";p();Object.defineProperty(pgi,"__esModule",{value:!0})});var ggi=I(mgi=>{"use strict";p();Object.defineProperty(mgi,"__esModule",{value:!0})});var Agi=I(kb=>{"use strict";p();var I0a=kb&&kb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DH=kb&&kb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I0a(e,t,r)};Object.defineProperty(kb,"__esModule",{value:!0});DH(rgi(),kb);DH(igi(),kb);DH(sgi(),kb);DH(cgi(),kb);DH(ugi(),kb);DH(fgi(),kb);DH(hgi(),kb);DH(ggi(),kb)});var _E=I(Y5=>{"use strict";p();var x0a=Y5&&Y5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jft=Y5&&Y5.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x0a(e,t,r)};Object.defineProperty(Y5,"__esModule",{value:!0});jft(wmi(),Y5);jft(lmr(),Y5);jft(egi(),Y5);jft(Agi(),Y5)});var umr=I((Ftp,ygi)=>{"use strict";p();var w0a=(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 k2;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 HA;(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"})(HA||(jr.QuickPulseCounter=HA={}));var xNe;(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"})(xNe||(jr.PerformanceCounter=xNe={}));var Egi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(Egi||(jr.MetricId=Egi={}));jr.PerformanceToQuickPulseCounter=(k2={},k2[xNe.PROCESSOR_TIME]=HA.PROCESSOR_TIME,k2[xNe.REQUEST_RATE]=HA.REQUEST_RATE,k2[xNe.REQUEST_DURATION]=HA.REQUEST_DURATION,k2[HA.COMMITTED_BYTES]=HA.COMMITTED_BYTES,k2[HA.REQUEST_FAILURE_RATE]=HA.REQUEST_FAILURE_RATE,k2[HA.DEPENDENCY_RATE]=HA.DEPENDENCY_RATE,k2[HA.DEPENDENCY_FAILURE_RATE]=HA.DEPENDENCY_FAILURE_RATE,k2[HA.DEPENDENCY_DURATION]=HA.DEPENDENCY_DURATION,k2[HA.EXCEPTION_RATE]=HA.EXCEPTION_RATE,k2);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 _gi;(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"})(_gi||(jr.StatsbeatFeature=_gi={}));var Cgi;(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"})(Cgi||(jr.StatsbeatInstrumentation=Cgi={}));var vgi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(vgi||(jr.StatsbeatFeatureType=vgi={}));var bgi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(bgi||(jr.StatsbeatNetworkCategory=bgi={}));var Sgi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(Sgi||(jr.HttpRequestCookieNames=Sgi={}));var Tgi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(Tgi||(jr.AttachTypePrefix=Tgi={}));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 hmr=I((pmr,Igi)=>{"use strict";p();var R0a=pmr&&pmr.__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)}})(),Hft=require("url"),k0a=_E(),dmr=qA(),IT=Zhe(),P0a=umr(),NH=QX(),D0a=z0r(),fmr=qft(),N0a=$l(),Gft=ad(),M0a=(function(t){R0a(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 Hft.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(Gft.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Gft.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Gft.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 Hft.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 Hft.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=Hft.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===Gft.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",N0a.warn("Could not decode the auth cookie with error: ",dmr.dumpObj(s))}var o=e.parseId(dmr.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=dmr.getCorrelationContextTarget(r,IT.requestContextSourceKey),r.headers){var o=r.headers[IT.traceStateHeader]?r.headers[IT.traceStateHeader].toString():null,s=r.headers[IT.traceparentHeader]?r.headers[IT.traceparentHeader].toString():null,c=r.headers[IT.requestIdHeader]?r.headers[IT.requestIdHeader].toString():null,l=r.headers[IT.parentIdHeader]?r.headers[IT.parentIdHeader].toString():null,u=r.headers[IT.rootIdHeader]?r.headers[IT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[IT.correlationContextHeader]?r.headers[IT.correlationContextHeader].toString():null,NH.w3cEnabled&&(s||o)?(this.traceparent=new fmr(s?s.toString():null),this.tracestate=s&&o&&new D0a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?NH.w3cEnabled?(this.traceparent=new fmr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=NH.generateRequestId(this.parentId),this.operationId=NH.getRootId(this.requestId)):NH.w3cEnabled?(this.traceparent=new fmr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=NH.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=NH.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=NH.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new k0a.ContextTagKeys,e})(P0a);Igi.exports=M0a});var Hgi=I((Eo,jgi)=>{p();Eo=jgi.exports=Na;var al;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?al=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):al=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var wNe=256,$ft=Number.MAX_SAFE_INTEGER||9007199254740991,mmr=16,O0a=wNe-6,RNe=Eo.re=[],Su=Eo.safeRe=[],er=Eo.src=[],pa=0,_mr="[a-zA-Z0-9-]",gmr=[["\\s",1],["\\d",wNe],[_mr,O0a]];function Jft(t){for(var e=0;e)?=?)";var Vft=pa++;er[Vft]=er[t0e]+"|x|X|\\*";var Wft=pa++;er[Wft]=er[e0e]+"|x|X|\\*";var jX=pa++;er[jX]="[v=\\s]*("+er[Wft]+")(?:\\.("+er[Wft]+")(?:\\.("+er[Wft]+")(?:"+er[vmr]+")?"+er[PNe]+"?)?)?";var n0e=pa++;er[n0e]="[v=\\s]*("+er[Vft]+")(?:\\.("+er[Vft]+")(?:\\.("+er[Vft]+")(?:"+er[bmr]+")?"+er[PNe]+"?)?)?";var Pgi=pa++;er[Pgi]="^"+er[s0e]+"\\s*"+er[jX]+"$";var Dgi=pa++;er[Dgi]="^"+er[s0e]+"\\s*"+er[n0e]+"$";var Ngi=pa++;er[Ngi]="(?:^|[^\\d])(\\d{1,"+mmr+"})(?:\\.(\\d{1,"+mmr+"}))?(?:\\.(\\d{1,"+mmr+"}))?(?:$|[^\\d])";var Zft=pa++;er[Zft]="(?:~>?)";var i0e=pa++;er[i0e]="(\\s*)"+er[Zft]+"\\s+";RNe[i0e]=new RegExp(er[i0e],"g");Su[i0e]=new RegExp(Jft(er[i0e]),"g");var B0a="$1~",Mgi=pa++;er[Mgi]="^"+er[Zft]+er[jX]+"$";var Ogi=pa++;er[Ogi]="^"+er[Zft]+er[n0e]+"$";var Xft=pa++;er[Xft]="(?:\\^)";var o0e=pa++;er[o0e]="(\\s*)"+er[Xft]+"\\s+";RNe[o0e]=new RegExp(er[o0e],"g");Su[o0e]=new RegExp(Jft(er[o0e]),"g");var L0a="$1^",Bgi=pa++;er[Bgi]="^"+er[Xft]+er[jX]+"$";var Lgi=pa++;er[Lgi]="^"+er[Xft]+er[n0e]+"$";var xmr=pa++;er[xmr]="^"+er[s0e]+"\\s*("+Tmr+")$|^$";var wmr=pa++;er[wmr]="^"+er[s0e]+"\\s*("+kgi+")$|^$";var HX=pa++;er[HX]="(\\s*)"+er[s0e]+"\\s*("+Tmr+"|"+er[jX]+")";RNe[HX]=new RegExp(er[HX],"g");Su[HX]=new RegExp(Jft(er[HX]),"g");var F0a="$1$2$3",Fgi=pa++;er[Fgi]="^\\s*("+er[jX]+")\\s+-\\s+("+er[jX]+")\\s*$";var Ugi=pa++;er[Ugi]="^\\s*("+er[n0e]+")\\s+-\\s+("+er[n0e]+")\\s*$";var Qgi=pa++;er[Qgi]="(<|>)?=?\\s*\\*";for(K5=0;K5wNe)return null;var r=e.loose?Su[Imr]:Su[Smr];if(!r.test(t))return null;try{return new Na(t,e)}catch{return null}}a(GX,"parse");Eo.valid=U0a;function U0a(t,e){var r=GX(t,e);return r?r.version:null}a(U0a,"valid");Eo.clean=Q0a;function Q0a(t,e){var r=GX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Q0a,"clean");Eo.SemVer=Na;function Na(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Na){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>wNe)throw new TypeError("version is longer than "+wNe+" characters");if(!(this instanceof Na))return new Na(t,e);al("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Su[Imr]:Su[Smr]);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>$ft||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$ft||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$ft||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<$ft)return o}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}a(Na,"SemVer");Na.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};Na.prototype.toString=function(){return this.version};Na.prototype.compare=function(t){return al("SemVer.compare",this.version,this.options,t),t instanceof Na||(t=new Na(t,this.options)),this.compareMain(t)||this.comparePre(t)};Na.prototype.compareMain=function(t){return t instanceof Na||(t=new Na(t,this.options)),r0e(this.major,t.major)||r0e(this.minor,t.minor)||r0e(this.patch,t.patch)};Na.prototype.comparePre=function(t){if(t instanceof Na||(t=new Na(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var r=this.prerelease[e],n=t.prerelease[e];if(al("prerelease compare",e,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return r0e(r,n)}while(++e)};Na.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",e),this.inc("pre",e);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":if(this.prerelease.length===0)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=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=q0a;function q0a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Na(t,r).inc(e,n).version}catch{return null}}a(q0a,"inc");Eo.diff=j0a;function j0a(t,e){if(Rmr(t,e))return null;var r=GX(t),n=GX(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(j0a,"diff");Eo.compareIdentifiers=r0e;var xgi=/^[0-9]+$/;function r0e(t,e){var r=xgi.test(t),n=xgi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(kNe,"gt");Eo.lt=zft;function zft(t,e,r){return i8(t,e,r)<0}a(zft,"lt");Eo.eq=Rmr;function Rmr(t,e,r){return i8(t,e,r)===0}a(Rmr,"eq");Eo.neq=qgi;function qgi(t,e,r){return i8(t,e,r)!==0}a(qgi,"neq");Eo.gte=kmr;function kmr(t,e,r){return i8(t,e,r)>=0}a(kmr,"gte");Eo.lte=Pmr;function Pmr(t,e,r){return i8(t,e,r)<=0}a(Pmr,"lte");Eo.cmp=Yft;function Yft(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 Rmr(t,r,n);case"!=":return qgi(t,r,n);case">":return kNe(t,r,n);case">=":return kmr(t,r,n);case"<":return zft(t,r,n);case"<=":return Pmr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Yft,"cmp");Eo.Comparator=Vw;function Vw(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Vw){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof Vw))return new Vw(t,e);t=t.trim().split(/\s+/).join(" "),al("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===DNe?this.value="":this.value=this.operator+this.semver.version,al("comp",this)}a(Vw,"Comparator");var DNe={};Vw.prototype.parse=function(t){var e=this.options.loose?Su[xmr]:Su[wmr],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 Na(r[2],this.options.loose):this.semver=DNe};Vw.prototype.toString=function(){return this.value};Vw.prototype.test=function(t){return al("Comparator.test",t,this.options.loose),this.semver===DNe?!0:(typeof t=="string"&&(t=new Na(t,this.options)),Yft(t,this.operator,this.semver,this.options))};Vw.prototype.intersects=function(t,e){if(!(t instanceof Vw))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Ef(t.value,e),Kft(this.value,r,e);if(t.operator==="")return r=new Ef(this.value,e),Kft(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=Yft(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Yft(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Ef;function Ef(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ef)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Ef(t.raw,e);if(t instanceof Vw)return new Ef(t.value,e);if(!(this instanceof Ef))return new Ef(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(Ef,"Range");Ef.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Ef.prototype.toString=function(){return this.range};Ef.prototype.parseRange=function(t){var e=this.options.loose,r=e?Su[Ugi]:Su[Fgi];t=t.replace(r,sma),al("hyphen replace",t),t=t.replace(Su[HX],F0a),al("comparator trim",t,Su[HX]),t=t.replace(Su[i0e],B0a),t=t.replace(Su[o0e],L0a);var n=e?Su[xmr]:Su[wmr],o=t.split(" ").map(function(s){return Z0a(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 Vw(s,this.options)},this),o};Ef.prototype.intersects=function(t,e){if(!(t instanceof Ef))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=J0a;function J0a(t,e){return new Ef(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(J0a,"toComparators");function Z0a(t,e){return al("comp",t,e),t=tma(t,e),al("caret",t),t=X0a(t,e),al("tildes",t),t=nma(t,e),al("xrange",t),t=oma(t,e),al("stars",t),t}a(Z0a,"parseComparator");function aC(t){return!t||t.toLowerCase()==="x"||t==="*"}a(aC,"isX");function X0a(t,e){return t.trim().split(/\s+/).map(function(r){return ema(r,e)}).join(" ")}a(X0a,"replaceTildes");function ema(t,e){var r=e.loose?Su[Ogi]:Su[Mgi];return t.replace(r,function(n,o,s,c,l){al("tilde",t,n,o,s,c,l);var u;return aC(o)?u="":aC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":aC(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(al("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",al("tilde return",u),u})}a(ema,"replaceTilde");function tma(t,e){return t.trim().split(/\s+/).map(function(r){return rma(r,e)}).join(" ")}a(tma,"replaceCarets");function rma(t,e){al("caret",t,e);var r=e.loose?Su[Lgi]:Su[Bgi];return t.replace(r,function(n,o,s,c,l){al("caret",t,n,o,s,c,l);var u;return aC(o)?u="":aC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":aC(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(al("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"):(al("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"),al("caret return",u),u})}a(rma,"replaceCaret");function nma(t,e){return al("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return ima(r,e)}).join(" ")}a(nma,"replaceXRanges");function ima(t,e){t=t.trim();var r=e.loose?Su[Dgi]:Su[Pgi];return t.replace(r,function(n,o,s,c,l,u){al("xRange",t,n,o,s,c,l,u);var d=aC(s),f=d||aC(c),h=f||aC(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"),al("xRange return",n),n})}a(ima,"replaceXRange");function oma(t,e){return al("replaceStars",t,e),t.trim().replace(Su[Qgi],"")}a(oma,"replaceStars");function sma(t,e,r,n,o,s,c,l,u,d,f,h,m){return aC(r)?e="":aC(n)?e=">="+r+".0.0":aC(o)?e=">="+r+"."+n+".0":e=">="+e,aC(u)?l="":aC(d)?l="<"+(+u+1)+".0.0":aC(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(sma,"hyphenReplace");Ef.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Na(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(ama,"testSet");Eo.satisfies=Kft;function Kft(t,e,r){try{e=new Ef(e,r)}catch{return!1}return e.test(t)}a(Kft,"satisfies");Eo.maxSatisfying=cma;function cma(t,e,r){var n=null,o=null;try{var s=new Ef(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Na(n,r))}),n}a(cma,"maxSatisfying");Eo.minSatisfying=lma;function lma(t,e,r){var n=null,o=null;try{var s=new Ef(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Na(n,r))}),n}a(lma,"minSatisfying");Eo.minVersion=uma;function uma(t,e){t=new Ef(t,e);var r=new Na("0.0.0");if(t.test(r)||(r=new Na("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||kNe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(uma,"minVersion");Eo.validRange=dma;function dma(t,e){try{return new Ef(t,e).range||"*"}catch{return null}}a(dma,"validRange");Eo.ltr=fma;function fma(t,e,r){return Dmr(t,e,"<",r)}a(fma,"ltr");Eo.gtr=pma;function pma(t,e,r){return Dmr(t,e,">",r)}a(pma,"gtr");Eo.outside=Dmr;function Dmr(t,e,r,n){t=new Na(t,n),e=new Ef(e,n);var o,s,c,l,u;switch(r){case">":o=kNe,s=Pmr,c=zft,l=">",u=">=";break;case"<":o=zft,s=kmr,c=kNe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kft(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(Dmr,"outside");Eo.prerelease=hma;function hma(t,e){var r=GX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(hma,"prerelease");Eo.intersects=mma;function mma(t,e,r){return t=new Ef(t,r),e=new Ef(e,r),t.intersects(e)}a(mma,"intersects");Eo.coerce=gma;function gma(t){if(t instanceof Na)return t;if(typeof t!="string")return null;var e=t.match(Su[Ngi]);return e==null?null:GX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(gma,"coerce")});var rpt=I((Wtp,Wgi)=>{"use strict";p();var $gi=Uhe(),a0e=$gi.wrap,ept=$gi.unwrap,o8="wrap@before";function tpt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(tpt,"defineProperty");function Ama(t,e){for(var r=e.length,n=0;n0&&Ama(t,o)}a(yma,"_findAndProcess");function Ggi(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 Rc=require("util"),s8=require("assert"),Ema=rpt(),cd=require("async_hooks"),NNe="cls@contexts",MNe="error@context",_f=process.env.DEBUG_CLS_HOOKED,wc=-1;Kgi.exports={getNamespace:zgi,createNamespace:_ma,destroyNamespace:Ygi,reset:Cma,ERROR_SYMBOL:MNe};function Ww(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(Ww,"Namespace");Ww.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,_f){let n=" ".repeat(this._indent<0?0:this._indent);Qd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+wc+" active:"+Rc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");Ww.prototype.get=a(function(e){if(!this.active){if(_f){let r=cd.currentId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+wc+" active:"+Rc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),Qd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Rc.inspect(this.active)}`)}return this.active[e]},"get");Ww.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=wc,_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Rc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");Ww.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(_f){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Qd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Rc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[MNe]=r),n}finally{if(_f){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Qd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Rc.inspect(r)}`)}this.exit(r)}},"run");Ww.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");Ww.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 _f&&Qd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),n.then(o=>(_f&&Qd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[MNe]=r,_f&&Qd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),this.exit(r),o})},"runPromise");Ww.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[MNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");Ww.prototype.enter=a(function(e){if(s8.ok(e,"context must be provided for entering"),_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Rc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");Ww.prototype.exit=a(function(e){if(s8.ok(e,"context must be provided for exiting"),_f){let n=cd.executionAsyncId(),o=cd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Qd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${wc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Rc.inspect(e)}`)}if(this.active===e){s8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(_f&&Qd("??ERROR?? context exiting but not entered - ignoring: "+Rc.inspect(e)),s8.ok(r>=0,`context not currently entered; can't exit. -`+Rc.inspect(this)+` -`+Rc.inspect(e))):(s8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");Ww.prototype.bindEmitter=a(function(e){s8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[NNe]||(c[NNe]=Object.create(null)),c[NNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[NNe]))return c;let l=c,u=c[NNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Ema(e,o,s)},"bindEmitter");Ww.prototype.fromException=a(function(e){return e[MNe]},"fromException");function zgi(t){return process.namespaces[t]}a(zgi,"getNamespace");function _ma(t){s8.ok(t,"namespace must be given a name."),_f&&Qd(`NS-CREATING NAMESPACE (${t})`);let e=new Ww(t);return e.id=wc,cd.createHook({init(n,o,s,c){if(wc=cd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),_f){let l=" ".repeat(e._indent<0?0:e._indent);Qd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(wc===0){let l=cd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),_f){let d=" ".repeat(e._indent<0?0:e._indent);Qd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${l} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(_f){let d=" ".repeat(e._indent<0?0:e._indent);Qd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${l} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(_f&&o==="PROMISE"){Qd(Rc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);Qd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){wc=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(wc),o){if(_f){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(_f){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Rc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){wc=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(wc),o){if(_f){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}AFTER (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`)}e.exit(o)}else if(_f){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`)}},destroy(n){if(wc=cd.executionAsyncId(),_f){let o=cd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);Qd(`${s}DESTROY (${t}) currentUid:${wc} asyncId:${n} triggerId:${o} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(e._contexts.get(wc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(_ma,"createNamespace");function Ygi(t){let e=zgi(t);s8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),s8.ok(e.id,"don't assign to process.namespaces directly! "+Rc.inspect(e)),process.namespaces[t]=null}a(Ygi,"destroyNamespace");function Cma(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Ygi(t)}),process.namespaces=Object.create(null)}a(Cma,"reset");process.namespaces={};function Qd(...t){_f&&process._rawDebug(`${Rc.format(...t)}`)}a(Qd,"debug2")});var Xgi=I((Xtp,Zgi)=>{"use strict";p();function vma(){}a(vma,"NextTickWrap");Zgi.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 tAi=I((rrp,eAi)=>{"use strict";p();function bma(){}a(bma,"PromiseWrap");eAi.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 bma,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 nAi=I((orp,rAi)=>{"use strict";p();var xT=require("timers");function Sma(){}a(Sma,"TimeoutWrap");function Tma(){}a(Tma,"IntervalWrap");function Ima(){}a(Ima,"ImmediateWrap");var xma=new Map,wma=new Map,Rma=new Map,Nmr=null,Mmr=!1;rAi.exports=a(function(){Omr(this._hooks,this._state,"setTimeout","clearTimeout",Sma,xma,!0),Omr(this._hooks,this._state,"setInterval","clearInterval",Tma,wma,!1),Omr(this._hooks,this._state,"setImmediate","clearImmediate",Ima,Rma,!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 Omr(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),Nmr=null,(c||Mmr)&&(Mmr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(xT,d),s.set(g,m),g},xT[n]=function(d){if(Nmr===d&&d!==null)Mmr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(xT,arguments)}}a(Omr,"patchTimer")});var Bmr=I((crp,kma)=>{kma.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 sAi=I((lrp,oAi)=>{"use strict";p();var BNe=process.binding("async_wrap"),Pma=BNe.Providers.TIMERWRAP,iAi={nextTick:Xgi(),promise:tAi(),timers:nAi()},ONe=new Set;function Dma(){this.enabled=!1,this.counter=0}a(Dma,"State");function Lmr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===Pma){ONe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!ONe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!ONe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(ONe.has(o)){ONe.delete(o);return}for(let s of n)s(o)}}a(Lmr,"Hooks");Lmr.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 npt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(npt,"removeElement");Lmr.prototype.remove=function(t){t.init&&npt(this.initFns,t.init),t.pre&&npt(this.preFns,t.pre),t.post&&npt(this.postFns,t.post),t.destroy&&npt(this.destroyFns,t.destroy)};function LNe(){this._state=new Dma,this._hooks=new Lmr,this.version=Bmr().version,this.providers=BNe.Providers;for(let t of Object.keys(iAi))iAi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),BNe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(LNe,"AsyncHook");oAi.exports=LNe;LNe.prototype.addHooks=function(t){this._hooks.add(t)};LNe.prototype.removeHooks=function(t){this._hooks.remove(t)};LNe.prototype.enable=function(){this._state.enabled=!0,BNe.enable()};LNe.prototype.disable=function(){this._state.enabled=!1,BNe.disable()}});var Fmr=I((frp,Nma)=>{Nma.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 cAi=I((prp,aAi)=>{p();function Mma(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(Mma,"FormatErrorString");aAi.exports=a(function(e,r){var n=[];n.push(Mma(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` -`)},"FormatStackTrace")});var fAi=I((grp,dAi)=>{p();var ipt=cAi();function uAi(){this.extend=new FNe,this.filter=new FNe,this.format=new UNe,this.version=Fmr().version}a(uAi,"stackChain");var Qmr=!1;uAi.prototype.callSite=a(function t(e){e||(e={}),Qmr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return Qmr=!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 MH=new uAi;function FNe(){this._modifiers=[]}a(FNe,"TraceModifier");FNe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Fmr().version)qmr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else qmr.exports=global._stackChain=fAi()});var pAi=I((Crp,Hmr)=>{"use strict";p();var Bma=sAi();if(global._asyncHook)if(global._asyncHook.version===Bmr().version)Hmr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else jmr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),Hmr.exports=global._asyncHook=new Bma});var EAi=I((brp,yAi)=>{"use strict";p();var rh=require("util"),a8=require("assert"),Lma=rpt(),c0e=pAi(),QNe="cls@contexts",qNe="error@context",mAi=[];for(let t in c0e.providers)mAi[c0e.providers[t]]=t;var fp=process.env.DEBUG_CLS_HOOKED,c0=-1;yAi.exports={getNamespace:gAi,createNamespace:Fma,destroyNamespace:AAi,reset:Uma,ERROR_SYMBOL:qNe};function zw(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(zw,"Namespace");zw.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 fp&&th(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+c0+" active:"+rh.inspect(this.active,!0)),this.active[e]=r,r},"set");zw.prototype.get=a(function(e){if(!this.active){fp&&th(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+c0+" active:"+rh.inspect(this.active,!0));return}return fp&&th(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+c0+" active:"+rh.inspect(this.active,!0)),this.active[e]},"get");zw.prototype.createContext=a(function(){fp&&th(" CREATING Context: "+this.name+" uid:"+c0+" len:"+this._set.length+" active:"+rh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=c0,fp&&th(" CREATED Context: "+this.name+" uid:"+c0+" len:"+this._set.length+" context:"+rh.inspect(e,!0,2,!0)),e},"createContext");zw.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return fp&&th(" BEFORE RUN: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),e(r),r}catch(n){throw n&&(n[qNe]=r),n}finally{fp&&th(" AFTER RUN: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),this.exit(r)}},"run");zw.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");zw.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 fp&&th(" BEFORE runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),n.then(o=>(fp&&th(" AFTER runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[qNe]=r,fp&&th(" AFTER runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),this.exit(r),o})},"runPromise");zw.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[qNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");zw.prototype.enter=a(function(e){a8.ok(e,"context must be provided for entering"),fp&&th(" ENTER "+this.name+" uid:"+c0+" len:"+this._set.length+" context: "+rh.inspect(e)),this._set.push(this.active),this.active=e},"enter");zw.prototype.exit=a(function(e){if(a8.ok(e,"context must be provided for exiting"),fp&&th(" EXIT "+this.name+" uid:"+c0+" len:"+this._set.length+" context: "+rh.inspect(e)),this.active===e){a8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(fp&&th("??ERROR?? context exiting but not entered - ignoring: "+rh.inspect(e)),a8.ok(r>=0,`context not currently entered; can't exit. -`+rh.inspect(this)+` -`+rh.inspect(e))):(a8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");zw.prototype.bindEmitter=a(function(e){a8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[QNe]||(c[QNe]=Object.create(null)),c[QNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[QNe]))return c;let l=c,u=c[QNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Lma(e,o,s)},"bindEmitter");zw.prototype.fromException=a(function(e){return e[qNe]},"fromException");function gAi(t){return process.namespaces[t]}a(gAi,"getNamespace");function Fma(t){a8.ok(t,"namespace must be given a name."),fp&&th("CREATING NAMESPACE "+t);let e=new zw(t);return e.id=c0,c0e.addHooks({init(r,n,o,s,c){c0=r,s?(e._contexts.set(r,e._contexts.get(s)),fp&&th("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(c0,e.active),fp&&th("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+mAi[o]+" active:"+rh.inspect(e.active,!0))},pre(r,n){c0=r;let o=e._contexts.get(r);o?(fp&&th(" PRE "+t+" uid:"+r+" handle:"+opt(n)+" context:"+rh.inspect(o)),e.enter(o)):fp&&th(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+opt(n))},post(r,n){c0=r;let o=e._contexts.get(r);o?(fp&&th(" POST "+t+" uid:"+r+" handle:"+opt(n)+" context:"+rh.inspect(o)),e.exit(o)):fp&&th(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+opt(n))},destroy(r){c0=r,fp&&th("DESTROY "+t+" uid:"+r+" context:"+rh.inspect(e._contexts.get(c0))+" active:"+rh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(Fma,"createNamespace");function AAi(t){let e=gAi(t);a8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),a8.ok(e.id,"don't assign to process.namespaces directly! "+rh.inspect(e)),process.namespaces[t]=null}a(AAi,"destroyNamespace");function Uma(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){AAi(t)}),process.namespaces=Object.create(null)}a(Uma,"reset");process.namespaces={};c0e._state&&!c0e._state.enabled&&c0e.enable();function th(t){process.env.DEBUG&&process._rawDebug(t)}a(th,"debug2");function opt(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(opt,"getFunctionName");if(fp){Gmr=jmr();for(hAi in Gmr.filter._modifiers)Gmr.filter.deattach(hAi)}var Gmr,hAi});var _Ai=I((Irp,$mr)=>{"use strict";p();var Qma=Hgi();process&&Qma.gte(process.versions.node,"8.0.0")?$mr.exports=Jgi():$mr.exports=EAi()});var LAi=I((_o,BAi)=>{p();_o=BAi.exports=Ma;var cl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?cl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):cl=a(function(){},"debug");_o.SEMVER_SPEC_VERSION="2.0.0";var jNe=256,spt=Number.MAX_SAFE_INTEGER||9007199254740991,Vmr=16,qma=jNe-6,HNe=_o.re=[],Tu=_o.safeRe=[],tr=_o.src=[],ha=0,Jmr="[a-zA-Z0-9-]",Wmr=[["\\s",1],["\\d",jNe],[Jmr,qma]];function fpt(t){for(var e=0;e)?=?)";var apt=ha++;tr[apt]=tr[u0e]+"|x|X|\\*";var cpt=ha++;tr[cpt]=tr[l0e]+"|x|X|\\*";var $X=ha++;tr[$X]="[v=\\s]*("+tr[cpt]+")(?:\\.("+tr[cpt]+")(?:\\.("+tr[cpt]+")(?:"+tr[Xmr]+")?"+tr[$Ne]+"?)?)?";var f0e=ha++;tr[f0e]="[v=\\s]*("+tr[apt]+")(?:\\.("+tr[apt]+")(?:\\.("+tr[apt]+")(?:"+tr[egr]+")?"+tr[$Ne]+"?)?)?";var TAi=ha++;tr[TAi]="^"+tr[m0e]+"\\s*"+tr[$X]+"$";var IAi=ha++;tr[IAi]="^"+tr[m0e]+"\\s*"+tr[f0e]+"$";var xAi=ha++;tr[xAi]="(?:^|[^\\d])(\\d{1,"+Vmr+"})(?:\\.(\\d{1,"+Vmr+"}))?(?:\\.(\\d{1,"+Vmr+"}))?(?:$|[^\\d])";var ppt=ha++;tr[ppt]="(?:~>?)";var p0e=ha++;tr[p0e]="(\\s*)"+tr[ppt]+"\\s+";HNe[p0e]=new RegExp(tr[p0e],"g");Tu[p0e]=new RegExp(fpt(tr[p0e]),"g");var jma="$1~",wAi=ha++;tr[wAi]="^"+tr[ppt]+tr[$X]+"$";var RAi=ha++;tr[RAi]="^"+tr[ppt]+tr[f0e]+"$";var hpt=ha++;tr[hpt]="(?:\\^)";var h0e=ha++;tr[h0e]="(\\s*)"+tr[hpt]+"\\s+";HNe[h0e]=new RegExp(tr[h0e],"g");Tu[h0e]=new RegExp(fpt(tr[h0e]),"g");var Hma="$1^",kAi=ha++;tr[kAi]="^"+tr[hpt]+tr[$X]+"$";var PAi=ha++;tr[PAi]="^"+tr[hpt]+tr[f0e]+"$";var igr=ha++;tr[igr]="^"+tr[m0e]+"\\s*("+rgr+")$|^$";var ogr=ha++;tr[ogr]="^"+tr[m0e]+"\\s*("+SAi+")$|^$";var VX=ha++;tr[VX]="(\\s*)"+tr[m0e]+"\\s*("+rgr+"|"+tr[$X]+")";HNe[VX]=new RegExp(tr[VX],"g");Tu[VX]=new RegExp(fpt(tr[VX]),"g");var Gma="$1$2$3",DAi=ha++;tr[DAi]="^\\s*("+tr[$X]+")\\s+-\\s+("+tr[$X]+")\\s*$";var NAi=ha++;tr[NAi]="^\\s*("+tr[f0e]+")\\s+-\\s+("+tr[f0e]+")\\s*$";var MAi=ha++;tr[MAi]="(<|>)?=?\\s*\\*";for(J5=0;J5jNe)return null;var r=e.loose?Tu[ngr]:Tu[tgr];if(!r.test(t))return null;try{return new Ma(t,e)}catch{return null}}a(WX,"parse");_o.valid=$ma;function $ma(t,e){var r=WX(t,e);return r?r.version:null}a($ma,"valid");_o.clean=Vma;function Vma(t,e){var r=WX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Vma,"clean");_o.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>jNe)throw new TypeError("version is longer than "+jNe+" characters");if(!(this instanceof Ma))return new Ma(t,e);cl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Tu[ngr]:Tu[tgr]);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>spt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>spt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>spt||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};_o.inc=Wma;function Wma(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(Wma,"inc");_o.diff=zma;function zma(t,e){if(sgr(t,e))return null;var r=WX(t),n=WX(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(zma,"diff");_o.compareIdentifiers=d0e;var CAi=/^[0-9]+$/;function d0e(t,e){var r=CAi.test(t),n=CAi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(GNe,"gt");_o.lt=lpt;function lpt(t,e,r){return c8(t,e,r)<0}a(lpt,"lt");_o.eq=sgr;function sgr(t,e,r){return c8(t,e,r)===0}a(sgr,"eq");_o.neq=OAi;function OAi(t,e,r){return c8(t,e,r)!==0}a(OAi,"neq");_o.gte=agr;function agr(t,e,r){return c8(t,e,r)>=0}a(agr,"gte");_o.lte=cgr;function cgr(t,e,r){return c8(t,e,r)<=0}a(cgr,"lte");_o.cmp=upt;function upt(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 sgr(t,r,n);case"!=":return OAi(t,r,n);case">":return GNe(t,r,n);case">=":return agr(t,r,n);case"<":return lpt(t,r,n);case"<=":return cgr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(upt,"cmp");_o.Comparator=Yw;function Yw(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Yw){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof Yw))return new Yw(t,e);t=t.trim().split(/\s+/).join(" "),cl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===VNe?this.value="":this.value=this.operator+this.semver.version,cl("comp",this)}a(Yw,"Comparator");var VNe={};Yw.prototype.parse=function(t){var e=this.options.loose?Tu[igr]:Tu[ogr],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=VNe};Yw.prototype.toString=function(){return this.value};Yw.prototype.test=function(t){return cl("Comparator.test",t,this.options.loose),this.semver===VNe?!0:(typeof t=="string"&&(t=new Ma(t,this.options)),upt(t,this.operator,this.semver,this.options))};Yw.prototype.intersects=function(t,e){if(!(t instanceof Yw))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Cf(t.value,e),dpt(this.value,r,e);if(t.operator==="")return r=new Cf(this.value,e),dpt(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=upt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=upt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};_o.Range=Cf;function Cf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Cf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Cf(t.raw,e);if(t instanceof Yw)return new Cf(t.value,e);if(!(this instanceof Cf))return new Cf(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(Cf,"Range");Cf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Cf.prototype.toString=function(){return this.range};Cf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Tu[NAi]:Tu[DAi];t=t.replace(r,fga),cl("hyphen replace",t),t=t.replace(Tu[VX],Gma),cl("comparator trim",t,Tu[VX]),t=t.replace(Tu[p0e],jma),t=t.replace(Tu[h0e],Hma);var n=e?Tu[igr]:Tu[ogr],o=t.split(" ").map(function(s){return iga(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 Yw(s,this.options)},this),o};Cf.prototype.intersects=function(t,e){if(!(t instanceof Cf))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)})})})})};_o.toComparators=nga;function nga(t,e){return new Cf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(nga,"toComparators");function iga(t,e){return cl("comp",t,e),t=aga(t,e),cl("caret",t),t=oga(t,e),cl("tildes",t),t=lga(t,e),cl("xrange",t),t=dga(t,e),cl("stars",t),t}a(iga,"parseComparator");function cC(t){return!t||t.toLowerCase()==="x"||t==="*"}a(cC,"isX");function oga(t,e){return t.trim().split(/\s+/).map(function(r){return sga(r,e)}).join(" ")}a(oga,"replaceTildes");function sga(t,e){var r=e.loose?Tu[RAi]:Tu[wAi];return t.replace(r,function(n,o,s,c,l){cl("tilde",t,n,o,s,c,l);var u;return cC(o)?u="":cC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":cC(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(cl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",cl("tilde return",u),u})}a(sga,"replaceTilde");function aga(t,e){return t.trim().split(/\s+/).map(function(r){return cga(r,e)}).join(" ")}a(aga,"replaceCarets");function cga(t,e){cl("caret",t,e);var r=e.loose?Tu[PAi]:Tu[kAi];return t.replace(r,function(n,o,s,c,l){cl("caret",t,n,o,s,c,l);var u;return cC(o)?u="":cC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":cC(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(cl("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"):(cl("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"),cl("caret return",u),u})}a(cga,"replaceCaret");function lga(t,e){return cl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return uga(r,e)}).join(" ")}a(lga,"replaceXRanges");function uga(t,e){t=t.trim();var r=e.loose?Tu[IAi]:Tu[TAi];return t.replace(r,function(n,o,s,c,l,u){cl("xRange",t,n,o,s,c,l,u);var d=cC(s),f=d||cC(c),h=f||cC(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"),cl("xRange return",n),n})}a(uga,"replaceXRange");function dga(t,e){return cl("replaceStars",t,e),t.trim().replace(Tu[MAi],"")}a(dga,"replaceStars");function fga(t,e,r,n,o,s,c,l,u,d,f,h,m){return cC(r)?e="":cC(n)?e=">="+r+".0.0":cC(o)?e=">="+r+"."+n+".0":e=">="+e,cC(u)?l="":cC(d)?l="<"+(+u+1)+".0.0":cC(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(fga,"hyphenReplace");Cf.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(pga,"testSet");_o.satisfies=dpt;function dpt(t,e,r){try{e=new Cf(e,r)}catch{return!1}return e.test(t)}a(dpt,"satisfies");_o.maxSatisfying=hga;function hga(t,e,r){var n=null,o=null;try{var s=new Cf(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(hga,"maxSatisfying");_o.minSatisfying=mga;function mga(t,e,r){var n=null,o=null;try{var s=new Cf(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(mga,"minSatisfying");_o.minVersion=gga;function gga(t,e){t=new Cf(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||GNe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(gga,"minVersion");_o.validRange=Aga;function Aga(t,e){try{return new Cf(t,e).range||"*"}catch{return null}}a(Aga,"validRange");_o.ltr=yga;function yga(t,e,r){return lgr(t,e,"<",r)}a(yga,"ltr");_o.gtr=Ega;function Ega(t,e,r){return lgr(t,e,">",r)}a(Ega,"gtr");_o.outside=lgr;function lgr(t,e,r,n){t=new Ma(t,n),e=new Cf(e,n);var o,s,c,l,u;switch(r){case">":o=GNe,s=cgr,c=lpt,l=">",u=">=";break;case"<":o=lpt,s=agr,c=GNe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(dpt(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(lgr,"outside");_o.prerelease=_ga;function _ga(t,e){var r=WX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(_ga,"prerelease");_o.intersects=Cga;function Cga(t,e,r){return t=new Cf(t,r),e=new Cf(e,r),t.intersects(e)}a(Cga,"intersects");_o.coerce=vga;function vga(t){if(t instanceof Ma)return t;if(typeof t!="string")return null;var e=t.match(Tu[xAi]);return e==null?null:WX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(vga,"coerce")});var QAi=I((krp,UAi)=>{p();var bga=Uhe().wrap,dgr=1,fgr=2,pgr=4,gpt=8,Vl=[],Sga=0,CE=!1,OH=[],g0e,hgr;function mgr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Vl=OH.pop()),A0e=void 0,n&&!CE},"asyncCatcher"),hgr=a(function(e,r,n){var o=[];CE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);CE=!1;var d=e.apply(this,arguments);for(CE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return CE=!1,Vl=OH.pop(),A0e=void 0,d}},"asyncWrap"),bga(process,"_fatalException",function(t){return a(function(r){return g0e(r)||t(r)},"_asyncFatalException")})):(ugr=!1,g0e=a(function(e){if(ugr)throw e;for(var r=!1,n=Vl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);CE=!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]);CE=!1}Vl=OH.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",g0e));var mpt,A0e,ugr;function Tga(t,e,r){CE=!0;for(var n=0;n0)return hgr(t,r,e);return Tga(t,r,e)}a(Iga,"wrapCallback");function Z5(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=dgr),typeof t.before=="function"&&(this.before=t.before,this.flags|=fgr),typeof t.after=="function"&&(this.after=t.after,this.flags|=pgr),typeof t.error=="function"&&(this.error=t.error,this.flags|=gpt),this.uid=++Sga,this.data=e===void 0?null:e}a(Z5,"AsyncListener");Z5.prototype.create=void 0;Z5.prototype.before=void 0;Z5.prototype.after=void 0;Z5.prototype.error=void 0;Z5.prototype.data=void 0;Z5.prototype.uid=0;Z5.prototype.flags=0;function FAi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof Z5?t:new Z5(t,e)}a(FAi,"createAsyncListener");function xga(t,e){var r;t instanceof Z5?r=t:r=FAi(t,e);for(var n=!1,o=0;o{"use strict";p();qAi.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 YAi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var VAi=Uhe(),ypt=LAi(),Pb=VAi.wrap,BH=VAi.massWrap,vf=QAi(),Rga=require("util"),kga=ypt.gte(process.version,"6.0.0"),ygr=ypt.gte(process.version,"7.0.0"),Pga=ypt.gte(process.version,"8.0.0"),Dga=ypt.gte(process.version,"11.0.0"),X5=require("net");ygr&&!X5._normalizeArgs?X5._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:Lga(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]}:!ygr&&!X5._normalizeConnectArgs&&(X5._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 X5.Server.prototype?Pb(X5.Server.prototype,"_setUpListenHandle",HAi):Pb(X5.Server.prototype,"_listen2",HAi);function HAi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=vf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=vf(this._handle.onconnection))}}}a(HAi,"wrapSetUpListenHandle");function WAi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=vf(e._originalOnread)}}a(WAi,"patchOnRead");Pb(X5.Socket.prototype,"connect",function(t){return function(){var e;Pga&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=ygr?X5._normalizeArgs(arguments):X5._normalizeConnectArgs(arguments),e[1]&&(e[1]=vf(e[1]));var r=t.apply(this,e);return WAi(this),r}});var Nga=require("http");Pb(Nga.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=vf(function(n){return WAi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var ggr=require("child_process");function GAi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=vf(e._handle.onread),Pb(e._handle,"close",Ept))}),t._handle&&(t._handle.onexit=vf(t._handle.onexit))}a(GAi,"wrapChildProcess");ggr.ChildProcess?Pb(ggr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return GAi(this),e}}):BH(ggr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return GAi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var Cgr=[];process._nextDomainTick&&Cgr.push("_nextDomainTick");process._tickDomainCallback&&Cgr.push("_tickDomainCallback");BH(process,Cgr,e4);Pb(process,"nextTick",Ept);var vgr=["setTimeout","setInterval"];global.setImmediate&&vgr.push("setImmediate");var zAi=require("timers"),Mga=global.setTimeout===zAi.setTimeout;BH(zAi,vgr,Ept);Mga&&BH(global,vgr,Ept);var Egr=require("dns");BH(Egr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],e4);Egr.resolveNaptr&&Pb(Egr,"resolveNaptr",e4);var YX=require("fs");BH(YX,["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"],e4);YX.lchown&&Pb(YX,"lchown",e4);YX.lchmod&&Pb(YX,"lchmod",e4);YX.ftruncate&&Pb(YX,"ftruncate",e4);var WNe;try{WNe=require("zlib")}catch{}WNe&&WNe.Deflate&&WNe.Deflate.prototype&&(zX=Object.getPrototypeOf(WNe.Deflate.prototype),zX._transform?Pb(zX,"_transform",e4):zX.write&&zX.flush&&zX.end&&BH(zX,["write","flush","end"],e4));var zX,_gr;try{_gr=require("crypto")}catch{}_gr&&(Agr=["pbkdf2","randomBytes"],Dga||Agr.push("pseudoRandomBytes"),BH(_gr,Agr,e4));var Agr,Apt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";Apt&&($Ai=process.addAsyncListener({create:a(function(){Apt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){Apt=!1},"notSync")),process.removeAsyncListener($Ai));var $Ai;Apt&&Oga();function Oga(){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"),Rga.inherits(e,t),Pb(t.prototype,"then",s),t.prototype.chain&&Pb(t.prototype,"chain",s),kga)global.Promise=jAi()(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=vf(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:vf(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(Oga,"wrapPromise");function e4(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(Bga,"toNumber");function Lga(t){return typeof t=="string"&&Bga(t)===!1}a(Lga,"isPipeName")});var eyi=I((qrp,XAi)=>{"use strict";p();var l8=require("assert"),Fga=rpt(),zNe="cls@contexts",bgr="error@context";process.addAsyncListener||YAi();function P2(t){this.name=t,this.active=null,this._set=[],this.id=null}a(P2,"Namespace");P2.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};P2.prototype.get=function(t){if(this.active)return this.active[t]};P2.prototype.createContext=function(){return Object.create(this.active)};P2.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[bgr]=e),r}finally{this.exit(e)}};P2.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};P2.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[bgr]=e),n}finally{r.exit(e)}}};P2.prototype.enter=function(t){l8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};P2.prototype.exit=function(t){if(l8.ok(t,"context must be provided for exiting"),this.active===t){l8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);l8.ok(e>=0,"context not currently entered; can't exit"),l8.ok(e,"can't remove top context"),this._set.splice(e,1)};P2.prototype.bindEmitter=function(t){l8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[zNe]||(s[zNe]=Object.create(null)),s[zNe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[zNe]))return s;var c=s,l=s[zNe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),Fga(t,n,o)};P2.prototype.fromException=function(t){return t[bgr]};function KAi(t){return process.namespaces[t]}a(KAi,"get");function Uga(t){l8.ok(t,"namespace must be given a name!");var e=new P2(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(Uga,"create");function JAi(t){var e=KAi(t);l8.ok(e,"can't delete nonexistent namespace!"),l8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(JAi,"destroy");function ZAi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){JAi(t)}),process.namespaces=Object.create(null)}a(ZAi,"reset");process.namespaces||ZAi();XAi.exports={getNamespace:KAi,createNamespace:Uga,destroyNamespace:JAi,reset:ZAi}});var FH=I(t4=>{"use strict";p();var Qga=t4&&t4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qga=t4&&t4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jga=t4&&t4.__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)&&Qga(e,t,r);return qga(e,t),e};Object.defineProperty(t4,"__esModule",{value:!0});t4.CorrelationContextManager=void 0;var LH=$l(),Hga=jga(Qft()),KX=qft(),Sgr=z0r(),tyi=hmr(),y0e=qA(),Gga=(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 $ga(o)}:null},t.spanToContextObject=function(e,r,n){var o=new KX;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=KX.formatOpenTelemetryTraceFlags(e.traceFlags)||KX.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){LH.warn("Error binding to session context",y0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){LH.warn("Error binding to session context",y0e.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){LH.warn("Error binding to session context",y0e.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=_Ai():this.cls=eyi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){LH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",y0e.dumpObj(r)),this.enabled=!1;return}Hga.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){LH.warn("Error binding to session context",y0e.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 KX(f.headers.traceparent):f.headers["request-id"]&&(u=new KX(null,f.headers["request-id"])),f.headers.tracestate&&(d=new Sgr(f.headers.tracestate)))}u||(u=new KX(n.traceParent||n.traceparent)),d||(d=new Sgr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new tyi(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 KX(c.traceparent?c.traceparent.toString():null),d=new Sgr(c.tracestate?c.tracestate.toString():null),m=new tyi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return LH.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){LH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",y0e.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})();t4.CorrelationContextManager=Gga;var $ga=(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");No.insertSnippetByIndex=HAa;var GAa=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");No.isContentTypeHeaderHtml=GAa});var Pgr=I((wnp,Cyi)=>{"use strict";p();var _yi=ad(),$Aa=(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||_yi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||_yi.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})();Cyi.exports=$Aa});var vyi={};wi(vyi,{webSnippet:()=>VAa});var VAa,byi=me(()=>{p();VAa=`!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(" ")};Sni.O=function(t){return this.inspectOpts.colors=this.useColors,adt.inspect(t,this.inspectOpts)}});var Ini=I((Qjf,wpr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?wpr.exports=bni():wpr.exports=Tni()});var Ppr=I((jjf,xni)=>{"use strict";p();var Rpr=require("path").sep;xni.exports=function(t){var e=t.split(Rpr),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]+Rpr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Rpr;return{name:o,basedir:c,path:d}}}});var kpr=I((Gjf,wni)=>{"use strict";p();var HKs=require("os");wni.exports=HKs.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 Dpr=I((Wjf,Rni)=>{p();Rni.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 Pni=I((Yjf,LDe)=>{"use strict";p();var GKs=process.platform==="win32",$Ks=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Npr={};function VKs(t){return $Ks.exec(t).slice(1)}a(VKs,"win32SplitPath");Npr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=VKs(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 WKs=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Mpr={};function zKs(t){return WKs.exec(t).slice(1)}a(zKs,"posixSplitPath");Mpr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=zKs(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]}};GKs?LDe.exports=Npr.parse:LDe.exports=Mpr.parse;LDe.exports.posix=Mpr.parse;LDe.exports.win32=Npr.parse});var Opr=I((Zjf,Mni)=>{p();var Nni=require("path"),kni=Nni.parse||Pni(),Dni=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=kni(e);s.dir!==o[o.length-1];)o.push(s.dir),s=kni(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return Nni.resolve(n,l,u)}))},[])},"getNodeModulesDirs");Mni.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 Dni(e,o)},r);var s=Dni(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Bpr=I((tHf,Oni)=>{p();Oni.exports=function(t,e){return e||{}}});var Fni=I((nHf,Lni)=>{"use strict";p();var YKs="Function.prototype.bind called on incompatible ",KKs=Object.prototype.toString,JKs=Math.max,ZKs="[object Function]",Bni=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var tJs=Fni();Uni.exports=Function.prototype.bind||tJs});var jni=I((cHf,qni)=>{"use strict";p();var rJs=Function.prototype.call,nJs=Object.prototype.hasOwnProperty,iJs=Qni();qni.exports=iJs.call(rJs,nJs)});var Hni=I((uHf,oJs)=>{oJs.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 FDe=I((dHf,Vni)=>{"use strict";p();var sJs=jni();function aJs(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(aJs,"specifierIncluded");function Gni(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 dX=require("fs"),lJs=kpr(),s0=require("path"),uJs=Dpr(),dJs=Opr(),fJs=Bpr(),pJs=FDe(),hJs=process.platform!=="win32"&&dX.realpath&&typeof dX.realpath.native=="function"?dX.realpath.native:dX.realpath,Wni=lJs(),mJs=a(function(){return[s0.join(Wni,".node_modules"),s0.join(Wni,".node_libraries")]},"defaultPaths"),gJs=a(function(e,r){dX.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"),AJs=a(function(e,r){dX.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),yJs=a(function(e,r){hJs(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),UDe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),EJs=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"),_Js=a(function(e,r,n){for(var o=dJs(r,n,e),s=0;s{vJs.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 eii=I((yHf,Xni)=>{"use strict";p();var CJs=FDe(),Jni=Kni(),Zni={};for(ldt in Jni)Object.prototype.hasOwnProperty.call(Jni,ldt)&&(Zni[ldt]=CJs(ldt));var ldt;Xni.exports=Zni});var rii=I((_Hf,tii)=>{p();var bJs=FDe();tii.exports=a(function(e){return bJs(e)},"isCore")});var oii=I((bHf,iii)=>{p();var SJs=FDe(),fX=require("fs"),mE=require("path"),TJs=kpr(),IJs=Dpr(),xJs=Opr(),wJs=Bpr(),RJs=process.platform!=="win32"&&fX.realpathSync&&typeof fX.realpathSync.native=="function"?fX.realpathSync.native:fX.realpathSync,nii=TJs(),PJs=a(function(){return[mE.join(nii,".node_modules"),mE.join(nii,".node_libraries")]},"defaultPaths"),kJs=a(function(e){try{var r=fX.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"),DJs=a(function(e){try{var r=fX.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),NJs=a(function(e){try{return RJs(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),QDe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),MJs=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),OJs=a(function(e,r,n){for(var o=xJs(r,n,e),s=0;s{p();var udt=Yni();udt.core=eii();udt.isCore=rii();udt.sync=oii();sii.exports=udt});var aii=I((wHf,BJs)=>{BJs.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 qpr=I((RHf,Qpr)=>{"use strict";p();var vhe=require("path"),_2=require("module"),eh=Ini()("require-in-the-middle"),LJs=Ppr();Qpr.exports=qDe;Qpr.exports.Hook=qDe;var Fpr,_he;if(_2.isBuiltin)_he=_2.isBuiltin;else if(_2.builtinModules)_he=a(t=>t.startsWith("node:")?!0:(Fpr===void 0&&(Fpr=new Set(_2.builtinModules)),Fpr.has(t)),"isCore");else{let t=Lpr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?_he=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):_he=a(n=>!!t.core[n],"isCore")}var ddt;function FJs(t,e){if(!ddt)if(require.resolve&&require.resolve.paths)ddt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Lpr();ddt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return ddt(t,e)}a(FJs,"resolve");var UJs=/([/\\]index)?(\.js)?$/,Upr=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:(eh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function qDe(t,e,r){if(!(this instanceof qDe))return new qDe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof _2._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof _2._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,aii().bugs.url);return}this._cache=new Upr,this._unhooked=!1,this._origRequire=_2.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);eh("registering require hook"),this._require=_2.prototype.require=function(u){return n._unhooked===!0?(eh("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?(eh("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=_he(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);_he(v)&&(m=v)}}else{if(d)return eh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=_2._resolveFilename(f,this)}catch(v){return eh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(eh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return eh("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 eh("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 eh("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=vhe.parse(m);g=v.name,A=v.dir}else{let v=LJs(m);if(v===void 0)return eh("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=QJs(v);eh("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=FJs(g,A)}catch{return eh("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+vhe.sep+vhe.relative(A,m),eh("preparing to process require of internal file: %s",g);else return eh("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),eh("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),eh("returning module: %s",g),_}a(l,"patchedRequire")}a(qDe,"Hook");qDe.prototype.unhook=function(){this._unhooked=!0,this._require===_2.prototype.require?(_2.prototype.require=this._origRequire,eh("require unhook successful")):eh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,eh("process.getBuiltinModule unhook successful")):eh("process.getBuiltinModule unhook unsuccessful"))};function QJs(t){let e=vhe.sep!=="/"?t.path.split(vhe.sep).join("/"):t.path;return vhe.posix.join(t.name,e).replace(UJs,"")}a(QJs,"resolveModuleName")});var fdt,pdt,cii=_e(()=>{p();fdt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},pdt=class{static{a(this,"ModuleNameTrie")}_trie=new fdt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new fdt,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 jJs(t){return jpr.sep!=="/"?t.split(jpr.sep).join("/"):t}var uii,jpr,qJs,hdt,dii=_e(()=>{p();uii=he(qpr()),jpr=he(require("path"));cii();qJs=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),hdt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new pdt;static _instance;constructor(){this._initialize()}_initialize(){new uii.Hook(null,{internals:!0},(e,r,n)=>{let o=jJs(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 qJs?new t:this._instance=this._instance??new t}};a(jJs,"normalizePathSeparators")});var Aii=I(pX=>{p();var fii=[],Hpr=new WeakMap,pii=new WeakMap,hii=new Map,mii=[],HJs={set(t,e,r){return Hpr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=pii.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 Hpr.get(t)[e](r.value)}};function GJs(t,e,r,n,o){hii.set(t,o),Hpr.set(e,r),pii.set(e,n);let s=new Proxy(e,HJs);fii.forEach(c=>c(t,s)),mii.push([t,s])}a(GJs,"register");var gii=!1;function $Js(){return gii}a($Js,"getExperimentalPatchInternals");function VJs(t){gii=t}a(VJs,"setExperimentalPatchInternals");pX.register=GJs;pX.importHooks=fii;pX.specifiers=hii;pX.toHook=mii;pX.getExperimentalPatchInternals=$Js;pX.setExperimentalPatchInternals=VJs});var bii=I((jHf,Che)=>{p();var yii=require("path"),WJs=Ppr(),{fileURLToPath:Eii}=require("url"),{MessageChannel:zJs}=require("worker_threads"),{importHooks:Gpr,specifiers:YJs,toHook:KJs,getExperimentalPatchInternals:JJs}=Aii();function vii(t){Gpr.push(t),KJs.forEach(([e,r])=>t(e,r))}a(vii,"addHook");function Cii(t){let e=Gpr.indexOf(t);e>-1&&Gpr.splice(e,1)}a(Cii,"removeHook");function _ii(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(_ii,"callHookFn");var $pr;function ZJs(){let{port1:t,port2:e}=new zJs,r=0,n;$pr=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(ZJs,"createAddHookMessageChannel");function jDe(t,e,r){if(!(this instanceof jDe))return new jDe(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;$pr&&Array.isArray(t)&&$pr(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=Eii(o)}catch{}let d=WJs(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+yii.sep+yii.relative(u,Eii(c));else if(!JJs()&&!u.endsWith(YJs.get(c)))continue}_ii(r,s,o,u)}}else _ii(r,s,o,u)},vii(this._iitmHook)}a(jDe,"Hook");jDe.prototype.unhook=function(){Cii(this._iitmHook)};Che.exports=jDe;Che.exports.Hook=jDe;Che.exports.addHook=vii;Che.exports.removeHook=Cii;Che.exports.createAddHookMessageChannel=ZJs});function Sii(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 Tii(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 mdt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var Vpr=_e(()=>{p();a(Sii,"safeExecuteInTheMiddle");a(Tii,"safeExecuteInTheMiddleAsync");a(mdt,"isWrapped")});function Iii(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>dni(e,n,{includePrerelease:r}))}var QF,Wpr,HDe,xii,wii,Rii,bhe,Pii=_e(()=>{p();QF=he(require("path")),Wpr=require("util");mni();HDe=he(ghe());Eni();dii();xii=he(bii());ao();wii=he(qpr()),Rii=require("fs");Vpr();bhe=class extends idt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=hdt.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(mdt(e[r])&&this._unwrap(e,r),Wpr.types.isProxy(e)){let o=(0,HDe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,HDe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>Wpr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,HDe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Pn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Pn.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{Pn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Pn.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,Rii.readFileSync)(QF.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Pn.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 Iii(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=QF.normalize(n);return c.filter(d=>d.name===l).filter(d=>Iii(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&&QF.isAbsolute(l)){let d=QF.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=QF.isAbsolute(e.name)?new wii.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new xii.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(Iii,"isSupported")});var GDe,kii=_e(()=>{p();GDe=require("path")});var Dii=_e(()=>{p();Pii();kii()});var zpr=_e(()=>{p();Dii()});var gdt,Nii=_e(()=>{p();gdt=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 Adt,Mii=_e(()=>{p();zpr();Adt=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,GDe.normalize)(e)}}});var Ypr={};xi(Ypr,{InstrumentationBase:()=>bhe,InstrumentationNodeModuleDefinition:()=>gdt,InstrumentationNodeModuleFile:()=>Adt,isWrapped:()=>mdt,registerInstrumentations:()=>ini,safeExecuteInTheMiddle:()=>Sii,safeExecuteInTheMiddleAsync:()=>Tii});var Kpr=_e(()=>{p();oni();zpr();Nii();Mii();Vpr()});var Bii=I(Jpr=>{"use strict";p();Object.defineProperty(Jpr,"__esModule",{value:!0});Jpr.log=rZs;var Oii=(bL(),ya(s7)),XJs=require("node:os"),eZs=Oii.__importDefault(require("node:util")),tZs=Oii.__importStar(require("node:process"));function rZs(t,...e){tZs.stderr.write(`${eZs.default.format(t,...e)}${XJs.EOL}`)}a(rZs,"log")});var qii=I(rhr=>{"use strict";p();Object.defineProperty(rhr,"__esModule",{value:!0});var nZs=Bii(),Lii=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Fii,Zpr=[],Xpr=[],ydt=[];Lii&&ehr(Lii);var Uii=Object.assign(t=>Qii(t),{enable:ehr,enabled:thr,disable:iZs,log:nZs.log});function ehr(t){Fii=t,Zpr=[],Xpr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?Xpr.push(new RegExp(`^${n.substr(1)}$`)):Zpr.push(new RegExp(`^${n}$`));for(let n of ydt)n.enabled=thr(n.namespace)}a(ehr,"enable");function thr(t){if(t.endsWith("*"))return!0;for(let e of Xpr)if(e.test(t))return!1;for(let e of Zpr)if(e.test(t))return!0;return!1}a(thr,"enabled");function iZs(){let t=Fii||"";return ehr(""),t}a(iZs,"disable");function Qii(t){let e=Object.assign(r,{enabled:thr(t),destroy:oZs,log:Uii.log,namespace:t,extend:sZs});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),ydt.push(e),e}a(Qii,"createDebugger");function oZs(){let t=ydt.indexOf(this);return t>=0?(ydt.splice(t,1),!0):!1}a(oZs,"destroy");function sZs(t){let e=Qii(`${this.namespace}:${t}`);return e.log=this.log,e}a(sZs,"extend");rhr.default=Uii});var Cdt=I(N5=>{"use strict";p();Object.defineProperty(N5,"__esModule",{value:!0});N5.AzureLogger=void 0;N5.setLogLevel=Gii;N5.getLogLevel=cZs;N5.createClientLogger=lZs;var aZs=(bL(),ya(s7)),$De=aZs.__importDefault(qii()),Hii=new Set,Edt=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,vdt;N5.AzureLogger=(0,$De.default)("azure");N5.AzureLogger.log=(...t)=>{$De.default.log(...t)};var nhr=["verbose","info","warning","error"];Edt&&(Wii(Edt)?Gii(Edt):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Edt}'; logging is not enabled. Acceptable values: ${nhr.join(", ")}.`));function Gii(t){if(t&&!Wii(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${nhr.join(",")}`);vdt=t;let e=[];for(let r of Hii)Vii(r)&&e.push(r.namespace);$De.default.enable(e.join(","))}a(Gii,"setLogLevel");function cZs(){return vdt}a(cZs,"getLogLevel");var jii={verbose:400,info:300,warning:200,error:100};function lZs(t){let e=N5.AzureLogger.extend(t);return $ii(N5.AzureLogger,e),{error:_dt(e,"error"),warning:_dt(e,"warning"),info:_dt(e,"info"),verbose:_dt(e,"verbose")}}a(lZs,"createClientLogger");function $ii(t,e){e.log=(...r)=>{t.log(...r)}}a($ii,"patchLogMethod");function _dt(t,e){let r=Object.assign(t.extend(e),{level:e});if($ii(t,r),Vii(r)){let n=$De.default.disable();$De.default.enable(n+","+r.namespace)}return Hii.add(r),r}a(_dt,"createLogger");function Vii(t){return!!(vdt&&jii[t.level]<=jii[vdt])}a(Vii,"shouldEnable");function Wii(t){return nhr.includes(t)}a(Wii,"isAzureLogLevel")});var ihr=I(bdt=>{"use strict";p();Object.defineProperty(bdt,"__esModule",{value:!0});bdt.logger=void 0;var uZs=Cdt();bdt.logger=(0,uZs.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function Sdt(t){return t.setValue(ohr,!0)}function zii(t){return t.deleteValue(ohr)}function She(t){return t.getValue(ohr)===!0}var ohr,VDe=_e(()=>{p();ao();ohr=tb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Sdt,"suppressTracing");a(zii,"unsuppressTracing");a(She,"isTracingSuppressed")});var Tdt,Yii=_e(()=>{p();Tdt="baggage"});function Jii(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function Zii(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 shr(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=mfe(e.join(";"))),{key:o,value:s,metadata:c}}function Xii(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=shr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var ahr=_e(()=>{p();ao();a(Jii,"serializeKeyPairs");a(Zii,"getKeyPairs");a(shr,"parsePairKeyValue");a(Xii,"parseKeyPairsIntoRecord")});var xdt,eoi=_e(()=>{p();ao();VDe();Yii();ahr();xdt=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=lT.getBaggage(e);if(!o||She(e))return;let s=Zii(o).filter(l=>l.length<=4096).slice(0,180),c=Jii(s);c.length>0&&n.set(r,Tdt,c)}extract(e,r,n){let o=n.get(r,Tdt),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=shr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:lT.setBaggage(e,lT.createBaggage(c))}fields(){return[Tdt]}}});var wdt,toi=_e(()=>{p();wdt=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 roi(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(!pZs(r)){Pn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!chr(n)){Pn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function pZs(t){return typeof t=="string"&&t!==""}function chr(t){return t==null?!0:Array.isArray(t)?hZs(t):noi(typeof t)}function hZs(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(noi(n)){e=n;continue}return!1}return!1}}return!0}function noi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var ioi=_e(()=>{p();ao();a(roi,"sanitizeAttributes");a(pZs,"isAttributeKey");a(chr,"isAttributeValue");a(hZs,"isHomogeneousAttributeValueArray");a(noi,"isValidPrimitiveAttributeValueType")});function Rdt(){return t=>{Pn.error(mZs(t))}}function mZs(t){return typeof t=="string"?t:JSON.stringify(gZs(t))}function gZs(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 lhr=_e(()=>{p();ao();a(Rdt,"loggingErrorHandler");a(mZs,"stringifyException");a(gZs,"flattenException")});function soi(t){ooi=t}function aoi(t){try{ooi(t)}catch{}}var ooi,coi=_e(()=>{p();lhr();ooi=Rdt();a(soi,"setGlobalErrorHandler");a(aoi,"globalErrorHandler")});function Pdt(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Pn.warn(`Unknown value ${(0,uhr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function WDe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function kdt(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Pn.warn(`Unknown value ${(0,uhr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function Ddt(t){return WDe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var uhr,loi=_e(()=>{p();ao();uhr=require("util");a(Pdt,"getNumberFromEnv");a(WDe,"getStringFromEnv");a(kdt,"getBooleanFromEnv");a(Ddt,"getStringListFromEnv")});var Ndt,uoi=_e(()=>{p();Ndt=typeof globalThis=="object"?globalThis:global});var doi,lH,foi=_e(()=>{p();doi=require("perf_hooks"),lH=doi.performance});var poi,hoi=_e(()=>{p();poi="2.2.0"});function th(t){let e={},r=t.length;for(let n=0;n{p();a(th,"createConstMap")});var moi,goi,Aoi,yoi,Eoi,_oi,voi,Coi,boi,Soi,Toi,Ioi,xoi,woi,Roi,Poi,koi,Doi,Noi,Moi,Ooi,Boi,Loi,Foi,Uoi,Qoi,qoi,joi,Hoi,Goi,$oi,Voi,Woi,zoi,Yoi,Koi,Joi,Zoi,Xoi,esi,tsi,rsi,nsi,isi,osi,ssi,asi,csi,lsi,usi,dsi,fsi,psi,hsi,msi,gsi,Asi,ysi,Esi,_si,vsi,Csi,bsi,Ssi,Tsi,Isi,xsi,wsi,Rsi,Psi,ksi,Dsi,Nsi,Msi,Osi,Bsi,Lsi,Fsi,Usi,Qsi,qsi,jsi,Hsi,Gsi,$si,Vsi,Wsi,zsi,Ysi,Ksi,Jsi,Zsi,Xsi,eai,tai,rai,nai,iai,oai,sai,aai,cai,lai,uai,dai,fai,pai,hai,mai,gai,Aai,yai,Eai,_ai,vai,Cai,bai,Sai,Tai,Iai,xai,wai,Rai,Pai,kai,Dai,Nai,Mai,AZs,yZs,EZs,_Zs,vZs,CZs,bZs,SZs,TZs,IZs,xZs,wZs,RZs,PZs,kZs,DZs,NZs,MZs,OZs,BZs,LZs,FZs,UZs,QZs,qZs,jZs,HZs,GZs,$Zs,VZs,WZs,zZs,YZs,KZs,JZs,ZZs,XZs,eXs,tXs,rXs,nXs,iXs,oXs,sXs,aXs,cXs,lXs,uXs,dXs,fXs,pXs,hXs,mXs,gXs,AXs,yXs,EXs,_Xs,vXs,CXs,bXs,SXs,TXs,IXs,xXs,wXs,RXs,PXs,kXs,DXs,NXs,MXs,OXs,BXs,LXs,FXs,UXs,QXs,qXs,jXs,HXs,GXs,$Xs,VXs,WXs,zXs,YXs,KXs,JXs,ZXs,XXs,eea,tea,rea,nea,iea,oea,sea,aea,cea,lea,uea,dea,fea,pea,hea,mea,gea,Aea,yea,Eea,_ea,vea,Cea,bea,Sea,Tea,Iea,xea,wea,Rea,Pea,kea,Dea,Nea,Mea,Oea,Bea,Lea,Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,vci,Cci,bci,Sci,Tci,Ici,xci,Fea,Uea,Qea,qea,jea,Hea,Gea,$ea,Vea,Wea,zea,Yea,Kea,Jea,Zea,Xea,eta,tta,rta,nta,ita,ota,sta,ata,cta,lta,uta,dta,fta,pta,hta,mta,gta,Ata,yta,Eta,_ta,vta,Cta,bta,Sta,Tta,Ita,xta,wta,Rta,Pta,kta,wci,Rci,Pci,kci,Dci,Nci,Mci,Oci,Bci,Lci,Fci,Dta,Nta,Mta,Ota,Bta,Lta,Fta,Uta,Qta,qta,jta,Hta,Uci,Qci,qci,jci,Hci,Gta,$ta,Vta,Wta,zta,Yta,Gci,$ci,Vci,Kta,Jta,Zta,Xta,Wci,zci,Yci,Kci,era,tra,rra,nra,ira,Jci,Zci,Xci,eli,tli,rli,nli,ora,sra,ara,cra,lra,ura,dra,fra,ili,oli,sli,ali,cli,pra,hra,mra,gra,Ara,yra,lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,vli,Cli,bli,Sli,Tli,Ili,xli,wli,Rli,Era,_ra,vra,Cra,bra,Sra,Tra,Ira,xra,wra,Rra,Pra,kra,Dra,Nra,Mra,Ora,Bra,Lra,Fra,Ura,Qra,Pli,kli,Dli,Nli,Mli,qra,jra,Hra,Gra,$ra,Vra,Oli,Bli,Wra,zra,Yra,Lli,Fli,Kra,Jra,Zra,Uli,Qli,qli,jli,Hli,Gli,$li,Vli,Wli,zli,Yli,Kli,Jli,Zli,Xli,eui,tui,Xra,ena,tna,rna,nna,ina,ona,sna,ana,cna,lna,una,dna,fna,pna,hna,mna,gna,rui,nui,Ana,yna,Ena,iui=_e(()=>{p();dhr();moi="aws.lambda.invoked_arn",goi="db.system",Aoi="db.connection_string",yoi="db.user",Eoi="db.jdbc.driver_classname",_oi="db.name",voi="db.statement",Coi="db.operation",boi="db.mssql.instance_name",Soi="db.cassandra.keyspace",Toi="db.cassandra.page_size",Ioi="db.cassandra.consistency_level",xoi="db.cassandra.table",woi="db.cassandra.idempotence",Roi="db.cassandra.speculative_execution_count",Poi="db.cassandra.coordinator.id",koi="db.cassandra.coordinator.dc",Doi="db.hbase.namespace",Noi="db.redis.database_index",Moi="db.mongodb.collection",Ooi="db.sql.table",Boi="exception.type",Loi="exception.message",Foi="exception.stacktrace",Uoi="exception.escaped",Qoi="faas.trigger",qoi="faas.execution",joi="faas.document.collection",Hoi="faas.document.operation",Goi="faas.document.time",$oi="faas.document.name",Voi="faas.time",Woi="faas.cron",zoi="faas.coldstart",Yoi="faas.invoked_name",Koi="faas.invoked_provider",Joi="faas.invoked_region",Zoi="net.transport",Xoi="net.peer.ip",esi="net.peer.port",tsi="net.peer.name",rsi="net.host.ip",nsi="net.host.port",isi="net.host.name",osi="net.host.connection.type",ssi="net.host.connection.subtype",asi="net.host.carrier.name",csi="net.host.carrier.mcc",lsi="net.host.carrier.mnc",usi="net.host.carrier.icc",dsi="peer.service",fsi="enduser.id",psi="enduser.role",hsi="enduser.scope",msi="thread.id",gsi="thread.name",Asi="code.function",ysi="code.namespace",Esi="code.filepath",_si="code.lineno",vsi="http.method",Csi="http.url",bsi="http.target",Ssi="http.host",Tsi="http.scheme",Isi="http.status_code",xsi="http.flavor",wsi="http.user_agent",Rsi="http.request_content_length",Psi="http.request_content_length_uncompressed",ksi="http.response_content_length",Dsi="http.response_content_length_uncompressed",Nsi="http.server_name",Msi="http.route",Osi="http.client_ip",Bsi="aws.dynamodb.table_names",Lsi="aws.dynamodb.consumed_capacity",Fsi="aws.dynamodb.item_collection_metrics",Usi="aws.dynamodb.provisioned_read_capacity",Qsi="aws.dynamodb.provisioned_write_capacity",qsi="aws.dynamodb.consistent_read",jsi="aws.dynamodb.projection",Hsi="aws.dynamodb.limit",Gsi="aws.dynamodb.attributes_to_get",$si="aws.dynamodb.index_name",Vsi="aws.dynamodb.select",Wsi="aws.dynamodb.global_secondary_indexes",zsi="aws.dynamodb.local_secondary_indexes",Ysi="aws.dynamodb.exclusive_start_table",Ksi="aws.dynamodb.table_count",Jsi="aws.dynamodb.scan_forward",Zsi="aws.dynamodb.segment",Xsi="aws.dynamodb.total_segments",eai="aws.dynamodb.count",tai="aws.dynamodb.scanned_count",rai="aws.dynamodb.attribute_definitions",nai="aws.dynamodb.global_secondary_index_updates",iai="messaging.system",oai="messaging.destination",sai="messaging.destination_kind",aai="messaging.temp_destination",cai="messaging.protocol",lai="messaging.protocol_version",uai="messaging.url",dai="messaging.message_id",fai="messaging.conversation_id",pai="messaging.message_payload_size_bytes",hai="messaging.message_payload_compressed_size_bytes",mai="messaging.operation",gai="messaging.consumer_id",Aai="messaging.rabbitmq.routing_key",yai="messaging.kafka.message_key",Eai="messaging.kafka.consumer_group",_ai="messaging.kafka.client_id",vai="messaging.kafka.partition",Cai="messaging.kafka.tombstone",bai="rpc.system",Sai="rpc.service",Tai="rpc.method",Iai="rpc.grpc.status_code",xai="rpc.jsonrpc.version",wai="rpc.jsonrpc.request_id",Rai="rpc.jsonrpc.error_code",Pai="rpc.jsonrpc.error_message",kai="message.type",Dai="message.id",Nai="message.compressed_size",Mai="message.uncompressed_size",AZs=moi,yZs=goi,EZs=Aoi,_Zs=yoi,vZs=Eoi,CZs=_oi,bZs=voi,SZs=Coi,TZs=boi,IZs=Soi,xZs=Toi,wZs=Ioi,RZs=xoi,PZs=woi,kZs=Roi,DZs=Poi,NZs=koi,MZs=Doi,OZs=Noi,BZs=Moi,LZs=Ooi,FZs=Boi,UZs=Loi,QZs=Foi,qZs=Uoi,jZs=Qoi,HZs=qoi,GZs=joi,$Zs=Hoi,VZs=Goi,WZs=$oi,zZs=Voi,YZs=Woi,KZs=zoi,JZs=Yoi,ZZs=Koi,XZs=Joi,eXs=Zoi,tXs=Xoi,rXs=esi,nXs=tsi,iXs=rsi,oXs=nsi,sXs=isi,aXs=osi,cXs=ssi,lXs=asi,uXs=csi,dXs=lsi,fXs=usi,pXs=dsi,hXs=fsi,mXs=psi,gXs=hsi,AXs=msi,yXs=gsi,EXs=Asi,_Xs=ysi,vXs=Esi,CXs=_si,bXs=vsi,SXs=Csi,TXs=bsi,IXs=Ssi,xXs=Tsi,wXs=Isi,RXs=xsi,PXs=wsi,kXs=Rsi,DXs=Psi,NXs=ksi,MXs=Dsi,OXs=Nsi,BXs=Msi,LXs=Osi,FXs=Bsi,UXs=Lsi,QXs=Fsi,qXs=Usi,jXs=Qsi,HXs=qsi,GXs=jsi,$Xs=Hsi,VXs=Gsi,WXs=$si,zXs=Vsi,YXs=Wsi,KXs=zsi,JXs=Ysi,ZXs=Ksi,XXs=Jsi,eea=Zsi,tea=Xsi,rea=eai,nea=tai,iea=rai,oea=nai,sea=iai,aea=oai,cea=sai,lea=aai,uea=cai,dea=lai,fea=uai,pea=dai,hea=fai,mea=pai,gea=hai,Aea=mai,yea=gai,Eea=Aai,_ea=yai,vea=Eai,Cea=_ai,bea=vai,Sea=Cai,Tea=bai,Iea=Sai,xea=Tai,wea=Iai,Rea=xai,Pea=wai,kea=Rai,Dea=Pai,Nea=kai,Mea=Dai,Oea=Nai,Bea=Mai,Lea=th([moi,goi,Aoi,yoi,Eoi,_oi,voi,Coi,boi,Soi,Toi,Ioi,xoi,woi,Roi,Poi,koi,Doi,Noi,Moi,Ooi,Boi,Loi,Foi,Uoi,Qoi,qoi,joi,Hoi,Goi,$oi,Voi,Woi,zoi,Yoi,Koi,Joi,Zoi,Xoi,esi,tsi,rsi,nsi,isi,osi,ssi,asi,csi,lsi,usi,dsi,fsi,psi,hsi,msi,gsi,Asi,ysi,Esi,_si,vsi,Csi,bsi,Ssi,Tsi,Isi,xsi,wsi,Rsi,Psi,ksi,Dsi,Nsi,Msi,Osi,Bsi,Lsi,Fsi,Usi,Qsi,qsi,jsi,Hsi,Gsi,$si,Vsi,Wsi,zsi,Ysi,Ksi,Jsi,Zsi,Xsi,eai,tai,rai,nai,iai,oai,sai,aai,cai,lai,uai,dai,fai,pai,hai,mai,gai,Aai,yai,Eai,_ai,vai,Cai,bai,Sai,Tai,Iai,xai,wai,Rai,Pai,kai,Dai,Nai,Mai]),Oai="other_sql",Bai="mssql",Lai="mysql",Fai="oracle",Uai="db2",Qai="postgresql",qai="redshift",jai="hive",Hai="cloudscape",Gai="hsqldb",$ai="progress",Vai="maxdb",Wai="hanadb",zai="ingres",Yai="firstsql",Kai="edb",Jai="cache",Zai="adabas",Xai="firebird",eci="derby",tci="filemaker",rci="informix",nci="instantdb",ici="interbase",oci="mariadb",sci="netezza",aci="pervasive",cci="pointbase",lci="sqlite",uci="sybase",dci="teradata",fci="vertica",pci="h2",hci="coldfusion",mci="cassandra",gci="hbase",Aci="mongodb",yci="redis",Eci="couchbase",_ci="couchdb",vci="cosmosdb",Cci="dynamodb",bci="neo4j",Sci="geode",Tci="elasticsearch",Ici="memcached",xci="cockroachdb",Fea=Oai,Uea=Bai,Qea=Lai,qea=Fai,jea=Uai,Hea=Qai,Gea=qai,$ea=jai,Vea=Hai,Wea=Gai,zea=$ai,Yea=Vai,Kea=Wai,Jea=zai,Zea=Yai,Xea=Kai,eta=Jai,tta=Zai,rta=Xai,nta=eci,ita=tci,ota=rci,sta=nci,ata=ici,cta=oci,lta=sci,uta=aci,dta=cci,fta=lci,pta=uci,hta=dci,mta=fci,gta=pci,Ata=hci,yta=mci,Eta=gci,_ta=Aci,vta=yci,Cta=Eci,bta=_ci,Sta=vci,Tta=Cci,Ita=bci,xta=Sci,wta=Tci,Rta=Ici,Pta=xci,kta=th([Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,vci,Cci,bci,Sci,Tci,Ici,xci]),wci="all",Rci="each_quorum",Pci="quorum",kci="local_quorum",Dci="one",Nci="two",Mci="three",Oci="local_one",Bci="any",Lci="serial",Fci="local_serial",Dta=wci,Nta=Rci,Mta=Pci,Ota=kci,Bta=Dci,Lta=Nci,Fta=Mci,Uta=Oci,Qta=Bci,qta=Lci,jta=Fci,Hta=th([wci,Rci,Pci,kci,Dci,Nci,Mci,Oci,Bci,Lci,Fci]),Uci="datasource",Qci="http",qci="pubsub",jci="timer",Hci="other",Gta=Uci,$ta=Qci,Vta=qci,Wta=jci,zta=Hci,Yta=th([Uci,Qci,qci,jci,Hci]),Gci="insert",$ci="edit",Vci="delete",Kta=Gci,Jta=$ci,Zta=Vci,Xta=th([Gci,$ci,Vci]),Wci="alibaba_cloud",zci="aws",Yci="azure",Kci="gcp",era=Wci,tra=zci,rra=Yci,nra=Kci,ira=th([Wci,zci,Yci,Kci]),Jci="ip_tcp",Zci="ip_udp",Xci="ip",eli="unix",tli="pipe",rli="inproc",nli="other",ora=Jci,sra=Zci,ara=Xci,cra=eli,lra=tli,ura=rli,dra=nli,fra=th([Jci,Zci,Xci,eli,tli,rli,nli]),ili="wifi",oli="wired",sli="cell",ali="unavailable",cli="unknown",pra=ili,hra=oli,mra=sli,gra=ali,Ara=cli,yra=th([ili,oli,sli,ali,cli]),lli="gprs",uli="edge",dli="umts",fli="cdma",pli="evdo_0",hli="evdo_a",mli="cdma2000_1xrtt",gli="hsdpa",Ali="hsupa",yli="hspa",Eli="iden",_li="evdo_b",vli="lte",Cli="ehrpd",bli="hspap",Sli="gsm",Tli="td_scdma",Ili="iwlan",xli="nr",wli="nrnsa",Rli="lte_ca",Era=lli,_ra=uli,vra=dli,Cra=fli,bra=pli,Sra=hli,Tra=mli,Ira=gli,xra=Ali,wra=yli,Rra=Eli,Pra=_li,kra=vli,Dra=Cli,Nra=bli,Mra=Sli,Ora=Tli,Bra=Ili,Lra=xli,Fra=wli,Ura=Rli,Qra=th([lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,vli,Cli,bli,Sli,Tli,Ili,xli,wli,Rli]),Pli="1.0",kli="1.1",Dli="2.0",Nli="SPDY",Mli="QUIC",qra=Pli,jra=kli,Hra=Dli,Gra=Nli,$ra=Mli,Vra={HTTP_1_0:Pli,HTTP_1_1:kli,HTTP_2_0:Dli,SPDY:Nli,QUIC:Mli},Oli="queue",Bli="topic",Wra=Oli,zra=Bli,Yra=th([Oli,Bli]),Lli="receive",Fli="process",Kra=Lli,Jra=Fli,Zra=th([Lli,Fli]),Uli=0,Qli=1,qli=2,jli=3,Hli=4,Gli=5,$li=6,Vli=7,Wli=8,zli=9,Yli=10,Kli=11,Jli=12,Zli=13,Xli=14,eui=15,tui=16,Xra=Uli,ena=Qli,tna=qli,rna=jli,nna=Hli,ina=Gli,ona=$li,sna=Vli,ana=Wli,cna=zli,lna=Yli,una=Kli,dna=Jli,fna=Zli,pna=Xli,hna=eui,mna=tui,gna={OK:Uli,CANCELLED:Qli,UNKNOWN:qli,INVALID_ARGUMENT:jli,DEADLINE_EXCEEDED:Hli,NOT_FOUND:Gli,ALREADY_EXISTS:$li,PERMISSION_DENIED:Vli,RESOURCE_EXHAUSTED:Wli,FAILED_PRECONDITION:zli,ABORTED:Yli,OUT_OF_RANGE:Kli,UNIMPLEMENTED:Jli,INTERNAL:Zli,UNAVAILABLE:Xli,DATA_LOSS:eui,UNAUTHENTICATED:tui},rui="SENT",nui="RECEIVED",Ana=rui,yna=nui,Ena=th([rui,nui])});var oui=_e(()=>{p();iui()});var sui,aui,cui,lui,uui,dui,fui,pui,hui,mui,gui,Aui,yui,Eui,_ui,vui,Cui,bui,Sui,Tui,Iui,xui,wui,Rui,Pui,kui,Dui,Nui,Mui,Oui,Bui,Lui,Fui,Uui,Qui,qui,jui,Hui,Gui,$ui,Vui,Wui,zui,Yui,Kui,Jui,Zui,Xui,edi,tdi,rdi,ndi,idi,odi,sdi,adi,cdi,ldi,udi,ddi,fdi,pdi,hdi,mdi,gdi,Adi,ydi,Edi,_di,vdi,Cdi,bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,Pdi,kdi,Ddi,_na,vna,Cna,bna,Sna,Tna,Ina,xna,wna,Rna,Pna,kna,Dna,Nna,Mna,Ona,Bna,Lna,Fna,Una,Qna,qna,jna,Hna,Gna,$na,Vna,Wna,zna,Yna,Kna,Jna,Zna,Xna,eia,tia,ria,nia,iia,oia,sia,aia,cia,lia,uia,dia,fia,pia,hia,mia,gia,Aia,yia,Eia,_ia,via,Cia,bia,Sia,Tia,Iia,xia,wia,Ria,Pia,kia,Dia,Nia,Mia,Oia,Bia,Lia,Fia,Uia,Qia,qia,jia,Hia,Gia,$ia,Via,Wia,Ndi,Mdi,Odi,Bdi,zia,Yia,Kia,Jia,Zia,Ldi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,Xia,eoa,toa,roa,noa,ioa,ooa,soa,aoa,coa,loa,uoa,doa,foa,poa,hoa,moa,goa,efi,tfi,Aoa,yoa,Eoa,rfi,nfi,ifi,ofi,sfi,afi,cfi,_oa,voa,Coa,boa,Soa,Toa,Ioa,xoa,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,woa,Roa,Poa,koa,Doa,Noa,Moa,Ooa,Boa,Loa,Foa,Uoa,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,Qoa,qoa,joa,Hoa,Goa,$oa,Voa,Woa,zoa,Yoa,Koa,Pfi=_e(()=>{p();dhr();sui="cloud.provider",aui="cloud.account.id",cui="cloud.region",lui="cloud.availability_zone",uui="cloud.platform",dui="aws.ecs.container.arn",fui="aws.ecs.cluster.arn",pui="aws.ecs.launchtype",hui="aws.ecs.task.arn",mui="aws.ecs.task.family",gui="aws.ecs.task.revision",Aui="aws.eks.cluster.arn",yui="aws.log.group.names",Eui="aws.log.group.arns",_ui="aws.log.stream.names",vui="aws.log.stream.arns",Cui="container.name",bui="container.id",Sui="container.runtime",Tui="container.image.name",Iui="container.image.tag",xui="deployment.environment",wui="device.id",Rui="device.model.identifier",Pui="device.model.name",kui="faas.name",Dui="faas.id",Nui="faas.version",Mui="faas.instance",Oui="faas.max_memory",Bui="host.id",Lui="host.name",Fui="host.type",Uui="host.arch",Qui="host.image.name",qui="host.image.id",jui="host.image.version",Hui="k8s.cluster.name",Gui="k8s.node.name",$ui="k8s.node.uid",Vui="k8s.namespace.name",Wui="k8s.pod.uid",zui="k8s.pod.name",Yui="k8s.container.name",Kui="k8s.replicaset.uid",Jui="k8s.replicaset.name",Zui="k8s.deployment.uid",Xui="k8s.deployment.name",edi="k8s.statefulset.uid",tdi="k8s.statefulset.name",rdi="k8s.daemonset.uid",ndi="k8s.daemonset.name",idi="k8s.job.uid",odi="k8s.job.name",sdi="k8s.cronjob.uid",adi="k8s.cronjob.name",cdi="os.type",ldi="os.description",udi="os.name",ddi="os.version",fdi="process.pid",pdi="process.executable.name",hdi="process.executable.path",mdi="process.command",gdi="process.command_line",Adi="process.command_args",ydi="process.owner",Edi="process.runtime.name",_di="process.runtime.version",vdi="process.runtime.description",Cdi="service.name",bdi="service.namespace",Sdi="service.instance.id",Tdi="service.version",Idi="telemetry.sdk.name",xdi="telemetry.sdk.language",wdi="telemetry.sdk.version",Rdi="telemetry.auto.version",Pdi="webengine.name",kdi="webengine.version",Ddi="webengine.description",_na=sui,vna=aui,Cna=cui,bna=lui,Sna=uui,Tna=dui,Ina=fui,xna=pui,wna=hui,Rna=mui,Pna=gui,kna=Aui,Dna=yui,Nna=Eui,Mna=_ui,Ona=vui,Bna=Cui,Lna=bui,Fna=Sui,Una=Tui,Qna=Iui,qna=xui,jna=wui,Hna=Rui,Gna=Pui,$na=kui,Vna=Dui,Wna=Nui,zna=Mui,Yna=Oui,Kna=Bui,Jna=Lui,Zna=Fui,Xna=Uui,eia=Qui,tia=qui,ria=jui,nia=Hui,iia=Gui,oia=$ui,sia=Vui,aia=Wui,cia=zui,lia=Yui,uia=Kui,dia=Jui,fia=Zui,pia=Xui,hia=edi,mia=tdi,gia=rdi,Aia=ndi,yia=idi,Eia=odi,_ia=sdi,via=adi,Cia=cdi,bia=ldi,Sia=udi,Tia=ddi,Iia=fdi,xia=pdi,wia=hdi,Ria=mdi,Pia=gdi,kia=Adi,Dia=ydi,Nia=Edi,Mia=_di,Oia=vdi,Bia=Cdi,Lia=bdi,Fia=Sdi,Uia=Tdi,Qia=Idi,qia=xdi,jia=wdi,Hia=Rdi,Gia=Pdi,$ia=kdi,Via=Ddi,Wia=th([sui,aui,cui,lui,uui,dui,fui,pui,hui,mui,gui,Aui,yui,Eui,_ui,vui,Cui,bui,Sui,Tui,Iui,xui,wui,Rui,Pui,kui,Dui,Nui,Mui,Oui,Bui,Lui,Fui,Uui,Qui,qui,jui,Hui,Gui,$ui,Vui,Wui,zui,Yui,Kui,Jui,Zui,Xui,edi,tdi,rdi,ndi,idi,odi,sdi,adi,cdi,ldi,udi,ddi,fdi,pdi,hdi,mdi,gdi,Adi,ydi,Edi,_di,vdi,Cdi,bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,Pdi,kdi,Ddi]),Ndi="alibaba_cloud",Mdi="aws",Odi="azure",Bdi="gcp",zia=Ndi,Yia=Mdi,Kia=Odi,Jia=Bdi,Zia=th([Ndi,Mdi,Odi,Bdi]),Ldi="alibaba_cloud_ecs",Fdi="alibaba_cloud_fc",Udi="aws_ec2",Qdi="aws_ecs",qdi="aws_eks",jdi="aws_lambda",Hdi="aws_elastic_beanstalk",Gdi="azure_vm",$di="azure_container_instances",Vdi="azure_aks",Wdi="azure_functions",zdi="azure_app_service",Ydi="gcp_compute_engine",Kdi="gcp_cloud_run",Jdi="gcp_kubernetes_engine",Zdi="gcp_cloud_functions",Xdi="gcp_app_engine",Xia=Ldi,eoa=Fdi,toa=Udi,roa=Qdi,noa=qdi,ioa=jdi,ooa=Hdi,soa=Gdi,aoa=$di,coa=Vdi,loa=Wdi,uoa=zdi,doa=Ydi,foa=Kdi,poa=Jdi,hoa=Zdi,moa=Xdi,goa=th([Ldi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi]),efi="ec2",tfi="fargate",Aoa=efi,yoa=tfi,Eoa=th([efi,tfi]),rfi="amd64",nfi="arm32",ifi="arm64",ofi="ia64",sfi="ppc32",afi="ppc64",cfi="x86",_oa=rfi,voa=nfi,Coa=ifi,boa=ofi,Soa=sfi,Toa=afi,Ioa=cfi,xoa=th([rfi,nfi,ifi,ofi,sfi,afi,cfi]),lfi="windows",ufi="linux",dfi="darwin",ffi="freebsd",pfi="netbsd",hfi="openbsd",mfi="dragonflybsd",gfi="hpux",Afi="aix",yfi="solaris",Efi="z_os",woa=lfi,Roa=ufi,Poa=dfi,koa=ffi,Doa=pfi,Noa=hfi,Moa=mfi,Ooa=gfi,Boa=Afi,Loa=yfi,Foa=Efi,Uoa=th([lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi]),_fi="cpp",vfi="dotnet",Cfi="erlang",bfi="go",Sfi="java",Tfi="nodejs",Ifi="php",xfi="python",wfi="ruby",Rfi="webjs",Qoa=_fi,qoa=vfi,joa=Cfi,Hoa=bfi,Goa=Sfi,$oa=Tfi,Voa=Ifi,Woa=xfi,zoa=wfi,Yoa=Rfi,Koa=th([_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi])});var kfi=_e(()=>{p();Pfi()});var Joa,Zoa,Xoa,esa,tsa,rsa,nsa,isa,osa,ssa,asa,csa,lsa,usa,dsa,fsa,psa,hsa,msa,gsa,Asa,ysa,Esa,_sa,vsa,Csa,bsa,Ssa,Tsa,Isa,xsa,wsa,Rsa,Psa,ksa,Dsa,Nsa,Msa,Osa,Bsa,Lsa,Fsa,Q$f,q$f,Usa,Qsa,qsa,jsa,Hsa,Gsa,$sa,Vsa,Wsa,zsa,Ysa,Ksa,Jsa,Zsa,Xsa,eaa,taa,raa,naa,iaa,oaa,saa,aaa,caa,laa,uaa,daa,faa,paa,haa,maa,gaa,Aaa,yaa,Eaa,_aa,vaa,Caa,baa,Saa,Taa,Iaa,xaa,waa,Raa,Paa,kaa,Daa,Naa,Maa,Oaa,Baa,Laa,Faa,Uaa,Qaa,qaa,jaa,Haa,Gaa,$aa,Vaa,Waa,zaa,Yaa,Kaa,Jaa,Zaa,Xaa,eca,fhr,tca,rca,nca,ica,oca,phr,sca,aca,cca,lca,uca,dca,hhr,mhr,fca,pca,hca,mca,gca,Aca,Dfi=_e(()=>{p();Joa="aspnetcore.diagnostics.exception.result",Zoa="aborted",Xoa="handled",esa="skipped",tsa="unhandled",rsa="aspnetcore.diagnostics.handler.type",nsa="aspnetcore.rate_limiting.policy",isa="aspnetcore.rate_limiting.result",osa="acquired",ssa="endpoint_limiter",asa="global_limiter",csa="request_canceled",lsa="aspnetcore.request.is_unhandled",usa="aspnetcore.routing.is_fallback",dsa="aspnetcore.routing.match_status",fsa="failure",psa="success",hsa="aspnetcore.user.is_authenticated",msa="client.address",gsa="client.port",Asa="code.column.number",ysa="code.file.path",Esa="code.function.name",_sa="code.line.number",vsa="code.stacktrace",Csa="db.collection.name",bsa="db.namespace",Ssa="db.operation.batch.size",Tsa="db.operation.name",Isa="db.query.summary",xsa="db.query.text",wsa="db.response.status_code",Rsa="db.stored_procedure.name",Psa="db.system.name",ksa="mariadb",Dsa="microsoft.sql_server",Nsa="mysql",Msa="postgresql",Osa="dotnet.gc.heap.generation",Bsa="gen0",Lsa="gen1",Fsa="gen2",Q$f="loh",q$f="poh",Usa="error.type",Qsa="_OTHER",qsa="exception.escaped",jsa="exception.message",Hsa="exception.stacktrace",Gsa="exception.type",$sa=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),Vsa="http.request.method",Wsa="_OTHER",zsa="CONNECT",Ysa="DELETE",Ksa="GET",Jsa="HEAD",Zsa="OPTIONS",Xsa="PATCH",eaa="POST",taa="PUT",raa="TRACE",naa="http.request.method_original",iaa="http.request.resend_count",oaa=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),saa="http.response.status_code",aaa="http.route",caa="jvm.gc.action",laa="jvm.gc.name",uaa="jvm.memory.pool.name",daa="jvm.memory.type",faa="heap",paa="non_heap",haa="jvm.thread.daemon",maa="jvm.thread.state",gaa="blocked",Aaa="new",yaa="runnable",Eaa="terminated",_aa="timed_waiting",vaa="waiting",Caa="network.local.address",baa="network.local.port",Saa="network.peer.address",Taa="network.peer.port",Iaa="network.protocol.name",xaa="network.protocol.version",waa="network.transport",Raa="pipe",Paa="quic",kaa="tcp",Daa="udp",Naa="unix",Maa="network.type",Oaa="ipv4",Baa="ipv6",Laa="otel.scope.name",Faa="otel.scope.version",Uaa="otel.status_code",Qaa="ERROR",qaa="OK",jaa="otel.status_description",Haa="server.address",Gaa="server.port",$aa="service.name",Vaa="service.version",Waa="signalr.connection.status",zaa="app_shutdown",Yaa="normal_closure",Kaa="timeout",Jaa="signalr.transport",Zaa="long_polling",Xaa="server_sent_events",eca="web_sockets",fhr="telemetry.sdk.language",tca="cpp",rca="dotnet",nca="erlang",ica="go",oca="java",phr="nodejs",sca="php",aca="python",cca="ruby",lca="rust",uca="swift",dca="webjs",hhr="telemetry.sdk.name",mhr="telemetry.sdk.version",fca="url.fragment",pca="url.full",hca="url.path",mca="url.query",gca="url.scheme",Aca="user_agent.original"});var yca,Eca,_ca,vca,Cca,bca,Sca,Tca,Ica,xca,wca,Rca,Pca,kca,Dca,Nca,Mca,Oca,Bca,Lca,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,Nfi=_e(()=>{p();yca="aspnetcore.diagnostics.exceptions",Eca="aspnetcore.rate_limiting.active_request_leases",_ca="aspnetcore.rate_limiting.queued_requests",vca="aspnetcore.rate_limiting.request.time_in_queue",Cca="aspnetcore.rate_limiting.request_lease.duration",bca="aspnetcore.rate_limiting.requests",Sca="aspnetcore.routing.match_attempts",Tca="db.client.operation.duration",Ica="dotnet.assembly.count",xca="dotnet.exceptions",wca="dotnet.gc.collections",Rca="dotnet.gc.heap.total_allocated",Pca="dotnet.gc.last_collection.heap.fragmentation.size",kca="dotnet.gc.last_collection.heap.size",Dca="dotnet.gc.last_collection.memory.committed_size",Nca="dotnet.gc.pause.time",Mca="dotnet.jit.compilation.time",Oca="dotnet.jit.compiled_il.size",Bca="dotnet.jit.compiled_methods",Lca="dotnet.monitor.lock_contentions",Fca="dotnet.process.cpu.count",Uca="dotnet.process.cpu.time",Qca="dotnet.process.memory.working_set",qca="dotnet.thread_pool.queue.length",jca="dotnet.thread_pool.thread.count",Hca="dotnet.thread_pool.work_item.count",Gca="dotnet.timer.count",$ca="http.client.request.duration",Vca="http.server.request.duration",Wca="jvm.class.count",zca="jvm.class.loaded",Yca="jvm.class.unloaded",Kca="jvm.cpu.count",Jca="jvm.cpu.recent_utilization",Zca="jvm.cpu.time",Xca="jvm.gc.duration",ela="jvm.memory.committed",tla="jvm.memory.limit",rla="jvm.memory.used",nla="jvm.memory.used_after_last_gc",ila="jvm.thread.count",ola="kestrel.active_connections",sla="kestrel.active_tls_handshakes",ala="kestrel.connection.duration",cla="kestrel.queued_connections",lla="kestrel.queued_requests",ula="kestrel.rejected_connections",dla="kestrel.tls_handshake.duration",fla="kestrel.upgraded_connections",pla="signalr.server.active_connections",hla="signalr.server.connection.duration"});var mla,Mfi=_e(()=>{p();mla="exception"});var ghr={};xi(ghr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Zoa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Xoa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>esa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>tsa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>osa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>ssa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>asa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>csa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>fsa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>psa,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Joa,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>rsa,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>nsa,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>isa,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>lsa,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>usa,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>dsa,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>hsa,ATTR_CLIENT_ADDRESS:()=>msa,ATTR_CLIENT_PORT:()=>gsa,ATTR_CODE_COLUMN_NUMBER:()=>Asa,ATTR_CODE_FILE_PATH:()=>ysa,ATTR_CODE_FUNCTION_NAME:()=>Esa,ATTR_CODE_LINE_NUMBER:()=>_sa,ATTR_CODE_STACKTRACE:()=>vsa,ATTR_DB_COLLECTION_NAME:()=>Csa,ATTR_DB_NAMESPACE:()=>bsa,ATTR_DB_OPERATION_BATCH_SIZE:()=>Ssa,ATTR_DB_OPERATION_NAME:()=>Tsa,ATTR_DB_QUERY_SUMMARY:()=>Isa,ATTR_DB_QUERY_TEXT:()=>xsa,ATTR_DB_RESPONSE_STATUS_CODE:()=>wsa,ATTR_DB_STORED_PROCEDURE_NAME:()=>Rsa,ATTR_DB_SYSTEM_NAME:()=>Psa,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Osa,ATTR_ERROR_TYPE:()=>Usa,ATTR_EXCEPTION_ESCAPED:()=>qsa,ATTR_EXCEPTION_MESSAGE:()=>jsa,ATTR_EXCEPTION_STACKTRACE:()=>Hsa,ATTR_EXCEPTION_TYPE:()=>Gsa,ATTR_HTTP_REQUEST_HEADER:()=>$sa,ATTR_HTTP_REQUEST_METHOD:()=>Vsa,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>naa,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>iaa,ATTR_HTTP_RESPONSE_HEADER:()=>oaa,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>saa,ATTR_HTTP_ROUTE:()=>aaa,ATTR_JVM_GC_ACTION:()=>caa,ATTR_JVM_GC_NAME:()=>laa,ATTR_JVM_MEMORY_POOL_NAME:()=>uaa,ATTR_JVM_MEMORY_TYPE:()=>daa,ATTR_JVM_THREAD_DAEMON:()=>haa,ATTR_JVM_THREAD_STATE:()=>maa,ATTR_NETWORK_LOCAL_ADDRESS:()=>Caa,ATTR_NETWORK_LOCAL_PORT:()=>baa,ATTR_NETWORK_PEER_ADDRESS:()=>Saa,ATTR_NETWORK_PEER_PORT:()=>Taa,ATTR_NETWORK_PROTOCOL_NAME:()=>Iaa,ATTR_NETWORK_PROTOCOL_VERSION:()=>xaa,ATTR_NETWORK_TRANSPORT:()=>waa,ATTR_NETWORK_TYPE:()=>Maa,ATTR_OTEL_SCOPE_NAME:()=>Laa,ATTR_OTEL_SCOPE_VERSION:()=>Faa,ATTR_OTEL_STATUS_CODE:()=>Uaa,ATTR_OTEL_STATUS_DESCRIPTION:()=>jaa,ATTR_SERVER_ADDRESS:()=>Haa,ATTR_SERVER_PORT:()=>Gaa,ATTR_SERVICE_NAME:()=>$aa,ATTR_SERVICE_VERSION:()=>Vaa,ATTR_SIGNALR_CONNECTION_STATUS:()=>Waa,ATTR_SIGNALR_TRANSPORT:()=>Jaa,ATTR_TELEMETRY_SDK_LANGUAGE:()=>fhr,ATTR_TELEMETRY_SDK_NAME:()=>hhr,ATTR_TELEMETRY_SDK_VERSION:()=>mhr,ATTR_URL_FRAGMENT:()=>fca,ATTR_URL_FULL:()=>pca,ATTR_URL_PATH:()=>hca,ATTR_URL_QUERY:()=>mca,ATTR_URL_SCHEME:()=>gca,ATTR_USER_AGENT_ORIGINAL:()=>Aca,AWSECSLAUNCHTYPEVALUES_EC2:()=>Aoa,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>yoa,AwsEcsLaunchtypeValues:()=>Eoa,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Xia,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>eoa,CLOUDPLATFORMVALUES_AWS_EC2:()=>toa,CLOUDPLATFORMVALUES_AWS_ECS:()=>roa,CLOUDPLATFORMVALUES_AWS_EKS:()=>noa,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>ooa,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>ioa,CLOUDPLATFORMVALUES_AZURE_AKS:()=>coa,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>uoa,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>aoa,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>loa,CLOUDPLATFORMVALUES_AZURE_VM:()=>soa,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>moa,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>hoa,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>foa,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>doa,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>poa,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>zia,CLOUDPROVIDERVALUES_AWS:()=>Yia,CLOUDPROVIDERVALUES_AZURE:()=>Kia,CLOUDPROVIDERVALUES_GCP:()=>Jia,CloudPlatformValues:()=>goa,CloudProviderValues:()=>Zia,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Dta,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Qta,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Nta,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Uta,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Ota,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>jta,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Bta,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Mta,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>qta,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Fta,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Lta,DBSYSTEMVALUES_ADABAS:()=>tta,DBSYSTEMVALUES_CACHE:()=>eta,DBSYSTEMVALUES_CASSANDRA:()=>yta,DBSYSTEMVALUES_CLOUDSCAPE:()=>Vea,DBSYSTEMVALUES_COCKROACHDB:()=>Pta,DBSYSTEMVALUES_COLDFUSION:()=>Ata,DBSYSTEMVALUES_COSMOSDB:()=>Sta,DBSYSTEMVALUES_COUCHBASE:()=>Cta,DBSYSTEMVALUES_COUCHDB:()=>bta,DBSYSTEMVALUES_DB2:()=>jea,DBSYSTEMVALUES_DERBY:()=>nta,DBSYSTEMVALUES_DYNAMODB:()=>Tta,DBSYSTEMVALUES_EDB:()=>Xea,DBSYSTEMVALUES_ELASTICSEARCH:()=>wta,DBSYSTEMVALUES_FILEMAKER:()=>ita,DBSYSTEMVALUES_FIREBIRD:()=>rta,DBSYSTEMVALUES_FIRSTSQL:()=>Zea,DBSYSTEMVALUES_GEODE:()=>xta,DBSYSTEMVALUES_H2:()=>gta,DBSYSTEMVALUES_HANADB:()=>Kea,DBSYSTEMVALUES_HBASE:()=>Eta,DBSYSTEMVALUES_HIVE:()=>$ea,DBSYSTEMVALUES_HSQLDB:()=>Wea,DBSYSTEMVALUES_INFORMIX:()=>ota,DBSYSTEMVALUES_INGRES:()=>Jea,DBSYSTEMVALUES_INSTANTDB:()=>sta,DBSYSTEMVALUES_INTERBASE:()=>ata,DBSYSTEMVALUES_MARIADB:()=>cta,DBSYSTEMVALUES_MAXDB:()=>Yea,DBSYSTEMVALUES_MEMCACHED:()=>Rta,DBSYSTEMVALUES_MONGODB:()=>_ta,DBSYSTEMVALUES_MSSQL:()=>Uea,DBSYSTEMVALUES_MYSQL:()=>Qea,DBSYSTEMVALUES_NEO4J:()=>Ita,DBSYSTEMVALUES_NETEZZA:()=>lta,DBSYSTEMVALUES_ORACLE:()=>qea,DBSYSTEMVALUES_OTHER_SQL:()=>Fea,DBSYSTEMVALUES_PERVASIVE:()=>uta,DBSYSTEMVALUES_POINTBASE:()=>dta,DBSYSTEMVALUES_POSTGRESQL:()=>Hea,DBSYSTEMVALUES_PROGRESS:()=>zea,DBSYSTEMVALUES_REDIS:()=>vta,DBSYSTEMVALUES_REDSHIFT:()=>Gea,DBSYSTEMVALUES_SQLITE:()=>fta,DBSYSTEMVALUES_SYBASE:()=>pta,DBSYSTEMVALUES_TERADATA:()=>hta,DBSYSTEMVALUES_VERTICA:()=>mta,DB_SYSTEM_NAME_VALUE_MARIADB:()=>ksa,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Dsa,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Nsa,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Msa,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Bsa,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Lsa,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Fsa,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Q$f,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>q$f,DbCassandraConsistencyLevelValues:()=>Hta,DbSystemValues:()=>kta,ERROR_TYPE_VALUE_OTHER:()=>Qsa,EVENT_EXCEPTION:()=>mla,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Zta,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Jta,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Kta,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>era,FAASINVOKEDPROVIDERVALUES_AWS:()=>tra,FAASINVOKEDPROVIDERVALUES_AZURE:()=>rra,FAASINVOKEDPROVIDERVALUES_GCP:()=>nra,FAASTRIGGERVALUES_DATASOURCE:()=>Gta,FAASTRIGGERVALUES_HTTP:()=>$ta,FAASTRIGGERVALUES_OTHER:()=>zta,FAASTRIGGERVALUES_PUBSUB:()=>Vta,FAASTRIGGERVALUES_TIMER:()=>Wta,FaasDocumentOperationValues:()=>Xta,FaasInvokedProviderValues:()=>ira,FaasTriggerValues:()=>Yta,HOSTARCHVALUES_AMD64:()=>_oa,HOSTARCHVALUES_ARM32:()=>voa,HOSTARCHVALUES_ARM64:()=>Coa,HOSTARCHVALUES_IA64:()=>boa,HOSTARCHVALUES_PPC32:()=>Soa,HOSTARCHVALUES_PPC64:()=>Toa,HOSTARCHVALUES_X86:()=>Ioa,HTTPFLAVORVALUES_HTTP_1_0:()=>qra,HTTPFLAVORVALUES_HTTP_1_1:()=>jra,HTTPFLAVORVALUES_HTTP_2_0:()=>Hra,HTTPFLAVORVALUES_QUIC:()=>$ra,HTTPFLAVORVALUES_SPDY:()=>Gra,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>zsa,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Ysa,HTTP_REQUEST_METHOD_VALUE_GET:()=>Ksa,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Jsa,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Zsa,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Wsa,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Xsa,HTTP_REQUEST_METHOD_VALUE_POST:()=>eaa,HTTP_REQUEST_METHOD_VALUE_PUT:()=>taa,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>raa,HostArchValues:()=>xoa,HttpFlavorValues:()=>Vra,JVM_MEMORY_TYPE_VALUE_HEAP:()=>faa,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>paa,JVM_THREAD_STATE_VALUE_BLOCKED:()=>gaa,JVM_THREAD_STATE_VALUE_NEW:()=>Aaa,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>yaa,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Eaa,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>_aa,JVM_THREAD_STATE_VALUE_WAITING:()=>vaa,MESSAGETYPEVALUES_RECEIVED:()=>yna,MESSAGETYPEVALUES_SENT:()=>Ana,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Wra,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>zra,MESSAGINGOPERATIONVALUES_PROCESS:()=>Jra,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Kra,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>yca,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Eca,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>_ca,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>bca,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Cca,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>vca,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Sca,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Tca,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Ica,METRIC_DOTNET_EXCEPTIONS:()=>xca,METRIC_DOTNET_GC_COLLECTIONS:()=>wca,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>Rca,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>Pca,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>kca,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Dca,METRIC_DOTNET_GC_PAUSE_TIME:()=>Nca,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Mca,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Oca,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Bca,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Lca,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>Fca,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Uca,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>Qca,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>qca,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>jca,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>Hca,METRIC_DOTNET_TIMER_COUNT:()=>Gca,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>$ca,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Vca,METRIC_JVM_CLASS_COUNT:()=>Wca,METRIC_JVM_CLASS_LOADED:()=>zca,METRIC_JVM_CLASS_UNLOADED:()=>Yca,METRIC_JVM_CPU_COUNT:()=>Kca,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Jca,METRIC_JVM_CPU_TIME:()=>Zca,METRIC_JVM_GC_DURATION:()=>Xca,METRIC_JVM_MEMORY_COMMITTED:()=>ela,METRIC_JVM_MEMORY_LIMIT:()=>tla,METRIC_JVM_MEMORY_USED:()=>rla,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>nla,METRIC_JVM_THREAD_COUNT:()=>ila,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>ola,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>sla,METRIC_KESTREL_CONNECTION_DURATION:()=>ala,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>cla,METRIC_KESTREL_QUEUED_REQUESTS:()=>lla,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>ula,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>dla,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>fla,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>pla,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>hla,MessageTypeValues:()=>Ena,MessagingDestinationKindValues:()=>Yra,MessagingOperationValues:()=>Zra,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Cra,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Tra,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>_ra,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Dra,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>bra,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Sra,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Pra,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Era,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Mra,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Ira,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>wra,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Nra,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>xra,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Rra,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Bra,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>kra,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Ura,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Lra,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Fra,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Ora,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>vra,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>mra,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>gra,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Ara,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>pra,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>hra,NETTRANSPORTVALUES_INPROC:()=>ura,NETTRANSPORTVALUES_IP:()=>ara,NETTRANSPORTVALUES_IP_TCP:()=>ora,NETTRANSPORTVALUES_IP_UDP:()=>sra,NETTRANSPORTVALUES_OTHER:()=>dra,NETTRANSPORTVALUES_PIPE:()=>lra,NETTRANSPORTVALUES_UNIX:()=>cra,NETWORK_TRANSPORT_VALUE_PIPE:()=>Raa,NETWORK_TRANSPORT_VALUE_QUIC:()=>Paa,NETWORK_TRANSPORT_VALUE_TCP:()=>kaa,NETWORK_TRANSPORT_VALUE_UDP:()=>Daa,NETWORK_TRANSPORT_VALUE_UNIX:()=>Naa,NETWORK_TYPE_VALUE_IPV4:()=>Oaa,NETWORK_TYPE_VALUE_IPV6:()=>Baa,NetHostConnectionSubtypeValues:()=>Qra,NetHostConnectionTypeValues:()=>yra,NetTransportValues:()=>fra,OSTYPEVALUES_AIX:()=>Boa,OSTYPEVALUES_DARWIN:()=>Poa,OSTYPEVALUES_DRAGONFLYBSD:()=>Moa,OSTYPEVALUES_FREEBSD:()=>koa,OSTYPEVALUES_HPUX:()=>Ooa,OSTYPEVALUES_LINUX:()=>Roa,OSTYPEVALUES_NETBSD:()=>Doa,OSTYPEVALUES_OPENBSD:()=>Noa,OSTYPEVALUES_SOLARIS:()=>Loa,OSTYPEVALUES_WINDOWS:()=>woa,OSTYPEVALUES_Z_OS:()=>Foa,OTEL_STATUS_CODE_VALUE_ERROR:()=>Qaa,OTEL_STATUS_CODE_VALUE_OK:()=>qaa,OsTypeValues:()=>Uoa,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>lna,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>ona,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>ena,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>hna,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>nna,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>cna,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>fna,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>rna,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>ina,RPCGRPCSTATUSCODEVALUES_OK:()=>Xra,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>una,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>sna,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>ana,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>mna,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>pna,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>dna,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>tna,RpcGrpcStatusCodeValues:()=>gna,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>VXs,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>iea,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>HXs,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>UXs,SEMATTRS_AWS_DYNAMODB_COUNT:()=>rea,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>JXs,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>YXs,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>oea,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>WXs,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>QXs,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>$Xs,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>KXs,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>GXs,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>qXs,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>jXs,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>nea,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>XXs,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>eea,SEMATTRS_AWS_DYNAMODB_SELECT:()=>zXs,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>ZXs,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>FXs,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>tea,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>AZs,SEMATTRS_CODE_FILEPATH:()=>vXs,SEMATTRS_CODE_FUNCTION:()=>EXs,SEMATTRS_CODE_LINENO:()=>CXs,SEMATTRS_CODE_NAMESPACE:()=>_Xs,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>wZs,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>NZs,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>DZs,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>PZs,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>IZs,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>xZs,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>kZs,SEMATTRS_DB_CASSANDRA_TABLE:()=>RZs,SEMATTRS_DB_CONNECTION_STRING:()=>EZs,SEMATTRS_DB_HBASE_NAMESPACE:()=>MZs,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>vZs,SEMATTRS_DB_MONGODB_COLLECTION:()=>BZs,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>TZs,SEMATTRS_DB_NAME:()=>CZs,SEMATTRS_DB_OPERATION:()=>SZs,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>OZs,SEMATTRS_DB_SQL_TABLE:()=>LZs,SEMATTRS_DB_STATEMENT:()=>bZs,SEMATTRS_DB_SYSTEM:()=>yZs,SEMATTRS_DB_USER:()=>_Zs,SEMATTRS_ENDUSER_ID:()=>hXs,SEMATTRS_ENDUSER_ROLE:()=>mXs,SEMATTRS_ENDUSER_SCOPE:()=>gXs,SEMATTRS_EXCEPTION_ESCAPED:()=>qZs,SEMATTRS_EXCEPTION_MESSAGE:()=>UZs,SEMATTRS_EXCEPTION_STACKTRACE:()=>QZs,SEMATTRS_EXCEPTION_TYPE:()=>FZs,SEMATTRS_FAAS_COLDSTART:()=>KZs,SEMATTRS_FAAS_CRON:()=>YZs,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>GZs,SEMATTRS_FAAS_DOCUMENT_NAME:()=>WZs,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>$Zs,SEMATTRS_FAAS_DOCUMENT_TIME:()=>VZs,SEMATTRS_FAAS_EXECUTION:()=>HZs,SEMATTRS_FAAS_INVOKED_NAME:()=>JZs,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>ZZs,SEMATTRS_FAAS_INVOKED_REGION:()=>XZs,SEMATTRS_FAAS_TIME:()=>zZs,SEMATTRS_FAAS_TRIGGER:()=>jZs,SEMATTRS_HTTP_CLIENT_IP:()=>LXs,SEMATTRS_HTTP_FLAVOR:()=>RXs,SEMATTRS_HTTP_HOST:()=>IXs,SEMATTRS_HTTP_METHOD:()=>bXs,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>kXs,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>DXs,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>NXs,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>MXs,SEMATTRS_HTTP_ROUTE:()=>BXs,SEMATTRS_HTTP_SCHEME:()=>xXs,SEMATTRS_HTTP_SERVER_NAME:()=>OXs,SEMATTRS_HTTP_STATUS_CODE:()=>wXs,SEMATTRS_HTTP_TARGET:()=>TXs,SEMATTRS_HTTP_URL:()=>SXs,SEMATTRS_HTTP_USER_AGENT:()=>PXs,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Oea,SEMATTRS_MESSAGE_ID:()=>Mea,SEMATTRS_MESSAGE_TYPE:()=>Nea,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Bea,SEMATTRS_MESSAGING_CONSUMER_ID:()=>yea,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>hea,SEMATTRS_MESSAGING_DESTINATION:()=>aea,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>cea,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Cea,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>vea,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>_ea,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>bea,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Sea,SEMATTRS_MESSAGING_MESSAGE_ID:()=>pea,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>gea,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>mea,SEMATTRS_MESSAGING_OPERATION:()=>Aea,SEMATTRS_MESSAGING_PROTOCOL:()=>uea,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>dea,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Eea,SEMATTRS_MESSAGING_SYSTEM:()=>sea,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>lea,SEMATTRS_MESSAGING_URL:()=>fea,SEMATTRS_NET_HOST_CARRIER_ICC:()=>fXs,SEMATTRS_NET_HOST_CARRIER_MCC:()=>uXs,SEMATTRS_NET_HOST_CARRIER_MNC:()=>dXs,SEMATTRS_NET_HOST_CARRIER_NAME:()=>lXs,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>cXs,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>aXs,SEMATTRS_NET_HOST_IP:()=>iXs,SEMATTRS_NET_HOST_NAME:()=>sXs,SEMATTRS_NET_HOST_PORT:()=>oXs,SEMATTRS_NET_PEER_IP:()=>tXs,SEMATTRS_NET_PEER_NAME:()=>nXs,SEMATTRS_NET_PEER_PORT:()=>rXs,SEMATTRS_NET_TRANSPORT:()=>eXs,SEMATTRS_PEER_SERVICE:()=>pXs,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>wea,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>kea,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Dea,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Pea,SEMATTRS_RPC_JSONRPC_VERSION:()=>Rea,SEMATTRS_RPC_METHOD:()=>xea,SEMATTRS_RPC_SERVICE:()=>Iea,SEMATTRS_RPC_SYSTEM:()=>Tea,SEMATTRS_THREAD_ID:()=>AXs,SEMATTRS_THREAD_NAME:()=>yXs,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Ina,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Tna,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>xna,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>wna,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Rna,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Pna,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>kna,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Nna,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Dna,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Ona,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Mna,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>vna,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>bna,SEMRESATTRS_CLOUD_PLATFORM:()=>Sna,SEMRESATTRS_CLOUD_PROVIDER:()=>_na,SEMRESATTRS_CLOUD_REGION:()=>Cna,SEMRESATTRS_CONTAINER_ID:()=>Lna,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Una,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Qna,SEMRESATTRS_CONTAINER_NAME:()=>Bna,SEMRESATTRS_CONTAINER_RUNTIME:()=>Fna,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>qna,SEMRESATTRS_DEVICE_ID:()=>jna,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Hna,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Gna,SEMRESATTRS_FAAS_ID:()=>Vna,SEMRESATTRS_FAAS_INSTANCE:()=>zna,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Yna,SEMRESATTRS_FAAS_NAME:()=>$na,SEMRESATTRS_FAAS_VERSION:()=>Wna,SEMRESATTRS_HOST_ARCH:()=>Xna,SEMRESATTRS_HOST_ID:()=>Kna,SEMRESATTRS_HOST_IMAGE_ID:()=>tia,SEMRESATTRS_HOST_IMAGE_NAME:()=>eia,SEMRESATTRS_HOST_IMAGE_VERSION:()=>ria,SEMRESATTRS_HOST_NAME:()=>Jna,SEMRESATTRS_HOST_TYPE:()=>Zna,SEMRESATTRS_K8S_CLUSTER_NAME:()=>nia,SEMRESATTRS_K8S_CONTAINER_NAME:()=>lia,SEMRESATTRS_K8S_CRONJOB_NAME:()=>via,SEMRESATTRS_K8S_CRONJOB_UID:()=>_ia,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Aia,SEMRESATTRS_K8S_DAEMONSET_UID:()=>gia,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>pia,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>fia,SEMRESATTRS_K8S_JOB_NAME:()=>Eia,SEMRESATTRS_K8S_JOB_UID:()=>yia,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>sia,SEMRESATTRS_K8S_NODE_NAME:()=>iia,SEMRESATTRS_K8S_NODE_UID:()=>oia,SEMRESATTRS_K8S_POD_NAME:()=>cia,SEMRESATTRS_K8S_POD_UID:()=>aia,SEMRESATTRS_K8S_REPLICASET_NAME:()=>dia,SEMRESATTRS_K8S_REPLICASET_UID:()=>uia,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>mia,SEMRESATTRS_K8S_STATEFULSET_UID:()=>hia,SEMRESATTRS_OS_DESCRIPTION:()=>bia,SEMRESATTRS_OS_NAME:()=>Sia,SEMRESATTRS_OS_TYPE:()=>Cia,SEMRESATTRS_OS_VERSION:()=>Tia,SEMRESATTRS_PROCESS_COMMAND:()=>Ria,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>kia,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Pia,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>xia,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>wia,SEMRESATTRS_PROCESS_OWNER:()=>Dia,SEMRESATTRS_PROCESS_PID:()=>Iia,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Oia,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Nia,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Mia,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Fia,SEMRESATTRS_SERVICE_NAME:()=>Bia,SEMRESATTRS_SERVICE_NAMESPACE:()=>Lia,SEMRESATTRS_SERVICE_VERSION:()=>Uia,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Hia,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>qia,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Qia,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>jia,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Via,SEMRESATTRS_WEBENGINE_NAME:()=>Gia,SEMRESATTRS_WEBENGINE_VERSION:()=>$ia,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>zaa,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Yaa,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Kaa,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Zaa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Xaa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>eca,SemanticAttributes:()=>Lea,SemanticResourceAttributes:()=>Wia,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Qoa,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>qoa,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>joa,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Hoa,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Goa,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>$oa,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Voa,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Woa,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>zoa,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Yoa,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>tca,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>rca,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>nca,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>ica,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>oca,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>phr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>sca,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>aca,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>cca,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>lca,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>uca,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>dca,TelemetrySdkLanguageValues:()=>Koa});var Mdt=_e(()=>{p();oui();kfi();Dfi();Nfi();Mfi()});var Ofi,Bfi=_e(()=>{p();Ofi="process.runtime.name"});var Odt,Lfi=_e(()=>{p();hoi();Mdt();Bfi();Odt={[hhr]:"opentelemetry",[Ofi]:"node",[fhr]:phr,[mhr]:poi}});var Ffi=_e(()=>{p();loi();uoi();foi();Lfi()});var Ahr=_e(()=>{p();Ffi()});function The(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Ala);return[r,n]}function Ldt(){let t=lH.timeOrigin;if(typeof t!="number"){let e=lH;t=e.timing&&e.timing.fetchStart}return t}function yhr(t){let e=The(Ldt()),r=The(typeof t=="number"?t:lH.now());return Ehr(e,r)}function Qfi(t){if(Fdt(t))return t;if(typeof t=="number")return t=Bdt&&(r[1]-=Bdt,r[0]+=1),r}var Ufi,gla,Ala,Bdt,Wfi=_e(()=>{p();Ahr();Ufi=9,gla=6,Ala=Math.pow(10,gla),Bdt=Math.pow(10,Ufi);a(The,"millisToHrTime");a(Ldt,"getTimeOrigin");a(yhr,"hrTime");a(Qfi,"timeInputToHrTime");a(qfi,"hrTimeDuration");a(jfi,"hrTimeToTimeStamp");a(Hfi,"hrTimeToNanoseconds");a(Gfi,"hrTimeToMilliseconds");a($fi,"hrTimeToMicroseconds");a(Fdt,"isTimeInputHrTime");a(Vfi,"isTimeInput");a(Ehr,"addHrTimes")});function zfi(t){typeof t!="number"&&t.unref()}var Yfi=_e(()=>{p();a(zfi,"unrefTimer")});var Udt,Kfi=_e(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Udt||(Udt={}))});var Qdt,Jfi=_e(()=>{p();ao();Qdt=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){Pn.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){Pn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function Zfi(t){return _la.test(t)}function Xfi(t){return vla.test(t)&&!Cla.test(t)}var _hr,yla,Ela,_la,vla,Cla,epi=_e(()=>{p();_hr="[_0-9a-z-*/]",yla=`[a-z]${_hr}{0,255}`,Ela=`[a-z0-9]${_hr}{0,240}@[a-z]${_hr}{0,13}`,_la=new RegExp(`^(?:${yla}|${Ela})$`),vla=/^[ -~]{0,255}[!-~]$/,Cla=/,|=/;a(Zfi,"validateKey");a(Xfi,"validateValue")});var tpi,bla,rpi,npi,Ihe,vhr=_e(()=>{p();epi();tpi=32,bla=512,rpi=",",npi="=",Ihe=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+npi+this.get(r)),e),[]).join(rpi)}_parse(e){e.length>bla||(this._internalState=e.split(rpi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(npi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);Zfi(c)&&Xfi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>tpi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,tpi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function Chr(t){let e=Rla.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var zDe,YDe,Sla,Tla,Ila,xla,wla,Rla,qdt,ipi=_e(()=>{p();ao();VDe();vhr();zDe="traceparent",YDe="tracestate",Sla="00",Tla="(?!ff)[\\da-f]{2}",Ila="(?![0]{32})[\\da-f]{32}",xla="(?![0]{16})[\\da-f]{16}",wla="[\\da-f]{2}",Rla=new RegExp(`^\\s?(${Tla})-(${Ila})-(${xla})-(${wla})(-.*)?\\s?$`);a(Chr,"parseTraceParent");qdt=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=_u.getSpanContext(e);if(!o||She(e)||!rb(o))return;let s=`${Sla}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||gf.NONE).toString(16)}`;n.set(r,zDe,s),o.traceState&&n.set(r,YDe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,zDe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=Chr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,YDe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new Ihe(typeof u=="string"?u:void 0)}return _u.setSpanContext(e,c)}fields(){return[zDe,YDe]}}});function opi(t,e){return t.setValue(bhr,e)}function spi(t){return t.deleteValue(bhr)}function api(t){return t.getValue(bhr)}var bhr,jdt,cpi=_e(()=>{p();ao();bhr=tb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(jdt||(jdt={}));a(opi,"setRPCMetadata");a(spi,"deleteRPCMetadata");a(api,"getRPCMetadata")});function Shr(t){if(!Bla(t)||Lla(t)!==Pla)return!1;let e=Ola(t);if(e===null)return!0;let r=dpi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&lpi.call(r)===Mla}function Bla(t){return t!=null&&typeof t=="object"}function Lla(t){return t==null?t===void 0?Dla:kla:hX&&hX in Object(t)?Fla(t):Ula(t)}function Fla(t){let e=dpi.call(t,hX),r=t[hX],n=!1;try{t[hX]=void 0,n=!0}catch{}let o=fpi.call(t);return n&&(e?t[hX]=r:delete t[hX]),o}function Ula(t){return fpi.call(t)}var Pla,kla,Dla,Nla,lpi,Mla,Ola,upi,dpi,hX,fpi,ppi=_e(()=>{p();Pla="[object Object]",kla="[object Null]",Dla="[object Undefined]",Nla=Function.prototype,lpi=Nla.toString,Mla=lpi.call(Object),Ola=Object.getPrototypeOf,upi=Object.prototype,dpi=upi.hasOwnProperty,hX=Symbol?Symbol.toStringTag:void 0,fpi=upi.toString;a(Shr,"isPlainObject");a(Bla,"isObjectLike");a(Lla,"baseGetTag");a(Fla,"getRawTag");a(Ula,"objectToString")});function mpi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=gpi(e,t.shift(),0,r);return e}function Thr(t){return Gdt(t)?t.slice():t}function gpi(t,e,r=0,n){let o;if(!(r>Qla)){if(r++,Hdt(t)||Hdt(e)||Api(e))o=Thr(e);else if(Gdt(t)){if(o=t.slice(),Gdt(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(hpi(t,u,n)||hpi(e,u,n))delete o[u];else{if(KDe(f)&&KDe(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]=gpi(o[u],d,r,n)}}}}else o=e;return o}}function hpi(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 qla(t,e){return!(!Shr(t)||!Shr(e))}var Qla,ypi=_e(()=>{p();ppi();Qla=20;a(mpi,"merge");a(Thr,"takeValue");a(gpi,"mergeTwoObjects");a(hpi,"wasObjectReferenced");a(Gdt,"isArray");a(Api,"isFunction");a(KDe,"isObject");a(Hdt,"isPrimitive");a(qla,"shouldMerge")});function Epi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new JDe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var JDe,_pi=_e(()=>{p();JDe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(Epi,"callWithTimeout")});function Ihr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function vpi(t,e){if(!e)return!1;for(let r of e)if(Ihr(t,r))return!0;return!1}var Cpi=_e(()=>{p();a(Ihr,"urlMatches");a(vpi,"isUrlIgnored")});var $dt,bpi=_e(()=>{p();$dt=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 Vdt,Spi=_e(()=>{p();bpi();Vdt=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new $dt;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 Ipi(t){if(t==null)return;let e=Tpi[t.toUpperCase()];return e??(Pn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Tpi)}, using default`),wa.INFO)}var Tpi,xpi=_e(()=>{p();ao();Tpi={ALL:wa.ALL,VERBOSE:wa.VERBOSE,DEBUG:wa.DEBUG,INFO:wa.INFO,WARN:wa.WARN,ERROR:wa.ERROR,NONE:wa.NONE};a(Ipi,"diagLogLevelFromString")});function wpi(t,e){return new Promise(r=>{_g.with(Sdt(_g.active()),()=>{t.export(e,n=>{r(n)})})})}var Rpi=_e(()=>{p();ao();VDe();a(wpi,"_export")});var Wdt={};xi(Wdt,{AnchoredClock:()=>wdt,BindOnceFuture:()=>Vdt,CompositePropagator:()=>Qdt,ExportResultCode:()=>Udt,RPCType:()=>jdt,SDK_INFO:()=>Odt,TRACE_PARENT_HEADER:()=>zDe,TRACE_STATE_HEADER:()=>YDe,TimeoutError:()=>JDe,TraceState:()=>Ihe,W3CBaggagePropagator:()=>xdt,W3CTraceContextPropagator:()=>qdt,_globalThis:()=>Ndt,addHrTimes:()=>Ehr,callWithTimeout:()=>Epi,deleteRPCMetadata:()=>spi,diagLogLevelFromString:()=>Ipi,getBooleanFromEnv:()=>kdt,getNumberFromEnv:()=>Pdt,getRPCMetadata:()=>api,getStringFromEnv:()=>WDe,getStringListFromEnv:()=>Ddt,getTimeOrigin:()=>Ldt,globalErrorHandler:()=>aoi,hrTime:()=>yhr,hrTimeDuration:()=>qfi,hrTimeToMicroseconds:()=>$fi,hrTimeToMilliseconds:()=>Gfi,hrTimeToNanoseconds:()=>Hfi,hrTimeToTimeStamp:()=>jfi,internal:()=>jla,isAttributeValue:()=>chr,isTimeInput:()=>Vfi,isTimeInputHrTime:()=>Fdt,isTracingSuppressed:()=>She,isUrlIgnored:()=>vpi,loggingErrorHandler:()=>Rdt,merge:()=>mpi,millisToHrTime:()=>The,otperformance:()=>lH,parseKeyPairsIntoRecord:()=>Xii,parseTraceParent:()=>Chr,sanitizeAttributes:()=>roi,setGlobalErrorHandler:()=>soi,setRPCMetadata:()=>opi,suppressTracing:()=>Sdt,timeInputToHrTime:()=>Qfi,unrefTimer:()=>zfi,unsuppressTracing:()=>zii,urlMatches:()=>Ihr});var jla,zdt=_e(()=>{p();eoi();toi();ioi();coi();lhr();Wfi();Yfi();Kfi();ahr();Ahr();Jfi();ipi();cpi();VDe();vhr();ypi();_pi();Cpi();Spi();xpi();Rpi();jla={_export:wpi}});var Dpi=I(Ydt=>{"use strict";p();Object.defineProperty(Ydt,"__esModule",{value:!0});Ydt.OpenTelemetrySpanWrapper=void 0;var Ppi=(ao(),ya(r5)),kpi=(zdt(),ya(Wdt)),Hla=ihr(),xhr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&Gla(e.error)?e.error?(this._span.setStatus({code:Ppi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:Ppi.SpanStatusCode.ERROR}):e.status==="success"&&Hla.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,kpi.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,kpi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Ydt.OpenTelemetrySpanWrapper=xhr;function Gla(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(Gla,"isRecordableError")});var whr=I(M5=>{"use strict";p();Object.defineProperty(M5,"__esModule",{value:!0});M5.environmentCache=M5.SDK_VERSION=void 0;M5.envVarToBoolean=$la;M5.SDK_VERSION="1.0.0-beta.9";M5.environmentCache=new Map;function $la(t){var e;M5.environmentCache.has(t)||Vla(t);let r=((e=M5.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a($la,"envVarToBoolean");function Vla(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];M5.environmentCache.set(t,r)}}a(Vla,"loadEnvironmentVariable")});var Bpi=I(Kdt=>{"use strict";p();Object.defineProperty(Kdt,"__esModule",{value:!0});Kdt.toOpenTelemetrySpanKind=Opi;Kdt.toSpanOptions=zla;var Npi=(ao(),ya(r5)),Mpi=(zdt(),ya(Wdt));function Opi(t){let e=(t||"internal").toUpperCase();return Npi.SpanKind[e]}a(Opi,"toOpenTelemetrySpanKind");function Wla(t=[]){return t.reduce((e,r)=>{let n=Npi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,Mpi.sanitizeAttributes)(r.attributes)}),e},[])}a(Wla,"toOpenTelemetryLinks");function zla(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,Mpi.sanitizeAttributes)(e),s=Opi(n),c=Wla(r);return{attributes:o,kind:s,links:c}}a(zla,"toSpanOptions")});var Upi=I(uH=>{"use strict";p();Object.defineProperty(uH,"__esModule",{value:!0});uH.OpenTelemetryInstrumenter=uH.propagator=void 0;var O5=(ao(),ya(r5)),Fpi=(zdt(),ya(Wdt)),Yla=Dpi(),Lpi=whr(),Kla=Bpi();uH.propagator=new Fpi.W3CTraceContextPropagator;var Rhr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||O5.context.active(),o;return(0,Lpi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=O5.trace.wrapSpanContext(O5.INVALID_SPAN_CONTEXT):(o=O5.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,Kla.toSpanOptions)(r),n),(0,Lpi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,Fpi.suppressTracing)(n))),{span:new Yla.OpenTelemetrySpanWrapper(o),tracingContext:O5.trace.setSpan(n,o)}}withContext(e,r,...n){return O5.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return uH.propagator.extract(O5.context.active(),{traceparent:e},O5.defaultTextMapGetter)}createRequestHeaders(e){let r={};return uH.propagator.inject(e||O5.context.active(),r,O5.defaultTextMapSetter),r}};uH.OpenTelemetryInstrumenter=Rhr});var qpi=I(ZDe=>{"use strict";p();Object.defineProperty(ZDe,"__esModule",{value:!0});ZDe.AzureSdkInstrumentation=void 0;ZDe.createAzureSdkInstrumentation=Xla;var Qpi=(Kpr(),ya(Ypr)),Jla=Upi(),Zla=whr(),Jdt=class extends Qpi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",Zla.SDK_VERSION,Object.assign({},e))}init(){let e=new Qpi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Jla.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};ZDe.AzureSdkInstrumentation=Jdt;function Xla(t={}){return new Jdt(t)}a(Xla,"createAzureSdkInstrumentation")});var Hpi=I(Zdt=>{"use strict";p();Object.defineProperty(Zdt,"__esModule",{value:!0});var jpi=(bL(),ya(s7));jpi.__exportStar(ihr(),Zdt);jpi.__exportStar(qpi(),Zdt)});var $pi=I(Fw=>{"use strict";p();Object.defineProperty(Fw,"__esModule",{value:!0});Fw.enable=Fw.azureCoreTracing=Fw.AzureMonitorSymbol=void 0;var Phr=fp();Fw.AzureMonitorSymbol="Azure_Monitor_Tracer";var khr="azure-coretracing",Gpi=!1,eua=a(function(t){if(Gpi)return t;try{var e=($ri(),ya(Gri)),r=(ao(),ya(r5)),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 Phr.channel.publish(khr,A),E},A},d[Fw.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[Fw.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 Phr.channel.publish(khr,v),T},v},g[Fw.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(Kpr(),ya(Ypr)),u=Hpi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}Gpi=!0}catch{}return t},"azureCoreTracingPatchFunction");Fw.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:eua,publisherName:khr};function tua(){Phr.channel.registerMonkeyPatch("@azure/core-tracing",Fw.azureCoreTracing)}a(tua,"enable");Fw.enable=tua});var Wpi=I(mX=>{"use strict";p();Object.defineProperty(mX,"__esModule",{value:!0});mX.enable=mX.bunyan=void 0;var Vpi=fp(),rua=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)),Vpi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");mX.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:rua};function nua(){Vpi.channel.registerMonkeyPatch("bunyan",mX.bunyan)}a(nua,"enable");mX.enable=nua});var Ypi=I(gX=>{"use strict";p();Object.defineProperty(gX,"__esModule",{value:!0});gX.enable=gX.console=void 0;var Dhr=fp(),zpi=require("stream"),iua=a(function(t){var e=new zpi.Writable,r=new zpi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return Dhr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return Dhr.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:iua};function oua(){Dhr.channel.registerMonkeyPatch("console",gX.console),require("console")}a(oua,"enable");gX.enable=oua});var Kpi=I(AX=>{"use strict";p();Object.defineProperty(AX,"__esModule",{value:!0});AX.enable=AX.mongoCore=void 0;var Nhr=fp(),sua=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]=Nhr.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]=Nhr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");AX.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:sua};function aua(){Nhr.channel.registerMonkeyPatch("mongodb-core",AX.mongoCore)}a(aua,"enable");AX.enable=aua});var Jpi=I(rv=>{"use strict";p();var xhe=rv&&rv.__assign||function(){return xhe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:cua};rv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:lua};rv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:dua};function fua(){gE.channel.registerMonkeyPatch("mongodb",rv.mongo2),gE.channel.registerMonkeyPatch("mongodb",rv.mongo3),gE.channel.registerMonkeyPatch("mongodb",rv.mongo330)}a(fua,"enable");rv.enable=fua});var Xpi=I(yX=>{"use strict";p();Object.defineProperty(yX,"__esModule",{value:!0});yX.enable=yX.mysql=void 0;var Xdt=fp(),Zpi=require("path"),pua=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]=Xdt.channel.bindToContext(h(_,E))):arguments[A]=Xdt.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(Zpi.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;Xdt.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(Zpi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");yX.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:pua};function hua(){Xdt.channel.registerMonkeyPatch("mysql",yX.mysql)}a(hua,"enable");yX.enable=hua});var thi=I(EX=>{"use strict";p();Object.defineProperty(EX,"__esModule",{value:!0});EX.enable=EX.postgresPool1=void 0;var ehi=fp();function mua(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=ehi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(mua,"postgresPool1PatchFunction");EX.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:mua};function gua(){ehi.channel.registerMonkeyPatch("pg-pool",EX.postgresPool1)}a(gua,"enable");EX.enable=gua});var nhi=I(B5=>{"use strict";p();Object.defineProperty(B5,"__esModule",{value:!0});B5.enable=B5.postgres=B5.postgres6=void 0;var whe=fp(),rhi=require("events"),Mhr="postgres";function Aua(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=whe.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),whe.channel.publish(Mhr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof rhi.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(Aua,"postgres6PatchFunction");function yua(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=whe.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),whe.channel.publish(Mhr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof rhi.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(yua,"postgresLatestPatchFunction");B5.postgres6={versionSpecifier:"6.*",patch:Aua};B5.postgres={versionSpecifier:">=7.* <=8.*",patch:yua,publisherName:Mhr};function Eua(){whe.channel.registerMonkeyPatch("pg",B5.postgres6),whe.channel.registerMonkeyPatch("pg",B5.postgres)}a(Eua,"enable");B5.enable=Eua});var ihi=I(_X=>{"use strict";p();Object.defineProperty(_X,"__esModule",{value:!0});_X.enable=_X.redis=void 0;var Ohr=fp(),_ua=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=Ohr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;Ohr.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");_X.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:_ua};function vua(){Ohr.channel.registerMonkeyPatch("redis",_X.redis)}a(vua,"enable");_X.enable=vua});var ohi=I(qF=>{"use strict";p();var eft=qF&&qF.__assign||function(){return eft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:Cua};function bua(){Bhr.channel.registerMonkeyPatch("tedious",qF.tedious)}a(bua,"enable");qF.enable=bua});var shi=I(vb=>{"use strict";p();var Sua=vb&&vb.__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)}})(),Tua=vb&&vb.__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");vb.winston3={versionSpecifier:"3.x",patch:xua};vb.winston2={versionSpecifier:"2.x",patch:Iua};function wua(){tft.channel.registerMonkeyPatch("winston",vb.winston2),tft.channel.registerMonkeyPatch("winston",vb.winston3)}a(wua,"enable");vb.enable=wua});var yhi=I(Cu=>{"use strict";p();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.enable=Cu.tedious=Cu.pgPool=Cu.pg=Cu.winston=Cu.redis=Cu.mysql=Cu.mongodb=Cu.mongodbCore=Cu.console=Cu.bunyan=Cu.azuresdk=void 0;var ahi=$pi();Cu.azuresdk=ahi;var chi=Wpi();Cu.bunyan=chi;var lhi=Ypi();Cu.console=lhi;var uhi=Kpi();Cu.mongodbCore=uhi;var dhi=Jpi();Cu.mongodb=dhi;var fhi=Xpi();Cu.mysql=fhi;var phi=thi();Cu.pgPool=phi;var hhi=nhi();Cu.pg=hhi;var mhi=ihi();Cu.redis=mhi;var ghi=ohi();Cu.tedious=ghi;var Ahi=shi();Cu.winston=Ahi;function Rua(){chi.enable(),lhi.enable(),uhi.enable(),dhi.enable(),fhi.enable(),hhi.enable(),phi.enable(),mhi.enable(),Ahi.enable(),ahi.enable(),ghi.enable()}a(Rua,"enable");Cu.enable=Rua});var ift=I(vX=>{"use strict";p();Object.defineProperty(vX,"__esModule",{value:!0});vX.IsInitialized=void 0;vX.registerContextPreservation=Pua;var Lhr=jl(),_hi=Aut();vX.IsInitialized=!_hi.JsonConfig.getInstance().noDiagnosticChannel;var Fhr="DiagnosticChannel";if(vX.IsInitialized){v2=yhi(),Ehi=_hi.JsonConfig.getInstance().noPatchModules,rft=Ehi.split(","),Uhr={bunyan:v2.bunyan,console:v2.console,mongodb:v2.mongodb,mongodbCore:v2.mongodbCore,mysql:v2.mysql,redis:v2.redis,pg:v2.pg,pgPool:v2.pgPool,winston:v2.winston,azuresdk:v2.azuresdk};for(nft in Uhr)rft.indexOf(nft)===-1&&(Uhr[nft].enable(),Lhr.info(Fhr,"Subscribed to ".concat(nft," events")));rft.length>0&&Lhr.info(Fhr,"Some modules will not be patched",rft)}else Lhr.info(Fhr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var v2,Ehi,rft,Uhr,nft;function Pua(t){if(vX.IsInitialized){var e=fp();e.channel.addContextPreservation(t)}}a(Pua,"registerContextPreservation")});var Rhe=I((Vzf,vhi)=>{"use strict";p();vhi.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 VA=I((jhr,Chi)=>{"use strict";p();var fH=jhr&&jhr.__assign||function(){return fH=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"){CX.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"){CX.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+")",CX.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 Hhr=VA(),Mua=(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"|"+Hhr.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=Hhr.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=Hhr.randomu32(),t})();bhi.exports=Mua});var oft=I((Xzf,Shi)=>{"use strict";p();var WA=VA(),Oua=bX(),Bua=(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=WA.w3cTraceId(),this.spanId=WA.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=WA.w3cTraceId(),this.spanId=WA.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=WA.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=WA.w3cTraceId(),this.spanId=WA.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=WA.w3cTraceId(),this.spanId=WA.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=WA.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=WA.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=WA.w3cTraceId().substr(0,16),this.traceId=WA.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=Oua.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=WA.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=WA.w3cTraceId(),this.spanId=WA.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=WA.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();Shi.exports=Bua});var Ghr=I((rYf,Thi)=>{"use strict";p();var Lua=(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 Fua=(function(){function t(){}return a(t,"Domain"),t})();Ihi.exports=Fua});var whi=I(($hr,xhi)=>{"use strict";p();var Uua=$hr&&$hr.__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)}})(),Qua=jF(),qua=(function(t){Uua(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(Qua);xhi.exports=qua});var Vhr=I((uYf,Rhi)=>{"use strict";p();var jua=(function(){function t(){}return a(t,"Base"),t})();Rhi.exports=jua});var khi=I((pYf,Phi)=>{"use strict";p();var Hua=(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})();Phi.exports=Hua});var Nhi=I((Whr,Dhi)=>{"use strict";p();var Gua=Whr&&Whr.__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)}})(),$ua=Vhr(),Vua=(function(t){Gua(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})($ua);Dhi.exports=Vua});var Yhr=I((yYf,Mhi)=>{"use strict";p();var zhr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(zhr||(zhr={}));Mhi.exports=zhr});var Bhi=I((_Yf,Ohi)=>{"use strict";p();var Wua=Yhr(),zua=(function(){function t(){this.kind=Wua.Measurement}return a(t,"DataPoint"),t})();Ohi.exports=zua});var Fhi=I((bYf,Lhi)=>{"use strict";p();var Yua=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();Lhi.exports=Yua});var Jhr=I((Khr,Uhi)=>{"use strict";p();var Kua=Khr&&Khr.__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)}})(),Jua=jF(),Zua=(function(t){Kua(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(Jua);Uhi.exports=Zua});var qhi=I((Zhr,Qhi)=>{"use strict";p();var Xua=Zhr&&Zhr.__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)}})(),eda=jF(),tda=(function(t){Xua(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})(eda);Qhi.exports=tda});var Hhi=I((PYf,jhi)=>{"use strict";p();var rda=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();jhi.exports=rda});var $hi=I((Xhr,Ghi)=>{"use strict";p();var nda=Xhr&&Xhr.__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)}})(),ida=jF(),oda=(function(t){nda(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(ida);Ghi.exports=oda});var Whi=I((e0r,Vhi)=>{"use strict";p();var sda=e0r&&e0r.__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)}})(),ada=jF(),cda=(function(t){sda(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(ada);Vhi.exports=cda});var Yhi=I((t0r,zhi)=>{"use strict";p();var lda=t0r&&t0r.__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)}})(),uda=Jhr(),dda=(function(t){lda(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(uda);zhi.exports=dda});var Jhi=I((r0r,Khi)=>{"use strict";p();var fda=r0r&&r0r.__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)}})(),pda=jF(),hda=(function(t){fda(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})(pda);Khi.exports=hda});var Xhi=I((n0r,Zhi)=>{"use strict";p();var mda=n0r&&n0r.__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)}})(),gda=jF(),Ada=(function(t){mda(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(gda);Zhi.exports=Ada});var t0i=I((HYf,e0i)=>{"use strict";p();var i0r;(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"})(i0r||(i0r={}));e0i.exports=i0r});var n0i=I(($Yf,r0i)=>{"use strict";p();var yda=(function(){function t(){}return a(t,"StackFrame"),t})();r0i.exports=yda});var o0r=I(a0=>{"use strict";p();Object.defineProperty(a0,"__esModule",{value:!0});a0.AvailabilityData=whi();a0.Base=Vhr();a0.ContextTagKeys=khi();a0.Data=Nhi();a0.DataPoint=Bhi();a0.DataPointType=Yhr();a0.Domain=jF();a0.Envelope=Fhi();a0.EventData=Jhr();a0.ExceptionData=qhi();a0.ExceptionDetails=Hhi();a0.MessageData=$hi();a0.MetricData=Whi();a0.PageViewData=Yhi();a0.RemoteDependencyData=Jhi();a0.RequestData=Xhi();a0.SeverityLevel=t0i();a0.StackFrame=n0i()});var i0i=I(XDe=>{"use strict";p();Object.defineProperty(XDe,"__esModule",{value:!0});XDe.RemoteDependencyDataConstants=void 0;XDe.domainSupportsProperties=_da;var SX=o0r(),Eda=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();XDe.RemoteDependencyDataConstants=Eda;function _da(t){return"properties"in t||t instanceof SX.EventData||t instanceof SX.ExceptionData||t instanceof SX.MessageData||t instanceof SX.MetricData||t instanceof SX.PageViewData||t instanceof SX.RemoteDependencyData||t instanceof SX.RequestData}a(_da,"domainSupportsProperties")});var s0i=I(o0i=>{"use strict";p();Object.defineProperty(o0i,"__esModule",{value:!0})});var c0i=I(a0i=>{"use strict";p();Object.defineProperty(a0i,"__esModule",{value:!0})});var u0i=I(l0i=>{"use strict";p();Object.defineProperty(l0i,"__esModule",{value:!0})});var f0i=I(d0i=>{"use strict";p();Object.defineProperty(d0i,"__esModule",{value:!0})});var h0i=I(p0i=>{"use strict";p();Object.defineProperty(p0i,"__esModule",{value:!0})});var g0i=I(m0i=>{"use strict";p();Object.defineProperty(m0i,"__esModule",{value:!0})});var y0i=I(A0i=>{"use strict";p();Object.defineProperty(A0i,"__esModule",{value:!0})});var _0i=I(E0i=>{"use strict";p();Object.defineProperty(E0i,"__esModule",{value:!0})});var C0i=I(v0i=>{"use strict";p();Object.defineProperty(v0i,"__esModule",{value:!0})});var S0i=I(b0i=>{"use strict";p();Object.defineProperty(b0i,"__esModule",{value:!0})});var I0i=I(T0i=>{"use strict";p();Object.defineProperty(T0i,"__esModule",{value:!0})});var w0i=I(x0i=>{"use strict";p();Object.defineProperty(x0i,"__esModule",{value:!0})});var R0i=I(pH=>{"use strict";p();Object.defineProperty(pH,"__esModule",{value:!0});pH.TelemetryType=pH.TelemetryTypeString=void 0;pH.telemetryTypeToBaseType=vda;pH.baseTypeToTelemetryType=Cda;function vda(t){switch(t){case Tg.Event:return"EventData";case Tg.Exception:return"ExceptionData";case Tg.Trace:return"MessageData";case Tg.Metric:return"MetricData";case Tg.Request:return"RequestData";case Tg.Dependency:return"RemoteDependencyData";case Tg.Availability:return"AvailabilityData";case Tg.PageView:return"PageViewData"}}a(vda,"telemetryTypeToBaseType");function Cda(t){switch(t){case"EventData":return Tg.Event;case"ExceptionData":return Tg.Exception;case"MessageData":return Tg.Trace;case"MetricData":return Tg.Metric;case"RequestData":return Tg.Request;case"RemoteDependencyData":return Tg.Dependency;case"AvailabilityData":return Tg.Availability;case"PageViewData":return Tg.PageView}}a(Cda,"baseTypeToTelemetryType");pH.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Tg;(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"})(Tg||(pH.TelemetryType=Tg={}))});var P0i=I(cm=>{"use strict";p();var bda=cm&&cm.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ET=cm&&cm.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bda(e,t,r)};Object.defineProperty(cm,"__esModule",{value:!0});ET(s0i(),cm);ET(c0i(),cm);ET(u0i(),cm);ET(f0i(),cm);ET(h0i(),cm);ET(g0i(),cm);ET(y0i(),cm);ET(_0i(),cm);ET(C0i(),cm);ET(S0i(),cm);ET(I0i(),cm);ET(w0i(),cm);ET(R0i(),cm)});var D0i=I(k0i=>{"use strict";p();Object.defineProperty(k0i,"__esModule",{value:!0})});var M0i=I(N0i=>{"use strict";p();Object.defineProperty(N0i,"__esModule",{value:!0})});var B0i=I(O0i=>{"use strict";p();Object.defineProperty(O0i,"__esModule",{value:!0})});var F0i=I(L0i=>{"use strict";p();Object.defineProperty(L0i,"__esModule",{value:!0})});var Q0i=I(U0i=>{"use strict";p();Object.defineProperty(U0i,"__esModule",{value:!0})});var j0i=I(q0i=>{"use strict";p();Object.defineProperty(q0i,"__esModule",{value:!0})});var G0i=I(H0i=>{"use strict";p();Object.defineProperty(H0i,"__esModule",{value:!0})});var V0i=I($0i=>{"use strict";p();Object.defineProperty($0i,"__esModule",{value:!0})});var W0i=I(Cb=>{"use strict";p();var Sda=Cb&&Cb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hH=Cb&&Cb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Sda(e,t,r)};Object.defineProperty(Cb,"__esModule",{value:!0});hH(D0i(),Cb);hH(M0i(),Cb);hH(B0i(),Cb);hH(F0i(),Cb);hH(Q0i(),Cb);hH(j0i(),Cb);hH(G0i(),Cb);hH(V0i(),Cb)});var AE=I(L5=>{"use strict";p();var Tda=L5&&L5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sft=L5&&L5.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tda(e,t,r)};Object.defineProperty(L5,"__esModule",{value:!0});sft(i0i(),L5);sft(o0r(),L5);sft(P0i(),L5);sft(W0i(),L5)});var s0r=I((JKf,z0i)=>{"use strict";p();var Ida=(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 C2;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 zA;(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"})(zA||(jr.QuickPulseCounter=zA={}));var eNe;(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"})(eNe||(jr.PerformanceCounter=eNe={}));var Y0i;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(Y0i||(jr.MetricId=Y0i={}));jr.PerformanceToQuickPulseCounter=(C2={},C2[eNe.PROCESSOR_TIME]=zA.PROCESSOR_TIME,C2[eNe.REQUEST_RATE]=zA.REQUEST_RATE,C2[eNe.REQUEST_DURATION]=zA.REQUEST_DURATION,C2[zA.COMMITTED_BYTES]=zA.COMMITTED_BYTES,C2[zA.REQUEST_FAILURE_RATE]=zA.REQUEST_FAILURE_RATE,C2[zA.DEPENDENCY_RATE]=zA.DEPENDENCY_RATE,C2[zA.DEPENDENCY_FAILURE_RATE]=zA.DEPENDENCY_FAILURE_RATE,C2[zA.DEPENDENCY_DURATION]=zA.DEPENDENCY_DURATION,C2[zA.EXCEPTION_RATE]=zA.EXCEPTION_RATE,C2);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 K0i;(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"})(K0i||(jr.StatsbeatFeature=K0i={}));var J0i;(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"})(J0i||(jr.StatsbeatInstrumentation=J0i={}));var Z0i;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(Z0i||(jr.StatsbeatFeatureType=Z0i={}));var X0i;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(X0i||(jr.StatsbeatNetworkCategory=X0i={}));var emi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(emi||(jr.HttpRequestCookieNames=emi={}));var tmi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(tmi||(jr.AttachTypePrefix=tmi={}));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 u0r=I((l0r,rmi)=>{"use strict";p();var xda=l0r&&l0r.__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)}})(),aft=require("url"),wda=AE(),a0r=VA(),_T=Rhe(),Rda=s0r(),mH=bX(),Pda=Ghr(),c0r=oft(),kda=jl(),cft=ad(),Dda=(function(t){xda(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 aft.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(cft.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(cft.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(cft.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 aft.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 aft.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=aft.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===cft.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",kda.warn("Could not decode the auth cookie with error: ",a0r.dumpObj(s))}var o=e.parseId(a0r.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=a0r.getCorrelationContextTarget(r,_T.requestContextSourceKey),r.headers){var o=r.headers[_T.traceStateHeader]?r.headers[_T.traceStateHeader].toString():null,s=r.headers[_T.traceparentHeader]?r.headers[_T.traceparentHeader].toString():null,c=r.headers[_T.requestIdHeader]?r.headers[_T.requestIdHeader].toString():null,l=r.headers[_T.parentIdHeader]?r.headers[_T.parentIdHeader].toString():null,u=r.headers[_T.rootIdHeader]?r.headers[_T.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[_T.correlationContextHeader]?r.headers[_T.correlationContextHeader].toString():null,mH.w3cEnabled&&(s||o)?(this.traceparent=new c0r(s?s.toString():null),this.tracestate=s&&o&&new Pda(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?mH.w3cEnabled?(this.traceparent=new c0r(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=mH.generateRequestId(this.parentId),this.operationId=mH.getRootId(this.requestId)):mH.w3cEnabled?(this.traceparent=new c0r,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=mH.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=mH.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=mH.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new wda.ContextTagKeys,e})(Rda);rmi.exports=Dda});var Emi=I((yo,ymi)=>{p();yo=ymi.exports=Pa;var ol;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?ol=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):ol=a(function(){},"debug");yo.SEMVER_SPEC_VERSION="2.0.0";var tNe=256,lft=Number.MAX_SAFE_INTEGER||9007199254740991,d0r=16,Nda=tNe-6,rNe=yo.re=[],bu=yo.safeRe=[],er=yo.src=[],ua=0,g0r="[a-zA-Z0-9-]",f0r=[["\\s",1],["\\d",tNe],[g0r,Nda]];function mft(t){for(var e=0;e)?=?)";var uft=ua++;er[uft]=er[Dhe]+"|x|X|\\*";var dft=ua++;er[dft]=er[khe]+"|x|X|\\*";var TX=ua++;er[TX]="[v=\\s]*("+er[dft]+")(?:\\.("+er[dft]+")(?:\\.("+er[dft]+")(?:"+er[y0r]+")?"+er[iNe]+"?)?)?";var Mhe=ua++;er[Mhe]="[v=\\s]*("+er[uft]+")(?:\\.("+er[uft]+")(?:\\.("+er[uft]+")(?:"+er[E0r]+")?"+er[iNe]+"?)?)?";var ami=ua++;er[ami]="^"+er[Lhe]+"\\s*"+er[TX]+"$";var cmi=ua++;er[cmi]="^"+er[Lhe]+"\\s*"+er[Mhe]+"$";var lmi=ua++;er[lmi]="(?:^|[^\\d])(\\d{1,"+d0r+"})(?:\\.(\\d{1,"+d0r+"}))?(?:\\.(\\d{1,"+d0r+"}))?(?:$|[^\\d])";var gft=ua++;er[gft]="(?:~>?)";var Ohe=ua++;er[Ohe]="(\\s*)"+er[gft]+"\\s+";rNe[Ohe]=new RegExp(er[Ohe],"g");bu[Ohe]=new RegExp(mft(er[Ohe]),"g");var Mda="$1~",umi=ua++;er[umi]="^"+er[gft]+er[TX]+"$";var dmi=ua++;er[dmi]="^"+er[gft]+er[Mhe]+"$";var Aft=ua++;er[Aft]="(?:\\^)";var Bhe=ua++;er[Bhe]="(\\s*)"+er[Aft]+"\\s+";rNe[Bhe]=new RegExp(er[Bhe],"g");bu[Bhe]=new RegExp(mft(er[Bhe]),"g");var Oda="$1^",fmi=ua++;er[fmi]="^"+er[Aft]+er[TX]+"$";var pmi=ua++;er[pmi]="^"+er[Aft]+er[Mhe]+"$";var b0r=ua++;er[b0r]="^"+er[Lhe]+"\\s*("+v0r+")$|^$";var S0r=ua++;er[S0r]="^"+er[Lhe]+"\\s*("+smi+")$|^$";var IX=ua++;er[IX]="(\\s*)"+er[Lhe]+"\\s*("+v0r+"|"+er[TX]+")";rNe[IX]=new RegExp(er[IX],"g");bu[IX]=new RegExp(mft(er[IX]),"g");var Bda="$1$2$3",hmi=ua++;er[hmi]="^\\s*("+er[TX]+")\\s+-\\s+("+er[TX]+")\\s*$";var mmi=ua++;er[mmi]="^\\s*("+er[Mhe]+")\\s+-\\s+("+er[Mhe]+")\\s*$";var gmi=ua++;er[gmi]="(<|>)?=?\\s*\\*";for(F5=0;F5tNe)return null;var r=e.loose?bu[C0r]:bu[_0r];if(!r.test(t))return null;try{return new Pa(t,e)}catch{return null}}a(xX,"parse");yo.valid=Lda;function Lda(t,e){var r=xX(t,e);return r?r.version:null}a(Lda,"valid");yo.clean=Fda;function Fda(t,e){var r=xX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Fda,"clean");yo.SemVer=Pa;function Pa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Pa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>tNe)throw new TypeError("version is longer than "+tNe+" characters");if(!(this instanceof Pa))return new Pa(t,e);ol("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?bu[C0r]:bu[_0r]);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>lft||this.major<0)throw new TypeError("Invalid major version");if(this.minor>lft||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>lft||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=Uda;function Uda(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Pa(t,r).inc(e,n).version}catch{return null}}a(Uda,"inc");yo.diff=Qda;function Qda(t,e){if(T0r(t,e))return null;var r=xX(t),n=xX(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(Qda,"diff");yo.compareIdentifiers=Nhe;var nmi=/^[0-9]+$/;function Nhe(t,e){var r=nmi.test(t),n=nmi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(nNe,"gt");yo.lt=fft;function fft(t,e,r){return HF(t,e,r)<0}a(fft,"lt");yo.eq=T0r;function T0r(t,e,r){return HF(t,e,r)===0}a(T0r,"eq");yo.neq=Ami;function Ami(t,e,r){return HF(t,e,r)!==0}a(Ami,"neq");yo.gte=I0r;function I0r(t,e,r){return HF(t,e,r)>=0}a(I0r,"gte");yo.lte=x0r;function x0r(t,e,r){return HF(t,e,r)<=0}a(x0r,"lte");yo.cmp=pft;function pft(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 T0r(t,r,n);case"!=":return Ami(t,r,n);case">":return nNe(t,r,n);case">=":return I0r(t,r,n);case"<":return fft(t,r,n);case"<=":return x0r(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(pft,"cmp");yo.Comparator=Uw;function Uw(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Uw){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof Uw))return new Uw(t,e);t=t.trim().split(/\s+/).join(" "),ol("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===oNe?this.value="":this.value=this.operator+this.semver.version,ol("comp",this)}a(Uw,"Comparator");var oNe={};Uw.prototype.parse=function(t){var e=this.options.loose?bu[b0r]:bu[S0r],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 Pa(r[2],this.options.loose):this.semver=oNe};Uw.prototype.toString=function(){return this.value};Uw.prototype.test=function(t){return ol("Comparator.test",t,this.options.loose),this.semver===oNe?!0:(typeof t=="string"&&(t=new Pa(t,this.options)),pft(t,this.operator,this.semver,this.options))};Uw.prototype.intersects=function(t,e){if(!(t instanceof Uw))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Ef(t.value,e),hft(this.value,r,e);if(t.operator==="")return r=new Ef(this.value,e),hft(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=pft(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=pft(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};yo.Range=Ef;function Ef(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ef)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Ef(t.raw,e);if(t instanceof Uw)return new Ef(t.value,e);if(!(this instanceof Ef))return new Ef(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(Ef,"Range");Ef.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Ef.prototype.toString=function(){return this.range};Ef.prototype.parseRange=function(t){var e=this.options.loose,r=e?bu[mmi]:bu[hmi];t=t.replace(r,ifa),ol("hyphen replace",t),t=t.replace(bu[IX],Bda),ol("comparator trim",t,bu[IX]),t=t.replace(bu[Ohe],Mda),t=t.replace(bu[Bhe],Oda);var n=e?bu[b0r]:bu[S0r],o=t.split(" ").map(function(s){return Kda(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 Uw(s,this.options)},this),o};Ef.prototype.intersects=function(t,e){if(!(t instanceof Ef))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=Yda;function Yda(t,e){return new Ef(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Yda,"toComparators");function Kda(t,e){return ol("comp",t,e),t=Xda(t,e),ol("caret",t),t=Jda(t,e),ol("tildes",t),t=tfa(t,e),ol("xrange",t),t=nfa(t,e),ol("stars",t),t}a(Kda,"parseComparator");function nv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(nv,"isX");function Jda(t,e){return t.trim().split(/\s+/).map(function(r){return Zda(r,e)}).join(" ")}a(Jda,"replaceTildes");function Zda(t,e){var r=e.loose?bu[dmi]:bu[umi];return t.replace(r,function(n,o,s,c,l){ol("tilde",t,n,o,s,c,l);var u;return nv(o)?u="":nv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":nv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(ol("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",ol("tilde return",u),u})}a(Zda,"replaceTilde");function Xda(t,e){return t.trim().split(/\s+/).map(function(r){return efa(r,e)}).join(" ")}a(Xda,"replaceCarets");function efa(t,e){ol("caret",t,e);var r=e.loose?bu[pmi]:bu[fmi];return t.replace(r,function(n,o,s,c,l){ol("caret",t,n,o,s,c,l);var u;return nv(o)?u="":nv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":nv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(ol("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"):(ol("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"),ol("caret return",u),u})}a(efa,"replaceCaret");function tfa(t,e){return ol("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return rfa(r,e)}).join(" ")}a(tfa,"replaceXRanges");function rfa(t,e){t=t.trim();var r=e.loose?bu[cmi]:bu[ami];return t.replace(r,function(n,o,s,c,l,u){ol("xRange",t,n,o,s,c,l,u);var d=nv(s),f=d||nv(c),h=f||nv(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"),ol("xRange return",n),n})}a(rfa,"replaceXRange");function nfa(t,e){return ol("replaceStars",t,e),t.trim().replace(bu[gmi],"")}a(nfa,"replaceStars");function ifa(t,e,r,n,o,s,c,l,u,d,f,h,m){return nv(r)?e="":nv(n)?e=">="+r+".0.0":nv(o)?e=">="+r+"."+n+".0":e=">="+e,nv(u)?l="":nv(d)?l="<"+(+u+1)+".0.0":nv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(ifa,"hyphenReplace");Ef.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Pa(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(ofa,"testSet");yo.satisfies=hft;function hft(t,e,r){try{e=new Ef(e,r)}catch{return!1}return e.test(t)}a(hft,"satisfies");yo.maxSatisfying=sfa;function sfa(t,e,r){var n=null,o=null;try{var s=new Ef(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Pa(n,r))}),n}a(sfa,"maxSatisfying");yo.minSatisfying=afa;function afa(t,e,r){var n=null,o=null;try{var s=new Ef(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Pa(n,r))}),n}a(afa,"minSatisfying");yo.minVersion=cfa;function cfa(t,e){t=new Ef(t,e);var r=new Pa("0.0.0");if(t.test(r)||(r=new Pa("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||nNe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(cfa,"minVersion");yo.validRange=lfa;function lfa(t,e){try{return new Ef(t,e).range||"*"}catch{return null}}a(lfa,"validRange");yo.ltr=ufa;function ufa(t,e,r){return w0r(t,e,"<",r)}a(ufa,"ltr");yo.gtr=dfa;function dfa(t,e,r){return w0r(t,e,">",r)}a(dfa,"gtr");yo.outside=w0r;function w0r(t,e,r,n){t=new Pa(t,n),e=new Ef(e,n);var o,s,c,l,u;switch(r){case">":o=nNe,s=x0r,c=fft,l=">",u=">=";break;case"<":o=fft,s=I0r,c=nNe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(hft(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(w0r,"outside");yo.prerelease=ffa;function ffa(t,e){var r=xX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(ffa,"prerelease");yo.intersects=pfa;function pfa(t,e,r){return t=new Ef(t,r),e=new Ef(e,r),t.intersects(e)}a(pfa,"intersects");yo.coerce=hfa;function hfa(t){if(t instanceof Pa)return t;if(typeof t!="string")return null;var e=t.match(bu[lmi]);return e==null?null:xX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(hfa,"coerce")});var _ft=I((sJf,bmi)=>{"use strict";p();var vmi=ghe(),Fhe=vmi.wrap,yft=vmi.unwrap,GF="wrap@before";function Eft(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(Eft,"defineProperty");function mfa(t,e){for(var r=e.length,n=0;n0&&mfa(t,o)}a(gfa,"_findAndProcess");function _mi(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 xc=require("util"),$F=require("assert"),Afa=_ft(),cd=require("async_hooks"),sNe="cls@contexts",aNe="error@context",_f=process.env.DEBUG_CLS_HOOKED,Ic=-1;Imi.exports={getNamespace:Smi,createNamespace:yfa,destroyNamespace:Tmi,reset:Efa,ERROR_SYMBOL:aNe};function Qw(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(Qw,"Namespace");Qw.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,_f){let n=" ".repeat(this._indent<0?0:this._indent);Fd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+Ic+" active:"+xc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");Qw.prototype.get=a(function(e){if(!this.active){if(_f){let r=cd.currentId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${Ic} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+Ic+" active:"+xc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),Fd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${Ic} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${xc.inspect(this.active)}`)}return this.active[e]},"get");Qw.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=Ic,_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${Ic} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${xc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");Qw.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(_f){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Fd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${Ic} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${xc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[aNe]=r),n}finally{if(_f){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Fd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${Ic} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${xc.inspect(r)}`)}this.exit(r)}},"run");Qw.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");Qw.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 _f&&Fd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+Ic+" len:"+this._set.length+" "+xc.inspect(r)),n.then(o=>(_f&&Fd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+Ic+" len:"+this._set.length+" "+xc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[aNe]=r,_f&&Fd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+Ic+" len:"+this._set.length+" "+xc.inspect(r)),this.exit(r),o})},"runPromise");Qw.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[aNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");Qw.prototype.enter=a(function(e){if($F.ok(e,"context must be provided for entering"),_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${Ic} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${xc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");Qw.prototype.exit=a(function(e){if($F.ok(e,"context must be provided for exiting"),_f){let n=cd.executionAsyncId(),o=cd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Fd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${Ic} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${xc.inspect(e)}`)}if(this.active===e){$F.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(_f&&Fd("??ERROR?? context exiting but not entered - ignoring: "+xc.inspect(e)),$F.ok(r>=0,`context not currently entered; can't exit. +`+xc.inspect(this)+` +`+xc.inspect(e))):($F.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");Qw.prototype.bindEmitter=a(function(e){$F.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[sNe]||(c[sNe]=Object.create(null)),c[sNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[sNe]))return c;let l=c,u=c[sNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Afa(e,o,s)},"bindEmitter");Qw.prototype.fromException=a(function(e){return e[aNe]},"fromException");function Smi(t){return process.namespaces[t]}a(Smi,"getNamespace");function yfa(t){$F.ok(t,"namespace must be given a name."),_f&&Fd(`NS-CREATING NAMESPACE (${t})`);let e=new Qw(t);return e.id=Ic,cd.createHook({init(n,o,s,c){if(Ic=cd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),_f){let l=" ".repeat(e._indent<0?0:e._indent);Fd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(Ic===0){let l=cd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),_f){let d=" ".repeat(e._indent<0?0:e._indent);Fd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${Ic} triggerId:${l} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(_f){let d=" ".repeat(e._indent<0?0:e._indent);Fd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${Ic} triggerId:${l} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(_f&&o==="PROMISE"){Fd(xc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);Fd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){Ic=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(Ic),o){if(_f){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(_f){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${xc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){Ic=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(Ic),o){if(_f){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}AFTER (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(o)}`)}e.exit(o)}else if(_f){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(o)}`)}},destroy(n){if(Ic=cd.executionAsyncId(),_f){let o=cd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);Fd(`${s}DESTROY (${t}) currentUid:${Ic} asyncId:${n} triggerId:${o} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(e._contexts.get(Ic))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(yfa,"createNamespace");function Tmi(t){let e=Smi(t);$F.ok(e,`can't delete nonexistent namespace! "`+t+'"'),$F.ok(e.id,"don't assign to process.namespaces directly! "+xc.inspect(e)),process.namespaces[t]=null}a(Tmi,"destroyNamespace");function Efa(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Tmi(t)}),process.namespaces=Object.create(null)}a(Efa,"reset");process.namespaces={};function Fd(...t){_f&&process._rawDebug(`${xc.format(...t)}`)}a(Fd,"debug2")});var Rmi=I((fJf,wmi)=>{"use strict";p();function _fa(){}a(_fa,"NextTickWrap");wmi.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 kmi=I((mJf,Pmi)=>{"use strict";p();function vfa(){}a(vfa,"PromiseWrap");Pmi.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 vfa,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 Nmi=I((yJf,Dmi)=>{"use strict";p();var vT=require("timers");function Cfa(){}a(Cfa,"TimeoutWrap");function bfa(){}a(bfa,"IntervalWrap");function Sfa(){}a(Sfa,"ImmediateWrap");var Tfa=new Map,Ifa=new Map,xfa=new Map,R0r=null,P0r=!1;Dmi.exports=a(function(){k0r(this._hooks,this._state,"setTimeout","clearTimeout",Cfa,Tfa,!0),k0r(this._hooks,this._state,"setInterval","clearInterval",bfa,Ifa,!1),k0r(this._hooks,this._state,"setImmediate","clearImmediate",Sfa,xfa,!0),global.setTimeout=vT.setTimeout,global.setInterval=vT.setInterval,global.setImmediate=vT.setImmediate,global.clearTimeout=vT.clearTimeout,global.clearInterval=vT.clearInterval,global.clearImmediate=vT.clearImmediate},"patch");function k0r(t,e,r,n,o,s,c){let l=vT[r],u=vT[n];vT[r]=function(){if(!e.enabled)return l.apply(vT,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),R0r=null,(c||P0r)&&(P0r=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(vT,d),s.set(g,m),g},vT[n]=function(d){if(R0r===d&&d!==null)P0r=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(vT,arguments)}}a(k0r,"patchTimer")});var D0r=I((vJf,wfa)=>{wfa.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 Bmi=I((CJf,Omi)=>{"use strict";p();var lNe=process.binding("async_wrap"),Rfa=lNe.Providers.TIMERWRAP,Mmi={nextTick:Rmi(),promise:kmi(),timers:Nmi()},cNe=new Set;function Pfa(){this.enabled=!1,this.counter=0}a(Pfa,"State");function N0r(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===Rfa){cNe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!cNe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!cNe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(cNe.has(o)){cNe.delete(o);return}for(let s of n)s(o)}}a(N0r,"Hooks");N0r.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 vft(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(vft,"removeElement");N0r.prototype.remove=function(t){t.init&&vft(this.initFns,t.init),t.pre&&vft(this.preFns,t.pre),t.post&&vft(this.postFns,t.post),t.destroy&&vft(this.destroyFns,t.destroy)};function uNe(){this._state=new Pfa,this._hooks=new N0r,this.version=D0r().version,this.providers=lNe.Providers;for(let t of Object.keys(Mmi))Mmi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),lNe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(uNe,"AsyncHook");Omi.exports=uNe;uNe.prototype.addHooks=function(t){this._hooks.add(t)};uNe.prototype.removeHooks=function(t){this._hooks.remove(t)};uNe.prototype.enable=function(){this._state.enabled=!0,lNe.enable()};uNe.prototype.disable=function(){this._state.enabled=!1,lNe.disable()}});var M0r=I((TJf,kfa)=>{kfa.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 Fmi=I((IJf,Lmi)=>{p();function Dfa(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(Dfa,"FormatErrorString");Lmi.exports=a(function(e,r){var n=[];n.push(Dfa(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` +`)},"FormatStackTrace")});var jmi=I((RJf,qmi)=>{p();var Cft=Fmi();function Qmi(){this.extend=new dNe,this.filter=new dNe,this.format=new fNe,this.version=M0r().version}a(Qmi,"stackChain");var B0r=!1;Qmi.prototype.callSite=a(function t(e){e||(e={}),B0r=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return B0r=!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 gH=new Qmi;function dNe(){this._modifiers=[]}a(dNe,"TraceModifier");dNe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===M0r().version)L0r.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else L0r.exports=global._stackChain=jmi()});var Hmi=I((MJf,U0r)=>{"use strict";p();var Mfa=Bmi();if(global._asyncHook)if(global._asyncHook.version===D0r().version)U0r.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else F0r().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),U0r.exports=global._asyncHook=new Mfa});var Ymi=I((BJf,zmi)=>{"use strict";p();var nh=require("util"),VF=require("assert"),Ofa=_ft(),Uhe=Hmi(),pNe="cls@contexts",hNe="error@context",$mi=[];for(let t in Uhe.providers)$mi[Uhe.providers[t]]=t;var pp=process.env.DEBUG_CLS_HOOKED,c0=-1;zmi.exports={getNamespace:Vmi,createNamespace:Bfa,destroyNamespace:Wmi,reset:Lfa,ERROR_SYMBOL:hNe};function qw(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(qw,"Namespace");qw.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 pp&&rh(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+c0+" active:"+nh.inspect(this.active,!0)),this.active[e]=r,r},"set");qw.prototype.get=a(function(e){if(!this.active){pp&&rh(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+c0+" active:"+nh.inspect(this.active,!0));return}return pp&&rh(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+c0+" active:"+nh.inspect(this.active,!0)),this.active[e]},"get");qw.prototype.createContext=a(function(){pp&&rh(" CREATING Context: "+this.name+" uid:"+c0+" len:"+this._set.length+" active:"+nh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=c0,pp&&rh(" CREATED Context: "+this.name+" uid:"+c0+" len:"+this._set.length+" context:"+nh.inspect(e,!0,2,!0)),e},"createContext");qw.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return pp&&rh(" BEFORE RUN: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+nh.inspect(r)),e(r),r}catch(n){throw n&&(n[hNe]=r),n}finally{pp&&rh(" AFTER RUN: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+nh.inspect(r)),this.exit(r)}},"run");qw.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");qw.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 pp&&rh(" BEFORE runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+nh.inspect(r)),n.then(o=>(pp&&rh(" AFTER runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+nh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[hNe]=r,pp&&rh(" AFTER runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+nh.inspect(r)),this.exit(r),o})},"runPromise");qw.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[hNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");qw.prototype.enter=a(function(e){VF.ok(e,"context must be provided for entering"),pp&&rh(" ENTER "+this.name+" uid:"+c0+" len:"+this._set.length+" context: "+nh.inspect(e)),this._set.push(this.active),this.active=e},"enter");qw.prototype.exit=a(function(e){if(VF.ok(e,"context must be provided for exiting"),pp&&rh(" EXIT "+this.name+" uid:"+c0+" len:"+this._set.length+" context: "+nh.inspect(e)),this.active===e){VF.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(pp&&rh("??ERROR?? context exiting but not entered - ignoring: "+nh.inspect(e)),VF.ok(r>=0,`context not currently entered; can't exit. +`+nh.inspect(this)+` +`+nh.inspect(e))):(VF.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");qw.prototype.bindEmitter=a(function(e){VF.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[pNe]||(c[pNe]=Object.create(null)),c[pNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[pNe]))return c;let l=c,u=c[pNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Ofa(e,o,s)},"bindEmitter");qw.prototype.fromException=a(function(e){return e[hNe]},"fromException");function Vmi(t){return process.namespaces[t]}a(Vmi,"getNamespace");function Bfa(t){VF.ok(t,"namespace must be given a name."),pp&&rh("CREATING NAMESPACE "+t);let e=new qw(t);return e.id=c0,Uhe.addHooks({init(r,n,o,s,c){c0=r,s?(e._contexts.set(r,e._contexts.get(s)),pp&&rh("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(c0,e.active),pp&&rh("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+$mi[o]+" active:"+nh.inspect(e.active,!0))},pre(r,n){c0=r;let o=e._contexts.get(r);o?(pp&&rh(" PRE "+t+" uid:"+r+" handle:"+bft(n)+" context:"+nh.inspect(o)),e.enter(o)):pp&&rh(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+bft(n))},post(r,n){c0=r;let o=e._contexts.get(r);o?(pp&&rh(" POST "+t+" uid:"+r+" handle:"+bft(n)+" context:"+nh.inspect(o)),e.exit(o)):pp&&rh(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+bft(n))},destroy(r){c0=r,pp&&rh("DESTROY "+t+" uid:"+r+" context:"+nh.inspect(e._contexts.get(c0))+" active:"+nh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(Bfa,"createNamespace");function Wmi(t){let e=Vmi(t);VF.ok(e,`can't delete nonexistent namespace! "`+t+'"'),VF.ok(e.id,"don't assign to process.namespaces directly! "+nh.inspect(e)),process.namespaces[t]=null}a(Wmi,"destroyNamespace");function Lfa(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Wmi(t)}),process.namespaces=Object.create(null)}a(Lfa,"reset");process.namespaces={};Uhe._state&&!Uhe._state.enabled&&Uhe.enable();function rh(t){process.env.DEBUG&&process._rawDebug(t)}a(rh,"debug2");function bft(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(bft,"getFunctionName");if(pp){Q0r=F0r();for(Gmi in Q0r.filter._modifiers)Q0r.filter.deattach(Gmi)}var Q0r,Gmi});var Kmi=I((UJf,q0r)=>{"use strict";p();var Ffa=Emi();process&&Ffa.gte(process.versions.node,"8.0.0")?q0r.exports=xmi():q0r.exports=Ymi()});var pgi=I((Eo,fgi)=>{p();Eo=fgi.exports=ka;var sl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?sl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):sl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var mNe=256,Sft=Number.MAX_SAFE_INTEGER||9007199254740991,j0r=16,Ufa=mNe-6,gNe=Eo.re=[],Su=Eo.safeRe=[],tr=Eo.src=[],da=0,W0r="[a-zA-Z0-9-]",H0r=[["\\s",1],["\\d",mNe],[W0r,Ufa]];function Pft(t){for(var e=0;e)?=?)";var Tft=da++;tr[Tft]=tr[qhe]+"|x|X|\\*";var Ift=da++;tr[Ift]=tr[Qhe]+"|x|X|\\*";var wX=da++;tr[wX]="[v=\\s]*("+tr[Ift]+")(?:\\.("+tr[Ift]+")(?:\\.("+tr[Ift]+")(?:"+tr[Y0r]+")?"+tr[yNe]+"?)?)?";var Hhe=da++;tr[Hhe]="[v=\\s]*("+tr[Tft]+")(?:\\.("+tr[Tft]+")(?:\\.("+tr[Tft]+")(?:"+tr[K0r]+")?"+tr[yNe]+"?)?)?";var tgi=da++;tr[tgi]="^"+tr[Vhe]+"\\s*"+tr[wX]+"$";var rgi=da++;tr[rgi]="^"+tr[Vhe]+"\\s*"+tr[Hhe]+"$";var ngi=da++;tr[ngi]="(?:^|[^\\d])(\\d{1,"+j0r+"})(?:\\.(\\d{1,"+j0r+"}))?(?:\\.(\\d{1,"+j0r+"}))?(?:$|[^\\d])";var kft=da++;tr[kft]="(?:~>?)";var Ghe=da++;tr[Ghe]="(\\s*)"+tr[kft]+"\\s+";gNe[Ghe]=new RegExp(tr[Ghe],"g");Su[Ghe]=new RegExp(Pft(tr[Ghe]),"g");var Qfa="$1~",igi=da++;tr[igi]="^"+tr[kft]+tr[wX]+"$";var ogi=da++;tr[ogi]="^"+tr[kft]+tr[Hhe]+"$";var Dft=da++;tr[Dft]="(?:\\^)";var $he=da++;tr[$he]="(\\s*)"+tr[Dft]+"\\s+";gNe[$he]=new RegExp(tr[$he],"g");Su[$he]=new RegExp(Pft(tr[$he]),"g");var qfa="$1^",sgi=da++;tr[sgi]="^"+tr[Dft]+tr[wX]+"$";var agi=da++;tr[agi]="^"+tr[Dft]+tr[Hhe]+"$";var emr=da++;tr[emr]="^"+tr[Vhe]+"\\s*("+Z0r+")$|^$";var tmr=da++;tr[tmr]="^"+tr[Vhe]+"\\s*("+egi+")$|^$";var RX=da++;tr[RX]="(\\s*)"+tr[Vhe]+"\\s*("+Z0r+"|"+tr[wX]+")";gNe[RX]=new RegExp(tr[RX],"g");Su[RX]=new RegExp(Pft(tr[RX]),"g");var jfa="$1$2$3",cgi=da++;tr[cgi]="^\\s*("+tr[wX]+")\\s+-\\s+("+tr[wX]+")\\s*$";var lgi=da++;tr[lgi]="^\\s*("+tr[Hhe]+")\\s+-\\s+("+tr[Hhe]+")\\s*$";var ugi=da++;tr[ugi]="(<|>)?=?\\s*\\*";for(U5=0;U5mNe)return null;var r=e.loose?Su[X0r]:Su[J0r];if(!r.test(t))return null;try{return new ka(t,e)}catch{return null}}a(PX,"parse");Eo.valid=Hfa;function Hfa(t,e){var r=PX(t,e);return r?r.version:null}a(Hfa,"valid");Eo.clean=Gfa;function Gfa(t,e){var r=PX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Gfa,"clean");Eo.SemVer=ka;function ka(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof ka){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>mNe)throw new TypeError("version is longer than "+mNe+" characters");if(!(this instanceof ka))return new ka(t,e);sl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Su[X0r]:Su[J0r]);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>Sft||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Sft||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Sft||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=$fa;function $fa(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new ka(t,r).inc(e,n).version}catch{return null}}a($fa,"inc");Eo.diff=Vfa;function Vfa(t,e){if(rmr(t,e))return null;var r=PX(t),n=PX(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(Vfa,"diff");Eo.compareIdentifiers=jhe;var Jmi=/^[0-9]+$/;function jhe(t,e){var r=Jmi.test(t),n=Jmi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(ANe,"gt");Eo.lt=xft;function xft(t,e,r){return WF(t,e,r)<0}a(xft,"lt");Eo.eq=rmr;function rmr(t,e,r){return WF(t,e,r)===0}a(rmr,"eq");Eo.neq=dgi;function dgi(t,e,r){return WF(t,e,r)!==0}a(dgi,"neq");Eo.gte=nmr;function nmr(t,e,r){return WF(t,e,r)>=0}a(nmr,"gte");Eo.lte=imr;function imr(t,e,r){return WF(t,e,r)<=0}a(imr,"lte");Eo.cmp=wft;function wft(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 rmr(t,r,n);case"!=":return dgi(t,r,n);case">":return ANe(t,r,n);case">=":return nmr(t,r,n);case"<":return xft(t,r,n);case"<=":return imr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(wft,"cmp");Eo.Comparator=jw;function jw(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof jw){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof jw))return new jw(t,e);t=t.trim().split(/\s+/).join(" "),sl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===ENe?this.value="":this.value=this.operator+this.semver.version,sl("comp",this)}a(jw,"Comparator");var ENe={};jw.prototype.parse=function(t){var e=this.options.loose?Su[emr]:Su[tmr],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 ka(r[2],this.options.loose):this.semver=ENe};jw.prototype.toString=function(){return this.value};jw.prototype.test=function(t){return sl("Comparator.test",t,this.options.loose),this.semver===ENe?!0:(typeof t=="string"&&(t=new ka(t,this.options)),wft(t,this.operator,this.semver,this.options))};jw.prototype.intersects=function(t,e){if(!(t instanceof jw))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new vf(t.value,e),Rft(this.value,r,e);if(t.operator==="")return r=new vf(this.value,e),Rft(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=wft(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=wft(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=vf;function vf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof vf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new vf(t.raw,e);if(t instanceof jw)return new vf(t.value,e);if(!(this instanceof vf))return new vf(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(vf,"Range");vf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};vf.prototype.toString=function(){return this.range};vf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Su[lgi]:Su[cgi];t=t.replace(r,upa),sl("hyphen replace",t),t=t.replace(Su[RX],jfa),sl("comparator trim",t,Su[RX]),t=t.replace(Su[Ghe],Qfa),t=t.replace(Su[$he],qfa);var n=e?Su[emr]:Su[tmr],o=t.split(" ").map(function(s){return rpa(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 jw(s,this.options)},this),o};vf.prototype.intersects=function(t,e){if(!(t instanceof vf))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=tpa;function tpa(t,e){return new vf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(tpa,"toComparators");function rpa(t,e){return sl("comp",t,e),t=opa(t,e),sl("caret",t),t=npa(t,e),sl("tildes",t),t=apa(t,e),sl("xrange",t),t=lpa(t,e),sl("stars",t),t}a(rpa,"parseComparator");function iv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(iv,"isX");function npa(t,e){return t.trim().split(/\s+/).map(function(r){return ipa(r,e)}).join(" ")}a(npa,"replaceTildes");function ipa(t,e){var r=e.loose?Su[ogi]:Su[igi];return t.replace(r,function(n,o,s,c,l){sl("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?(sl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",sl("tilde return",u),u})}a(ipa,"replaceTilde");function opa(t,e){return t.trim().split(/\s+/).map(function(r){return spa(r,e)}).join(" ")}a(opa,"replaceCarets");function spa(t,e){sl("caret",t,e);var r=e.loose?Su[agi]:Su[sgi];return t.replace(r,function(n,o,s,c,l){sl("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?(sl("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"):(sl("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"),sl("caret return",u),u})}a(spa,"replaceCaret");function apa(t,e){return sl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return cpa(r,e)}).join(" ")}a(apa,"replaceXRanges");function cpa(t,e){t=t.trim();var r=e.loose?Su[rgi]:Su[tgi];return t.replace(r,function(n,o,s,c,l,u){sl("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"),sl("xRange return",n),n})}a(cpa,"replaceXRange");function lpa(t,e){return sl("replaceStars",t,e),t.trim().replace(Su[ugi],"")}a(lpa,"replaceStars");function upa(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(upa,"hyphenReplace");vf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new ka(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(dpa,"testSet");Eo.satisfies=Rft;function Rft(t,e,r){try{e=new vf(e,r)}catch{return!1}return e.test(t)}a(Rft,"satisfies");Eo.maxSatisfying=fpa;function fpa(t,e,r){var n=null,o=null;try{var s=new vf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new ka(n,r))}),n}a(fpa,"maxSatisfying");Eo.minSatisfying=ppa;function ppa(t,e,r){var n=null,o=null;try{var s=new vf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new ka(n,r))}),n}a(ppa,"minSatisfying");Eo.minVersion=hpa;function hpa(t,e){t=new vf(t,e);var r=new ka("0.0.0");if(t.test(r)||(r=new ka("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||ANe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(hpa,"minVersion");Eo.validRange=mpa;function mpa(t,e){try{return new vf(t,e).range||"*"}catch{return null}}a(mpa,"validRange");Eo.ltr=gpa;function gpa(t,e,r){return omr(t,e,"<",r)}a(gpa,"ltr");Eo.gtr=Apa;function Apa(t,e,r){return omr(t,e,">",r)}a(Apa,"gtr");Eo.outside=omr;function omr(t,e,r,n){t=new ka(t,n),e=new vf(e,n);var o,s,c,l,u;switch(r){case">":o=ANe,s=imr,c=xft,l=">",u=">=";break;case"<":o=xft,s=nmr,c=ANe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Rft(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(omr,"outside");Eo.prerelease=ypa;function ypa(t,e){var r=PX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(ypa,"prerelease");Eo.intersects=Epa;function Epa(t,e,r){return t=new vf(t,r),e=new vf(e,r),t.intersects(e)}a(Epa,"intersects");Eo.coerce=_pa;function _pa(t){if(t instanceof ka)return t;if(typeof t!="string")return null;var e=t.match(Su[ngi]);return e==null?null:PX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(_pa,"coerce")});var ggi=I((HJf,mgi)=>{p();var vpa=ghe().wrap,amr=1,cmr=2,lmr=4,Mft=8,Hl=[],Cpa=0,yE=!1,AH=[],Whe,umr;function dmr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Hl=AH.pop()),zhe=void 0,n&&!yE},"asyncCatcher"),umr=a(function(e,r,n){var o=[];yE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);yE=!1;var d=e.apply(this,arguments);for(yE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return yE=!1,Hl=AH.pop(),zhe=void 0,d}},"asyncWrap"),vpa(process,"_fatalException",function(t){return a(function(r){return Whe(r)||t(r)},"_asyncFatalException")})):(smr=!1,Whe=a(function(e){if(smr)throw e;for(var r=!1,n=Hl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);yE=!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]);yE=!1}Hl=AH.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",Whe));var Nft,zhe,smr;function bpa(t,e,r){yE=!0;for(var n=0;n0)return umr(t,r,e);return bpa(t,r,e)}a(Spa,"wrapCallback");function Q5(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=amr),typeof t.before=="function"&&(this.before=t.before,this.flags|=cmr),typeof t.after=="function"&&(this.after=t.after,this.flags|=lmr),typeof t.error=="function"&&(this.error=t.error,this.flags|=Mft),this.uid=++Cpa,this.data=e===void 0?null:e}a(Q5,"AsyncListener");Q5.prototype.create=void 0;Q5.prototype.before=void 0;Q5.prototype.after=void 0;Q5.prototype.error=void 0;Q5.prototype.data=void 0;Q5.prototype.uid=0;Q5.prototype.flags=0;function hgi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof Q5?t:new Q5(t,e)}a(hgi,"createAsyncListener");function Tpa(t,e){var r;t instanceof Q5?r=t:r=hgi(t,e);for(var n=!1,o=0;o{"use strict";p();Agi.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 Tgi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var Cgi=ghe(),Bft=pgi(),bb=Cgi.wrap,yH=Cgi.massWrap,Cf=ggi(),xpa=require("util"),wpa=Bft.gte(process.version,"6.0.0"),hmr=Bft.gte(process.version,"7.0.0"),Rpa=Bft.gte(process.version,"8.0.0"),Ppa=Bft.gte(process.version,"11.0.0"),q5=require("net");hmr&&!q5._normalizeArgs?q5._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:Opa(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]}:!hmr&&!q5._normalizeConnectArgs&&(q5._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 q5.Server.prototype?bb(q5.Server.prototype,"_setUpListenHandle",Egi):bb(q5.Server.prototype,"_listen2",Egi);function Egi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Cf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Cf(this._handle.onconnection))}}}a(Egi,"wrapSetUpListenHandle");function bgi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Cf(e._originalOnread)}}a(bgi,"patchOnRead");bb(q5.Socket.prototype,"connect",function(t){return function(){var e;Rpa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=hmr?q5._normalizeArgs(arguments):q5._normalizeConnectArgs(arguments),e[1]&&(e[1]=Cf(e[1]));var r=t.apply(this,e);return bgi(this),r}});var kpa=require("http");bb(kpa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Cf(function(n){return bgi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var fmr=require("child_process");function _gi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Cf(e._handle.onread),bb(e._handle,"close",Lft))}),t._handle&&(t._handle.onexit=Cf(t._handle.onexit))}a(_gi,"wrapChildProcess");fmr.ChildProcess?bb(fmr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return _gi(this),e}}):yH(fmr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return _gi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var Amr=[];process._nextDomainTick&&Amr.push("_nextDomainTick");process._tickDomainCallback&&Amr.push("_tickDomainCallback");yH(process,Amr,j5);bb(process,"nextTick",Lft);var ymr=["setTimeout","setInterval"];global.setImmediate&&ymr.push("setImmediate");var Sgi=require("timers"),Dpa=global.setTimeout===Sgi.setTimeout;yH(Sgi,ymr,Lft);Dpa&&yH(global,ymr,Lft);var mmr=require("dns");yH(mmr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],j5);mmr.resolveNaptr&&bb(mmr,"resolveNaptr",j5);var DX=require("fs");yH(DX,["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"],j5);DX.lchown&&bb(DX,"lchown",j5);DX.lchmod&&bb(DX,"lchmod",j5);DX.ftruncate&&bb(DX,"ftruncate",j5);var _Ne;try{_Ne=require("zlib")}catch{}_Ne&&_Ne.Deflate&&_Ne.Deflate.prototype&&(kX=Object.getPrototypeOf(_Ne.Deflate.prototype),kX._transform?bb(kX,"_transform",j5):kX.write&&kX.flush&&kX.end&&yH(kX,["write","flush","end"],j5));var kX,gmr;try{gmr=require("crypto")}catch{}gmr&&(pmr=["pbkdf2","randomBytes"],Ppa||pmr.push("pseudoRandomBytes"),yH(gmr,pmr,j5));var pmr,Oft=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";Oft&&(vgi=process.addAsyncListener({create:a(function(){Oft=!1},"create")}),global.Promise.resolve(!0).then(a(function(){Oft=!1},"notSync")),process.removeAsyncListener(vgi));var vgi;Oft&&Npa();function Npa(){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"),xpa.inherits(e,t),bb(t.prototype,"then",s),t.prototype.chain&&bb(t.prototype,"chain",s),wpa)global.Promise=ygi()(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=Cf(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:Cf(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(Npa,"wrapPromise");function j5(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(Mpa,"toNumber");function Opa(t){return typeof t=="string"&&Mpa(t)===!1}a(Opa,"isPipeName")});var Pgi=I((eZf,Rgi)=>{"use strict";p();var zF=require("assert"),Bpa=_ft(),vNe="cls@contexts",Emr="error@context";process.addAsyncListener||Tgi();function b2(t){this.name=t,this.active=null,this._set=[],this.id=null}a(b2,"Namespace");b2.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};b2.prototype.get=function(t){if(this.active)return this.active[t]};b2.prototype.createContext=function(){return Object.create(this.active)};b2.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[Emr]=e),r}finally{this.exit(e)}};b2.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};b2.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[Emr]=e),n}finally{r.exit(e)}}};b2.prototype.enter=function(t){zF.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};b2.prototype.exit=function(t){if(zF.ok(t,"context must be provided for exiting"),this.active===t){zF.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);zF.ok(e>=0,"context not currently entered; can't exit"),zF.ok(e,"can't remove top context"),this._set.splice(e,1)};b2.prototype.bindEmitter=function(t){zF.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[vNe]||(s[vNe]=Object.create(null)),s[vNe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[vNe]))return s;var c=s,l=s[vNe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),Bpa(t,n,o)};b2.prototype.fromException=function(t){return t[Emr]};function Igi(t){return process.namespaces[t]}a(Igi,"get");function Lpa(t){zF.ok(t,"namespace must be given a name!");var e=new b2(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(Lpa,"create");function xgi(t){var e=Igi(t);zF.ok(e,"can't delete nonexistent namespace!"),zF.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(xgi,"destroy");function wgi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){xgi(t)}),process.namespaces=Object.create(null)}a(wgi,"reset");process.namespaces||wgi();Rgi.exports={getNamespace:Igi,createNamespace:Lpa,destroyNamespace:xgi,reset:wgi}});var _H=I(H5=>{"use strict";p();var Fpa=H5&&H5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Upa=H5&&H5.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qpa=H5&&H5.__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)&&Fpa(e,t,r);return Upa(e,t),e};Object.defineProperty(H5,"__esModule",{value:!0});H5.CorrelationContextManager=void 0;var EH=jl(),qpa=Qpa(ift()),NX=oft(),_mr=Ghr(),kgi=u0r(),Yhe=VA(),jpa=(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 Hpa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new NX;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=NX.formatOpenTelemetryTraceFlags(e.traceFlags)||NX.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){EH.warn("Error binding to session context",Yhe.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){EH.warn("Error binding to session context",Yhe.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){EH.warn("Error binding to session context",Yhe.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=Kmi():this.cls=Pgi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){EH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",Yhe.dumpObj(r)),this.enabled=!1;return}qpa.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){EH.warn("Error binding to session context",Yhe.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 NX(f.headers.traceparent):f.headers["request-id"]&&(u=new NX(null,f.headers["request-id"])),f.headers.tracestate&&(d=new _mr(f.headers.tracestate)))}u||(u=new NX(n.traceParent||n.traceparent)),d||(d=new _mr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new kgi(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 NX(c.traceparent?c.traceparent.toString():null),d=new _mr(c.tracestate?c.tracestate.toString():null),m=new kgi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return EH.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){EH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",Yhe.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})();H5.CorrelationContextManager=jpa;var Hpa=(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");ko.insertSnippetByIndex=qha;var jha=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");ko.isContentTypeHeaderHtml=jha});var xmr=I((qZf,Jgi)=>{"use strict";p();var Kgi=ad(),Hha=(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||Kgi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||Kgi.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})();Jgi.exports=Hha});var Zgi={};xi(Zgi,{webSnippet:()=>Gha});var Gha,Xgi=_e(()=>{p();Gha=`!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 Syi=require("http"),Tyi=require("https"),v0e=require("zlib"),r4=$l(),Jw=Eyi(),Iyi=kgr(),KNe=ad(),xyi=Pgr(),WAa=(byi(),Ca(vyi)),zAa=(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=KNe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=KNe.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(KNe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(KNe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=xyi.parse(e),o=n.instrumentationkey||"";xyi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,r4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){r4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=Iyi.getOsPrefix(),n=Iyi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r +}});`});var oAi=I(($Zf,iAi)=>{"use strict";p();var eAi=require("http"),tAi=require("https"),Xhe=require("zlib"),G5=jl(),Gw=Ygi(),rAi=Imr(),bNe=ad(),nAi=xmr(),$ha=(Xgi(),ya(Zgi)),Vha=(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=bNe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=bNe.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(bNe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(bNe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=nAi.parse(e),o=n.instrumentationkey||"";nAi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,G5.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){G5.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=rAi.getOsPrefix(),n=rAi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r `).concat(e,` disableIkeyDeprecationMessage: true,\r - sdkExtension: "`).concat(n).concat(r,"d_n_"),s=WAa.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(KNe.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=$ha.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(bNe.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,r4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=Syi.createServer,r=Tyi.createServer,n=this._isEnabled;Syi.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=Jw.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){r4.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=Jw.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){r4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},Tyi.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=Jw.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){r4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=Jw.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){r4.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=Jw.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){r4.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=Jw.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=Jw.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){r4.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 Jw.contentEncodingMethod.GZIP:var o=v0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=v0e.gzipSync(s)}break;case Jw.contentEncodingMethod.DEFLATE:var c=v0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=v0e.deflateSync(l)}break;case Jw.contentEncodingMethod.BR:var u=Jw.getBrotliDecompressSync(v0e),d=Jw.getBrotliCompressSync(v0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){r4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();wyi.exports=zAa});var Pyi=I((Ngr,kyi)=>{"use strict";p();var YAa=Ngr&&Ngr.__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)}})(),Zw=require("url"),Dgr=_E(),KAa=qA(),JAa=Zhe(),ZAa=umr(),XAa=QX(),eya=(function(t){YAa(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=KAa.getCorrelationContextTarget(r,JAa.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=Dgr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new Zw.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=Dgr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==XAa.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=Dgr.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 Zw.URL(r)}catch{}else try{var o=new Zw.URL("http://"+r);o.port==="443"?r=new Zw.URL("https://"+r):r=new Zw.URL("http://"+r)}catch{}else{if(r&&typeof Zw.URL=="function"&&r instanceof Zw.URL)return Zw.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 Zw.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 Zw.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 Zw.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",Zw.format(r)},e})(ZAa);kyi.exports=eya});var Dyi=I(b0e=>{"use strict";p();var Mpt=b0e&&b0e.__assign||function(){return Mpt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var oya=f8&&f8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sya=f8&&f8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aya=f8&&f8.__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)&&oya(e,t,r);return sya(e,t),e};Object.defineProperty(f8,"__esModule",{value:!0});f8.spanToTelemetryContract=hya;var Nyi=require("url"),D2=(co(),Ca(v5)),ms=(gft(),Ca(_0r)),d8=aya(ad()),cya=Dyi(),lya=qA();function uya(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=lya.stringify(s)),e}a(uya,"createPropertiesFromSpan");function dya(t){return t===ms.DbSystemValues.DB2||t===ms.DbSystemValues.DERBY||t===ms.DbSystemValues.MARIADB||t===ms.DbSystemValues.MSSQL||t===ms.DbSystemValues.ORACLE||t===ms.DbSystemValues.SQLITE||t===ms.DbSystemValues.OTHER_SQL||t===ms.DbSystemValues.HSQLDB||t===ms.DbSystemValues.H2}a(dya,"isSqlDB");function Myi(t){var e=t.attributes[ms.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[ms.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[ms.SemanticAttributes.HTTP_SCHEME],o=t.attributes[ms.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[ms.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[ms.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[ms.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[ms.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(Myi,"getUrl");function Ogr(t){var e=t.attributes[ms.SemanticAttributes.PEER_SERVICE],r=t.attributes[ms.SemanticAttributes.HTTP_HOST],n=t.attributes[ms.SemanticAttributes.HTTP_URL],o=t.attributes[ms.SemanticAttributes.NET_PEER_NAME],s=t.attributes[ms.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(Ogr,"getDependencyTarget");function fya(t){var e={name:t.name,success:t.status.code!=D2.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===D2.SpanKind.PRODUCER&&(e.dependencyTypeName=d8.DependencyTypeName.QueueMessage),t.kind===D2.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=d8.DependencyTypeName.InProc);var r=t.attributes[ms.SemanticAttributes.HTTP_METHOD],n=t.attributes[ms.SemanticAttributes.DB_SYSTEM],o=t.attributes[ms.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=d8.DependencyTypeName.Http;var s=t.attributes[ms.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new Nyi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=Myi(t);var u=t.attributes[ms.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=Ogr(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)===ms.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===ms.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===ms.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===ms.DbSystemValues.REDIS?e.dependencyTypeName="redis":dya(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[ms.SemanticAttributes.DB_STATEMENT],y=t.attributes[ms.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=Ogr(t),E=t.attributes[ms.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=d8.DependencyTypeName.Grpc;var _=t.attributes[ms.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=Ogr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(fya,"createDependencyData");function pya(t){var e={name:t.name,success:t.status.code!=D2.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[ms.SemanticAttributes.HTTP_METHOD],n=t.attributes[ms.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==D2.SpanKind.SERVER){var o=t.attributes[ms.SemanticAttributes.HTTP_ROUTE],s=t.attributes[ms.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new Nyi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=Myi(t);var l=t.attributes[ms.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(pya,"createRequestData");function hya(t){var e;switch(t.kind){case D2.SpanKind.CLIENT:case D2.SpanKind.PRODUCER:case D2.SpanKind.INTERNAL:e=fya(t);break;case D2.SpanKind.SERVER:case D2.SpanKind.CONSUMER:e=pya(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=uya(t),t.attributes[d8.AzNamespace]&&(t.kind===D2.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(d8.DependencyTypeName.InProc," | ").concat(t.attributes[d8.AzNamespace])),t.attributes[d8.AzNamespace]===d8.MicrosoftEventHub&&(0,cya.parseEventHubSpan)(t,e)),e}a(hya,"spanToTelemetryContract")});var Lyi=I(HH=>{"use strict";p();var S0e=HH&&HH.__assign||function(){return S0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var gya=wT&&wT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Aya=wT&&wT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yya=wT&&wT.__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)&&gya(e,t,r);return Aya(e,t),e};Object.defineProperty(wT,"__esModule",{value:!0});wT.subscriber=void 0;wT.enable=bya;var ZNe=(co(),Ca(v5)),Eya=ad(),Bgr=dp(),_ya=yya(Oyi()),Cya=Lyi(),eee=[],vya=a(function(t){try{var e=t.data,r=_ya.spanToTelemetryContract(e);Cya.AsyncScopeManager.with(e,function(){eee.forEach(function(n){e.kind===ZNe.SpanKind.SERVER||e.kind===ZNe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===ZNe.SpanKind.CLIENT||e.kind===ZNe.SpanKind.INTERNAL||e.kind===ZNe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");wT.subscriber=vya;function bya(t,e){if(t){var r=eee.find(function(n){return n==e});if(r)return;eee.length===0&&Bgr.channel.subscribe("azure-coretracing",wT.subscriber,Bgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Eya.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),eee.push(e)}else eee=eee.filter(function(n){return n!=e}),eee.length===0&&Bgr.channel.unsubscribe("azure-coretracing",wT.subscriber)}a(bya,"enable")});var Uyi=I(ree=>{"use strict";p();Object.defineProperty(ree,"__esModule",{value:!0});ree.subscriber=void 0;ree.enable=Iya;var Sya=ad(),Lgr=dp(),tee=[],Tya=a(function(t){t.data.event.commandName!=="ismaster"&&tee.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");ree.subscriber=Tya;function Iya(t,e){if(t){var r=tee.find(function(n){return n==e});if(r)return;tee.length===0&&Lgr.channel.subscribe("mongodb",ree.subscriber,Lgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Sya.StatsbeatInstrumentation.MONGODB)}),tee.push(e)}else tee=tee.filter(function(n){return n!=e}),tee.length===0&&Lgr.channel.unsubscribe("mongodb",ree.subscriber)}a(Iya,"enable")});var Qyi=I(iee=>{"use strict";p();Object.defineProperty(iee,"__esModule",{value:!0});iee.subscriber=void 0;iee.enable=Rya;var xya=ad(),Fgr=dp(),nee=[],wya=a(function(t){nee.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");iee.subscriber=wya;function Rya(t,e){if(t){var r=nee.find(function(n){return n==e});if(r)return;nee.length===0&&Fgr.channel.subscribe("mysql",iee.subscriber,Fgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(xya.StatsbeatInstrumentation.MYSQL)}),nee.push(e)}else nee=nee.filter(function(n){return n!=e}),nee.length===0&&Fgr.channel.unsubscribe("mysql",iee.subscriber)}a(Rya,"enable")});var qyi=I(see=>{"use strict";p();Object.defineProperty(see,"__esModule",{value:!0});see.subscriber=void 0;see.enable=Dya;var kya=ad(),Ugr=dp(),oee=[],Pya=a(function(t){oee.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");see.subscriber=Pya;function Dya(t,e){if(t){var r=oee.find(function(n){return n==e});if(r)return;oee.length===0&&Ugr.channel.subscribe("redis",see.subscriber,Ugr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(kya.StatsbeatInstrumentation.REDIS)}),oee.push(e)}else oee=oee.filter(function(n){return n!=e}),oee.length===0&&Ugr.channel.unsubscribe("redis",see.subscriber)}a(Dya,"enable")});var jyi=I(cee=>{"use strict";p();Object.defineProperty(cee,"__esModule",{value:!0});cee.subscriber=void 0;cee.enable=Oya;var Nya=ad(),Qgr=dp(),aee=[],Mya=a(function(t){aee.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");cee.subscriber=Mya;function Oya(t,e){if(t){var r=aee.find(function(n){return n==e});if(r)return;aee.length===0&&Qgr.channel.subscribe("postgres",cee.subscriber,Qgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Nya.StatsbeatInstrumentation.POSTGRES)}),aee.push(e)}else aee=aee.filter(function(n){return n!=e}),aee.length===0&&Qgr.channel.unsubscribe("postgres",cee.subscriber)}a(Oya,"enable")});var x0e=I((p8,Hyi)=>{"use strict";p();var Bya=p8&&p8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lya=p8&&p8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fya=p8&&p8.__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)&&Bya(e,t,r);return Lya(e,t),e},Opt=p8&&p8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var Gyi=require("http"),$yi=require("https"),Vyi=$l(),Wyi=qA(),jya=Zhe(),jgr=hmr(),h8=FH(),Hya=wpt(),Gya=(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||Hya.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?h8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&h8.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 h8.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 jgr(e),c=this._generateCorrelationContext(s);h8.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){h8.CorrelationContextManager.wrapEmitter(c),h8.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=Gyi.createServer;Gyi.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=$yi.createServer;$yi.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){Vyi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=h8.CorrelationContextManager.getCurrentContext(),o=new jgr(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){Vyi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=h8.CorrelationContextManager.getCurrentContext(),s=n||new jgr(r.request,o&&o.operation.parentId);Wyi.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(jya.requestContextHeader);Wyi.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,h8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();zyi.exports=Gya});var Jyi=I(($gr,Kyi)=>{"use strict";p();var Xw=$gr&&$gr.__assign||function(){return Xw=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:Wya,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 lee.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case lee.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case lee.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case lee.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case lee.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=Xw(Xw({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=Xw(Xw({},r),{Message:e.data.baseData.message,SeverityLevel:lee.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=Xw(Xw({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=Xw(Xw({},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=Xw(Xw({},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=Yyi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=Yyi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):Vya.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 lee.ContextTagKeys,t})();Kyi.exports=zya});var Xyi=I((hip,Zyi)=>{"use strict";p();var Yya=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Zyi.exports={getTransmissionTime:Yya}});var nEi=I((tMe,rEi)=>{"use strict";p();var eEi=tMe&&tMe.__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())})},tEi=tMe&&tMe.__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=eR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[eR.time]=Zya.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:",Vgr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=Wgr.tlsRestrictedAgent,h=Kya.request(l,function(E){if(E.statusCode==200){var _=E.headers[eR.subscribed]==="true",v=null;try{v=E.headers[eR.endpointRedirect]?new Xya.URL(E.headers[eR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+Wgr.dumpObj(T))}var b=E.headers[eR.pollingIntervalHint]?parseInt(E.headers[eR.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:"),Vgr.warn(t.TAG,r,e)):Vgr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();rEi.exports=eEa});var lEi=I((rMe,cEi)=>{"use strict";p();var iEi=rMe&&rMe.__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())})},oEi=rMe&&rMe.__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 iEi(this,void 0,void 0,function(){return oEi(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&&(sEi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,sEi.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})();cEi.exports=nEa});var dEi=I(w0e=>{"use strict";p();var Fpt=w0e&&w0e.__assign||function(){return Fpt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var fEi=$H&&$H.__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())})},pEi=$H&&$H.__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 lEa=QX(),mEi=Pgr(),uEa=$l(),gEi=ad(),dEa=require("url"),fEa=Xut(),pEa=(function(){function t(e){this._endpointBase=gEi.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=mEi.parse(e),o=mEi.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]||gEi.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new dEa.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=lEa.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)||uEa.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=fEa.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})();AEi.exports=pEa});var Xgr=I(Zgr=>{"use strict";p();Object.defineProperty(Zgr,"__esModule",{value:!0});Zgr.createEmptyPipeline=hEa;var yEi=new Set(["Deserialize","Serialize","Retry","Sign"]),Jgr=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&&!yEi.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!yEi.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 hEa(){return Jgr.create()}a(hEa,"createEmptyPipeline")});var uee=I(Qpt=>{"use strict";p();Object.defineProperty(Qpt,"__esModule",{value:!0});Qpt.logger=void 0;var mEa=ift();Qpt.logger=(0,mEa.createClientLogger)("core-rest-pipeline")});var tAr=I(eAr=>{"use strict";p();Object.defineProperty(eAr,"__esModule",{value:!0});eAr.getRandomIntegerInclusive=gEa;function gEa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(gEa,"getRandomIntegerInclusive")});var EEi=I(rAr=>{"use strict";p();Object.defineProperty(rAr,"__esModule",{value:!0});rAr.calculateRetryDelay=yEa;var AEa=tAr();function yEa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,AEa.getRandomIntegerInclusive)(0,n/2)}}a(yEa,"calculateRetryDelay")});var qpt=I(nAr=>{"use strict";p();Object.defineProperty(nAr,"__esModule",{value:!0});nAr.isObject=EEa;function EEa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(EEa,"isObject")});var _Ei=I(iAr=>{"use strict";p();Object.defineProperty(iAr,"__esModule",{value:!0});iAr.isError=CEa;var _Ea=qpt();function CEa(t){if((0,_Ea.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(CEa,"isError")});var vEi=I(jpt=>{"use strict";p();Object.defineProperty(jpt,"__esModule",{value:!0});jpt.computeSha256Hmac=vEa;jpt.computeSha256Hash=bEa;var CEi=require("node:crypto");async function vEa(t,e,r){let n=Buffer.from(t,"base64");return(0,CEi.createHmac)("sha256",n).update(e).digest(r)}a(vEa,"computeSha256Hmac");async function bEa(t,e){return(0,CEi.createHash)("sha256").update(t).digest(e)}a(bEa,"computeSha256Hash")});var bEi=I(sAr=>{"use strict";p();var oAr;Object.defineProperty(sAr,"__esModule",{value:!0});sAr.randomUUID=IEa;var SEa=require("node:crypto"),TEa=typeof((oAr=globalThis?.crypto)===null||oAr===void 0?void 0:oAr.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):SEa.randomUUID;function IEa(){return TEa()}a(IEa,"randomUUID")});var SEi=I(lm=>{"use strict";p();var aAr,cAr,lAr,uAr;Object.defineProperty(lm,"__esModule",{value:!0});lm.isReactNative=lm.isNodeRuntime=lm.isNodeLike=lm.isBun=lm.isDeno=lm.isWebWorker=lm.isBrowser=void 0;lm.isBrowser=typeof window<"u"&&typeof window.document<"u";lm.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((aAr=self.constructor)===null||aAr===void 0?void 0:aAr.name)==="DedicatedWorkerGlobalScope"||((cAr=self.constructor)===null||cAr===void 0?void 0:cAr.name)==="ServiceWorkerGlobalScope"||((lAr=self.constructor)===null||lAr===void 0?void 0:lAr.name)==="SharedWorkerGlobalScope");lm.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";lm.isBun=typeof Bun<"u"&&typeof Bun.version<"u";lm.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((uAr=globalThis.process.versions)===null||uAr===void 0)&&uAr.node);lm.isNodeRuntime=lm.isNodeLike&&!lm.isBun&&!lm.isDeno;lm.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var TEi=I(Hpt=>{"use strict";p();Object.defineProperty(Hpt,"__esModule",{value:!0});Hpt.uint8ArrayToString=xEa;Hpt.stringToUint8Array=wEa;function xEa(t,e){return Buffer.from(t).toString(e)}a(xEa,"uint8ArrayToString");function wEa(t,e){return Buffer.from(t,e)}a(wEa,"stringToUint8Array")});var IEi=I(Gpt=>{"use strict";p();Object.defineProperty(Gpt,"__esModule",{value:!0});Gpt.Sanitizer=void 0;var REa=qpt(),dAr="REDACTED",kEa=["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"],PEa=["api-version"],fAr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=kEa.concat(e),r=PEa.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,REa.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,dAr);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]=dAr;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]=dAr;return r}};Gpt.Sanitizer=fAr});var $pt=I(ma=>{"use strict";p();Object.defineProperty(ma,"__esModule",{value:!0});ma.Sanitizer=ma.uint8ArrayToString=ma.stringToUint8Array=ma.isWebWorker=ma.isReactNative=ma.isDeno=ma.isNodeRuntime=ma.isNodeLike=ma.isBun=ma.isBrowser=ma.randomUUID=ma.computeSha256Hmac=ma.computeSha256Hash=ma.isError=ma.isObject=ma.getRandomIntegerInclusive=ma.calculateRetryDelay=void 0;var DEa=EEi();Object.defineProperty(ma,"calculateRetryDelay",{enumerable:!0,get:a(function(){return DEa.calculateRetryDelay},"get")});var NEa=tAr();Object.defineProperty(ma,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return NEa.getRandomIntegerInclusive},"get")});var MEa=qpt();Object.defineProperty(ma,"isObject",{enumerable:!0,get:a(function(){return MEa.isObject},"get")});var OEa=_Ei();Object.defineProperty(ma,"isError",{enumerable:!0,get:a(function(){return OEa.isError},"get")});var xEi=vEi();Object.defineProperty(ma,"computeSha256Hash",{enumerable:!0,get:a(function(){return xEi.computeSha256Hash},"get")});Object.defineProperty(ma,"computeSha256Hmac",{enumerable:!0,get:a(function(){return xEi.computeSha256Hmac},"get")});var BEa=bEi();Object.defineProperty(ma,"randomUUID",{enumerable:!0,get:a(function(){return BEa.randomUUID},"get")});var dee=SEi();Object.defineProperty(ma,"isBrowser",{enumerable:!0,get:a(function(){return dee.isBrowser},"get")});Object.defineProperty(ma,"isBun",{enumerable:!0,get:a(function(){return dee.isBun},"get")});Object.defineProperty(ma,"isNodeLike",{enumerable:!0,get:a(function(){return dee.isNodeLike},"get")});Object.defineProperty(ma,"isNodeRuntime",{enumerable:!0,get:a(function(){return dee.isNodeRuntime},"get")});Object.defineProperty(ma,"isDeno",{enumerable:!0,get:a(function(){return dee.isDeno},"get")});Object.defineProperty(ma,"isReactNative",{enumerable:!0,get:a(function(){return dee.isReactNative},"get")});Object.defineProperty(ma,"isWebWorker",{enumerable:!0,get:a(function(){return dee.isWebWorker},"get")});var wEi=TEi();Object.defineProperty(ma,"stringToUint8Array",{enumerable:!0,get:a(function(){return wEi.stringToUint8Array},"get")});Object.defineProperty(ma,"uint8ArrayToString",{enumerable:!0,get:a(function(){return wEi.uint8ArrayToString},"get")});var LEa=IEi();Object.defineProperty(ma,"Sanitizer",{enumerable:!0,get:a(function(){return LEa.Sanitizer},"get")})});var REi=I(pAr=>{"use strict";p();Object.defineProperty(pAr,"__esModule",{value:!0});pAr.cancelablePromiseRace=FEa;async function FEa(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(FEa,"cancelablePromiseRace")});var kEi=I(Vpt=>{"use strict";p();Object.defineProperty(Vpt,"__esModule",{value:!0});Vpt.AbortError=void 0;var hAr=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};Vpt.AbortError=hAr});var iMe=I(Wpt=>{"use strict";p();Object.defineProperty(Wpt,"__esModule",{value:!0});Wpt.AbortError=void 0;var UEa=kEi();Object.defineProperty(Wpt,"AbortError",{enumerable:!0,get:a(function(){return UEa.AbortError},"get")})});var gAr=I(mAr=>{"use strict";p();Object.defineProperty(mAr,"__esModule",{value:!0});mAr.createAbortablePromise=qEa;var QEa=iMe();function qEa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new QEa.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(qEa,"createAbortablePromise")});var PEi=I(zpt=>{"use strict";p();Object.defineProperty(zpt,"__esModule",{value:!0});zpt.delay=$Ea;zpt.calculateRetryDelay=VEa;var jEa=gAr(),HEa=$pt(),GEa="The delay was aborted.";function $Ea(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,jEa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??GEa})}a($Ea,"delay");function VEa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,HEa.getRandomIntegerInclusive)(0,n/2)}}a(VEa,"calculateRetryDelay")});var DEi=I(AAr=>{"use strict";p();Object.defineProperty(AAr,"__esModule",{value:!0});AAr.getErrorMessage=zEa;var WEa=$pt();function zEa(t){if((0,WEa.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(zEa,"getErrorMessage")});var MEi=I(oMe=>{"use strict";p();Object.defineProperty(oMe,"__esModule",{value:!0});oMe.isDefined=yAr;oMe.isObjectWithProperties=YEa;oMe.objectHasProperty=NEi;function yAr(t){return typeof t<"u"&&t!==null}a(yAr,"isDefined");function YEa(t,e){if(!yAr(t)||typeof t!="object")return!1;for(let r of e)if(!NEi(t,r))return!1;return!0}a(YEa,"isObjectWithProperties");function NEi(t,e){return yAr(t)&&typeof t=="object"&&e in t}a(NEi,"objectHasProperty")});var n4=I(is=>{"use strict";p();Object.defineProperty(is,"__esModule",{value:!0});is.isWebWorker=is.isReactNative=is.isNodeRuntime=is.isNodeLike=is.isNode=is.isDeno=is.isBun=is.isBrowser=is.objectHasProperty=is.isObjectWithProperties=is.isDefined=is.getErrorMessage=is.delay=is.createAbortablePromise=is.cancelablePromiseRace=void 0;is.calculateRetryDelay=t_a;is.computeSha256Hash=r_a;is.computeSha256Hmac=n_a;is.getRandomIntegerInclusive=i_a;is.isError=o_a;is.isObject=s_a;is.randomUUID=a_a;is.uint8ArrayToString=c_a;is.stringToUint8Array=l_a;var KEa=(OL(),Ca(E7)),$A=KEa.__importStar($pt()),JEa=REi();Object.defineProperty(is,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return JEa.cancelablePromiseRace},"get")});var ZEa=gAr();Object.defineProperty(is,"createAbortablePromise",{enumerable:!0,get:a(function(){return ZEa.createAbortablePromise},"get")});var XEa=PEi();Object.defineProperty(is,"delay",{enumerable:!0,get:a(function(){return XEa.delay},"get")});var e_a=DEi();Object.defineProperty(is,"getErrorMessage",{enumerable:!0,get:a(function(){return e_a.getErrorMessage},"get")});var EAr=MEi();Object.defineProperty(is,"isDefined",{enumerable:!0,get:a(function(){return EAr.isDefined},"get")});Object.defineProperty(is,"isObjectWithProperties",{enumerable:!0,get:a(function(){return EAr.isObjectWithProperties},"get")});Object.defineProperty(is,"objectHasProperty",{enumerable:!0,get:a(function(){return EAr.objectHasProperty},"get")});function t_a(t,e){return $A.calculateRetryDelay(t,e)}a(t_a,"calculateRetryDelay");function r_a(t,e){return $A.computeSha256Hash(t,e)}a(r_a,"computeSha256Hash");function n_a(t,e,r){return $A.computeSha256Hmac(t,e,r)}a(n_a,"computeSha256Hmac");function i_a(t,e){return $A.getRandomIntegerInclusive(t,e)}a(i_a,"getRandomIntegerInclusive");function o_a(t){return $A.isError(t)}a(o_a,"isError");function s_a(t){return $A.isObject(t)}a(s_a,"isObject");function a_a(){return $A.randomUUID()}a(a_a,"randomUUID");is.isBrowser=$A.isBrowser;is.isBun=$A.isBun;is.isDeno=$A.isDeno;is.isNode=$A.isNodeLike;is.isNodeLike=$A.isNodeLike;is.isNodeRuntime=$A.isNodeRuntime;is.isReactNative=$A.isReactNative;is.isWebWorker=$A.isWebWorker;function c_a(t,e){return $A.uint8ArrayToString(t,e)}a(c_a,"uint8ArrayToString");function l_a(t,e){return $A.stringToUint8Array(t,e)}a(l_a,"stringToUint8Array")});var Kpt=I(Ypt=>{"use strict";p();Object.defineProperty(Ypt,"__esModule",{value:!0});Ypt.Sanitizer=void 0;var u_a=n4(),_Ar="REDACTED",d_a=["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"],f_a=["api-version"],CAr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=d_a.concat(e),r=f_a.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,u_a.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,_Ar);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]=_Ar;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]=_Ar;return r}};Ypt.Sanitizer=CAr});var vAr=I(R0e=>{"use strict";p();Object.defineProperty(R0e,"__esModule",{value:!0});R0e.logPolicyName=void 0;R0e.logPolicy=m_a;var p_a=uee(),h_a=Kpt();R0e.logPolicyName="logPolicy";function m_a(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:p_a.logger.info,n=new h_a.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:R0e.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(m_a,"logPolicy")});var bAr=I(k0e=>{"use strict";p();Object.defineProperty(k0e,"__esModule",{value:!0});k0e.redirectPolicyName=void 0;k0e.redirectPolicy=g_a;k0e.redirectPolicyName="redirectPolicy";var OEi=["GET","HEAD"];function g_a(t={}){let{maxRetries:e=20}=t;return{name:k0e.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return BEi(n,o,e)}}}a(g_a,"redirectPolicy");async function BEi(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&OEi.includes(o.method)||s===302&&OEi.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(Jpt,"__esModule",{value:!0});Jpt.getHeaderName=A_a;Jpt.setPlatformSpecificData=y_a;var LEi=(OL(),Ca(E7)),SAr=LEi.__importStar(require("node:os")),TAr=LEi.__importStar(require("node:process"));function A_a(){return"User-Agent"}a(A_a,"getHeaderName");async function y_a(t){if(TAr&&TAr.versions){let e=TAr.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",`(${SAr.arch()}-${SAr.type()}-${SAr.release()})`)}a(y_a,"setPlatformSpecificData")});var VH=I(P0e=>{"use strict";p();Object.defineProperty(P0e,"__esModule",{value:!0});P0e.DEFAULT_RETRY_POLICY_COUNT=P0e.SDK_VERSION=void 0;P0e.SDK_VERSION="1.16.3";P0e.DEFAULT_RETRY_POLICY_COUNT=3});var IAr=I(Zpt=>{"use strict";p();Object.defineProperty(Zpt,"__esModule",{value:!0});Zpt.getUserAgentHeaderName=C_a;Zpt.getUserAgentValue=v_a;var UEi=FEi(),E_a=VH();function __a(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(__a,"getUserAgentString");function C_a(){return(0,UEi.getHeaderName)()}a(C_a,"getUserAgentHeaderName");async function v_a(t){let e=new Map;e.set("core-rest-pipeline",E_a.SDK_VERSION),await(0,UEi.setPlatformSpecificData)(e);let r=__a(e);return t?`${t} ${r}`:r}a(v_a,"getUserAgentValue")});var xAr=I(D0e=>{"use strict";p();Object.defineProperty(D0e,"__esModule",{value:!0});D0e.userAgentPolicyName=void 0;D0e.userAgentPolicy=b_a;var qEi=IAr(),QEi=(0,qEi.getUserAgentHeaderName)();D0e.userAgentPolicyName="userAgentPolicy";function b_a(t={}){let e=(0,qEi.getUserAgentValue)(t.userAgentPrefix);return{name:D0e.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(QEi)||r.headers.set(QEi,await e),n(r)}}}a(b_a,"userAgentPolicy")});var Xpt=I(N0e=>{"use strict";p();Object.defineProperty(N0e,"__esModule",{value:!0});N0e.isNodeReadableStream=jEi;N0e.isWebReadableStream=HEi;N0e.isReadableStream=S_a;N0e.isBlob=T_a;function jEi(t){return!!(t&&typeof t.pipe=="function")}a(jEi,"isNodeReadableStream");function HEi(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(HEi,"isWebReadableStream");function S_a(t){return jEi(t)||HEi(t)}a(S_a,"isReadableStream");function T_a(t){return typeof t.stream=="function"}a(T_a,"isBlob")});var wAr=I(sMe=>{"use strict";p();Object.defineProperty(sMe,"__esModule",{value:!0});sMe.getRawContent=R_a;sMe.createFileFromStream=k_a;sMe.createFile=P_a;var I_a=n4(),x_a=Xpt(),GEi={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},eht=Symbol("rawContent");function w_a(t){return typeof t[eht]=="function"}a(w_a,"hasRawContent");function R_a(t){return w_a(t)?t[eht]():t.stream()}a(R_a,"getRawContent");function k_a(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},GEi),{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,x_a.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[eht]:t})}a(k_a,"createFileFromStream");function P_a(t,e,r={}){var n,o,s;return I_a.isNodeLike?Object.assign(Object.assign({},GEi),{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"),[eht]:()=>t}):new File([t],e,r)}a(P_a,"createFile")});var WEi=I(kAr=>{"use strict";p();Object.defineProperty(kAr,"__esModule",{value:!0});kAr.concat=B_a;var m8=(OL(),Ca(E7)),RAr=require("node:stream"),D_a=Xpt(),N_a=wAr();function $Ei(){return m8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield m8.__await(e.read());if(r)return yield m8.__await(void 0);yield yield m8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a($Ei,"streamAsyncIterator");function M_a(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=$Ei.bind(t)),t.values||(t.values=$Ei.bind(t))}a(M_a,"makeAsyncIterable");function O_a(t){return t instanceof ReadableStream?(M_a(t),RAr.Readable.fromWeb(t)):t}a(O_a,"ensureNodeStream");function VEi(t){return t instanceof Uint8Array?RAr.Readable.from(Buffer.from(t)):(0,D_a.isBlob)(t)?VEi((0,N_a.getRawContent)(t)):O_a(t)}a(VEi,"toStream");async function B_a(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(VEi);return RAr.Readable.from((function(){return m8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,m8.__asyncValues(d)),u;u=yield m8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield m8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield m8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(B_a,"concat")});var PAr=I(M0e=>{"use strict";p();Object.defineProperty(M0e,"__esModule",{value:!0});M0e.multipartPolicyName=void 0;M0e.multipartPolicy=W_a;var fee=n4(),L_a=WEi(),F_a=Xpt();function U_a(){return`----AzSDKFormBoundary${(0,fee.randomUUID)()}`}a(U_a,"generateBoundary");function Q_a(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(Q_a,"encodeHeaders");function q_a(t){return t instanceof Uint8Array?t.byteLength:(0,F_a.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(q_a,"getLength");function j_a(t){let e=0;for(let r of t){let n=q_a(r);if(n===void 0)return;e+=n}return e}a(j_a,"getTotalLength");async function H_a(t,e,r){let n=[(0,fee.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,fee.stringToUint8Array)(`\r -`,"utf-8"),(0,fee.stringToUint8Array)(Q_a(s.headers),"utf-8"),(0,fee.stringToUint8Array)(`\r -`,"utf-8"),s.body,(0,fee.stringToUint8Array)(`\r ---${r}`,"utf-8")]),(0,fee.stringToUint8Array)(`--\r +`),r+=c;break}}})}catch{this._isEnabled=!1,G5.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=eAi.createServer,r=tAi.createServer,n=this._isEnabled;eAi.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=Gw.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){G5.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=Gw.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){G5.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},tAi.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=Gw.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){G5.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=Gw.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){G5.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=Gw.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){G5.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=Gw.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=Gw.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){G5.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 Gw.contentEncodingMethod.GZIP:var o=Xhe.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=Xhe.gzipSync(s)}break;case Gw.contentEncodingMethod.DEFLATE:var c=Xhe.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=Xhe.deflateSync(l)}break;case Gw.contentEncodingMethod.BR:var u=Gw.getBrotliDecompressSync(Xhe),d=Gw.getBrotliCompressSync(Xhe);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){G5.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();iAi.exports=Vha});var aAi=I((Rmr,sAi)=>{"use strict";p();var Wha=Rmr&&Rmr.__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)}})(),$w=require("url"),wmr=AE(),zha=VA(),Yha=Rhe(),Kha=s0r(),Jha=bX(),Zha=(function(t){Wha(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=zha.getCorrelationContextTarget(r,Yha.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=wmr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new $w.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=wmr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==Jha.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=wmr.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 $w.URL(r)}catch{}else try{var o=new $w.URL("http://"+r);o.port==="443"?r=new $w.URL("https://"+r):r=new $w.URL("http://"+r)}catch{}else{if(r&&typeof $w.URL=="function"&&r instanceof $w.URL)return $w.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 $w.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 $w.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 $w.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",$w.format(r)},e})(Kha);sAi.exports=Zha});var cAi=I(e0e=>{"use strict";p();var Zft=e0e&&e0e.__assign||function(){return Zft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var n0a=JF&&JF.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i0a=JF&&JF.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o0a=JF&&JF.__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)&&n0a(e,t,r);return i0a(e,t),e};Object.defineProperty(JF,"__esModule",{value:!0});JF.spanToTelemetryContract=f0a;var lAi=require("url"),S2=(ao(),ya(r5)),ps=(Mdt(),ya(ghr)),KF=o0a(ad()),s0a=cAi(),a0a=VA();function c0a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=a0a.stringify(s)),e}a(c0a,"createPropertiesFromSpan");function l0a(t){return t===ps.DbSystemValues.DB2||t===ps.DbSystemValues.DERBY||t===ps.DbSystemValues.MARIADB||t===ps.DbSystemValues.MSSQL||t===ps.DbSystemValues.ORACLE||t===ps.DbSystemValues.SQLITE||t===ps.DbSystemValues.OTHER_SQL||t===ps.DbSystemValues.HSQLDB||t===ps.DbSystemValues.H2}a(l0a,"isSqlDB");function uAi(t){var e=t.attributes[ps.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[ps.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[ps.SemanticAttributes.HTTP_SCHEME],o=t.attributes[ps.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[ps.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[ps.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[ps.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[ps.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(uAi,"getUrl");function kmr(t){var e=t.attributes[ps.SemanticAttributes.PEER_SERVICE],r=t.attributes[ps.SemanticAttributes.HTTP_HOST],n=t.attributes[ps.SemanticAttributes.HTTP_URL],o=t.attributes[ps.SemanticAttributes.NET_PEER_NAME],s=t.attributes[ps.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(kmr,"getDependencyTarget");function u0a(t){var e={name:t.name,success:t.status.code!=S2.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===S2.SpanKind.PRODUCER&&(e.dependencyTypeName=KF.DependencyTypeName.QueueMessage),t.kind===S2.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=KF.DependencyTypeName.InProc);var r=t.attributes[ps.SemanticAttributes.HTTP_METHOD],n=t.attributes[ps.SemanticAttributes.DB_SYSTEM],o=t.attributes[ps.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=KF.DependencyTypeName.Http;var s=t.attributes[ps.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new lAi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=uAi(t);var u=t.attributes[ps.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=kmr(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)===ps.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===ps.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===ps.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===ps.DbSystemValues.REDIS?e.dependencyTypeName="redis":l0a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[ps.SemanticAttributes.DB_STATEMENT],y=t.attributes[ps.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=kmr(t),E=t.attributes[ps.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=KF.DependencyTypeName.Grpc;var _=t.attributes[ps.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=kmr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(u0a,"createDependencyData");function d0a(t){var e={name:t.name,success:t.status.code!=S2.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[ps.SemanticAttributes.HTTP_METHOD],n=t.attributes[ps.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==S2.SpanKind.SERVER){var o=t.attributes[ps.SemanticAttributes.HTTP_ROUTE],s=t.attributes[ps.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new lAi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=uAi(t);var l=t.attributes[ps.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(d0a,"createRequestData");function f0a(t){var e;switch(t.kind){case S2.SpanKind.CLIENT:case S2.SpanKind.PRODUCER:case S2.SpanKind.INTERNAL:e=u0a(t);break;case S2.SpanKind.SERVER:case S2.SpanKind.CONSUMER:e=d0a(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=c0a(t),t.attributes[KF.AzNamespace]&&(t.kind===S2.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(KF.DependencyTypeName.InProc," | ").concat(t.attributes[KF.AzNamespace])),t.attributes[KF.AzNamespace]===KF.MicrosoftEventHub&&(0,s0a.parseEventHubSpan)(t,e)),e}a(f0a,"spanToTelemetryContract")});var pAi=I(TH=>{"use strict";p();var t0e=TH&&TH.__assign||function(){return t0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var h0a=CT&&CT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m0a=CT&&CT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),g0a=CT&&CT.__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)&&h0a(e,t,r);return m0a(e,t),e};Object.defineProperty(CT,"__esModule",{value:!0});CT.subscriber=void 0;CT.enable=v0a;var TNe=(ao(),ya(r5)),A0a=ad(),Dmr=fp(),y0a=g0a(dAi()),E0a=pAi(),BX=[],_0a=a(function(t){try{var e=t.data,r=y0a.spanToTelemetryContract(e);E0a.AsyncScopeManager.with(e,function(){BX.forEach(function(n){e.kind===TNe.SpanKind.SERVER||e.kind===TNe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===TNe.SpanKind.CLIENT||e.kind===TNe.SpanKind.INTERNAL||e.kind===TNe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");CT.subscriber=_0a;function v0a(t,e){if(t){var r=BX.find(function(n){return n==e});if(r)return;BX.length===0&&Dmr.channel.subscribe("azure-coretracing",CT.subscriber,Dmr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(A0a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),BX.push(e)}else BX=BX.filter(function(n){return n!=e}),BX.length===0&&Dmr.channel.unsubscribe("azure-coretracing",CT.subscriber)}a(v0a,"enable")});var mAi=I(FX=>{"use strict";p();Object.defineProperty(FX,"__esModule",{value:!0});FX.subscriber=void 0;FX.enable=S0a;var C0a=ad(),Nmr=fp(),LX=[],b0a=a(function(t){t.data.event.commandName!=="ismaster"&&LX.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");FX.subscriber=b0a;function S0a(t,e){if(t){var r=LX.find(function(n){return n==e});if(r)return;LX.length===0&&Nmr.channel.subscribe("mongodb",FX.subscriber,Nmr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(C0a.StatsbeatInstrumentation.MONGODB)}),LX.push(e)}else LX=LX.filter(function(n){return n!=e}),LX.length===0&&Nmr.channel.unsubscribe("mongodb",FX.subscriber)}a(S0a,"enable")});var gAi=I(QX=>{"use strict";p();Object.defineProperty(QX,"__esModule",{value:!0});QX.subscriber=void 0;QX.enable=x0a;var T0a=ad(),Mmr=fp(),UX=[],I0a=a(function(t){UX.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");QX.subscriber=I0a;function x0a(t,e){if(t){var r=UX.find(function(n){return n==e});if(r)return;UX.length===0&&Mmr.channel.subscribe("mysql",QX.subscriber,Mmr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(T0a.StatsbeatInstrumentation.MYSQL)}),UX.push(e)}else UX=UX.filter(function(n){return n!=e}),UX.length===0&&Mmr.channel.unsubscribe("mysql",QX.subscriber)}a(x0a,"enable")});var AAi=I(jX=>{"use strict";p();Object.defineProperty(jX,"__esModule",{value:!0});jX.subscriber=void 0;jX.enable=P0a;var w0a=ad(),Omr=fp(),qX=[],R0a=a(function(t){qX.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");jX.subscriber=R0a;function P0a(t,e){if(t){var r=qX.find(function(n){return n==e});if(r)return;qX.length===0&&Omr.channel.subscribe("redis",jX.subscriber,Omr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(w0a.StatsbeatInstrumentation.REDIS)}),qX.push(e)}else qX=qX.filter(function(n){return n!=e}),qX.length===0&&Omr.channel.unsubscribe("redis",jX.subscriber)}a(P0a,"enable")});var yAi=I(GX=>{"use strict";p();Object.defineProperty(GX,"__esModule",{value:!0});GX.subscriber=void 0;GX.enable=N0a;var k0a=ad(),Bmr=fp(),HX=[],D0a=a(function(t){HX.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");GX.subscriber=D0a;function N0a(t,e){if(t){var r=HX.find(function(n){return n==e});if(r)return;HX.length===0&&Bmr.channel.subscribe("postgres",GX.subscriber,Bmr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(k0a.StatsbeatInstrumentation.POSTGRES)}),HX.push(e)}else HX=HX.filter(function(n){return n!=e}),HX.length===0&&Bmr.channel.unsubscribe("postgres",GX.subscriber)}a(N0a,"enable")});var i0e=I((ZF,EAi)=>{"use strict";p();var M0a=ZF&&ZF.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),O0a=ZF&&ZF.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),B0a=ZF&&ZF.__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)&&M0a(e,t,r);return O0a(e,t),e},Xft=ZF&&ZF.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var _Ai=require("http"),vAi=require("https"),CAi=jl(),bAi=VA(),Q0a=Rhe(),Fmr=u0r(),XF=_H(),q0a=Vft(),j0a=(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||q0a.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?XF.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&XF.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 XF.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 Fmr(e),c=this._generateCorrelationContext(s);XF.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){XF.CorrelationContextManager.wrapEmitter(c),XF.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=_Ai.createServer;_Ai.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=vAi.createServer;vAi.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){CAi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=XF.CorrelationContextManager.getCurrentContext(),o=new Fmr(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){CAi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=XF.CorrelationContextManager.getCurrentContext(),s=n||new Fmr(r.request,o&&o.operation.parentId);bAi.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(Q0a.requestContextHeader);bAi.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,XF.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();SAi.exports=j0a});var xAi=I((qmr,IAi)=>{"use strict";p();var Vw=qmr&&qmr.__assign||function(){return Vw=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:$0a,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 $X.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case $X.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case $X.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case $X.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case $X.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=Vw(Vw({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=Vw(Vw({},r),{Message:e.data.baseData.message,SeverityLevel:$X.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=Vw(Vw({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=Vw(Vw({},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=Vw(Vw({},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=TAi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=TAi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):G0a.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 $X.ContextTagKeys,t})();IAi.exports=V0a});var RAi=I((xXf,wAi)=>{"use strict";p();var W0a=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");wAi.exports={getTransmissionTime:W0a}});var NAi=I((wNe,DAi)=>{"use strict";p();var PAi=wNe&&wNe.__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())})},kAi=wNe&&wNe.__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=Ww.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[Ww.time]=K0a.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:",jmr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=Hmr.tlsRestrictedAgent,h=z0a.request(l,function(E){if(E.statusCode==200){var _=E.headers[Ww.subscribed]==="true",v=null;try{v=E.headers[Ww.endpointRedirect]?new J0a.URL(E.headers[Ww.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+Hmr.dumpObj(T))}var b=E.headers[Ww.pollingIntervalHint]?parseInt(E.headers[Ww.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:"),jmr.warn(t.TAG,r,e)):jmr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();DAi.exports=Z0a});var UAi=I((RNe,FAi)=>{"use strict";p();var MAi=RNe&&RNe.__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())})},OAi=RNe&&RNe.__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 MAi(this,void 0,void 0,function(){return OAi(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&&(BAi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,BAi.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})();FAi.exports=tma});var qAi=I(o0e=>{"use strict";p();var rpt=o0e&&o0e.__assign||function(){return rpt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var jAi=xH&&xH.__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())})},HAi=xH&&xH.__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 ama=bX(),$Ai=xmr(),cma=jl(),VAi=ad(),lma=require("url"),uma=Aut(),dma=(function(){function t(e){this._endpointBase=VAi.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=$Ai.parse(e),o=$Ai.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]||VAi.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new lma.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=ama.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)||cma.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=uma.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})();WAi.exports=dma});var Ymr=I(zmr=>{"use strict";p();Object.defineProperty(zmr,"__esModule",{value:!0});zmr.createEmptyPipeline=fma;var zAi=new Set(["Deserialize","Serialize","Retry","Sign"]),Wmr=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&&!zAi.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!zAi.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 fma(){return Wmr.create()}a(fma,"createEmptyPipeline")});var VX=I(ipt=>{"use strict";p();Object.defineProperty(ipt,"__esModule",{value:!0});ipt.logger=void 0;var pma=Cdt();ipt.logger=(0,pma.createClientLogger)("core-rest-pipeline")});var Jmr=I(Kmr=>{"use strict";p();Object.defineProperty(Kmr,"__esModule",{value:!0});Kmr.getRandomIntegerInclusive=hma;function hma(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(hma,"getRandomIntegerInclusive")});var YAi=I(Zmr=>{"use strict";p();Object.defineProperty(Zmr,"__esModule",{value:!0});Zmr.calculateRetryDelay=gma;var mma=Jmr();function gma(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,mma.getRandomIntegerInclusive)(0,n/2)}}a(gma,"calculateRetryDelay")});var opt=I(Xmr=>{"use strict";p();Object.defineProperty(Xmr,"__esModule",{value:!0});Xmr.isObject=Ama;function Ama(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Ama,"isObject")});var KAi=I(egr=>{"use strict";p();Object.defineProperty(egr,"__esModule",{value:!0});egr.isError=Ema;var yma=opt();function Ema(t){if((0,yma.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(Ema,"isError")});var ZAi=I(spt=>{"use strict";p();Object.defineProperty(spt,"__esModule",{value:!0});spt.computeSha256Hmac=_ma;spt.computeSha256Hash=vma;var JAi=require("node:crypto");async function _ma(t,e,r){let n=Buffer.from(t,"base64");return(0,JAi.createHmac)("sha256",n).update(e).digest(r)}a(_ma,"computeSha256Hmac");async function vma(t,e){return(0,JAi.createHash)("sha256").update(t).digest(e)}a(vma,"computeSha256Hash")});var XAi=I(rgr=>{"use strict";p();var tgr;Object.defineProperty(rgr,"__esModule",{value:!0});rgr.randomUUID=Sma;var Cma=require("node:crypto"),bma=typeof((tgr=globalThis?.crypto)===null||tgr===void 0?void 0:tgr.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):Cma.randomUUID;function Sma(){return bma()}a(Sma,"randomUUID")});var eyi=I(lm=>{"use strict";p();var ngr,igr,ogr,sgr;Object.defineProperty(lm,"__esModule",{value:!0});lm.isReactNative=lm.isNodeRuntime=lm.isNodeLike=lm.isBun=lm.isDeno=lm.isWebWorker=lm.isBrowser=void 0;lm.isBrowser=typeof window<"u"&&typeof window.document<"u";lm.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((ngr=self.constructor)===null||ngr===void 0?void 0:ngr.name)==="DedicatedWorkerGlobalScope"||((igr=self.constructor)===null||igr===void 0?void 0:igr.name)==="ServiceWorkerGlobalScope"||((ogr=self.constructor)===null||ogr===void 0?void 0:ogr.name)==="SharedWorkerGlobalScope");lm.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";lm.isBun=typeof Bun<"u"&&typeof Bun.version<"u";lm.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((sgr=globalThis.process.versions)===null||sgr===void 0)&&sgr.node);lm.isNodeRuntime=lm.isNodeLike&&!lm.isBun&&!lm.isDeno;lm.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var tyi=I(apt=>{"use strict";p();Object.defineProperty(apt,"__esModule",{value:!0});apt.uint8ArrayToString=Tma;apt.stringToUint8Array=Ima;function Tma(t,e){return Buffer.from(t).toString(e)}a(Tma,"uint8ArrayToString");function Ima(t,e){return Buffer.from(t,e)}a(Ima,"stringToUint8Array")});var ryi=I(cpt=>{"use strict";p();Object.defineProperty(cpt,"__esModule",{value:!0});cpt.Sanitizer=void 0;var xma=opt(),agr="REDACTED",wma=["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"],Rma=["api-version"],cgr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=wma.concat(e),r=Rma.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,xma.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,agr);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]=agr;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]=agr;return r}};cpt.Sanitizer=cgr});var lpt=I(fa=>{"use strict";p();Object.defineProperty(fa,"__esModule",{value:!0});fa.Sanitizer=fa.uint8ArrayToString=fa.stringToUint8Array=fa.isWebWorker=fa.isReactNative=fa.isDeno=fa.isNodeRuntime=fa.isNodeLike=fa.isBun=fa.isBrowser=fa.randomUUID=fa.computeSha256Hmac=fa.computeSha256Hash=fa.isError=fa.isObject=fa.getRandomIntegerInclusive=fa.calculateRetryDelay=void 0;var Pma=YAi();Object.defineProperty(fa,"calculateRetryDelay",{enumerable:!0,get:a(function(){return Pma.calculateRetryDelay},"get")});var kma=Jmr();Object.defineProperty(fa,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return kma.getRandomIntegerInclusive},"get")});var Dma=opt();Object.defineProperty(fa,"isObject",{enumerable:!0,get:a(function(){return Dma.isObject},"get")});var Nma=KAi();Object.defineProperty(fa,"isError",{enumerable:!0,get:a(function(){return Nma.isError},"get")});var nyi=ZAi();Object.defineProperty(fa,"computeSha256Hash",{enumerable:!0,get:a(function(){return nyi.computeSha256Hash},"get")});Object.defineProperty(fa,"computeSha256Hmac",{enumerable:!0,get:a(function(){return nyi.computeSha256Hmac},"get")});var Mma=XAi();Object.defineProperty(fa,"randomUUID",{enumerable:!0,get:a(function(){return Mma.randomUUID},"get")});var WX=eyi();Object.defineProperty(fa,"isBrowser",{enumerable:!0,get:a(function(){return WX.isBrowser},"get")});Object.defineProperty(fa,"isBun",{enumerable:!0,get:a(function(){return WX.isBun},"get")});Object.defineProperty(fa,"isNodeLike",{enumerable:!0,get:a(function(){return WX.isNodeLike},"get")});Object.defineProperty(fa,"isNodeRuntime",{enumerable:!0,get:a(function(){return WX.isNodeRuntime},"get")});Object.defineProperty(fa,"isDeno",{enumerable:!0,get:a(function(){return WX.isDeno},"get")});Object.defineProperty(fa,"isReactNative",{enumerable:!0,get:a(function(){return WX.isReactNative},"get")});Object.defineProperty(fa,"isWebWorker",{enumerable:!0,get:a(function(){return WX.isWebWorker},"get")});var iyi=tyi();Object.defineProperty(fa,"stringToUint8Array",{enumerable:!0,get:a(function(){return iyi.stringToUint8Array},"get")});Object.defineProperty(fa,"uint8ArrayToString",{enumerable:!0,get:a(function(){return iyi.uint8ArrayToString},"get")});var Oma=ryi();Object.defineProperty(fa,"Sanitizer",{enumerable:!0,get:a(function(){return Oma.Sanitizer},"get")})});var oyi=I(lgr=>{"use strict";p();Object.defineProperty(lgr,"__esModule",{value:!0});lgr.cancelablePromiseRace=Bma;async function Bma(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(Bma,"cancelablePromiseRace")});var syi=I(upt=>{"use strict";p();Object.defineProperty(upt,"__esModule",{value:!0});upt.AbortError=void 0;var ugr=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};upt.AbortError=ugr});var kNe=I(dpt=>{"use strict";p();Object.defineProperty(dpt,"__esModule",{value:!0});dpt.AbortError=void 0;var Lma=syi();Object.defineProperty(dpt,"AbortError",{enumerable:!0,get:a(function(){return Lma.AbortError},"get")})});var fgr=I(dgr=>{"use strict";p();Object.defineProperty(dgr,"__esModule",{value:!0});dgr.createAbortablePromise=Uma;var Fma=kNe();function Uma(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new Fma.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(Uma,"createAbortablePromise")});var ayi=I(fpt=>{"use strict";p();Object.defineProperty(fpt,"__esModule",{value:!0});fpt.delay=Hma;fpt.calculateRetryDelay=Gma;var Qma=fgr(),qma=lpt(),jma="The delay was aborted.";function Hma(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,Qma.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??jma})}a(Hma,"delay");function Gma(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,qma.getRandomIntegerInclusive)(0,n/2)}}a(Gma,"calculateRetryDelay")});var cyi=I(pgr=>{"use strict";p();Object.defineProperty(pgr,"__esModule",{value:!0});pgr.getErrorMessage=Vma;var $ma=lpt();function Vma(t){if((0,$ma.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(Vma,"getErrorMessage")});var uyi=I(DNe=>{"use strict";p();Object.defineProperty(DNe,"__esModule",{value:!0});DNe.isDefined=hgr;DNe.isObjectWithProperties=Wma;DNe.objectHasProperty=lyi;function hgr(t){return typeof t<"u"&&t!==null}a(hgr,"isDefined");function Wma(t,e){if(!hgr(t)||typeof t!="object")return!1;for(let r of e)if(!lyi(t,r))return!1;return!0}a(Wma,"isObjectWithProperties");function lyi(t,e){return hgr(t)&&typeof t=="object"&&e in t}a(lyi,"objectHasProperty")});var $5=I(rs=>{"use strict";p();Object.defineProperty(rs,"__esModule",{value:!0});rs.isWebWorker=rs.isReactNative=rs.isNodeRuntime=rs.isNodeLike=rs.isNode=rs.isDeno=rs.isBun=rs.isBrowser=rs.objectHasProperty=rs.isObjectWithProperties=rs.isDefined=rs.getErrorMessage=rs.delay=rs.createAbortablePromise=rs.cancelablePromiseRace=void 0;rs.calculateRetryDelay=Xma;rs.computeSha256Hash=ega;rs.computeSha256Hmac=tga;rs.getRandomIntegerInclusive=rga;rs.isError=nga;rs.isObject=iga;rs.randomUUID=oga;rs.uint8ArrayToString=sga;rs.stringToUint8Array=aga;var zma=(bL(),ya(s7)),KA=zma.__importStar(lpt()),Yma=oyi();Object.defineProperty(rs,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return Yma.cancelablePromiseRace},"get")});var Kma=fgr();Object.defineProperty(rs,"createAbortablePromise",{enumerable:!0,get:a(function(){return Kma.createAbortablePromise},"get")});var Jma=ayi();Object.defineProperty(rs,"delay",{enumerable:!0,get:a(function(){return Jma.delay},"get")});var Zma=cyi();Object.defineProperty(rs,"getErrorMessage",{enumerable:!0,get:a(function(){return Zma.getErrorMessage},"get")});var mgr=uyi();Object.defineProperty(rs,"isDefined",{enumerable:!0,get:a(function(){return mgr.isDefined},"get")});Object.defineProperty(rs,"isObjectWithProperties",{enumerable:!0,get:a(function(){return mgr.isObjectWithProperties},"get")});Object.defineProperty(rs,"objectHasProperty",{enumerable:!0,get:a(function(){return mgr.objectHasProperty},"get")});function Xma(t,e){return KA.calculateRetryDelay(t,e)}a(Xma,"calculateRetryDelay");function ega(t,e){return KA.computeSha256Hash(t,e)}a(ega,"computeSha256Hash");function tga(t,e,r){return KA.computeSha256Hmac(t,e,r)}a(tga,"computeSha256Hmac");function rga(t,e){return KA.getRandomIntegerInclusive(t,e)}a(rga,"getRandomIntegerInclusive");function nga(t){return KA.isError(t)}a(nga,"isError");function iga(t){return KA.isObject(t)}a(iga,"isObject");function oga(){return KA.randomUUID()}a(oga,"randomUUID");rs.isBrowser=KA.isBrowser;rs.isBun=KA.isBun;rs.isDeno=KA.isDeno;rs.isNode=KA.isNodeLike;rs.isNodeLike=KA.isNodeLike;rs.isNodeRuntime=KA.isNodeRuntime;rs.isReactNative=KA.isReactNative;rs.isWebWorker=KA.isWebWorker;function sga(t,e){return KA.uint8ArrayToString(t,e)}a(sga,"uint8ArrayToString");function aga(t,e){return KA.stringToUint8Array(t,e)}a(aga,"stringToUint8Array")});var hpt=I(ppt=>{"use strict";p();Object.defineProperty(ppt,"__esModule",{value:!0});ppt.Sanitizer=void 0;var cga=$5(),ggr="REDACTED",lga=["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"],uga=["api-version"],Agr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=lga.concat(e),r=uga.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,cga.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,ggr);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]=ggr;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]=ggr;return r}};ppt.Sanitizer=Agr});var ygr=I(s0e=>{"use strict";p();Object.defineProperty(s0e,"__esModule",{value:!0});s0e.logPolicyName=void 0;s0e.logPolicy=pga;var dga=VX(),fga=hpt();s0e.logPolicyName="logPolicy";function pga(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:dga.logger.info,n=new fga.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:s0e.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(pga,"logPolicy")});var Egr=I(a0e=>{"use strict";p();Object.defineProperty(a0e,"__esModule",{value:!0});a0e.redirectPolicyName=void 0;a0e.redirectPolicy=hga;a0e.redirectPolicyName="redirectPolicy";var dyi=["GET","HEAD"];function hga(t={}){let{maxRetries:e=20}=t;return{name:a0e.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return fyi(n,o,e)}}}a(hga,"redirectPolicy");async function fyi(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&dyi.includes(o.method)||s===302&&dyi.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(mpt,"__esModule",{value:!0});mpt.getHeaderName=mga;mpt.setPlatformSpecificData=gga;var pyi=(bL(),ya(s7)),_gr=pyi.__importStar(require("node:os")),vgr=pyi.__importStar(require("node:process"));function mga(){return"User-Agent"}a(mga,"getHeaderName");async function gga(t){if(vgr&&vgr.versions){let e=vgr.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",`(${_gr.arch()}-${_gr.type()}-${_gr.release()})`)}a(gga,"setPlatformSpecificData")});var wH=I(c0e=>{"use strict";p();Object.defineProperty(c0e,"__esModule",{value:!0});c0e.DEFAULT_RETRY_POLICY_COUNT=c0e.SDK_VERSION=void 0;c0e.SDK_VERSION="1.16.3";c0e.DEFAULT_RETRY_POLICY_COUNT=3});var Cgr=I(gpt=>{"use strict";p();Object.defineProperty(gpt,"__esModule",{value:!0});gpt.getUserAgentHeaderName=Ega;gpt.getUserAgentValue=_ga;var myi=hyi(),Aga=wH();function yga(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(yga,"getUserAgentString");function Ega(){return(0,myi.getHeaderName)()}a(Ega,"getUserAgentHeaderName");async function _ga(t){let e=new Map;e.set("core-rest-pipeline",Aga.SDK_VERSION),await(0,myi.setPlatformSpecificData)(e);let r=yga(e);return t?`${t} ${r}`:r}a(_ga,"getUserAgentValue")});var bgr=I(l0e=>{"use strict";p();Object.defineProperty(l0e,"__esModule",{value:!0});l0e.userAgentPolicyName=void 0;l0e.userAgentPolicy=vga;var Ayi=Cgr(),gyi=(0,Ayi.getUserAgentHeaderName)();l0e.userAgentPolicyName="userAgentPolicy";function vga(t={}){let e=(0,Ayi.getUserAgentValue)(t.userAgentPrefix);return{name:l0e.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(gyi)||r.headers.set(gyi,await e),n(r)}}}a(vga,"userAgentPolicy")});var Apt=I(u0e=>{"use strict";p();Object.defineProperty(u0e,"__esModule",{value:!0});u0e.isNodeReadableStream=yyi;u0e.isWebReadableStream=Eyi;u0e.isReadableStream=Cga;u0e.isBlob=bga;function yyi(t){return!!(t&&typeof t.pipe=="function")}a(yyi,"isNodeReadableStream");function Eyi(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(Eyi,"isWebReadableStream");function Cga(t){return yyi(t)||Eyi(t)}a(Cga,"isReadableStream");function bga(t){return typeof t.stream=="function"}a(bga,"isBlob")});var Sgr=I(NNe=>{"use strict";p();Object.defineProperty(NNe,"__esModule",{value:!0});NNe.getRawContent=xga;NNe.createFileFromStream=wga;NNe.createFile=Rga;var Sga=$5(),Tga=Apt(),_yi={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},ypt=Symbol("rawContent");function Iga(t){return typeof t[ypt]=="function"}a(Iga,"hasRawContent");function xga(t){return Iga(t)?t[ypt]():t.stream()}a(xga,"getRawContent");function wga(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},_yi),{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,Tga.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[ypt]:t})}a(wga,"createFileFromStream");function Rga(t,e,r={}){var n,o,s;return Sga.isNodeLike?Object.assign(Object.assign({},_yi),{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"),[ypt]:()=>t}):new File([t],e,r)}a(Rga,"createFile")});var byi=I(Igr=>{"use strict";p();Object.defineProperty(Igr,"__esModule",{value:!0});Igr.concat=Mga;var e8=(bL(),ya(s7)),Tgr=require("node:stream"),Pga=Apt(),kga=Sgr();function vyi(){return e8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield e8.__await(e.read());if(r)return yield e8.__await(void 0);yield yield e8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(vyi,"streamAsyncIterator");function Dga(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=vyi.bind(t)),t.values||(t.values=vyi.bind(t))}a(Dga,"makeAsyncIterable");function Nga(t){return t instanceof ReadableStream?(Dga(t),Tgr.Readable.fromWeb(t)):t}a(Nga,"ensureNodeStream");function Cyi(t){return t instanceof Uint8Array?Tgr.Readable.from(Buffer.from(t)):(0,Pga.isBlob)(t)?Cyi((0,kga.getRawContent)(t)):Nga(t)}a(Cyi,"toStream");async function Mga(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(Cyi);return Tgr.Readable.from((function(){return e8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,e8.__asyncValues(d)),u;u=yield e8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield e8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield e8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Mga,"concat")});var xgr=I(d0e=>{"use strict";p();Object.defineProperty(d0e,"__esModule",{value:!0});d0e.multipartPolicyName=void 0;d0e.multipartPolicy=$ga;var zX=$5(),Oga=byi(),Bga=Apt();function Lga(){return`----AzSDKFormBoundary${(0,zX.randomUUID)()}`}a(Lga,"generateBoundary");function Fga(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(Fga,"encodeHeaders");function Uga(t){return t instanceof Uint8Array?t.byteLength:(0,Bga.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(Uga,"getLength");function Qga(t){let e=0;for(let r of t){let n=Uga(r);if(n===void 0)return;e+=n}return e}a(Qga,"getTotalLength");async function qga(t,e,r){let n=[(0,zX.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,zX.stringToUint8Array)(`\r +`,"utf-8"),(0,zX.stringToUint8Array)(Fga(s.headers),"utf-8"),(0,zX.stringToUint8Array)(`\r +`,"utf-8"),s.body,(0,zX.stringToUint8Array)(`\r +--${r}`,"utf-8")]),(0,zX.stringToUint8Array)(`--\r \r -`,"utf-8")],o=j_a(n);o&&t.headers.set("Content-Length",o),t.body=await(0,L_a.concat)(n)}a(H_a,"buildRequestBody");M0e.multipartPolicyName="multipartPolicy";var G_a=70,$_a=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function V_a(t){if(t.length>G_a)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!$_a.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(V_a,"assertValidBoundary");function W_a(){return{name:M0e.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?V_a(n):n=U_a(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await H_a(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(W_a,"multipartPolicy")});var DAr=I(O0e=>{"use strict";p();Object.defineProperty(O0e,"__esModule",{value:!0});O0e.decompressResponsePolicyName=void 0;O0e.decompressResponsePolicy=z_a;O0e.decompressResponsePolicyName="decompressResponsePolicy";function z_a(){return{name:O0e.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(z_a,"decompressResponsePolicy")});var rht=I(tht=>{"use strict";p();Object.defineProperty(tht,"__esModule",{value:!0});tht.delay=J_a;tht.parseHeaderValueAsNumber=Z_a;var Y_a=iMe(),K_a="The operation was aborted.";function J_a(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new Y_a.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:K_a)),"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(J_a,"delay");function Z_a(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Z_a,"parseHeaderValueAsNumber")});var iht=I(nht=>{"use strict";p();Object.defineProperty(nht,"__esModule",{value:!0});nht.isThrottlingRetryResponse=tCa;nht.throttlingRetryStrategy=rCa;var X_a=rht(),NAr="Retry-After",eCa=["retry-after-ms","x-ms-retry-after-ms",NAr];function zEi(t){if(t&&[429,503].includes(t.status))try{for(let o of eCa){let s=(0,X_a.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===NAr?1e3:1)}let e=t.headers.get(NAr);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(zEi,"getRetryAfterInMs");function tCa(t){return Number.isFinite(zEi(t))}a(tCa,"isThrottlingRetryResponse");function rCa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=zEi(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(rCa,"throttlingRetryStrategy")});var oht=I(aMe=>{"use strict";p();Object.defineProperty(aMe,"__esModule",{value:!0});aMe.exponentialRetryStrategy=aCa;aMe.isExponentialRetryResponse=YEi;aMe.isSystemError=KEi;var nCa=n4(),iCa=iht(),oCa=1e3,sCa=1e3*64;function aCa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:oCa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:sCa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=KEi(u),f=d&&t.ignoreSystemErrors,h=YEi(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,iCa.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,nCa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(aCa,"exponentialRetryStrategy");function YEi(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(YEi,"isExponentialRetryResponse");function KEi(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(KEi,"isSystemError")});var B0e=I(MAr=>{"use strict";p();Object.defineProperty(MAr,"__esModule",{value:!0});MAr.retryPolicy=fCa;var cCa=rht(),lCa=ift(),uCa=iMe(),JEi=VH(),ZEi=(0,lCa.createClientLogger)("core-rest-pipeline retryPolicy"),dCa="retryPolicy";function fCa(t,e={maxRetries:JEi.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||ZEi;return{name:dCa,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 uCa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:JEi.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||ZEi;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,cCa.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(fCa,"retryPolicy")});var OAr=I(L0e=>{"use strict";p();Object.defineProperty(L0e,"__esModule",{value:!0});L0e.defaultRetryPolicyName=void 0;L0e.defaultRetryPolicy=ACa;var pCa=oht(),hCa=iht(),mCa=B0e(),gCa=VH();L0e.defaultRetryPolicyName="defaultRetryPolicy";function ACa(t={}){var e;return{name:L0e.defaultRetryPolicyName,sendRequest:(0,mCa.retryPolicy)([(0,hCa.throttlingRetryStrategy)(),(0,pCa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:gCa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(ACa,"defaultRetryPolicy")});var cMe=I(LAr=>{"use strict";p();Object.defineProperty(LAr,"__esModule",{value:!0});LAr.createHttpHeaders=ECa;function sht(t){return t.toLowerCase()}a(sht,"normalizeName");function*yCa(t){for(let e of t.values())yield[e.name,e.value]}a(yCa,"headerIterator");var BAr=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(sht(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(sht(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(sht(e))}delete(e){this._headersMap.delete(sht(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 yCa(this._headersMap)}};function ECa(t){return new BAr(t)}a(ECa,"createHttpHeaders")});var FAr=I(F0e=>{"use strict";p();Object.defineProperty(F0e,"__esModule",{value:!0});F0e.formDataPolicyName=void 0;F0e.formDataPolicy=CCa;var e_i=n4(),XEi=cMe();F0e.formDataPolicyName="formDataPolicy";function _Ca(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(_Ca,"formDataToFormDataMap");function CCa(){return{name:F0e.formDataPolicyName,async sendRequest(t,e){if(e_i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=_Ca(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=vCa(t.formData):await bCa(t.formData,t),t.formData=void 0}return e(t)}}}a(CCa,"formDataPolicy");function vCa(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(vCa,"wwwFormUrlEncode");async function bCa(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,XEi.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,e_i.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,XEi.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(bCa,"prepareFormData")});var UAr=I(tR=>{"use strict";p();Object.defineProperty(tR,"__esModule",{value:!0});tR.globalNoProxyList=tR.proxyPolicyName=void 0;tR.loadNoProxy=o_i;tR.getDefaultProxySettings=NCa;tR.proxyPolicy=OCa;var SCa=vBt(),TCa=bBt(),ICa=uee(),xCa="HTTPS_PROXY",wCa="HTTP_PROXY",RCa="ALL_PROXY",kCa="NO_PROXY";tR.proxyPolicyName="proxyPolicy";tR.globalNoProxyList=[];var n_i=!1,PCa=new Map;function aht(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(aht,"getEnvironmentValue");function i_i(){if(!process)return;let t=aht(xCa),e=aht(RCa),r=aht(wCa);return t||e||r}a(i_i,"loadEnvironmentProxyValue");function DCa(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(DCa,"isBypassed");function o_i(){let t=aht(kCa);return n_i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(o_i,"loadNoProxy");function NCa(t){if(!t&&(t=i_i(),!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(NCa,"getDefaultProxySettings");function MCa(){let t=i_i();return t?new URL(t):void 0}a(MCa,"getDefaultProxySettingsInternal");function t_i(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(t_i,"getUrlFromProxySettings");function r_i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&ICa.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 TCa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new SCa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(r_i,"setProxyAgentOnRequest");function OCa(t,e){n_i||tR.globalNoProxyList.push(...o_i());let r=t?t_i(t):MCa(),n={};return{name:tR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!DCa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:tR.globalNoProxyList,e?.customNoProxyList?void 0:PCa)?r_i(o,n,r):o.proxySettings&&r_i(o,n,t_i(o.proxySettings)),s(o)}}}a(OCa,"proxyPolicy")});var QAr=I(U0e=>{"use strict";p();Object.defineProperty(U0e,"__esModule",{value:!0});U0e.setClientRequestIdPolicyName=void 0;U0e.setClientRequestIdPolicy=BCa;U0e.setClientRequestIdPolicyName="setClientRequestIdPolicy";function BCa(t="x-ms-client-request-id"){return{name:U0e.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(BCa,"setClientRequestIdPolicy")});var qAr=I(Q0e=>{"use strict";p();Object.defineProperty(Q0e,"__esModule",{value:!0});Q0e.tlsPolicyName=void 0;Q0e.tlsPolicy=LCa;Q0e.tlsPolicyName="tlsPolicy";function LCa(t){return{name:Q0e.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(LCa,"tlsPolicy")});var jAr=I(g8=>{"use strict";p();Object.defineProperty(g8,"__esModule",{value:!0});g8.TracingContextImpl=g8.knownContextKeys=void 0;g8.createTracingContext=FCa;g8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function FCa(t={}){let e=new cht(t.parentContext);return t.span&&(e=e.setValue(g8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(g8.knownContextKeys.namespace,t.namespace)),e}a(FCa,"createTracingContext");var cht=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}};g8.TracingContextImpl=cht});var HAr=I(q0e=>{"use strict";p();Object.defineProperty(q0e,"__esModule",{value:!0});q0e.createDefaultTracingSpan=s_i;q0e.createDefaultInstrumenter=a_i;q0e.useInstrumenter=QCa;q0e.getInstrumenter=qCa;var UCa=jAr(),lht=gMt();function s_i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(s_i,"createDefaultTracingSpan");function a_i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:s_i(),tracingContext:(0,UCa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(a_i,"createDefaultInstrumenter");function QCa(t){lht.state.instrumenterImplementation=t}a(QCa,"useInstrumenter");function qCa(){return lht.state.instrumenterImplementation||(lht.state.instrumenterImplementation=a_i()),lht.state.instrumenterImplementation}a(qCa,"getInstrumenter")});var c_i=I($Ar=>{"use strict";p();Object.defineProperty($Ar,"__esModule",{value:!0});$Ar.createTracingClient=jCa;var uht=HAr(),GAr=jAr();function jCa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,uht.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(GAr.knownContextKeys.namespace)||(A=A.setValue(GAr.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(GAr.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,uht.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,uht.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,uht.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(jCa,"createTracingClient")});var l_i=I(j0e=>{"use strict";p();Object.defineProperty(j0e,"__esModule",{value:!0});j0e.createTracingClient=j0e.useInstrumenter=void 0;var HCa=HAr();Object.defineProperty(j0e,"useInstrumenter",{enumerable:!0,get:a(function(){return HCa.useInstrumenter},"get")});var GCa=c_i();Object.defineProperty(j0e,"createTracingClient",{enumerable:!0,get:a(function(){return GCa.createTracingClient},"get")})});var u_i=I(dht=>{"use strict";p();Object.defineProperty(dht,"__esModule",{value:!0});dht.custom=void 0;var $Ca=require("node:util");dht.custom=$Ca.inspect.custom});var fht=I(lMe=>{"use strict";p();Object.defineProperty(lMe,"__esModule",{value:!0});lMe.RestError=void 0;lMe.isRestError=KCa;var VCa=n4(),WCa=u_i(),zCa=Kpt(),YCa=new zCa.Sanitizer,H0e=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)}[WCa.custom](){return`RestError: ${this.message} - ${YCa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};lMe.RestError=H0e;H0e.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";H0e.PARSE_ERROR="PARSE_ERROR";function KCa(t){return t instanceof H0e?!0:(0,VCa.isError)(t)&&t.name==="RestError"}a(KCa,"isRestError")});var VAr=I(G0e=>{"use strict";p();Object.defineProperty(G0e,"__esModule",{value:!0});G0e.tracingPolicyName=void 0;G0e.tracingPolicy=rva;var JCa=l_i(),ZCa=VH(),XCa=IAr(),pht=uee(),uMe=n4(),eva=fht(),tva=Kpt();G0e.tracingPolicyName="tracingPolicy";function rva(t={}){let e=(0,XCa.getUserAgentValue)(t.userAgentPrefix),r=new tva.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=nva();return{name:G0e.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=iva(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return sva(f,m),m}catch(m){throw ova(f,m),m}}}}a(rva,"tracingPolicy");function nva(){try{return(0,JCa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:ZCa.SDK_VERSION})}catch(t){pht.logger.warning(`Error when creating the TracingClient: ${(0,uMe.getErrorMessage)(t)}`);return}}a(nva,"tryCreateTracingClient");function iva(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){pht.logger.warning(`Skipping creating a tracing span due to an error: ${(0,uMe.getErrorMessage)(n)}`);return}}a(iva,"tryCreateSpan");function ova(t,e){try{t.setStatus({status:"error",error:(0,uMe.isError)(e)?e:void 0}),(0,eva.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){pht.logger.warning(`Skipping tracing span processing due to an error: ${(0,uMe.getErrorMessage)(r)}`)}}a(ova,"tryProcessError");function sva(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){pht.logger.warning(`Skipping tracing span processing due to an error: ${(0,uMe.getErrorMessage)(r)}`)}}a(sva,"tryProcessResponse")});var p_i=I(WAr=>{"use strict";p();Object.defineProperty(WAr,"__esModule",{value:!0});WAr.createPipelineFromOptions=yva;var ava=vAr(),cva=Xgr(),lva=bAr(),uva=xAr(),d_i=PAr(),dva=DAr(),fva=OAr(),pva=FAr(),f_i=n4(),hva=UAr(),mva=QAr(),gva=qAr(),Ava=VAr();function yva(t){var e;let r=(0,cva.createEmptyPipeline)();return f_i.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,gva.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,hva.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,dva.decompressResponsePolicy)())),r.addPolicy((0,pva.formDataPolicy)(),{beforePolicies:[d_i.multipartPolicyName]}),r.addPolicy((0,uva.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,mva.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,d_i.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,fva.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,Ava.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),f_i.isNodeLike&&r.addPolicy((0,lva.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,ava.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(yva,"createPipelineFromOptions")});var E_i=I(mht=>{"use strict";p();Object.defineProperty(mht,"__esModule",{value:!0});mht.getBodyLength=y_i;mht.createNodeHttpClient=Tva;var JAr=(OL(),Ca(E7)),zAr=JAr.__importStar(require("node:http")),YAr=JAr.__importStar(require("node:https")),h_i=JAr.__importStar(require("node:zlib")),Eva=require("node:stream"),m_i=iMe(),_va=cMe(),pMe=fht(),dMe=uee(),Cva={};function fMe(t){return t&&typeof t.pipe=="function"}a(fMe,"isReadableStream");function g_i(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(g_i,"isStreamComplete");function A_i(t){return t&&typeof t.byteLength=="number"}a(A_i,"isArrayBuffer");var hht=class extends Eva.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}},KAr=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 m_i.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=y_i(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new hht(E);_.on("error",v=>{dMe.logger.error("Error in upload progress",v)}),fMe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=vva(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?bva(h,m):h;let y=e.onDownloadProgress;if(y){let E=new hht(y);E.on("error",_=>{dMe.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 Sva(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();fMe(d)&&(h=g_i(d));let m=Promise.resolve();fMe(f)&&(m=g_i(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{dMe.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?zAr.request(u,d):YAr.request(u,d);h.once("error",m=>{var g;f(new pMe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:pMe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new m_i.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&fMe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):A_i(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(dMe.logger.error("Unrecognized body type",n),f(new pMe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?zAr.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new zAr.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return YAr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Cva,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(dMe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new YAr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function vva(t){let e=(0,_va.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(vva,"getResponseHeaders");function bva(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=h_i.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=h_i.createInflate();return t.pipe(n),n}return t}a(bva,"getDecodedResponseStream");function Sva(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 pMe.RestError(`Error reading response as text: ${o.message}`,{code:pMe.RestError.PARSE_ERROR}))})})}a(Sva,"streamToText");function y_i(t){return t?Buffer.isBuffer(t)?t.length:fMe(t)?null:A_i(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(y_i,"getBodyLength");function Tva(){return new KAr}a(Tva,"createNodeHttpClient")});var __i=I(ZAr=>{"use strict";p();Object.defineProperty(ZAr,"__esModule",{value:!0});ZAr.createDefaultHttpClient=xva;var Iva=E_i();function xva(){return(0,Iva.createNodeHttpClient)()}a(xva,"createDefaultHttpClient")});var C_i=I(eyr=>{"use strict";p();Object.defineProperty(eyr,"__esModule",{value:!0});eyr.createPipelineRequest=kva;var wva=cMe(),Rva=n4(),XAr=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,wva.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,Rva.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function kva(t){return new XAr(t)}a(kva,"createPipelineRequest")});var v_i=I(hMe=>{"use strict";p();Object.defineProperty(hMe,"__esModule",{value:!0});hMe.exponentialRetryPolicyName=void 0;hMe.exponentialRetryPolicy=Mva;var Pva=oht(),Dva=B0e(),Nva=VH();hMe.exponentialRetryPolicyName="exponentialRetryPolicy";function Mva(t={}){var e;return(0,Dva.retryPolicy)([(0,Pva.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Nva.DEFAULT_RETRY_POLICY_COUNT})}a(Mva,"exponentialRetryPolicy")});var b_i=I($0e=>{"use strict";p();Object.defineProperty($0e,"__esModule",{value:!0});$0e.systemErrorRetryPolicyName=void 0;$0e.systemErrorRetryPolicy=Fva;var Ova=oht(),Bva=B0e(),Lva=VH();$0e.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Fva(t={}){var e;return{name:$0e.systemErrorRetryPolicyName,sendRequest:(0,Bva.retryPolicy)([(0,Ova.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Lva.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Fva,"systemErrorRetryPolicy")});var S_i=I(V0e=>{"use strict";p();Object.defineProperty(V0e,"__esModule",{value:!0});V0e.throttlingRetryPolicyName=void 0;V0e.throttlingRetryPolicy=jva;var Uva=iht(),Qva=B0e(),qva=VH();V0e.throttlingRetryPolicyName="throttlingRetryPolicy";function jva(t={}){var e;return{name:V0e.throttlingRetryPolicyName,sendRequest:(0,Qva.retryPolicy)([(0,Uva.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:qva.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(jva,"throttlingRetryPolicy")});var tyr=I(W0e=>{"use strict";p();Object.defineProperty(W0e,"__esModule",{value:!0});W0e.DEFAULT_CYCLER_OPTIONS=void 0;W0e.createTokenCycler=$va;var Hva=rht();W0e.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Gva(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($va,"createTokenCycler")});var T_i=I(z0e=>{"use strict";p();Object.defineProperty(z0e,"__esModule",{value:!0});z0e.bearerTokenAuthenticationPolicyName=void 0;z0e.bearerTokenAuthenticationPolicy=Kva;var Vva=tyr(),Wva=uee();z0e.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function zva(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(zva,"defaultAuthorizeRequest");function Yva(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(Yva,"getChallenge");function Kva(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||Wva.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:zva,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,Vva.createTokenCycler)(r):()=>Promise.resolve(null);return{name:z0e.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&&Yva(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(Kva,"bearerTokenAuthenticationPolicy")});var I_i=I(Y0e=>{"use strict";p();Object.defineProperty(Y0e,"__esModule",{value:!0});Y0e.ndJsonPolicyName=void 0;Y0e.ndJsonPolicy=Jva;Y0e.ndJsonPolicyName="ndJsonPolicy";function Jva(){return{name:Y0e.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(Jva,"ndJsonPolicy")});var w_i=I(pee=>{"use strict";p();Object.defineProperty(pee,"__esModule",{value:!0});pee.auxiliaryAuthenticationHeaderPolicyName=void 0;pee.auxiliaryAuthenticationHeaderPolicy=tba;var Zva=tyr(),Xva=uee();pee.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var x_i="x-ms-authorization-auxiliary";async function eba(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(eba,"sendAuthorizeRequest");function tba(t){let{credentials:e,scopes:r}=t,n=t.logger||Xva.logger,o=new WeakMap;return{name:pee.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(`${pee.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,Zva.createTokenCycler)(d),o.set(d,f)),l.push(eba({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. ${x_i} header will not be set.`),c(s)):(s.headers.set(x_i,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(tba,"auxiliaryAuthenticationHeaderPolicy")});var V_i=I(Cr=>{"use strict";p();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.createFileFromStream=Cr.createFile=Cr.auxiliaryAuthenticationHeaderPolicyName=Cr.auxiliaryAuthenticationHeaderPolicy=Cr.ndJsonPolicyName=Cr.ndJsonPolicy=Cr.bearerTokenAuthenticationPolicyName=Cr.bearerTokenAuthenticationPolicy=Cr.formDataPolicyName=Cr.formDataPolicy=Cr.tlsPolicyName=Cr.tlsPolicy=Cr.userAgentPolicyName=Cr.userAgentPolicy=Cr.defaultRetryPolicy=Cr.tracingPolicyName=Cr.tracingPolicy=Cr.retryPolicy=Cr.throttlingRetryPolicyName=Cr.throttlingRetryPolicy=Cr.systemErrorRetryPolicyName=Cr.systemErrorRetryPolicy=Cr.redirectPolicyName=Cr.redirectPolicy=Cr.getDefaultProxySettings=Cr.proxyPolicyName=Cr.proxyPolicy=Cr.multipartPolicyName=Cr.multipartPolicy=Cr.logPolicyName=Cr.logPolicy=Cr.setClientRequestIdPolicyName=Cr.setClientRequestIdPolicy=Cr.exponentialRetryPolicyName=Cr.exponentialRetryPolicy=Cr.decompressResponsePolicyName=Cr.decompressResponsePolicy=Cr.isRestError=Cr.RestError=Cr.createPipelineRequest=Cr.createHttpHeaders=Cr.createDefaultHttpClient=Cr.createPipelineFromOptions=Cr.createEmptyPipeline=void 0;var rba=Xgr();Object.defineProperty(Cr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return rba.createEmptyPipeline},"get")});var nba=p_i();Object.defineProperty(Cr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return nba.createPipelineFromOptions},"get")});var iba=__i();Object.defineProperty(Cr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return iba.createDefaultHttpClient},"get")});var oba=cMe();Object.defineProperty(Cr,"createHttpHeaders",{enumerable:!0,get:a(function(){return oba.createHttpHeaders},"get")});var sba=C_i();Object.defineProperty(Cr,"createPipelineRequest",{enumerable:!0,get:a(function(){return sba.createPipelineRequest},"get")});var R_i=fht();Object.defineProperty(Cr,"RestError",{enumerable:!0,get:a(function(){return R_i.RestError},"get")});Object.defineProperty(Cr,"isRestError",{enumerable:!0,get:a(function(){return R_i.isRestError},"get")});var k_i=DAr();Object.defineProperty(Cr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return k_i.decompressResponsePolicy},"get")});Object.defineProperty(Cr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return k_i.decompressResponsePolicyName},"get")});var P_i=v_i();Object.defineProperty(Cr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return P_i.exponentialRetryPolicy},"get")});Object.defineProperty(Cr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return P_i.exponentialRetryPolicyName},"get")});var D_i=QAr();Object.defineProperty(Cr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return D_i.setClientRequestIdPolicy},"get")});Object.defineProperty(Cr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return D_i.setClientRequestIdPolicyName},"get")});var N_i=vAr();Object.defineProperty(Cr,"logPolicy",{enumerable:!0,get:a(function(){return N_i.logPolicy},"get")});Object.defineProperty(Cr,"logPolicyName",{enumerable:!0,get:a(function(){return N_i.logPolicyName},"get")});var M_i=PAr();Object.defineProperty(Cr,"multipartPolicy",{enumerable:!0,get:a(function(){return M_i.multipartPolicy},"get")});Object.defineProperty(Cr,"multipartPolicyName",{enumerable:!0,get:a(function(){return M_i.multipartPolicyName},"get")});var ryr=UAr();Object.defineProperty(Cr,"proxyPolicy",{enumerable:!0,get:a(function(){return ryr.proxyPolicy},"get")});Object.defineProperty(Cr,"proxyPolicyName",{enumerable:!0,get:a(function(){return ryr.proxyPolicyName},"get")});Object.defineProperty(Cr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return ryr.getDefaultProxySettings},"get")});var O_i=bAr();Object.defineProperty(Cr,"redirectPolicy",{enumerable:!0,get:a(function(){return O_i.redirectPolicy},"get")});Object.defineProperty(Cr,"redirectPolicyName",{enumerable:!0,get:a(function(){return O_i.redirectPolicyName},"get")});var B_i=b_i();Object.defineProperty(Cr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return B_i.systemErrorRetryPolicy},"get")});Object.defineProperty(Cr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return B_i.systemErrorRetryPolicyName},"get")});var L_i=S_i();Object.defineProperty(Cr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return L_i.throttlingRetryPolicy},"get")});Object.defineProperty(Cr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return L_i.throttlingRetryPolicyName},"get")});var aba=B0e();Object.defineProperty(Cr,"retryPolicy",{enumerable:!0,get:a(function(){return aba.retryPolicy},"get")});var F_i=VAr();Object.defineProperty(Cr,"tracingPolicy",{enumerable:!0,get:a(function(){return F_i.tracingPolicy},"get")});Object.defineProperty(Cr,"tracingPolicyName",{enumerable:!0,get:a(function(){return F_i.tracingPolicyName},"get")});var cba=OAr();Object.defineProperty(Cr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return cba.defaultRetryPolicy},"get")});var U_i=xAr();Object.defineProperty(Cr,"userAgentPolicy",{enumerable:!0,get:a(function(){return U_i.userAgentPolicy},"get")});Object.defineProperty(Cr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return U_i.userAgentPolicyName},"get")});var Q_i=qAr();Object.defineProperty(Cr,"tlsPolicy",{enumerable:!0,get:a(function(){return Q_i.tlsPolicy},"get")});Object.defineProperty(Cr,"tlsPolicyName",{enumerable:!0,get:a(function(){return Q_i.tlsPolicyName},"get")});var q_i=FAr();Object.defineProperty(Cr,"formDataPolicy",{enumerable:!0,get:a(function(){return q_i.formDataPolicy},"get")});Object.defineProperty(Cr,"formDataPolicyName",{enumerable:!0,get:a(function(){return q_i.formDataPolicyName},"get")});var j_i=T_i();Object.defineProperty(Cr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return j_i.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(Cr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return j_i.bearerTokenAuthenticationPolicyName},"get")});var H_i=I_i();Object.defineProperty(Cr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return H_i.ndJsonPolicy},"get")});Object.defineProperty(Cr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return H_i.ndJsonPolicyName},"get")});var G_i=w_i();Object.defineProperty(Cr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return G_i.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(Cr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return G_i.auxiliaryAuthenticationHeaderPolicyName},"get")});var $_i=wAr();Object.defineProperty(Cr,"createFile",{enumerable:!0,get:a(function(){return $_i.createFile},"get")});Object.defineProperty(Cr,"createFileFromStream",{enumerable:!0,get:a(function(){return $_i.createFileFromStream},"get")})});var z_i=I((gMe,W_i)=>{"use strict";p();var lba=gMe&&gMe.__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())})},uba=gMe&&gMe.__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 mba=$l(),gba=qA(),Aba=(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){mba.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||gba.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})();Y_i.exports=Aba});var J_i=I(nyr=>{"use strict";p();Object.defineProperty(nyr,"__esModule",{value:!0});nyr.azureRoleEnvironmentTelemetryProcessor=yba;function yba(t,e){}a(yba,"azureRoleEnvironmentTelemetryProcessor")});var eCi=I(ght=>{"use strict";p();Object.defineProperty(ght,"__esModule",{value:!0});ght.samplingTelemetryProcessor=Eba;ght.getSamplingHashCode=X_i;var Z_i=_E();function Eba(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&Z_i.TelemetryType.Metric===Z_i.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=X_i(e.correlationContext.operation.id){"use strict";p();var _ba=A8&&A8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cba=A8&&A8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vba=A8&&A8.__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)&&_ba(e,t,r);return Cba(e,t),e};Object.defineProperty(A8,"__esModule",{value:!0});A8.performanceMetricsTelemetryProcessor=bba;var iyr=wpt(),oyr=vba(_E());function bba(t,e){switch(e&&e.addDocument(t),t.data.baseType){case oyr.TelemetryTypeString.Exception:iyr.countException();break;case oyr.TelemetryTypeString.Request:var r=t.data.baseData;iyr.countRequest(r.duration,r.success);break;case oyr.TelemetryTypeString.Dependency:var n=t.data.baseData;iyr.countDependency(n.duration,n.success);break}return!0}a(bba,"performanceMetricsTelemetryProcessor")});var rCi=I(N2=>{"use strict";p();var i4=N2&&N2.__assign||function(){return i4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var Rba=o4&&o4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yht=o4&&o4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rba(e,t,r)};Object.defineProperty(o4,"__esModule",{value:!0});yht(J_i(),o4);yht(eCi(),o4);yht(tCi(),o4);yht(rCi(),o4)});var syr=I((hcp,sCi)=>{"use strict";p();var Zi=_E(),Db=qA(),iCi=FH(),kba=$l(),Pba=(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=Db.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=iCi.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=Db.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=Db.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=Db.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Db.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=Db.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=iCi.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(oCi.regex.test(l)){var u=new oCi(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})(),oCi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Db.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Db.trim(n[2])||this.method,this.fileName=Db.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})();sCi.exports=Pba});var aCi=I(WH=>{"use strict";p();var Dba=WH&&WH.__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())})},Nba=WH&&WH.__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 Eht=EMe&&EMe.__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())})},_ht=EMe&&EMe.__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&&!yMe.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(zH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(zH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return Eht(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return _ht(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 qba.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(zH.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=Nb.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),Uba.gzip(f,function(g,A){var y=A;g?(h._logWarn(Nb.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(Nb.dumpObj(s)),s[Qba.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($ba)&&b.statusCode===400&&(cyr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(Gba.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==Hba||b.statusCode==jba?h._statsbeat.countThrottle(zH.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(zH.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(zH.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var k=JSON.parse(T),D=[];k.errors&&(k.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(zH.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=Nb.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(zH.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,Nb.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,Nb.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r(Nb.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(Nb.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 Eht(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return _ht(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,y8.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: "+Nb.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,yMe.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: "+Nb.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,y8.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: "+Nb.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=hee.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,y8.writeFileAsync(l,Nb.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: "+Nb.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),ayr.existsSync(this._tempDir)||ayr.mkdirSync(this._tempDir),yMe.FileAccessControl.applyACLRulesSync(this._tempDir);var r=y8.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=hee.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),ayr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+Nb.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return Eht(this,void 0,void 0,function(){var e,r,n,o,s,c;return _ht(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,y8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return hee.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=hee.join(this._tempDir,r),[4,y8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,y8.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 Eht(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return _ht(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,y8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return hee.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=hee.join(this._tempDir,e[r]),[4,y8.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})();cCi.exports=Vba});var uCi=I(Cht=>{"use strict";p();Object.defineProperty(Cht,"__esModule",{value:!0});Cht.AzureVirtualMachine=void 0;var lCi=$l(),Wba=qA(),zba=x0e(),Yba="http://169.254.169.254/metadata/instance/compute",Kba="api-version=2017-12-01",Jba="format=json",Zba="UNREACH",Xba=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(Yba,"?").concat(Kba,"&").concat(Jba),l=(n={method:"GET"},n[zba.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=Wba.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){lCi.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(Zba)>-1?s.isVM=!1:lCi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();Cht.AzureVirtualMachine=Xba});var dCi=I(vht=>{"use strict";p();Object.defineProperty(vht,"__esModule",{value:!0});vht.NetworkStatsbeat=void 0;var e1a=(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})();vht.NetworkStatsbeat=e1a});var gCi=I((mee,mCi)=>{"use strict";p();var s4=mee&&mee.__assign||function(){return s4=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:ld.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:ld.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(s4(s4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(s4(s4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(s4(s4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(s4(s4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:ld.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})();mCi.exports=l1a});var ECi=I((kcp,yCi)=>{"use strict";p();var u1a=require("url"),d1a=Kgr(),f1a=z_i(),p1a=_0e(),E8=_E(),h1a=K_i(),fyr=nCi(),ACi=FH(),m1a=gCi(),g1a=lyr(),pyr=qA(),bht=$l(),A1a=syr(),y1a=(function(){function t(e){this._telemetryProcessors=[];var r=new d1a(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 p1a,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new m1a(this.config,this.context),this._statsbeat.enable(!0));var n=new g1a(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new h1a(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,E8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,E8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,E8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,E8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!pyr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,E8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,E8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,E8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new u1a.URL(e.data).host}catch(r){e.target=null,bht.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,E8.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&&E8.telemetryTypeToBaseType(r)){var n=A1a.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&&fyr.samplingTelemetryProcessor(n,{correlationContext:ACi.CorrelationContextManager.getCurrentContext()}),fyr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(fyr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else bht.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||(bht.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new f1a(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=ACi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var E1a=hyr&&hyr.__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)}})(),_1a=ECi(),_Ci=Hgr(),C1a=x0e(),Sht=$l(),v1a=(function(t){E1a(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?_Ci.trackRequestSync(this,r):Sht.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&Sht.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?_Ci.trackRequest(this,r):Sht.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?C1a.trackRequest(this,r):Sht.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(_1a);CCi.exports=v1a});var SCi=I(bCi=>{"use strict";p();Object.defineProperty(bCi,"__esModule",{value:!0})});var wCi=I(pt=>{"use strict";p();Object.defineProperty(pt,"__esModule",{value:!0});pt.Configuration=pt.liveMetricsClient=pt.defaultClient=pt.DistributedTracingModes=void 0;pt.setup=P1a;pt.start=xCi;pt.getCorrelationContext=N1a;pt.startOperation=M1a;pt.wrapWithCorrelationContext=O1a;pt.dispose=B1a;var gyr=FH(),b1a=syi(),S1a=cyi(),Ayr=wpt(),T1a=Rgr(),I1a=yyi(),x1a=Ryi(),w1a=x0e(),R1a=Hgr(),TCi=QX(),_Me=$l(),ICi=lEi(),yyr=dEi(),k1a=hEi();pt.TelemetryClient=vCi();pt.Contracts=_E();pt.azureFunctionsTypes=SCi();var myr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(myr||(pt.DistributedTracingModes=myr={}));var CMe,vMe,bMe,SMe,TMe,J0e,Z0e,gee,IMe,xMe,RT=!1,Tht;function P1a(t){return pt.defaultClient?_Me.info("The default client is already setup"):(pt.defaultClient=new pt.TelemetryClient(t),CMe=new b1a(pt.defaultClient),vMe=new S1a(pt.defaultClient),bMe=new Ayr(pt.defaultClient),SMe=new T1a(pt.defaultClient),TMe=new I1a(pt.defaultClient),J0e=new x1a(pt.defaultClient),gee=new R1a(pt.defaultClient),IMe=new w1a(pt.defaultClient),Z0e||(Z0e=new yyr.AutoCollectNativePerformance(pt.defaultClient)),xMe=new k1a.AzureFunctionsHook(pt.defaultClient)),Eyr}a(P1a,"setup");function D1a(){pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectExternalLoggers==null&&(pt.defaultClient.config.enableAutoCollectExternalLoggers=!0),pt.defaultClient.config.enableAutoCollectConsole==null&&(pt.defaultClient.config.enableAutoCollectConsole=!1),pt.defaultClient.config.enableAutoCollectExceptions==null&&(pt.defaultClient.config.enableAutoCollectExceptions=!0),pt.defaultClient.config.enableAutoCollectPerformance==null&&(pt.defaultClient.config.enableAutoCollectPerformance=!0),pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),pt.defaultClient.config.enableAutoCollectHeartbeat==null&&(pt.defaultClient.config.enableAutoCollectHeartbeat=!0),pt.defaultClient.config.enableAutoCollectRequests==null&&(pt.defaultClient.config.enableAutoCollectRequests=!0),pt.defaultClient.config.enableAutoCollectDependencies==null&&(pt.defaultClient.config.enableAutoCollectDependencies=!0),pt.defaultClient.config.enableUseDiskRetryCaching==null&&(pt.defaultClient.config.enableUseDiskRetryCaching=!0),pt.defaultClient.config.enableAutoDependencyCorrelation==null&&(pt.defaultClient.config.enableAutoDependencyCorrelation=!0),pt.defaultClient.config.enableSendLiveMetrics==null&&(pt.defaultClient.config.enableSendLiveMetrics=!1),pt.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(pt.defaultClient.config.enableAutoCollectExtendedMetrics=!0),pt.defaultClient.config.enableWebInstrumentation==null&&(pt.defaultClient.config.enableWebInstrumentation=!1),pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(D1a,"_setDefaultConfig");function xCi(){if(pt.defaultClient){RT=!0,D1a(),CMe.enable(pt.defaultClient.config.enableAutoCollectExternalLoggers,pt.defaultClient.config.enableAutoCollectConsole),vMe.enable(pt.defaultClient.config.enableAutoCollectExceptions),bMe.enable(pt.defaultClient.config.enableAutoCollectPerformance),SMe.enable(pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics),TMe.enable(pt.defaultClient.config.enableAutoCollectHeartbeat),gee.useAutoCorrelation(pt.defaultClient.config.enableAutoDependencyCorrelation,pt.defaultClient.config.enableUseAsyncHooks),gee.enable(pt.defaultClient.config.enableAutoCollectRequests),IMe.enable(pt.defaultClient.config.enableAutoCollectDependencies),J0e.enable(pt.defaultClient.config.enableWebInstrumentation,pt.defaultClient.config.webInstrumentationConnectionString),pt.defaultClient.config.enableSendLiveMetrics&&(pt.liveMetricsClient||(pt.liveMetricsClient=new ICi(pt.defaultClient.config,pt.defaultClient.context,pt.defaultClient.getAuthorizationHandler,pt.defaultClient),Tht=new Ayr(pt.liveMetricsClient,1e3,!0),pt.liveMetricsClient.addCollector(Tht),pt.defaultClient.quickPulseClient=pt.liveMetricsClient),pt.liveMetricsClient.enable(pt.defaultClient.config.enableSendLiveMetrics)),xMe.enable(pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=yyr.AutoCollectNativePerformance.parseEnabled(pt.defaultClient.config.enableAutoCollectExtendedMetrics,pt.defaultClient.config);Z0e.enable(pt.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),pt.defaultClient&&pt.defaultClient.channel&&pt.defaultClient.channel.setUseDiskRetryCaching(pt.defaultClient.config.enableUseDiskRetryCaching,pt.defaultClient.config.enableResendInterval,pt.defaultClient.config.enableMaxBytesOnDisk)}else _Me.warn("Start cannot be called before setup");return Eyr}a(xCi,"start");function N1a(){return gyr.CorrelationContextManager.getCurrentContext()}a(N1a,"getCorrelationContext");function M1a(t,e){return gyr.CorrelationContextManager.startOperation(t,e)}a(M1a,"startOperation");function O1a(t,e){return gyr.CorrelationContextManager.wrapCallback(t,e)}a(O1a,"wrapWithCorrelationContext");var Eyr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return TCi.w3cEnabled=e===myr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectExternalLoggers=e,pt.defaultClient.config.enableAutoCollectConsole=r,RT&&CMe.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectExceptions=e,RT&&vMe.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),pt.defaultClient){pt.defaultClient.config.enableAutoCollectPerformance=e;var n=yyr.AutoCollectNativePerformance.parseEnabled(r,pt.defaultClient.config);pt.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,RT&&(bMe.enable(e),Z0e.enable(pt.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,RT&&SMe.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectHeartbeat=e,RT&&TMe.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return pt.defaultClient&&(pt.defaultClient.config.enableWebInstrumentation=e,pt.defaultClient.config.webInstrumentationConnectionString=r,RT&&J0e.enable(pt.defaultClient.config.enableAutoWebSnippetInjection,pt.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return pt.defaultClient&&(pt.defaultClient.config.enableWebInstrumentation=e,pt.defaultClient.config.webInstrumentationConnectionString=r,RT&&J0e.enable(pt.defaultClient.config.enableWebInstrumentation,pt.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectRequests=e,RT&&gee.enable(e)),t},t.setAutoCollectDependencies=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectDependencies=e,RT&&IMe.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return pt.defaultClient&&(pt.defaultClient.config.enableAutoDependencyCorrelation=e,pt.defaultClient.config.enableUseAsyncHooks=r,RT&&gee.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return pt.defaultClient&&(pt.defaultClient.config.enableUseDiskRetryCaching=e,pt.defaultClient.config.enableResendInterval=r,pt.defaultClient.config.enableMaxBytesOnDisk=n,pt.defaultClient.channel&&pt.defaultClient.channel.setUseDiskRetryCaching(pt.defaultClient.config.enableUseDiskRetryCaching,pt.defaultClient.config.enableResendInterval,pt.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),_Me.enableDebug=e,_Me.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,RT&&xMe.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),pt.defaultClient?(!pt.liveMetricsClient&&e?(pt.liveMetricsClient=new ICi(pt.defaultClient.config,pt.defaultClient.context,pt.defaultClient.getAuthorizationHandler,pt.defaultClient),Tht=new Ayr(pt.liveMetricsClient,1e3,!0),pt.liveMetricsClient.addCollector(Tht),pt.defaultClient.quickPulseClient=pt.liveMetricsClient):pt.liveMetricsClient&&pt.liveMetricsClient.enable(e),pt.defaultClient.config.enableSendLiveMetrics=e,t):(_Me.warn("Live metrics client cannot be setup without the default client"),t)},t.start=xCi,t})();pt.Configuration=Eyr;function B1a(){TCi.w3cEnabled=!0,pt.defaultClient=null,RT=!1,CMe&&CMe.dispose(),vMe&&vMe.dispose(),bMe&&bMe.dispose(),SMe&&SMe.dispose(),TMe&&TMe.dispose(),J0e&&J0e.dispose(),Z0e&&Z0e.dispose(),gee&&gee.dispose(),IMe&&IMe.dispose(),pt.liveMetricsClient&&(pt.liveMetricsClient.enable(!1),pt.liveMetricsClient=void 0),xMe&&xMe.dispose()}a(B1a,"dispose")});var Cyr=I(rR=>{"use strict";p();var L1a=rR&&rR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F1a=rR&&rR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RCi=rR&&rR.__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 j1a(e)?kCi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};rR.AzureInsightReporter=_yr;function H1a(t,e,r){let n=new U1a.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,PCi(t,e,n),n}a(H1a,"createAppInsightsClient");function PCi(t,e,r){r.commonProperties=G1a(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(PCi,"configureReporter");function G1a(t,e){return t=t||{},t.common_os=Iht.platform(),t.common_platformversion=Iht.release(),t.common_arch=Iht.arch(),t.common_cpu=Array.from(new Set(Iht.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(G1a,"decorateWithCommonProperties")});var DCi=I((Hcp,$1a)=>{$1a.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.51.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.123.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=Qga(n);o&&t.headers.set("Content-Length",o),t.body=await(0,Oga.concat)(n)}a(qga,"buildRequestBody");d0e.multipartPolicyName="multipartPolicy";var jga=70,Hga=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function Gga(t){if(t.length>jga)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!Hga.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(Gga,"assertValidBoundary");function $ga(){return{name:d0e.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?Gga(n):n=Lga(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await qga(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a($ga,"multipartPolicy")});var wgr=I(f0e=>{"use strict";p();Object.defineProperty(f0e,"__esModule",{value:!0});f0e.decompressResponsePolicyName=void 0;f0e.decompressResponsePolicy=Vga;f0e.decompressResponsePolicyName="decompressResponsePolicy";function Vga(){return{name:f0e.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(Vga,"decompressResponsePolicy")});var _pt=I(Ept=>{"use strict";p();Object.defineProperty(Ept,"__esModule",{value:!0});Ept.delay=Yga;Ept.parseHeaderValueAsNumber=Kga;var Wga=kNe(),zga="The operation was aborted.";function Yga(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new Wga.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:zga)),"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(Yga,"delay");function Kga(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Kga,"parseHeaderValueAsNumber")});var Cpt=I(vpt=>{"use strict";p();Object.defineProperty(vpt,"__esModule",{value:!0});vpt.isThrottlingRetryResponse=Xga;vpt.throttlingRetryStrategy=eAa;var Jga=_pt(),Rgr="Retry-After",Zga=["retry-after-ms","x-ms-retry-after-ms",Rgr];function Syi(t){if(t&&[429,503].includes(t.status))try{for(let o of Zga){let s=(0,Jga.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===Rgr?1e3:1)}let e=t.headers.get(Rgr);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Syi,"getRetryAfterInMs");function Xga(t){return Number.isFinite(Syi(t))}a(Xga,"isThrottlingRetryResponse");function eAa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Syi(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(eAa,"throttlingRetryStrategy")});var bpt=I(MNe=>{"use strict";p();Object.defineProperty(MNe,"__esModule",{value:!0});MNe.exponentialRetryStrategy=oAa;MNe.isExponentialRetryResponse=Tyi;MNe.isSystemError=Iyi;var tAa=$5(),rAa=Cpt(),nAa=1e3,iAa=1e3*64;function oAa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:nAa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:iAa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=Iyi(u),f=d&&t.ignoreSystemErrors,h=Tyi(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,rAa.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,tAa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(oAa,"exponentialRetryStrategy");function Tyi(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(Tyi,"isExponentialRetryResponse");function Iyi(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(Iyi,"isSystemError")});var p0e=I(Pgr=>{"use strict";p();Object.defineProperty(Pgr,"__esModule",{value:!0});Pgr.retryPolicy=uAa;var sAa=_pt(),aAa=Cdt(),cAa=kNe(),xyi=wH(),wyi=(0,aAa.createClientLogger)("core-rest-pipeline retryPolicy"),lAa="retryPolicy";function uAa(t,e={maxRetries:xyi.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||wyi;return{name:lAa,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 cAa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:xyi.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||wyi;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,sAa.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(uAa,"retryPolicy")});var kgr=I(h0e=>{"use strict";p();Object.defineProperty(h0e,"__esModule",{value:!0});h0e.defaultRetryPolicyName=void 0;h0e.defaultRetryPolicy=mAa;var dAa=bpt(),fAa=Cpt(),pAa=p0e(),hAa=wH();h0e.defaultRetryPolicyName="defaultRetryPolicy";function mAa(t={}){var e;return{name:h0e.defaultRetryPolicyName,sendRequest:(0,pAa.retryPolicy)([(0,fAa.throttlingRetryStrategy)(),(0,dAa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:hAa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(mAa,"defaultRetryPolicy")});var ONe=I(Ngr=>{"use strict";p();Object.defineProperty(Ngr,"__esModule",{value:!0});Ngr.createHttpHeaders=AAa;function Spt(t){return t.toLowerCase()}a(Spt,"normalizeName");function*gAa(t){for(let e of t.values())yield[e.name,e.value]}a(gAa,"headerIterator");var Dgr=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(Spt(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(Spt(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(Spt(e))}delete(e){this._headersMap.delete(Spt(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 gAa(this._headersMap)}};function AAa(t){return new Dgr(t)}a(AAa,"createHttpHeaders")});var Mgr=I(m0e=>{"use strict";p();Object.defineProperty(m0e,"__esModule",{value:!0});m0e.formDataPolicyName=void 0;m0e.formDataPolicy=EAa;var Pyi=$5(),Ryi=ONe();m0e.formDataPolicyName="formDataPolicy";function yAa(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(yAa,"formDataToFormDataMap");function EAa(){return{name:m0e.formDataPolicyName,async sendRequest(t,e){if(Pyi.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=yAa(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=_Aa(t.formData):await vAa(t.formData,t),t.formData=void 0}return e(t)}}}a(EAa,"formDataPolicy");function _Aa(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(_Aa,"wwwFormUrlEncode");async function vAa(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,Ryi.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,Pyi.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,Ryi.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(vAa,"prepareFormData")});var Ogr=I(zw=>{"use strict";p();Object.defineProperty(zw,"__esModule",{value:!0});zw.globalNoProxyList=zw.proxyPolicyName=void 0;zw.loadNoProxy=Oyi;zw.getDefaultProxySettings=kAa;zw.proxyPolicy=NAa;var CAa=Q4t(),bAa=q4t(),SAa=VX(),TAa="HTTPS_PROXY",IAa="HTTP_PROXY",xAa="ALL_PROXY",wAa="NO_PROXY";zw.proxyPolicyName="proxyPolicy";zw.globalNoProxyList=[];var Nyi=!1,RAa=new Map;function Tpt(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(Tpt,"getEnvironmentValue");function Myi(){if(!process)return;let t=Tpt(TAa),e=Tpt(xAa),r=Tpt(IAa);return t||e||r}a(Myi,"loadEnvironmentProxyValue");function PAa(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(PAa,"isBypassed");function Oyi(){let t=Tpt(wAa);return Nyi=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(Oyi,"loadNoProxy");function kAa(t){if(!t&&(t=Myi(),!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(kAa,"getDefaultProxySettings");function DAa(){let t=Myi();return t?new URL(t):void 0}a(DAa,"getDefaultProxySettingsInternal");function kyi(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(kyi,"getUrlFromProxySettings");function Dyi(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&SAa.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 bAa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new CAa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Dyi,"setProxyAgentOnRequest");function NAa(t,e){Nyi||zw.globalNoProxyList.push(...Oyi());let r=t?kyi(t):DAa(),n={};return{name:zw.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!PAa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:zw.globalNoProxyList,e?.customNoProxyList?void 0:RAa)?Dyi(o,n,r):o.proxySettings&&Dyi(o,n,kyi(o.proxySettings)),s(o)}}}a(NAa,"proxyPolicy")});var Bgr=I(g0e=>{"use strict";p();Object.defineProperty(g0e,"__esModule",{value:!0});g0e.setClientRequestIdPolicyName=void 0;g0e.setClientRequestIdPolicy=MAa;g0e.setClientRequestIdPolicyName="setClientRequestIdPolicy";function MAa(t="x-ms-client-request-id"){return{name:g0e.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(MAa,"setClientRequestIdPolicy")});var Lgr=I(A0e=>{"use strict";p();Object.defineProperty(A0e,"__esModule",{value:!0});A0e.tlsPolicyName=void 0;A0e.tlsPolicy=OAa;A0e.tlsPolicyName="tlsPolicy";function OAa(t){return{name:A0e.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(OAa,"tlsPolicy")});var Fgr=I(t8=>{"use strict";p();Object.defineProperty(t8,"__esModule",{value:!0});t8.TracingContextImpl=t8.knownContextKeys=void 0;t8.createTracingContext=BAa;t8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function BAa(t={}){let e=new Ipt(t.parentContext);return t.span&&(e=e.setValue(t8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(t8.knownContextKeys.namespace,t.namespace)),e}a(BAa,"createTracingContext");var Ipt=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}};t8.TracingContextImpl=Ipt});var Ugr=I(y0e=>{"use strict";p();Object.defineProperty(y0e,"__esModule",{value:!0});y0e.createDefaultTracingSpan=Byi;y0e.createDefaultInstrumenter=Lyi;y0e.useInstrumenter=FAa;y0e.getInstrumenter=UAa;var LAa=Fgr(),xpt=MNt();function Byi(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(Byi,"createDefaultTracingSpan");function Lyi(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:Byi(),tracingContext:(0,LAa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(Lyi,"createDefaultInstrumenter");function FAa(t){xpt.state.instrumenterImplementation=t}a(FAa,"useInstrumenter");function UAa(){return xpt.state.instrumenterImplementation||(xpt.state.instrumenterImplementation=Lyi()),xpt.state.instrumenterImplementation}a(UAa,"getInstrumenter")});var Fyi=I(qgr=>{"use strict";p();Object.defineProperty(qgr,"__esModule",{value:!0});qgr.createTracingClient=QAa;var wpt=Ugr(),Qgr=Fgr();function QAa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,wpt.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(Qgr.knownContextKeys.namespace)||(A=A.setValue(Qgr.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(Qgr.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,wpt.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,wpt.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,wpt.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(QAa,"createTracingClient")});var Uyi=I(E0e=>{"use strict";p();Object.defineProperty(E0e,"__esModule",{value:!0});E0e.createTracingClient=E0e.useInstrumenter=void 0;var qAa=Ugr();Object.defineProperty(E0e,"useInstrumenter",{enumerable:!0,get:a(function(){return qAa.useInstrumenter},"get")});var jAa=Fyi();Object.defineProperty(E0e,"createTracingClient",{enumerable:!0,get:a(function(){return jAa.createTracingClient},"get")})});var Qyi=I(Rpt=>{"use strict";p();Object.defineProperty(Rpt,"__esModule",{value:!0});Rpt.custom=void 0;var HAa=require("node:util");Rpt.custom=HAa.inspect.custom});var Ppt=I(BNe=>{"use strict";p();Object.defineProperty(BNe,"__esModule",{value:!0});BNe.RestError=void 0;BNe.isRestError=zAa;var GAa=$5(),$Aa=Qyi(),VAa=hpt(),WAa=new VAa.Sanitizer,_0e=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)}[$Aa.custom](){return`RestError: ${this.message} + ${WAa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};BNe.RestError=_0e;_0e.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";_0e.PARSE_ERROR="PARSE_ERROR";function zAa(t){return t instanceof _0e?!0:(0,GAa.isError)(t)&&t.name==="RestError"}a(zAa,"isRestError")});var jgr=I(v0e=>{"use strict";p();Object.defineProperty(v0e,"__esModule",{value:!0});v0e.tracingPolicyName=void 0;v0e.tracingPolicy=eya;var YAa=Uyi(),KAa=wH(),JAa=Cgr(),kpt=VX(),LNe=$5(),ZAa=Ppt(),XAa=hpt();v0e.tracingPolicyName="tracingPolicy";function eya(t={}){let e=(0,JAa.getUserAgentValue)(t.userAgentPrefix),r=new XAa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=tya();return{name:v0e.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=rya(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return iya(f,m),m}catch(m){throw nya(f,m),m}}}}a(eya,"tracingPolicy");function tya(){try{return(0,YAa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:KAa.SDK_VERSION})}catch(t){kpt.logger.warning(`Error when creating the TracingClient: ${(0,LNe.getErrorMessage)(t)}`);return}}a(tya,"tryCreateTracingClient");function rya(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){kpt.logger.warning(`Skipping creating a tracing span due to an error: ${(0,LNe.getErrorMessage)(n)}`);return}}a(rya,"tryCreateSpan");function nya(t,e){try{t.setStatus({status:"error",error:(0,LNe.isError)(e)?e:void 0}),(0,ZAa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){kpt.logger.warning(`Skipping tracing span processing due to an error: ${(0,LNe.getErrorMessage)(r)}`)}}a(nya,"tryProcessError");function iya(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){kpt.logger.warning(`Skipping tracing span processing due to an error: ${(0,LNe.getErrorMessage)(r)}`)}}a(iya,"tryProcessResponse")});var Hyi=I(Hgr=>{"use strict";p();Object.defineProperty(Hgr,"__esModule",{value:!0});Hgr.createPipelineFromOptions=gya;var oya=ygr(),sya=Ymr(),aya=Egr(),cya=bgr(),qyi=xgr(),lya=wgr(),uya=kgr(),dya=Mgr(),jyi=$5(),fya=Ogr(),pya=Bgr(),hya=Lgr(),mya=jgr();function gya(t){var e;let r=(0,sya.createEmptyPipeline)();return jyi.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,hya.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,fya.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,lya.decompressResponsePolicy)())),r.addPolicy((0,dya.formDataPolicy)(),{beforePolicies:[qyi.multipartPolicyName]}),r.addPolicy((0,cya.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,pya.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,qyi.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,uya.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,mya.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),jyi.isNodeLike&&r.addPolicy((0,aya.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,oya.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(gya,"createPipelineFromOptions")});var Yyi=I(Npt=>{"use strict";p();Object.defineProperty(Npt,"__esModule",{value:!0});Npt.getBodyLength=zyi;Npt.createNodeHttpClient=bya;var Wgr=(bL(),ya(s7)),Ggr=Wgr.__importStar(require("node:http")),$gr=Wgr.__importStar(require("node:https")),Gyi=Wgr.__importStar(require("node:zlib")),Aya=require("node:stream"),$yi=kNe(),yya=ONe(),QNe=Ppt(),FNe=VX(),Eya={};function UNe(t){return t&&typeof t.pipe=="function"}a(UNe,"isReadableStream");function Vyi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(Vyi,"isStreamComplete");function Wyi(t){return t&&typeof t.byteLength=="number"}a(Wyi,"isArrayBuffer");var Dpt=class extends Aya.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}},Vgr=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 $yi.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=zyi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new Dpt(E);_.on("error",v=>{FNe.logger.error("Error in upload progress",v)}),UNe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=_ya(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?vya(h,m):h;let y=e.onDownloadProgress;if(y){let E=new Dpt(y);E.on("error",_=>{FNe.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 Cya(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();UNe(d)&&(h=Vyi(d));let m=Promise.resolve();UNe(f)&&(m=Vyi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{FNe.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?Ggr.request(u,d):$gr.request(u,d);h.once("error",m=>{var g;f(new QNe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:QNe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new $yi.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&UNe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Wyi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(FNe.logger.error("Unrecognized body type",n),f(new QNe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Ggr.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Ggr.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return $gr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Eya,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(FNe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new $gr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function _ya(t){let e=(0,yya.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(_ya,"getResponseHeaders");function vya(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=Gyi.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=Gyi.createInflate();return t.pipe(n),n}return t}a(vya,"getDecodedResponseStream");function Cya(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 QNe.RestError(`Error reading response as text: ${o.message}`,{code:QNe.RestError.PARSE_ERROR}))})})}a(Cya,"streamToText");function zyi(t){return t?Buffer.isBuffer(t)?t.length:UNe(t)?null:Wyi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(zyi,"getBodyLength");function bya(){return new Vgr}a(bya,"createNodeHttpClient")});var Kyi=I(zgr=>{"use strict";p();Object.defineProperty(zgr,"__esModule",{value:!0});zgr.createDefaultHttpClient=Tya;var Sya=Yyi();function Tya(){return(0,Sya.createNodeHttpClient)()}a(Tya,"createDefaultHttpClient")});var Jyi=I(Kgr=>{"use strict";p();Object.defineProperty(Kgr,"__esModule",{value:!0});Kgr.createPipelineRequest=wya;var Iya=ONe(),xya=$5(),Ygr=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,Iya.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,xya.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function wya(t){return new Ygr(t)}a(wya,"createPipelineRequest")});var Zyi=I(qNe=>{"use strict";p();Object.defineProperty(qNe,"__esModule",{value:!0});qNe.exponentialRetryPolicyName=void 0;qNe.exponentialRetryPolicy=Dya;var Rya=bpt(),Pya=p0e(),kya=wH();qNe.exponentialRetryPolicyName="exponentialRetryPolicy";function Dya(t={}){var e;return(0,Pya.retryPolicy)([(0,Rya.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:kya.DEFAULT_RETRY_POLICY_COUNT})}a(Dya,"exponentialRetryPolicy")});var Xyi=I(C0e=>{"use strict";p();Object.defineProperty(C0e,"__esModule",{value:!0});C0e.systemErrorRetryPolicyName=void 0;C0e.systemErrorRetryPolicy=Bya;var Nya=bpt(),Mya=p0e(),Oya=wH();C0e.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Bya(t={}){var e;return{name:C0e.systemErrorRetryPolicyName,sendRequest:(0,Mya.retryPolicy)([(0,Nya.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Oya.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Bya,"systemErrorRetryPolicy")});var eEi=I(b0e=>{"use strict";p();Object.defineProperty(b0e,"__esModule",{value:!0});b0e.throttlingRetryPolicyName=void 0;b0e.throttlingRetryPolicy=Qya;var Lya=Cpt(),Fya=p0e(),Uya=wH();b0e.throttlingRetryPolicyName="throttlingRetryPolicy";function Qya(t={}){var e;return{name:b0e.throttlingRetryPolicyName,sendRequest:(0,Fya.retryPolicy)([(0,Lya.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Uya.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Qya,"throttlingRetryPolicy")});var Jgr=I(S0e=>{"use strict";p();Object.defineProperty(S0e,"__esModule",{value:!0});S0e.DEFAULT_CYCLER_OPTIONS=void 0;S0e.createTokenCycler=Hya;var qya=_pt();S0e.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function jya(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(Hya,"createTokenCycler")});var tEi=I(T0e=>{"use strict";p();Object.defineProperty(T0e,"__esModule",{value:!0});T0e.bearerTokenAuthenticationPolicyName=void 0;T0e.bearerTokenAuthenticationPolicy=zya;var Gya=Jgr(),$ya=VX();T0e.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function Vya(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(Vya,"defaultAuthorizeRequest");function Wya(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(Wya,"getChallenge");function zya(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||$ya.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:Vya,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,Gya.createTokenCycler)(r):()=>Promise.resolve(null);return{name:T0e.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&&Wya(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(zya,"bearerTokenAuthenticationPolicy")});var rEi=I(I0e=>{"use strict";p();Object.defineProperty(I0e,"__esModule",{value:!0});I0e.ndJsonPolicyName=void 0;I0e.ndJsonPolicy=Yya;I0e.ndJsonPolicyName="ndJsonPolicy";function Yya(){return{name:I0e.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(Yya,"ndJsonPolicy")});var iEi=I(YX=>{"use strict";p();Object.defineProperty(YX,"__esModule",{value:!0});YX.auxiliaryAuthenticationHeaderPolicyName=void 0;YX.auxiliaryAuthenticationHeaderPolicy=Xya;var Kya=Jgr(),Jya=VX();YX.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var nEi="x-ms-authorization-auxiliary";async function Zya(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(Zya,"sendAuthorizeRequest");function Xya(t){let{credentials:e,scopes:r}=t,n=t.logger||Jya.logger,o=new WeakMap;return{name:YX.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(`${YX.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,Kya.createTokenCycler)(d),o.set(d,f)),l.push(Zya({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. ${nEi} header will not be set.`),c(s)):(s.headers.set(nEi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(Xya,"auxiliaryAuthenticationHeaderPolicy")});var CEi=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 eEa=Ymr();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return eEa.createEmptyPipeline},"get")});var tEa=Hyi();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return tEa.createPipelineFromOptions},"get")});var rEa=Kyi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return rEa.createDefaultHttpClient},"get")});var nEa=ONe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return nEa.createHttpHeaders},"get")});var iEa=Jyi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return iEa.createPipelineRequest},"get")});var oEi=Ppt();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return oEi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return oEi.isRestError},"get")});var sEi=wgr();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return sEi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return sEi.decompressResponsePolicyName},"get")});var aEi=Zyi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return aEi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return aEi.exponentialRetryPolicyName},"get")});var cEi=Bgr();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return cEi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return cEi.setClientRequestIdPolicyName},"get")});var lEi=ygr();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return lEi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return lEi.logPolicyName},"get")});var uEi=xgr();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return uEi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return uEi.multipartPolicyName},"get")});var Zgr=Ogr();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return Zgr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return Zgr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return Zgr.getDefaultProxySettings},"get")});var dEi=Egr();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return dEi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return dEi.redirectPolicyName},"get")});var fEi=Xyi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return fEi.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return fEi.systemErrorRetryPolicyName},"get")});var pEi=eEi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return pEi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return pEi.throttlingRetryPolicyName},"get")});var oEa=p0e();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return oEa.retryPolicy},"get")});var hEi=jgr();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return hEi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return hEi.tracingPolicyName},"get")});var sEa=kgr();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return sEa.defaultRetryPolicy},"get")});var mEi=bgr();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return mEi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return mEi.userAgentPolicyName},"get")});var gEi=Lgr();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return gEi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return gEi.tlsPolicyName},"get")});var AEi=Mgr();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return AEi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return AEi.formDataPolicyName},"get")});var yEi=tEi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return yEi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return yEi.bearerTokenAuthenticationPolicyName},"get")});var EEi=rEi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return EEi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return EEi.ndJsonPolicyName},"get")});var _Ei=iEi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return _Ei.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return _Ei.auxiliaryAuthenticationHeaderPolicyName},"get")});var vEi=Sgr();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return vEi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return vEi.createFileFromStream},"get")})});var SEi=I((HNe,bEi)=>{"use strict";p();var aEa=HNe&&HNe.__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())})},cEa=HNe&&HNe.__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 pEa=jl(),hEa=VA(),mEa=(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){pEa.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||hEa.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})();TEi.exports=mEa});var xEi=I(Xgr=>{"use strict";p();Object.defineProperty(Xgr,"__esModule",{value:!0});Xgr.azureRoleEnvironmentTelemetryProcessor=gEa;function gEa(t,e){}a(gEa,"azureRoleEnvironmentTelemetryProcessor")});var PEi=I(Mpt=>{"use strict";p();Object.defineProperty(Mpt,"__esModule",{value:!0});Mpt.samplingTelemetryProcessor=AEa;Mpt.getSamplingHashCode=REi;var wEi=AE();function AEa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&wEi.TelemetryType.Metric===wEi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=REi(e.correlationContext.operation.id){"use strict";p();var yEa=r8&&r8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EEa=r8&&r8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_Ea=r8&&r8.__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)&&yEa(e,t,r);return EEa(e,t),e};Object.defineProperty(r8,"__esModule",{value:!0});r8.performanceMetricsTelemetryProcessor=vEa;var eAr=Vft(),tAr=_Ea(AE());function vEa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case tAr.TelemetryTypeString.Exception:eAr.countException();break;case tAr.TelemetryTypeString.Request:var r=t.data.baseData;eAr.countRequest(r.duration,r.success);break;case tAr.TelemetryTypeString.Dependency:var n=t.data.baseData;eAr.countDependency(n.duration,n.success);break}return!0}a(vEa,"performanceMetricsTelemetryProcessor")});var DEi=I(T2=>{"use strict";p();var V5=T2&&T2.__assign||function(){return V5=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var xEa=W5&&W5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bpt=W5&&W5.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xEa(e,t,r)};Object.defineProperty(W5,"__esModule",{value:!0});Bpt(xEi(),W5);Bpt(PEi(),W5);Bpt(kEi(),W5);Bpt(DEi(),W5)});var rAr=I((Inp,BEi)=>{"use strict";p();var Ji=AE(),Sb=VA(),MEi=_H(),wEa=jl(),REa=(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=Sb.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=MEi.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=Sb.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=Sb.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=Sb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Sb.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=Sb.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=MEi.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(OEi.regex.test(l)){var u=new OEi(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})(),OEi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Sb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Sb.trim(n[2])||this.method,this.fileName=Sb.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})();BEi.exports=REa});var LEi=I(RH=>{"use strict";p();var PEa=RH&&RH.__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())})},kEa=RH&&RH.__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 Lpt=VNe&&VNe.__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())})},Fpt=VNe&&VNe.__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&&!$Ne.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(PH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(PH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return Lpt(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return Fpt(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 UEa.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(PH.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=Tb.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),LEa.gzip(f,function(g,A){var y=A;g?(h._logWarn(Tb.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(Tb.dumpObj(s)),s[FEa.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(HEa)&&b.statusCode===400&&(iAr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(jEa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==qEa||b.statusCode==QEa?h._statsbeat.countThrottle(PH.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(PH.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(PH.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(PH.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=Tb.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(PH.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,Tb.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,Tb.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r(Tb.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(Tb.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 Lpt(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return Fpt(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,n8.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: "+Tb.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,$Ne.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: "+Tb.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,n8.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: "+Tb.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=KX.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,n8.writeFileAsync(l,Tb.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: "+Tb.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),nAr.existsSync(this._tempDir)||nAr.mkdirSync(this._tempDir),$Ne.FileAccessControl.applyACLRulesSync(this._tempDir);var r=n8.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=KX.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),nAr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+Tb.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return Lpt(this,void 0,void 0,function(){var e,r,n,o,s,c;return Fpt(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,n8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return KX.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=KX.join(this._tempDir,r),[4,n8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,n8.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 Lpt(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return Fpt(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,n8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return KX.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=KX.join(this._tempDir,e[r]),[4,n8.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})();FEi.exports=GEa});var QEi=I(Upt=>{"use strict";p();Object.defineProperty(Upt,"__esModule",{value:!0});Upt.AzureVirtualMachine=void 0;var UEi=jl(),$Ea=VA(),VEa=i0e(),WEa="http://169.254.169.254/metadata/instance/compute",zEa="api-version=2017-12-01",YEa="format=json",KEa="UNREACH",JEa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(WEa,"?").concat(zEa,"&").concat(YEa),l=(n={method:"GET"},n[VEa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=$Ea.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){UEi.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(KEa)>-1?s.isVM=!1:UEi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();Upt.AzureVirtualMachine=JEa});var qEi=I(Qpt=>{"use strict";p();Object.defineProperty(Qpt,"__esModule",{value:!0});Qpt.NetworkStatsbeat=void 0;var ZEa=(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})();Qpt.NetworkStatsbeat=ZEa});var VEi=I((JX,$Ei)=>{"use strict";p();var z5=JX&&JX.__assign||function(){return z5=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:ld.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:ld.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(z5(z5({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(z5(z5({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(z5(z5({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(z5(z5({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:ld.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})();$Ei.exports=a_a});var YEi=I((jnp,zEi)=>{"use strict";p();var c_a=require("url"),l_a=Vmr(),u_a=SEi(),d_a=Jhe(),i8=AE(),f_a=IEi(),cAr=NEi(),WEi=_H(),p_a=VEi(),h_a=oAr(),lAr=VA(),qpt=jl(),m_a=rAr(),g_a=(function(){function t(e){this._telemetryProcessors=[];var r=new l_a(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 d_a,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new p_a(this.config,this.context),this._statsbeat.enable(!0));var n=new h_a(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new f_a(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,i8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,i8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,i8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,i8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!lAr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,i8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,i8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,i8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new c_a.URL(e.data).host}catch(r){e.target=null,qpt.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,i8.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&&i8.telemetryTypeToBaseType(r)){var n=m_a.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&&cAr.samplingTelemetryProcessor(n,{correlationContext:WEi.CorrelationContextManager.getCurrentContext()}),cAr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(cAr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else qpt.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||(qpt.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new u_a(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=WEi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var A_a=uAr&&uAr.__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)}})(),y_a=YEi(),KEi=Umr(),E_a=i0e(),jpt=jl(),__a=(function(t){A_a(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?KEi.trackRequestSync(this,r):jpt.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&jpt.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?KEi.trackRequest(this,r):jpt.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?E_a.trackRequest(this,r):jpt.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(y_a);JEi.exports=__a});var e_i=I(XEi=>{"use strict";p();Object.defineProperty(XEi,"__esModule",{value:!0})});var i_i=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});At.Configuration=At.liveMetricsClient=At.defaultClient=At.DistributedTracingModes=void 0;At.setup=R_a;At.start=n_i;At.getCorrelationContext=k_a;At.startOperation=D_a;At.wrapWithCorrelationContext=N_a;At.dispose=M_a;var fAr=_H(),v_a=Bgi(),C_a=Fgi(),pAr=Vft(),b_a=Tmr(),S_a=zgi(),T_a=oAi(),I_a=i0e(),x_a=Umr(),t_i=bX(),WNe=jl(),r_i=UAi(),hAr=qAi(),w_a=GAi();At.TelemetryClient=ZEi();At.Contracts=AE();At.azureFunctionsTypes=e_i();var dAr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(dAr||(At.DistributedTracingModes=dAr={}));var zNe,YNe,KNe,JNe,ZNe,w0e,R0e,ZX,XNe,eMe,bT=!1,Hpt;function R_a(t){return At.defaultClient?WNe.info("The default client is already setup"):(At.defaultClient=new At.TelemetryClient(t),zNe=new v_a(At.defaultClient),YNe=new C_a(At.defaultClient),KNe=new pAr(At.defaultClient),JNe=new b_a(At.defaultClient),ZNe=new S_a(At.defaultClient),w0e=new T_a(At.defaultClient),ZX=new x_a(At.defaultClient),XNe=new I_a(At.defaultClient),R0e||(R0e=new hAr.AutoCollectNativePerformance(At.defaultClient)),eMe=new w_a.AzureFunctionsHook(At.defaultClient)),mAr}a(R_a,"setup");function P_a(){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(P_a,"_setDefaultConfig");function n_i(){if(At.defaultClient){bT=!0,P_a(),zNe.enable(At.defaultClient.config.enableAutoCollectExternalLoggers,At.defaultClient.config.enableAutoCollectConsole),YNe.enable(At.defaultClient.config.enableAutoCollectExceptions),KNe.enable(At.defaultClient.config.enableAutoCollectPerformance),JNe.enable(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics),ZNe.enable(At.defaultClient.config.enableAutoCollectHeartbeat),ZX.useAutoCorrelation(At.defaultClient.config.enableAutoDependencyCorrelation,At.defaultClient.config.enableUseAsyncHooks),ZX.enable(At.defaultClient.config.enableAutoCollectRequests),XNe.enable(At.defaultClient.config.enableAutoCollectDependencies),w0e.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString),At.defaultClient.config.enableSendLiveMetrics&&(At.liveMetricsClient||(At.liveMetricsClient=new r_i(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),Hpt=new pAr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(Hpt),At.defaultClient.quickPulseClient=At.liveMetricsClient),At.liveMetricsClient.enable(At.defaultClient.config.enableSendLiveMetrics)),eMe.enable(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=hAr.AutoCollectNativePerformance.parseEnabled(At.defaultClient.config.enableAutoCollectExtendedMetrics,At.defaultClient.config);R0e.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 WNe.warn("Start cannot be called before setup");return mAr}a(n_i,"start");function k_a(){return fAr.CorrelationContextManager.getCurrentContext()}a(k_a,"getCorrelationContext");function D_a(t,e){return fAr.CorrelationContextManager.startOperation(t,e)}a(D_a,"startOperation");function N_a(t,e){return fAr.CorrelationContextManager.wrapCallback(t,e)}a(N_a,"wrapWithCorrelationContext");var mAr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return t_i.w3cEnabled=e===dAr.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,bT&&zNe.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectExceptions=e,bT&&YNe.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),At.defaultClient){At.defaultClient.config.enableAutoCollectPerformance=e;var n=hAr.AutoCollectNativePerformance.parseEnabled(r,At.defaultClient.config);At.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,bT&&(KNe.enable(e),R0e.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,bT&&JNe.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectHeartbeat=e,bT&&ZNe.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,bT&&w0e.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,bT&&w0e.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectRequests=e,bT&&ZX.enable(e)),t},t.setAutoCollectDependencies=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectDependencies=e,bT&&XNe.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableAutoDependencyCorrelation=e,At.defaultClient.config.enableUseAsyncHooks=r,bT&&ZX.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),WNe.enableDebug=e,WNe.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,bT&&eMe.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),At.defaultClient?(!At.liveMetricsClient&&e?(At.liveMetricsClient=new r_i(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),Hpt=new pAr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(Hpt),At.defaultClient.quickPulseClient=At.liveMetricsClient):At.liveMetricsClient&&At.liveMetricsClient.enable(e),At.defaultClient.config.enableSendLiveMetrics=e,t):(WNe.warn("Live metrics client cannot be setup without the default client"),t)},t.start=n_i,t})();At.Configuration=mAr;function M_a(){t_i.w3cEnabled=!0,At.defaultClient=null,bT=!1,zNe&&zNe.dispose(),YNe&&YNe.dispose(),KNe&&KNe.dispose(),JNe&&JNe.dispose(),ZNe&&ZNe.dispose(),w0e&&w0e.dispose(),R0e&&R0e.dispose(),ZX&&ZX.dispose(),XNe&&XNe.dispose(),At.liveMetricsClient&&(At.liveMetricsClient.enable(!1),At.liveMetricsClient=void 0),eMe&&eMe.dispose()}a(M_a,"dispose")});var AAr=I(Yw=>{"use strict";p();var O_a=Yw&&Yw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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_a=Yw&&Yw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o_i=Yw&&Yw.__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 Q_a(e)?s_i(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};Yw.AzureInsightReporter=gAr;function q_a(t,e,r){let n=new L_a.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,a_i(t,e,n),n}a(q_a,"createAppInsightsClient");function a_i(t,e,r){r.commonProperties=j_a(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(a_i,"configureReporter");function j_a(t,e){return t=t||{},t.common_os=Gpt.platform(),t.common_platformversion=Gpt.release(),t.common_arch=Gpt.arch(),t.common_cpu=Array.from(new Set(Gpt.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(j_a,"decorateWithCommonProperties")});var c_i=I((tip,H_a)=>{H_a.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.51.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.123.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. @@ -792,49 +748,49 @@ 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.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:!1,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,markdownDescription:"Enable OpenTelemetry trace/metric/log emission for Copilot Chat operations. 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",markdownDescription:"OTel exporter type for Copilot Chat telemetry. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Env var `OTEL_EXPORTER_OTLP_ENDPOINT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Env var `COPILOT_OTEL_CAPTURE_CONTENT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.maxAttributeSizeChars":{type:"integer",default:0,minimum:0,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]`. Env var `COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.outfile":{type:"string",default:"",markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.dbSpanExporter.enabled":{type:"boolean",default:!1,markdownDescription:"Enable SQLite DB span exporter. Persists OTel spans to a local SQLite database. Automatically enables OTel when set to true. 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"}],"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"}],"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.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.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",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",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",canDelegate:!0,requiresCustomModels:!0,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",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",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","@keyv/sqlite":"^4.0.5","@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","@vitest/coverage-v8":"^3.2.4","@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.27.2",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",keyv:"^5.3.2",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.11","ts-dedent":"^2.2.0",tsx:"^4.20.3",typescript:"^5.8.3","vite-plugin-top-level-await":"^1.5.0","vite-plugin-wasm":"^3.5.0",vitest:"^3.0.5","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.49","@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",dompurify:"^3.4.1",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:{"@aminya/node-gyp-build":"npm:node-gyp-build@4.8.1",string_decoder:"npm:string_decoder@1.2.0","node-gyp":"npm:node-gyp@10.3.1",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 wMe=I(Mb=>{"use strict";p();Object.defineProperty(Mb,"__esModule",{value:!0});Mb.vscodeEngineVersion=Mb.isPreRelease=Mb.isProduction=Mb.packageJson=void 0;Mb.packageJson=DCi();Mb.isProduction=Mb.packageJson.buildType!=="dev";Mb.isPreRelease=Mb.packageJson.isPreRelease||!Mb.isProduction;Mb.vscodeEngineVersion=Mb.packageJson.engines.vscode});var a4=I(Ob=>{"use strict";p();Object.defineProperty(Ob,"__esModule",{value:!0});Ob.isScenarioAutomation=Ob.AbstractEnvService=Ob.INativeEnvService=Ob.IEnvService=Ob.NameAndVersion=Ob.OperatingSystem=void 0;var MCi=rn(),OCi=QIe(),X0e=wMe(),NCi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(NCi||(Ob.OperatingSystem=NCi={}));var vyr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Ob.NameAndVersion=vyr;Ob.IEnvService=(0,MCi.createServiceIdentifier)("IEnvService");Ob.INativeEnvService=(0,MCi.createServiceIdentifier)("INativeEnvService");var byr=class{static{a(this,"AbstractEnvService")}isProduction(){return X0e.isProduction}isPreRelease(){return X0e.isPreRelease}isSimulation(){return OCi.env.SIMULATION==="1"}getBuildType(){return X0e.packageJson.buildType}getVersion(){return X0e.packageJson.version}getBuild(){return X0e.packageJson.build}getName(){return X0e.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Ob.AbstractEnvService=byr;Ob.isScenarioAutomation=OCi.env.IS_SCENARIO_AUTOMATION==="1"});var um=I(Aee=>{"use strict";p();Object.defineProperty(Aee,"__esModule",{value:!0});Aee.generateUuid=void 0;Aee.isUUID=W1a;Aee.prefixedUuid=z1a;var V1a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function W1a(t){return V1a.test(t)}a(W1a,"isUUID");Aee.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 z1a(t){return`${t}-${(0,Aee.generateUuid)()}`}a(z1a,"prefixedUuid")});var BCi=I(xht=>{"use strict";p();Object.defineProperty(xht,"__esModule",{value:!0});xht.CopilotConfigPrefix=void 0;xht.CopilotConfigPrefix="github.copilot"});var Tyr=I(M2=>{"use strict";p();var Y1a=M2&&M2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),K1a=M2&&M2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),J1a=M2&&M2.__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(X1a,"transformEvent")});var vE=I(fn=>{"use strict";p();Object.defineProperty(fn,"__esModule",{value:!0});fn.apiVersion=fn.ICompletionsEditorAndPluginInfo=fn.BuildInfo=fn.InMemoryConfigProvider=fn.DefaultsOnlyConfigProvider=fn.ConfigProvider=fn.ICompletionsConfigProvider=fn.BuildType=fn.BlockMode=fn.ConfigKey=fn.packageJson=void 0;fn.shouldDoServerTrimming=rSa;fn.getConfigKeyRecursively=nSa;fn.getConfigDefaultForKey=FCi;fn.getOptionalConfigDefaultForKey=UCi;fn.getConfig=iSa;fn.dumpForTelemetry=oSa;fn.formatNameAndVersion=Ryr;fn.editorVersionHeaders=sSa;var wht=wMe();Object.defineProperty(fn,"packageJson",{enumerable:!0,get:a(function(){return wht.packageJson},"get")});var LCi=rn(),eSa=BCi(),tSa=Tyr();fn.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 Rht;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Rht||(fn.BlockMode=Rht={}));function rSa(t){return[Rht.Server,Rht.ParsingAndServer].includes(t)}a(rSa,"shouldDoServerTrimming");var yee;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(yee||(fn.BuildType=yee={}));fn.ICompletionsConfigProvider=(0,LCi.createServiceIdentifier)("ICompletionsConfigProvider");var RMe=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};fn.ConfigProvider=RMe;var Iyr=class extends RMe{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return FCi(e)}getOptionalConfig(e){return UCi(e)}dumpForTelemetry(){return{}}};fn.DefaultsOnlyConfigProvider=Iyr;var xyr=class extends RMe{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new tSa.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[fn.ConfigKey.ShowEditorCompletions,fn.ConfigKey.EnableAutoCompletions,fn.ConfigKey.DelayCompletions,fn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};fn.InMemoryConfigProvider=xyr;function nSa(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(nSa,"getConfigKeyRecursively");function FCi(t){if(wyr.has(t))return wyr.get(t);throw new Error(`Missing config default value: ${eSa.CopilotConfigPrefix}.${t}`)}a(FCi,"getConfigDefaultForKey");function UCi(t){return wyr.get(t)}a(UCi,"getOptionalConfigDefaultForKey");var wyr=new Map([[fn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[fn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[fn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[fn.ConfigKey.RelatedFilesVSCode,!1],[fn.ConfigKey.IncludeNeighboringFiles,!1],[fn.ConfigKey.ExcludeRelatedFiles,!1],[fn.ConfigKey.ContextProviders,[]],[fn.ConfigKey.DebugSnippyOverrideUrl,""],[fn.ConfigKey.UseSubsetMatching,null],[fn.ConfigKey.ContextProviderTimeBudget,void 0],[fn.ConfigKey.DebugOverrideCapiUrl,""],[fn.ConfigKey.DebugTestOverrideCapiUrl,""],[fn.ConfigKey.DebugOverrideProxyUrl,""],[fn.ConfigKey.DebugTestOverrideProxyUrl,""],[fn.ConfigKey.DebugOverrideEngine,""],[fn.ConfigKey.AlwaysRequestMultiline,void 0],[fn.ConfigKey.CompletionsDebounce,void 0],[fn.ConfigKey.CompletionsDelay,void 0],[fn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[fn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[fn.ConfigKey.ShowEditorCompletions,void 0],[fn.ConfigKey.EnableAutoCompletions,void 0],[fn.ConfigKey.DelayCompletions,void 0],[fn.ConfigKey.FilterCompletions,void 0],[fn.ConfigKey.UseSplitContextPrompt,!0],[fn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[fn.ConfigKey.UserSelectedCompletionModel,""],[fn.ConfigKey.DebugOverrideEngineLegacy,""],[fn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[fn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[fn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[fn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[fn.ConfigKey.DebugFilterLogCategories,[]]]);function iSa(t,e){return t.get(fn.ICompletionsConfigProvider).getConfig(e)}a(iSa,"getConfig");function oSa(t){try{return t.get(fn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(oSa,"dumpForTelemetry");var kht=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===yee.NIGHTLY}static isProduction(){return this.getBuildType()!==yee.DEV}static getBuildType(){return wht.packageJson.buildType==="prod"?t.getVersion().length===15?yee.NIGHTLY:yee.PROD:yee.DEV}static getVersion(){return wht.packageJson.version}static getBuild(){return wht.packageJson.build}};fn.BuildInfo=kht;function Ryr({name:t,version:e}){return`${t}/${e}`}a(Ryr,"formatNameAndVersion");fn.ICompletionsEditorAndPluginInfo=(0,LCi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");fn.apiVersion="2025-05-01";function sSa(t){let e=t.get(fn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Ryr(e.getEditorInfo()),"Editor-Plugin-Version":Ryr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":kht.getVersion()}}a(sSa,"editorVersionHeaders")});var kyr=I(Pht=>{"use strict";p();Object.defineProperty(Pht,"__esModule",{value:!0});Pht.ExpServiceTelemetryNames=void 0;var QCi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(QCi||(Pht.ExpServiceTelemetryNames=QCi={}))});var Dht=I(eme=>{"use strict";p();Object.defineProperty(eme,"__esModule",{value:!0});eme.ExpConfig=eme.ExpTreatmentVariables=void 0;var aSa=Tg(),cSa=kyr(),qCi;(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"})(qCi||(eme.ExpTreatmentVariables=qCi={}));var Pyr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,aSa.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[cSa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};eme.ExpConfig=Pyr});var VA=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.ICompletionsFeaturesService=void 0;var lSa=rn();Nht.ICompletionsFeaturesService=(0,lSa.createServiceIdentifier)("ICompletionsFeaturesService")});var Mht=I(YH=>{"use strict";p();Object.defineProperty(YH,"__esModule",{value:!0});YH.FilterSettings=YH.Release=YH.Filter=void 0;var Eee;(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"})(Eee||(YH.Filter=Eee={}));var jCi;(function(t){t.Stable="stable",t.Nightly="nightly"})(jCi||(YH.Release=jCi={}));var uSa={[Eee.CopilotClientTimeBucket]:"timeBucket",[Eee.CopilotOverrideEngine]:"engine",[Eee.CopilotRepository]:"repo",[Eee.CopilotFileType]:"fileType",[Eee.CopilotUserKind]:"userKind"},Dyr=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=uSa[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};YH.FilterSettings=Dyr});var KH=I(dm=>{"use strict";p();Object.defineProperty(dm,"__esModule",{value:!0});dm.vString=fSa;dm.vNumber=hSa;dm.vBoolean=gSa;dm.vObjAny=ySa;dm.vUndefined=_Sa;dm.vNull=CSa;dm.vNullable=vSa;dm.vUnchecked=GCi;dm.vUnknown=bSa;dm.vRequired=SSa;dm.vObj=TSa;dm.vArray=ISa;dm.vTuple=xSa;dm.vUnion=$Ci;dm.vEnum=wSa;dm.vLiteral=RSa;dm.vLazy=kSa;var _ee=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}}},dSa=new _ee("string");function fSa(){return dSa}a(fSa,"vString");var pSa=new _ee("number");function hSa(){return pSa}a(hSa,"vNumber");var mSa=new _ee("boolean");function gSa(){return mSa}a(gSa,"vBoolean");var ASa=new _ee("object");function ySa(){return ASa}a(ySa,"vObjAny");var ESa=new _ee("undefined");function _Sa(){return ESa}a(_Sa,"vUndefined");var Nyr=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"}}},HCi=new Nyr;function CSa(){return HCi}a(CSa,"vNull");function vSa(t){return $Ci(t,HCi)}a(vSa,"vNullable");function GCi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(GCi,"vUnchecked");function bSa(){return GCi()}a(bSa,"vUnknown");function SSa(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(SSa,"vRequired");function TSa(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(TSa,"vObj");function ISa(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(xSa,"vTuple");function $Ci(...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($Ci,"vUnion");function wSa(...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(wSa,"vEnum");function RSa(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(RSa,"vLiteral");function kSa(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(kSa,"vLazy")});var Myr=I(kMe=>{"use strict";p();Object.defineProperty(kMe,"__esModule",{value:!0});kMe.ImportChanges=void 0;var PSa=KH(),Oht;(function(t){t.All="all",t.None="none"})(Oht||(kMe.ImportChanges=Oht={}));(function(t){t.VALIDATOR=(0,PSa.vEnum)(t.All,t.None)})(Oht||(kMe.ImportChanges=Oht={}))});var zCi=I(tme=>{"use strict";p();Object.defineProperty(tme,"__esModule",{value:!0});tme.JointCompletionsProviderTriggerChangeStrategy=tme.JointCompletionsProviderStrategy=void 0;var VCi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(VCi||(tme.JointCompletionsProviderStrategy=VCi={}));var WCi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(WCi||(tme.JointCompletionsProviderTriggerChangeStrategy=WCi={}))});var YCi=I(PMe=>{"use strict";p();Object.defineProperty(PMe,"__esModule",{value:!0});PMe.DocumentSwitchTriggerStrategy=void 0;var DSa=KH(),Bht;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(Bht||(PMe.DocumentSwitchTriggerStrategy=Bht={}));(function(t){t.VALIDATOR=(0,DSa.vEnum)(t.Always,t.AfterAcceptance)})(Bht||(PMe.DocumentSwitchTriggerStrategy=Bht={}))});var Oyr=I(DMe=>{"use strict";p();Object.defineProperty(DMe,"__esModule",{value:!0});DMe.DiffHistoryMergeStrategy=void 0;var NSa=KH(),Lht;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(Lht||(DMe.DiffHistoryMergeStrategy=Lht={}));(function(t){t.VALIDATOR=(0,NSa.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(Lht||(DMe.DiffHistoryMergeStrategy=Lht={}))});var WA=I(En=>{"use strict";p();Object.defineProperty(En,"__esModule",{value:!0});En.SpeculativeRequestsAutoExpandEditWindowLines=En.SpeculativeRequestsCursorPlacement=En.DuplicateAdditionsMode=En.SpeculativeRequestsEnablement=En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=En.MODEL_CONFIGURATION_VALIDATOR=En.LINT_OPTIONS_VALIDATOR=En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=En.DEFAULT_OPTIONS=En.ResponseFormat=En.PromptingStrategy=En.EditIntent=En.EarlyDivergenceCancellationMode=En.AggressivenessLevel=En.AggressivenessSetting=En.LintOptionShowCode=En.LintOptionWarning=En.CurrentFileOptions=En.GlobalBudgetOptions=En.NeighborFilesOptions=En.RecentlyViewedDocumentsOptions=En.RecentFileClippingStrategy=En.IncludeLineNumbersOption=void 0;En.isPromptingStrategy=MSa;En.isAggressivenessStrategy=OSa;En.applyStrategyConfig=LSa;En.parseLintOptionString=FSa;En.parseUserHappinessScoreConfigurationString=USa;var XCi=Yu(),xn=KH(),Bb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(Bb||(En.IncludeLineNumbersOption=Bb={}));var Cee;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(Cee||(En.RecentFileClippingStrategy=Cee={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.AroundEditRange,t.Proportional)})(Cee||(En.RecentFileClippingStrategy=Cee={}));var Byr;(function(t){t.VALIDATOR=(0,xn.vObj)({nDocuments:(0,xn.vNumber)(),maxTokens:(0,xn.vNumber)(),includeViewedFiles:(0,xn.vBoolean)(),includeLineNumbers:(0,xn.vEnum)(Bb.WithSpaceAfter,Bb.WithoutSpace,Bb.None),clippingStrategy:(0,xn.vEnum)(Cee.AroundEditRange,Cee.Proportional)})})(Byr||(En.RecentlyViewedDocumentsOptions=Byr={}));var KCi;(function(t){t.VALIDATOR=(0,xn.vObj)({enabled:(0,xn.vBoolean)(),maxTokens:(0,xn.vNumber)()})})(KCi||(En.NeighborFilesOptions=KCi={}));var JCi;(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})(JCi||(En.GlobalBudgetOptions=JCi={}));var Lyr;(function(t){t.VALIDATOR=(0,xn.vObj)({maxTokens:(0,xn.vNumber)(),includeTags:(0,xn.vBoolean)(),includeLineNumbers:(0,xn.vEnum)(Bb.WithSpaceAfter,Bb.WithoutSpace,Bb.None),includeCursorTag:(0,xn.vBoolean)(),prioritizeAboveCursor:(0,xn.vBoolean)()})})(Lyr||(En.CurrentFileOptions=Lyr={}));var rme;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(rme||(En.LintOptionWarning=rme={}));var nme;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(nme||(En.LintOptionShowCode=nme={}));var Fht;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(Fht||(En.AggressivenessSetting=Fht={}));var JH;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(JH||(En.AggressivenessLevel=JH={}));var Uht;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(Uht||(En.EarlyDivergenceCancellationMode=Uht={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(Uht||(En.EarlyDivergenceCancellationMode=Uht={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return JH.Low;case t.Medium:return JH.Medium;case t.High:return JH.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(Fht||(En.AggressivenessSetting=Fht={}));var Qht;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(Qht||(En.EditIntent=Qht={}));(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===JH.Medium||s===JH.High;case t.Low:return s===JH.High;default:(0,XCi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(Qht||(En.EditIntent=Qht={}));var Tl;(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"})(Tl||(En.PromptingStrategy=Tl={}));function MSa(t){return Object.values(Tl).includes(t)}a(MSa,"isPromptingStrategy");function OSa(t){return t===Tl.XtabAggressiveness||t===Tl.Xtab275Aggressiveness||t===Tl.Xtab275AggressivenessHighLow||t===Tl.Xtab275EditIntent||t===Tl.Xtab275EditIntentShort}a(OSa,"isAggressivenessStrategy");var qht;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(qht||(En.ResponseFormat=qht={}));(function(t){function e(r){switch(r){case Tl.UnifiedModel:case Tl.Codexv21NesUnified:case Tl.Nes41Miniv3:return t.UnifiedWithXml;case Tl.Xtab275:case Tl.XtabAggressiveness:case Tl.Xtab275Aggressiveness:case Tl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case Tl.PatchBased:case Tl.PatchBased01:case Tl.PatchBased02:case Tl.PatchBased02WithRecentLineNumbers:case Tl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case Tl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case Tl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case Tl.SimplifiedSystemPrompt:case Tl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,XCi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(qht||(En.ResponseFormat=qht={}));En.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:2e3,includeTags:!0,includeLineNumbers:Bb.None,includeCursorTag:!1,prioritizeAboveCursor:!1},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:Bb.None,clippingStrategy:Cee.AroundEditRange},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};En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:nme.YES_WITH_SURROUNDING,tagName:"linter",warnings:rme.YES_IF_NO_ERRORS,nRecentFiles:0};En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var BSa={[Tl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[Tl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Bb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Bb.WithoutSpace},supportsNextCursorLinePrediction:!1},[Tl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Bb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Bb.None},supportsNextCursorLinePrediction:!1}};function LSa(t){let e=t.promptingStrategy===void 0?void 0:BSa[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(LSa,"applyStrategyConfig");En.LINT_OPTIONS_VALIDATOR=(0,xn.vObj)({tagName:(0,xn.vString)(),warnings:(0,xn.vEnum)(rme.YES,rme.NO,rme.YES_IF_NO_ERRORS),showCode:(0,xn.vEnum)(nme.NO,nme.YES,nme.YES_WITH_SURROUNDING),maxLints:(0,xn.vNumber)(),maxLineDistance:(0,xn.vNumber)(),nRecentFiles:(0,xn.vNumber)()});En.MODEL_CONFIGURATION_VALIDATOR=(0,xn.vObj)({modelName:(0,xn.vRequired)((0,xn.vString)()),promptingStrategy:(0,xn.vUnion)((0,xn.vEnum)(...Object.values(Tl)),(0,xn.vUndefined)()),includeTagsInCurrentFile:(0,xn.vRequired)((0,xn.vBoolean)()),includePostScript:(0,xn.vUnion)((0,xn.vBoolean)(),(0,xn.vUndefined)()),currentFile:(0,xn.vUnion)(Lyr.VALIDATOR,(0,xn.vUndefined)()),recentlyViewedDocuments:(0,xn.vUnion)(Byr.VALIDATOR,(0,xn.vUndefined)()),lintOptions:(0,xn.vUnion)(En.LINT_OPTIONS_VALIDATOR,(0,xn.vUndefined)()),supportsNextCursorLinePrediction:(0,xn.vUnion)((0,xn.vBoolean)(),(0,xn.vUndefined)())});function FSa(t,e){try{let r=JSON.parse(t),n=En.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(FSa,"parseLintOptionString");En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var ZCi=(0,xn.vObj)({acceptedScore:(0,xn.vRequired)((0,xn.vNumber)()),rejectedScore:(0,xn.vRequired)((0,xn.vNumber)()),ignoredScore:(0,xn.vRequired)((0,xn.vNumber)()),highThreshold:(0,xn.vRequired)((0,xn.vNumber)()),mediumThreshold:(0,xn.vRequired)((0,xn.vNumber)()),includeIgnored:(0,xn.vRequired)((0,xn.vBoolean)()),ignoredLimit:(0,xn.vRequired)((0,xn.vNumber)()),limitConsecutiveIgnored:(0,xn.vRequired)((0,xn.vBoolean)()),limitTotalIgnored:(0,xn.vRequired)((0,xn.vBoolean)())});function NMe(t,e,r){return t>=e&&t<=r}a(NMe,"isInRange");En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=ZCi.validate(t);if(e.error)return e;let r=e.content;return NMe(r.acceptedScore,0,1)?NMe(r.rejectedScore,0,1)?NMe(r.ignoredScore,0,1)?NMe(r.highThreshold,0,1)?NMe(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(ime,"__esModule",{value:!0});ime.TextReplacement=ime.TextEdit=void 0;var evi=El(),tvi=Yu(),zht=Ts(),Vht=Gh(),ZH=I_(),l0=qp(),Yht=Zpe(),rvi=CT(),Kht=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>lC.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new lC(e,r)])}static delete(e){return new t([new lC(e,"")])}static insert(e,r){return new t([new lC(l0.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,evi.compareBy)(n=>n.range,l0.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,tvi.assertFn)(()=>(0,tvi.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 lC(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=Yht.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new ZH.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Wht(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 ZH.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof ZH.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof ZH.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Wht(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 ZH.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Wht(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Wht(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new rvi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new lC(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=Yht.TextLength.ofText(s.text),l=ZH.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 zht.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 rvi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=l0.Range.fromPositions(new ZH.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=l0.Range.fromPositions(r.range.getEndPosition(),new ZH.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(` -`)}};ime.TextEdit=Kht;var lC=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new zht.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",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",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",canDelegate:!0,requiresCustomModels:!0,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",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",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","@keyv/sqlite":"^4.0.5","@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","@vitest/coverage-v8":"^3.2.4","@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.27.2",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",keyv:"^5.3.2",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.11","ts-dedent":"^2.2.0",tsx:"^4.20.3",typescript:"^5.8.3","vite-plugin-top-level-await":"^1.5.0","vite-plugin-wasm":"^3.5.0",vitest:"^3.0.5","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.49","@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",dompurify:"^3.4.1",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:{"@aminya/node-gyp-build":"npm:node-gyp-build@4.8.1",string_decoder:"npm:string_decoder@1.2.0","node-gyp":"npm:node-gyp@10.3.1",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 tMe=I(Ib=>{"use strict";p();Object.defineProperty(Ib,"__esModule",{value:!0});Ib.vscodeEngineVersion=Ib.isPreRelease=Ib.isProduction=Ib.packageJson=void 0;Ib.packageJson=c_i();Ib.isProduction=Ib.packageJson.buildType!=="dev";Ib.isPreRelease=Ib.packageJson.isPreRelease||!Ib.isProduction;Ib.vscodeEngineVersion=Ib.packageJson.engines.vscode});var Y5=I(xb=>{"use strict";p();Object.defineProperty(xb,"__esModule",{value:!0});xb.isScenarioAutomation=xb.AbstractEnvService=xb.INativeEnvService=xb.IEnvService=xb.NameAndVersion=xb.OperatingSystem=void 0;var u_i=rn(),d_i=uIe(),P0e=tMe(),l_i;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(l_i||(xb.OperatingSystem=l_i={}));var yAr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};xb.NameAndVersion=yAr;xb.IEnvService=(0,u_i.createServiceIdentifier)("IEnvService");xb.INativeEnvService=(0,u_i.createServiceIdentifier)("INativeEnvService");var EAr=class{static{a(this,"AbstractEnvService")}isProduction(){return P0e.isProduction}isPreRelease(){return P0e.isPreRelease}isSimulation(){return d_i.env.SIMULATION==="1"}getBuildType(){return P0e.packageJson.buildType}getVersion(){return P0e.packageJson.version}getBuild(){return P0e.packageJson.build}getName(){return P0e.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};xb.AbstractEnvService=EAr;xb.isScenarioAutomation=d_i.env.IS_SCENARIO_AUTOMATION==="1"});var um=I(eee=>{"use strict";p();Object.defineProperty(eee,"__esModule",{value:!0});eee.generateUuid=void 0;eee.isUUID=$_a;eee.prefixedUuid=V_a;var G_a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function $_a(t){return G_a.test(t)}a($_a,"isUUID");eee.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 V_a(t){return`${t}-${(0,eee.generateUuid)()}`}a(V_a,"prefixedUuid")});var f_i=I($pt=>{"use strict";p();Object.defineProperty($pt,"__esModule",{value:!0});$pt.CopilotConfigPrefix=void 0;$pt.CopilotConfigPrefix="github.copilot"});var vAr=I(I2=>{"use strict";p();var W_a=I2&&I2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z_a=I2&&I2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y_a=I2&&I2.__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(J_a,"transformEvent")});var EE=I(dn=>{"use strict";p();Object.defineProperty(dn,"__esModule",{value:!0});dn.apiVersion=dn.ICompletionsEditorAndPluginInfo=dn.BuildInfo=dn.InMemoryConfigProvider=dn.DefaultsOnlyConfigProvider=dn.ConfigProvider=dn.ICompletionsConfigProvider=dn.BuildType=dn.BlockMode=dn.ConfigKey=dn.packageJson=void 0;dn.shouldDoServerTrimming=eva;dn.getConfigKeyRecursively=tva;dn.getConfigDefaultForKey=h_i;dn.getOptionalConfigDefaultForKey=m_i;dn.getConfig=rva;dn.dumpForTelemetry=nva;dn.formatNameAndVersion=TAr;dn.editorVersionHeaders=iva;var Vpt=tMe();Object.defineProperty(dn,"packageJson",{enumerable:!0,get:a(function(){return Vpt.packageJson},"get")});var p_i=rn(),Z_a=f_i(),X_a=vAr();dn.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 Wpt;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Wpt||(dn.BlockMode=Wpt={}));function eva(t){return[Wpt.Server,Wpt.ParsingAndServer].includes(t)}a(eva,"shouldDoServerTrimming");var tee;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(tee||(dn.BuildType=tee={}));dn.ICompletionsConfigProvider=(0,p_i.createServiceIdentifier)("ICompletionsConfigProvider");var rMe=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};dn.ConfigProvider=rMe;var CAr=class extends rMe{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return h_i(e)}getOptionalConfig(e){return m_i(e)}dumpForTelemetry(){return{}}};dn.DefaultsOnlyConfigProvider=CAr;var bAr=class extends rMe{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new X_a.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[dn.ConfigKey.ShowEditorCompletions,dn.ConfigKey.EnableAutoCompletions,dn.ConfigKey.DelayCompletions,dn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};dn.InMemoryConfigProvider=bAr;function tva(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(tva,"getConfigKeyRecursively");function h_i(t){if(SAr.has(t))return SAr.get(t);throw new Error(`Missing config default value: ${Z_a.CopilotConfigPrefix}.${t}`)}a(h_i,"getConfigDefaultForKey");function m_i(t){return SAr.get(t)}a(m_i,"getOptionalConfigDefaultForKey");var SAr=new Map([[dn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[dn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[dn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[dn.ConfigKey.RelatedFilesVSCode,!1],[dn.ConfigKey.IncludeNeighboringFiles,!1],[dn.ConfigKey.ExcludeRelatedFiles,!1],[dn.ConfigKey.ContextProviders,[]],[dn.ConfigKey.DebugSnippyOverrideUrl,""],[dn.ConfigKey.UseSubsetMatching,null],[dn.ConfigKey.ContextProviderTimeBudget,void 0],[dn.ConfigKey.DebugOverrideCapiUrl,""],[dn.ConfigKey.DebugTestOverrideCapiUrl,""],[dn.ConfigKey.DebugOverrideProxyUrl,""],[dn.ConfigKey.DebugTestOverrideProxyUrl,""],[dn.ConfigKey.DebugOverrideEngine,""],[dn.ConfigKey.AlwaysRequestMultiline,void 0],[dn.ConfigKey.CompletionsDebounce,void 0],[dn.ConfigKey.CompletionsDelay,void 0],[dn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[dn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[dn.ConfigKey.ShowEditorCompletions,void 0],[dn.ConfigKey.EnableAutoCompletions,void 0],[dn.ConfigKey.DelayCompletions,void 0],[dn.ConfigKey.FilterCompletions,void 0],[dn.ConfigKey.UseSplitContextPrompt,!0],[dn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[dn.ConfigKey.UserSelectedCompletionModel,""],[dn.ConfigKey.DebugOverrideEngineLegacy,""],[dn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[dn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[dn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[dn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[dn.ConfigKey.DebugFilterLogCategories,[]]]);function rva(t,e){return t.get(dn.ICompletionsConfigProvider).getConfig(e)}a(rva,"getConfig");function nva(t){try{return t.get(dn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(nva,"dumpForTelemetry");var zpt=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===tee.NIGHTLY}static isProduction(){return this.getBuildType()!==tee.DEV}static getBuildType(){return Vpt.packageJson.buildType==="prod"?t.getVersion().length===15?tee.NIGHTLY:tee.PROD:tee.DEV}static getVersion(){return Vpt.packageJson.version}static getBuild(){return Vpt.packageJson.build}};dn.BuildInfo=zpt;function TAr({name:t,version:e}){return`${t}/${e}`}a(TAr,"formatNameAndVersion");dn.ICompletionsEditorAndPluginInfo=(0,p_i.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");dn.apiVersion="2025-05-01";function iva(t){let e=t.get(dn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":TAr(e.getEditorInfo()),"Editor-Plugin-Version":TAr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":zpt.getVersion()}}a(iva,"editorVersionHeaders")});var IAr=I(Ypt=>{"use strict";p();Object.defineProperty(Ypt,"__esModule",{value:!0});Ypt.ExpServiceTelemetryNames=void 0;var g_i;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(g_i||(Ypt.ExpServiceTelemetryNames=g_i={}))});var Kpt=I(k0e=>{"use strict";p();Object.defineProperty(k0e,"__esModule",{value:!0});k0e.ExpConfig=k0e.ExpTreatmentVariables=void 0;var ova=xg(),sva=IAr(),A_i;(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"})(A_i||(k0e.ExpTreatmentVariables=A_i={}));var xAr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,ova.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[sva.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};k0e.ExpConfig=xAr});var JA=I(Jpt=>{"use strict";p();Object.defineProperty(Jpt,"__esModule",{value:!0});Jpt.ICompletionsFeaturesService=void 0;var ava=rn();Jpt.ICompletionsFeaturesService=(0,ava.createServiceIdentifier)("ICompletionsFeaturesService")});var Zpt=I(kH=>{"use strict";p();Object.defineProperty(kH,"__esModule",{value:!0});kH.FilterSettings=kH.Release=kH.Filter=void 0;var ree;(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"})(ree||(kH.Filter=ree={}));var y_i;(function(t){t.Stable="stable",t.Nightly="nightly"})(y_i||(kH.Release=y_i={}));var cva={[ree.CopilotClientTimeBucket]:"timeBucket",[ree.CopilotOverrideEngine]:"engine",[ree.CopilotRepository]:"repo",[ree.CopilotFileType]:"fileType",[ree.CopilotUserKind]:"userKind"},wAr=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=cva[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};kH.FilterSettings=wAr});var DH=I(dm=>{"use strict";p();Object.defineProperty(dm,"__esModule",{value:!0});dm.vString=uva;dm.vNumber=fva;dm.vBoolean=hva;dm.vObjAny=gva;dm.vUndefined=yva;dm.vNull=Eva;dm.vNullable=_va;dm.vUnchecked=__i;dm.vUnknown=vva;dm.vRequired=Cva;dm.vObj=bva;dm.vArray=Sva;dm.vTuple=Tva;dm.vUnion=v_i;dm.vEnum=Iva;dm.vLiteral=xva;dm.vLazy=wva;var nee=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}}},lva=new nee("string");function uva(){return lva}a(uva,"vString");var dva=new nee("number");function fva(){return dva}a(fva,"vNumber");var pva=new nee("boolean");function hva(){return pva}a(hva,"vBoolean");var mva=new nee("object");function gva(){return mva}a(gva,"vObjAny");var Ava=new nee("undefined");function yva(){return Ava}a(yva,"vUndefined");var RAr=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"}}},E_i=new RAr;function Eva(){return E_i}a(Eva,"vNull");function _va(t){return v_i(t,E_i)}a(_va,"vNullable");function __i(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(__i,"vUnchecked");function vva(){return __i()}a(vva,"vUnknown");function Cva(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(Cva,"vRequired");function bva(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(bva,"vObj");function Sva(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(Tva,"vTuple");function v_i(...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(v_i,"vUnion");function Iva(...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(Iva,"vEnum");function xva(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(xva,"vLiteral");function wva(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(wva,"vLazy")});var PAr=I(nMe=>{"use strict";p();Object.defineProperty(nMe,"__esModule",{value:!0});nMe.ImportChanges=void 0;var Rva=DH(),Xpt;(function(t){t.All="all",t.None="none"})(Xpt||(nMe.ImportChanges=Xpt={}));(function(t){t.VALIDATOR=(0,Rva.vEnum)(t.All,t.None)})(Xpt||(nMe.ImportChanges=Xpt={}))});var S_i=I(D0e=>{"use strict";p();Object.defineProperty(D0e,"__esModule",{value:!0});D0e.JointCompletionsProviderTriggerChangeStrategy=D0e.JointCompletionsProviderStrategy=void 0;var C_i;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(C_i||(D0e.JointCompletionsProviderStrategy=C_i={}));var b_i;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(b_i||(D0e.JointCompletionsProviderTriggerChangeStrategy=b_i={}))});var T_i=I(iMe=>{"use strict";p();Object.defineProperty(iMe,"__esModule",{value:!0});iMe.DocumentSwitchTriggerStrategy=void 0;var Pva=DH(),eht;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(eht||(iMe.DocumentSwitchTriggerStrategy=eht={}));(function(t){t.VALIDATOR=(0,Pva.vEnum)(t.Always,t.AfterAcceptance)})(eht||(iMe.DocumentSwitchTriggerStrategy=eht={}))});var kAr=I(oMe=>{"use strict";p();Object.defineProperty(oMe,"__esModule",{value:!0});oMe.DiffHistoryMergeStrategy=void 0;var kva=DH(),tht;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(tht||(oMe.DiffHistoryMergeStrategy=tht={}));(function(t){t.VALIDATOR=(0,kva.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(tht||(oMe.DiffHistoryMergeStrategy=tht={}))});var ZA=I(En=>{"use strict";p();Object.defineProperty(En,"__esModule",{value:!0});En.SpeculativeRequestsAutoExpandEditWindowLines=En.SpeculativeRequestsCursorPlacement=En.DuplicateAdditionsMode=En.SpeculativeRequestsEnablement=En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=En.MODEL_CONFIGURATION_VALIDATOR=En.LINT_OPTIONS_VALIDATOR=En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=En.DEFAULT_OPTIONS=En.ResponseFormat=En.PromptingStrategy=En.EditIntent=En.EarlyDivergenceCancellationMode=En.AggressivenessLevel=En.AggressivenessSetting=En.LintOptionShowCode=En.LintOptionWarning=En.CurrentFileOptions=En.GlobalBudgetOptions=En.NeighborFilesOptions=En.RecentlyViewedDocumentsOptions=En.RecentFileClippingStrategy=En.IncludeLineNumbersOption=void 0;En.isPromptingStrategy=Dva;En.isAggressivenessStrategy=Nva;En.applyStrategyConfig=Ova;En.parseLintOptionString=Bva;En.parseUserHappinessScoreConfigurationString=Lva;var R_i=Yu(),In=DH(),wb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(wb||(En.IncludeLineNumbersOption=wb={}));var iee;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(iee||(En.RecentFileClippingStrategy=iee={}));(function(t){t.VALIDATOR=(0,In.vEnum)(t.AroundEditRange,t.Proportional)})(iee||(En.RecentFileClippingStrategy=iee={}));var DAr;(function(t){t.VALIDATOR=(0,In.vObj)({nDocuments:(0,In.vNumber)(),maxTokens:(0,In.vNumber)(),includeViewedFiles:(0,In.vBoolean)(),includeLineNumbers:(0,In.vEnum)(wb.WithSpaceAfter,wb.WithoutSpace,wb.None),clippingStrategy:(0,In.vEnum)(iee.AroundEditRange,iee.Proportional)})})(DAr||(En.RecentlyViewedDocumentsOptions=DAr={}));var I_i;(function(t){t.VALIDATOR=(0,In.vObj)({enabled:(0,In.vBoolean)(),maxTokens:(0,In.vNumber)()})})(I_i||(En.NeighborFilesOptions=I_i={}));var x_i;(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})(x_i||(En.GlobalBudgetOptions=x_i={}));var NAr;(function(t){t.VALIDATOR=(0,In.vObj)({maxTokens:(0,In.vNumber)(),includeTags:(0,In.vBoolean)(),includeLineNumbers:(0,In.vEnum)(wb.WithSpaceAfter,wb.WithoutSpace,wb.None),includeCursorTag:(0,In.vBoolean)(),prioritizeAboveCursor:(0,In.vBoolean)()})})(NAr||(En.CurrentFileOptions=NAr={}));var N0e;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(N0e||(En.LintOptionWarning=N0e={}));var M0e;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(M0e||(En.LintOptionShowCode=M0e={}));var rht;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(rht||(En.AggressivenessSetting=rht={}));var NH;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(NH||(En.AggressivenessLevel=NH={}));var nht;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(nht||(En.EarlyDivergenceCancellationMode=nht={}));(function(t){t.VALIDATOR=(0,In.vEnum)(t.Cursor,t.EditWindow,t.Off)})(nht||(En.EarlyDivergenceCancellationMode=nht={}));(function(t){t.VALIDATOR=(0,In.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return NH.Low;case t.Medium:return NH.Medium;case t.High:return NH.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(rht||(En.AggressivenessSetting=rht={}));var iht;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(iht||(En.EditIntent=iht={}));(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===NH.Medium||s===NH.High;case t.Low:return s===NH.High;default:(0,R_i.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(iht||(En.EditIntent=iht={}));var bl;(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"})(bl||(En.PromptingStrategy=bl={}));function Dva(t){return Object.values(bl).includes(t)}a(Dva,"isPromptingStrategy");function Nva(t){return t===bl.XtabAggressiveness||t===bl.Xtab275Aggressiveness||t===bl.Xtab275AggressivenessHighLow||t===bl.Xtab275EditIntent||t===bl.Xtab275EditIntentShort}a(Nva,"isAggressivenessStrategy");var oht;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(oht||(En.ResponseFormat=oht={}));(function(t){function e(r){switch(r){case bl.UnifiedModel:case bl.Codexv21NesUnified:case bl.Nes41Miniv3:return t.UnifiedWithXml;case bl.Xtab275:case bl.XtabAggressiveness:case bl.Xtab275Aggressiveness:case bl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case bl.PatchBased:case bl.PatchBased01:case bl.PatchBased02:case bl.PatchBased02WithRecentLineNumbers:case bl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case bl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case bl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case bl.SimplifiedSystemPrompt:case bl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,R_i.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(oht||(En.ResponseFormat=oht={}));En.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:2e3,includeTags:!0,includeLineNumbers:wb.None,includeCursorTag:!1,prioritizeAboveCursor:!1},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:wb.None,clippingStrategy:iee.AroundEditRange},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};En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:M0e.YES_WITH_SURROUNDING,tagName:"linter",warnings:N0e.YES_IF_NO_ERRORS,nRecentFiles:0};En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var Mva={[bl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[bl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:wb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:wb.WithoutSpace},supportsNextCursorLinePrediction:!1},[bl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:wb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:wb.None},supportsNextCursorLinePrediction:!1}};function Ova(t){let e=t.promptingStrategy===void 0?void 0:Mva[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(Ova,"applyStrategyConfig");En.LINT_OPTIONS_VALIDATOR=(0,In.vObj)({tagName:(0,In.vString)(),warnings:(0,In.vEnum)(N0e.YES,N0e.NO,N0e.YES_IF_NO_ERRORS),showCode:(0,In.vEnum)(M0e.NO,M0e.YES,M0e.YES_WITH_SURROUNDING),maxLints:(0,In.vNumber)(),maxLineDistance:(0,In.vNumber)(),nRecentFiles:(0,In.vNumber)()});En.MODEL_CONFIGURATION_VALIDATOR=(0,In.vObj)({modelName:(0,In.vRequired)((0,In.vString)()),promptingStrategy:(0,In.vUnion)((0,In.vEnum)(...Object.values(bl)),(0,In.vUndefined)()),includeTagsInCurrentFile:(0,In.vRequired)((0,In.vBoolean)()),includePostScript:(0,In.vUnion)((0,In.vBoolean)(),(0,In.vUndefined)()),currentFile:(0,In.vUnion)(NAr.VALIDATOR,(0,In.vUndefined)()),recentlyViewedDocuments:(0,In.vUnion)(DAr.VALIDATOR,(0,In.vUndefined)()),lintOptions:(0,In.vUnion)(En.LINT_OPTIONS_VALIDATOR,(0,In.vUndefined)()),supportsNextCursorLinePrediction:(0,In.vUnion)((0,In.vBoolean)(),(0,In.vUndefined)())});function Bva(t,e){try{let r=JSON.parse(t),n=En.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(Bva,"parseLintOptionString");En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var w_i=(0,In.vObj)({acceptedScore:(0,In.vRequired)((0,In.vNumber)()),rejectedScore:(0,In.vRequired)((0,In.vNumber)()),ignoredScore:(0,In.vRequired)((0,In.vNumber)()),highThreshold:(0,In.vRequired)((0,In.vNumber)()),mediumThreshold:(0,In.vRequired)((0,In.vNumber)()),includeIgnored:(0,In.vRequired)((0,In.vBoolean)()),ignoredLimit:(0,In.vRequired)((0,In.vNumber)()),limitConsecutiveIgnored:(0,In.vRequired)((0,In.vBoolean)()),limitTotalIgnored:(0,In.vRequired)((0,In.vBoolean)())});function sMe(t,e,r){return t>=e&&t<=r}a(sMe,"isInRange");En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=w_i.validate(t);if(e.error)return e;let r=e.content;return sMe(r.acceptedScore,0,1)?sMe(r.rejectedScore,0,1)?sMe(r.ignoredScore,0,1)?sMe(r.highThreshold,0,1)?sMe(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(O0e,"__esModule",{value:!0});O0e.TextReplacement=O0e.TextEdit=void 0;var P_i=Al(),k_i=Yu(),fht=Cs(),uht=Gh(),MH=b_(),l0=jp(),pht=Rpe(),D_i=mT(),hht=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>ov.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new ov(e,r)])}static delete(e){return new t([new ov(e,"")])}static insert(e,r){return new t([new ov(l0.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,P_i.compareBy)(n=>n.range,l0.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,k_i.assertFn)(()=>(0,k_i.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 ov(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=pht.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new MH.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return dht(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 MH.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof MH.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof MH.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return dht(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 MH.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=dht(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=dht(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new D_i.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new ov(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=pht.TextLength.ofText(s.text),l=MH.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 fht.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 D_i.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=l0.Range.fromPositions(new MH.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=l0.Range.fromPositions(r.range.getEndPosition(),new MH.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(` +`)}};O0e.TextEdit=hht;var ov=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new fht.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}"`}};ime.TextReplacement=lC;function Wht(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return l0.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new zht.BugIndicatingError("start must be before end");return new l0.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(Wht,"rangeFromPositions")});var eG=I(XH=>{"use strict";p();Object.defineProperty(XH,"__esModule",{value:!0});XH.SerializedLineReplacement=XH.LineReplacement=XH.LineEdit=void 0;var Fyr=El(),nvi=Yu(),QSa=Gh(),OMe=g2(),ovi=gE(),ome=I_(),sme=qp(),ame=MMe(),Jht=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>vee.deserialize(r)))}static fromStringEdit(e,r){let n=ame.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,Fyr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,nvi.assert)((0,nvi.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 ovi.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(OMe.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 OMe.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 vee(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,Fyr.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 vee(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};XH.LineEdit=Jht;var vee=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(OMe.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,QSa.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(sme.Range.fromPositions(new ome.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(sme.Range.fromPositions(e.range.getEndPosition(),new ome.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 ome.Position(s,c)}else n=new ome.Position(1,1);let o=r.addToPosition(new ome.Position(1,1));return new ame.TextReplacement(sme.Range.fromPositions(n,o),"")}else return new ame.TextReplacement(new sme.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,uht.commonPrefixLength)(r,n);r=r.substring(o),n=n.substring(o);let s=(0,uht.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}"`}};O0e.TextReplacement=ov;function dht(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return l0.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new fht.BugIndicatingError("start must be before end");return new l0.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(dht,"rangeFromPositions")});var BH=I(OH=>{"use strict";p();Object.defineProperty(OH,"__esModule",{value:!0});OH.SerializedLineReplacement=OH.LineReplacement=OH.LineEdit=void 0;var MAr=Al(),N_i=Yu(),Fva=Gh(),cMe=c2(),O_i=pE(),B0e=b_(),L0e=jp(),F0e=aMe(),mht=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>oee.deserialize(r)))}static fromStringEdit(e,r){let n=F0e.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,MAr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,N_i.assert)((0,N_i.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 O_i.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(cMe.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 cMe.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 oee(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,MAr.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 oee(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};OH.LineEdit=mht;var oee=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(cMe.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,Fva.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(L0e.Range.fromPositions(new B0e.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(L0e.Range.fromPositions(e.range.getEndPosition(),new B0e.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 B0e.Position(s,c)}else n=new B0e.Position(1,1);let o=r.addToPosition(new B0e.Position(1,1));return new F0e.TextReplacement(L0e.Range.fromPositions(n,o),"")}else return new F0e.TextReplacement(new L0e.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 ame.TextReplacement(sme.Range.fromPositions(new ome.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new sme.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new ame.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new ovi.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})(ivi||(XH.SerializedLineReplacement=ivi={}))});var Uyr=I(cme=>{"use strict";p();Object.defineProperty(cme,"__esModule",{value:!0});cme.ArrayMap=cme.ResponseProcessor=void 0;var qSa=Ts(),Zht=eG(),Xht=g2(),svi;(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 e0t;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 Xht.LineRange(A.startLineIdx+1,l.length+1);yield new Zht.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),k=x.length;if(R-k>1&&k>0)return;let D=[f.startLineIdx,b],N=new Xht.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new Zht.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(svi||(cme.ResponseProcessor=svi={}));var e0t=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)||[]}};cme.ArrayMap=e0t});var cvi=I(t0t=>{"use strict";p();Object.defineProperty(t0t,"__esModule",{value:!0});t0t.AlternativeNotebookFormat=void 0;var avi;(function(t){t.json="json",t.xml="xml",t.text="text"})(avi||(t0t.AlternativeNotebookFormat=avi={}))});var Il=I(Ho=>{"use strict";p();var jSa=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]})),HSa=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),LMe=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):lvi.isObject(r)&&lvi.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,WSa.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=qyr;var r0t;function KSa(){if(!r0t){r0t=new Map;let e=zSa.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)r0t.set(n,r[n].default)}return r0t}a(KSa,"getPackageJsonDefaults");function mvi(t,e,r){let n=`${Ho.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Ho.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=KSa(),c=s.has(n),l=s.get(n);if(c&&!VSa.equals(e,l))throw new Qyr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new Qyr.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(mvi,"toBaseConfig");var jyr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Ho.globalConfigRegistry=new jyr;var Hyr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new gvi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Ho.ConfigurationMigrationRegistry=new Hyr;function ot(t,e,r,n,o,s){if(e===1){let l={...mvi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new Qyr.BugIndicatingError("Shared settings cannot be experiment based");return Ho.globalConfigRegistry.registerConfig(l),l}let c={...mvi(t,r,o),configType:0,validator:n};return Ho.globalConfigRegistry.registerConfig(c),c}a(ot,"defineSetting");function kt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?ot(t,e,r,n,o):ot(t,e,r,n,o,s)}a(kt,"defineTeamInternalSetting");function Wyr(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(Wyr,"migrateSetting");function xg(t,e,r,n){return Wyr(e,t),ot(e,0,r,void 0,{...n,oldKey:t})}a(xg,"defineAndMigrateSetting");function fm(t,e,r,n,o){return Wyr(e,t),ot(e,1,r,void 0,{...n,oldKey:t},o)}a(fm,"defineAndMigrateExpSetting");Ho.HARD_TOOL_LIMIT=128;var Gyr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(Gyr||(Ho.AuthProviderId=Gyr={}));var $yr;(function(t){t.Default="default",t.Minimal="minimal"})($yr||(Ho.AuthPermissionMode=$yr={}));var BMe;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(BMe||(Ho.AzureAuthMode=BMe={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(BMe||(Ho.AzureAuthMode=BMe={}));Ho.XTabProviderId="XtabProvider";var Vyr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=ot("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideCAPIUrl=ot("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=ot("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=ot("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=ot("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=ot("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=ot("advanced.authProvider",0,Gyr.GitHub),s.AuthPermissions=ot("advanced.authPermissions",0,$yr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=ot("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=ot("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=xg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=xg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=xg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=xg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=xg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=xg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=xg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=xg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=xg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=xg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=xg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=xg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=xg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=xg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=xg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=ot("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=ot("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=ot("chat.cli.autoModel.enabled",0,!1),s.CLIModelDetailsEnabled=ot("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=ot("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=ot("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=ot("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=ot("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=xg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLIBranchSupport=ot("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=ot("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=ot("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=ot("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=ot("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=ot("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=ot("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=ot("chat.cli.terminalLinks.enabled",0,!0),s.RequestLoggerMaxEntries=xg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=fm("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=fm("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=fm("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=fm("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=fm("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=ot("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=fm("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=fm("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",YSa.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=fm("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=ot("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=ot("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=fm("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=fm("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=fm("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=fm("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=fm("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=ot("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=ot("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=ot("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=ot("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=ot("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=ot("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=ot("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=ot("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=ot("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=ot("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=ot("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=ot("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=fm("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=fm("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=fm("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=ot("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=ot("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=ot("nextEditSuggestions.eagerness",1,Iu.AggressivenessSetting.Default,Iu.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=fm("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=ot("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=ot("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=ot("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=ot("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=ot("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=ot("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=ot("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=ot("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=fm("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=fm("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=xg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=ot("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=ot("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=ot("chat.otel.enabled",0,!1),s.OTelExporterType=ot("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=ot("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=ot("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=ot("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=ot("chat.otel.outfile",0,""),s.OTelDbSpanExporter=ot("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=ot("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=ot("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=ot("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=ot("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=ot("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=ot("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return Wyr(l,c),ot(l,0,null,Iu.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=kt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=kt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=kt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=kt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,Ig.vBoolean)()),s.InlineEditsModelPickerEnabled=kt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,Ig.vBoolean)()),s.InlineEditsUseSlashModels=kt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=kt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=kt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,Ig.vBoolean)()),s.InlineEditsLogCancelledRequests=kt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,Ig.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=kt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,Ig.vString)()),s.InlineEditsNextCursorPredictionApiKey=kt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,Ig.vString)()),s.InlineEditsXtabProviderUrl=kt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,Ig.vString)()),s.InlineEditsXtabProviderApiKey=kt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,Ig.vString)()),s.InlineEditsNextCursorPredictionLintOptions=kt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Iu.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=kt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,Ig.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=kt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,Ig.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=kt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,Ig.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=kt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,Ig.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,O2.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=kt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=kt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=kt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=kt("chat.advanced.promptRenderer.trace",0,!1),s.AgentSandboxEnabled=kt("chat.advanced.agent.sandbox.enabled",1,!1),s.DebugCollectFetcherTelemetry=kt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=kt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=kt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=kt("chat.advanced.modelProviderPreference",0,void 0,(0,Ig.vString)()),s.UseVSCodeTelemetryLibForGH=kt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=kt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=kt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=kt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=kt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsEagerBackupRequest=kt("chat.advanced.inlineEdits.eagerBackupRequest",1,!1),s.InlineEditsDebounceUseCoreRequestTime=kt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=kt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=kt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=kt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=kt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=kt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=kt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=kt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=kt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=kt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=kt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=kt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=kt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=kt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,5,(0,Ig.vNumber)()),s.InlineEditsBackoffDebounceEnabled=kt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=kt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=kt("chat.advanced.inlineEdits.speculativeRequests",1,O2.SpeculativeRequestsEnablement.Off,O2.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=kt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,O2.SpeculativeRequestsCursorPlacement.AfterEditApplied,O2.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=kt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,O2.SpeculativeRequestsAutoExpandEditWindowLines.Off,O2.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=kt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=kt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=kt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,fvi.DocumentSwitchTriggerStrategy.AfterAcceptance,fvi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=kt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=kt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=kt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=kt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,Ig.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=kt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=kt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=kt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=kt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=kt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=kt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=kt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=kt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=kt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=kt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=kt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Iu.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=kt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Iu.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Iu.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=kt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,pvi.DiffHistoryMergeStrategy.SameStartLine,pvi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=kt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,Ig.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=kt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,Ig.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=kt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=kt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=kt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Iu.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabPageSize=kt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Iu.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=kt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Iu.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=kt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Iu.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=kt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Iu.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Iu.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=kt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Iu.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabDiffOnlyForDocsInPrompt=kt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Iu.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=kt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Iu.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=kt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,hvi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=kt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,hvi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=kt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,O2.EarlyDivergenceCancellationMode.Off,O2.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Iu.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Iu.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=kt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Iu.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Iu.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=kt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=kt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,Iu.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=kt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=kt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=kt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,O2.DuplicateAdditionsMode.Off,O2.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=kt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=kt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=kt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=kt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=kt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=kt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=kt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsAllowImportChanges=kt("chat.advanced.inlineEdits.allowImportChanges",1,uvi.ImportChanges.None,uvi.ImportChanges.VALIDATOR),s.InlineEditsIgnoreWhenSuggestVisible=kt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=kt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=kt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,dvi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=kt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,dvi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=kt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=kt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=kt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=kt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=kt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=kt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=kt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=kt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=ot("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=ot("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=ot("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=ot("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=ot("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=kt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=kt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=kt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=kt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=kt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=ot("chat.planAgent.model",0,""),s.OllamaEndpoint=ot("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=ot("chat.azureModels",0,{}),s.CustomOAIModels=ot("chat.customOAIModels",0,{}),s.AzureAuthType=ot("chat.azureAuthType",0,BMe.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=ot("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=ot("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=ot("chat.rateLimitAutoSwitchToAuto",0,!1,(0,Ig.vBoolean)()),t.UseAnthropicMessagesApi=ot("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=ot("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=ot("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=ot("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=ot("chat.responsesApi.promptCacheKey.enabled",1,!1),t.Updated53CodexPromptEnabled=ot("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=ot("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=ot("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=ot("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGpt55ReadFileTool=ot("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableGpt55EconomicalSearchAndEdit=ot("chat.gpt55EconomicalSearchAndEdit.enabled",1,!1),t.EnableGpt55LargePromptSections=ot("chat.gpt55LargePromptSections.enabled",1,!1),t.EnableChatImageUpload=ot("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=ot("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=ot("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=ot("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=ot("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=ot("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=ot("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=ot("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=ot("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=ot("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=ot("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=ot("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=ot("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=ot("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=ot("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=ot("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=ot("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=ot("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=ot("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=ot("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=ot("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=ot("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=ot("chat.scopeSelection",0,!1),t.EnableCodeActions=ot("editor.enableCodeActions",0,!0),t.LocaleOverride=ot("chat.localeOverride",0,"auto"),t.TerminalChatLocation=ot("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=ot("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=ot("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=ot("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=ot("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=ot("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=ot("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=ot("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=ot("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=ot("nextEditSuggestions.enabled",1,!0),t.InlineEditsEnableDiagnosticsProvider=ot("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=ot("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=ot("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=ot("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=ot("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=ot("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=ot("chat.virtualTools.threshold",1,Ho.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=ot("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=ot("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=ot("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=ot("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=ot("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=ot("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=ot("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=ot("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=ot("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=ot("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=ot("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=ot("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=ot("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=ot("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=ot("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=ot("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=ot("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=ot("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=ot("chat.cloudAgentBackend.version",0,"v1"),t.AdditionalReadAccessPaths=ot("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=ot("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=ot("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=ot("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=ot("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=ot("chat.askAgent.model",0,""),t.ExploreAgentEnabled=ot("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=ot("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=ot("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=ot("chat.localIndex.enabled",1,!1)})(Vyr||(Ho.ConfigKey=Vyr={}));function JSa(){return Object.values(Vyr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(JSa,"getAllConfigKeys");var ZSa=[];function XSa(t){return ZSa.push(t),t}a(XSa,"registerNextEditProviderId")});var pp=I(zA=>{"use strict";p();Object.defineProperty(zA,"__esModule",{value:!0});zA.LogMemory=zA.LogServiceImpl=zA.ConsoleLog=zA.LogTarget=zA.LogLevel=zA.ILogService=void 0;zA.collectErrorMessages=yvi;zA.collectSingleLineErrorMessage=rTa;zA.sanitizeNetworkErrorForTelemetry=nTa;var eTa=rn(),tTa=ko();zA.ILogService=(0,eTa.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||(zA.LogLevel=bE={}));var Avi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(Avi||(zA.LogTarget=Avi={}));var zyr=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)}};zA.ConsoleLog=zyr;var Yyr=class extends tTa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new Kyr(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)}};zA.LogServiceImpl=Yyr;var Kyr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){i0t.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,yvi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new Jyr(this,e)}withExtraTarget(e){return new n0t(this,[e])}},Jyr=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 n0t(this,[e],this._prefix)}},n0t=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 yvi(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 F0e.TextReplacement(L0e.Range.fromPositions(new B0e.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new L0e.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new F0e.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new O_i.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})(M_i||(OH.SerializedLineReplacement=M_i={}))});var OAr=I(U0e=>{"use strict";p();Object.defineProperty(U0e,"__esModule",{value:!0});U0e.ArrayMap=U0e.ResponseProcessor=void 0;var Uva=Cs(),ght=BH(),Aht=c2(),B_i;(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 yht;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 Aht.LineRange(A.startLineIdx+1,l.length+1);yield new ght.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 Aht.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new ght.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(B_i||(U0e.ResponseProcessor=B_i={}));var yht=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)||[]}};U0e.ArrayMap=yht});var F_i=I(Eht=>{"use strict";p();Object.defineProperty(Eht,"__esModule",{value:!0});Eht.AlternativeNotebookFormat=void 0;var L_i;(function(t){t.json="json",t.xml="xml",t.text="text"})(L_i||(Eht.AlternativeNotebookFormat=L_i={}))});var Sl=I(Uo=>{"use strict";p();var Qva=Uo&&Uo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qva=Uo&&Uo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),uMe=Uo&&Uo.__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):U_i.isObject(r)&&U_i.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 Uo.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,$va.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){}};Uo.AbstractConfigurationService=LAr;var _ht;function zva(){if(!_ht){_ht=new Map;let e=Vva.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)_ht.set(n,r[n].default)}return _ht}a(zva,"getPackageJsonDefaults");function $_i(t,e,r){let n=`${Uo.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Uo.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=zva(),c=s.has(n),l=s.get(n);if(c&&!Gva.equals(e,l))throw new BAr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new BAr.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($_i,"toBaseConfig");var FAr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Uo.globalConfigRegistry=new FAr;var UAr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new V_i.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Uo.ConfigurationMigrationRegistry=new UAr;function dt(t,e,r,n,o,s){if(e===1){let l={...$_i(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new BAr.BugIndicatingError("Shared settings cannot be experiment based");return Uo.globalConfigRegistry.registerConfig(l),l}let c={...$_i(t,r,o),configType:0,validator:n};return Uo.globalConfigRegistry.registerConfig(c),c}a(dt,"defineSetting");function Nt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?dt(t,e,r,n,o):dt(t,e,r,n,o,s)}a(Nt,"defineTeamInternalSetting");function HAr(t,e){Uo.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Uo.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Uo.CopilotConfigPrefix}.${t}`,{value:r}],[`${Uo.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(HAr,"migrateSetting");function Rg(t,e,r,n){return HAr(e,t),dt(e,0,r,void 0,{...n,oldKey:t})}a(Rg,"defineAndMigrateSetting");function fm(t,e,r,n,o){return HAr(e,t),dt(e,1,r,void 0,{...n,oldKey:t},o)}a(fm,"defineAndMigrateExpSetting");Uo.HARD_TOOL_LIMIT=128;var QAr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(QAr||(Uo.AuthProviderId=QAr={}));var qAr;(function(t){t.Default="default",t.Minimal="minimal"})(qAr||(Uo.AuthPermissionMode=qAr={}));var lMe;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(lMe||(Uo.AzureAuthMode=lMe={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(lMe||(Uo.AzureAuthMode=lMe={}));Uo.XTabProviderId="XtabProvider";var jAr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=dt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideCAPIUrl=dt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=dt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=dt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=dt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=dt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=dt("advanced.authProvider",0,QAr.GitHub),s.AuthPermissions=dt("advanced.authPermissions",0,qAr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=dt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=dt("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=Rg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=Rg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=Rg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=Rg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=Rg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=Rg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=Rg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=Rg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=Rg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=Rg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=Rg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=Rg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=Rg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=Rg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=Rg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=dt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=dt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=dt("chat.cli.autoModel.enabled",0,!1),s.CLIModelDetailsEnabled=dt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=dt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=dt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=dt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=dt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Rg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLIBranchSupport=dt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=dt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=dt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=dt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=dt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=dt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=dt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=dt("chat.cli.terminalLinks.enabled",0,!0),s.RequestLoggerMaxEntries=Rg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=fm("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=fm("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=fm("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=fm("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=fm("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=dt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=fm("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=fm("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",Wva.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=fm("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=dt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=dt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=fm("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=fm("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=fm("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=fm("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=fm("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=dt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=dt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=dt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=dt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=dt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=dt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=dt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=dt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=dt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=dt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=dt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=dt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=fm("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=fm("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=fm("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=dt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=dt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=dt("nextEditSuggestions.eagerness",1,Tu.AggressivenessSetting.Default,Tu.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=fm("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=dt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=dt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=dt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=dt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=dt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=dt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=dt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=dt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=fm("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=fm("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Rg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=dt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=dt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=dt("chat.otel.enabled",0,!1),s.OTelExporterType=dt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=dt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=dt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=dt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=dt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=dt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=dt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=dt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=dt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=dt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=dt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=dt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return HAr(l,c),dt(l,0,null,Tu.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Nt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Nt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Nt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Nt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,wg.vBoolean)()),s.InlineEditsModelPickerEnabled=Nt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,wg.vBoolean)()),s.InlineEditsUseSlashModels=Nt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Nt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Nt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,wg.vBoolean)()),s.InlineEditsLogCancelledRequests=Nt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,wg.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Nt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,wg.vString)()),s.InlineEditsNextCursorPredictionApiKey=Nt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,wg.vString)()),s.InlineEditsXtabProviderUrl=Nt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,wg.vString)()),s.InlineEditsXtabProviderApiKey=Nt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,wg.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Nt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Tu.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Nt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,wg.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Nt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,wg.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Nt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,wg.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Nt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,wg.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,x2.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Nt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Nt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Nt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Nt("chat.advanced.promptRenderer.trace",0,!1),s.AgentSandboxEnabled=Nt("chat.advanced.agent.sandbox.enabled",1,!1),s.DebugCollectFetcherTelemetry=Nt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Nt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Nt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Nt("chat.advanced.modelProviderPreference",0,void 0,(0,wg.vString)()),s.UseVSCodeTelemetryLibForGH=Nt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Nt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Nt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Nt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Nt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsEagerBackupRequest=Nt("chat.advanced.inlineEdits.eagerBackupRequest",1,!1),s.InlineEditsDebounceUseCoreRequestTime=Nt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Nt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Nt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Nt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Nt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Nt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Nt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Nt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Nt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Nt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Nt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Nt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Nt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Nt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,5,(0,wg.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Nt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Nt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Nt("chat.advanced.inlineEdits.speculativeRequests",1,x2.SpeculativeRequestsEnablement.Off,x2.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Nt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,x2.SpeculativeRequestsCursorPlacement.AfterEditApplied,x2.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Nt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,x2.SpeculativeRequestsAutoExpandEditWindowLines.Off,x2.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Nt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Nt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Nt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,j_i.DocumentSwitchTriggerStrategy.AfterAcceptance,j_i.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Nt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Nt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Nt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Nt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,wg.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Nt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Nt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Nt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Nt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Nt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Nt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Nt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Nt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Nt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Nt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Tu.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Nt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Tu.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Tu.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,H_i.DiffHistoryMergeStrategy.SameStartLine,H_i.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,wg.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,wg.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Nt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Nt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Tu.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabPageSize=Nt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Tu.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Tu.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Tu.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Tu.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Tu.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Nt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Tu.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Nt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Tu.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Nt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Tu.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Nt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,G_i.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Nt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,G_i.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Nt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,x2.EarlyDivergenceCancellationMode.Off,x2.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Tu.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Tu.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Nt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Tu.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Tu.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Nt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Nt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,Tu.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Nt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Nt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Nt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,x2.DuplicateAdditionsMode.Off,x2.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Nt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Nt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Nt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Nt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Nt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Nt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Nt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsAllowImportChanges=Nt("chat.advanced.inlineEdits.allowImportChanges",1,Q_i.ImportChanges.None,Q_i.ImportChanges.VALIDATOR),s.InlineEditsIgnoreWhenSuggestVisible=Nt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,q_i.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,q_i.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Nt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Nt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Nt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Nt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Nt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Nt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Nt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Nt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=dt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=dt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=dt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=dt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=dt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Nt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Nt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Nt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Nt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Nt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=dt("chat.planAgent.model",0,""),s.OllamaEndpoint=dt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=dt("chat.azureModels",0,{}),s.CustomOAIModels=dt("chat.customOAIModels",0,{}),s.AzureAuthType=dt("chat.azureAuthType",0,lMe.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=dt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=dt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=dt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,wg.vBoolean)()),t.UseAnthropicMessagesApi=dt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=dt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=dt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=dt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=dt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.Updated53CodexPromptEnabled=dt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=dt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=dt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=dt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGpt55ReadFileTool=dt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableGpt55EconomicalSearchAndEdit=dt("chat.gpt55EconomicalSearchAndEdit.enabled",1,!1),t.EnableGpt55LargePromptSections=dt("chat.gpt55LargePromptSections.enabled",1,!1),t.EnableChatImageUpload=dt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=dt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=dt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=dt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=dt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=dt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=dt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=dt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=dt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=dt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=dt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=dt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=dt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=dt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=dt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=dt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=dt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=dt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=dt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=dt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=dt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=dt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=dt("chat.scopeSelection",0,!1),t.EnableCodeActions=dt("editor.enableCodeActions",0,!0),t.LocaleOverride=dt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=dt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=dt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=dt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=dt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=dt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=dt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=dt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=dt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=dt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=dt("nextEditSuggestions.enabled",1,!0),t.InlineEditsEnableDiagnosticsProvider=dt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=dt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=dt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=dt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=dt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=dt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=dt("chat.virtualTools.threshold",1,Uo.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=dt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=dt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=dt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=dt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=dt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=dt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=dt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=dt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=dt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=dt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=dt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=dt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=dt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=dt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=dt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=dt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=dt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=dt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=dt("chat.cloudAgentBackend.version",0,"v1"),t.AdditionalReadAccessPaths=dt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=dt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=dt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=dt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=dt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=dt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=dt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=dt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=dt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=dt("chat.localIndex.enabled",1,!1)})(jAr||(Uo.ConfigKey=jAr={}));function Yva(){return Object.values(jAr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(Yva,"getAllConfigKeys");var Kva=[];function Jva(t){return Kva.push(t),t}a(Jva,"registerNextEditProviderId")});var hp=I(XA=>{"use strict";p();Object.defineProperty(XA,"__esModule",{value:!0});XA.LogMemory=XA.LogServiceImpl=XA.ConsoleLog=XA.LogTarget=XA.LogLevel=XA.ILogService=void 0;XA.collectErrorMessages=z_i;XA.collectSingleLineErrorMessage=eCa;XA.sanitizeNetworkErrorForTelemetry=tCa;var Zva=rn(),Xva=wo();XA.ILogService=(0,Zva.createServiceIdentifier)("ILogService");var _E;(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"})(_E||(XA.LogLevel=_E={}));var W_i;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(W_i||(XA.LogTarget=W_i={}));var GAr=class{static{a(this,"ConsoleLog")}constructor(e,r=_E.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===_E.Error?console.error(r,...n):e===_E.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};XA.ConsoleLog=GAr;var $Ar=class extends Xva.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new VAr(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)}};XA.LogServiceImpl=$Ar;var VAr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){Cht.addLog(_E[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(_E.Trace,e)}debug(e){this._logIt(_E.Debug,e)}info(e){this._logIt(_E.Info,e)}warn(e){this._logIt(_E.Warning,e)}error(e,r){this._logIt(_E.Error,z_i(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new WAr(this,e)}withExtraTarget(e){return new vht(this,[e])}},WAr=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 vht(this,[e],this._prefix)}},vht=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(_E.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(_E.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(_E.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(_E.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(_E.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 z_i(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(Evi(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(yvi,"collectErrorMessages");function rTa(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(Evi(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(rTa,"collectSingleLineErrorMessage");function nTa(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(nTa,"sanitizeNetworkErrorForTelemetry");function Evi(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(Evi,"extractChromiumDetails");var i0t=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}};zA.LogMemory=i0t});var UMe=I(FMe=>{"use strict";p();Object.defineProperty(FMe,"__esModule",{value:!0});FMe.ICopilotTokenManager=void 0;FMe.nowSeconds=oTa;var iTa=rn();FMe.ICopilotTokenManager=(0,iTa.createServiceIdentifier)("ICopilotTokenManager");function oTa(){return Math.floor(Date.now()/1e3)}a(oTa,"nowSeconds")});var SE=I(u0=>{"use strict";p();var sTa=u0&&u0.__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},o0t=u0&&u0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u0,"__esModule",{value:!0});u0.BaseAuthenticationService=u0.IAuthenticationService=u0.MinimalModeError=u0.GITHUB_SCOPE_ALIGNED=u0.GITHUB_SCOPE_READ_USER=u0.GITHUB_SCOPE_USER_EMAIL=void 0;u0.authProviderId=pTa;var aTa=rn(),Zyr=Sc(),cTa=ko(),lTa=HF(),bee=Il(),uTa=pp(),dTa=UMe(),fTa=_H();u0.GITHUB_SCOPE_USER_EMAIL=["user:email"];u0.GITHUB_SCOPE_READ_USER=["read:user"];u0.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var Xyr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};u0.MinimalModeError=Xyr;u0.IAuthenticationService=(0,aTa.createServiceIdentifier)("IAuthenticationService");var eEr=class extends cTa.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()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new Zyr.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidAccessTokenChange=this._register(new Zyr.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new Zyr.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,lTa.derived)(s=>this._configurationService.getConfigObservable(bee.ConfigKey.Shared.AuthPermissions).read(s)===bee.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=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=r,this._copilotTokenError=void 0,r}catch(r){this._tokenStore.copilotToken=void 0;let n=this._copilotTokenError;throw this._copilotTokenError=r,n&&r&&n.message!==r.message&&this.fireAuthenticationChange("getCopilotToken error change"),r}}resetCopilotToken(e){this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e)}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=this._tokenStore.copilotToken,s=this._copilotTokenError,c=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let l of c)l.status==="rejected"&&this._logService.error(`Error getting a session: ${l.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed, minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken.");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{}(o?.token!==this._tokenStore.copilotToken?.token||s?.message!==this._copilotTokenError?.message)&&(this._logService.debug("CopilotToken state changed, firing event."),this.fireAuthenticationChange("handleAuthChangeEvent")),this._logService.debug("Finished handling auth change event.")}};u0.BaseAuthenticationService=eEr;u0.BaseAuthenticationService=eEr=sTa([o0t(0,uTa.ILogService),o0t(1,fTa.ICopilotTokenStore),o0t(2,dTa.ICopilotTokenManager),o0t(3,bee.IConfigurationService)],eEr);function pTa(t){return t.getConfig(bee.ConfigKey.Shared.AuthProvider)===bee.AuthProviderId.GitHubEnterprise?bee.AuthProviderId.GitHubEnterprise:bee.AuthProviderId.GitHub}a(pTa,"authProviderId")});var s0t=I(tEr=>{"use strict";p();Object.defineProperty(tEr,"__esModule",{value:!0});tEr.onCopilotToken=hTa;function hTa(t,e){return t.onDidAuthenticationChange(()=>{let r=t.copilotToken;r&&e(r)})}a(hTa,"onCopilotToken")});var nEr=I(B2=>{"use strict";p();var mTa=B2&&B2.__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},gTa=B2&&B2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(B2,"__esModule",{value:!0});B2.TelemetryUserConfig=B2.ICompletionsTelemetryUserConfigService=void 0;var ATa=SE(),yTa=rn(),ETa=ko(),_Ta=s0t();function CTa(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(CTa,"propertiesFromCopilotToken");B2.ICompletionsTelemetryUserConfigService=(0,yTa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var rEr=class extends ETa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,_Ta.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=CTa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};B2.TelemetryUserConfig=rEr;B2.TelemetryUserConfig=rEr=mTa([gTa(0,ATa.IAuthenticationService)],rEr)});var QMe=I(lme=>{"use strict";p();Object.defineProperty(lme,"__esModule",{value:!0});lme.PromiseQueue=lme.ICompletionsPromiseQueueService=void 0;var vTa=rn();lme.ICompletionsPromiseQueueService=(0,vTa.createServiceIdentifier)("completionsPromiseQueueService");var iEr=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)}};lme.PromiseQueue=iEr});var Tg=I(ud=>{"use strict";p();Object.defineProperty(ud,"__esModule",{value:!0});ud.TelemetryReporters=ud.ICompletionsTelemetryReporters=ud.CopilotTelemetryReporter=ud.TelemetryWithExp=ud.TelemetryData=ud.TelemetryStore=void 0;ud.telemetrizePromptLength=MTa;ud.now=dme;ud.telemetry=pEr;ud.telemetryExpProblem=LTa;ud.telemetryRaw=UTa;ud.telemetryException=vvi;ud.telemetryCatch=QTa;ud.telemetryError=qTa;ud.logEngineCompletion=HTa;ud.logEnginePrompt=GTa;var bTa=a4(),STa=rn(),TTa=um(),cEr=Qs(),a0t=See(),c4=vE(),ITa=Dht(),xTa=VA(),wTa=Mht(),RTa=kyr(),lEr=nEr(),uEr=QMe(),kT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(kT||(ud.TelemetryStore=kT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(kT||(ud.TelemetryStore=kT={}));function ume(t){return t===kT.Enhanced}a(ume,"isEnhanced");var kTa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],qMe=8192,PTa=21,l4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[RTa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},dme())}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=dme())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(xTa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(bTa.IEnvService),n=e.get(c4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,c4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,c4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${c4.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,c4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,c4.dumpForTelemetry)(e);r["copilot.build"]=c4.BuildInfo.getBuild(),r["copilot.buildType"]=c4.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(ume(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>qMe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+qMe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(MTa,"telemetrizePromptLength");function dme(){return performance.now()}a(dme,"now");function OTa(t){return Math.floor(t/1e3)}a(OTa,"nowSeconds");function fEr(t){return t.get(lEr.ICompletionsTelemetryUserConfigService).optedIn}a(fEr,"shouldSendEnhanced");function _vi(t){return t.get(lEr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(_vi,"shouldSendFinetuningTelemetry");function pEr(t,e,r,n){return t.get(uEr.ICompletionsPromiseQueueService).register(BTa(t,e,dme(),r?.extendedBy(),n))}a(pEr,"telemetry");async function BTa(t,e,r,n,o=kT.Standard){let s=t.get(a0t.ICompletionsTelemetryService),c=t.get(cEr.IInstantiationService),l=n||l4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!ume(o)||c.invokeFunction(fEr))&&dEr(s,o,e,l),ume(o)&&kTa.includes(e)&&c.invokeFunction(_vi)&&c.invokeFunction(NTa,o,e,l)}a(BTa,"_telemetry");function LTa(t,e){return t.get(uEr.ICompletionsPromiseQueueService).register(FTa(t,e,dme()))}a(LTa,"telemetryExpProblem");async function FTa(t,e,r){let n=t.get(a0t.ICompletionsTelemetryService),o="expProblem",s=l4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,kT.Standard,"SkipExp",r),dEr(n,kT.Standard,o,s)}a(FTa,"_telemetryExpProblem");function UTa(t,e,r,n){let o=t.get(a0t.ICompletionsTelemetryService),s={...r,...Cvi(t)};dEr(o,kT.Standard,e,{properties:s,measurements:n})}a(UTa,"telemetryRaw");function Cvi(t){let e=t.get(c4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,TTa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,c4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(lEr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(Cvi,"createRequiredProperties");function vvi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(vvi,"telemetryException");function QTa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){vvi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(QTa,"telemetryCatch");function qTa(t,e,r,n){return t.get(uEr.ICompletionsPromiseQueueService).register(jTa(t,e,dme(),r?.extendedBy(),n))}a(qTa,"telemetryError");async function jTa(t,e,r,n,o=kT.Standard){if(ume(o)&&!fEr(t))return;let s=t.get(cEr.IInstantiationService),c=n||l4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(DTa,o,e,c)}a(jTa,"_telemetryError");function HTa(t,e,r,n,o){let s=l4.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),pEr(t,"engine.completion",s,kT.Enhanced)}a(HTa,"logEngineCompletion");function GTa(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 pEr(t,"engine.prompt",o,kT.Enhanced)}a(GTa,"logEnginePrompt");var sEr=class{static{a(this,"CopilotTelemetryReporter")}};ud.CopilotTelemetryReporter=sEr;ud.ICompletionsTelemetryReporters=(0,STa.createServiceIdentifier)("ICompletionsTelemetryReporters");var aEr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=kT.Standard){return ume(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(fEr(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()))}};ud.TelemetryReporters=aEr});var See=I(L2=>{"use strict";p();var $Ta=L2&&L2.__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},VTa=L2&&L2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(L2,"__esModule",{value:!0});L2.CompletionsTelemetryServiceBridge=L2.ICompletionsTelemetryService=void 0;var WTa=o0(),hEr=Cyr(),zTa=rn(),jMe=Tg();L2.ICompletionsTelemetryService=(0,zTa.createServiceIdentifier)("completionsTelemetryService");var mEr=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,hEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??jMe.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,hEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??jMe.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,hEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??jMe.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??jMe.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 jMe.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};L2.CompletionsTelemetryServiceBridge=mEr;L2.CompletionsTelemetryServiceBridge=mEr=$Ta([VTa(0,WTa.ITelemetryService)],mEr)});var bvi=I(fme=>{"use strict";p();Object.defineProperty(fme,"__esModule",{value:!0});fme.CopilotExtensionStatus=fme.ICompletionsExtensionStatus=void 0;var YTa=rn();fme.ICompletionsExtensionStatus=(0,YTa.createServiceIdentifier)("ICompletionsExtensionStatus");var gEr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};fme.CopilotExtensionStatus=gEr});var c0t=I(F2=>{"use strict";p();Object.defineProperty(F2,"__esModule",{value:!0});F2.CopilotToken=void 0;F2.containsInternalOrg=Svi;F2.containsVSCodeOrg=xvi;F2.validateTokenEnvelope=wvi;F2.isTokenEnvelope=tIa;F2.isErrorEnvelope=rIa;F2.isStandardErrorEnvelope=nIa;F2.createTestExtendedTokenInfo=iIa;var Fn=KH();function Svi(t){return Tvi(t)||Ivi(t)}a(Svi,"containsInternalOrg");function Tvi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(Tvi,"containsGitHubOrg");function Ivi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(Ivi,"containsMicrosoftOrg");function xvi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(xvi,"containsVSCodeOrg");var AEr=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 Svi(this.organizationList)}get isMicrosoftInternal(){return Ivi(this.organizationList)}get isGitHubInternal(){return Tvi(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||xvi(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"}};F2.CopilotToken=AEr;var KTa=(0,Fn.vObj)({message:(0,Fn.vRequired)((0,Fn.vString)()),notification_id:(0,Fn.vRequired)((0,Fn.vString)()),title:(0,Fn.vRequired)((0,Fn.vString)()),url:(0,Fn.vRequired)((0,Fn.vString)())}),JTa=(0,Fn.vObj)({can_signup_for_limited:(0,Fn.vNullable)((0,Fn.vBoolean)()),error_details:(0,Fn.vRequired)(KTa),message:(0,Fn.vRequired)((0,Fn.vString)()),reason:(0,Fn.vString)()}),ZTa=(0,Fn.vObj)({token:(0,Fn.vRequired)((0,Fn.vString)()),expires_at:(0,Fn.vRequired)((0,Fn.vNumber)()),refresh_in:(0,Fn.vRequired)((0,Fn.vNumber)()),sku:(0,Fn.vString)(),individual:(0,Fn.vBoolean)(),blackbird_clientside_indexing:(0,Fn.vBoolean)(),code_quote_enabled:(0,Fn.vBoolean)(),code_review_enabled:(0,Fn.vBoolean)(),codesearch:(0,Fn.vBoolean)(),copilotignore_enabled:(0,Fn.vBoolean)(),public_suggestions:(0,Fn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Fn.vEnum)("enabled","disabled"),endpoints:(0,Fn.vObj)({api:(0,Fn.vString)(),"origin-tracker":(0,Fn.vString)(),proxy:(0,Fn.vString)(),telemetry:(0,Fn.vString)()}),enterprise_list:(0,Fn.vNullable)((0,Fn.vArray)((0,Fn.vNumber)())),limited_user_quotas:(0,Fn.vNullable)((0,Fn.vObj)({chat:(0,Fn.vRequired)((0,Fn.vNumber)()),completions:(0,Fn.vRequired)((0,Fn.vNumber)())})),limited_user_reset_date:(0,Fn.vNullable)((0,Fn.vNumber)()),organization_list:(0,Fn.vArray)((0,Fn.vString)())}),XTa=(0,Fn.vObj)({message:(0,Fn.vRequired)((0,Fn.vString)()),documentation_url:(0,Fn.vRequired)((0,Fn.vString)()),status:(0,Fn.vRequired)((0,Fn.vString)())}),eIa=(0,Fn.vObj)({token:(0,Fn.vRequired)((0,Fn.vString)()),expires_at:(0,Fn.vRequired)((0,Fn.vNumber)()),refresh_in:(0,Fn.vRequired)((0,Fn.vNumber)())});function wvi(t){let e=ZTa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=eIa.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(wvi,"validateTokenEnvelope");function tIa(t){return wvi(t).valid}a(tIa,"isTokenEnvelope");function rIa(t){return JTa.validate(t).error===void 0}a(rIa,"isErrorEnvelope");function nIa(t){return XTa.validate(t).error===void 0}a(nIa,"isStandardErrorEnvelope");function iIa(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(iIa,"createTestExtendedTokenInfo")});var pme=I(PT=>{"use strict";p();var oIa=PT&&PT.__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},sIa=PT&&PT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(PT,"__esModule",{value:!0});PT.CopilotTokenManagerImpl=PT.ICompletionsCopilotTokenManager=PT.CopilotToken=void 0;var aIa=SE(),cIa=rn(),lIa=Xc(),uIa=ko(),dIa=c0t();Object.defineProperty(PT,"CopilotToken",{enumerable:!0,get:a(function(){return dIa.CopilotToken},"get")});PT.ICompletionsCopilotTokenManager=(0,cIa.createServiceIdentifier)("ICompletionsCopilotTokenManager");var yEr=class extends uIa.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 lIa.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidAuthenticationChange(()=>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}};PT.CopilotTokenManagerImpl=yEr;PT.CopilotTokenManagerImpl=yEr=oIa([sIa(1,aIa.IAuthenticationService)],yEr)});var l0t=I(hme=>{"use strict";p();Object.defineProperty(hme,"__esModule",{value:!0});hme.NoOpCitationManager=hme.ICompletionsCitationManager=void 0;var fIa=rn(),pIa=ko();hme.ICompletionsCitationManager=(0,fIa.createServiceIdentifier)("ICompletionsCitationManager");var EEr=class{static{a(this,"NoOpCitationManager")}register(){return pIa.Disposable.None}async handleIPCodeCitation(e){}};hme.NoOpCitationManager=EEr});var uC=I(wg=>{"use strict";p();Object.defineProperty(wg,"__esModule",{value:!0});wg.HasPropertyKey=hIa;wg.IsAsyncIterator=mIa;wg.IsArray=_Er;wg.IsBigInt=gIa;wg.IsBoolean=AIa;wg.IsDate=yIa;wg.IsFunction=EIa;wg.IsIterator=_Ia;wg.IsNull=CIa;wg.IsNumber=vIa;wg.IsObject=CEr;wg.IsRegExp=bIa;wg.IsString=SIa;wg.IsSymbol=TIa;wg.IsUint8Array=vEr;wg.IsUndefined=IIa;function hIa(t,e){return e in t}a(hIa,"HasPropertyKey");function mIa(t){return CEr(t)&&!_Er(t)&&!vEr(t)&&Symbol.asyncIterator in t}a(mIa,"IsAsyncIterator");function _Er(t){return Array.isArray(t)}a(_Er,"IsArray");function gIa(t){return typeof t=="bigint"}a(gIa,"IsBigInt");function AIa(t){return typeof t=="boolean"}a(AIa,"IsBoolean");function yIa(t){return t instanceof globalThis.Date}a(yIa,"IsDate");function EIa(t){return typeof t=="function"}a(EIa,"IsFunction");function _Ia(t){return CEr(t)&&!_Er(t)&&!vEr(t)&&Symbol.iterator in t}a(_Ia,"IsIterator");function CIa(t){return t===null}a(CIa,"IsNull");function vIa(t){return typeof t=="number"}a(vIa,"IsNumber");function CEr(t){return typeof t=="object"&&t!==null}a(CEr,"IsObject");function bIa(t){return t instanceof globalThis.RegExp}a(bIa,"IsRegExp");function SIa(t){return typeof t=="string"}a(SIa,"IsString");function TIa(t){return typeof t=="symbol"}a(TIa,"IsSymbol");function vEr(t){return t instanceof globalThis.Uint8Array}a(vEr,"IsUint8Array");function IIa(t){return t===void 0}a(IIa,"IsUndefined")});var Lb=I(_8=>{"use strict";p();var xIa=_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]})),wIa=_8&&_8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RIa=_8&&_8.__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;ou0t(e))}a(kIa,"ArrayType");function PIa(t){return new Date(t.getTime())}a(PIa,"DateType");function DIa(t){return new Uint8Array(t)}a(DIa,"Uint8ArrayType");function NIa(t){return new RegExp(t.source,t.flags)}a(NIa,"RegExpType");function MIa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=u0t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=u0t(t[r]);return e}a(MIa,"ObjectType");function u0t(t){return HMe.IsArray(t)?kIa(t):HMe.IsDate(t)?PIa(t):HMe.IsUint8Array(t)?DIa(t):HMe.IsRegExp(t)?NIa(t):HMe.IsObject(t)?MIa(t):t}a(u0t,"Visit");function OIa(t){return u0t(t)}a(OIa,"Clone")});var f0t=I(d0t=>{"use strict";p();Object.defineProperty(d0t,"__esModule",{value:!0});d0t.CloneRest=BIa;d0t.CloneType=kvi;var Rvi=Lb();function BIa(t){return t.map(e=>kvi(e))}a(BIa,"CloneRest");function kvi(t,e){return e===void 0?(0,Rvi.Clone)(t):(0,Rvi.Clone)({...e,...t})}a(kvi,"CloneType")});var bEr=I(tG=>{"use strict";p();var LIa=tG&&tG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pvi=tG&&tG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LIa(e,t,r)};Object.defineProperty(tG,"__esModule",{value:!0});Pvi(f0t(),tG);Pvi(Lb(),tG)});var p0t=I(ga=>{"use strict";p();Object.defineProperty(ga,"__esModule",{value:!0});ga.IsAsyncIterator=FIa;ga.IsIterator=UIa;ga.IsStandardObject=QIa;ga.IsInstanceObject=qIa;ga.IsPromise=jIa;ga.IsDate=HIa;ga.IsMap=GIa;ga.IsSet=$Ia;ga.IsRegExp=VIa;ga.IsTypedArray=WIa;ga.IsInt8Array=zIa;ga.IsUint8Array=YIa;ga.IsUint8ClampedArray=KIa;ga.IsInt16Array=JIa;ga.IsUint16Array=ZIa;ga.IsInt32Array=XIa;ga.IsUint32Array=exa;ga.IsFloat32Array=txa;ga.IsFloat64Array=rxa;ga.IsBigInt64Array=nxa;ga.IsBigUint64Array=ixa;ga.HasPropertyKey=oxa;ga.IsObject=GMe;ga.IsArray=Dvi;ga.IsUndefined=Nvi;ga.IsNull=Mvi;ga.IsBoolean=Ovi;ga.IsNumber=Bvi;ga.IsInteger=sxa;ga.IsBigInt=Lvi;ga.IsString=Fvi;ga.IsFunction=Uvi;ga.IsSymbol=Qvi;ga.IsValueType=axa;function FIa(t){return GMe(t)&&globalThis.Symbol.asyncIterator in t}a(FIa,"IsAsyncIterator");function UIa(t){return GMe(t)&&globalThis.Symbol.iterator in t}a(UIa,"IsIterator");function QIa(t){return GMe(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(QIa,"IsStandardObject");function qIa(t){return GMe(t)&&!Dvi(t)&&Uvi(t.constructor)&&t.constructor.name!=="Object"}a(qIa,"IsInstanceObject");function jIa(t){return t instanceof globalThis.Promise}a(jIa,"IsPromise");function HIa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(HIa,"IsDate");function GIa(t){return t instanceof globalThis.Map}a(GIa,"IsMap");function $Ia(t){return t instanceof globalThis.Set}a($Ia,"IsSet");function VIa(t){return t instanceof globalThis.RegExp}a(VIa,"IsRegExp");function WIa(t){return globalThis.ArrayBuffer.isView(t)}a(WIa,"IsTypedArray");function zIa(t){return t instanceof globalThis.Int8Array}a(zIa,"IsInt8Array");function YIa(t){return t instanceof globalThis.Uint8Array}a(YIa,"IsUint8Array");function KIa(t){return t instanceof globalThis.Uint8ClampedArray}a(KIa,"IsUint8ClampedArray");function JIa(t){return t instanceof globalThis.Int16Array}a(JIa,"IsInt16Array");function ZIa(t){return t instanceof globalThis.Uint16Array}a(ZIa,"IsUint16Array");function XIa(t){return t instanceof globalThis.Int32Array}a(XIa,"IsInt32Array");function exa(t){return t instanceof globalThis.Uint32Array}a(exa,"IsUint32Array");function txa(t){return t instanceof globalThis.Float32Array}a(txa,"IsFloat32Array");function rxa(t){return t instanceof globalThis.Float64Array}a(rxa,"IsFloat64Array");function nxa(t){return t instanceof globalThis.BigInt64Array}a(nxa,"IsBigInt64Array");function ixa(t){return t instanceof globalThis.BigUint64Array}a(ixa,"IsBigUint64Array");function oxa(t,e){return e in t}a(oxa,"HasPropertyKey");function GMe(t){return t!==null&&typeof t=="object"}a(GMe,"IsObject");function Dvi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Dvi,"IsArray");function Nvi(t){return t===void 0}a(Nvi,"IsUndefined");function Mvi(t){return t===null}a(Mvi,"IsNull");function Ovi(t){return typeof t=="boolean"}a(Ovi,"IsBoolean");function Bvi(t){return typeof t=="number"}a(Bvi,"IsNumber");function sxa(t){return globalThis.Number.isInteger(t)}a(sxa,"IsInteger");function Lvi(t){return typeof t=="bigint"}a(Lvi,"IsBigInt");function Fvi(t){return typeof t=="string"}a(Fvi,"IsString");function Uvi(t){return typeof t=="function"}a(Uvi,"IsFunction");function Qvi(t){return typeof t=="symbol"}a(Qvi,"IsSymbol");function axa(t){return Lvi(t)||Ovi(t)||Mvi(t)||Bvi(t)||Fvi(t)||Qvi(t)||Nvi(t)}a(axa,"IsValueType")});var pm=I(Tee=>{"use strict";p();var cxa=Tee&&Tee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lxa=Tee&&Tee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cxa(e,t,r)};Object.defineProperty(Tee,"__esModule",{value:!0});lxa(p0t(),Tee)});var $Me=I(m0t=>{"use strict";p();Object.defineProperty(m0t,"__esModule",{value:!0});m0t.TypeSystemPolicy=void 0;var h0t=pm(),qvi;(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,h0t.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,h0t.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,h0t.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,h0t.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(qvi||(m0t.TypeSystemPolicy=qvi={}))});var jvi=I(C8=>{"use strict";p();var uxa=C8&&C8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dxa=C8&&C8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fxa=C8&&C8.__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;og0t(e))}a(pxa,"ImmutableArray");function hxa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=g0t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=g0t(t[r]);return globalThis.Object.freeze(e)}a(hxa,"ImmutableObject");function g0t(t){return VMe.IsArray(t)?pxa(t):VMe.IsDate(t)?t:VMe.IsUint8Array(t)?t:VMe.IsRegExp(t)?t:VMe.IsObject(t)?hxa(t):t}a(g0t,"Immutable")});var Ti=I(SEr=>{"use strict";p();Object.defineProperty(SEr,"__esModule",{value:!0});SEr.CreateType=yxa;var mxa=$Me(),gxa=jvi(),Axa=Lb();function yxa(t,e){let r=e!==void 0?{...e,...t}:t;switch(mxa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,gxa.Immutable)(r);case"clone":return(0,Axa.Clone)(r);default:return r}}a(yxa,"CreateType")});var v8=I(Iee=>{"use strict";p();var Exa=Iee&&Iee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_xa=Iee&&Iee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Exa(e,t,r)};Object.defineProperty(Iee,"__esModule",{value:!0});_xa(Ti(),Iee)});var IEr=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.TypeBoxError=void 0;var TEr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};A0t.TypeBoxError=TEr});var bf=I(xee=>{"use strict";p();var Cxa=xee&&xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vxa=xee&&xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cxa(e,t,r)};Object.defineProperty(xee,"__esModule",{value:!0});vxa(IEr(),xee)});var WMe=I(nR=>{"use strict";p();Object.defineProperty(nR,"__esModule",{value:!0});nR.Kind=nR.Hint=nR.OptionalKind=nR.ReadonlyKind=nR.TransformKind=void 0;nR.TransformKind=Symbol.for("TypeBox.Transform");nR.ReadonlyKind=Symbol.for("TypeBox.Readonly");nR.OptionalKind=Symbol.for("TypeBox.Optional");nR.Hint=Symbol.for("TypeBox.Hint");nR.Kind=Symbol.for("TypeBox.Kind")});var _n=I(wee=>{"use strict";p();var bxa=wee&&wee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Sxa=wee&&wee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bxa(e,t,r)};Object.defineProperty(wee,"__esModule",{value:!0});Sxa(WMe(),wee)});var gs=I(ci=>{"use strict";p();var Txa=ci&&ci.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ixa=ci&&ci.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xxa=ci&&ci.__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 Uxa=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]})),Qxa=Yn&&Yn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qxa=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(wEr,"IsControlCharacterFree");function Ibi(t){return REr(t)||Rg(t)}a(Ibi,"IsAdditionalProperties");function YMe(t){return ii.IsUndefined(t)||ii.IsBigInt(t)}a(YMe,"IsOptionalBigInt");function Wl(t){return ii.IsUndefined(t)||ii.IsNumber(t)}a(Wl,"IsOptionalNumber");function REr(t){return ii.IsUndefined(t)||ii.IsBoolean(t)}a(REr,"IsOptionalBoolean");function ll(t){return ii.IsUndefined(t)||ii.IsString(t)}a(ll,"IsOptionalString");function Gxa(t){return ii.IsUndefined(t)||ii.IsString(t)&&wEr(t)&&Tbi(t)}a(Gxa,"IsOptionalPattern");function $xa(t){return ii.IsUndefined(t)||ii.IsString(t)&&wEr(t)}a($xa,"IsOptionalFormat");function xbi(t){return ii.IsUndefined(t)||Rg(t)}a(xbi,"IsOptionalSchema");function Vxa(t){return ii.IsObject(t)&&t[u4.ReadonlyKind]==="Readonly"}a(Vxa,"IsReadonly");function Wxa(t){return ii.IsObject(t)&&t[u4.OptionalKind]==="Optional"}a(Wxa,"IsOptional");function wbi(t){return js(t,"Any")&&ll(t.$id)}a(wbi,"IsAny");function Rbi(t){return js(t,"Argument")&&ii.IsNumber(t.index)}a(Rbi,"IsArgument");function kbi(t){return js(t,"Array")&&t.type==="array"&&ll(t.$id)&&Rg(t.items)&&Wl(t.minItems)&&Wl(t.maxItems)&&REr(t.uniqueItems)&&xbi(t.contains)&&Wl(t.minContains)&&Wl(t.maxContains)}a(kbi,"IsArray");function Pbi(t){return js(t,"AsyncIterator")&&t.type==="AsyncIterator"&&ll(t.$id)&&Rg(t.items)}a(Pbi,"IsAsyncIterator");function Dbi(t){return js(t,"BigInt")&&t.type==="bigint"&&ll(t.$id)&&YMe(t.exclusiveMaximum)&&YMe(t.exclusiveMinimum)&&YMe(t.maximum)&&YMe(t.minimum)&&YMe(t.multipleOf)}a(Dbi,"IsBigInt");function Nbi(t){return js(t,"Boolean")&&t.type==="boolean"&&ll(t.$id)}a(Nbi,"IsBoolean");function Mbi(t){return js(t,"Computed")&&ii.IsString(t.target)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Rg(e))}a(Mbi,"IsComputed");function Obi(t){return js(t,"Constructor")&&t.type==="Constructor"&&ll(t.$id)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Rg(e))&&Rg(t.returns)}a(Obi,"IsConstructor");function Bbi(t){return js(t,"Date")&&t.type==="Date"&&ll(t.$id)&&Wl(t.exclusiveMaximumTimestamp)&&Wl(t.exclusiveMinimumTimestamp)&&Wl(t.maximumTimestamp)&&Wl(t.minimumTimestamp)&&Wl(t.multipleOfTimestamp)}a(Bbi,"IsDate");function Lbi(t){return js(t,"Function")&&t.type==="Function"&&ll(t.$id)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Rg(e))&&Rg(t.returns)}a(Lbi,"IsFunction");function zxa(t){return js(t,"Import")&&ii.HasPropertyKey(t,"$defs")&&ii.IsObject(t.$defs)&&y0t(t.$defs)&&ii.HasPropertyKey(t,"$ref")&&ii.IsString(t.$ref)&&t.$ref in t.$defs}a(zxa,"IsImport");function Fbi(t){return js(t,"Integer")&&t.type==="integer"&&ll(t.$id)&&Wl(t.exclusiveMaximum)&&Wl(t.exclusiveMinimum)&&Wl(t.maximum)&&Wl(t.minimum)&&Wl(t.multipleOf)}a(Fbi,"IsInteger");function y0t(t){return ii.IsObject(t)&&Object.entries(t).every(([e,r])=>wEr(e)&&Rg(r))}a(y0t,"IsProperties");function Ubi(t){return js(t,"Intersect")&&!(ii.IsString(t.type)&&t.type!=="object")&&ii.IsArray(t.allOf)&&t.allOf.every(e=>Rg(e)&&!o1i(e))&&ll(t.type)&&(REr(t.unevaluatedProperties)||xbi(t.unevaluatedProperties))&&ll(t.$id)}a(Ubi,"IsIntersect");function Qbi(t){return js(t,"Iterator")&&t.type==="Iterator"&&ll(t.$id)&&Rg(t.items)}a(Qbi,"IsIterator");function js(t,e){return ii.IsObject(t)&&u4.Kind in t&&t[u4.Kind]===e}a(js,"IsKindOf");function qbi(t){return KMe(t)&&ii.IsString(t.const)}a(qbi,"IsLiteralString");function jbi(t){return KMe(t)&&ii.IsNumber(t.const)}a(jbi,"IsLiteralNumber");function Yxa(t){return KMe(t)&&ii.IsBoolean(t.const)}a(Yxa,"IsLiteralBoolean");function KMe(t){return js(t,"Literal")&&ll(t.$id)&&Hbi(t.const)}a(KMe,"IsLiteral");function Hbi(t){return ii.IsBoolean(t)||ii.IsNumber(t)||ii.IsString(t)}a(Hbi,"IsLiteralValue");function Gbi(t){return js(t,"MappedKey")&&ii.IsArray(t.keys)&&t.keys.every(e=>ii.IsNumber(e)||ii.IsString(e))}a(Gbi,"IsMappedKey");function $bi(t){return js(t,"MappedResult")&&y0t(t.properties)}a($bi,"IsMappedResult");function Vbi(t){return js(t,"Never")&&ii.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Vbi,"IsNever");function Wbi(t){return js(t,"Not")&&Rg(t.not)}a(Wbi,"IsNot");function zbi(t){return js(t,"Null")&&t.type==="null"&&ll(t.$id)}a(zbi,"IsNull");function Ybi(t){return js(t,"Number")&&t.type==="number"&&ll(t.$id)&&Wl(t.exclusiveMaximum)&&Wl(t.exclusiveMinimum)&&Wl(t.maximum)&&Wl(t.minimum)&&Wl(t.multipleOf)}a(Ybi,"IsNumber");function Kbi(t){return js(t,"Object")&&t.type==="object"&&ll(t.$id)&&y0t(t.properties)&&Ibi(t.additionalProperties)&&Wl(t.minProperties)&&Wl(t.maxProperties)}a(Kbi,"IsObject");function Jbi(t){return js(t,"Promise")&&t.type==="Promise"&&ll(t.$id)&&Rg(t.item)}a(Jbi,"IsPromise");function Zbi(t){return js(t,"Record")&&t.type==="object"&&ll(t.$id)&&Ibi(t.additionalProperties)&&ii.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&Tbi(r[0])&&ii.IsObject(e.patternProperties)&&Rg(e.patternProperties[r[0]])})(t)}a(Zbi,"IsRecord");function Kxa(t){return ii.IsObject(t)&&u4.Hint in t&&t[u4.Hint]==="Recursive"}a(Kxa,"IsRecursive");function Xbi(t){return js(t,"Ref")&&ll(t.$id)&&ii.IsString(t.$ref)}a(Xbi,"IsRef");function e1i(t){return js(t,"RegExp")&&ll(t.$id)&&ii.IsString(t.source)&&ii.IsString(t.flags)&&Wl(t.maxLength)&&Wl(t.minLength)}a(e1i,"IsRegExp");function t1i(t){return js(t,"String")&&t.type==="string"&&ll(t.$id)&&Wl(t.minLength)&&Wl(t.maxLength)&&Gxa(t.pattern)&&$xa(t.format)}a(t1i,"IsString");function r1i(t){return js(t,"Symbol")&&t.type==="symbol"&&ll(t.$id)}a(r1i,"IsSymbol");function n1i(t){return js(t,"TemplateLiteral")&&t.type==="string"&&ii.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(n1i,"IsTemplateLiteral");function i1i(t){return js(t,"This")&&ll(t.$id)&&ii.IsString(t.$ref)}a(i1i,"IsThis");function o1i(t){return ii.IsObject(t)&&u4.TransformKind in t}a(o1i,"IsTransform");function s1i(t){return js(t,"Tuple")&&t.type==="array"&&ll(t.$id)&&ii.IsNumber(t.minItems)&&ii.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(ii.IsUndefined(t.items)&&ii.IsUndefined(t.additionalItems)&&t.minItems===0||ii.IsArray(t.items)&&t.items.every(e=>Rg(e)))}a(s1i,"IsTuple");function a1i(t){return js(t,"Undefined")&&t.type==="undefined"&&ll(t.$id)}a(a1i,"IsUndefined");function Jxa(t){return kEr(t)&&t.anyOf.every(e=>qbi(e)||jbi(e))}a(Jxa,"IsUnionLiteral");function kEr(t){return js(t,"Union")&&ll(t.$id)&&ii.IsObject(t)&&ii.IsArray(t.anyOf)&&t.anyOf.every(e=>Rg(e))}a(kEr,"IsUnion");function c1i(t){return js(t,"Uint8Array")&&t.type==="Uint8Array"&&ll(t.$id)&&Wl(t.minByteLength)&&Wl(t.maxByteLength)}a(c1i,"IsUint8Array");function l1i(t){return js(t,"Unknown")&&ll(t.$id)}a(l1i,"IsUnknown");function u1i(t){return js(t,"Unsafe")}a(u1i,"IsUnsafe");function d1i(t){return js(t,"Void")&&t.type==="void"&&ll(t.$id)}a(d1i,"IsVoid");function f1i(t){return ii.IsObject(t)&&u4.Kind in t&&ii.IsString(t[u4.Kind])&&!Hxa.includes(t[u4.Kind])}a(f1i,"IsKind");function Rg(t){return ii.IsObject(t)&&(wbi(t)||Rbi(t)||kbi(t)||Nbi(t)||Dbi(t)||Pbi(t)||Mbi(t)||Obi(t)||Bbi(t)||Lbi(t)||Fbi(t)||Ubi(t)||Qbi(t)||KMe(t)||Gbi(t)||$bi(t)||Vbi(t)||Wbi(t)||zbi(t)||Ybi(t)||Kbi(t)||Jbi(t)||Zbi(t)||Xbi(t)||e1i(t)||t1i(t)||r1i(t)||n1i(t)||i1i(t)||s1i(t)||a1i(t)||kEr(t)||c1i(t)||l1i(t)||u1i(t)||d1i(t)||f1i(t))}a(Rg,"IsSchema")});var DEr=I(Ub=>{"use strict";p();var Zxa=Ub&&Ub.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xxa=Ub&&Ub.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PEr=Ub&&Ub.__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(NEr,"__esModule",{value:!0});NEr.Increment=ewa;function ewa(t){return(parseInt(t)+1).toString()}a(ewa,"Increment")});var m1i=I(Ree=>{"use strict";p();var twa=Ree&&Ree.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rwa=Ree&&Ree.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&twa(e,t,r)};Object.defineProperty(Ree,"__esModule",{value:!0});rwa(h1i(),Ree)});var g1i=I(hp=>{"use strict";p();Object.defineProperty(hp,"__esModule",{value:!0});hp.PatternNeverExact=hp.PatternStringExact=hp.PatternNumberExact=hp.PatternBooleanExact=hp.PatternNever=hp.PatternString=hp.PatternNumber=hp.PatternBoolean=void 0;hp.PatternBoolean="(true|false)";hp.PatternNumber="(0|[1-9][0-9]*)";hp.PatternString="(.*)";hp.PatternNever="(?!.*)";hp.PatternBooleanExact=`^${hp.PatternBoolean}$`;hp.PatternNumberExact=`^${hp.PatternNumber}$`;hp.PatternStringExact=`^${hp.PatternString}$`;hp.PatternNeverExact=`^${hp.PatternNever}$`});var JMe=I(kee=>{"use strict";p();var nwa=kee&&kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=kee&&kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nwa(e,t,r)};Object.defineProperty(kee,"__esModule",{value:!0});iwa(g1i(),kee)});var A1i=I(rG=>{"use strict";p();Object.defineProperty(rG,"__esModule",{value:!0});rG.Entries=owa;rG.Clear=swa;rG.Delete=awa;rG.Has=cwa;rG.Set=lwa;rG.Get=uwa;var mme=new Map;function owa(){return new Map(mme)}a(owa,"Entries");function swa(){return mme.clear()}a(swa,"Clear");function awa(t){return mme.delete(t)}a(awa,"Delete");function cwa(t){return mme.has(t)}a(cwa,"Has");function lwa(t,e){mme.set(t,e)}a(lwa,"Set");function uwa(t){return mme.get(t)}a(uwa,"Get")});var y1i=I(nG=>{"use strict";p();Object.defineProperty(nG,"__esModule",{value:!0});nG.Entries=dwa;nG.Clear=fwa;nG.Delete=pwa;nG.Has=hwa;nG.Set=mwa;nG.Get=gwa;var gme=new Map;function dwa(){return new Map(gme)}a(dwa,"Entries");function fwa(){return gme.clear()}a(fwa,"Clear");function pwa(t){return gme.delete(t)}a(pwa,"Delete");function hwa(t){return gme.has(t)}a(hwa,"Has");function mwa(t,e){gme.set(t,e)}a(mwa,"Set");function gwa(t){return gme.get(t)}a(gwa,"Get")});var Ame=I(iR=>{"use strict";p();var Awa=iR&&iR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ywa=iR&&iR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E1i=iR&&iR.__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(d4,"__esModule",{value:!0});d4.SetIncludes=_1i;d4.SetIsSubset=Ewa;d4.SetDistinct=_wa;d4.SetIntersect=C1i;d4.SetUnion=Cwa;d4.SetComplement=vwa;d4.SetIntersectMany=Swa;d4.SetUnionMany=Twa;function _1i(t,e){return t.includes(e)}a(_1i,"SetIncludes");function Ewa(t,e){return t.every(r=>_1i(e,r))}a(Ewa,"SetIsSubset");function _wa(t){return[...new Set(t)]}a(_wa,"SetDistinct");function C1i(t,e){return t.filter(r=>e.includes(r))}a(C1i,"SetIntersect");function Cwa(t,e){return[...t,...e]}a(Cwa,"SetUnion");function vwa(t,e){return t.filter(r=>!e.includes(r))}a(vwa,"SetComplement");function bwa(t,e){return t.reduce((r,n)=>C1i(r,n),e)}a(bwa,"SetIntersectManyResolve");function Swa(t){return t.length===1?t[0]:t.length>1?bwa(t.slice(1),t[0]):[]}a(Swa,"SetIntersectMany");function Twa(t){let e=[];for(let r of t)e.push(...r);return e}a(Twa,"SetUnionMany")});var ZMe=I(Pee=>{"use strict";p();var Iwa=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]})),xwa=Pee&&Pee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Iwa(e,t,r)};Object.defineProperty(Pee,"__esModule",{value:!0});xwa(v1i(),Pee)});var b1i=I(MEr=>{"use strict";p();Object.defineProperty(MEr,"__esModule",{value:!0});MEr.Any=kwa;var wwa=v8(),Rwa=_n();function kwa(t){return(0,wwa.CreateType)({[Rwa.Kind]:"Any"},t)}a(kwa,"Any")});var yme=I(Dee=>{"use strict";p();var Pwa=Dee&&Dee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Dwa=Dee&&Dee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pwa(e,t,r)};Object.defineProperty(Dee,"__esModule",{value:!0});Dwa(b1i(),Dee)});var S1i=I(OEr=>{"use strict";p();Object.defineProperty(OEr,"__esModule",{value:!0});OEr.Array=Owa;var Nwa=Ti(),Mwa=_n();function Owa(t,e){return(0,Nwa.CreateType)({[Mwa.Kind]:"Array",type:"array",items:t},e)}a(Owa,"Array")});var Eme=I(Nee=>{"use strict";p();var Bwa=Nee&&Nee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lwa=Nee&&Nee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Bwa(e,t,r)};Object.defineProperty(Nee,"__esModule",{value:!0});Lwa(S1i(),Nee)});var T1i=I(BEr=>{"use strict";p();Object.defineProperty(BEr,"__esModule",{value:!0});BEr.Argument=Qwa;var Fwa=Ti(),Uwa=_n();function Qwa(t){return(0,Fwa.CreateType)({[Uwa.Kind]:"Argument",index:t})}a(Qwa,"Argument")});var E0t=I(Mee=>{"use strict";p();var qwa=Mee&&Mee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jwa=Mee&&Mee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qwa(e,t,r)};Object.defineProperty(Mee,"__esModule",{value:!0});jwa(T1i(),Mee)});var I1i=I(LEr=>{"use strict";p();Object.defineProperty(LEr,"__esModule",{value:!0});LEr.AsyncIterator=$wa;var Hwa=_n(),Gwa=Ti();function $wa(t,e){return(0,Gwa.CreateType)({[Hwa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a($wa,"AsyncIterator")});var _me=I(Oee=>{"use strict";p();var Vwa=Oee&&Oee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wwa=Oee&&Oee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vwa(e,t,r)};Object.defineProperty(Oee,"__esModule",{value:!0});Wwa(I1i(),Oee)});var x1i=I(FEr=>{"use strict";p();Object.defineProperty(FEr,"__esModule",{value:!0});FEr.Computed=Kwa;var zwa=v8(),Ywa=WMe();function Kwa(t,e,r){return(0,zwa.CreateType)({[Ywa.Kind]:"Computed",target:t,parameters:e},r)}a(Kwa,"Computed")});var iG=I(Bee=>{"use strict";p();var Jwa=Bee&&Bee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zwa=Bee&&Bee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jwa(e,t,r)};Object.defineProperty(Bee,"__esModule",{value:!0});Zwa(x1i(),Bee)});var _0t=I(UEr=>{"use strict";p();Object.defineProperty(UEr,"__esModule",{value:!0});UEr.Discard=eRa;function Xwa(t,e){let{[e]:r,...n}=t;return n}a(Xwa,"DiscardKey");function eRa(t,e){return e.reduce((r,n)=>Xwa(r,n),t)}a(eRa,"Discard")});var S8=I(Lee=>{"use strict";p();var tRa=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]})),rRa=Lee&&Lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tRa(e,t,r)};Object.defineProperty(Lee,"__esModule",{value:!0});rRa(_0t(),Lee)});var w1i=I(QEr=>{"use strict";p();Object.defineProperty(QEr,"__esModule",{value:!0});QEr.Never=oRa;var nRa=Ti(),iRa=_n();function oRa(t){return(0,nRa.CreateType)({[iRa.Kind]:"Never",not:{}},t)}a(oRa,"Never")});var d0=I(Fee=>{"use strict";p();var sRa=Fee&&Fee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aRa=Fee&&Fee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sRa(e,t,r)};Object.defineProperty(Fee,"__esModule",{value:!0});aRa(w1i(),Fee)});var R1i=I(qEr=>{"use strict";p();Object.defineProperty(qEr,"__esModule",{value:!0});qEr.MappedKey=uRa;var cRa=Ti(),lRa=_n();function uRa(t){return(0,cRa.CreateType)({[lRa.Kind]:"MappedKey",keys:t})}a(uRa,"MappedKey")});var HEr=I(jEr=>{"use strict";p();Object.defineProperty(jEr,"__esModule",{value:!0});jEr.MappedResult=pRa;var dRa=Ti(),fRa=_n();function pRa(t){return(0,dRa.CreateType)({[fRa.Kind]:"MappedResult",properties:t})}a(pRa,"MappedResult")});var k1i=I(GEr=>{"use strict";p();Object.defineProperty(GEr,"__esModule",{value:!0});GEr.Constructor=gRa;var hRa=Ti(),mRa=_n();function gRa(t,e,r){return(0,hRa.CreateType)({[mRa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(gRa,"Constructor")});var Cme=I(Uee=>{"use strict";p();var ARa=Uee&&Uee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yRa=Uee&&Uee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ARa(e,t,r)};Object.defineProperty(Uee,"__esModule",{value:!0});yRa(k1i(),Uee)});var P1i=I($Er=>{"use strict";p();Object.defineProperty($Er,"__esModule",{value:!0});$Er.Function=CRa;var ERa=Ti(),_Ra=_n();function CRa(t,e,r){return(0,ERa.CreateType)({[_Ra.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(CRa,"Function")});var oG=I(Qee=>{"use strict";p();var vRa=Qee&&Qee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bRa=Qee&&Qee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vRa(e,t,r)};Object.defineProperty(Qee,"__esModule",{value:!0});bRa(P1i(),Qee)});var WEr=I(VEr=>{"use strict";p();Object.defineProperty(VEr,"__esModule",{value:!0});VEr.UnionCreate=IRa;var SRa=Ti(),TRa=_n();function IRa(t,e){return(0,SRa.CreateType)({[TRa.Kind]:"Union",anyOf:t},e)}a(IRa,"UnionCreate")});var O1i=I(zEr=>{"use strict";p();Object.defineProperty(zEr,"__esModule",{value:!0});zEr.UnionEvaluated=ORa;var xRa=Ti(),wRa=_n(),RRa=S8(),kRa=d0(),PRa=f4(),D1i=WEr(),M1i=gs();function DRa(t){return t.some(e=>(0,M1i.IsOptional)(e))}a(DRa,"IsUnionOptional");function N1i(t){return t.map(e=>(0,M1i.IsOptional)(e)?NRa(e):e)}a(N1i,"RemoveOptionalFromRest");function NRa(t){return(0,RRa.Discard)(t,[wRa.OptionalKind])}a(NRa,"RemoveOptionalFromType");function MRa(t,e){return DRa(t)?(0,PRa.Optional)((0,D1i.UnionCreate)(N1i(t),e)):(0,D1i.UnionCreate)(N1i(t),e)}a(MRa,"ResolveUnion");function ORa(t,e){return t.length===1?(0,xRa.CreateType)(t[0],e):t.length===0?(0,kRa.Never)(e):MRa(t,e)}a(ORa,"UnionEvaluated")});var L1i=I(B1i=>{"use strict";p();Object.defineProperty(B1i,"__esModule",{value:!0});var upp=_n()});var F1i=I(YEr=>{"use strict";p();Object.defineProperty(YEr,"__esModule",{value:!0});YEr.Union=URa;var BRa=d0(),LRa=Ti(),FRa=WEr();function URa(t,e){return t.length===0?(0,BRa.Never)(e):t.length===1?(0,LRa.CreateType)(t[0],e):(0,FRa.UnionCreate)(t,e)}a(URa,"Union")});var mp=I(T8=>{"use strict";p();var QRa=T8&&T8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KEr=T8&&T8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QRa(e,t,r)};Object.defineProperty(T8,"__esModule",{value:!0});KEr(O1i(),T8);KEr(L1i(),T8);KEr(F1i(),T8)});var C0t=I(vme=>{"use strict";p();Object.defineProperty(vme,"__esModule",{value:!0});vme.TemplateLiteralParserError=void 0;vme.TemplateLiteralParse=qee;vme.TemplateLiteralParseExact=YRa;var qRa=bf(),XMe=class extends qRa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};vme.TemplateLiteralParserError=XMe;function jRa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(jRa,"Unescape");function JEr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(JEr,"IsNonEscaped");function I8(t,e){return JEr(t,e,"(")}a(I8,"IsOpenParen");function eOe(t,e){return JEr(t,e,")")}a(eOe,"IsCloseParen");function U1i(t,e){return JEr(t,e,"|")}a(U1i,"IsSeparator");function HRa(t){if(!(I8(t,0)&&eOe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(qee(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(qee(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(WRa,"Or");function zRa(t){function e(o,s){if(!I8(o,s))throw new XMe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(qee(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(zRa,"And");function qee(t){return HRa(t)?qee(GRa(t)):$Ra(t)?WRa(t):VRa(t)?zRa(t):{type:"const",const:jRa(t)}}a(qee,"TemplateLiteralParse");function YRa(t){return qee(t.slice(1,t.length-1))}a(YRa,"TemplateLiteralParseExact")});var ZEr=I(bme=>{"use strict";p();Object.defineProperty(bme,"__esModule",{value:!0});bme.TemplateLiteralFiniteError=void 0;bme.IsTemplateLiteralExpressionFinite=b0t;bme.IsTemplateLiteralFinite=tka;var KRa=C0t(),JRa=bf(),v0t=class extends JRa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};bme.TemplateLiteralFiniteError=v0t;function ZRa(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(ZRa,"IsNumberExpression");function XRa(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(XRa,"IsBooleanExpression");function eka(t){return t.type==="const"&&t.const===".*"}a(eka,"IsStringExpression");function b0t(t){return ZRa(t)||eka(t)?!1:XRa(t)?!0:t.type==="and"?t.expr.every(e=>b0t(e)):t.type==="or"?t.expr.every(e=>b0t(e)):t.type==="const"?!0:(()=>{throw new v0t("Unknown expression type")})()}a(b0t,"IsTemplateLiteralExpressionFinite");function tka(t){let e=(0,KRa.TemplateLiteralParseExact)(t.pattern);return b0t(e)}a(tka,"IsTemplateLiteralFinite")});var XEr=I(Sme=>{"use strict";p();Object.defineProperty(Sme,"__esModule",{value:!0});Sme.TemplateLiteralGenerateError=void 0;Sme.TemplateLiteralExpressionGenerate=T0t;Sme.TemplateLiteralGenerate=cka;var rka=ZEr(),nka=C0t(),ika=bf(),S0t=class extends ika.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Sme.TemplateLiteralGenerateError=S0t;function*Q1i(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of Q1i(t.slice(1)))yield`${e}${r}`}a(Q1i,"GenerateReduce");function*oka(t){return yield*Q1i(t.expr.map(e=>[...T0t(e)]))}a(oka,"GenerateAnd");function*ska(t){for(let e of t.expr)yield*T0t(e)}a(ska,"GenerateOr");function*aka(t){return yield t.const}a(aka,"GenerateConst");function*T0t(t){return t.type==="and"?yield*oka(t):t.type==="or"?yield*ska(t):t.type==="const"?yield*aka(t):(()=>{throw new S0t("Unknown expression")})()}a(T0t,"TemplateLiteralExpressionGenerate");function cka(t){let e=(0,nka.TemplateLiteralParseExact)(t.pattern);return(0,rka.IsTemplateLiteralExpressionFinite)(e)?[...T0t(e)]:[]}a(cka,"TemplateLiteralGenerate")});var q1i=I(e_r=>{"use strict";p();Object.defineProperty(e_r,"__esModule",{value:!0});e_r.Literal=dka;var lka=Ti(),uka=_n();function dka(t,e){return(0,lka.CreateType)({[uka.Kind]:"Literal",const:t,type:typeof t},e)}a(dka,"Literal")});var TE=I(jee=>{"use strict";p();var fka=jee&&jee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pka=jee&&jee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fka(e,t,r)};Object.defineProperty(jee,"__esModule",{value:!0});pka(q1i(),jee)});var j1i=I(t_r=>{"use strict";p();Object.defineProperty(t_r,"__esModule",{value:!0});t_r.Boolean=gka;var hka=_n(),mka=v8();function gka(t){return(0,mka.CreateType)({[hka.Kind]:"Boolean",type:"boolean"},t)}a(gka,"Boolean")});var tOe=I(Hee=>{"use strict";p();var Aka=Hee&&Hee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yka=Hee&&Hee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Aka(e,t,r)};Object.defineProperty(Hee,"__esModule",{value:!0});yka(j1i(),Hee)});var H1i=I(r_r=>{"use strict";p();Object.defineProperty(r_r,"__esModule",{value:!0});r_r.BigInt=Cka;var Eka=_n(),_ka=v8();function Cka(t){return(0,_ka.CreateType)({[Eka.Kind]:"BigInt",type:"bigint"},t)}a(Cka,"BigInt")});var Tme=I(Gee=>{"use strict";p();var vka=Gee&&Gee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bka=Gee&&Gee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vka(e,t,r)};Object.defineProperty(Gee,"__esModule",{value:!0});bka(H1i(),Gee)});var G1i=I(n_r=>{"use strict";p();Object.defineProperty(n_r,"__esModule",{value:!0});n_r.Number=Ika;var Ska=Ti(),Tka=_n();function Ika(t){return(0,Ska.CreateType)({[Tka.Kind]:"Number",type:"number"},t)}a(Ika,"Number")});var sG=I($ee=>{"use strict";p();var xka=$ee&&$ee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wka=$ee&&$ee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xka(e,t,r)};Object.defineProperty($ee,"__esModule",{value:!0});wka(G1i(),$ee)});var $1i=I(i_r=>{"use strict";p();Object.defineProperty(i_r,"__esModule",{value:!0});i_r.String=Pka;var Rka=Ti(),kka=_n();function Pka(t){return(0,Rka.CreateType)({[kka.Kind]:"String",type:"string"},t)}a(Pka,"String")});var aG=I(Vee=>{"use strict";p();var Dka=Vee&&Vee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Nka=Vee&&Vee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dka(e,t,r)};Object.defineProperty(Vee,"__esModule",{value:!0});Nka($1i(),Vee)});var a_r=I(s_r=>{"use strict";p();Object.defineProperty(s_r,"__esModule",{value:!0});s_r.TemplateLiteralSyntax=jka;var rOe=TE(),Mka=tOe(),Oka=Tme(),Bka=sG(),Lka=aG(),Fka=mp(),Uka=d0();function*Qka(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,Mka.Boolean)():e==="number"?yield(0,Bka.Number)():e==="bigint"?yield(0,Oka.BigInt)():e==="string"?yield(0,Lka.String)():yield(()=>{let r=e.split("|").map(n=>(0,rOe.Literal)(n.trim()));return r.length===0?(0,Uka.Never)():r.length===1?r[0]:(0,Fka.UnionEvaluated)(r)})()}a(Qka,"FromUnion");function*qka(t){if(t[1]!=="{"){let e=(0,rOe.Literal)("$"),r=o_r(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(iOe,"__esModule",{value:!0});iOe.TemplateLiteralPatternError=void 0;iOe.TemplateLiteralPattern=Vka;var nOe=JMe(),Hka=_n(),Gka=bf(),cG=gs(),I0t=class extends Gka.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};iOe.TemplateLiteralPatternError=I0t;function $ka(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a($ka,"Escape");function V1i(t,e){return(0,cG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,cG.IsUnion)(t)?`(${t.anyOf.map(r=>V1i(r,e)).join("|")})`:(0,cG.IsNumber)(t)?`${e}${nOe.PatternNumber}`:(0,cG.IsInteger)(t)?`${e}${nOe.PatternNumber}`:(0,cG.IsBigInt)(t)?`${e}${nOe.PatternNumber}`:(0,cG.IsString)(t)?`${e}${nOe.PatternString}`:(0,cG.IsLiteral)(t)?`${e}${$ka(t.const.toString())}`:(0,cG.IsBoolean)(t)?`${e}${nOe.PatternBoolean}`:(()=>{throw new I0t(`Unexpected Kind '${t[Hka.Kind]}'`)})()}a(V1i,"Visit");function Vka(t){return`^${t.map(e=>V1i(e,"")).join("")}$`}a(Vka,"TemplateLiteralPattern")});var W1i=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.TemplateLiteralToUnion=Kka;var Wka=mp(),zka=TE(),Yka=XEr();function Kka(t){let r=(0,Yka.TemplateLiteralGenerate)(t).map(n=>(0,zka.Literal)(n));return(0,Wka.UnionEvaluated)(r)}a(Kka,"TemplateLiteralToUnion")});var Y1i=I(u_r=>{"use strict";p();Object.defineProperty(u_r,"__esModule",{value:!0});u_r.TemplateLiteral=tPa;var Jka=Ti(),Zka=a_r(),z1i=c_r(),Xka=uC(),ePa=_n();function tPa(t,e){let r=(0,Xka.IsString)(t)?(0,z1i.TemplateLiteralPattern)((0,Zka.TemplateLiteralSyntax)(t)):(0,z1i.TemplateLiteralPattern)(t);return(0,Jka.CreateType)({[ePa.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(tPa,"TemplateLiteral")});var U2=I(DT=>{"use strict";p();var rPa=DT&&DT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wee=DT&&DT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rPa(e,t,r)};Object.defineProperty(DT,"__esModule",{value:!0});Wee(ZEr(),DT);Wee(XEr(),DT);Wee(a_r(),DT);Wee(C0t(),DT);Wee(c_r(),DT);Wee(W1i(),DT);Wee(Y1i(),DT)});var x0t=I(d_r=>{"use strict";p();Object.defineProperty(d_r,"__esModule",{value:!0});d_r.IndexPropertyKeys=K1i;var nPa=U2(),oOe=gs();function iPa(t){return(0,nPa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(iPa,"FromTemplateLiteral");function oPa(t){let e=[];for(let r of t)e.push(...K1i(r));return e}a(oPa,"FromUnion");function sPa(t){return[t.toString()]}a(sPa,"FromLiteral");function K1i(t){return[...new Set((0,oOe.IsTemplateLiteral)(t)?iPa(t):(0,oOe.IsUnion)(t)?oPa(t.anyOf):(0,oOe.IsLiteral)(t)?sPa(t.const):(0,oOe.IsNumber)(t)?["[number]"]:(0,oOe.IsInteger)(t)?["[number]"]:[])]}a(K1i,"IndexPropertyKeys")});var p_r=I(f_r=>{"use strict";p();Object.defineProperty(f_r,"__esModule",{value:!0});f_r.IndexFromMappedResult=fPa;var aPa=f0(),cPa=x0t(),lPa=Q2();function uPa(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,lPa.Index)(t,(0,cPa.IndexPropertyKeys)(e[o]),r);return n}a(uPa,"FromProperties");function dPa(t,e,r){return uPa(t,e.properties,r)}a(dPa,"FromMappedResult");function fPa(t,e,r){let n=dPa(t,e,r);return(0,aPa.MappedResult)(n)}a(fPa,"IndexFromMappedResult")});var R0t=I(Ime=>{"use strict";p();Object.defineProperty(Ime,"__esModule",{value:!0});Ime.IndexFromPropertyKey=m_r;Ime.IndexFromPropertyKeys=eSi;Ime.IndexFromComputed=IPa;Ime.Index=xPa;var pPa=Ti(),hPa=bf(),Z1i=iG(),w0t=d0(),mPa=NT(),h_r=mp(),gPa=x0t(),APa=g_r(),yPa=p_r(),Qb=gs();function X1i(t,e){return t.map(r=>m_r(r,e))}a(X1i,"FromRest");function EPa(t){return t.filter(e=>!(0,Qb.IsNever)(e))}a(EPa,"FromIntersectRest");function _Pa(t,e){return(0,mPa.IntersectEvaluated)(EPa(X1i(t,e)))}a(_Pa,"FromIntersect");function CPa(t){return t.some(e=>(0,Qb.IsNever)(e))?[]:t}a(CPa,"FromUnionRest");function vPa(t,e){return(0,h_r.UnionEvaluated)(CPa(X1i(t,e)))}a(vPa,"FromUnion");function bPa(t,e){return e in t?t[e]:e==="[number]"?(0,h_r.UnionEvaluated)(t):(0,w0t.Never)()}a(bPa,"FromTuple");function SPa(t,e){return e==="[number]"?t:(0,w0t.Never)()}a(SPa,"FromArray");function TPa(t,e){return e in t?t[e]:(0,w0t.Never)()}a(TPa,"FromProperty");function m_r(t,e){return(0,Qb.IsIntersect)(t)?_Pa(t.allOf,e):(0,Qb.IsUnion)(t)?vPa(t.anyOf,e):(0,Qb.IsTuple)(t)?bPa(t.items??[],e):(0,Qb.IsArray)(t)?SPa(t.items,e):(0,Qb.IsObject)(t)?TPa(t.properties,e):(0,w0t.Never)()}a(m_r,"IndexFromPropertyKey");function eSi(t,e){return e.map(r=>m_r(t,r))}a(eSi,"IndexFromPropertyKeys");function J1i(t,e){return(0,h_r.UnionEvaluated)(eSi(t,e))}a(J1i,"FromSchema");function IPa(t,e){return(0,Z1i.Computed)("Index",[t,e])}a(IPa,"IndexFromComputed");function xPa(t,e,r){if((0,Qb.IsRef)(t)||(0,Qb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Qb.IsSchema)(t)||!(0,Qb.IsSchema)(e))throw new hPa.TypeBoxError(n);return(0,Z1i.Computed)("Index",[t,e])}return(0,Qb.IsMappedResult)(e)?(0,yPa.IndexFromMappedResult)(t,e,r):(0,Qb.IsMappedKey)(e)?(0,APa.IndexFromMappedKey)(t,e,r):(0,pPa.CreateType)((0,Qb.IsSchema)(e)?J1i(t,(0,gPa.IndexPropertyKeys)(e)):J1i(t,e),r)}a(xPa,"Index")});var g_r=I(A_r=>{"use strict";p();Object.defineProperty(A_r,"__esModule",{value:!0});A_r.IndexFromMappedKey=MPa;var wPa=R0t(),RPa=f0(),kPa=Lb();function PPa(t,e,r){return{[e]:(0,wPa.Index)(t,[e],(0,kPa.Clone)(r))}}a(PPa,"MappedIndexPropertyKey");function DPa(t,e,r){return e.reduce((n,o)=>({...n,...PPa(t,o,r)}),{})}a(DPa,"MappedIndexPropertyKeys");function NPa(t,e,r){return DPa(t,e.keys,r)}a(NPa,"MappedIndexProperties");function MPa(t,e,r){let n=NPa(t,e,r);return(0,RPa.MappedResult)(n)}a(MPa,"IndexFromMappedKey")});var Q2=I(p4=>{"use strict";p();var OPa=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]})),k0t=p4&&p4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OPa(e,t,r)};Object.defineProperty(p4,"__esModule",{value:!0});k0t(g_r(),p4);k0t(p_r(),p4);k0t(x0t(),p4);k0t(R0t(),p4)});var tSi=I(y_r=>{"use strict";p();Object.defineProperty(y_r,"__esModule",{value:!0});y_r.Iterator=FPa;var BPa=Ti(),LPa=_n();function FPa(t,e){return(0,BPa.CreateType)({[LPa.Kind]:"Iterator",type:"Iterator",items:t},e)}a(FPa,"Iterator")});var xme=I(zee=>{"use strict";p();var UPa=zee&&zee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QPa=zee&&zee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UPa(e,t,r)};Object.defineProperty(zee,"__esModule",{value:!0});QPa(tSi(),zee)});var nSi=I(P0t=>{"use strict";p();Object.defineProperty(P0t,"__esModule",{value:!0});P0t.Object=void 0;var qPa=Ti(),rSi=_n(),jPa=gs();function HPa(t){return globalThis.Object.keys(t).filter(e=>!(0,jPa.IsOptional)(t[e]))}a(HPa,"RequiredArray");function GPa(t,e){let r=HPa(t),n=r.length>0?{[rSi.Kind]:"Object",type:"object",required:r,properties:t}:{[rSi.Kind]:"Object",type:"object",properties:t};return(0,qPa.CreateType)(n,e)}a(GPa,"_Object");P0t.Object=GPa});var dC=I(Yee=>{"use strict";p();var $Pa=Yee&&Yee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VPa=Yee&&Yee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Pa(e,t,r)};Object.defineProperty(Yee,"__esModule",{value:!0});VPa(nSi(),Yee)});var iSi=I(E_r=>{"use strict";p();Object.defineProperty(E_r,"__esModule",{value:!0});E_r.Promise=YPa;var WPa=Ti(),zPa=_n();function YPa(t,e){return(0,WPa.CreateType)({[zPa.Kind]:"Promise",type:"Promise",item:t},e)}a(YPa,"Promise")});var sOe=I(Kee=>{"use strict";p();var KPa=Kee&&Kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JPa=Kee&&Kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KPa(e,t,r)};Object.defineProperty(Kee,"__esModule",{value:!0});JPa(iSi(),Kee)});var C_r=I(__r=>{"use strict";p();Object.defineProperty(__r,"__esModule",{value:!0});__r.Readonly=i2a;var oSi=Ti(),sSi=_n(),ZPa=S8(),XPa=v_r(),e2a=gs();function t2a(t){return(0,oSi.CreateType)((0,ZPa.Discard)(t,[sSi.ReadonlyKind]))}a(t2a,"RemoveReadonly");function r2a(t){return(0,oSi.CreateType)({...t,[sSi.ReadonlyKind]:"Readonly"})}a(r2a,"AddReadonly");function n2a(t,e){return e===!1?t2a(t):r2a(t)}a(n2a,"ReadonlyWithFlag");function i2a(t,e){let r=e??!0;return(0,e2a.IsMappedResult)(t)?(0,XPa.ReadonlyFromMappedResult)(t,r):n2a(t,r)}a(i2a,"Readonly")});var v_r=I(b_r=>{"use strict";p();Object.defineProperty(b_r,"__esModule",{value:!0});b_r.ReadonlyFromMappedResult=l2a;var o2a=f0(),s2a=C_r();function a2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,s2a.Readonly)(t[n],e);return r}a(a2a,"FromProperties");function c2a(t,e){return a2a(t.properties,e)}a(c2a,"FromMappedResult");function l2a(t,e){let r=c2a(t,e);return(0,o2a.MappedResult)(r)}a(l2a,"ReadonlyFromMappedResult")});var uG=I(lG=>{"use strict";p();var u2a=lG&&lG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aSi=lG&&lG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u2a(e,t,r)};Object.defineProperty(lG,"__esModule",{value:!0});aSi(v_r(),lG);aSi(C_r(),lG)});var lSi=I(S_r=>{"use strict";p();Object.defineProperty(S_r,"__esModule",{value:!0});S_r.Tuple=f2a;var d2a=Ti(),cSi=_n();function f2a(t,e){return(0,d2a.CreateType)(t.length>0?{[cSi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[cSi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(f2a,"Tuple")});var x8=I(Jee=>{"use strict";p();var p2a=Jee&&Jee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h2a=Jee&&Jee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p2a(e,t,r)};Object.defineProperty(Jee,"__esModule",{value:!0});h2a(lSi(),Jee)});var mSi=I(D0t=>{"use strict";p();Object.defineProperty(D0t,"__esModule",{value:!0});D0t.MappedFunctionReturnType=hSi;D0t.Mapped=M2a;var T_r=_n(),uSi=S8(),m2a=Eme(),g2a=_me(),A2a=Cme(),y2a=oG(),E2a=Q2(),_2a=NT(),C2a=xme(),dSi=TE(),fSi=dC(),v2a=f4(),b2a=sOe(),S2a=uG(),T2a=x8(),I2a=mp(),x2a=ZMe(),w2a=HEr(),fC=gs();function pSi(t,e){return t in e?oR(t,e[t]):(0,w2a.MappedResult)(e)}a(pSi,"FromMappedResult");function R2a(t){return{[t]:(0,dSi.Literal)(t)}}a(R2a,"MappedKeyToKnownMappedResultProperties");function k2a(t){let e={};for(let r of t)e[r]=(0,dSi.Literal)(r);return e}a(k2a,"MappedKeyToUnknownMappedResultProperties");function P2a(t,e){return(0,x2a.SetIncludes)(e,t)?R2a(t):k2a(e)}a(P2a,"MappedKeyToMappedResultProperties");function D2a(t,e){let r=P2a(t,e);return pSi(t,r)}a(D2a,"FromMappedKey");function aOe(t,e){return e.map(r=>oR(t,r))}a(aOe,"FromRest");function N2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=oR(t,e[n]);return r}a(N2a,"FromProperties");function oR(t,e){let r={...e};return(0,fC.IsOptional)(e)?(0,v2a.Optional)(oR(t,(0,uSi.Discard)(e,[T_r.OptionalKind]))):(0,fC.IsReadonly)(e)?(0,S2a.Readonly)(oR(t,(0,uSi.Discard)(e,[T_r.ReadonlyKind]))):(0,fC.IsMappedResult)(e)?pSi(t,e.properties):(0,fC.IsMappedKey)(e)?D2a(t,e.keys):(0,fC.IsConstructor)(e)?(0,A2a.Constructor)(aOe(t,e.parameters),oR(t,e.returns),r):(0,fC.IsFunction)(e)?(0,y2a.Function)(aOe(t,e.parameters),oR(t,e.returns),r):(0,fC.IsAsyncIterator)(e)?(0,g2a.AsyncIterator)(oR(t,e.items),r):(0,fC.IsIterator)(e)?(0,C2a.Iterator)(oR(t,e.items),r):(0,fC.IsIntersect)(e)?(0,_2a.Intersect)(aOe(t,e.allOf),r):(0,fC.IsUnion)(e)?(0,I2a.Union)(aOe(t,e.anyOf),r):(0,fC.IsTuple)(e)?(0,T2a.Tuple)(aOe(t,e.items??[]),r):(0,fC.IsObject)(e)?(0,fSi.Object)(N2a(t,e.properties),r):(0,fC.IsArray)(e)?(0,m2a.Array)(oR(t,e.items),r):(0,fC.IsPromise)(e)?(0,b2a.Promise)(oR(t,e.item),r):e}a(oR,"FromSchemaType");function hSi(t,e){let r={};for(let n of t)r[n]=oR(n,e);return r}a(hSi,"MappedFunctionReturnType");function M2a(t,e,r){let n=(0,fC.IsSchema)(t)?(0,E2a.IndexPropertyKeys)(t):t,o=e({[T_r.Kind]:"MappedKey",keys:n}),s=hSi(n,o);return(0,fSi.Object)(s,r)}a(M2a,"Mapped")});var f0=I(w8=>{"use strict";p();var O2a=w8&&w8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),I_r=w8&&w8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O2a(e,t,r)};Object.defineProperty(w8,"__esModule",{value:!0});I_r(R1i(),w8);I_r(HEr(),w8);I_r(mSi(),w8)});var w_r=I(x_r=>{"use strict";p();Object.defineProperty(x_r,"__esModule",{value:!0});x_r.Optional=j2a;var gSi=Ti(),ASi=_n(),B2a=S8(),L2a=R_r(),F2a=gs();function U2a(t){return(0,gSi.CreateType)((0,B2a.Discard)(t,[ASi.OptionalKind]))}a(U2a,"RemoveOptional");function Q2a(t){return(0,gSi.CreateType)({...t,[ASi.OptionalKind]:"Optional"})}a(Q2a,"AddOptional");function q2a(t,e){return e===!1?U2a(t):Q2a(t)}a(q2a,"OptionalWithFlag");function j2a(t,e){let r=e??!0;return(0,F2a.IsMappedResult)(t)?(0,L2a.OptionalFromMappedResult)(t,r):q2a(t,r)}a(j2a,"Optional")});var R_r=I(k_r=>{"use strict";p();Object.defineProperty(k_r,"__esModule",{value:!0});k_r.OptionalFromMappedResult=W2a;var H2a=f0(),G2a=w_r();function $2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,G2a.Optional)(t[n],e);return r}a($2a,"FromProperties");function V2a(t,e){return $2a(t.properties,e)}a(V2a,"FromMappedResult");function W2a(t,e){let r=V2a(t,e);return(0,H2a.MappedResult)(r)}a(W2a,"OptionalFromMappedResult")});var f4=I(dG=>{"use strict";p();var z2a=dG&&dG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ySi=dG&&dG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&z2a(e,t,r)};Object.defineProperty(dG,"__esModule",{value:!0});ySi(R_r(),dG);ySi(w_r(),dG)});var N_r=I(D_r=>{"use strict";p();Object.defineProperty(D_r,"__esModule",{value:!0});D_r.IntersectCreate=K2a;var Y2a=Ti(),ESi=_n(),P_r=gs();function K2a(t,e={}){let r=t.every(o=>(0,P_r.IsObject)(o)),n=(0,P_r.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,Y2a.CreateType)(e.unevaluatedProperties===!1||(0,P_r.IsSchema)(e.unevaluatedProperties)||r?{...n,[ESi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[ESi.Kind]:"Intersect",allOf:t},e)}a(K2a,"IntersectCreate")});var vSi=I(O_r=>{"use strict";p();Object.defineProperty(O_r,"__esModule",{value:!0});O_r.IntersectEvaluated=oDa;var J2a=_n(),Z2a=Ti(),X2a=S8(),eDa=d0(),tDa=f4(),_Si=N_r(),M_r=gs();function rDa(t){return t.every(e=>(0,M_r.IsOptional)(e))}a(rDa,"IsIntersectOptional");function nDa(t){return(0,X2a.Discard)(t,[J2a.OptionalKind])}a(nDa,"RemoveOptionalFromType");function CSi(t){return t.map(e=>(0,M_r.IsOptional)(e)?nDa(e):e)}a(CSi,"RemoveOptionalFromRest");function iDa(t,e){return rDa(t)?(0,tDa.Optional)((0,_Si.IntersectCreate)(CSi(t),e)):(0,_Si.IntersectCreate)(CSi(t),e)}a(iDa,"ResolveIntersect");function oDa(t,e={}){if(t.length===1)return(0,Z2a.CreateType)(t[0],e);if(t.length===0)return(0,eDa.Never)(e);if(t.some(r=>(0,M_r.IsTransform)(r)))throw new Error("Cannot intersect transform types");return iDa(t,e)}a(oDa,"IntersectEvaluated")});var SSi=I(bSi=>{"use strict";p();Object.defineProperty(bSi,"__esModule",{value:!0});var M0p=_n()});var TSi=I(B_r=>{"use strict";p();Object.defineProperty(B_r,"__esModule",{value:!0});B_r.Intersect=uDa;var sDa=Ti(),aDa=d0(),cDa=N_r(),lDa=gs();function uDa(t,e){if(t.length===1)return(0,sDa.CreateType)(t[0],e);if(t.length===0)return(0,aDa.Never)(e);if(t.some(r=>(0,lDa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,cDa.IntersectCreate)(t,e)}a(uDa,"Intersect")});var NT=I(R8=>{"use strict";p();var dDa=R8&&R8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L_r=R8&&R8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dDa(e,t,r)};Object.defineProperty(R8,"__esModule",{value:!0});L_r(vSi(),R8);L_r(SSi(),R8);L_r(TSi(),R8)});var ISi=I(F_r=>{"use strict";p();Object.defineProperty(F_r,"__esModule",{value:!0});F_r.Ref=mDa;var fDa=bf(),pDa=Ti(),hDa=_n();function mDa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new fDa.TypeBoxError("Ref: $ref must be a string");return(0,pDa.CreateType)({[hDa.Kind]:"Ref",$ref:e},r)}a(mDa,"Ref")});var fG=I(Zee=>{"use strict";p();var gDa=Zee&&Zee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Zee&&Zee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gDa(e,t,r)};Object.defineProperty(Zee,"__esModule",{value:!0});ADa(ISi(),Zee)});var wSi=I(q_r=>{"use strict";p();Object.defineProperty(q_r,"__esModule",{value:!0});q_r.Awaited=Q_r;var yDa=Ti(),U_r=iG(),EDa=NT(),_Da=mp(),CDa=fG(),cOe=gs();function vDa(t,e){return(0,U_r.Computed)("Awaited",[(0,U_r.Computed)(t,e)])}a(vDa,"FromComputed");function bDa(t){return(0,U_r.Computed)("Awaited",[(0,CDa.Ref)(t)])}a(bDa,"FromRef");function SDa(t){return(0,EDa.Intersect)(xSi(t))}a(SDa,"FromIntersect");function TDa(t){return(0,_Da.Union)(xSi(t))}a(TDa,"FromUnion");function IDa(t){return Q_r(t)}a(IDa,"FromPromise");function xSi(t){return t.map(e=>Q_r(e))}a(xSi,"FromRest");function Q_r(t,e){return(0,yDa.CreateType)((0,cOe.IsComputed)(t)?vDa(t.target,t.parameters):(0,cOe.IsIntersect)(t)?SDa(t.allOf):(0,cOe.IsUnion)(t)?TDa(t.anyOf):(0,cOe.IsPromise)(t)?IDa(t.item):(0,cOe.IsRef)(t)?bDa(t.$ref):t,e)}a(Q_r,"Awaited")});var lOe=I(Xee=>{"use strict";p();var xDa=Xee&&Xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wDa=Xee&&Xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xDa(e,t,r)};Object.defineProperty(Xee,"__esModule",{value:!0});wDa(wSi(),Xee)});var M0t=I(N0t=>{"use strict";p();Object.defineProperty(N0t,"__esModule",{value:!0});N0t.KeyOfPropertyKeys=H_r;N0t.KeyOfPattern=ODa;var RSi=ZMe(),wme=gs();function kSi(t){let e=[];for(let r of t)e.push(H_r(r));return e}a(kSi,"FromRest");function RDa(t){let e=kSi(t);return(0,RSi.SetUnionMany)(e)}a(RDa,"FromIntersect");function kDa(t){let e=kSi(t);return(0,RSi.SetIntersectMany)(e)}a(kDa,"FromUnion");function PDa(t){return t.map((e,r)=>r.toString())}a(PDa,"FromTuple");function DDa(t){return["[number]"]}a(DDa,"FromArray");function NDa(t){return globalThis.Object.getOwnPropertyNames(t)}a(NDa,"FromProperties");function MDa(t){return j_r?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(MDa,"FromPatternProperties");function H_r(t){return(0,wme.IsIntersect)(t)?RDa(t.allOf):(0,wme.IsUnion)(t)?kDa(t.anyOf):(0,wme.IsTuple)(t)?PDa(t.items??[]):(0,wme.IsArray)(t)?DDa(t.items):(0,wme.IsObject)(t)?NDa(t.properties):(0,wme.IsRecord)(t)?MDa(t.patternProperties):[]}a(H_r,"KeyOfPropertyKeys");var j_r=!1;function ODa(t){j_r=!0;let e=H_r(t);return j_r=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(ODa,"KeyOfPattern")});var V_r=I(O0t=>{"use strict";p();Object.defineProperty(O0t,"__esModule",{value:!0});O0t.KeyOfPropertyKeysToRest=PSi;O0t.KeyOf=VDa;var BDa=Ti(),LDa=TE(),FDa=sG(),$_r=iG(),UDa=fG(),QDa=M0t(),qDa=mp(),jDa=W_r(),G_r=gs();function HDa(t,e){return(0,$_r.Computed)("KeyOf",[(0,$_r.Computed)(t,e)])}a(HDa,"FromComputed");function GDa(t){return(0,$_r.Computed)("KeyOf",[(0,UDa.Ref)(t)])}a(GDa,"FromRef");function $Da(t,e){let r=(0,QDa.KeyOfPropertyKeys)(t),n=PSi(r),o=(0,qDa.UnionEvaluated)(n);return(0,BDa.CreateType)(o,e)}a($Da,"KeyOfFromType");function PSi(t){return t.map(e=>e==="[number]"?(0,FDa.Number)():(0,LDa.Literal)(e))}a(PSi,"KeyOfPropertyKeysToRest");function VDa(t,e){return(0,G_r.IsComputed)(t)?HDa(t.target,t.parameters):(0,G_r.IsRef)(t)?GDa(t.$ref):(0,G_r.IsMappedResult)(t)?(0,jDa.KeyOfFromMappedResult)(t,e):$Da(t,e)}a(VDa,"KeyOf")});var W_r=I(z_r=>{"use strict";p();Object.defineProperty(z_r,"__esModule",{value:!0});z_r.KeyOfFromMappedResult=ZDa;var WDa=f0(),zDa=V_r(),YDa=Lb();function KDa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,zDa.KeyOf)(t[n],(0,YDa.Clone)(e));return r}a(KDa,"FromProperties");function JDa(t,e){return KDa(t.properties,e)}a(JDa,"FromMappedResult");function ZDa(t,e){let r=JDa(t,e);return(0,WDa.MappedResult)(r)}a(ZDa,"KeyOfFromMappedResult")});var DSi=I(Y_r=>{"use strict";p();Object.defineProperty(Y_r,"__esModule",{value:!0});Y_r.KeyOfPropertyEntries=tNa;var XDa=R0t(),eNa=M0t();function tNa(t){let e=(0,eNa.KeyOfPropertyKeys)(t),r=(0,XDa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(tNa,"KeyOfPropertyEntries")});var q2=I(h4=>{"use strict";p();var rNa=h4&&h4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B0t=h4&&h4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rNa(e,t,r)};Object.defineProperty(h4,"__esModule",{value:!0});B0t(W_r(),h4);B0t(DSi(),h4);B0t(M0t(),h4);B0t(V_r(),h4)});var NSi=I(K_r=>{"use strict";p();Object.defineProperty(K_r,"__esModule",{value:!0});K_r.Composite=pNa;var nNa=NT(),iNa=Q2(),oNa=q2(),sNa=dC(),aNa=ZMe(),cNa=gs();function lNa(t){let e=[];for(let r of t)e.push(...(0,oNa.KeyOfPropertyKeys)(r));return(0,aNa.SetDistinct)(e)}a(lNa,"CompositeKeys");function uNa(t){return t.filter(e=>!(0,cNa.IsNever)(e))}a(uNa,"FilterNever");function dNa(t,e){let r=[];for(let n of t)r.push(...(0,iNa.IndexFromPropertyKeys)(n,[e]));return uNa(r)}a(dNa,"CompositeProperty");function fNa(t,e){let r={};for(let n of e)r[n]=(0,nNa.IntersectEvaluated)(dNa(t,n));return r}a(fNa,"CompositeProperties");function pNa(t,e){let r=lNa(t),n=fNa(t,r);return(0,sNa.Object)(n,e)}a(pNa,"Composite")});var L0t=I(ete=>{"use strict";p();var hNa=ete&&ete.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=ete&&ete.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hNa(e,t,r)};Object.defineProperty(ete,"__esModule",{value:!0});mNa(NSi(),ete)});var MSi=I(J_r=>{"use strict";p();Object.defineProperty(J_r,"__esModule",{value:!0});J_r.Date=yNa;var gNa=_n(),ANa=Ti();function yNa(t){return(0,ANa.CreateType)({[gNa.Kind]:"Date",type:"Date"},t)}a(yNa,"Date")});var uOe=I(tte=>{"use strict";p();var ENa=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]})),_Na=tte&&tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ENa(e,t,r)};Object.defineProperty(tte,"__esModule",{value:!0});_Na(MSi(),tte)});var OSi=I(Z_r=>{"use strict";p();Object.defineProperty(Z_r,"__esModule",{value:!0});Z_r.Null=bNa;var CNa=Ti(),vNa=_n();function bNa(t){return(0,CNa.CreateType)({[vNa.Kind]:"Null",type:"null"},t)}a(bNa,"Null")});var dOe=I(rte=>{"use strict";p();var SNa=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]})),TNa=rte&&rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SNa(e,t,r)};Object.defineProperty(rte,"__esModule",{value:!0});TNa(OSi(),rte)});var BSi=I(X_r=>{"use strict";p();Object.defineProperty(X_r,"__esModule",{value:!0});X_r.Symbol=wNa;var INa=Ti(),xNa=_n();function wNa(t){return(0,INa.CreateType)({[xNa.Kind]:"Symbol",type:"symbol"},t)}a(wNa,"Symbol")});var fOe=I(nte=>{"use strict";p();var RNa=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]})),kNa=nte&&nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RNa(e,t,r)};Object.defineProperty(nte,"__esModule",{value:!0});kNa(BSi(),nte)});var LSi=I(eCr=>{"use strict";p();Object.defineProperty(eCr,"__esModule",{value:!0});eCr.Undefined=NNa;var PNa=Ti(),DNa=_n();function NNa(t){return(0,PNa.CreateType)({[DNa.Kind]:"Undefined",type:"undefined"},t)}a(NNa,"Undefined")});var pOe=I(ite=>{"use strict";p();var MNa=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]})),ONa=ite&&ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MNa(e,t,r)};Object.defineProperty(ite,"__esModule",{value:!0});ONa(LSi(),ite)});var FSi=I(tCr=>{"use strict";p();Object.defineProperty(tCr,"__esModule",{value:!0});tCr.Uint8Array=FNa;var BNa=Ti(),LNa=_n();function FNa(t){return(0,BNa.CreateType)({[LNa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(FNa,"Uint8Array")});var hOe=I(ote=>{"use strict";p();var UNa=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]})),QNa=ote&&ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UNa(e,t,r)};Object.defineProperty(ote,"__esModule",{value:!0});QNa(FSi(),ote)});var USi=I(rCr=>{"use strict";p();Object.defineProperty(rCr,"__esModule",{value:!0});rCr.Unknown=HNa;var qNa=Ti(),jNa=_n();function HNa(t){return(0,qNa.CreateType)({[jNa.Kind]:"Unknown"},t)}a(HNa,"Unknown")});var pG=I(ste=>{"use strict";p();var GNa=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]})),$Na=ste&&ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GNa(e,t,r)};Object.defineProperty(ste,"__esModule",{value:!0});$Na(USi(),ste)});var jSi=I(sCr=>{"use strict";p();Object.defineProperty(sCr,"__esModule",{value:!0});sCr.Const=iMa;var QSi=yme(),VNa=Tme(),WNa=uOe(),zNa=oG(),nCr=TE(),YNa=dOe(),qSi=dC(),KNa=fOe(),JNa=x8(),iCr=uG(),ZNa=pOe(),XNa=hOe(),eMa=pG(),tMa=v8(),qb=uC();function rMa(t){return t.map(e=>oCr(e,!1))}a(rMa,"FromArray");function nMa(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,iCr.Readonly)(oCr(t[r],!1));return e}a(nMa,"FromProperties");function F0t(t,e){return e===!0?t:(0,iCr.Readonly)(t)}a(F0t,"ConditionalReadonly");function oCr(t,e){return(0,qb.IsAsyncIterator)(t)||(0,qb.IsIterator)(t)?F0t((0,QSi.Any)(),e):(0,qb.IsArray)(t)?(0,iCr.Readonly)((0,JNa.Tuple)(rMa(t))):(0,qb.IsUint8Array)(t)?(0,XNa.Uint8Array)():(0,qb.IsDate)(t)?(0,WNa.Date)():(0,qb.IsObject)(t)?F0t((0,qSi.Object)(nMa(t)),e):(0,qb.IsFunction)(t)?F0t((0,zNa.Function)([],(0,eMa.Unknown)()),e):(0,qb.IsUndefined)(t)?(0,ZNa.Undefined)():(0,qb.IsNull)(t)?(0,YNa.Null)():(0,qb.IsSymbol)(t)?(0,KNa.Symbol)():(0,qb.IsBigInt)(t)?(0,VNa.BigInt)():(0,qb.IsNumber)(t)||(0,qb.IsBoolean)(t)||(0,qb.IsString)(t)?(0,nCr.Literal)(t):(0,qSi.Object)({})}a(oCr,"FromValue");function iMa(t,e){return(0,tMa.CreateType)(oCr(t,!0),e)}a(iMa,"Const")});var U0t=I(ate=>{"use strict";p();var oMa=ate&&ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sMa=ate&&ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oMa(e,t,r)};Object.defineProperty(ate,"__esModule",{value:!0});sMa(jSi(),ate)});var HSi=I(k8=>{"use strict";p();var aMa=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]})),cMa=k8&&k8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lMa=k8&&k8.__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 hMa=cte&&cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mMa=cte&&cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hMa(e,t,r)};Object.defineProperty(cte,"__esModule",{value:!0});mMa(HSi(),cte)});var GSi=I(aCr=>{"use strict";p();Object.defineProperty(aCr,"__esModule",{value:!0});aCr.Enum=_Ma;var gMa=TE(),AMa=_n(),yMa=mp(),EMa=uC();function _Ma(t,e){if((0,EMa.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,gMa.Literal)(s));return(0,yMa.Union)(o,{...e,[AMa.Hint]:"Enum"})}a(_Ma,"Enum")});var q0t=I(lte=>{"use strict";p();var CMa=lte&<e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=lte&<e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CMa(e,t,r)};Object.defineProperty(lte,"__esModule",{value:!0});vMa(GSi(),lte)});var mCr=I(ute=>{"use strict";p();Object.defineProperty(ute,"__esModule",{value:!0});ute.ExtendsResult=ute.ExtendsResolverError=void 0;ute.ExtendsCheck=dOa;var $Si=yme(),bMa=oG(),fCr=sG(),lCr=aG(),SMa=pG(),VSi=U2(),Rme=JMe(),JSi=_n(),TMa=bf(),$e=DEr(),j0t=class extends TMa.TypeBoxError{static{a(this,"ExtendsResolverError")}};ute.ExtendsResolverError=j0t;var Dt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Dt||(ute.ExtendsResult=Dt={}));function sR(t){return t===Dt.False?t:Dt.True}a(sR,"IntoBooleanResult");function kme(t){throw new j0t(t)}a(kme,"Throw");function p0(t){return $e.TypeGuard.IsNever(t)||$e.TypeGuard.IsIntersect(t)||$e.TypeGuard.IsUnion(t)||$e.TypeGuard.IsUnknown(t)||$e.TypeGuard.IsAny(t)}a(p0,"IsStructuralRight");function h0(t,e){return $e.TypeGuard.IsNever(e)?eTi(t,e):$e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)?hCr(t,e):$e.TypeGuard.IsUnknown(e)?iTi(t,e):$e.TypeGuard.IsAny(e)?pCr(t,e):kme("StructuralRight")}a(h0,"StructuralRight");function pCr(t,e){return Dt.True}a(pCr,"FromAnyRight");function IMa(t,e){return $e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>$e.TypeGuard.IsAny(r)||$e.TypeGuard.IsUnknown(r))?Dt.True:$e.TypeGuard.IsUnion(e)?Dt.Union:$e.TypeGuard.IsUnknown(e)||$e.TypeGuard.IsAny(e)?Dt.True:Dt.Union}a(IMa,"FromAny");function xMa(t,e){return $e.TypeGuard.IsUnknown(t)?Dt.False:$e.TypeGuard.IsAny(t)?Dt.Union:$e.TypeGuard.IsNever(t)?Dt.True:Dt.False}a(xMa,"FromArrayRight");function wMa(t,e){return $e.TypeGuard.IsObject(e)&&G0t(e)?Dt.True:p0(e)?h0(t,e):$e.TypeGuard.IsArray(e)?sR(ul(t.items,e.items)):Dt.False}a(wMa,"FromArray");function RMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsAsyncIterator(e)?sR(ul(t.items,e.items)):Dt.False}a(RMa,"FromAsyncIterator");function kMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsBigInt(e)?Dt.True:Dt.False}a(kMa,"FromBigInt");function ZSi(t,e){return $e.TypeGuard.IsLiteralBoolean(t)||$e.TypeGuard.IsBoolean(t)?Dt.True:Dt.False}a(ZSi,"FromBooleanRight");function PMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsBoolean(e)?Dt.True:Dt.False}a(PMa,"FromBoolean");function DMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Dt.False:t.parameters.every((r,n)=>sR(ul(e.parameters[n],r))===Dt.True)?sR(ul(t.returns,e.returns)):Dt.False:Dt.False}a(DMa,"FromConstructor");function NMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsDate(e)?Dt.True:Dt.False}a(NMa,"FromDate");function MMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Dt.False:t.parameters.every((r,n)=>sR(ul(e.parameters[n],r))===Dt.True)?sR(ul(t.returns,e.returns)):Dt.False:Dt.False}a(MMa,"FromFunction");function XSi(t,e){return $e.TypeGuard.IsLiteral(t)&&$e.ValueGuard.IsNumber(t.const)||$e.TypeGuard.IsNumber(t)||$e.TypeGuard.IsInteger(t)?Dt.True:Dt.False}a(XSi,"FromIntegerRight");function OMa(t,e){return $e.TypeGuard.IsInteger(e)||$e.TypeGuard.IsNumber(e)?Dt.True:p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):Dt.False}a(OMa,"FromInteger");function H0t(t,e){return e.allOf.every(r=>ul(t,r)===Dt.True)?Dt.True:Dt.False}a(H0t,"FromIntersectRight");function BMa(t,e){return t.allOf.some(r=>ul(r,e)===Dt.True)?Dt.True:Dt.False}a(BMa,"FromIntersect");function LMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsIterator(e)?sR(ul(t.items,e.items)):Dt.False}a(LMa,"FromIterator");function FMa(t,e){return $e.TypeGuard.IsLiteral(e)&&e.const===t.const?Dt.True:p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsString(e)?nTi(t,e):$e.TypeGuard.IsNumber(e)?tTi(t,e):$e.TypeGuard.IsInteger(e)?XSi(t,e):$e.TypeGuard.IsBoolean(e)?ZSi(t,e):Dt.False}a(FMa,"FromLiteral");function eTi(t,e){return Dt.False}a(eTi,"FromNeverRight");function UMa(t,e){return Dt.True}a(UMa,"FromNever");function WSi(t){let[e,r]=[t,0];for(;$e.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,SMa.Unknown)()}a(WSi,"UnwrapTNot");function QMa(t,e){return $e.TypeGuard.IsNot(t)?ul(WSi(t),e):$e.TypeGuard.IsNot(e)?ul(t,WSi(e)):kme("Invalid fallthrough for Not")}a(QMa,"FromNot");function qMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsNull(e)?Dt.True:Dt.False}a(qMa,"FromNull");function tTi(t,e){return $e.TypeGuard.IsLiteralNumber(t)||$e.TypeGuard.IsNumber(t)||$e.TypeGuard.IsInteger(t)?Dt.True:Dt.False}a(tTi,"FromNumberRight");function jMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsInteger(e)||$e.TypeGuard.IsNumber(e)?Dt.True:Dt.False}a(jMa,"FromNumber");function jb(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(jb,"IsObjectPropertyCount");function zSi(t){return G0t(t)}a(zSi,"IsObjectStringLike");function YSi(t){return jb(t,0)||jb(t,1)&&"description"in t.properties&&$e.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&($e.TypeGuard.IsString(t.properties.description.anyOf[0])&&$e.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||$e.TypeGuard.IsString(t.properties.description.anyOf[1])&&$e.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(YSi,"IsObjectSymbolLike");function cCr(t){return jb(t,0)}a(cCr,"IsObjectNumberLike");function KSi(t){return jb(t,0)}a(KSi,"IsObjectBooleanLike");function HMa(t){return jb(t,0)}a(HMa,"IsObjectBigIntLike");function GMa(t){return jb(t,0)}a(GMa,"IsObjectDateLike");function $Ma(t){return G0t(t)}a($Ma,"IsObjectUint8ArrayLike");function VMa(t){let e=(0,fCr.Number)();return jb(t,0)||jb(t,1)&&"length"in t.properties&&sR(ul(t.properties.length,e))===Dt.True}a(VMa,"IsObjectFunctionLike");function WMa(t){return jb(t,0)}a(WMa,"IsObjectConstructorLike");function G0t(t){let e=(0,fCr.Number)();return jb(t,0)||jb(t,1)&&"length"in t.properties&&sR(ul(t.properties.length,e))===Dt.True}a(G0t,"IsObjectArrayLike");function zMa(t){let e=(0,bMa.Function)([(0,$Si.Any)()],(0,$Si.Any)());return jb(t,0)||jb(t,1)&&"then"in t.properties&&sR(ul(t.properties.then,e))===Dt.True}a(zMa,"IsObjectPromiseLike");function rTi(t,e){return ul(t,e)===Dt.False||$e.TypeGuard.IsOptional(t)&&!$e.TypeGuard.IsOptional(e)?Dt.False:Dt.True}a(rTi,"Property");function IE(t,e){return $e.TypeGuard.IsUnknown(t)?Dt.False:$e.TypeGuard.IsAny(t)?Dt.Union:$e.TypeGuard.IsNever(t)||$e.TypeGuard.IsLiteralString(t)&&zSi(e)||$e.TypeGuard.IsLiteralNumber(t)&&cCr(e)||$e.TypeGuard.IsLiteralBoolean(t)&&KSi(e)||$e.TypeGuard.IsSymbol(t)&&YSi(e)||$e.TypeGuard.IsBigInt(t)&&HMa(e)||$e.TypeGuard.IsString(t)&&zSi(e)||$e.TypeGuard.IsSymbol(t)&&YSi(e)||$e.TypeGuard.IsNumber(t)&&cCr(e)||$e.TypeGuard.IsInteger(t)&&cCr(e)||$e.TypeGuard.IsBoolean(t)&&KSi(e)||$e.TypeGuard.IsUint8Array(t)&&$Ma(e)||$e.TypeGuard.IsDate(t)&&GMa(e)||$e.TypeGuard.IsConstructor(t)&&WMa(e)||$e.TypeGuard.IsFunction(t)&&VMa(e)?Dt.True:$e.TypeGuard.IsRecord(t)&&$e.TypeGuard.IsString(uCr(t))?e[JSi.Hint]==="Record"?Dt.True:Dt.False:$e.TypeGuard.IsRecord(t)&&$e.TypeGuard.IsNumber(uCr(t))&&jb(e,0)?Dt.True:Dt.False}a(IE,"FromObjectRight");function YMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!$e.TypeGuard.IsOptional(e.properties[r]))return Dt.False;if($e.TypeGuard.IsOptional(e.properties[r]))return Dt.True;if(rTi(t.properties[r],e.properties[r])===Dt.False)return Dt.False}return Dt.True})():Dt.False}a(YMa,"FromObject");function KMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)&&zMa(e)?Dt.True:$e.TypeGuard.IsPromise(e)?sR(ul(t.item,e.item)):Dt.False}a(KMa,"FromPromise");function uCr(t){return Rme.PatternNumberExact in t.patternProperties?(0,fCr.Number)():Rme.PatternStringExact in t.patternProperties?(0,lCr.String)():kme("Unknown record key pattern")}a(uCr,"RecordKey");function dCr(t){return Rme.PatternNumberExact in t.patternProperties?t.patternProperties[Rme.PatternNumberExact]:Rme.PatternStringExact in t.patternProperties?t.patternProperties[Rme.PatternStringExact]:kme("Unable to get record value schema")}a(dCr,"RecordValue");function aR(t,e){let[r,n]=[uCr(e),dCr(e)];return $e.TypeGuard.IsLiteralString(t)&&$e.TypeGuard.IsNumber(r)&&sR(ul(t,n))===Dt.True?Dt.True:$e.TypeGuard.IsUint8Array(t)&&$e.TypeGuard.IsNumber(r)||$e.TypeGuard.IsString(t)&&$e.TypeGuard.IsNumber(r)||$e.TypeGuard.IsArray(t)&&$e.TypeGuard.IsNumber(r)?ul(t,n):$e.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(rTi(n,t.properties[o])===Dt.False)return Dt.False;return Dt.True})():Dt.False}a(aR,"FromRecordRight");function JMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?ul(dCr(t),dCr(e)):Dt.False}a(JMa,"FromRecord");function ZMa(t,e){let r=$e.TypeGuard.IsRegExp(t)?(0,lCr.String)():t,n=$e.TypeGuard.IsRegExp(e)?(0,lCr.String)():e;return ul(r,n)}a(ZMa,"FromRegExp");function nTi(t,e){return $e.TypeGuard.IsLiteral(t)&&$e.ValueGuard.IsString(t.const)||$e.TypeGuard.IsString(t)?Dt.True:Dt.False}a(nTi,"FromStringRight");function XMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsString(e)?Dt.True:Dt.False}a(XMa,"FromString");function eOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsSymbol(e)?Dt.True:Dt.False}a(eOa,"FromSymbol");function tOa(t,e){return $e.TypeGuard.IsTemplateLiteral(t)?ul((0,VSi.TemplateLiteralToUnion)(t),e):$e.TypeGuard.IsTemplateLiteral(e)?ul(t,(0,VSi.TemplateLiteralToUnion)(e)):kme("Invalid fallthrough for TemplateLiteral")}a(tOa,"FromTemplateLiteral");function rOa(t,e){return $e.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>ul(r,e.items)===Dt.True)}a(rOa,"IsArrayOfTuple");function nOa(t,e){return $e.TypeGuard.IsNever(t)?Dt.True:$e.TypeGuard.IsUnknown(t)?Dt.False:$e.TypeGuard.IsAny(t)?Dt.Union:Dt.False}a(nOa,"FromTupleRight");function iOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)&&G0t(e)||$e.TypeGuard.IsArray(e)&&rOa(t,e)?Dt.True:$e.TypeGuard.IsTuple(e)?$e.ValueGuard.IsUndefined(t.items)&&!$e.ValueGuard.IsUndefined(e.items)||!$e.ValueGuard.IsUndefined(t.items)&&$e.ValueGuard.IsUndefined(e.items)?Dt.False:$e.ValueGuard.IsUndefined(t.items)&&!$e.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>ul(r,e.items[n])===Dt.True)?Dt.True:Dt.False:Dt.False}a(iOa,"FromTuple");function oOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsUint8Array(e)?Dt.True:Dt.False}a(oOa,"FromUint8Array");function sOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsVoid(e)?lOa(t,e):$e.TypeGuard.IsUndefined(e)?Dt.True:Dt.False}a(sOa,"FromUndefined");function hCr(t,e){return e.anyOf.some(r=>ul(t,r)===Dt.True)?Dt.True:Dt.False}a(hCr,"FromUnionRight");function aOa(t,e){return t.anyOf.every(r=>ul(r,e)===Dt.True)?Dt.True:Dt.False}a(aOa,"FromUnion");function iTi(t,e){return Dt.True}a(iTi,"FromUnknownRight");function cOa(t,e){return $e.TypeGuard.IsNever(e)?eTi(t,e):$e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)?hCr(t,e):$e.TypeGuard.IsAny(e)?pCr(t,e):$e.TypeGuard.IsString(e)?nTi(t,e):$e.TypeGuard.IsNumber(e)?tTi(t,e):$e.TypeGuard.IsInteger(e)?XSi(t,e):$e.TypeGuard.IsBoolean(e)?ZSi(t,e):$e.TypeGuard.IsArray(e)?xMa(t,e):$e.TypeGuard.IsTuple(e)?nOa(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsUnknown(e)?Dt.True:Dt.False}a(cOa,"FromUnknown");function lOa(t,e){return $e.TypeGuard.IsUndefined(t)||$e.TypeGuard.IsUndefined(t)?Dt.True:Dt.False}a(lOa,"FromVoidRight");function uOa(t,e){return $e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)?hCr(t,e):$e.TypeGuard.IsUnknown(e)?iTi(t,e):$e.TypeGuard.IsAny(e)?pCr(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsVoid(e)?Dt.True:Dt.False}a(uOa,"FromVoid");function ul(t,e){return $e.TypeGuard.IsTemplateLiteral(t)||$e.TypeGuard.IsTemplateLiteral(e)?tOa(t,e):$e.TypeGuard.IsRegExp(t)||$e.TypeGuard.IsRegExp(e)?ZMa(t,e):$e.TypeGuard.IsNot(t)||$e.TypeGuard.IsNot(e)?QMa(t,e):$e.TypeGuard.IsAny(t)?IMa(t,e):$e.TypeGuard.IsArray(t)?wMa(t,e):$e.TypeGuard.IsBigInt(t)?kMa(t,e):$e.TypeGuard.IsBoolean(t)?PMa(t,e):$e.TypeGuard.IsAsyncIterator(t)?RMa(t,e):$e.TypeGuard.IsConstructor(t)?DMa(t,e):$e.TypeGuard.IsDate(t)?NMa(t,e):$e.TypeGuard.IsFunction(t)?MMa(t,e):$e.TypeGuard.IsInteger(t)?OMa(t,e):$e.TypeGuard.IsIntersect(t)?BMa(t,e):$e.TypeGuard.IsIterator(t)?LMa(t,e):$e.TypeGuard.IsLiteral(t)?FMa(t,e):$e.TypeGuard.IsNever(t)?UMa(t,e):$e.TypeGuard.IsNull(t)?qMa(t,e):$e.TypeGuard.IsNumber(t)?jMa(t,e):$e.TypeGuard.IsObject(t)?YMa(t,e):$e.TypeGuard.IsRecord(t)?JMa(t,e):$e.TypeGuard.IsString(t)?XMa(t,e):$e.TypeGuard.IsSymbol(t)?eOa(t,e):$e.TypeGuard.IsTuple(t)?iOa(t,e):$e.TypeGuard.IsPromise(t)?KMa(t,e):$e.TypeGuard.IsUint8Array(t)?oOa(t,e):$e.TypeGuard.IsUndefined(t)?sOa(t,e):$e.TypeGuard.IsUnion(t)?aOa(t,e):$e.TypeGuard.IsUnknown(t)?cOa(t,e):$e.TypeGuard.IsVoid(t)?uOa(t,e):kme(`Unknown left type operand '${t[JSi.Kind]}'`)}a(ul,"Visit");function dOa(t,e){return ul(t,e)}a(dOa,"ExtendsCheck")});var ACr=I(gCr=>{"use strict";p();Object.defineProperty(gCr,"__esModule",{value:!0});gCr.ExtendsFromMappedResult=AOa;var fOa=f0(),pOa=$0t(),hOa=Lb();function mOa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,pOa.Extends)(t[c],e,r,n,(0,hOa.Clone)(o));return s}a(mOa,"FromProperties");function gOa(t,e,r,n,o){return mOa(t.properties,e,r,n,o)}a(gOa,"FromMappedResult");function AOa(t,e,r,n,o){let s=gOa(t,e,r,n,o);return(0,fOa.MappedResult)(s)}a(AOa,"ExtendsFromMappedResult")});var $0t=I(ECr=>{"use strict";p();Object.defineProperty(ECr,"__esModule",{value:!0});ECr.Extends=vOa;var oTi=Ti(),yOa=mp(),yCr=mCr(),EOa=_Cr(),_Oa=ACr(),sTi=gs();function COa(t,e,r,n){let o=(0,yCr.ExtendsCheck)(t,e);return o===yCr.ExtendsResult.Union?(0,yOa.Union)([r,n]):o===yCr.ExtendsResult.True?r:n}a(COa,"ExtendsResolve");function vOa(t,e,r,n,o){return(0,sTi.IsMappedResult)(t)?(0,_Oa.ExtendsFromMappedResult)(t,e,r,n,o):(0,sTi.IsMappedKey)(t)?(0,oTi.CreateType)((0,EOa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,oTi.CreateType)(COa(t,e,r,n),o)}a(vOa,"Extends")});var _Cr=I(CCr=>{"use strict";p();Object.defineProperty(CCr,"__esModule",{value:!0});CCr.ExtendsFromMappedKey=kOa;var bOa=f0(),SOa=TE(),TOa=$0t(),IOa=Lb();function xOa(t,e,r,n,o){return{[t]:(0,TOa.Extends)((0,SOa.Literal)(t),e,r,n,(0,IOa.Clone)(o))}}a(xOa,"FromPropertyKey");function wOa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...xOa(c,e,r,n,o)}),{})}a(wOa,"FromPropertyKeys");function ROa(t,e,r,n,o){return wOa(t.keys,e,r,n,o)}a(ROa,"FromMappedKey");function kOa(t,e,r,n,o){let s=ROa(t,e,r,n,o);return(0,bOa.MappedResult)(s)}a(kOa,"ExtendsFromMappedKey")});var bCr=I(vCr=>{"use strict";p();Object.defineProperty(vCr,"__esModule",{value:!0});vCr.ExtendsUndefinedCheck=W0t;var V0t=_n();function POa(t){return t.allOf.every(e=>W0t(e))}a(POa,"Intersect");function DOa(t){return t.anyOf.some(e=>W0t(e))}a(DOa,"Union");function NOa(t){return!W0t(t.not)}a(NOa,"Not");function W0t(t){return t[V0t.Kind]==="Intersect"?POa(t):t[V0t.Kind]==="Union"?DOa(t):t[V0t.Kind]==="Not"?NOa(t):t[V0t.Kind]==="Undefined"}a(W0t,"ExtendsUndefinedCheck")});var dte=I(j2=>{"use strict";p();var MOa=j2&&j2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mOe=j2&&j2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MOa(e,t,r)};Object.defineProperty(j2,"__esModule",{value:!0});mOe(mCr(),j2);mOe(_Cr(),j2);mOe(ACr(),j2);mOe(bCr(),j2);mOe($0t(),j2)});var TCr=I(SCr=>{"use strict";p();Object.defineProperty(SCr,"__esModule",{value:!0});SCr.ExcludeFromTemplateLiteral=LOa;var OOa=z0t(),BOa=U2();function LOa(t,e){return(0,OOa.Exclude)((0,BOa.TemplateLiteralToUnion)(t),e)}a(LOa,"ExcludeFromTemplateLiteral")});var z0t=I(wCr=>{"use strict";p();Object.defineProperty(wCr,"__esModule",{value:!0});wCr.Exclude=HOa;var ICr=Ti(),FOa=mp(),UOa=d0(),Y0t=dte(),QOa=RCr(),qOa=TCr(),xCr=gs();function jOa(t,e){let r=t.filter(n=>(0,Y0t.ExtendsCheck)(n,e)===Y0t.ExtendsResult.False);return r.length===1?r[0]:(0,FOa.Union)(r)}a(jOa,"ExcludeRest");function HOa(t,e,r={}){return(0,xCr.IsTemplateLiteral)(t)?(0,ICr.CreateType)((0,qOa.ExcludeFromTemplateLiteral)(t,e),r):(0,xCr.IsMappedResult)(t)?(0,ICr.CreateType)((0,QOa.ExcludeFromMappedResult)(t,e),r):(0,ICr.CreateType)((0,xCr.IsUnion)(t)?jOa(t.anyOf,e):(0,Y0t.ExtendsCheck)(t,e)!==Y0t.ExtendsResult.False?(0,UOa.Never)():t,r)}a(HOa,"Exclude")});var RCr=I(kCr=>{"use strict";p();Object.defineProperty(kCr,"__esModule",{value:!0});kCr.ExcludeFromMappedResult=zOa;var GOa=f0(),$Oa=z0t();function VOa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,$Oa.Exclude)(t[n],e);return r}a(VOa,"FromProperties");function WOa(t,e){return VOa(t.properties,e)}a(WOa,"FromMappedResult");function zOa(t,e){let r=WOa(t,e);return(0,GOa.MappedResult)(r)}a(zOa,"ExcludeFromMappedResult")});var K0t=I(P8=>{"use strict";p();var YOa=P8&&P8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PCr=P8&&P8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YOa(e,t,r)};Object.defineProperty(P8,"__esModule",{value:!0});PCr(RCr(),P8);PCr(TCr(),P8);PCr(z0t(),P8)});var NCr=I(DCr=>{"use strict";p();Object.defineProperty(DCr,"__esModule",{value:!0});DCr.ExtractFromTemplateLiteral=ZOa;var KOa=J0t(),JOa=U2();function ZOa(t,e){return(0,KOa.Extract)((0,JOa.TemplateLiteralToUnion)(t),e)}a(ZOa,"ExtractFromTemplateLiteral")});var J0t=I(BCr=>{"use strict";p();Object.defineProperty(BCr,"__esModule",{value:!0});BCr.Extract=i5a;var MCr=Ti(),XOa=mp(),e5a=d0(),Z0t=dte(),t5a=LCr(),r5a=NCr(),OCr=gs();function n5a(t,e){let r=t.filter(n=>(0,Z0t.ExtendsCheck)(n,e)!==Z0t.ExtendsResult.False);return r.length===1?r[0]:(0,XOa.Union)(r)}a(n5a,"ExtractRest");function i5a(t,e,r){return(0,OCr.IsTemplateLiteral)(t)?(0,MCr.CreateType)((0,r5a.ExtractFromTemplateLiteral)(t,e),r):(0,OCr.IsMappedResult)(t)?(0,MCr.CreateType)((0,t5a.ExtractFromMappedResult)(t,e),r):(0,MCr.CreateType)((0,OCr.IsUnion)(t)?n5a(t.anyOf,e):(0,Z0t.ExtendsCheck)(t,e)!==Z0t.ExtendsResult.False?t:(0,e5a.Never)(),r)}a(i5a,"Extract")});var LCr=I(FCr=>{"use strict";p();Object.defineProperty(FCr,"__esModule",{value:!0});FCr.ExtractFromMappedResult=l5a;var o5a=f0(),s5a=J0t();function a5a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,s5a.Extract)(t[n],e);return r}a(a5a,"FromProperties");function c5a(t,e){return a5a(t.properties,e)}a(c5a,"FromMappedResult");function l5a(t,e){let r=c5a(t,e);return(0,o5a.MappedResult)(r)}a(l5a,"ExtractFromMappedResult")});var X0t=I(D8=>{"use strict";p();var u5a=D8&&D8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UCr=D8&&D8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u5a(e,t,r)};Object.defineProperty(D8,"__esModule",{value:!0});UCr(LCr(),D8);UCr(NCr(),D8);UCr(J0t(),D8)});var aTi=I(N8=>{"use strict";p();var d5a=N8&&N8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=N8&&N8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),p5a=N8&&N8.__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 y5a=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]})),E5a=fte&&fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y5a(e,t,r)};Object.defineProperty(fte,"__esModule",{value:!0});E5a(aTi(),fte)});var cTi=I(QCr=>{"use strict";p();Object.defineProperty(QCr,"__esModule",{value:!0});QCr.ReadonlyOptional=v5a;var _5a=uG(),C5a=f4();function v5a(t){return(0,_5a.Readonly)((0,C5a.Optional)(t))}a(v5a,"ReadonlyOptional")});var gOe=I(pte=>{"use strict";p();var b5a=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]})),S5a=pte&&pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b5a(e,t,r)};Object.defineProperty(pte,"__esModule",{value:!0});S5a(cTi(),pte)});var pTi=I(Pme=>{"use strict";p();Object.defineProperty(Pme,"__esModule",{value:!0});Pme.Record=q5a;Pme.RecordPattern=jCr;Pme.RecordKey=j5a;Pme.RecordValue=H5a;var T5a=Ti(),uTi=_n(),I5a=d0(),x5a=sG(),dTi=dC(),lTi=aG(),w5a=mp(),R5a=U2(),hte=JMe(),fTi=Q2(),k5a=uC(),m4=gs();function mte(t,e,r){return(0,T5a.CreateType)({[uTi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(mte,"RecordCreateFromPattern");function qCr(t,e,r){let n={};for(let o of t)n[o]=e;return(0,dTi.Object)(n,{...r,[uTi.Hint]:"Record"})}a(qCr,"RecordCreateFromKeys");function P5a(t,e,r){return(0,R5a.IsTemplateLiteralFinite)(t)?qCr((0,fTi.IndexPropertyKeys)(t),e,r):mte(t.pattern,e,r)}a(P5a,"FromTemplateLiteralKey");function D5a(t,e,r){return qCr((0,fTi.IndexPropertyKeys)((0,w5a.Union)(t)),e,r)}a(D5a,"FromUnionKey");function N5a(t,e,r){return qCr([t.toString()],e,r)}a(N5a,"FromLiteralKey");function M5a(t,e,r){return mte(t.source,e,r)}a(M5a,"FromRegExpKey");function O5a(t,e,r){let n=(0,k5a.IsUndefined)(t.pattern)?hte.PatternStringExact:t.pattern;return mte(n,e,r)}a(O5a,"FromStringKey");function B5a(t,e,r){return mte(hte.PatternStringExact,e,r)}a(B5a,"FromAnyKey");function L5a(t,e,r){return mte(hte.PatternNeverExact,e,r)}a(L5a,"FromNeverKey");function F5a(t,e,r){return(0,dTi.Object)({true:e,false:e},r)}a(F5a,"FromBooleanKey");function U5a(t,e,r){return mte(hte.PatternNumberExact,e,r)}a(U5a,"FromIntegerKey");function Q5a(t,e,r){return mte(hte.PatternNumberExact,e,r)}a(Q5a,"FromNumberKey");function q5a(t,e,r={}){return(0,m4.IsUnion)(t)?D5a(t.anyOf,e,r):(0,m4.IsTemplateLiteral)(t)?P5a(t,e,r):(0,m4.IsLiteral)(t)?N5a(t.const,e,r):(0,m4.IsBoolean)(t)?F5a(t,e,r):(0,m4.IsInteger)(t)?U5a(t,e,r):(0,m4.IsNumber)(t)?Q5a(t,e,r):(0,m4.IsRegExp)(t)?M5a(t,e,r):(0,m4.IsString)(t)?O5a(t,e,r):(0,m4.IsAny)(t)?B5a(t,e,r):(0,m4.IsNever)(t)?L5a(t,e,r):(0,I5a.Never)(r)}a(q5a,"Record");function jCr(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(jCr,"RecordPattern");function j5a(t){let e=jCr(t);return e===hte.PatternStringExact?(0,lTi.String)():e===hte.PatternNumberExact?(0,x5a.Number)():(0,lTi.String)({pattern:e})}a(j5a,"RecordKey");function H5a(t){return t.patternProperties[jCr(t)]}a(H5a,"RecordValue")});var Dme=I(gte=>{"use strict";p();var G5a=gte&>e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$5a=gte&>e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G5a(e,t,r)};Object.defineProperty(gte,"__esModule",{value:!0});$5a(pTi(),gte)});var mTi=I(g4=>{"use strict";p();var V5a=g4&&g4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=g4&&g4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hTi=g4&&g4.__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]:p4a(t,e[n])}),{})}a(h4a,"FromProperties");function Nme(t,e){return e.map(r=>H2(t,r))}a(Nme,"FromTypes");function H2(t,e){return Hb.IsConstructor(e)?t4a(t,e):Hb.IsFunction(e)?r4a(t,e):Hb.IsIntersect(e)?n4a(t,e):Hb.IsUnion(e)?i4a(t,e):Hb.IsTuple(e)?o4a(t,e):Hb.IsArray(e)?s4a(t,e):Hb.IsAsyncIterator(e)?a4a(t,e):Hb.IsIterator(e)?c4a(t,e):Hb.IsPromise(e)?l4a(t,e):Hb.IsObject(e)?u4a(t,e):Hb.IsRecord(e)?d4a(t,e):Hb.IsArgument(e)?f4a(t,e):e}a(H2,"FromType");function m4a(t,e){return H2(e,(0,z5a.CloneType)(t))}a(m4a,"Instantiate")});var tmt=I(Ate=>{"use strict";p();var g4a=Ate&&Ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A4a=Ate&&Ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g4a(e,t,r)};Object.defineProperty(Ate,"__esModule",{value:!0});A4a(mTi(),Ate)});var gTi=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.Integer=_4a;var y4a=Ti(),E4a=_n();function _4a(t){return(0,y4a.CreateType)({[E4a.Kind]:"Integer",type:"integer"},t)}a(_4a,"Integer")});var rmt=I(yte=>{"use strict";p();var C4a=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]})),v4a=yte&&yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C4a(e,t,r)};Object.defineProperty(yte,"__esModule",{value:!0});v4a(gTi(),yte)});var VCr=I($Cr=>{"use strict";p();Object.defineProperty($Cr,"__esModule",{value:!0});$Cr.IntrinsicFromMappedKey=k4a;var b4a=f0(),S4a=Ete(),T4a=TE(),I4a=Lb();function x4a(t,e,r){return{[t]:(0,S4a.Intrinsic)((0,T4a.Literal)(t),e,(0,I4a.Clone)(r))}}a(x4a,"MappedIntrinsicPropertyKey");function w4a(t,e,r){return t.reduce((o,s)=>({...o,...x4a(s,e,r)}),{})}a(w4a,"MappedIntrinsicPropertyKeys");function R4a(t,e,r){return w4a(t.keys,e,r)}a(R4a,"MappedIntrinsicProperties");function k4a(t,e,r){let n=R4a(t,e,r);return(0,b4a.MappedResult)(n)}a(k4a,"IntrinsicFromMappedKey")});var Ete=I(WCr=>{"use strict";p();Object.defineProperty(WCr,"__esModule",{value:!0});WCr.Intrinsic=CTi;var P4a=Ti(),nmt=U2(),D4a=VCr(),ATi=TE(),yTi=mp(),imt=gs();function N4a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(N4a,"ApplyUncapitalize");function M4a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(M4a,"ApplyCapitalize");function O4a(t){return t.toUpperCase()}a(O4a,"ApplyUppercase");function B4a(t){return t.toLowerCase()}a(B4a,"ApplyLowercase");function L4a(t,e,r){let n=(0,nmt.TemplateLiteralParseExact)(t.pattern);if(!(0,nmt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:ETi(t.pattern,e)};let c=[...(0,nmt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,ATi.Literal)(d)),l=_Ti(c,e),u=(0,yTi.Union)(l);return(0,nmt.TemplateLiteral)([u],r)}a(L4a,"FromTemplateLiteral");function ETi(t,e){return typeof t=="string"?e==="Uncapitalize"?N4a(t):e==="Capitalize"?M4a(t):e==="Uppercase"?O4a(t):e==="Lowercase"?B4a(t):t:t.toString()}a(ETi,"FromLiteralValue");function _Ti(t,e){return t.map(r=>CTi(r,e))}a(_Ti,"FromRest");function CTi(t,e,r={}){return(0,imt.IsMappedKey)(t)?(0,D4a.IntrinsicFromMappedKey)(t,e,r):(0,imt.IsTemplateLiteral)(t)?L4a(t,e,r):(0,imt.IsUnion)(t)?(0,yTi.Union)(_Ti(t.anyOf,e),r):(0,imt.IsLiteral)(t)?(0,ATi.Literal)(ETi(t.const,e),r):(0,P4a.CreateType)(t,r)}a(CTi,"Intrinsic")});var vTi=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.Capitalize=U4a;var F4a=Ete();function U4a(t,e={}){return(0,F4a.Intrinsic)(t,"Capitalize",e)}a(U4a,"Capitalize")});var bTi=I(YCr=>{"use strict";p();Object.defineProperty(YCr,"__esModule",{value:!0});YCr.Lowercase=q4a;var Q4a=Ete();function q4a(t,e={}){return(0,Q4a.Intrinsic)(t,"Lowercase",e)}a(q4a,"Lowercase")});var STi=I(KCr=>{"use strict";p();Object.defineProperty(KCr,"__esModule",{value:!0});KCr.Uncapitalize=H4a;var j4a=Ete();function H4a(t,e={}){return(0,j4a.Intrinsic)(t,"Uncapitalize",e)}a(H4a,"Uncapitalize")});var TTi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.Uppercase=$4a;var G4a=Ete();function $4a(t,e={}){return(0,G4a.Intrinsic)(t,"Uppercase",e)}a($4a,"Uppercase")});var omt=I(cR=>{"use strict";p();var V4a=cR&&cR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Mme=cR&&cR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V4a(e,t,r)};Object.defineProperty(cR,"__esModule",{value:!0});Mme(vTi(),cR);Mme(VCr(),cR);Mme(Ete(),cR);Mme(bTi(),cR);Mme(STi(),cR);Mme(TTi(),cR)});var XCr=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.OmitFromMappedResult=Z4a;var W4a=f0(),z4a=smt(),Y4a=Lb();function K4a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,z4a.Omit)(t[o],e,(0,Y4a.Clone)(r));return n}a(K4a,"FromProperties");function J4a(t,e,r){return K4a(t.properties,e,r)}a(J4a,"FromMappedResult");function Z4a(t,e,r){let n=J4a(t,e,r);return(0,W4a.MappedResult)(n)}a(Z4a,"OmitFromMappedResult")});var smt=I(rvr=>{"use strict";p();Object.defineProperty(rvr,"__esModule",{value:!0});rvr.Omit=hBa;var X4a=Ti(),eBa=_0t(),tBa=WMe(),evr=iG(),rBa=TE(),nBa=Q2(),iBa=NT(),ITi=mp(),xTi=dC(),oBa=nvr(),sBa=XCr(),M8=gs(),aBa=uC();function cBa(t,e){return t.map(r=>tvr(r,e))}a(cBa,"FromIntersect");function lBa(t,e){return t.map(r=>tvr(r,e))}a(lBa,"FromUnion");function uBa(t,e){let{[e]:r,...n}=t;return n}a(uBa,"FromProperty");function dBa(t,e){return e.reduce((r,n)=>uBa(r,n),t)}a(dBa,"FromProperties");function fBa(t,e,r){let n=(0,eBa.Discard)(t,[tBa.TransformKind,"$id","required","properties"]),o=dBa(r,e);return(0,xTi.Object)(o,n)}a(fBa,"FromObject");function pBa(t){let e=t.reduce((r,n)=>(0,M8.IsLiteralValue)(n)?[...r,(0,rBa.Literal)(n)]:r,[]);return(0,ITi.Union)(e)}a(pBa,"UnionFromPropertyKeys");function tvr(t,e){return(0,M8.IsIntersect)(t)?(0,iBa.Intersect)(cBa(t.allOf,e)):(0,M8.IsUnion)(t)?(0,ITi.Union)(lBa(t.anyOf,e)):(0,M8.IsObject)(t)?fBa(t,e,t.properties):(0,xTi.Object)({})}a(tvr,"OmitResolve");function hBa(t,e,r){let n=(0,aBa.IsArray)(e)?pBa(e):e,o=(0,M8.IsSchema)(e)?(0,nBa.IndexPropertyKeys)(e):e,s=(0,M8.IsRef)(t),c=(0,M8.IsRef)(e);return(0,M8.IsMappedResult)(t)?(0,sBa.OmitFromMappedResult)(t,o,r):(0,M8.IsMappedKey)(e)?(0,oBa.OmitFromMappedKey)(t,e,r):s&&c?(0,evr.Computed)("Omit",[t,n],r):!s&&c?(0,evr.Computed)("Omit",[t,n],r):s&&!c?(0,evr.Computed)("Omit",[t,n],r):(0,X4a.CreateType)({...tvr(t,o),...r})}a(hBa,"Omit")});var nvr=I(ivr=>{"use strict";p();Object.defineProperty(ivr,"__esModule",{value:!0});ivr.OmitFromMappedKey=CBa;var mBa=f0(),gBa=smt(),ABa=Lb();function yBa(t,e,r){return{[e]:(0,gBa.Omit)(t,[e],(0,ABa.Clone)(r))}}a(yBa,"FromPropertyKey");function EBa(t,e,r){return e.reduce((n,o)=>({...n,...yBa(t,o,r)}),{})}a(EBa,"FromPropertyKeys");function _Ba(t,e,r){return EBa(t,e.keys,r)}a(_Ba,"FromMappedKey");function CBa(t,e,r){let n=_Ba(t,e,r);return(0,mBa.MappedResult)(n)}a(CBa,"OmitFromMappedKey")});var AOe=I(O8=>{"use strict";p();var vBa=O8&&O8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ovr=O8&&O8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vBa(e,t,r)};Object.defineProperty(O8,"__esModule",{value:!0});ovr(nvr(),O8);ovr(XCr(),O8);ovr(smt(),O8)});var avr=I(svr=>{"use strict";p();Object.defineProperty(svr,"__esModule",{value:!0});svr.PickFromMappedResult=wBa;var bBa=f0(),SBa=amt(),TBa=Lb();function IBa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,SBa.Pick)(t[o],e,(0,TBa.Clone)(r));return n}a(IBa,"FromProperties");function xBa(t,e,r){return IBa(t.properties,e,r)}a(xBa,"FromMappedResult");function wBa(t,e,r){let n=xBa(t,e,r);return(0,bBa.MappedResult)(n)}a(wBa,"PickFromMappedResult")});var amt=I(uvr=>{"use strict";p();Object.defineProperty(uvr,"__esModule",{value:!0});uvr.Pick=HBa;var RBa=Ti(),kBa=_0t(),cvr=iG(),PBa=NT(),DBa=TE(),wTi=dC(),RTi=mp(),NBa=Q2(),MBa=WMe(),B8=gs(),OBa=uC(),BBa=dvr(),LBa=avr();function FBa(t,e){return t.map(r=>lvr(r,e))}a(FBa,"FromIntersect");function UBa(t,e){return t.map(r=>lvr(r,e))}a(UBa,"FromUnion");function QBa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(QBa,"FromProperties");function qBa(t,e,r){let n=(0,kBa.Discard)(t,[MBa.TransformKind,"$id","required","properties"]),o=QBa(r,e);return(0,wTi.Object)(o,n)}a(qBa,"FromObject");function jBa(t){let e=t.reduce((r,n)=>(0,B8.IsLiteralValue)(n)?[...r,(0,DBa.Literal)(n)]:r,[]);return(0,RTi.Union)(e)}a(jBa,"UnionFromPropertyKeys");function lvr(t,e){return(0,B8.IsIntersect)(t)?(0,PBa.Intersect)(FBa(t.allOf,e)):(0,B8.IsUnion)(t)?(0,RTi.Union)(UBa(t.anyOf,e)):(0,B8.IsObject)(t)?qBa(t,e,t.properties):(0,wTi.Object)({})}a(lvr,"PickResolve");function HBa(t,e,r){let n=(0,OBa.IsArray)(e)?jBa(e):e,o=(0,B8.IsSchema)(e)?(0,NBa.IndexPropertyKeys)(e):e,s=(0,B8.IsRef)(t),c=(0,B8.IsRef)(e);return(0,B8.IsMappedResult)(t)?(0,LBa.PickFromMappedResult)(t,o,r):(0,B8.IsMappedKey)(e)?(0,BBa.PickFromMappedKey)(t,e,r):s&&c?(0,cvr.Computed)("Pick",[t,n],r):!s&&c?(0,cvr.Computed)("Pick",[t,n],r):s&&!c?(0,cvr.Computed)("Pick",[t,n],r):(0,RBa.CreateType)({...lvr(t,o),...r})}a(HBa,"Pick")});var dvr=I(fvr=>{"use strict";p();Object.defineProperty(fvr,"__esModule",{value:!0});fvr.PickFromMappedKey=KBa;var GBa=f0(),$Ba=amt(),VBa=Lb();function WBa(t,e,r){return{[e]:(0,$Ba.Pick)(t,[e],(0,VBa.Clone)(r))}}a(WBa,"FromPropertyKey");function zBa(t,e,r){return e.reduce((n,o)=>({...n,...WBa(t,o,r)}),{})}a(zBa,"FromPropertyKeys");function YBa(t,e,r){return zBa(t,e.keys,r)}a(YBa,"FromMappedKey");function KBa(t,e,r){let n=YBa(t,e,r);return(0,GBa.MappedResult)(n)}a(KBa,"PickFromMappedKey")});var yOe=I(L8=>{"use strict";p();var JBa=L8&&L8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pvr=L8&&L8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JBa(e,t,r)};Object.defineProperty(L8,"__esModule",{value:!0});pvr(dvr(),L8);pvr(avr(),L8);pvr(amt(),L8)});var mvr=I(F8=>{"use strict";p();var ZBa=F8&&F8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XBa=F8&&F8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eLa=F8&&F8.__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;oDTi(e))}a(kTi,"FromRest");function DTi(t){return pC.IsComputed(t)?lLa(t.target,t.parameters):pC.IsRef(t)?uLa(t.$ref):pC.IsIntersect(t)?(0,nLa.Intersect)(kTi(t.allOf)):pC.IsUnion(t)?(0,iLa.Union)(kTi(t.anyOf)):pC.IsObject(t)?fLa(t,t.properties):pC.IsBigInt(t)||pC.IsBoolean(t)||pC.IsInteger(t)||pC.IsLiteral(t)||pC.IsNull(t)||pC.IsNumber(t)||pC.IsString(t)||pC.IsSymbol(t)||pC.IsUndefined(t)?t:(0,PTi.Object)({})}a(DTi,"PartialResolve");function pLa(t,e){return pC.IsMappedResult(t)?(0,cLa.PartialFromMappedResult)(t,e):(0,tLa.CreateType)({...DTi(t),...e})}a(pLa,"Partial")});var gvr=I(Avr=>{"use strict";p();Object.defineProperty(Avr,"__esModule",{value:!0});Avr.PartialFromMappedResult=ELa;var hLa=f0(),mLa=mvr(),gLa=Lb();function ALa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,mLa.Partial)(t[n],(0,gLa.Clone)(e));return r}a(ALa,"FromProperties");function yLa(t,e){return ALa(t.properties,e)}a(yLa,"FromMappedResult");function ELa(t,e){let r=yLa(t,e);return(0,hLa.MappedResult)(r)}a(ELa,"PartialFromMappedResult")});var EOe=I(hG=>{"use strict";p();var _La=hG&&hG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NTi=hG&&hG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_La(e,t,r)};Object.defineProperty(hG,"__esModule",{value:!0});NTi(gvr(),hG);NTi(mvr(),hG)});var Evr=I(U8=>{"use strict";p();var CLa=U8&&U8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vLa=U8&&U8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bLa=U8&&U8.__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;oFTi(e))}a(MTi,"FromRest");function FTi(t){return hC.IsComputed(t)?RLa(t.target,t.parameters):hC.IsRef(t)?kLa(t.$ref):hC.IsIntersect(t)?(0,TLa.Intersect)(MTi(t.allOf)):hC.IsUnion(t)?(0,ILa.Union)(MTi(t.anyOf)):hC.IsObject(t)?DLa(t,t.properties):hC.IsBigInt(t)||hC.IsBoolean(t)||hC.IsInteger(t)||hC.IsLiteral(t)||hC.IsNull(t)||hC.IsNumber(t)||hC.IsString(t)||hC.IsSymbol(t)||hC.IsUndefined(t)?t:(0,OTi.Object)({})}a(FTi,"RequiredResolve");function NLa(t,e){return hC.IsMappedResult(t)?(0,wLa.RequiredFromMappedResult)(t,e):(0,SLa.CreateType)({...FTi(t),...e})}a(NLa,"Required")});var _vr=I(Cvr=>{"use strict";p();Object.defineProperty(Cvr,"__esModule",{value:!0});Cvr.RequiredFromMappedResult=FLa;var MLa=f0(),OLa=Evr();function BLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,OLa.Required)(t[n],e);return r}a(BLa,"FromProperties");function LLa(t,e){return BLa(t.properties,e)}a(LLa,"FromMappedResult");function FLa(t,e){let r=LLa(t,e);return(0,MLa.MappedResult)(r)}a(FLa,"RequiredFromMappedResult")});var _Oe=I(mG=>{"use strict";p();var ULa=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]})),UTi=mG&&mG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ULa(e,t,r)};Object.defineProperty(mG,"__esModule",{value:!0});UTi(_vr(),mG);UTi(Evr(),mG)});var HTi=I(G2=>{"use strict";p();var QLa=G2&&G2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qLa=G2&&G2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jLa=G2&&G2.__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;oYA.IsRef(r)?bvr(t,r.$ref):$b(t,r))}a(s3a,"DereferenceParameters");function bvr(t,e){return e in t?YA.IsRef(t[e])?bvr(t,t[e].$ref):$b(t,t[e]):(0,vvr.Never)()}a(bvr,"Dereference");function a3a(t){return(0,$La.Awaited)(t[0])}a(a3a,"FromAwaited");function c3a(t){return(0,zLa.Index)(t[0],t[1])}a(c3a,"FromIndex");function l3a(t){return(0,ZLa.KeyOf)(t[0])}a(l3a,"FromKeyOf");function u3a(t){return(0,r3a.Partial)(t[0])}a(u3a,"FromPartial");function d3a(t){return(0,e3a.Omit)(t[0],t[1])}a(d3a,"FromOmit");function f3a(t){return(0,t3a.Pick)(t[0],t[1])}a(f3a,"FromPick");function p3a(t){return(0,n3a.Required)(t[0])}a(p3a,"FromRequired");function h3a(t,e,r){let n=s3a(t,r);return e==="Awaited"?a3a(n):e==="Index"?c3a(n):e==="KeyOf"?l3a(n):e==="Partial"?u3a(n):e==="Omit"?d3a(n):e==="Pick"?f3a(n):e==="Required"?p3a(n):(0,vvr.Never)()}a(h3a,"FromComputed");function m3a(t,e){return(0,GLa.Array)($b(t,e))}a(m3a,"FromArray");function g3a(t,e){return(0,VLa.AsyncIterator)($b(t,e))}a(g3a,"FromAsyncIterator");function A3a(t,e,r){return(0,WLa.Constructor)(COe(t,e),$b(t,r))}a(A3a,"FromConstructor");function y3a(t,e,r){return(0,YLa.Function)(COe(t,e),$b(t,r))}a(y3a,"FromFunction");function E3a(t,e){return(0,KLa.Intersect)(COe(t,e))}a(E3a,"FromIntersect");function _3a(t,e){return(0,JLa.Iterator)($b(t,e))}a(_3a,"FromIterator");function C3a(t,e){return(0,XLa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:$b(t,e[n])}),{}))}a(C3a,"FromObject");function v3a(t,e){let[r,n]=[$b(t,(0,qTi.RecordValue)(e)),(0,qTi.RecordPattern)(e)],o=(0,HLa.CloneType)(e);return o.patternProperties[n]=r,o}a(v3a,"FromRecord");function b3a(t,e){return YA.IsRef(e)?{...bvr(t,e.$ref),[cmt.TransformKind]:e[cmt.TransformKind]}:e}a(b3a,"FromTransform");function S3a(t,e){return(0,i3a.Tuple)(COe(t,e))}a(S3a,"FromTuple");function T3a(t,e){return(0,o3a.Union)(COe(t,e))}a(T3a,"FromUnion");function COe(t,e){return e.map(r=>$b(t,r))}a(COe,"FromTypes");function $b(t,e){return YA.IsOptional(e)?(0,Gb.CreateType)($b(t,(0,QTi.Discard)(e,[cmt.OptionalKind])),e):YA.IsReadonly(e)?(0,Gb.CreateType)($b(t,(0,QTi.Discard)(e,[cmt.ReadonlyKind])),e):YA.IsTransform(e)?(0,Gb.CreateType)(b3a(t,e),e):YA.IsArray(e)?(0,Gb.CreateType)(m3a(t,e.items),e):YA.IsAsyncIterator(e)?(0,Gb.CreateType)(g3a(t,e.items),e):YA.IsComputed(e)?(0,Gb.CreateType)(h3a(t,e.target,e.parameters)):YA.IsConstructor(e)?(0,Gb.CreateType)(A3a(t,e.parameters,e.returns),e):YA.IsFunction(e)?(0,Gb.CreateType)(y3a(t,e.parameters,e.returns),e):YA.IsIntersect(e)?(0,Gb.CreateType)(E3a(t,e.allOf),e):YA.IsIterator(e)?(0,Gb.CreateType)(_3a(t,e.items),e):YA.IsObject(e)?(0,Gb.CreateType)(C3a(t,e.properties),e):YA.IsRecord(e)?(0,Gb.CreateType)(v3a(t,e)):YA.IsTuple(e)?(0,Gb.CreateType)(S3a(t,e.items||[]),e):YA.IsUnion(e)?(0,Gb.CreateType)(T3a(t,e.anyOf),e):e}a($b,"FromType");function jTi(t,e){return e in t?$b(t,t[e]):(0,vvr.Never)()}a(jTi,"ComputeType");function I3a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:jTi(t,r)}),{})}a(I3a,"ComputeModuleProperties")});var $Ti=I(vOe=>{"use strict";p();Object.defineProperty(vOe,"__esModule",{value:!0});vOe.TModule=void 0;vOe.Module=R3a;var GTi=v8(),x3a=_n(),w3a=HTi(),lmt=class{static{a(this,"TModule")}constructor(e){let r=(0,w3a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,GTi.CreateType)(this.$defs[e],r)};return(0,GTi.CreateType)({[x3a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};vOe.TModule=lmt;function R3a(t){return new lmt(t)}a(R3a,"Module")});var umt=I(_te=>{"use strict";p();var k3a=_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]})),P3a=_te&&_te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k3a(e,t,r)};Object.defineProperty(_te,"__esModule",{value:!0});P3a($Ti(),_te)});var VTi=I(Svr=>{"use strict";p();Object.defineProperty(Svr,"__esModule",{value:!0});Svr.Not=M3a;var D3a=Ti(),N3a=_n();function M3a(t,e){return(0,D3a.CreateType)({[N3a.Kind]:"Not",not:t},e)}a(M3a,"Not")});var dmt=I(Cte=>{"use strict";p();var O3a=Cte&&Cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Cte&&Cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O3a(e,t,r)};Object.defineProperty(Cte,"__esModule",{value:!0});B3a(VTi(),Cte)});var WTi=I(Q8=>{"use strict";p();var L3a=Q8&&Q8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F3a=Q8&&Q8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U3a=Q8&&Q8.__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 G3a=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]})),$3a=vte&&vte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G3a(e,t,r)};Object.defineProperty(vte,"__esModule",{value:!0});$3a(WTi(),vte)});var YTi=I(Tvr=>{"use strict";p();Object.defineProperty(Tvr,"__esModule",{value:!0});Tvr.Recursive=K3a;var V3a=f0t(),W3a=Ti(),z3a=uC(),zTi=_n(),Y3a=0;function K3a(t,e={}){(0,z3a.IsUndefined)(e.$id)&&(e.$id=`T${Y3a++}`);let r=(0,V3a.CloneType)(t({[zTi.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,W3a.CreateType)({[zTi.Hint]:"Recursive",...r},e)}a(K3a,"Recursive")});var pmt=I(bte=>{"use strict";p();var J3a=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]})),Z3a=bte&&bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&J3a(e,t,r)};Object.defineProperty(bte,"__esModule",{value:!0});Z3a(YTi(),bte)});var KTi=I(Ivr=>{"use strict";p();Object.defineProperty(Ivr,"__esModule",{value:!0});Ivr.RegExp=rFa;var X3a=Ti(),eFa=uC(),tFa=_n();function rFa(t,e){let r=(0,eFa.IsString)(t)?new globalThis.RegExp(t):t;return(0,X3a.CreateType)({[tFa.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(rFa,"RegExp")});var hmt=I(Ste=>{"use strict";p();var nFa=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]})),iFa=Ste&&Ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nFa(e,t,r)};Object.defineProperty(Ste,"__esModule",{value:!0});iFa(KTi(),Ste)});var JTi=I(wvr=>{"use strict";p();Object.defineProperty(wvr,"__esModule",{value:!0});wvr.Rest=sFa;var xvr=gs();function oFa(t){return(0,xvr.IsIntersect)(t)?t.allOf:(0,xvr.IsUnion)(t)?t.anyOf:(0,xvr.IsTuple)(t)?t.items??[]:[]}a(oFa,"RestResolve");function sFa(t){return oFa(t)}a(sFa,"Rest")});var mmt=I(Tte=>{"use strict";p();var aFa=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]})),cFa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aFa(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});cFa(JTi(),Tte)});var ZTi=I(q8=>{"use strict";p();var lFa=q8&&q8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uFa=q8&&q8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dFa=q8&&q8.__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 gFa=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]})),AFa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gFa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});AFa(ZTi(),Ite)});var eIi=I(XTi=>{"use strict";p();Object.defineProperty(XTi,"__esModule",{value:!0})});var rIi=I(tIi=>{"use strict";p();Object.defineProperty(tIi,"__esModule",{value:!0});var jEp=_n()});var iIi=I(gG=>{"use strict";p();var yFa=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]})),nIi=gG&&gG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yFa(e,t,r)};Object.defineProperty(gG,"__esModule",{value:!0});nIi(eIi(),gG);nIi(rIi(),gG)});var sIi=I(oIi=>{"use strict";p();Object.defineProperty(oIi,"__esModule",{value:!0})});var aIi=I(xte=>{"use strict";p();var EFa=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]})),_Fa=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EFa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});_Fa(sIi(),xte)});var cIi=I(wte=>{"use strict";p();Object.defineProperty(wte,"__esModule",{value:!0});wte.TransformEncodeBuilder=wte.TransformDecodeBuilder=void 0;wte.Transform=vFa;var Amt=_n(),CFa=gs(),ymt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new Emt(this.schema,e)}};wte.TransformDecodeBuilder=ymt;var Emt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Amt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Amt.TransformKind].Decode(c)),"Decode")};return{...r,[Amt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Amt.TransformKind]:n}}Encode(e){return(0,CFa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};wte.TransformEncodeBuilder=Emt;function vFa(t){return new ymt(t)}a(vFa,"Transform")});var _mt=I(Rte=>{"use strict";p();var bFa=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]})),SFa=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bFa(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});SFa(cIi(),Rte)});var uIi=I(Rvr=>{"use strict";p();Object.defineProperty(Rvr,"__esModule",{value:!0});Rvr.Unsafe=IFa;var TFa=Ti(),lIi=_n();function IFa(t={}){return(0,TFa.CreateType)({[lIi.Kind]:t[lIi.Kind]??"Unsafe"},t)}a(IFa,"Unsafe")});var bOe=I(kte=>{"use strict";p();var xFa=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]})),wFa=kte&&kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xFa(e,t,r)};Object.defineProperty(kte,"__esModule",{value:!0});wFa(uIi(),kte)});var dIi=I(kvr=>{"use strict";p();Object.defineProperty(kvr,"__esModule",{value:!0});kvr.Void=PFa;var RFa=Ti(),kFa=_n();function PFa(t){return(0,RFa.CreateType)({[kFa.Kind]:"Void",type:"void"},t)}a(PFa,"Void")});var Cmt=I(Pte=>{"use strict";p();var DFa=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]})),NFa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DFa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});NFa(dIi(),Pte)});var Dvr=I(bmt=>{"use strict";p();Object.defineProperty(bmt,"__esModule",{value:!0});bmt.JsonTypeBuilder=void 0;var MFa=yme(),OFa=Eme(),BFa=tOe(),LFa=L0t(),FFa=U0t(),UFa=q0t(),QFa=K0t(),qFa=dte(),jFa=X0t(),HFa=Q2(),GFa=rmt(),$Fa=NT(),vmt=omt(),VFa=q2(),WFa=TE(),zFa=f0(),YFa=d0(),KFa=dmt(),JFa=dOe(),ZFa=umt(),XFa=sG(),e8a=dC(),t8a=AOe(),r8a=f4(),n8a=EOe(),i8a=yOe(),o8a=uG(),s8a=gOe(),a8a=Dme(),c8a=pmt(),l8a=fG(),u8a=_Oe(),d8a=mmt(),f8a=aG(),p8a=U2(),h8a=_mt(),m8a=x8(),g8a=mp(),A8a=pG(),y8a=bOe(),Pvr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,s8a.ReadonlyOptional)(e)}Readonly(e,r){return(0,o8a.Readonly)(e,r??!0)}Optional(e,r){return(0,r8a.Optional)(e,r??!0)}Any(e){return(0,MFa.Any)(e)}Array(e,r){return(0,OFa.Array)(e,r)}Boolean(e){return(0,BFa.Boolean)(e)}Capitalize(e,r){return(0,vmt.Capitalize)(e,r)}Composite(e,r){return(0,LFa.Composite)(e,r)}Const(e,r){return(0,FFa.Const)(e,r)}Enum(e,r){return(0,UFa.Enum)(e,r)}Exclude(e,r,n){return(0,QFa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,qFa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,jFa.Extract)(e,r,n)}Index(e,r,n){return(0,HFa.Index)(e,r,n)}Integer(e){return(0,GFa.Integer)(e)}Intersect(e,r){return(0,$Fa.Intersect)(e,r)}KeyOf(e,r){return(0,VFa.KeyOf)(e,r)}Literal(e,r){return(0,WFa.Literal)(e,r)}Lowercase(e,r){return(0,vmt.Lowercase)(e,r)}Mapped(e,r,n){return(0,zFa.Mapped)(e,r,n)}Module(e){return(0,ZFa.Module)(e)}Never(e){return(0,YFa.Never)(e)}Not(e,r){return(0,KFa.Not)(e,r)}Null(e){return(0,JFa.Null)(e)}Number(e){return(0,XFa.Number)(e)}Object(e,r){return(0,e8a.Object)(e,r)}Omit(e,r,n){return(0,t8a.Omit)(e,r,n)}Partial(e,r){return(0,n8a.Partial)(e,r)}Pick(e,r,n){return(0,i8a.Pick)(e,r,n)}Record(e,r,n){return(0,a8a.Record)(e,r,n)}Recursive(e,r){return(0,c8a.Recursive)(e,r)}Ref(...e){return(0,l8a.Ref)(e[0],e[1])}Required(e,r){return(0,u8a.Required)(e,r)}Rest(e){return(0,d8a.Rest)(e)}String(e){return(0,f8a.String)(e)}TemplateLiteral(e,r){return(0,p8a.TemplateLiteral)(e,r)}Transform(e){return(0,h8a.Transform)(e)}Tuple(e,r){return(0,m8a.Tuple)(e,r)}Uncapitalize(e,r){return(0,vmt.Uncapitalize)(e,r)}Union(e,r){return(0,g8a.Union)(e,r)}Unknown(e){return(0,A8a.Unknown)(e)}Unsafe(e){return(0,y8a.Unsafe)(e)}Uppercase(e,r){return(0,vmt.Uppercase)(e,r)}};bmt.JsonTypeBuilder=Pvr});var fIi=I(Pt=>{"use strict";p();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Rest=Pt.Required=Pt.RegExp=Pt.Ref=Pt.Recursive=Pt.Record=Pt.ReadonlyOptional=Pt.Readonly=Pt.Promise=Pt.Pick=Pt.Partial=Pt.Parameters=Pt.Optional=Pt.Omit=Pt.Object=Pt.Number=Pt.Null=Pt.Not=Pt.Never=Pt.Module=Pt.Mapped=Pt.Literal=Pt.KeyOf=Pt.Iterator=Pt.Uppercase=Pt.Lowercase=Pt.Uncapitalize=Pt.Capitalize=Pt.Intersect=Pt.Integer=Pt.Instantiate=Pt.InstanceType=Pt.Index=Pt.Function=Pt.Extract=Pt.Extends=Pt.Exclude=Pt.Enum=Pt.Date=Pt.ConstructorParameters=Pt.Constructor=Pt.Const=Pt.Composite=Pt.Boolean=Pt.BigInt=Pt.Awaited=Pt.AsyncIterator=Pt.Array=Pt.Argument=Pt.Any=void 0;Pt.Void=Pt.Unsafe=Pt.Unknown=Pt.Union=Pt.Undefined=Pt.Uint8Array=Pt.Tuple=Pt.Transform=Pt.TemplateLiteral=Pt.Symbol=Pt.String=Pt.ReturnType=void 0;var E8a=yme();Object.defineProperty(Pt,"Any",{enumerable:!0,get:a(function(){return E8a.Any},"get")});var _8a=E0t();Object.defineProperty(Pt,"Argument",{enumerable:!0,get:a(function(){return _8a.Argument},"get")});var C8a=Eme();Object.defineProperty(Pt,"Array",{enumerable:!0,get:a(function(){return C8a.Array},"get")});var v8a=_me();Object.defineProperty(Pt,"AsyncIterator",{enumerable:!0,get:a(function(){return v8a.AsyncIterator},"get")});var b8a=lOe();Object.defineProperty(Pt,"Awaited",{enumerable:!0,get:a(function(){return b8a.Awaited},"get")});var S8a=Tme();Object.defineProperty(Pt,"BigInt",{enumerable:!0,get:a(function(){return S8a.BigInt},"get")});var T8a=tOe();Object.defineProperty(Pt,"Boolean",{enumerable:!0,get:a(function(){return T8a.Boolean},"get")});var I8a=L0t();Object.defineProperty(Pt,"Composite",{enumerable:!0,get:a(function(){return I8a.Composite},"get")});var x8a=U0t();Object.defineProperty(Pt,"Const",{enumerable:!0,get:a(function(){return x8a.Const},"get")});var w8a=Cme();Object.defineProperty(Pt,"Constructor",{enumerable:!0,get:a(function(){return w8a.Constructor},"get")});var R8a=Q0t();Object.defineProperty(Pt,"ConstructorParameters",{enumerable:!0,get:a(function(){return R8a.ConstructorParameters},"get")});var k8a=uOe();Object.defineProperty(Pt,"Date",{enumerable:!0,get:a(function(){return k8a.Date},"get")});var P8a=q0t();Object.defineProperty(Pt,"Enum",{enumerable:!0,get:a(function(){return P8a.Enum},"get")});var D8a=K0t();Object.defineProperty(Pt,"Exclude",{enumerable:!0,get:a(function(){return D8a.Exclude},"get")});var N8a=dte();Object.defineProperty(Pt,"Extends",{enumerable:!0,get:a(function(){return N8a.Extends},"get")});var M8a=X0t();Object.defineProperty(Pt,"Extract",{enumerable:!0,get:a(function(){return M8a.Extract},"get")});var O8a=oG();Object.defineProperty(Pt,"Function",{enumerable:!0,get:a(function(){return O8a.Function},"get")});var B8a=Q2();Object.defineProperty(Pt,"Index",{enumerable:!0,get:a(function(){return B8a.Index},"get")});var L8a=emt();Object.defineProperty(Pt,"InstanceType",{enumerable:!0,get:a(function(){return L8a.InstanceType},"get")});var F8a=tmt();Object.defineProperty(Pt,"Instantiate",{enumerable:!0,get:a(function(){return F8a.Instantiate},"get")});var U8a=rmt();Object.defineProperty(Pt,"Integer",{enumerable:!0,get:a(function(){return U8a.Integer},"get")});var Q8a=NT();Object.defineProperty(Pt,"Intersect",{enumerable:!0,get:a(function(){return Q8a.Intersect},"get")});var Smt=omt();Object.defineProperty(Pt,"Capitalize",{enumerable:!0,get:a(function(){return Smt.Capitalize},"get")});Object.defineProperty(Pt,"Uncapitalize",{enumerable:!0,get:a(function(){return Smt.Uncapitalize},"get")});Object.defineProperty(Pt,"Lowercase",{enumerable:!0,get:a(function(){return Smt.Lowercase},"get")});Object.defineProperty(Pt,"Uppercase",{enumerable:!0,get:a(function(){return Smt.Uppercase},"get")});var q8a=xme();Object.defineProperty(Pt,"Iterator",{enumerable:!0,get:a(function(){return q8a.Iterator},"get")});var j8a=q2();Object.defineProperty(Pt,"KeyOf",{enumerable:!0,get:a(function(){return j8a.KeyOf},"get")});var H8a=TE();Object.defineProperty(Pt,"Literal",{enumerable:!0,get:a(function(){return H8a.Literal},"get")});var G8a=f0();Object.defineProperty(Pt,"Mapped",{enumerable:!0,get:a(function(){return G8a.Mapped},"get")});var $8a=umt();Object.defineProperty(Pt,"Module",{enumerable:!0,get:a(function(){return $8a.Module},"get")});var V8a=d0();Object.defineProperty(Pt,"Never",{enumerable:!0,get:a(function(){return V8a.Never},"get")});var W8a=dmt();Object.defineProperty(Pt,"Not",{enumerable:!0,get:a(function(){return W8a.Not},"get")});var z8a=dOe();Object.defineProperty(Pt,"Null",{enumerable:!0,get:a(function(){return z8a.Null},"get")});var Y8a=sG();Object.defineProperty(Pt,"Number",{enumerable:!0,get:a(function(){return Y8a.Number},"get")});var K8a=dC();Object.defineProperty(Pt,"Object",{enumerable:!0,get:a(function(){return K8a.Object},"get")});var J8a=AOe();Object.defineProperty(Pt,"Omit",{enumerable:!0,get:a(function(){return J8a.Omit},"get")});var Z8a=f4();Object.defineProperty(Pt,"Optional",{enumerable:!0,get:a(function(){return Z8a.Optional},"get")});var X8a=fmt();Object.defineProperty(Pt,"Parameters",{enumerable:!0,get:a(function(){return X8a.Parameters},"get")});var e6a=EOe();Object.defineProperty(Pt,"Partial",{enumerable:!0,get:a(function(){return e6a.Partial},"get")});var t6a=yOe();Object.defineProperty(Pt,"Pick",{enumerable:!0,get:a(function(){return t6a.Pick},"get")});var r6a=sOe();Object.defineProperty(Pt,"Promise",{enumerable:!0,get:a(function(){return r6a.Promise},"get")});var n6a=uG();Object.defineProperty(Pt,"Readonly",{enumerable:!0,get:a(function(){return n6a.Readonly},"get")});var i6a=gOe();Object.defineProperty(Pt,"ReadonlyOptional",{enumerable:!0,get:a(function(){return i6a.ReadonlyOptional},"get")});var o6a=Dme();Object.defineProperty(Pt,"Record",{enumerable:!0,get:a(function(){return o6a.Record},"get")});var s6a=pmt();Object.defineProperty(Pt,"Recursive",{enumerable:!0,get:a(function(){return s6a.Recursive},"get")});var a6a=fG();Object.defineProperty(Pt,"Ref",{enumerable:!0,get:a(function(){return a6a.Ref},"get")});var c6a=hmt();Object.defineProperty(Pt,"RegExp",{enumerable:!0,get:a(function(){return c6a.RegExp},"get")});var l6a=_Oe();Object.defineProperty(Pt,"Required",{enumerable:!0,get:a(function(){return l6a.Required},"get")});var u6a=mmt();Object.defineProperty(Pt,"Rest",{enumerable:!0,get:a(function(){return u6a.Rest},"get")});var d6a=gmt();Object.defineProperty(Pt,"ReturnType",{enumerable:!0,get:a(function(){return d6a.ReturnType},"get")});var f6a=aG();Object.defineProperty(Pt,"String",{enumerable:!0,get:a(function(){return f6a.String},"get")});var p6a=fOe();Object.defineProperty(Pt,"Symbol",{enumerable:!0,get:a(function(){return p6a.Symbol},"get")});var h6a=U2();Object.defineProperty(Pt,"TemplateLiteral",{enumerable:!0,get:a(function(){return h6a.TemplateLiteral},"get")});var m6a=_mt();Object.defineProperty(Pt,"Transform",{enumerable:!0,get:a(function(){return m6a.Transform},"get")});var g6a=x8();Object.defineProperty(Pt,"Tuple",{enumerable:!0,get:a(function(){return g6a.Tuple},"get")});var A6a=hOe();Object.defineProperty(Pt,"Uint8Array",{enumerable:!0,get:a(function(){return A6a.Uint8Array},"get")});var y6a=pOe();Object.defineProperty(Pt,"Undefined",{enumerable:!0,get:a(function(){return y6a.Undefined},"get")});var E6a=mp();Object.defineProperty(Pt,"Union",{enumerable:!0,get:a(function(){return E6a.Union},"get")});var _6a=pG();Object.defineProperty(Pt,"Unknown",{enumerable:!0,get:a(function(){return _6a.Unknown},"get")});var C6a=bOe();Object.defineProperty(Pt,"Unsafe",{enumerable:!0,get:a(function(){return C6a.Unsafe},"get")});var v6a=Cmt();Object.defineProperty(Pt,"Void",{enumerable:!0,get:a(function(){return v6a.Void},"get")})});var pIi=I(Tmt=>{"use strict";p();Object.defineProperty(Tmt,"__esModule",{value:!0});Tmt.JavaScriptTypeBuilder=void 0;var b6a=Dvr(),S6a=E0t(),T6a=_me(),I6a=lOe(),x6a=Tme(),w6a=Cme(),R6a=Q0t(),k6a=uOe(),P6a=oG(),D6a=emt(),N6a=tmt(),M6a=xme(),O6a=fmt(),B6a=sOe(),L6a=hmt(),F6a=gmt(),U6a=fOe(),Q6a=hOe(),q6a=pOe(),j6a=Cmt(),Nvr=class extends b6a.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,S6a.Argument)(e)}AsyncIterator(e,r){return(0,T6a.AsyncIterator)(e,r)}Awaited(e,r){return(0,I6a.Awaited)(e,r)}BigInt(e){return(0,x6a.BigInt)(e)}ConstructorParameters(e,r){return(0,R6a.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,w6a.Constructor)(e,r,n)}Date(e={}){return(0,k6a.Date)(e)}Function(e,r,n){return(0,P6a.Function)(e,r,n)}InstanceType(e,r){return(0,D6a.InstanceType)(e,r)}Instantiate(e,r){return(0,N6a.Instantiate)(e,r)}Iterator(e,r){return(0,M6a.Iterator)(e,r)}Parameters(e,r){return(0,O6a.Parameters)(e,r)}Promise(e,r){return(0,B6a.Promise)(e,r)}RegExp(e,r){return(0,L6a.RegExp)(e,r)}ReturnType(e,r){return(0,F6a.ReturnType)(e,r)}Symbol(e){return(0,U6a.Symbol)(e)}Undefined(e){return(0,q6a.Undefined)(e)}Uint8Array(e){return(0,Q6a.Uint8Array)(e)}Void(e){return(0,j6a.Void)(e)}};Tmt.JavaScriptTypeBuilder=Nvr});var hIi=I(Vb=>{"use strict";p();var H6a=Vb&&Vb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G6a=Vb&&Vb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$6a=Vb&&Vb.__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 K6a=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]})),mn=Xr&&Xr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K6a(e,t,r)};Object.defineProperty(Xr,"__esModule",{value:!0});mn(bEr(),Xr);mn(v8(),Xr);mn(bf(),Xr);mn(DEr(),Xr);mn(m1i(),Xr);mn(JMe(),Xr);mn(Ame(),Xr);mn(ZMe(),Xr);mn(_n(),Xr);mn(yme(),Xr);mn(Eme(),Xr);mn(E0t(),Xr);mn(_me(),Xr);mn(lOe(),Xr);mn(Tme(),Xr);mn(tOe(),Xr);mn(L0t(),Xr);mn(U0t(),Xr);mn(Cme(),Xr);mn(Q0t(),Xr);mn(uOe(),Xr);mn(q0t(),Xr);mn(K0t(),Xr);mn(dte(),Xr);mn(X0t(),Xr);mn(oG(),Xr);mn(Q2(),Xr);mn(emt(),Xr);mn(tmt(),Xr);mn(rmt(),Xr);mn(NT(),Xr);mn(xme(),Xr);mn(omt(),Xr);mn(q2(),Xr);mn(TE(),Xr);mn(umt(),Xr);mn(f0(),Xr);mn(d0(),Xr);mn(dmt(),Xr);mn(dOe(),Xr);mn(sG(),Xr);mn(dC(),Xr);mn(AOe(),Xr);mn(f4(),Xr);mn(fmt(),Xr);mn(EOe(),Xr);mn(yOe(),Xr);mn(sOe(),Xr);mn(uG(),Xr);mn(gOe(),Xr);mn(Dme(),Xr);mn(pmt(),Xr);mn(fG(),Xr);mn(hmt(),Xr);mn(_Oe(),Xr);mn(mmt(),Xr);mn(gmt(),Xr);mn(iIi(),Xr);mn(aIi(),Xr);mn(aG(),Xr);mn(fOe(),Xr);mn(U2(),Xr);mn(_mt(),Xr);mn(x8(),Xr);mn(hOe(),Xr);mn(pOe(),Xr);mn(mp(),Xr);mn(pG(),Xr);mn(bOe(),Xr);mn(Cmt(),Xr);mn(hIi(),Xr)});var gIi=I(lR=>{"use strict";p();var J6a=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]})),Z6a=lR&&lR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X6a=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();var t9a=A4&&A4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r9a=A4&&A4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n9a=A4&&A4.__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(xmt,"__esModule",{value:!0});xmt.ContextItemOrigin=void 0;var EIi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(EIi||(xmt.ContextItemOrigin=EIi={}))});var vIi=I(xu=>{"use strict";p();Object.defineProperty(xu,"__esModule",{value:!0});xu.RangeSchema=xu.WorkspaceFolder=xu.VersionedTextDocumentIdentifier=xu.TextEdit=xu.TextDocumentItem=xu.Range=xu.Position=xu.DocumentUri=xu.Disposable=xu.Command=xu.CancellationTokenSource=xu.CancellationToken=void 0;var wmt=Imt(),$2=ti();Object.defineProperty(xu,"CancellationToken",{enumerable:!0,get:a(function(){return $2.CancellationToken},"get")});Object.defineProperty(xu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return $2.CancellationTokenSource},"get")});Object.defineProperty(xu,"Command",{enumerable:!0,get:a(function(){return $2.Command},"get")});Object.defineProperty(xu,"Disposable",{enumerable:!0,get:a(function(){return $2.Disposable},"get")});Object.defineProperty(xu,"DocumentUri",{enumerable:!0,get:a(function(){return $2.DocumentUri},"get")});Object.defineProperty(xu,"Position",{enumerable:!0,get:a(function(){return $2.Position},"get")});Object.defineProperty(xu,"Range",{enumerable:!0,get:a(function(){return $2.Range},"get")});Object.defineProperty(xu,"TextDocumentItem",{enumerable:!0,get:a(function(){return $2.TextDocumentItem},"get")});Object.defineProperty(xu,"TextEdit",{enumerable:!0,get:a(function(){return $2.TextEdit},"get")});Object.defineProperty(xu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return $2.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(xu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return $2.WorkspaceFolder},"get")});var CIi=wmt.Type.Object({line:wmt.Type.Integer({minimum:0}),character:wmt.Type.Integer({minimum:0})});xu.RangeSchema=wmt.Type.Object({start:CIi,end:CIi})});var SIi=I(bIi=>{"use strict";p();Object.defineProperty(bIi,"__esModule",{value:!0})});var TOe=I(Sf=>{"use strict";p();var o9a=Sf&&Sf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SOe=Sf&&Sf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o9a(e,t,r)};Object.defineProperty(Sf,"__esModule",{value:!0});Sf.TextEdit=Sf.Range=Sf.Position=Sf.Disposable=Sf.CancellationTokenSource=Sf.CancellationToken=void 0;var Ome=ti();Object.defineProperty(Sf,"CancellationToken",{enumerable:!0,get:a(function(){return Ome.CancellationToken},"get")});Object.defineProperty(Sf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Ome.CancellationTokenSource},"get")});Object.defineProperty(Sf,"Disposable",{enumerable:!0,get:a(function(){return Ome.Disposable},"get")});Object.defineProperty(Sf,"Position",{enumerable:!0,get:a(function(){return Ome.Position},"get")});Object.defineProperty(Sf,"Range",{enumerable:!0,get:a(function(){return Ome.Range},"get")});Object.defineProperty(Sf,"TextEdit",{enumerable:!0,get:a(function(){return Ome.TextEdit},"get")});SOe(gIi(),Sf);SOe(yIi(),Sf);SOe(_Ii(),Sf);SOe(vIi(),Sf);SOe(SIi(),Sf)});var Ovr=I(MT=>{"use strict";p();var s9a=MT&&MT.__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},TIi=MT&&MT.__param||function(t,e){return function(r,n){e(r,n,t)}},a9a=MT&&MT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(MT,"__esModule",{value:!0});MT.CompletionNotifier=MT.ICompletionsNotifierService=void 0;var c9a=a9a(require("events")),l9a=rn(),u9a=See(),d9a=TOe(),f9a=Tg(),p9a=QMe(),Rmt="CompletionRequested";MT.ICompletionsNotifierService=(0,l9a.createServiceIdentifier)("ICompletionsNotifierService");var Mvr=class{static{a(this,"CompletionNotifier")}#e=new c9a.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(Rmt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,f9a.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${Rmt}`);return this.#e.on(Rmt,r),d9a.Disposable.create(()=>this.#e.off(Rmt,r))}};MT.CompletionNotifier=Mvr;MT.CompletionNotifier=Mvr=s9a([TIi(0,p9a.ICompletionsPromiseQueueService),TIi(1,u9a.ICompletionsTelemetryService)],Mvr)});var Bvr=I(kmt=>{"use strict";p();Object.defineProperty(kmt,"__esModule",{value:!0});kmt.ICompletionsObservableWorkspace=void 0;var h9a=Qs();kmt.ICompletionsObservableWorkspace=(0,h9a.createDecorator)("ICompletionsObservableWorkspace")});var xl=I(V2=>{"use strict";p();Object.defineProperty(V2,"__esModule",{value:!0});V2.logger=V2.Logger=V2.ICompletionsLogTargetService=V2.LogLevel=void 0;var m9a=rn(),g9a=See(),A9a=Tg(),Dte;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Dte||(V2.LogLevel=Dte={}));V2.ICompletionsLogTargetService=(0,m9a.createServiceIdentifier)("ICompletionsLogTargetService");var Pmt=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,Dte.DEBUG,...r)}info(e,...r){this.log(e,Dte.INFO,...r)}warn(e,...r){this.log(e,Dte.WARN,...r)}error(e,...r){this.log(e,Dte.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,A9a.telemetryException)(e.get(g9a.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(V2.ICompletionsLogTargetService),Dte.ERROR,`${o}:`,s)}};V2.Logger=Pmt;V2.logger=new Pmt("default")});var xIi=I(AG=>{"use strict";p();Object.defineProperty(AG,"__esModule",{value:!0});AG.INotificationService=AG.NullNotificationService=AG.ProgressLocation=void 0;var y9a=rn(),E9a=SP(),IIi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(IIi||(AG.ProgressLocation=IIi={}));var Lvr=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")},E9a.CancellationToken.None))}};AG.NullNotificationService=Lvr;AG.INotificationService=(0,y9a.createServiceIdentifier)("INotificationService")});var Uvr=I(W2=>{"use strict";p();var _9a=W2&&W2.__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},C9a=W2&&W2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(W2,"__esModule",{value:!0});W2.ExtensionNotificationSender=W2.ICompletionsNotificationSender=void 0;var v9a=xIi(),b9a=rn();W2.ICompletionsNotificationSender=(0,b9a.createServiceIdentifier)("ICompletionsNotificationSender");var Fvr=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}}};W2.ExtensionNotificationSender=Fvr;W2.ExtensionNotificationSender=Fvr=_9a([C9a(0,v9a.INotificationService)],Fvr)});var jvr=I(z2=>{"use strict";p();var S9a=z2&&z2.__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},Qvr=z2&&z2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z2,"__esModule",{value:!0});z2.UserErrorNotifier=z2.ICompletionsUserErrorNotifierService=void 0;var T9a=a4(),I9a=rn(),x9a=Ku(),kIi=xl(),w9a=Uvr(),R9a=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],wIi="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.",RIi="https://gh.io/copilot-network-errors";z2.ICompletionsUserErrorNotifierService=(0,I9a.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var qvr=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&&R9a.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new kIi.Logger("certificates").error(this._logTarget,`${wIi} Please visit ${RIi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(wIi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(x9a.URI.parse(RIi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};z2.UserErrorNotifier=qvr;z2.UserErrorNotifier=qvr=S9a([Qvr(0,kIi.ICompletionsLogTargetService),Qvr(1,w9a.ICompletionsNotificationSender),Qvr(2,T9a.IEnvService)],qvr)});var gp=I(Bme=>{"use strict";p();Object.defineProperty(Bme,"__esModule",{value:!0});Bme.NullExperimentationService=Bme.IExperimentationService=void 0;var k9a=rn(),P9a=Sc();Bme.IExperimentationService=(0,k9a.createServiceIdentifier)("IExperimentationService");var Hvr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new P9a.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};Bme.NullExperimentationService=Hvr});var yG=I(Wb=>{"use strict";p();Object.defineProperty(Wb,"__esModule",{value:!0});Wb.DEFAULT_PROMPT_ALLOCATION_PERCENT=Wb.DEFAULT_SUFFIX_MATCH_THRESHOLD=Wb.DEFAULT_NUM_SNIPPETS=Wb.DEFAULT_MAX_PROMPT_LENGTH=Wb.DEFAULT_MAX_COMPLETION_LENGTH=void 0;Wb.normalizeLanguageId=N9a;Wb.DEFAULT_MAX_COMPLETION_LENGTH=500;Wb.DEFAULT_MAX_PROMPT_LENGTH=8192-Wb.DEFAULT_MAX_COMPLETION_LENGTH;Wb.DEFAULT_NUM_SNIPPETS=4;Wb.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;Wb.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var D9a={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function N9a(t){return t=t.toLowerCase(),D9a[t]??t}a(N9a,"normalizeLanguageId")});var PIi=I(Gvr=>{"use strict";p();Object.defineProperty(Gvr,"__esModule",{value:!0});Gvr.getUserKind=O9a;function M9a(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(M9a,"findKnownOrg");function O9a(t){let e=t.organizationList??[];return M9a(e)??""}a(O9a,"getUserKind")});var IOe=I(y4=>{"use strict";p();Object.defineProperty(y4,"__esModule",{value:!0});y4.IEndpointProvider=y4.ModelSupportedEndpoint=void 0;y4.isEndpointEditToolName=F9a;y4.isChatModelInformation=U9a;y4.isEmbeddingModelInformation=Q9a;y4.isCompletionModelInformation=q9a;var B9a=rn(),L9a=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function F9a(t){return L9a.has(t)}a(F9a,"isEndpointEditToolName");var DIi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(DIi||(y4.ModelSupportedEndpoint=DIi={}));function U9a(t){return t.capabilities.type==="chat"}a(U9a,"isChatModelInformation");function Q9a(t){return t.capabilities.type==="embeddings"}a(Q9a,"isEmbeddingModelInformation");function q9a(t){return t.capabilities.type==="completion"}a(q9a,"isCompletionModelInformation");y4.IEndpointProvider=(0,B9a.createServiceIdentifier)("IEndpointProvider")});var MIi=I($vr=>{"use strict";p();Object.defineProperty($vr,"__esModule",{value:!0});$vr.getUserSelectedModelConfiguration=j9a;var NIi=vE();function j9a(t){let e=(0,NIi.getConfig)(t,NIi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(j9a,"getUserSelectedModelConfiguration")});var BIi=I(KA=>{"use strict";p();Object.defineProperty(KA,"__esModule",{value:!0});KA.isReadable=G9a;KA.isReadableStream=OIi;KA.isReadableBufferedStream=$9a;KA.newWriteableStream=xOe;KA.consumeReadable=V9a;KA.peekReadable=W9a;KA.consumeStream=z9a;KA.listenStream=Nmt;KA.peekStream=Y9a;KA.toStream=K9a;KA.emptyStream=J9a;KA.toReadable=Z9a;KA.transform=X9a;KA.prefixedReadable=eUa;KA.prefixedStream=tUa;var H9a=Ts(),Dmt=ko();function G9a(t){let e=t;return e?typeof e.read=="function":!1}a(G9a,"isReadable");function OIi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(OIi,"isReadableStream");function $9a(t){let e=t;return e?OIi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a($9a,"isReadableBufferedStream");function xOe(t,e){return new Vvr(t,e)}a(xOe,"newWriteableStream");var Vvr=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,H9a.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 V9a(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(V9a,"consumeReadable");function W9a(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(W9a,"peekReadable");function z9a(t,e){return new Promise((r,n)=>{let o=[];Nmt(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(z9a,"consumeStream");function Nmt(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(Nmt,"listenStream");function Y9a(t,e){return new Promise((r,n)=>{let o=new Dmt.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,Dmt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,Dmt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,Dmt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(Y9a,"peekStream");function K9a(t,e){let r=xOe(e);return r.end(t),r}a(K9a,"toStream");function J9a(){let t=xOe(()=>{throw new Error("not supported")});return t.end(),t}a(J9a,"emptyStream");function Z9a(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(Z9a,"toReadable");function X9a(t,e,r){let n=xOe(r);return Nmt(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(X9a,"transform");function eUa(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(eUa,"prefixedReadable");function tUa(t,e,r){let n=!1,o=xOe(r);return Nmt(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(tUa,"prefixedStream")});var _G=I(gc=>{"use strict";p();var rUa=gc&&gc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nUa=gc&&gc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iUa=gc&&gc.__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)),Wvr,zvr,xE=class t{static{a(this,"VSBuffer")}static alloc(e){return wOe?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return wOe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&wOe?new t(Buffer.from(e)):(Wvr||(Wvr=new TextEncoder),new t(Wvr.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])}};gc.VSBuffer=xE;function UIi(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=sUa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(aUa,"readUInt16LE");function cUa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(cUa,"writeUInt16LE");function QIi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(QIi,"readUInt32BE");function qIi(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(qIi,"writeUInt32BE");function jIi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(jIi,"readUInt32LE");function HIi(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(HIi,"writeUInt32LE");function GIi(t,e){return t[e]}a(GIi,"readUInt8");function $Ii(t,e,r){t[r]=e}a($Ii,"writeUInt8");function lUa(t){return EG.consumeReadable(t,e=>xE.concat(e))}a(lUa,"readableToBuffer");function uUa(t){return EG.toReadable(t)}a(uUa,"bufferToReadable");function VIi(t){return EG.consumeStream(t,e=>xE.concat(e))}a(VIi,"streamToBuffer");async function dUa(t){return t.ended?xE.concat(t.buffer):xE.concat([...t.buffer,await VIi(t.stream)])}a(dUa,"bufferedStreamToBuffer");function fUa(t){return EG.toStream(t,e=>xE.concat(e))}a(fUa,"bufferToStream");function pUa(t){return EG.transform(t,{data:a(e=>typeof e=="string"?xE.fromString(e):xE.wrap(e),"data")},e=>xE.concat(e))}a(pUa,"streamToBufferReadableStream");function hUa(t){return EG.newWriteableStream(e=>xE.concat(e),t)}a(hUa,"newWriteableBufferStream");function mUa(t,e){return EG.prefixedReadable(t,e,r=>xE.concat(r))}a(mUa,"prefixedBufferReadable");function gUa(t,e){return EG.prefixedStream(t,e,r=>xE.concat(r))}a(gUa,"prefixedBufferStream");function AUa(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 xE.wrap(o).slice(0,c)}a(AUa,"decodeBase64");var yUa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EUa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function _Ua({buffer:t},e=!0,r=!1){let n=r?EUa:yUa,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(_Ua,"encodeBase64");var LIi="0123456789abcdef";function CUa({buffer:t}){let e="";for(let r=0;r>>4],e+=LIi[n&15]}return e}a(CUa,"encodeHex");function vUa(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]=FIi(t,r++)<<4|FIi(t,r++);return xE.wrap(e)}a(vUa,"decodeHex");function FIi(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(FIi,"decodeHexChar")});var WIi=I(Mmt=>{"use strict";p();Object.defineProperty(Mmt,"__esModule",{value:!0});Mmt.readVariableLengthQuantity=SUa;Mmt.writeVariableLengthQuantity=TUa;var bUa=_G();function SUa(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 bUa.VSBuffer.fromByteArray(e)}a(TUa,"writeVariableLengthQuantity")});var Yvr=I(Omt=>{"use strict";p();Object.defineProperty(Omt,"__esModule",{value:!0});Omt.parseTikTokenBinary=void 0;var IUa=require("fs"),xUa=WIi(),wUa=_G(),RUa=a(t=>{let e=(0,IUa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(Bmt,"__esModule",{value:!0});Bmt.CopilotPromptLoadFailure=void 0;var Kvr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};Bmt.CopilotPromptLoadFailure=Kvr});var Zvr=I(uR=>{"use strict";p();var kUa=uR&&uR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=uR&&uR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DUa=uR&&uR.__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(Y2,"__esModule",{value:!0});Y2.initializeTokenizers=Y2.ApproximateTokenizer=Y2.TTokenizer=Y2.TokenizerName=void 0;Y2.getTokenizer=UUa;var Xvr=oGe(),BUa=Yvr(),LUa=Jvr(),FUa=Zvr(),E4;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(E4||(Y2.TokenizerName=E4={}));var Lmt=new Map;function UUa(t=E4.o200k){let e=Lmt.get(t);return e!==void 0||(e=Lmt.get(E4.o200k),e!==void 0)?e:new Umt}a(UUa,"getTokenizer");var Fmt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,Xvr.createTokenizer)((0,BUa.parseTikTokenBinary)((0,FUa.locateFile)(`${e}.tiktoken`)),(0,Xvr.getSpecialTokensByEncoder)(e),(0,Xvr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new LUa.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.lengthr(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(z_i,"collectErrorMessages");function eCa(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(Y_i(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(eCa,"collectSingleLineErrorMessage");function tCa(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(tCa,"sanitizeNetworkErrorForTelemetry");function Y_i(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(Y_i,"extractChromiumDetails");var Cht=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}};XA.LogMemory=Cht});var fMe=I(dMe=>{"use strict";p();Object.defineProperty(dMe,"__esModule",{value:!0});dMe.ICopilotTokenManager=void 0;dMe.nowSeconds=nCa;var rCa=rn();dMe.ICopilotTokenManager=(0,rCa.createServiceIdentifier)("ICopilotTokenManager");function nCa(){return Math.floor(Date.now()/1e3)}a(nCa,"nowSeconds")});var vE=I(u0=>{"use strict";p();var iCa=u0&&u0.__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},bht=u0&&u0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u0,"__esModule",{value:!0});u0.BaseAuthenticationService=u0.IAuthenticationService=u0.MinimalModeError=u0.GITHUB_SCOPE_ALIGNED=u0.GITHUB_SCOPE_READ_USER=u0.GITHUB_SCOPE_USER_EMAIL=void 0;u0.authProviderId=dCa;var oCa=rn(),zAr=Cc(),sCa=wo(),aCa=wF(),see=Sl(),cCa=hp(),lCa=fMe(),uCa=rH();u0.GITHUB_SCOPE_USER_EMAIL=["user:email"];u0.GITHUB_SCOPE_READ_USER=["read:user"];u0.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var YAr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};u0.MinimalModeError=YAr;u0.IAuthenticationService=(0,oCa.createServiceIdentifier)("IAuthenticationService");var KAr=class extends sCa.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()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new zAr.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidAccessTokenChange=this._register(new zAr.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new zAr.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,aCa.derived)(s=>this._configurationService.getConfigObservable(see.ConfigKey.Shared.AuthPermissions).read(s)===see.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=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=r,this._copilotTokenError=void 0,r}catch(r){this._tokenStore.copilotToken=void 0;let n=this._copilotTokenError;throw this._copilotTokenError=r,n&&r&&n.message!==r.message&&this.fireAuthenticationChange("getCopilotToken error change"),r}}resetCopilotToken(e){this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e)}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=this._tokenStore.copilotToken,s=this._copilotTokenError,c=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let l of c)l.status==="rejected"&&this._logService.error(`Error getting a session: ${l.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed, minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken.");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{}(o?.token!==this._tokenStore.copilotToken?.token||s?.message!==this._copilotTokenError?.message)&&(this._logService.debug("CopilotToken state changed, firing event."),this.fireAuthenticationChange("handleAuthChangeEvent")),this._logService.debug("Finished handling auth change event.")}};u0.BaseAuthenticationService=KAr;u0.BaseAuthenticationService=KAr=iCa([bht(0,cCa.ILogService),bht(1,uCa.ICopilotTokenStore),bht(2,lCa.ICopilotTokenManager),bht(3,see.IConfigurationService)],KAr);function dCa(t){return t.getConfig(see.ConfigKey.Shared.AuthProvider)===see.AuthProviderId.GitHubEnterprise?see.AuthProviderId.GitHubEnterprise:see.AuthProviderId.GitHub}a(dCa,"authProviderId")});var Sht=I(JAr=>{"use strict";p();Object.defineProperty(JAr,"__esModule",{value:!0});JAr.onCopilotToken=fCa;function fCa(t,e){return t.onDidAuthenticationChange(()=>{let r=t.copilotToken;r&&e(r)})}a(fCa,"onCopilotToken")});var XAr=I(w2=>{"use strict";p();var pCa=w2&&w2.__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},hCa=w2&&w2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(w2,"__esModule",{value:!0});w2.TelemetryUserConfig=w2.ICompletionsTelemetryUserConfigService=void 0;var mCa=vE(),gCa=rn(),ACa=wo(),yCa=Sht();function ECa(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(ECa,"propertiesFromCopilotToken");w2.ICompletionsTelemetryUserConfigService=(0,gCa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var ZAr=class extends ACa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,yCa.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=ECa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};w2.TelemetryUserConfig=ZAr;w2.TelemetryUserConfig=ZAr=pCa([hCa(0,mCa.IAuthenticationService)],ZAr)});var pMe=I(Q0e=>{"use strict";p();Object.defineProperty(Q0e,"__esModule",{value:!0});Q0e.PromiseQueue=Q0e.ICompletionsPromiseQueueService=void 0;var _Ca=rn();Q0e.ICompletionsPromiseQueueService=(0,_Ca.createServiceIdentifier)("completionsPromiseQueueService");var eyr=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)}};Q0e.PromiseQueue=eyr});var xg=I(ud=>{"use strict";p();Object.defineProperty(ud,"__esModule",{value:!0});ud.TelemetryReporters=ud.ICompletionsTelemetryReporters=ud.CopilotTelemetryReporter=ud.TelemetryWithExp=ud.TelemetryData=ud.TelemetryStore=void 0;ud.telemetrizePromptLength=DCa;ud.now=j0e;ud.telemetry=lyr;ud.telemetryExpProblem=OCa;ud.telemetryRaw=LCa;ud.telemetryException=Z_i;ud.telemetryCatch=FCa;ud.telemetryError=UCa;ud.logEngineCompletion=qCa;ud.logEnginePrompt=jCa;var vCa=Y5(),CCa=rn(),bCa=um(),iyr=Ls(),Tht=aee(),K5=EE(),SCa=Kpt(),TCa=JA(),ICa=Zpt(),xCa=IAr(),oyr=XAr(),syr=pMe(),ST;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(ST||(ud.TelemetryStore=ST={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(ST||(ud.TelemetryStore=ST={}));function q0e(t){return t===ST.Enhanced}a(q0e,"isEnhanced");var wCa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],hMe=8192,RCa=21,J5=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[xCa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},j0e())}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=j0e())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(TCa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(vCa.IEnvService),n=e.get(K5.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,K5.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,K5.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${K5.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,K5.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,K5.dumpForTelemetry)(e);r["copilot.build"]=K5.BuildInfo.getBuild(),r["copilot.buildType"]=K5.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(q0e(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>hMe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+hMe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(DCa,"telemetrizePromptLength");function j0e(){return performance.now()}a(j0e,"now");function NCa(t){return Math.floor(t/1e3)}a(NCa,"nowSeconds");function cyr(t){return t.get(oyr.ICompletionsTelemetryUserConfigService).optedIn}a(cyr,"shouldSendEnhanced");function K_i(t){return t.get(oyr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(K_i,"shouldSendFinetuningTelemetry");function lyr(t,e,r,n){return t.get(syr.ICompletionsPromiseQueueService).register(MCa(t,e,j0e(),r?.extendedBy(),n))}a(lyr,"telemetry");async function MCa(t,e,r,n,o=ST.Standard){let s=t.get(Tht.ICompletionsTelemetryService),c=t.get(iyr.IInstantiationService),l=n||J5.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!q0e(o)||c.invokeFunction(cyr))&&ayr(s,o,e,l),q0e(o)&&wCa.includes(e)&&c.invokeFunction(K_i)&&c.invokeFunction(kCa,o,e,l)}a(MCa,"_telemetry");function OCa(t,e){return t.get(syr.ICompletionsPromiseQueueService).register(BCa(t,e,j0e()))}a(OCa,"telemetryExpProblem");async function BCa(t,e,r){let n=t.get(Tht.ICompletionsTelemetryService),o="expProblem",s=J5.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,ST.Standard,"SkipExp",r),ayr(n,ST.Standard,o,s)}a(BCa,"_telemetryExpProblem");function LCa(t,e,r,n){let o=t.get(Tht.ICompletionsTelemetryService),s={...r,...J_i(t)};ayr(o,ST.Standard,e,{properties:s,measurements:n})}a(LCa,"telemetryRaw");function J_i(t){let e=t.get(K5.ICompletionsEditorAndPluginInfo),r={unique_id:(0,bCa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,K5.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(oyr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(J_i,"createRequiredProperties");function Z_i(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(Z_i,"telemetryException");function FCa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){Z_i(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(FCa,"telemetryCatch");function UCa(t,e,r,n){return t.get(syr.ICompletionsPromiseQueueService).register(QCa(t,e,j0e(),r?.extendedBy(),n))}a(UCa,"telemetryError");async function QCa(t,e,r,n,o=ST.Standard){if(q0e(o)&&!cyr(t))return;let s=t.get(iyr.IInstantiationService),c=n||J5.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(PCa,o,e,c)}a(QCa,"_telemetryError");function qCa(t,e,r,n,o){let s=J5.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),lyr(t,"engine.completion",s,ST.Enhanced)}a(qCa,"logEngineCompletion");function jCa(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 lyr(t,"engine.prompt",o,ST.Enhanced)}a(jCa,"logEnginePrompt");var ryr=class{static{a(this,"CopilotTelemetryReporter")}};ud.CopilotTelemetryReporter=ryr;ud.ICompletionsTelemetryReporters=(0,CCa.createServiceIdentifier)("ICompletionsTelemetryReporters");var nyr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=ST.Standard){return q0e(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(cyr(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()))}};ud.TelemetryReporters=nyr});var aee=I(R2=>{"use strict";p();var HCa=R2&&R2.__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},GCa=R2&&R2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(R2,"__esModule",{value:!0});R2.CompletionsTelemetryServiceBridge=R2.ICompletionsTelemetryService=void 0;var $Ca=o0(),uyr=AAr(),VCa=rn(),mMe=xg();R2.ICompletionsTelemetryService=(0,VCa.createServiceIdentifier)("completionsTelemetryService");var dyr=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,uyr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??mMe.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,uyr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??mMe.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,uyr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??mMe.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??mMe.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 mMe.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};R2.CompletionsTelemetryServiceBridge=dyr;R2.CompletionsTelemetryServiceBridge=dyr=HCa([GCa(0,$Ca.ITelemetryService)],dyr)});var X_i=I(H0e=>{"use strict";p();Object.defineProperty(H0e,"__esModule",{value:!0});H0e.CopilotExtensionStatus=H0e.ICompletionsExtensionStatus=void 0;var WCa=rn();H0e.ICompletionsExtensionStatus=(0,WCa.createServiceIdentifier)("ICompletionsExtensionStatus");var fyr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};H0e.CopilotExtensionStatus=fyr});var Iht=I(P2=>{"use strict";p();Object.defineProperty(P2,"__esModule",{value:!0});P2.CopilotToken=void 0;P2.containsInternalOrg=evi;P2.containsVSCodeOrg=nvi;P2.validateTokenEnvelope=ivi;P2.isTokenEnvelope=XCa;P2.isErrorEnvelope=eba;P2.isStandardErrorEnvelope=tba;P2.createTestExtendedTokenInfo=rba;var Fn=DH();function evi(t){return tvi(t)||rvi(t)}a(evi,"containsInternalOrg");function tvi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(tvi,"containsGitHubOrg");function rvi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(rvi,"containsMicrosoftOrg");function nvi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(nvi,"containsVSCodeOrg");var pyr=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 evi(this.organizationList)}get isMicrosoftInternal(){return rvi(this.organizationList)}get isGitHubInternal(){return tvi(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||nvi(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"}};P2.CopilotToken=pyr;var zCa=(0,Fn.vObj)({message:(0,Fn.vRequired)((0,Fn.vString)()),notification_id:(0,Fn.vRequired)((0,Fn.vString)()),title:(0,Fn.vRequired)((0,Fn.vString)()),url:(0,Fn.vRequired)((0,Fn.vString)())}),YCa=(0,Fn.vObj)({can_signup_for_limited:(0,Fn.vNullable)((0,Fn.vBoolean)()),error_details:(0,Fn.vRequired)(zCa),message:(0,Fn.vRequired)((0,Fn.vString)()),reason:(0,Fn.vString)()}),KCa=(0,Fn.vObj)({token:(0,Fn.vRequired)((0,Fn.vString)()),expires_at:(0,Fn.vRequired)((0,Fn.vNumber)()),refresh_in:(0,Fn.vRequired)((0,Fn.vNumber)()),sku:(0,Fn.vString)(),individual:(0,Fn.vBoolean)(),blackbird_clientside_indexing:(0,Fn.vBoolean)(),code_quote_enabled:(0,Fn.vBoolean)(),code_review_enabled:(0,Fn.vBoolean)(),codesearch:(0,Fn.vBoolean)(),copilotignore_enabled:(0,Fn.vBoolean)(),public_suggestions:(0,Fn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Fn.vEnum)("enabled","disabled"),endpoints:(0,Fn.vObj)({api:(0,Fn.vString)(),"origin-tracker":(0,Fn.vString)(),proxy:(0,Fn.vString)(),telemetry:(0,Fn.vString)()}),enterprise_list:(0,Fn.vNullable)((0,Fn.vArray)((0,Fn.vNumber)())),limited_user_quotas:(0,Fn.vNullable)((0,Fn.vObj)({chat:(0,Fn.vRequired)((0,Fn.vNumber)()),completions:(0,Fn.vRequired)((0,Fn.vNumber)())})),limited_user_reset_date:(0,Fn.vNullable)((0,Fn.vNumber)()),organization_list:(0,Fn.vArray)((0,Fn.vString)())}),JCa=(0,Fn.vObj)({message:(0,Fn.vRequired)((0,Fn.vString)()),documentation_url:(0,Fn.vRequired)((0,Fn.vString)()),status:(0,Fn.vRequired)((0,Fn.vString)())}),ZCa=(0,Fn.vObj)({token:(0,Fn.vRequired)((0,Fn.vString)()),expires_at:(0,Fn.vRequired)((0,Fn.vNumber)()),refresh_in:(0,Fn.vRequired)((0,Fn.vNumber)())});function ivi(t){let e=KCa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=ZCa.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(ivi,"validateTokenEnvelope");function XCa(t){return ivi(t).valid}a(XCa,"isTokenEnvelope");function eba(t){return YCa.validate(t).error===void 0}a(eba,"isErrorEnvelope");function tba(t){return JCa.validate(t).error===void 0}a(tba,"isStandardErrorEnvelope");function rba(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(rba,"createTestExtendedTokenInfo")});var G0e=I(TT=>{"use strict";p();var nba=TT&&TT.__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},iba=TT&&TT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TT,"__esModule",{value:!0});TT.CopilotTokenManagerImpl=TT.ICompletionsCopilotTokenManager=TT.CopilotToken=void 0;var oba=vE(),sba=rn(),aba=Jc(),cba=wo(),lba=Iht();Object.defineProperty(TT,"CopilotToken",{enumerable:!0,get:a(function(){return lba.CopilotToken},"get")});TT.ICompletionsCopilotTokenManager=(0,sba.createServiceIdentifier)("ICompletionsCopilotTokenManager");var hyr=class extends cba.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 aba.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidAuthenticationChange(()=>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}};TT.CopilotTokenManagerImpl=hyr;TT.CopilotTokenManagerImpl=hyr=nba([iba(1,oba.IAuthenticationService)],hyr)});var xht=I($0e=>{"use strict";p();Object.defineProperty($0e,"__esModule",{value:!0});$0e.NoOpCitationManager=$0e.ICompletionsCitationManager=void 0;var uba=rn(),dba=wo();$0e.ICompletionsCitationManager=(0,uba.createServiceIdentifier)("ICompletionsCitationManager");var myr=class{static{a(this,"NoOpCitationManager")}register(){return dba.Disposable.None}async handleIPCodeCitation(e){}};$0e.NoOpCitationManager=myr});var sv=I(Pg=>{"use strict";p();Object.defineProperty(Pg,"__esModule",{value:!0});Pg.HasPropertyKey=fba;Pg.IsAsyncIterator=pba;Pg.IsArray=gyr;Pg.IsBigInt=hba;Pg.IsBoolean=mba;Pg.IsDate=gba;Pg.IsFunction=Aba;Pg.IsIterator=yba;Pg.IsNull=Eba;Pg.IsNumber=_ba;Pg.IsObject=Ayr;Pg.IsRegExp=vba;Pg.IsString=Cba;Pg.IsSymbol=bba;Pg.IsUint8Array=yyr;Pg.IsUndefined=Sba;function fba(t,e){return e in t}a(fba,"HasPropertyKey");function pba(t){return Ayr(t)&&!gyr(t)&&!yyr(t)&&Symbol.asyncIterator in t}a(pba,"IsAsyncIterator");function gyr(t){return Array.isArray(t)}a(gyr,"IsArray");function hba(t){return typeof t=="bigint"}a(hba,"IsBigInt");function mba(t){return typeof t=="boolean"}a(mba,"IsBoolean");function gba(t){return t instanceof globalThis.Date}a(gba,"IsDate");function Aba(t){return typeof t=="function"}a(Aba,"IsFunction");function yba(t){return Ayr(t)&&!gyr(t)&&!yyr(t)&&Symbol.iterator in t}a(yba,"IsIterator");function Eba(t){return t===null}a(Eba,"IsNull");function _ba(t){return typeof t=="number"}a(_ba,"IsNumber");function Ayr(t){return typeof t=="object"&&t!==null}a(Ayr,"IsObject");function vba(t){return t instanceof globalThis.RegExp}a(vba,"IsRegExp");function Cba(t){return typeof t=="string"}a(Cba,"IsString");function bba(t){return typeof t=="symbol"}a(bba,"IsSymbol");function yyr(t){return t instanceof globalThis.Uint8Array}a(yyr,"IsUint8Array");function Sba(t){return t===void 0}a(Sba,"IsUndefined")});var Rb=I(o8=>{"use strict";p();var Tba=o8&&o8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=o8&&o8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xba=o8&&o8.__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;owht(e))}a(wba,"ArrayType");function Rba(t){return new Date(t.getTime())}a(Rba,"DateType");function Pba(t){return new Uint8Array(t)}a(Pba,"Uint8ArrayType");function kba(t){return new RegExp(t.source,t.flags)}a(kba,"RegExpType");function Dba(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=wht(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=wht(t[r]);return e}a(Dba,"ObjectType");function wht(t){return gMe.IsArray(t)?wba(t):gMe.IsDate(t)?Rba(t):gMe.IsUint8Array(t)?Pba(t):gMe.IsRegExp(t)?kba(t):gMe.IsObject(t)?Dba(t):t}a(wht,"Visit");function Nba(t){return wht(t)}a(Nba,"Clone")});var Pht=I(Rht=>{"use strict";p();Object.defineProperty(Rht,"__esModule",{value:!0});Rht.CloneRest=Mba;Rht.CloneType=svi;var ovi=Rb();function Mba(t){return t.map(e=>svi(e))}a(Mba,"CloneRest");function svi(t,e){return e===void 0?(0,ovi.Clone)(t):(0,ovi.Clone)({...e,...t})}a(svi,"CloneType")});var Eyr=I(LH=>{"use strict";p();var Oba=LH&&LH.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),avi=LH&&LH.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Oba(e,t,r)};Object.defineProperty(LH,"__esModule",{value:!0});avi(Pht(),LH);avi(Rb(),LH)});var kht=I(pa=>{"use strict";p();Object.defineProperty(pa,"__esModule",{value:!0});pa.IsAsyncIterator=Bba;pa.IsIterator=Lba;pa.IsStandardObject=Fba;pa.IsInstanceObject=Uba;pa.IsPromise=Qba;pa.IsDate=qba;pa.IsMap=jba;pa.IsSet=Hba;pa.IsRegExp=Gba;pa.IsTypedArray=$ba;pa.IsInt8Array=Vba;pa.IsUint8Array=Wba;pa.IsUint8ClampedArray=zba;pa.IsInt16Array=Yba;pa.IsUint16Array=Kba;pa.IsInt32Array=Jba;pa.IsUint32Array=Zba;pa.IsFloat32Array=Xba;pa.IsFloat64Array=e1a;pa.IsBigInt64Array=t1a;pa.IsBigUint64Array=r1a;pa.HasPropertyKey=n1a;pa.IsObject=AMe;pa.IsArray=cvi;pa.IsUndefined=lvi;pa.IsNull=uvi;pa.IsBoolean=dvi;pa.IsNumber=fvi;pa.IsInteger=i1a;pa.IsBigInt=pvi;pa.IsString=hvi;pa.IsFunction=mvi;pa.IsSymbol=gvi;pa.IsValueType=o1a;function Bba(t){return AMe(t)&&globalThis.Symbol.asyncIterator in t}a(Bba,"IsAsyncIterator");function Lba(t){return AMe(t)&&globalThis.Symbol.iterator in t}a(Lba,"IsIterator");function Fba(t){return AMe(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(Fba,"IsStandardObject");function Uba(t){return AMe(t)&&!cvi(t)&&mvi(t.constructor)&&t.constructor.name!=="Object"}a(Uba,"IsInstanceObject");function Qba(t){return t instanceof globalThis.Promise}a(Qba,"IsPromise");function qba(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(qba,"IsDate");function jba(t){return t instanceof globalThis.Map}a(jba,"IsMap");function Hba(t){return t instanceof globalThis.Set}a(Hba,"IsSet");function Gba(t){return t instanceof globalThis.RegExp}a(Gba,"IsRegExp");function $ba(t){return globalThis.ArrayBuffer.isView(t)}a($ba,"IsTypedArray");function Vba(t){return t instanceof globalThis.Int8Array}a(Vba,"IsInt8Array");function Wba(t){return t instanceof globalThis.Uint8Array}a(Wba,"IsUint8Array");function zba(t){return t instanceof globalThis.Uint8ClampedArray}a(zba,"IsUint8ClampedArray");function Yba(t){return t instanceof globalThis.Int16Array}a(Yba,"IsInt16Array");function Kba(t){return t instanceof globalThis.Uint16Array}a(Kba,"IsUint16Array");function Jba(t){return t instanceof globalThis.Int32Array}a(Jba,"IsInt32Array");function Zba(t){return t instanceof globalThis.Uint32Array}a(Zba,"IsUint32Array");function Xba(t){return t instanceof globalThis.Float32Array}a(Xba,"IsFloat32Array");function e1a(t){return t instanceof globalThis.Float64Array}a(e1a,"IsFloat64Array");function t1a(t){return t instanceof globalThis.BigInt64Array}a(t1a,"IsBigInt64Array");function r1a(t){return t instanceof globalThis.BigUint64Array}a(r1a,"IsBigUint64Array");function n1a(t,e){return e in t}a(n1a,"HasPropertyKey");function AMe(t){return t!==null&&typeof t=="object"}a(AMe,"IsObject");function cvi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(cvi,"IsArray");function lvi(t){return t===void 0}a(lvi,"IsUndefined");function uvi(t){return t===null}a(uvi,"IsNull");function dvi(t){return typeof t=="boolean"}a(dvi,"IsBoolean");function fvi(t){return typeof t=="number"}a(fvi,"IsNumber");function i1a(t){return globalThis.Number.isInteger(t)}a(i1a,"IsInteger");function pvi(t){return typeof t=="bigint"}a(pvi,"IsBigInt");function hvi(t){return typeof t=="string"}a(hvi,"IsString");function mvi(t){return typeof t=="function"}a(mvi,"IsFunction");function gvi(t){return typeof t=="symbol"}a(gvi,"IsSymbol");function o1a(t){return pvi(t)||dvi(t)||uvi(t)||fvi(t)||hvi(t)||gvi(t)||lvi(t)}a(o1a,"IsValueType")});var pm=I(cee=>{"use strict";p();var s1a=cee&&cee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),a1a=cee&&cee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s1a(e,t,r)};Object.defineProperty(cee,"__esModule",{value:!0});a1a(kht(),cee)});var yMe=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.TypeSystemPolicy=void 0;var Dht=pm(),Avi;(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,Dht.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,Dht.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,Dht.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,Dht.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(Avi||(Nht.TypeSystemPolicy=Avi={}))});var yvi=I(s8=>{"use strict";p();var c1a=s8&&s8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l1a=s8&&s8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u1a=s8&&s8.__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;oMht(e))}a(d1a,"ImmutableArray");function f1a(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Mht(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Mht(t[r]);return globalThis.Object.freeze(e)}a(f1a,"ImmutableObject");function Mht(t){return EMe.IsArray(t)?d1a(t):EMe.IsDate(t)?t:EMe.IsUint8Array(t)?t:EMe.IsRegExp(t)?t:EMe.IsObject(t)?f1a(t):t}a(Mht,"Immutable")});var Si=I(_yr=>{"use strict";p();Object.defineProperty(_yr,"__esModule",{value:!0});_yr.CreateType=g1a;var p1a=yMe(),h1a=yvi(),m1a=Rb();function g1a(t,e){let r=e!==void 0?{...e,...t}:t;switch(p1a.TypeSystemPolicy.InstanceMode){case"freeze":return(0,h1a.Immutable)(r);case"clone":return(0,m1a.Clone)(r);default:return r}}a(g1a,"CreateType")});var a8=I(lee=>{"use strict";p();var A1a=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]})),y1a=lee&&lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A1a(e,t,r)};Object.defineProperty(lee,"__esModule",{value:!0});y1a(Si(),lee)});var Cyr=I(Oht=>{"use strict";p();Object.defineProperty(Oht,"__esModule",{value:!0});Oht.TypeBoxError=void 0;var vyr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};Oht.TypeBoxError=vyr});var bf=I(uee=>{"use strict";p();var E1a=uee&&uee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_1a=uee&&uee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E1a(e,t,r)};Object.defineProperty(uee,"__esModule",{value:!0});_1a(Cyr(),uee)});var _Me=I(Kw=>{"use strict";p();Object.defineProperty(Kw,"__esModule",{value:!0});Kw.Kind=Kw.Hint=Kw.OptionalKind=Kw.ReadonlyKind=Kw.TransformKind=void 0;Kw.TransformKind=Symbol.for("TypeBox.Transform");Kw.ReadonlyKind=Symbol.for("TypeBox.Readonly");Kw.OptionalKind=Symbol.for("TypeBox.Optional");Kw.Hint=Symbol.for("TypeBox.Hint");Kw.Kind=Symbol.for("TypeBox.Kind")});var _n=I(dee=>{"use strict";p();var v1a=dee&&dee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C1a=dee&&dee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v1a(e,t,r)};Object.defineProperty(dee,"__esModule",{value:!0});C1a(_Me(),dee)});var hs=I(li=>{"use strict";p();var b1a=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]})),S1a=li&&li.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T1a=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 L1a=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]})),F1a=Yn&&Yn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U1a=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(Syr,"IsControlCharacterFree");function rCi(t){return Tyr(t)||kg(t)}a(rCi,"IsAdditionalProperties");function CMe(t){return oi.IsUndefined(t)||oi.IsBigInt(t)}a(CMe,"IsOptionalBigInt");function Gl(t){return oi.IsUndefined(t)||oi.IsNumber(t)}a(Gl,"IsOptionalNumber");function Tyr(t){return oi.IsUndefined(t)||oi.IsBoolean(t)}a(Tyr,"IsOptionalBoolean");function al(t){return oi.IsUndefined(t)||oi.IsString(t)}a(al,"IsOptionalString");function j1a(t){return oi.IsUndefined(t)||oi.IsString(t)&&Syr(t)&&tCi(t)}a(j1a,"IsOptionalPattern");function H1a(t){return oi.IsUndefined(t)||oi.IsString(t)&&Syr(t)}a(H1a,"IsOptionalFormat");function nCi(t){return oi.IsUndefined(t)||kg(t)}a(nCi,"IsOptionalSchema");function G1a(t){return oi.IsObject(t)&&t[Z5.ReadonlyKind]==="Readonly"}a(G1a,"IsReadonly");function $1a(t){return oi.IsObject(t)&&t[Z5.OptionalKind]==="Optional"}a($1a,"IsOptional");function iCi(t){return Us(t,"Any")&&al(t.$id)}a(iCi,"IsAny");function oCi(t){return Us(t,"Argument")&&oi.IsNumber(t.index)}a(oCi,"IsArgument");function sCi(t){return Us(t,"Array")&&t.type==="array"&&al(t.$id)&&kg(t.items)&&Gl(t.minItems)&&Gl(t.maxItems)&&Tyr(t.uniqueItems)&&nCi(t.contains)&&Gl(t.minContains)&&Gl(t.maxContains)}a(sCi,"IsArray");function aCi(t){return Us(t,"AsyncIterator")&&t.type==="AsyncIterator"&&al(t.$id)&&kg(t.items)}a(aCi,"IsAsyncIterator");function cCi(t){return Us(t,"BigInt")&&t.type==="bigint"&&al(t.$id)&&CMe(t.exclusiveMaximum)&&CMe(t.exclusiveMinimum)&&CMe(t.maximum)&&CMe(t.minimum)&&CMe(t.multipleOf)}a(cCi,"IsBigInt");function lCi(t){return Us(t,"Boolean")&&t.type==="boolean"&&al(t.$id)}a(lCi,"IsBoolean");function uCi(t){return Us(t,"Computed")&&oi.IsString(t.target)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>kg(e))}a(uCi,"IsComputed");function dCi(t){return Us(t,"Constructor")&&t.type==="Constructor"&&al(t.$id)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>kg(e))&&kg(t.returns)}a(dCi,"IsConstructor");function fCi(t){return Us(t,"Date")&&t.type==="Date"&&al(t.$id)&&Gl(t.exclusiveMaximumTimestamp)&&Gl(t.exclusiveMinimumTimestamp)&&Gl(t.maximumTimestamp)&&Gl(t.minimumTimestamp)&&Gl(t.multipleOfTimestamp)}a(fCi,"IsDate");function pCi(t){return Us(t,"Function")&&t.type==="Function"&&al(t.$id)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>kg(e))&&kg(t.returns)}a(pCi,"IsFunction");function V1a(t){return Us(t,"Import")&&oi.HasPropertyKey(t,"$defs")&&oi.IsObject(t.$defs)&&Bht(t.$defs)&&oi.HasPropertyKey(t,"$ref")&&oi.IsString(t.$ref)&&t.$ref in t.$defs}a(V1a,"IsImport");function hCi(t){return Us(t,"Integer")&&t.type==="integer"&&al(t.$id)&&Gl(t.exclusiveMaximum)&&Gl(t.exclusiveMinimum)&&Gl(t.maximum)&&Gl(t.minimum)&&Gl(t.multipleOf)}a(hCi,"IsInteger");function Bht(t){return oi.IsObject(t)&&Object.entries(t).every(([e,r])=>Syr(e)&&kg(r))}a(Bht,"IsProperties");function mCi(t){return Us(t,"Intersect")&&!(oi.IsString(t.type)&&t.type!=="object")&&oi.IsArray(t.allOf)&&t.allOf.every(e=>kg(e)&&!OCi(e))&&al(t.type)&&(Tyr(t.unevaluatedProperties)||nCi(t.unevaluatedProperties))&&al(t.$id)}a(mCi,"IsIntersect");function gCi(t){return Us(t,"Iterator")&&t.type==="Iterator"&&al(t.$id)&&kg(t.items)}a(gCi,"IsIterator");function Us(t,e){return oi.IsObject(t)&&Z5.Kind in t&&t[Z5.Kind]===e}a(Us,"IsKindOf");function ACi(t){return bMe(t)&&oi.IsString(t.const)}a(ACi,"IsLiteralString");function yCi(t){return bMe(t)&&oi.IsNumber(t.const)}a(yCi,"IsLiteralNumber");function W1a(t){return bMe(t)&&oi.IsBoolean(t.const)}a(W1a,"IsLiteralBoolean");function bMe(t){return Us(t,"Literal")&&al(t.$id)&&ECi(t.const)}a(bMe,"IsLiteral");function ECi(t){return oi.IsBoolean(t)||oi.IsNumber(t)||oi.IsString(t)}a(ECi,"IsLiteralValue");function _Ci(t){return Us(t,"MappedKey")&&oi.IsArray(t.keys)&&t.keys.every(e=>oi.IsNumber(e)||oi.IsString(e))}a(_Ci,"IsMappedKey");function vCi(t){return Us(t,"MappedResult")&&Bht(t.properties)}a(vCi,"IsMappedResult");function CCi(t){return Us(t,"Never")&&oi.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(CCi,"IsNever");function bCi(t){return Us(t,"Not")&&kg(t.not)}a(bCi,"IsNot");function SCi(t){return Us(t,"Null")&&t.type==="null"&&al(t.$id)}a(SCi,"IsNull");function TCi(t){return Us(t,"Number")&&t.type==="number"&&al(t.$id)&&Gl(t.exclusiveMaximum)&&Gl(t.exclusiveMinimum)&&Gl(t.maximum)&&Gl(t.minimum)&&Gl(t.multipleOf)}a(TCi,"IsNumber");function ICi(t){return Us(t,"Object")&&t.type==="object"&&al(t.$id)&&Bht(t.properties)&&rCi(t.additionalProperties)&&Gl(t.minProperties)&&Gl(t.maxProperties)}a(ICi,"IsObject");function xCi(t){return Us(t,"Promise")&&t.type==="Promise"&&al(t.$id)&&kg(t.item)}a(xCi,"IsPromise");function wCi(t){return Us(t,"Record")&&t.type==="object"&&al(t.$id)&&rCi(t.additionalProperties)&&oi.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&tCi(r[0])&&oi.IsObject(e.patternProperties)&&kg(e.patternProperties[r[0]])})(t)}a(wCi,"IsRecord");function z1a(t){return oi.IsObject(t)&&Z5.Hint in t&&t[Z5.Hint]==="Recursive"}a(z1a,"IsRecursive");function RCi(t){return Us(t,"Ref")&&al(t.$id)&&oi.IsString(t.$ref)}a(RCi,"IsRef");function PCi(t){return Us(t,"RegExp")&&al(t.$id)&&oi.IsString(t.source)&&oi.IsString(t.flags)&&Gl(t.maxLength)&&Gl(t.minLength)}a(PCi,"IsRegExp");function kCi(t){return Us(t,"String")&&t.type==="string"&&al(t.$id)&&Gl(t.minLength)&&Gl(t.maxLength)&&j1a(t.pattern)&&H1a(t.format)}a(kCi,"IsString");function DCi(t){return Us(t,"Symbol")&&t.type==="symbol"&&al(t.$id)}a(DCi,"IsSymbol");function NCi(t){return Us(t,"TemplateLiteral")&&t.type==="string"&&oi.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(NCi,"IsTemplateLiteral");function MCi(t){return Us(t,"This")&&al(t.$id)&&oi.IsString(t.$ref)}a(MCi,"IsThis");function OCi(t){return oi.IsObject(t)&&Z5.TransformKind in t}a(OCi,"IsTransform");function BCi(t){return Us(t,"Tuple")&&t.type==="array"&&al(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=>kg(e)))}a(BCi,"IsTuple");function LCi(t){return Us(t,"Undefined")&&t.type==="undefined"&&al(t.$id)}a(LCi,"IsUndefined");function Y1a(t){return Iyr(t)&&t.anyOf.every(e=>ACi(e)||yCi(e))}a(Y1a,"IsUnionLiteral");function Iyr(t){return Us(t,"Union")&&al(t.$id)&&oi.IsObject(t)&&oi.IsArray(t.anyOf)&&t.anyOf.every(e=>kg(e))}a(Iyr,"IsUnion");function FCi(t){return Us(t,"Uint8Array")&&t.type==="Uint8Array"&&al(t.$id)&&Gl(t.minByteLength)&&Gl(t.maxByteLength)}a(FCi,"IsUint8Array");function UCi(t){return Us(t,"Unknown")&&al(t.$id)}a(UCi,"IsUnknown");function QCi(t){return Us(t,"Unsafe")}a(QCi,"IsUnsafe");function qCi(t){return Us(t,"Void")&&t.type==="void"&&al(t.$id)}a(qCi,"IsVoid");function jCi(t){return oi.IsObject(t)&&Z5.Kind in t&&oi.IsString(t[Z5.Kind])&&!q1a.includes(t[Z5.Kind])}a(jCi,"IsKind");function kg(t){return oi.IsObject(t)&&(iCi(t)||oCi(t)||sCi(t)||lCi(t)||cCi(t)||aCi(t)||uCi(t)||dCi(t)||fCi(t)||pCi(t)||hCi(t)||mCi(t)||gCi(t)||bMe(t)||_Ci(t)||vCi(t)||CCi(t)||bCi(t)||SCi(t)||TCi(t)||ICi(t)||xCi(t)||wCi(t)||RCi(t)||PCi(t)||kCi(t)||DCi(t)||NCi(t)||MCi(t)||BCi(t)||LCi(t)||Iyr(t)||FCi(t)||UCi(t)||QCi(t)||qCi(t)||jCi(t))}a(kg,"IsSchema")});var wyr=I(kb=>{"use strict";p();var K1a=kb&&kb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J1a=kb&&kb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xyr=kb&&kb.__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(Ryr,"__esModule",{value:!0});Ryr.Increment=Z1a;function Z1a(t){return(parseInt(t)+1).toString()}a(Z1a,"Increment")});var $Ci=I(fee=>{"use strict";p();var X1a=fee&&fee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eSa=fee&&fee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X1a(e,t,r)};Object.defineProperty(fee,"__esModule",{value:!0});eSa(GCi(),fee)});var VCi=I(mp=>{"use strict";p();Object.defineProperty(mp,"__esModule",{value:!0});mp.PatternNeverExact=mp.PatternStringExact=mp.PatternNumberExact=mp.PatternBooleanExact=mp.PatternNever=mp.PatternString=mp.PatternNumber=mp.PatternBoolean=void 0;mp.PatternBoolean="(true|false)";mp.PatternNumber="(0|[1-9][0-9]*)";mp.PatternString="(.*)";mp.PatternNever="(?!.*)";mp.PatternBooleanExact=`^${mp.PatternBoolean}$`;mp.PatternNumberExact=`^${mp.PatternNumber}$`;mp.PatternStringExact=`^${mp.PatternString}$`;mp.PatternNeverExact=`^${mp.PatternNever}$`});var SMe=I(pee=>{"use strict";p();var tSa=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]})),rSa=pee&&pee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tSa(e,t,r)};Object.defineProperty(pee,"__esModule",{value:!0});rSa(VCi(),pee)});var WCi=I(FH=>{"use strict";p();Object.defineProperty(FH,"__esModule",{value:!0});FH.Entries=nSa;FH.Clear=iSa;FH.Delete=oSa;FH.Has=sSa;FH.Set=aSa;FH.Get=cSa;var V0e=new Map;function nSa(){return new Map(V0e)}a(nSa,"Entries");function iSa(){return V0e.clear()}a(iSa,"Clear");function oSa(t){return V0e.delete(t)}a(oSa,"Delete");function sSa(t){return V0e.has(t)}a(sSa,"Has");function aSa(t,e){V0e.set(t,e)}a(aSa,"Set");function cSa(t){return V0e.get(t)}a(cSa,"Get")});var zCi=I(UH=>{"use strict";p();Object.defineProperty(UH,"__esModule",{value:!0});UH.Entries=lSa;UH.Clear=uSa;UH.Delete=dSa;UH.Has=fSa;UH.Set=pSa;UH.Get=hSa;var W0e=new Map;function lSa(){return new Map(W0e)}a(lSa,"Entries");function uSa(){return W0e.clear()}a(uSa,"Clear");function dSa(t){return W0e.delete(t)}a(dSa,"Delete");function fSa(t){return W0e.has(t)}a(fSa,"Has");function pSa(t,e){W0e.set(t,e)}a(pSa,"Set");function hSa(t){return W0e.get(t)}a(hSa,"Get")});var z0e=I(Jw=>{"use strict";p();var mSa=Jw&&Jw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gSa=Jw&&Jw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),YCi=Jw&&Jw.__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(X5,"__esModule",{value:!0});X5.SetIncludes=KCi;X5.SetIsSubset=ASa;X5.SetDistinct=ySa;X5.SetIntersect=JCi;X5.SetUnion=ESa;X5.SetComplement=_Sa;X5.SetIntersectMany=CSa;X5.SetUnionMany=bSa;function KCi(t,e){return t.includes(e)}a(KCi,"SetIncludes");function ASa(t,e){return t.every(r=>KCi(e,r))}a(ASa,"SetIsSubset");function ySa(t){return[...new Set(t)]}a(ySa,"SetDistinct");function JCi(t,e){return t.filter(r=>e.includes(r))}a(JCi,"SetIntersect");function ESa(t,e){return[...t,...e]}a(ESa,"SetUnion");function _Sa(t,e){return t.filter(r=>!e.includes(r))}a(_Sa,"SetComplement");function vSa(t,e){return t.reduce((r,n)=>JCi(r,n),e)}a(vSa,"SetIntersectManyResolve");function CSa(t){return t.length===1?t[0]:t.length>1?vSa(t.slice(1),t[0]):[]}a(CSa,"SetIntersectMany");function bSa(t){let e=[];for(let r of t)e.push(...r);return e}a(bSa,"SetUnionMany")});var TMe=I(hee=>{"use strict";p();var SSa=hee&&hee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TSa=hee&&hee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SSa(e,t,r)};Object.defineProperty(hee,"__esModule",{value:!0});TSa(ZCi(),hee)});var XCi=I(Pyr=>{"use strict";p();Object.defineProperty(Pyr,"__esModule",{value:!0});Pyr.Any=wSa;var ISa=a8(),xSa=_n();function wSa(t){return(0,ISa.CreateType)({[xSa.Kind]:"Any"},t)}a(wSa,"Any")});var Y0e=I(mee=>{"use strict";p();var RSa=mee&&mee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PSa=mee&&mee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RSa(e,t,r)};Object.defineProperty(mee,"__esModule",{value:!0});PSa(XCi(),mee)});var ebi=I(kyr=>{"use strict";p();Object.defineProperty(kyr,"__esModule",{value:!0});kyr.Array=NSa;var kSa=Si(),DSa=_n();function NSa(t,e){return(0,kSa.CreateType)({[DSa.Kind]:"Array",type:"array",items:t},e)}a(NSa,"Array")});var K0e=I(gee=>{"use strict";p();var MSa=gee&&gee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OSa=gee&&gee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MSa(e,t,r)};Object.defineProperty(gee,"__esModule",{value:!0});OSa(ebi(),gee)});var tbi=I(Dyr=>{"use strict";p();Object.defineProperty(Dyr,"__esModule",{value:!0});Dyr.Argument=FSa;var BSa=Si(),LSa=_n();function FSa(t){return(0,BSa.CreateType)({[LSa.Kind]:"Argument",index:t})}a(FSa,"Argument")});var Lht=I(Aee=>{"use strict";p();var USa=Aee&&Aee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QSa=Aee&&Aee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&USa(e,t,r)};Object.defineProperty(Aee,"__esModule",{value:!0});QSa(tbi(),Aee)});var rbi=I(Nyr=>{"use strict";p();Object.defineProperty(Nyr,"__esModule",{value:!0});Nyr.AsyncIterator=HSa;var qSa=_n(),jSa=Si();function HSa(t,e){return(0,jSa.CreateType)({[qSa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(HSa,"AsyncIterator")});var J0e=I(yee=>{"use strict";p();var GSa=yee&&yee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Sa=yee&&yee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GSa(e,t,r)};Object.defineProperty(yee,"__esModule",{value:!0});$Sa(rbi(),yee)});var nbi=I(Myr=>{"use strict";p();Object.defineProperty(Myr,"__esModule",{value:!0});Myr.Computed=zSa;var VSa=a8(),WSa=_Me();function zSa(t,e,r){return(0,VSa.CreateType)({[WSa.Kind]:"Computed",target:t,parameters:e},r)}a(zSa,"Computed")});var QH=I(Eee=>{"use strict";p();var YSa=Eee&&Eee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KSa=Eee&&Eee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YSa(e,t,r)};Object.defineProperty(Eee,"__esModule",{value:!0});KSa(nbi(),Eee)});var Fht=I(Oyr=>{"use strict";p();Object.defineProperty(Oyr,"__esModule",{value:!0});Oyr.Discard=ZSa;function JSa(t,e){let{[e]:r,...n}=t;return n}a(JSa,"DiscardKey");function ZSa(t,e){return e.reduce((r,n)=>JSa(r,n),t)}a(ZSa,"Discard")});var l8=I(_ee=>{"use strict";p();var XSa=_ee&&_ee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eTa=_ee&&_ee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XSa(e,t,r)};Object.defineProperty(_ee,"__esModule",{value:!0});eTa(Fht(),_ee)});var ibi=I(Byr=>{"use strict";p();Object.defineProperty(Byr,"__esModule",{value:!0});Byr.Never=nTa;var tTa=Si(),rTa=_n();function nTa(t){return(0,tTa.CreateType)({[rTa.Kind]:"Never",not:{}},t)}a(nTa,"Never")});var d0=I(vee=>{"use strict";p();var iTa=vee&&vee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oTa=vee&&vee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iTa(e,t,r)};Object.defineProperty(vee,"__esModule",{value:!0});oTa(ibi(),vee)});var obi=I(Lyr=>{"use strict";p();Object.defineProperty(Lyr,"__esModule",{value:!0});Lyr.MappedKey=cTa;var sTa=Si(),aTa=_n();function cTa(t){return(0,sTa.CreateType)({[aTa.Kind]:"MappedKey",keys:t})}a(cTa,"MappedKey")});var Uyr=I(Fyr=>{"use strict";p();Object.defineProperty(Fyr,"__esModule",{value:!0});Fyr.MappedResult=dTa;var lTa=Si(),uTa=_n();function dTa(t){return(0,lTa.CreateType)({[uTa.Kind]:"MappedResult",properties:t})}a(dTa,"MappedResult")});var sbi=I(Qyr=>{"use strict";p();Object.defineProperty(Qyr,"__esModule",{value:!0});Qyr.Constructor=hTa;var fTa=Si(),pTa=_n();function hTa(t,e,r){return(0,fTa.CreateType)({[pTa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(hTa,"Constructor")});var Z0e=I(Cee=>{"use strict";p();var mTa=Cee&&Cee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gTa=Cee&&Cee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mTa(e,t,r)};Object.defineProperty(Cee,"__esModule",{value:!0});gTa(sbi(),Cee)});var abi=I(qyr=>{"use strict";p();Object.defineProperty(qyr,"__esModule",{value:!0});qyr.Function=ETa;var ATa=Si(),yTa=_n();function ETa(t,e,r){return(0,ATa.CreateType)({[yTa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(ETa,"Function")});var qH=I(bee=>{"use strict";p();var _Ta=bee&&bee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vTa=bee&&bee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ta(e,t,r)};Object.defineProperty(bee,"__esModule",{value:!0});vTa(abi(),bee)});var Hyr=I(jyr=>{"use strict";p();Object.defineProperty(jyr,"__esModule",{value:!0});jyr.UnionCreate=STa;var CTa=Si(),bTa=_n();function STa(t,e){return(0,CTa.CreateType)({[bTa.Kind]:"Union",anyOf:t},e)}a(STa,"UnionCreate")});var dbi=I(Gyr=>{"use strict";p();Object.defineProperty(Gyr,"__esModule",{value:!0});Gyr.UnionEvaluated=NTa;var TTa=Si(),ITa=_n(),xTa=l8(),wTa=d0(),RTa=e4(),cbi=Hyr(),ubi=hs();function PTa(t){return t.some(e=>(0,ubi.IsOptional)(e))}a(PTa,"IsUnionOptional");function lbi(t){return t.map(e=>(0,ubi.IsOptional)(e)?kTa(e):e)}a(lbi,"RemoveOptionalFromRest");function kTa(t){return(0,xTa.Discard)(t,[ITa.OptionalKind])}a(kTa,"RemoveOptionalFromType");function DTa(t,e){return PTa(t)?(0,RTa.Optional)((0,cbi.UnionCreate)(lbi(t),e)):(0,cbi.UnionCreate)(lbi(t),e)}a(DTa,"ResolveUnion");function NTa(t,e){return t.length===1?(0,TTa.CreateType)(t[0],e):t.length===0?(0,wTa.Never)(e):DTa(t,e)}a(NTa,"UnionEvaluated")});var pbi=I(fbi=>{"use strict";p();Object.defineProperty(fbi,"__esModule",{value:!0});var bcp=_n()});var hbi=I($yr=>{"use strict";p();Object.defineProperty($yr,"__esModule",{value:!0});$yr.Union=LTa;var MTa=d0(),OTa=Si(),BTa=Hyr();function LTa(t,e){return t.length===0?(0,MTa.Never)(e):t.length===1?(0,OTa.CreateType)(t[0],e):(0,BTa.UnionCreate)(t,e)}a(LTa,"Union")});var gp=I(u8=>{"use strict";p();var FTa=u8&&u8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vyr=u8&&u8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FTa(e,t,r)};Object.defineProperty(u8,"__esModule",{value:!0});Vyr(dbi(),u8);Vyr(pbi(),u8);Vyr(hbi(),u8)});var Uht=I(X0e=>{"use strict";p();Object.defineProperty(X0e,"__esModule",{value:!0});X0e.TemplateLiteralParserError=void 0;X0e.TemplateLiteralParse=See;X0e.TemplateLiteralParseExact=WTa;var UTa=bf(),IMe=class extends UTa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};X0e.TemplateLiteralParserError=IMe;function QTa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(QTa,"Unescape");function Wyr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(Wyr,"IsNonEscaped");function d8(t,e){return Wyr(t,e,"(")}a(d8,"IsOpenParen");function xMe(t,e){return Wyr(t,e,")")}a(xMe,"IsCloseParen");function mbi(t,e){return Wyr(t,e,"|")}a(mbi,"IsSeparator");function qTa(t){if(!(d8(t,0)&&xMe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(See(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(See(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a($Ta,"Or");function VTa(t){function e(o,s){if(!d8(o,s))throw new IMe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(See(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(VTa,"And");function See(t){return qTa(t)?See(jTa(t)):HTa(t)?$Ta(t):GTa(t)?VTa(t):{type:"const",const:QTa(t)}}a(See,"TemplateLiteralParse");function WTa(t){return See(t.slice(1,t.length-1))}a(WTa,"TemplateLiteralParseExact")});var zyr=I(eme=>{"use strict";p();Object.defineProperty(eme,"__esModule",{value:!0});eme.TemplateLiteralFiniteError=void 0;eme.IsTemplateLiteralExpressionFinite=qht;eme.IsTemplateLiteralFinite=XTa;var zTa=Uht(),YTa=bf(),Qht=class extends YTa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};eme.TemplateLiteralFiniteError=Qht;function KTa(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(KTa,"IsNumberExpression");function JTa(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(JTa,"IsBooleanExpression");function ZTa(t){return t.type==="const"&&t.const===".*"}a(ZTa,"IsStringExpression");function qht(t){return KTa(t)||ZTa(t)?!1:JTa(t)?!0:t.type==="and"?t.expr.every(e=>qht(e)):t.type==="or"?t.expr.every(e=>qht(e)):t.type==="const"?!0:(()=>{throw new Qht("Unknown expression type")})()}a(qht,"IsTemplateLiteralExpressionFinite");function XTa(t){let e=(0,zTa.TemplateLiteralParseExact)(t.pattern);return qht(e)}a(XTa,"IsTemplateLiteralFinite")});var Yyr=I(tme=>{"use strict";p();Object.defineProperty(tme,"__esModule",{value:!0});tme.TemplateLiteralGenerateError=void 0;tme.TemplateLiteralExpressionGenerate=Hht;tme.TemplateLiteralGenerate=sIa;var eIa=zyr(),tIa=Uht(),rIa=bf(),jht=class extends rIa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};tme.TemplateLiteralGenerateError=jht;function*gbi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of gbi(t.slice(1)))yield`${e}${r}`}a(gbi,"GenerateReduce");function*nIa(t){return yield*gbi(t.expr.map(e=>[...Hht(e)]))}a(nIa,"GenerateAnd");function*iIa(t){for(let e of t.expr)yield*Hht(e)}a(iIa,"GenerateOr");function*oIa(t){return yield t.const}a(oIa,"GenerateConst");function*Hht(t){return t.type==="and"?yield*nIa(t):t.type==="or"?yield*iIa(t):t.type==="const"?yield*oIa(t):(()=>{throw new jht("Unknown expression")})()}a(Hht,"TemplateLiteralExpressionGenerate");function sIa(t){let e=(0,tIa.TemplateLiteralParseExact)(t.pattern);return(0,eIa.IsTemplateLiteralExpressionFinite)(e)?[...Hht(e)]:[]}a(sIa,"TemplateLiteralGenerate")});var Abi=I(Kyr=>{"use strict";p();Object.defineProperty(Kyr,"__esModule",{value:!0});Kyr.Literal=lIa;var aIa=Si(),cIa=_n();function lIa(t,e){return(0,aIa.CreateType)({[cIa.Kind]:"Literal",const:t,type:typeof t},e)}a(lIa,"Literal")});var CE=I(Tee=>{"use strict";p();var uIa=Tee&&Tee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dIa=Tee&&Tee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uIa(e,t,r)};Object.defineProperty(Tee,"__esModule",{value:!0});dIa(Abi(),Tee)});var ybi=I(Jyr=>{"use strict";p();Object.defineProperty(Jyr,"__esModule",{value:!0});Jyr.Boolean=hIa;var fIa=_n(),pIa=a8();function hIa(t){return(0,pIa.CreateType)({[fIa.Kind]:"Boolean",type:"boolean"},t)}a(hIa,"Boolean")});var wMe=I(Iee=>{"use strict";p();var mIa=Iee&&Iee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gIa=Iee&&Iee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mIa(e,t,r)};Object.defineProperty(Iee,"__esModule",{value:!0});gIa(ybi(),Iee)});var Ebi=I(Zyr=>{"use strict";p();Object.defineProperty(Zyr,"__esModule",{value:!0});Zyr.BigInt=EIa;var AIa=_n(),yIa=a8();function EIa(t){return(0,yIa.CreateType)({[AIa.Kind]:"BigInt",type:"bigint"},t)}a(EIa,"BigInt")});var rme=I(xee=>{"use strict";p();var _Ia=xee&&xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vIa=xee&&xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ia(e,t,r)};Object.defineProperty(xee,"__esModule",{value:!0});vIa(Ebi(),xee)});var _bi=I(Xyr=>{"use strict";p();Object.defineProperty(Xyr,"__esModule",{value:!0});Xyr.Number=SIa;var CIa=Si(),bIa=_n();function SIa(t){return(0,CIa.CreateType)({[bIa.Kind]:"Number",type:"number"},t)}a(SIa,"Number")});var jH=I(wee=>{"use strict";p();var TIa=wee&&wee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IIa=wee&&wee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TIa(e,t,r)};Object.defineProperty(wee,"__esModule",{value:!0});IIa(_bi(),wee)});var vbi=I(eEr=>{"use strict";p();Object.defineProperty(eEr,"__esModule",{value:!0});eEr.String=RIa;var xIa=Si(),wIa=_n();function RIa(t){return(0,xIa.CreateType)({[wIa.Kind]:"String",type:"string"},t)}a(RIa,"String")});var HH=I(Ree=>{"use strict";p();var PIa=Ree&&Ree.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kIa=Ree&&Ree.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PIa(e,t,r)};Object.defineProperty(Ree,"__esModule",{value:!0});kIa(vbi(),Ree)});var nEr=I(rEr=>{"use strict";p();Object.defineProperty(rEr,"__esModule",{value:!0});rEr.TemplateLiteralSyntax=QIa;var RMe=CE(),DIa=wMe(),NIa=rme(),MIa=jH(),OIa=HH(),BIa=gp(),LIa=d0();function*FIa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,DIa.Boolean)():e==="number"?yield(0,MIa.Number)():e==="bigint"?yield(0,NIa.BigInt)():e==="string"?yield(0,OIa.String)():yield(()=>{let r=e.split("|").map(n=>(0,RMe.Literal)(n.trim()));return r.length===0?(0,LIa.Never)():r.length===1?r[0]:(0,BIa.UnionEvaluated)(r)})()}a(FIa,"FromUnion");function*UIa(t){if(t[1]!=="{"){let e=(0,RMe.Literal)("$"),r=tEr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(kMe,"__esModule",{value:!0});kMe.TemplateLiteralPatternError=void 0;kMe.TemplateLiteralPattern=GIa;var PMe=SMe(),qIa=_n(),jIa=bf(),GH=hs(),Ght=class extends jIa.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};kMe.TemplateLiteralPatternError=Ght;function HIa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(HIa,"Escape");function Cbi(t,e){return(0,GH.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,GH.IsUnion)(t)?`(${t.anyOf.map(r=>Cbi(r,e)).join("|")})`:(0,GH.IsNumber)(t)?`${e}${PMe.PatternNumber}`:(0,GH.IsInteger)(t)?`${e}${PMe.PatternNumber}`:(0,GH.IsBigInt)(t)?`${e}${PMe.PatternNumber}`:(0,GH.IsString)(t)?`${e}${PMe.PatternString}`:(0,GH.IsLiteral)(t)?`${e}${HIa(t.const.toString())}`:(0,GH.IsBoolean)(t)?`${e}${PMe.PatternBoolean}`:(()=>{throw new Ght(`Unexpected Kind '${t[qIa.Kind]}'`)})()}a(Cbi,"Visit");function GIa(t){return`^${t.map(e=>Cbi(e,"")).join("")}$`}a(GIa,"TemplateLiteralPattern")});var bbi=I(oEr=>{"use strict";p();Object.defineProperty(oEr,"__esModule",{value:!0});oEr.TemplateLiteralToUnion=zIa;var $Ia=gp(),VIa=CE(),WIa=Yyr();function zIa(t){let r=(0,WIa.TemplateLiteralGenerate)(t).map(n=>(0,VIa.Literal)(n));return(0,$Ia.UnionEvaluated)(r)}a(zIa,"TemplateLiteralToUnion")});var Tbi=I(sEr=>{"use strict";p();Object.defineProperty(sEr,"__esModule",{value:!0});sEr.TemplateLiteral=XIa;var YIa=Si(),KIa=nEr(),Sbi=iEr(),JIa=sv(),ZIa=_n();function XIa(t,e){let r=(0,JIa.IsString)(t)?(0,Sbi.TemplateLiteralPattern)((0,KIa.TemplateLiteralSyntax)(t)):(0,Sbi.TemplateLiteralPattern)(t);return(0,YIa.CreateType)({[ZIa.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(XIa,"TemplateLiteral")});var k2=I(IT=>{"use strict";p();var exa=IT&&IT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pee=IT&&IT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&exa(e,t,r)};Object.defineProperty(IT,"__esModule",{value:!0});Pee(zyr(),IT);Pee(Yyr(),IT);Pee(nEr(),IT);Pee(Uht(),IT);Pee(iEr(),IT);Pee(bbi(),IT);Pee(Tbi(),IT)});var $ht=I(aEr=>{"use strict";p();Object.defineProperty(aEr,"__esModule",{value:!0});aEr.IndexPropertyKeys=Ibi;var txa=k2(),DMe=hs();function rxa(t){return(0,txa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(rxa,"FromTemplateLiteral");function nxa(t){let e=[];for(let r of t)e.push(...Ibi(r));return e}a(nxa,"FromUnion");function ixa(t){return[t.toString()]}a(ixa,"FromLiteral");function Ibi(t){return[...new Set((0,DMe.IsTemplateLiteral)(t)?rxa(t):(0,DMe.IsUnion)(t)?nxa(t.anyOf):(0,DMe.IsLiteral)(t)?ixa(t.const):(0,DMe.IsNumber)(t)?["[number]"]:(0,DMe.IsInteger)(t)?["[number]"]:[])]}a(Ibi,"IndexPropertyKeys")});var lEr=I(cEr=>{"use strict";p();Object.defineProperty(cEr,"__esModule",{value:!0});cEr.IndexFromMappedResult=uxa;var oxa=f0(),sxa=$ht(),axa=D2();function cxa(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,axa.Index)(t,(0,sxa.IndexPropertyKeys)(e[o]),r);return n}a(cxa,"FromProperties");function lxa(t,e,r){return cxa(t,e.properties,r)}a(lxa,"FromMappedResult");function uxa(t,e,r){let n=lxa(t,e,r);return(0,oxa.MappedResult)(n)}a(uxa,"IndexFromMappedResult")});var Wht=I(nme=>{"use strict";p();Object.defineProperty(nme,"__esModule",{value:!0});nme.IndexFromPropertyKey=dEr;nme.IndexFromPropertyKeys=Pbi;nme.IndexFromComputed=Sxa;nme.Index=Txa;var dxa=Si(),fxa=bf(),wbi=QH(),Vht=d0(),pxa=xT(),uEr=gp(),hxa=$ht(),mxa=fEr(),gxa=lEr(),Db=hs();function Rbi(t,e){return t.map(r=>dEr(r,e))}a(Rbi,"FromRest");function Axa(t){return t.filter(e=>!(0,Db.IsNever)(e))}a(Axa,"FromIntersectRest");function yxa(t,e){return(0,pxa.IntersectEvaluated)(Axa(Rbi(t,e)))}a(yxa,"FromIntersect");function Exa(t){return t.some(e=>(0,Db.IsNever)(e))?[]:t}a(Exa,"FromUnionRest");function _xa(t,e){return(0,uEr.UnionEvaluated)(Exa(Rbi(t,e)))}a(_xa,"FromUnion");function vxa(t,e){return e in t?t[e]:e==="[number]"?(0,uEr.UnionEvaluated)(t):(0,Vht.Never)()}a(vxa,"FromTuple");function Cxa(t,e){return e==="[number]"?t:(0,Vht.Never)()}a(Cxa,"FromArray");function bxa(t,e){return e in t?t[e]:(0,Vht.Never)()}a(bxa,"FromProperty");function dEr(t,e){return(0,Db.IsIntersect)(t)?yxa(t.allOf,e):(0,Db.IsUnion)(t)?_xa(t.anyOf,e):(0,Db.IsTuple)(t)?vxa(t.items??[],e):(0,Db.IsArray)(t)?Cxa(t.items,e):(0,Db.IsObject)(t)?bxa(t.properties,e):(0,Vht.Never)()}a(dEr,"IndexFromPropertyKey");function Pbi(t,e){return e.map(r=>dEr(t,r))}a(Pbi,"IndexFromPropertyKeys");function xbi(t,e){return(0,uEr.UnionEvaluated)(Pbi(t,e))}a(xbi,"FromSchema");function Sxa(t,e){return(0,wbi.Computed)("Index",[t,e])}a(Sxa,"IndexFromComputed");function Txa(t,e,r){if((0,Db.IsRef)(t)||(0,Db.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Db.IsSchema)(t)||!(0,Db.IsSchema)(e))throw new fxa.TypeBoxError(n);return(0,wbi.Computed)("Index",[t,e])}return(0,Db.IsMappedResult)(e)?(0,gxa.IndexFromMappedResult)(t,e,r):(0,Db.IsMappedKey)(e)?(0,mxa.IndexFromMappedKey)(t,e,r):(0,dxa.CreateType)((0,Db.IsSchema)(e)?xbi(t,(0,hxa.IndexPropertyKeys)(e)):xbi(t,e),r)}a(Txa,"Index")});var fEr=I(pEr=>{"use strict";p();Object.defineProperty(pEr,"__esModule",{value:!0});pEr.IndexFromMappedKey=Dxa;var Ixa=Wht(),xxa=f0(),wxa=Rb();function Rxa(t,e,r){return{[e]:(0,Ixa.Index)(t,[e],(0,wxa.Clone)(r))}}a(Rxa,"MappedIndexPropertyKey");function Pxa(t,e,r){return e.reduce((n,o)=>({...n,...Rxa(t,o,r)}),{})}a(Pxa,"MappedIndexPropertyKeys");function kxa(t,e,r){return Pxa(t,e.keys,r)}a(kxa,"MappedIndexProperties");function Dxa(t,e,r){let n=kxa(t,e,r);return(0,xxa.MappedResult)(n)}a(Dxa,"IndexFromMappedKey")});var D2=I(t4=>{"use strict";p();var Nxa=t4&&t4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zht=t4&&t4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nxa(e,t,r)};Object.defineProperty(t4,"__esModule",{value:!0});zht(fEr(),t4);zht(lEr(),t4);zht($ht(),t4);zht(Wht(),t4)});var kbi=I(hEr=>{"use strict";p();Object.defineProperty(hEr,"__esModule",{value:!0});hEr.Iterator=Bxa;var Mxa=Si(),Oxa=_n();function Bxa(t,e){return(0,Mxa.CreateType)({[Oxa.Kind]:"Iterator",type:"Iterator",items:t},e)}a(Bxa,"Iterator")});var ime=I(kee=>{"use strict";p();var Lxa=kee&&kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Fxa=kee&&kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lxa(e,t,r)};Object.defineProperty(kee,"__esModule",{value:!0});Fxa(kbi(),kee)});var Nbi=I(Yht=>{"use strict";p();Object.defineProperty(Yht,"__esModule",{value:!0});Yht.Object=void 0;var Uxa=Si(),Dbi=_n(),Qxa=hs();function qxa(t){return globalThis.Object.keys(t).filter(e=>!(0,Qxa.IsOptional)(t[e]))}a(qxa,"RequiredArray");function jxa(t,e){let r=qxa(t),n=r.length>0?{[Dbi.Kind]:"Object",type:"object",required:r,properties:t}:{[Dbi.Kind]:"Object",type:"object",properties:t};return(0,Uxa.CreateType)(n,e)}a(jxa,"_Object");Yht.Object=jxa});var av=I(Dee=>{"use strict";p();var Hxa=Dee&&Dee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gxa=Dee&&Dee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hxa(e,t,r)};Object.defineProperty(Dee,"__esModule",{value:!0});Gxa(Nbi(),Dee)});var Mbi=I(mEr=>{"use strict";p();Object.defineProperty(mEr,"__esModule",{value:!0});mEr.Promise=Wxa;var $xa=Si(),Vxa=_n();function Wxa(t,e){return(0,$xa.CreateType)({[Vxa.Kind]:"Promise",type:"Promise",item:t},e)}a(Wxa,"Promise")});var NMe=I(Nee=>{"use strict";p();var zxa=Nee&&Nee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yxa=Nee&&Nee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zxa(e,t,r)};Object.defineProperty(Nee,"__esModule",{value:!0});Yxa(Mbi(),Nee)});var AEr=I(gEr=>{"use strict";p();Object.defineProperty(gEr,"__esModule",{value:!0});gEr.Readonly=rwa;var Obi=Si(),Bbi=_n(),Kxa=l8(),Jxa=yEr(),Zxa=hs();function Xxa(t){return(0,Obi.CreateType)((0,Kxa.Discard)(t,[Bbi.ReadonlyKind]))}a(Xxa,"RemoveReadonly");function ewa(t){return(0,Obi.CreateType)({...t,[Bbi.ReadonlyKind]:"Readonly"})}a(ewa,"AddReadonly");function twa(t,e){return e===!1?Xxa(t):ewa(t)}a(twa,"ReadonlyWithFlag");function rwa(t,e){let r=e??!0;return(0,Zxa.IsMappedResult)(t)?(0,Jxa.ReadonlyFromMappedResult)(t,r):twa(t,r)}a(rwa,"Readonly")});var yEr=I(EEr=>{"use strict";p();Object.defineProperty(EEr,"__esModule",{value:!0});EEr.ReadonlyFromMappedResult=awa;var nwa=f0(),iwa=AEr();function owa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,iwa.Readonly)(t[n],e);return r}a(owa,"FromProperties");function swa(t,e){return owa(t.properties,e)}a(swa,"FromMappedResult");function awa(t,e){let r=swa(t,e);return(0,nwa.MappedResult)(r)}a(awa,"ReadonlyFromMappedResult")});var VH=I($H=>{"use strict";p();var cwa=$H&&$H.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lbi=$H&&$H.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cwa(e,t,r)};Object.defineProperty($H,"__esModule",{value:!0});Lbi(yEr(),$H);Lbi(AEr(),$H)});var Ubi=I(_Er=>{"use strict";p();Object.defineProperty(_Er,"__esModule",{value:!0});_Er.Tuple=uwa;var lwa=Si(),Fbi=_n();function uwa(t,e){return(0,lwa.CreateType)(t.length>0?{[Fbi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Fbi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(uwa,"Tuple")});var f8=I(Mee=>{"use strict";p();var dwa=Mee&&Mee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Mee&&Mee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dwa(e,t,r)};Object.defineProperty(Mee,"__esModule",{value:!0});fwa(Ubi(),Mee)});var $bi=I(Kht=>{"use strict";p();Object.defineProperty(Kht,"__esModule",{value:!0});Kht.MappedFunctionReturnType=Gbi;Kht.Mapped=Dwa;var vEr=_n(),Qbi=l8(),pwa=K0e(),hwa=J0e(),mwa=Z0e(),gwa=qH(),Awa=D2(),ywa=xT(),Ewa=ime(),qbi=CE(),jbi=av(),_wa=e4(),vwa=NMe(),Cwa=VH(),bwa=f8(),Swa=gp(),Twa=TMe(),Iwa=Uyr(),cv=hs();function Hbi(t,e){return t in e?Zw(t,e[t]):(0,Iwa.MappedResult)(e)}a(Hbi,"FromMappedResult");function xwa(t){return{[t]:(0,qbi.Literal)(t)}}a(xwa,"MappedKeyToKnownMappedResultProperties");function wwa(t){let e={};for(let r of t)e[r]=(0,qbi.Literal)(r);return e}a(wwa,"MappedKeyToUnknownMappedResultProperties");function Rwa(t,e){return(0,Twa.SetIncludes)(e,t)?xwa(t):wwa(e)}a(Rwa,"MappedKeyToMappedResultProperties");function Pwa(t,e){let r=Rwa(t,e);return Hbi(t,r)}a(Pwa,"FromMappedKey");function MMe(t,e){return e.map(r=>Zw(t,r))}a(MMe,"FromRest");function kwa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Zw(t,e[n]);return r}a(kwa,"FromProperties");function Zw(t,e){let r={...e};return(0,cv.IsOptional)(e)?(0,_wa.Optional)(Zw(t,(0,Qbi.Discard)(e,[vEr.OptionalKind]))):(0,cv.IsReadonly)(e)?(0,Cwa.Readonly)(Zw(t,(0,Qbi.Discard)(e,[vEr.ReadonlyKind]))):(0,cv.IsMappedResult)(e)?Hbi(t,e.properties):(0,cv.IsMappedKey)(e)?Pwa(t,e.keys):(0,cv.IsConstructor)(e)?(0,mwa.Constructor)(MMe(t,e.parameters),Zw(t,e.returns),r):(0,cv.IsFunction)(e)?(0,gwa.Function)(MMe(t,e.parameters),Zw(t,e.returns),r):(0,cv.IsAsyncIterator)(e)?(0,hwa.AsyncIterator)(Zw(t,e.items),r):(0,cv.IsIterator)(e)?(0,Ewa.Iterator)(Zw(t,e.items),r):(0,cv.IsIntersect)(e)?(0,ywa.Intersect)(MMe(t,e.allOf),r):(0,cv.IsUnion)(e)?(0,Swa.Union)(MMe(t,e.anyOf),r):(0,cv.IsTuple)(e)?(0,bwa.Tuple)(MMe(t,e.items??[]),r):(0,cv.IsObject)(e)?(0,jbi.Object)(kwa(t,e.properties),r):(0,cv.IsArray)(e)?(0,pwa.Array)(Zw(t,e.items),r):(0,cv.IsPromise)(e)?(0,vwa.Promise)(Zw(t,e.item),r):e}a(Zw,"FromSchemaType");function Gbi(t,e){let r={};for(let n of t)r[n]=Zw(n,e);return r}a(Gbi,"MappedFunctionReturnType");function Dwa(t,e,r){let n=(0,cv.IsSchema)(t)?(0,Awa.IndexPropertyKeys)(t):t,o=e({[vEr.Kind]:"MappedKey",keys:n}),s=Gbi(n,o);return(0,jbi.Object)(s,r)}a(Dwa,"Mapped")});var f0=I(p8=>{"use strict";p();var Nwa=p8&&p8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CEr=p8&&p8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nwa(e,t,r)};Object.defineProperty(p8,"__esModule",{value:!0});CEr(obi(),p8);CEr(Uyr(),p8);CEr($bi(),p8)});var SEr=I(bEr=>{"use strict";p();Object.defineProperty(bEr,"__esModule",{value:!0});bEr.Optional=Qwa;var Vbi=Si(),Wbi=_n(),Mwa=l8(),Owa=TEr(),Bwa=hs();function Lwa(t){return(0,Vbi.CreateType)((0,Mwa.Discard)(t,[Wbi.OptionalKind]))}a(Lwa,"RemoveOptional");function Fwa(t){return(0,Vbi.CreateType)({...t,[Wbi.OptionalKind]:"Optional"})}a(Fwa,"AddOptional");function Uwa(t,e){return e===!1?Lwa(t):Fwa(t)}a(Uwa,"OptionalWithFlag");function Qwa(t,e){let r=e??!0;return(0,Bwa.IsMappedResult)(t)?(0,Owa.OptionalFromMappedResult)(t,r):Uwa(t,r)}a(Qwa,"Optional")});var TEr=I(IEr=>{"use strict";p();Object.defineProperty(IEr,"__esModule",{value:!0});IEr.OptionalFromMappedResult=$wa;var qwa=f0(),jwa=SEr();function Hwa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,jwa.Optional)(t[n],e);return r}a(Hwa,"FromProperties");function Gwa(t,e){return Hwa(t.properties,e)}a(Gwa,"FromMappedResult");function $wa(t,e){let r=Gwa(t,e);return(0,qwa.MappedResult)(r)}a($wa,"OptionalFromMappedResult")});var e4=I(WH=>{"use strict";p();var Vwa=WH&&WH.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zbi=WH&&WH.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vwa(e,t,r)};Object.defineProperty(WH,"__esModule",{value:!0});zbi(TEr(),WH);zbi(SEr(),WH)});var REr=I(wEr=>{"use strict";p();Object.defineProperty(wEr,"__esModule",{value:!0});wEr.IntersectCreate=zwa;var Wwa=Si(),Ybi=_n(),xEr=hs();function zwa(t,e={}){let r=t.every(o=>(0,xEr.IsObject)(o)),n=(0,xEr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,Wwa.CreateType)(e.unevaluatedProperties===!1||(0,xEr.IsSchema)(e.unevaluatedProperties)||r?{...n,[Ybi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[Ybi.Kind]:"Intersect",allOf:t},e)}a(zwa,"IntersectCreate")});var Zbi=I(kEr=>{"use strict";p();Object.defineProperty(kEr,"__esModule",{value:!0});kEr.IntersectEvaluated=nRa;var Ywa=_n(),Kwa=Si(),Jwa=l8(),Zwa=d0(),Xwa=e4(),Kbi=REr(),PEr=hs();function eRa(t){return t.every(e=>(0,PEr.IsOptional)(e))}a(eRa,"IsIntersectOptional");function tRa(t){return(0,Jwa.Discard)(t,[Ywa.OptionalKind])}a(tRa,"RemoveOptionalFromType");function Jbi(t){return t.map(e=>(0,PEr.IsOptional)(e)?tRa(e):e)}a(Jbi,"RemoveOptionalFromRest");function rRa(t,e){return eRa(t)?(0,Xwa.Optional)((0,Kbi.IntersectCreate)(Jbi(t),e)):(0,Kbi.IntersectCreate)(Jbi(t),e)}a(rRa,"ResolveIntersect");function nRa(t,e={}){if(t.length===1)return(0,Kwa.CreateType)(t[0],e);if(t.length===0)return(0,Zwa.Never)(e);if(t.some(r=>(0,PEr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return rRa(t,e)}a(nRa,"IntersectEvaluated")});var e1i=I(Xbi=>{"use strict";p();Object.defineProperty(Xbi,"__esModule",{value:!0});var Wup=_n()});var t1i=I(DEr=>{"use strict";p();Object.defineProperty(DEr,"__esModule",{value:!0});DEr.Intersect=cRa;var iRa=Si(),oRa=d0(),sRa=REr(),aRa=hs();function cRa(t,e){if(t.length===1)return(0,iRa.CreateType)(t[0],e);if(t.length===0)return(0,oRa.Never)(e);if(t.some(r=>(0,aRa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,sRa.IntersectCreate)(t,e)}a(cRa,"Intersect")});var xT=I(h8=>{"use strict";p();var lRa=h8&&h8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NEr=h8&&h8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lRa(e,t,r)};Object.defineProperty(h8,"__esModule",{value:!0});NEr(Zbi(),h8);NEr(e1i(),h8);NEr(t1i(),h8)});var r1i=I(MEr=>{"use strict";p();Object.defineProperty(MEr,"__esModule",{value:!0});MEr.Ref=pRa;var uRa=bf(),dRa=Si(),fRa=_n();function pRa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new uRa.TypeBoxError("Ref: $ref must be a string");return(0,dRa.CreateType)({[fRa.Kind]:"Ref",$ref:e},r)}a(pRa,"Ref")});var zH=I(Oee=>{"use strict";p();var hRa=Oee&&Oee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Oee&&Oee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hRa(e,t,r)};Object.defineProperty(Oee,"__esModule",{value:!0});mRa(r1i(),Oee)});var i1i=I(LEr=>{"use strict";p();Object.defineProperty(LEr,"__esModule",{value:!0});LEr.Awaited=BEr;var gRa=Si(),OEr=QH(),ARa=xT(),yRa=gp(),ERa=zH(),OMe=hs();function _Ra(t,e){return(0,OEr.Computed)("Awaited",[(0,OEr.Computed)(t,e)])}a(_Ra,"FromComputed");function vRa(t){return(0,OEr.Computed)("Awaited",[(0,ERa.Ref)(t)])}a(vRa,"FromRef");function CRa(t){return(0,ARa.Intersect)(n1i(t))}a(CRa,"FromIntersect");function bRa(t){return(0,yRa.Union)(n1i(t))}a(bRa,"FromUnion");function SRa(t){return BEr(t)}a(SRa,"FromPromise");function n1i(t){return t.map(e=>BEr(e))}a(n1i,"FromRest");function BEr(t,e){return(0,gRa.CreateType)((0,OMe.IsComputed)(t)?_Ra(t.target,t.parameters):(0,OMe.IsIntersect)(t)?CRa(t.allOf):(0,OMe.IsUnion)(t)?bRa(t.anyOf):(0,OMe.IsPromise)(t)?SRa(t.item):(0,OMe.IsRef)(t)?vRa(t.$ref):t,e)}a(BEr,"Awaited")});var BMe=I(Bee=>{"use strict";p();var TRa=Bee&&Bee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IRa=Bee&&Bee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TRa(e,t,r)};Object.defineProperty(Bee,"__esModule",{value:!0});IRa(i1i(),Bee)});var Zht=I(Jht=>{"use strict";p();Object.defineProperty(Jht,"__esModule",{value:!0});Jht.KeyOfPropertyKeys=UEr;Jht.KeyOfPattern=NRa;var o1i=TMe(),ome=hs();function s1i(t){let e=[];for(let r of t)e.push(UEr(r));return e}a(s1i,"FromRest");function xRa(t){let e=s1i(t);return(0,o1i.SetUnionMany)(e)}a(xRa,"FromIntersect");function wRa(t){let e=s1i(t);return(0,o1i.SetIntersectMany)(e)}a(wRa,"FromUnion");function RRa(t){return t.map((e,r)=>r.toString())}a(RRa,"FromTuple");function PRa(t){return["[number]"]}a(PRa,"FromArray");function kRa(t){return globalThis.Object.getOwnPropertyNames(t)}a(kRa,"FromProperties");function DRa(t){return FEr?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(DRa,"FromPatternProperties");function UEr(t){return(0,ome.IsIntersect)(t)?xRa(t.allOf):(0,ome.IsUnion)(t)?wRa(t.anyOf):(0,ome.IsTuple)(t)?RRa(t.items??[]):(0,ome.IsArray)(t)?PRa(t.items):(0,ome.IsObject)(t)?kRa(t.properties):(0,ome.IsRecord)(t)?DRa(t.patternProperties):[]}a(UEr,"KeyOfPropertyKeys");var FEr=!1;function NRa(t){FEr=!0;let e=UEr(t);return FEr=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(NRa,"KeyOfPattern")});var jEr=I(Xht=>{"use strict";p();Object.defineProperty(Xht,"__esModule",{value:!0});Xht.KeyOfPropertyKeysToRest=a1i;Xht.KeyOf=GRa;var MRa=Si(),ORa=CE(),BRa=jH(),qEr=QH(),LRa=zH(),FRa=Zht(),URa=gp(),QRa=HEr(),QEr=hs();function qRa(t,e){return(0,qEr.Computed)("KeyOf",[(0,qEr.Computed)(t,e)])}a(qRa,"FromComputed");function jRa(t){return(0,qEr.Computed)("KeyOf",[(0,LRa.Ref)(t)])}a(jRa,"FromRef");function HRa(t,e){let r=(0,FRa.KeyOfPropertyKeys)(t),n=a1i(r),o=(0,URa.UnionEvaluated)(n);return(0,MRa.CreateType)(o,e)}a(HRa,"KeyOfFromType");function a1i(t){return t.map(e=>e==="[number]"?(0,BRa.Number)():(0,ORa.Literal)(e))}a(a1i,"KeyOfPropertyKeysToRest");function GRa(t,e){return(0,QEr.IsComputed)(t)?qRa(t.target,t.parameters):(0,QEr.IsRef)(t)?jRa(t.$ref):(0,QEr.IsMappedResult)(t)?(0,QRa.KeyOfFromMappedResult)(t,e):HRa(t,e)}a(GRa,"KeyOf")});var HEr=I(GEr=>{"use strict";p();Object.defineProperty(GEr,"__esModule",{value:!0});GEr.KeyOfFromMappedResult=KRa;var $Ra=f0(),VRa=jEr(),WRa=Rb();function zRa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,VRa.KeyOf)(t[n],(0,WRa.Clone)(e));return r}a(zRa,"FromProperties");function YRa(t,e){return zRa(t.properties,e)}a(YRa,"FromMappedResult");function KRa(t,e){let r=YRa(t,e);return(0,$Ra.MappedResult)(r)}a(KRa,"KeyOfFromMappedResult")});var c1i=I($Er=>{"use strict";p();Object.defineProperty($Er,"__esModule",{value:!0});$Er.KeyOfPropertyEntries=XRa;var JRa=Wht(),ZRa=Zht();function XRa(t){let e=(0,ZRa.KeyOfPropertyKeys)(t),r=(0,JRa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(XRa,"KeyOfPropertyEntries")});var N2=I(r4=>{"use strict";p();var ePa=r4&&r4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e0t=r4&&r4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ePa(e,t,r)};Object.defineProperty(r4,"__esModule",{value:!0});e0t(HEr(),r4);e0t(c1i(),r4);e0t(Zht(),r4);e0t(jEr(),r4)});var l1i=I(VEr=>{"use strict";p();Object.defineProperty(VEr,"__esModule",{value:!0});VEr.Composite=dPa;var tPa=xT(),rPa=D2(),nPa=N2(),iPa=av(),oPa=TMe(),sPa=hs();function aPa(t){let e=[];for(let r of t)e.push(...(0,nPa.KeyOfPropertyKeys)(r));return(0,oPa.SetDistinct)(e)}a(aPa,"CompositeKeys");function cPa(t){return t.filter(e=>!(0,sPa.IsNever)(e))}a(cPa,"FilterNever");function lPa(t,e){let r=[];for(let n of t)r.push(...(0,rPa.IndexFromPropertyKeys)(n,[e]));return cPa(r)}a(lPa,"CompositeProperty");function uPa(t,e){let r={};for(let n of e)r[n]=(0,tPa.IntersectEvaluated)(lPa(t,n));return r}a(uPa,"CompositeProperties");function dPa(t,e){let r=aPa(t),n=uPa(t,r);return(0,iPa.Object)(n,e)}a(dPa,"Composite")});var t0t=I(Lee=>{"use strict";p();var fPa=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]})),pPa=Lee&&Lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fPa(e,t,r)};Object.defineProperty(Lee,"__esModule",{value:!0});pPa(l1i(),Lee)});var u1i=I(WEr=>{"use strict";p();Object.defineProperty(WEr,"__esModule",{value:!0});WEr.Date=gPa;var hPa=_n(),mPa=Si();function gPa(t){return(0,mPa.CreateType)({[hPa.Kind]:"Date",type:"Date"},t)}a(gPa,"Date")});var LMe=I(Fee=>{"use strict";p();var APa=Fee&&Fee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yPa=Fee&&Fee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&APa(e,t,r)};Object.defineProperty(Fee,"__esModule",{value:!0});yPa(u1i(),Fee)});var d1i=I(zEr=>{"use strict";p();Object.defineProperty(zEr,"__esModule",{value:!0});zEr.Null=vPa;var EPa=Si(),_Pa=_n();function vPa(t){return(0,EPa.CreateType)({[_Pa.Kind]:"Null",type:"null"},t)}a(vPa,"Null")});var FMe=I(Uee=>{"use strict";p();var CPa=Uee&&Uee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bPa=Uee&&Uee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CPa(e,t,r)};Object.defineProperty(Uee,"__esModule",{value:!0});bPa(d1i(),Uee)});var f1i=I(YEr=>{"use strict";p();Object.defineProperty(YEr,"__esModule",{value:!0});YEr.Symbol=IPa;var SPa=Si(),TPa=_n();function IPa(t){return(0,SPa.CreateType)({[TPa.Kind]:"Symbol",type:"symbol"},t)}a(IPa,"Symbol")});var UMe=I(Qee=>{"use strict";p();var xPa=Qee&&Qee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wPa=Qee&&Qee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xPa(e,t,r)};Object.defineProperty(Qee,"__esModule",{value:!0});wPa(f1i(),Qee)});var p1i=I(KEr=>{"use strict";p();Object.defineProperty(KEr,"__esModule",{value:!0});KEr.Undefined=kPa;var RPa=Si(),PPa=_n();function kPa(t){return(0,RPa.CreateType)({[PPa.Kind]:"Undefined",type:"undefined"},t)}a(kPa,"Undefined")});var QMe=I(qee=>{"use strict";p();var DPa=qee&&qee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NPa=qee&&qee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DPa(e,t,r)};Object.defineProperty(qee,"__esModule",{value:!0});NPa(p1i(),qee)});var h1i=I(JEr=>{"use strict";p();Object.defineProperty(JEr,"__esModule",{value:!0});JEr.Uint8Array=BPa;var MPa=Si(),OPa=_n();function BPa(t){return(0,MPa.CreateType)({[OPa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(BPa,"Uint8Array")});var qMe=I(jee=>{"use strict";p();var LPa=jee&&jee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FPa=jee&&jee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LPa(e,t,r)};Object.defineProperty(jee,"__esModule",{value:!0});FPa(h1i(),jee)});var m1i=I(ZEr=>{"use strict";p();Object.defineProperty(ZEr,"__esModule",{value:!0});ZEr.Unknown=qPa;var UPa=Si(),QPa=_n();function qPa(t){return(0,UPa.CreateType)({[QPa.Kind]:"Unknown"},t)}a(qPa,"Unknown")});var YH=I(Hee=>{"use strict";p();var jPa=Hee&&Hee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HPa=Hee&&Hee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jPa(e,t,r)};Object.defineProperty(Hee,"__esModule",{value:!0});HPa(m1i(),Hee)});var y1i=I(r_r=>{"use strict";p();Object.defineProperty(r_r,"__esModule",{value:!0});r_r.Const=rka;var g1i=Y0e(),GPa=rme(),$Pa=LMe(),VPa=qH(),XEr=CE(),WPa=FMe(),A1i=av(),zPa=UMe(),YPa=f8(),e_r=VH(),KPa=QMe(),JPa=qMe(),ZPa=YH(),XPa=a8(),Nb=sv();function eka(t){return t.map(e=>t_r(e,!1))}a(eka,"FromArray");function tka(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,e_r.Readonly)(t_r(t[r],!1));return e}a(tka,"FromProperties");function r0t(t,e){return e===!0?t:(0,e_r.Readonly)(t)}a(r0t,"ConditionalReadonly");function t_r(t,e){return(0,Nb.IsAsyncIterator)(t)||(0,Nb.IsIterator)(t)?r0t((0,g1i.Any)(),e):(0,Nb.IsArray)(t)?(0,e_r.Readonly)((0,YPa.Tuple)(eka(t))):(0,Nb.IsUint8Array)(t)?(0,JPa.Uint8Array)():(0,Nb.IsDate)(t)?(0,$Pa.Date)():(0,Nb.IsObject)(t)?r0t((0,A1i.Object)(tka(t)),e):(0,Nb.IsFunction)(t)?r0t((0,VPa.Function)([],(0,ZPa.Unknown)()),e):(0,Nb.IsUndefined)(t)?(0,KPa.Undefined)():(0,Nb.IsNull)(t)?(0,WPa.Null)():(0,Nb.IsSymbol)(t)?(0,zPa.Symbol)():(0,Nb.IsBigInt)(t)?(0,GPa.BigInt)():(0,Nb.IsNumber)(t)||(0,Nb.IsBoolean)(t)||(0,Nb.IsString)(t)?(0,XEr.Literal)(t):(0,A1i.Object)({})}a(t_r,"FromValue");function rka(t,e){return(0,XPa.CreateType)(t_r(t,!0),e)}a(rka,"Const")});var n0t=I(Gee=>{"use strict";p();var nka=Gee&&Gee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ika=Gee&&Gee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nka(e,t,r)};Object.defineProperty(Gee,"__esModule",{value:!0});ika(y1i(),Gee)});var E1i=I(m8=>{"use strict";p();var oka=m8&&m8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ska=m8&&m8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aka=m8&&m8.__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 fka=$ee&&$ee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pka=$ee&&$ee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fka(e,t,r)};Object.defineProperty($ee,"__esModule",{value:!0});pka(E1i(),$ee)});var _1i=I(n_r=>{"use strict";p();Object.defineProperty(n_r,"__esModule",{value:!0});n_r.Enum=yka;var hka=CE(),mka=_n(),gka=gp(),Aka=sv();function yka(t,e){if((0,Aka.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,hka.Literal)(s));return(0,gka.Union)(o,{...e,[mka.Hint]:"Enum"})}a(yka,"Enum")});var o0t=I(Vee=>{"use strict";p();var Eka=Vee&&Vee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_ka=Vee&&Vee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Eka(e,t,r)};Object.defineProperty(Vee,"__esModule",{value:!0});_ka(_1i(),Vee)});var d_r=I(Wee=>{"use strict";p();Object.defineProperty(Wee,"__esModule",{value:!0});Wee.ExtendsResult=Wee.ExtendsResolverError=void 0;Wee.ExtendsCheck=l2a;var v1i=Y0e(),vka=qH(),c_r=jH(),o_r=HH(),Cka=YH(),C1i=k2(),sme=SMe(),x1i=_n(),bka=bf(),et=wyr(),s0t=class extends bka.TypeBoxError{static{a(this,"ExtendsResolverError")}};Wee.ExtendsResolverError=s0t;var Ot;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Ot||(Wee.ExtendsResult=Ot={}));function Xw(t){return t===Ot.False?t:Ot.True}a(Xw,"IntoBooleanResult");function ame(t){throw new s0t(t)}a(ame,"Throw");function p0(t){return et.TypeGuard.IsNever(t)||et.TypeGuard.IsIntersect(t)||et.TypeGuard.IsUnion(t)||et.TypeGuard.IsUnknown(t)||et.TypeGuard.IsAny(t)}a(p0,"IsStructuralRight");function h0(t,e){return et.TypeGuard.IsNever(e)?P1i(t,e):et.TypeGuard.IsIntersect(e)?a0t(t,e):et.TypeGuard.IsUnion(e)?u_r(t,e):et.TypeGuard.IsUnknown(e)?M1i(t,e):et.TypeGuard.IsAny(e)?l_r(t,e):ame("StructuralRight")}a(h0,"StructuralRight");function l_r(t,e){return Ot.True}a(l_r,"FromAnyRight");function Ska(t,e){return et.TypeGuard.IsIntersect(e)?a0t(t,e):et.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>et.TypeGuard.IsAny(r)||et.TypeGuard.IsUnknown(r))?Ot.True:et.TypeGuard.IsUnion(e)?Ot.Union:et.TypeGuard.IsUnknown(e)||et.TypeGuard.IsAny(e)?Ot.True:Ot.Union}a(Ska,"FromAny");function Tka(t,e){return et.TypeGuard.IsUnknown(t)?Ot.False:et.TypeGuard.IsAny(t)?Ot.Union:et.TypeGuard.IsNever(t)?Ot.True:Ot.False}a(Tka,"FromArrayRight");function Ika(t,e){return et.TypeGuard.IsObject(e)&&c0t(e)?Ot.True:p0(e)?h0(t,e):et.TypeGuard.IsArray(e)?Xw(cl(t.items,e.items)):Ot.False}a(Ika,"FromArray");function xka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsAsyncIterator(e)?Xw(cl(t.items,e.items)):Ot.False}a(xka,"FromAsyncIterator");function wka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsBigInt(e)?Ot.True:Ot.False}a(wka,"FromBigInt");function w1i(t,e){return et.TypeGuard.IsLiteralBoolean(t)||et.TypeGuard.IsBoolean(t)?Ot.True:Ot.False}a(w1i,"FromBooleanRight");function Rka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsBoolean(e)?Ot.True:Ot.False}a(Rka,"FromBoolean");function Pka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Ot.False:t.parameters.every((r,n)=>Xw(cl(e.parameters[n],r))===Ot.True)?Xw(cl(t.returns,e.returns)):Ot.False:Ot.False}a(Pka,"FromConstructor");function kka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsDate(e)?Ot.True:Ot.False}a(kka,"FromDate");function Dka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Ot.False:t.parameters.every((r,n)=>Xw(cl(e.parameters[n],r))===Ot.True)?Xw(cl(t.returns,e.returns)):Ot.False:Ot.False}a(Dka,"FromFunction");function R1i(t,e){return et.TypeGuard.IsLiteral(t)&&et.ValueGuard.IsNumber(t.const)||et.TypeGuard.IsNumber(t)||et.TypeGuard.IsInteger(t)?Ot.True:Ot.False}a(R1i,"FromIntegerRight");function Nka(t,e){return et.TypeGuard.IsInteger(e)||et.TypeGuard.IsNumber(e)?Ot.True:p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):Ot.False}a(Nka,"FromInteger");function a0t(t,e){return e.allOf.every(r=>cl(t,r)===Ot.True)?Ot.True:Ot.False}a(a0t,"FromIntersectRight");function Mka(t,e){return t.allOf.some(r=>cl(r,e)===Ot.True)?Ot.True:Ot.False}a(Mka,"FromIntersect");function Oka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsIterator(e)?Xw(cl(t.items,e.items)):Ot.False}a(Oka,"FromIterator");function Bka(t,e){return et.TypeGuard.IsLiteral(e)&&e.const===t.const?Ot.True:p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsString(e)?N1i(t,e):et.TypeGuard.IsNumber(e)?k1i(t,e):et.TypeGuard.IsInteger(e)?R1i(t,e):et.TypeGuard.IsBoolean(e)?w1i(t,e):Ot.False}a(Bka,"FromLiteral");function P1i(t,e){return Ot.False}a(P1i,"FromNeverRight");function Lka(t,e){return Ot.True}a(Lka,"FromNever");function b1i(t){let[e,r]=[t,0];for(;et.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,Cka.Unknown)()}a(b1i,"UnwrapTNot");function Fka(t,e){return et.TypeGuard.IsNot(t)?cl(b1i(t),e):et.TypeGuard.IsNot(e)?cl(t,b1i(e)):ame("Invalid fallthrough for Not")}a(Fka,"FromNot");function Uka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsNull(e)?Ot.True:Ot.False}a(Uka,"FromNull");function k1i(t,e){return et.TypeGuard.IsLiteralNumber(t)||et.TypeGuard.IsNumber(t)||et.TypeGuard.IsInteger(t)?Ot.True:Ot.False}a(k1i,"FromNumberRight");function Qka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsInteger(e)||et.TypeGuard.IsNumber(e)?Ot.True:Ot.False}a(Qka,"FromNumber");function Mb(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(Mb,"IsObjectPropertyCount");function S1i(t){return c0t(t)}a(S1i,"IsObjectStringLike");function T1i(t){return Mb(t,0)||Mb(t,1)&&"description"in t.properties&&et.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(et.TypeGuard.IsString(t.properties.description.anyOf[0])&&et.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||et.TypeGuard.IsString(t.properties.description.anyOf[1])&&et.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(T1i,"IsObjectSymbolLike");function i_r(t){return Mb(t,0)}a(i_r,"IsObjectNumberLike");function I1i(t){return Mb(t,0)}a(I1i,"IsObjectBooleanLike");function qka(t){return Mb(t,0)}a(qka,"IsObjectBigIntLike");function jka(t){return Mb(t,0)}a(jka,"IsObjectDateLike");function Hka(t){return c0t(t)}a(Hka,"IsObjectUint8ArrayLike");function Gka(t){let e=(0,c_r.Number)();return Mb(t,0)||Mb(t,1)&&"length"in t.properties&&Xw(cl(t.properties.length,e))===Ot.True}a(Gka,"IsObjectFunctionLike");function $ka(t){return Mb(t,0)}a($ka,"IsObjectConstructorLike");function c0t(t){let e=(0,c_r.Number)();return Mb(t,0)||Mb(t,1)&&"length"in t.properties&&Xw(cl(t.properties.length,e))===Ot.True}a(c0t,"IsObjectArrayLike");function Vka(t){let e=(0,vka.Function)([(0,v1i.Any)()],(0,v1i.Any)());return Mb(t,0)||Mb(t,1)&&"then"in t.properties&&Xw(cl(t.properties.then,e))===Ot.True}a(Vka,"IsObjectPromiseLike");function D1i(t,e){return cl(t,e)===Ot.False||et.TypeGuard.IsOptional(t)&&!et.TypeGuard.IsOptional(e)?Ot.False:Ot.True}a(D1i,"Property");function bE(t,e){return et.TypeGuard.IsUnknown(t)?Ot.False:et.TypeGuard.IsAny(t)?Ot.Union:et.TypeGuard.IsNever(t)||et.TypeGuard.IsLiteralString(t)&&S1i(e)||et.TypeGuard.IsLiteralNumber(t)&&i_r(e)||et.TypeGuard.IsLiteralBoolean(t)&&I1i(e)||et.TypeGuard.IsSymbol(t)&&T1i(e)||et.TypeGuard.IsBigInt(t)&&qka(e)||et.TypeGuard.IsString(t)&&S1i(e)||et.TypeGuard.IsSymbol(t)&&T1i(e)||et.TypeGuard.IsNumber(t)&&i_r(e)||et.TypeGuard.IsInteger(t)&&i_r(e)||et.TypeGuard.IsBoolean(t)&&I1i(e)||et.TypeGuard.IsUint8Array(t)&&Hka(e)||et.TypeGuard.IsDate(t)&&jka(e)||et.TypeGuard.IsConstructor(t)&&$ka(e)||et.TypeGuard.IsFunction(t)&&Gka(e)?Ot.True:et.TypeGuard.IsRecord(t)&&et.TypeGuard.IsString(s_r(t))?e[x1i.Hint]==="Record"?Ot.True:Ot.False:et.TypeGuard.IsRecord(t)&&et.TypeGuard.IsNumber(s_r(t))&&Mb(e,0)?Ot.True:Ot.False}a(bE,"FromObjectRight");function Wka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!et.TypeGuard.IsOptional(e.properties[r]))return Ot.False;if(et.TypeGuard.IsOptional(e.properties[r]))return Ot.True;if(D1i(t.properties[r],e.properties[r])===Ot.False)return Ot.False}return Ot.True})():Ot.False}a(Wka,"FromObject");function zka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)&&Vka(e)?Ot.True:et.TypeGuard.IsPromise(e)?Xw(cl(t.item,e.item)):Ot.False}a(zka,"FromPromise");function s_r(t){return sme.PatternNumberExact in t.patternProperties?(0,c_r.Number)():sme.PatternStringExact in t.patternProperties?(0,o_r.String)():ame("Unknown record key pattern")}a(s_r,"RecordKey");function a_r(t){return sme.PatternNumberExact in t.patternProperties?t.patternProperties[sme.PatternNumberExact]:sme.PatternStringExact in t.patternProperties?t.patternProperties[sme.PatternStringExact]:ame("Unable to get record value schema")}a(a_r,"RecordValue");function eR(t,e){let[r,n]=[s_r(e),a_r(e)];return et.TypeGuard.IsLiteralString(t)&&et.TypeGuard.IsNumber(r)&&Xw(cl(t,n))===Ot.True?Ot.True:et.TypeGuard.IsUint8Array(t)&&et.TypeGuard.IsNumber(r)||et.TypeGuard.IsString(t)&&et.TypeGuard.IsNumber(r)||et.TypeGuard.IsArray(t)&&et.TypeGuard.IsNumber(r)?cl(t,n):et.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(D1i(n,t.properties[o])===Ot.False)return Ot.False;return Ot.True})():Ot.False}a(eR,"FromRecordRight");function Yka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?cl(a_r(t),a_r(e)):Ot.False}a(Yka,"FromRecord");function Kka(t,e){let r=et.TypeGuard.IsRegExp(t)?(0,o_r.String)():t,n=et.TypeGuard.IsRegExp(e)?(0,o_r.String)():e;return cl(r,n)}a(Kka,"FromRegExp");function N1i(t,e){return et.TypeGuard.IsLiteral(t)&&et.ValueGuard.IsString(t.const)||et.TypeGuard.IsString(t)?Ot.True:Ot.False}a(N1i,"FromStringRight");function Jka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsString(e)?Ot.True:Ot.False}a(Jka,"FromString");function Zka(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsSymbol(e)?Ot.True:Ot.False}a(Zka,"FromSymbol");function Xka(t,e){return et.TypeGuard.IsTemplateLiteral(t)?cl((0,C1i.TemplateLiteralToUnion)(t),e):et.TypeGuard.IsTemplateLiteral(e)?cl(t,(0,C1i.TemplateLiteralToUnion)(e)):ame("Invalid fallthrough for TemplateLiteral")}a(Xka,"FromTemplateLiteral");function e2a(t,e){return et.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>cl(r,e.items)===Ot.True)}a(e2a,"IsArrayOfTuple");function t2a(t,e){return et.TypeGuard.IsNever(t)?Ot.True:et.TypeGuard.IsUnknown(t)?Ot.False:et.TypeGuard.IsAny(t)?Ot.Union:Ot.False}a(t2a,"FromTupleRight");function r2a(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)&&c0t(e)||et.TypeGuard.IsArray(e)&&e2a(t,e)?Ot.True:et.TypeGuard.IsTuple(e)?et.ValueGuard.IsUndefined(t.items)&&!et.ValueGuard.IsUndefined(e.items)||!et.ValueGuard.IsUndefined(t.items)&&et.ValueGuard.IsUndefined(e.items)?Ot.False:et.ValueGuard.IsUndefined(t.items)&&!et.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>cl(r,e.items[n])===Ot.True)?Ot.True:Ot.False:Ot.False}a(r2a,"FromTuple");function n2a(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsUint8Array(e)?Ot.True:Ot.False}a(n2a,"FromUint8Array");function i2a(t,e){return p0(e)?h0(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsRecord(e)?eR(t,e):et.TypeGuard.IsVoid(e)?a2a(t,e):et.TypeGuard.IsUndefined(e)?Ot.True:Ot.False}a(i2a,"FromUndefined");function u_r(t,e){return e.anyOf.some(r=>cl(t,r)===Ot.True)?Ot.True:Ot.False}a(u_r,"FromUnionRight");function o2a(t,e){return t.anyOf.every(r=>cl(r,e)===Ot.True)?Ot.True:Ot.False}a(o2a,"FromUnion");function M1i(t,e){return Ot.True}a(M1i,"FromUnknownRight");function s2a(t,e){return et.TypeGuard.IsNever(e)?P1i(t,e):et.TypeGuard.IsIntersect(e)?a0t(t,e):et.TypeGuard.IsUnion(e)?u_r(t,e):et.TypeGuard.IsAny(e)?l_r(t,e):et.TypeGuard.IsString(e)?N1i(t,e):et.TypeGuard.IsNumber(e)?k1i(t,e):et.TypeGuard.IsInteger(e)?R1i(t,e):et.TypeGuard.IsBoolean(e)?w1i(t,e):et.TypeGuard.IsArray(e)?Tka(t,e):et.TypeGuard.IsTuple(e)?t2a(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsUnknown(e)?Ot.True:Ot.False}a(s2a,"FromUnknown");function a2a(t,e){return et.TypeGuard.IsUndefined(t)||et.TypeGuard.IsUndefined(t)?Ot.True:Ot.False}a(a2a,"FromVoidRight");function c2a(t,e){return et.TypeGuard.IsIntersect(e)?a0t(t,e):et.TypeGuard.IsUnion(e)?u_r(t,e):et.TypeGuard.IsUnknown(e)?M1i(t,e):et.TypeGuard.IsAny(e)?l_r(t,e):et.TypeGuard.IsObject(e)?bE(t,e):et.TypeGuard.IsVoid(e)?Ot.True:Ot.False}a(c2a,"FromVoid");function cl(t,e){return et.TypeGuard.IsTemplateLiteral(t)||et.TypeGuard.IsTemplateLiteral(e)?Xka(t,e):et.TypeGuard.IsRegExp(t)||et.TypeGuard.IsRegExp(e)?Kka(t,e):et.TypeGuard.IsNot(t)||et.TypeGuard.IsNot(e)?Fka(t,e):et.TypeGuard.IsAny(t)?Ska(t,e):et.TypeGuard.IsArray(t)?Ika(t,e):et.TypeGuard.IsBigInt(t)?wka(t,e):et.TypeGuard.IsBoolean(t)?Rka(t,e):et.TypeGuard.IsAsyncIterator(t)?xka(t,e):et.TypeGuard.IsConstructor(t)?Pka(t,e):et.TypeGuard.IsDate(t)?kka(t,e):et.TypeGuard.IsFunction(t)?Dka(t,e):et.TypeGuard.IsInteger(t)?Nka(t,e):et.TypeGuard.IsIntersect(t)?Mka(t,e):et.TypeGuard.IsIterator(t)?Oka(t,e):et.TypeGuard.IsLiteral(t)?Bka(t,e):et.TypeGuard.IsNever(t)?Lka(t,e):et.TypeGuard.IsNull(t)?Uka(t,e):et.TypeGuard.IsNumber(t)?Qka(t,e):et.TypeGuard.IsObject(t)?Wka(t,e):et.TypeGuard.IsRecord(t)?Yka(t,e):et.TypeGuard.IsString(t)?Jka(t,e):et.TypeGuard.IsSymbol(t)?Zka(t,e):et.TypeGuard.IsTuple(t)?r2a(t,e):et.TypeGuard.IsPromise(t)?zka(t,e):et.TypeGuard.IsUint8Array(t)?n2a(t,e):et.TypeGuard.IsUndefined(t)?i2a(t,e):et.TypeGuard.IsUnion(t)?o2a(t,e):et.TypeGuard.IsUnknown(t)?s2a(t,e):et.TypeGuard.IsVoid(t)?c2a(t,e):ame(`Unknown left type operand '${t[x1i.Kind]}'`)}a(cl,"Visit");function l2a(t,e){return cl(t,e)}a(l2a,"ExtendsCheck")});var p_r=I(f_r=>{"use strict";p();Object.defineProperty(f_r,"__esModule",{value:!0});f_r.ExtendsFromMappedResult=m2a;var u2a=f0(),d2a=l0t(),f2a=Rb();function p2a(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,d2a.Extends)(t[c],e,r,n,(0,f2a.Clone)(o));return s}a(p2a,"FromProperties");function h2a(t,e,r,n,o){return p2a(t.properties,e,r,n,o)}a(h2a,"FromMappedResult");function m2a(t,e,r,n,o){let s=h2a(t,e,r,n,o);return(0,u2a.MappedResult)(s)}a(m2a,"ExtendsFromMappedResult")});var l0t=I(m_r=>{"use strict";p();Object.defineProperty(m_r,"__esModule",{value:!0});m_r.Extends=_2a;var O1i=Si(),g2a=gp(),h_r=d_r(),A2a=g_r(),y2a=p_r(),B1i=hs();function E2a(t,e,r,n){let o=(0,h_r.ExtendsCheck)(t,e);return o===h_r.ExtendsResult.Union?(0,g2a.Union)([r,n]):o===h_r.ExtendsResult.True?r:n}a(E2a,"ExtendsResolve");function _2a(t,e,r,n,o){return(0,B1i.IsMappedResult)(t)?(0,y2a.ExtendsFromMappedResult)(t,e,r,n,o):(0,B1i.IsMappedKey)(t)?(0,O1i.CreateType)((0,A2a.ExtendsFromMappedKey)(t,e,r,n,o)):(0,O1i.CreateType)(E2a(t,e,r,n),o)}a(_2a,"Extends")});var g_r=I(A_r=>{"use strict";p();Object.defineProperty(A_r,"__esModule",{value:!0});A_r.ExtendsFromMappedKey=w2a;var v2a=f0(),C2a=CE(),b2a=l0t(),S2a=Rb();function T2a(t,e,r,n,o){return{[t]:(0,b2a.Extends)((0,C2a.Literal)(t),e,r,n,(0,S2a.Clone)(o))}}a(T2a,"FromPropertyKey");function I2a(t,e,r,n,o){return t.reduce((s,c)=>({...s,...T2a(c,e,r,n,o)}),{})}a(I2a,"FromPropertyKeys");function x2a(t,e,r,n,o){return I2a(t.keys,e,r,n,o)}a(x2a,"FromMappedKey");function w2a(t,e,r,n,o){let s=x2a(t,e,r,n,o);return(0,v2a.MappedResult)(s)}a(w2a,"ExtendsFromMappedKey")});var E_r=I(y_r=>{"use strict";p();Object.defineProperty(y_r,"__esModule",{value:!0});y_r.ExtendsUndefinedCheck=d0t;var u0t=_n();function R2a(t){return t.allOf.every(e=>d0t(e))}a(R2a,"Intersect");function P2a(t){return t.anyOf.some(e=>d0t(e))}a(P2a,"Union");function k2a(t){return!d0t(t.not)}a(k2a,"Not");function d0t(t){return t[u0t.Kind]==="Intersect"?R2a(t):t[u0t.Kind]==="Union"?P2a(t):t[u0t.Kind]==="Not"?k2a(t):t[u0t.Kind]==="Undefined"}a(d0t,"ExtendsUndefinedCheck")});var zee=I(M2=>{"use strict";p();var D2a=M2&&M2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jMe=M2&&M2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D2a(e,t,r)};Object.defineProperty(M2,"__esModule",{value:!0});jMe(d_r(),M2);jMe(g_r(),M2);jMe(p_r(),M2);jMe(E_r(),M2);jMe(l0t(),M2)});var v_r=I(__r=>{"use strict";p();Object.defineProperty(__r,"__esModule",{value:!0});__r.ExcludeFromTemplateLiteral=O2a;var N2a=f0t(),M2a=k2();function O2a(t,e){return(0,N2a.Exclude)((0,M2a.TemplateLiteralToUnion)(t),e)}a(O2a,"ExcludeFromTemplateLiteral")});var f0t=I(S_r=>{"use strict";p();Object.defineProperty(S_r,"__esModule",{value:!0});S_r.Exclude=q2a;var C_r=Si(),B2a=gp(),L2a=d0(),p0t=zee(),F2a=T_r(),U2a=v_r(),b_r=hs();function Q2a(t,e){let r=t.filter(n=>(0,p0t.ExtendsCheck)(n,e)===p0t.ExtendsResult.False);return r.length===1?r[0]:(0,B2a.Union)(r)}a(Q2a,"ExcludeRest");function q2a(t,e,r={}){return(0,b_r.IsTemplateLiteral)(t)?(0,C_r.CreateType)((0,U2a.ExcludeFromTemplateLiteral)(t,e),r):(0,b_r.IsMappedResult)(t)?(0,C_r.CreateType)((0,F2a.ExcludeFromMappedResult)(t,e),r):(0,C_r.CreateType)((0,b_r.IsUnion)(t)?Q2a(t.anyOf,e):(0,p0t.ExtendsCheck)(t,e)!==p0t.ExtendsResult.False?(0,L2a.Never)():t,r)}a(q2a,"Exclude")});var T_r=I(I_r=>{"use strict";p();Object.defineProperty(I_r,"__esModule",{value:!0});I_r.ExcludeFromMappedResult=V2a;var j2a=f0(),H2a=f0t();function G2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,H2a.Exclude)(t[n],e);return r}a(G2a,"FromProperties");function $2a(t,e){return G2a(t.properties,e)}a($2a,"FromMappedResult");function V2a(t,e){let r=$2a(t,e);return(0,j2a.MappedResult)(r)}a(V2a,"ExcludeFromMappedResult")});var h0t=I(g8=>{"use strict";p();var W2a=g8&&g8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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_r=g8&&g8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W2a(e,t,r)};Object.defineProperty(g8,"__esModule",{value:!0});x_r(T_r(),g8);x_r(v_r(),g8);x_r(f0t(),g8)});var R_r=I(w_r=>{"use strict";p();Object.defineProperty(w_r,"__esModule",{value:!0});w_r.ExtractFromTemplateLiteral=K2a;var z2a=m0t(),Y2a=k2();function K2a(t,e){return(0,z2a.Extract)((0,Y2a.TemplateLiteralToUnion)(t),e)}a(K2a,"ExtractFromTemplateLiteral")});var m0t=I(D_r=>{"use strict";p();Object.defineProperty(D_r,"__esModule",{value:!0});D_r.Extract=rDa;var P_r=Si(),J2a=gp(),Z2a=d0(),g0t=zee(),X2a=N_r(),eDa=R_r(),k_r=hs();function tDa(t,e){let r=t.filter(n=>(0,g0t.ExtendsCheck)(n,e)!==g0t.ExtendsResult.False);return r.length===1?r[0]:(0,J2a.Union)(r)}a(tDa,"ExtractRest");function rDa(t,e,r){return(0,k_r.IsTemplateLiteral)(t)?(0,P_r.CreateType)((0,eDa.ExtractFromTemplateLiteral)(t,e),r):(0,k_r.IsMappedResult)(t)?(0,P_r.CreateType)((0,X2a.ExtractFromMappedResult)(t,e),r):(0,P_r.CreateType)((0,k_r.IsUnion)(t)?tDa(t.anyOf,e):(0,g0t.ExtendsCheck)(t,e)!==g0t.ExtendsResult.False?t:(0,Z2a.Never)(),r)}a(rDa,"Extract")});var N_r=I(M_r=>{"use strict";p();Object.defineProperty(M_r,"__esModule",{value:!0});M_r.ExtractFromMappedResult=aDa;var nDa=f0(),iDa=m0t();function oDa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,iDa.Extract)(t[n],e);return r}a(oDa,"FromProperties");function sDa(t,e){return oDa(t.properties,e)}a(sDa,"FromMappedResult");function aDa(t,e){let r=sDa(t,e);return(0,nDa.MappedResult)(r)}a(aDa,"ExtractFromMappedResult")});var A0t=I(A8=>{"use strict";p();var cDa=A8&&A8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),O_r=A8&&A8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cDa(e,t,r)};Object.defineProperty(A8,"__esModule",{value:!0});O_r(N_r(),A8);O_r(R_r(),A8);O_r(m0t(),A8)});var L1i=I(y8=>{"use strict";p();var lDa=y8&&y8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uDa=y8&&y8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dDa=y8&&y8.__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 gDa=Yee&&Yee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Yee&&Yee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gDa(e,t,r)};Object.defineProperty(Yee,"__esModule",{value:!0});ADa(L1i(),Yee)});var F1i=I(B_r=>{"use strict";p();Object.defineProperty(B_r,"__esModule",{value:!0});B_r.ReadonlyOptional=_Da;var yDa=VH(),EDa=e4();function _Da(t){return(0,yDa.Readonly)((0,EDa.Optional)(t))}a(_Da,"ReadonlyOptional")});var HMe=I(Kee=>{"use strict";p();var vDa=Kee&&Kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Kee&&Kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vDa(e,t,r)};Object.defineProperty(Kee,"__esModule",{value:!0});CDa(F1i(),Kee)});var H1i=I(cme=>{"use strict";p();Object.defineProperty(cme,"__esModule",{value:!0});cme.Record=UDa;cme.RecordPattern=F_r;cme.RecordKey=QDa;cme.RecordValue=qDa;var bDa=Si(),Q1i=_n(),SDa=d0(),TDa=jH(),q1i=av(),U1i=HH(),IDa=gp(),xDa=k2(),Jee=SMe(),j1i=D2(),wDa=sv(),n4=hs();function Zee(t,e,r){return(0,bDa.CreateType)({[Q1i.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(Zee,"RecordCreateFromPattern");function L_r(t,e,r){let n={};for(let o of t)n[o]=e;return(0,q1i.Object)(n,{...r,[Q1i.Hint]:"Record"})}a(L_r,"RecordCreateFromKeys");function RDa(t,e,r){return(0,xDa.IsTemplateLiteralFinite)(t)?L_r((0,j1i.IndexPropertyKeys)(t),e,r):Zee(t.pattern,e,r)}a(RDa,"FromTemplateLiteralKey");function PDa(t,e,r){return L_r((0,j1i.IndexPropertyKeys)((0,IDa.Union)(t)),e,r)}a(PDa,"FromUnionKey");function kDa(t,e,r){return L_r([t.toString()],e,r)}a(kDa,"FromLiteralKey");function DDa(t,e,r){return Zee(t.source,e,r)}a(DDa,"FromRegExpKey");function NDa(t,e,r){let n=(0,wDa.IsUndefined)(t.pattern)?Jee.PatternStringExact:t.pattern;return Zee(n,e,r)}a(NDa,"FromStringKey");function MDa(t,e,r){return Zee(Jee.PatternStringExact,e,r)}a(MDa,"FromAnyKey");function ODa(t,e,r){return Zee(Jee.PatternNeverExact,e,r)}a(ODa,"FromNeverKey");function BDa(t,e,r){return(0,q1i.Object)({true:e,false:e},r)}a(BDa,"FromBooleanKey");function LDa(t,e,r){return Zee(Jee.PatternNumberExact,e,r)}a(LDa,"FromIntegerKey");function FDa(t,e,r){return Zee(Jee.PatternNumberExact,e,r)}a(FDa,"FromNumberKey");function UDa(t,e,r={}){return(0,n4.IsUnion)(t)?PDa(t.anyOf,e,r):(0,n4.IsTemplateLiteral)(t)?RDa(t,e,r):(0,n4.IsLiteral)(t)?kDa(t.const,e,r):(0,n4.IsBoolean)(t)?BDa(t,e,r):(0,n4.IsInteger)(t)?LDa(t,e,r):(0,n4.IsNumber)(t)?FDa(t,e,r):(0,n4.IsRegExp)(t)?DDa(t,e,r):(0,n4.IsString)(t)?NDa(t,e,r):(0,n4.IsAny)(t)?MDa(t,e,r):(0,n4.IsNever)(t)?ODa(t,e,r):(0,SDa.Never)(r)}a(UDa,"Record");function F_r(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(F_r,"RecordPattern");function QDa(t){let e=F_r(t);return e===Jee.PatternStringExact?(0,U1i.String)():e===Jee.PatternNumberExact?(0,TDa.Number)():(0,U1i.String)({pattern:e})}a(QDa,"RecordKey");function qDa(t){return t.patternProperties[F_r(t)]}a(qDa,"RecordValue")});var lme=I(Xee=>{"use strict";p();var jDa=Xee&&Xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HDa=Xee&&Xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jDa(e,t,r)};Object.defineProperty(Xee,"__esModule",{value:!0});HDa(H1i(),Xee)});var $1i=I(i4=>{"use strict";p();var GDa=i4&&i4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=i4&&i4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G1i=i4&&i4.__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]:dNa(t,e[n])}),{})}a(fNa,"FromProperties");function ume(t,e){return e.map(r=>O2(t,r))}a(ume,"FromTypes");function O2(t,e){return Ob.IsConstructor(e)?XDa(t,e):Ob.IsFunction(e)?eNa(t,e):Ob.IsIntersect(e)?tNa(t,e):Ob.IsUnion(e)?rNa(t,e):Ob.IsTuple(e)?nNa(t,e):Ob.IsArray(e)?iNa(t,e):Ob.IsAsyncIterator(e)?oNa(t,e):Ob.IsIterator(e)?sNa(t,e):Ob.IsPromise(e)?aNa(t,e):Ob.IsObject(e)?cNa(t,e):Ob.IsRecord(e)?lNa(t,e):Ob.IsArgument(e)?uNa(t,e):e}a(O2,"FromType");function pNa(t,e){return O2(e,(0,VDa.CloneType)(t))}a(pNa,"Instantiate")});var E0t=I(ete=>{"use strict";p();var hNa=ete&&ete.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=ete&&ete.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hNa(e,t,r)};Object.defineProperty(ete,"__esModule",{value:!0});mNa($1i(),ete)});var V1i=I(Q_r=>{"use strict";p();Object.defineProperty(Q_r,"__esModule",{value:!0});Q_r.Integer=yNa;var gNa=Si(),ANa=_n();function yNa(t){return(0,gNa.CreateType)({[ANa.Kind]:"Integer",type:"integer"},t)}a(yNa,"Integer")});var _0t=I(tte=>{"use strict";p();var ENa=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]})),_Na=tte&&tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ENa(e,t,r)};Object.defineProperty(tte,"__esModule",{value:!0});_Na(V1i(),tte)});var j_r=I(q_r=>{"use strict";p();Object.defineProperty(q_r,"__esModule",{value:!0});q_r.IntrinsicFromMappedKey=wNa;var vNa=f0(),CNa=rte(),bNa=CE(),SNa=Rb();function TNa(t,e,r){return{[t]:(0,CNa.Intrinsic)((0,bNa.Literal)(t),e,(0,SNa.Clone)(r))}}a(TNa,"MappedIntrinsicPropertyKey");function INa(t,e,r){return t.reduce((o,s)=>({...o,...TNa(s,e,r)}),{})}a(INa,"MappedIntrinsicPropertyKeys");function xNa(t,e,r){return INa(t.keys,e,r)}a(xNa,"MappedIntrinsicProperties");function wNa(t,e,r){let n=xNa(t,e,r);return(0,vNa.MappedResult)(n)}a(wNa,"IntrinsicFromMappedKey")});var rte=I(H_r=>{"use strict";p();Object.defineProperty(H_r,"__esModule",{value:!0});H_r.Intrinsic=J1i;var RNa=Si(),v0t=k2(),PNa=j_r(),W1i=CE(),z1i=gp(),C0t=hs();function kNa(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(kNa,"ApplyUncapitalize");function DNa(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(DNa,"ApplyCapitalize");function NNa(t){return t.toUpperCase()}a(NNa,"ApplyUppercase");function MNa(t){return t.toLowerCase()}a(MNa,"ApplyLowercase");function ONa(t,e,r){let n=(0,v0t.TemplateLiteralParseExact)(t.pattern);if(!(0,v0t.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:Y1i(t.pattern,e)};let c=[...(0,v0t.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,W1i.Literal)(d)),l=K1i(c,e),u=(0,z1i.Union)(l);return(0,v0t.TemplateLiteral)([u],r)}a(ONa,"FromTemplateLiteral");function Y1i(t,e){return typeof t=="string"?e==="Uncapitalize"?kNa(t):e==="Capitalize"?DNa(t):e==="Uppercase"?NNa(t):e==="Lowercase"?MNa(t):t:t.toString()}a(Y1i,"FromLiteralValue");function K1i(t,e){return t.map(r=>J1i(r,e))}a(K1i,"FromRest");function J1i(t,e,r={}){return(0,C0t.IsMappedKey)(t)?(0,PNa.IntrinsicFromMappedKey)(t,e,r):(0,C0t.IsTemplateLiteral)(t)?ONa(t,e,r):(0,C0t.IsUnion)(t)?(0,z1i.Union)(K1i(t.anyOf,e),r):(0,C0t.IsLiteral)(t)?(0,W1i.Literal)(Y1i(t.const,e),r):(0,RNa.CreateType)(t,r)}a(J1i,"Intrinsic")});var Z1i=I(G_r=>{"use strict";p();Object.defineProperty(G_r,"__esModule",{value:!0});G_r.Capitalize=LNa;var BNa=rte();function LNa(t,e={}){return(0,BNa.Intrinsic)(t,"Capitalize",e)}a(LNa,"Capitalize")});var X1i=I($_r=>{"use strict";p();Object.defineProperty($_r,"__esModule",{value:!0});$_r.Lowercase=UNa;var FNa=rte();function UNa(t,e={}){return(0,FNa.Intrinsic)(t,"Lowercase",e)}a(UNa,"Lowercase")});var eSi=I(V_r=>{"use strict";p();Object.defineProperty(V_r,"__esModule",{value:!0});V_r.Uncapitalize=qNa;var QNa=rte();function qNa(t,e={}){return(0,QNa.Intrinsic)(t,"Uncapitalize",e)}a(qNa,"Uncapitalize")});var tSi=I(W_r=>{"use strict";p();Object.defineProperty(W_r,"__esModule",{value:!0});W_r.Uppercase=HNa;var jNa=rte();function HNa(t,e={}){return(0,jNa.Intrinsic)(t,"Uppercase",e)}a(HNa,"Uppercase")});var b0t=I(tR=>{"use strict";p();var GNa=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]})),dme=tR&&tR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GNa(e,t,r)};Object.defineProperty(tR,"__esModule",{value:!0});dme(Z1i(),tR);dme(j_r(),tR);dme(rte(),tR);dme(X1i(),tR);dme(eSi(),tR);dme(tSi(),tR)});var Y_r=I(z_r=>{"use strict";p();Object.defineProperty(z_r,"__esModule",{value:!0});z_r.OmitFromMappedResult=KNa;var $Na=f0(),VNa=S0t(),WNa=Rb();function zNa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,VNa.Omit)(t[o],e,(0,WNa.Clone)(r));return n}a(zNa,"FromProperties");function YNa(t,e,r){return zNa(t.properties,e,r)}a(YNa,"FromMappedResult");function KNa(t,e,r){let n=YNa(t,e,r);return(0,$Na.MappedResult)(n)}a(KNa,"OmitFromMappedResult")});var S0t=I(Z_r=>{"use strict";p();Object.defineProperty(Z_r,"__esModule",{value:!0});Z_r.Omit=fMa;var JNa=Si(),ZNa=Fht(),XNa=_Me(),K_r=QH(),eMa=CE(),tMa=D2(),rMa=xT(),rSi=gp(),nSi=av(),nMa=X_r(),iMa=Y_r(),E8=hs(),oMa=sv();function sMa(t,e){return t.map(r=>J_r(r,e))}a(sMa,"FromIntersect");function aMa(t,e){return t.map(r=>J_r(r,e))}a(aMa,"FromUnion");function cMa(t,e){let{[e]:r,...n}=t;return n}a(cMa,"FromProperty");function lMa(t,e){return e.reduce((r,n)=>cMa(r,n),t)}a(lMa,"FromProperties");function uMa(t,e,r){let n=(0,ZNa.Discard)(t,[XNa.TransformKind,"$id","required","properties"]),o=lMa(r,e);return(0,nSi.Object)(o,n)}a(uMa,"FromObject");function dMa(t){let e=t.reduce((r,n)=>(0,E8.IsLiteralValue)(n)?[...r,(0,eMa.Literal)(n)]:r,[]);return(0,rSi.Union)(e)}a(dMa,"UnionFromPropertyKeys");function J_r(t,e){return(0,E8.IsIntersect)(t)?(0,rMa.Intersect)(sMa(t.allOf,e)):(0,E8.IsUnion)(t)?(0,rSi.Union)(aMa(t.anyOf,e)):(0,E8.IsObject)(t)?uMa(t,e,t.properties):(0,nSi.Object)({})}a(J_r,"OmitResolve");function fMa(t,e,r){let n=(0,oMa.IsArray)(e)?dMa(e):e,o=(0,E8.IsSchema)(e)?(0,tMa.IndexPropertyKeys)(e):e,s=(0,E8.IsRef)(t),c=(0,E8.IsRef)(e);return(0,E8.IsMappedResult)(t)?(0,iMa.OmitFromMappedResult)(t,o,r):(0,E8.IsMappedKey)(e)?(0,nMa.OmitFromMappedKey)(t,e,r):s&&c?(0,K_r.Computed)("Omit",[t,n],r):!s&&c?(0,K_r.Computed)("Omit",[t,n],r):s&&!c?(0,K_r.Computed)("Omit",[t,n],r):(0,JNa.CreateType)({...J_r(t,o),...r})}a(fMa,"Omit")});var X_r=I(evr=>{"use strict";p();Object.defineProperty(evr,"__esModule",{value:!0});evr.OmitFromMappedKey=EMa;var pMa=f0(),hMa=S0t(),mMa=Rb();function gMa(t,e,r){return{[e]:(0,hMa.Omit)(t,[e],(0,mMa.Clone)(r))}}a(gMa,"FromPropertyKey");function AMa(t,e,r){return e.reduce((n,o)=>({...n,...gMa(t,o,r)}),{})}a(AMa,"FromPropertyKeys");function yMa(t,e,r){return AMa(t,e.keys,r)}a(yMa,"FromMappedKey");function EMa(t,e,r){let n=yMa(t,e,r);return(0,pMa.MappedResult)(n)}a(EMa,"OmitFromMappedKey")});var GMe=I(_8=>{"use strict";p();var _Ma=_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]})),tvr=_8&&_8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ma(e,t,r)};Object.defineProperty(_8,"__esModule",{value:!0});tvr(X_r(),_8);tvr(Y_r(),_8);tvr(S0t(),_8)});var nvr=I(rvr=>{"use strict";p();Object.defineProperty(rvr,"__esModule",{value:!0});rvr.PickFromMappedResult=IMa;var vMa=f0(),CMa=T0t(),bMa=Rb();function SMa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,CMa.Pick)(t[o],e,(0,bMa.Clone)(r));return n}a(SMa,"FromProperties");function TMa(t,e,r){return SMa(t.properties,e,r)}a(TMa,"FromMappedResult");function IMa(t,e,r){let n=TMa(t,e,r);return(0,vMa.MappedResult)(n)}a(IMa,"PickFromMappedResult")});var T0t=I(svr=>{"use strict";p();Object.defineProperty(svr,"__esModule",{value:!0});svr.Pick=qMa;var xMa=Si(),wMa=Fht(),ivr=QH(),RMa=xT(),PMa=CE(),iSi=av(),oSi=gp(),kMa=D2(),DMa=_Me(),v8=hs(),NMa=sv(),MMa=avr(),OMa=nvr();function BMa(t,e){return t.map(r=>ovr(r,e))}a(BMa,"FromIntersect");function LMa(t,e){return t.map(r=>ovr(r,e))}a(LMa,"FromUnion");function FMa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(FMa,"FromProperties");function UMa(t,e,r){let n=(0,wMa.Discard)(t,[DMa.TransformKind,"$id","required","properties"]),o=FMa(r,e);return(0,iSi.Object)(o,n)}a(UMa,"FromObject");function QMa(t){let e=t.reduce((r,n)=>(0,v8.IsLiteralValue)(n)?[...r,(0,PMa.Literal)(n)]:r,[]);return(0,oSi.Union)(e)}a(QMa,"UnionFromPropertyKeys");function ovr(t,e){return(0,v8.IsIntersect)(t)?(0,RMa.Intersect)(BMa(t.allOf,e)):(0,v8.IsUnion)(t)?(0,oSi.Union)(LMa(t.anyOf,e)):(0,v8.IsObject)(t)?UMa(t,e,t.properties):(0,iSi.Object)({})}a(ovr,"PickResolve");function qMa(t,e,r){let n=(0,NMa.IsArray)(e)?QMa(e):e,o=(0,v8.IsSchema)(e)?(0,kMa.IndexPropertyKeys)(e):e,s=(0,v8.IsRef)(t),c=(0,v8.IsRef)(e);return(0,v8.IsMappedResult)(t)?(0,OMa.PickFromMappedResult)(t,o,r):(0,v8.IsMappedKey)(e)?(0,MMa.PickFromMappedKey)(t,e,r):s&&c?(0,ivr.Computed)("Pick",[t,n],r):!s&&c?(0,ivr.Computed)("Pick",[t,n],r):s&&!c?(0,ivr.Computed)("Pick",[t,n],r):(0,xMa.CreateType)({...ovr(t,o),...r})}a(qMa,"Pick")});var avr=I(cvr=>{"use strict";p();Object.defineProperty(cvr,"__esModule",{value:!0});cvr.PickFromMappedKey=zMa;var jMa=f0(),HMa=T0t(),GMa=Rb();function $Ma(t,e,r){return{[e]:(0,HMa.Pick)(t,[e],(0,GMa.Clone)(r))}}a($Ma,"FromPropertyKey");function VMa(t,e,r){return e.reduce((n,o)=>({...n,...$Ma(t,o,r)}),{})}a(VMa,"FromPropertyKeys");function WMa(t,e,r){return VMa(t,e.keys,r)}a(WMa,"FromMappedKey");function zMa(t,e,r){let n=WMa(t,e,r);return(0,jMa.MappedResult)(n)}a(zMa,"PickFromMappedKey")});var $Me=I(C8=>{"use strict";p();var YMa=C8&&C8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lvr=C8&&C8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YMa(e,t,r)};Object.defineProperty(C8,"__esModule",{value:!0});lvr(avr(),C8);lvr(nvr(),C8);lvr(T0t(),C8)});var dvr=I(b8=>{"use strict";p();var KMa=b8&&b8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=b8&&b8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ZMa=b8&&b8.__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;ocSi(e))}a(sSi,"FromRest");function cSi(t){return lv.IsComputed(t)?aOa(t.target,t.parameters):lv.IsRef(t)?cOa(t.$ref):lv.IsIntersect(t)?(0,tOa.Intersect)(sSi(t.allOf)):lv.IsUnion(t)?(0,rOa.Union)(sSi(t.anyOf)):lv.IsObject(t)?uOa(t,t.properties):lv.IsBigInt(t)||lv.IsBoolean(t)||lv.IsInteger(t)||lv.IsLiteral(t)||lv.IsNull(t)||lv.IsNumber(t)||lv.IsString(t)||lv.IsSymbol(t)||lv.IsUndefined(t)?t:(0,aSi.Object)({})}a(cSi,"PartialResolve");function dOa(t,e){return lv.IsMappedResult(t)?(0,sOa.PartialFromMappedResult)(t,e):(0,XMa.CreateType)({...cSi(t),...e})}a(dOa,"Partial")});var fvr=I(pvr=>{"use strict";p();Object.defineProperty(pvr,"__esModule",{value:!0});pvr.PartialFromMappedResult=AOa;var fOa=f0(),pOa=dvr(),hOa=Rb();function mOa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,pOa.Partial)(t[n],(0,hOa.Clone)(e));return r}a(mOa,"FromProperties");function gOa(t,e){return mOa(t.properties,e)}a(gOa,"FromMappedResult");function AOa(t,e){let r=gOa(t,e);return(0,fOa.MappedResult)(r)}a(AOa,"PartialFromMappedResult")});var VMe=I(KH=>{"use strict";p();var yOa=KH&&KH.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lSi=KH&&KH.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yOa(e,t,r)};Object.defineProperty(KH,"__esModule",{value:!0});lSi(fvr(),KH);lSi(dvr(),KH)});var mvr=I(S8=>{"use strict";p();var EOa=S8&&S8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Oa=S8&&S8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vOa=S8&&S8.__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;ohSi(e))}a(uSi,"FromRest");function hSi(t){return uv.IsComputed(t)?xOa(t.target,t.parameters):uv.IsRef(t)?wOa(t.$ref):uv.IsIntersect(t)?(0,bOa.Intersect)(uSi(t.allOf)):uv.IsUnion(t)?(0,SOa.Union)(uSi(t.anyOf)):uv.IsObject(t)?POa(t,t.properties):uv.IsBigInt(t)||uv.IsBoolean(t)||uv.IsInteger(t)||uv.IsLiteral(t)||uv.IsNull(t)||uv.IsNumber(t)||uv.IsString(t)||uv.IsSymbol(t)||uv.IsUndefined(t)?t:(0,dSi.Object)({})}a(hSi,"RequiredResolve");function kOa(t,e){return uv.IsMappedResult(t)?(0,IOa.RequiredFromMappedResult)(t,e):(0,COa.CreateType)({...hSi(t),...e})}a(kOa,"Required")});var gvr=I(Avr=>{"use strict";p();Object.defineProperty(Avr,"__esModule",{value:!0});Avr.RequiredFromMappedResult=BOa;var DOa=f0(),NOa=mvr();function MOa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,NOa.Required)(t[n],e);return r}a(MOa,"FromProperties");function OOa(t,e){return MOa(t.properties,e)}a(OOa,"FromMappedResult");function BOa(t,e){let r=OOa(t,e);return(0,DOa.MappedResult)(r)}a(BOa,"RequiredFromMappedResult")});var WMe=I(JH=>{"use strict";p();var LOa=JH&&JH.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mSi=JH&&JH.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LOa(e,t,r)};Object.defineProperty(JH,"__esModule",{value:!0});mSi(gvr(),JH);mSi(mvr(),JH)});var ESi=I(B2=>{"use strict";p();var FOa=B2&&B2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UOa=B2&&B2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QOa=B2&&B2.__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)?Evr(t,r.$ref):Lb(t,r))}a(i5a,"DereferenceParameters");function Evr(t,e){return e in t?ey.IsRef(t[e])?Evr(t,t[e].$ref):Lb(t,t[e]):(0,yvr.Never)()}a(Evr,"Dereference");function o5a(t){return(0,HOa.Awaited)(t[0])}a(o5a,"FromAwaited");function s5a(t){return(0,VOa.Index)(t[0],t[1])}a(s5a,"FromIndex");function a5a(t){return(0,KOa.KeyOf)(t[0])}a(a5a,"FromKeyOf");function c5a(t){return(0,e5a.Partial)(t[0])}a(c5a,"FromPartial");function l5a(t){return(0,ZOa.Omit)(t[0],t[1])}a(l5a,"FromOmit");function u5a(t){return(0,XOa.Pick)(t[0],t[1])}a(u5a,"FromPick");function d5a(t){return(0,t5a.Required)(t[0])}a(d5a,"FromRequired");function f5a(t,e,r){let n=i5a(t,r);return e==="Awaited"?o5a(n):e==="Index"?s5a(n):e==="KeyOf"?a5a(n):e==="Partial"?c5a(n):e==="Omit"?l5a(n):e==="Pick"?u5a(n):e==="Required"?d5a(n):(0,yvr.Never)()}a(f5a,"FromComputed");function p5a(t,e){return(0,jOa.Array)(Lb(t,e))}a(p5a,"FromArray");function h5a(t,e){return(0,GOa.AsyncIterator)(Lb(t,e))}a(h5a,"FromAsyncIterator");function m5a(t,e,r){return(0,$Oa.Constructor)(zMe(t,e),Lb(t,r))}a(m5a,"FromConstructor");function g5a(t,e,r){return(0,WOa.Function)(zMe(t,e),Lb(t,r))}a(g5a,"FromFunction");function A5a(t,e){return(0,zOa.Intersect)(zMe(t,e))}a(A5a,"FromIntersect");function y5a(t,e){return(0,YOa.Iterator)(Lb(t,e))}a(y5a,"FromIterator");function E5a(t,e){return(0,JOa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:Lb(t,e[n])}),{}))}a(E5a,"FromObject");function _5a(t,e){let[r,n]=[Lb(t,(0,ASi.RecordValue)(e)),(0,ASi.RecordPattern)(e)],o=(0,qOa.CloneType)(e);return o.patternProperties[n]=r,o}a(_5a,"FromRecord");function v5a(t,e){return ey.IsRef(e)?{...Evr(t,e.$ref),[I0t.TransformKind]:e[I0t.TransformKind]}:e}a(v5a,"FromTransform");function C5a(t,e){return(0,r5a.Tuple)(zMe(t,e))}a(C5a,"FromTuple");function b5a(t,e){return(0,n5a.Union)(zMe(t,e))}a(b5a,"FromUnion");function zMe(t,e){return e.map(r=>Lb(t,r))}a(zMe,"FromTypes");function Lb(t,e){return ey.IsOptional(e)?(0,Bb.CreateType)(Lb(t,(0,gSi.Discard)(e,[I0t.OptionalKind])),e):ey.IsReadonly(e)?(0,Bb.CreateType)(Lb(t,(0,gSi.Discard)(e,[I0t.ReadonlyKind])),e):ey.IsTransform(e)?(0,Bb.CreateType)(v5a(t,e),e):ey.IsArray(e)?(0,Bb.CreateType)(p5a(t,e.items),e):ey.IsAsyncIterator(e)?(0,Bb.CreateType)(h5a(t,e.items),e):ey.IsComputed(e)?(0,Bb.CreateType)(f5a(t,e.target,e.parameters)):ey.IsConstructor(e)?(0,Bb.CreateType)(m5a(t,e.parameters,e.returns),e):ey.IsFunction(e)?(0,Bb.CreateType)(g5a(t,e.parameters,e.returns),e):ey.IsIntersect(e)?(0,Bb.CreateType)(A5a(t,e.allOf),e):ey.IsIterator(e)?(0,Bb.CreateType)(y5a(t,e.items),e):ey.IsObject(e)?(0,Bb.CreateType)(E5a(t,e.properties),e):ey.IsRecord(e)?(0,Bb.CreateType)(_5a(t,e)):ey.IsTuple(e)?(0,Bb.CreateType)(C5a(t,e.items||[]),e):ey.IsUnion(e)?(0,Bb.CreateType)(b5a(t,e.anyOf),e):e}a(Lb,"FromType");function ySi(t,e){return e in t?Lb(t,t[e]):(0,yvr.Never)()}a(ySi,"ComputeType");function S5a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:ySi(t,r)}),{})}a(S5a,"ComputeModuleProperties")});var vSi=I(YMe=>{"use strict";p();Object.defineProperty(YMe,"__esModule",{value:!0});YMe.TModule=void 0;YMe.Module=x5a;var _Si=a8(),T5a=_n(),I5a=ESi(),x0t=class{static{a(this,"TModule")}constructor(e){let r=(0,I5a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,_Si.CreateType)(this.$defs[e],r)};return(0,_Si.CreateType)({[T5a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};YMe.TModule=x0t;function x5a(t){return new x0t(t)}a(x5a,"Module")});var w0t=I(nte=>{"use strict";p();var w5a=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]})),R5a=nte&&nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&w5a(e,t,r)};Object.defineProperty(nte,"__esModule",{value:!0});R5a(vSi(),nte)});var CSi=I(_vr=>{"use strict";p();Object.defineProperty(_vr,"__esModule",{value:!0});_vr.Not=D5a;var P5a=Si(),k5a=_n();function D5a(t,e){return(0,P5a.CreateType)({[k5a.Kind]:"Not",not:t},e)}a(D5a,"Not")});var R0t=I(ite=>{"use strict";p();var N5a=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]})),M5a=ite&&ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N5a(e,t,r)};Object.defineProperty(ite,"__esModule",{value:!0});M5a(CSi(),ite)});var bSi=I(T8=>{"use strict";p();var O5a=T8&&T8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B5a=T8&&T8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L5a=T8&&T8.__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 j5a=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]})),H5a=ote&&ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j5a(e,t,r)};Object.defineProperty(ote,"__esModule",{value:!0});H5a(bSi(),ote)});var TSi=I(vvr=>{"use strict";p();Object.defineProperty(vvr,"__esModule",{value:!0});vvr.Recursive=z5a;var G5a=Pht(),$5a=Si(),V5a=sv(),SSi=_n(),W5a=0;function z5a(t,e={}){(0,V5a.IsUndefined)(e.$id)&&(e.$id=`T${W5a++}`);let r=(0,G5a.CloneType)(t({[SSi.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,$5a.CreateType)({[SSi.Hint]:"Recursive",...r},e)}a(z5a,"Recursive")});var k0t=I(ste=>{"use strict";p();var Y5a=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]})),K5a=ste&&ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Y5a(e,t,r)};Object.defineProperty(ste,"__esModule",{value:!0});K5a(TSi(),ste)});var ISi=I(Cvr=>{"use strict";p();Object.defineProperty(Cvr,"__esModule",{value:!0});Cvr.RegExp=e4a;var J5a=Si(),Z5a=sv(),X5a=_n();function e4a(t,e){let r=(0,Z5a.IsString)(t)?new globalThis.RegExp(t):t;return(0,J5a.CreateType)({[X5a.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(e4a,"RegExp")});var D0t=I(ate=>{"use strict";p();var t4a=ate&&ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r4a=ate&&ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t4a(e,t,r)};Object.defineProperty(ate,"__esModule",{value:!0});r4a(ISi(),ate)});var xSi=I(Svr=>{"use strict";p();Object.defineProperty(Svr,"__esModule",{value:!0});Svr.Rest=i4a;var bvr=hs();function n4a(t){return(0,bvr.IsIntersect)(t)?t.allOf:(0,bvr.IsUnion)(t)?t.anyOf:(0,bvr.IsTuple)(t)?t.items??[]:[]}a(n4a,"RestResolve");function i4a(t){return n4a(t)}a(i4a,"Rest")});var N0t=I(cte=>{"use strict";p();var o4a=cte&&cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s4a=cte&&cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o4a(e,t,r)};Object.defineProperty(cte,"__esModule",{value:!0});s4a(xSi(),cte)});var wSi=I(I8=>{"use strict";p();var a4a=I8&&I8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c4a=I8&&I8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l4a=I8&&I8.__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 h4a=lte&<e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m4a=lte&<e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h4a(e,t,r)};Object.defineProperty(lte,"__esModule",{value:!0});m4a(wSi(),lte)});var PSi=I(RSi=>{"use strict";p();Object.defineProperty(RSi,"__esModule",{value:!0})});var DSi=I(kSi=>{"use strict";p();Object.defineProperty(kSi,"__esModule",{value:!0});var tmp=_n()});var MSi=I(ZH=>{"use strict";p();var g4a=ZH&&ZH.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NSi=ZH&&ZH.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g4a(e,t,r)};Object.defineProperty(ZH,"__esModule",{value:!0});NSi(PSi(),ZH);NSi(DSi(),ZH)});var BSi=I(OSi=>{"use strict";p();Object.defineProperty(OSi,"__esModule",{value:!0})});var LSi=I(ute=>{"use strict";p();var A4a=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]})),y4a=ute&&ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A4a(e,t,r)};Object.defineProperty(ute,"__esModule",{value:!0});y4a(BSi(),ute)});var FSi=I(dte=>{"use strict";p();Object.defineProperty(dte,"__esModule",{value:!0});dte.TransformEncodeBuilder=dte.TransformDecodeBuilder=void 0;dte.Transform=_4a;var O0t=_n(),E4a=hs(),B0t=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new L0t(this.schema,e)}};dte.TransformDecodeBuilder=B0t;var L0t=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[O0t.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[O0t.TransformKind].Decode(c)),"Decode")};return{...r,[O0t.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[O0t.TransformKind]:n}}Encode(e){return(0,E4a.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};dte.TransformEncodeBuilder=L0t;function _4a(t){return new B0t(t)}a(_4a,"Transform")});var F0t=I(fte=>{"use strict";p();var v4a=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]})),C4a=fte&&fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v4a(e,t,r)};Object.defineProperty(fte,"__esModule",{value:!0});C4a(FSi(),fte)});var QSi=I(Tvr=>{"use strict";p();Object.defineProperty(Tvr,"__esModule",{value:!0});Tvr.Unsafe=S4a;var b4a=Si(),USi=_n();function S4a(t={}){return(0,b4a.CreateType)({[USi.Kind]:t[USi.Kind]??"Unsafe"},t)}a(S4a,"Unsafe")});var KMe=I(pte=>{"use strict";p();var T4a=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]})),I4a=pte&&pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T4a(e,t,r)};Object.defineProperty(pte,"__esModule",{value:!0});I4a(QSi(),pte)});var qSi=I(Ivr=>{"use strict";p();Object.defineProperty(Ivr,"__esModule",{value:!0});Ivr.Void=R4a;var x4a=Si(),w4a=_n();function R4a(t){return(0,x4a.CreateType)({[w4a.Kind]:"Void",type:"void"},t)}a(R4a,"Void")});var U0t=I(hte=>{"use strict";p();var P4a=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]})),k4a=hte&&hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P4a(e,t,r)};Object.defineProperty(hte,"__esModule",{value:!0});k4a(qSi(),hte)});var wvr=I(q0t=>{"use strict";p();Object.defineProperty(q0t,"__esModule",{value:!0});q0t.JsonTypeBuilder=void 0;var D4a=Y0e(),N4a=K0e(),M4a=wMe(),O4a=t0t(),B4a=n0t(),L4a=o0t(),F4a=h0t(),U4a=zee(),Q4a=A0t(),q4a=D2(),j4a=_0t(),H4a=xT(),Q0t=b0t(),G4a=N2(),$4a=CE(),V4a=f0(),W4a=d0(),z4a=R0t(),Y4a=FMe(),K4a=w0t(),J4a=jH(),Z4a=av(),X4a=GMe(),eBa=e4(),tBa=VMe(),rBa=$Me(),nBa=VH(),iBa=HMe(),oBa=lme(),sBa=k0t(),aBa=zH(),cBa=WMe(),lBa=N0t(),uBa=HH(),dBa=k2(),fBa=F0t(),pBa=f8(),hBa=gp(),mBa=YH(),gBa=KMe(),xvr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,iBa.ReadonlyOptional)(e)}Readonly(e,r){return(0,nBa.Readonly)(e,r??!0)}Optional(e,r){return(0,eBa.Optional)(e,r??!0)}Any(e){return(0,D4a.Any)(e)}Array(e,r){return(0,N4a.Array)(e,r)}Boolean(e){return(0,M4a.Boolean)(e)}Capitalize(e,r){return(0,Q0t.Capitalize)(e,r)}Composite(e,r){return(0,O4a.Composite)(e,r)}Const(e,r){return(0,B4a.Const)(e,r)}Enum(e,r){return(0,L4a.Enum)(e,r)}Exclude(e,r,n){return(0,F4a.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,U4a.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,Q4a.Extract)(e,r,n)}Index(e,r,n){return(0,q4a.Index)(e,r,n)}Integer(e){return(0,j4a.Integer)(e)}Intersect(e,r){return(0,H4a.Intersect)(e,r)}KeyOf(e,r){return(0,G4a.KeyOf)(e,r)}Literal(e,r){return(0,$4a.Literal)(e,r)}Lowercase(e,r){return(0,Q0t.Lowercase)(e,r)}Mapped(e,r,n){return(0,V4a.Mapped)(e,r,n)}Module(e){return(0,K4a.Module)(e)}Never(e){return(0,W4a.Never)(e)}Not(e,r){return(0,z4a.Not)(e,r)}Null(e){return(0,Y4a.Null)(e)}Number(e){return(0,J4a.Number)(e)}Object(e,r){return(0,Z4a.Object)(e,r)}Omit(e,r,n){return(0,X4a.Omit)(e,r,n)}Partial(e,r){return(0,tBa.Partial)(e,r)}Pick(e,r,n){return(0,rBa.Pick)(e,r,n)}Record(e,r,n){return(0,oBa.Record)(e,r,n)}Recursive(e,r){return(0,sBa.Recursive)(e,r)}Ref(...e){return(0,aBa.Ref)(e[0],e[1])}Required(e,r){return(0,cBa.Required)(e,r)}Rest(e){return(0,lBa.Rest)(e)}String(e){return(0,uBa.String)(e)}TemplateLiteral(e,r){return(0,dBa.TemplateLiteral)(e,r)}Transform(e){return(0,fBa.Transform)(e)}Tuple(e,r){return(0,pBa.Tuple)(e,r)}Uncapitalize(e,r){return(0,Q0t.Uncapitalize)(e,r)}Union(e,r){return(0,hBa.Union)(e,r)}Unknown(e){return(0,mBa.Unknown)(e)}Unsafe(e){return(0,gBa.Unsafe)(e)}Uppercase(e,r){return(0,Q0t.Uppercase)(e,r)}};q0t.JsonTypeBuilder=xvr});var jSi=I(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Rest=Mt.Required=Mt.RegExp=Mt.Ref=Mt.Recursive=Mt.Record=Mt.ReadonlyOptional=Mt.Readonly=Mt.Promise=Mt.Pick=Mt.Partial=Mt.Parameters=Mt.Optional=Mt.Omit=Mt.Object=Mt.Number=Mt.Null=Mt.Not=Mt.Never=Mt.Module=Mt.Mapped=Mt.Literal=Mt.KeyOf=Mt.Iterator=Mt.Uppercase=Mt.Lowercase=Mt.Uncapitalize=Mt.Capitalize=Mt.Intersect=Mt.Integer=Mt.Instantiate=Mt.InstanceType=Mt.Index=Mt.Function=Mt.Extract=Mt.Extends=Mt.Exclude=Mt.Enum=Mt.Date=Mt.ConstructorParameters=Mt.Constructor=Mt.Const=Mt.Composite=Mt.Boolean=Mt.BigInt=Mt.Awaited=Mt.AsyncIterator=Mt.Array=Mt.Argument=Mt.Any=void 0;Mt.Void=Mt.Unsafe=Mt.Unknown=Mt.Union=Mt.Undefined=Mt.Uint8Array=Mt.Tuple=Mt.Transform=Mt.TemplateLiteral=Mt.Symbol=Mt.String=Mt.ReturnType=void 0;var ABa=Y0e();Object.defineProperty(Mt,"Any",{enumerable:!0,get:a(function(){return ABa.Any},"get")});var yBa=Lht();Object.defineProperty(Mt,"Argument",{enumerable:!0,get:a(function(){return yBa.Argument},"get")});var EBa=K0e();Object.defineProperty(Mt,"Array",{enumerable:!0,get:a(function(){return EBa.Array},"get")});var _Ba=J0e();Object.defineProperty(Mt,"AsyncIterator",{enumerable:!0,get:a(function(){return _Ba.AsyncIterator},"get")});var vBa=BMe();Object.defineProperty(Mt,"Awaited",{enumerable:!0,get:a(function(){return vBa.Awaited},"get")});var CBa=rme();Object.defineProperty(Mt,"BigInt",{enumerable:!0,get:a(function(){return CBa.BigInt},"get")});var bBa=wMe();Object.defineProperty(Mt,"Boolean",{enumerable:!0,get:a(function(){return bBa.Boolean},"get")});var SBa=t0t();Object.defineProperty(Mt,"Composite",{enumerable:!0,get:a(function(){return SBa.Composite},"get")});var TBa=n0t();Object.defineProperty(Mt,"Const",{enumerable:!0,get:a(function(){return TBa.Const},"get")});var IBa=Z0e();Object.defineProperty(Mt,"Constructor",{enumerable:!0,get:a(function(){return IBa.Constructor},"get")});var xBa=i0t();Object.defineProperty(Mt,"ConstructorParameters",{enumerable:!0,get:a(function(){return xBa.ConstructorParameters},"get")});var wBa=LMe();Object.defineProperty(Mt,"Date",{enumerable:!0,get:a(function(){return wBa.Date},"get")});var RBa=o0t();Object.defineProperty(Mt,"Enum",{enumerable:!0,get:a(function(){return RBa.Enum},"get")});var PBa=h0t();Object.defineProperty(Mt,"Exclude",{enumerable:!0,get:a(function(){return PBa.Exclude},"get")});var kBa=zee();Object.defineProperty(Mt,"Extends",{enumerable:!0,get:a(function(){return kBa.Extends},"get")});var DBa=A0t();Object.defineProperty(Mt,"Extract",{enumerable:!0,get:a(function(){return DBa.Extract},"get")});var NBa=qH();Object.defineProperty(Mt,"Function",{enumerable:!0,get:a(function(){return NBa.Function},"get")});var MBa=D2();Object.defineProperty(Mt,"Index",{enumerable:!0,get:a(function(){return MBa.Index},"get")});var OBa=y0t();Object.defineProperty(Mt,"InstanceType",{enumerable:!0,get:a(function(){return OBa.InstanceType},"get")});var BBa=E0t();Object.defineProperty(Mt,"Instantiate",{enumerable:!0,get:a(function(){return BBa.Instantiate},"get")});var LBa=_0t();Object.defineProperty(Mt,"Integer",{enumerable:!0,get:a(function(){return LBa.Integer},"get")});var FBa=xT();Object.defineProperty(Mt,"Intersect",{enumerable:!0,get:a(function(){return FBa.Intersect},"get")});var j0t=b0t();Object.defineProperty(Mt,"Capitalize",{enumerable:!0,get:a(function(){return j0t.Capitalize},"get")});Object.defineProperty(Mt,"Uncapitalize",{enumerable:!0,get:a(function(){return j0t.Uncapitalize},"get")});Object.defineProperty(Mt,"Lowercase",{enumerable:!0,get:a(function(){return j0t.Lowercase},"get")});Object.defineProperty(Mt,"Uppercase",{enumerable:!0,get:a(function(){return j0t.Uppercase},"get")});var UBa=ime();Object.defineProperty(Mt,"Iterator",{enumerable:!0,get:a(function(){return UBa.Iterator},"get")});var QBa=N2();Object.defineProperty(Mt,"KeyOf",{enumerable:!0,get:a(function(){return QBa.KeyOf},"get")});var qBa=CE();Object.defineProperty(Mt,"Literal",{enumerable:!0,get:a(function(){return qBa.Literal},"get")});var jBa=f0();Object.defineProperty(Mt,"Mapped",{enumerable:!0,get:a(function(){return jBa.Mapped},"get")});var HBa=w0t();Object.defineProperty(Mt,"Module",{enumerable:!0,get:a(function(){return HBa.Module},"get")});var GBa=d0();Object.defineProperty(Mt,"Never",{enumerable:!0,get:a(function(){return GBa.Never},"get")});var $Ba=R0t();Object.defineProperty(Mt,"Not",{enumerable:!0,get:a(function(){return $Ba.Not},"get")});var VBa=FMe();Object.defineProperty(Mt,"Null",{enumerable:!0,get:a(function(){return VBa.Null},"get")});var WBa=jH();Object.defineProperty(Mt,"Number",{enumerable:!0,get:a(function(){return WBa.Number},"get")});var zBa=av();Object.defineProperty(Mt,"Object",{enumerable:!0,get:a(function(){return zBa.Object},"get")});var YBa=GMe();Object.defineProperty(Mt,"Omit",{enumerable:!0,get:a(function(){return YBa.Omit},"get")});var KBa=e4();Object.defineProperty(Mt,"Optional",{enumerable:!0,get:a(function(){return KBa.Optional},"get")});var JBa=P0t();Object.defineProperty(Mt,"Parameters",{enumerable:!0,get:a(function(){return JBa.Parameters},"get")});var ZBa=VMe();Object.defineProperty(Mt,"Partial",{enumerable:!0,get:a(function(){return ZBa.Partial},"get")});var XBa=$Me();Object.defineProperty(Mt,"Pick",{enumerable:!0,get:a(function(){return XBa.Pick},"get")});var eLa=NMe();Object.defineProperty(Mt,"Promise",{enumerable:!0,get:a(function(){return eLa.Promise},"get")});var tLa=VH();Object.defineProperty(Mt,"Readonly",{enumerable:!0,get:a(function(){return tLa.Readonly},"get")});var rLa=HMe();Object.defineProperty(Mt,"ReadonlyOptional",{enumerable:!0,get:a(function(){return rLa.ReadonlyOptional},"get")});var nLa=lme();Object.defineProperty(Mt,"Record",{enumerable:!0,get:a(function(){return nLa.Record},"get")});var iLa=k0t();Object.defineProperty(Mt,"Recursive",{enumerable:!0,get:a(function(){return iLa.Recursive},"get")});var oLa=zH();Object.defineProperty(Mt,"Ref",{enumerable:!0,get:a(function(){return oLa.Ref},"get")});var sLa=D0t();Object.defineProperty(Mt,"RegExp",{enumerable:!0,get:a(function(){return sLa.RegExp},"get")});var aLa=WMe();Object.defineProperty(Mt,"Required",{enumerable:!0,get:a(function(){return aLa.Required},"get")});var cLa=N0t();Object.defineProperty(Mt,"Rest",{enumerable:!0,get:a(function(){return cLa.Rest},"get")});var lLa=M0t();Object.defineProperty(Mt,"ReturnType",{enumerable:!0,get:a(function(){return lLa.ReturnType},"get")});var uLa=HH();Object.defineProperty(Mt,"String",{enumerable:!0,get:a(function(){return uLa.String},"get")});var dLa=UMe();Object.defineProperty(Mt,"Symbol",{enumerable:!0,get:a(function(){return dLa.Symbol},"get")});var fLa=k2();Object.defineProperty(Mt,"TemplateLiteral",{enumerable:!0,get:a(function(){return fLa.TemplateLiteral},"get")});var pLa=F0t();Object.defineProperty(Mt,"Transform",{enumerable:!0,get:a(function(){return pLa.Transform},"get")});var hLa=f8();Object.defineProperty(Mt,"Tuple",{enumerable:!0,get:a(function(){return hLa.Tuple},"get")});var mLa=qMe();Object.defineProperty(Mt,"Uint8Array",{enumerable:!0,get:a(function(){return mLa.Uint8Array},"get")});var gLa=QMe();Object.defineProperty(Mt,"Undefined",{enumerable:!0,get:a(function(){return gLa.Undefined},"get")});var ALa=gp();Object.defineProperty(Mt,"Union",{enumerable:!0,get:a(function(){return ALa.Union},"get")});var yLa=YH();Object.defineProperty(Mt,"Unknown",{enumerable:!0,get:a(function(){return yLa.Unknown},"get")});var ELa=KMe();Object.defineProperty(Mt,"Unsafe",{enumerable:!0,get:a(function(){return ELa.Unsafe},"get")});var _La=U0t();Object.defineProperty(Mt,"Void",{enumerable:!0,get:a(function(){return _La.Void},"get")})});var HSi=I(H0t=>{"use strict";p();Object.defineProperty(H0t,"__esModule",{value:!0});H0t.JavaScriptTypeBuilder=void 0;var vLa=wvr(),CLa=Lht(),bLa=J0e(),SLa=BMe(),TLa=rme(),ILa=Z0e(),xLa=i0t(),wLa=LMe(),RLa=qH(),PLa=y0t(),kLa=E0t(),DLa=ime(),NLa=P0t(),MLa=NMe(),OLa=D0t(),BLa=M0t(),LLa=UMe(),FLa=qMe(),ULa=QMe(),QLa=U0t(),Rvr=class extends vLa.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,CLa.Argument)(e)}AsyncIterator(e,r){return(0,bLa.AsyncIterator)(e,r)}Awaited(e,r){return(0,SLa.Awaited)(e,r)}BigInt(e){return(0,TLa.BigInt)(e)}ConstructorParameters(e,r){return(0,xLa.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,ILa.Constructor)(e,r,n)}Date(e={}){return(0,wLa.Date)(e)}Function(e,r,n){return(0,RLa.Function)(e,r,n)}InstanceType(e,r){return(0,PLa.InstanceType)(e,r)}Instantiate(e,r){return(0,kLa.Instantiate)(e,r)}Iterator(e,r){return(0,DLa.Iterator)(e,r)}Parameters(e,r){return(0,NLa.Parameters)(e,r)}Promise(e,r){return(0,MLa.Promise)(e,r)}RegExp(e,r){return(0,OLa.RegExp)(e,r)}ReturnType(e,r){return(0,BLa.ReturnType)(e,r)}Symbol(e){return(0,LLa.Symbol)(e)}Undefined(e){return(0,ULa.Undefined)(e)}Uint8Array(e){return(0,FLa.Uint8Array)(e)}Void(e){return(0,QLa.Void)(e)}};H0t.JavaScriptTypeBuilder=Rvr});var GSi=I(Fb=>{"use strict";p();var qLa=Fb&&Fb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jLa=Fb&&Fb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HLa=Fb&&Fb.__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 zLa=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]})),hn=Xr&&Xr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zLa(e,t,r)};Object.defineProperty(Xr,"__esModule",{value:!0});hn(Eyr(),Xr);hn(a8(),Xr);hn(bf(),Xr);hn(wyr(),Xr);hn($Ci(),Xr);hn(SMe(),Xr);hn(z0e(),Xr);hn(TMe(),Xr);hn(_n(),Xr);hn(Y0e(),Xr);hn(K0e(),Xr);hn(Lht(),Xr);hn(J0e(),Xr);hn(BMe(),Xr);hn(rme(),Xr);hn(wMe(),Xr);hn(t0t(),Xr);hn(n0t(),Xr);hn(Z0e(),Xr);hn(i0t(),Xr);hn(LMe(),Xr);hn(o0t(),Xr);hn(h0t(),Xr);hn(zee(),Xr);hn(A0t(),Xr);hn(qH(),Xr);hn(D2(),Xr);hn(y0t(),Xr);hn(E0t(),Xr);hn(_0t(),Xr);hn(xT(),Xr);hn(ime(),Xr);hn(b0t(),Xr);hn(N2(),Xr);hn(CE(),Xr);hn(w0t(),Xr);hn(f0(),Xr);hn(d0(),Xr);hn(R0t(),Xr);hn(FMe(),Xr);hn(jH(),Xr);hn(av(),Xr);hn(GMe(),Xr);hn(e4(),Xr);hn(P0t(),Xr);hn(VMe(),Xr);hn($Me(),Xr);hn(NMe(),Xr);hn(VH(),Xr);hn(HMe(),Xr);hn(lme(),Xr);hn(k0t(),Xr);hn(zH(),Xr);hn(D0t(),Xr);hn(WMe(),Xr);hn(N0t(),Xr);hn(M0t(),Xr);hn(MSi(),Xr);hn(LSi(),Xr);hn(HH(),Xr);hn(UMe(),Xr);hn(k2(),Xr);hn(F0t(),Xr);hn(f8(),Xr);hn(qMe(),Xr);hn(QMe(),Xr);hn(gp(),Xr);hn(YH(),Xr);hn(KMe(),Xr);hn(U0t(),Xr);hn(GSi(),Xr)});var VSi=I(rR=>{"use strict";p();var YLa=rR&&rR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KLa=rR&&rR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JLa=rR&&rR.__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 XLa=o4&&o4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e3a=o4&&o4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),t3a=o4&&o4.__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($0t,"__esModule",{value:!0});$0t.ContextItemOrigin=void 0;var YSi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(YSi||($0t.ContextItemOrigin=YSi={}))});var ZSi=I(Iu=>{"use strict";p();Object.defineProperty(Iu,"__esModule",{value:!0});Iu.RangeSchema=Iu.WorkspaceFolder=Iu.VersionedTextDocumentIdentifier=Iu.TextEdit=Iu.TextDocumentItem=Iu.Range=Iu.Position=Iu.DocumentUri=Iu.Disposable=Iu.Command=Iu.CancellationTokenSource=Iu.CancellationToken=void 0;var V0t=G0t(),L2=ti();Object.defineProperty(Iu,"CancellationToken",{enumerable:!0,get:a(function(){return L2.CancellationToken},"get")});Object.defineProperty(Iu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return L2.CancellationTokenSource},"get")});Object.defineProperty(Iu,"Command",{enumerable:!0,get:a(function(){return L2.Command},"get")});Object.defineProperty(Iu,"Disposable",{enumerable:!0,get:a(function(){return L2.Disposable},"get")});Object.defineProperty(Iu,"DocumentUri",{enumerable:!0,get:a(function(){return L2.DocumentUri},"get")});Object.defineProperty(Iu,"Position",{enumerable:!0,get:a(function(){return L2.Position},"get")});Object.defineProperty(Iu,"Range",{enumerable:!0,get:a(function(){return L2.Range},"get")});Object.defineProperty(Iu,"TextDocumentItem",{enumerable:!0,get:a(function(){return L2.TextDocumentItem},"get")});Object.defineProperty(Iu,"TextEdit",{enumerable:!0,get:a(function(){return L2.TextEdit},"get")});Object.defineProperty(Iu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return L2.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Iu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return L2.WorkspaceFolder},"get")});var JSi=V0t.Type.Object({line:V0t.Type.Integer({minimum:0}),character:V0t.Type.Integer({minimum:0})});Iu.RangeSchema=V0t.Type.Object({start:JSi,end:JSi})});var eTi=I(XSi=>{"use strict";p();Object.defineProperty(XSi,"__esModule",{value:!0})});var ZMe=I(Sf=>{"use strict";p();var n3a=Sf&&Sf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JMe=Sf&&Sf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&n3a(e,t,r)};Object.defineProperty(Sf,"__esModule",{value:!0});Sf.TextEdit=Sf.Range=Sf.Position=Sf.Disposable=Sf.CancellationTokenSource=Sf.CancellationToken=void 0;var fme=ti();Object.defineProperty(Sf,"CancellationToken",{enumerable:!0,get:a(function(){return fme.CancellationToken},"get")});Object.defineProperty(Sf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return fme.CancellationTokenSource},"get")});Object.defineProperty(Sf,"Disposable",{enumerable:!0,get:a(function(){return fme.Disposable},"get")});Object.defineProperty(Sf,"Position",{enumerable:!0,get:a(function(){return fme.Position},"get")});Object.defineProperty(Sf,"Range",{enumerable:!0,get:a(function(){return fme.Range},"get")});Object.defineProperty(Sf,"TextEdit",{enumerable:!0,get:a(function(){return fme.TextEdit},"get")});JMe(VSi(),Sf);JMe(zSi(),Sf);JMe(KSi(),Sf);JMe(ZSi(),Sf);JMe(eTi(),Sf)});var kvr=I(wT=>{"use strict";p();var i3a=wT&&wT.__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},tTi=wT&&wT.__param||function(t,e){return function(r,n){e(r,n,t)}},o3a=wT&&wT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wT,"__esModule",{value:!0});wT.CompletionNotifier=wT.ICompletionsNotifierService=void 0;var s3a=o3a(require("events")),a3a=rn(),c3a=aee(),l3a=ZMe(),u3a=xg(),d3a=pMe(),W0t="CompletionRequested";wT.ICompletionsNotifierService=(0,a3a.createServiceIdentifier)("ICompletionsNotifierService");var Pvr=class{static{a(this,"CompletionNotifier")}#e=new s3a.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(W0t,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,u3a.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${W0t}`);return this.#e.on(W0t,r),l3a.Disposable.create(()=>this.#e.off(W0t,r))}};wT.CompletionNotifier=Pvr;wT.CompletionNotifier=Pvr=i3a([tTi(0,d3a.ICompletionsPromiseQueueService),tTi(1,c3a.ICompletionsTelemetryService)],Pvr)});var Dvr=I(z0t=>{"use strict";p();Object.defineProperty(z0t,"__esModule",{value:!0});z0t.ICompletionsObservableWorkspace=void 0;var f3a=Ls();z0t.ICompletionsObservableWorkspace=(0,f3a.createDecorator)("ICompletionsObservableWorkspace")});var Tl=I(F2=>{"use strict";p();Object.defineProperty(F2,"__esModule",{value:!0});F2.logger=F2.Logger=F2.ICompletionsLogTargetService=F2.LogLevel=void 0;var p3a=rn(),h3a=aee(),m3a=xg(),mte;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(mte||(F2.LogLevel=mte={}));F2.ICompletionsLogTargetService=(0,p3a.createServiceIdentifier)("ICompletionsLogTargetService");var Y0t=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,mte.DEBUG,...r)}info(e,...r){this.log(e,mte.INFO,...r)}warn(e,...r){this.log(e,mte.WARN,...r)}error(e,...r){this.log(e,mte.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,m3a.telemetryException)(e.get(h3a.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(F2.ICompletionsLogTargetService),mte.ERROR,`${o}:`,s)}};F2.Logger=Y0t;F2.logger=new Y0t("default")});var nTi=I(XH=>{"use strict";p();Object.defineProperty(XH,"__esModule",{value:!0});XH.INotificationService=XH.NullNotificationService=XH.ProgressLocation=void 0;var g3a=rn(),A3a=Ak(),rTi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(rTi||(XH.ProgressLocation=rTi={}));var Nvr=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")},A3a.CancellationToken.None))}};XH.NullNotificationService=Nvr;XH.INotificationService=(0,g3a.createServiceIdentifier)("INotificationService")});var Ovr=I(U2=>{"use strict";p();var y3a=U2&&U2.__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},E3a=U2&&U2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(U2,"__esModule",{value:!0});U2.ExtensionNotificationSender=U2.ICompletionsNotificationSender=void 0;var _3a=nTi(),v3a=rn();U2.ICompletionsNotificationSender=(0,v3a.createServiceIdentifier)("ICompletionsNotificationSender");var Mvr=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}}};U2.ExtensionNotificationSender=Mvr;U2.ExtensionNotificationSender=Mvr=y3a([E3a(0,_3a.INotificationService)],Mvr)});var Fvr=I(Q2=>{"use strict";p();var C3a=Q2&&Q2.__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},Bvr=Q2&&Q2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Q2,"__esModule",{value:!0});Q2.UserErrorNotifier=Q2.ICompletionsUserErrorNotifierService=void 0;var b3a=Y5(),S3a=rn(),T3a=Ku(),sTi=Tl(),I3a=Ovr(),x3a=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],iTi="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.",oTi="https://gh.io/copilot-network-errors";Q2.ICompletionsUserErrorNotifierService=(0,S3a.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var Lvr=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&&x3a.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new sTi.Logger("certificates").error(this._logTarget,`${iTi} Please visit ${oTi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(iTi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(T3a.URI.parse(oTi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};Q2.UserErrorNotifier=Lvr;Q2.UserErrorNotifier=Lvr=C3a([Bvr(0,sTi.ICompletionsLogTargetService),Bvr(1,I3a.ICompletionsNotificationSender),Bvr(2,b3a.IEnvService)],Lvr)});var Ap=I(pme=>{"use strict";p();Object.defineProperty(pme,"__esModule",{value:!0});pme.NullExperimentationService=pme.IExperimentationService=void 0;var w3a=rn(),R3a=Cc();pme.IExperimentationService=(0,w3a.createServiceIdentifier)("IExperimentationService");var Uvr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new R3a.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};pme.NullExperimentationService=Uvr});var eG=I(Ub=>{"use strict";p();Object.defineProperty(Ub,"__esModule",{value:!0});Ub.DEFAULT_PROMPT_ALLOCATION_PERCENT=Ub.DEFAULT_SUFFIX_MATCH_THRESHOLD=Ub.DEFAULT_NUM_SNIPPETS=Ub.DEFAULT_MAX_PROMPT_LENGTH=Ub.DEFAULT_MAX_COMPLETION_LENGTH=void 0;Ub.normalizeLanguageId=k3a;Ub.DEFAULT_MAX_COMPLETION_LENGTH=500;Ub.DEFAULT_MAX_PROMPT_LENGTH=8192-Ub.DEFAULT_MAX_COMPLETION_LENGTH;Ub.DEFAULT_NUM_SNIPPETS=4;Ub.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;Ub.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var P3a={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function k3a(t){return t=t.toLowerCase(),P3a[t]??t}a(k3a,"normalizeLanguageId")});var aTi=I(Qvr=>{"use strict";p();Object.defineProperty(Qvr,"__esModule",{value:!0});Qvr.getUserKind=N3a;function D3a(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(D3a,"findKnownOrg");function N3a(t){let e=t.organizationList??[];return D3a(e)??""}a(N3a,"getUserKind")});var XMe=I(s4=>{"use strict";p();Object.defineProperty(s4,"__esModule",{value:!0});s4.IEndpointProvider=s4.ModelSupportedEndpoint=void 0;s4.isEndpointEditToolName=B3a;s4.isChatModelInformation=L3a;s4.isEmbeddingModelInformation=F3a;s4.isCompletionModelInformation=U3a;var M3a=rn(),O3a=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function B3a(t){return O3a.has(t)}a(B3a,"isEndpointEditToolName");var cTi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(cTi||(s4.ModelSupportedEndpoint=cTi={}));function L3a(t){return t.capabilities.type==="chat"}a(L3a,"isChatModelInformation");function F3a(t){return t.capabilities.type==="embeddings"}a(F3a,"isEmbeddingModelInformation");function U3a(t){return t.capabilities.type==="completion"}a(U3a,"isCompletionModelInformation");s4.IEndpointProvider=(0,M3a.createServiceIdentifier)("IEndpointProvider")});var uTi=I(qvr=>{"use strict";p();Object.defineProperty(qvr,"__esModule",{value:!0});qvr.getUserSelectedModelConfiguration=Q3a;var lTi=EE();function Q3a(t){let e=(0,lTi.getConfig)(t,lTi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(Q3a,"getUserSelectedModelConfiguration")});var fTi=I(ty=>{"use strict";p();Object.defineProperty(ty,"__esModule",{value:!0});ty.isReadable=j3a;ty.isReadableStream=dTi;ty.isReadableBufferedStream=H3a;ty.newWriteableStream=eOe;ty.consumeReadable=G3a;ty.peekReadable=$3a;ty.consumeStream=V3a;ty.listenStream=J0t;ty.peekStream=W3a;ty.toStream=z3a;ty.emptyStream=Y3a;ty.toReadable=K3a;ty.transform=J3a;ty.prefixedReadable=Z3a;ty.prefixedStream=X3a;var q3a=Cs(),K0t=wo();function j3a(t){let e=t;return e?typeof e.read=="function":!1}a(j3a,"isReadable");function dTi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(dTi,"isReadableStream");function H3a(t){let e=t;return e?dTi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(H3a,"isReadableBufferedStream");function eOe(t,e){return new jvr(t,e)}a(eOe,"newWriteableStream");var jvr=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,q3a.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 G3a(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(G3a,"consumeReadable");function $3a(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($3a,"peekReadable");function V3a(t,e){return new Promise((r,n)=>{let o=[];J0t(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(V3a,"consumeStream");function J0t(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(J0t,"listenStream");function W3a(t,e){return new Promise((r,n)=>{let o=new K0t.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,K0t.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,K0t.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,K0t.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(W3a,"peekStream");function z3a(t,e){let r=eOe(e);return r.end(t),r}a(z3a,"toStream");function Y3a(){let t=eOe(()=>{throw new Error("not supported")});return t.end(),t}a(Y3a,"emptyStream");function K3a(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(K3a,"toReadable");function J3a(t,e,r){let n=eOe(r);return J0t(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(J3a,"transform");function Z3a(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(Z3a,"prefixedReadable");function X3a(t,e,r){let n=!1,o=eOe(r);return J0t(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(X3a,"prefixedStream")});var rG=I(hc=>{"use strict";p();var eFa=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]})),tFa=hc&&hc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rFa=hc&&hc.__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)),Hvr,Gvr,SE=class t{static{a(this,"VSBuffer")}static alloc(e){return tOe?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return tOe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&tOe?new t(Buffer.from(e)):(Hvr||(Hvr=new TextEncoder),new t(Hvr.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])}};hc.VSBuffer=SE;function mTi(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=iFa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(oFa,"readUInt16LE");function sFa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(sFa,"writeUInt16LE");function gTi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(gTi,"readUInt32BE");function ATi(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(ATi,"writeUInt32BE");function yTi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(yTi,"readUInt32LE");function ETi(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(ETi,"writeUInt32LE");function _Ti(t,e){return t[e]}a(_Ti,"readUInt8");function vTi(t,e,r){t[r]=e}a(vTi,"writeUInt8");function aFa(t){return tG.consumeReadable(t,e=>SE.concat(e))}a(aFa,"readableToBuffer");function cFa(t){return tG.toReadable(t)}a(cFa,"bufferToReadable");function CTi(t){return tG.consumeStream(t,e=>SE.concat(e))}a(CTi,"streamToBuffer");async function lFa(t){return t.ended?SE.concat(t.buffer):SE.concat([...t.buffer,await CTi(t.stream)])}a(lFa,"bufferedStreamToBuffer");function uFa(t){return tG.toStream(t,e=>SE.concat(e))}a(uFa,"bufferToStream");function dFa(t){return tG.transform(t,{data:a(e=>typeof e=="string"?SE.fromString(e):SE.wrap(e),"data")},e=>SE.concat(e))}a(dFa,"streamToBufferReadableStream");function fFa(t){return tG.newWriteableStream(e=>SE.concat(e),t)}a(fFa,"newWriteableBufferStream");function pFa(t,e){return tG.prefixedReadable(t,e,r=>SE.concat(r))}a(pFa,"prefixedBufferReadable");function hFa(t,e){return tG.prefixedStream(t,e,r=>SE.concat(r))}a(hFa,"prefixedBufferStream");function mFa(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 SE.wrap(o).slice(0,c)}a(mFa,"decodeBase64");var gFa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",AFa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function yFa({buffer:t},e=!0,r=!1){let n=r?AFa:gFa,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(yFa,"encodeBase64");var pTi="0123456789abcdef";function EFa({buffer:t}){let e="";for(let r=0;r>>4],e+=pTi[n&15]}return e}a(EFa,"encodeHex");function _Fa(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]=hTi(t,r++)<<4|hTi(t,r++);return SE.wrap(e)}a(_Fa,"decodeHex");function hTi(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(hTi,"decodeHexChar")});var bTi=I(Z0t=>{"use strict";p();Object.defineProperty(Z0t,"__esModule",{value:!0});Z0t.readVariableLengthQuantity=CFa;Z0t.writeVariableLengthQuantity=bFa;var vFa=rG();function CFa(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 vFa.VSBuffer.fromByteArray(e)}a(bFa,"writeVariableLengthQuantity")});var $vr=I(X0t=>{"use strict";p();Object.defineProperty(X0t,"__esModule",{value:!0});X0t.parseTikTokenBinary=void 0;var SFa=require("fs"),TFa=bTi(),IFa=rG(),xFa=a(t=>{let e=(0,SFa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(emt,"__esModule",{value:!0});emt.CopilotPromptLoadFailure=void 0;var Vvr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};emt.CopilotPromptLoadFailure=Vvr});var zvr=I(nR=>{"use strict";p();var wFa=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]})),RFa=nR&&nR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PFa=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(q2,"__esModule",{value:!0});q2.initializeTokenizers=q2.ApproximateTokenizer=q2.TTokenizer=q2.TokenizerName=void 0;q2.getTokenizer=LFa;var Yvr=DHe(),MFa=$vr(),OFa=Wvr(),BFa=zvr(),a4;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(a4||(q2.TokenizerName=a4={}));var tmt=new Map;function LFa(t=a4.o200k){let e=tmt.get(t);return e!==void 0||(e=tmt.get(a4.o200k),e!==void 0)?e:new nmt}a(LFa,"getTokenizer");var rmt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,Yvr.createTokenizer)((0,MFa.parseTikTokenBinary)((0,BFa.locateFile)(`${e}.tiktoken`)),(0,Yvr.getSpecialTokensByEncoder)(e),(0,Yvr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new OFa.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)}};q2.TTokenizer=rmt;var Jvr=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)}},QUa={[E4.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},[E4.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}},ebr=4,Umt=class{static{a(this,"ApproximateTokenizer")}constructor(e=E4.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(-ebr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-ebr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?QUa[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)}},FFa={[a4.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},[a4.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}},Kvr=4,nmt=class{static{a(this,"ApproximateTokenizer")}constructor(e=a4.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(-Kvr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-Kvr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?FFa[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)}};Y2.ApproximateTokenizer=Umt;async function KIi(t){try{let e=await Fmt.create(t);Lmt.set(t,e)}catch{}}a(KIi,"setTokenizer");Y2.initializeTokenizers=(async()=>{Lmt.set(E4.mock,new tbr),await Promise.all([KIi(E4.cl100k),KIi(E4.o200k)])})()});var Lme=I(Mte=>{"use strict";p();var qUa=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]})),jUa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qUa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});jUa(JIi(),Mte)});var nbr=I(K2=>{"use strict";p();var HUa=K2&&K2.__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},ROe=K2&&K2.__param||function(t,e){return function(r,n){e(r,n,t)}},kOe;Object.defineProperty(K2,"__esModule",{value:!0});K2.AvailableModelsManager=K2.ICompletionsModelManagerService=void 0;var GUa=SE(),$Ua=IOe(),VUa=rn(),WUa=ko(),zUa=Qs(),YUa=MIi(),KUa=Lme(),JUa=Tyr(),ZUa=s0t(),Qmt=vE(),XUa=VA(),ZIi=xl();K2.ICompletionsModelManagerService=(0,VUa.createServiceIdentifier)("ICompletionsModelManagerService");var e7a="gpt-41-copilot",rbr=kOe=class extends WUa.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 JUa.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,ZUa.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=kOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return e7a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=kOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return kOe.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:KUa.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(YUa.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(ZIi.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(Qmt.getConfig,Qmt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(Qmt.getConfig,Qmt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new CG(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 CG(s,"exp"):new CG(n,"modelpicker"):s?new CG(s,"exp"):this.customModels.length>0?new CG(this.customModels[0],"custommodel"):new CG(r,"default")}};K2.AvailableModelsManager=rbr;K2.AvailableModelsManager=rbr=kOe=HUa([ROe(1,zUa.IInstantiationService),ROe(2,XUa.ICompletionsFeaturesService),ROe(3,$Ua.IEndpointProvider),ROe(4,GUa.IAuthenticationService),ROe(5,ZIi.ICompletionsLogTargetService)],rbr);var CG=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var obr=I(ibr=>{"use strict";p();Object.defineProperty(ibr,"__esModule",{value:!0});ibr.getEngineRequestInfo=r7a;var t7a=nbr();function r7a(t,e=void 0){let r=t.get(t7a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(r7a,"getEngineRequestInfo")});var rxi=I(qmt=>{"use strict";p();Object.defineProperty(qmt,"__esModule",{value:!0});qmt.setupCompletionsExperimentationService=a7a;qmt.createCompletionsFilters=txi;var n7a=SE(),i7a=gp(),o7a=Qs(),XIi=PIi(),vG=vE(),s7a=obr(),dR=Mht();function a7a(t){let e=t.get(n7a.IAuthenticationService),r=t.get(o7a.IInstantiationService),n=e.onDidAuthenticationChange(()=>{r.invokeFunction(exi,e.copilotToken)});return exi(t,e.copilotToken),n}a(a7a,"setupCompletionsExperimentationService");function c7a(t){return vG.BuildInfo.getBuildType()===vG.BuildType.NIGHTLY?dR.Release.Nightly:dR.Release.Stable}a(c7a,"getPluginRelease");function exi(t,e){let r=t.get(i7a.IExperimentationService),n=txi(t,e);r.setCompletionsFilters(n)}a(exi,"updateCompletionsFilters");function txi(t,e){let r=new Map;if(r.set(dR.Filter.ExtensionRelease,c7a(t)),r.set(dR.Filter.CopilotOverrideEngine,(0,vG.getConfig)(t,vG.ConfigKey.DebugOverrideEngine)||(0,vG.getConfig)(t,vG.ConfigKey.DebugOverrideEngineLegacy)),r.set(dR.Filter.CopilotClientVersion,vG.BuildInfo.isProduction()?vG.BuildInfo.getVersion():"1.999.0"),e){let o=(0,XIi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(dR.Filter.CopilotUserKind,o),r.set(dR.Filter.CopilotCustomModel,s),r.set(dR.Filter.CopilotOrgs,c),r.set(dR.Filter.CopilotCustomModelNames,l),r.set(dR.Filter.CopilotTrackingId,u),r.set(dR.Filter.CopilotUserKind,(0,XIi.getUserKind)(e))}let n=(0,s7a.getEngineRequestInfo)(t).modelId;return r.set(dR.Filter.CopilotEngine,n),r}a(txi,"createCompletionsFilters")});var nxi=I(j8=>{"use strict";p();var l7a=j8&&j8.__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},sbr=j8&&j8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(j8,"__esModule",{value:!0});j8.Features=void 0;var u7a=pp(),d7a=gp(),f7a=Qs(),Fme=yG(),p7a=pme(),abr=Tg(),h7a=rxi(),Oa=Dht(),m7a=Mht(),cbr=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=abr.TelemetryData.createAndMarkAsIssued()){if(r instanceof abr.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 abr.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(Oa.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 Oa.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(h7a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new m7a.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[Oa.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SuffixPercent]??Fme.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SuffixMatchThreshold]??Fme.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[Oa.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[Oa.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[Oa.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(u7a.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[Oa.ExpTreatmentVariables.MaxPromptCompletionTokens]??Fme.DEFAULT_MAX_PROMPT_LENGTH+Fme.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.StableContextPercent]??Fme.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.VolatileContextPercent]??Fme.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};j8.Features=cbr;j8.Features=cbr=l7a([sbr(0,f7a.IInstantiationService),sbr(1,d7a.IExperimentationService),sbr(2,p7a.ICompletionsCopilotTokenManager)],cbr)});var bG=I(Ume=>{"use strict";p();Object.defineProperty(Ume,"__esModule",{value:!0});Ume.ICompletionsFileSystemService=Ume.FileType=void 0;var g7a=rn(),ixi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(ixi||(Ume.FileType=ixi={}));Ume.ICompletionsFileSystemService=(0,g7a.createServiceIdentifier)("ICompletionsFileSystemService")});var lbr=I(jmt=>{"use strict";p();Object.defineProperty(jmt,"__esModule",{value:!0});jmt.knownLanguages=void 0;jmt.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 sxi=I(SG=>{"use strict";p();Object.defineProperty(SG,"__esModule",{value:!0});SG.knownFileExtensions=SG.templateLanguageLimitations=SG.knownTemplateLanguageExtensions=void 0;var oxi=lbr();SG.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];SG.templateLanguageLimitations={".php":[".blade"]};SG.knownFileExtensions=Object.keys(oxi.knownLanguages).flatMap(t=>oxi.knownLanguages[t].extensions)});var TG=I(J2=>{"use strict";p();Object.defineProperty(J2,"__esModule",{value:!0});J2.makeFsUri=C7a;J2.validateUri=v7a;J2.normalizeUri=b7a;J2.fsPath=uxi;J2.getFsPath=dxi;J2.getFsUri=S7a;J2.joinPath=T7a;J2.basename=w7a;J2.dirname=R7a;var A7a=require("os"),y7a=require("path"),E7a=xP(),POe=Ku();function cxi(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+cxi(t.substring(3)):t}}a(cxi,"decodeURIComponentGraceful");var axi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function _7a(t){return t.match(axi)?t.replace(axi,e=>cxi(e)):t}a(_7a,"percentDecode");function C7a(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 POe.URI.file(t).toString()}a(C7a,"makeFsUri");function DOe(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?POe.URI.parse(e[1]+e[2],!0):POe.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(DOe,"parseUri");function v7a(t){return DOe(t),t}a(v7a,"validateUri");function b7a(t){try{return DOe(t).toString()}catch{return t}}a(b7a,"normalizeUri");var lxi=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function uxi(t){let e=DOe(t);if(!lxi.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,A7a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,y7a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(uxi,"fsPath");function dxi(t){try{return uxi(t)}catch{return}}a(dxi,"getFsPath");function S7a(t){let e=dxi(t);if(e)return POe.URI.file(e).toString()}a(S7a,"getFsUri");function T7a(t,...e){let r=POe.URI.joinPath(DOe(t),...e.map(I7a)).toString();return typeof t=="string"?r:{uri:r}}a(T7a,"joinPath");function I7a(t){return x7a(t)?t.replaceAll("\\","/"):t}a(I7a,"pathToURIPath");function x7a(t){return/^[^/\\]*\\/.test(t)}a(x7a,"isWinPath");function w7a(t){return _7a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(w7a,"basename");function R7a(t){let e=(0,E7a.dirname)(DOe(t)),r;return lxi.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(R7a,"dirname")});var pxi=I(wE=>{"use strict";p();var k7a=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]})),P7a=wE&&wE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),D7a=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&&ubr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ubr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Qme.has(e))return{languageId:Qme.get(e)[0],isGuess:!1};let n=dbr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Qme.has(e))return{languageId:Qme.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},pbr=class extends qme{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 Ote("cpp",r.isGuess,r.fileExtension):r}},hbr=class extends qme{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Ote(e.languageId,!0,""):this.delegate.detectLanguage(e)}};wE.languageDetection=new pbr(new hbr(new fbr));function O7a({uri:t,languageId:e}){let r=wE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(O7a,"detectLanguage")});var Hme=I(jme=>{"use strict";p();Object.defineProperty(jme,"__esModule",{value:!0});jme.CopilotTextDocument=jme.LocationFactory=void 0;var B7a=pxi(),L7a=TG(),NOe=(z3t(),Ca(Pln)),IG=NCe(),mbr=class{static{a(this,"LocationFactory")}static{this.range=IG.Range.create.bind(IG.Range)}static{this.position=IG.Position.create.bind(IG.Position)}};jme.LocationFactory=mbr;var gbr=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=NOe.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return NOe.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=NOe.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return NOe.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,B7a.detectLanguage)({uri:e,languageId:r})){return new t((0,L7a.normalizeUri)(e),NOe.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=IG.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=IG.Range.create(IG.Position.create(r,0),IG.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};jme.CopilotTextDocument=gbr});var OOe=I((Rvp,Axi)=>{"use strict";p();var Abr=Object.defineProperty,F7a=Object.getOwnPropertyDescriptor,U7a=Object.getOwnPropertyNames,Q7a=Object.prototype.hasOwnProperty,q7a=a((t,e)=>{for(var r in e)Abr(t,r,{get:e[r],enumerable:!0})},"__export"),j7a=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of U7a(e))!Q7a.call(t,o)&&o!==r&&Abr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=F7a(e,o))||n.enumerable});return t},"__copyProps"),H7a=a(t=>j7a(Abr({},"__esModule",{value:!0}),t),"__toCommonJS"),mxi={};q7a(mxi,{config:a(()=>z7a,"config"),t:a(()=>gxi,"t")});Axi.exports=H7a(mxi);var G7a=require("fs"),$7a=require("fs/promises");async function V7a(t){if(t.protocol==="file:")return await(0,$7a.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(V7a,"readFileFromUri");function W7a(t){return(0,G7a.readFileSync)(t,"utf8")}a(W7a,"readFileFromFsPath");var MOe;function z7a(t){if("contents"in t){typeof t.contents=="string"?MOe=JSON.parse(t.contents):MOe=t.contents;return}if("fsPath"in t){let e=W7a(t.fsPath),r=JSON.parse(e);MOe=hxi(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)=>{V7a(e).then(o=>{try{let s=JSON.parse(o);MOe=hxi(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(z7a,"config");function gxi(...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=MOe?.[r];return s?typeof s=="string"?Hmt(s,o):s.comment?Hmt(s.message,o):Hmt(n,o):Hmt(n,o)}a(gxi,"t");var Y7a=/{([^}]+)}/g;function Hmt(t,e){return Object.keys(e).length===0?t:t.replace(Y7a,(r,n)=>e[n]??r)}a(Hmt,"format");function hxi(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(hxi,"isBuiltinExtension")});var Bte=I(gC=>{"use strict";p();var K7a=gC&&gC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J7a=gC&&gC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Z7a=gC&&gC.__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{tmt.set(a4.mock,new Jvr),await Promise.all([ITi(a4.cl100k),ITi(a4.o200k)])})()});var hme=I(Ate=>{"use strict";p();var UFa=Ate&&Ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Ate&&Ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UFa(e,t,r)};Object.defineProperty(Ate,"__esModule",{value:!0});QFa(xTi(),Ate)});var Xvr=I(j2=>{"use strict";p();var qFa=j2&&j2.__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},rOe=j2&&j2.__param||function(t,e){return function(r,n){e(r,n,t)}},nOe;Object.defineProperty(j2,"__esModule",{value:!0});j2.AvailableModelsManager=j2.ICompletionsModelManagerService=void 0;var jFa=vE(),HFa=XMe(),GFa=rn(),$Fa=wo(),VFa=Ls(),WFa=uTi(),zFa=hme(),YFa=vAr(),KFa=Sht(),imt=EE(),JFa=JA(),wTi=Tl();j2.ICompletionsModelManagerService=(0,GFa.createServiceIdentifier)("ICompletionsModelManagerService");var ZFa="gpt-41-copilot",Zvr=nOe=class extends $Fa.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 YFa.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,KFa.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=nOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return ZFa}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=nOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return nOe.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:zFa.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(WFa.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(wTi.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(imt.getConfig,imt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(imt.getConfig,imt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new nG(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 nG(s,"exp"):new nG(n,"modelpicker"):s?new nG(s,"exp"):this.customModels.length>0?new nG(this.customModels[0],"custommodel"):new nG(r,"default")}};j2.AvailableModelsManager=Zvr;j2.AvailableModelsManager=Zvr=nOe=qFa([rOe(1,VFa.IInstantiationService),rOe(2,JFa.ICompletionsFeaturesService),rOe(3,HFa.IEndpointProvider),rOe(4,jFa.IAuthenticationService),rOe(5,wTi.ICompletionsLogTargetService)],Zvr);var nG=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var tCr=I(eCr=>{"use strict";p();Object.defineProperty(eCr,"__esModule",{value:!0});eCr.getEngineRequestInfo=e8a;var XFa=Xvr();function e8a(t,e=void 0){let r=t.get(XFa.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(e8a,"getEngineRequestInfo")});var DTi=I(omt=>{"use strict";p();Object.defineProperty(omt,"__esModule",{value:!0});omt.setupCompletionsExperimentationService=o8a;omt.createCompletionsFilters=kTi;var t8a=vE(),r8a=Ap(),n8a=Ls(),RTi=aTi(),iG=EE(),i8a=tCr(),iR=Zpt();function o8a(t){let e=t.get(t8a.IAuthenticationService),r=t.get(n8a.IInstantiationService),n=e.onDidAuthenticationChange(()=>{r.invokeFunction(PTi,e.copilotToken)});return PTi(t,e.copilotToken),n}a(o8a,"setupCompletionsExperimentationService");function s8a(t){return iG.BuildInfo.getBuildType()===iG.BuildType.NIGHTLY?iR.Release.Nightly:iR.Release.Stable}a(s8a,"getPluginRelease");function PTi(t,e){let r=t.get(r8a.IExperimentationService),n=kTi(t,e);r.setCompletionsFilters(n)}a(PTi,"updateCompletionsFilters");function kTi(t,e){let r=new Map;if(r.set(iR.Filter.ExtensionRelease,s8a(t)),r.set(iR.Filter.CopilotOverrideEngine,(0,iG.getConfig)(t,iG.ConfigKey.DebugOverrideEngine)||(0,iG.getConfig)(t,iG.ConfigKey.DebugOverrideEngineLegacy)),r.set(iR.Filter.CopilotClientVersion,iG.BuildInfo.isProduction()?iG.BuildInfo.getVersion():"1.999.0"),e){let o=(0,RTi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(iR.Filter.CopilotUserKind,o),r.set(iR.Filter.CopilotCustomModel,s),r.set(iR.Filter.CopilotOrgs,c),r.set(iR.Filter.CopilotCustomModelNames,l),r.set(iR.Filter.CopilotTrackingId,u),r.set(iR.Filter.CopilotUserKind,(0,RTi.getUserKind)(e))}let n=(0,i8a.getEngineRequestInfo)(t).modelId;return r.set(iR.Filter.CopilotEngine,n),r}a(kTi,"createCompletionsFilters")});var NTi=I(x8=>{"use strict";p();var a8a=x8&&x8.__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},rCr=x8&&x8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(x8,"__esModule",{value:!0});x8.Features=void 0;var c8a=hp(),l8a=Ap(),u8a=Ls(),mme=eG(),d8a=G0e(),nCr=xg(),f8a=DTi(),Da=Kpt(),p8a=Zpt(),iCr=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=nCr.TelemetryData.createAndMarkAsIssued()){if(r instanceof nCr.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 nCr.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(Da.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 Da.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(f8a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new p8a.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[Da.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.SuffixPercent]??mme.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.SuffixMatchThreshold]??mme.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[Da.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[Da.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[Da.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(c8a.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[Da.ExpTreatmentVariables.MaxPromptCompletionTokens]??mme.DEFAULT_MAX_PROMPT_LENGTH+mme.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.StableContextPercent]??mme.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.VolatileContextPercent]??mme.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};x8.Features=iCr;x8.Features=iCr=a8a([rCr(0,u8a.IInstantiationService),rCr(1,l8a.IExperimentationService),rCr(2,d8a.ICompletionsCopilotTokenManager)],iCr)});var oG=I(gme=>{"use strict";p();Object.defineProperty(gme,"__esModule",{value:!0});gme.ICompletionsFileSystemService=gme.FileType=void 0;var h8a=rn(),MTi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(MTi||(gme.FileType=MTi={}));gme.ICompletionsFileSystemService=(0,h8a.createServiceIdentifier)("ICompletionsFileSystemService")});var oCr=I(smt=>{"use strict";p();Object.defineProperty(smt,"__esModule",{value:!0});smt.knownLanguages=void 0;smt.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 BTi=I(sG=>{"use strict";p();Object.defineProperty(sG,"__esModule",{value:!0});sG.knownFileExtensions=sG.templateLanguageLimitations=sG.knownTemplateLanguageExtensions=void 0;var OTi=oCr();sG.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];sG.templateLanguageLimitations={".php":[".blade"]};sG.knownFileExtensions=Object.keys(OTi.knownLanguages).flatMap(t=>OTi.knownLanguages[t].extensions)});var aG=I(H2=>{"use strict";p();Object.defineProperty(H2,"__esModule",{value:!0});H2.makeFsUri=E8a;H2.validateUri=_8a;H2.normalizeUri=v8a;H2.fsPath=QTi;H2.getFsPath=qTi;H2.getFsUri=C8a;H2.joinPath=b8a;H2.basename=I8a;H2.dirname=x8a;var m8a=require("os"),g8a=require("path"),A8a=_k(),iOe=Ku();function FTi(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+FTi(t.substring(3)):t}}a(FTi,"decodeURIComponentGraceful");var LTi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function y8a(t){return t.match(LTi)?t.replace(LTi,e=>FTi(e)):t}a(y8a,"percentDecode");function E8a(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 iOe.URI.file(t).toString()}a(E8a,"makeFsUri");function oOe(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?iOe.URI.parse(e[1]+e[2],!0):iOe.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(oOe,"parseUri");function _8a(t){return oOe(t),t}a(_8a,"validateUri");function v8a(t){try{return oOe(t).toString()}catch{return t}}a(v8a,"normalizeUri");var UTi=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function QTi(t){let e=oOe(t);if(!UTi.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,m8a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,g8a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(QTi,"fsPath");function qTi(t){try{return QTi(t)}catch{return}}a(qTi,"getFsPath");function C8a(t){let e=qTi(t);if(e)return iOe.URI.file(e).toString()}a(C8a,"getFsUri");function b8a(t,...e){let r=iOe.URI.joinPath(oOe(t),...e.map(S8a)).toString();return typeof t=="string"?r:{uri:r}}a(b8a,"joinPath");function S8a(t){return T8a(t)?t.replaceAll("\\","/"):t}a(S8a,"pathToURIPath");function T8a(t){return/^[^/\\]*\\/.test(t)}a(T8a,"isWinPath");function I8a(t){return y8a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(I8a,"basename");function x8a(t){let e=(0,A8a.dirname)(oOe(t)),r;return UTi.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(x8a,"dirname")});var HTi=I(TE=>{"use strict";p();var w8a=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]})),R8a=TE&&TE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),P8a=TE&&TE.__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&&sCr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=sCr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Ame.has(e))return{languageId:Ame.get(e)[0],isGuess:!1};let n=aCr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Ame.has(e))return{languageId:Ame.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},lCr=class extends yme{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 yte("cpp",r.isGuess,r.fileExtension):r}},uCr=class extends yme{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new yte(e.languageId,!0,""):this.delegate.detectLanguage(e)}};TE.languageDetection=new lCr(new uCr(new cCr));function N8a({uri:t,languageId:e}){let r=TE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(N8a,"detectLanguage")});var _me=I(Eme=>{"use strict";p();Object.defineProperty(Eme,"__esModule",{value:!0});Eme.CopilotTextDocument=Eme.LocationFactory=void 0;var M8a=HTi(),O8a=aG(),sOe=(f3t(),ya(wcn)),cG=uve(),dCr=class{static{a(this,"LocationFactory")}static{this.range=cG.Range.create.bind(cG.Range)}static{this.position=cG.Position.create.bind(cG.Position)}};Eme.LocationFactory=dCr;var fCr=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=sOe.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return sOe.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=sOe.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return sOe.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,M8a.detectLanguage)({uri:e,languageId:r})){return new t((0,O8a.normalizeUri)(e),sOe.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=cG.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=cG.Range.create(cG.Position.create(r,0),cG.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};Eme.CopilotTextDocument=fCr});var cOe=I((jAp,WTi)=>{"use strict";p();var pCr=Object.defineProperty,B8a=Object.getOwnPropertyDescriptor,L8a=Object.getOwnPropertyNames,F8a=Object.prototype.hasOwnProperty,U8a=a((t,e)=>{for(var r in e)pCr(t,r,{get:e[r],enumerable:!0})},"__export"),Q8a=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of L8a(e))!F8a.call(t,o)&&o!==r&&pCr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=B8a(e,o))||n.enumerable});return t},"__copyProps"),q8a=a(t=>Q8a(pCr({},"__esModule",{value:!0}),t),"__toCommonJS"),$Ti={};U8a($Ti,{config:a(()=>V8a,"config"),t:a(()=>VTi,"t")});WTi.exports=q8a($Ti);var j8a=require("fs"),H8a=require("fs/promises");async function G8a(t){if(t.protocol==="file:")return await(0,H8a.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(G8a,"readFileFromUri");function $8a(t){return(0,j8a.readFileSync)(t,"utf8")}a($8a,"readFileFromFsPath");var aOe;function V8a(t){if("contents"in t){typeof t.contents=="string"?aOe=JSON.parse(t.contents):aOe=t.contents;return}if("fsPath"in t){let e=$8a(t.fsPath),r=JSON.parse(e);aOe=GTi(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)=>{G8a(e).then(o=>{try{let s=JSON.parse(o);aOe=GTi(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(V8a,"config");function VTi(...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=aOe?.[r];return s?typeof s=="string"?amt(s,o):s.comment?amt(s.message,o):amt(n,o):amt(n,o)}a(VTi,"t");var W8a=/{([^}]+)}/g;function amt(t,e){return Object.keys(e).length===0?t:t.replace(W8a,(r,n)=>e[n]??r)}a(amt,"format");function GTi(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(GTi,"isBuiltinExtension")});var Ete=I(fv=>{"use strict";p();var z8a=fv&&fv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y8a=fv&&fv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K8a=fv&&fv.__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(Ebr,"__esModule",{value:!0});Ebr.isDocumentValid=iQa;var rQa=Bte(),nQa=Ku();async function iQa(t,e){return await t.get(rQa.IIgnoreService).isCopilotIgnored(nQa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(iQa,"isDocumentValid")});var zb=I(Z2=>{"use strict";p();var oQa=Z2&&Z2.__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},yxi=Z2&&Z2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Z2,"__esModule",{value:!0});Z2.TextDocumentManager=Z2.ICompletionsTextDocumentManagerService=void 0;var sQa=rn(),aQa=Qs(),cQa=bG(),Exi=_br(),Gme=TG();Z2.ICompletionsTextDocumentManagerService=(0,sQa.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var Cbr=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(Exi.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,Gme.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(Exi.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,Gme.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,Gme.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,Gme.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,Gme.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,Gme.basename)(r)}};Z2.TextDocumentManager=Cbr;Z2.TextDocumentManager=Cbr=oQa([yxi(0,aQa.IInstantiationService),yxi(1,cQa.ICompletionsFileSystemService)],Cbr)});var Sbr=I(X2=>{"use strict";p();var lQa=X2&&X2.__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},vbr=X2&&X2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(X2,"__esModule",{value:!0});X2.FileReader=X2.ICompletionsFileReaderService=void 0;var uQa=rn(),dQa=Qs(),fQa=bG(),pQa=Hme(),hQa=zb(),mQa=_br(),gQa=TG();X2.ICompletionsFileReaderService=(0,uQa.createServiceIdentifier)("ICompletionsFileReaderService");var bbr=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,gQa.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(mQa.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:pQa.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}};X2.FileReader=bbr;X2.FileReader=bbr=lQa([vbr(0,hQa.ICompletionsTextDocumentManagerService),vbr(1,dQa.IInstantiationService),vbr(2,fQa.ICompletionsFileSystemService)],bbr)});var H8=I(Gmt=>{"use strict";p();Object.defineProperty(Gmt,"__esModule",{value:!0});Gmt.LRUCacheMap=void 0;var Tbr=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)}};Gmt.LRUCacheMap=Tbr});var LOe=I(BOe=>{"use strict";p();Object.defineProperty(BOe,"__esModule",{value:!0});BOe.Deferred=void 0;BOe.delay=AQa;var Ibr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};BOe.Deferred=Ibr;function AQa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(AQa,"delay")});var _xi=I($me=>{"use strict";p();Object.defineProperty($me,"__esModule",{value:!0});$me.ReplaySubject=$me.Subject=void 0;var $mt=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?.()}};$me.Subject=$mt;var xbr=class extends $mt{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)}};$me.ReplaySubject=xbr});var kbr=I(eD=>{"use strict";p();var yQa=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},Cxi=eD&&eD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eD,"__esModule",{value:!0});eD.AsyncCompletionManager=eD.ICompletionsAsyncManagerService=void 0;var EQa=rn(),_Qa=VA(),CQa=H8(),vxi=xl(),vQa=LOe(),bQa=_xi(),Lte;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Lte||(Lte={}));eD.ICompletionsAsyncManagerService=(0,EQa.createServiceIdentifier)("ICompletionsAsyncManagerService");var Rbr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new vxi.Logger("AsyncCompletionManager"),this.requests=new CQa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(wbr(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 bQa.ReplaySubject;return this.requests.set(e,{state:Lte.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:Lte.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 vQa.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(wbr(r,n,f)){if(f.state===Lte.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)wbr(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!==Lte.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};eD.AsyncCompletionManager=Rbr;eD.AsyncCompletionManager=Rbr=yQa([Cxi(0,_Qa.ICompletionsFeaturesService),Cxi(1,vxi.ICompletionsLogTargetService)],Rbr);function wbr(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===Lte.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(wbr,"isCandidate")});var bxi=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.LRURadixTrie=void 0;var Pbr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new FOe,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 FOe;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 FOe;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(Vme,"__esModule",{value:!0});Vme.CompletionsCache=Vme.ICompletionsCacheService=void 0;var SQa=rn(),Sxi=bxi();Vme.ICompletionsCacheService=(0,SQa.createServiceIdentifier)("ICompletionsCacheService");var Dbr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new Sxi.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 Sxi.LRURadixTrie(100)}};Vme.CompletionsCache=Dbr});var Txi=I(Wme=>{"use strict";p();Object.defineProperty(Wme,"__esModule",{value:!0});Wme.BlockMode=void 0;Wme.shouldDoParsingTrimming=TQa;Wme.shouldDoServerTrimming=IQa;var Fte;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Fte||(Wme.BlockMode=Fte={}));function TQa(t){return[Fte.Parsing,Fte.ParsingAndServer,Fte.MoreMultiline].includes(t)}a(TQa,"shouldDoParsingTrimming");function IQa(t){return[Fte.Server,Fte.ParsingAndServer].includes(t)}a(IQa,"shouldDoServerTrimming")});var Ute=I(OT=>{"use strict";p();var xQa=OT&&OT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(OT,"__esModule",{value:!0});OT.WASMLanguage=void 0;OT.isSupportedLanguageId=RQa;OT.languageIdToWasmLanguage=Lbr;OT.getLanguage=xxi;OT.parseTreeSitter=PQa;OT.parseTreeSitterIncludingVersion=wxi;OT.getBlockCloseToken=DQa;OT.queryPythonIsDocstring=OQa;var Mbr=xQa(ice()),wQa=Jvr(),Ixi=Zvr(),dd;(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"})(dd||(OT.WASMLanguage=dd={}));var Obr={python:dd.Python,javascript:dd.JavaScript,javascriptreact:dd.JavaScript,jsx:dd.JavaScript,typescript:dd.TypeScript,typescriptreact:dd.TSX,go:dd.Go,ruby:dd.Ruby,csharp:dd.CSharp,java:dd.Java,php:dd.Php,c:dd.Cpp,cpp:dd.Cpp};function RQa(t){return t in Obr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(RQa,"isSupportedLanguageId");function Lbr(t){if(!(t in Obr))throw new Error(`Unrecognized language: ${t}`);return Obr[t]}a(Lbr,"languageIdToWasmLanguage");var Nbr=new Map;async function kQa(t){let e;try{e=await(0,Ixi.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new wQa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return Mbr.default.Language.load(e)}a(kQa,"loadWasmLanguage");function xxi(t){let e=Lbr(t);if(!Nbr.has(e)){let r=kQa(e);Nbr.set(e,r)}return Nbr.get(e)}a(xxi,"getLanguage");var Bbr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function PQa(t,e){return(await wxi(t,e))[0]}a(PQa,"parseTreeSitter");async function wxi(t,e){await Mbr.default.init({locateFile:a(s=>(0,Ixi.locateFile)(s),"locateFile")});let r;try{r=new Mbr.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 Bbr(`Could not init Parse for language <${t}>`,s):s}let n=await xxi(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(wxi,"parseTreeSitterIncludingVersion");function DQa(t){switch(Lbr(t)){case dd.Python:return null;case dd.JavaScript:case dd.TypeScript:case dd.TSX:case dd.Go:case dd.CSharp:case dd.Java:case dd.Php:case dd.Cpp:return"}";case dd.Ruby:return"end"}}a(DQa,"getBlockCloseToken");function NQa(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(NQa,"innerQuery");var MQa=[`[ +**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.`);fv.IIgnoreService=(0,Z8a.createServiceIdentifier)("IIgnoreService");var hCr=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(){}};fv.NullIgnoreService=hCr;async function X8a(t,e){let r=[];for(let n of e)await t.isCopilotIgnored(n)||r.push(n);return r}a(X8a,"filterIngoredResources")});var gCr=I(mCr=>{"use strict";p();Object.defineProperty(mCr,"__esModule",{value:!0});mCr.isDocumentValid=r6a;var e6a=Ete(),t6a=Ku();async function r6a(t,e){return await t.get(e6a.IIgnoreService).isCopilotIgnored(t6a.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(r6a,"isDocumentValid")});var Qb=I(G2=>{"use strict";p();var n6a=G2&&G2.__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},zTi=G2&&G2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(G2,"__esModule",{value:!0});G2.TextDocumentManager=G2.ICompletionsTextDocumentManagerService=void 0;var i6a=rn(),o6a=Ls(),s6a=oG(),YTi=gCr(),vme=aG();G2.ICompletionsTextDocumentManagerService=(0,i6a.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var ACr=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(YTi.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,vme.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(YTi.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,vme.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,vme.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,vme.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,vme.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,vme.basename)(r)}};G2.TextDocumentManager=ACr;G2.TextDocumentManager=ACr=n6a([zTi(0,o6a.IInstantiationService),zTi(1,s6a.ICompletionsFileSystemService)],ACr)});var _Cr=I($2=>{"use strict";p();var a6a=$2&&$2.__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},yCr=$2&&$2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($2,"__esModule",{value:!0});$2.FileReader=$2.ICompletionsFileReaderService=void 0;var c6a=rn(),l6a=Ls(),u6a=oG(),d6a=_me(),f6a=Qb(),p6a=gCr(),h6a=aG();$2.ICompletionsFileReaderService=(0,c6a.createServiceIdentifier)("ICompletionsFileReaderService");var ECr=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,h6a.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(p6a.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:d6a.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}};$2.FileReader=ECr;$2.FileReader=ECr=a6a([yCr(0,f6a.ICompletionsTextDocumentManagerService),yCr(1,l6a.IInstantiationService),yCr(2,u6a.ICompletionsFileSystemService)],ECr)});var w8=I(cmt=>{"use strict";p();Object.defineProperty(cmt,"__esModule",{value:!0});cmt.LRUCacheMap=void 0;var vCr=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)}};cmt.LRUCacheMap=vCr});var uOe=I(lOe=>{"use strict";p();Object.defineProperty(lOe,"__esModule",{value:!0});lOe.Deferred=void 0;lOe.delay=m6a;var CCr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};lOe.Deferred=CCr;function m6a(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(m6a,"delay")});var KTi=I(Cme=>{"use strict";p();Object.defineProperty(Cme,"__esModule",{value:!0});Cme.ReplaySubject=Cme.Subject=void 0;var lmt=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?.()}};Cme.Subject=lmt;var bCr=class extends lmt{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)}};Cme.ReplaySubject=bCr});var ICr=I(V2=>{"use strict";p();var g6a=V2&&V2.__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},JTi=V2&&V2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(V2,"__esModule",{value:!0});V2.AsyncCompletionManager=V2.ICompletionsAsyncManagerService=void 0;var A6a=rn(),y6a=JA(),E6a=w8(),ZTi=Tl(),_6a=uOe(),v6a=KTi(),_te;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(_te||(_te={}));V2.ICompletionsAsyncManagerService=(0,A6a.createServiceIdentifier)("ICompletionsAsyncManagerService");var TCr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new ZTi.Logger("AsyncCompletionManager"),this.requests=new E6a.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(SCr(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 v6a.ReplaySubject;return this.requests.set(e,{state:_te.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:_te.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 _6a.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(SCr(r,n,f)){if(f.state===_te.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)SCr(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!==_te.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};V2.AsyncCompletionManager=TCr;V2.AsyncCompletionManager=TCr=g6a([JTi(0,y6a.ICompletionsFeaturesService),JTi(1,ZTi.ICompletionsLogTargetService)],TCr);function SCr(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===_te.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(SCr,"isCandidate")});var XTi=I(umt=>{"use strict";p();Object.defineProperty(umt,"__esModule",{value:!0});umt.LRURadixTrie=void 0;var xCr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new dOe,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 dOe;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 dOe;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(bme,"__esModule",{value:!0});bme.CompletionsCache=bme.ICompletionsCacheService=void 0;var C6a=rn(),eIi=XTi();bme.ICompletionsCacheService=(0,C6a.createServiceIdentifier)("ICompletionsCacheService");var wCr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new eIi.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 eIi.LRURadixTrie(100)}};bme.CompletionsCache=wCr});var tIi=I(Sme=>{"use strict";p();Object.defineProperty(Sme,"__esModule",{value:!0});Sme.BlockMode=void 0;Sme.shouldDoParsingTrimming=b6a;Sme.shouldDoServerTrimming=S6a;var vte;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(vte||(Sme.BlockMode=vte={}));function b6a(t){return[vte.Parsing,vte.ParsingAndServer,vte.MoreMultiline].includes(t)}a(b6a,"shouldDoParsingTrimming");function S6a(t){return[vte.Server,vte.ParsingAndServer].includes(t)}a(S6a,"shouldDoServerTrimming")});var Cte=I(RT=>{"use strict";p();var T6a=RT&&RT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(RT,"__esModule",{value:!0});RT.WASMLanguage=void 0;RT.isSupportedLanguageId=x6a;RT.languageIdToWasmLanguage=NCr;RT.getLanguage=nIi;RT.parseTreeSitter=R6a;RT.parseTreeSitterIncludingVersion=iIi;RT.getBlockCloseToken=P6a;RT.queryPythonIsDocstring=N6a;var PCr=T6a(Qae()),I6a=Wvr(),rIi=zvr(),dd;(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"})(dd||(RT.WASMLanguage=dd={}));var kCr={python:dd.Python,javascript:dd.JavaScript,javascriptreact:dd.JavaScript,jsx:dd.JavaScript,typescript:dd.TypeScript,typescriptreact:dd.TSX,go:dd.Go,ruby:dd.Ruby,csharp:dd.CSharp,java:dd.Java,php:dd.Php,c:dd.Cpp,cpp:dd.Cpp};function x6a(t){return t in kCr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(x6a,"isSupportedLanguageId");function NCr(t){if(!(t in kCr))throw new Error(`Unrecognized language: ${t}`);return kCr[t]}a(NCr,"languageIdToWasmLanguage");var RCr=new Map;async function w6a(t){let e;try{e=await(0,rIi.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new I6a.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return PCr.default.Language.load(e)}a(w6a,"loadWasmLanguage");function nIi(t){let e=NCr(t);if(!RCr.has(e)){let r=w6a(e);RCr.set(e,r)}return RCr.get(e)}a(nIi,"getLanguage");var DCr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function R6a(t,e){return(await iIi(t,e))[0]}a(R6a,"parseTreeSitter");async function iIi(t,e){await PCr.default.init({locateFile:a(s=>(0,rIi.locateFile)(s),"locateFile")});let r;try{r=new PCr.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 DCr(`Could not init Parse for language <${t}>`,s):s}let n=await nIi(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(iIi,"parseTreeSitterIncludingVersion");function P6a(t){switch(NCr(t)){case dd.Python:return null;case dd.JavaScript:case dd.TypeScript:case dd.TSX:case dd.Go:case dd.CSharp:case dd.Java:case dd.Php:case dd.Cpp:return"}";case dd.Ruby:return"end"}}a(P6a,"getBlockCloseToken");function k6a(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(k6a,"innerQuery");var D6a=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function OQa(t){return NQa([MQa],t).length===1}a(OQa,"queryPythonIsDocstring")});var $br=I(Jme=>{"use strict";p();Object.defineProperty(Jme,"__esModule",{value:!0});Jme.StatementTree=Jme.StatementNode=void 0;var BQa=Ute(),tD=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 N6a(t){return k6a([D6a],t).length===1}a(N6a,"queryPythonIsDocstring")});var qCr=I(wme=>{"use strict";p();Object.defineProperty(wme,"__esModule",{value:!0});wme.StatementTree=wme.StatementNode=void 0;var M6a=Cte(),W2=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}}};Jme.StatementNode=tD;var fR=class{static{a(this,"StatementTree")}static isSupported(e){return zme.languageIds.has(e)||Yme.languageIds.has(e)||QOe.languageIds.has(e)||Kme.languageIds.has(e)||qOe.languageIds.has(e)||jOe.languageIds.has(e)||HOe.languageIds.has(e)||GOe.languageIds.has(e)||$Oe.languageIds.has(e)}static isTrimmedByDefault(e){return zme.languageIds.has(e)||Yme.languageIds.has(e)||Kme.languageIds.has(e)}static create(e,r,n,o){if(zme.languageIds.has(e))return new zme(e,r,n,o);if(Yme.languageIds.has(e))return new Yme(e,r,n,o);if(QOe.languageIds.has(e))return new QOe(e,r,n,o);if(Kme.languageIds.has(e))return new Kme(e,r,n,o);if(HOe.languageIds.has(e))return new HOe(e,r,n,o);if(qOe.languageIds.has(e))return new qOe(e,r,n,o);if(jOe.languageIds.has(e))return new jOe(e,r,n,o);if(GOe.languageIds.has(e))return new GOe(e,r,n,o);if($Oe.languageIds.has(e))return new $Oe(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,BQa.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}}};wme.StatementNode=W2;var oR=class{static{a(this,"StatementTree")}static isSupported(e){return Tme.languageIds.has(e)||Ime.languageIds.has(e)||pOe.languageIds.has(e)||xme.languageIds.has(e)||hOe.languageIds.has(e)||mOe.languageIds.has(e)||gOe.languageIds.has(e)||AOe.languageIds.has(e)||yOe.languageIds.has(e)}static isTrimmedByDefault(e){return Tme.languageIds.has(e)||Ime.languageIds.has(e)||xme.languageIds.has(e)}static create(e,r,n,o){if(Tme.languageIds.has(e))return new Tme(e,r,n,o);if(Ime.languageIds.has(e))return new Ime(e,r,n,o);if(pOe.languageIds.has(e))return new pOe(e,r,n,o);if(xme.languageIds.has(e))return new xme(e,r,n,o);if(gOe.languageIds.has(e))return new gOe(e,r,n,o);if(hOe.languageIds.has(e))return new hOe(e,r,n,o);if(mOe.languageIds.has(e))return new mOe(e,r,n,o);if(AOe.languageIds.has(e))return new AOe(e,r,n,o);if(yOe.languageIds.has(e))return new yOe(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,M6a.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(` -`)}};Jme.StatementTree=fR;var Wmt=class t extends tD{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"}},zme=class extends fR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new Wmt(e)}getStatementQueryText(){return`[ +`)}};wme.StatementTree=oR;var dmt=class t extends W2{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"}},Tme=class extends oR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new dmt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -857,7 +813,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (labeled_statement) (method_definition) (field_definition) - ] @statement`}},Yme=class extends fR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new Wmt(e)}getStatementQueryText(){return`[ + ] @statement`}},Ime=class extends oR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new dmt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -880,7 +836,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},Fbr=class t extends tD{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}},QOe=class extends fR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new Fbr(e)}getStatementQueryText(){return`[ + ] @statement`}},MCr=class t extends W2{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}},pOe=class extends oR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new MCr(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -906,24 +862,24 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (decorated_definition) (match_statement) (block) - ] @statement`}},Ubr=class t extends tD{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)}},Kme=class extends fR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new Ubr(e)}getStatementQueryText(){return`[ + ] @statement`}},OCr=class t extends W2{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)}},xme=class extends oR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new OCr(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},Qbr=class t extends tD{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)}},qOe=class extends fR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new Qbr(e)}getStatementQueryText(){return`[ + ] @statement`}},BCr=class t extends W2{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)}},hOe=class extends oR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new BCr(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},qbr=class t extends tD{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)}},jOe=class extends fR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new qbr(e)}getStatementQueryText(){return`[ + ] @statement`}},LCr=class t extends W2{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)}},mOe=class extends oR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new LCr(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},jbr=class t extends tD{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"}},HOe=class extends fR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new jbr(e)}getStatementQueryText(){return`[ + ] @statement`}},FCr=class t extends W2{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"}},gOe=class extends oR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new FCr(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -936,7 +892,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (block) (static_initializer) (constructor_declaration) - ] @statement`}},Hbr=class t extends tD{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"}},GOe=class extends fR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new Hbr(e)}getStatementQueryText(){return`[ + ] @statement`}},UCr=class t extends W2{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"}},AOe=class extends oR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new UCr(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -948,7 +904,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (declaration) (accessor_declaration) (block) - ] @statement`}},Gbr=class t extends tD{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)}},$Oe=class extends fR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new Gbr(e)}getStatementQueryText(){return`[ + ] @statement`}},QCr=class t extends W2{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)}},yOe=class extends oR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new QCr(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -985,30 +941,30 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}}});var Zme=I(rD=>{"use strict";p();Object.defineProperty(rD,"__esModule",{value:!0});rD.BlockPositionType=rD.TerseBlockTrimmer=rD.VerboseBlockTrimmer=rD.BlockTrimmer=void 0;rD.getBlockPositionType=LQa;var zmt=$br(),VOe=class{static{a(this,"BlockTrimmer")}static isSupported(e){return zmt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return zmt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=zmt.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}};rD.BlockTrimmer=VOe;var Vbr=class extends VOe{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}};rD.VerboseBlockTrimmer=Vbr;var Wbr=class extends VOe{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 FQa=nD&&nD.__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},Rxi=nD&&nD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(nD,"__esModule",{value:!0});nD.ConfigBlockModeConfig=nD.ICompletionsBlockModeConfig=void 0;var UQa=rn(),QQa=Qs(),_4=Txi(),Pxi=Ute(),kxi=vE(),qQa=VA(),jQa=Zme(),HQa=$br();nD.ICompletionsBlockModeConfig=(0,UQa.createServiceIdentifier)("ICompletionsBlockModeConfig");var Ybr=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 zbr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(kxi.getConfig,kxi.ConfigKey.AlwaysRequestMultiline)??o)||jQa.BlockTrimmer.isTrimmedByDefault(e)?zbr(_4.BlockMode.MoreMultiline,e):e==="ruby"?_4.BlockMode.Parsing:(0,Pxi.isSupportedLanguageId)(e)?_4.BlockMode.ParsingAndServer:_4.BlockMode.Server}};nD.ConfigBlockModeConfig=Ybr;nD.ConfigBlockModeConfig=Ybr=FQa([Rxi(0,QQa.IInstantiationService),Rxi(1,qQa.ICompletionsFeaturesService)],Ybr);function GQa(t){return[_4.BlockMode.Parsing,_4.BlockMode.ParsingAndServer,_4.BlockMode.MoreMultiline].includes(t)}a(GQa,"blockModeRequiresTreeSitter");function zbr(t,e){return t===_4.BlockMode.MoreMultiline&&HQa.StatementTree.isSupported(e)?t:GQa(t)&&!(0,Pxi.isSupportedLanguageId)(e)?_4.BlockMode.Server:t}a(zbr,"toApplicableBlockMode")});var xG=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.ResultType=void 0;var Dxi;(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"})(Dxi||(Ymt.ResultType=Dxi={}))});var Zbr=I(Xme=>{"use strict";p();Object.defineProperty(Xme,"__esModule",{value:!0});Xme.CurrentGhostText=Xme.ICompletionsCurrentGhostText=void 0;var $Qa=rn(),VQa=xG();Xme.ICompletionsCurrentGhostText=(0,$Qa.createServiceIdentifier)("ICompletionsCurrentGhostText");var Jbr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==VQa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&Nxi(this.choices[0].completionText,n))return WQa(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)}};Xme.CurrentGhostText=Jbr;function WQa(t,e){return t.filter(r=>Nxi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(WQa,"adjustChoicesStart");function Nxi(t,e){return t.startsWith(e)&&t.length>e.length}a(Nxi,"startsWithAndExceeds")});var Mxi=I($8=>{"use strict";p();var zQa=$8&&$8.__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},YQa=$8&&$8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($8,"__esModule",{value:!0});$8.ChangeTracker=void 0;var KQa=zb(),Xbr=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)}};$8.ChangeTracker=Xbr;$8.ChangeTracker=Xbr=zQa([YQa(2,KQa.ICompletionsTextDocumentManagerService)],Xbr)});var t1r=I(WOe=>{"use strict";p();Object.defineProperty(WOe,"__esModule",{value:!0});WOe.CompletionState=void 0;WOe.createCompletionState=JQa;var e1r=TOe(),Kmt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??e1r.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(ege,"__esModule",{value:!0});ege.SpeculativeRequestCache=ege.ICompletionsSpeculativeRequestCache=void 0;var ZQa=rn(),XQa=H8();ege.ICompletionsSpeculativeRequestCache=(0,ZQa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var r1r=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new XQa.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())}};ege.SpeculativeRequestCache=r1r});var tge=I(AC=>{"use strict";p();Object.defineProperty(AC,"__esModule",{value:!0});AC.logger=AC.GHOST_TEXT_CATEGORY=void 0;AC.telemetryShown=tqa;AC.telemetryAccepted=rqa;AC.telemetryRejected=nqa;AC.mkCanceledResultTelemetry=iqa;AC.mkBasicResultTelemetry=oqa;AC.handleGhostTextResultTelemetry=sqa;AC.resultTypeToString=n1r;var Oxi=xl(),Qte=Tg(),zOe=xG(),eqa=Jmt();AC.GHOST_TEXT_CATEGORY="ghostText";AC.logger=new Oxi.Logger("getCompletions");function tqa(t,e){t.get(eqa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=n1r(e.resultType),(0,Qte.telemetry)(t,"ghostText.shown",e.telemetry)}a(tqa,"telemetryShown");function rqa(t,e,r){let n=e+".accepted";(0,Qte.telemetry)(t,n,r)}a(rqa,"telemetryAccepted");function nqa(t,e,r){let n=e+".rejected";(0,Qte.telemetry)(t,n,r)}a(nqa,"telemetryRejected");function iqa(t,e={}){return{...e,telemetryBlob:t}}a(iqa,"mkCanceledResultTelemetry");function oqa(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(oqa,"mkBasicResultTelemetry");function sqa(t,e){let r=t.get(Oxi.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,Qte.now)()-e.telemetryBlob.issuedTime,o=n1r(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 AC.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,Qte.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(AC.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,Qte.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,Qte.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(sqa,"handleGhostTextResultTelemetry");function n1r(t){switch(t){case zOe.ResultType.Network:return"network";case zOe.ResultType.Cache:return"cache";case zOe.ResultType.Cycling:return"cycling";case zOe.ResultType.TypingAsSuggested:return"typingAsSuggested";case zOe.ResultType.Async:return"async"}}a(n1r,"resultTypeToString")});var Fxi=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.getBlockParser=egt;rge.isEmptyBlockStart=uqa;rge.isBlockBodyFinished=dqa;rge.getNodeStart=fqa;var wG=Ute(),Zmt=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,wG.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)}},Xmt=class extends Zmt{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(z2,"__esModule",{value:!0});z2.BlockPositionType=z2.TerseBlockTrimmer=z2.VerboseBlockTrimmer=z2.BlockTrimmer=void 0;z2.getBlockPositionType=O6a;var fmt=qCr(),EOe=class{static{a(this,"BlockTrimmer")}static isSupported(e){return fmt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return fmt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=fmt.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}};z2.BlockTrimmer=EOe;var jCr=class extends EOe{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}};z2.VerboseBlockTrimmer=jCr;var HCr=class extends EOe{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 B6a=Y2&&Y2.__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},oIi=Y2&&Y2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Y2,"__esModule",{value:!0});Y2.ConfigBlockModeConfig=Y2.ICompletionsBlockModeConfig=void 0;var L6a=rn(),F6a=Ls(),c4=tIi(),aIi=Cte(),sIi=EE(),U6a=JA(),Q6a=Rme(),q6a=qCr();Y2.ICompletionsBlockModeConfig=(0,L6a.createServiceIdentifier)("ICompletionsBlockModeConfig");var $Cr=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 GCr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(sIi.getConfig,sIi.ConfigKey.AlwaysRequestMultiline)??o)||Q6a.BlockTrimmer.isTrimmedByDefault(e)?GCr(c4.BlockMode.MoreMultiline,e):e==="ruby"?c4.BlockMode.Parsing:(0,aIi.isSupportedLanguageId)(e)?c4.BlockMode.ParsingAndServer:c4.BlockMode.Server}};Y2.ConfigBlockModeConfig=$Cr;Y2.ConfigBlockModeConfig=$Cr=B6a([oIi(0,F6a.IInstantiationService),oIi(1,U6a.ICompletionsFeaturesService)],$Cr);function j6a(t){return[c4.BlockMode.Parsing,c4.BlockMode.ParsingAndServer,c4.BlockMode.MoreMultiline].includes(t)}a(j6a,"blockModeRequiresTreeSitter");function GCr(t,e){return t===c4.BlockMode.MoreMultiline&&q6a.StatementTree.isSupported(e)?t:j6a(t)&&!(0,aIi.isSupportedLanguageId)(e)?c4.BlockMode.Server:t}a(GCr,"toApplicableBlockMode")});var lG=I(pmt=>{"use strict";p();Object.defineProperty(pmt,"__esModule",{value:!0});pmt.ResultType=void 0;var cIi;(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"})(cIi||(pmt.ResultType=cIi={}))});var zCr=I(Pme=>{"use strict";p();Object.defineProperty(Pme,"__esModule",{value:!0});Pme.CurrentGhostText=Pme.ICompletionsCurrentGhostText=void 0;var H6a=rn(),G6a=lG();Pme.ICompletionsCurrentGhostText=(0,H6a.createServiceIdentifier)("ICompletionsCurrentGhostText");var WCr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==G6a.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&lIi(this.choices[0].completionText,n))return $6a(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)}};Pme.CurrentGhostText=WCr;function $6a(t,e){return t.filter(r=>lIi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a($6a,"adjustChoicesStart");function lIi(t,e){return t.startsWith(e)&&t.length>e.length}a(lIi,"startsWithAndExceeds")});var uIi=I(P8=>{"use strict";p();var V6a=P8&&P8.__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},W6a=P8&&P8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(P8,"__esModule",{value:!0});P8.ChangeTracker=void 0;var z6a=Qb(),YCr=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)}};P8.ChangeTracker=YCr;P8.ChangeTracker=YCr=V6a([W6a(2,z6a.ICompletionsTextDocumentManagerService)],YCr)});var JCr=I(_Oe=>{"use strict";p();Object.defineProperty(_Oe,"__esModule",{value:!0});_Oe.CompletionState=void 0;_Oe.createCompletionState=Y6a;var KCr=ZMe(),hmt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??KCr.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(kme,"__esModule",{value:!0});kme.SpeculativeRequestCache=kme.ICompletionsSpeculativeRequestCache=void 0;var K6a=rn(),J6a=w8();kme.ICompletionsSpeculativeRequestCache=(0,K6a.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var ZCr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new J6a.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())}};kme.SpeculativeRequestCache=ZCr});var Dme=I(pv=>{"use strict";p();Object.defineProperty(pv,"__esModule",{value:!0});pv.logger=pv.GHOST_TEXT_CATEGORY=void 0;pv.telemetryShown=X6a;pv.telemetryAccepted=e9a;pv.telemetryRejected=t9a;pv.mkCanceledResultTelemetry=r9a;pv.mkBasicResultTelemetry=n9a;pv.handleGhostTextResultTelemetry=i9a;pv.resultTypeToString=XCr;var dIi=Tl(),bte=xg(),vOe=lG(),Z6a=mmt();pv.GHOST_TEXT_CATEGORY="ghostText";pv.logger=new dIi.Logger("getCompletions");function X6a(t,e){t.get(Z6a.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=XCr(e.resultType),(0,bte.telemetry)(t,"ghostText.shown",e.telemetry)}a(X6a,"telemetryShown");function e9a(t,e,r){let n=e+".accepted";(0,bte.telemetry)(t,n,r)}a(e9a,"telemetryAccepted");function t9a(t,e,r){let n=e+".rejected";(0,bte.telemetry)(t,n,r)}a(t9a,"telemetryRejected");function r9a(t,e={}){return{...e,telemetryBlob:t}}a(r9a,"mkCanceledResultTelemetry");function n9a(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(n9a,"mkBasicResultTelemetry");function i9a(t,e){let r=t.get(dIi.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,bte.now)()-e.telemetryBlob.issuedTime,o=XCr(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 pv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,bte.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(pv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,bte.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,bte.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(i9a,"handleGhostTextResultTelemetry");function XCr(t){switch(t){case vOe.ResultType.Network:return"network";case vOe.ResultType.Cache:return"cache";case vOe.ResultType.Cycling:return"cycling";case vOe.ResultType.TypingAsSuggested:return"typingAsSuggested";case vOe.ResultType.Async:return"async"}}a(XCr,"resultTypeToString")});var hIi=I(Nme=>{"use strict";p();Object.defineProperty(Nme,"__esModule",{value:!0});Nme.getBlockParser=ymt;Nme.isEmptyBlockStart=c9a;Nme.isBlockBodyFinished=l9a;Nme.getNodeStart=u9a;var uG=Cte(),gmt=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,uG.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)}},Amt=class extends gmt{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(Lxi,"rewindToNearestNonWs");function Bxi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(Bxi,"indent");function cqa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=Bxi(t,r),o=Bxi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(cqa,"outdented");var C4=class extends Zmt{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,wG.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()}}},lqa={python:new C4("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 C4("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 C4("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 C4("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 Xmt("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 Xmt("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 C4("csharp",{},new Map([]),[],"block",null,!0),java:new C4("java",{},new Map([]),[],"block",null,!0),php:new C4("php",{},new Map([]),[],"block",null,!0),cpp:new C4("cpp",{},new Map([]),[],"block",null,!0)};function egt(t){if(!(0,wG.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return lqa[(0,wG.languageIdToWasmLanguage)(t)]}a(egt,"getBlockParser");async function uqa(t,e,r){return(0,wG.isSupportedLanguageId)(t)?egt(t).isEmptyBlockStart(e,r):!1}a(uqa,"isEmptyBlockStart");async function dqa(t,e,r,n){if((0,wG.isSupportedLanguageId)(t))return egt(t).isBlockBodyFinished(e,r,n)}a(dqa,"isBlockBodyFinished");async function fqa(t,e,r){if((0,wG.isSupportedLanguageId)(t))return egt(t).getNodeStart(e,r)}a(fqa,"getNodeStart")});var ngt=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.parsingBlockFinished=pqa;RG.isEmptyBlockStartUtil=hqa;RG.getNodeStartUtil=mqa;RG.contextIndentation=Eqa;RG.contextIndentationFromText=Uxi;RG.indentationBlockFinished=vqa;var i1r=Fxi(),rgt=Hme();function pqa(t,e){let r=t.getText(rgt.LocationFactory.range(rgt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,i1r.isBlockBodyFinished)(o,r,s,n)}a(pqa,"parsingBlockFinished");function hqa(t,e){return(0,i1r.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(hqa,"isEmptyBlockStartUtil");async function mqa(t,e,r){let o=t.getText(rgt.LocationFactory.range(rgt.LocationFactory.position(0,0),e))+r,s=await(0,i1r.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(mqa,"getNodeStartUtil");var gqa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),Aqa=new RegExp(`^(${gqa.join("|")})`);function yqa(t){return Aqa.test(t.trimLeft().toLowerCase())}a(yqa,"isContinuationLine");function tgt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(tgt,"indentationOfLine");function Eqa(t,e){let r=t.getText(),n=t.offsetAt(e);return Uxi(r,n,t.detectedLanguageId)}a(Eqa,"contextIndentation");function Uxi(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(o9a,"getLineAtOffset");function pIi(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(pIi,"rewindToNearestNonWs");function fIi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(fIi,"indent");function s9a(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=fIi(t,r),o=fIi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(s9a,"outdented");var l4=class extends gmt{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,uG.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()}}},a9a={python:new l4("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 l4("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 l4("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 l4("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 Amt("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 Amt("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 l4("csharp",{},new Map([]),[],"block",null,!0),java:new l4("java",{},new Map([]),[],"block",null,!0),php:new l4("php",{},new Map([]),[],"block",null,!0),cpp:new l4("cpp",{},new Map([]),[],"block",null,!0)};function ymt(t){if(!(0,uG.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return a9a[(0,uG.languageIdToWasmLanguage)(t)]}a(ymt,"getBlockParser");async function c9a(t,e,r){return(0,uG.isSupportedLanguageId)(t)?ymt(t).isEmptyBlockStart(e,r):!1}a(c9a,"isEmptyBlockStart");async function l9a(t,e,r,n){if((0,uG.isSupportedLanguageId)(t))return ymt(t).isBlockBodyFinished(e,r,n)}a(l9a,"isBlockBodyFinished");async function u9a(t,e,r){if((0,uG.isSupportedLanguageId)(t))return ymt(t).getNodeStart(e,r)}a(u9a,"getNodeStart")});var vmt=I(dG=>{"use strict";p();Object.defineProperty(dG,"__esModule",{value:!0});dG.parsingBlockFinished=d9a;dG.isEmptyBlockStartUtil=f9a;dG.getNodeStartUtil=p9a;dG.contextIndentation=A9a;dG.contextIndentationFromText=mIi;dG.indentationBlockFinished=_9a;var ebr=hIi(),_mt=_me();function d9a(t,e){let r=t.getText(_mt.LocationFactory.range(_mt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,ebr.isBlockBodyFinished)(o,r,s,n)}a(d9a,"parsingBlockFinished");function f9a(t,e){return(0,ebr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(f9a,"isEmptyBlockStartUtil");async function p9a(t,e,r){let o=t.getText(_mt.LocationFactory.range(_mt.LocationFactory.position(0,0),e))+r,s=await(0,ebr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(p9a,"getNodeStartUtil");var h9a=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),m9a=new RegExp(`^(${h9a.join("|")})`);function g9a(t){return m9a.test(t.trimLeft().toLowerCase())}a(g9a,"isContinuationLine");function Emt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Emt,"indentationOfLine");function A9a(t,e){let r=t.getText(),n=t.offsetAt(e);return mIi(r,n,t.detectedLanguageId)}a(A9a,"contextIndentation");function mIi(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=tgt(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=tgt(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=Emt(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=Emt(n[f]);if(h!==void 0&&h{let n=Cqa(r,t,e);return n==="continue"?void 0:n}}a(vqa,"indentationBlockFinished")});var YOe=I(kg=>{"use strict";p();Object.defineProperty(kg,"__esModule",{value:!0});kg.languageMarkers=void 0;kg.mdCodeBlockLangToLanguageId=bqa;kg.isShebangLine=Iqa;kg.hasLanguageMarker=qxi;kg.comment=jxi;kg.commentBlockAsSingles=xqa;kg.getLanguageMarker=wqa;kg.getPathMarker=Rqa;kg.newLineEnded=kqa;kg.getLanguage=Pqa;kg.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 o1r={};for(let[t,e]of Object.entries(kg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)o1r[r]=t;else o1r[t]=t;function bqa(t){return o1r[t]}a(bqa,"mdCodeBlockLangToLanguageId");var Sqa={start:"//",end:""},Tqa=["php","plaintext"],s1r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function Iqa(t){return Object.values(s1r).includes(t.trim())}a(Iqa,"isShebangLine");function qxi({source:t}){return t.startsWith("#!")||t.startsWith("{let n=E9a(r,t,e);return n==="continue"?void 0:n}}a(_9a,"indentationBlockFinished")});var COe=I(Dg=>{"use strict";p();Object.defineProperty(Dg,"__esModule",{value:!0});Dg.languageMarkers=void 0;Dg.mdCodeBlockLangToLanguageId=v9a;Dg.isShebangLine=S9a;Dg.hasLanguageMarker=AIi;Dg.comment=yIi;Dg.commentBlockAsSingles=T9a;Dg.getLanguageMarker=I9a;Dg.getPathMarker=x9a;Dg.newLineEnded=w9a;Dg.getLanguage=R9a;Dg.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 tbr={};for(let[t,e]of Object.entries(Dg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)tbr[r]=t;else tbr[t]=t;function v9a(t){return tbr[t]}a(v9a,"mdCodeBlockLangToLanguageId");var C9a={start:"//",end:""},b9a=["php","plaintext"],rbr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function S9a(t){return Object.values(rbr).includes(t.trim())}a(S9a,"isShebangLine");function AIi({source:t}){return t.startsWith("#!")||t.startsWith("jxi(s,e)).join(` +`).map(s=>yIi(s,e)).join(` `);return r?o+` -`:o}a(xqa,"commentBlockAsSingles");function wqa(t){let{languageId:e}=t;return Tqa.indexOf(e)===-1&&!qxi(t)?e in s1r?s1r[e]:`Language: ${e}`:""}a(wqa,"getLanguageMarker");function Rqa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Rqa,"getPathMarker");function kqa(t){return t===""||t.endsWith(` +`:o}a(T9a,"commentBlockAsSingles");function I9a(t){let{languageId:e}=t;return b9a.indexOf(e)===-1&&!AIi(t)?e in rbr?rbr[e]:`Language: ${e}`:""}a(I9a,"getLanguageMarker");function x9a(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(x9a,"getPathMarker");function w9a(t){return t===""||t.endsWith(` `)?t:t+` -`}a(kqa,"newLineEnded");function Pqa(t){return Qxi(typeof t=="string"?t:"plaintext")}a(Pqa,"getLanguage");function Qxi(t){return kg.languageMarkers[t]!==void 0?{languageId:t,...kg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(Qxi,"_getLanguage")});var c1r=I(a1r=>{"use strict";p();Object.defineProperty(a1r,"__esModule",{value:!0});a1r.getCursorContext=Mqa;var Hxi=Lme(),Dqa={tokenizerName:Hxi.TokenizerName.o200k};function Nqa(t){return{...Dqa,...t}}a(Nqa,"cursorContextOptions");function Mqa(t,e={}){let r=Nqa(e),n=(0,Hxi.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(w9a,"newLineEnded");function R9a(t){return gIi(typeof t=="string"?t:"plaintext")}a(R9a,"getLanguage");function gIi(t){return Dg.languageMarkers[t]!==void 0?{languageId:t,...Dg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(gIi,"_getLanguage")});var ibr=I(nbr=>{"use strict";p();Object.defineProperty(nbr,"__esModule",{value:!0});nbr.getCursorContext=D9a;var EIi=hme(),P9a={tokenizerName:EIi.TokenizerName.o200k};function k9a(t){return{...P9a,...t}}a(k9a,"cursorContextOptions");function D9a(t,e={}){let r=k9a(e),n=(0,EIi.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(Mqa,"getCursorContext")});var l1r=I(qte=>{"use strict";p();Object.defineProperty(qte,"__esModule",{value:!0});qte.SnippetSemantics=qte.SnippetProviderType=void 0;qte.announceSnippet=Bqa;var Gxi;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(Gxi||(qte.SnippetProviderType=Gxi={}));var Yb;(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"})(Yb||(qte.SnippetSemantics=Yb={}));var Oqa={[Yb.Function]:"function",[Yb.Snippet]:"snippet",[Yb.Snippets]:"snippets",[Yb.Variable]:"variable",[Yb.Parameter]:"parameter",[Yb.Method]:"method",[Yb.Class]:"class",[Yb.Module]:"module",[Yb.Alias]:"alias",[Yb.Enum]:"enum member",[Yb.Interface]:"interface"};function Bqa(t){let e=Oqa[t.semantics],r=[Yb.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(Bqa,"announceSnippet")});var p1r=I(Hte=>{"use strict";p();Object.defineProperty(Hte,"__esModule",{value:!0});Hte.WindowedMatcher=Hte.SortOptions=void 0;Hte.splitIntoWords=Wxi;var $xi=l1r(),u1r=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]}},jte;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(jte||(Hte.SortOptions=jte={}));var d1r=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=Uqa.get(e.languageId)??Fqa}tokenize(e){return new Set(Wxi(e).filter(r=>!this.stopsForLanguage.has(r)))}},Vxi=new u1r(20),f1r=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new d1r(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=jte.Descending){return r===jte.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===jte.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=jte.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=Vxi.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(Wxi,"splitIntoWords");var Lqa=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"]),Fqa=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",...Lqa]),Uqa=new Map([])});var h1r=I(pR=>{"use strict";p();Object.defineProperty(pR,"__esModule",{value:!0});pR.virtualNode=Qqa;pR.lineNode=qqa;pR.blankNode=jqa;pR.topNode=Hqa;pR.isBlank=Gqa;pR.isLine=$qa;pR.isVirtual=zxi;pR.isTop=Yxi;pR.cutTreeAfterLine=Vqa;pR.duplicateTree=Wqa;function Qqa(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(Qqa,"virtualNode");function qqa(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(qqa,"lineNode");function jqa(t){return{type:"blank",lineNumber:t,subs:[]}}a(jqa,"blankNode");function Hqa(t){return{type:"top",indentation:-1,subs:t??[]}}a(Hqa,"topNode");function Gqa(t){return t.type==="blank"}a(Gqa,"isBlank");function $qa(t){return t.type==="line"}a($qa,"isLine");function zxi(t){return t.type==="virtual"}a(zxi,"isVirtual");function Yxi(t){return t.type==="top"}a(Yxi,"isTop");function Vqa(t,e){function r(n){if(!zxi(n)&&!Yxi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(v4,"__esModule",{value:!0});v4.clearLabels=zqa;v4.clearLabelsIf=Yqa;v4.mapLabels=g1r;v4.resetLineNumbers=Kqa;v4.visitTree=KOe;v4.visitTreeConditionally=Jqa;v4.foldTree=Zqa;v4.rebuildTree=Xqa;var m1r=h1r();function zqa(t){return KOe(t,e=>{e.label=void 0},"bottomUp"),t}a(zqa,"clearLabels");function Yqa(t,e){return KOe(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(Yqa,"clearLabelsIf");function g1r(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>g1r(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=>g1r(r,e)),label:t.label?e(t.label):void 0}}}a(g1r,"mapLabels");function Kqa(t){let e=0;function r(n){!(0,m1r.isVirtual)(n)&&!(0,m1r.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),KOe(t,r,"topDown")}a(Kqa,"resetLineNumbers");function KOe(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(KOe,"visitTree");function Jqa(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(Jqa,"visitTreeConditionally");function Zqa(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),KOe(t,s,n),o}a(Zqa,"foldTree");function Xqa(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,m1r.topNode)()}a(Xqa,"rebuildTree")});var twi=I(iD=>{"use strict";p();Object.defineProperty(iD,"__esModule",{value:!0});iD.parseRaw=Kxi;iD.labelLines=Jxi;iD.labelVirtualInherited=eja;iD.buildLabelRules=Zxi;iD.combineClosersAndOpeners=Xxi;iD.groupBlocks=tja;iD.flattenVirtual=rja;iD.registerLanguageSpecificParser=oja;iD.parseTree=sja;var Pg=h1r(),nge=A1r();function Kxi(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,Pg.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,nge.visitTree)(t,r,"bottomUp")}a(Jxi,"labelLines");function eja(t){function e(r){if((0,Pg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Pg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,nge.visitTree)(t,e,"bottomUp")}a(eja,"labelVirtualInherited");function Zxi(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(Zxi,"buildLabelRules");function Xxi(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,Pg.isLine)(l)||(0,Pg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Pg.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,Pg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Pg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,nge.rebuildTree)(t,e);return(0,nge.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(Xxi,"combineClosersAndOpeners");function tja(t,e=Pg.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,Pg.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(igt,"__esModule",{value:!0});igt.getBasicWindowDelineations=cja;igt.getIndentationWindowsDelineations=lja;var rwi=A1r(),aja=twi();function cja(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(lja,"getIndentationWindowsDelineations")});var iwi=I(JOe=>{"use strict";p();Object.defineProperty(JOe,"__esModule",{value:!0});JOe.FixedWindowSizeJaccardMatcher=void 0;JOe.computeScore=nwi;var uja=c1r(),dja=p1r(),fja=y1r(),E1r=class t extends dja.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,fja.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,uja.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return nwi(e,r)}};JOe.FixedWindowSizeJaccardMatcher=E1r;function nwi(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(nwi,"computeScore")});var swi=I(ogt=>{"use strict";p();Object.defineProperty(ogt,"__esModule",{value:!0});ogt.BlockTokenSubsetMatcher=void 0;var pja=Ute(),owi=c1r(),hja=p1r(),mja=y1r(),_1r=class t extends hja.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,mja.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,owi.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,owi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return gja(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,pja.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}}};ogt.BlockTokenSubsetMatcher=_1r;function gja(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(gja,"computeScore")});var sgt=I(oD=>{"use strict";p();Object.defineProperty(oD,"__esModule",{value:!0});oD.defaultCppSimilarFilesOptions=oD.nullSimilarFilesOptions=oD.conservativeFilesOptions=oD.defaultSimilarFilesOptions=void 0;oD.getSimilarSnippets=Sja;var Aja=iwi(),yja=swi(),Eja=0,_ja=60,Cja=4,vja=1,awi=20,cwi=1e4;oD.defaultSimilarFilesOptions={snippetLength:_ja,threshold:Eja,maxTopSnippets:Cja,maxCharPerFile:cwi,maxNumberOfFiles:awi,maxSnippetsPerFile:vja,useSubsetMatching:!1};oD.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:cwi,maxNumberOfFiles:awi,maxSnippetsPerFile:1};oD.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};oD.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function bja(t,e){return(e.useSubsetMatching?yja.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):Aja.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(bja,"getMatcher");async function Sja(t,e,r){let n=bja(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(Sja,"getSimilarSnippets")});var uwi=I(agt=>{"use strict";p();Object.defineProperty(agt,"__esModule",{value:!0});agt.getCppSimilarFilesOptions=Ija;agt.getCppNumberOfSnippets=xja;var lwi=sgt(),Tja=cgt();function Ija(t,e){return{...lwi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,Tja.useSubsetMatching)(t,e)}}a(Ija,"getCppSimilarFilesOptions");function xja(t){return lwi.defaultCppSimilarFilesOptions.maxTopSnippets}a(xja,"getCppNumberOfSnippets")});var cgt=I(ZOe=>{"use strict";p();Object.defineProperty(ZOe,"__esModule",{value:!0});ZOe.getSimilarFilesOptions=Dja;ZOe.getNumberOfSnippets=Mja;ZOe.useSubsetMatching=pwi;var wja=yG(),Rja=sgt(),dwi=vE(),kja=Dht(),fwi=uwi(),Pja=new Map([["cpp",fwi.getCppSimilarFilesOptions]]);function Dja(t,e,r){let n=Pja.get(r);return n?n(t,e):{...Rja.defaultSimilarFilesOptions,useSubsetMatching:pwi(t,e)}}a(Dja,"getSimilarFilesOptions");var Nja=new Map([["cpp",fwi.getCppNumberOfSnippets]]);function Mja(t,e){let r=Nja.get(e);return r?r(t):wja.DEFAULT_NUM_SNIPPETS}a(Mja,"getNumberOfSnippets");function pwi(t,e){return(e.filtersAndExp.exp.variables[kja.ExpTreatmentVariables.UseSubsetMatching]||(0,dwi.getConfig)(t,dwi.ConfigKey.UseSubsetMatching))??!1}a(pwi,"useSubsetMatching")});var XOe=I(Gte=>{"use strict";p();Object.defineProperty(Gte,"__esModule",{value:!0});Gte.convertToAPIChoice=Fja;Gte.getTemperatureForSamples=qja;Gte.getStops=Hja;Gte.getTopP=Gja;Gte.getMaxSolutionTokens=$ja;var Oja=um(),Bja=yG(),hwi=xl(),Lja=Tg();function Fja(t,e,r,n,o,s,c){return(0,Lja.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:Uja(t,r),meanAlternativeLogProb:Qja(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,Oja.generateUuid)(),finishReason:r.finish_reason}}a(Fja,"convertToAPIChoice");function Uja(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){hwi.logger.exception(t,r,"Error calculating mean prob")}}a(Uja,"calculateMeanLogProb");function Qja(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){hwi.logger.exception(t,r,"Error calculating mean prob")}}a(Qja,"calculateMeanAlternativeLogProb");function qja(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(qja,"getTemperatureForSamples");var jja={markdown:[` +`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(D9a,"getCursorContext")});var obr=I(Ste=>{"use strict";p();Object.defineProperty(Ste,"__esModule",{value:!0});Ste.SnippetSemantics=Ste.SnippetProviderType=void 0;Ste.announceSnippet=M9a;var _Ii;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(_Ii||(Ste.SnippetProviderType=_Ii={}));var qb;(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"})(qb||(Ste.SnippetSemantics=qb={}));var N9a={[qb.Function]:"function",[qb.Snippet]:"snippet",[qb.Snippets]:"snippets",[qb.Variable]:"variable",[qb.Parameter]:"parameter",[qb.Method]:"method",[qb.Class]:"class",[qb.Module]:"module",[qb.Alias]:"alias",[qb.Enum]:"enum member",[qb.Interface]:"interface"};function M9a(t){let e=N9a[t.semantics],r=[qb.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(M9a,"announceSnippet")});var lbr=I(Ite=>{"use strict";p();Object.defineProperty(Ite,"__esModule",{value:!0});Ite.WindowedMatcher=Ite.SortOptions=void 0;Ite.splitIntoWords=bIi;var vIi=obr(),sbr=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]}},Tte;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Tte||(Ite.SortOptions=Tte={}));var abr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=L9a.get(e.languageId)??B9a}tokenize(e){return new Set(bIi(e).filter(r=>!this.stopsForLanguage.has(r)))}},CIi=new sbr(20),cbr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new abr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Tte.Descending){return r===Tte.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Tte.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Tte.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=CIi.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(bIi,"splitIntoWords");var O9a=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"]),B9a=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",...O9a]),L9a=new Map([])});var ubr=I(sR=>{"use strict";p();Object.defineProperty(sR,"__esModule",{value:!0});sR.virtualNode=F9a;sR.lineNode=U9a;sR.blankNode=Q9a;sR.topNode=q9a;sR.isBlank=j9a;sR.isLine=H9a;sR.isVirtual=SIi;sR.isTop=TIi;sR.cutTreeAfterLine=G9a;sR.duplicateTree=$9a;function F9a(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(F9a,"virtualNode");function U9a(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(U9a,"lineNode");function Q9a(t){return{type:"blank",lineNumber:t,subs:[]}}a(Q9a,"blankNode");function q9a(t){return{type:"top",indentation:-1,subs:t??[]}}a(q9a,"topNode");function j9a(t){return t.type==="blank"}a(j9a,"isBlank");function H9a(t){return t.type==="line"}a(H9a,"isLine");function SIi(t){return t.type==="virtual"}a(SIi,"isVirtual");function TIi(t){return t.type==="top"}a(TIi,"isTop");function G9a(t,e){function r(n){if(!SIi(n)&&!TIi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(u4,"__esModule",{value:!0});u4.clearLabels=V9a;u4.clearLabelsIf=W9a;u4.mapLabels=fbr;u4.resetLineNumbers=z9a;u4.visitTree=bOe;u4.visitTreeConditionally=Y9a;u4.foldTree=K9a;u4.rebuildTree=J9a;var dbr=ubr();function V9a(t){return bOe(t,e=>{e.label=void 0},"bottomUp"),t}a(V9a,"clearLabels");function W9a(t,e){return bOe(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(W9a,"clearLabelsIf");function fbr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>fbr(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=>fbr(r,e)),label:t.label?e(t.label):void 0}}}a(fbr,"mapLabels");function z9a(t){let e=0;function r(n){!(0,dbr.isVirtual)(n)&&!(0,dbr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),bOe(t,r,"topDown")}a(z9a,"resetLineNumbers");function bOe(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(bOe,"visitTree");function Y9a(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(Y9a,"visitTreeConditionally");function K9a(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),bOe(t,s,n),o}a(K9a,"foldTree");function J9a(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,dbr.topNode)()}a(J9a,"rebuildTree")});var kIi=I(K2=>{"use strict";p();Object.defineProperty(K2,"__esModule",{value:!0});K2.parseRaw=IIi;K2.labelLines=xIi;K2.labelVirtualInherited=Z9a;K2.buildLabelRules=wIi;K2.combineClosersAndOpeners=RIi;K2.groupBlocks=X9a;K2.flattenVirtual=eUa;K2.registerLanguageSpecificParser=nUa;K2.parseTree=iUa;var Ng=ubr(),Mme=pbr();function IIi(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,Ng.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,Mme.visitTree)(t,r,"bottomUp")}a(xIi,"labelLines");function Z9a(t){function e(r){if((0,Ng.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Ng.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,Mme.visitTree)(t,e,"bottomUp")}a(Z9a,"labelVirtualInherited");function wIi(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(wIi,"buildLabelRules");function RIi(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,Ng.isLine)(l)||(0,Ng.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Ng.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,Ng.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Ng.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,Mme.rebuildTree)(t,e);return(0,Mme.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(RIi,"combineClosersAndOpeners");function X9a(t,e=Ng.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,Ng.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(Cmt,"__esModule",{value:!0});Cmt.getBasicWindowDelineations=sUa;Cmt.getIndentationWindowsDelineations=aUa;var DIi=pbr(),oUa=kIi();function sUa(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(aUa,"getIndentationWindowsDelineations")});var MIi=I(SOe=>{"use strict";p();Object.defineProperty(SOe,"__esModule",{value:!0});SOe.FixedWindowSizeJaccardMatcher=void 0;SOe.computeScore=NIi;var cUa=ibr(),lUa=lbr(),uUa=hbr(),mbr=class t extends lUa.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,uUa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,cUa.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return NIi(e,r)}};SOe.FixedWindowSizeJaccardMatcher=mbr;function NIi(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(NIi,"computeScore")});var BIi=I(bmt=>{"use strict";p();Object.defineProperty(bmt,"__esModule",{value:!0});bmt.BlockTokenSubsetMatcher=void 0;var dUa=Cte(),OIi=ibr(),fUa=lbr(),pUa=hbr(),gbr=class t extends fUa.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,pUa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,OIi.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,OIi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return hUa(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,dUa.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}}};bmt.BlockTokenSubsetMatcher=gbr;function hUa(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(hUa,"computeScore")});var Smt=I(J2=>{"use strict";p();Object.defineProperty(J2,"__esModule",{value:!0});J2.defaultCppSimilarFilesOptions=J2.nullSimilarFilesOptions=J2.conservativeFilesOptions=J2.defaultSimilarFilesOptions=void 0;J2.getSimilarSnippets=CUa;var mUa=MIi(),gUa=BIi(),AUa=0,yUa=60,EUa=4,_Ua=1,LIi=20,FIi=1e4;J2.defaultSimilarFilesOptions={snippetLength:yUa,threshold:AUa,maxTopSnippets:EUa,maxCharPerFile:FIi,maxNumberOfFiles:LIi,maxSnippetsPerFile:_Ua,useSubsetMatching:!1};J2.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:FIi,maxNumberOfFiles:LIi,maxSnippetsPerFile:1};J2.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};J2.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function vUa(t,e){return(e.useSubsetMatching?gUa.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):mUa.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(vUa,"getMatcher");async function CUa(t,e,r){let n=vUa(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(CUa,"getSimilarSnippets")});var QIi=I(Tmt=>{"use strict";p();Object.defineProperty(Tmt,"__esModule",{value:!0});Tmt.getCppSimilarFilesOptions=SUa;Tmt.getCppNumberOfSnippets=TUa;var UIi=Smt(),bUa=Imt();function SUa(t,e){return{...UIi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,bUa.useSubsetMatching)(t,e)}}a(SUa,"getCppSimilarFilesOptions");function TUa(t){return UIi.defaultCppSimilarFilesOptions.maxTopSnippets}a(TUa,"getCppNumberOfSnippets")});var Imt=I(TOe=>{"use strict";p();Object.defineProperty(TOe,"__esModule",{value:!0});TOe.getSimilarFilesOptions=PUa;TOe.getNumberOfSnippets=DUa;TOe.useSubsetMatching=HIi;var IUa=eG(),xUa=Smt(),qIi=EE(),wUa=Kpt(),jIi=QIi(),RUa=new Map([["cpp",jIi.getCppSimilarFilesOptions]]);function PUa(t,e,r){let n=RUa.get(r);return n?n(t,e):{...xUa.defaultSimilarFilesOptions,useSubsetMatching:HIi(t,e)}}a(PUa,"getSimilarFilesOptions");var kUa=new Map([["cpp",jIi.getCppNumberOfSnippets]]);function DUa(t,e){let r=kUa.get(e);return r?r(t):IUa.DEFAULT_NUM_SNIPPETS}a(DUa,"getNumberOfSnippets");function HIi(t,e){return(e.filtersAndExp.exp.variables[wUa.ExpTreatmentVariables.UseSubsetMatching]||(0,qIi.getConfig)(t,qIi.ConfigKey.UseSubsetMatching))??!1}a(HIi,"useSubsetMatching")});var IOe=I(xte=>{"use strict";p();Object.defineProperty(xte,"__esModule",{value:!0});xte.convertToAPIChoice=BUa;xte.getTemperatureForSamples=UUa;xte.getStops=qUa;xte.getTopP=jUa;xte.getMaxSolutionTokens=HUa;var NUa=um(),MUa=eG(),GIi=Tl(),OUa=xg();function BUa(t,e,r,n,o,s,c){return(0,OUa.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:LUa(t,r),meanAlternativeLogProb:FUa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,NUa.generateUuid)(),finishReason:r.finish_reason}}a(BUa,"convertToAPIChoice");function LUa(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){GIi.logger.exception(t,r,"Error calculating mean prob")}}a(LUa,"calculateMeanLogProb");function FUa(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){GIi.logger.exception(t,r,"Error calculating mean prob")}}a(FUa,"calculateMeanAlternativeLogProb");function UUa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(UUa,"getTemperatureForSamples");var QUa={markdown:[` `],python:[` @@ -1016,31 +972,31 @@ def `,` class `,` if `,` -#`]};function Hja(t){return jja[t??""]??[` +#`]};function qUa(t){return QUa[t??""]??[` -`,"\n```"]}a(Hja,"getStops");function Gja(){return 1}a(Gja,"getTopP");function $ja(){return Bja.DEFAULT_MAX_COMPLETION_LENGTH}a($ja,"getMaxSolutionTokens")});var b4=I(e5e=>{"use strict";p();Object.defineProperty(e5e,"__esModule",{value:!0});e5e.Fragment=gwi;e5e.jsx=mwi;e5e.jsxs=mwi;function mwi(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(mwi,"functionComponentFunction");function gwi(t){return{type:"f",children:t}}a(gwi,"fragmentFunction");gwi.isFragmentFunction=!0});var sD=I(C1r=>{"use strict";p();Object.defineProperty(C1r,"__esModule",{value:!0});C1r.es5ClassCompat=Vja;function Vja(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(Vja,"es5ClassCompat")});var ige=I(Vte=>{"use strict";p();var Wja=Vte&&Vte.__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},$te;Object.defineProperty(Vte,"__esModule",{value:!0});Vte.Position=void 0;var lgt=Ts(),zja=sD(),v1r=$te=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,lgt.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 $te(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,lgt.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 $te(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Vte.Position=v1r;Vte.Position=v1r=$te=Wja([zja.es5ClassCompat],v1r)});var S4=I(kG=>{"use strict";p();var Yja=kG&&kG.__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},V8;Object.defineProperty(kG,"__esModule",{value:!0});kG.Range=void 0;kG.getDebugDescriptionOfRange=Awi;var Kja=Ts(),Jja=sD(),yC=ige(),b1r=V8=class{static{a(this,"Range")}static isRange(e){return e instanceof V8?!0:!e||typeof e!="object"?!1:yC.Position.isPosition(e.start)&&yC.Position.isPosition(e.end)}static of(e){if(e instanceof V8)return e;if(this.isRange(e))return new V8(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 yC.Position(e,r),c=new yC.Position(n,o)):yC.Position.isPosition(e)&&yC.Position.isPosition(r)&&(s=yC.Position.of(e),c=yC.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 V8.isRange(e)?this.contains(e.start)&&this.contains(e.end):yC.Position.isPosition(e)?!(yC.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=yC.Position.Max(e.start,this._start),n=yC.Position.Min(e.end,this._end);if(!r.isAfter(n))return new V8(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=yC.Position.Min(e.start,this._start),n=yC.Position.Max(e.end,this.end);return new V8(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,Kja.illegalArgument)();let n;return e?yC.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 V8(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return Awi(this)}};kG.Range=b1r;kG.Range=b1r=V8=Yja([Jja.es5ClassCompat],b1r);function Awi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(Awi,"getDebugDescriptionOfRange")});var T1r=I(Kb=>{"use strict";p();var _wi=Kb&&Kb.__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(Kb,"__esModule",{value:!0});Kb.Diagnostic=Kb.DiagnosticRelatedInformation=Kb.DiagnosticSeverity=Kb.DiagnosticTag=void 0;var ywi=El(),Zja=Ku(),Cwi=sD(),vwi=S4(),Ewi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(Ewi||(Kb.DiagnosticTag=Ewi={}));var ugt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(ugt||(Kb.DiagnosticSeverity=ugt={}));var dgt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&vwi.Range.isRange(e.location.range)&&Zja.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()}};Kb.DiagnosticRelatedInformation=dgt;Kb.DiagnosticRelatedInformation=dgt=_wi([Cwi.es5ClassCompat],dgt);var S1r=class{static{a(this,"Diagnostic")}constructor(e,r,n=ugt.Error){if(!vwi.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:ugt[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,ywi.equals)(e.tags,r.tags)&&(0,ywi.equals)(e.relatedInformation,r.relatedInformation,dgt.isEqual)}};Kb.Diagnostic=S1r;Kb.Diagnostic=S1r=_wi([Cwi.es5ClassCompat],S1r)});var w1r=I(Wte=>{"use strict";p();var Xja=Wte&&Wte.__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},I1r;Object.defineProperty(Wte,"__esModule",{value:!0});Wte.Location=void 0;var eHa=Ku(),tHa=sD(),rHa=ige(),fgt=S4(),x1r=I1r=class{static{a(this,"Location")}static isLocation(e){return e instanceof I1r?!0:e?fgt.Range.isRange(e.range)&&eHa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(fgt.Range.isRange(r))this.range=fgt.Range.of(r);else if(rHa.Position.isPosition(r))this.range=new fgt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Wte.Location=x1r;Wte.Location=x1r=I1r=Xja([tHa.es5ClassCompat],x1r)});var bwi=I(D1r=>{"use strict";p();Object.defineProperty(D1r,"__esModule",{value:!0});D1r.getKoreanAltChars=nHa;function nHa(t){let e=iHa(t);if(e&&e.length>0)return new Uint32Array(e)}a(nHa,"getKoreanAltChars");var Jb=0,PG=new Uint32Array(10);function iHa(t){if(Jb=0,T4(t,R1r,4352),Jb>0||(T4(t,k1r,4449),Jb>0)||(T4(t,P1r,4520),Jb>0)||(T4(t,zte,12593),Jb))return PG.subarray(0,Jb);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 PG.subarray(0,Jb)}}a(iHa,"disassembleKorean");function T4(t,e,r){t>=r&&t>8&&(PG[Jb++]=t>>8&255),t>>16&&(PG[Jb++]=t>>16&255))}a(oHa,"addCodesToBuffer");var R1r=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),k1r=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),P1r=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]),zte=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 Iwi=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.tryNormalizeToBase=void 0;oge.normalizeNFC=aHa;oge.normalizeNFD=Swi;var N1r=bP(),sHa=new N1r.LRUCache(1e4);function aHa(t){return Twi(t,"NFC",sHa)}a(aHa,"normalizeNFC");var cHa=new N1r.LRUCache(1e4);function Swi(t){return Twi(t,"NFD",cHa)}a(Swi,"normalizeNFD");var lHa=/[^\u0000-\u0080]/;function Twi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return lHa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(Twi,"normalize");oge.tryNormalizeToBase=(function(){let t=new N1r.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=Swi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var Vwi=I(ac=>{"use strict";p();var uHa=ac&&ac.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dHa=ac&&ac.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fHa=ac&&ac.__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(Nwi,"_matchesPrefix");function Mwi(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(Mwi,"matchesContiguousSubString");function mHa(t,e){if(t.length>e.length)return null;t=(0,mgt.tryNormalizeToBase)(t),e=(0,mgt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(mHa,"matchesBaseContiguousSubString");function Owi(t,e){return t.length>e.length?null:B1r(t.toLowerCase(),e.toLowerCase(),0,0)}a(Owi,"matchesSubString");function B1r(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=B1r(t,e,r+1,n+1))?G1r({start:n,end:n+1},o):null}return B1r(t,e,r,n+1)}a(B1r,"_matchesSubString");function j1r(t){return 97<=t&&t<=122}a(j1r,"isLower");function n5e(t){return 65<=t&&t<=90}a(n5e,"isUpper");function H1r(t){return 48<=t&&t<=57}a(H1r,"isNumber");function Bwi(t){return t===32||t===9||t===10||t===13}a(Bwi,"isWhitespace");var Lwi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>Lwi.add(t.charCodeAt(0)));function ggt(t){return Bwi(t)||Lwi.has(t)}a(ggt,"isWordSeparator");function xwi(t,e){return t===e||ggt(t)&&ggt(e)}a(xwi,"charactersMatch");var M1r=new Map;function wwi(t){if(M1r.has(t))return M1r.get(t);let e,r=(0,hHa.getKoreanAltChars)(t);return r&&(e=r),M1r.set(t,e),e}a(wwi,"getAlternateCodes");function Fwi(t){return j1r(t)||n5e(t)||H1r(t)}a(Fwi,"isAlphanumeric");function G1r(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(G1r,"join");function Uwi(t,e){for(let r=e;r0&&!Fwi(t.charCodeAt(r-1)))return r}return t.length}a(Uwi,"nextAnchor");function L1r(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=L1r(t,e,r+1,n+1);!o&&(s=Uwi(e,s)).6}a(AHa,"isUpperCaseWord");function yHa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(yHa,"isCamelCaseWord");function EHa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=gHa(e);if(!yHa(r)){if(!AHa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&ggt(t.charCodeAt(r-1)))return r;return t.length}a(Qwi,"nextWord");var vHa=q1r(ac.matchesPrefix,$1r,Mwi),bHa=q1r(ac.matchesPrefix,$1r,Owi),kwi=new pHa.LRUCache(1e4);function SHa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=kwi.get(t);n||(n=new RegExp(Q1r.convertSimple2RegExpPattern(t),"i"),kwi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?bHa(t,e):vHa(t,e)}a(SHa,"matchesFuzzy");function THa(t,e){let r=r5e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?qwi(r):null}a(THa,"matchesFuzzy2");function IHa(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(qwi,"createMatches");var NG=128;function V1r(){let t=[],e=[];for(let r=0;r<=NG;r++)e[r]=0;for(let r=0;r<=NG;r++)t.push(e.slice(0));return t}a(V1r,"initTable");function jwi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(jwi,"initArr");var Hwi=jwi(2*NG),U1r=jwi(2*NG),I4=V1r(),DG=V1r(),t5e=V1r(),xHa=!1;function O1r(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} +`,"\n```"]}a(qUa,"getStops");function jUa(){return 1}a(jUa,"getTopP");function HUa(){return MUa.DEFAULT_MAX_COMPLETION_LENGTH}a(HUa,"getMaxSolutionTokens")});var d4=I(xOe=>{"use strict";p();Object.defineProperty(xOe,"__esModule",{value:!0});xOe.Fragment=VIi;xOe.jsx=$Ii;xOe.jsxs=$Ii;function $Ii(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($Ii,"functionComponentFunction");function VIi(t){return{type:"f",children:t}}a(VIi,"fragmentFunction");VIi.isFragmentFunction=!0});var Z2=I(Abr=>{"use strict";p();Object.defineProperty(Abr,"__esModule",{value:!0});Abr.es5ClassCompat=GUa;function GUa(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(GUa,"es5ClassCompat")});var Ome=I(Rte=>{"use strict";p();var $Ua=Rte&&Rte.__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},wte;Object.defineProperty(Rte,"__esModule",{value:!0});Rte.Position=void 0;var xmt=Cs(),VUa=Z2(),ybr=wte=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,xmt.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 wte(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,xmt.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 wte(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Rte.Position=ybr;Rte.Position=ybr=wte=$Ua([VUa.es5ClassCompat],ybr)});var f4=I(fG=>{"use strict";p();var WUa=fG&&fG.__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},k8;Object.defineProperty(fG,"__esModule",{value:!0});fG.Range=void 0;fG.getDebugDescriptionOfRange=WIi;var zUa=Cs(),YUa=Z2(),hv=Ome(),Ebr=k8=class{static{a(this,"Range")}static isRange(e){return e instanceof k8?!0:!e||typeof e!="object"?!1:hv.Position.isPosition(e.start)&&hv.Position.isPosition(e.end)}static of(e){if(e instanceof k8)return e;if(this.isRange(e))return new k8(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 hv.Position(e,r),c=new hv.Position(n,o)):hv.Position.isPosition(e)&&hv.Position.isPosition(r)&&(s=hv.Position.of(e),c=hv.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 k8.isRange(e)?this.contains(e.start)&&this.contains(e.end):hv.Position.isPosition(e)?!(hv.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=hv.Position.Max(e.start,this._start),n=hv.Position.Min(e.end,this._end);if(!r.isAfter(n))return new k8(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=hv.Position.Min(e.start,this._start),n=hv.Position.Max(e.end,this.end);return new k8(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,zUa.illegalArgument)();let n;return e?hv.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 k8(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return WIi(this)}};fG.Range=Ebr;fG.Range=Ebr=k8=WUa([YUa.es5ClassCompat],Ebr);function WIi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(WIi,"getDebugDescriptionOfRange")});var vbr=I(jb=>{"use strict";p();var KIi=jb&&jb.__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(jb,"__esModule",{value:!0});jb.Diagnostic=jb.DiagnosticRelatedInformation=jb.DiagnosticSeverity=jb.DiagnosticTag=void 0;var zIi=Al(),KUa=Ku(),JIi=Z2(),ZIi=f4(),YIi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(YIi||(jb.DiagnosticTag=YIi={}));var wmt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(wmt||(jb.DiagnosticSeverity=wmt={}));var Rmt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&ZIi.Range.isRange(e.location.range)&&KUa.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()}};jb.DiagnosticRelatedInformation=Rmt;jb.DiagnosticRelatedInformation=Rmt=KIi([JIi.es5ClassCompat],Rmt);var _br=class{static{a(this,"Diagnostic")}constructor(e,r,n=wmt.Error){if(!ZIi.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:wmt[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,zIi.equals)(e.tags,r.tags)&&(0,zIi.equals)(e.relatedInformation,r.relatedInformation,Rmt.isEqual)}};jb.Diagnostic=_br;jb.Diagnostic=_br=KIi([JIi.es5ClassCompat],_br)});var Sbr=I(Pte=>{"use strict";p();var JUa=Pte&&Pte.__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},Cbr;Object.defineProperty(Pte,"__esModule",{value:!0});Pte.Location=void 0;var ZUa=Ku(),XUa=Z2(),e7a=Ome(),Pmt=f4(),bbr=Cbr=class{static{a(this,"Location")}static isLocation(e){return e instanceof Cbr?!0:e?Pmt.Range.isRange(e.range)&&ZUa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(Pmt.Range.isRange(r))this.range=Pmt.Range.of(r);else if(e7a.Position.isPosition(r))this.range=new Pmt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Pte.Location=bbr;Pte.Location=bbr=Cbr=JUa([XUa.es5ClassCompat],bbr)});var XIi=I(wbr=>{"use strict";p();Object.defineProperty(wbr,"__esModule",{value:!0});wbr.getKoreanAltChars=t7a;function t7a(t){let e=r7a(t);if(e&&e.length>0)return new Uint32Array(e)}a(t7a,"getKoreanAltChars");var Hb=0,pG=new Uint32Array(10);function r7a(t){if(Hb=0,p4(t,Tbr,4352),Hb>0||(p4(t,Ibr,4449),Hb>0)||(p4(t,xbr,4520),Hb>0)||(p4(t,kte,12593),Hb))return pG.subarray(0,Hb);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 pG.subarray(0,Hb)}}a(r7a,"disassembleKorean");function p4(t,e,r){t>=r&&t>8&&(pG[Hb++]=t>>8&255),t>>16&&(pG[Hb++]=t>>16&255))}a(n7a,"addCodesToBuffer");var Tbr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),Ibr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),xbr=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]),kte=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 rxi=I(Bme=>{"use strict";p();Object.defineProperty(Bme,"__esModule",{value:!0});Bme.tryNormalizeToBase=void 0;Bme.normalizeNFC=o7a;Bme.normalizeNFD=exi;var Rbr=gk(),i7a=new Rbr.LRUCache(1e4);function o7a(t){return txi(t,"NFC",i7a)}a(o7a,"normalizeNFC");var s7a=new Rbr.LRUCache(1e4);function exi(t){return txi(t,"NFD",s7a)}a(exi,"normalizeNFD");var a7a=/[^\u0000-\u0080]/;function txi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return a7a.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(txi,"normalize");Bme.tryNormalizeToBase=(function(){let t=new Rbr.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=exi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var Cxi=I(oc=>{"use strict";p();var c7a=oc&&oc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l7a=oc&&oc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u7a=oc&&oc.__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(lxi,"_matchesPrefix");function uxi(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(uxi,"matchesContiguousSubString");function p7a(t,e){if(t.length>e.length)return null;t=(0,Nmt.tryNormalizeToBase)(t),e=(0,Nmt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(p7a,"matchesBaseContiguousSubString");function dxi(t,e){return t.length>e.length?null:Dbr(t.toLowerCase(),e.toLowerCase(),0,0)}a(dxi,"matchesSubString");function Dbr(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=Dbr(t,e,r+1,n+1))?Qbr({start:n,end:n+1},o):null}return Dbr(t,e,r,n+1)}a(Dbr,"_matchesSubString");function Fbr(t){return 97<=t&&t<=122}a(Fbr,"isLower");function POe(t){return 65<=t&&t<=90}a(POe,"isUpper");function Ubr(t){return 48<=t&&t<=57}a(Ubr,"isNumber");function fxi(t){return t===32||t===9||t===10||t===13}a(fxi,"isWhitespace");var pxi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>pxi.add(t.charCodeAt(0)));function Mmt(t){return fxi(t)||pxi.has(t)}a(Mmt,"isWordSeparator");function nxi(t,e){return t===e||Mmt(t)&&Mmt(e)}a(nxi,"charactersMatch");var Pbr=new Map;function ixi(t){if(Pbr.has(t))return Pbr.get(t);let e,r=(0,f7a.getKoreanAltChars)(t);return r&&(e=r),Pbr.set(t,e),e}a(ixi,"getAlternateCodes");function hxi(t){return Fbr(t)||POe(t)||Ubr(t)}a(hxi,"isAlphanumeric");function Qbr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(Qbr,"join");function mxi(t,e){for(let r=e;r0&&!hxi(t.charCodeAt(r-1)))return r}return t.length}a(mxi,"nextAnchor");function Nbr(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=Nbr(t,e,r+1,n+1);!o&&(s=mxi(e,s)).6}a(m7a,"isUpperCaseWord");function g7a(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(g7a,"isCamelCaseWord");function A7a(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=h7a(e);if(!g7a(r)){if(!m7a(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&Mmt(t.charCodeAt(r-1)))return r;return t.length}a(gxi,"nextWord");var _7a=Lbr(oc.matchesPrefix,qbr,uxi),v7a=Lbr(oc.matchesPrefix,qbr,dxi),sxi=new d7a.LRUCache(1e4);function C7a(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=sxi.get(t);n||(n=new RegExp(Bbr.convertSimple2RegExpPattern(t),"i"),sxi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?v7a(t,e):_7a(t,e)}a(C7a,"matchesFuzzy");function b7a(t,e){let r=ROe(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?Axi(r):null}a(b7a,"matchesFuzzy2");function S7a(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(Axi,"createMatches");var mG=128;function jbr(){let t=[],e=[];for(let r=0;r<=mG;r++)e[r]=0;for(let r=0;r<=mG;r++)t.push(e.slice(0));return t}a(jbr,"initTable");function yxi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(yxi,"initArr");var Exi=yxi(2*mG),Obr=yxi(2*mG),h4=jbr(),hG=jbr(),wOe=jbr(),T7a=!1;function kbr(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(O1r,"printTable");function wHa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(O1r(DG,t,t.length,r,r.length)),console.log(O1r(t5e,t,t.length,r,r.length)),console.log(O1r(I4,t,t.length,r,r.length))}a(wHa,"printTables");function pgt(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!!Q1r.isEmojiImprecise(r)}}a(pgt,"isSeparatorAtPos");function Pwi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(Pwi,"isWhitespaceAtPos");function hgt(t,e,r){return e[t]!==r[t]}a(hgt,"isUpperCaseAtPos");function Gwi(t,e,r,n,o,s,c=!1){for(;eNG?NG:t.length,u=n.length>NG?NG:n.length;if(r>=l||s>=u||l-r>u-s||!Gwi(e,r,l,o,s,u,!0))return;RHa(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=k?DG[d][f-1]+(I4[d][f-1]>0?-5:0):0,N=m>v+1&&I4[d][f-1]>0,L=N?DG[d][f-2]+(I4[d][f-2]>0?-5:0):0;if(N&&(!k||L>=D)&&(!R||L>=x))DG[d][f]=L,t5e[d][f]=3,I4[d][f]=0;else if(k&&(!R||D>=x))DG[d][f]=D,t5e[d][f]=2,I4[d][f]=0;else if(R)DG[d][f]=x,t5e[d][f]=1,I4[d][f]=I4[d-1][f-1]+1;else throw new Error("not possible")}}if(xHa&&wHa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[DG[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=t5e[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]&&!hgt(v+s-1,n,o)&&y+1>I4[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(r5e,"fuzzyScore");function RHa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(U1r[c]=l,c--),l--}a(RHa,"_fillInMaxWordMatchPos");function kHa(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:hgt(c,o,s)&&(c===0||!hgt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):pgt(s,c)&&(c===0||!pgt(s,c-1))?h=5:(pgt(s,c-1)||Pwi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=hgt(c,o,s)||pgt(s,c-1)||Pwi(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(kHa,"_doScore");function PHa(t,e,r,n,o,s,c){return $wi(t,e,r,n,o,s,!0,c)}a(PHa,"fuzzyScoreGracefulAggressive");function DHa(t,e,r,n,o,s,c){return $wi(t,e,r,n,o,s,!1,c)}a(DHa,"fuzzyScoreGraceful");function $wi(t,e,r,n,o,s,c,l){let u=r5e(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($wi,"fuzzyScoreWithPermutations");function NHa(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(NHa,"nextTypoPermutation")});var zwi=I(MG=>{"use strict";p();Object.defineProperty(MG,"__esModule",{value:!0});MG.escapeIcons=LHa;MG.markdownEscapeEscapedIcons=UHa;MG.stripIcons=qHa;MG.getCodiconAriaLabel=jHa;MG.parseLabelWithIcons=HHa;MG.matchesFuzzyIconAware=GHa;var Wwi=Vwi(),MHa=Gh(),z1r=Spr(),OHa="$(",Y1r=new RegExp(`\\$\\(${z1r.ThemeIcon.iconNameExpression}(?:${z1r.ThemeIcon.iconModifierExpression})?\\)`,"g"),BHa=new RegExp(`(\\\\)?${Y1r.source}`,"g");function LHa(t){return t.replace(BHa,(e,r)=>r?e:`\\${e}`)}a(LHa,"escapeIcons");var FHa=new RegExp(`\\\\${Y1r.source}`,"g");function UHa(t){return t.replace(FHa,e=>`\\${e}`)}a(UHa,"markdownEscapeEscapedIcons");var QHa=new RegExp(`(\\s)?(\\\\)?${Y1r.source}(\\s)?`,"g");function qHa(t){return t.indexOf(OHa)===-1?t:t.replace(QHa,(e,r,n,o)=>n?e:r||o||"")}a(qHa,"stripIcons");function jHa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(jHa,"getCodiconAriaLabel");var W1r=new RegExp(`\\$\\(${z1r.ThemeIcon.iconNameCharacter}+\\)`,"g");function HHa(t){W1r.lastIndex=0;let e="",r=[],n=0;for(;;){let o=W1r.lastIndex,s=W1r.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(JA,"__esModule",{value:!0});JA.MarkdownString=void 0;JA.isEmptyMarkdownString=Ywi;JA.isMarkdownString=Kwi;JA.markdownStringEqual=KHa;JA.escapeMarkdownSyntaxTokens=_gt;JA.escapeMarkdownLinkLabel=JHa;JA.appendEscapedMarkdownCodeBlockFence=Jwi;JA.appendEscapedMarkdownInlineCode=ZHa;JA.escapeDoubleQuotes=XHa;JA.removeMarkdownEscapes=eGa;JA.parseHrefAndDimensions=tGa;JA.createMarkdownLink=Zwi;JA.createMarkdownCommandLink=rGa;JA.createCommandUri=Xwi;var $Ha=Ts(),VHa=zwi(),WHa=yK(),zHa=xP(),YHa=Gh(),ygt=Ku(),Egt=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?ygt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,$Ha.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+=_gt(this.supportThemeIcons?(0,VHa.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ +`;return c}a(kbr,"printTable");function I7a(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(kbr(hG,t,t.length,r,r.length)),console.log(kbr(wOe,t,t.length,r,r.length)),console.log(kbr(h4,t,t.length,r,r.length))}a(I7a,"printTables");function kmt(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!!Bbr.isEmojiImprecise(r)}}a(kmt,"isSeparatorAtPos");function axi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(axi,"isWhitespaceAtPos");function Dmt(t,e,r){return e[t]!==r[t]}a(Dmt,"isUpperCaseAtPos");function _xi(t,e,r,n,o,s,c=!1){for(;emG?mG:t.length,u=n.length>mG?mG:n.length;if(r>=l||s>=u||l-r>u-s||!_xi(e,r,l,o,s,u,!0))return;x7a(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?hG[d][f-1]+(h4[d][f-1]>0?-5:0):0,N=m>v+1&&h4[d][f-1]>0,L=N?hG[d][f-2]+(h4[d][f-2]>0?-5:0):0;if(N&&(!P||L>=D)&&(!R||L>=x))hG[d][f]=L,wOe[d][f]=3,h4[d][f]=0;else if(P&&(!R||D>=x))hG[d][f]=D,wOe[d][f]=2,h4[d][f]=0;else if(R)hG[d][f]=x,wOe[d][f]=1,h4[d][f]=h4[d-1][f-1]+1;else throw new Error("not possible")}}if(T7a&&I7a(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[hG[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=wOe[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]&&!Dmt(v+s-1,n,o)&&y+1>h4[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(ROe,"fuzzyScore");function x7a(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(Obr[c]=l,c--),l--}a(x7a,"_fillInMaxWordMatchPos");function w7a(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:Dmt(c,o,s)&&(c===0||!Dmt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):kmt(s,c)&&(c===0||!kmt(s,c-1))?h=5:(kmt(s,c-1)||axi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=Dmt(c,o,s)||kmt(s,c-1)||axi(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(w7a,"_doScore");function R7a(t,e,r,n,o,s,c){return vxi(t,e,r,n,o,s,!0,c)}a(R7a,"fuzzyScoreGracefulAggressive");function P7a(t,e,r,n,o,s,c){return vxi(t,e,r,n,o,s,!1,c)}a(P7a,"fuzzyScoreGraceful");function vxi(t,e,r,n,o,s,c,l){let u=ROe(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(vxi,"fuzzyScoreWithPermutations");function k7a(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(k7a,"nextTypoPermutation")});var Sxi=I(gG=>{"use strict";p();Object.defineProperty(gG,"__esModule",{value:!0});gG.escapeIcons=O7a;gG.markdownEscapeEscapedIcons=L7a;gG.stripIcons=U7a;gG.getCodiconAriaLabel=Q7a;gG.parseLabelWithIcons=q7a;gG.matchesFuzzyIconAware=j7a;var bxi=Cxi(),D7a=Gh(),Gbr=_fr(),N7a="$(",$br=new RegExp(`\\$\\(${Gbr.ThemeIcon.iconNameExpression}(?:${Gbr.ThemeIcon.iconModifierExpression})?\\)`,"g"),M7a=new RegExp(`(\\\\)?${$br.source}`,"g");function O7a(t){return t.replace(M7a,(e,r)=>r?e:`\\${e}`)}a(O7a,"escapeIcons");var B7a=new RegExp(`\\\\${$br.source}`,"g");function L7a(t){return t.replace(B7a,e=>`\\${e}`)}a(L7a,"markdownEscapeEscapedIcons");var F7a=new RegExp(`(\\s)?(\\\\)?${$br.source}(\\s)?`,"g");function U7a(t){return t.indexOf(N7a)===-1?t:t.replace(F7a,(e,r,n,o)=>n?e:r||o||"")}a(U7a,"stripIcons");function Q7a(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(Q7a,"getCodiconAriaLabel");var Hbr=new RegExp(`\\$\\(${Gbr.ThemeIcon.iconNameCharacter}+\\)`,"g");function q7a(t){Hbr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=Hbr.lastIndex,s=Hbr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(ry,"__esModule",{value:!0});ry.MarkdownString=void 0;ry.isEmptyMarkdownString=Txi;ry.isMarkdownString=Ixi;ry.markdownStringEqual=z7a;ry.escapeMarkdownSyntaxTokens=Fmt;ry.escapeMarkdownLinkLabel=Y7a;ry.appendEscapedMarkdownCodeBlockFence=xxi;ry.appendEscapedMarkdownInlineCode=K7a;ry.escapeDoubleQuotes=J7a;ry.removeMarkdownEscapes=Z7a;ry.parseHrefAndDimensions=X7a;ry.createMarkdownLink=wxi;ry.createMarkdownCommandLink=eQa;ry.createCommandUri=Rxi;var H7a=Cs(),G7a=Sxi(),$7a=XY(),V7a=_k(),W7a=Gh(),Bmt=Ku(),Lmt=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?Bmt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,H7a.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+=Fmt(this.supportThemeIcons?(0,G7a.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+=` -${Jwi(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,YHa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};JA.MarkdownString=Egt;function Ywi(t){return Kwi(t)?!t.value:Array.isArray(t)?t.every(Ywi):!0}a(Ywi,"isEmptyMarkdownString");function Kwi(t){return t instanceof Egt?!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(Kwi,"isMarkdownString");function KHa(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,zHa.isEqual)(ygt.URI.from(t.baseUri),ygt.URI.from(e.baseUri)))}a(KHa,"markdownStringEqual");function _gt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(_gt,"escapeMarkdownSyntaxTokens");function JHa(t){return t.replace(/[\\\]]/g,"\\$&")}a(JHa,"escapeMarkdownLinkLabel");function Jwi(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(Jwi,"appendEscapedMarkdownCodeBlockFence");function ZHa(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(ZHa,"appendEscapedMarkdownInlineCode");function XHa(t){return t.replace(/"/g,""")}a(XHa,"escapeDoubleQuotes");function eGa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(eGa,"removeMarkdownEscapes");function tGa(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(tGa,"parseHrefAndDimensions");function Zwi(t,e,r,n=!0){return`[${n?_gt(t):t}](${e}${r?` "${_gt(r)}"`:""})`}a(Zwi,"createMarkdownLink");function rGa(t,e=!0){let r=Xwi(t.id,...t.arguments||[]).toString();return Zwi(t.text,r,t.tooltip,e)}a(rGa,"createMarkdownCommandLink");function Xwi(t,...e){return ygt.URI.from({scheme:WHa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(Xwi,"createCommandUri")});var Z1r=I(Yte=>{"use strict";p();var nGa=Yte&&Yte.__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},K1r;Object.defineProperty(Yte,"__esModule",{value:!0});Yte.MarkdownString=void 0;var iGa=eRi(),oGa=sD(),J1r=K1r=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof K1r?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new iGa.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}};Yte.MarkdownString=J1r;Yte.MarkdownString=J1r=K1r=nGa([oGa.es5ClassCompat],J1r)});var nRi=I(W8=>{"use strict";p();Object.defineProperty(W8,"__esModule",{value:!0});W8.Mimes=void 0;W8.getMediaOrTextMime=aGa;W8.getMediaMime=rRi;W8.getExtensionForMimeType=cGa;W8.normalizeMimeType=uGa;W8.isTextStreamMime=dGa;var tRi=hA();W8.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 sGa={".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"},X1r={".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 aGa(t){let e=(0,tRi.extname)(t),r=sGa[e.toLowerCase()];return r!==void 0?r:rRi(t)}a(aGa,"getMediaOrTextMime");function rRi(t){let e=(0,tRi.extname)(t),r=X1r[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(rRi,"getMediaMime");function cGa(t){for(let e in X1r){let r=X1r[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(cGa,"getExtensionForMimeType");var lGa=/^(.+)\/(.+?)(;.+)?$/;function uGa(t,e){let r=lGa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(uGa,"normalizeMimeType");function dGa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(dGa,"isTextStreamMime")});var sRi=I(hm=>{"use strict";p();var fGa=hm&&hm.__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},OG;Object.defineProperty(hm,"__esModule",{value:!0});hm.NotebookCellOutput=hm.NotebookCellOutputItem=hm.NotebookEdit=hm.NotebookData=hm.NotebookCellData=hm.NotebookRange=hm.NotebookCellKind=void 0;var pGa=sD(),iRi=Ts(),Cgt=nRi(),hGa=um(),oRi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(oRi||(hm.NotebookCellKind=oRi={}));var Kte=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,iRi.illegalArgument)("start must be positive");if(r<0)throw(0,iRi.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)}};hm.NotebookRange=Kte;var eSr=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)}};hm.NotebookCellData=eSr;var tSr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};hm.NotebookData=tSr;var rSr=OG=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof OG?!0:e?Kte.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new OG(e,r)}static insertCells(e,r){return new OG(new Kte(e,e),r)}static deleteCells(e){return new OG(e,[])}static updateCellMetadata(e,r){let n=new OG(new Kte(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new OG(new Kte(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};hm.NotebookEdit=rSr;hm.NotebookEdit=rSr=OG=fGa([pGa.es5ClassCompat],rSr);var nSr=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=Cgt.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,Cgt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};hm.NotebookCellOutputItem=nSr;var iSr=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,hGa.generateUuid)(),this.metadata=r??n)}};hm.NotebookCellOutput=iSr});var cRi=I(LG=>{"use strict";p();var mGa=LG&&LG.__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},oSr;Object.defineProperty(LG,"__esModule",{value:!0});LG.Selection=void 0;LG.getDebugDescriptionOfSelection=aRi;var gGa=sD(),BG=ige(),sSr=S4(),aSr=oSr=class extends sSr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof oSr?!0:!e||typeof e!="object"?!1:sSr.Range.isRange(e)&&BG.Position.isPosition(e.anchor)&&BG.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 BG.Position(e,r),c=new BG.Position(n,o)):BG.Position.isPosition(e)&&BG.Position.isPosition(r)&&(s=BG.Position.of(e),c=BG.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 aRi(this)}};LG.Selection=aSr;LG.Selection=aSr=oSr=mGa([gGa.es5ClassCompat],aSr);function aRi(t){let e=(0,sSr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(aRi,"getDebugDescriptionOfSelection")});var lSr=I(Zte=>{"use strict";p();var AGa=Zte&&Zte.__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},Jte;Object.defineProperty(Zte,"__esModule",{value:!0});Zte.SnippetString=void 0;var yGa=sD(),cSr=Jte=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Jte?!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+=Jte._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 Jte;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Jte._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 Jte;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}};Zte.SnippetString=cSr;Zte.SnippetString=cSr=Jte=AGa([yGa.es5ClassCompat],cSr)});var dSr=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.SnippetTextEdit=void 0;var EGa=lSr(),lRi=S4(),uSr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?lRi.Range.isRange(e.range)&&EGa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new lRi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};vgt.SnippetTextEdit=uSr});var fRi=I(aD=>{"use strict";p();var _Ga=aD&&aD.__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},fSr;Object.defineProperty(aD,"__esModule",{value:!0});aD.SymbolInformation=aD.SymbolTag=aD.SymbolKind=void 0;var CGa=sD(),uRi=w1r(),vGa=S4(),pSr;(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"})(pSr||(aD.SymbolKind=pSr={}));var dRi;(function(t){t[t.Deprecated=1]="Deprecated"})(dRi||(aD.SymbolTag=dRi={}));var hSr=fSr=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 uRi.Location?this.location=o:n instanceof vGa.Range&&(this.location=new uRi.Location(o,n)),fSr.validate(this)}toJSON(){return{name:this.name,kind:pSr[this.kind],location:this.location,containerName:this.containerName}}};aD.SymbolInformation=hSr;aD.SymbolInformation=hSr=fSr=_Ga([CGa.es5ClassCompat],hSr)});var ASr=I(z8=>{"use strict";p();var bGa=z8&&z8.__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},Xte;Object.defineProperty(z8,"__esModule",{value:!0});z8.TextEdit=z8.EndOfLine=void 0;var mSr=Ts(),SGa=sD(),pRi=ige(),bgt=S4(),hRi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(hRi||(z8.EndOfLine=hRi={}));var gSr=Xte=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof Xte?!0:!e||typeof e!="object"?!1:bgt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new Xte(e,r)}static insert(e,r){return Xte.replace(new bgt.Range(e,e),r)}static delete(e){return Xte.replace(e,"")}static setEndOfLine(e){let r=new Xte(new bgt.Range(new pRi.Position(0,0),new pRi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!bgt.Range.isRange(e))throw(0,mSr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,mSr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,mSr.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}}};z8.TextEdit=gSr;z8.TextEdit=gSr=Xte=bGa([SGa.es5ClassCompat],gSr)});var IRi=I(St=>{"use strict";p();Object.defineProperty(St,"__esModule",{value:!0});St.ChatResponseClearToPreviousToolInvocationReason=St.ChatRequestEditedFileEventKind=St.ChatInputNotificationSeverity=St.ChatErrorLevel=St.AISearchKeyword=St.TextSearchMatch2=St.ExcludeSettingOptions=St.LanguageModelPromptTsxPart=St.ChatImageMimeType=St.LanguageModelDataPart2=St.LanguageModelDataPart=St.LanguageModelThinkingPart=St.LanguageModelTextPart2=St.LanguageModelPartAudience=St.LanguageModelTextPart=St.LanguageModelToolResult2=St.LanguageModelToolResult=St.ChatReferenceBinaryData=St.ChatReferenceDiagnostic=St.ChatRequestNotebookData=St.ChatRequestEditorData=St.ChatResponseTurn=St.ChatRequestTurn2=St.ChatRequestTurn=St.ChatResponseQuestionCarouselPart=St.ChatQuestion=St.ChatQuestionType=St.ChatResponseConfirmationPart=St.ChatResponseWorkspaceEditPart=St.ChatResponseNotebookEditPart=St.ChatResponseTextEditPart=St.ChatResponseMarkdownWithVulnerabilitiesPart=St.ChatResponseCommandButtonPart=St.ChatResponseCodeCitationPart=St.ChatResponsePullRequestPart=St.ChatResponseExtensionsPart=St.ChatResponseMovePart=St.ChatResponseReferencePart2=St.ChatResponseReferencePart=St.ChatResponseInfoPart=St.ChatResponseWarningPart=St.ChatResponseProgressPart2=St.ChatResponseExternalEditPart=St.ChatResponseHookPart=St.ChatResponseThinkingProgressPart=St.ChatResponseProgressPart=St.ChatResponseAnchorPart=St.ChatResponseFileTreePart=St.ChatResponseCodeblockUriPart=St.ChatResponseMarkdownPart=void 0;St.McpHttpServerDefinition=St.McpStdioServerDefinition=St.ChatResource=St.LanguageModelError=St.ChatSessionStatus=St.ChatResponseTurn2=St.ChatSubagentToolInvocationData=St.ChatToolInvocationPart=St.McpToolInvocationContentData=St.LanguageModelChatMessage=St.LanguageModelChatToolMode=St.LanguageModelChatMessageRole=St.LanguageModelToolResultPart2=St.LanguageModelToolResultPart=St.LanguageModelToolCallPart=St.LanguageModelToolMCPSource=St.LanguageModelToolExtensionSource=void 0;var mRi=_G(),xgt=Z1r(),ySr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new xgt.MarkdownString(e):e}};St.ChatResponseMarkdownPart=ySr;var ESr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};St.ChatResponseCodeblockUriPart=ESr;var _Sr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};St.ChatResponseFileTreePart=_Sr;var CSr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};St.ChatResponseAnchorPart=CSr;var vSr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};St.ChatResponseProgressPart=vSr;var bSr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};St.ChatResponseThinkingProgressPart=bSr;var SSr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};St.ChatResponseHookPart=SSr;var TSr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};St.ChatResponseExternalEditPart=TSr;var ISr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};St.ChatResponseProgressPart2=ISr;var xSr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new xgt.MarkdownString(e):e}};St.ChatResponseWarningPart=xSr;var wSr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new xgt.MarkdownString(e):e}};St.ChatResponseInfoPart=wSr;var RSr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};St.ChatResponseReferencePart=RSr;var kSr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};St.ChatResponseReferencePart2=kSr;var PSr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};St.ChatResponseMovePart=PSr;var DSr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};St.ChatResponseExtensionsPart=DSr;var NSr=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}};St.ChatResponsePullRequestPart=NSr;var MSr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};St.ChatResponseCodeCitationPart=MSr;var OSr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};St.ChatResponseCommandButtonPart=OSr;var BSr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new xgt.MarkdownString(e):e,this.vulnerabilities=r}};St.ChatResponseMarkdownWithVulnerabilitiesPart=BSr;var LSr=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]}};St.ChatResponseTextEditPart=LSr;var FSr=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]}};St.ChatResponseNotebookEditPart=FSr;var USr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};St.ChatResponseWorkspaceEditPart=USr;var QSr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};St.ChatResponseConfirmationPart=QSr;var gRi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(gRi||(St.ChatQuestionType=gRi={}));var qSr=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)}};St.ChatQuestion=qSr;var jSr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};St.ChatResponseQuestionCarouselPart=jSr;var HSr=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}};St.ChatRequestTurn=HSr;var GSr=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}};St.ChatRequestTurn2=GSr;var $Sr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};St.ChatResponseTurn=$Sr;var VSr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};St.ChatRequestEditorData=VSr;var WSr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};St.ChatRequestNotebookData=WSr;var zSr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};St.ChatReferenceDiagnostic=zSr;var YSr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};St.ChatReferenceBinaryData=YSr;var KSr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};St.LanguageModelToolResult=KSr;var JSr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};St.LanguageModelToolResult2=JSr;var Sgt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};St.LanguageModelTextPart=Sgt;var ARi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(ARi||(St.LanguageModelPartAudience=ARi={}));var ZSr=class extends Sgt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};St.LanguageModelTextPart2=ZSr;var XSr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};St.LanguageModelThinkingPart=XSr;var Tgt=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(mRi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(mRi.VSBuffer.fromString(e).buffer,"text/plain")}};St.LanguageModelDataPart=Tgt;var eTr=class extends Tgt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};St.LanguageModelDataPart2=eTr;var yRi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(yRi||(St.ChatImageMimeType=yRi={}));var tTr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};St.LanguageModelPromptTsxPart=tTr;var ERi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(ERi||(St.ExcludeSettingOptions=ERi={}));var rTr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};St.TextSearchMatch2=rTr;var nTr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};St.AISearchKeyword=nTr;var _Ri;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(_Ri||(St.ChatErrorLevel=_Ri={}));var CRi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(CRi||(St.ChatInputNotificationSeverity=CRi={}));var vRi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(vRi||(St.ChatRequestEditedFileEventKind=vRi={}));var bRi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(bRi||(St.ChatResponseClearToPreviousToolInvocationReason=bRi={}));var iTr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};St.LanguageModelToolExtensionSource=iTr;var oTr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};St.LanguageModelToolMCPSource=oTr;var sTr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};St.LanguageModelToolCallPart=sTr;var aTr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};St.LanguageModelToolResultPart=aTr;var cTr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};St.LanguageModelToolResultPart2=cTr;var Igt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Igt||(St.LanguageModelChatMessageRole=Igt={}));var SRi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(SRi||(St.LanguageModelChatToolMode=SRi={}));var lTr=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(Igt.User,e,r)}static Assistant(e,r){return new t(Igt.Assistant,e,r)}};St.LanguageModelChatMessage=lTr;var uTr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};St.McpToolInvocationContentData=uTr;var dTr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};St.ChatToolInvocationPart=dTr;var fTr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};St.ChatSubagentToolInvocationData=fTr;var pTr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};St.ChatResponseTurn2=pTr;var TRi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(TRi||(St.ChatSessionStatus=TRi={}));var hTr=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??""}};St.LanguageModelError=hTr;var mTr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};St.ChatResource=mTr;var gTr=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}};St.McpStdioServerDefinition=gTr;var ATr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};St.McpHttpServerDefinition=ATr});var RRi=I(FG=>{"use strict";p();Object.defineProperty(FG,"__esModule",{value:!0});FG.TextDocumentChangeReason=FG.TextEditorSelectionChangeKind=FG.WorkspaceEdit=void 0;var TGa=El(),IGa=bP(),xGa=S4(),wGa=dSr(),RGa=ASr(),yTr=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 RGa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new xGa.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,wGa.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(Ap,"__esModule",{value:!0});Ap.FileType=Ap.ChatSessionStatus=Ap.ChatLocation=Ap.ChatVariableLevel=Ap.ExtensionMode=Ap.DiagnosticSeverity=Ap.TextEditorRevealType=Ap.TextEditorLineNumbersStyle=Ap.TextEditorCursorStyle=Ap.InteractiveEditorResponseFeedbackKind=void 0;var kRi;(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"})(kRi||(Ap.InteractiveEditorResponseFeedbackKind=kRi={}));var PRi;(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"})(PRi||(Ap.TextEditorCursorStyle=PRi={}));var DRi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(DRi||(Ap.TextEditorLineNumbersStyle=DRi={}));var NRi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(NRi||(Ap.TextEditorRevealType=NRi={}));var MRi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(MRi||(Ap.DiagnosticSeverity=MRi={}));var ORi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(ORi||(Ap.ExtensionMode=ORi={}));var BRi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(BRi||(Ap.ChatVariableLevel=BRi={}));var LRi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(LRi||(Ap.ChatLocation=LRi={}));var FRi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(FRi||(Ap.ChatSessionStatus=FRi={}));var URi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(URi||(Ap.FileType=URi={}))});var jRi=I(ETr=>{"use strict";p();Object.defineProperty(ETr,"__esModule",{value:!0});ETr.t=kGa;function kGa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return qRi({message:e,args:r})}return qRi(t[0])}a(kGa,"t");function qRi(t){let{message:e,args:r}=t;return DGa(e,r??{})}a(qRi,"getMessage");var PGa=/{([^}]+)}/g;function DGa(t,e){return t.replace(PGa,(r,n)=>e[n]??r)}a(DGa,"format2")});var $Ri=I(UG=>{"use strict";p();Object.defineProperty(UG,"__esModule",{value:!0});UG.NewSymbolName=UG.NewSymbolNameTriggerKind=UG.NewSymbolNameTag=void 0;var HRi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(HRi||(UG.NewSymbolNameTag=HRi={}));var GRi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(GRi||(UG.NewSymbolNameTriggerKind=GRi={}));var _Tr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};UG.NewSymbolName=_Tr});var WRi=I(wgt=>{"use strict";p();Object.defineProperty(wgt,"__esModule",{value:!0});wgt.TerminalShellExecutionCommandLineConfidence=void 0;var VRi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(VRi||(wgt.TerminalShellExecutionCommandLineConfidence=VRi={}))});var zRi=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.ThemeColor=sge.ThemeIcon=void 0;var CTr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};sge.ThemeIcon=CTr;var vTr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};sge.ThemeColor=vTr});var mm=I((yTp,ZRi)=>{"use strict";p();var NGa=SP(),MGa=Sc(),OGa=Ku(),YRi=T1r(),BGa=w1r(),LGa=Z1r(),i5e=sRi(),FGa=ige(),UGa=S4(),QGa=cRi(),qGa=lSr(),jGa=dSr(),KRi=fRi(),JRi=ASr(),Nn=IRi(),bTr=RRi(),QG=QRi(),HGa=jRi(),STr=$Ri(),GGa=WRi(),$Ga=zRi(),VGa={Position:FGa.Position,Range:UGa.Range,Selection:QGa.Selection,EventEmitter:MGa.Emitter,CancellationTokenSource:NGa.CancellationTokenSource,Diagnostic:YRi.Diagnostic,Location:BGa.Location,DiagnosticRelatedInformation:YRi.DiagnosticRelatedInformation,TextEdit:JRi.TextEdit,WorkspaceEdit:bTr.WorkspaceEdit,Uri:OGa.URI,MarkdownString:LGa.MarkdownString,DiagnosticSeverity:QG.DiagnosticSeverity,TextEditorCursorStyle:QG.TextEditorCursorStyle,TextEditorLineNumbersStyle:QG.TextEditorLineNumbersStyle,TextEditorRevealType:QG.TextEditorRevealType,EndOfLine:JRi.EndOfLine,l10n:{t:HGa.t},ExtensionMode:QG.ExtensionMode,ChatVariableLevel:QG.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:Nn.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:Nn.ChatResponseMarkdownPart,ChatResponseFileTreePart:Nn.ChatResponseFileTreePart,ChatResponseAnchorPart:Nn.ChatResponseAnchorPart,ChatResponseMovePart:Nn.ChatResponseMovePart,ChatResponseExtensionsPart:Nn.ChatResponseExtensionsPart,ChatResponseProgressPart:Nn.ChatResponseProgressPart,ChatResponseProgressPart2:Nn.ChatResponseProgressPart2,ChatResponseWarningPart:Nn.ChatResponseWarningPart,ChatResponseInfoPart:Nn.ChatResponseInfoPart,ChatResponseHookPart:Nn.ChatResponseHookPart,ChatResponseReferencePart:Nn.ChatResponseReferencePart,ChatResponseReferencePart2:Nn.ChatResponseReferencePart2,ChatResponseCodeCitationPart:Nn.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:Nn.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:Nn.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:Nn.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:Nn.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:Nn.ChatResponseTextEditPart,ChatResponseNotebookEditPart:Nn.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:Nn.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:Nn.ChatResponseConfirmationPart,ChatQuestion:Nn.ChatQuestion,ChatQuestionType:Nn.ChatQuestionType,ChatResponseQuestionCarouselPart:Nn.ChatResponseQuestionCarouselPart,ChatRequestTurn:Nn.ChatRequestTurn,ChatResponseTurn:Nn.ChatResponseTurn,ChatRequestEditorData:Nn.ChatRequestEditorData,ChatRequestNotebookData:Nn.ChatRequestNotebookData,NewSymbolName:STr.NewSymbolName,NewSymbolNameTag:STr.NewSymbolNameTag,NewSymbolNameTriggerKind:STr.NewSymbolNameTriggerKind,ChatLocation:QG.ChatLocation,SymbolInformation:KRi.SymbolInformation,LanguageModelToolResult:Nn.LanguageModelToolResult,ExtendedLanguageModelToolResult:Nn.LanguageModelToolResult,LanguageModelToolResult2:Nn.LanguageModelToolResult2,LanguageModelPromptTsxPart:Nn.LanguageModelPromptTsxPart,LanguageModelTextPart:Nn.LanguageModelTextPart,LanguageModelDataPart:Nn.LanguageModelDataPart,LanguageModelToolExtensionSource:Nn.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:Nn.LanguageModelToolMCPSource,ChatReferenceBinaryData:Nn.ChatReferenceBinaryData,ChatReferenceDiagnostic:Nn.ChatReferenceDiagnostic,TextSearchMatch2:Nn.TextSearchMatch2,AISearchKeyword:Nn.AISearchKeyword,ExcludeSettingOptions:Nn.ExcludeSettingOptions,NotebookCellKind:i5e.NotebookCellKind,NotebookRange:i5e.NotebookRange,NotebookEdit:i5e.NotebookEdit,NotebookCellData:i5e.NotebookCellData,NotebookData:i5e.NotebookData,ChatErrorLevel:Nn.ChatErrorLevel,ChatInputNotificationSeverity:Nn.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:GGa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:Nn.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:Nn.ChatResponsePullRequestPart,LanguageModelTextPart2:Nn.LanguageModelTextPart2,LanguageModelDataPart2:Nn.LanguageModelDataPart2,LanguageModelThinkingPart:Nn.LanguageModelThinkingPart,LanguageModelPartAudience:Nn.LanguageModelPartAudience,ChatResponseThinkingProgressPart:Nn.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:Nn.LanguageModelToolCallPart,LanguageModelToolResultPart:Nn.LanguageModelToolResultPart,LanguageModelToolResultPart2:Nn.LanguageModelToolResultPart2,LanguageModelChatMessageRole:Nn.LanguageModelChatMessageRole,LanguageModelChatMessage:Nn.LanguageModelChatMessage,LanguageModelChatToolMode:Nn.LanguageModelChatToolMode,TextEditorSelectionChangeKind:bTr.TextEditorSelectionChangeKind,TextDocumentChangeReason:bTr.TextDocumentChangeReason,ChatToolInvocationPart:Nn.ChatToolInvocationPart,ChatSubagentToolInvocationData:Nn.ChatSubagentToolInvocationData,McpToolInvocationContentData:Nn.McpToolInvocationContentData,ChatResponseTurn2:Nn.ChatResponseTurn2,ChatRequestTurn2:Nn.ChatRequestTurn2,LanguageModelError:Nn.LanguageModelError,SymbolKind:KRi.SymbolKind,SnippetString:qGa.SnippetString,SnippetTextEdit:jGa.SnippetTextEdit,FileType:QG.FileType,ChatSessionStatus:Nn.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:Nn.McpHttpServerDefinition,McpStdioServerDefinition:Nn.McpStdioServerDefinition,ThemeIcon:$Ga.ThemeIcon};ZRi.exports=VGa});var XRi=I(age=>{"use strict";p();Object.defineProperty(age,"__esModule",{value:!0});age.UseData=age.UseState=void 0;var TTr=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}};age.UseState=TTr;var ITr=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)}}};age.UseData=ITr});var tki=I(Rgt=>{"use strict";p();Object.defineProperty(Rgt,"__esModule",{value:!0});Rgt.VirtualPromptReconciler=void 0;var eki=XRi(),xTr=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(WGa(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 RTr(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 wTr([])),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)}};Rgt.VirtualPromptReconciler=xTr;var wTr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},RTr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new eki.UseState(e.state),this.dataHook=new eki.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 WGa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(WGa,"isFragmentFunction")});var rki=I(kgt=>{"use strict";p();Object.defineProperty(kgt,"__esModule",{value:!0});kgt.VirtualPrompt=void 0;var zGa=tki(),kTr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new zGa.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()}};kgt.VirtualPrompt=kTr});var Y8=I(Pgt=>{"use strict";p();Object.defineProperty(Pgt,"__esModule",{value:!0});Pgt.Text=YGa;Pgt.Chunk=KGa;function YGa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(YGa,"Text");function KGa(t){return t.children}a(KGa,"Chunk")});var qG=I(K8=>{"use strict";p();Object.defineProperty(K8,"__esModule",{value:!0});K8.PerCompletionContextProviderStatistics=K8.ContextProviderStatistics=K8.ICompletionsContextProviderService=void 0;K8.componentStatisticsToPromptMatcher=XGa;var JGa=rn(),ZGa=H8();K8.ICompletionsContextProviderService=(0,JGa.createServiceIdentifier)("ICompletionsContextProviderService");var PTr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new Dgt){this.createStatistics=e,this.statistics=new ZGa.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)}}};K8.ContextProviderStatistics=PTr;var Dgt=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()}}};K8.PerCompletionContextProviderStatistics=Dgt;function XGa(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(XGa,"componentStatisticsToPromptMatcher")});var a5e=I(s5e=>{"use strict";p();Object.defineProperty(s5e,"__esModule",{value:!0});s5e.filterContextItemsByType=n$a;s5e.filterSupportedContextItems=i$a;s5e.addOrValidateContextItemsIDs=s$a;var e$a=mm(),t$a=Ku(),DTr=um(),r$a=TOe(),NTr=xl(),o5e;(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&&!r$a.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(o5e||(o5e={}));var MTr;(function(t){function e(r){if(!o5e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(MTr||(MTr={}));var OTr;(function(t){function e(r){if(!o5e.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})(OTr||(OTr={}));var BTr;(function(t){function e(r){if(!o5e.is(r))return!1;let n=r;if(!t$a.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof e$a.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(BTr||(BTr={}));var LTr;(function(t){function e(r){if(MTr.is(r))return"Trait";if(OTr.is(r))return"CodeSnippet";if(BTr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(LTr||(LTr={}));function n$a(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(n$a,"filterContextItemsByType");function i$a(t){let e=[],r=0;return t.forEach(n=>{let o=LTr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(i$a,"filterSupportedContextItems");function o$a(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(o$a,"validateContextItemId");function s$a(t,e){let r=new Set,n=t.get(NTr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,DTr.generateUuid)();if(!o$a(c)){let l=(0,DTr.generateUuid)();NTr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,DTr.generateUuid)();NTr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(s$a,"addOrValidateContextItemsIDs")});var FTr=I(Ngt=>{"use strict";p();Object.defineProperty(Ngt,"__esModule",{value:!0});Ngt.getCodeSnippetsFromContextItems=d$a;Ngt.addRelativePathToCodeSnippets=f$a;var a$a=zb(),c$a=qG(),l$a=a5e(),u$a="content_excluded";async function d$a(t,e,r,n){let o=(0,l$a.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(c$a.ICompletionsContextProviderService),u=t.get(a$a.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,u$a]]),g}).map(h=>h.data)}a(d$a,"getCodeSnippetsFromContextItems");function f$a(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(f$a,"addRelativePathToCodeSnippets")});var UTr=I(Bgt=>{"use strict";p();Object.defineProperty(Bgt,"__esModule",{value:!0});Bgt.CodeSnippets=void 0;var Mgt=b4(),Ogt=Y8(),p$a=J8(),h$a=FTr(),m$a=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(p$a.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,h$a.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,Mgt.jsx)(Ogt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Mgt.jsx)(Ogt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(cge,"__esModule",{value:!0});cge.CompletionsContext=nki;cge.StableCompletionsContext=iki;cge.AdditionalCompletionsContext=oki;cge.isContextNode=g$a;function nki(t){return t.children}a(nki,"CompletionsContext");function iki(t){return t.children}a(iki,"StableCompletionsContext");function oki(t){return t.children}a(oki,"AdditionalCompletionsContext");function g$a(t){return t.name===nki.name||t.name===iki.name||t.name===oki.name}a(g$a,"isContextNode")});var qTr=I(l5e=>{"use strict";p();Object.defineProperty(l5e,"__esModule",{value:!0});l5e.SnapshotWalker=void 0;l5e.defaultTransformers=ski;var A$a=Y8(),QTr=class{static{a(this,"SnapshotWalker")}constructor(e,r=ski()){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)}};l5e.SnapshotWalker=QTr;function ski(){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===A$a.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(ski,"defaultTransformers")});var aki=I(jTr=>{"use strict";p();Object.defineProperty(jTr,"__esModule",{value:!0});jTr.findEditDistanceScore=y$a;function y$a(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(cD,"__esModule",{value:!0});cD.MAX_EDIT_DISTANCE_LENGTH=void 0;cD.CurrentFile=v$a;cD.BeforeCursor=$Tr;cD.AfterCursor=VTr;cD.DocumentPrefix=b$a;cD.DocumentSuffix=S$a;var hR=b4(),lge=Y8(),E$a=yG(),_$a=aki(),C$a=Lme(),HTr=J8();cD.MAX_EDIT_DISTANCE_LENGTH=50;function GTr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(GTr,"approximateMaxCharacters");function v$a(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(HTr.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=GTr(c);return(0,hR.jsxs)(hR.Fragment,{children:[(0,hR.jsx)($Tr,{document:r,position:o,maxCharacters:m}),(0,hR.jsx)(VTr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(v$a,"CurrentFile");function $Tr(t){if(t.document===void 0||t.position===void 0)return(0,hR.jsx)(lge.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,hR.jsx)(lge.Text,{children:e})}a($Tr,"BeforeCursor");function VTr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,hR.jsx)(lge.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,hR.jsx)(lge.Text,{});if(r===s)return(0,hR.jsx)(lge.Text,{children:r});let c=s;if(r!==""){let l=(0,C$a.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,cD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,cD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,_$a.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??E$a.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,hR.jsx)(lge.Text,{children:c})}a(VTr,"AfterCursor");function b$a(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(HTr.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=GTr(c);return(0,hR.jsx)($Tr,{document:r,position:o,maxCharacters:u})}a(b$a,"DocumentPrefix");function S$a(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(HTr.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=GTr(c);return(0,hR.jsx)(VTr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(S$a,"DocumentSuffix")});var zTr=I(ere=>{"use strict";p();Object.defineProperty(ere,"__esModule",{value:!0});ere.WishlistElision=void 0;ere.makePrompt=T$a;ere.makePrefixPrompt=I$a;ere.makeContextPrompt=x$a;var WTr=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]}};ere.WishlistElision=WTr;function T$a(t){return t.map(e=>e.elidedValue).join("")}a(T$a,"makePrompt");function I$a(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(I$a,"makePrefixPrompt");function x$a(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(x$a,"makeContextPrompt")});var JTr=I(jG=>{"use strict";p();Object.defineProperty(jG,"__esModule",{value:!0});jG.transformers=jG.CompletionsPromptRenderer=void 0;jG.normalizeLineEndings=KTr;var dki=qTr(),cki=YOe(),lki=Lme(),w$a=c5e(),Lgt=u5e(),uki=zTr(),R$a=5,YTr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=uki.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??lki.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 uki.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,lki.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(...k$a([...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-R$a: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 dki.SnapshotWalker(e,jG.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Lgt.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:KTr(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,cki.isShebangLine)(f.value)?y=A:y=(0,cki.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:KTr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Lgt.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}}};jG.CompletionsPromptRenderer=YTr;jG.transformers=[...(0,dki.defaultTransformers)(),(t,e,r)=>(0,w$a.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Lgt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Lgt.AfterCursor.name?{...r,type:"suffix"}:r];function k$a(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(k$a,"computeComponentStatistics");function KTr(t){return t.replace(/\r\n?/g,` -`)}a(KTr,"normalizeLineEndings")});var Fgt=I(uge=>{"use strict";p();Object.defineProperty(uge,"__esModule",{value:!0});uge.ILanguageContextProviderService=uge.ProviderTarget=void 0;var P$a=rn(),fki;(function(t){t.NES="nes",t.Completions="completions"})(fki||(uge.ProviderTarget=fki={}));uge.ILanguageContextProviderService=(0,P$a.createServiceIdentifier)("ILanguageContextProviderService")});var tre=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.RuntimeMode=dge.ICompletionsRuntimeModeService=void 0;var D$a=rn();dge.ICompletionsRuntimeModeService=(0,D$a.createServiceIdentifier)("completionsRuntimeModeService");var ZTr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:pki(r,n),verboseLogging:M$a(r,n),testMode:e,simulation:N$a(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}};dge.RuntimeMode=ZTr;function pki(t,e){return t.includes("--debug")||XTr(e,"DEBUG")}a(pki,"determineDebugFlag");function N$a(t){return XTr(t,"SIMULATION")}a(N$a,"determineSimulationFlag");function M$a(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||XTr(e,"VERBOSE")||pki(t,e)}a(M$a,"determineVerboseLoggingEnabled");function XTr(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(XTr,"determineEnvFlagEnabled")});var Aki=I(d5e=>{"use strict";p();Object.defineProperty(d5e,"__esModule",{value:!0});d5e.eventToPromise=O$a;d5e.isArrayOfT=gki;d5e.resolveAll=L$a;var hki=LOe();async function O$a(t){let e=new hki.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(O$a,"eventToPromise");async function B$a(t){if(t.isCancellationRequested)return;let e=new hki.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(B$a,"cancellationTokenToPromise");async function mki(t,e){if(e){let r=B$a(e);await Promise.race([t,r])}else await t}a(mki,"raceCancellation");function gki(t){return Array.isArray(t)}a(gki,"isArrayOfT");async function L$a(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await F$a(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(L$a,"resolveAll");async function F$a(t,e){let r;return t instanceof Promise?r=await U$a(t,e):r=await Q$a(t,e),r}a(F$a,"resolve");async function U$a(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:gki(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await mki(o,e),n.resolutionTime=performance.now()-r,n}a(U$a,"resolvePromise");async function Q$a(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 mki(o,e),n.resolutionTime=performance.now()-r,n}a(Q$a,"resolveIterable")});var yki=I(tIr=>{"use strict";p();Object.defineProperty(tIr,"__esModule",{value:!0});tIr.fillInCppVSCodeActiveExperiments=G$a;var q$a=VA(),eIr=xl(),j$a={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},H$a="ms-vscode.cpptools";function G$a(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(H$a))&&$$a(t,r,n)}a(G$a,"fillInCppVSCodeActiveExperiments");function $$a(t,e,r){try{let n=t.get(q$a.ICompletionsFeaturesService),o=t.get(eIr.ICompletionsLogTargetService),s=j$a,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){eIr.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){eIr.logger.exception(t,n,"fillInCppActiveExperiments")}}a($$a,"addActiveExperiments")});var _ki=I(rIr=>{"use strict";p();Object.defineProperty(rIr,"__esModule",{value:!0});rIr.fillInCSharpActiveExperiments=W$a;var V$a=VA(),Eki=xl();function W$a(t,e,r){let n=t.get(V$a.ICompletionsFeaturesService),o=t.get(Eki.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 Eki.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(W$a,"fillInCSharpActiveExperiments")});var Cki=I(HG=>{"use strict";p();Object.defineProperty(HG,"__esModule",{value:!0});HG.multiLanguageContextProviderParamsDefault=void 0;HG.fillInMultiLanguageActiveExperiments=K$a;HG.getMultiLanguageContextProviderParamsFromActiveExperiments=X$a;var z$a=VA(),nIr=xl(),Y$a="fallbackContextProvider";HG.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function K$a(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Y$a))&&J$a(t,r,n)}a(K$a,"fillInMultiLanguageActiveExperiments");function J$a(t,e,r){try{let n=Z$a(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){nIr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(J$a,"addActiveExperiments");function Z$a(t,e){let r=HG.multiLanguageContextProviderParamsDefault,n=t.get(nIr.ICompletionsLogTargetService),s=t.get(z$a.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){nIr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(Z$a,"getMultiLanguageContextProviderParamsFromExp");function X$a(t){let e={...HG.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(X$a,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var bki=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.TS_CONTEXT_PROVIDER_ID=void 0;fge.fillInTsActiveExperiments=tVa;var eVa=VA(),vki=xl();fge.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function tVa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(fge.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(vki.ICompletionsLogTargetService),s=t.get(eVa.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 vki.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(tVa,"fillInTsActiveExperiments")});var qgt=I(wl=>{"use strict";p();var cIr=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},lD=wl&&wl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(wl,"__esModule",{value:!0});wl.DefaultDiagnosticSettings=wl.CachedContextProviderRegistry=wl.MutableContextProviderRegistry=wl.CoreContextProviderRegistry=wl.DefaultContextProvidersContainer=wl.ICompletionsDefaultContextProviders=wl.ICompletionsContextProviderRegistryService=void 0;wl.telemetrizeContextItems=uVa;wl.matchContextItems=dVa;wl.useContextProviderAPI=pVa;wl.getDefaultDiagnosticSettings=mVa;var rVa=ti(),Ski=Il(),lIr=Fgt(),nVa=gp(),xki=rn(),iVa=Ts(),uIr=Qs(),Ugt=vE(),wki=VA(),oVa=H8(),Z8=xl(),dIr=tre(),Tki=Aki(),sVa=yki(),aVa=_ki(),cVa=Cki(),lVa=bki(),Iki=a5e(),Rki=qG();wl.ICompletionsContextProviderRegistryService=(0,xki.createServiceIdentifier)("ICompletionsContextProviderRegistryService");wl.ICompletionsDefaultContextProviders=(0,xki.createServiceIdentifier)("ICompletionsDefaultContextProviders");var iIr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};wl.DefaultContextProvidersContainer=iIr;var Qgt=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([lIr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return Z8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(aVa.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 Z8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(sVa.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(cVa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(lVa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new rVa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(hVa,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,Tki.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,iVa.isCancellationError)(x.reason)||Z8.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 k=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(Z8.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,Tki.isArrayOfT)(Q)?k.push(...Q):Q&&k.push(Q),k.length>0&&(x.status="partial")}catch(Q){Z8.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,Q)}let[D,N]=(0,Iki.filterSupportedContextItems)(k);N&&Z8.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(Iki.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 Z8.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(kki,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]}))}};wl.CoreContextProviderRegistry=Qgt;wl.CoreContextProviderRegistry=Qgt=cIr([lD(1,lIr.ILanguageContextProviderService),lD(2,dIr.ICompletionsRuntimeModeService),lD(3,uIr.IInstantiationService),lD(4,Z8.ICompletionsLogTargetService),lD(5,Rki.ICompletionsContextProviderService)],Qgt);var oIr=class extends Qgt{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)}};wl.MutableContextProviderRegistry=oIr;wl.MutableContextProviderRegistry=oIr=cIr([lD(1,lIr.ILanguageContextProviderService),lD(2,dIr.ICompletionsRuntimeModeService),lD(3,uIr.IInstantiationService),lD(4,Z8.ICompletionsLogTargetService),lD(5,Rki.ICompletionsContextProviderService)],oIr);var sIr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new oVa.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}};wl.CachedContextProviderRegistry=sIr;wl.CachedContextProviderRegistry=sIr=cIr([lD(2,uIr.IInstantiationService)],sIr);function uVa(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(uVa,"telemetrizeContextItems");function dVa(t){return t.matchScore>0&&t.resolution!=="error"}a(dVa,"matchContextItems");function kki(t,e,r){let n=fVa(t,e,r),o=(0,Ugt.getConfig)(t,Ugt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(wl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(kki,"getActiveContextProviders");function fVa(t,e,r){if(t.get(dIr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(wki.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(fVa,"getExpContextProviders");function pVa(t,e,r){return kki(t,e,r).length>0}a(pVa,"useContextProviderAPI");function hVa(t,e,r){let n=(0,Ugt.getConfig)(t,Ugt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(wki.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(hVa,"getContextProviderTimeBudget");var aIr;(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")})(aIr||(wl.DefaultDiagnosticSettings=aIr={}));function mVa(t){let e=t.get(Ski.IConfigurationService),r=t.get(nVa.IExperimentationService),n=e.getExperimentBasedConfig(Ski.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return aIr.from(n)}a(mVa,"getDefaultDiagnosticSettings")});var jgt=I(uD=>{"use strict";p();var gVa=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},AVa=uD&&uD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uD,"__esModule",{value:!0});uD.ContextProviderBridge=uD.ICompletionsContextProviderBridgeService=void 0;var yVa=rn(),EVa=H8(),_Va=qgt();uD.ICompletionsContextProviderBridgeService=(0,yVa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var fIr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new EVa.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:[]}};uD.ContextProviderBridge=fIr;uD.ContextProviderBridge=fIr=gVa([AVa(0,_Va.ICompletionsContextProviderRegistryService)],fIr)});var mIr=I(Hgt=>{"use strict";p();Object.defineProperty(Hgt,"__esModule",{value:!0});Hgt.Diagnostics=void 0;var pIr=b4(),CVa=mm(),hIr=Y8(),vVa=yG(),bVa=J8();function SVa(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(SVa,"getCode");function TVa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(TVa,"getRelativePath");var IVa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(bVa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,vVa.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,pIr.jsx)(hIr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${TVa(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=SVa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,pIr.jsx)(hIr.Text,{children:`${_.line+1}:${_.character+1} - ${CVa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,pIr.jsx)(hIr.Chunk,{children:m})})},"Diagnostics");Hgt.Diagnostics=IVa});var gIr=I($gt=>{"use strict";p();Object.defineProperty($gt,"__esModule",{value:!0});$gt.DocumentMarker=void 0;var Ggt=b4(),Pki=Y8(),Dki=YOe(),xVa=J8(),wVa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(xVa.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,Ggt.jsx)(RVa,{docInfo:s}):(0,Ggt.jsx)(kVa,{docInfo:s})}},"DocumentMarker");$gt.DocumentMarker=wVa;var RVa=a(t=>(0,Ggt.jsx)(Pki.Text,{children:(0,Dki.getPathMarker)(t.docInfo)}),"PathMarker"),kVa=a(t=>(0,Ggt.jsx)(Pki.Text,{children:(0,Dki.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var AIr=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.RecentEdits=void 0;f5e.editIsTooCloseToCursor=Oki;var Nki=b4(),Mki=Y8(),Vgt=YOe(),PVa=J8();function Oki(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(Oki,"editIsTooCloseToCursor");var DVa=a((t,e)=>{let[r,n]=e.useState();return e.useData(PVa.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(Oki(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,Vgt.newLineEnded)(`File: ${T}`)+(0,Vgt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,Vgt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,Vgt.newLineEnded)("End of recent edits");n(h)}),r?(0,Nki.jsx)(Mki.Chunk,{children:(0,Nki.jsx)(Mki.Text,{children:r})}):void 0},"RecentEdits");f5e.RecentEdits=DVa});var Bki=I(x4=>{"use strict";p();Object.defineProperty(x4,"__esModule",{value:!0});x4.registerDocumentTracker=x4.accessTimes=void 0;x4.sortByAccessTimes=OVa;var NVa=H8(),MVa=zb();x4.accessTimes=new NVa.LRUCacheMap;function OVa(t){return[...t].sort((e,r)=>{let n=x4.accessTimes.get(e.uri)??0;return(x4.accessTimes.get(r.uri)??0)-n})}a(OVa,"sortByAccessTimes");var BVa=a(t=>t.get(MVa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&x4.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");x4.registerDocumentTracker=BVa});var Lki=I(X8=>{"use strict";p();var LVa=X8&&X8.__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},FVa=X8&&X8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(X8,"__esModule",{value:!0});X8.OpenTabFiles=void 0;var UVa=Bki(),QVa=zb(),yIr=pge(),EIr=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>yIr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,yIr.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,UVa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(yIr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};X8.OpenTabFiles=EIr;X8.OpenTabFiles=EIr=LVa([FVa(0,QVa.ICompletionsTextDocumentManagerService)],EIr)});var Fki=I(_Ir=>{"use strict";p();Object.defineProperty(_Ir,"__esModule",{value:!0});_Ir.shortCircuit=qVa;function qVa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(qVa,"shortCircuit")});var Zgt=I(Rl=>{"use strict";p();var jVa=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},Wgt=Rl&&Rl.__param||function(t,e){return function(r,n){e(r,n,t)}},CIr;Object.defineProperty(Rl,"__esModule",{value:!0});Rl.RelatedFilesProvider=Rl.ICompletionsRelatedFilesProviderService=Rl.relatedFilesLogger=Rl.PromiseExpirationCacheMap=Rl.EmptyRelatedFilesResponse=void 0;Rl.getRelatedFilesAndTraits=ZVa;var HVa=Bte(),GVa=rn(),$Va=Ku(),SIr=Qs(),VVa=bG(),WVa=H8(),Jgt=xl(),zVa=Tg(),YVa=Fki();Rl.EmptyRelatedFilesResponse={entries:[],traits:[]};var zgt={entries:new Map,traits:[]},Ygt=class extends WVa.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.timestampRl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Rl.RelatedFilesProvider=vIr;Rl.RelatedFilesProvider=vIr=CIr=jVa([Wgt(0,SIr.IInstantiationService),Wgt(1,HVa.IIgnoreService),Wgt(2,Jgt.ICompletionsLogTargetService),Wgt(3,VVa.ICompletionsFileSystemService)],vIr);var JVa=3,p5e=new Ygt(KVa);async function Uki(t,e,r,n,o){let s=t.get(SIr.IInstantiationService),c=t.get(Jgt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Rl.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(p5e.bumpRetryCount(e.uri)>=JVa?u=zgt:u=void 0);let d=performance.now()-l;if(Rl.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 Kgt;return u}a(Uki,"getRelatedFiles");var bIr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(p5e.has(s))return p5e.get(s);let c=Uki(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw p5e.delete(s),l})),p5e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");bIr=(0,YVa.shortCircuit)(bIr,200,zgt);async function ZVa(t,e,r,n,o,s=!1){let c=t.get(SIr.IInstantiationService),l=t.get(Jgt.ICompletionsLogTargetService),u=t.get(Rl.ICompletionsRelatedFilesProviderService),d=zgt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(Uki,f,r,n,u):await c.invokeFunction(bIr,f,r,n,u)}catch(f){d=zgt,f instanceof Kgt&&c.invokeFunction(zVa.telemetry,"getRelatedFilesList",r)}return Rl.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(ZVa,"getRelatedFilesAndTraits")});var pge=I(GG=>{"use strict";p();Object.defineProperty(GG,"__esModule",{value:!0});GG.NeighborSource=GG.NeighboringFileType=void 0;GG.considerNeighborFile=nWa;GG.isIncludeNeighborFilesActive=iWa;var XVa=Qs(),Qki=yG(),jki=VA(),eWa=xl(),tWa=zb(),rWa=Lki(),Xgt=Zgt(),qki;(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"})(qki||(GG.NeighboringFileType=qki={}));function nWa(t,e){return(0,Qki.normalizeLanguageId)(t)===(0,Qki.normalizeLanguageId)(e)}a(nWa,"considerNeighborFile");var TIr=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(jki.ICompletionsFeaturesService),d=e.get(eWa.ICompletionsLogTargetService),f=e.get(XVa.IInstantiationService),h=e.get(tWa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(rWa.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 Xgt.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 Xgt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(Xgt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(Xgt.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)}};GG.NeighborSource=TIr;function iWa(t,e,r){return t.get(jki.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(iWa,"isIncludeNeighborFilesActive")});var xIr=I(eAt=>{"use strict";p();Object.defineProperty(eAt,"__esModule",{value:!0});eAt.SimilarFiles=void 0;var hge=b4(),IIr=Y8(),oWa=sgt(),sWa=l1r(),aWa=cgt(),cWa=J8(),lWa=mge(),Hki=pge(),uWa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(cWa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=Hki.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await Hki.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(lWa.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,sWa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(aWa.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,oWa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,hge.jsxs)(hge.Fragment,{children:[...o.map((u,d)=>(0,hge.jsx)(dWa,{snippet:u}))]})},"SimilarFiles");eAt.SimilarFiles=uWa;var dWa=a((t,e)=>(0,hge.jsxs)(IIr.Chunk,{children:[(0,hge.jsx)(IIr.Text,{children:t.snippet.headline}),(0,hge.jsx)(IIr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var Jki=I(BT=>{"use strict";p();Object.defineProperty(BT,"__esModule",{value:!0});BT.getAllRecentEditsByTimestamp=fWa;BT.findChangeSpan=wIr;BT.getDiff=$ki;BT.unifiedDiff=Vki;BT.findReplaceDiff=Wki;BT.editsOverlap=zki;BT.updateEdits=Yki;BT.buildIncomingEdit=RIr;BT.trimOldFilesFromState=Kki;BT.recentEditsReducer=mWa;BT.summarizeEdit=gWa;function fWa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(fWa,"getAllRecentEditsByTimestamp");function wIr(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(wIr,"findChangeSpan");function $ki(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($ki,"getDiff");function pWa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(pWa,"measureDiffSize");function Vki(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(` +${xxi(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,W7a.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};ry.MarkdownString=Lmt;function Txi(t){return Ixi(t)?!t.value:Array.isArray(t)?t.every(Txi):!0}a(Txi,"isEmptyMarkdownString");function Ixi(t){return t instanceof Lmt?!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(Ixi,"isMarkdownString");function z7a(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,V7a.isEqual)(Bmt.URI.from(t.baseUri),Bmt.URI.from(e.baseUri)))}a(z7a,"markdownStringEqual");function Fmt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(Fmt,"escapeMarkdownSyntaxTokens");function Y7a(t){return t.replace(/[\\\]]/g,"\\$&")}a(Y7a,"escapeMarkdownLinkLabel");function xxi(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(xxi,"appendEscapedMarkdownCodeBlockFence");function K7a(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(K7a,"appendEscapedMarkdownInlineCode");function J7a(t){return t.replace(/"/g,""")}a(J7a,"escapeDoubleQuotes");function Z7a(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(Z7a,"removeMarkdownEscapes");function X7a(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(X7a,"parseHrefAndDimensions");function wxi(t,e,r,n=!0){return`[${n?Fmt(t):t}](${e}${r?` "${Fmt(r)}"`:""})`}a(wxi,"createMarkdownLink");function eQa(t,e=!0){let r=Rxi(t.id,...t.arguments||[]).toString();return wxi(t.text,r,t.tooltip,e)}a(eQa,"createMarkdownCommandLink");function Rxi(t,...e){return Bmt.URI.from({scheme:$7a.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(Rxi,"createCommandUri")});var zbr=I(Dte=>{"use strict";p();var tQa=Dte&&Dte.__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},Vbr;Object.defineProperty(Dte,"__esModule",{value:!0});Dte.MarkdownString=void 0;var rQa=Pxi(),nQa=Z2(),Wbr=Vbr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof Vbr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new rQa.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}};Dte.MarkdownString=Wbr;Dte.MarkdownString=Wbr=Vbr=tQa([nQa.es5ClassCompat],Wbr)});var Nxi=I(D8=>{"use strict";p();Object.defineProperty(D8,"__esModule",{value:!0});D8.Mimes=void 0;D8.getMediaOrTextMime=oQa;D8.getMediaMime=Dxi;D8.getExtensionForMimeType=sQa;D8.normalizeMimeType=cQa;D8.isTextStreamMime=lQa;var kxi=AA();D8.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 iQa={".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"},Ybr={".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 oQa(t){let e=(0,kxi.extname)(t),r=iQa[e.toLowerCase()];return r!==void 0?r:Dxi(t)}a(oQa,"getMediaOrTextMime");function Dxi(t){let e=(0,kxi.extname)(t),r=Ybr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(Dxi,"getMediaMime");function sQa(t){for(let e in Ybr){let r=Ybr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(sQa,"getExtensionForMimeType");var aQa=/^(.+)\/(.+?)(;.+)?$/;function cQa(t,e){let r=aQa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(cQa,"normalizeMimeType");function lQa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(lQa,"isTextStreamMime")});var Bxi=I(hm=>{"use strict";p();var uQa=hm&&hm.__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},AG;Object.defineProperty(hm,"__esModule",{value:!0});hm.NotebookCellOutput=hm.NotebookCellOutputItem=hm.NotebookEdit=hm.NotebookData=hm.NotebookCellData=hm.NotebookRange=hm.NotebookCellKind=void 0;var dQa=Z2(),Mxi=Cs(),Umt=Nxi(),fQa=um(),Oxi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(Oxi||(hm.NotebookCellKind=Oxi={}));var Nte=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,Mxi.illegalArgument)("start must be positive");if(r<0)throw(0,Mxi.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)}};hm.NotebookRange=Nte;var Kbr=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)}};hm.NotebookCellData=Kbr;var Jbr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};hm.NotebookData=Jbr;var Zbr=AG=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof AG?!0:e?Nte.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new AG(e,r)}static insertCells(e,r){return new AG(new Nte(e,e),r)}static deleteCells(e){return new AG(e,[])}static updateCellMetadata(e,r){let n=new AG(new Nte(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new AG(new Nte(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};hm.NotebookEdit=Zbr;hm.NotebookEdit=Zbr=AG=uQa([dQa.es5ClassCompat],Zbr);var Xbr=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=Umt.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,Umt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};hm.NotebookCellOutputItem=Xbr;var e1r=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,fQa.generateUuid)(),this.metadata=r??n)}};hm.NotebookCellOutput=e1r});var Fxi=I(EG=>{"use strict";p();var pQa=EG&&EG.__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},t1r;Object.defineProperty(EG,"__esModule",{value:!0});EG.Selection=void 0;EG.getDebugDescriptionOfSelection=Lxi;var hQa=Z2(),yG=Ome(),r1r=f4(),n1r=t1r=class extends r1r.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof t1r?!0:!e||typeof e!="object"?!1:r1r.Range.isRange(e)&&yG.Position.isPosition(e.anchor)&&yG.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 yG.Position(e,r),c=new yG.Position(n,o)):yG.Position.isPosition(e)&&yG.Position.isPosition(r)&&(s=yG.Position.of(e),c=yG.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 Lxi(this)}};EG.Selection=n1r;EG.Selection=n1r=t1r=pQa([hQa.es5ClassCompat],n1r);function Lxi(t){let e=(0,r1r.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(Lxi,"getDebugDescriptionOfSelection")});var o1r=I(Ote=>{"use strict";p();var mQa=Ote&&Ote.__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},Mte;Object.defineProperty(Ote,"__esModule",{value:!0});Ote.SnippetString=void 0;var gQa=Z2(),i1r=Mte=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Mte?!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+=Mte._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 Mte;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Mte._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 Mte;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}};Ote.SnippetString=i1r;Ote.SnippetString=i1r=Mte=mQa([gQa.es5ClassCompat],i1r)});var a1r=I(Qmt=>{"use strict";p();Object.defineProperty(Qmt,"__esModule",{value:!0});Qmt.SnippetTextEdit=void 0;var AQa=o1r(),Uxi=f4(),s1r=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?Uxi.Range.isRange(e.range)&&AQa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new Uxi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};Qmt.SnippetTextEdit=s1r});var jxi=I(X2=>{"use strict";p();var yQa=X2&&X2.__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},c1r;Object.defineProperty(X2,"__esModule",{value:!0});X2.SymbolInformation=X2.SymbolTag=X2.SymbolKind=void 0;var EQa=Z2(),Qxi=Sbr(),_Qa=f4(),l1r;(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"})(l1r||(X2.SymbolKind=l1r={}));var qxi;(function(t){t[t.Deprecated=1]="Deprecated"})(qxi||(X2.SymbolTag=qxi={}));var u1r=c1r=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 Qxi.Location?this.location=o:n instanceof _Qa.Range&&(this.location=new Qxi.Location(o,n)),c1r.validate(this)}toJSON(){return{name:this.name,kind:l1r[this.kind],location:this.location,containerName:this.containerName}}};X2.SymbolInformation=u1r;X2.SymbolInformation=u1r=c1r=yQa([EQa.es5ClassCompat],u1r)});var p1r=I(N8=>{"use strict";p();var vQa=N8&&N8.__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},Bte;Object.defineProperty(N8,"__esModule",{value:!0});N8.TextEdit=N8.EndOfLine=void 0;var d1r=Cs(),CQa=Z2(),Hxi=Ome(),qmt=f4(),Gxi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(Gxi||(N8.EndOfLine=Gxi={}));var f1r=Bte=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof Bte?!0:!e||typeof e!="object"?!1:qmt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new Bte(e,r)}static insert(e,r){return Bte.replace(new qmt.Range(e,e),r)}static delete(e){return Bte.replace(e,"")}static setEndOfLine(e){let r=new Bte(new qmt.Range(new Hxi.Position(0,0),new Hxi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!qmt.Range.isRange(e))throw(0,d1r.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,d1r.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,d1r.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}}};N8.TextEdit=f1r;N8.TextEdit=f1r=Bte=vQa([CQa.es5ClassCompat],f1r)});var rwi=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 $xi=rG(),$mt=zbr(),h1r=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new $mt.MarkdownString(e):e}};xt.ChatResponseMarkdownPart=h1r;var m1r=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};xt.ChatResponseCodeblockUriPart=m1r;var g1r=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};xt.ChatResponseFileTreePart=g1r;var A1r=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};xt.ChatResponseAnchorPart=A1r;var y1r=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};xt.ChatResponseProgressPart=y1r;var E1r=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.ChatResponseThinkingProgressPart=E1r;var _1r=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};xt.ChatResponseHookPart=_1r;var v1r=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};xt.ChatResponseExternalEditPart=v1r;var C1r=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};xt.ChatResponseProgressPart2=C1r;var b1r=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new $mt.MarkdownString(e):e}};xt.ChatResponseWarningPart=b1r;var S1r=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new $mt.MarkdownString(e):e}};xt.ChatResponseInfoPart=S1r;var T1r=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};xt.ChatResponseReferencePart=T1r;var I1r=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};xt.ChatResponseReferencePart2=I1r;var x1r=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};xt.ChatResponseMovePart=x1r;var w1r=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};xt.ChatResponseExtensionsPart=w1r;var R1r=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=R1r;var P1r=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};xt.ChatResponseCodeCitationPart=P1r;var k1r=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};xt.ChatResponseCommandButtonPart=k1r;var D1r=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new $mt.MarkdownString(e):e,this.vulnerabilities=r}};xt.ChatResponseMarkdownWithVulnerabilitiesPart=D1r;var N1r=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=N1r;var M1r=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=M1r;var O1r=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};xt.ChatResponseWorkspaceEditPart=O1r;var B1r=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};xt.ChatResponseConfirmationPart=B1r;var Vxi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(Vxi||(xt.ChatQuestionType=Vxi={}));var L1r=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=L1r;var F1r=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};xt.ChatResponseQuestionCarouselPart=F1r;var U1r=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=U1r;var Q1r=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=Q1r;var q1r=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn=q1r;var j1r=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};xt.ChatRequestEditorData=j1r;var H1r=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};xt.ChatRequestNotebookData=H1r;var G1r=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};xt.ChatReferenceDiagnostic=G1r;var $1r=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};xt.ChatReferenceBinaryData=$1r;var V1r=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};xt.LanguageModelToolResult=V1r;var W1r=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};xt.LanguageModelToolResult2=W1r;var jmt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};xt.LanguageModelTextPart=jmt;var Wxi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(Wxi||(xt.LanguageModelPartAudience=Wxi={}));var z1r=class extends jmt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};xt.LanguageModelTextPart2=z1r;var Y1r=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.LanguageModelThinkingPart=Y1r;var Hmt=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($xi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t($xi.VSBuffer.fromString(e).buffer,"text/plain")}};xt.LanguageModelDataPart=Hmt;var K1r=class extends Hmt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};xt.LanguageModelDataPart2=K1r;var zxi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(zxi||(xt.ChatImageMimeType=zxi={}));var J1r=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};xt.LanguageModelPromptTsxPart=J1r;var Yxi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(Yxi||(xt.ExcludeSettingOptions=Yxi={}));var Z1r=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};xt.TextSearchMatch2=Z1r;var X1r=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};xt.AISearchKeyword=X1r;var Kxi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(Kxi||(xt.ChatErrorLevel=Kxi={}));var Jxi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(Jxi||(xt.ChatInputNotificationSeverity=Jxi={}));var Zxi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(Zxi||(xt.ChatRequestEditedFileEventKind=Zxi={}));var Xxi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(Xxi||(xt.ChatResponseClearToPreviousToolInvocationReason=Xxi={}));var eSr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};xt.LanguageModelToolExtensionSource=eSr;var tSr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};xt.LanguageModelToolMCPSource=tSr;var rSr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};xt.LanguageModelToolCallPart=rSr;var nSr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart=nSr;var iSr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart2=iSr;var Gmt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Gmt||(xt.LanguageModelChatMessageRole=Gmt={}));var ewi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(ewi||(xt.LanguageModelChatToolMode=ewi={}));var oSr=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(Gmt.User,e,r)}static Assistant(e,r){return new t(Gmt.Assistant,e,r)}};xt.LanguageModelChatMessage=oSr;var sSr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};xt.McpToolInvocationContentData=sSr;var aSr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};xt.ChatToolInvocationPart=aSr;var cSr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};xt.ChatSubagentToolInvocationData=cSr;var lSr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn2=lSr;var twi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(twi||(xt.ChatSessionStatus=twi={}));var uSr=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=uSr;var dSr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};xt.ChatResource=dSr;var fSr=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=fSr;var pSr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};xt.McpHttpServerDefinition=pSr});var owi=I(_G=>{"use strict";p();Object.defineProperty(_G,"__esModule",{value:!0});_G.TextDocumentChangeReason=_G.TextEditorSelectionChangeKind=_G.WorkspaceEdit=void 0;var bQa=Al(),SQa=gk(),TQa=f4(),IQa=a1r(),xQa=p1r(),hSr=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 xQa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new TQa.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,IQa.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(yp,"__esModule",{value:!0});yp.FileType=yp.ChatSessionStatus=yp.ChatLocation=yp.ChatVariableLevel=yp.ExtensionMode=yp.DiagnosticSeverity=yp.TextEditorRevealType=yp.TextEditorLineNumbersStyle=yp.TextEditorCursorStyle=yp.InteractiveEditorResponseFeedbackKind=void 0;var swi;(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"})(swi||(yp.InteractiveEditorResponseFeedbackKind=swi={}));var awi;(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"})(awi||(yp.TextEditorCursorStyle=awi={}));var cwi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(cwi||(yp.TextEditorLineNumbersStyle=cwi={}));var lwi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(lwi||(yp.TextEditorRevealType=lwi={}));var uwi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(uwi||(yp.DiagnosticSeverity=uwi={}));var dwi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(dwi||(yp.ExtensionMode=dwi={}));var fwi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(fwi||(yp.ChatVariableLevel=fwi={}));var pwi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(pwi||(yp.ChatLocation=pwi={}));var hwi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(hwi||(yp.ChatSessionStatus=hwi={}));var mwi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(mwi||(yp.FileType=mwi={}))});var ywi=I(mSr=>{"use strict";p();Object.defineProperty(mSr,"__esModule",{value:!0});mSr.t=wQa;function wQa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return Awi({message:e,args:r})}return Awi(t[0])}a(wQa,"t");function Awi(t){let{message:e,args:r}=t;return PQa(e,r??{})}a(Awi,"getMessage");var RQa=/{([^}]+)}/g;function PQa(t,e){return t.replace(RQa,(r,n)=>e[n]??r)}a(PQa,"format2")});var vwi=I(vG=>{"use strict";p();Object.defineProperty(vG,"__esModule",{value:!0});vG.NewSymbolName=vG.NewSymbolNameTriggerKind=vG.NewSymbolNameTag=void 0;var Ewi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(Ewi||(vG.NewSymbolNameTag=Ewi={}));var _wi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(_wi||(vG.NewSymbolNameTriggerKind=_wi={}));var gSr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};vG.NewSymbolName=gSr});var bwi=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.TerminalShellExecutionCommandLineConfidence=void 0;var Cwi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(Cwi||(Vmt.TerminalShellExecutionCommandLineConfidence=Cwi={}))});var Swi=I(Lme=>{"use strict";p();Object.defineProperty(Lme,"__esModule",{value:!0});Lme.ThemeColor=Lme.ThemeIcon=void 0;var ASr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};Lme.ThemeIcon=ASr;var ySr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};Lme.ThemeColor=ySr});var mm=I((kvp,wwi)=>{"use strict";p();var kQa=Ak(),DQa=Cc(),NQa=Ku(),Twi=vbr(),MQa=Sbr(),OQa=zbr(),kOe=Bxi(),BQa=Ome(),LQa=f4(),FQa=Fxi(),UQa=o1r(),QQa=a1r(),Iwi=jxi(),xwi=p1r(),Nn=rwi(),ESr=owi(),CG=gwi(),qQa=ywi(),_Sr=vwi(),jQa=bwi(),HQa=Swi(),GQa={Position:BQa.Position,Range:LQa.Range,Selection:FQa.Selection,EventEmitter:DQa.Emitter,CancellationTokenSource:kQa.CancellationTokenSource,Diagnostic:Twi.Diagnostic,Location:MQa.Location,DiagnosticRelatedInformation:Twi.DiagnosticRelatedInformation,TextEdit:xwi.TextEdit,WorkspaceEdit:ESr.WorkspaceEdit,Uri:NQa.URI,MarkdownString:OQa.MarkdownString,DiagnosticSeverity:CG.DiagnosticSeverity,TextEditorCursorStyle:CG.TextEditorCursorStyle,TextEditorLineNumbersStyle:CG.TextEditorLineNumbersStyle,TextEditorRevealType:CG.TextEditorRevealType,EndOfLine:xwi.EndOfLine,l10n:{t:qQa.t},ExtensionMode:CG.ExtensionMode,ChatVariableLevel:CG.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:Nn.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:Nn.ChatResponseMarkdownPart,ChatResponseFileTreePart:Nn.ChatResponseFileTreePart,ChatResponseAnchorPart:Nn.ChatResponseAnchorPart,ChatResponseMovePart:Nn.ChatResponseMovePart,ChatResponseExtensionsPart:Nn.ChatResponseExtensionsPart,ChatResponseProgressPart:Nn.ChatResponseProgressPart,ChatResponseProgressPart2:Nn.ChatResponseProgressPart2,ChatResponseWarningPart:Nn.ChatResponseWarningPart,ChatResponseInfoPart:Nn.ChatResponseInfoPart,ChatResponseHookPart:Nn.ChatResponseHookPart,ChatResponseReferencePart:Nn.ChatResponseReferencePart,ChatResponseReferencePart2:Nn.ChatResponseReferencePart2,ChatResponseCodeCitationPart:Nn.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:Nn.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:Nn.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:Nn.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:Nn.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:Nn.ChatResponseTextEditPart,ChatResponseNotebookEditPart:Nn.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:Nn.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:Nn.ChatResponseConfirmationPart,ChatQuestion:Nn.ChatQuestion,ChatQuestionType:Nn.ChatQuestionType,ChatResponseQuestionCarouselPart:Nn.ChatResponseQuestionCarouselPart,ChatRequestTurn:Nn.ChatRequestTurn,ChatResponseTurn:Nn.ChatResponseTurn,ChatRequestEditorData:Nn.ChatRequestEditorData,ChatRequestNotebookData:Nn.ChatRequestNotebookData,NewSymbolName:_Sr.NewSymbolName,NewSymbolNameTag:_Sr.NewSymbolNameTag,NewSymbolNameTriggerKind:_Sr.NewSymbolNameTriggerKind,ChatLocation:CG.ChatLocation,SymbolInformation:Iwi.SymbolInformation,LanguageModelToolResult:Nn.LanguageModelToolResult,ExtendedLanguageModelToolResult:Nn.LanguageModelToolResult,LanguageModelToolResult2:Nn.LanguageModelToolResult2,LanguageModelPromptTsxPart:Nn.LanguageModelPromptTsxPart,LanguageModelTextPart:Nn.LanguageModelTextPart,LanguageModelDataPart:Nn.LanguageModelDataPart,LanguageModelToolExtensionSource:Nn.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:Nn.LanguageModelToolMCPSource,ChatReferenceBinaryData:Nn.ChatReferenceBinaryData,ChatReferenceDiagnostic:Nn.ChatReferenceDiagnostic,TextSearchMatch2:Nn.TextSearchMatch2,AISearchKeyword:Nn.AISearchKeyword,ExcludeSettingOptions:Nn.ExcludeSettingOptions,NotebookCellKind:kOe.NotebookCellKind,NotebookRange:kOe.NotebookRange,NotebookEdit:kOe.NotebookEdit,NotebookCellData:kOe.NotebookCellData,NotebookData:kOe.NotebookData,ChatErrorLevel:Nn.ChatErrorLevel,ChatInputNotificationSeverity:Nn.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:jQa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:Nn.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:Nn.ChatResponsePullRequestPart,LanguageModelTextPart2:Nn.LanguageModelTextPart2,LanguageModelDataPart2:Nn.LanguageModelDataPart2,LanguageModelThinkingPart:Nn.LanguageModelThinkingPart,LanguageModelPartAudience:Nn.LanguageModelPartAudience,ChatResponseThinkingProgressPart:Nn.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:Nn.LanguageModelToolCallPart,LanguageModelToolResultPart:Nn.LanguageModelToolResultPart,LanguageModelToolResultPart2:Nn.LanguageModelToolResultPart2,LanguageModelChatMessageRole:Nn.LanguageModelChatMessageRole,LanguageModelChatMessage:Nn.LanguageModelChatMessage,LanguageModelChatToolMode:Nn.LanguageModelChatToolMode,TextEditorSelectionChangeKind:ESr.TextEditorSelectionChangeKind,TextDocumentChangeReason:ESr.TextDocumentChangeReason,ChatToolInvocationPart:Nn.ChatToolInvocationPart,ChatSubagentToolInvocationData:Nn.ChatSubagentToolInvocationData,McpToolInvocationContentData:Nn.McpToolInvocationContentData,ChatResponseTurn2:Nn.ChatResponseTurn2,ChatRequestTurn2:Nn.ChatRequestTurn2,LanguageModelError:Nn.LanguageModelError,SymbolKind:Iwi.SymbolKind,SnippetString:UQa.SnippetString,SnippetTextEdit:QQa.SnippetTextEdit,FileType:CG.FileType,ChatSessionStatus:Nn.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:Nn.McpHttpServerDefinition,McpStdioServerDefinition:Nn.McpStdioServerDefinition,ThemeIcon:HQa.ThemeIcon};wwi.exports=GQa});var Rwi=I(Fme=>{"use strict";p();Object.defineProperty(Fme,"__esModule",{value:!0});Fme.UseData=Fme.UseState=void 0;var vSr=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}};Fme.UseState=vSr;var CSr=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)}}};Fme.UseData=CSr});var kwi=I(Wmt=>{"use strict";p();Object.defineProperty(Wmt,"__esModule",{value:!0});Wmt.VirtualPromptReconciler=void 0;var Pwi=Rwi(),bSr=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($Qa(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 TSr(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 SSr([])),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)}};Wmt.VirtualPromptReconciler=bSr;var SSr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},TSr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new Pwi.UseState(e.state),this.dataHook=new Pwi.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 $Qa(t){return typeof t=="function"&&"isFragmentFunction"in t}a($Qa,"isFragmentFunction")});var Dwi=I(zmt=>{"use strict";p();Object.defineProperty(zmt,"__esModule",{value:!0});zmt.VirtualPrompt=void 0;var VQa=kwi(),ISr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new VQa.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()}};zmt.VirtualPrompt=ISr});var M8=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.Text=WQa;Ymt.Chunk=zQa;function WQa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(WQa,"Text");function zQa(t){return t.children}a(zQa,"Chunk")});var bG=I(O8=>{"use strict";p();Object.defineProperty(O8,"__esModule",{value:!0});O8.PerCompletionContextProviderStatistics=O8.ContextProviderStatistics=O8.ICompletionsContextProviderService=void 0;O8.componentStatisticsToPromptMatcher=JQa;var YQa=rn(),KQa=w8();O8.ICompletionsContextProviderService=(0,YQa.createServiceIdentifier)("ICompletionsContextProviderService");var xSr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new Kmt){this.createStatistics=e,this.statistics=new KQa.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)}}};O8.ContextProviderStatistics=xSr;var Kmt=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()}}};O8.PerCompletionContextProviderStatistics=Kmt;function JQa(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(JQa,"componentStatisticsToPromptMatcher")});var MOe=I(NOe=>{"use strict";p();Object.defineProperty(NOe,"__esModule",{value:!0});NOe.filterContextItemsByType=tqa;NOe.filterSupportedContextItems=rqa;NOe.addOrValidateContextItemsIDs=iqa;var ZQa=mm(),XQa=Ku(),wSr=um(),eqa=ZMe(),RSr=Tl(),DOe;(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&&!eqa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(DOe||(DOe={}));var PSr;(function(t){function e(r){if(!DOe.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(PSr||(PSr={}));var kSr;(function(t){function e(r){if(!DOe.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})(kSr||(kSr={}));var DSr;(function(t){function e(r){if(!DOe.is(r))return!1;let n=r;if(!XQa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof ZQa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(DSr||(DSr={}));var NSr;(function(t){function e(r){if(PSr.is(r))return"Trait";if(kSr.is(r))return"CodeSnippet";if(DSr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(NSr||(NSr={}));function tqa(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(tqa,"filterContextItemsByType");function rqa(t){let e=[],r=0;return t.forEach(n=>{let o=NSr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(rqa,"filterSupportedContextItems");function nqa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(nqa,"validateContextItemId");function iqa(t,e){let r=new Set,n=t.get(RSr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,wSr.generateUuid)();if(!nqa(c)){let l=(0,wSr.generateUuid)();RSr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,wSr.generateUuid)();RSr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(iqa,"addOrValidateContextItemsIDs")});var MSr=I(Jmt=>{"use strict";p();Object.defineProperty(Jmt,"__esModule",{value:!0});Jmt.getCodeSnippetsFromContextItems=lqa;Jmt.addRelativePathToCodeSnippets=uqa;var oqa=Qb(),sqa=bG(),aqa=MOe(),cqa="content_excluded";async function lqa(t,e,r,n){let o=(0,aqa.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(sqa.ICompletionsContextProviderService),u=t.get(oqa.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,cqa]]),g}).map(h=>h.data)}a(lqa,"getCodeSnippetsFromContextItems");function uqa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(uqa,"addRelativePathToCodeSnippets")});var OSr=I(egt=>{"use strict";p();Object.defineProperty(egt,"__esModule",{value:!0});egt.CodeSnippets=void 0;var Zmt=d4(),Xmt=M8(),dqa=B8(),fqa=MSr(),pqa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(dqa.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,fqa.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,Zmt.jsx)(Xmt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Zmt.jsx)(Xmt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(Ume,"__esModule",{value:!0});Ume.CompletionsContext=Nwi;Ume.StableCompletionsContext=Mwi;Ume.AdditionalCompletionsContext=Owi;Ume.isContextNode=hqa;function Nwi(t){return t.children}a(Nwi,"CompletionsContext");function Mwi(t){return t.children}a(Mwi,"StableCompletionsContext");function Owi(t){return t.children}a(Owi,"AdditionalCompletionsContext");function hqa(t){return t.name===Nwi.name||t.name===Mwi.name||t.name===Owi.name}a(hqa,"isContextNode")});var LSr=I(BOe=>{"use strict";p();Object.defineProperty(BOe,"__esModule",{value:!0});BOe.SnapshotWalker=void 0;BOe.defaultTransformers=Bwi;var mqa=M8(),BSr=class{static{a(this,"SnapshotWalker")}constructor(e,r=Bwi()){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)}};BOe.SnapshotWalker=BSr;function Bwi(){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===mqa.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(Bwi,"defaultTransformers")});var Lwi=I(FSr=>{"use strict";p();Object.defineProperty(FSr,"__esModule",{value:!0});FSr.findEditDistanceScore=gqa;function gqa(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(eD,"__esModule",{value:!0});eD.MAX_EDIT_DISTANCE_LENGTH=void 0;eD.CurrentFile=_qa;eD.BeforeCursor=qSr;eD.AfterCursor=jSr;eD.DocumentPrefix=vqa;eD.DocumentSuffix=Cqa;var aR=d4(),Qme=M8(),Aqa=eG(),yqa=Lwi(),Eqa=hme(),USr=B8();eD.MAX_EDIT_DISTANCE_LENGTH=50;function QSr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(QSr,"approximateMaxCharacters");function _qa(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(USr.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=QSr(c);return(0,aR.jsxs)(aR.Fragment,{children:[(0,aR.jsx)(qSr,{document:r,position:o,maxCharacters:m}),(0,aR.jsx)(jSr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(_qa,"CurrentFile");function qSr(t){if(t.document===void 0||t.position===void 0)return(0,aR.jsx)(Qme.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,aR.jsx)(Qme.Text,{children:e})}a(qSr,"BeforeCursor");function jSr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,aR.jsx)(Qme.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,aR.jsx)(Qme.Text,{});if(r===s)return(0,aR.jsx)(Qme.Text,{children:r});let c=s;if(r!==""){let l=(0,Eqa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,eD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,eD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,yqa.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??Aqa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,aR.jsx)(Qme.Text,{children:c})}a(jSr,"AfterCursor");function vqa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(USr.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=QSr(c);return(0,aR.jsx)(qSr,{document:r,position:o,maxCharacters:u})}a(vqa,"DocumentPrefix");function Cqa(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(USr.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=QSr(c);return(0,aR.jsx)(jSr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(Cqa,"DocumentSuffix")});var GSr=I(Lte=>{"use strict";p();Object.defineProperty(Lte,"__esModule",{value:!0});Lte.WishlistElision=void 0;Lte.makePrompt=bqa;Lte.makePrefixPrompt=Sqa;Lte.makeContextPrompt=Tqa;var HSr=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]}};Lte.WishlistElision=HSr;function bqa(t){return t.map(e=>e.elidedValue).join("")}a(bqa,"makePrompt");function Sqa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(Sqa,"makePrefixPrompt");function Tqa(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(Tqa,"makeContextPrompt")});var WSr=I(SG=>{"use strict";p();Object.defineProperty(SG,"__esModule",{value:!0});SG.transformers=SG.CompletionsPromptRenderer=void 0;SG.normalizeLineEndings=VSr;var qwi=LSr(),Fwi=COe(),Uwi=hme(),Iqa=OOe(),tgt=LOe(),Qwi=GSr(),xqa=5,$Sr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=Qwi.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??Uwi.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 Qwi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,Uwi.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(...wqa([...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-xqa: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 qwi.SnapshotWalker(e,SG.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===tgt.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:VSr(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,Fwi.isShebangLine)(f.value)?y=A:y=(0,Fwi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:VSr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${tgt.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}}};SG.CompletionsPromptRenderer=$Sr;SG.transformers=[...(0,qwi.defaultTransformers)(),(t,e,r)=>(0,Iqa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===tgt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===tgt.AfterCursor.name?{...r,type:"suffix"}:r];function wqa(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(wqa,"computeComponentStatistics");function VSr(t){return t.replace(/\r\n?/g,` +`)}a(VSr,"normalizeLineEndings")});var rgt=I(qme=>{"use strict";p();Object.defineProperty(qme,"__esModule",{value:!0});qme.ILanguageContextProviderService=qme.ProviderTarget=void 0;var Rqa=rn(),jwi;(function(t){t.NES="nes",t.Completions="completions"})(jwi||(qme.ProviderTarget=jwi={}));qme.ILanguageContextProviderService=(0,Rqa.createServiceIdentifier)("ILanguageContextProviderService")});var Fte=I(jme=>{"use strict";p();Object.defineProperty(jme,"__esModule",{value:!0});jme.RuntimeMode=jme.ICompletionsRuntimeModeService=void 0;var Pqa=rn();jme.ICompletionsRuntimeModeService=(0,Pqa.createServiceIdentifier)("completionsRuntimeModeService");var zSr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:Hwi(r,n),verboseLogging:Dqa(r,n),testMode:e,simulation:kqa(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}};jme.RuntimeMode=zSr;function Hwi(t,e){return t.includes("--debug")||YSr(e,"DEBUG")}a(Hwi,"determineDebugFlag");function kqa(t){return YSr(t,"SIMULATION")}a(kqa,"determineSimulationFlag");function Dqa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||YSr(e,"VERBOSE")||Hwi(t,e)}a(Dqa,"determineVerboseLoggingEnabled");function YSr(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(YSr,"determineEnvFlagEnabled")});var Wwi=I(FOe=>{"use strict";p();Object.defineProperty(FOe,"__esModule",{value:!0});FOe.eventToPromise=Nqa;FOe.isArrayOfT=Vwi;FOe.resolveAll=Oqa;var Gwi=uOe();async function Nqa(t){let e=new Gwi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(Nqa,"eventToPromise");async function Mqa(t){if(t.isCancellationRequested)return;let e=new Gwi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(Mqa,"cancellationTokenToPromise");async function $wi(t,e){if(e){let r=Mqa(e);await Promise.race([t,r])}else await t}a($wi,"raceCancellation");function Vwi(t){return Array.isArray(t)}a(Vwi,"isArrayOfT");async function Oqa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await Bqa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Oqa,"resolveAll");async function Bqa(t,e){let r;return t instanceof Promise?r=await Lqa(t,e):r=await Fqa(t,e),r}a(Bqa,"resolve");async function Lqa(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:Vwi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await $wi(o,e),n.resolutionTime=performance.now()-r,n}a(Lqa,"resolvePromise");async function Fqa(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 $wi(o,e),n.resolutionTime=performance.now()-r,n}a(Fqa,"resolveIterable")});var zwi=I(JSr=>{"use strict";p();Object.defineProperty(JSr,"__esModule",{value:!0});JSr.fillInCppVSCodeActiveExperiments=jqa;var Uqa=JA(),KSr=Tl(),Qqa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},qqa="ms-vscode.cpptools";function jqa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(qqa))&&Hqa(t,r,n)}a(jqa,"fillInCppVSCodeActiveExperiments");function Hqa(t,e,r){try{let n=t.get(Uqa.ICompletionsFeaturesService),o=t.get(KSr.ICompletionsLogTargetService),s=Qqa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){KSr.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){KSr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(Hqa,"addActiveExperiments")});var Kwi=I(ZSr=>{"use strict";p();Object.defineProperty(ZSr,"__esModule",{value:!0});ZSr.fillInCSharpActiveExperiments=$qa;var Gqa=JA(),Ywi=Tl();function $qa(t,e,r){let n=t.get(Gqa.ICompletionsFeaturesService),o=t.get(Ywi.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 Ywi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a($qa,"fillInCSharpActiveExperiments")});var Jwi=I(TG=>{"use strict";p();Object.defineProperty(TG,"__esModule",{value:!0});TG.multiLanguageContextProviderParamsDefault=void 0;TG.fillInMultiLanguageActiveExperiments=zqa;TG.getMultiLanguageContextProviderParamsFromActiveExperiments=Jqa;var Vqa=JA(),XSr=Tl(),Wqa="fallbackContextProvider";TG.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function zqa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Wqa))&&Yqa(t,r,n)}a(zqa,"fillInMultiLanguageActiveExperiments");function Yqa(t,e,r){try{let n=Kqa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){XSr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(Yqa,"addActiveExperiments");function Kqa(t,e){let r=TG.multiLanguageContextProviderParamsDefault,n=t.get(XSr.ICompletionsLogTargetService),s=t.get(Vqa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){XSr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(Kqa,"getMultiLanguageContextProviderParamsFromExp");function Jqa(t){let e={...TG.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(Jqa,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var Xwi=I(Hme=>{"use strict";p();Object.defineProperty(Hme,"__esModule",{value:!0});Hme.TS_CONTEXT_PROVIDER_ID=void 0;Hme.fillInTsActiveExperiments=Xqa;var Zqa=JA(),Zwi=Tl();Hme.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function Xqa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(Hme.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(Zwi.ICompletionsLogTargetService),s=t.get(Zqa.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 Zwi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(Xqa,"fillInTsActiveExperiments")});var ogt=I(Il=>{"use strict";p();var iTr=Il&&Il.__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},tD=Il&&Il.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Il,"__esModule",{value:!0});Il.DefaultDiagnosticSettings=Il.CachedContextProviderRegistry=Il.MutableContextProviderRegistry=Il.CoreContextProviderRegistry=Il.DefaultContextProvidersContainer=Il.ICompletionsDefaultContextProviders=Il.ICompletionsContextProviderRegistryService=void 0;Il.telemetrizeContextItems=cja;Il.matchContextItems=lja;Il.useContextProviderAPI=dja;Il.getDefaultDiagnosticSettings=pja;var eja=ti(),eRi=Sl(),oTr=rgt(),tja=Ap(),nRi=rn(),rja=Cs(),sTr=Ls(),ngt=EE(),iRi=JA(),nja=w8(),L8=Tl(),aTr=Fte(),tRi=Wwi(),ija=zwi(),oja=Kwi(),sja=Jwi(),aja=Xwi(),rRi=MOe(),oRi=bG();Il.ICompletionsContextProviderRegistryService=(0,nRi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Il.ICompletionsDefaultContextProviders=(0,nRi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var eTr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Il.DefaultContextProvidersContainer=eTr;var igt=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([oTr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return L8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(oja.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 L8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(ija.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(sja.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(aja.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new eja.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(fja,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,tRi.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,rja.isCancellationError)(x.reason)||L8.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")&&(L8.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,tRi.isArrayOfT)(j)?P.push(...j):j&&P.push(j),P.length>0&&(x.status="partial")}catch(j){L8.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,j)}let[D,N]=(0,rRi.filterSupportedContextItems)(P);N&&L8.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(rRi.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 L8.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(sRi,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]}))}};Il.CoreContextProviderRegistry=igt;Il.CoreContextProviderRegistry=igt=iTr([tD(1,oTr.ILanguageContextProviderService),tD(2,aTr.ICompletionsRuntimeModeService),tD(3,sTr.IInstantiationService),tD(4,L8.ICompletionsLogTargetService),tD(5,oRi.ICompletionsContextProviderService)],igt);var tTr=class extends igt{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)}};Il.MutableContextProviderRegistry=tTr;Il.MutableContextProviderRegistry=tTr=iTr([tD(1,oTr.ILanguageContextProviderService),tD(2,aTr.ICompletionsRuntimeModeService),tD(3,sTr.IInstantiationService),tD(4,L8.ICompletionsLogTargetService),tD(5,oRi.ICompletionsContextProviderService)],tTr);var rTr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new nja.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}};Il.CachedContextProviderRegistry=rTr;Il.CachedContextProviderRegistry=rTr=iTr([tD(2,sTr.IInstantiationService)],rTr);function cja(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(cja,"telemetrizeContextItems");function lja(t){return t.matchScore>0&&t.resolution!=="error"}a(lja,"matchContextItems");function sRi(t,e,r){let n=uja(t,e,r),o=(0,ngt.getConfig)(t,ngt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Il.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(sRi,"getActiveContextProviders");function uja(t,e,r){if(t.get(aTr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(iRi.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(uja,"getExpContextProviders");function dja(t,e,r){return sRi(t,e,r).length>0}a(dja,"useContextProviderAPI");function fja(t,e,r){let n=(0,ngt.getConfig)(t,ngt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(iRi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(fja,"getContextProviderTimeBudget");var nTr;(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")})(nTr||(Il.DefaultDiagnosticSettings=nTr={}));function pja(t){let e=t.get(eRi.IConfigurationService),r=t.get(tja.IExperimentationService),n=e.getExperimentBasedConfig(eRi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return nTr.from(n)}a(pja,"getDefaultDiagnosticSettings")});var sgt=I(rD=>{"use strict";p();var hja=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},mja=rD&&rD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(rD,"__esModule",{value:!0});rD.ContextProviderBridge=rD.ICompletionsContextProviderBridgeService=void 0;var gja=rn(),Aja=w8(),yja=ogt();rD.ICompletionsContextProviderBridgeService=(0,gja.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var cTr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new Aja.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:[]}};rD.ContextProviderBridge=cTr;rD.ContextProviderBridge=cTr=hja([mja(0,yja.ICompletionsContextProviderRegistryService)],cTr)});var dTr=I(agt=>{"use strict";p();Object.defineProperty(agt,"__esModule",{value:!0});agt.Diagnostics=void 0;var lTr=d4(),Eja=mm(),uTr=M8(),_ja=eG(),vja=B8();function Cja(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(Cja,"getCode");function bja(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(bja,"getRelativePath");var Sja=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(vja.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,_ja.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,lTr.jsx)(uTr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${bja(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=Cja(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,lTr.jsx)(uTr.Text,{children:`${_.line+1}:${_.character+1} - ${Eja.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,lTr.jsx)(uTr.Chunk,{children:m})})},"Diagnostics");agt.Diagnostics=Sja});var fTr=I(lgt=>{"use strict";p();Object.defineProperty(lgt,"__esModule",{value:!0});lgt.DocumentMarker=void 0;var cgt=d4(),aRi=M8(),cRi=COe(),Tja=B8(),Ija=a((t,e)=>{let[r,n]=e.useState();if(e.useData(Tja.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,cgt.jsx)(xja,{docInfo:s}):(0,cgt.jsx)(wja,{docInfo:s})}},"DocumentMarker");lgt.DocumentMarker=Ija;var xja=a(t=>(0,cgt.jsx)(aRi.Text,{children:(0,cRi.getPathMarker)(t.docInfo)}),"PathMarker"),wja=a(t=>(0,cgt.jsx)(aRi.Text,{children:(0,cRi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var pTr=I(UOe=>{"use strict";p();Object.defineProperty(UOe,"__esModule",{value:!0});UOe.RecentEdits=void 0;UOe.editIsTooCloseToCursor=dRi;var lRi=d4(),uRi=M8(),ugt=COe(),Rja=B8();function dRi(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(dRi,"editIsTooCloseToCursor");var Pja=a((t,e)=>{let[r,n]=e.useState();return e.useData(Rja.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(dRi(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,ugt.newLineEnded)(`File: ${T}`)+(0,ugt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,ugt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,ugt.newLineEnded)("End of recent edits");n(h)}),r?(0,lRi.jsx)(uRi.Chunk,{children:(0,lRi.jsx)(uRi.Text,{children:r})}):void 0},"RecentEdits");UOe.RecentEdits=Pja});var fRi=I(m4=>{"use strict";p();Object.defineProperty(m4,"__esModule",{value:!0});m4.registerDocumentTracker=m4.accessTimes=void 0;m4.sortByAccessTimes=Nja;var kja=w8(),Dja=Qb();m4.accessTimes=new kja.LRUCacheMap;function Nja(t){return[...t].sort((e,r)=>{let n=m4.accessTimes.get(e.uri)??0;return(m4.accessTimes.get(r.uri)??0)-n})}a(Nja,"sortByAccessTimes");var Mja=a(t=>t.get(Dja.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&m4.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");m4.registerDocumentTracker=Mja});var pRi=I(F8=>{"use strict";p();var Oja=F8&&F8.__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},Bja=F8&&F8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(F8,"__esModule",{value:!0});F8.OpenTabFiles=void 0;var Lja=fRi(),Fja=Qb(),hTr=Gme(),mTr=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>hTr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,hTr.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,Lja.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(hTr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};F8.OpenTabFiles=mTr;F8.OpenTabFiles=mTr=Oja([Bja(0,Fja.ICompletionsTextDocumentManagerService)],mTr)});var hRi=I(gTr=>{"use strict";p();Object.defineProperty(gTr,"__esModule",{value:!0});gTr.shortCircuit=Uja;function Uja(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(Uja,"shortCircuit")});var ggt=I(xl=>{"use strict";p();var Qja=xl&&xl.__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},dgt=xl&&xl.__param||function(t,e){return function(r,n){e(r,n,t)}},ATr;Object.defineProperty(xl,"__esModule",{value:!0});xl.RelatedFilesProvider=xl.ICompletionsRelatedFilesProviderService=xl.relatedFilesLogger=xl.PromiseExpirationCacheMap=xl.EmptyRelatedFilesResponse=void 0;xl.getRelatedFilesAndTraits=Kja;var qja=Ete(),jja=rn(),Hja=Ku(),_Tr=Ls(),Gja=oG(),$ja=w8(),mgt=Tl(),Vja=xg(),Wja=hRi();xl.EmptyRelatedFilesResponse={entries:[],traits:[]};var fgt={entries:new Map,traits:[]},pgt=class extends $ja.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.timestampxl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};xl.RelatedFilesProvider=yTr;xl.RelatedFilesProvider=yTr=ATr=Qja([dgt(0,_Tr.IInstantiationService),dgt(1,qja.IIgnoreService),dgt(2,mgt.ICompletionsLogTargetService),dgt(3,Gja.ICompletionsFileSystemService)],yTr);var Yja=3,QOe=new pgt(zja);async function mRi(t,e,r,n,o){let s=t.get(_Tr.IInstantiationService),c=t.get(mgt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>xl.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(QOe.bumpRetryCount(e.uri)>=Yja?u=fgt:u=void 0);let d=performance.now()-l;if(xl.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 hgt;return u}a(mRi,"getRelatedFiles");var ETr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(QOe.has(s))return QOe.get(s);let c=mRi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw QOe.delete(s),l})),QOe.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");ETr=(0,Wja.shortCircuit)(ETr,200,fgt);async function Kja(t,e,r,n,o,s=!1){let c=t.get(_Tr.IInstantiationService),l=t.get(mgt.ICompletionsLogTargetService),u=t.get(xl.ICompletionsRelatedFilesProviderService),d=fgt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(mRi,f,r,n,u):await c.invokeFunction(ETr,f,r,n,u)}catch(f){d=fgt,f instanceof hgt&&c.invokeFunction(Vja.telemetry,"getRelatedFilesList",r)}return xl.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(Kja,"getRelatedFilesAndTraits")});var Gme=I(IG=>{"use strict";p();Object.defineProperty(IG,"__esModule",{value:!0});IG.NeighborSource=IG.NeighboringFileType=void 0;IG.considerNeighborFile=tHa;IG.isIncludeNeighborFilesActive=rHa;var Jja=Ls(),gRi=eG(),yRi=JA(),Zja=Tl(),Xja=Qb(),eHa=pRi(),Agt=ggt(),ARi;(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"})(ARi||(IG.NeighboringFileType=ARi={}));function tHa(t,e){return(0,gRi.normalizeLanguageId)(t)===(0,gRi.normalizeLanguageId)(e)}a(tHa,"considerNeighborFile");var vTr=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(yRi.ICompletionsFeaturesService),d=e.get(Zja.ICompletionsLogTargetService),f=e.get(Jja.IInstantiationService),h=e.get(Xja.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(eHa.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 Agt.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 Agt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(Agt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(Agt.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)}};IG.NeighborSource=vTr;function rHa(t,e,r){return t.get(yRi.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(rHa,"isIncludeNeighborFilesActive")});var bTr=I(ygt=>{"use strict";p();Object.defineProperty(ygt,"__esModule",{value:!0});ygt.SimilarFiles=void 0;var $me=d4(),CTr=M8(),nHa=Smt(),iHa=obr(),oHa=Imt(),sHa=B8(),aHa=Vme(),ERi=Gme(),cHa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(sHa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=ERi.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await ERi.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(aHa.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,iHa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(oHa.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,nHa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,$me.jsxs)($me.Fragment,{children:[...o.map((u,d)=>(0,$me.jsx)(lHa,{snippet:u}))]})},"SimilarFiles");ygt.SimilarFiles=cHa;var lHa=a((t,e)=>(0,$me.jsxs)(CTr.Chunk,{children:[(0,$me.jsx)(CTr.Text,{children:t.snippet.headline}),(0,$me.jsx)(CTr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var xRi=I(PT=>{"use strict";p();Object.defineProperty(PT,"__esModule",{value:!0});PT.getAllRecentEditsByTimestamp=uHa;PT.findChangeSpan=STr;PT.getDiff=vRi;PT.unifiedDiff=CRi;PT.findReplaceDiff=bRi;PT.editsOverlap=SRi;PT.updateEdits=TRi;PT.buildIncomingEdit=TTr;PT.trimOldFilesFromState=IRi;PT.recentEditsReducer=pHa;PT.summarizeEdit=hHa;function uHa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(uHa,"getAllRecentEditsByTimestamp");function STr(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(STr,"findChangeSpan");function vRi(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(vRi,"getDiff");function dHa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(dHa,"measureDiffSize");function CRi(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(Vki,"unifiedDiff");function hWa(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(hWa,"aidersDiff");function Wki(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(Wki,"findReplaceDiff");function Gki(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(Gki,"applyEditsToLines");function zki(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(zki,"editsOverlap");function Yki(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(zki(r,c,o.editMergeLineDistance)){let u=Gki(t.split(` -`),s.slice(0,-1)),d=wIr(u,n);d&&(r=RIr(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=Gki(t.split(` +`}a(CRi,"unifiedDiff");function fHa(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(fHa,"aidersDiff");function bRi(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(bRi,"findReplaceDiff");function _Ri(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(_Ri,"applyEditsToLines");function SRi(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(SRi,"editsOverlap");function TRi(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(SRi(r,c,o.editMergeLineDistance)){let u=_Ri(t.split(` +`),s.slice(0,-1)),d=STr(u,n);d&&(r=TTr(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=_Ri(t.split(` `),c).join(` -`)}return{originalContent:t,edits:s}}a(Yki,"updateEdits");function RIr(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=$ki(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(RIr,"buildIncomingEdit");function Kki(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(TRi,"updateEdits");function TTr(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=vRi(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(TTr,"buildIncomingEdit");function IRi(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=wIr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=RIr(e,s,c,l,n);if(pWa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=Yki(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return Kki(h,n.maxFiles)}a(mWa,"recentEditsReducer");function gWa(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=hWa(t.diff);else if(e.summarizationFormat==="diff")o=Vki(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=Wki(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(gWa,"summarizeEdit")});var tAt=I(dD=>{"use strict";p();var AWa=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},yWa=dD&&dD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dD,"__esModule",{value:!0});dD.FullRecentEditsProvider=dD.ICompletionsRecentEditsProviderService=void 0;var EWa=B5(),_Wa=rn(),CWa=ko(),vWa=HF(),bWa=Bvr(),kIr=Jki();dD.ICompletionsRecentEditsProviderService=(0,_Wa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var SWa=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}),PIr=class extends CWa.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({},SWa)}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,kIr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,kIr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,kIr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,vWa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,EWa.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))}};dD.FullRecentEditsProvider=PIr;dD.FullRecentEditsProvider=PIr=AWa([yWa(1,bWa.ICompletionsObservableWorkspace)],PIr)});var DIr=I(nAt=>{"use strict";p();Object.defineProperty(nAt,"__esModule",{value:!0});nAt.Traits=void 0;var rAt=b4(),Zki=Y8(),TWa=yG(),IWa=J8(),xWa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(IWa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,TWa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,rAt.jsxs)(rAt.Fragment,{children:[(0,rAt.jsx)(Zki.Text,{children:`Consider this related information: -`}),...r.map(c=>(0,rAt.jsx)(Zki.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");nAt.Traits=xWa});var tPi=I(NIr=>{"use strict";p();Object.defineProperty(NIr,"__esModule",{value:!0});NIr.splitContextCompletionsPrompt=LWa;var mR=b4(),wWa=Qs(),RWa=zb(),kWa=tAt(),PWa=UTr(),Xki=c5e(),ePi=u5e(),DWa=mIr(),NWa=gIr(),MWa=AIr(),OWa=xIr(),BWa=DIr();function LWa(t){let e=t.get(wWa.IInstantiationService),r=t.get(RWa.ICompletionsTextDocumentManagerService),n=t.get(kWa.ICompletionsRecentEditsProviderService);return(0,mR.jsxs)(mR.Fragment,{children:[(0,mR.jsxs)(Xki.StableCompletionsContext,{children:[(0,mR.jsx)(NWa.DocumentMarker,{tdms:r,weight:.7}),(0,mR.jsx)(BWa.Traits,{weight:.6}),(0,mR.jsx)(DWa.Diagnostics,{tdms:r,weight:.65}),(0,mR.jsx)(PWa.CodeSnippets,{tdms:r,weight:.9}),(0,mR.jsx)(OWa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,mR.jsx)(ePi.DocumentSuffix,{weight:1}),(0,mR.jsx)(Xki.AdditionalCompletionsContext,{children:(0,mR.jsx)(MWa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,mR.jsx)(ePi.DocumentPrefix,{weight:1})]})}a(LWa,"splitContextCompletionsPrompt")});var oPi=I(oAt=>{"use strict";p();Object.defineProperty(oAt,"__esModule",{value:!0});oAt.SplitContextPromptRenderer=void 0;var FWa=qTr(),UWa=c5e(),iAt=JTr(),rPi=u5e(),nPi=zTr(),iPi=0;function QWa(){iPi=0}a(QWa,"resetContextIndex");function qWa(){return iPi++}a(qWa,"getNextContextIndex");var MIr=class extends iAt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=nPi.makePrefixPrompt,this.formatContext=nPi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(QWa(),new FWa.SnapshotWalker(e,jWa).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===rPi.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,iAt.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,iAt.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 ${rPi.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}}};oAt.SplitContextPromptRenderer=MIr;var jWa=[...iAt.transformers,(t,e,r)=>(0,UWa.isContextNode)(t)?{...r,index:qWa()}:r]});var $G=I(e6=>{"use strict";p();Object.defineProperty(e6,"__esModule",{value:!0});e6.AbstractLanguageDiagnosticsService=e6.ILanguageDiagnosticsService=void 0;e6.rangeSpanningDiagnostics=$Wa;e6.isError=VWa;e6.getDiagnosticsAtSelection=WWa;var HWa=rn(),GWa=xP(),OIr=mm();e6.ILanguageDiagnosticsService=(0,HWa.createServiceIdentifier)("ILanguageDiagnosticService");var BIr=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,GWa.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};e6.AbstractLanguageDiagnosticsService=BIr;function $Wa(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a($Wa,"rangeSpanningDiagnostics");function VWa(t){return t.severity===OIr.DiagnosticSeverity.Error}a(VWa,"isError");function WWa(t,e,r=[OIr.DiagnosticSeverity.Error,OIr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(WWa,"getDiagnosticsAtSelection")});var aPi=I(LIr=>{"use strict";p();Object.defineProperty(LIr,"__esModule",{value:!0});LIr.getDiagnosticsFromContextItems=JWa;var zWa=zb(),sPi=qG(),YWa=a5e(),KWa="content_excluded";async function JWa(t,e,r){let n=(0,YWa.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)ZWa(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(sPi.ICompletionsContextProviderService),l=t.get(zWa.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,KWa]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(JWa,"getDiagnosticsFromContextItems");function ZWa(t,e,r,n){let o=t.get(sPi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(ZWa,"setupExpectationsForDiagnosticBags")});var cPi=I(sAt=>{"use strict";p();Object.defineProperty(sAt,"__esModule",{value:!0});sAt.getTraitsFromContextItems=rza;sAt.ReportTraitsTelemetry=oza;var XWa=Tg(),eza=qG(),tza=a5e();function rza(t,e,r){let n=(0,tza.filterContextItemsByType)(r,"Trait");for(let s of n)nza(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(rza,"getTraitsFromContextItems");function nza(t,e,r,n){let o=t.get(eza.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(nza,"setupExpectationsForTraits");var iza=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function oza(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=iza.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,XWa.telemetry)(t,e,l)}}a(oza,"ReportTraitsTelemetry")});var J8=I(Xb=>{"use strict";p();var fPi=Xb&&Xb.__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},Zb=Xb&&Xb.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Xb,"__esModule",{value:!0});Xb.TestComponentsCompletionsPromptFactory=Xb.ComponentsCompletionsPromptFactory=Xb.PromptOrdering=void 0;Xb.isCompletionRequestData=Sza;var w4=b4(),lPi=mm(),jIr=xl(),pPi=Bte(),FIr=Ku(),HIr=Qs(),hPi=See(),uPi=rki(),sza=Tg(),aza=zb(),cza=UTr(),lza=c5e(),uza=JTr(),mPi=jgt(),dza=u5e(),fza=mIr(),pza=gIr(),hza=AIr(),mza=xIr(),gza=tPi(),Aza=oPi(),yza=DIr(),gPi=$G(),Eza=um(),h5e=qgt(),_za=FTr(),Cza=aPi(),dPi=cPi(),GIr=qG(),fD=mge(),vza=tAt(),bza=pge();function Sza(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(Sza,"isCompletionRequestData");var VG;(function(t){t.Default="default",t.SplitContext="splitContext"})(VG||(Xb.PromptOrdering=VG={}));var UIr={[VG.Default]:{promptFunction:APi,renderer:uza.CompletionsPromptRenderer},[VG.SplitContext]:{promptFunction:gza.splitContextCompletionsPrompt,renderer:Aza.SplitContextPromptRenderer}};function APi(t){let e=t.get(aza.ICompletionsTextDocumentManagerService),r=t.get(HIr.IInstantiationService),n=t.get(vza.ICompletionsRecentEditsProviderService);return(0,w4.jsxs)(w4.Fragment,{children:[(0,w4.jsxs)(lza.CompletionsContext,{children:[(0,w4.jsx)(pza.DocumentMarker,{tdms:e,weight:.7}),(0,w4.jsx)(yza.Traits,{weight:.6}),(0,w4.jsx)(fza.Diagnostics,{tdms:e,weight:.65}),(0,w4.jsx)(cza.CodeSnippets,{tdms:e,weight:.9}),(0,w4.jsx)(mza.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,w4.jsx)(hza.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,w4.jsx)(dza.CurrentFile,{weight:1})]})}a(APi,"defaultCompletionsPrompt");var aAt=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??VG.Default,this.virtualPrompt=e??new uPi.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(fD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?VG.SplitContext:VG.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 fD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return fD._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 fD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,fD.trimLastLine)(b.prefix),R={...b,prefix:T},x,k=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(h5e.useContextProviderAPI,k,n)){let N=(0,GIr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,h5e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),jIr.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(h5e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(h5e.matchContextItems);this.instantiationService.invokeFunction(Tza,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(dPi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(dPi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(_za.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(Cza.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(h5e.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 fD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(FIr.URI.parse(e.uri)))return fD._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,sza.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),fD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new uPi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=UIr[this.promptOrdering]?.promptFunction??APi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=UIr[this.promptOrdering]??UIr[VG.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(FIr.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===lPi.DiagnosticSeverity.Error?d.push(_):_.severity===lPi.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:FIr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,Eza.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)}};aAt=fPi([Zb(2,HIr.IInstantiationService),Zb(3,hPi.ICompletionsTelemetryService),Zb(4,pPi.IIgnoreService),Zb(5,mPi.ICompletionsContextProviderBridgeService),Zb(6,jIr.ICompletionsLogTargetService),Zb(7,GIr.ICompletionsContextProviderService),Zb(8,gPi.ILanguageDiagnosticsService)],aAt);var QIr=class extends aAt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};Xb.ComponentsCompletionsPromptFactory=QIr;Xb.ComponentsCompletionsPromptFactory=QIr=fPi([Zb(0,HIr.IInstantiationService),Zb(1,hPi.ICompletionsTelemetryService),Zb(2,pPi.IIgnoreService),Zb(3,mPi.ICompletionsContextProviderBridgeService),Zb(4,jIr.ICompletionsLogTargetService),Zb(5,GIr.ICompletionsContextProviderService),Zb(6,gPi.ILanguageDiagnosticsService)],QIr);var qIr=class extends aAt{static{a(this,"TestComponentsCompletionsPromptFactory")}};Xb.TestComponentsCompletionsPromptFactory=qIr;function Tza(t,e,r,n){let o=["cpp","c"];return(0,bza.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(Tza,"similarFilesEnabled")});var KIr=I(RE=>{"use strict";p();var yPi=RE&&RE.__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},EPi=RE&&RE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(RE,"__esModule",{value:!0});RE.TestCompletionsPromptFactory=RE.CompletionsPromptFactory=RE.DEFAULT_PROMPT_TIMEOUT=RE.ICompletionsPromptFactoryService=void 0;var Iza=ti(),_Pi=Qs(),$Ir=mge(),xza=J8(),wza=rn();RE.ICompletionsPromptFactoryService=(0,wza.createServiceIdentifier)("ICompletionsPromptFactoryService");var VIr=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 $Ir._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return $Ir._promptError}}};RE.DEFAULT_PROMPT_TIMEOUT=1200;var WIr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Iza.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s($Ir._promptTimeout)},RE.DEFAULT_PROMPT_TIMEOUT)})])}},cAt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new VIr(new WIr(n.createInstance(xza.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};cAt=yPi([EPi(2,_Pi.IInstantiationService)],cAt);var zIr=class extends cAt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};RE.CompletionsPromptFactory=zIr;RE.CompletionsPromptFactory=zIr=yPi([EPi(0,_Pi.IInstantiationService)],zIr);var YIr=class extends cAt{static{a(this,"TestCompletionsPromptFactory")}};RE.TestCompletionsPromptFactory=YIr});var mge=I(nh=>{"use strict";p();Object.defineProperty(nh,"__esModule",{value:!0});nh.PromptResponse=nh._promptTimeout=nh._promptCancelled=nh._promptError=nh._copilotContentExclusion=nh._contextTooShort=nh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=nh.MIN_PROMPT_CHARS=void 0;nh.trimLastLine=Oza;nh.extractPrompt=Bza;nh.getPromptOptions=Uza;var Rza=YOe(),kza=VA(),CPi=cgt(),Pza=XOe(),Dza=zb(),Nza=KIr(),Mza=pge();nh.MIN_PROMPT_CHARS=10;nh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];nh._contextTooShort={type:"contextTooShort"};nh._copilotContentExclusion={type:"copilotContentExclusion"};nh._promptError={type:"promptError"};nh._promptCancelled={type:"promptCancelled"};nh._promptTimeout={type:"promptTimeout"};var vPi;(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=STr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=TTr(e,s,c,l,n);if(dHa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=TRi(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return IRi(h,n.maxFiles)}a(pHa,"recentEditsReducer");function hHa(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=fHa(t.diff);else if(e.summarizationFormat==="diff")o=CRi(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=bRi(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(hHa,"summarizeEdit")});var Egt=I(nD=>{"use strict";p();var mHa=nD&&nD.__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},gHa=nD&&nD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(nD,"__esModule",{value:!0});nD.FullRecentEditsProvider=nD.ICompletionsRecentEditsProviderService=void 0;var AHa=S5(),yHa=rn(),EHa=wo(),_Ha=wF(),vHa=Dvr(),ITr=xRi();nD.ICompletionsRecentEditsProviderService=(0,yHa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var CHa=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}),xTr=class extends EHa.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({},CHa)}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,ITr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,ITr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,ITr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,_Ha.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,AHa.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))}};nD.FullRecentEditsProvider=xTr;nD.FullRecentEditsProvider=xTr=mHa([gHa(1,vHa.ICompletionsObservableWorkspace)],xTr)});var wTr=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.Traits=void 0;var _gt=d4(),wRi=M8(),bHa=eG(),SHa=B8(),THa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(SHa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,bHa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,_gt.jsxs)(_gt.Fragment,{children:[(0,_gt.jsx)(wRi.Text,{children:`Consider this related information: +`}),...r.map(c=>(0,_gt.jsx)(wRi.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");vgt.Traits=THa});var kRi=I(RTr=>{"use strict";p();Object.defineProperty(RTr,"__esModule",{value:!0});RTr.splitContextCompletionsPrompt=OHa;var cR=d4(),IHa=Ls(),xHa=Qb(),wHa=Egt(),RHa=OSr(),RRi=OOe(),PRi=LOe(),PHa=dTr(),kHa=fTr(),DHa=pTr(),NHa=bTr(),MHa=wTr();function OHa(t){let e=t.get(IHa.IInstantiationService),r=t.get(xHa.ICompletionsTextDocumentManagerService),n=t.get(wHa.ICompletionsRecentEditsProviderService);return(0,cR.jsxs)(cR.Fragment,{children:[(0,cR.jsxs)(RRi.StableCompletionsContext,{children:[(0,cR.jsx)(kHa.DocumentMarker,{tdms:r,weight:.7}),(0,cR.jsx)(MHa.Traits,{weight:.6}),(0,cR.jsx)(PHa.Diagnostics,{tdms:r,weight:.65}),(0,cR.jsx)(RHa.CodeSnippets,{tdms:r,weight:.9}),(0,cR.jsx)(NHa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,cR.jsx)(PRi.DocumentSuffix,{weight:1}),(0,cR.jsx)(RRi.AdditionalCompletionsContext,{children:(0,cR.jsx)(DHa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,cR.jsx)(PRi.DocumentPrefix,{weight:1})]})}a(OHa,"splitContextCompletionsPrompt")});var ORi=I(bgt=>{"use strict";p();Object.defineProperty(bgt,"__esModule",{value:!0});bgt.SplitContextPromptRenderer=void 0;var BHa=LSr(),LHa=OOe(),Cgt=WSr(),DRi=LOe(),NRi=GSr(),MRi=0;function FHa(){MRi=0}a(FHa,"resetContextIndex");function UHa(){return MRi++}a(UHa,"getNextContextIndex");var PTr=class extends Cgt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=NRi.makePrefixPrompt,this.formatContext=NRi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(FHa(),new BHa.SnapshotWalker(e,QHa).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===DRi.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,Cgt.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,Cgt.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 ${DRi.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}}};bgt.SplitContextPromptRenderer=PTr;var QHa=[...Cgt.transformers,(t,e,r)=>(0,LHa.isContextNode)(t)?{...r,index:UHa()}:r]});var xG=I(U8=>{"use strict";p();Object.defineProperty(U8,"__esModule",{value:!0});U8.AbstractLanguageDiagnosticsService=U8.ILanguageDiagnosticsService=void 0;U8.rangeSpanningDiagnostics=HHa;U8.isError=GHa;U8.getDiagnosticsAtSelection=$Ha;var qHa=rn(),jHa=_k(),kTr=mm();U8.ILanguageDiagnosticsService=(0,qHa.createServiceIdentifier)("ILanguageDiagnosticService");var DTr=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,jHa.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};U8.AbstractLanguageDiagnosticsService=DTr;function HHa(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(HHa,"rangeSpanningDiagnostics");function GHa(t){return t.severity===kTr.DiagnosticSeverity.Error}a(GHa,"isError");function $Ha(t,e,r=[kTr.DiagnosticSeverity.Error,kTr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a($Ha,"getDiagnosticsAtSelection")});var LRi=I(NTr=>{"use strict";p();Object.defineProperty(NTr,"__esModule",{value:!0});NTr.getDiagnosticsFromContextItems=YHa;var VHa=Qb(),BRi=bG(),WHa=MOe(),zHa="content_excluded";async function YHa(t,e,r){let n=(0,WHa.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)KHa(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(BRi.ICompletionsContextProviderService),l=t.get(VHa.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,zHa]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(YHa,"getDiagnosticsFromContextItems");function KHa(t,e,r,n){let o=t.get(BRi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(KHa,"setupExpectationsForDiagnosticBags")});var FRi=I(Sgt=>{"use strict";p();Object.defineProperty(Sgt,"__esModule",{value:!0});Sgt.getTraitsFromContextItems=eGa;Sgt.ReportTraitsTelemetry=nGa;var JHa=xg(),ZHa=bG(),XHa=MOe();function eGa(t,e,r){let n=(0,XHa.filterContextItemsByType)(r,"Trait");for(let s of n)tGa(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(eGa,"getTraitsFromContextItems");function tGa(t,e,r,n){let o=t.get(ZHa.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(tGa,"setupExpectationsForTraits");var rGa=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function nGa(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=rGa.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,JHa.telemetry)(t,e,l)}}a(nGa,"ReportTraitsTelemetry")});var B8=I($b=>{"use strict";p();var jRi=$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},Gb=$b&&$b.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($b,"__esModule",{value:!0});$b.TestComponentsCompletionsPromptFactory=$b.ComponentsCompletionsPromptFactory=$b.PromptOrdering=void 0;$b.isCompletionRequestData=CGa;var g4=d4(),URi=mm(),FTr=Tl(),HRi=Ete(),MTr=Ku(),UTr=Ls(),GRi=aee(),QRi=Dwi(),iGa=xg(),oGa=Qb(),sGa=OSr(),aGa=OOe(),cGa=WSr(),$Ri=sgt(),lGa=LOe(),uGa=dTr(),dGa=fTr(),fGa=pTr(),pGa=bTr(),hGa=kRi(),mGa=ORi(),gGa=wTr(),VRi=xG(),AGa=um(),qOe=ogt(),yGa=MSr(),EGa=LRi(),qRi=FRi(),QTr=bG(),iD=Vme(),_Ga=Egt(),vGa=Gme();function CGa(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(CGa,"isCompletionRequestData");var wG;(function(t){t.Default="default",t.SplitContext="splitContext"})(wG||($b.PromptOrdering=wG={}));var OTr={[wG.Default]:{promptFunction:WRi,renderer:cGa.CompletionsPromptRenderer},[wG.SplitContext]:{promptFunction:hGa.splitContextCompletionsPrompt,renderer:mGa.SplitContextPromptRenderer}};function WRi(t){let e=t.get(oGa.ICompletionsTextDocumentManagerService),r=t.get(UTr.IInstantiationService),n=t.get(_Ga.ICompletionsRecentEditsProviderService);return(0,g4.jsxs)(g4.Fragment,{children:[(0,g4.jsxs)(aGa.CompletionsContext,{children:[(0,g4.jsx)(dGa.DocumentMarker,{tdms:e,weight:.7}),(0,g4.jsx)(gGa.Traits,{weight:.6}),(0,g4.jsx)(uGa.Diagnostics,{tdms:e,weight:.65}),(0,g4.jsx)(sGa.CodeSnippets,{tdms:e,weight:.9}),(0,g4.jsx)(pGa.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,g4.jsx)(fGa.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,g4.jsx)(lGa.CurrentFile,{weight:1})]})}a(WRi,"defaultCompletionsPrompt");var Tgt=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??wG.Default,this.virtualPrompt=e??new QRi.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(iD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?wG.SplitContext:wG.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 iD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return iD._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 iD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,iD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(qOe.useContextProviderAPI,P,n)){let N=(0,QTr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,qOe.telemetrizeContextItems)(this.contextProviderStatistics,e,E),FTr.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(qOe.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(qOe.matchContextItems);this.instantiationService.invokeFunction(bGa,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(qRi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(qRi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(yGa.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(EGa.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(qOe.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 iD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(MTr.URI.parse(e.uri)))return iD._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,iGa.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),iD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new QRi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=OTr[this.promptOrdering]?.promptFunction??WRi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=OTr[this.promptOrdering]??OTr[wG.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(MTr.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===URi.DiagnosticSeverity.Error?d.push(_):_.severity===URi.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:MTr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,AGa.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)}};Tgt=jRi([Gb(2,UTr.IInstantiationService),Gb(3,GRi.ICompletionsTelemetryService),Gb(4,HRi.IIgnoreService),Gb(5,$Ri.ICompletionsContextProviderBridgeService),Gb(6,FTr.ICompletionsLogTargetService),Gb(7,QTr.ICompletionsContextProviderService),Gb(8,VRi.ILanguageDiagnosticsService)],Tgt);var BTr=class extends Tgt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};$b.ComponentsCompletionsPromptFactory=BTr;$b.ComponentsCompletionsPromptFactory=BTr=jRi([Gb(0,UTr.IInstantiationService),Gb(1,GRi.ICompletionsTelemetryService),Gb(2,HRi.IIgnoreService),Gb(3,$Ri.ICompletionsContextProviderBridgeService),Gb(4,FTr.ICompletionsLogTargetService),Gb(5,QTr.ICompletionsContextProviderService),Gb(6,VRi.ILanguageDiagnosticsService)],BTr);var LTr=class extends Tgt{static{a(this,"TestComponentsCompletionsPromptFactory")}};$b.TestComponentsCompletionsPromptFactory=LTr;function bGa(t,e,r,n){let o=["cpp","c"];return(0,vGa.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(bGa,"similarFilesEnabled")});var VTr=I(IE=>{"use strict";p();var zRi=IE&&IE.__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},YRi=IE&&IE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(IE,"__esModule",{value:!0});IE.TestCompletionsPromptFactory=IE.CompletionsPromptFactory=IE.DEFAULT_PROMPT_TIMEOUT=IE.ICompletionsPromptFactoryService=void 0;var SGa=ti(),KRi=Ls(),qTr=Vme(),TGa=B8(),IGa=rn();IE.ICompletionsPromptFactoryService=(0,IGa.createServiceIdentifier)("ICompletionsPromptFactoryService");var jTr=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 qTr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return qTr._promptError}}};IE.DEFAULT_PROMPT_TIMEOUT=1200;var HTr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new SGa.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(qTr._promptTimeout)},IE.DEFAULT_PROMPT_TIMEOUT)})])}},Igt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new jTr(new HTr(n.createInstance(TGa.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};Igt=zRi([YRi(2,KRi.IInstantiationService)],Igt);var GTr=class extends Igt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};IE.CompletionsPromptFactory=GTr;IE.CompletionsPromptFactory=GTr=zRi([YRi(0,KRi.IInstantiationService)],GTr);var $Tr=class extends Igt{static{a(this,"TestCompletionsPromptFactory")}};IE.TestCompletionsPromptFactory=$Tr});var Vme=I(ih=>{"use strict";p();Object.defineProperty(ih,"__esModule",{value:!0});ih.PromptResponse=ih._promptTimeout=ih._promptCancelled=ih._promptError=ih._copilotContentExclusion=ih._contextTooShort=ih.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=ih.MIN_PROMPT_CHARS=void 0;ih.trimLastLine=NGa;ih.extractPrompt=MGa;ih.getPromptOptions=LGa;var xGa=COe(),wGa=JA(),JRi=Imt(),RGa=IOe(),PGa=Qb(),kGa=VTr(),DGa=Gme();ih.MIN_PROMPT_CHARS=10;ih.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];ih._contextTooShort={type:"contextTooShort"};ih._copilotContentExclusion={type:"copilotContentExclusion"};ih._promptError={type:"promptError"};ih._promptCancelled={type:"promptCancelled"};ih._promptTimeout={type:"promptTimeout"};var ZRi;(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} @@ -1050,14 +1006,14 @@ ${o.join(", ")}`).join(` --- ${n.content} ---------------`).join(` -`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(vPi||(nh.PromptResponse=vPi={}));function Oza(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(Oza,"trimLastLine");function Bza(t,e,r,n,o,s={}){let l=t.get(Dza.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Fza(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Nza.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(Bza,"extractPrompt");function Lza(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,Rza.commentBlockAsSingles)(n,e)}a(Lza,"addNeighboringCellsToPrompt");function Fza(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Lza(l,r.document.detectedLanguageId)).join(` +`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(ZRi||(ih.PromptResponse=ZRi={}));function NGa(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(NGa,"trimLastLine");function MGa(t,e,r,n,o,s={}){let l=t.get(PGa.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=BGa(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(kGa.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(MGa,"extractPrompt");function OGa(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,xGa.commentBlockAsSingles)(n,e)}a(OGa,"addNeighboringCellsToPrompt");function BGa(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>OGa(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Fza,"applyEditsForNotebook");function Uza(t,e,r){let n=t.get(kza.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,Pza.getMaxSolutionTokens)(),c=(0,CPi.getNumberOfSnippets)(e,r),l=(0,CPi.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(Uza,"getPromptOptions")});var TPi=I(WG=>{"use strict";p();Object.defineProperty(WG,"__esModule",{value:!0});WG.TypeSystem=WG.TypeSystemDuplicateFormat=WG.TypeSystemDuplicateTypeKind=void 0;var lAt=Ame(),Qza=bOe(),qza=_n(),SPi=bf(),uAt=class extends SPi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};WG.TypeSystemDuplicateTypeKind=uAt;var dAt=class extends SPi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};WG.TypeSystemDuplicateFormat=dAt;var bPi;(function(t){function e(n,o){if(lAt.TypeRegistry.Has(n))throw new uAt(n);return lAt.TypeRegistry.Set(n,o),(s={})=>(0,Qza.Unsafe)({...s,[qza.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(lAt.FormatRegistry.Has(n))throw new dAt(n);return lAt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(bPi||(WG.TypeSystem=bPi={}))});var JIr=I(zG=>{"use strict";p();var jza=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]})),IPi=zG&&zG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jza(e,t,r)};Object.defineProperty(zG,"__esModule",{value:!0});IPi($Me(),zG);IPi(TPi(),zG)});var ZIr=I(m5e=>{"use strict";p();Object.defineProperty(m5e,"__esModule",{value:!0});m5e.DefaultErrorFunction=xPi;m5e.SetErrorFunction=Gza;m5e.GetErrorFunction=$za;var Hza=_n(),Un=XIr();function xPi(t){switch(t.errorType){case Un.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case Un.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case Un.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case Un.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case Un.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case Un.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case Un.ValueErrorType.Array:return"Expected array";case Un.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case Un.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.BigInt:return"Expected bigint";case Un.ValueErrorType.Boolean:return"Expected boolean";case Un.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case Un.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case Un.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case Un.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case Un.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case Un.ValueErrorType.Date:return"Expected Date";case Un.ValueErrorType.Function:return"Expected function";case Un.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.Integer:return"Expected integer";case Un.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case Un.ValueErrorType.Intersect:return"Expected all values to match";case Un.ValueErrorType.Iterator:return"Expected Iterator";case Un.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case Un.ValueErrorType.Never:return"Never";case Un.ValueErrorType.Not:return"Value should not match";case Un.ValueErrorType.Null:return"Expected null";case Un.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.Number:return"Expected number";case Un.ValueErrorType.Object:return"Expected object";case Un.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case Un.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case Un.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case Un.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case Un.ValueErrorType.Promise:return"Expected Promise";case Un.ValueErrorType.RegExp:return"Expected string to match regular expression";case Un.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case Un.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case Un.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case Un.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case Un.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case Un.ValueErrorType.String:return"Expected string";case Un.ValueErrorType.Symbol:return"Expected symbol";case Un.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case Un.ValueErrorType.Tuple:return"Expected tuple";case Un.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case Un.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case Un.ValueErrorType.Uint8Array:return"Expected Uint8Array";case Un.ValueErrorType.Undefined:return"Expected undefined";case Un.ValueErrorType.Union:return"Expected union value";case Un.ValueErrorType.Void:return"Expected void";case Un.ValueErrorType.Kind:return`Expected kind '${t.schema[Hza.Kind]}'`;default:return"Unknown error type"}}a(xPi,"DefaultErrorFunction");var wPi=xPi;function Gza(t){wPi=t}a(Gza,"SetErrorFunction");function $za(){return wPi}a($za,"GetErrorFunction")});var PPi=I(gge=>{"use strict";p();Object.defineProperty(gge,"__esModule",{value:!0});gge.TypeDereferenceError=void 0;gge.Pushref=Yza;gge.Deref=kPi;var Vza=bf(),RPi=_n(),Wza=p0t(),fAt=class extends Vza.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};gge.TypeDereferenceError=fAt;function zza(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new fAt(t);return kPi(r,e)}a(zza,"Resolve");function Yza(t,e){return!(0,Wza.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Yza,"Pushref");function kPi(t,e){return t[RPi.Kind]==="This"||t[RPi.Kind]==="Ref"?zza(t,e):t}a(kPi,"Deref")});var pD=I(rre=>{"use strict";p();var Kza=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]})),Jza=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kza(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});Jza(PPi(),rre)});var OPi=I(g5e=>{"use strict";p();Object.defineProperty(g5e,"__esModule",{value:!0});g5e.ValueHashError=void 0;g5e.Hash=hYa;var hD=pm(),Zza=bf(),pAt=class extends Zza.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};g5e.ValueHashError=pAt;var LT;(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"})(LT||(LT={}));var Age=BigInt("14695981039346656037"),[Xza,eYa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],tYa=Array.from({length:256}).map((t,e)=>BigInt(e)),DPi=new Float64Array(1),NPi=new DataView(DPi.buffer),MPi=new Uint8Array(DPi.buffer);function*rYa(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(rYa,"NumberToBytes");function nYa(t){kE(LT.Array);for(let e of t)yge(e)}a(nYa,"ArrayType");function iYa(t){kE(LT.Boolean),kE(t?1:0)}a(iYa,"BooleanType");function oYa(t){kE(LT.BigInt),NPi.setBigInt64(0,t);for(let e of MPi)kE(e)}a(oYa,"BigIntType");function sYa(t){kE(LT.Date),yge(t.getTime())}a(sYa,"DateType");function aYa(t){kE(LT.Null)}a(aYa,"NullType");function cYa(t){kE(LT.Number),NPi.setFloat64(0,t);for(let e of MPi)kE(e)}a(cYa,"NumberType");function lYa(t){kE(LT.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())yge(e),yge(t[e])}a(lYa,"ObjectType");function uYa(t){kE(LT.String);for(let e=0;e{"use strict";p();var mYa=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]})),gYa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mYa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});gYa(OPi(),nre)});var txr=I(_5e=>{"use strict";p();Object.defineProperty(_5e,"__esModule",{value:!0});_5e.ValueCheckUnknownTypeError=void 0;_5e.Check=nKa;var y5e=JIr(),exr=pD(),AYa=A5e(),Ege=_n(),BPi=q2(),yYa=dte(),E5e=Ame(),EYa=bf(),_Ya=d0(),m0=pm(),CYa=gs(),hAt=class extends EYa.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};_5e.ValueCheckUnknownTypeError=hAt;function vYa(t){return t[Ege.Kind]==="Any"||t[Ege.Kind]==="Unknown"}a(vYa,"IsAnyOrUnknown");function ea(t){return t!==void 0}a(ea,"IsDefined");function bYa(t,e,r){return!0}a(bYa,"FromAny");function SYa(t,e,r){return!0}a(SYa,"FromArgument");function TYa(t,e,r){if(!(0,m0.IsArray)(r)||ea(t.minItems)&&!(r.length>=t.minItems)||ea(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Dg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,AYa.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ea(t.contains)||(0,m0.IsNumber)(t.minContains)||(0,m0.IsNumber)(t.maxContains)))return!0;let n=ea(t.contains)?t.contains:(0,_Ya.Never)(),o=r.reduce((s,c)=>Dg(n,e,c)?s+1:s,0);return!(o===0||(0,m0.IsNumber)(t.minContains)&&ot.maxContains)}a(TYa,"FromArray");function IYa(t,e,r){return(0,m0.IsAsyncIterator)(r)}a(IYa,"FromAsyncIterator");function xYa(t,e,r){return!(!(0,m0.IsBigInt)(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(xYa,"FromBigInt");function wYa(t,e,r){return(0,m0.IsBoolean)(r)}a(wYa,"FromBoolean");function RYa(t,e,r){return Dg(t.returns,e,r.prototype)}a(RYa,"FromConstructor");function kYa(t,e,r){return!(!(0,m0.IsDate)(r)||ea(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ea(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ea(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ea(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(kYa,"FromDate");function PYa(t,e,r){return(0,m0.IsFunction)(r)}a(PYa,"FromFunction");function DYa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Dg(o,[...e,...n],r)}a(DYa,"FromImport");function NYa(t,e,r){return!(!(0,m0.IsInteger)(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(NYa,"FromInteger");function MYa(t,e,r){let n=t.allOf.every(o=>Dg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,BPi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,CYa.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,BPi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Dg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(MYa,"FromIntersect");function OYa(t,e,r){return(0,m0.IsIterator)(r)}a(OYa,"FromIterator");function BYa(t,e,r){return r===t.const}a(BYa,"FromLiteral");function LYa(t,e,r){return!1}a(LYa,"FromNever");function FYa(t,e,r){return!Dg(t.not,e,r)}a(FYa,"FromNot");function UYa(t,e,r){return(0,m0.IsNull)(r)}a(UYa,"FromNull");function QYa(t,e,r){return!(!y5e.TypeSystemPolicy.IsNumberLike(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(QYa,"FromNumber");function qYa(t,e,r){if(!y5e.TypeSystemPolicy.IsObjectLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(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(!Dg(s,e,r[o])||((0,yYa.ExtendsUndefinedCheck)(s)||vYa(s))&&!(o in r))return!1}else if(y5e.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Dg(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)||Dg(t.additionalProperties,e,r[s])):!0}a(qYa,"FromObject");function jYa(t,e,r){return(0,m0.IsPromise)(r)}a(jYa,"FromPromise");function HYa(t,e,r){if(!y5e.TypeSystemPolicy.IsRecordLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(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)?Dg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Dg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(HYa,"FromRecord");function GYa(t,e,r){return Dg((0,exr.Deref)(t,e),e,r)}a(GYa,"FromRef");function $Ya(t,e,r){let n=new RegExp(t.source,t.flags);return ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a($Ya,"FromRegExp");function VYa(t,e,r){return!(0,m0.IsString)(r)||ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)||ea(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ea(t.format)?E5e.FormatRegistry.Has(t.format)?E5e.FormatRegistry.Get(t.format)(r):!1:!0}a(VYa,"FromString");function WYa(t,e,r){return(0,m0.IsSymbol)(r)}a(WYa,"FromSymbol");function zYa(t,e,r){return(0,m0.IsString)(r)&&new RegExp(t.pattern).test(r)}a(zYa,"FromTemplateLiteral");function YYa(t,e,r){return Dg((0,exr.Deref)(t,e),e,r)}a(YYa,"FromThis");function KYa(t,e,r){if(!(0,m0.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nDg(n,e,r))}a(ZYa,"FromUnion");function XYa(t,e,r){return!(!(0,m0.IsUint8Array)(r)||ea(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ea(t.minByteLength)&&!(r.length>=t.minByteLength))}a(XYa,"FromUint8Array");function eKa(t,e,r){return!0}a(eKa,"FromUnknown");function tKa(t,e,r){return y5e.TypeSystemPolicy.IsVoidLike(r)}a(tKa,"FromVoid");function rKa(t,e,r){return E5e.TypeRegistry.Has(t[Ege.Kind])?E5e.TypeRegistry.Get(t[Ege.Kind])(t,r):!1}a(rKa,"FromKind");function Dg(t,e,r){let n=ea(t.$id)?(0,exr.Pushref)(t,e):e,o=t;switch(o[Ege.Kind]){case"Any":return bYa(o,n,r);case"Argument":return SYa(o,n,r);case"Array":return TYa(o,n,r);case"AsyncIterator":return IYa(o,n,r);case"BigInt":return xYa(o,n,r);case"Boolean":return wYa(o,n,r);case"Constructor":return RYa(o,n,r);case"Date":return kYa(o,n,r);case"Function":return PYa(o,n,r);case"Import":return DYa(o,n,r);case"Integer":return NYa(o,n,r);case"Intersect":return MYa(o,n,r);case"Iterator":return OYa(o,n,r);case"Literal":return BYa(o,n,r);case"Never":return LYa(o,n,r);case"Not":return FYa(o,n,r);case"Null":return UYa(o,n,r);case"Number":return QYa(o,n,r);case"Object":return qYa(o,n,r);case"Promise":return jYa(o,n,r);case"Record":return HYa(o,n,r);case"Ref":return GYa(o,n,r);case"RegExp":return $Ya(o,n,r);case"String":return VYa(o,n,r);case"Symbol":return WYa(o,n,r);case"TemplateLiteral":return zYa(o,n,r);case"This":return YYa(o,n,r);case"Tuple":return KYa(o,n,r);case"Undefined":return JYa(o,n,r);case"Union":return ZYa(o,n,r);case"Uint8Array":return XYa(o,n,r);case"Unknown":return eKa(o,n,r);case"Void":return tKa(o,n,r);default:if(!E5e.TypeRegistry.Has(o[Ege.Kind]))throw new hAt(o);return rKa(o,n,r)}}a(Dg,"Visit");function nKa(...t){return t.length===3?Dg(t[0],t[1],t[2]):Dg(t[0],[],t[1])}a(nKa,"Check")});var FT=I(ire=>{"use strict";p();var iKa=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]})),oKa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iKa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});oKa(txr(),ire)});var XIr=I(r6=>{"use strict";p();Object.defineProperty(r6,"__esModule",{value:!0});r6.ValueErrorIterator=r6.ValueErrorsUnknownTypeError=r6.ValueErrorType=void 0;r6.Errors=VKa;var C5e=JIr(),LPi=q2(),mAt=Ame(),sKa=bCr(),aKa=ZIr(),cKa=bf(),FPi=pD(),lKa=A5e(),uKa=FT(),rxr=_n(),dKa=d0(),ih=pm(),en;(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"})(en||(r6.ValueErrorType=en={}));var gAt=class extends cKa.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};r6.ValueErrorsUnknownTypeError=gAt;function t6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(t6,"EscapeKey");function ta(t){return t!==void 0}a(ta,"IsDefined");var v5e=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}};r6.ValueErrorIterator=v5e;function an(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,aKa.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(an,"Create");function*fKa(t,e,r,n){}a(fKa,"FromAny");function*pKa(t,e,r,n){}a(pKa,"FromArgument");function*hKa(t,e,r,n){if(!(0,ih.IsArray)(n))return yield an(en.Array,t,r,n);ta(t.minItems)&&!(n.length>=t.minItems)&&(yield an(en.ArrayMinItems,t,r,n)),ta(t.maxItems)&&!(n.length<=t.maxItems)&&(yield an(en.ArrayMaxItems,t,r,n));for(let c=0;cNg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield an(en.ArrayContains,t,r,n)),(0,ih.IsNumber)(t.minContains)&&st.maxContains&&(yield an(en.ArrayMaxContains,t,r,n))}a(hKa,"FromArray");function*mKa(t,e,r,n){(0,ih.IsAsyncIterator)(n)||(yield an(en.AsyncIterator,t,r,n))}a(mKa,"FromAsyncIterator");function*gKa(t,e,r,n){if(!(0,ih.IsBigInt)(n))return yield an(en.BigInt,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(en.BigIntExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(en.BigIntMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(en.BigIntMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield an(en.BigIntMultipleOf,t,r,n))}a(gKa,"FromBigInt");function*AKa(t,e,r,n){(0,ih.IsBoolean)(n)||(yield an(en.Boolean,t,r,n))}a(AKa,"FromBoolean");function*yKa(t,e,r,n){yield*Ng(t.returns,e,r,n.prototype)}a(yKa,"FromConstructor");function*EKa(t,e,r,n){if(!(0,ih.IsDate)(n))return yield an(en.Date,t,r,n);ta(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield an(en.DateExclusiveMinimumTimestamp,t,r,n)),ta(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield an(en.DateMaximumTimestamp,t,r,n)),ta(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield an(en.DateMinimumTimestamp,t,r,n)),ta(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield an(en.DateMultipleOfTimestamp,t,r,n))}a(EKa,"FromDate");function*_Ka(t,e,r,n){(0,ih.IsFunction)(n)||(yield an(en.Function,t,r,n))}a(_Ka,"FromFunction");function*CKa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Ng(s,[...e,...o],r,n)}a(CKa,"FromImport");function*vKa(t,e,r,n){if(!(0,ih.IsInteger)(n))return yield an(en.Integer,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(en.IntegerExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(en.IntegerMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(en.IntegerMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield an(en.IntegerMultipleOf,t,r,n))}a(vKa,"FromInteger");function*bKa(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Ng(s,e,r,n))o=!0,yield c;if(o)return yield an(en.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,LPi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield an(en.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,LPi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Ng(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(bKa,"FromIntersect");function*SKa(t,e,r,n){(0,ih.IsIterator)(n)||(yield an(en.Iterator,t,r,n))}a(SKa,"FromIterator");function*TKa(t,e,r,n){n!==t.const&&(yield an(en.Literal,t,r,n))}a(TKa,"FromLiteral");function*IKa(t,e,r,n){yield an(en.Never,t,r,n)}a(IKa,"FromNever");function*xKa(t,e,r,n){Ng(t.not,e,r,n).next().done===!0&&(yield an(en.Not,t,r,n))}a(xKa,"FromNot");function*wKa(t,e,r,n){(0,ih.IsNull)(n)||(yield an(en.Null,t,r,n))}a(wKa,"FromNull");function*RKa(t,e,r,n){if(!C5e.TypeSystemPolicy.IsNumberLike(n))return yield an(en.Number,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(en.NumberExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(en.NumberMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(en.NumberMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield an(en.NumberMultipleOf,t,r,n))}a(RKa,"FromNumber");function*kKa(t,e,r,n){if(!C5e.TypeSystemPolicy.IsObjectLike(n))return yield an(en.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield an(en.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield an(en.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 an(en.ObjectRequiredProperty,t.properties[l],`${r}/${t6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield an(en.ObjectAdditionalProperties,t,`${r}/${t6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Ng(t.additionalProperties,e,`${r}/${t6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Ng(u,e,`${r}/${t6(l)}`,n[l]),(0,sKa.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield an(en.ObjectRequiredProperty,u,`${r}/${t6(l)}`,void 0))):C5e.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Ng(u,e,`${r}/${t6(l)}`,n[l]))}}a(kKa,"FromObject");function*PKa(t,e,r,n){(0,ih.IsPromise)(n)||(yield an(en.Promise,t,r,n))}a(PKa,"FromPromise");function*DKa(t,e,r,n){if(!C5e.TypeSystemPolicy.IsRecordLike(n))return yield an(en.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield an(en.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield an(en.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*Ng(s,e,`${r}/${t6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Ng(t.additionalProperties,e,`${r}/${t6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield an(en.ObjectAdditionalProperties,t,`${r}/${t6(l)}`,u)}}a(DKa,"FromRecord");function*NKa(t,e,r,n){yield*Ng((0,FPi.Deref)(t,e),e,r,n)}a(NKa,"FromRef");function*MKa(t,e,r,n){if(!(0,ih.IsString)(n))return yield an(en.String,t,r,n);if(ta(t.minLength)&&!(n.length>=t.minLength)&&(yield an(en.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield an(en.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield an(en.RegExp,t,r,n)}a(MKa,"FromRegExp");function*OKa(t,e,r,n){if(!(0,ih.IsString)(n))return yield an(en.String,t,r,n);ta(t.minLength)&&!(n.length>=t.minLength)&&(yield an(en.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield an(en.StringMaxLength,t,r,n)),(0,ih.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield an(en.StringPattern,t,r,n))),(0,ih.IsString)(t.format)&&(mAt.FormatRegistry.Has(t.format)?mAt.FormatRegistry.Get(t.format)(n)||(yield an(en.StringFormat,t,r,n)):yield an(en.StringFormatUnknown,t,r,n))}a(OKa,"FromString");function*BKa(t,e,r,n){(0,ih.IsSymbol)(n)||(yield an(en.Symbol,t,r,n))}a(BKa,"FromSymbol");function*LKa(t,e,r,n){if(!(0,ih.IsString)(n))return yield an(en.String,t,r,n);new RegExp(t.pattern).test(n)||(yield an(en.StringPattern,t,r,n))}a(LKa,"FromTemplateLiteral");function*FKa(t,e,r,n){yield*Ng((0,FPi.Deref)(t,e),e,r,n)}a(FKa,"FromThis");function*UKa(t,e,r,n){if(!(0,ih.IsArray)(n))return yield an(en.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield an(en.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield an(en.TupleLength,t,r,n);if(t.items)for(let o=0;onew v5e(Ng(s,e,r,n)));yield an(en.Union,t,r,n,o)}a(qKa,"FromUnion");function*jKa(t,e,r,n){if(!(0,ih.IsUint8Array)(n))return yield an(en.Uint8Array,t,r,n);ta(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield an(en.Uint8ArrayMaxByteLength,t,r,n)),ta(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield an(en.Uint8ArrayMinByteLength,t,r,n))}a(jKa,"FromUint8Array");function*HKa(t,e,r,n){}a(HKa,"FromUnknown");function*GKa(t,e,r,n){C5e.TypeSystemPolicy.IsVoidLike(n)||(yield an(en.Void,t,r,n))}a(GKa,"FromVoid");function*$Ka(t,e,r,n){mAt.TypeRegistry.Get(t[rxr.Kind])(t,n)||(yield an(en.Kind,t,r,n))}a($Ka,"FromKind");function*Ng(t,e,r,n){let o=ta(t.$id)?[...e,t]:e,s=t;switch(s[rxr.Kind]){case"Any":return yield*fKa(s,o,r,n);case"Argument":return yield*pKa(s,o,r,n);case"Array":return yield*hKa(s,o,r,n);case"AsyncIterator":return yield*mKa(s,o,r,n);case"BigInt":return yield*gKa(s,o,r,n);case"Boolean":return yield*AKa(s,o,r,n);case"Constructor":return yield*yKa(s,o,r,n);case"Date":return yield*EKa(s,o,r,n);case"Function":return yield*_Ka(s,o,r,n);case"Import":return yield*CKa(s,o,r,n);case"Integer":return yield*vKa(s,o,r,n);case"Intersect":return yield*bKa(s,o,r,n);case"Iterator":return yield*SKa(s,o,r,n);case"Literal":return yield*TKa(s,o,r,n);case"Never":return yield*IKa(s,o,r,n);case"Not":return yield*xKa(s,o,r,n);case"Null":return yield*wKa(s,o,r,n);case"Number":return yield*RKa(s,o,r,n);case"Object":return yield*kKa(s,o,r,n);case"Promise":return yield*PKa(s,o,r,n);case"Record":return yield*DKa(s,o,r,n);case"Ref":return yield*NKa(s,o,r,n);case"RegExp":return yield*MKa(s,o,r,n);case"String":return yield*OKa(s,o,r,n);case"Symbol":return yield*BKa(s,o,r,n);case"TemplateLiteral":return yield*LKa(s,o,r,n);case"This":return yield*FKa(s,o,r,n);case"Tuple":return yield*UKa(s,o,r,n);case"Undefined":return yield*QKa(s,o,r,n);case"Union":return yield*qKa(s,o,r,n);case"Uint8Array":return yield*jKa(s,o,r,n);case"Unknown":return yield*HKa(s,o,r,n);case"Void":return yield*GKa(s,o,r,n);default:if(!mAt.TypeRegistry.Has(s[rxr.Kind]))throw new gAt(t);return yield*$Ka(s,o,r,n)}}a(Ng,"Visit");function VKa(...t){let e=t.length===3?Ng(t[0],t[1],"",t[2]):Ng(t[0],[],"",t[1]);return new v5e(e)}a(VKa,"Errors")});var _ge=I(YG=>{"use strict";p();var WKa=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]})),UPi=YG&&YG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WKa(e,t,r)};Object.defineProperty(YG,"__esModule",{value:!0});UPi(XIr(),YG);UPi(ZIr(),YG)});var GPi=I(n6=>{"use strict";p();var zKa=n6&&n6.__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},qPi=n6&&n6.__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)},nxr,AAt,jPi;Object.defineProperty(n6,"__esModule",{value:!0});n6.AssertError=void 0;n6.Assert=JKa;var HPi=_ge(),YKa=IEr(),KKa=txr(),yAt=class extends YKa.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),nxr.add(this),AAt.set(this,void 0),zKa(this,AAt,e,"f"),this.error=r}Errors(){return new HPi.ValueErrorIterator(qPi(this,nxr,"m",jPi).call(this))}};n6.AssertError=yAt;AAt=new WeakMap,nxr=new WeakSet,jPi=a(function*(){this.error&&(yield this.error),yield*qPi(this,AAt,"f")},"_AssertError_Iterator");function QPi(t,e,r){if(!(0,KKa.Check)(t,e,r))throw new yAt((0,HPi.Errors)(t,e,r))}a(QPi,"AssertValue");function JKa(...t){return t.length===3?QPi(t[0],t[1],t[2]):QPi(t[0],[],t[1])}a(JKa,"Assert")});var EAt=I(ore=>{"use strict";p();var ZKa=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]})),XKa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZKa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});XKa(GPi(),ore)});var $Pi=I(ixr=>{"use strict";p();Object.defineProperty(ixr,"__esModule",{value:!0});ixr.Clone=Cge;var sre=pm();function eJa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Cge(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Cge(t[r]);return e}a(eJa,"FromObject");function tJa(t){return t.map(e=>Cge(e))}a(tJa,"FromArray");function rJa(t){return t.slice()}a(rJa,"FromTypedArray");function nJa(t){return new Map(Cge([...t.entries()]))}a(nJa,"FromMap");function iJa(t){return new Set(Cge([...t.entries()]))}a(iJa,"FromSet");function oJa(t){return new Date(t.toISOString())}a(oJa,"FromDate");function Cge(t){if((0,sre.IsArray)(t))return tJa(t);if((0,sre.IsDate)(t))return oJa(t);if((0,sre.IsTypedArray)(t))return rJa(t);if((0,sre.IsMap)(t))return nJa(t);if((0,sre.IsSet)(t))return iJa(t);if((0,sre.IsObject)(t))return eJa(t);if((0,sre.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Cge,"Clone")});var mD=I(are=>{"use strict";p();var sJa=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]})),aJa=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sJa(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});aJa($Pi(),are)});var YPi=I(b5e=>{"use strict";p();Object.defineProperty(b5e,"__esModule",{value:!0});b5e.ValueCreateError=void 0;b5e.Create=zJa;var Ba=pm(),cJa=FT(),lJa=mD(),oxr=pD(),VPi=U2(),uJa=Ame(),WPi=_n(),dJa=bf(),fJa=p0t(),e1=class extends dJa.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};b5e.ValueCreateError=e1;function Ja(t){return(0,fJa.IsFunction)(t)?t():(0,lJa.Clone)(t)}a(Ja,"FromDefault");function pJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(pJa,"FromAny");function hJa(t,e){return{}}a(hJa,"FromArgument");function mJa(t,e){if(t.uniqueItems===!0&&!(0,Ba.HasPropertyKey)(t,"default"))throw new e1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ba.HasPropertyKey)(t,"default"))throw new e1(t,"Array with the contains constraint requires a default value");return"default"in t?Ja(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>UT(t.items,e)):[]}a(mJa,"FromArray");function gJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):(async function*(){})()}a(gJa,"FromAsyncIterator");function AJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):BigInt(0)}a(AJa,"FromBigInt");function yJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):!1}a(yJa,"FromBoolean");function EJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=UT(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(EJa,"FromConstructor");function _Ja(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(_Ja,"FromDate");function CJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):()=>UT(t.returns,e)}a(CJa,"FromFunction");function vJa(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return UT(n,[...e,...r])}a(vJa,"FromImport");function bJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(bJa,"FromInteger");function SJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=t.allOf.reduce((n,o)=>{let s=UT(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,cJa.Check)(t,e,r))throw new e1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(SJa,"FromIntersect");function TJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):(function*(){})()}a(TJa,"FromIterator");function IJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.const}a(IJa,"FromLiteral");function xJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"Never types cannot be created. Consider using a default value.")}a(xJa,"FromNever");function wJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"Not types must have a default value")}a(wJa,"FromNot");function RJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):null}a(RJa,"FromNull");function kJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(kJa,"FromNumber");function PJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=UT(s,e));return n}}a(PJa,"FromObject");function DJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):Promise.resolve(UT(t.item,e))}a(DJa,"FromPromise");function NJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(NJa,"FromRecord");function MJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):UT((0,oxr.Deref)(t,e),e)}a(MJa,"FromRef");function OJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"RegExp types cannot be created. Consider using a default value.")}a(OJa,"FromRegExp");function BJa(t,e){if(t.pattern!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"String types with formats must specify a default value")}else return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(BJa,"FromString");function LJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(LJa,"FromSymbol");function FJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);if(!(0,VPi.IsTemplateLiteralFinite)(t))throw new e1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,VPi.TemplateLiteralGenerate)(t)[0]}a(FJa,"FromTemplateLiteral");function UJa(t,e){if(zPi++>WJa)throw new e1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):UT((0,oxr.Deref)(t,e),e)}a(UJa,"FromThis");function QJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>UT(t.items[n],e))}a(QJa,"FromTuple");function qJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default)}a(qJa,"FromUndefined");function jJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return UT(t.anyOf[0],e)}a(jJa,"FromUnion");function HJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(HJa,"FromUint8Array");function GJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(GJa,"FromUnknown");function $Ja(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default)}a($Ja,"FromVoid");function VJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new Error("User defined types must specify a default value")}a(VJa,"FromKind");function UT(t,e){let r=(0,oxr.Pushref)(t,e),n=t;switch(n[WPi.Kind]){case"Any":return pJa(n,r);case"Argument":return hJa(n,r);case"Array":return mJa(n,r);case"AsyncIterator":return gJa(n,r);case"BigInt":return AJa(n,r);case"Boolean":return yJa(n,r);case"Constructor":return EJa(n,r);case"Date":return _Ja(n,r);case"Function":return CJa(n,r);case"Import":return vJa(n,r);case"Integer":return bJa(n,r);case"Intersect":return SJa(n,r);case"Iterator":return TJa(n,r);case"Literal":return IJa(n,r);case"Never":return xJa(n,r);case"Not":return wJa(n,r);case"Null":return RJa(n,r);case"Number":return kJa(n,r);case"Object":return PJa(n,r);case"Promise":return DJa(n,r);case"Record":return NJa(n,r);case"Ref":return MJa(n,r);case"RegExp":return OJa(n,r);case"String":return BJa(n,r);case"Symbol":return LJa(n,r);case"TemplateLiteral":return FJa(n,r);case"This":return UJa(n,r);case"Tuple":return QJa(n,r);case"Undefined":return qJa(n,r);case"Union":return jJa(n,r);case"Uint8Array":return HJa(n,r);case"Unknown":return GJa(n,r);case"Void":return $Ja(n,r);default:if(!uJa.TypeRegistry.Has(n[WPi.Kind]))throw new e1(n,"Unknown type");return VJa(n,r)}}a(UT,"Visit");var WJa=512,zPi=0;function zJa(...t){return zPi=0,t.length===2?UT(t[0],t[1]):UT(t[0],[])}a(zJa,"Create")});var _At=I(cre=>{"use strict";p();var YJa=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]})),KJa=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YJa(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});KJa(YPi(),cre)});var XPi=I(I5e=>{"use strict";p();Object.defineProperty(I5e,"__esModule",{value:!0});I5e.ValueCastError=void 0;I5e.Cast=ZPi;var gR=pm(),JJa=bf(),CAt=_n(),KG=_At(),QT=FT(),lre=mD(),T5e=pD(),S5e=class extends JJa.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};I5e.ValueCastError=S5e;function KPi(t,e,r){if(t[CAt.Kind]==="Object"&&typeof r=="object"&&!(0,gR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[CAt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,QT.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[CAt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,T5e.Deref)(s,e)).map(s=>KPi(s,e,r));return Math.max(...o)}else return(0,QT.Check)(t,e,r)?1:0}a(KPi,"ScoreUnion");function ZJa(t,e,r){let n=t.anyOf.map(c=>(0,T5e.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=KPi(c,e,r);l>s&&(o=c,s=l)}return o}a(ZJa,"SelectUnion");function XJa(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,lre.Clone)(t.default);{let n=ZJa(t,e,r);return ZPi(n,e,r)}}a(XJa,"CastUnion");function eZa(t,e,r){return(0,QT.Check)(t,e,r)?(0,lre.Clone)(r):(0,KG.Create)(t,e)}a(eZa,"DefaultClone");function tZa(t,e,r){return(0,QT.Check)(t,e,r)?r:(0,KG.Create)(t,e)}a(tZa,"Default");function rZa(t,e,r){if((0,QT.Check)(t,e,r))return(0,lre.Clone)(r);let n=(0,gR.IsArray)(r)?(0,lre.Clone)(r):(0,KG.Create)(t,e),o=(0,gR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,gR.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,QT.Check)(t,e,l))throw new S5e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(rZa,"FromArray");function nZa(t,e,r){if((0,QT.Check)(t,e,r))return(0,KG.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(nZa,"FromConstructor");function iZa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return gD(o,[...e,...n],r)}a(iZa,"FromImport");function JPi(t,e){return(0,gR.IsObject)(t)&&!(0,gR.IsObject)(e)||!(0,gR.IsObject)(t)&&(0,gR.IsObject)(e)?t:!(0,gR.IsObject)(t)||!(0,gR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?JPi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(JPi,"IntersectAssign");function oZa(t,e,r){if((0,QT.Check)(t,e,r))return r;let n=(0,KG.Create)(t,e),o=JPi(n,r);return(0,QT.Check)(t,e,o)?o:n}a(oZa,"FromIntersect");function sZa(t,e,r){throw new S5e(t,"Never types cannot be cast")}a(sZa,"FromNever");function aZa(t,e,r){if((0,QT.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,KG.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(aZa,"FromObject");function cZa(t,e,r){if((0,QT.Check)(t,e,r))return(0,lre.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,KG.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(cZa,"FromRecord");function lZa(t,e,r){return gD((0,T5e.Deref)(t,e),e,r)}a(lZa,"FromRef");function uZa(t,e,r){return gD((0,T5e.Deref)(t,e),e,r)}a(uZa,"FromThis");function dZa(t,e,r){return(0,QT.Check)(t,e,r)?(0,lre.Clone)(r):(0,gR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>gD(n,e,r[o])):(0,KG.Create)(t,e)}a(dZa,"FromTuple");function fZa(t,e,r){return(0,QT.Check)(t,e,r)?(0,lre.Clone)(r):XJa(t,e,r)}a(fZa,"FromUnion");function gD(t,e,r){let n=(0,gR.IsString)(t.$id)?(0,T5e.Pushref)(t,e):e,o=t;switch(t[CAt.Kind]){case"Array":return rZa(o,n,r);case"Constructor":return nZa(o,n,r);case"Import":return iZa(o,n,r);case"Intersect":return oZa(o,n,r);case"Never":return sZa(o,n,r);case"Object":return aZa(o,n,r);case"Record":return cZa(o,n,r);case"Ref":return lZa(o,n,r);case"This":return uZa(o,n,r);case"Tuple":return dZa(o,n,r);case"Union":return fZa(o,n,r);case"Date":case"Symbol":case"Uint8Array":return eZa(t,e,r);default:return tZa(o,n,r)}}a(gD,"Visit");function ZPi(...t){return t.length===3?gD(t[0],t[1],t[2]):gD(t[0],[],t[1])}a(ZPi,"Cast")});var vAt=I(ure=>{"use strict";p();var pZa=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]})),hZa=ure&&ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pZa(e,t,r)};Object.defineProperty(ure,"__esModule",{value:!0});hZa(XPi(),ure)});var t2i=I(axr=>{"use strict";p();Object.defineProperty(axr,"__esModule",{value:!0});axr.Clean=xZa;var mZa=q2(),bAt=FT(),gZa=mD(),sxr=pD(),e2i=_n(),AD=pm(),SAt=gs();function AZa(t){return(0,SAt.IsKind)(t)&&t[e2i.Kind]!=="Unsafe"}a(AZa,"IsCheckable");function yZa(t,e,r){return(0,AD.IsArray)(r)?r.map(n=>t1(t.items,e,n)):r}a(yZa,"FromArray");function EZa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return t1(o,[...e,...n],r)}a(EZa,"FromImport");function _Za(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>t1(l,e,(0,gZa.Clone)(r))).reduce((l,u)=>(0,AD.IsObject)(u)?{...l,...u}:u,{});if(!(0,AD.IsObject)(r)||!(0,AD.IsObject)(s)||!(0,SAt.IsKind)(n))return s;let c=(0,mZa.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,bAt.Check)(n,e,r[l])&&(s[l]=t1(n,e,r[l]));return s}a(_Za,"FromIntersect");function CZa(t,e,r){if(!(0,AD.IsObject)(r)||(0,AD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,AD.HasPropertyKey)(t.properties,o)){r[o]=t1(t.properties[o],e,r[o]);continue}if((0,SAt.IsKind)(n)&&(0,bAt.Check)(n,e,r[o])){r[o]=t1(n,e,r[o]);continue}delete r[o]}return r}a(CZa,"FromObject");function vZa(t,e,r){if(!(0,AD.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]=t1(c,e,r[u]);continue}if((0,SAt.IsKind)(n)&&(0,bAt.Check)(n,e,r[u])){r[u]=t1(n,e,r[u]);continue}delete r[u]}return r}a(vZa,"FromRecord");function bZa(t,e,r){return t1((0,sxr.Deref)(t,e),e,r)}a(bZa,"FromRef");function SZa(t,e,r){return t1((0,sxr.Deref)(t,e),e,r)}a(SZa,"FromThis");function TZa(t,e,r){if(!(0,AD.IsArray)(r))return r;if((0,AD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(TZa,"FromTuple");function IZa(t,e,r){for(let n of t.anyOf)if(AZa(n)&&(0,bAt.Check)(n,e,r))return t1(n,e,r);return r}a(IZa,"FromUnion");function t1(t,e,r){let n=(0,AD.IsString)(t.$id)?(0,sxr.Pushref)(t,e):e,o=t;switch(o[e2i.Kind]){case"Array":return yZa(o,n,r);case"Import":return EZa(o,n,r);case"Intersect":return _Za(o,n,r);case"Object":return CZa(o,n,r);case"Record":return vZa(o,n,r);case"Ref":return bZa(o,n,r);case"This":return SZa(o,n,r);case"Tuple":return TZa(o,n,r);case"Union":return IZa(o,n,r);default:return r}}a(t1,"Visit");function xZa(...t){return t.length===3?t1(t[0],t[1],t[2]):t1(t[0],[],t[1])}a(xZa,"Clean")});var TAt=I(dre=>{"use strict";p();var wZa=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]})),RZa=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wZa(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});RZa(t2i(),dre)});var s2i=I(lxr=>{"use strict";p();Object.defineProperty(lxr,"__esModule",{value:!0});lxr.Convert=fXa;var kZa=mD(),r2i=FT(),cxr=pD(),PZa=_n(),La=pm();function IAt(t){return(0,La.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(IAt,"IsStringNumeric");function DZa(t){return(0,La.IsBigInt)(t)||(0,La.IsBoolean)(t)||(0,La.IsNumber)(t)}a(DZa,"IsValueToString");function x5e(t){return t===!0||(0,La.IsNumber)(t)&&t===1||(0,La.IsBigInt)(t)&&t===BigInt("1")||(0,La.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(x5e,"IsValueTrue");function w5e(t){return t===!1||(0,La.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,La.IsBigInt)(t)&&t===BigInt("0")||(0,La.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(w5e,"IsValueFalse");function NZa(t){return(0,La.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(NZa,"IsTimeStringWithTimeZone");function MZa(t){return(0,La.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(MZa,"IsTimeStringWithoutTimeZone");function OZa(t){return(0,La.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(OZa,"IsDateTimeStringWithTimeZone");function BZa(t){return(0,La.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(BZa,"IsDateTimeStringWithoutTimeZone");function LZa(t){return(0,La.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(LZa,"IsDateString");function FZa(t,e){let r=i2i(t);return r===e?r:t}a(FZa,"TryConvertLiteralString");function UZa(t,e){let r=o2i(t);return r===e?r:t}a(UZa,"TryConvertLiteralNumber");function QZa(t,e){let r=n2i(t);return r===e?r:t}a(QZa,"TryConvertLiteralBoolean");function qZa(t,e){return(0,La.IsString)(t.const)?FZa(e,t.const):(0,La.IsNumber)(t.const)?UZa(e,t.const):(0,La.IsBoolean)(t.const)?QZa(e,t.const):e}a(qZa,"TryConvertLiteral");function n2i(t){return x5e(t)?!0:w5e(t)?!1:t}a(n2i,"TryConvertBoolean");function jZa(t){let e=a(r=>r.split(".")[0],"truncateInteger");return IAt(t)?BigInt(e(t)):(0,La.IsNumber)(t)?BigInt(Math.trunc(t)):w5e(t)?BigInt(0):x5e(t)?BigInt(1):t}a(jZa,"TryConvertBigInt");function i2i(t){return(0,La.IsSymbol)(t)&&t.description!==void 0?t.description.toString():DZa(t)?t.toString():t}a(i2i,"TryConvertString");function o2i(t){return IAt(t)?parseFloat(t):x5e(t)?1:w5e(t)?0:t}a(o2i,"TryConvertNumber");function HZa(t){return IAt(t)?parseInt(t):(0,La.IsNumber)(t)?Math.trunc(t):x5e(t)?1:w5e(t)?0:t}a(HZa,"TryConvertInteger");function GZa(t){return(0,La.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(GZa,"TryConvertNull");function $Za(t){return(0,La.IsString)(t)&&t==="undefined"?void 0:t}a($Za,"TryConvertUndefined");function VZa(t){return(0,La.IsDate)(t)?t:(0,La.IsNumber)(t)?new Date(t):x5e(t)?new Date(1):w5e(t)?new Date(0):IAt(t)?new Date(parseInt(t)):MZa(t)?new Date(`1970-01-01T${t}.000Z`):NZa(t)?new Date(`1970-01-01T${t}`):BZa(t)?new Date(`${t}.000Z`):OZa(t)?new Date(t):LZa(t)?new Date(`${t}T00:00:00.000Z`):t}a(VZa,"TryConvertDate");function WZa(t,e,r){return((0,La.IsArray)(r)?r:[r]).map(o=>yD(t.items,e,o))}a(WZa,"FromArray");function zZa(t,e,r){return jZa(r)}a(zZa,"FromBigInt");function YZa(t,e,r){return n2i(r)}a(YZa,"FromBoolean");function KZa(t,e,r){return VZa(r)}a(KZa,"FromDate");function JZa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return yD(o,[...e,...n],r)}a(JZa,"FromImport");function ZZa(t,e,r){return HZa(r)}a(ZZa,"FromInteger");function XZa(t,e,r){return t.allOf.reduce((n,o)=>yD(o,e,n),r)}a(XZa,"FromIntersect");function eXa(t,e,r){return qZa(t,r)}a(eXa,"FromLiteral");function tXa(t,e,r){return GZa(r)}a(tXa,"FromNull");function rXa(t,e,r){return o2i(r)}a(rXa,"FromNumber");function nXa(t,e,r){if(!(0,La.IsObject)(r)||(0,La.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,La.HasPropertyKey)(r,n)&&(r[n]=yD(t.properties[n],e,r[n]));return r}a(nXa,"FromObject");function iXa(t,e,r){if(!((0,La.IsObject)(r)&&!(0,La.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]=yD(s,e,l);return r}a(iXa,"FromRecord");function oXa(t,e,r){return yD((0,cxr.Deref)(t,e),e,r)}a(oXa,"FromRef");function sXa(t,e,r){return i2i(r)}a(sXa,"FromString");function aXa(t,e,r){return(0,La.IsString)(r)||(0,La.IsNumber)(r)?Symbol(r):r}a(aXa,"FromSymbol");function cXa(t,e,r){return yD((0,cxr.Deref)(t,e),e,r)}a(cXa,"FromThis");function lXa(t,e,r){return(0,La.IsArray)(r)&&!(0,La.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var pXa=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]})),hXa=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pXa(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});hXa(s2i(),fre)});var u2i=I(pre=>{"use strict";p();Object.defineProperty(pre,"__esModule",{value:!0});pre.TransformDecodeError=pre.TransformDecodeCheckError=void 0;pre.TransformDecode=xXa;var mXa=$Me(),a2i=_n(),c2i=bf(),l2i=q2(),dxr=pD(),gXa=FT(),i6=pm(),R5e=gs(),uxr=class extends c2i.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}};pre.TransformDecodeCheckError=uxr;var wAt=class extends c2i.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}};pre.TransformDecodeError=wAt;function qd(t,e,r){try{return(0,R5e.IsTransform)(t)?t[a2i.TransformKind].Decode(r):r}catch(n){throw new wAt(t,e,r,n)}}a(qd,"Default");function AXa(t,e,r,n){return(0,i6.IsArray)(n)?qd(t,r,n.map((o,s)=>ED(t.items,e,`${r}/${s}`,o))):qd(t,r,n)}a(AXa,"FromArray");function yXa(t,e,r,n){if(!(0,i6.IsObject)(n)||(0,i6.IsValueType)(n))return qd(t,r,n);let o=(0,l2i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=ED(h,e,`${r}/${f}`,c[f]));if(!(0,R5e.IsTransform)(t.unevaluatedProperties))return qd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=qd(u,`${r}/${f}`,d[f]));return qd(t,r,d)}a(yXa,"FromIntersect");function EXa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=ED(s,[...e,...o],r,n);return qd(t,r,c)}a(EXa,"FromImport");function _Xa(t,e,r,n){return qd(t,r,ED(t.not,e,r,n))}a(_Xa,"FromNot");function CXa(t,e,r,n){if(!(0,i6.IsObject)(n))return qd(t,r,n);let o=(0,l2i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,i6.HasPropertyKey)(s,d)&&((0,i6.IsUndefined)(s[d])&&(!(0,R5e.IsUndefined)(t.properties[d])||mXa.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=ED(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,R5e.IsSchema)(t.additionalProperties))return qd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=qd(l,`${r}/${d}`,u[d]));return qd(t,r,u)}a(CXa,"FromObject");function vXa(t,e,r,n){if(!(0,i6.IsObject)(n))return qd(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]=ED(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,R5e.IsSchema)(t.additionalProperties))return qd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=qd(u,`${r}/${f}`,d[f]));return qd(t,r,d)}a(vXa,"FromRecord");function bXa(t,e,r,n){let o=(0,dxr.Deref)(t,e);return qd(t,r,ED(o,e,r,n))}a(bXa,"FromRef");function SXa(t,e,r,n){let o=(0,dxr.Deref)(t,e);return qd(t,r,ED(o,e,r,n))}a(SXa,"FromThis");function TXa(t,e,r,n){return(0,i6.IsArray)(n)&&(0,i6.IsArray)(t.items)?qd(t,r,t.items.map((o,s)=>ED(o,e,`${r}/${s}`,n[s]))):qd(t,r,n)}a(TXa,"FromTuple");function IXa(t,e,r,n){for(let o of t.anyOf){if(!(0,gXa.Check)(o,e,n))continue;let s=ED(o,e,r,n);return qd(t,r,s)}return qd(t,r,n)}a(IXa,"FromUnion");function ED(t,e,r,n){let o=(0,dxr.Pushref)(t,e),s=t;switch(t[a2i.Kind]){case"Array":return AXa(s,o,r,n);case"Import":return EXa(s,o,r,n);case"Intersect":return yXa(s,o,r,n);case"Not":return _Xa(s,o,r,n);case"Object":return CXa(s,o,r,n);case"Record":return vXa(s,o,r,n);case"Ref":return bXa(s,o,r,n);case"Symbol":return qd(s,r,n);case"This":return SXa(s,o,r,n);case"Tuple":return TXa(s,o,r,n);case"Union":return IXa(s,o,r,n);default:return qd(s,r,n)}}a(ED,"Visit");function xXa(t,e,r){return ED(t,e,"",r)}a(xXa,"TransformDecode")});var m2i=I(hre=>{"use strict";p();Object.defineProperty(hre,"__esModule",{value:!0});hre.TransformEncodeError=hre.TransformEncodeCheckError=void 0;hre.TransformEncode=UXa;var wXa=$Me(),f2i=_n(),p2i=bf(),h2i=q2(),pxr=pD(),d2i=FT(),JG=pm(),k5e=gs(),fxr=class extends p2i.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}};hre.TransformEncodeCheckError=fxr;var RAt=class extends p2i.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}};hre.TransformEncodeError=RAt;function ZA(t,e,r){try{return(0,k5e.IsTransform)(t)?t[f2i.TransformKind].Encode(r):r}catch(n){throw new RAt(t,e,r,n)}}a(ZA,"Default");function RXa(t,e,r,n){let o=ZA(t,r,n);return(0,JG.IsArray)(o)?o.map((s,c)=>_D(t.items,e,`${r}/${c}`,s)):o}a(RXa,"FromArray");function kXa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=ZA(t,r,n);return _D(s,[...e,...o],r,c)}a(kXa,"FromImport");function PXa(t,e,r,n){let o=ZA(t,r,n);if(!(0,JG.IsObject)(n)||(0,JG.IsValueType)(n))return o;let s=(0,h2i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=_D(m,e,`${r}/${h}`,l[h]));if(!(0,k5e.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]=ZA(d,`${r}/${h}`,f[h]));return f}a(PXa,"FromIntersect");function DXa(t,e,r,n){return ZA(t.not,r,ZA(t,r,n))}a(DXa,"FromNot");function NXa(t,e,r,n){let o=ZA(t,r,n);if(!(0,JG.IsObject)(o))return o;let s=(0,h2i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,JG.HasPropertyKey)(c,f)&&((0,JG.IsUndefined)(c[f])&&(!(0,k5e.IsUndefined)(t.properties[f])||wXa.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=_D(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,k5e.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]=ZA(u,`${r}/${f}`,d[f]));return d}a(NXa,"FromObject");function MXa(t,e,r,n){let o=ZA(t,r,n);if(!(0,JG.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]=_D(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,k5e.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]=ZA(d,`${r}/${h}`,f[h]));return f}a(MXa,"FromRecord");function OXa(t,e,r,n){let o=(0,pxr.Deref)(t,e),s=_D(o,e,r,n);return ZA(t,r,s)}a(OXa,"FromRef");function BXa(t,e,r,n){let o=(0,pxr.Deref)(t,e),s=_D(o,e,r,n);return ZA(t,r,s)}a(BXa,"FromThis");function LXa(t,e,r,n){let o=ZA(t,r,n);return(0,JG.IsArray)(t.items)?t.items.map((s,c)=>_D(s,e,`${r}/${c}`,o[c])):[]}a(LXa,"FromTuple");function FXa(t,e,r,n){for(let o of t.anyOf){if(!(0,d2i.Check)(o,e,n))continue;let s=_D(o,e,r,n);return ZA(t,r,s)}for(let o of t.anyOf){let s=_D(o,e,r,n);if((0,d2i.Check)(t,e,s))return ZA(t,r,s)}return ZA(t,r,n)}a(FXa,"FromUnion");function _D(t,e,r,n){let o=(0,pxr.Pushref)(t,e),s=t;switch(t[f2i.Kind]){case"Array":return RXa(s,o,r,n);case"Import":return kXa(s,o,r,n);case"Intersect":return PXa(s,o,r,n);case"Not":return DXa(s,o,r,n);case"Object":return NXa(s,o,r,n);case"Record":return MXa(s,o,r,n);case"Ref":return OXa(s,o,r,n);case"This":return BXa(s,o,r,n);case"Tuple":return LXa(s,o,r,n);case"Union":return FXa(s,o,r,n);default:return ZA(s,r,n)}}a(_D,"Visit");function UXa(t,e,r){return _D(t,e,"",r)}a(UXa,"TransformEncode")});var g2i=I(gxr=>{"use strict";p();Object.defineProperty(gxr,"__esModule",{value:!0});gxr.HasTransform=nec;var mxr=pD(),QXa=_n(),g0=gs(),qXa=pm();function jXa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(jXa,"FromArray");function HXa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(HXa,"FromAsyncIterator");function GXa(t,e){return(0,g0.IsTransform)(t)||gm(t.returns,e)||t.parameters.some(r=>gm(r,e))}a(GXa,"FromConstructor");function $Xa(t,e){return(0,g0.IsTransform)(t)||gm(t.returns,e)||t.parameters.some(r=>gm(r,e))}a($Xa,"FromFunction");function VXa(t,e){return(0,g0.IsTransform)(t)||(0,g0.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>gm(r,e))}a(VXa,"FromIntersect");function WXa(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,g0.IsTransform)(t)||gm(n,[...r,...e])}a(WXa,"FromImport");function zXa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(zXa,"FromIterator");function YXa(t,e){return(0,g0.IsTransform)(t)||gm(t.not,e)}a(YXa,"FromNot");function KXa(t,e){return(0,g0.IsTransform)(t)||Object.values(t.properties).some(r=>gm(r,e))||(0,g0.IsSchema)(t.additionalProperties)&&gm(t.additionalProperties,e)}a(KXa,"FromObject");function JXa(t,e){return(0,g0.IsTransform)(t)||gm(t.item,e)}a(JXa,"FromPromise");function ZXa(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,g0.IsTransform)(t)||gm(n,e)||(0,g0.IsSchema)(t.additionalProperties)&&(0,g0.IsTransform)(t.additionalProperties)}a(ZXa,"FromRecord");function XXa(t,e){return(0,g0.IsTransform)(t)?!0:gm((0,mxr.Deref)(t,e),e)}a(XXa,"FromRef");function eec(t,e){return(0,g0.IsTransform)(t)?!0:gm((0,mxr.Deref)(t,e),e)}a(eec,"FromThis");function tec(t,e){return(0,g0.IsTransform)(t)||!(0,qXa.IsUndefined)(t.items)&&t.items.some(r=>gm(r,e))}a(tec,"FromTuple");function rec(t,e){return(0,g0.IsTransform)(t)||t.anyOf.some(r=>gm(r,e))}a(rec,"FromUnion");function gm(t,e){let r=(0,mxr.Pushref)(t,e),n=t;if(t.$id&&hxr.has(t.$id))return!1;switch(t.$id&&hxr.add(t.$id),t[QXa.Kind]){case"Array":return jXa(n,r);case"AsyncIterator":return HXa(n,r);case"Constructor":return GXa(n,r);case"Function":return $Xa(n,r);case"Import":return WXa(n,r);case"Intersect":return VXa(n,r);case"Iterator":return zXa(n,r);case"Not":return YXa(n,r);case"Object":return KXa(n,r);case"Promise":return JXa(n,r);case"Record":return ZXa(n,r);case"Ref":return XXa(n,r);case"This":return eec(n,r);case"Tuple":return tec(n,r);case"Union":return rec(n,r);default:return(0,g0.IsTransform)(t)}}a(gm,"Visit");var hxr=new Set;function nec(t,e){return hxr.clear(),gm(t,e)}a(nec,"HasTransform")});var P5e=I(o6=>{"use strict";p();var iec=o6&&o6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Axr=o6&&o6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iec(e,t,r)};Object.defineProperty(o6,"__esModule",{value:!0});Axr(u2i(),o6);Axr(m2i(),o6);Axr(g2i(),o6)});var A2i=I(Exr=>{"use strict";p();Object.defineProperty(Exr,"__esModule",{value:!0});Exr.Decode=aec;var yxr=P5e(),oec=FT(),sec=_ge();function aec(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,oec.Check)(e,r,n))throw new yxr.TransformDecodeCheckError(e,n,(0,sec.Errors)(e,r,n).First());return(0,yxr.HasTransform)(e,r)?(0,yxr.TransformDecode)(e,r,n):n}a(aec,"Decode")});var _xr=I(mre=>{"use strict";p();var cec=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]})),lec=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cec(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});lec(A2i(),mre)});var E2i=I(bxr=>{"use strict";p();Object.defineProperty(bxr,"__esModule",{value:!0});bxr.Default=bec;var uec=FT(),y2i=mD(),vxr=pD(),dec=_n(),r1=pm(),fec=gs();function s6(t,e){let r=(0,r1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,r1.IsFunction)(r)?r():(0,y2i.Clone)(r);return(0,r1.IsUndefined)(e)?n:(0,r1.IsObject)(e)&&(0,r1.IsObject)(n)?Object.assign(n,e):e}a(s6,"ValueOrDefault");function Cxr(t){return(0,fec.IsKind)(t)&&"default"in t}a(Cxr,"HasDefaultProperty");function pec(t,e,r){if((0,r1.IsArray)(r)){for(let o=0;o{let c=EC(s,e,n);return(0,r1.IsObject)(c)?{...o,...c}:c},{})}a(gec,"FromIntersect");function Aec(t,e,r){let n=s6(t,r);if(!(0,r1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=EC(t.properties[s],e,n[s]);(0,r1.IsUndefined)(c)||(n[s]=EC(t.properties[s],e,n[s]))}if(!Cxr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=EC(t.additionalProperties,e,n[s]));return n}a(Aec,"FromObject");function yec(t,e,r){let n=s6(t,r);if(!(0,r1.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)&&Cxr(c)&&(n[u]=EC(c,e,n[u]));if(!Cxr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=EC(o,e,n[u]));return n}a(yec,"FromRecord");function Eec(t,e,r){return EC((0,vxr.Deref)(t,e),e,s6(t,r))}a(Eec,"FromRef");function _ec(t,e,r){return EC((0,vxr.Deref)(t,e),e,r)}a(_ec,"FromThis");function Cec(t,e,r){let n=s6(t,r);if(!(0,r1.IsArray)(n)||(0,r1.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 Sec=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]})),Tec=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Sec(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});Tec(E2i(),gre)});var v2i=I(CD=>{"use strict";p();Object.defineProperty(CD,"__esModule",{value:!0});CD.ValuePointerRootDeleteError=CD.ValuePointerRootSetError=void 0;CD.Format=D5e;CD.Set=Iec;CD.Delete=xec;CD.Has=wec;CD.Get=Rec;var C2i=bf(),PAt=class extends C2i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};CD.ValuePointerRootSetError=PAt;var DAt=class extends C2i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};CD.ValuePointerRootDeleteError=DAt;function _2i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(_2i,"Escape");function*D5e(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var kec=R4&&R4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pec=R4&&R4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Dec=R4&&R4.__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(Sxr,"__esModule",{value:!0});Sxr.Equal=MAt;var a6=pm();function Nec(t,e){if(!(0,a6.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=>MAt(t[o],e[o]))}a(Nec,"ObjectType");function Mec(t,e){return(0,a6.IsDate)(e)&&t.getTime()===e.getTime()}a(Mec,"DateType");function Oec(t,e){return!(0,a6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>MAt(r,e[n]))}a(Oec,"ArrayType");function Bec(t,e){return!(0,a6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>MAt(r,e[n]))}a(Bec,"TypedArrayType");function Lec(t,e){return t===e}a(Lec,"ValueType");function MAt(t,e){if((0,a6.IsDate)(t))return Mec(t,e);if((0,a6.IsTypedArray)(t))return Bec(t,e);if((0,a6.IsArray)(t))return Oec(t,e);if((0,a6.IsObject)(t))return Nec(t,e);if((0,a6.IsValueType)(t))return Lec(t,e);throw new Error("ValueEquals: Unable to compare value")}a(MAt,"Equal")});var x2i=I(XA=>{"use strict";p();Object.defineProperty(XA,"__esModule",{value:!0});XA.ValueDiffError=XA.Edit=XA.Delete=XA.Update=XA.Insert=void 0;XA.Diff=$ec;XA.Patch=zec;var k4=pm(),Ixr=NAt(),xxr=mD(),Fec=Txr(),Uec=bf(),wxr=TE(),Rxr=dC(),kxr=aG(),S2i=pG(),Qec=mp();XA.Insert=(0,Rxr.Object)({type:(0,wxr.Literal)("insert"),path:(0,kxr.String)(),value:(0,S2i.Unknown)()});XA.Update=(0,Rxr.Object)({type:(0,wxr.Literal)("update"),path:(0,kxr.String)(),value:(0,S2i.Unknown)()});XA.Delete=(0,Rxr.Object)({type:(0,wxr.Literal)("delete"),path:(0,kxr.String)()});XA.Edit=(0,Qec.Union)([XA.Insert,XA.Update,XA.Delete]);var N5e=class extends Uec.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};XA.ValueDiffError=N5e;function OAt(t,e){return{type:"update",path:t,value:e}}a(OAt,"CreateUpdate");function T2i(t,e){return{type:"insert",path:t,value:e}}a(T2i,"CreateInsert");function I2i(t){return{type:"delete",path:t}}a(I2i,"CreateDelete");function b2i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new N5e(t,"Cannot diff objects with symbols")}a(b2i,"AssertDiffable");function*qec(t,e,r){if(b2i(e),b2i(r),!(0,k4.IsStandardObject)(r))return yield OAt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,k4.HasPropertyKey)(e,s)||(yield T2i(`${t}/${s}`,r[s]));for(let s of n)(0,k4.HasPropertyKey)(r,s)&&((0,Fec.Equal)(e,r)||(yield*BAt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,k4.HasPropertyKey)(r,s)||(yield I2i(`${t}/${s}`))}a(qec,"ObjectType");function*jec(t,e,r){if(!(0,k4.IsArray)(r))return yield OAt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(Vec,"IsRootUpdate");function Wec(t){return t.length===0}a(Wec,"IsIdentity");function zec(t,e){if(Vec(e))return(0,xxr.Clone)(e[0].value);if(Wec(e))return(0,xxr.Clone)(t);let r=(0,xxr.Clone)(t);for(let n of e)switch(n.type){case"insert":{Ixr.ValuePointer.Set(r,n.path,n.value);break}case"update":{Ixr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{Ixr.ValuePointer.Delete(r,n.path);break}}return r}a(zec,"Patch")});var Pxr=I(Are=>{"use strict";p();var Yec=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]})),Kec=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yec(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});Kec(x2i(),Are)});var w2i=I(Nxr=>{"use strict";p();Object.defineProperty(Nxr,"__esModule",{value:!0});Nxr.Encode=Xec;var Dxr=P5e(),Jec=FT(),Zec=_ge();function Xec(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,Dxr.HasTransform)(e,r)?(0,Dxr.TransformEncode)(e,r,n):n;if(!(0,Jec.Check)(e,r,o))throw new Dxr.TransformEncodeCheckError(e,o,(0,Zec.Errors)(e,r,o).First());return o}a(Xec,"Encode")});var Mxr=I(yre=>{"use strict";p();var etc=yre&&yre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ttc=yre&&yre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&etc(e,t,r)};Object.defineProperty(yre,"__esModule",{value:!0});ttc(w2i(),yre)});var Oxr=I(Ere=>{"use strict";p();var rtc=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]})),ntc=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rtc(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});ntc(Txr(),Ere)});var k2i=I(O5e=>{"use strict";p();Object.defineProperty(O5e,"__esModule",{value:!0});O5e.ValueMutateError=void 0;O5e.Mutate=utc;var vD=pm(),FAt=NAt(),Bxr=mD(),itc=bf();function LAt(t){return(0,vD.IsObject)(t)&&!(0,vD.IsArray)(t)}a(LAt,"IsStandardObject");var M5e=class extends itc.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};O5e.ValueMutateError=M5e;function otc(t,e,r,n){if(!LAt(r))FAt.ValuePointer.Set(t,e,(0,Bxr.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)Lxr(t,`${e}/${c}`,r[c],n[c])}}a(otc,"ObjectType");function stc(t,e,r,n){if(!(0,vD.IsArray)(r))FAt.ValuePointer.Set(t,e,(0,Bxr.Clone)(n));else{for(let o=0;o{"use strict";p();var dtc=_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]})),ftc=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dtc(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});ftc(k2i(),_re)});var D2i=I(bD=>{"use strict";p();Object.defineProperty(bD,"__esModule",{value:!0});bD.ParseDefault=bD.ParseRegistry=bD.ParseError=void 0;bD.Parse=Ctc;var ptc=bf(),UAt=P5e(),htc=EAt(),mtc=vAt(),gtc=TAt(),Atc=mD(),ytc=xAt(),Etc=kAt(),P2i=pm(),B5e=class extends ptc.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};bD.ParseError=B5e;var Uxr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,htc.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,mtc.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,gtc.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Atc.Clone)(l)],["Convert",(s,c,l)=>(0,ytc.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,UAt.HasTransform)(s,c)?(0,UAt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Etc.Default)(s,c,l)],["Encode",(s,c,l)=>(0,UAt.HasTransform)(s,c)?(0,UAt.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})(Uxr||(bD.ParseRegistry=Uxr={}));bD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function _tc(t,e,r,n){return t.reduce((o,s)=>{let c=Uxr.Get(s);if((0,P2i.IsUndefined)(c))throw new B5e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(_tc,"ParseValue");function Ctc(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,P2i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[bD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[bD.ParseDefault,t[0],[],t[1]]:(()=>{throw new B5e("Invalid Arguments")})();return _tc(e,r,n,o)}a(Ctc,"Parse")});var Qxr=I(Cre=>{"use strict";p();var vtc=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]})),btc=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vtc(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});btc(D2i(),Cre)});var M2i=I(As=>{"use strict";p();Object.defineProperty(As,"__esModule",{value:!0});As.Parse=As.Mutate=As.Hash=As.Equal=As.Encode=As.Edit=As.Patch=As.Diff=As.Default=As.Decode=As.Create=As.Convert=As.Clone=As.Clean=As.Check=As.Cast=As.Assert=As.ValueErrorIterator=As.Errors=void 0;var N2i=_ge();Object.defineProperty(As,"Errors",{enumerable:!0,get:a(function(){return N2i.Errors},"get")});Object.defineProperty(As,"ValueErrorIterator",{enumerable:!0,get:a(function(){return N2i.ValueErrorIterator},"get")});var Stc=EAt();Object.defineProperty(As,"Assert",{enumerable:!0,get:a(function(){return Stc.Assert},"get")});var Ttc=vAt();Object.defineProperty(As,"Cast",{enumerable:!0,get:a(function(){return Ttc.Cast},"get")});var Itc=FT();Object.defineProperty(As,"Check",{enumerable:!0,get:a(function(){return Itc.Check},"get")});var xtc=TAt();Object.defineProperty(As,"Clean",{enumerable:!0,get:a(function(){return xtc.Clean},"get")});var wtc=mD();Object.defineProperty(As,"Clone",{enumerable:!0,get:a(function(){return wtc.Clone},"get")});var Rtc=xAt();Object.defineProperty(As,"Convert",{enumerable:!0,get:a(function(){return Rtc.Convert},"get")});var ktc=_At();Object.defineProperty(As,"Create",{enumerable:!0,get:a(function(){return ktc.Create},"get")});var Ptc=_xr();Object.defineProperty(As,"Decode",{enumerable:!0,get:a(function(){return Ptc.Decode},"get")});var Dtc=kAt();Object.defineProperty(As,"Default",{enumerable:!0,get:a(function(){return Dtc.Default},"get")});var qxr=Pxr();Object.defineProperty(As,"Diff",{enumerable:!0,get:a(function(){return qxr.Diff},"get")});Object.defineProperty(As,"Patch",{enumerable:!0,get:a(function(){return qxr.Patch},"get")});Object.defineProperty(As,"Edit",{enumerable:!0,get:a(function(){return qxr.Edit},"get")});var Ntc=Mxr();Object.defineProperty(As,"Encode",{enumerable:!0,get:a(function(){return Ntc.Encode},"get")});var Mtc=Oxr();Object.defineProperty(As,"Equal",{enumerable:!0,get:a(function(){return Mtc.Equal},"get")});var Otc=A5e();Object.defineProperty(As,"Hash",{enumerable:!0,get:a(function(){return Otc.Hash},"get")});var Btc=Fxr();Object.defineProperty(As,"Mutate",{enumerable:!0,get:a(function(){return Btc.Mutate},"get")});var Ltc=Qxr();Object.defineProperty(As,"Parse",{enumerable:!0,get:a(function(){return Ltc.Parse},"get")})});var O2i=I(P4=>{"use strict";p();var Ftc=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]})),Utc=P4&&P4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qtc=P4&&P4.__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 qtc=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]})),Mg=Hc&&Hc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qtc(e,t,r)};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Value=Hc.ValueErrorIterator=Hc.ValueErrorType=void 0;var B2i=_ge();Object.defineProperty(Hc,"ValueErrorType",{enumerable:!0,get:a(function(){return B2i.ValueErrorType},"get")});Object.defineProperty(Hc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return B2i.ValueErrorIterator},"get")});Mg(pm(),Hc);Mg(EAt(),Hc);Mg(vAt(),Hc);Mg(FT(),Hc);Mg(TAt(),Hc);Mg(mD(),Hc);Mg(xAt(),Hc);Mg(_At(),Hc);Mg(_xr(),Hc);Mg(kAt(),Hc);Mg(Pxr(),Hc);Mg(Mxr(),Hc);Mg(Oxr(),Hc);Mg(A5e(),Hc);Mg(Fxr(),Hc);Mg(Qxr(),Hc);Mg(NAt(),Hc);Mg(P5e(),Hc);var jtc=O2i();Object.defineProperty(Hc,"Value",{enumerable:!0,get:a(function(){return jtc.Value},"get")})});var F2i=I(QAt=>{"use strict";p();Object.defineProperty(QAt,"__esModule",{value:!0});QAt.assertShape=void 0;var L2i=jxr(),Htc=a((t,e)=>{if(L2i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...L2i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");QAt.assertShape=Htc});var vre={};wi(vre,{CAPIClient:()=>Ytc,RequestType:()=>Q2i});async function Wtc(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 ztc(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 Gtc,Hxr,L5e,$tc,Vtc,Q2i,Ytc,bre=me(()=>{p();Gtc=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)}}},Hxr=class U2i{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||U2i.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`}};Hxr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",Hxr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";L5e=Hxr,$tc=`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(BGa,"applyEditsForNotebook");function LGa(t,e,r){let n=t.get(wGa.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,RGa.getMaxSolutionTokens)(),c=(0,JRi.getNumberOfSnippets)(e,r),l=(0,JRi.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(LGa,"getPromptOptions")});var tPi=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.TypeSystem=RG.TypeSystemDuplicateFormat=RG.TypeSystemDuplicateTypeKind=void 0;var xgt=z0e(),FGa=KMe(),UGa=_n(),ePi=bf(),wgt=class extends ePi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};RG.TypeSystemDuplicateTypeKind=wgt;var Rgt=class extends ePi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};RG.TypeSystemDuplicateFormat=Rgt;var XRi;(function(t){function e(n,o){if(xgt.TypeRegistry.Has(n))throw new wgt(n);return xgt.TypeRegistry.Set(n,o),(s={})=>(0,FGa.Unsafe)({...s,[UGa.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(xgt.FormatRegistry.Has(n))throw new Rgt(n);return xgt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(XRi||(RG.TypeSystem=XRi={}))});var WTr=I(PG=>{"use strict";p();var QGa=PG&&PG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rPi=PG&&PG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QGa(e,t,r)};Object.defineProperty(PG,"__esModule",{value:!0});rPi(yMe(),PG);rPi(tPi(),PG)});var zTr=I(jOe=>{"use strict";p();Object.defineProperty(jOe,"__esModule",{value:!0});jOe.DefaultErrorFunction=nPi;jOe.SetErrorFunction=jGa;jOe.GetErrorFunction=HGa;var qGa=_n(),Un=YTr();function nPi(t){switch(t.errorType){case Un.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case Un.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case Un.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case Un.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case Un.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case Un.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case Un.ValueErrorType.Array:return"Expected array";case Un.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case Un.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.BigInt:return"Expected bigint";case Un.ValueErrorType.Boolean:return"Expected boolean";case Un.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case Un.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case Un.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case Un.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case Un.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case Un.ValueErrorType.Date:return"Expected Date";case Un.ValueErrorType.Function:return"Expected function";case Un.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.Integer:return"Expected integer";case Un.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case Un.ValueErrorType.Intersect:return"Expected all values to match";case Un.ValueErrorType.Iterator:return"Expected Iterator";case Un.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case Un.ValueErrorType.Never:return"Never";case Un.ValueErrorType.Not:return"Value should not match";case Un.ValueErrorType.Null:return"Expected null";case Un.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.Number:return"Expected number";case Un.ValueErrorType.Object:return"Expected object";case Un.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case Un.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case Un.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case Un.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case Un.ValueErrorType.Promise:return"Expected Promise";case Un.ValueErrorType.RegExp:return"Expected string to match regular expression";case Un.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case Un.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case Un.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case Un.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case Un.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case Un.ValueErrorType.String:return"Expected string";case Un.ValueErrorType.Symbol:return"Expected symbol";case Un.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case Un.ValueErrorType.Tuple:return"Expected tuple";case Un.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case Un.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case Un.ValueErrorType.Uint8Array:return"Expected Uint8Array";case Un.ValueErrorType.Undefined:return"Expected undefined";case Un.ValueErrorType.Union:return"Expected union value";case Un.ValueErrorType.Void:return"Expected void";case Un.ValueErrorType.Kind:return`Expected kind '${t.schema[qGa.Kind]}'`;default:return"Unknown error type"}}a(nPi,"DefaultErrorFunction");var iPi=nPi;function jGa(t){iPi=t}a(jGa,"SetErrorFunction");function HGa(){return iPi}a(HGa,"GetErrorFunction")});var aPi=I(Wme=>{"use strict";p();Object.defineProperty(Wme,"__esModule",{value:!0});Wme.TypeDereferenceError=void 0;Wme.Pushref=WGa;Wme.Deref=sPi;var GGa=bf(),oPi=_n(),$Ga=kht(),Pgt=class extends GGa.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};Wme.TypeDereferenceError=Pgt;function VGa(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new Pgt(t);return sPi(r,e)}a(VGa,"Resolve");function WGa(t,e){return!(0,$Ga.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(WGa,"Pushref");function sPi(t,e){return t[oPi.Kind]==="This"||t[oPi.Kind]==="Ref"?VGa(t,e):t}a(sPi,"Deref")});var oD=I(Ute=>{"use strict";p();var zGa=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]})),YGa=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zGa(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});YGa(aPi(),Ute)});var dPi=I(HOe=>{"use strict";p();Object.defineProperty(HOe,"__esModule",{value:!0});HOe.ValueHashError=void 0;HOe.Hash=f$a;var sD=pm(),KGa=bf(),kgt=class extends KGa.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};HOe.ValueHashError=kgt;var kT;(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"})(kT||(kT={}));var zme=BigInt("14695981039346656037"),[JGa,ZGa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],XGa=Array.from({length:256}).map((t,e)=>BigInt(e)),cPi=new Float64Array(1),lPi=new DataView(cPi.buffer),uPi=new Uint8Array(cPi.buffer);function*e$a(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(e$a,"NumberToBytes");function t$a(t){xE(kT.Array);for(let e of t)Yme(e)}a(t$a,"ArrayType");function r$a(t){xE(kT.Boolean),xE(t?1:0)}a(r$a,"BooleanType");function n$a(t){xE(kT.BigInt),lPi.setBigInt64(0,t);for(let e of uPi)xE(e)}a(n$a,"BigIntType");function i$a(t){xE(kT.Date),Yme(t.getTime())}a(i$a,"DateType");function o$a(t){xE(kT.Null)}a(o$a,"NullType");function s$a(t){xE(kT.Number),lPi.setFloat64(0,t);for(let e of uPi)xE(e)}a(s$a,"NumberType");function a$a(t){xE(kT.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Yme(e),Yme(t[e])}a(a$a,"ObjectType");function c$a(t){xE(kT.String);for(let e=0;e{"use strict";p();var p$a=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]})),h$a=Qte&&Qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p$a(e,t,r)};Object.defineProperty(Qte,"__esModule",{value:!0});h$a(dPi(),Qte)});var JTr=I(WOe=>{"use strict";p();Object.defineProperty(WOe,"__esModule",{value:!0});WOe.ValueCheckUnknownTypeError=void 0;WOe.Check=tVa;var $Oe=WTr(),KTr=oD(),m$a=GOe(),Kme=_n(),fPi=N2(),g$a=zee(),VOe=z0e(),A$a=bf(),y$a=d0(),m0=pm(),E$a=hs(),Dgt=class extends A$a.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};WOe.ValueCheckUnknownTypeError=Dgt;function _$a(t){return t[Kme.Kind]==="Any"||t[Kme.Kind]==="Unknown"}a(_$a,"IsAnyOrUnknown");function Ks(t){return t!==void 0}a(Ks,"IsDefined");function v$a(t,e,r){return!0}a(v$a,"FromAny");function C$a(t,e,r){return!0}a(C$a,"FromArgument");function b$a(t,e,r){if(!(0,m0.IsArray)(r)||Ks(t.minItems)&&!(r.length>=t.minItems)||Ks(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Mg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,m$a.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(Ks(t.contains)||(0,m0.IsNumber)(t.minContains)||(0,m0.IsNumber)(t.maxContains)))return!0;let n=Ks(t.contains)?t.contains:(0,y$a.Never)(),o=r.reduce((s,c)=>Mg(n,e,c)?s+1:s,0);return!(o===0||(0,m0.IsNumber)(t.minContains)&&ot.maxContains)}a(b$a,"FromArray");function S$a(t,e,r){return(0,m0.IsAsyncIterator)(r)}a(S$a,"FromAsyncIterator");function T$a(t,e,r){return!(!(0,m0.IsBigInt)(r)||Ks(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Ks(t.maximum)&&!(r<=t.maximum)||Ks(t.minimum)&&!(r>=t.minimum)||Ks(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(T$a,"FromBigInt");function I$a(t,e,r){return(0,m0.IsBoolean)(r)}a(I$a,"FromBoolean");function x$a(t,e,r){return Mg(t.returns,e,r.prototype)}a(x$a,"FromConstructor");function w$a(t,e,r){return!(!(0,m0.IsDate)(r)||Ks(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||Ks(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||Ks(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||Ks(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(w$a,"FromDate");function R$a(t,e,r){return(0,m0.IsFunction)(r)}a(R$a,"FromFunction");function P$a(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Mg(o,[...e,...n],r)}a(P$a,"FromImport");function k$a(t,e,r){return!(!(0,m0.IsInteger)(r)||Ks(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Ks(t.maximum)&&!(r<=t.maximum)||Ks(t.minimum)&&!(r>=t.minimum)||Ks(t.multipleOf)&&r%t.multipleOf!==0)}a(k$a,"FromInteger");function D$a(t,e,r){let n=t.allOf.every(o=>Mg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,fPi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,E$a.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,fPi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Mg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(D$a,"FromIntersect");function N$a(t,e,r){return(0,m0.IsIterator)(r)}a(N$a,"FromIterator");function M$a(t,e,r){return r===t.const}a(M$a,"FromLiteral");function O$a(t,e,r){return!1}a(O$a,"FromNever");function B$a(t,e,r){return!Mg(t.not,e,r)}a(B$a,"FromNot");function L$a(t,e,r){return(0,m0.IsNull)(r)}a(L$a,"FromNull");function F$a(t,e,r){return!(!$Oe.TypeSystemPolicy.IsNumberLike(r)||Ks(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Ks(t.minimum)&&!(r>=t.minimum)||Ks(t.maximum)&&!(r<=t.maximum)||Ks(t.multipleOf)&&r%t.multipleOf!==0)}a(F$a,"FromNumber");function U$a(t,e,r){if(!$Oe.TypeSystemPolicy.IsObjectLike(r)||Ks(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Ks(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(!Mg(s,e,r[o])||((0,g$a.ExtendsUndefinedCheck)(s)||_$a(s))&&!(o in r))return!1}else if($Oe.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Mg(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)||Mg(t.additionalProperties,e,r[s])):!0}a(U$a,"FromObject");function Q$a(t,e,r){return(0,m0.IsPromise)(r)}a(Q$a,"FromPromise");function q$a(t,e,r){if(!$Oe.TypeSystemPolicy.IsRecordLike(r)||Ks(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Ks(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)?Mg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Mg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(q$a,"FromRecord");function j$a(t,e,r){return Mg((0,KTr.Deref)(t,e),e,r)}a(j$a,"FromRef");function H$a(t,e,r){let n=new RegExp(t.source,t.flags);return Ks(t.minLength)&&!(r.length>=t.minLength)||Ks(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(H$a,"FromRegExp");function G$a(t,e,r){return!(0,m0.IsString)(r)||Ks(t.minLength)&&!(r.length>=t.minLength)||Ks(t.maxLength)&&!(r.length<=t.maxLength)||Ks(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:Ks(t.format)?VOe.FormatRegistry.Has(t.format)?VOe.FormatRegistry.Get(t.format)(r):!1:!0}a(G$a,"FromString");function $$a(t,e,r){return(0,m0.IsSymbol)(r)}a($$a,"FromSymbol");function V$a(t,e,r){return(0,m0.IsString)(r)&&new RegExp(t.pattern).test(r)}a(V$a,"FromTemplateLiteral");function W$a(t,e,r){return Mg((0,KTr.Deref)(t,e),e,r)}a(W$a,"FromThis");function z$a(t,e,r){if(!(0,m0.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nMg(n,e,r))}a(K$a,"FromUnion");function J$a(t,e,r){return!(!(0,m0.IsUint8Array)(r)||Ks(t.maxByteLength)&&!(r.length<=t.maxByteLength)||Ks(t.minByteLength)&&!(r.length>=t.minByteLength))}a(J$a,"FromUint8Array");function Z$a(t,e,r){return!0}a(Z$a,"FromUnknown");function X$a(t,e,r){return $Oe.TypeSystemPolicy.IsVoidLike(r)}a(X$a,"FromVoid");function eVa(t,e,r){return VOe.TypeRegistry.Has(t[Kme.Kind])?VOe.TypeRegistry.Get(t[Kme.Kind])(t,r):!1}a(eVa,"FromKind");function Mg(t,e,r){let n=Ks(t.$id)?(0,KTr.Pushref)(t,e):e,o=t;switch(o[Kme.Kind]){case"Any":return v$a(o,n,r);case"Argument":return C$a(o,n,r);case"Array":return b$a(o,n,r);case"AsyncIterator":return S$a(o,n,r);case"BigInt":return T$a(o,n,r);case"Boolean":return I$a(o,n,r);case"Constructor":return x$a(o,n,r);case"Date":return w$a(o,n,r);case"Function":return R$a(o,n,r);case"Import":return P$a(o,n,r);case"Integer":return k$a(o,n,r);case"Intersect":return D$a(o,n,r);case"Iterator":return N$a(o,n,r);case"Literal":return M$a(o,n,r);case"Never":return O$a(o,n,r);case"Not":return B$a(o,n,r);case"Null":return L$a(o,n,r);case"Number":return F$a(o,n,r);case"Object":return U$a(o,n,r);case"Promise":return Q$a(o,n,r);case"Record":return q$a(o,n,r);case"Ref":return j$a(o,n,r);case"RegExp":return H$a(o,n,r);case"String":return G$a(o,n,r);case"Symbol":return $$a(o,n,r);case"TemplateLiteral":return V$a(o,n,r);case"This":return W$a(o,n,r);case"Tuple":return z$a(o,n,r);case"Undefined":return Y$a(o,n,r);case"Union":return K$a(o,n,r);case"Uint8Array":return J$a(o,n,r);case"Unknown":return Z$a(o,n,r);case"Void":return X$a(o,n,r);default:if(!VOe.TypeRegistry.Has(o[Kme.Kind]))throw new Dgt(o);return eVa(o,n,r)}}a(Mg,"Visit");function tVa(...t){return t.length===3?Mg(t[0],t[1],t[2]):Mg(t[0],[],t[1])}a(tVa,"Check")});var DT=I(qte=>{"use strict";p();var rVa=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]})),nVa=qte&&qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rVa(e,t,r)};Object.defineProperty(qte,"__esModule",{value:!0});nVa(JTr(),qte)});var YTr=I(q8=>{"use strict";p();Object.defineProperty(q8,"__esModule",{value:!0});q8.ValueErrorIterator=q8.ValueErrorsUnknownTypeError=q8.ValueErrorType=void 0;q8.Errors=GVa;var zOe=WTr(),pPi=N2(),Ngt=z0e(),iVa=E_r(),oVa=zTr(),sVa=bf(),hPi=oD(),aVa=GOe(),cVa=DT(),ZTr=_n(),lVa=d0(),oh=pm(),en;(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"})(en||(q8.ValueErrorType=en={}));var Mgt=class extends sVa.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};q8.ValueErrorsUnknownTypeError=Mgt;function Q8(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Q8,"EscapeKey");function Js(t){return t!==void 0}a(Js,"IsDefined");var YOe=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}};q8.ValueErrorIterator=YOe;function sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,oVa.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*uVa(t,e,r,n){}a(uVa,"FromAny");function*dVa(t,e,r,n){}a(dVa,"FromArgument");function*fVa(t,e,r,n){if(!(0,oh.IsArray)(n))return yield sn(en.Array,t,r,n);Js(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(en.ArrayMinItems,t,r,n)),Js(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(en.ArrayMaxItems,t,r,n));for(let c=0;cOg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(en.ArrayContains,t,r,n)),(0,oh.IsNumber)(t.minContains)&&st.maxContains&&(yield sn(en.ArrayMaxContains,t,r,n))}a(fVa,"FromArray");function*pVa(t,e,r,n){(0,oh.IsAsyncIterator)(n)||(yield sn(en.AsyncIterator,t,r,n))}a(pVa,"FromAsyncIterator");function*hVa(t,e,r,n){if(!(0,oh.IsBigInt)(n))return yield sn(en.BigInt,t,r,n);Js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(en.BigIntExclusiveMinimum,t,r,n)),Js(t.maximum)&&!(n<=t.maximum)&&(yield sn(en.BigIntMaximum,t,r,n)),Js(t.minimum)&&!(n>=t.minimum)&&(yield sn(en.BigIntMinimum,t,r,n)),Js(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(en.BigIntMultipleOf,t,r,n))}a(hVa,"FromBigInt");function*mVa(t,e,r,n){(0,oh.IsBoolean)(n)||(yield sn(en.Boolean,t,r,n))}a(mVa,"FromBoolean");function*gVa(t,e,r,n){yield*Og(t.returns,e,r,n.prototype)}a(gVa,"FromConstructor");function*AVa(t,e,r,n){if(!(0,oh.IsDate)(n))return yield sn(en.Date,t,r,n);Js(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(en.DateExclusiveMinimumTimestamp,t,r,n)),Js(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(en.DateMaximumTimestamp,t,r,n)),Js(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(en.DateMinimumTimestamp,t,r,n)),Js(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(en.DateMultipleOfTimestamp,t,r,n))}a(AVa,"FromDate");function*yVa(t,e,r,n){(0,oh.IsFunction)(n)||(yield sn(en.Function,t,r,n))}a(yVa,"FromFunction");function*EVa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Og(s,[...e,...o],r,n)}a(EVa,"FromImport");function*_Va(t,e,r,n){if(!(0,oh.IsInteger)(n))return yield sn(en.Integer,t,r,n);Js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(en.IntegerExclusiveMinimum,t,r,n)),Js(t.maximum)&&!(n<=t.maximum)&&(yield sn(en.IntegerMaximum,t,r,n)),Js(t.minimum)&&!(n>=t.minimum)&&(yield sn(en.IntegerMinimum,t,r,n)),Js(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(en.IntegerMultipleOf,t,r,n))}a(_Va,"FromInteger");function*vVa(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Og(s,e,r,n))o=!0,yield c;if(o)return yield sn(en.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,pPi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(en.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,pPi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Og(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(vVa,"FromIntersect");function*CVa(t,e,r,n){(0,oh.IsIterator)(n)||(yield sn(en.Iterator,t,r,n))}a(CVa,"FromIterator");function*bVa(t,e,r,n){n!==t.const&&(yield sn(en.Literal,t,r,n))}a(bVa,"FromLiteral");function*SVa(t,e,r,n){yield sn(en.Never,t,r,n)}a(SVa,"FromNever");function*TVa(t,e,r,n){Og(t.not,e,r,n).next().done===!0&&(yield sn(en.Not,t,r,n))}a(TVa,"FromNot");function*IVa(t,e,r,n){(0,oh.IsNull)(n)||(yield sn(en.Null,t,r,n))}a(IVa,"FromNull");function*xVa(t,e,r,n){if(!zOe.TypeSystemPolicy.IsNumberLike(n))return yield sn(en.Number,t,r,n);Js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(en.NumberExclusiveMinimum,t,r,n)),Js(t.maximum)&&!(n<=t.maximum)&&(yield sn(en.NumberMaximum,t,r,n)),Js(t.minimum)&&!(n>=t.minimum)&&(yield sn(en.NumberMinimum,t,r,n)),Js(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(en.NumberMultipleOf,t,r,n))}a(xVa,"FromNumber");function*wVa(t,e,r,n){if(!zOe.TypeSystemPolicy.IsObjectLike(n))return yield sn(en.Object,t,r,n);Js(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(en.ObjectMinProperties,t,r,n)),Js(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(en.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(en.ObjectRequiredProperty,t.properties[l],`${r}/${Q8(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(en.ObjectAdditionalProperties,t,`${r}/${Q8(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Og(t.additionalProperties,e,`${r}/${Q8(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Og(u,e,`${r}/${Q8(l)}`,n[l]),(0,iVa.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield sn(en.ObjectRequiredProperty,u,`${r}/${Q8(l)}`,void 0))):zOe.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Og(u,e,`${r}/${Q8(l)}`,n[l]))}}a(wVa,"FromObject");function*RVa(t,e,r,n){(0,oh.IsPromise)(n)||(yield sn(en.Promise,t,r,n))}a(RVa,"FromPromise");function*PVa(t,e,r,n){if(!zOe.TypeSystemPolicy.IsRecordLike(n))return yield sn(en.Object,t,r,n);Js(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(en.ObjectMinProperties,t,r,n)),Js(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(en.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*Og(s,e,`${r}/${Q8(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Og(t.additionalProperties,e,`${r}/${Q8(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(en.ObjectAdditionalProperties,t,`${r}/${Q8(l)}`,u)}}a(PVa,"FromRecord");function*kVa(t,e,r,n){yield*Og((0,hPi.Deref)(t,e),e,r,n)}a(kVa,"FromRef");function*DVa(t,e,r,n){if(!(0,oh.IsString)(n))return yield sn(en.String,t,r,n);if(Js(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(en.StringMinLength,t,r,n)),Js(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(en.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(en.RegExp,t,r,n)}a(DVa,"FromRegExp");function*NVa(t,e,r,n){if(!(0,oh.IsString)(n))return yield sn(en.String,t,r,n);Js(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(en.StringMinLength,t,r,n)),Js(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(en.StringMaxLength,t,r,n)),(0,oh.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(en.StringPattern,t,r,n))),(0,oh.IsString)(t.format)&&(Ngt.FormatRegistry.Has(t.format)?Ngt.FormatRegistry.Get(t.format)(n)||(yield sn(en.StringFormat,t,r,n)):yield sn(en.StringFormatUnknown,t,r,n))}a(NVa,"FromString");function*MVa(t,e,r,n){(0,oh.IsSymbol)(n)||(yield sn(en.Symbol,t,r,n))}a(MVa,"FromSymbol");function*OVa(t,e,r,n){if(!(0,oh.IsString)(n))return yield sn(en.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(en.StringPattern,t,r,n))}a(OVa,"FromTemplateLiteral");function*BVa(t,e,r,n){yield*Og((0,hPi.Deref)(t,e),e,r,n)}a(BVa,"FromThis");function*LVa(t,e,r,n){if(!(0,oh.IsArray)(n))return yield sn(en.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(en.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(en.TupleLength,t,r,n);if(t.items)for(let o=0;onew YOe(Og(s,e,r,n)));yield sn(en.Union,t,r,n,o)}a(UVa,"FromUnion");function*QVa(t,e,r,n){if(!(0,oh.IsUint8Array)(n))return yield sn(en.Uint8Array,t,r,n);Js(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(en.Uint8ArrayMaxByteLength,t,r,n)),Js(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(en.Uint8ArrayMinByteLength,t,r,n))}a(QVa,"FromUint8Array");function*qVa(t,e,r,n){}a(qVa,"FromUnknown");function*jVa(t,e,r,n){zOe.TypeSystemPolicy.IsVoidLike(n)||(yield sn(en.Void,t,r,n))}a(jVa,"FromVoid");function*HVa(t,e,r,n){Ngt.TypeRegistry.Get(t[ZTr.Kind])(t,n)||(yield sn(en.Kind,t,r,n))}a(HVa,"FromKind");function*Og(t,e,r,n){let o=Js(t.$id)?[...e,t]:e,s=t;switch(s[ZTr.Kind]){case"Any":return yield*uVa(s,o,r,n);case"Argument":return yield*dVa(s,o,r,n);case"Array":return yield*fVa(s,o,r,n);case"AsyncIterator":return yield*pVa(s,o,r,n);case"BigInt":return yield*hVa(s,o,r,n);case"Boolean":return yield*mVa(s,o,r,n);case"Constructor":return yield*gVa(s,o,r,n);case"Date":return yield*AVa(s,o,r,n);case"Function":return yield*yVa(s,o,r,n);case"Import":return yield*EVa(s,o,r,n);case"Integer":return yield*_Va(s,o,r,n);case"Intersect":return yield*vVa(s,o,r,n);case"Iterator":return yield*CVa(s,o,r,n);case"Literal":return yield*bVa(s,o,r,n);case"Never":return yield*SVa(s,o,r,n);case"Not":return yield*TVa(s,o,r,n);case"Null":return yield*IVa(s,o,r,n);case"Number":return yield*xVa(s,o,r,n);case"Object":return yield*wVa(s,o,r,n);case"Promise":return yield*RVa(s,o,r,n);case"Record":return yield*PVa(s,o,r,n);case"Ref":return yield*kVa(s,o,r,n);case"RegExp":return yield*DVa(s,o,r,n);case"String":return yield*NVa(s,o,r,n);case"Symbol":return yield*MVa(s,o,r,n);case"TemplateLiteral":return yield*OVa(s,o,r,n);case"This":return yield*BVa(s,o,r,n);case"Tuple":return yield*LVa(s,o,r,n);case"Undefined":return yield*FVa(s,o,r,n);case"Union":return yield*UVa(s,o,r,n);case"Uint8Array":return yield*QVa(s,o,r,n);case"Unknown":return yield*qVa(s,o,r,n);case"Void":return yield*jVa(s,o,r,n);default:if(!Ngt.TypeRegistry.Has(s[ZTr.Kind]))throw new Mgt(t);return yield*HVa(s,o,r,n)}}a(Og,"Visit");function GVa(...t){let e=t.length===3?Og(t[0],t[1],"",t[2]):Og(t[0],[],"",t[1]);return new YOe(e)}a(GVa,"Errors")});var Jme=I(kG=>{"use strict";p();var $Va=kG&&kG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mPi=kG&&kG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Va(e,t,r)};Object.defineProperty(kG,"__esModule",{value:!0});mPi(YTr(),kG);mPi(zTr(),kG)});var _Pi=I(j8=>{"use strict";p();var VVa=j8&&j8.__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},APi=j8&&j8.__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)},XTr,Ogt,yPi;Object.defineProperty(j8,"__esModule",{value:!0});j8.AssertError=void 0;j8.Assert=YVa;var EPi=Jme(),WVa=Cyr(),zVa=JTr(),Bgt=class extends WVa.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),XTr.add(this),Ogt.set(this,void 0),VVa(this,Ogt,e,"f"),this.error=r}Errors(){return new EPi.ValueErrorIterator(APi(this,XTr,"m",yPi).call(this))}};j8.AssertError=Bgt;Ogt=new WeakMap,XTr=new WeakSet,yPi=a(function*(){this.error&&(yield this.error),yield*APi(this,Ogt,"f")},"_AssertError_Iterator");function gPi(t,e,r){if(!(0,zVa.Check)(t,e,r))throw new Bgt((0,EPi.Errors)(t,e,r))}a(gPi,"AssertValue");function YVa(...t){return t.length===3?gPi(t[0],t[1],t[2]):gPi(t[0],[],t[1])}a(YVa,"Assert")});var Lgt=I(jte=>{"use strict";p();var KVa=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]})),JVa=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KVa(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});JVa(_Pi(),jte)});var vPi=I(eIr=>{"use strict";p();Object.defineProperty(eIr,"__esModule",{value:!0});eIr.Clone=Zme;var Hte=pm();function ZVa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Zme(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Zme(t[r]);return e}a(ZVa,"FromObject");function XVa(t){return t.map(e=>Zme(e))}a(XVa,"FromArray");function eWa(t){return t.slice()}a(eWa,"FromTypedArray");function tWa(t){return new Map(Zme([...t.entries()]))}a(tWa,"FromMap");function rWa(t){return new Set(Zme([...t.entries()]))}a(rWa,"FromSet");function nWa(t){return new Date(t.toISOString())}a(nWa,"FromDate");function Zme(t){if((0,Hte.IsArray)(t))return XVa(t);if((0,Hte.IsDate)(t))return nWa(t);if((0,Hte.IsTypedArray)(t))return eWa(t);if((0,Hte.IsMap)(t))return tWa(t);if((0,Hte.IsSet)(t))return rWa(t);if((0,Hte.IsObject)(t))return ZVa(t);if((0,Hte.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Zme,"Clone")});var aD=I(Gte=>{"use strict";p();var iWa=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]})),oWa=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iWa(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});oWa(vPi(),Gte)});var TPi=I(KOe=>{"use strict";p();Object.defineProperty(KOe,"__esModule",{value:!0});KOe.ValueCreateError=void 0;KOe.Create=VWa;var Na=pm(),sWa=DT(),aWa=aD(),tIr=oD(),CPi=k2(),cWa=z0e(),bPi=_n(),lWa=bf(),uWa=kht(),Vb=class extends lWa.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};KOe.ValueCreateError=Vb;function Ya(t){return(0,uWa.IsFunction)(t)?t():(0,aWa.Clone)(t)}a(Ya,"FromDefault");function dWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):{}}a(dWa,"FromAny");function fWa(t,e){return{}}a(fWa,"FromArgument");function pWa(t,e){if(t.uniqueItems===!0&&!(0,Na.HasPropertyKey)(t,"default"))throw new Vb(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Na.HasPropertyKey)(t,"default"))throw new Vb(t,"Array with the contains constraint requires a default value");return"default"in t?Ya(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>NT(t.items,e)):[]}a(pWa,"FromArray");function hWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):(async function*(){})()}a(hWa,"FromAsyncIterator");function mWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):BigInt(0)}a(mWa,"FromBigInt");function gWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):!1}a(gWa,"FromBoolean");function AWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);{let r=NT(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(AWa,"FromConstructor");function yWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(yWa,"FromDate");function EWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):()=>NT(t.returns,e)}a(EWa,"FromFunction");function _Wa(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return NT(n,[...e,...r])}a(_Wa,"FromImport");function vWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):t.minimum!==void 0?t.minimum:0}a(vWa,"FromInteger");function CWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);{let r=t.allOf.reduce((n,o)=>{let s=NT(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,sWa.Check)(t,e,r))throw new Vb(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(CWa,"FromIntersect");function bWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):(function*(){})()}a(bWa,"FromIterator");function SWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):t.const}a(SWa,"FromLiteral");function TWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);throw new Vb(t,"Never types cannot be created. Consider using a default value.")}a(TWa,"FromNever");function IWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);throw new Vb(t,"Not types must have a default value")}a(IWa,"FromNot");function xWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):null}a(xWa,"FromNull");function wWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):t.minimum!==void 0?t.minimum:0}a(wWa,"FromNumber");function RWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=NT(s,e));return n}}a(RWa,"FromObject");function PWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):Promise.resolve(NT(t.item,e))}a(PWa,"FromPromise");function kWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):{}}a(kWa,"FromRecord");function DWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):NT((0,tIr.Deref)(t,e),e)}a(DWa,"FromRef");function NWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);throw new Vb(t,"RegExp types cannot be created. Consider using a default value.")}a(NWa,"FromRegExp");function MWa(t,e){if(t.pattern!==void 0){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);throw new Vb(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);throw new Vb(t,"String types with formats must specify a default value")}else return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(MWa,"FromString");function OWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(OWa,"FromSymbol");function BWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);if(!(0,CPi.IsTemplateLiteralFinite)(t))throw new Vb(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,CPi.TemplateLiteralGenerate)(t)[0]}a(BWa,"FromTemplateLiteral");function LWa(t,e){if(SPi++>$Wa)throw new Vb(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):NT((0,tIr.Deref)(t,e),e)}a(LWa,"FromThis");function FWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>NT(t.items[n],e))}a(FWa,"FromTuple");function UWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default)}a(UWa,"FromUndefined");function QWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return NT(t.anyOf[0],e)}a(QWa,"FromUnion");function qWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(qWa,"FromUint8Array");function jWa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ya(t.default):{}}a(jWa,"FromUnknown");function HWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default)}a(HWa,"FromVoid");function GWa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ya(t.default);throw new Error("User defined types must specify a default value")}a(GWa,"FromKind");function NT(t,e){let r=(0,tIr.Pushref)(t,e),n=t;switch(n[bPi.Kind]){case"Any":return dWa(n,r);case"Argument":return fWa(n,r);case"Array":return pWa(n,r);case"AsyncIterator":return hWa(n,r);case"BigInt":return mWa(n,r);case"Boolean":return gWa(n,r);case"Constructor":return AWa(n,r);case"Date":return yWa(n,r);case"Function":return EWa(n,r);case"Import":return _Wa(n,r);case"Integer":return vWa(n,r);case"Intersect":return CWa(n,r);case"Iterator":return bWa(n,r);case"Literal":return SWa(n,r);case"Never":return TWa(n,r);case"Not":return IWa(n,r);case"Null":return xWa(n,r);case"Number":return wWa(n,r);case"Object":return RWa(n,r);case"Promise":return PWa(n,r);case"Record":return kWa(n,r);case"Ref":return DWa(n,r);case"RegExp":return NWa(n,r);case"String":return MWa(n,r);case"Symbol":return OWa(n,r);case"TemplateLiteral":return BWa(n,r);case"This":return LWa(n,r);case"Tuple":return FWa(n,r);case"Undefined":return UWa(n,r);case"Union":return QWa(n,r);case"Uint8Array":return qWa(n,r);case"Unknown":return jWa(n,r);case"Void":return HWa(n,r);default:if(!cWa.TypeRegistry.Has(n[bPi.Kind]))throw new Vb(n,"Unknown type");return GWa(n,r)}}a(NT,"Visit");var $Wa=512,SPi=0;function VWa(...t){return SPi=0,t.length===2?NT(t[0],t[1]):NT(t[0],[])}a(VWa,"Create")});var Fgt=I($te=>{"use strict";p();var WWa=$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]})),zWa=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WWa(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});zWa(TPi(),$te)});var RPi=I(XOe=>{"use strict";p();Object.defineProperty(XOe,"__esModule",{value:!0});XOe.ValueCastError=void 0;XOe.Cast=wPi;var lR=pm(),YWa=bf(),Ugt=_n(),DG=Fgt(),MT=DT(),Vte=aD(),ZOe=oD(),JOe=class extends YWa.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};XOe.ValueCastError=JOe;function IPi(t,e,r){if(t[Ugt.Kind]==="Object"&&typeof r=="object"&&!(0,lR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[Ugt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,MT.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[Ugt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,ZOe.Deref)(s,e)).map(s=>IPi(s,e,r));return Math.max(...o)}else return(0,MT.Check)(t,e,r)?1:0}a(IPi,"ScoreUnion");function KWa(t,e,r){let n=t.anyOf.map(c=>(0,ZOe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=IPi(c,e,r);l>s&&(o=c,s=l)}return o}a(KWa,"SelectUnion");function JWa(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,Vte.Clone)(t.default);{let n=KWa(t,e,r);return wPi(n,e,r)}}a(JWa,"CastUnion");function ZWa(t,e,r){return(0,MT.Check)(t,e,r)?(0,Vte.Clone)(r):(0,DG.Create)(t,e)}a(ZWa,"DefaultClone");function XWa(t,e,r){return(0,MT.Check)(t,e,r)?r:(0,DG.Create)(t,e)}a(XWa,"Default");function eza(t,e,r){if((0,MT.Check)(t,e,r))return(0,Vte.Clone)(r);let n=(0,lR.IsArray)(r)?(0,Vte.Clone)(r):(0,DG.Create)(t,e),o=(0,lR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,lR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>cD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,MT.Check)(t,e,l))throw new JOe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(eza,"FromArray");function tza(t,e,r){if((0,MT.Check)(t,e,r))return(0,DG.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]=cD(c,e,r.prototype[s]));return o}a(tza,"FromConstructor");function rza(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return cD(o,[...e,...n],r)}a(rza,"FromImport");function xPi(t,e){return(0,lR.IsObject)(t)&&!(0,lR.IsObject)(e)||!(0,lR.IsObject)(t)&&(0,lR.IsObject)(e)?t:!(0,lR.IsObject)(t)||!(0,lR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?xPi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(xPi,"IntersectAssign");function nza(t,e,r){if((0,MT.Check)(t,e,r))return r;let n=(0,DG.Create)(t,e),o=xPi(n,r);return(0,MT.Check)(t,e,o)?o:n}a(nza,"FromIntersect");function iza(t,e,r){throw new JOe(t,"Never types cannot be cast")}a(iza,"FromNever");function oza(t,e,r){if((0,MT.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,DG.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]=cD(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]=cD(t.additionalProperties,e,r[c]))}return o}a(oza,"FromObject");function sza(t,e,r){if((0,MT.Check)(t,e,r))return(0,Vte.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,DG.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]=cD(o,e,l);return s}a(sza,"FromRecord");function aza(t,e,r){return cD((0,ZOe.Deref)(t,e),e,r)}a(aza,"FromRef");function cza(t,e,r){return cD((0,ZOe.Deref)(t,e),e,r)}a(cza,"FromThis");function lza(t,e,r){return(0,MT.Check)(t,e,r)?(0,Vte.Clone)(r):(0,lR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>cD(n,e,r[o])):(0,DG.Create)(t,e)}a(lza,"FromTuple");function uza(t,e,r){return(0,MT.Check)(t,e,r)?(0,Vte.Clone)(r):JWa(t,e,r)}a(uza,"FromUnion");function cD(t,e,r){let n=(0,lR.IsString)(t.$id)?(0,ZOe.Pushref)(t,e):e,o=t;switch(t[Ugt.Kind]){case"Array":return eza(o,n,r);case"Constructor":return tza(o,n,r);case"Import":return rza(o,n,r);case"Intersect":return nza(o,n,r);case"Never":return iza(o,n,r);case"Object":return oza(o,n,r);case"Record":return sza(o,n,r);case"Ref":return aza(o,n,r);case"This":return cza(o,n,r);case"Tuple":return lza(o,n,r);case"Union":return uza(o,n,r);case"Date":case"Symbol":case"Uint8Array":return ZWa(t,e,r);default:return XWa(o,n,r)}}a(cD,"Visit");function wPi(...t){return t.length===3?cD(t[0],t[1],t[2]):cD(t[0],[],t[1])}a(wPi,"Cast")});var Qgt=I(Wte=>{"use strict";p();var dza=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]})),fza=Wte&&Wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dza(e,t,r)};Object.defineProperty(Wte,"__esModule",{value:!0});fza(RPi(),Wte)});var kPi=I(nIr=>{"use strict";p();Object.defineProperty(nIr,"__esModule",{value:!0});nIr.Clean=Tza;var pza=N2(),qgt=DT(),hza=aD(),rIr=oD(),PPi=_n(),lD=pm(),jgt=hs();function mza(t){return(0,jgt.IsKind)(t)&&t[PPi.Kind]!=="Unsafe"}a(mza,"IsCheckable");function gza(t,e,r){return(0,lD.IsArray)(r)?r.map(n=>Wb(t.items,e,n)):r}a(gza,"FromArray");function Aza(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Wb(o,[...e,...n],r)}a(Aza,"FromImport");function yza(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>Wb(l,e,(0,hza.Clone)(r))).reduce((l,u)=>(0,lD.IsObject)(u)?{...l,...u}:u,{});if(!(0,lD.IsObject)(r)||!(0,lD.IsObject)(s)||!(0,jgt.IsKind)(n))return s;let c=(0,pza.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,qgt.Check)(n,e,r[l])&&(s[l]=Wb(n,e,r[l]));return s}a(yza,"FromIntersect");function Eza(t,e,r){if(!(0,lD.IsObject)(r)||(0,lD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,lD.HasPropertyKey)(t.properties,o)){r[o]=Wb(t.properties[o],e,r[o]);continue}if((0,jgt.IsKind)(n)&&(0,qgt.Check)(n,e,r[o])){r[o]=Wb(n,e,r[o]);continue}delete r[o]}return r}a(Eza,"FromObject");function _za(t,e,r){if(!(0,lD.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]=Wb(c,e,r[u]);continue}if((0,jgt.IsKind)(n)&&(0,qgt.Check)(n,e,r[u])){r[u]=Wb(n,e,r[u]);continue}delete r[u]}return r}a(_za,"FromRecord");function vza(t,e,r){return Wb((0,rIr.Deref)(t,e),e,r)}a(vza,"FromRef");function Cza(t,e,r){return Wb((0,rIr.Deref)(t,e),e,r)}a(Cza,"FromThis");function bza(t,e,r){if(!(0,lD.IsArray)(r))return r;if((0,lD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(bza,"FromTuple");function Sza(t,e,r){for(let n of t.anyOf)if(mza(n)&&(0,qgt.Check)(n,e,r))return Wb(n,e,r);return r}a(Sza,"FromUnion");function Wb(t,e,r){let n=(0,lD.IsString)(t.$id)?(0,rIr.Pushref)(t,e):e,o=t;switch(o[PPi.Kind]){case"Array":return gza(o,n,r);case"Import":return Aza(o,n,r);case"Intersect":return yza(o,n,r);case"Object":return Eza(o,n,r);case"Record":return _za(o,n,r);case"Ref":return vza(o,n,r);case"This":return Cza(o,n,r);case"Tuple":return bza(o,n,r);case"Union":return Sza(o,n,r);default:return r}}a(Wb,"Visit");function Tza(...t){return t.length===3?Wb(t[0],t[1],t[2]):Wb(t[0],[],t[1])}a(Tza,"Clean")});var Hgt=I(zte=>{"use strict";p();var Iza=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]})),xza=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Iza(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});xza(kPi(),zte)});var BPi=I(oIr=>{"use strict";p();Object.defineProperty(oIr,"__esModule",{value:!0});oIr.Convert=uYa;var wza=aD(),DPi=DT(),iIr=oD(),Rza=_n(),Ma=pm();function Ggt(t){return(0,Ma.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(Ggt,"IsStringNumeric");function Pza(t){return(0,Ma.IsBigInt)(t)||(0,Ma.IsBoolean)(t)||(0,Ma.IsNumber)(t)}a(Pza,"IsValueToString");function e5e(t){return t===!0||(0,Ma.IsNumber)(t)&&t===1||(0,Ma.IsBigInt)(t)&&t===BigInt("1")||(0,Ma.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(e5e,"IsValueTrue");function t5e(t){return t===!1||(0,Ma.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Ma.IsBigInt)(t)&&t===BigInt("0")||(0,Ma.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(t5e,"IsValueFalse");function kza(t){return(0,Ma.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(kza,"IsTimeStringWithTimeZone");function Dza(t){return(0,Ma.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Dza,"IsTimeStringWithoutTimeZone");function Nza(t){return(0,Ma.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(Nza,"IsDateTimeStringWithTimeZone");function Mza(t){return(0,Ma.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(Mza,"IsDateTimeStringWithoutTimeZone");function Oza(t){return(0,Ma.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Oza,"IsDateString");function Bza(t,e){let r=MPi(t);return r===e?r:t}a(Bza,"TryConvertLiteralString");function Lza(t,e){let r=OPi(t);return r===e?r:t}a(Lza,"TryConvertLiteralNumber");function Fza(t,e){let r=NPi(t);return r===e?r:t}a(Fza,"TryConvertLiteralBoolean");function Uza(t,e){return(0,Ma.IsString)(t.const)?Bza(e,t.const):(0,Ma.IsNumber)(t.const)?Lza(e,t.const):(0,Ma.IsBoolean)(t.const)?Fza(e,t.const):e}a(Uza,"TryConvertLiteral");function NPi(t){return e5e(t)?!0:t5e(t)?!1:t}a(NPi,"TryConvertBoolean");function Qza(t){let e=a(r=>r.split(".")[0],"truncateInteger");return Ggt(t)?BigInt(e(t)):(0,Ma.IsNumber)(t)?BigInt(Math.trunc(t)):t5e(t)?BigInt(0):e5e(t)?BigInt(1):t}a(Qza,"TryConvertBigInt");function MPi(t){return(0,Ma.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Pza(t)?t.toString():t}a(MPi,"TryConvertString");function OPi(t){return Ggt(t)?parseFloat(t):e5e(t)?1:t5e(t)?0:t}a(OPi,"TryConvertNumber");function qza(t){return Ggt(t)?parseInt(t):(0,Ma.IsNumber)(t)?Math.trunc(t):e5e(t)?1:t5e(t)?0:t}a(qza,"TryConvertInteger");function jza(t){return(0,Ma.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(jza,"TryConvertNull");function Hza(t){return(0,Ma.IsString)(t)&&t==="undefined"?void 0:t}a(Hza,"TryConvertUndefined");function Gza(t){return(0,Ma.IsDate)(t)?t:(0,Ma.IsNumber)(t)?new Date(t):e5e(t)?new Date(1):t5e(t)?new Date(0):Ggt(t)?new Date(parseInt(t)):Dza(t)?new Date(`1970-01-01T${t}.000Z`):kza(t)?new Date(`1970-01-01T${t}`):Mza(t)?new Date(`${t}.000Z`):Nza(t)?new Date(t):Oza(t)?new Date(`${t}T00:00:00.000Z`):t}a(Gza,"TryConvertDate");function $za(t,e,r){return((0,Ma.IsArray)(r)?r:[r]).map(o=>uD(t.items,e,o))}a($za,"FromArray");function Vza(t,e,r){return Qza(r)}a(Vza,"FromBigInt");function Wza(t,e,r){return NPi(r)}a(Wza,"FromBoolean");function zza(t,e,r){return Gza(r)}a(zza,"FromDate");function Yza(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return uD(o,[...e,...n],r)}a(Yza,"FromImport");function Kza(t,e,r){return qza(r)}a(Kza,"FromInteger");function Jza(t,e,r){return t.allOf.reduce((n,o)=>uD(o,e,n),r)}a(Jza,"FromIntersect");function Zza(t,e,r){return Uza(t,r)}a(Zza,"FromLiteral");function Xza(t,e,r){return jza(r)}a(Xza,"FromNull");function eYa(t,e,r){return OPi(r)}a(eYa,"FromNumber");function tYa(t,e,r){if(!(0,Ma.IsObject)(r)||(0,Ma.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Ma.HasPropertyKey)(r,n)&&(r[n]=uD(t.properties[n],e,r[n]));return r}a(tYa,"FromObject");function rYa(t,e,r){if(!((0,Ma.IsObject)(r)&&!(0,Ma.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]=uD(s,e,l);return r}a(rYa,"FromRecord");function nYa(t,e,r){return uD((0,iIr.Deref)(t,e),e,r)}a(nYa,"FromRef");function iYa(t,e,r){return MPi(r)}a(iYa,"FromString");function oYa(t,e,r){return(0,Ma.IsString)(r)||(0,Ma.IsNumber)(r)?Symbol(r):r}a(oYa,"FromSymbol");function sYa(t,e,r){return uD((0,iIr.Deref)(t,e),e,r)}a(sYa,"FromThis");function aYa(t,e,r){return(0,Ma.IsArray)(r)&&!(0,Ma.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var dYa=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]})),fYa=Yte&&Yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dYa(e,t,r)};Object.defineProperty(Yte,"__esModule",{value:!0});fYa(BPi(),Yte)});var QPi=I(Kte=>{"use strict";p();Object.defineProperty(Kte,"__esModule",{value:!0});Kte.TransformDecodeError=Kte.TransformDecodeCheckError=void 0;Kte.TransformDecode=TYa;var pYa=yMe(),LPi=_n(),FPi=bf(),UPi=N2(),aIr=oD(),hYa=DT(),H8=pm(),r5e=hs(),sIr=class extends FPi.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}};Kte.TransformDecodeCheckError=sIr;var Vgt=class extends FPi.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}};Kte.TransformDecodeError=Vgt;function Ud(t,e,r){try{return(0,r5e.IsTransform)(t)?t[LPi.TransformKind].Decode(r):r}catch(n){throw new Vgt(t,e,r,n)}}a(Ud,"Default");function mYa(t,e,r,n){return(0,H8.IsArray)(n)?Ud(t,r,n.map((o,s)=>dD(t.items,e,`${r}/${s}`,o))):Ud(t,r,n)}a(mYa,"FromArray");function gYa(t,e,r,n){if(!(0,H8.IsObject)(n)||(0,H8.IsValueType)(n))return Ud(t,r,n);let o=(0,UPi.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=dD(h,e,`${r}/${f}`,c[f]));if(!(0,r5e.IsTransform)(t.unevaluatedProperties))return Ud(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Ud(u,`${r}/${f}`,d[f]));return Ud(t,r,d)}a(gYa,"FromIntersect");function AYa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=dD(s,[...e,...o],r,n);return Ud(t,r,c)}a(AYa,"FromImport");function yYa(t,e,r,n){return Ud(t,r,dD(t.not,e,r,n))}a(yYa,"FromNot");function EYa(t,e,r,n){if(!(0,H8.IsObject)(n))return Ud(t,r,n);let o=(0,UPi.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,H8.HasPropertyKey)(s,d)&&((0,H8.IsUndefined)(s[d])&&(!(0,r5e.IsUndefined)(t.properties[d])||pYa.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=dD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,r5e.IsSchema)(t.additionalProperties))return Ud(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Ud(l,`${r}/${d}`,u[d]));return Ud(t,r,u)}a(EYa,"FromObject");function _Ya(t,e,r,n){if(!(0,H8.IsObject)(n))return Ud(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]=dD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,r5e.IsSchema)(t.additionalProperties))return Ud(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Ud(u,`${r}/${f}`,d[f]));return Ud(t,r,d)}a(_Ya,"FromRecord");function vYa(t,e,r,n){let o=(0,aIr.Deref)(t,e);return Ud(t,r,dD(o,e,r,n))}a(vYa,"FromRef");function CYa(t,e,r,n){let o=(0,aIr.Deref)(t,e);return Ud(t,r,dD(o,e,r,n))}a(CYa,"FromThis");function bYa(t,e,r,n){return(0,H8.IsArray)(n)&&(0,H8.IsArray)(t.items)?Ud(t,r,t.items.map((o,s)=>dD(o,e,`${r}/${s}`,n[s]))):Ud(t,r,n)}a(bYa,"FromTuple");function SYa(t,e,r,n){for(let o of t.anyOf){if(!(0,hYa.Check)(o,e,n))continue;let s=dD(o,e,r,n);return Ud(t,r,s)}return Ud(t,r,n)}a(SYa,"FromUnion");function dD(t,e,r,n){let o=(0,aIr.Pushref)(t,e),s=t;switch(t[LPi.Kind]){case"Array":return mYa(s,o,r,n);case"Import":return AYa(s,o,r,n);case"Intersect":return gYa(s,o,r,n);case"Not":return yYa(s,o,r,n);case"Object":return EYa(s,o,r,n);case"Record":return _Ya(s,o,r,n);case"Ref":return vYa(s,o,r,n);case"Symbol":return Ud(s,r,n);case"This":return CYa(s,o,r,n);case"Tuple":return bYa(s,o,r,n);case"Union":return SYa(s,o,r,n);default:return Ud(s,r,n)}}a(dD,"Visit");function TYa(t,e,r){return dD(t,e,"",r)}a(TYa,"TransformDecode")});var $Pi=I(Jte=>{"use strict";p();Object.defineProperty(Jte,"__esModule",{value:!0});Jte.TransformEncodeError=Jte.TransformEncodeCheckError=void 0;Jte.TransformEncode=LYa;var IYa=yMe(),jPi=_n(),HPi=bf(),GPi=N2(),lIr=oD(),qPi=DT(),NG=pm(),n5e=hs(),cIr=class extends HPi.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}};Jte.TransformEncodeCheckError=cIr;var Wgt=class extends HPi.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}};Jte.TransformEncodeError=Wgt;function ny(t,e,r){try{return(0,n5e.IsTransform)(t)?t[jPi.TransformKind].Encode(r):r}catch(n){throw new Wgt(t,e,r,n)}}a(ny,"Default");function xYa(t,e,r,n){let o=ny(t,r,n);return(0,NG.IsArray)(o)?o.map((s,c)=>fD(t.items,e,`${r}/${c}`,s)):o}a(xYa,"FromArray");function wYa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=ny(t,r,n);return fD(s,[...e,...o],r,c)}a(wYa,"FromImport");function RYa(t,e,r,n){let o=ny(t,r,n);if(!(0,NG.IsObject)(n)||(0,NG.IsValueType)(n))return o;let s=(0,GPi.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=fD(m,e,`${r}/${h}`,l[h]));if(!(0,n5e.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]=ny(d,`${r}/${h}`,f[h]));return f}a(RYa,"FromIntersect");function PYa(t,e,r,n){return ny(t.not,r,ny(t,r,n))}a(PYa,"FromNot");function kYa(t,e,r,n){let o=ny(t,r,n);if(!(0,NG.IsObject)(o))return o;let s=(0,GPi.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,NG.HasPropertyKey)(c,f)&&((0,NG.IsUndefined)(c[f])&&(!(0,n5e.IsUndefined)(t.properties[f])||IYa.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=fD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,n5e.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]=ny(u,`${r}/${f}`,d[f]));return d}a(kYa,"FromObject");function DYa(t,e,r,n){let o=ny(t,r,n);if(!(0,NG.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]=fD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,n5e.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]=ny(d,`${r}/${h}`,f[h]));return f}a(DYa,"FromRecord");function NYa(t,e,r,n){let o=(0,lIr.Deref)(t,e),s=fD(o,e,r,n);return ny(t,r,s)}a(NYa,"FromRef");function MYa(t,e,r,n){let o=(0,lIr.Deref)(t,e),s=fD(o,e,r,n);return ny(t,r,s)}a(MYa,"FromThis");function OYa(t,e,r,n){let o=ny(t,r,n);return(0,NG.IsArray)(t.items)?t.items.map((s,c)=>fD(s,e,`${r}/${c}`,o[c])):[]}a(OYa,"FromTuple");function BYa(t,e,r,n){for(let o of t.anyOf){if(!(0,qPi.Check)(o,e,n))continue;let s=fD(o,e,r,n);return ny(t,r,s)}for(let o of t.anyOf){let s=fD(o,e,r,n);if((0,qPi.Check)(t,e,s))return ny(t,r,s)}return ny(t,r,n)}a(BYa,"FromUnion");function fD(t,e,r,n){let o=(0,lIr.Pushref)(t,e),s=t;switch(t[jPi.Kind]){case"Array":return xYa(s,o,r,n);case"Import":return wYa(s,o,r,n);case"Intersect":return RYa(s,o,r,n);case"Not":return PYa(s,o,r,n);case"Object":return kYa(s,o,r,n);case"Record":return DYa(s,o,r,n);case"Ref":return NYa(s,o,r,n);case"This":return MYa(s,o,r,n);case"Tuple":return OYa(s,o,r,n);case"Union":return BYa(s,o,r,n);default:return ny(s,r,n)}}a(fD,"Visit");function LYa(t,e,r){return fD(t,e,"",r)}a(LYa,"TransformEncode")});var VPi=I(fIr=>{"use strict";p();Object.defineProperty(fIr,"__esModule",{value:!0});fIr.HasTransform=tKa;var dIr=oD(),FYa=_n(),g0=hs(),UYa=pm();function QYa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(QYa,"FromArray");function qYa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(qYa,"FromAsyncIterator");function jYa(t,e){return(0,g0.IsTransform)(t)||gm(t.returns,e)||t.parameters.some(r=>gm(r,e))}a(jYa,"FromConstructor");function HYa(t,e){return(0,g0.IsTransform)(t)||gm(t.returns,e)||t.parameters.some(r=>gm(r,e))}a(HYa,"FromFunction");function GYa(t,e){return(0,g0.IsTransform)(t)||(0,g0.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>gm(r,e))}a(GYa,"FromIntersect");function $Ya(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,g0.IsTransform)(t)||gm(n,[...r,...e])}a($Ya,"FromImport");function VYa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(VYa,"FromIterator");function WYa(t,e){return(0,g0.IsTransform)(t)||gm(t.not,e)}a(WYa,"FromNot");function zYa(t,e){return(0,g0.IsTransform)(t)||Object.values(t.properties).some(r=>gm(r,e))||(0,g0.IsSchema)(t.additionalProperties)&&gm(t.additionalProperties,e)}a(zYa,"FromObject");function YYa(t,e){return(0,g0.IsTransform)(t)||gm(t.item,e)}a(YYa,"FromPromise");function KYa(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,g0.IsTransform)(t)||gm(n,e)||(0,g0.IsSchema)(t.additionalProperties)&&(0,g0.IsTransform)(t.additionalProperties)}a(KYa,"FromRecord");function JYa(t,e){return(0,g0.IsTransform)(t)?!0:gm((0,dIr.Deref)(t,e),e)}a(JYa,"FromRef");function ZYa(t,e){return(0,g0.IsTransform)(t)?!0:gm((0,dIr.Deref)(t,e),e)}a(ZYa,"FromThis");function XYa(t,e){return(0,g0.IsTransform)(t)||!(0,UYa.IsUndefined)(t.items)&&t.items.some(r=>gm(r,e))}a(XYa,"FromTuple");function eKa(t,e){return(0,g0.IsTransform)(t)||t.anyOf.some(r=>gm(r,e))}a(eKa,"FromUnion");function gm(t,e){let r=(0,dIr.Pushref)(t,e),n=t;if(t.$id&&uIr.has(t.$id))return!1;switch(t.$id&&uIr.add(t.$id),t[FYa.Kind]){case"Array":return QYa(n,r);case"AsyncIterator":return qYa(n,r);case"Constructor":return jYa(n,r);case"Function":return HYa(n,r);case"Import":return $Ya(n,r);case"Intersect":return GYa(n,r);case"Iterator":return VYa(n,r);case"Not":return WYa(n,r);case"Object":return zYa(n,r);case"Promise":return YYa(n,r);case"Record":return KYa(n,r);case"Ref":return JYa(n,r);case"This":return ZYa(n,r);case"Tuple":return XYa(n,r);case"Union":return eKa(n,r);default:return(0,g0.IsTransform)(t)}}a(gm,"Visit");var uIr=new Set;function tKa(t,e){return uIr.clear(),gm(t,e)}a(tKa,"HasTransform")});var i5e=I(G8=>{"use strict";p();var rKa=G8&&G8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pIr=G8&&G8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rKa(e,t,r)};Object.defineProperty(G8,"__esModule",{value:!0});pIr(QPi(),G8);pIr($Pi(),G8);pIr(VPi(),G8)});var WPi=I(mIr=>{"use strict";p();Object.defineProperty(mIr,"__esModule",{value:!0});mIr.Decode=oKa;var hIr=i5e(),nKa=DT(),iKa=Jme();function oKa(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,nKa.Check)(e,r,n))throw new hIr.TransformDecodeCheckError(e,n,(0,iKa.Errors)(e,r,n).First());return(0,hIr.HasTransform)(e,r)?(0,hIr.TransformDecode)(e,r,n):n}a(oKa,"Decode")});var gIr=I(Zte=>{"use strict";p();var sKa=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]})),aKa=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sKa(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});aKa(WPi(),Zte)});var YPi=I(EIr=>{"use strict";p();Object.defineProperty(EIr,"__esModule",{value:!0});EIr.Default=vKa;var cKa=DT(),zPi=aD(),yIr=oD(),lKa=_n(),zb=pm(),uKa=hs();function $8(t,e){let r=(0,zb.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,zb.IsFunction)(r)?r():(0,zPi.Clone)(r);return(0,zb.IsUndefined)(e)?n:(0,zb.IsObject)(e)&&(0,zb.IsObject)(n)?Object.assign(n,e):e}a($8,"ValueOrDefault");function AIr(t){return(0,uKa.IsKind)(t)&&"default"in t}a(AIr,"HasDefaultProperty");function dKa(t,e,r){if((0,zb.IsArray)(r)){for(let o=0;o{let c=mv(s,e,n);return(0,zb.IsObject)(c)?{...o,...c}:c},{})}a(hKa,"FromIntersect");function mKa(t,e,r){let n=$8(t,r);if(!(0,zb.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=mv(t.properties[s],e,n[s]);(0,zb.IsUndefined)(c)||(n[s]=mv(t.properties[s],e,n[s]))}if(!AIr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=mv(t.additionalProperties,e,n[s]));return n}a(mKa,"FromObject");function gKa(t,e,r){let n=$8(t,r);if(!(0,zb.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)&&AIr(c)&&(n[u]=mv(c,e,n[u]));if(!AIr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=mv(o,e,n[u]));return n}a(gKa,"FromRecord");function AKa(t,e,r){return mv((0,yIr.Deref)(t,e),e,$8(t,r))}a(AKa,"FromRef");function yKa(t,e,r){return mv((0,yIr.Deref)(t,e),e,r)}a(yKa,"FromThis");function EKa(t,e,r){let n=$8(t,r);if(!(0,zb.IsArray)(n)||(0,zb.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 CKa=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]})),bKa=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CKa(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});bKa(YPi(),Xte)});var ZPi=I(pD=>{"use strict";p();Object.defineProperty(pD,"__esModule",{value:!0});pD.ValuePointerRootDeleteError=pD.ValuePointerRootSetError=void 0;pD.Format=o5e;pD.Set=SKa;pD.Delete=TKa;pD.Has=IKa;pD.Get=xKa;var JPi=bf(),Ygt=class extends JPi.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};pD.ValuePointerRootSetError=Ygt;var Kgt=class extends JPi.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};pD.ValuePointerRootDeleteError=Kgt;function KPi(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(KPi,"Escape");function*o5e(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var wKa=A4&&A4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RKa=A4&&A4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PKa=A4&&A4.__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(_Ir,"__esModule",{value:!0});_Ir.Equal=Zgt;var V8=pm();function kKa(t,e){if(!(0,V8.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=>Zgt(t[o],e[o]))}a(kKa,"ObjectType");function DKa(t,e){return(0,V8.IsDate)(e)&&t.getTime()===e.getTime()}a(DKa,"DateType");function NKa(t,e){return!(0,V8.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>Zgt(r,e[n]))}a(NKa,"ArrayType");function MKa(t,e){return!(0,V8.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>Zgt(r,e[n]))}a(MKa,"TypedArrayType");function OKa(t,e){return t===e}a(OKa,"ValueType");function Zgt(t,e){if((0,V8.IsDate)(t))return DKa(t,e);if((0,V8.IsTypedArray)(t))return MKa(t,e);if((0,V8.IsArray)(t))return NKa(t,e);if((0,V8.IsObject)(t))return kKa(t,e);if((0,V8.IsValueType)(t))return OKa(t,e);throw new Error("ValueEquals: Unable to compare value")}a(Zgt,"Equal")});var nki=I(iy=>{"use strict";p();Object.defineProperty(iy,"__esModule",{value:!0});iy.ValueDiffError=iy.Edit=iy.Delete=iy.Update=iy.Insert=void 0;iy.Diff=HKa;iy.Patch=VKa;var y4=pm(),CIr=Jgt(),bIr=aD(),BKa=vIr(),LKa=bf(),SIr=CE(),TIr=av(),IIr=HH(),eki=YH(),FKa=gp();iy.Insert=(0,TIr.Object)({type:(0,SIr.Literal)("insert"),path:(0,IIr.String)(),value:(0,eki.Unknown)()});iy.Update=(0,TIr.Object)({type:(0,SIr.Literal)("update"),path:(0,IIr.String)(),value:(0,eki.Unknown)()});iy.Delete=(0,TIr.Object)({type:(0,SIr.Literal)("delete"),path:(0,IIr.String)()});iy.Edit=(0,FKa.Union)([iy.Insert,iy.Update,iy.Delete]);var s5e=class extends LKa.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};iy.ValueDiffError=s5e;function Xgt(t,e){return{type:"update",path:t,value:e}}a(Xgt,"CreateUpdate");function tki(t,e){return{type:"insert",path:t,value:e}}a(tki,"CreateInsert");function rki(t){return{type:"delete",path:t}}a(rki,"CreateDelete");function XPi(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new s5e(t,"Cannot diff objects with symbols")}a(XPi,"AssertDiffable");function*UKa(t,e,r){if(XPi(e),XPi(r),!(0,y4.IsStandardObject)(r))return yield Xgt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,y4.HasPropertyKey)(e,s)||(yield tki(`${t}/${s}`,r[s]));for(let s of n)(0,y4.HasPropertyKey)(r,s)&&((0,BKa.Equal)(e,r)||(yield*eAt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,y4.HasPropertyKey)(r,s)||(yield rki(`${t}/${s}`))}a(UKa,"ObjectType");function*QKa(t,e,r){if(!(0,y4.IsArray)(r))return yield Xgt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(GKa,"IsRootUpdate");function $Ka(t){return t.length===0}a($Ka,"IsIdentity");function VKa(t,e){if(GKa(e))return(0,bIr.Clone)(e[0].value);if($Ka(e))return(0,bIr.Clone)(t);let r=(0,bIr.Clone)(t);for(let n of e)switch(n.type){case"insert":{CIr.ValuePointer.Set(r,n.path,n.value);break}case"update":{CIr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{CIr.ValuePointer.Delete(r,n.path);break}}return r}a(VKa,"Patch")});var xIr=I(ere=>{"use strict";p();var WKa=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]})),zKa=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WKa(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});zKa(nki(),ere)});var iki=I(RIr=>{"use strict";p();Object.defineProperty(RIr,"__esModule",{value:!0});RIr.Encode=JKa;var wIr=i5e(),YKa=DT(),KKa=Jme();function JKa(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,wIr.HasTransform)(e,r)?(0,wIr.TransformEncode)(e,r,n):n;if(!(0,YKa.Check)(e,r,o))throw new wIr.TransformEncodeCheckError(e,o,(0,KKa.Errors)(e,r,o).First());return o}a(JKa,"Encode")});var PIr=I(tre=>{"use strict";p();var ZKa=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]})),XKa=tre&&tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZKa(e,t,r)};Object.defineProperty(tre,"__esModule",{value:!0});XKa(iki(),tre)});var kIr=I(rre=>{"use strict";p();var eJa=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]})),tJa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eJa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});tJa(vIr(),rre)});var ski=I(c5e=>{"use strict";p();Object.defineProperty(c5e,"__esModule",{value:!0});c5e.ValueMutateError=void 0;c5e.Mutate=cJa;var hD=pm(),rAt=Jgt(),DIr=aD(),rJa=bf();function tAt(t){return(0,hD.IsObject)(t)&&!(0,hD.IsArray)(t)}a(tAt,"IsStandardObject");var a5e=class extends rJa.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};c5e.ValueMutateError=a5e;function nJa(t,e,r,n){if(!tAt(r))rAt.ValuePointer.Set(t,e,(0,DIr.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)NIr(t,`${e}/${c}`,r[c],n[c])}}a(nJa,"ObjectType");function iJa(t,e,r,n){if(!(0,hD.IsArray)(r))rAt.ValuePointer.Set(t,e,(0,DIr.Clone)(n));else{for(let o=0;o{"use strict";p();var lJa=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]})),uJa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lJa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});uJa(ski(),nre)});var cki=I(mD=>{"use strict";p();Object.defineProperty(mD,"__esModule",{value:!0});mD.ParseDefault=mD.ParseRegistry=mD.ParseError=void 0;mD.Parse=EJa;var dJa=bf(),nAt=i5e(),fJa=Lgt(),pJa=Qgt(),hJa=Hgt(),mJa=aD(),gJa=$gt(),AJa=zgt(),aki=pm(),l5e=class extends dJa.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};mD.ParseError=l5e;var OIr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,fJa.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,pJa.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,hJa.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,mJa.Clone)(l)],["Convert",(s,c,l)=>(0,gJa.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,nAt.HasTransform)(s,c)?(0,nAt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,AJa.Default)(s,c,l)],["Encode",(s,c,l)=>(0,nAt.HasTransform)(s,c)?(0,nAt.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})(OIr||(mD.ParseRegistry=OIr={}));mD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function yJa(t,e,r,n){return t.reduce((o,s)=>{let c=OIr.Get(s);if((0,aki.IsUndefined)(c))throw new l5e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(yJa,"ParseValue");function EJa(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,aki.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[mD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[mD.ParseDefault,t[0],[],t[1]]:(()=>{throw new l5e("Invalid Arguments")})();return yJa(e,r,n,o)}a(EJa,"Parse")});var BIr=I(ire=>{"use strict";p();var _Ja=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]})),vJa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ja(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});vJa(cki(),ire)});var uki=I(ms=>{"use strict";p();Object.defineProperty(ms,"__esModule",{value:!0});ms.Parse=ms.Mutate=ms.Hash=ms.Equal=ms.Encode=ms.Edit=ms.Patch=ms.Diff=ms.Default=ms.Decode=ms.Create=ms.Convert=ms.Clone=ms.Clean=ms.Check=ms.Cast=ms.Assert=ms.ValueErrorIterator=ms.Errors=void 0;var lki=Jme();Object.defineProperty(ms,"Errors",{enumerable:!0,get:a(function(){return lki.Errors},"get")});Object.defineProperty(ms,"ValueErrorIterator",{enumerable:!0,get:a(function(){return lki.ValueErrorIterator},"get")});var CJa=Lgt();Object.defineProperty(ms,"Assert",{enumerable:!0,get:a(function(){return CJa.Assert},"get")});var bJa=Qgt();Object.defineProperty(ms,"Cast",{enumerable:!0,get:a(function(){return bJa.Cast},"get")});var SJa=DT();Object.defineProperty(ms,"Check",{enumerable:!0,get:a(function(){return SJa.Check},"get")});var TJa=Hgt();Object.defineProperty(ms,"Clean",{enumerable:!0,get:a(function(){return TJa.Clean},"get")});var IJa=aD();Object.defineProperty(ms,"Clone",{enumerable:!0,get:a(function(){return IJa.Clone},"get")});var xJa=$gt();Object.defineProperty(ms,"Convert",{enumerable:!0,get:a(function(){return xJa.Convert},"get")});var wJa=Fgt();Object.defineProperty(ms,"Create",{enumerable:!0,get:a(function(){return wJa.Create},"get")});var RJa=gIr();Object.defineProperty(ms,"Decode",{enumerable:!0,get:a(function(){return RJa.Decode},"get")});var PJa=zgt();Object.defineProperty(ms,"Default",{enumerable:!0,get:a(function(){return PJa.Default},"get")});var LIr=xIr();Object.defineProperty(ms,"Diff",{enumerable:!0,get:a(function(){return LIr.Diff},"get")});Object.defineProperty(ms,"Patch",{enumerable:!0,get:a(function(){return LIr.Patch},"get")});Object.defineProperty(ms,"Edit",{enumerable:!0,get:a(function(){return LIr.Edit},"get")});var kJa=PIr();Object.defineProperty(ms,"Encode",{enumerable:!0,get:a(function(){return kJa.Encode},"get")});var DJa=kIr();Object.defineProperty(ms,"Equal",{enumerable:!0,get:a(function(){return DJa.Equal},"get")});var NJa=GOe();Object.defineProperty(ms,"Hash",{enumerable:!0,get:a(function(){return NJa.Hash},"get")});var MJa=MIr();Object.defineProperty(ms,"Mutate",{enumerable:!0,get:a(function(){return MJa.Mutate},"get")});var OJa=BIr();Object.defineProperty(ms,"Parse",{enumerable:!0,get:a(function(){return OJa.Parse},"get")})});var dki=I(E4=>{"use strict";p();var BJa=E4&&E4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LJa=E4&&E4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FJa=E4&&E4.__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=Qc&&Qc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bg=Qc&&Qc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UJa(e,t,r)};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.Value=Qc.ValueErrorIterator=Qc.ValueErrorType=void 0;var fki=Jme();Object.defineProperty(Qc,"ValueErrorType",{enumerable:!0,get:a(function(){return fki.ValueErrorType},"get")});Object.defineProperty(Qc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return fki.ValueErrorIterator},"get")});Bg(pm(),Qc);Bg(Lgt(),Qc);Bg(Qgt(),Qc);Bg(DT(),Qc);Bg(Hgt(),Qc);Bg(aD(),Qc);Bg($gt(),Qc);Bg(Fgt(),Qc);Bg(gIr(),Qc);Bg(zgt(),Qc);Bg(xIr(),Qc);Bg(PIr(),Qc);Bg(kIr(),Qc);Bg(GOe(),Qc);Bg(MIr(),Qc);Bg(BIr(),Qc);Bg(Jgt(),Qc);Bg(i5e(),Qc);var QJa=dki();Object.defineProperty(Qc,"Value",{enumerable:!0,get:a(function(){return QJa.Value},"get")})});var hki=I(iAt=>{"use strict";p();Object.defineProperty(iAt,"__esModule",{value:!0});iAt.assertShape=void 0;var pki=FIr(),qJa=a((t,e)=>{if(pki.Value.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...pki.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");iAt.assertShape=qJa});var ore={};xi(ore,{CAPIClient:()=>WJa,RequestType:()=>gki});async function $Ja(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 VJa(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 jJa,UIr,u5e,HJa,GJa,gki,WJa,sre=_e(()=>{p();jJa=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)}}},UIr=class mki{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||mki.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`}};UIr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",UIr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";u5e=UIr,HJa=`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. @@ -1099,169 +1055,169 @@ 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.`,Vtc=`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.`,GJa=`I have read and agree to the following license terms: -${$tc} -`,Q2i=(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))(Q2i||{});a(Wtc,"v");a(ztc,"_");Ytc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===Vtc&&(this._licenseCheckSucceeded=!0),this._domainService=new L5e,this._fetcherService=r??new Gtc,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(`${L5e.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${L5e.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(`${L5e.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${L5e.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(!ztc(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 Wtc(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 ey=I(_C=>{"use strict";p();Object.defineProperty(_C,"__esModule",{value:!0});_C.DestroyableStream=_C.HeadersImpl=_C.Response=_C.NO_FETCH_TELEMETRY=_C.IFetcherService=void 0;_C.jsonVerboseError=Jtc;_C.isAbortError=q2i;_C.safeGetHostname=Ztc;var Ktc=rn();_C.IFetcherService=(0,Ktc.createServiceIdentifier)("IFetcherService");_C.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var Gxr=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&&!q2i(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 qAt(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())}};_C.Response=Gxr;var $xr=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")}}};_C.HeadersImpl=$xr;var qAt=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()}};_C.DestroyableStream=qAt;async function Jtc(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` +${HJa} +`,gki=(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))(gki||{});a($Ja,"v");a(VJa,"_");WJa=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===GJa&&(this._licenseCheckSucceeded=!0),this._domainService=new u5e,this._fetcherService=r??new jJa,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(`${u5e.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${u5e.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(`${u5e.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${u5e.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(!VJa(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 $Ja(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 oy=I(gv=>{"use strict";p();Object.defineProperty(gv,"__esModule",{value:!0});gv.DestroyableStream=gv.HeadersImpl=gv.Response=gv.NO_FETCH_TELEMETRY=gv.IFetcherService=void 0;gv.jsonVerboseError=YJa;gv.isAbortError=Aki;gv.safeGetHostname=KJa;var zJa=rn();gv.IFetcherService=(0,zJa.createServiceIdentifier)("IFetcherService");gv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var QIr=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&&!Aki(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 oAt(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())}};gv.Response=QIr;var qIr=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")}}};gv.HeadersImpl=qIr;var oAt=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()}};gv.DestroyableStream=oAt;async function YJa(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(Jtc,"jsonVerboseError");function q2i(t){return t&&t.name==="AbortError"}a(q2i,"isAbortError");function Ztc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(Ztc,"safeGetHostname")});var j2i=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.INTEGRATION_ID=vge.LICENSE_AGREEMENT=void 0;vge.LICENSE_AGREEMENT=void 0;vge.INTEGRATION_ID="code-oss"});var PE=I(bge=>{"use strict";p();Object.defineProperty(bge,"__esModule",{value:!0});bge.ICAPIClientService=bge.BaseCAPIClientService=void 0;var F5e=(bre(),Ca(vre)),Xtc=rn(),erc=ey(),trc=j2i(),Vxr=class extends F5e.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()},trc.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===F5e.RequestType.Telemetry||r.type===F5e.RequestType.ChatCompletions||r.type===F5e.RequestType.ChatMessages||r.type===F5e.RequestType.ChatResponses)&&(e.callSite=erc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};bge.BaseCAPIClientService=Vxr;bge.ICAPIClientService=(0,Xtc.createServiceIdentifier)("ICAPIClientService")});var HAt=I(jAt=>{"use strict";p();Object.defineProperty(jAt,"__esModule",{value:!0});jAt.getEndpointUrl=arc;jAt.getLastKnownEndpoints=crc;var rrc=SE(),nrc=PE(),ZG=vE(),irc=tre(),orc=TG();function G2i(t){let e=t.get(nrc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(G2i,"getDefaultEndpoints");function H2i(t,e,r){if(r!==void 0&&t.get(irc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,ZG.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,ZG.getConfig)(t,n);if(o)return o}}a(H2i,"urlConfigOverride");function src(t,e){switch(e){case"proxy":return H2i(t,[ZG.ConfigKey.DebugOverrideProxyUrl,ZG.ConfigKey.DebugOverrideProxyUrlLegacy],[ZG.ConfigKey.DebugTestOverrideProxyUrl,ZG.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!ZG.BuildInfo.isProduction())return H2i(t,[ZG.ConfigKey.DebugSnippyOverrideUrl])}}a(src,"getEndpointOverrideUrl");function arc(t,e,r,...n){let o=src(t,r)??(e.endpoints?e.endpoints[r]:void 0)??G2i(t)[r];return(0,orc.joinPath)(o,...n)}a(arc,"getEndpointUrl");function crc(t){return t.get(rrc.IAuthenticationService).copilotToken?.endpoints??G2i(t)}a(crc,"getLastKnownEndpoints")});var zxr=I(U5e=>{"use strict";p();Object.defineProperty(U5e,"__esModule",{value:!0});U5e.Response=void 0;U5e.isAbortError=urc;var lrc=ey();Object.defineProperty(U5e,"Response",{enumerable:!0,get:a(function(){return lrc.Response},"get")});var Wxr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function urc(t){return!t||typeof t!="object"?!1:t instanceof Wxr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(urc,"isAbortError")});var Sge=I(Am=>{"use strict";p();var drc=Am&&Am.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),frc=Am&&Am.__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},prc=Am&&Am.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&drc(e,t,r)},Yxr=Am&&Am.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Am,"__esModule",{value:!0});Am.Fetcher=Am.CompletionsFetcher=Am.ICompletionsFetcherService=void 0;Am.isInterruptedNetworkError=Arc;prc(zxr(),Am);var $2i=Il(),hrc=ey(),mrc=gp(),grc=rn();Am.ICompletionsFetcherService=(0,grc.createServiceIdentifier)("ICompletionsFetcherService");var Kxr=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($2i.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()}};Am.CompletionsFetcher=Kxr;Am.CompletionsFetcher=Kxr=frc([Yxr(0,$2i.IConfigurationService),Yxr(1,hrc.IFetcherService),Yxr(2,mrc.IExperimentationService)],Kxr);var Jxr=class{static{a(this,"Fetcher")}getImplementation(){return this}};Am.Fetcher=Jxr;function Arc(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(Arc,"isInterruptedNetworkError")});var V2i=I(Tge=>{"use strict";p();Object.defineProperty(Tge,"__esModule",{value:!0});Tge.FeatureName=Tge.OutputPaneShowCommand=void 0;Tge.OutputPaneShowCommand="codereferencing.showOutputPane2";Tge.FeatureName="code-referencing"});var Q5e=I(GAt=>{"use strict";p();Object.defineProperty(GAt,"__esModule",{value:!0});GAt.codeReferenceLogger=void 0;var yrc=xl(),Erc=V2i();GAt.codeReferenceLogger=new yrc.Logger(Erc.FeatureName)});var Y2i=I(WAt=>{"use strict";p();Object.defineProperty(WAt,"__esModule",{value:!0});WAt.ConnectionState=void 0;var _rc=Qs(),Crc=xl(),vrc=HAt(),brc=Sge(),q5e=Q5e(),Src=3e3,Zxr=2,W2i=256,z2i=Math.log(W2i)/Math.log(Zxr)/Zxr,SD={connection:"disabled",maxAttempts:z2i,retryAttempts:0,initialWait:!1},$At,VAt=[];function Trc(){if($At)return $At;function t(_){return VAt.push(_),()=>{let v=VAt.indexOf(_);v!==-1&&VAt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of VAt)_()}a(e,"afterUpdateConnection");function r(_){SD.connection!==_&&(SD.connection=_,e())}a(r,"updateConnection");function n(){return SD.connection==="connected"}a(n,"isConnected");function o(){return SD.connection==="disconnected"}a(o,"isDisconnected");function s(){return SD.connection==="retry"}a(s,"isRetrying");function c(){return SD.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(_){SD.initialWait!==_&&(SD.initialWait=_)}a(h,"setInitialWait");function m(_,v=Src){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return SD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(Crc.ICompletionsLogTargetService),T=_.get(brc.ICompletionsFetcherService),w=_.get(_rc.IInstantiationService);q5e.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>W2i){q5e.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let k=a(async()=>{SD.retryAttempts=Math.min(SD.retryAttempts+1,z2i);try{q5e.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(vrc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{q5e.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{k()},x*1e3)}a(R,"succeedOrRetry"),q5e.codeReferenceLogger.info(b,"Attempting to reconnect."),R(Zxr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),$At={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},$At}a(Trc,"registerConnectionState");WAt.ConnectionState=Trc()});var J2i=I(Og=>{"use strict";p();Object.defineProperty(Og,"__esModule",{value:!0});Og.ErrorMessages=Og.ErrorReasons=void 0;Og.getErrorType=K2i;Og.createErrorResponse=Irc;Og.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};Og.ErrorMessages={[Og.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Og.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Og.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function K2i(t){return t===401?Og.ErrorReasons.Unauthorized:t===400?Og.ErrorReasons.BadArguments:t===404?Og.ErrorReasons.NotFound:t===429?Og.ErrorReasons.RateLimit:t>=500&&t<600?Og.ErrorReasons.InternalError:t>=600?Og.ErrorReasons.ConnectionError:Og.ErrorReasons.Unknown}a(K2i,"getErrorType");function Irc(t,e,r={}){return{kind:"failure",reason:K2i(Number(t)),code:Number(t),msg:e,meta:r}}a(Irc,"createErrorResponse")});var nwr=I(D4=>{"use strict";p();Object.defineProperty(D4,"__esModule",{value:!0});D4.NoopTelemetryReporter=D4.snippyTelemetry=D4.matchNotificationTelemetry=D4.copilotOutputLogTelemetry=void 0;var xrc=xl(),DE=Tg(),wrc=Q5e(),Rrc=/^[1-6][0-9][0-9]$/,krc=/([A-Z][a-z]+)/,Prc="code_referencing",Ige=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[Prc,this.baseKey,...e].join(".")}},Xxr=class extends Ige{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=DE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(DE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=DE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(DE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=DE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(DE.telemetry,n,r)}};D4.copilotOutputLogTelemetry=new Xxr;var ewr=class extends Ige{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=DE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(DE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=DE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(DE.telemetry,o,n)}};D4.matchNotificationTelemetry=new ewr;var twr=class extends Ige{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=DE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(DE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=DE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(DE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(Rrc)){e.invokeFunction(l=>wrc.codeReferenceLogger.debug(l.get(xrc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(krc).filter(l=>!!l).join("_").toLowerCase(),c=DE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(DE.telemetryError,this.buildKey(s,r),c)}};D4.snippyTelemetry=new twr;var rwr=class extends Ige{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};D4.NoopTelemetryReporter=rwr});var Z2i=I(iwr=>{"use strict";p();Object.defineProperty(iwr,"__esModule",{value:!0});iwr.call=Qrc;var Drc=Qs(),Nrc=pme(),Mrc=vE(),Orc=xl(),Brc=HAt(),Lrc=Sge(),xge=Y2i(),oh=J2i(),Frc=Q5e(),Urc=nwr();async function Qrc(t,e,r,n){let o,s=t.get(Orc.ICompletionsLogTargetService),c=t.get(Drc.IInstantiationService),l=t.get(Nrc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return xge.ConnectionState.setDisconnected(),(0,oh.createErrorResponse)(401,oh.ErrorMessages[oh.ErrorReasons.Unauthorized])}if(Frc.codeReferenceLogger.info(s,`Calling ${e}`),xge.ConnectionState.isRetrying())return(0,oh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(xge.ConnectionState.isDisconnected())return(0,oh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(Lrc.ICompletionsFetcherService).fetch((0,Brc.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,Mrc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(xge.ConnectionState.enableRetry),(0,oh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw Urc.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,oh.getErrorType)(A),E=m||"unknown error";switch(y){case oh.ErrorReasons.Unauthorized:return(0,oh.createErrorResponse)(h,oh.ErrorMessages[oh.ErrorReasons.Unauthorized],g);case oh.ErrorReasons.BadArguments:return(0,oh.createErrorResponse)(h,E,g);case oh.ErrorReasons.RateLimit:return c.invokeFunction(_=>xge.ConnectionState.enableRetry(_,60*1e3)),(0,oh.createErrorResponse)(h,oh.ErrorMessages.RateLimitError,g);case oh.ErrorReasons.InternalError:return c.invokeFunction(_=>xge.ConnectionState.enableRetry(_)),(0,oh.createErrorResponse)(h,oh.ErrorMessages[oh.ErrorReasons.InternalError],g);default:return(0,oh.createErrorResponse)(h,E,g)}}a(Qrc,"call")});var owr=I(n1=>{"use strict";p();Object.defineProperty(n1,"__esModule",{value:!0});n1.FileMatchResponse=n1.FileMatchRequest=n1.MatchResponse=n1.MatchRequest=n1.MatchError=void 0;var Aa=Imt();n1.MatchError=Aa.Type.Object({kind:Aa.Type.Literal("failure"),reason:Aa.Type.String(),code:Aa.Type.Number(),msg:Aa.Type.String(),meta:Aa.Type.Optional(Aa.Type.Any())});var qrc=Aa.Type.Object({matched_source:Aa.Type.String(),occurrences:Aa.Type.String(),capped:Aa.Type.Boolean(),cursor:Aa.Type.String(),github_url:Aa.Type.String()});n1.MatchRequest=Aa.Type.Object({source:Aa.Type.String()});var jrc=Aa.Type.Object({snippets:Aa.Type.Array(qrc)});n1.MatchResponse=Aa.Type.Union([jrc,n1.MatchError]);n1.FileMatchRequest=Aa.Type.Object({cursor:Aa.Type.String()});var Hrc=Aa.Type.Object({commit_id:Aa.Type.String(),license:Aa.Type.String(),nwo:Aa.Type.String(),path:Aa.Type.String(),url:Aa.Type.String()}),Grc=Aa.Type.Object({has_next_page:Aa.Type.Boolean(),cursor:Aa.Type.String()}),$rc=Aa.Type.Object({count:Aa.Type.Record(Aa.Type.String(),Aa.Type.String())}),Vrc=Aa.Type.Object({file_matches:Aa.Type.Array(Hrc),page_info:Grc,license_stats:$rc});n1.FileMatchResponse=Aa.Type.Union([Vrc,n1.MatchError])});var rDi=I(N4=>{"use strict";p();var Wrc=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]})),zrc=N4&&N4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X2i=N4&&N4.__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(c6,"__esModule",{value:!0});c6.MinTokenLength=void 0;c6.lexemeLength=nDi;c6.offsetLastLexemes=Zrc;c6.hasMinLexemeLength=Xrc;var j5e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");c6.MinTokenLength=65;function nDi(t){let e=0,r;j5e.lastIndex=0;do if(r=j5e.exec(t),r&&(e+=1),e>=c6.MinTokenLength)break;while(r);return e}a(nDi,"lexemeLength");function Jrc(t,e){let r=0,n;j5e.lastIndex=0;do if(n=j5e.exec(t),n&&(r+=1,r>=e))return j5e.lastIndex;while(n);return t.length}a(Jrc,"offsetFirstLexemes");function Zrc(t,e){let r=t.split("").reverse().join(""),n=Jrc(r,e);return r.length-n}a(Zrc,"offsetLastLexemes");function Xrc(t){return nDi(t)>=c6.MinTokenLength}a(Xrc,"hasMinLexemeLength")});var uDi=I(l6=>{"use strict";p();var enc=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]})),tnc=l6&&l6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cDi=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;osDi(E,()=>oDi.Match(E,f)));if(!h||aDi(h)||!h.snippets.length){swr.codeReferenceLogger.info(s,"No match found");return}swr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>sDi(T,()=>oDi.FilesForMatch(T,{cursor:E.cursor})));if(!_||aDi(_))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(lnc,"fetchCitations")});var gDi=I(XG=>{"use strict";p();Object.defineProperty(XG,"__esModule",{value:!0});XG.editDistance=fDi;XG.emptyLexDictionary=pDi;XG.reverseLexDictionary=hDi;XG.lexGeneratorWords=mDi;XG.lexicalAnalyzer=awr;XG.lexEditDistance=unc;function fDi(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(mDi,"lexGeneratorWords");function awr(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(awr,"lexicalAnalyzer");function dDi(t){return t!==" "}a(dDi,"notSingleSpace");function unc(t,e,r=mDi){let[n,o]=awr(t,pDi(),r,dDi),[s,c]=awr(e,o,r,dDi);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=hDi(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=fDi(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(unc,"lexEditDistance")});var cwr=I(Sre=>{"use strict";p();Object.defineProperty(Sre,"__esModule",{value:!0});Sre.PartialAcceptTriggerKind=void 0;Sre.computeCompCharLen=dnc;Sre.countLines=fnc;Sre.computeCompletionText=pnc;var ADi;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(ADi||(Sre.PartialAcceptTriggerKind=ADi={}));function dnc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(dnc,"computeCompCharLen");function fnc(t){return t.length===0?0:t.split(` -`).length}a(fnc,"countLines");function pnc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(pnc,"computeCompletionText")});var xDi=I(ZAt=>{"use strict";p();Object.defineProperty(ZAt,"__esModule",{value:!0});ZAt.postRejectionTasks=Tnc;ZAt.postInsertionTasks=Inc;var JAt=Qs(),_Di=See(),hnc=pme(),KAt=Mxi(),mnc=l0t(),gnc=t1r(),CDi=Sbr(),vDi=tge(),Rge=xl(),yDi=ngt(),Anc=mge(),ync=uDi(),EDi=gDi(),Enc=cwr(),e$=Tg(),_nc=zb(),bDi=QMe(),Cnc=tre(),t$=new Rge.Logger("postInsertion"),SDi=[{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}],TDi=50,vnc=1500,bnc=.5,Snc=500,lwr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function IDi(t,e,r,n,o){let s=t.get(JAt.IInstantiationService),c=t.get(Rge.ICompletionsLogTargetService),l=await t.get(CDi.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return t$.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(Anc.extractPrompt,r.properties.headerRequestId,(0,gnc.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,yDi.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,yDi.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:Snc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(IDi,"captureCode");function Tnc(t,e,r,n,o){let s=t.get(Rge.ICompletionsLogTargetService),c=t.get(JAt.IInstantiationService),l=t.get(_Di.ICompletionsTelemetryService),u=t.get(bDi.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{t$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(vDi.telemetryRejected,e,g)});let d=c.createInstance(KAt.ChangeTracker,n,r-1),f=c.createInstance(KAt.ChangeTracker,n,r),h=a(async m=>{t$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(IDi,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});t$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(e$.telemetry,e+".capturedAfterRejected",v,e$.TelemetryStore.Enhanced)},"checkInCode");SDi.filter(m=>m.captureRejection).map(m=>d.push((0,e$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Tnc,"postRejectionTasks");function Inc(t,e,r,n,o,s,c,l){let u=t.get(Rge.ICompletionsLogTargetService),d=t.get(JAt.IInstantiationService),f=t.get(bDi.ICompletionsPromiseQueueService),h=t.get(_Di.ICompletionsTelemetryService),m=t.get(Cnc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});t$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(vDi.telemetryAccepted,e,g);let A=r;r=(0,Enc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(KAt.ChangeTracker,o,n),_=d.createInstance(KAt.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(knc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(lwr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:lwr.captureCode,captureRejection:lwr.captureRejection});f.register(b)}else SDi.map(b=>E.push((0,e$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,e$.telemetryCatch)(h,f,xnc,"post insertion citation check")(b,o,A,r,n,l))}a(Inc,"postInsertionTasks");async function xnc(t,e,r,n,o,s){let c=t.get(Rge.ICompletionsLogTargetService),l=t.get(_nc.ICompletionsTextDocumentManagerService),u=t.get(hnc.ICompletionsCopilotTokenManager),d=t.get(mnc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,ync.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=uwr(f.getText(),n,TDi,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=wnc(r.length,n.length,h.start_offset);if(m===void 0){t$.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+Rnc(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(xnc,"citationCheck");function wnc(t,e,r){if(!(ee))return r}a(wnc,"computeCitationStart");function Rnc(t,e,r){return e{"use strict";p();Object.defineProperty(ty,"__esModule",{value:!0});ty.LastGhostText=ty.ICompletionsLastGhostText=void 0;ty.rejectLastShown=kDi;ty.setLastShown=Mnc;ty.handleGhostTextShown=Onc;ty.handleGhostTextPostInsert=Lnc;ty.handlePartialGhostTextPostInsert=Fnc;var Pnc=rn(),wDi=xl(),fwr=xDi(),XAt=cwr(),RDi=xG(),pwr=tge(),Dnc=new wDi.Logger("ghostText");ty.ICompletionsLastGhostText=(0,Pnc.createServiceIdentifier)("ICompletionsLastGhostText");var dwr=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=dwr;function Nnc(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(Nnc,"computeRejectedCompletions");function kDi(t,e){let r=t.get(ty.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=Nnc(r);n.length>0&&(0,fwr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(kDi,"rejectLastShown");function Mnc(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!==RDi.ResultType.TypingAsSuggested&&kDi(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Mnc,"setLastShown");function Onc(t,e){let r=t.get(wDi.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!==RDi.ResultType.Network;Dnc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,pwr.telemetryShown)(t,e)}}a(Onc,"handleGhostTextShown");function Bnc(t,e,r){let n=t.get(ty.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,XAt.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,XAt.countLines)(e.displayText));let o=(0,XAt.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(Bnc,"handleLineAcceptance");function Lnc(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,XAt.countLines)(e.displayText)},r.resetState(),(0,fwr.postInsertionTasks)(t,pwr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Lnc,"handleGhostTextPostInsert");function Fnc(t,e,r){let n=t.get(ty.ICompletionsLastGhostText);Bnc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,fwr.postInsertionTasks)(t,pwr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Fnc,"handlePartialGhostTextPostInsert")});var PDi=I(mwr=>{"use strict";p();Object.defineProperty(mwr,"__esModule",{value:!0});mwr.normalizeIndentCharacter=Unc;function Unc(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(YJa,"jsonVerboseError");function Aki(t){return t&&t.name==="AbortError"}a(Aki,"isAbortError");function KJa(t){try{return new URL(t).hostname}catch{return"unknown"}}a(KJa,"safeGetHostname")});var yki=I(Xme=>{"use strict";p();Object.defineProperty(Xme,"__esModule",{value:!0});Xme.INTEGRATION_ID=Xme.LICENSE_AGREEMENT=void 0;Xme.LICENSE_AGREEMENT=void 0;Xme.INTEGRATION_ID="code-oss"});var wE=I(ege=>{"use strict";p();Object.defineProperty(ege,"__esModule",{value:!0});ege.ICAPIClientService=ege.BaseCAPIClientService=void 0;var d5e=(sre(),ya(ore)),JJa=rn(),ZJa=oy(),XJa=yki(),jIr=class extends d5e.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()},XJa.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===d5e.RequestType.Telemetry||r.type===d5e.RequestType.ChatCompletions||r.type===d5e.RequestType.ChatMessages||r.type===d5e.RequestType.ChatResponses)&&(e.callSite=ZJa.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};ege.BaseCAPIClientService=jIr;ege.ICAPIClientService=(0,JJa.createServiceIdentifier)("ICAPIClientService")});var aAt=I(sAt=>{"use strict";p();Object.defineProperty(sAt,"__esModule",{value:!0});sAt.getEndpointUrl=oZa;sAt.getLastKnownEndpoints=sZa;var eZa=vE(),tZa=wE(),MG=EE(),rZa=Fte(),nZa=aG();function _ki(t){let e=t.get(tZa.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(_ki,"getDefaultEndpoints");function Eki(t,e,r){if(r!==void 0&&t.get(rZa.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,MG.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,MG.getConfig)(t,n);if(o)return o}}a(Eki,"urlConfigOverride");function iZa(t,e){switch(e){case"proxy":return Eki(t,[MG.ConfigKey.DebugOverrideProxyUrl,MG.ConfigKey.DebugOverrideProxyUrlLegacy],[MG.ConfigKey.DebugTestOverrideProxyUrl,MG.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!MG.BuildInfo.isProduction())return Eki(t,[MG.ConfigKey.DebugSnippyOverrideUrl])}}a(iZa,"getEndpointOverrideUrl");function oZa(t,e,r,...n){let o=iZa(t,r)??(e.endpoints?e.endpoints[r]:void 0)??_ki(t)[r];return(0,nZa.joinPath)(o,...n)}a(oZa,"getEndpointUrl");function sZa(t){return t.get(eZa.IAuthenticationService).copilotToken?.endpoints??_ki(t)}a(sZa,"getLastKnownEndpoints")});var GIr=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.Response=void 0;f5e.isAbortError=cZa;var aZa=oy();Object.defineProperty(f5e,"Response",{enumerable:!0,get:a(function(){return aZa.Response},"get")});var HIr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function cZa(t){return!t||typeof t!="object"?!1:t instanceof HIr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(cZa,"isAbortError")});var tge=I(Am=>{"use strict";p();var lZa=Am&&Am.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uZa=Am&&Am.__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},dZa=Am&&Am.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lZa(e,t,r)},$Ir=Am&&Am.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Am,"__esModule",{value:!0});Am.Fetcher=Am.CompletionsFetcher=Am.ICompletionsFetcherService=void 0;Am.isInterruptedNetworkError=mZa;dZa(GIr(),Am);var vki=Sl(),fZa=oy(),pZa=Ap(),hZa=rn();Am.ICompletionsFetcherService=(0,hZa.createServiceIdentifier)("ICompletionsFetcherService");var VIr=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(vki.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()}};Am.CompletionsFetcher=VIr;Am.CompletionsFetcher=VIr=uZa([$Ir(0,vki.IConfigurationService),$Ir(1,fZa.IFetcherService),$Ir(2,pZa.IExperimentationService)],VIr);var WIr=class{static{a(this,"Fetcher")}getImplementation(){return this}};Am.Fetcher=WIr;function mZa(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(mZa,"isInterruptedNetworkError")});var Cki=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.FeatureName=rge.OutputPaneShowCommand=void 0;rge.OutputPaneShowCommand="codereferencing.showOutputPane2";rge.FeatureName="code-referencing"});var p5e=I(cAt=>{"use strict";p();Object.defineProperty(cAt,"__esModule",{value:!0});cAt.codeReferenceLogger=void 0;var gZa=Tl(),AZa=Cki();cAt.codeReferenceLogger=new gZa.Logger(AZa.FeatureName)});var Tki=I(dAt=>{"use strict";p();Object.defineProperty(dAt,"__esModule",{value:!0});dAt.ConnectionState=void 0;var yZa=Ls(),EZa=Tl(),_Za=aAt(),vZa=tge(),h5e=p5e(),CZa=3e3,zIr=2,bki=256,Ski=Math.log(bki)/Math.log(zIr)/zIr,gD={connection:"disabled",maxAttempts:Ski,retryAttempts:0,initialWait:!1},lAt,uAt=[];function bZa(){if(lAt)return lAt;function t(_){return uAt.push(_),()=>{let v=uAt.indexOf(_);v!==-1&&uAt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of uAt)_()}a(e,"afterUpdateConnection");function r(_){gD.connection!==_&&(gD.connection=_,e())}a(r,"updateConnection");function n(){return gD.connection==="connected"}a(n,"isConnected");function o(){return gD.connection==="disconnected"}a(o,"isDisconnected");function s(){return gD.connection==="retry"}a(s,"isRetrying");function c(){return gD.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(_){gD.initialWait!==_&&(gD.initialWait=_)}a(h,"setInitialWait");function m(_,v=CZa){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return gD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(EZa.ICompletionsLogTargetService),T=_.get(vZa.ICompletionsFetcherService),w=_.get(yZa.IInstantiationService);h5e.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>bki){h5e.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{gD.retryAttempts=Math.min(gD.retryAttempts+1,Ski);try{h5e.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(_Za.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{h5e.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),h5e.codeReferenceLogger.info(b,"Attempting to reconnect."),R(zIr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),lAt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},lAt}a(bZa,"registerConnectionState");dAt.ConnectionState=bZa()});var xki=I(Lg=>{"use strict";p();Object.defineProperty(Lg,"__esModule",{value:!0});Lg.ErrorMessages=Lg.ErrorReasons=void 0;Lg.getErrorType=Iki;Lg.createErrorResponse=SZa;Lg.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};Lg.ErrorMessages={[Lg.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Lg.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Lg.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function Iki(t){return t===401?Lg.ErrorReasons.Unauthorized:t===400?Lg.ErrorReasons.BadArguments:t===404?Lg.ErrorReasons.NotFound:t===429?Lg.ErrorReasons.RateLimit:t>=500&&t<600?Lg.ErrorReasons.InternalError:t>=600?Lg.ErrorReasons.ConnectionError:Lg.ErrorReasons.Unknown}a(Iki,"getErrorType");function SZa(t,e,r={}){return{kind:"failure",reason:Iki(Number(t)),code:Number(t),msg:e,meta:r}}a(SZa,"createErrorResponse")});var XIr=I(_4=>{"use strict";p();Object.defineProperty(_4,"__esModule",{value:!0});_4.NoopTelemetryReporter=_4.snippyTelemetry=_4.matchNotificationTelemetry=_4.copilotOutputLogTelemetry=void 0;var TZa=Tl(),RE=xg(),IZa=p5e(),xZa=/^[1-6][0-9][0-9]$/,wZa=/([A-Z][a-z]+)/,RZa="code_referencing",nge=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[RZa,this.baseKey,...e].join(".")}},YIr=class extends nge{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=RE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(RE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=RE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(RE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=RE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(RE.telemetry,n,r)}};_4.copilotOutputLogTelemetry=new YIr;var KIr=class extends nge{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=RE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(RE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=RE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(RE.telemetry,o,n)}};_4.matchNotificationTelemetry=new KIr;var JIr=class extends nge{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=RE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(RE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=RE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(RE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(xZa)){e.invokeFunction(l=>IZa.codeReferenceLogger.debug(l.get(TZa.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(wZa).filter(l=>!!l).join("_").toLowerCase(),c=RE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(RE.telemetryError,this.buildKey(s,r),c)}};_4.snippyTelemetry=new JIr;var ZIr=class extends nge{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};_4.NoopTelemetryReporter=ZIr});var wki=I(exr=>{"use strict";p();Object.defineProperty(exr,"__esModule",{value:!0});exr.call=FZa;var PZa=Ls(),kZa=G0e(),DZa=EE(),NZa=Tl(),MZa=aAt(),OZa=tge(),ige=Tki(),sh=xki(),BZa=p5e(),LZa=XIr();async function FZa(t,e,r,n){let o,s=t.get(NZa.ICompletionsLogTargetService),c=t.get(PZa.IInstantiationService),l=t.get(kZa.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return ige.ConnectionState.setDisconnected(),(0,sh.createErrorResponse)(401,sh.ErrorMessages[sh.ErrorReasons.Unauthorized])}if(BZa.codeReferenceLogger.info(s,`Calling ${e}`),ige.ConnectionState.isRetrying())return(0,sh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(ige.ConnectionState.isDisconnected())return(0,sh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(OZa.ICompletionsFetcherService).fetch((0,MZa.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,DZa.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(ige.ConnectionState.enableRetry),(0,sh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw LZa.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,sh.getErrorType)(A),E=m||"unknown error";switch(y){case sh.ErrorReasons.Unauthorized:return(0,sh.createErrorResponse)(h,sh.ErrorMessages[sh.ErrorReasons.Unauthorized],g);case sh.ErrorReasons.BadArguments:return(0,sh.createErrorResponse)(h,E,g);case sh.ErrorReasons.RateLimit:return c.invokeFunction(_=>ige.ConnectionState.enableRetry(_,60*1e3)),(0,sh.createErrorResponse)(h,sh.ErrorMessages.RateLimitError,g);case sh.ErrorReasons.InternalError:return c.invokeFunction(_=>ige.ConnectionState.enableRetry(_)),(0,sh.createErrorResponse)(h,sh.ErrorMessages[sh.ErrorReasons.InternalError],g);default:return(0,sh.createErrorResponse)(h,E,g)}}a(FZa,"call")});var txr=I(Yb=>{"use strict";p();Object.defineProperty(Yb,"__esModule",{value:!0});Yb.FileMatchResponse=Yb.FileMatchRequest=Yb.MatchResponse=Yb.MatchRequest=Yb.MatchError=void 0;var ha=G0t();Yb.MatchError=ha.Type.Object({kind:ha.Type.Literal("failure"),reason:ha.Type.String(),code:ha.Type.Number(),msg:ha.Type.String(),meta:ha.Type.Optional(ha.Type.Any())});var UZa=ha.Type.Object({matched_source:ha.Type.String(),occurrences:ha.Type.String(),capped:ha.Type.Boolean(),cursor:ha.Type.String(),github_url:ha.Type.String()});Yb.MatchRequest=ha.Type.Object({source:ha.Type.String()});var QZa=ha.Type.Object({snippets:ha.Type.Array(UZa)});Yb.MatchResponse=ha.Type.Union([QZa,Yb.MatchError]);Yb.FileMatchRequest=ha.Type.Object({cursor:ha.Type.String()});var qZa=ha.Type.Object({commit_id:ha.Type.String(),license:ha.Type.String(),nwo:ha.Type.String(),path:ha.Type.String(),url:ha.Type.String()}),jZa=ha.Type.Object({has_next_page:ha.Type.Boolean(),cursor:ha.Type.String()}),HZa=ha.Type.Object({count:ha.Type.Record(ha.Type.String(),ha.Type.String())}),GZa=ha.Type.Object({file_matches:ha.Type.Array(qZa),page_info:jZa,license_stats:HZa});Yb.FileMatchResponse=ha.Type.Union([GZa,Yb.MatchError])});var Dki=I(v4=>{"use strict";p();var $Za=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]})),VZa=v4&&v4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Rki=v4&&v4.__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(W8,"__esModule",{value:!0});W8.MinTokenLength=void 0;W8.lexemeLength=Nki;W8.offsetLastLexemes=KZa;W8.hasMinLexemeLength=JZa;var m5e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");W8.MinTokenLength=65;function Nki(t){let e=0,r;m5e.lastIndex=0;do if(r=m5e.exec(t),r&&(e+=1),e>=W8.MinTokenLength)break;while(r);return e}a(Nki,"lexemeLength");function YZa(t,e){let r=0,n;m5e.lastIndex=0;do if(n=m5e.exec(t),n&&(r+=1,r>=e))return m5e.lastIndex;while(n);return t.length}a(YZa,"offsetFirstLexemes");function KZa(t,e){let r=t.split("").reverse().join(""),n=YZa(r,e);return r.length-n}a(KZa,"offsetLastLexemes");function JZa(t){return Nki(t)>=W8.MinTokenLength}a(JZa,"hasMinLexemeLength")});var Qki=I(z8=>{"use strict";p();var ZZa=z8&&z8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XZa=z8&&z8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fki=z8&&z8.__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;oBki(E,()=>Oki.Match(E,f)));if(!h||Lki(h)||!h.snippets.length){rxr.codeReferenceLogger.info(s,"No match found");return}rxr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>Bki(T,()=>Oki.FilesForMatch(T,{cursor:E.cursor})));if(!_||Lki(_))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(aXa,"fetchCitations")});var Vki=I(OG=>{"use strict";p();Object.defineProperty(OG,"__esModule",{value:!0});OG.editDistance=jki;OG.emptyLexDictionary=Hki;OG.reverseLexDictionary=Gki;OG.lexGeneratorWords=$ki;OG.lexicalAnalyzer=nxr;OG.lexEditDistance=cXa;function jki(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($ki,"lexGeneratorWords");function nxr(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(nxr,"lexicalAnalyzer");function qki(t){return t!==" "}a(qki,"notSingleSpace");function cXa(t,e,r=$ki){let[n,o]=nxr(t,Hki(),r,qki),[s,c]=nxr(e,o,r,qki);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=Gki(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=jki(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(cXa,"lexEditDistance")});var ixr=I(are=>{"use strict";p();Object.defineProperty(are,"__esModule",{value:!0});are.PartialAcceptTriggerKind=void 0;are.computeCompCharLen=lXa;are.countLines=uXa;are.computeCompletionText=dXa;var Wki;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(Wki||(are.PartialAcceptTriggerKind=Wki={}));function lXa(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(lXa,"computeCompCharLen");function uXa(t){return t.length===0?0:t.split(` +`).length}a(uXa,"countLines");function dXa(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(dXa,"computeCompletionText")});var n2i=I(gAt=>{"use strict";p();Object.defineProperty(gAt,"__esModule",{value:!0});gAt.postRejectionTasks=bXa;gAt.postInsertionTasks=SXa;var mAt=Ls(),Kki=aee(),fXa=G0e(),hAt=uIi(),pXa=xht(),hXa=JCr(),Jki=_Cr(),Zki=Dme(),sge=Tl(),zki=vmt(),mXa=Vme(),gXa=Qki(),Yki=Vki(),AXa=ixr(),BG=xg(),yXa=Qb(),Xki=pMe(),EXa=Fte(),LG=new sge.Logger("postInsertion"),e2i=[{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}],t2i=50,_Xa=1500,vXa=.5,CXa=500,oxr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function r2i(t,e,r,n,o){let s=t.get(mAt.IInstantiationService),c=t.get(sge.ICompletionsLogTargetService),l=await t.get(Jki.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return LG.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(mXa.extractPrompt,r.properties.headerRequestId,(0,hXa.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,zki.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,zki.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:CXa)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(r2i,"captureCode");function bXa(t,e,r,n,o){let s=t.get(sge.ICompletionsLogTargetService),c=t.get(mAt.IInstantiationService),l=t.get(Kki.ICompletionsTelemetryService),u=t.get(Xki.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{LG.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(Zki.telemetryRejected,e,g)});let d=c.createInstance(hAt.ChangeTracker,n,r-1),f=c.createInstance(hAt.ChangeTracker,n,r),h=a(async m=>{LG.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(r2i,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});LG.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(BG.telemetry,e+".capturedAfterRejected",v,BG.TelemetryStore.Enhanced)},"checkInCode");e2i.filter(m=>m.captureRejection).map(m=>d.push((0,BG.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(bXa,"postRejectionTasks");function SXa(t,e,r,n,o,s,c,l){let u=t.get(sge.ICompletionsLogTargetService),d=t.get(mAt.IInstantiationService),f=t.get(Xki.ICompletionsPromiseQueueService),h=t.get(Kki.ICompletionsTelemetryService),m=t.get(EXa.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});LG.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(Zki.telemetryAccepted,e,g);let A=r;r=(0,AXa.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(hAt.ChangeTracker,o,n),_=d.createInstance(hAt.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(wXa,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(oxr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:oxr.captureCode,captureRejection:oxr.captureRejection});f.register(b)}else e2i.map(b=>E.push((0,BG.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,BG.telemetryCatch)(h,f,TXa,"post insertion citation check")(b,o,A,r,n,l))}a(SXa,"postInsertionTasks");async function TXa(t,e,r,n,o,s){let c=t.get(sge.ICompletionsLogTargetService),l=t.get(yXa.ICompletionsTextDocumentManagerService),u=t.get(fXa.ICompletionsCopilotTokenManager),d=t.get(pXa.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,gXa.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=sxr(f.getText(),n,t2i,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=IXa(r.length,n.length,h.start_offset);if(m===void 0){LG.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+xXa(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(TXa,"citationCheck");function IXa(t,e,r){if(!(ee))return r}a(IXa,"computeCitationStart");function xXa(t,e,r){return e{"use strict";p();Object.defineProperty(sy,"__esModule",{value:!0});sy.LastGhostText=sy.ICompletionsLastGhostText=void 0;sy.rejectLastShown=s2i;sy.setLastShown=DXa;sy.handleGhostTextShown=NXa;sy.handleGhostTextPostInsert=OXa;sy.handlePartialGhostTextPostInsert=BXa;var RXa=rn(),i2i=Tl(),cxr=n2i(),AAt=ixr(),o2i=lG(),lxr=Dme(),PXa=new i2i.Logger("ghostText");sy.ICompletionsLastGhostText=(0,RXa.createServiceIdentifier)("ICompletionsLastGhostText");var axr=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}};sy.LastGhostText=axr;function kXa(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(kXa,"computeRejectedCompletions");function s2i(t,e){let r=t.get(sy.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=kXa(r);n.length>0&&(0,cxr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(s2i,"rejectLastShown");function DXa(t,e,r,n){let o=t.get(sy.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==o2i.ResultType.TypingAsSuggested&&s2i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(DXa,"setLastShown");function NXa(t,e){let r=t.get(i2i.ICompletionsLogTargetService),n=t.get(sy.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!==o2i.ResultType.Network;PXa.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,lxr.telemetryShown)(t,e)}}a(NXa,"handleGhostTextShown");function MXa(t,e,r){let n=t.get(sy.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,AAt.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,AAt.countLines)(e.displayText));let o=(0,AAt.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(MXa,"handleLineAcceptance");function OXa(t,e){let r=t.get(sy.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,AAt.countLines)(e.displayText)},r.resetState(),(0,cxr.postInsertionTasks)(t,lxr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(OXa,"handleGhostTextPostInsert");function BXa(t,e,r){let n=t.get(sy.ICompletionsLastGhostText);MXa(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,cxr.postInsertionTasks)(t,lxr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(BXa,"handlePartialGhostTextPostInsert")});var a2i=I(dxr=>{"use strict";p();Object.defineProperty(dxr,"__esModule",{value:!0});dxr.normalizeIndentCharacter=LXa;function LXa(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(Unc,"normalizeIndentCharacter")});var DDi=I(gwr=>{"use strict";p();Object.defineProperty(gwr,"__esModule",{value:!0});gwr.completionsFromGhostTextResults=Hnc;var Qnc=um(),eyt=Hme(),qnc=PDi(),jnc=xG();function Hnc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=eyt.LocationFactory.range(eyt.LocationFactory.position(n.line,0),eyt.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,qnc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=eyt.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,Qnc.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===jnc.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(Hnc,"completionsFromGhostTextResults")});var Ewr=I(TD=>{"use strict";p();var Gnc=TD&&TD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$nc=TD&&TD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vnc=TD&&TD.__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(Wnc,"createRequestHMAC");async function znc(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(znc,"createSha256Hash");var Awr=new Map;function Ync(t){if(Awr.has(t))return Awr.get(t);let e=Knc(t);return Awr.set(t,e),e}a(Ync,"getCachedSha256Hash");function Knc(t){let e=new ywr;return e.update(t),e.digest()}a(Knc,"createSha256HashSyncInsecure");function r$(t,e=32){return t instanceof ArrayBuffer?(0,NDi.encodeHex)(NDi.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(r$,"toHexString");function M4(t,e){return(t>>>e|t<<32-e)>>>0}a(M4,"rightRotate");var ywr=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(tyt.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()),r$(this._h0)+r$(this._h1)+r$(this._h2)+r$(this._h3)+r$(this._h4)+r$(this._h5)+r$(this._h6)+r$(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=M4(A,7)^M4(A,18)^A>>>3,_=M4(y,17)^M4(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=M4(u,6)^M4(u,11)^M4(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=M4(o,2)^M4(o,13)^M4(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 _wr=I(ryt=>{"use strict";p();Object.defineProperty(ryt,"__esModule",{value:!0});ryt.isInlineSuggestionFromTextAfterCursor=MDi;ryt.determineIsInlineSuggestionPosition=Jnc;function MDi(t){let e=Znc(t),r=Xnc(t);if(!(e&&!r))return e&&r}a(MDi,"isInlineSuggestionFromTextAfterCursor");function Jnc(t){let e=t.textAfterCursor();return MDi(e)}a(Jnc,"determineIsInlineSuggestionPosition");function Znc(t){return t.trim().length!==0}a(Znc,"isMiddleOfTheLineFromTextAfterCursor");function Xnc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(Xnc,"isValidMiddleOfTheLineFromTextAfterCursor")});var iyt=I(n$=>{"use strict";p();Object.defineProperty(n$,"__esModule",{value:!0});n$.NoOpStatusReporter=n$.StatusReporter=n$.ICompletionsStatusReporter=void 0;var eic=rn();n$.ICompletionsStatusReporter=(0,eic.createServiceIdentifier)("ICompletionsStatusReporter");var nyt=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)}};n$.StatusReporter=nyt;var Cwr=class extends nyt{static{a(this,"NoOpStatusReporter")}didChange(){}};n$.NoOpStatusReporter=Cwr});var Iwr=I(ry=>{"use strict";p();Object.defineProperty(ry,"__esModule",{value:!0});ry.AdoRepoId=ry.GithubRepoId=ry.IGitService=void 0;ry.getGitHubRepoInfoFromContext=nic;ry.getOrderedRepoInfosFromContext=iic;ry.getOrderedRemoteUrlsFromContext=bwr;ry.parseRemoteUrl=Swr;ry.toGithubNwo=ODi;ry.toGithubWebUrl=oic;ry.getGithubRepoIdFromFetchUrl=Twr;ry.getAdoRepoIdFromFetchUrl=BDi;ry.normalizeFetchUrl=sic;var tic=rn(),vwr=Gh(),ric=Ku();ry.IGitService=(0,tic.createServiceIdentifier)("IGitService");function nic(t){for(let e of bwr(t))if(e){let r=Twr(e);if(r)return{id:r,remoteUrl:e}}}a(nic,"getGitHubRepoInfoFromContext");function*iic(t){for(let e of bwr(t)){let r=Twr(e)??BDi(e);r&&(yield{repoId:r,fetchUrl:e})}}a(iic,"getOrderedRepoInfosFromContext");function bwr(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(bwr,"getOrderedRemoteUrlsFromContext");function Swr(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=ric.URI.parse(t),r=e.authority,n=e.path;if(!((0,vwr.equalsIgnoreCase)(e.scheme,"ssh")||(0,vwr.equalsIgnoreCase)(e.scheme,"https")||(0,vwr.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(Swr,"parseRemoteUrl");var oyt=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 ODi(this)}};ry.GithubRepoId=oyt;function ODi(t){return`${t.org}/${t.repo}`.toLowerCase()}a(ODi,"toGithubNwo");function oic(t){return`https://${t.host}/${t.org}/${t.repo}`}a(oic,"toGithubWebUrl");function Twr(t){let e=Swr(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 oyt(s[1],s[2],o):void 0}a(Twr,"getGithubRepoIdFromFetchUrl");var kge=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()}};ry.AdoRepoId=kge;function BDi(t){let e=Swr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new kge(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 kge(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 kge(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(BDi,"getAdoRepoIdFromFetchUrl");function sic(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(sic,"normalizeFetchUrl")});var Rwr=I(Tre=>{"use strict";p();Object.defineProperty(Tre,"__esModule",{value:!0});Tre.ComputationStatus=void 0;Tre.tryGetGitHubNWO=lic;Tre.extractRepoInfoInBackground=uic;Tre.extractRepoInfo=LDi;var xwr=Iwr(),aic=bG(),cic=H8(),H5e=TG();function lic(t){if(t!==void 0&&t!==G5e.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(lic,"tryGetGitHubNWO");function uic(t,e){let r=(0,H5e.dirname)(e);return dic(t,r)}a(uic,"extractRepoInfoInBackground");var dic=mic(LDi,1e4);async function LDi(t,e){let r=t.get(aic.ICompletionsFileSystemService),n=(0,H5e.getFsUri)(e);if(!n)return;let o=await pic(r,n);if(!o)return;let s=(0,H5e.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=hic(c)??"",u=fic(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(LDi,"extractRepoInfo");function fic(t){let e=(0,xwr.parseRemoteUrl)(t);if(!e)return;let r=(0,xwr.getGithubRepoIdFromFetchUrl)(t)??(0,xwr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(fic,"parseRepoUrl");async function pic(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 G5e.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new wwr(d)),n.delete(c)}),G5e.PENDING}}a(mic,"computeInBackgroundAndMemoize")});var UDi=I(kwr=>{"use strict";p();Object.defineProperty(kwr,"__esModule",{value:!0});kwr.isRepetitive=Aic;var gic=[{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 Aic(t){let e=t.slice();return e.reverse(),FDi(e)||FDi(e.filter(r=>r.trim().length>0))}a(Aic,"isRepetitive");function FDi(t){let e=yic(t);for(let r of gic){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(yic,"kmp_prefix_function")});var qDi=I($5e=>{"use strict";p();Object.defineProperty($5e,"__esModule",{value:!0});$5e.maybeSnipCompletionImpl=QDi;$5e.postProcessChoiceInContext=Sic;$5e.checkSuffix=Tic;var Eic=Ute(),Ire=Tg(),_ic=UDi();function Cic(t,e,r,n){let o="}";try{o=(0,Eic.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return QDi({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Cic,"maybeSnipCompletion");function QDi(t,e,r,n){let o=vic(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(QDi,"maybeSnipCompletionImpl");function vic(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(LXa,"normalizeIndentCharacter")});var c2i=I(fxr=>{"use strict";p();Object.defineProperty(fxr,"__esModule",{value:!0});fxr.completionsFromGhostTextResults=qXa;var FXa=um(),yAt=_me(),UXa=a2i(),QXa=lG();function qXa(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=yAt.LocationFactory.range(yAt.LocationFactory.position(n.line,0),yAt.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,UXa.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=yAt.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,FXa.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===QXa.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(qXa,"completionsFromGhostTextResults")});var mxr=I(AD=>{"use strict";p();var jXa=AD&&AD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HXa=AD&&AD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),GXa=AD&&AD.__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($Xa,"createRequestHMAC");async function VXa(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(VXa,"createSha256Hash");var pxr=new Map;function WXa(t){if(pxr.has(t))return pxr.get(t);let e=zXa(t);return pxr.set(t,e),e}a(WXa,"getCachedSha256Hash");function zXa(t){let e=new hxr;return e.update(t),e.digest()}a(zXa,"createSha256HashSyncInsecure");function FG(t,e=32){return t instanceof ArrayBuffer?(0,l2i.encodeHex)(l2i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(FG,"toHexString");function C4(t,e){return(t>>>e|t<<32-e)>>>0}a(C4,"rightRotate");var hxr=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(EAt.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()),FG(this._h0)+FG(this._h1)+FG(this._h2)+FG(this._h3)+FG(this._h4)+FG(this._h5)+FG(this._h6)+FG(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=C4(A,7)^C4(A,18)^A>>>3,_=C4(y,17)^C4(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=C4(u,6)^C4(u,11)^C4(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=C4(o,2)^C4(o,13)^C4(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 gxr=I(_At=>{"use strict";p();Object.defineProperty(_At,"__esModule",{value:!0});_At.isInlineSuggestionFromTextAfterCursor=u2i;_At.determineIsInlineSuggestionPosition=YXa;function u2i(t){let e=KXa(t),r=JXa(t);if(!(e&&!r))return e&&r}a(u2i,"isInlineSuggestionFromTextAfterCursor");function YXa(t){let e=t.textAfterCursor();return u2i(e)}a(YXa,"determineIsInlineSuggestionPosition");function KXa(t){return t.trim().length!==0}a(KXa,"isMiddleOfTheLineFromTextAfterCursor");function JXa(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(JXa,"isValidMiddleOfTheLineFromTextAfterCursor")});var CAt=I(UG=>{"use strict";p();Object.defineProperty(UG,"__esModule",{value:!0});UG.NoOpStatusReporter=UG.StatusReporter=UG.ICompletionsStatusReporter=void 0;var ZXa=rn();UG.ICompletionsStatusReporter=(0,ZXa.createServiceIdentifier)("ICompletionsStatusReporter");var vAt=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)}};UG.StatusReporter=vAt;var Axr=class extends vAt{static{a(this,"NoOpStatusReporter")}didChange(){}};UG.NoOpStatusReporter=Axr});var Cxr=I(ay=>{"use strict";p();Object.defineProperty(ay,"__esModule",{value:!0});ay.AdoRepoId=ay.GithubRepoId=ay.IGitService=void 0;ay.getGitHubRepoInfoFromContext=tec;ay.getOrderedRepoInfosFromContext=rec;ay.getOrderedRemoteUrlsFromContext=Exr;ay.parseRemoteUrl=_xr;ay.toGithubNwo=d2i;ay.toGithubWebUrl=nec;ay.getGithubRepoIdFromFetchUrl=vxr;ay.getAdoRepoIdFromFetchUrl=f2i;ay.normalizeFetchUrl=iec;var XXa=rn(),yxr=Gh(),eec=Ku();ay.IGitService=(0,XXa.createServiceIdentifier)("IGitService");function tec(t){for(let e of Exr(t))if(e){let r=vxr(e);if(r)return{id:r,remoteUrl:e}}}a(tec,"getGitHubRepoInfoFromContext");function*rec(t){for(let e of Exr(t)){let r=vxr(e)??f2i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(rec,"getOrderedRepoInfosFromContext");function Exr(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(Exr,"getOrderedRemoteUrlsFromContext");function _xr(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=eec.URI.parse(t),r=e.authority,n=e.path;if(!((0,yxr.equalsIgnoreCase)(e.scheme,"ssh")||(0,yxr.equalsIgnoreCase)(e.scheme,"https")||(0,yxr.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(_xr,"parseRemoteUrl");var bAt=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 d2i(this)}};ay.GithubRepoId=bAt;function d2i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(d2i,"toGithubNwo");function nec(t){return`https://${t.host}/${t.org}/${t.repo}`}a(nec,"toGithubWebUrl");function vxr(t){let e=_xr(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 bAt(s[1],s[2],o):void 0}a(vxr,"getGithubRepoIdFromFetchUrl");var age=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()}};ay.AdoRepoId=age;function f2i(t){let e=_xr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new age(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 age(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 age(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(f2i,"getAdoRepoIdFromFetchUrl");function iec(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(iec,"normalizeFetchUrl")});var Txr=I(cre=>{"use strict";p();Object.defineProperty(cre,"__esModule",{value:!0});cre.ComputationStatus=void 0;cre.tryGetGitHubNWO=aec;cre.extractRepoInfoInBackground=cec;cre.extractRepoInfo=p2i;var bxr=Cxr(),oec=oG(),sec=w8(),g5e=aG();function aec(t){if(t!==void 0&&t!==A5e.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(aec,"tryGetGitHubNWO");function cec(t,e){let r=(0,g5e.dirname)(e);return lec(t,r)}a(cec,"extractRepoInfoInBackground");var lec=pec(p2i,1e4);async function p2i(t,e){let r=t.get(oec.ICompletionsFileSystemService),n=(0,g5e.getFsUri)(e);if(!n)return;let o=await dec(r,n);if(!o)return;let s=(0,g5e.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=fec(c)??"",u=uec(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(p2i,"extractRepoInfo");function uec(t){let e=(0,bxr.parseRemoteUrl)(t);if(!e)return;let r=(0,bxr.getGithubRepoIdFromFetchUrl)(t)??(0,bxr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(uec,"parseRepoUrl");async function dec(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 A5e.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new Sxr(d)),n.delete(c)}),A5e.PENDING}}a(pec,"computeInBackgroundAndMemoize")});var m2i=I(Ixr=>{"use strict";p();Object.defineProperty(Ixr,"__esModule",{value:!0});Ixr.isRepetitive=mec;var hec=[{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 mec(t){let e=t.slice();return e.reverse(),h2i(e)||h2i(e.filter(r=>r.trim().length>0))}a(mec,"isRepetitive");function h2i(t){let e=gec(t);for(let r of hec){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(gec,"kmp_prefix_function")});var A2i=I(y5e=>{"use strict";p();Object.defineProperty(y5e,"__esModule",{value:!0});y5e.maybeSnipCompletionImpl=g2i;y5e.postProcessChoiceInContext=Cec;y5e.checkSuffix=bec;var Aec=Cte(),lre=xg(),yec=m2i();function Eec(t,e,r,n){let o="}";try{o=(0,Aec.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return g2i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Eec,"maybeSnipCompletion");function g2i(t,e,r,n){let o=_ec(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(g2i,"maybeSnipCompletionImpl");function _ec(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(vic,"splitByNewLine");function bic(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(Tic,"checkSuffix")});var $Di=I(i$=>{"use strict";p();Object.defineProperty(i$,"__esModule",{value:!0});i$.DocumentLogEntry=void 0;i$.serializeOffsetRange=Iic;i$.deserializeOffsetRange=xic;i$.serializeEdit=wic;i$.deserializeEdit=Ric;var jDi=gE(),GDi=sd(),HDi;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(HDi||(i$.DocumentLogEntry=HDi={}));function Iic(t){return[t.start,t.endExclusive]}a(Iic,"serializeOffsetRange");function xic(t){return new GDi.OffsetRange(t[0],t[1])}a(xic,"deserializeOffsetRange");function wic(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(wic,"serializeEdit");function Ric(t){return jDi.StringEdit.create(t.map(e=>jDi.StringReplacement.replace(new GDi.OffsetRange(e[0],e[1]),e[2])))}a(Ric,"deserializeEdit")});var Pge=I(A0=>{"use strict";p();Object.defineProperty(A0,"__esModule",{value:!0});A0.StatelessNextEditTelemetryBuilder=A0.StatelessNextEditResult=A0.NoNextEditReason=A0.FilteredOutReason=A0.StatelessNextEditDocument=A0.StatelessNextEditRequest=A0.RequestEditWindowWithCursorJump=A0.RequestEditWindow=A0.WithStatelessProviderTelemetry=void 0;var VDi=Gx(),Pwr=Yu(),kic=Xc(),Pic=SP(),Dic=gE(),Nic=CT(),Mic=$Di(),Oic=ypr(),Dwr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};A0.WithStatelessProviderTelemetry=Dwr;var Nwr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};A0.RequestEditWindow=Nwr;var Mwr=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)}};A0.RequestEditWindowWithCursorJump=Mwr;var Owr=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 Pic.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Dic.StringEdit.empty,this._result=new kic.DeferredPromise,(0,Pwr.assert)(o.length>0),(0,Pwr.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(_ec,"splitByNewLine");function vec(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(bec,"checkSuffix")});var v2i=I(QG=>{"use strict";p();Object.defineProperty(QG,"__esModule",{value:!0});QG.DocumentLogEntry=void 0;QG.serializeOffsetRange=Sec;QG.deserializeOffsetRange=Tec;QG.serializeEdit=Iec;QG.deserializeEdit=xec;var y2i=pE(),_2i=sd(),E2i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(E2i||(QG.DocumentLogEntry=E2i={}));function Sec(t){return[t.start,t.endExclusive]}a(Sec,"serializeOffsetRange");function Tec(t){return new _2i.OffsetRange(t[0],t[1])}a(Tec,"deserializeOffsetRange");function Iec(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(Iec,"serializeEdit");function xec(t){return y2i.StringEdit.create(t.map(e=>y2i.StringReplacement.replace(new _2i.OffsetRange(e[0],e[1]),e[2])))}a(xec,"deserializeEdit")});var cge=I(A0=>{"use strict";p();Object.defineProperty(A0,"__esModule",{value:!0});A0.StatelessNextEditTelemetryBuilder=A0.StatelessNextEditResult=A0.NoNextEditReason=A0.FilteredOutReason=A0.StatelessNextEditDocument=A0.StatelessNextEditRequest=A0.RequestEditWindowWithCursorJump=A0.RequestEditWindow=A0.WithStatelessProviderTelemetry=void 0;var C2i=Lx(),xxr=Yu(),wec=Jc(),Rec=Ak(),Pec=pE(),kec=mT(),Dec=v2i(),Nec=hfr(),wxr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};A0.WithStatelessProviderTelemetry=wxr;var Rxr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};A0.RequestEditWindow=Rxr;var Pxr=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)}};A0.RequestEditWindowWithCursorJump=Pxr;var kxr=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 Rec.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Pec.StringEdit.empty,this._result=new wec.DeferredPromise,(0,xxr.assert)(o.length>0),(0,xxr.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(` -`)}`}};A0.StatelessNextEditRequest=Owr;var Bwr=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 Nic.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,Mic.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** +`)}`}};A0.StatelessNextEditRequest=kxr;var Dxr=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 kec.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,Dec.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(` -`)}};A0.StatelessNextEditDocument=Bwr;var WDi;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(WDi||(A0.FilteredOutReason=WDi={}));var O4;(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})(O4||(A0.NoNextEditReason=O4={}));var Lwr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=VDi.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=VDi.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};A0.StatelessNextEditResult=Lwr;var Fwr=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,Oic.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 O4.ActiveDocumentHasNoEdits||e.err instanceof O4.NoSuggestions||(e.err instanceof O4.GotCancelled||e.err instanceof O4.FilteredOut||e.err instanceof O4.PromptTooLarge?d=e.err.message:e.err instanceof O4.FetchFailure||e.err instanceof O4.Uncategorized||e.err instanceof O4.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,Pwr.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}};A0.StatelessNextEditTelemetryBuilder=Fwr});var zDi=I(syt=>{"use strict";p();Object.defineProperty(syt,"__esModule",{value:!0});syt.StreamCopilotAnnotations=void 0;var Uwr=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]??[]}};syt.StreamCopilotAnnotations=Uwr});var ayt=I(o$=>{"use strict";p();Object.defineProperty(o$,"__esModule",{value:!0});o$.ICompletionsFetchService=o$.CompletionsFetchError=o$.Completions=void 0;var Bic=rn(),YDi;(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})(YDi||(o$.Completions=YDi={}));var Qwr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};o$.CompletionsFetchError=Qwr;o$.ICompletionsFetchService=(0,Bic.createServiceIdentifier)("ICompletionsFetchService")});var V5e=I(Dge=>{"use strict";p();Object.defineProperty(Dge,"__esModule",{value:!0});Dge.CacheType=Dge.CustomDataPartMimeTypes=void 0;var KDi;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(KDi||(Dge.CustomDataPartMimeTypes=KDi={}));Dge.CacheType="ephemeral"});var jwr=I(W5e=>{"use strict";p();Object.defineProperty(W5e,"__esModule",{value:!0});W5e.ThinkingDataContainer=void 0;W5e.rawPartAsThinkingData=Fic;var Lic=wo(),JDi=V5e(),qwr=class extends Lic.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:JDi.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};W5e.ThinkingDataContainer=qwr;function Fic(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===JDi.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(Fic,"rawPartAsThinkingData")});var u6=I(CC=>{"use strict";p();Object.defineProperty(CC,"__esModule",{value:!0});CC.FilterReason=CC.FinishedCompletionReason=CC.ChatRole=CC.modelsWithoutResponsesContextManagement=CC.openAIContextManagementCompactionType=void 0;CC.isApiUsage=qic;CC.getCAPITextPart=tNi;CC.rawMessageToCAPI=rNi;var cyt=wo(),Uic=qTe(),Qic=jwr();function qic(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(qic,"isApiUsage");CC.openAIContextManagementCompactionType="compaction";CC.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var ZDi;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(ZDi||(CC.ChatRole=ZDi={}));function tNi(t){return Array.isArray(t)?t.map(e=>tNi(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(tNi,"getCAPITextPart");function rNi(t,e){if(Array.isArray(t))return t.map(n=>rNi(n,e));let r=(0,cyt.toMode)(cyt.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===Uic.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===cyt.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,Qic.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(rNi,"rawMessageToCAPI");var XDi;(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"})(XDi||(CC.FinishedCompletionReason=XDi={}));var eNi;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(eNi||(CC.FilterReason=eNi={}))});var f6=I(d6=>{"use strict";p();Object.defineProperty(d6,"__esModule",{value:!0});d6.getRequestId=Hic;d6.isCopilotAnnotation=Gic;d6.isCodeCitationAnnotation=$ic;d6.isCopilotWebReference=Vic;d6.isOpenAIContextManagementResponse=Wic;d6.isAnthropicContextManagementResponse=zic;d6.isOpenAiFunctionTool=Yic;var jic=u6();function Hic(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(Hic,"getRequestId");function Gic(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(Gic,"isCopilotAnnotation");function $ic(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($ic,"isCodeCitationAnnotation");function Vic(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(Vic,"isCopilotWebReference");function Wic(t){return"type"in t&&t.type===jic.openAIContextManagementCompactionType}a(Wic,"isOpenAIContextManagementResponse");function zic(t){return"applied_edits"in t}a(zic,"isAnthropicContextManagementResponse");function Yic(t){return t.function!==void 0}a(Yic,"isOpenAiFunctionTool")});var nNi=I(ID=>{"use strict";p();Object.defineProperty(ID,"__esModule",{value:!0});ID.asyncIterableMap=Kic;ID.asyncIterableFilter=Jic;ID.asyncIterableMapFilter=Zic;ID.asyncIterableFromArray=Xic;ID.asyncIterableToArray=eoc;ID.asyncIterableConcat=toc;ID.asyncIterableCount=roc;ID.iterableMap=noc;ID.iterableMapFilter=ioc;async function*Kic(t,e){for await(let r of t)yield e(r)}a(Kic,"asyncIterableMap");async function*Jic(t,e){for await(let r of t)await e(r)&&(yield r)}a(Jic,"asyncIterableFilter");async function*Zic(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Zic,"asyncIterableMapFilter");async function*Xic(t){for(let e of t)yield Promise.resolve(e)}a(Xic,"asyncIterableFromArray");async function eoc(t){let e=[];for await(let r of t)e.push(r);return e}a(eoc,"asyncIterableToArray");async function*toc(...t){for(let e of t)yield*e}a(toc,"asyncIterableConcat");async function roc(t){let e=0;for await(let r of t)e++;return e}a(roc,"asyncIterableCount");function*noc(t,e){for(let r of t)yield e(r)}a(noc,"iterableMap");function*ioc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(ioc,"iterableMapFilter")});var iNi=I(Hwr=>{"use strict";p();Object.defineProperty(Hwr,"__esModule",{value:!0});Hwr.getKey=soc;function ooc(t,e){return t!==null&&typeof t=="object"&&e in t}a(ooc,"hasKey");function soc(t,e){return ooc(t,e)?t[e]:void 0}a(soc,"getKey")});var Wwr=I(y0=>{"use strict";p();var aoc=y0&&y0.__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},s$=y0&&y0.__param||function(t,e){return function(r,n){e(r,n,t)}},Gwr;Object.defineProperty(y0,"__esModule",{value:!0});y0.LiveOpenAIFetcher=y0.CMDQuotaExceeded=y0.OpenAIFetcher=y0.ICompletionsOpenAIFetcherService=y0.CopilotUiKind=void 0;y0.sanitizeRequestOptionTelemetry=uNi;y0.postProcessChoices=dNi;var coc=SE(),loc=zDi(),uoc=a4(),Y5e=ayt(),doc=f6(),oNi=o0(),foc=rn(),poc=Yu(),hoc=SP(),moc=cO(),goc=um(),Aoc=Qs(),yoc=pme(),Eoc=s0t(),sNi=vE(),_oc=nNi(),lNi=xl(),Coc=HAt(),aNi=Sge(),voc=iyt(),boc=Rwr(),qT=Tg(),Soc=LOe(),Toc=tre(),z5e=iNi(),lyt=XOe(),Bg=new lNi.Logger("fetchCompletions"),uyt;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(uyt||(y0.CopilotUiKind=uyt={}));function Ioc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(Ioc,"getProcessingTime");function xoc(t){switch(t){case uyt.GhostText:return"copilot-ghost";case uyt.Panel:return"copilot-panel"}}a(xoc,"uiKindToIntent");y0.ICompletionsOpenAIFetcherService=(0,foc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var dyt=class{static{a(this,"OpenAIFetcher")}};y0.OpenAIFetcher=dyt;function woc(t,e,r,n){return(0,Coc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(woc,"getProxyEngineUrl");function uNi(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(uNi,"sanitizeRequestOptionTelemetry");function dNi(t){return(0,_oc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(dNi,"postProcessChoices");y0.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var $wr=Gwr=class extends dyt{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,lyt.getMaxSolutionTokens)(),temperature:(0,lyt.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,lyt.getTopP)(),n:e.count,stop:(0,lyt.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,boc.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,Soc.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(woc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,qT.telemetrizePromptLength)(u));uNi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(qT.telemetry,"request.sent",y);let E=xoc(m),_;_={...g,...this.instantiationService.invokeFunction(sNi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=sNi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new moc.StopWatch,b=o??hoc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof Y5e.Completions.Unexpected&&(0,aNi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(qT.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 Y5e.Completions.RequestCancelled)return this.instantiationService.invokeFunction(qT.telemetry,"networking.cancelRequest",qT.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(qT.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof Y5e.Completions.UnsuccessfulResponse){let k=(0,doc.getRequestId)(x.headers);y.extendWithRequestId(k),k.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(oNi.ITelemetryService).setSharedProperty("capi.assignmentcontext",k.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),Bg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),Bg.debug(this.logTargetService,"request.response properties",y.properties),Bg.debug(this.logTargetService,"request.response measurements",y.measurements),Bg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(qT.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof Y5e.Completions.Unexpected){let k=x.error;if((0,aNi.isAbortError)(k))throw this.instantiationService.invokeFunction(qT.telemetry,"request.cancel",y),k;this.statusReporter.setWarning((0,z5e.getKey)(k,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(qT.telemetry,"request.shownWarning",D),y.properties.message=String((0,z5e.getKey)(k,"name")??""),y.properties.code=String((0,z5e.getKey)(k,"code")??""),y.properties.errno=String((0,z5e.getKey)(k,"errno")??""),y.properties.type=String((0,z5e.getKey)(k,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,Bg.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(k)} after ${N}ms`),Bg.debug(this.logTargetService,"request.error properties",y.properties),Bg.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(qT.telemetry,"request.error",y),k}else(0,poc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(oNi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let k=v.elapsed();y.measurements.totalTimeMs=k;let D=200;Bg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${k}ms`),y.properties.status=String(D),Bg.debug(this.logTargetService,"request.response properties",y.properties),Bg.debug(this.logTargetService,"request.response measurements",y.measurements),Bg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(qT.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(k=>Bg.exception(k,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=Gwr.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:dNi(R),getProcessingTime:a(()=>Ioc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(qT.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,goc.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:y0.CMDQuotaExceeded,title:"Learn More"});let l=(0,Eoc.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),Bg.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(cNi(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`;Bg.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else cNi(n)?(Bg.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(qT.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",Bg.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(Bg.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Bg.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};y0.LiveOpenAIFetcher=$wr;y0.LiveOpenAIFetcher=$wr=Gwr=aoc([s$(0,Aoc.IInstantiationService),s$(1,Toc.ICompletionsRuntimeModeService),s$(2,lNi.ICompletionsLogTargetService),s$(3,yoc.ICompletionsCopilotTokenManager),s$(4,voc.ICompletionsStatusReporter),s$(5,coc.IAuthenticationService),s$(6,Y5e.ICompletionsFetchService),s$(7,uoc.IEnvService)],$wr);function cNi(t){return t.status>=400&&t.status<500}a(cNi,"isClientError");var Vwr=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new loc.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 Ywr=I(zwr=>{"use strict";p();Object.defineProperty(zwr,"__esModule",{value:!0});zwr.appendToCache=Roc;function Roc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(Roc,"appendToCache")});var gNi=I(jd=>{"use strict";p();var koc=jd&&jd.__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},xre=jd&&jd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jd,"__esModule",{value:!0});jd.CompletionsFromNetwork=jd.logger=void 0;jd.postProcessChoices=fyt;jd.makeGhostAPIChoice=mNi;jd.telemetryPerformance=Xwr;var K5e=Pge(),Poc=L_(),J5e=Gx(),Doc=Yu(),Noc=CT(),Moc=Qs(),fNi=vE(),Ooc=jvr(),Boc=VA(),hNi=xl(),Loc=zxr(),Jwr=Wwr(),Foc=XOe(),Uoc=Tg(),Qoc=tre(),qoc=Zme(),Kwr=Ywr(),joc=UOe(),pNi=xG(),xD=tge();jd.logger=new hNi.Logger("ghostText");var Zwr=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 jd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,xD.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return jd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,xD.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return jd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,xD.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(Xwr,"performance",h,c,l),jd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=fyt(h);m&&((0,Kwr.appendToCache)(this.completionsCacheService,e,m),jd.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;jd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=fyt(y,A);E&&(A.push(E),(0,Kwr.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[mNi(m,{forceSingleLine:!1}),g],telemetryData:(0,xD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:pNi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,xD.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 jd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,xD.mkCanceledResultTelemetry)(r)};let h=fyt(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,Kwr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(Xwr,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,xD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:pNi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new K5e.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=J5e.Result.ok(void 0);break;case"canceled":f=J5e.Result.error(new K5e.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=J5e.Result.error(new K5e.NoNextEditReason.NoSuggestions(new Noc.StringText(""),void 0));break;case"failed":f=J5e.Result.error(new K5e.NoNextEditReason.Uncategorized(Poc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=J5e.Result.error(new K5e.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Doc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){jd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,Foc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,fNi.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===fNi.BlockMode.MoreMultiline&&qoc.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:Jwr.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:Jwr.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,xD.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(jd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,xD.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,Loc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,xD.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>jd.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,xD.mkBasicResultTelemetry)(r)}}}};jd.CompletionsFromNetwork=Zwr;jd.CompletionsFromNetwork=Zwr=koc([xre(0,Moc.IInstantiationService),xre(1,Jwr.ICompletionsOpenAIFetcherService),xre(2,Boc.ICompletionsFeaturesService),xre(3,Qoc.ICompletionsRuntimeModeService),xre(4,hNi.ICompletionsLogTargetService),xre(5,joc.ICompletionsCacheService),xre(6,Ooc.ICompletionsUserErrorNotifierService)],Zwr);function fyt(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(fyt,"postProcessChoices");function mNi(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`)}};A0.StatelessNextEditDocument=Dxr;var b2i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(b2i||(A0.FilteredOutReason=b2i={}));var b4;(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})(b4||(A0.NoNextEditReason=b4={}));var Nxr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=C2i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=C2i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};A0.StatelessNextEditResult=Nxr;var Mxr=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,Nec.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 b4.ActiveDocumentHasNoEdits||e.err instanceof b4.NoSuggestions||(e.err instanceof b4.GotCancelled||e.err instanceof b4.FilteredOut||e.err instanceof b4.PromptTooLarge?d=e.err.message:e.err instanceof b4.FetchFailure||e.err instanceof b4.Uncategorized||e.err instanceof b4.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,xxr.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}};A0.StatelessNextEditTelemetryBuilder=Mxr});var S2i=I(SAt=>{"use strict";p();Object.defineProperty(SAt,"__esModule",{value:!0});SAt.StreamCopilotAnnotations=void 0;var Oxr=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]??[]}};SAt.StreamCopilotAnnotations=Oxr});var TAt=I(qG=>{"use strict";p();Object.defineProperty(qG,"__esModule",{value:!0});qG.ICompletionsFetchService=qG.CompletionsFetchError=qG.Completions=void 0;var Mec=rn(),T2i;(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})(T2i||(qG.Completions=T2i={}));var Bxr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};qG.CompletionsFetchError=Bxr;qG.ICompletionsFetchService=(0,Mec.createServiceIdentifier)("ICompletionsFetchService")});var E5e=I(lge=>{"use strict";p();Object.defineProperty(lge,"__esModule",{value:!0});lge.CacheType=lge.CustomDataPartMimeTypes=void 0;var I2i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(I2i||(lge.CustomDataPartMimeTypes=I2i={}));lge.CacheType="ephemeral"});var Fxr=I(_5e=>{"use strict";p();Object.defineProperty(_5e,"__esModule",{value:!0});_5e.ThinkingDataContainer=void 0;_5e.rawPartAsThinkingData=Bec;var Oec=Io(),x2i=E5e(),Lxr=class extends Oec.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:x2i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};_5e.ThinkingDataContainer=Lxr;function Bec(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===x2i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(Bec,"rawPartAsThinkingData")});var Y8=I(Av=>{"use strict";p();Object.defineProperty(Av,"__esModule",{value:!0});Av.FilterReason=Av.FinishedCompletionReason=Av.ChatRole=Av.modelsWithoutResponsesContextManagement=Av.openAIContextManagementCompactionType=void 0;Av.isApiUsage=Uec;Av.getCAPITextPart=k2i;Av.rawMessageToCAPI=D2i;var IAt=Io(),Lec=hTe(),Fec=Fxr();function Uec(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(Uec,"isApiUsage");Av.openAIContextManagementCompactionType="compaction";Av.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var w2i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(w2i||(Av.ChatRole=w2i={}));function k2i(t){return Array.isArray(t)?t.map(e=>k2i(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(k2i,"getCAPITextPart");function D2i(t,e){if(Array.isArray(t))return t.map(n=>D2i(n,e));let r=(0,IAt.toMode)(IAt.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===Lec.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===IAt.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,Fec.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(D2i,"rawMessageToCAPI");var R2i;(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"})(R2i||(Av.FinishedCompletionReason=R2i={}));var P2i;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(P2i||(Av.FilterReason=P2i={}))});var J8=I(K8=>{"use strict";p();Object.defineProperty(K8,"__esModule",{value:!0});K8.getRequestId=qec;K8.isCopilotAnnotation=jec;K8.isCodeCitationAnnotation=Hec;K8.isCopilotWebReference=Gec;K8.isOpenAIContextManagementResponse=$ec;K8.isAnthropicContextManagementResponse=Vec;K8.isOpenAiFunctionTool=Wec;var Qec=Y8();function qec(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(qec,"getRequestId");function jec(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(jec,"isCopilotAnnotation");function Hec(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(Hec,"isCodeCitationAnnotation");function Gec(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(Gec,"isCopilotWebReference");function $ec(t){return"type"in t&&t.type===Qec.openAIContextManagementCompactionType}a($ec,"isOpenAIContextManagementResponse");function Vec(t){return"applied_edits"in t}a(Vec,"isAnthropicContextManagementResponse");function Wec(t){return t.function!==void 0}a(Wec,"isOpenAiFunctionTool")});var N2i=I(yD=>{"use strict";p();Object.defineProperty(yD,"__esModule",{value:!0});yD.asyncIterableMap=zec;yD.asyncIterableFilter=Yec;yD.asyncIterableMapFilter=Kec;yD.asyncIterableFromArray=Jec;yD.asyncIterableToArray=Zec;yD.asyncIterableConcat=Xec;yD.asyncIterableCount=etc;yD.iterableMap=ttc;yD.iterableMapFilter=rtc;async function*zec(t,e){for await(let r of t)yield e(r)}a(zec,"asyncIterableMap");async function*Yec(t,e){for await(let r of t)await e(r)&&(yield r)}a(Yec,"asyncIterableFilter");async function*Kec(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Kec,"asyncIterableMapFilter");async function*Jec(t){for(let e of t)yield Promise.resolve(e)}a(Jec,"asyncIterableFromArray");async function Zec(t){let e=[];for await(let r of t)e.push(r);return e}a(Zec,"asyncIterableToArray");async function*Xec(...t){for(let e of t)yield*e}a(Xec,"asyncIterableConcat");async function etc(t){let e=0;for await(let r of t)e++;return e}a(etc,"asyncIterableCount");function*ttc(t,e){for(let r of t)yield e(r)}a(ttc,"iterableMap");function*rtc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(rtc,"iterableMapFilter")});var M2i=I(Uxr=>{"use strict";p();Object.defineProperty(Uxr,"__esModule",{value:!0});Uxr.getKey=itc;function ntc(t,e){return t!==null&&typeof t=="object"&&e in t}a(ntc,"hasKey");function itc(t,e){return ntc(t,e)?t[e]:void 0}a(itc,"getKey")});var Hxr=I(y0=>{"use strict";p();var otc=y0&&y0.__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},jG=y0&&y0.__param||function(t,e){return function(r,n){e(r,n,t)}},Qxr;Object.defineProperty(y0,"__esModule",{value:!0});y0.LiveOpenAIFetcher=y0.CMDQuotaExceeded=y0.OpenAIFetcher=y0.ICompletionsOpenAIFetcherService=y0.CopilotUiKind=void 0;y0.sanitizeRequestOptionTelemetry=Q2i;y0.postProcessChoices=q2i;var stc=vE(),atc=S2i(),ctc=Y5(),C5e=TAt(),ltc=J8(),O2i=o0(),utc=rn(),dtc=Yu(),ftc=Ak(),ptc=KM(),htc=um(),mtc=Ls(),gtc=G0e(),Atc=Sht(),B2i=EE(),ytc=N2i(),U2i=Tl(),Etc=aAt(),L2i=tge(),_tc=CAt(),vtc=Txr(),OT=xg(),Ctc=uOe(),btc=Fte(),v5e=M2i(),xAt=IOe(),Fg=new U2i.Logger("fetchCompletions"),wAt;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(wAt||(y0.CopilotUiKind=wAt={}));function Stc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(Stc,"getProcessingTime");function Ttc(t){switch(t){case wAt.GhostText:return"copilot-ghost";case wAt.Panel:return"copilot-panel"}}a(Ttc,"uiKindToIntent");y0.ICompletionsOpenAIFetcherService=(0,utc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var RAt=class{static{a(this,"OpenAIFetcher")}};y0.OpenAIFetcher=RAt;function Itc(t,e,r,n){return(0,Etc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(Itc,"getProxyEngineUrl");function Q2i(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(Q2i,"sanitizeRequestOptionTelemetry");function q2i(t){return(0,ytc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(q2i,"postProcessChoices");y0.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var qxr=Qxr=class extends RAt{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,xAt.getMaxSolutionTokens)(),temperature:(0,xAt.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,xAt.getTopP)(),n:e.count,stop:(0,xAt.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,vtc.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,Ctc.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(Itc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,OT.telemetrizePromptLength)(u));Q2i(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(OT.telemetry,"request.sent",y);let E=Ttc(m),_;_={...g,...this.instantiationService.invokeFunction(B2i.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=B2i.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new ptc.StopWatch,b=o??ftc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof C5e.Completions.Unexpected&&(0,L2i.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(OT.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 C5e.Completions.RequestCancelled)return this.instantiationService.invokeFunction(OT.telemetry,"networking.cancelRequest",OT.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(OT.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof C5e.Completions.UnsuccessfulResponse){let P=(0,ltc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(O2i.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),Fg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),Fg.debug(this.logTargetService,"request.response properties",y.properties),Fg.debug(this.logTargetService,"request.response measurements",y.measurements),Fg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(OT.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof C5e.Completions.Unexpected){let P=x.error;if((0,L2i.isAbortError)(P))throw this.instantiationService.invokeFunction(OT.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,v5e.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(OT.telemetry,"request.shownWarning",D),y.properties.message=String((0,v5e.getKey)(P,"name")??""),y.properties.code=String((0,v5e.getKey)(P,"code")??""),y.properties.errno=String((0,v5e.getKey)(P,"errno")??""),y.properties.type=String((0,v5e.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,Fg.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),Fg.debug(this.logTargetService,"request.error properties",y.properties),Fg.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(OT.telemetry,"request.error",y),P}else(0,dtc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(O2i.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;Fg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),Fg.debug(this.logTargetService,"request.response properties",y.properties),Fg.debug(this.logTargetService,"request.response measurements",y.measurements),Fg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(OT.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>Fg.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=Qxr.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:q2i(R),getProcessingTime:a(()=>Stc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(OT.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,htc.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:y0.CMDQuotaExceeded,title:"Learn More"});let l=(0,Atc.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),Fg.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(F2i(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`;Fg.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else F2i(n)?(Fg.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(OT.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",Fg.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(Fg.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Fg.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};y0.LiveOpenAIFetcher=qxr;y0.LiveOpenAIFetcher=qxr=Qxr=otc([jG(0,mtc.IInstantiationService),jG(1,btc.ICompletionsRuntimeModeService),jG(2,U2i.ICompletionsLogTargetService),jG(3,gtc.ICompletionsCopilotTokenManager),jG(4,_tc.ICompletionsStatusReporter),jG(5,stc.IAuthenticationService),jG(6,C5e.ICompletionsFetchService),jG(7,ctc.IEnvService)],qxr);function F2i(t){return t.status>=400&&t.status<500}a(F2i,"isClientError");var jxr=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new atc.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 $xr=I(Gxr=>{"use strict";p();Object.defineProperty(Gxr,"__esModule",{value:!0});Gxr.appendToCache=xtc;function xtc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(xtc,"appendToCache")});var V2i=I(Qd=>{"use strict";p();var wtc=Qd&&Qd.__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},ure=Qd&&Qd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Qd,"__esModule",{value:!0});Qd.CompletionsFromNetwork=Qd.logger=void 0;Qd.postProcessChoices=PAt;Qd.makeGhostAPIChoice=$2i;Qd.telemetryPerformance=Yxr;var b5e=cge(),Rtc=M_(),S5e=Lx(),Ptc=Yu(),ktc=mT(),Dtc=Ls(),j2i=EE(),Ntc=Fvr(),Mtc=JA(),G2i=Tl(),Otc=GIr(),Wxr=Hxr(),Btc=IOe(),Ltc=xg(),Ftc=Fte(),Utc=Rme(),Vxr=$xr(),Qtc=fOe(),H2i=lG(),ED=Dme();Qd.logger=new G2i.Logger("ghostText");var zxr=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 Qd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,ED.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Qd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,ED.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Qd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,ED.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(Yxr,"performance",h,c,l),Qd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=PAt(h);m&&((0,Vxr.appendToCache)(this.completionsCacheService,e,m),Qd.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;Qd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=PAt(y,A);E&&(A.push(E),(0,Vxr.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[$2i(m,{forceSingleLine:!1}),g],telemetryData:(0,ED.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:H2i.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,ED.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 Qd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,ED.mkCanceledResultTelemetry)(r)};let h=PAt(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,Vxr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(Yxr,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,ED.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:H2i.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new b5e.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=S5e.Result.ok(void 0);break;case"canceled":f=S5e.Result.error(new b5e.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=S5e.Result.error(new b5e.NoNextEditReason.NoSuggestions(new ktc.StringText(""),void 0));break;case"failed":f=S5e.Result.error(new b5e.NoNextEditReason.Uncategorized(Rtc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=S5e.Result.error(new b5e.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Ptc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Qd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,Btc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,j2i.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===j2i.BlockMode.MoreMultiline&&Utc.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:Wxr.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:Wxr.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,ED.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Qd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,ED.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,Otc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,ED.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Qd.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,ED.mkBasicResultTelemetry)(r)}}}};Qd.CompletionsFromNetwork=zxr;Qd.CompletionsFromNetwork=zxr=wtc([ure(0,Dtc.IInstantiationService),ure(1,Wxr.ICompletionsOpenAIFetcherService),ure(2,Mtc.ICompletionsFeaturesService),ure(3,Ftc.ICompletionsRuntimeModeService),ure(4,G2i.ICompletionsLogTargetService),ure(5,Qtc.ICompletionsCacheService),ure(6,Ntc.ICompletionsUserErrorNotifierService)],zxr);function PAt(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(PAt,"postProcessChoices");function $2i(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(mNi,"makeGhostAPIChoice");function Xwr(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,Uoc.telemetry)(t,`ghostText.${e}`,l)}a(Xwr,"telemetryPerformance")});var ANi=I(pyt=>{"use strict";p();Object.defineProperty(pyt,"__esModule",{value:!0});pyt.contextualFilterCharacterMap=void 0;pyt.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 yNi=I(eRr=>{"use strict";p();Object.defineProperty(eRr,"__esModule",{value:!0});eRr.multilineModelPredict=Hoc;function Hoc(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 k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.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 q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let F;t[294]>1e-35?F=-.0384794324818203:t[266]>1e-35?F=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?F=.07432960094940501:F=-.035248735855751855:t[134]>1e-35?F=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?F=-.01706896375068821:F=.08212247914968074:t[2]>59.50000000000001?F=-.09546478958824225:t[6]>53.50000000000001?F=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?F=.02816463285971267:F=.15449139016588445:F=-.10199787406123524:F=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?F=-.13924786681478077:F=-.0072772442570213335:t[39]>1e-35?F=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?F=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?F=-.11174465335620831:F=.00013144040097180107:F=-.08493919336681105:t[42]>1e-35?F=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?F=-.015540659878839153:F=-.14442609417300142:t[21]>1e-35?F=-.025251979447574083:F=.0023698372645272847:t[18]>1e-35?F=.07269739695712212:t[8]>2592.5000000000005?F=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?F=-.01835130329646532:t[9]>45.50000000000001?F=.02023047454629885:F=.16469378262221102:F=-.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 W;t[183]>1e-35?t[17]>1e-35?W=.030100940443356424:t[10]>1.5000000000000002?W=-.10861112216742408:W=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?W=-.032062878390325456:W=-.10808232631806887:t[8]>1641.5000000000002?W=-.06147013392655731:t[4]>12.500000000000002?W=.03324767551088266:t[145]>1e-35?W=.028851633810612017:W=-.054871239091792784:t[134]>1e-35?W=-.023813968121342108:t[266]>1e-35?W=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?W=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?W=-.025350325484720576:W=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?W=.056817276537534815:W=-.07674158463557636:W=-.06335553143454145:t[1]>56.50000000000001?W=.16390494217299284:W=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?W=.041717597065890205:W=-.10357913492269129:t[10]>29.500000000000004?W=.1365512866715726:W=.020600048310575665:W=.09708785634773187:W=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?W=-.03146213719547347:W=.11784024316238083:W=-.050940520532045355:W=-.047988344143075616:t[191]>1e-35?W=.028764654731460032:W=.0011911575567860023;let V;t[294]>1e-35?t[10]>50.50000000000001?V=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?V=-.05103908560370243:V=.05002066201169583:V=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?V=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?V=.127983140816313:V=-.05436534163636867:V=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?V=-.009504203657088933:t[8]>819.5000000000001?V=.18689664822602375:V=.03635576744011826:V=-.029862411809998525:t[223]>1e-35?V=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?V=-.09405026597863717:t[0]>4153.500000000001?V=.053577663326799765:V=-.05062127873995668:V=.06512222894425874:t[39]>1e-35?V=-.04985311717827547:t[51]>1e-35?V=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?V=-.02860634573675884:V=.08863753005590103:V=.11158892111063744:t[0]>655.5000000000001?V=-.031005736641654926:V=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?V=-.00843386136334982:V=-.05273594615999777:V=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?V=-.015774115523598486:V=.10147367091236065:V=-.048307000563071016:V=.002118376117677254;let G;t[8]>1014.5000000000001?t[9]>137.50000000000003?G=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?G=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?G=.07211107542565391:G=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?G=-.0751486415451188:t[1]>59.50000000000001?G=.13459005084554104:G=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?G=.06715575425741895:G=-.005895690393702183:t[8]>2915.5000000000005?G=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?G=-.00029068886245881074:G=.0613467393188786:t[148]>1e-35?G=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?G=.003887223773199377:G=-.08553893131979015:G=.025654192706396767:G=-.05651733979610658:G=-.02039913645229667:t[2]>7.500000000000001?G=-.1058450646728524:G=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?G=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?G=.1283258201586378:G=-.01718135372229775:G=-.07702452408491414:t[125]>1e-35?G=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?G=.04273051857848212:G=-.04533122948101463:t[2]>196.50000000000003?G=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?G=.0231032972703664:G=-.04807386814498683:G=.002729435991332102;let Y;t[179]>1e-35?Y=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?Y=.026484626664041125:t[10]>1.5000000000000002?Y=-.10187000872941615:Y=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Y=.09574540795390041:Y=-.06454986703691233:Y=-.11411849349353141:t[266]>1e-35?Y=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?Y=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?Y=-.04403391373512386:Y=.1132928075412222:t[2]>47.50000000000001?Y=-.09700191391838056:Y=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?Y=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?Y=-.001668912999010927:Y=-.02363511102970245:t[8]>58.50000000000001?Y=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?Y=.0911011436534449:t[1]>28.500000000000004?Y=-.07192390493729035:Y=.06913818091291246:Y=-.012312625373699222:Y=.06784496312307986:Y=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?Y=.0026564453057705273:Y=-.025425772389361445:t[122]>1e-35?Y=-.12046786388602149:t[0]>3183.5000000000005?Y=.01162092842804907:t[91]>1e-35?Y=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?Y=-.0001647792543020228:Y=-.023664538532907665:Y=.01609078206180752;let re;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?re=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?re=-.017696526862422682:re=.1450050954613223:re=-.05406930069823832:re=-.08308700260259043:t[120]>1e-35?re=.058316269489189415:t[297]>1e-35?t[94]>1e-35?re=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?re=.038431826961746934:re=-.05937462906539856:t[9]>65.50000000000001?re=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?re=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?re=-.09579030954062734:re=.025064711572811746:re=.02579440518821548:re=.1044440128091862:re=-.058348633139536844:re=.07766788227934436:re=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?re=.07463684068207214:re=.18244269035484484:t[6]>39.50000000000001?re=-.06050050067471004:re=.05787759066913493:re=.010783225857972171:re=.1674891243602606:t[4]>9.500000000000002?re=-.004814132027475892:re=-.14543299413454813:re=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?re=-.07634466313617769:re=.0287825335169114:re=-.06894721943300268:re=-.00023988459059521937;let j;t[131]>1e-35?t[1]>93.50000000000001?j=-.05706887458825395:t[2]>1.5000000000000002?j=.011446637886629108:j=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?j=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?j=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?j=.026278724448495064:j=.17053138400480508:t[0]>4463.500000000001?j=-.06482289890096041:j=.03026516489536295:j=-.031785170717683144:j=.1312690622980455:t[13]>1e-35?j=.14336922540461444:j=.03523850945454039:j=-.015407465968975714:t[39]>1e-35?j=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?j=-.0659975068798723:j=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?j=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?j=.057409156184759516:j=.2024322059866388:j=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?j=.010648654146284154:t[308]>1e-35?j=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?j=.12364025998551711:j=-.02247495081065243:t[1]>22.500000000000004?j=-.0726295464624251:j=.03481895086048152:t[0]>4331.500000000001?j=-.04775443357020673:j=.07172377425057568:t[2]>89.50000000000001?j=-.11782645274716962:j=.00010092665257989378;let X;t[147]>1e-35?X=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?X=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?X=-.016101990375700172:t[0]>2579.5000000000005?X=-.13045089661551845:X=-.02874367814784938:X=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?X=.17084176915326055:X=-.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?X=.10591712319944074:X=-.024082167264285:X=.16497698867036126:X=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?X=-.021012910475524206:X=-.13058422554298485:t[0]>1102.5000000000002?X=.10955864175201457:X=-.03566689354348996:t[1]>11.500000000000002?X=-.02093884208606101:X=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?X=-.013861861436128482:X=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?X=.10163873449625677:X=-.02779270277623805:t[1]>26.500000000000004?X=-.08035058228527389:X=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?X=-.007028075523033826:X=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?X=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?X=-.0032075580718124892:X=-.04442829143298883:X=-.06597073245775804:X=.0015594090939337751;let ie;t[223]>1e-35?t[8]>668.5000000000001?ie=-.12803889879260094:ie=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ie=.08967966612917375:t[1]>39.50000000000001?ie=-.059791671514498074:ie=.05648934961902822:t[2]>59.50000000000001?ie=-.08633234097449628:t[6]>53.50000000000001?ie=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ie=.025606129643140924:ie=.13835395886271978:ie=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ie=-.09975506556937946:t[10]>36.50000000000001?ie=-.09427724661655643:t[10]>24.500000000000004?ie=.07329330653410447:ie=-.02271182965807972:ie=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ie=-.05082091374050816:ie=.1687114435254966:t[0]>2314.5000000000005?ie=-.06422664016383926:ie=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ie=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ie=-.1274167728754332:ie=.01308079126447365:t[4]>73.50000000000001?ie=.13854015371106546:t[4]>48.50000000000001?ie=-.03684255740123261:t[6]>45.50000000000001?ie=.10329912215813097:t[10]>77.50000000000001?ie=-.08630788656925215:ie=.031022006843800853:t[1]>25.500000000000004?ie=-.08278381528048026:ie=.06664374548141594:t[84]>1e-35?ie=-.05624227409079396:ie=.00012184182357340415;let we;t[179]>1e-35?we=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?we=-.07595415373151816:we=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?we=.022822510448266862:we=.17491569312933697:we=-.058362287133533565:t[2]>2.5000000000000004?we=-.03633895806364428:we=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?we=-.07294848747514579:we=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?we=-.07009535282685533:t[8]>2640.0000000000005?we=-.051761240111316276:t[131]>1e-35?we=-.06245774419231631:we=.03495606662854905:we=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?we=.0015036626973581122:we=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?we=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?we=.022343994371919224:we=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?we=.07724450228328664:t[0]>3853.5000000000005?we=-.15671707454435677:t[10]>28.500000000000004?we=-.10179090671841723:we=.014878216919760927:we=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?we=.14054154485273487:we=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?we=-.08632985141410315:we=.005524157938954954:we=-.08802502622523681:we=-.0004649168897260341;let Ae;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?Ae=-.007458687464321174:Ae=-.09444966249102484:t[1]>23.500000000000004?Ae=.08564129697360716:Ae=-.07105002902845851:Ae=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?Ae=-.10326216566705966:t[1]>26.500000000000004?Ae=.0050539832484585365:Ae=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?Ae=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?Ae=.05783632021087773:t[10]>17.500000000000004?Ae=-.06720598671764105:t[1]>47.50000000000001?Ae=.097495825172558:Ae=-.013372242800584872:Ae=-.06463226787713715:t[42]>1e-35?Ae=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?Ae=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?Ae=.11051270080118503:Ae=.027719462817590454:t[8]>597.5000000000001?Ae=-.08441503592016869:Ae=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?Ae=-.12190088985091102:Ae=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?Ae=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?Ae=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?Ae=.016585157185448045:Ae=-.11032043771149425:Ae=.01586986028570486:t[8]>388.50000000000006?Ae=-.10592413013261853:Ae=.04930703248769364:t[13]>1e-35?Ae=.003621937787920821:Ae=-.0013786331198611841;let De;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?De=.009769895322846493:De=-.10620052926943656:t[9]>19.500000000000004?De=.03781202525403449:t[9]>14.500000000000002?De=-.11485785321365344:t[9]>6.500000000000001?De=.07677177833073881:t[0]>4342.500000000001?De=-.07079285609687631:t[49]>1e-35?De=.06156814809246001:De=-.014788509042554625:De=-.032659201618470655:t[5]>5207.500000000001?De=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?De=-.03094160322187924:t[1]>29.500000000000004?De=.09474646043921069:De=.023445783928231618:De=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?De=-.07164443768784848:t[1]>29.500000000000004?De=.089473622509272:t[8]>597.5000000000001?De=-.08155349903101317:De=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?De=-.004003900679358653:t[190]>1e-35?De=-.09236113461485262:t[8]>3198.5000000000005?De=-.0124130160451179:De=.018453070064009328:t[15]>1e-35?De=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?De=-.0009580759587680961:De=-.03227283036698222:De=.01369287669536875:t[1]>50.50000000000001?De=-.04213060332500437:t[35]>1e-35?De=-.11508095777767471:t[190]>1e-35?De=-.08611884672400155:t[297]>1e-35?De=.05723551879433584:De=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let J;t[3]>7.500000000000001?J=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?J=.03642374718166293:J=.16379973756366603:J=-.03946685266127979:t[186]>1e-35?J=.07618896623420895:t[96]>1e-35?J=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?J=-.022822371600847505:J=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?J=.044416424920571296:J=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?J=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?J=.1061937286809567:t[7]>54.50000000000001?J=.11487507743121311:t[8]>819.5000000000001?J=-.07181278009001418:t[10]>25.500000000000004?J=.13499019430369633:t[1]>31.500000000000004?J=.09032979489780704:J=-.12754166393372374:t[9]>37.50000000000001?J=-.05093963635361407:J=-.005026651151683848:t[9]>2.5000000000000004?J=.07619735785573735:J=.012363301341532136:t[26]>1e-35?J=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?J=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?J=-.10764172927882483:J=.01890760098464703:J=.06573095405846417:t[8]>634.5000000000001?J=-.00783575973273707:J=-.050612689680229306:t[1]>22.500000000000004?J=-.0016842490401359626:J=.0738227088444087:J=-.02663970950432175;let z;t[31]>1e-35?t[8]>17.500000000000004?z=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?z=.007191286124908192:z=-.09347881647636902:t[10]>1.5000000000000002?z=.07938758708008091:z=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?z=.12321804057595996:z=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?z=-.04644244754790671:z=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?z=.0706108609273337:t[2]>40.50000000000001?z=-.028046629962303716:z=-.06497613993109329:z=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?z=-.03056331974267756:z=-.11886389712497057:z=.053364962175658184:t[8]>2233.5000000000005?z=-.0448152521157682:z=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?z=.03818796510453344:z=.23673992112982362:z=.02858814226507374:t[10]>44.50000000000001?z=-.1125863771551199:z=.009129996952394916:t[1]>7.500000000000001?z=-.004374525302461639:z=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?z=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?z=-.13677189943034931:t[10]>2.5000000000000004?z=.039591891437078086:z=-.09312596849507347:z=-.02423172142089822:z=.0009836986075266283;let le;t[189]>1e-35?t[0]>5269.500000000001?le=-.103183298350443:t[2]>51.50000000000001?le=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?le=-.05186168947388339:le=.0496996365539082:t[10]>23.500000000000004?le=.1404445738719:t[93]>1e-35?le=.0027146310074558505:t[5]>3821.5000000000005?le=.002153033152069652:t[4]>2.5000000000000004?le=.007663539551317215:le=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?le=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?le=-.021479467709980358:le=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?le=.021660293256233334:le=-.0927396152303864:le=.0665074081601698:t[0]>1550.5000000000002?le=.08972407105958534:le=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?le=.06761927942466854:le=-.015762168112653286:t[17]>1e-35?le=.10311304131145381:le=-.017672785252336027:le=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?le=-.10638321435298535:le=.0007073011744385905:t[18]>1e-35?le=-.027056185501334325:t[145]>1e-35?le=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?le=.09762140519655171:t[9]>110.50000000000001?le=-.06581942957595835:t[6]>54.50000000000001?le=.04959634035251596:le=.0022616298654554207:le=-.007437620924990854;let K;t[179]>1e-35?K=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?K=.1470294450403005:K=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?K=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?K=.07965955447707423:t[10]>10.500000000000002?K=-.09236156404262426:K=.03396273196231458:K=-.13246465021467432:K=.07092822261735353:K=-.08753829085942:K=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?K=.004705878789890202:K=.13775378964952867:K=-.04770928980587811:t[10]>29.500000000000004?K=.011221519891071544:t[0]>3853.5000000000005?K=.06365381191628273:K=.15506252245336827:t[1]>37.50000000000001?K=-.07254777021042061:K=.026514587757252385:t[308]>1e-35?K=.04115804816617256:t[10]>26.500000000000004?K=.02077721353011946:t[5]>3548.5000000000005?K=-.1280907116663952:K=-.021974774274438:t[306]>1e-35?K=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?K=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?K=-.005710865560475598:t[94]>1e-35?K=-.06751507982853555:K=.027250040757588703:t[9]>52.50000000000001?K=.07060357924595577:K=-.030297760713011795:K=-.0006005400085266517;let ae;t[113]>1e-35?ae=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ae=-.06996356565314456:ae=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ae=-.08317707559926495:t[21]>1e-35?ae=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ae=-.010538203005984922:ae=.08454819465349446:t[9]>124.50000000000001?ae=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ae=-.08542251249346582:t[9]>50.50000000000001?ae=-.023428882537657472:ae=.010042500833979073:ae=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ae=.03006025206979096:t[9]>108.50000000000001?ae=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ae=.04222035773042132:ae=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ae=-.07209095448054853:ae=.028065954981903313:ae=.08714651929917122:ae=-.006678820669279169:t[10]>40.50000000000001?ae=.006982396294941626:ae=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ae=-.09351114982645548:t[4]>3.5000000000000004?ae=-.004837550129223451:ae=-.08324141237464677:t[303]>1e-35?ae=.10703037493990825:t[9]>156.50000000000003?ae=-.10803018621648303:t[116]>1e-35?ae=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ae=.10261721665006701:ae=.018994509090668264:ae=.0011244262442038839;let Me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Me=-.08404263465005328:t[0]>3682.5000000000005?Me=.041259223920298876:t[1]>29.500000000000004?Me=-.09541257493441671:Me=.001482192721625409:Me=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Me=-.08268996098437432:t[230]>1e-35?Me=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Me=-913218977737457e-19:t[4]>10.500000000000002?Me=-.056334165674005156:t[127]>1e-35?Me=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Me=-.04231200150318989:t[10]>42.50000000000001?Me=.10182973257894812:Me=.015934763950068445:Me=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Me=-.041117068322885315:Me=.1167767830037126:Me=.13611206992387337:t[10]>41.50000000000001?Me=-.07120286010564107:Me=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Me=-.07702290997669524:t[198]>1e-35?Me=.08776558554437136:Me=-.008290740324975692:t[2]>32.50000000000001?Me=.07198457624219955:Me=.005463113714361629:Me=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Me=.03295785445437507:Me=.15140250150674536:Me=-.035613213948910254:t[186]>1e-35?Me=.06849425535860769:t[96]>1e-35?Me=.06028225812727254:Me=-.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 se;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?se=-.01386103677247845:se=.11386694333005128:t[4]>27.500000000000004?se=-.021862617610091336:t[2]>31.500000000000004?se=.0828858469030438:se=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?se=.11303635767048735:se=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?se=-.04238798044549342:se=.022091190130494303:t[5]>5082.500000000001?se=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?se=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?se=-.04291104140431434:t[17]>1e-35?se=.11256797532342613:se=-.017206916368289193:se=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?se=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?se=.03581712466863222:se=.14770264307668884:t[8]>73.50000000000001?se=-.13093289429740068:se=.042461737442702936:t[52]>1e-35?se=.0501831919044939:se=-.010450249720465756:se=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?se=.0005381332165438493:se=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?se=.04849637311285226:se=-.036671377119808564:t[0]>421.50000000000006?se=.00020968499911058945:se=.11636422423182405:se=-.12687837788222575:se=.0012774367867215346;let Ie;t[120]>1e-35?Ie=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ie=-.042799574885345304:Ie=.07412430171193245:Ie=-.11248270469336048:t[193]>1e-35?Ie=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ie=.028911612178122104:Ie=.12326369727728437:t[0]>4091.5000000000005?Ie=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ie=.1159839898100149:Ie=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ie=-.0216343737351583:Ie=-.1220272260878369:t[2]>18.500000000000004?Ie=.09152924475072398:t[8]>55.50000000000001?Ie=.039508716651005665:Ie=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ie=.06793009902674053:Ie=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ie=-.04391068849624096:Ie=.04009967593394672:t[8]>1085.5000000000002?Ie=-.024773826356034825:Ie=-.13919707884246582:Ie=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ie=-.11567917501901476:Ie=-.006813640337684114:t[3]>7.500000000000001?Ie=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ie=-.001754586408351048:Ie=-.055422422450722056:Ie=-.06090032532532226:t[0]>5269.500000000001?Ie=.11787981735983527:Ie=-.00198119768540783:Ie=.00210412924303036;let _e;t[294]>1e-35?t[10]>50.50000000000001?_e=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?_e=-.06063239096209816:_e=.03317022411417386:_e=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?_e=-.013608609329298802:_e=.09078000157330264:t[99]>1e-35?_e=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?_e=-.07536137260189814:_e=.006253266595455118:t[10]>28.500000000000004?_e=-.006106041147592768:t[9]>156.50000000000003?_e=-.11828932797811101:t[94]>1e-35?_e=-.02566078479505714:t[303]>1e-35?_e=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?_e=-.08401252789168523:t[5]>4244.500000000001?_e=.026372887658499107:t[1]>16.500000000000004?_e=-.027836756345634026:_e=.09205362097909099:_e=.00934612788718244:t[203]>1e-35?_e=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?_e=-.09580979052540028:t[1]>50.50000000000001?_e=-.06402211827281554:_e=.08342858760095972:t[2]>36.50000000000001?_e=.008114897658204584:t[92]>1e-35?_e=.09541587072672864:_e=-.022342147210555434:_e=-.01660492519175128:_e=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?_e=.15846731118501817:_e=.039498507912023195:t[245]>1e-35?_e=.07008718676813333:_e=.0019806389728814727;let Re;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Re=-.01192072916082109:Re=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Re=.06874032717466054:t[4]>40.50000000000001?Re=-.07752510020707537:t[1]>76.50000000000001?Re=-.09944032260703917:t[8]>1381.5000000000002?Re=-.054466635810800745:t[1]>32.50000000000001?Re=.05974084520839573:Re=-.0384718740755954:Re=-.11374190719134032:t[0]>2151.5000000000005?Re=-.13703645155803298:Re=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Re=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Re=.013539805885738608:Re=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Re=.09941880179344399:Re=-.01608127391210995:Re=.08025226531247417:t[9]>67.50000000000001?Re=.13525448212444113:t[6]>61.50000000000001?Re=-.05511099182158894:t[94]>1e-35?Re=-.06821509831783572:t[128]>1e-35?Re=.11361314817714643:Re=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Re=-.09954181329804547:t[197]>1e-35?Re=.10102833149755386:t[188]>1e-35?Re=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Re=-.03781554214742005:Re=.09927933385592314:Re=-.020006000056720083:Re=-.10520473615957895:Re=-.12006990846253787:Re=-.00026111570975317574;let Je;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?Je=-.019188245509744628:Je=-.13354864350075848:t[0]>2461.5000000000005?Je=.051885477468354396:Je=-.0833581968852119:Je=.08233441701532287:Je=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?Je=.09926337893072812:Je=-.027753610497327715:t[0]>1972.5000000000002?Je=-.09780045823152517:Je=.032380915168504935:Je=.11502632261226381:t[17]>1e-35?Je=-.06094965899579662:t[10]>40.50000000000001?Je=-.07500475582440802:Je=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?Je=-.09584538995220808:Je=-.00908705814304442:Je=.03203281520813893:t[10]>49.50000000000001?Je=-.03146271513986384:t[2]>63.50000000000001?Je=.13172001315536286:t[224]>1e-35?Je=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?Je=.09521549382082259:Je=-.04414925613522197:t[0]>1847.5000000000002?Je=-.09118580379557353:Je=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?Je=.03525144509943896:Je=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?Je=-.04766112322938157:t[2]>10.500000000000002?Je=.0728516504357201:Je=-.05049625965272536:Je=-.10868663055825774:Je=.0005382613419948969;let Xe;t[147]>1e-35?t[1]>53.50000000000001?Xe=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Xe=-.030504020655417463:Xe=.07102458639110094:Xe=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?Xe=.055304563442710876:t[1]>53.50000000000001?Xe=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?Xe=-.1568835288372895:Xe=-.0279829124400056:Xe=.04493843959601833:Xe=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?Xe=-.054133834303687026:t[9]>48.50000000000001?Xe=.11263810289007213:t[9]>9.500000000000002?Xe=-.02202034562838259:t[4]>45.50000000000001?Xe=-.03410927569045158:Xe=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?Xe=-.029687297407295893:Xe=.10673602850001934:t[4]>42.50000000000001?Xe=.0036275562945108117:Xe=-.0760789221330622:Xe=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Xe=.08274426793676076:Xe=-.07076234425516396:Xe=.13890177606150175:Xe=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?Xe=-.09250637750836187:Xe=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?Xe=-.01897867921812603:Xe=.04890781705365262:Xe=-.11569892307597907:t[2]>106.50000000000001?Xe=.09032697440623969:Xe=.00047935919155035045;let Ct;t[115]>1e-35?Ct=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Ct=-.10131179514695865:t[8]>938.5000000000001?Ct=.10203729808015481:Ct=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Ct=.03574015165562999:Ct=-.07763042506449493:Ct=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Ct=.0665706259130275:Ct=-.06586817559309924:Ct=.11925564412287476:Ct=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Ct=.046017146627455346:Ct=-.08623321630086885:t[8]>1765.5000000000002?Ct=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Ct=.11143827902215087:Ct=-.01817808730473413:Ct=.16980985030210127:Ct=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Ct=.010168994879727824:Ct=-.09099594488792513:t[9]>1.5000000000000002?Ct=.0533459678147928:Ct=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Ct=-.062346959148773695:t[1]>47.50000000000001?Ct=-.0021578343835599316:t[2]>27.500000000000004?Ct=.19567373210166172:Ct=.07851555379116423:t[18]>1e-35?Ct=.03711549097804649:t[8]>359.50000000000006?Ct=.012492346746905587:t[4]>20.500000000000004?Ct=.047511695735697544:Ct=-.07999269063948773:Ct=6802045404471004e-20;let Ot;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Ot=.0011484728213539738:Ot=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Ot=-.09828874964938798:t[8]>1586.5000000000002?Ot=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Ot=.011938269926919522:Ot=.17541983715953954:t[19]>1e-35?Ot=.023002786011088672:Ot=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Ot=.06508934844183291:Ot=-.10168553534835639:Ot=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Ot=.021140806225203937:Ot=-.1167833342453639:t[2]>33.50000000000001?Ot=.13163585734056618:Ot=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Ot=.06314479201263888:Ot=-.09639088327091713:t[10]>29.500000000000004?Ot=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Ot=40577156464836036e-21:Ot=.12322387121810757:Ot=-.03697224045046014:t[1]>22.500000000000004?Ot=.016474835887320276:Ot=.16919298733903063:Ot=.07633203630214054:Ot=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ot=.14150493354700563:Ot=-.01831155354975749:t[1]>28.500000000000004?Ot=-.07952557178685365:t[10]>28.500000000000004?Ot=.0665695554984927:Ot=-.053640139319277094:Ot=.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 Ee;t[71]>1e-35?t[4]>17.500000000000004?Ee=.12586844370423247:Ee=-.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?Ee=-.08474891624263797:t[8]>125.50000000000001?Ee=.08125086980439704:Ee=-.04082085238068532:t[0]>3863.5000000000005?Ee=.020481535807469208:Ee=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ee=-.019110200161573936:Ee=-.12387719685855114:t[0]>1102.5000000000002?Ee=.08376595701957407:Ee=-.031821919580524834:t[9]>4.500000000000001?Ee=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ee=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ee=.1349841206807871:Ee=.011864053595560297:t[1]>41.50000000000001?Ee=-.08203662486612544:t[2]>18.500000000000004?Ee=-.009541865642346947:Ee=.08345043168501759:t[2]>10.500000000000002?Ee=-.09585031818030947:Ee=.019432330487099865:Ee=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ee=.11951517733981365:Ee=-.016651014735738538:t[1]>28.500000000000004?Ee=-.07410922545030711:t[10]>28.500000000000004?Ee=.05886430683844788:Ee=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ee=.04802269879144705:Ee=-.026208212831796737:t[4]>45.50000000000001?Ee=-.03227476944664786:Ee=.05124575625622705:Ee=.00020506696916003137;let Qe;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?Qe=-.03042091758483443:t[10]>14.500000000000002?Qe=.09816619204768777:Qe=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?Qe=-.02381165060401718:Qe=-.10950361804974783:Qe=.03538211665111128:t[212]>1e-35?t[19]>1e-35?Qe=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?Qe=-.06371052144380579:Qe=.0835500621252692:Qe=-.10408255929333915:t[1]>74.50000000000001?Qe=.13208968122712403:t[1]>64.50000000000001?Qe=-.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?Qe=.09922816902423433:Qe=.016366955328796718:Qe=.1592412560903584:t[1]>39.50000000000001?Qe=.05409467990258923:Qe=-.08260633210459611:Qe=-.06307205775247567:t[9]>36.50000000000001?Qe=.040253940015648144:Qe=.14202568969471283:Qe=-.028761848341594044:Qe=.08994073058773508:t[0]>807.5000000000001?Qe=-.043427848826323195:Qe=.04573516446846493:t[20]>1e-35?t[188]>1e-35?Qe=-.0758877731600639:t[23]>1e-35?Qe=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?Qe=.08124700978741987:Qe=.013296063087086852:t[7]>5.500000000000001?Qe=-.01640196088612987:Qe=-.12685498840146067:Qe=-.0004940792382459551;let nt;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?nt=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?nt=.08513773825688947:nt=-.1184664832315282:nt=.05676963535893477:nt=.14263843210340613:nt=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?nt=-.10669720555606924:nt=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?nt=.0664744575868955:nt=-.08469256188890871:nt=-.026746678040592144:t[281]>1e-35?nt=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?nt=.012131807587207655:nt=-.12776015795398743:nt=.04320472481083551:nt=.08390980661550446:t[10]>227.50000000000003?nt=-.09771783809101153:t[10]>130.50000000000003?nt=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?nt=-.07610698254064358:t[8]>902.5000000000001?nt=-.03136381213599649:t[131]>1e-35?nt=.0704821739127936:t[224]>1e-35?nt=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?nt=.10431473040024908:t[8]>841.5000000000001?nt=.07304745320500514:nt=-.038011541882439825:nt=-.01679746695007364:t[0]>3129.5000000000005?nt=.05589952587431965:t[210]>1e-35?nt=.06227198085800842:nt=-.0011341890997947812:t[8]>740.5000000000001?nt=.04817300084412584:nt=-.000577001010789238;let mt;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?mt=-.10504730480402079:t[5]>3341.5000000000005?mt=.11087894671081754:mt=-.0406668834674614:mt=.03308382165616109:t[8]>104.50000000000001?mt=-.10431436764549162:mt=.0073928337244891455:t[4]>34.50000000000001?mt=-.10571751512748416:mt=-.006081128814142983:t[13]>1e-35?mt=.1299673566095023:t[4]>60.50000000000001?mt=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?mt=.04857126072645073:mt=-.03431365358104773:t[4]>16.500000000000004?mt=.04101865986596709:mt=.16480274980378218:t[10]>26.500000000000004?mt=.03673978504199255:t[10]>9.500000000000002?mt=-.10996402743800027:t[308]>1e-35?mt=.0553693735082498:mt=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?mt=.010902983761213922:mt=.1325118659895645:mt=-.064362945508595:t[1]>66.50000000000001?mt=.033416767779331176:mt=-.054080316225040496:t[42]>1e-35?mt=-.07762364337810815:t[10]>1089.5000000000002?mt=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?mt=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?mt=.0220102041325908:mt=-.06516708740003069:mt=.012833498905748267:t[224]>1e-35?mt=-.007038418272997865:mt=.00037666304316290967;let xe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?xe=.07554189644995735:xe=-.052089349455904946:xe=-.10148206848169845:t[113]>1e-35?xe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?xe=.07172653627995676:xe=-.07602959317610998:xe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?xe=-.0399322883690891:xe=.06523495517476098:xe=-.10358715295743802:t[193]>1e-35?xe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?xe=.015928764772252406:xe=.1341513061552287:xe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?xe=-.033592997607280156:xe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?xe=-.08402551858097379:xe=.017401984506038796:t[1]>25.500000000000004?xe=.13337205393591278:xe=-.01160208350090984:xe=.06708317942315471:t[8]>227.50000000000003?xe=-.08486943882418681:xe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?xe=-.10496268177586783:xe=-.020921489532370493:xe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?xe=.11639296062157028:xe=-.004275784356569115:t[32]>1e-35?xe=-.07297384970166025:xe=.006026841626381599:xe=.002034611134960428;let He;t[248]>1e-35?He=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?He=-.06455513326540585:t[1]>29.500000000000004?He=.07718474591552532:t[4]>7.500000000000001?He=.040139336931404826:He=-.09685734690563386:He=.00015327283570347363:t[9]>88.50000000000001?He=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?He=-.04077257804338707:He=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?He=.03778141591008941:He=-.06459919920634845:He=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?He=.14063930759326346:t[0]>179.50000000000003?He=.07287482250668585:t[8]>1180.5000000000002?He=-.14419393112726253:t[10]>28.500000000000004?He=-.07993142770099469:t[17]>1e-35?He=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?He=.05527969663610186:He=-.10824385941441346:t[3]>11.500000000000002?He=.12358502961047915:He=-.017509147119622873:t[0]>74.50000000000001?He=-.014907705458730486:t[8]>95.50000000000001?He=-.02225118168342062:He=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?He=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?He=.04962819555610421:He=-.07213577821855309:He=.09139529824708481:t[19]>1e-35?He=.013439401088345224:He=-.049274647207292056:He=.10531673719686951;let Ze;t[40]>1e-35?t[0]>1937.5000000000002?Ze=-.06421671152073961:Ze=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Ze=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Ze=-.03520420769287065:t[8]>1085.5000000000002?Ze=-.019817352506127633:Ze=.11444439424520964:Ze=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Ze=-.010490117519863269:Ze=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Ze=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Ze=.06619344145920268:t[0]>4091.5000000000005?Ze=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ze=.10016091391222309:Ze=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Ze=-.019511460451434884:Ze=-.11643672465055221:t[2]>18.500000000000004?Ze=.07848228087333317:t[8]>55.50000000000001?Ze=.032583027899956235:Ze=-.11209832692153521:t[11]>1e-35?Ze=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Ze=-.09996887746328006:t[9]>2.5000000000000004?Ze=.02157682011863397:Ze=-.05247727848991843:Ze=.07409150201483244:t[1]>38.50000000000001?Ze=-.11378466075449625:t[224]>1e-35?Ze=-.10741749127732923:t[1]>26.500000000000004?Ze=.07343136534146562:Ze=-.07013573628594773:t[25]>1e-35?Ze=-.04626669734164317:Ze=.05518333197956482:Ze=.00032434010867555516;let at;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?at=.026313251010808853:at=-.08997339150292381:at=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?at=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?at=.0905155504503746:t[8]>1049.5000000000002?at=-.062312558183394054:t[8]>719.5000000000001?at=.09583836191410239:t[0]>3719.5000000000005?at=-.0778097309430818:at=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?at=-.12920865648544927:t[0]>2699.5000000000005?at=-.07086587879041864:at=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?at=-.11377786322600797:at=-.009486325820117998:t[1]>55.50000000000001?at=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?at=-.07938291201004219:t[2]>36.50000000000001?at=.01520046732530246:at=.13649854049662832:at=-.07145015938528873:t[8]>407.50000000000006?at=-.00350257360822279:at=.11332047082193297:at=-.10060624458629897:at=.05429496612497562:t[8]>1446.5000000000002?at=.006073419197482838:at=-.08718676350883998:at=-.11532497988252638:at=.10766270463068293:t[34]>1e-35?at=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?at=-.0004109812623829506:at=.021601073497455662:at=-7343540098965853e-20;let ct;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ct=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?ct=.05995640200798119:t[0]>3443.5000000000005?ct=-.14698883458733583:ct=-.030039164579240187:t[189]>1e-35?ct=-.06086763220538141:t[1]>86.50000000000001?ct=-.05096727866142538:t[4]>64.50000000000001?ct=.11240554253834577:t[4]>45.50000000000001?ct=-.030279760168394117:t[6]>45.50000000000001?ct=.10161088917815142:t[10]>77.50000000000001?ct=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?ct=-.06672020005240323:ct=.08831457502630258:t[8]>2592.5000000000005?ct=-.052617701047376654:t[10]>29.500000000000004?ct=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?ct=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?ct=-.064099222705728:ct=.044332487521538365:t[0]>2882.5000000000005?ct=.031099546885005065:ct=.12938467051623853:t[0]>4221.500000000001?ct=-.0928676413498701:t[9]>30.500000000000004?ct=-.05781824812803708:ct=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?ct=-.06648105454098469:ct=.05985487552383097:ct=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?ct=.05282385499619401:t[1]>66.50000000000001?ct=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?ct=.027885690791379255:ct=-.08407126408362446:ct=.014432924125571093:ct=-9903435845205118e-20;let ut;t[76]>1e-35?ut=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?ut=.013633653464240465:ut=-.10164319411983509:ut=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?ut=.00632864847804078:ut=-.08393000368134668:ut=.07870508617440916:t[284]>1e-35?ut=.1092302727710421:ut=-.0025505047582483234:t[248]>1e-35?ut=.07101822393621864:t[274]>1e-35?ut=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?ut=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?ut=.025081789181021243:ut=-.014813325803582618:t[9]>33.50000000000001?ut=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?ut=.11926990418060353:ut=.01852125513565268:ut=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?ut=-.1178464984373743:t[283]>1e-35?ut=.043370859226927405:t[5]>4320.500000000001?ut=-.01103141226366587:t[8]>1104.5000000000002?ut=-.023053423988095886:ut=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?ut=.000579145585864887:ut=.03389152834202143:t[128]>1e-35?ut=-.14527722052568462:t[210]>1e-35?ut=-.08915971541902741:t[7]>9.500000000000002?ut=-.03307314577076116:t[18]>1e-35?ut=-.05521712302023565:ut=.009315605032770029:ut=.0036332551852289933;let ee;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?ee=-.07583539600416284:t[188]>1e-35?ee=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?ee=-.011038193049597113:ee=.08154028164397753:t[1]>85.50000000000001?ee=.10259361975201933:ee=.011640408330521594:ee=-.00023319159023748508:t[92]>1e-35?ee=.13771692859530546:ee=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?ee=.09967230141007705:t[30]>1e-35?ee=-.08888529037551285:ee=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?ee=.08284665960761373:ee=-.029292565021289504:t[7]>7.500000000000001?ee=-.09945093355204493:ee=-.008381393701708593:t[20]>1e-35?ee=-.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?ee=.07585582641438211:t[8]>284.50000000000006?ee=-.029387993239886723:ee=.07716738177321587:t[1]>18.500000000000004?ee=.026745348497993746:ee=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?ee=.02337306890530338:ee=-.10390355904767366:ee=.07390521199638532:ee=-.06788247515155237:ee=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?ee=-.06360325615644084:ee=.04342192339836601:ee=-.10598779152030145:ee=.05253384605768211;let pe;t[3]>7.500000000000001?t[157]>1e-35?pe=-.07514182877923786:pe=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?pe=.028692053800951845:pe=.14081686716133598:pe=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?pe=.0037139292567243084:pe=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?pe=.01202688580305612:pe=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?pe=.043935495082738626:pe=-.05639305759669704:t[247]>1e-35?pe=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?pe=.10331836202616368:pe=.0006926658459781341:t[96]>1e-35?pe=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?pe=-.0741403257305367:pe=.022900127535540854:t[7]>3.5000000000000004?pe=.038110741403836294:pe=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?pe=-.09552842289807008:t[1]>27.500000000000004?pe=.012505935885798007:pe=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?pe=-.1046104767723845:pe=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?pe=.023466328488582572:pe=.11730925774586994:pe=-.04771965631104874:pe=.17059689880751394:pe=-.08181850955999449:t[26]>1e-35?pe=-.12727482696678769:pe=-.014343123272734182;let ke;t[147]>1e-35?t[1]>53.50000000000001?ke=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?ke=-.02763546051134888:ke=.06423344777499343:ke=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?ke=.049825139823021586:t[7]>22.500000000000004?ke=-.01131680751379858:t[0]>2579.5000000000005?ke=-.10673674485369694:ke=-.015387212937189957:ke=.04347325151148724:t[179]>1e-35?ke=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ke=.0650355590939066:ke=-.0473332870892226:ke=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?ke=.11139543329789044:t[126]>1e-35?ke=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?ke=.06370903833231022:t[10]>29.500000000000004?ke=.03415223859607161:t[10]>3.5000000000000004?ke=-.07415518117873297:ke=-.0014119203473324082:ke=.12617652343819508:t[9]>41.50000000000001?ke=-.10311145857176976:t[8]>2757.5000000000005?ke=-.08106484219011428:t[7]>71.50000000000001?ke=-.09783384432091176:t[1]>88.50000000000001?ke=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?ke=-.008884084501608536:ke=.061339437777743616:ke=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?ke=.01526664064166223:ke=.13534828515415498:ke=-.06985484465894776:ke=.0005758961943178744;let Le;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Le=-.029152732370514342:Le=.07173628916139178:t[1]>36.50000000000001?Le=-.08859111297255318:Le=.0018030071815630785:Le=.13652461563759322:Le=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Le=-.07145140450454163:t[21]>1e-35?Le=-.07422841663493233:Le=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Le=.11864240653986852:t[3]>33.50000000000001?Le=-.08821209591953476:Le=.05706392280054726:Le=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Le=.01953613016837112:Le=-.059781039130025006:t[148]>1e-35?Le=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Le=.07207826841738371:t[202]>1e-35?Le=.08163917539410503:Le=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Le=-.06858280496900336:Le=-.1781828899516648:Le=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Le=.018232649414147116:Le=-.04419781124222661:Le=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Le=.11452368095776105:Le=-.036496437259924026:Le=-.040445338739465486:Le=.0816572651001145:Le=-.08968914517368663:Le=.0002826343082585516;let Ve;t[189]>1e-35?t[0]>5269.500000000001?Ve=-.08839493050459957:t[10]>85.50000000000001?Ve=.10046908365702462:t[8]>2592.5000000000005?Ve=-.09632233975926387:t[8]>2000.5000000000002?Ve=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?Ve=.035504970430426296:t[1]>31.500000000000004?Ve=-.1133764813142531:Ve=-.01138280942244812:t[8]>1125.5000000000002?Ve=.09800530246229806:Ve=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?Ve=.07316772160107896:Ve=-.059095014819051765:Ve=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?Ve=-.09150209066166894:t[8]>3084.0000000000005?Ve=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?Ve=-.04449234460408263:Ve=.05568837973347338:Ve=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?Ve=.12741077850267066:Ve=.007372371864985329:t[2]>39.50000000000001?Ve=.02295917234617787:Ve=.14966532083907075:t[1]>39.50000000000001?Ve=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?Ve=-.02511861881285652:t[1]>27.500000000000004?Ve=.08683660011672288:Ve=.02956214835267301:t[9]>15.500000000000002?Ve=-.016538805462996232:Ve=.04352738094981517:Ve=-.05561856645643868:t[9]>170.50000000000003?Ve=-.07996752635874248:t[179]>1e-35?Ve=-.09065975936933919:Ve=-.00042817975060427177;let tt;t[39]>1e-35?t[4]>25.500000000000004?tt=.03443173196222934:tt=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?tt=-.0013415395759330318:tt=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?tt=.002297618040307216:tt=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?tt=-.015297257305397608:tt=.09651828834062742:tt=-.06636003334371929:t[10]>11.500000000000002?tt=.17631616138309397:t[0]>1639.5000000000002?tt=3804386478092585e-20:tt=-.09099296398683193:tt=-.06874415876172972:t[0]>2151.5000000000005?tt=-.1311264883406766:tt=.00809052010141122:t[253]>1e-35?tt=-.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?tt=.045038497754638605:tt=-.07770167665661752:tt=-.08596294280650517:tt=.08538655727027213:tt=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?tt=.054627956617973275:t[1]>61.50000000000001?tt=-.11994465088415499:t[4]>8.500000000000002?tt=.06676200239406452:tt=-.027503148069376867:t[8]>676.5000000000001?tt=-.10363964928357075:t[4]>8.500000000000002?tt=-.07589816227175682:tt=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?tt=.009093153189012338:tt=-.06119765876605404:tt=.0004668642103528348;let vt;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?vt=-.10100794502567233:vt=.08000205636470442:vt=-.11945419826856896:t[113]>1e-35?vt=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?vt=.1224302423880318:vt=-.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?vt=.0019277012166729114:t[1]>28.500000000000004?vt=-.054445821715687494:vt=.045645722976713245:t[30]>1e-35?vt=.13402660155331655:vt=.008921176001777645:vt=-.058547426505451076:vt=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?vt=-.13526418192218206:vt=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?vt=.0007263224246135398:vt=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?vt=-.11575657261278308:vt=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?vt=-.01995960178292952:vt=.11216586049153021:vt=-.10050961087149474:vt=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?vt=.10303451081526649:vt=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?vt=-.043799548968209395:vt=-.12451444314954115:t[4]>12.500000000000002?vt=-.03838117361958468:vt=.06504990789767144:t[57]>1e-35?vt=.06890006938293915:vt=.0003914274695562949;let Nt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?Nt=.004271749009686975:Nt=-.10523878297127605:Nt=.04633982158107851:Nt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?Nt=-.08655730561951676:t[8]>919.5000000000001?Nt=-.0676453705610183:t[7]>18.500000000000004?Nt=-.027787974193650575:Nt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?Nt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?Nt=-.03473877164537313:t[8]>719.5000000000001?Nt=.10471053866934404:Nt=.008236107678382981:t[4]>57.50000000000001?Nt=.09412219478825269:t[10]>66.50000000000001?Nt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?Nt=-.040681323751002293:Nt=.06374650297561021:Nt=.12884615227401788:t[10]>5.500000000000001?Nt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?Nt=-.05474068967150784:Nt=.03744700650806603:Nt=-.07846396348680855:t[1]>42.50000000000001?Nt=.018972315810821302:Nt=.10953621007604744:t[5]>4439.500000000001?Nt=.010999776705494586:t[1]>40.50000000000001?Nt=-.12394200059775967:t[10]>2.5000000000000004?Nt=.013528093962849453:Nt=-.09222088417048682:Nt=-.12662967149701485:Nt=.09327296405849603:t[3]>99.50000000000001?Nt=-.013581954439986752:Nt=.0005526498251862075;let Vt;t[187]>1e-35?t[243]>1e-35?Vt=-.08392792551692502:t[10]>68.50000000000001?Vt=.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?Vt=-.0825306209711224:Vt=.049559996084532945:Vt=-.1064938580886302:Vt=.03353240732240275:Vt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?Vt=.16966001471529374:t[1]>57.50000000000001?Vt=-.005772777673676247:Vt=.09383677041525058:t[8]>747.5000000000001?Vt=.054068175469351235:Vt=-.049968216310277036:t[8]>753.5000000000001?Vt=-.0679383555784074:t[4]>8.500000000000002?Vt=-.059757341189735386:Vt=.05701083682780414:Vt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?Vt=.05820296128730006:Vt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?Vt=.15340611616954566:Vt=.04385036188666874:t[0]>4449.500000000001?Vt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?Vt=.004840354641006495:Vt=.09967827580276283:Vt=.11605363537391578:t[9]>19.500000000000004?Vt=-.0735831692725717:Vt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?Vt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?Vt=-.02442182361342386:Vt=.10334853004243093:Vt=-.030431948680167104:Vt=-956078595250818e-19;let It;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?It=-.040232505718244854:t[0]>3030.5000000000005?It=.0634109586813073:It=-.04043617034245621:It=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?It=-.007859096946435131:It=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?It=.05515771679628051:It=-.04214471312668263:It=-.09589322222261765:t[193]>1e-35?It=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?It=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?It=-.08152604001147906:t[11]>1e-35?It=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?It=.13100930780107503:t[10]>25.500000000000004?It=.05921074710011526:It=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?It=.0009447118243153454:It=-.09820565036865991:It=.057146909749745546:t[0]>2115.5000000000005?It=-.12331216726611678:It=.007281983677694285:t[2]>56.50000000000001?It=.012310154675612615:It=-.08873665774670461:t[6]>25.500000000000004?It=.134708740821879:t[9]>5.500000000000001?It=-.0805901581148979:t[224]>1e-35?It=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?It=.10842593386554122:t[2]>13.500000000000002?It=.06466798320378395:It=-.08578130788886655:It=-.03590892078300114:It=.0003499894043880708;let Be;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?Be=.10839808814624702:Be=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?Be=-.007478368069393829:Be=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?Be=.04035247751736232:t[0]>4255.500000000001?Be=-.1310865624507367:t[0]>4004.5000000000005?Be=.06647367311982634:Be=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?Be=-.011618902907510411:Be=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?Be=.09356028223727986:Be=-.03811765057032162:Be=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?Be=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?Be=.1146142460964847:t[1]>62.50000000000001?Be=-.09679869865322362:t[9]>71.50000000000001?Be=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?Be=-.039046426387852974:Be=.04558778688367152:Be=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?Be=.03261697816211156:t[15]>1e-35?Be=.02586252542264368:t[2]>14.500000000000002?Be=-.016420452667484604:Be=-.1011799626006976:Be=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?Be=.010193588102560583:Be=.11748729525930773:Be=-.04468162226743652:Be=-.028365274393617957:t[71]>1e-35?Be=.05115139346588793:Be=-.0001510425316936658;let oe;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?oe=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?oe=.020637047900190317:oe=-.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?oe=-.04632587527094407:oe=.08603684785510396:oe=-.05101401015448496:oe=.025466432054358498:oe=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?oe=.020385355430046367:oe=.12032592051335252:oe=-.012387370292173013:t[2]>23.500000000000004?oe=-.12568545484492677:oe=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?oe=.043528764484784536:oe=.14352071657196003:oe=-.009332833816977268:oe=.11186782227735846:oe=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?oe=-.05649104643152564:oe=.03884200719305747:t[42]>1e-35?oe=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?oe=-.04103416502526736:oe=.04881823954656287:t[4]>15.500000000000002?oe=.009342724662897898:t[0]>3969.5000000000005?oe=-.025637309961309498:oe=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?oe=-.08185697075265091:t[0]>2215.5000000000005?oe=.030063975892297354:t[0]>807.5000000000001?oe=-.03924325550733229:oe=.0415330999189793:oe=-.00024374664461674863;let ve;t[3]>7.500000000000001?ve=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ve=.025798416259686565:ve=.13251610353146012:ve=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?ve=-.11098564237775424:ve=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?ve=.15347826616466054:t[3]>4.500000000000001?ve=.10379320730958941:ve=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?ve=.03159791088468647:ve=-.10612873364104258:ve=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?ve=-.02335760775001469:ve=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?ve=-.011164334474672973:ve=-.06594044410501655:t[207]>1e-35?ve=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?ve=-.01725821503981916:ve=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?ve=-.04226531631656534:ve=-.14409800530171432:ve=-.03245576341206398:t[8]>4214.500000000001?ve=.0895409165534886:t[247]>1e-35?ve=-.06506383629143335:t[118]>1e-35?ve=-.07214270121257443:t[8]>546.5000000000001?ve=-.004385020865473831:ve=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?ve=.046278501133958524:ve=-.030835570926968044:t[0]>493.50000000000006?ve=-.12794504651610425:ve=.009415039807550776;let Se;t[304]>1e-35?Se=-.04717777269217453:t[76]>1e-35?Se=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Se=-.09648224457374217:t[132]>1e-35?Se=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Se=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Se=.10838431695638147:t[230]>1e-35?Se=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Se=.050071316251979:Se=-.006356941111525215:t[6]>8.500000000000002?Se=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Se=.10217402850540398:Se=-.048840949025349197:Se=-.03668313197909846:t[7]>39.50000000000001?Se=-.0562642841496003:t[10]>2.5000000000000004?Se=.09749777369987417:Se=-.04848223121417616:t[0]>5453.500000000001?Se=.08316648226133942:Se=-.0261979698267618:t[212]>1e-35?Se=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Se=.04837009746506856:Se=-.09184360565631328:Se=.0032411047845613606:t[0]>4733.500000000001?Se=.0977378556864798:Se=.010776545559325588:Se=-.012483310473120218:Se=-.049284121449103935:Se=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Se=-.08380361910948711:Se=.07375088778585813:Se=-.1084864186071348:Se=.0007819503469605476;let de;t[7]>17.500000000000004?t[115]>1e-35?de=.08741852531696623:t[167]>1e-35?de=.10078975495600809:de=-.0018324767784017562:t[290]>1e-35?de=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?de=.1379733311640402:de=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?de=-.09360083033774169:de=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?de=-.015599362579530679:t[0]>4593.500000000001?de=-.12029549262691491:de=-.018917032256501397:de=.04632831686576592:de=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?de=-.05894883236412263:de=.05213944998315824:de=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?de=.07577412405680808:de=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?de=-.0277076900736147:t[1]>65.50000000000001?de=-.023587471585763506:de=.10184896592433082:de=-.057699270527916825:de=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?de=.06566902102799584:t[10]>25.500000000000004?de=-.07033633753181047:de=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?de=-.08108035861059537:de=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?de=-.12431182772561139:de=.01886235886984271:de=.0025579594894418116;let te;t[8]>2915.5000000000005?t[101]>1e-35?te=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?te=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?te=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?te=.0687641681341721:t[10]>102.50000000000001?te=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?te=-.06762578396473291:t[10]>65.50000000000001?te=-.05226727783610509:t[282]>1e-35?te=.09911438410640917:t[19]>1e-35?te=.06915156336429933:te=-.006565637886508241:te=-.08344300251849307:te=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?te=.19428463865406298:te=.016073883020956765:t[13]>1e-35?te=.06864077097923665:te=-.01388867527034731:t[0]>1847.5000000000002?te=.004655280608161356:t[1]>40.50000000000001?te=.031406054057765996:te=.12798062439212832:te=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?te=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?te=-.0706095614785733:te=.04227164041372561:te=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?te=-.07139533369873902:te=.008952586782921625:te=.06086212582180936:te=-.0816938490403437:te=-.051224901945956025:te=-.10525399124186095:te=.000270924147208224;let Fe;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Fe=.029186512383291244:t[7]>1.5000000000000002?Fe=-.14984127276725573:t[1]>40.50000000000001?Fe=.032757060730648144:Fe=-.07675575422749602:t[6]>8.500000000000002?Fe=.10599766037117893:Fe=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Fe=-.051394622947855385:Fe=.03237141302699347:Fe=.12526173027943244:Fe=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Fe=-.07383912482657777:t[0]>5147.500000000001?Fe=.07008813937042091:t[10]>38.50000000000001?Fe=-.06779203808365307:Fe=-.013782769999524498:Fe=.0880038869117715:Fe=-.12846294176070952:t[281]>1e-35?Fe=-.06810806903850834:t[10]>227.50000000000003?Fe=-.08937977001661111:t[10]>130.50000000000003?Fe=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Fe=.011036530162093841:Fe=-.11500797478569702:Fe=.03702229366129399:Fe=.07242026683784307:t[189]>1e-35?Fe=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Fe=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Fe=-.02608892716555304:Fe=.09609599320761308:t[9]>105.50000000000001?Fe=-.06848127135991534:Fe=.0023675721254089715:t[86]>1e-35?Fe=-.11049635625500497:Fe=-.004847764219432233;let et;t[125]>1e-35?t[0]>3969.5000000000005?et=-.09462233499115416:et=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?et=-.030700661288166148:et=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?et=.03149547314036763:et=-.08166208257451366:t[0]>5850.500000000001?et=-.10228136324773157:t[102]>1e-35?et=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?et=.01782894842128785:t[13]>1e-35?et=.002680190260979968:et=.1773965720476949:t[2]>72.50000000000001?et=.09090831938627947:t[1]>59.50000000000001?et=-.12297206702816128:t[0]>4977.500000000001?et=.09899015653118268:et=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?et=-.0675900954187773:et=.012336403425364092:et=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?et=-.02671721777458802:et=-.09242452991958029:t[284]>1e-35?et=-.08585691288582491:et=.013332890564324447:t[4]>14.500000000000002?et=-.005245022074799553:t[23]>1e-35?et=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?et=-.09289852307936758:t[116]>1e-35?et=-.09686573010015055:t[8]>804.5000000000001?et=.03812547148215318:et=.005162744968176633:t[9]>43.50000000000001?et=-.059246106396159376:et=.050370113808135275:et=.000794041852811028;let Ht;t[3]>7.500000000000001?Ht=.0004981426543104341:t[9]>114.50000000000001?Ht=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Ht=-.019061766497948867:Ht=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Ht=-.006044199577160493:Ht=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Ht=.11486607015912494:t[9]>16.500000000000004?Ht=-.08686820858087294:Ht=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Ht=-.022230207980026437:Ht=.1056683690528792:Ht=-.05859530800943035:Ht=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Ht=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Ht=-.05177544573528314:Ht=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Ht=.15159657923771555:Ht=-.0060542654587671055:t[9]>5.500000000000001?Ht=-.042808028205051786:t[1]>48.50000000000001?Ht=-.010449538258110742:Ht=.10026907521968294:Ht=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Ht=-.02272452389409874:Ht=-.11202691218244319:t[5]>1809.5000000000002?Ht=-.04460413584255906:Ht=.08196329474205256:t[10]>69.50000000000001?Ht=.10221481166238167:Ht=.0004063052701699382:t[243]>1e-35?Ht=-.07563941678849846:t[18]>1e-35?Ht=.02563513231103432:Ht=-.004740081147303786;let mr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?mr=.057446442918106:mr=-.04404018270156349:mr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?mr=-.05930486238817954:t[1]>29.500000000000004?mr=.06955866121256543:t[8]>597.5000000000001?mr=-.06538593556505168:mr=.06212512595497445:mr=.00021102929959182257:t[9]>90.50000000000001?mr=.0958061289119631:t[102]>1e-35?mr=.07172059675638813:t[1]>47.50000000000001?mr=-.03879798603977766:t[297]>1e-35?mr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?mr=.003805910996312012:mr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?mr=.11252376801858695:t[288]>1e-35?mr=-.10293901912180432:mr=.014669268837893872:t[1]>42.50000000000001?mr=-.05988274123836837:t[145]>1e-35?mr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?mr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?mr=-.03366718308159971:mr=.11936550608549797:t[1]>31.500000000000004?mr=-.07454716789539667:mr=.027859650621164217:t[10]>10.500000000000002?mr=-.11806374092321247:mr=-.03506042229223101:mr=-.0007080765837654515:t[10]>6.500000000000001?mr=-.028077713664996503:t[2]>7.500000000000001?mr=.15803724124216814:mr=.0351381284833169:mr=-.07877953381054767;let or;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?or=.14144941521975005:or=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?or=.10514088112381886:t[7]>18.500000000000004?or=-.10370643555956745:or=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?or=-.0508129468802936:t[224]>1e-35?or=-.037816066368733595:t[10]>43.50000000000001?or=.07793408602607932:or=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?or=.036972453794202324:or=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?or=.09475302525132188:or=-.03580104945898193:or=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?or=-.1282448778804823:or=-.014395808269207212:or=-.008940927190750592:or=-.1459118815453748:t[0]>4897.500000000001?or=-.09733068457286576:t[1]>57.50000000000001?or=.06575271409540207:or=-.019556422817450115:or=-.10623959222984136:t[18]>1e-35?or=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?or=.008125645893104896:or=-.11084368630465868:or=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?or=-.05854904579626861:t[4]>5.500000000000001?or=.02985784951394175:or=-.03247600140149334:or=-.11152899295304973:or=-.00035424577714215764;let Nr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Nr=-.06563670567578264:Nr=.067656954313663:Nr=-.10388217548685377:t[8]>2302.5000000000005?Nr=.07190621943790435:t[4]>67.50000000000001?Nr=.060020507643618604:t[4]>38.50000000000001?Nr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Nr=-.06568134366461277:t[8]>1075.5000000000002?Nr=-.004768057709758692:Nr=.11785959165999467:Nr=-.05080221682879267:Nr=.14814206127494542:Nr=-.07241946332311736:t[253]>1e-35?Nr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Nr=-.02471195342450034:Nr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Nr=-.10741850739482771:Nr=.010051635824944:Nr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Nr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Nr=-.08992396138178163:Nr=.010944365997007212:Nr=.06221307021813793:Nr=.1286024087559141:t[127]>1e-35?Nr=.06568148624531012:t[10]>40.50000000000001?Nr=-.07567979134643352:t[5]>5647.500000000001?Nr=.07594672895572069:Nr=-.018158016446439187:t[6]>55.50000000000001?Nr=.009293422430111872:t[4]>45.50000000000001?Nr=-.017749818406964022:t[2]>46.50000000000001?Nr=.01714136511113982:Nr=-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 wm=Goc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+k+D+N+L+B+Q+M+O+q+F+U+W+V+G+Y+re+j+X+ie+we+Ae+De+Te+Z+J+z+le+K+ae+Me+ne+se+Ie+_e+Re+Je+Xe+Ct+Ot+$t+Gt+Ee+Qe+nt+mt+xe+He+Ze+at+ct+ut+ee+pe+ke+Le+Ve+tt+vt+Nt+Vt+It+Be+oe+ve+Se+de+te+Fe+et+Ht+mr+or+Nr+Hr+Gr+zt+_r);return[1-wm,wm]}a(Hoc,"multilineModelPredict");function Goc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(Goc,"sigmoid")});var _Ni=I(c$=>{"use strict";p();Object.defineProperty(c$,"__esModule",{value:!0});c$.MultilineModelFeatures=c$.PromptFeatures=void 0;c$.hasComment=tRr;c$.requestMultilineScore=zoc;var a$=ANi(),$oc=yNi(),Voc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},ENi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function tRr(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(Voc[r]??[]).some(l=>s.includes(l))}a(tRr,"hasComment");var Z5e=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=tRr(e,-2,r),this.rstripSecondToLastLineHasComment=tRr(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)[0]}return r}a($2i,"makeGhostAPIChoice");function Yxr(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,Ltc.telemetry)(t,`ghostText.${e}`,l)}a(Yxr,"telemetryPerformance")});var W2i=I(kAt=>{"use strict";p();Object.defineProperty(kAt,"__esModule",{value:!0});kAt.contextualFilterCharacterMap=void 0;kAt.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 z2i=I(Kxr=>{"use strict";p();Object.defineProperty(Kxr,"__esModule",{value:!0});Kxr.multilineModelPredict=qtc;function qtc(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 q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.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 z;t[183]>1e-35?t[17]>1e-35?z=.030100940443356424:t[10]>1.5000000000000002?z=-.10861112216742408:z=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?z=-.032062878390325456:z=-.10808232631806887:t[8]>1641.5000000000002?z=-.06147013392655731:t[4]>12.500000000000002?z=.03324767551088266:t[145]>1e-35?z=.028851633810612017:z=-.054871239091792784:t[134]>1e-35?z=-.023813968121342108:t[266]>1e-35?z=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?z=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?z=-.025350325484720576:z=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?z=.056817276537534815:z=-.07674158463557636:z=-.06335553143454145:t[1]>56.50000000000001?z=.16390494217299284:z=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?z=.041717597065890205:z=-.10357913492269129:t[10]>29.500000000000004?z=.1365512866715726:z=.020600048310575665:z=.09708785634773187:z=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?z=-.03146213719547347:z=.11784024316238083:z=-.050940520532045355:z=-.047988344143075616:t[191]>1e-35?z=.028764654731460032:z=.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 $;t[8]>1014.5000000000001?t[9]>137.50000000000003?$=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?$=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?$=.07211107542565391:$=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?$=-.0751486415451188:t[1]>59.50000000000001?$=.13459005084554104:$=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?$=.06715575425741895:$=-.005895690393702183:t[8]>2915.5000000000005?$=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?$=-.00029068886245881074:$=.0613467393188786:t[148]>1e-35?$=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?$=.003887223773199377:$=-.08553893131979015:$=.025654192706396767:$=-.05651733979610658:$=-.02039913645229667:t[2]>7.500000000000001?$=-.1058450646728524:$=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?$=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?$=.1283258201586378:$=-.01718135372229775:$=-.07702452408491414:t[125]>1e-35?$=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?$=.04273051857848212:$=-.04533122948101463:t[2]>196.50000000000003?$=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?$=.0231032972703664:$=-.04807386814498683:$=.002729435991332102;let J;t[179]>1e-35?J=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?J=.026484626664041125:t[10]>1.5000000000000002?J=-.10187000872941615:J=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?J=.09574540795390041:J=-.06454986703691233:J=-.11411849349353141:t[266]>1e-35?J=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?J=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?J=-.04403391373512386:J=.1132928075412222:t[2]>47.50000000000001?J=-.09700191391838056:J=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?J=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?J=-.001668912999010927:J=-.02363511102970245:t[8]>58.50000000000001?J=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?J=.0911011436534449:t[1]>28.500000000000004?J=-.07192390493729035:J=.06913818091291246:J=-.012312625373699222:J=.06784496312307986:J=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?J=.0026564453057705273:J=-.025425772389361445:t[122]>1e-35?J=-.12046786388602149:t[0]>3183.5000000000005?J=.01162092842804907:t[91]>1e-35?J=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?J=-.0001647792543020228:J=-.023664538532907665:J=.01609078206180752;let ne;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ne=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ne=-.017696526862422682:ne=.1450050954613223:ne=-.05406930069823832:ne=-.08308700260259043:t[120]>1e-35?ne=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ne=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ne=.038431826961746934:ne=-.05937462906539856:t[9]>65.50000000000001?ne=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ne=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ne=-.09579030954062734:ne=.025064711572811746:ne=.02579440518821548:ne=.1044440128091862:ne=-.058348633139536844:ne=.07766788227934436:ne=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ne=.07463684068207214:ne=.18244269035484484:t[6]>39.50000000000001?ne=-.06050050067471004:ne=.05787759066913493:ne=.010783225857972171:ne=.1674891243602606:t[4]>9.500000000000002?ne=-.004814132027475892:ne=-.14543299413454813:ne=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ne=-.07634466313617769:ne=.0287825335169114:ne=-.06894721943300268:ne=-.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 ae;t[223]>1e-35?t[8]>668.5000000000001?ae=-.12803889879260094:ae=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ae=.08967966612917375:t[1]>39.50000000000001?ae=-.059791671514498074:ae=.05648934961902822:t[2]>59.50000000000001?ae=-.08633234097449628:t[6]>53.50000000000001?ae=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ae=.025606129643140924:ae=.13835395886271978:ae=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ae=-.09975506556937946:t[10]>36.50000000000001?ae=-.09427724661655643:t[10]>24.500000000000004?ae=.07329330653410447:ae=-.02271182965807972:ae=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ae=-.05082091374050816:ae=.1687114435254966:t[0]>2314.5000000000005?ae=-.06422664016383926:ae=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ae=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ae=-.1274167728754332:ae=.01308079126447365:t[4]>73.50000000000001?ae=.13854015371106546:t[4]>48.50000000000001?ae=-.03684255740123261:t[6]>45.50000000000001?ae=.10329912215813097:t[10]>77.50000000000001?ae=-.08630788656925215:ae=.031022006843800853:t[1]>25.500000000000004?ae=-.08278381528048026:ae=.06664374548141594:t[84]>1e-35?ae=-.05624227409079396:ae=.00012184182357340415;let Oe;t[179]>1e-35?Oe=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Oe=-.07595415373151816:Oe=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Oe=.022822510448266862:Oe=.17491569312933697:Oe=-.058362287133533565:t[2]>2.5000000000000004?Oe=-.03633895806364428:Oe=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Oe=-.07294848747514579:Oe=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Oe=-.07009535282685533:t[8]>2640.0000000000005?Oe=-.051761240111316276:t[131]>1e-35?Oe=-.06245774419231631:Oe=.03495606662854905:Oe=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Oe=.0015036626973581122:Oe=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Oe=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Oe=.022343994371919224:Oe=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Oe=.07724450228328664:t[0]>3853.5000000000005?Oe=-.15671707454435677:t[10]>28.500000000000004?Oe=-.10179090671841723:Oe=.014878216919760927:Oe=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Oe=.14054154485273487:Oe=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Oe=-.08632985141410315:Oe=.005524157938954954:Oe=-.08802502622523681:Oe=-.0004649168897260341;let ve;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ve=-.007458687464321174:ve=-.09444966249102484:t[1]>23.500000000000004?ve=.08564129697360716:ve=-.07105002902845851:ve=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ve=-.10326216566705966:t[1]>26.500000000000004?ve=.0050539832484585365:ve=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ve=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ve=.05783632021087773:t[10]>17.500000000000004?ve=-.06720598671764105:t[1]>47.50000000000001?ve=.097495825172558:ve=-.013372242800584872:ve=-.06463226787713715:t[42]>1e-35?ve=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ve=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ve=.11051270080118503:ve=.027719462817590454:t[8]>597.5000000000001?ve=-.08441503592016869:ve=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ve=-.12190088985091102:ve=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ve=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ve=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ve=.016585157185448045:ve=-.11032043771149425:ve=.01586986028570486:t[8]>388.50000000000006?ve=-.10592413013261853:ve=.04930703248769364:t[13]>1e-35?ve=.003621937787920821:ve=-.0013786331198611841;let Fe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Fe=.009769895322846493:Fe=-.10620052926943656:t[9]>19.500000000000004?Fe=.03781202525403449:t[9]>14.500000000000002?Fe=-.11485785321365344:t[9]>6.500000000000001?Fe=.07677177833073881:t[0]>4342.500000000001?Fe=-.07079285609687631:t[49]>1e-35?Fe=.06156814809246001:Fe=-.014788509042554625:Fe=-.032659201618470655:t[5]>5207.500000000001?Fe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Fe=-.03094160322187924:t[1]>29.500000000000004?Fe=.09474646043921069:Fe=.023445783928231618:Fe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Fe=-.07164443768784848:t[1]>29.500000000000004?Fe=.089473622509272:t[8]>597.5000000000001?Fe=-.08155349903101317:Fe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Fe=-.004003900679358653:t[190]>1e-35?Fe=-.09236113461485262:t[8]>3198.5000000000005?Fe=-.0124130160451179:Fe=.018453070064009328:t[15]>1e-35?Fe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Fe=-.0009580759587680961:Fe=-.03227283036698222:Fe=.01369287669536875:t[1]>50.50000000000001?Fe=-.04213060332500437:t[35]>1e-35?Fe=-.11508095777767471:t[190]>1e-35?Fe=-.08611884672400155:t[297]>1e-35?Fe=.05723551879433584:Fe=-.004829340082311461;let Pe;t[183]>1e-35?Pe=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Pe=-.11753465135886734:Pe=-.007515490299047085:Pe=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Pe=-.12371142493530439:t[1]>36.50000000000001?Pe=.032189417575190435:Pe=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Pe=-.0784518658439288:t[2]>54.50000000000001?Pe=.12477882322370665:Pe=.000313468482399738:Pe=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Pe=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Pe=.0353146070135579:Pe=-.06327619611098285:Pe=.02813577701641991:Pe=-.12354390728506215:t[34]>1e-35?Pe=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Pe=-.01245803535276381:Pe=-.07169472553475001:t[1]>11.500000000000002?Pe=.12989984824561698:Pe=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Pe=.010390226893521422:t[10]>14.500000000000002?Pe=.16790888126487719:Pe=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Pe=-.043398307129729134:Pe=.09963544907820426:t[9]>30.500000000000004?Pe=-.13540713124984502:t[9]>17.500000000000004?Pe=.0509435850590757:Pe=-.04761897852404613:t[4]>78.50000000000001?Pe=.09197086656470652:Pe=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.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 fe;t[189]>1e-35?t[0]>5269.500000000001?fe=-.103183298350443:t[2]>51.50000000000001?fe=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?fe=-.05186168947388339:fe=.0496996365539082:t[10]>23.500000000000004?fe=.1404445738719:t[93]>1e-35?fe=.0027146310074558505:t[5]>3821.5000000000005?fe=.002153033152069652:t[4]>2.5000000000000004?fe=.007663539551317215:fe=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?fe=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?fe=-.021479467709980358:fe=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?fe=.021660293256233334:fe=-.0927396152303864:fe=.0665074081601698:t[0]>1550.5000000000002?fe=.08972407105958534:fe=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?fe=.06761927942466854:fe=-.015762168112653286:t[17]>1e-35?fe=.10311304131145381:fe=-.017672785252336027:fe=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?fe=-.10638321435298535:fe=.0007073011744385905:t[18]>1e-35?fe=-.027056185501334325:t[145]>1e-35?fe=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?fe=.09762140519655171:t[9]>110.50000000000001?fe=-.06581942957595835:t[6]>54.50000000000001?fe=.04959634035251596:fe=.0022616298654554207:fe=-.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 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 ie;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ie=.08396556264106572:ie=-.0562516995099192:ie=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ie=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ie=.0052017514017035915:ie=-.11194119432743639:ie=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ie=-.025692451287403446:ie=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ie=-.11892250746801664:t[10]>22.500000000000004?ie=.07548493166973796:ie=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ie=.13750699058082427:t[18]>1e-35?ie=.06535408879552801:ie=-.054118179035040674:ie=.1344282838979622:t[0]>3982.5000000000005?ie=-.10409582202467015:t[19]>1e-35?ie=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ie=.012705935670766466:ie=.14149359442527545:ie=-.047977876173706004:t[20]>1e-35?ie=.057945228080337946:t[0]>3642.5000000000005?ie=-.008726535792122467:ie=-.08424769891378858:t[34]>1e-35?ie=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ie=.01196849566739346:ie=.1614642278429876:ie=-.043022338150701625:t[3]>5.500000000000001?ie=-.03907848255033881:ie=.018280601026175593:ie=.0006654540402589085;let le;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?le=-.01386103677247845:le=.11386694333005128:t[4]>27.500000000000004?le=-.021862617610091336:t[2]>31.500000000000004?le=.0828858469030438:le=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?le=.11303635767048735:le=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?le=-.04238798044549342:le=.022091190130494303:t[5]>5082.500000000001?le=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?le=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?le=-.04291104140431434:t[17]>1e-35?le=.11256797532342613:le=-.017206916368289193:le=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?le=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?le=.03581712466863222:le=.14770264307668884:t[8]>73.50000000000001?le=-.13093289429740068:le=.042461737442702936:t[52]>1e-35?le=.0501831919044939:le=-.010450249720465756:le=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?le=.0005381332165438493:le=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?le=.04849637311285226:le=-.036671377119808564:t[0]>421.50000000000006?le=.00020968499911058945:le=.11636422423182405:le=-.12687837788222575:le=.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 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 Et;t[115]>1e-35?Et=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Et=-.10131179514695865:t[8]>938.5000000000001?Et=.10203729808015481:Et=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Et=.03574015165562999:Et=-.07763042506449493:Et=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Et=.0665706259130275:Et=-.06586817559309924:Et=.11925564412287476:Et=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Et=.046017146627455346:Et=-.08623321630086885:t[8]>1765.5000000000002?Et=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Et=.11143827902215087:Et=-.01817808730473413:Et=.16980985030210127:Et=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Et=.010168994879727824:Et=-.09099594488792513:t[9]>1.5000000000000002?Et=.0533459678147928:Et=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Et=-.062346959148773695:t[1]>47.50000000000001?Et=-.0021578343835599316:t[2]>27.500000000000004?Et=.19567373210166172:Et=.07851555379116423:t[18]>1e-35?Et=.03711549097804649:t[8]>359.50000000000006?Et=.012492346746905587:t[4]>20.500000000000004?Et=.047511695735697544:Et=-.07999269063948773:Et=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 jt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?jt=.018337297491457794:jt=-.05926206443180149:jt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?jt=.10747078482128616:t[126]>1e-35?jt=-.10550625192391357:t[7]>71.50000000000001?jt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?jt=.1317396472229434:jt=-.025035791351328947:jt=-.0728334305864372:t[8]>963.5000000000001?jt=.023642201723096064:jt=.183010326734258:t[128]>1e-35?jt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?jt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?jt=-.1088876900335281:jt=.02758317023002635:jt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?jt=-.01928020117446408:jt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?jt=.07893723375925096:jt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?jt=-.10301657587280551:jt=.005787463140224318:jt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?jt=-.019296977889522397:jt=-.07274529751752634:t[1]>30.500000000000004?jt=-.050368901143148286:jt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?jt=.0015332402792773946:jt=.09930153676749967:jt=-.06370844564357069:jt=.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 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 de;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?de=.07554189644995735:de=-.052089349455904946:de=-.10148206848169845:t[113]>1e-35?de=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?de=.07172653627995676:de=-.07602959317610998:de=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?de=-.0399322883690891:de=.06523495517476098:de=-.10358715295743802:t[193]>1e-35?de=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?de=.015928764772252406:de=.1341513061552287:de=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?de=-.033592997607280156:de=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?de=-.08402551858097379:de=.017401984506038796:t[1]>25.500000000000004?de=.13337205393591278:de=-.01160208350090984:de=.06708317942315471:t[8]>227.50000000000003?de=-.08486943882418681:de=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?de=-.10496268177586783:de=-.020921489532370493:de=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?de=.11639296062157028:de=-.004275784356569115:t[32]>1e-35?de=-.07297384970166025:de=.006026841626381599:de=.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 Le;t[40]>1e-35?t[0]>1937.5000000000002?Le=-.06421671152073961:Le=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Le=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Le=-.03520420769287065:t[8]>1085.5000000000002?Le=-.019817352506127633:Le=.11444439424520964:Le=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Le=-.010490117519863269:Le=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Le=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Le=.06619344145920268:t[0]>4091.5000000000005?Le=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Le=.10016091391222309:Le=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Le=-.019511460451434884:Le=-.11643672465055221:t[2]>18.500000000000004?Le=.07848228087333317:t[8]>55.50000000000001?Le=.032583027899956235:Le=-.11209832692153521:t[11]>1e-35?Le=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Le=-.09996887746328006:t[9]>2.5000000000000004?Le=.02157682011863397:Le=-.05247727848991843:Le=.07409150201483244:t[1]>38.50000000000001?Le=-.11378466075449625:t[224]>1e-35?Le=-.10741749127732923:t[1]>26.500000000000004?Le=.07343136534146562:Le=-.07013573628594773:t[25]>1e-35?Le=-.04626669734164317:Le=.05518333197956482:Le=.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 Y;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?Y=-.07583539600416284:t[188]>1e-35?Y=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?Y=-.011038193049597113:Y=.08154028164397753:t[1]>85.50000000000001?Y=.10259361975201933:Y=.011640408330521594:Y=-.00023319159023748508:t[92]>1e-35?Y=.13771692859530546:Y=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?Y=.09967230141007705:t[30]>1e-35?Y=-.08888529037551285:Y=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?Y=.08284665960761373:Y=-.029292565021289504:t[7]>7.500000000000001?Y=-.09945093355204493:Y=-.008381393701708593:t[20]>1e-35?Y=-.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?Y=.07585582641438211:t[8]>284.50000000000006?Y=-.029387993239886723:Y=.07716738177321587:t[1]>18.500000000000004?Y=.026745348497993746:Y=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?Y=.02337306890530338:Y=-.10390355904767366:Y=.07390521199638532:Y=-.06788247515155237:Y=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?Y=-.06360325615644084:Y=.04342192339836601:Y=-.10598779152030145:Y=.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 pe;t[147]>1e-35?t[1]>53.50000000000001?pe=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?pe=-.02763546051134888:pe=.06423344777499343:pe=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?pe=.049825139823021586:t[7]>22.500000000000004?pe=-.01131680751379858:t[0]>2579.5000000000005?pe=-.10673674485369694:pe=-.015387212937189957:pe=.04347325151148724:t[179]>1e-35?pe=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.0650355590939066:pe=-.0473332870892226:pe=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?pe=.11139543329789044:t[126]>1e-35?pe=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?pe=.06370903833231022:t[10]>29.500000000000004?pe=.03415223859607161:t[10]>3.5000000000000004?pe=-.07415518117873297:pe=-.0014119203473324082:pe=.12617652343819508:t[9]>41.50000000000001?pe=-.10311145857176976:t[8]>2757.5000000000005?pe=-.08106484219011428:t[7]>71.50000000000001?pe=-.09783384432091176:t[1]>88.50000000000001?pe=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?pe=-.008884084501608536:pe=.061339437777743616:pe=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?pe=.01526664064166223:pe=.13534828515415498:pe=-.06985484465894776:pe=.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 Xe;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?Xe=-.10100794502567233:Xe=.08000205636470442:Xe=-.11945419826856896:t[113]>1e-35?Xe=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?Xe=.1224302423880318:Xe=-.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?Xe=.0019277012166729114:t[1]>28.500000000000004?Xe=-.054445821715687494:Xe=.045645722976713245:t[30]>1e-35?Xe=.13402660155331655:Xe=.008921176001777645:Xe=-.058547426505451076:Xe=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?Xe=-.13526418192218206:Xe=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?Xe=.0007263224246135398:Xe=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?Xe=-.11575657261278308:Xe=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?Xe=-.01995960178292952:Xe=.11216586049153021:Xe=-.10050961087149474:Xe=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Xe=.10303451081526649:Xe=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?Xe=-.043799548968209395:Xe=-.12451444314954115:t[4]>12.500000000000002?Xe=-.03838117361958468:Xe=.06504990789767144:t[57]>1e-35?Xe=.06890006938293915:Xe=.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 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 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 ge;t[7]>17.500000000000004?t[115]>1e-35?ge=.08741852531696623:t[167]>1e-35?ge=.10078975495600809:ge=-.0018324767784017562:t[290]>1e-35?ge=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ge=.1379733311640402:ge=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ge=-.09360083033774169:ge=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ge=-.015599362579530679:t[0]>4593.500000000001?ge=-.12029549262691491:ge=-.018917032256501397:ge=.04632831686576592:ge=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ge=-.05894883236412263:ge=.05213944998315824:ge=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ge=.07577412405680808:ge=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ge=-.0277076900736147:t[1]>65.50000000000001?ge=-.023587471585763506:ge=.10184896592433082:ge=-.057699270527916825:ge=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ge=.06566902102799584:t[10]>25.500000000000004?ge=-.07033633753181047:ge=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ge=-.08108035861059537:ge=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ge=-.12431182772561139:ge=.01886235886984271:ge=.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 $t;t[3]>7.500000000000001?$t=.0004981426543104341:t[9]>114.50000000000001?$t=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?$t=-.019061766497948867:$t=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?$t=-.006044199577160493:$t=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?$t=.11486607015912494:t[9]>16.500000000000004?$t=-.08686820858087294:$t=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?$t=-.022230207980026437:$t=.1056683690528792:$t=-.05859530800943035:$t=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?$t=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?$t=-.05177544573528314:$t=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?$t=.15159657923771555:$t=-.0060542654587671055:t[9]>5.500000000000001?$t=-.042808028205051786:t[1]>48.50000000000001?$t=-.010449538258110742:$t=.10026907521968294:$t=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?$t=-.02272452389409874:$t=-.11202691218244319:t[5]>1809.5000000000002?$t=-.04460413584255906:$t=.08196329474205256:t[10]>69.50000000000001?$t=.10221481166238167:$t=.0004063052701699382:t[243]>1e-35?$t=-.07563941678849846:t[18]>1e-35?$t=.02563513231103432:$t=-.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 sr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?sr=.14144941521975005:sr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?sr=.10514088112381886:t[7]>18.500000000000004?sr=-.10370643555956745:sr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?sr=-.0508129468802936:t[224]>1e-35?sr=-.037816066368733595:t[10]>43.50000000000001?sr=.07793408602607932:sr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?sr=.036972453794202324:sr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?sr=.09475302525132188:sr=-.03580104945898193:sr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?sr=-.1282448778804823:sr=-.014395808269207212:sr=-.008940927190750592:sr=-.1459118815453748:t[0]>4897.500000000001?sr=-.09733068457286576:t[1]>57.50000000000001?sr=.06575271409540207:sr=-.019556422817450115:sr=-.10623959222984136:t[18]>1e-35?sr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?sr=.008125645893104896:sr=-.11084368630465868:sr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?sr=-.05854904579626861:t[4]>5.500000000000001?sr=.02985784951394175:sr=-.03247600140149334:sr=-.11152899295304973:sr=-.00035424577714215764;let Nr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Nr=-.06563670567578264:Nr=.067656954313663:Nr=-.10388217548685377:t[8]>2302.5000000000005?Nr=.07190621943790435:t[4]>67.50000000000001?Nr=.060020507643618604:t[4]>38.50000000000001?Nr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Nr=-.06568134366461277:t[8]>1075.5000000000002?Nr=-.004768057709758692:Nr=.11785959165999467:Nr=-.05080221682879267:Nr=.14814206127494542:Nr=-.07241946332311736:t[253]>1e-35?Nr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Nr=-.02471195342450034:Nr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Nr=-.10741850739482771:Nr=.010051635824944:Nr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Nr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Nr=-.08992396138178163:Nr=.010944365997007212:Nr=.06221307021813793:Nr=.1286024087559141:t[127]>1e-35?Nr=.06568148624531012:t[10]>40.50000000000001?Nr=-.07567979134643352:t[5]>5647.500000000001?Nr=.07594672895572069:Nr=-.018158016446439187:t[6]>55.50000000000001?Nr=.009293422430111872:t[4]>45.50000000000001?Nr=-.017749818406964022:t[2]>46.50000000000001?Nr=.01714136511113982:Nr=-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 wm=jtc(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+q+Q+U+z+W+$+J+ne+H+re+ae+Oe+ve+Fe+Pe+Z+ee+K+fe+X+ue+qe+ie+le+Ne+we+Be+tt+st+Et+kt+Ht+jt+Ie+F+be+Ue+de+Se+Le+te+Te+Ge+Y+se+pe+Ce+He+$e+Xe+ct+bt+ht+We+ce+Re+Me+ge+oe+ze+at+$t+gr+sr+Nr+Hr+Gr+zt+_r);return[1-wm,wm]}a(qtc,"multilineModelPredict");function jtc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(jtc,"sigmoid")});var K2i=I(GG=>{"use strict";p();Object.defineProperty(GG,"__esModule",{value:!0});GG.MultilineModelFeatures=GG.PromptFeatures=void 0;GG.hasComment=Jxr;GG.requestMultilineScore=Vtc;var HG=W2i(),Htc=z2i(),Gtc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},Y2i={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function Jxr(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(Gtc[r]??[]).some(l=>s.includes(l))}a(Jxr,"hasComment");var T5e=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=Jxr(e,-2,r),this.rstripSecondToLastLineHasComment=Jxr(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]}};c$.PromptFeatures=Z5e;var hyt=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Z5e(e,n),this.suffixFeatures=new Z5e(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(ENi).length+1).fill(0);r[ENi[this.language]??0]=1;let n=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);n[a$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);o[a$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);s[a$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);return c[a$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};c$.MultilineModelFeatures=hyt;function Woc(t,e){return new hyt(t.prefix,t.suffix,e)}a(Woc,"constructMultilineFeatures");function zoc(t,e){let r=Woc(t,e).constructFeatures();return(0,$oc.multilineModelPredict)(r)[1]}a(zoc,"requestMultilineScore")});var CNi=I(p6=>{"use strict";p();var Yoc=p6&&p6.__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},Koc=p6&&p6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(p6,"__esModule",{value:!0});p6.StreamedCompletionSplitter=void 0;var Joc=Qs(),Zoc=XOe(),Xoc=Zme(),rRr=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}},nRr=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 rRr(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 Xoc.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(Zoc.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}};p6.StreamedCompletionSplitter=nRr;p6.StreamedCompletionSplitter=nRr=Yoc([Koc(5,Joc.IInstantiationService)],nRr)});var RNi=I(iRr=>{"use strict";p();Object.defineProperty(iRr,"__esModule",{value:!0});iRr.getGhostTextStrategy=ssc;var xNi=Qs(),vNi=Ute(),wD=vE(),wNi=VA(),myt=ngt(),bNi=Tg(),esc=Hme(),X5e=Zme(),tsc=Ywr(),rsc=UOe(),nsc=Kbr(),isc=_Ni(),osc=CNi(),SNi=20;function TNi(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]}};GG.PromptFeatures=T5e;var DAt=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new T5e(e,n),this.suffixFeatures=new T5e(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(Y2i).length+1).fill(0);r[Y2i[this.language]??0]=1;let n=new Array(Object.keys(HG.contextualFilterCharacterMap).length+1).fill(0);n[HG.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(HG.contextualFilterCharacterMap).length+1).fill(0);o[HG.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(HG.contextualFilterCharacterMap).length+1).fill(0);s[HG.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(HG.contextualFilterCharacterMap).length+1).fill(0);return c[HG.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};GG.MultilineModelFeatures=DAt;function $tc(t,e){return new DAt(t.prefix,t.suffix,e)}a($tc,"constructMultilineFeatures");function Vtc(t,e){let r=$tc(t,e).constructFeatures();return(0,Htc.multilineModelPredict)(r)[1]}a(Vtc,"requestMultilineScore")});var J2i=I(Z8=>{"use strict";p();var Wtc=Z8&&Z8.__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},ztc=Z8&&Z8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Z8,"__esModule",{value:!0});Z8.StreamedCompletionSplitter=void 0;var Ytc=Ls(),Ktc=IOe(),Jtc=Rme(),Zxr=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}},Xxr=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 Zxr(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 Jtc.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(Ktc.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}};Z8.StreamedCompletionSplitter=Xxr;Z8.StreamedCompletionSplitter=Xxr=Wtc([ztc(5,Ytc.IInstantiationService)],Xxr)});var oDi=I(ewr=>{"use strict";p();Object.defineProperty(ewr,"__esModule",{value:!0});ewr.getGhostTextStrategy=irc;var nDi=Ls(),Z2i=Cte(),_D=EE(),iDi=JA(),NAt=vmt(),X2i=xg(),Ztc=_me(),I5e=Rme(),Xtc=$xr(),erc=fOe(),trc=VCr(),rrc=K2i(),nrc=J2i(),eDi=20;function tDi(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(TNi,"takeNLines");async function ssc(t,e,r,n,o,s,c){let l=t.get(xNi.IInstantiationService),u=t.get(wNi.ICompletionsFeaturesService),d=t.get(nsc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case wD.BlockMode.Server:return s?{blockMode:wD.BlockMode.Parsing,requestMultiline:!0,finishedCb:TNi(f),stop:[` +`).length}}a(tDi,"takeNLines");async function irc(t,e,r,n,o,s,c){let l=t.get(nDi.IInstantiationService),u=t.get(iDi.ICompletionsFeaturesService),d=t.get(trc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case _D.BlockMode.Server:return s?{blockMode:_D.BlockMode.Parsing,requestMultiline:!0,finishedCb:tDi(f),stop:[` -`],maxTokens:SNi*f}:{blockMode:wD.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case wD.BlockMode.Parsing:case wD.BlockMode.ParsingAndServer:case wD.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(asc,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=esc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(INi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:wD.BlockMode.Parsing,requestMultiline:!0,finishedCb:TNi(f),stop:[` +`],maxTokens:eDi*f}:{blockMode:_D.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case _D.BlockMode.Parsing:case _D.BlockMode.ParsingAndServer:case _D.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(orc,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=Ztc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(rDi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:_D.BlockMode.Parsing,requestMultiline:!0,finishedCb:tDi(f),stop:[` -`],maxTokens:SNi*f};return h===wD.BlockMode.MoreMultiline&&(g.blockMode=wD.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(INi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(ssc,"getGhostTextStrategy");function INi(t,e,r,n,o,s,c,l,u){let d=t.get(wNi.ICompletionsFeaturesService),f=t.get(xNi.IInstantiationService);if(c&&e===wD.BlockMode.MoreMultiline&&X5e.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===X5e.BlockPositionType.EmptyBlock||o===X5e.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(rsc.ICompletionsCacheService);return{finishedCb:f.createInstance(osc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,tsc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,myt.parsingBlockFinished)(r,n):h=>{}}}a(INi,"buildFinishedCallback");async function asc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,bNi.telemetry)(t,"ghostText.longFileMultilineSkip",bNi.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===wD.BlockMode.MoreMultiline&&X5e.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,X5e.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&csc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,vNi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,myt.isEmptyBlockStartUtil)(r,n):o&&(0,vNi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,myt.isEmptyBlockStartUtil)(r,n)||await(0,myt.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,isc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(asc,"shouldRequestMultiline");function csc(t,e){return e.lineAt(t).text.trim().length===0}a(csc,"isNewLine")});var ONi=I(AR=>{"use strict";p();var lsc=AR&&AR.__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},RD=AR&&AR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(AR,"__esModule",{value:!0});AR.ForceMultiLine=AR.GhostTextComputer=void 0;AR.getGhostText=ksc;var PNi=pp(),usc=o0(),dsc=Ewr(),fsc=um(),DNi=Qs(),psc=_wr(),hsc=Lme(),msc=TOe(),gsc=Ovr(),t4e=vE(),uRr=VA(),Asc=xl(),ysc=Sge(),Esc=obr(),_sc=iyt(),Csc=jgt(),vsc=qG(),bsc=ngt(),oRr=mge(),aRr=Rwr(),sRr=qDi(),Nge=Tg(),gyt=Hme(),kNi=LOe(),Ssc=kbr(),Tsc=Zme(),Isc=UOe(),cRr=gNi(),NNi=Zbr(),xsc=RNi(),l$=xG(),sh=tge(),wsc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Rsc(t,e,r){let n=t.get(uRr.ICompletionsFeaturesService),o=(0,t4e.getConfig)(t,t4e.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,Nge.now)()-r.issuedTime;return Math.max(0,o-s)}a(Rsc,"getRemainingDebounceMs");function e4e(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(e4e,"isCompletionRequestCancelled");var Ayt=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,fsc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Osc,e.textDocument,l,n);await hsc.initializeTokenizers.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,ysc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,sh.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,Nge.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),e4e(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};let g=Dsc(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,sh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Esc.getEngineRequestInfo,n),y={...wsc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(oRr.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(oRr.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,sh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,sh.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,sh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,sh.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,sh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(Rsc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,kNi.delay)(_),e4e(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,sh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,oRr.trimLastLine)(e.textDocument.getText(gyt.LocationFactory.range(gyt.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(xsc.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(Psc,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(aRr.extractRepoInfoInBackground,e.textDocument.uri),k={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:E.prompt,multiline:w.requestMultiline,indentation:(0,bsc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:b};k.headers={...k.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(Lsc,e.textDocument,k,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 W=!w.requestMultiline;R=[[(0,cRr.makeGhostAPIChoice)(U[0],{forceSingleLine:W})],l$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(e4e(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,sh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===t4e.BlockMode.MoreMultiline&&Tsc.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(sRr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===l$.ResultType.Cache||R[1]===l$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,sh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,sh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,sh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(cRr.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let W=await U.getAllCompletionsFromNetwork(k,D,o,w.finishedCb,l);if(W.type==="success"){d.trace(`Cycling network request returned ${W.value[0].length} choices`);let V=R?.[0]??[];W.value[0].forEach(G=>{V.findIndex(Y=>Y.completionText.trim()===G.completionText.trim())===-1&&V.push(G)}),d.trace(`After deduplication: ${V.length} unique choices`),R=[V,l$.ResultType.Cycling]}else if(R===void 0)return W}else{d.trace("Initiating network request for completions");let W=a((re,j)=>(this.asyncCompletionManager.updateCompletion(r,re),w.finishedCb(re,j)),"finishedCb"),V=new msc.CancellationTokenSource,G=U.getCompletionsFromNetwork(k,D,V.token,W,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,V,G);let Y=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(Y===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,sh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[Y[0]],l$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,sh.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,sh.resultTypeToString)(B)}`);let Q=L.map(U=>this.instantiationService.invokeFunction(sRr.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(t4e.getConfig,t4e.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,Nge.now)()-n.issuedTime,q=Math.max(M-O,0);if(B!==l$.ResultType.TypingAsSuggested&&!y.isCycling&&q>0&&(d.debug(`Waiting ${q}ms before returning completion`),await(0,kNi.delay)(q),e4e(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,sh.mkCanceledResultTelemetry)(D)};let F=[];for(let U of Q){let W=Bsc(e.textDocument,k,U,D),V=g?(0,sRr.checkSuffix)(e.textDocument,e.position,U):0,Y={completion:Nsc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:W,isMiddleOfTheLine:g,suffixCoverage:V,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};F.push(Y)}return D.properties.clientCompletionId=F[0]?.clientCompletionId,D.measurements.foundOffset=F?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${F.length} results from ${(0,sh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),e4e(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,sh.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 ${F.length} results`),{type:"success",value:[F,B],telemetryData:(0,sh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};AR.GhostTextComputer=Ayt;AR.GhostTextComputer=Ayt=lsc([RD(0,DNi.IInstantiationService),RD(1,usc.ITelemetryService),RD(2,gsc.ICompletionsNotifierService),RD(3,Csc.ICompletionsContextProviderBridgeService),RD(4,NNi.ICompletionsCurrentGhostText),RD(5,vsc.ICompletionsContextProviderService),RD(6,Ssc.ICompletionsAsyncManagerService),RD(7,uRr.ICompletionsFeaturesService),RD(8,Asc.ICompletionsLogTargetService),RD(9,_sc.ICompletionsStatusReporter),RD(10,PNi.ILogService)],Ayt);async function ksc(t,e,r,n,o,s,c){return t.get(DNi.IInstantiationService).createInstance(Ayt).getGhostText(e,r,n,o,s,c)}a(ksc,"getGhostText");function Psc(t,e,r,n){let s=t.get(NNi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=Msc(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),l$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,l$.ResultType.Cache]}a(Psc,"getLocalInlineSuggestion");function Dsc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,psc.isInlineSuggestionFromTextAfterCursor)(n)}a(Dsc,"isInlineSuggestion");var lRr=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};AR.ForceMultiLine=lRr;function Nsc(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(Nsc,"adjustLeadingWhitespace");function Msc(t,e,r,n){let o=t.get(PNi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Isc.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,cRr.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(Msc,"getCompletionsFromCache");async function Osc(t,e,r,n){let o=t.get(uRr.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=Nge.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Osc,"createTelemetryWithExp");function Bsc(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,MNi(l,t),l.extendWithRequestId(o),l}a(Bsc,"telemetryWithAddData");function Lsc(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);MNi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===aRr.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==aRr.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(gyt.LocationFactory.range(h.range.start,n)),g=e.getText(gyt.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,dsc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,Nge.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,Nge.telemetry)(t,"ghostText.issued",_),d}a(Lsc,"telemetryIssued");function MNi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(MNi,"addDocumentTelemetry")});var UNi=I(h6=>{"use strict";p();var Fsc=h6&&h6.__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},dRr=h6&&h6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(h6,"__esModule",{value:!0});h6.GhostText=void 0;var BNi=ti(),Usc=Qs(),Qsc=t1r(),qsc=DDi(),LNi=ONi(),jsc=hwr(),Hsc=xG(),Gsc=Jmt(),FNi=tge(),$sc=xl(),fRr=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){Vsc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,Qsc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(FNi.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(LNi.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(jsc.setLastShown,e.textDocument,e.position,f),m=(0,qsc.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!==Hsc.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(LNi.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,_=BNi.Range.create(y,BNi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};h6.GhostText=fRr;h6.GhostText=fRr=Fsc([dRr(0,Usc.IInstantiationService),dRr(1,$sc.ICompletionsLogTargetService),dRr(2,Gsc.ICompletionsSpeculativeRequestCache)],fRr);function Vsc(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}});FNi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(Vsc,"logCompletionLocation")});var QNi=I(_yt=>{"use strict";p();Object.defineProperty(_yt,"__esModule",{value:!0});_yt.LocalFileSystem=void 0;var yyt=require("fs"),Wsc=require("path"),Eyt=bG(),pRr=TG(),hRr=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await yyt.promises.readFile((0,pRr.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,pRr.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,pRr.fsPath)(e),n=await yyt.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,Wsc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await yyt.promises.lstat(e);if(r.isSymbolicLink())try{let n=await yyt.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=Eyt.FileType.Unknown;return e.isFile()&&(o=Eyt.FileType.File),e.isDirectory()&&(o=Eyt.FileType.Directory),r.isSymbolicLink()&&n&&(o|=Eyt.FileType.SymbolicLink),o}};_yt.LocalFileSystem=hRr});var GNi=I(m6=>{"use strict";p();var zsc=m6&&m6.__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},r4e=m6&&m6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(m6,"__esModule",{value:!0});m6.CompositeRelatedFilesProvider=void 0;var Ysc=Bte(),Ksc=Qs(),Mge=vE(),Jsc=VA(),Zsc=bG(),Xsc=xl(),n4e=pge(),wre=Zgt(),qNi=["cpp","c","cuda-cpp"],jNi=["typescript","javascript","typescriptreact","javascriptreact"],HNi=["csharp"],eac=new Map([...qNi.map(t=>[t,n4e.NeighboringFileType.RelatedCpp]),...jNi.map(t=>[t,n4e.NeighboringFileType.RelatedTypeScript]),...HNi.map(t=>[t,n4e.NeighboringFileType.RelatedCSharpRoslyn])]);function tac(t){return eac.get(t)??n4e.NeighboringFileType.RelatedOther}a(tac,"getNeighboringFileType");var mRr=class extends wre.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(tac(s)===n4e.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),wre.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),wre.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return wre.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),wre.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return wre.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)wre.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 HNi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(Mge.getConfig,Mge.ConfigKey.RelatedFilesVSCodeCSharp):jNi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(Mge.getConfig,Mge.ConfigKey.RelatedFilesVSCodeTypeScript):qNi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(Mge.getConfig,Mge.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};m6.CompositeRelatedFilesProvider=mRr;m6.CompositeRelatedFilesProvider=mRr=zsc([r4e(0,Ksc.IInstantiationService),r4e(1,Ysc.IIgnoreService),r4e(2,Jsc.ICompletionsFeaturesService),r4e(3,Xsc.ICompletionsLogTargetService),r4e(4,Zsc.ICompletionsFileSystemService)],mRr)});var Cyt=I(Rre=>{"use strict";p();Object.defineProperty(Rre,"__esModule",{value:!0});Rre.PositionOffsetTransformer=Rre.PositionOffsetTransformerBase=void 0;Rre.ensureDependenciesAreSet=iac;var $Ni=gE(),VNi=MMe(),rac=Vct(),nac=Zpe(),WNi=Vct();Object.defineProperty(Rre,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return WNi.PositionOffsetTransformerBase},"get")});Object.defineProperty(Rre,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return WNi.PositionOffsetTransformer},"get")});(0,rac._setPositionOffsetTransformerDependencies)({StringEdit:$Ni.StringEdit,StringReplacement:$Ni.StringReplacement,TextReplacement:VNi.TextReplacement,TextEdit:VNi.TextEdit,TextLength:nac.TextLength});function iac(){}a(iac,"ensureDependenciesAreSet")});var byt=I(vyt=>{"use strict";p();Object.defineProperty(vyt,"__esModule",{value:!0});vyt.RootedLineEdit=void 0;var zNi=eG(),oac=Cyt(),sac=kD();(0,oac.ensureDependenciesAreSet)();var gRr=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=zNi.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 sac.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 zNi.LineEdit(r))}};vyt.RootedLineEdit=gRr});var kD=I(u$=>{"use strict";p();Object.defineProperty(u$,"__esModule",{value:!0});u$.Edits=u$.SingleEdits=u$.RootedEdit=void 0;var YNi=Yu(),aac=eG(),Oge=gE(),KNi=yRr(),cac=byt(),i4e=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return aac.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,YNi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,YNi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return cac.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)}};u$.RootedEdit=i4e;var ARr=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return Oge.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new Syt(Oge.StringEdit,this.edits.map(e=>e.toEdit()))}};u$.SingleEdits=ARr;var Syt=class t{static{a(this,"Edits")}static single(e){return new t(Oge.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=Oge.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(Oge.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,KNi.serializeStringEdit)(e))}static deserialize(e){return new t(Oge.StringEdit,e.map(r=>(0,KNi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=i4e.toLineEdit(new i4e(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` +`],maxTokens:eDi*f};return h===_D.BlockMode.MoreMultiline&&(g.blockMode=_D.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(rDi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(irc,"getGhostTextStrategy");function rDi(t,e,r,n,o,s,c,l,u){let d=t.get(iDi.ICompletionsFeaturesService),f=t.get(nDi.IInstantiationService);if(c&&e===_D.BlockMode.MoreMultiline&&I5e.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===I5e.BlockPositionType.EmptyBlock||o===I5e.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(erc.ICompletionsCacheService);return{finishedCb:f.createInstance(nrc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,Xtc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,NAt.parsingBlockFinished)(r,n):h=>{}}}a(rDi,"buildFinishedCallback");async function orc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,X2i.telemetry)(t,"ghostText.longFileMultilineSkip",X2i.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===_D.BlockMode.MoreMultiline&&I5e.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,I5e.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&src(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,Z2i.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,NAt.isEmptyBlockStartUtil)(r,n):o&&(0,Z2i.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,NAt.isEmptyBlockStartUtil)(r,n)||await(0,NAt.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,rrc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(orc,"shouldRequestMultiline");function src(t,e){return e.lineAt(t).text.trim().length===0}a(src,"isNewLine")});var dDi=I(uR=>{"use strict";p();var arc=uR&&uR.__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},vD=uR&&uR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uR,"__esModule",{value:!0});uR.ForceMultiLine=uR.GhostTextComputer=void 0;uR.getGhostText=wrc;var aDi=hp(),crc=o0(),lrc=mxr(),urc=um(),cDi=Ls(),drc=gxr(),frc=hme(),prc=ZMe(),hrc=kvr(),w5e=EE(),swr=JA(),mrc=Tl(),grc=tge(),Arc=tCr(),yrc=CAt(),Erc=sgt(),_rc=bG(),vrc=vmt(),twr=Vme(),nwr=Txr(),rwr=A2i(),uge=xg(),MAt=_me(),sDi=uOe(),Crc=ICr(),brc=Rme(),Src=fOe(),iwr=V2i(),lDi=zCr(),Trc=oDi(),$G=lG(),ah=Dme(),Irc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function xrc(t,e,r){let n=t.get(swr.ICompletionsFeaturesService),o=(0,w5e.getConfig)(t,w5e.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,uge.now)()-r.issuedTime;return Math.max(0,o-s)}a(xrc,"getRemainingDebounceMs");function x5e(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(x5e,"isCompletionRequestCancelled");var OAt=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,urc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Nrc,e.textDocument,l,n);await frc.initializeTokenizers.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,grc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,ah.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,uge.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),x5e(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,ah.mkBasicResultTelemetry)(n)};let g=Prc(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,ah.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Arc.getEngineRequestInfo,n),y={...Irc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(twr.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(twr.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,ah.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,ah.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,ah.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,ah.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,ah.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,ah.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(xrc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,sDi.delay)(_),x5e(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,ah.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,twr.trimLastLine)(e.textDocument.getText(MAt.LocationFactory.range(MAt.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(Trc.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(Rrc,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(nwr.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,vrc.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(Orc,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 z=!w.requestMultiline;R=[[(0,iwr.makeGhostAPIChoice)(U[0],{forceSingleLine:z})],$G.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(x5e(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,ah.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===w5e.BlockMode.MoreMultiline&&brc.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(rwr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===$G.ResultType.Cache||R[1]===$G.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,ah.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,ah.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,ah.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(iwr.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let z=await U.getAllCompletionsFromNetwork(P,D,o,w.finishedCb,l);if(z.type==="success"){d.trace(`Cycling network request returned ${z.value[0].length} choices`);let W=R?.[0]??[];z.value[0].forEach($=>{W.findIndex(J=>J.completionText.trim()===$.completionText.trim())===-1&&W.push($)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,$G.ResultType.Cycling]}else if(R===void 0)return z}else{d.trace("Initiating network request for completions");let z=a((ne,H)=>(this.asyncCompletionManager.updateCompletion(r,ne),w.finishedCb(ne,H)),"finishedCb"),W=new prc.CancellationTokenSource,$=U.getCompletionsFromNetwork(P,D,W.token,z,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,$);let J=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(J===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,ah.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[J[0]],$G.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,ah.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,ah.resultTypeToString)(B)}`);let j=L.map(U=>this.instantiationService.invokeFunction(rwr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0);d.trace(`Post-processed to ${j.length} choices`);let M=this.instantiationService.invokeFunction(w5e.getConfig,w5e.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,uge.now)()-n.issuedTime,q=Math.max(M-O,0);if(B!==$G.ResultType.TypingAsSuggested&&!y.isCycling&&q>0&&(d.debug(`Waiting ${q}ms before returning completion`),await(0,sDi.delay)(q),x5e(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,ah.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of j){let z=Mrc(e.textDocument,P,U,D),W=g?(0,rwr.checkSuffix)(e.textDocument,e.position,U):0,J={completion:krc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:z,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(J)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,ah.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),x5e(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,ah.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,ah.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};uR.GhostTextComputer=OAt;uR.GhostTextComputer=OAt=arc([vD(0,cDi.IInstantiationService),vD(1,crc.ITelemetryService),vD(2,hrc.ICompletionsNotifierService),vD(3,Erc.ICompletionsContextProviderBridgeService),vD(4,lDi.ICompletionsCurrentGhostText),vD(5,_rc.ICompletionsContextProviderService),vD(6,Crc.ICompletionsAsyncManagerService),vD(7,swr.ICompletionsFeaturesService),vD(8,mrc.ICompletionsLogTargetService),vD(9,yrc.ICompletionsStatusReporter),vD(10,aDi.ILogService)],OAt);async function wrc(t,e,r,n,o,s,c){return t.get(cDi.IInstantiationService).createInstance(OAt).getGhostText(e,r,n,o,s,c)}a(wrc,"getGhostText");function Rrc(t,e,r,n){let s=t.get(lDi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=Drc(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),$G.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,$G.ResultType.Cache]}a(Rrc,"getLocalInlineSuggestion");function Prc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,drc.isInlineSuggestionFromTextAfterCursor)(n)}a(Prc,"isInlineSuggestion");var owr=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};uR.ForceMultiLine=owr;function krc(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(krc,"adjustLeadingWhitespace");function Drc(t,e,r,n){let o=t.get(aDi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Src.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,iwr.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(Drc,"getCompletionsFromCache");async function Nrc(t,e,r,n){let o=t.get(swr.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=uge.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Nrc,"createTelemetryWithExp");function Mrc(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,uDi(l,t),l.extendWithRequestId(o),l}a(Mrc,"telemetryWithAddData");function Orc(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);uDi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===nwr.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==nwr.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(MAt.LocationFactory.range(h.range.start,n)),g=e.getText(MAt.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,lrc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,uge.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,uge.telemetry)(t,"ghostText.issued",_),d}a(Orc,"telemetryIssued");function uDi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(uDi,"addDocumentTelemetry")});var mDi=I(X8=>{"use strict";p();var Brc=X8&&X8.__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=X8&&X8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(X8,"__esModule",{value:!0});X8.GhostText=void 0;var fDi=ti(),Lrc=Ls(),Frc=JCr(),Urc=c2i(),pDi=dDi(),Qrc=uxr(),qrc=lG(),jrc=mmt(),hDi=Dme(),Hrc=Tl(),cwr=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){Grc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,Frc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(hDi.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(pDi.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(Qrc.setLastShown,e.textDocument,e.position,f),m=(0,Urc.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!==qrc.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(pDi.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,_=fDi.Range.create(y,fDi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};X8.GhostText=cwr;X8.GhostText=cwr=Brc([awr(0,Lrc.IInstantiationService),awr(1,Hrc.ICompletionsLogTargetService),awr(2,jrc.ICompletionsSpeculativeRequestCache)],cwr);function Grc(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}});hDi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(Grc,"logCompletionLocation")});var gDi=I(FAt=>{"use strict";p();Object.defineProperty(FAt,"__esModule",{value:!0});FAt.LocalFileSystem=void 0;var BAt=require("fs"),$rc=require("path"),LAt=oG(),lwr=aG(),uwr=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await BAt.promises.readFile((0,lwr.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,lwr.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,lwr.fsPath)(e),n=await BAt.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,$rc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await BAt.promises.lstat(e);if(r.isSymbolicLink())try{let n=await BAt.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=LAt.FileType.Unknown;return e.isFile()&&(o=LAt.FileType.File),e.isDirectory()&&(o=LAt.FileType.Directory),r.isSymbolicLink()&&n&&(o|=LAt.FileType.SymbolicLink),o}};FAt.LocalFileSystem=uwr});var _Di=I(e6=>{"use strict";p();var Vrc=e6&&e6.__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},R5e=e6&&e6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(e6,"__esModule",{value:!0});e6.CompositeRelatedFilesProvider=void 0;var Wrc=Ete(),zrc=Ls(),dge=EE(),Yrc=JA(),Krc=oG(),Jrc=Tl(),P5e=Gme(),dre=ggt(),ADi=["cpp","c","cuda-cpp"],yDi=["typescript","javascript","typescriptreact","javascriptreact"],EDi=["csharp"],Zrc=new Map([...ADi.map(t=>[t,P5e.NeighboringFileType.RelatedCpp]),...yDi.map(t=>[t,P5e.NeighboringFileType.RelatedTypeScript]),...EDi.map(t=>[t,P5e.NeighboringFileType.RelatedCSharpRoslyn])]);function Xrc(t){return Zrc.get(t)??P5e.NeighboringFileType.RelatedOther}a(Xrc,"getNeighboringFileType");var dwr=class extends dre.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(Xrc(s)===P5e.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),dre.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),dre.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return dre.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),dre.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return dre.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)dre.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 EDi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(dge.getConfig,dge.ConfigKey.RelatedFilesVSCodeCSharp):yDi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(dge.getConfig,dge.ConfigKey.RelatedFilesVSCodeTypeScript):ADi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(dge.getConfig,dge.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};e6.CompositeRelatedFilesProvider=dwr;e6.CompositeRelatedFilesProvider=dwr=Vrc([R5e(0,zrc.IInstantiationService),R5e(1,Wrc.IIgnoreService),R5e(2,Yrc.ICompletionsFeaturesService),R5e(3,Jrc.ICompletionsLogTargetService),R5e(4,Krc.ICompletionsFileSystemService)],dwr)});var UAt=I(fre=>{"use strict";p();Object.defineProperty(fre,"__esModule",{value:!0});fre.PositionOffsetTransformer=fre.PositionOffsetTransformerBase=void 0;fre.ensureDependenciesAreSet=rnc;var vDi=pE(),CDi=aMe(),enc=uct(),tnc=Rpe(),bDi=uct();Object.defineProperty(fre,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return bDi.PositionOffsetTransformerBase},"get")});Object.defineProperty(fre,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return bDi.PositionOffsetTransformer},"get")});(0,enc._setPositionOffsetTransformerDependencies)({StringEdit:vDi.StringEdit,StringReplacement:vDi.StringReplacement,TextReplacement:CDi.TextReplacement,TextEdit:CDi.TextEdit,TextLength:tnc.TextLength});function rnc(){}a(rnc,"ensureDependenciesAreSet")});var qAt=I(QAt=>{"use strict";p();Object.defineProperty(QAt,"__esModule",{value:!0});QAt.RootedLineEdit=void 0;var SDi=BH(),nnc=UAt(),inc=CD();(0,nnc.ensureDependenciesAreSet)();var fwr=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=SDi.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 inc.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 SDi.LineEdit(r))}};QAt.RootedLineEdit=fwr});var CD=I(VG=>{"use strict";p();Object.defineProperty(VG,"__esModule",{value:!0});VG.Edits=VG.SingleEdits=VG.RootedEdit=void 0;var TDi=Yu(),onc=BH(),fge=pE(),IDi=hwr(),snc=qAt(),k5e=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return onc.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,TDi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,TDi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return snc.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)}};VG.RootedEdit=k5e;var pwr=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return fge.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new jAt(fge.StringEdit,this.edits.map(e=>e.toEdit()))}};VG.SingleEdits=pwr;var jAt=class t{static{a(this,"Edits")}static single(e){return new t(fge.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=fge.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(fge.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,IDi.serializeStringEdit)(e))}static deserialize(e){return new t(fge.StringEdit,e.map(r=>(0,IDi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=k5e.toLineEdit(new k5e(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` --- -`)}};u$.Edits=Syt});var yRr=I(Bge=>{"use strict";p();Object.defineProperty(Bge,"__esModule",{value:!0});Bge.serializeStringEdit=dac;Bge.serializeSingleEdit=XNi;Bge.deserializeStringEdit=fac;Bge.decomposeStringEdit=hac;var lac=Ts(),ZNi=gE(),uac=sd(),JNi=kD();function dac(t){return t.replacements.map(e=>XNi(e))}a(dac,"serializeStringEdit");function XNi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(XNi,"serializeSingleEdit");function fac(t){return new ZNi.StringEdit(t.map(e=>pac(e)))}a(fac,"deserializeStringEdit");function pac(t){return new ZNi.StringReplacement(new uac.OffsetRange(t[0],t[1]),t[2])}a(pac,"deserializeSingleEdit");function hac(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 JNi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,lac.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(Tyt,"__esModule",{value:!0});Tyt.DebugRecorderBookmark=void 0;var ERr=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};Tyt.DebugRecorderBookmark=ERr});var nMi=I(Iyt=>{"use strict";p();Object.defineProperty(Iyt,"__esModule",{value:!0});Iyt.DebugRecorder=void 0;var mac=yRr(),gac=eMi(),Aac=B5(),yac=qDe(),tMi=El(),rMi=ko(),Eac=yK(),_ac=HF(),Cac=hA(),vac=um(),bac=CT(),_Rr=class extends rMi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=yac.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,_ac.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 CRr(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Aac.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,rMi.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,vac.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,tMi.compareBy)(n=>n.sortTime,tMi.numberComparator)),r.map(n=>n.entry)}createBookmark(){return new gac.DebugRecorderBookmark(this.getNow())}};Iyt.DebugRecorder=_Rr;var CRr=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,Cac.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Eac.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new bac.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(n++,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 r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,mac.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}}});var iMi=I(xyt=>{"use strict";p();Object.defineProperty(xyt,"__esModule",{value:!0});xyt.CapturingToken=void 0;var vRr=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}};xyt.CapturingToken=vRr});var oMi=I(bRr=>{"use strict";p();Object.defineProperty(bRr,"__esModule",{value:!0});bRr.secondsToHumanReadableTime=Sac;function Sac(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(Sac,"secondsToHumanReadableTime")});var yR=I(Hd=>{"use strict";p();var Tac=Hd&&Hd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Hd&&Hd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xac=Hd&&Hd.__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(pge,"__esModule",{value:!0});pge.serializeStringEdit=lnc;pge.serializeSingleEdit=RDi;pge.deserializeStringEdit=unc;pge.decomposeStringEdit=fnc;var anc=Cs(),wDi=pE(),cnc=sd(),xDi=CD();function lnc(t){return t.replacements.map(e=>RDi(e))}a(lnc,"serializeStringEdit");function RDi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(RDi,"serializeSingleEdit");function unc(t){return new wDi.StringEdit(t.map(e=>dnc(e)))}a(unc,"deserializeStringEdit");function dnc(t){return new wDi.StringReplacement(new cnc.OffsetRange(t[0],t[1]),t[2])}a(dnc,"deserializeSingleEdit");function fnc(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 xDi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,anc.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(HAt,"__esModule",{value:!0});HAt.DebugRecorderBookmark=void 0;var mwr=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};HAt.DebugRecorderBookmark=mwr});var NDi=I(GAt=>{"use strict";p();Object.defineProperty(GAt,"__esModule",{value:!0});GAt.DebugRecorder=void 0;var pnc=hwr(),hnc=PDi(),mnc=S5(),gnc=hDe(),kDi=Al(),DDi=wo(),Anc=XY(),ync=wF(),Enc=AA(),_nc=um(),vnc=mT(),gwr=class extends DDi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=gnc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,ync.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 Awr(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,mnc.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,DDi.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,_nc.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,kDi.compareBy)(n=>n.sortTime,kDi.numberComparator)),r.map(n=>n.entry)}createBookmark(){return new hnc.DebugRecorderBookmark(this.getNow())}};GAt.DebugRecorder=gwr;var Awr=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,Enc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Anc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new vnc.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(n++,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 r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,pnc.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}}});var MDi=I($At=>{"use strict";p();Object.defineProperty($At,"__esModule",{value:!0});$At.CapturingToken=void 0;var ywr=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}};$At.CapturingToken=ywr});var ODi=I(Ewr=>{"use strict";p();Object.defineProperty(Ewr,"__esModule",{value:!0});Ewr.secondsToHumanReadableTime=Cnc;function Cnc(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(Cnc,"secondsToHumanReadableTime")});var dR=I(qd=>{"use strict";p();var bnc=qd&&qd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Snc=qd&&qd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Tnc=qd&&qd.__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(B4,"__esModule",{value:!0});B4.PendingLoggedChatRequest=B4.IRequestLogger=B4.ChatRequestScheme=void 0;B4.resolveMarkdownContent=Oac;B4.resolveMarkdownIcon=Bac;var uMi=yR(),Nac=rn(),Mac=sd(),SRr=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 Mac.OffsetRange(n.index,n.index+o.length)}})}};B4.ChatRequestScheme=SRr;B4.IRequestLogger=(0,Nac.createServiceIdentifier)("IRequestLogger");function Oac(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(Oac,"resolveMarkdownContent");function Bac(t){return typeof t.icon=="function"?t.icon():t.icon}a(Bac,"resolveMarkdownIcon");var TRr=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})}},IRr=class extends TRr{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===uMi.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===uMi.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})}};B4.PendingLoggedChatRequest=IRr});var wRr=I(Fge=>{"use strict";p();Object.defineProperty(Fge,"__esModule",{value:!0});Fge.NullSnippyService=Fge.ISnippyService=void 0;var Lac=rn();Fge.ISnippyService=(0,Lac.createServiceIdentifier)("ISnippyService");var xRr=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};Fge.NullSnippyService=xRr});var PRr=I(Uge=>{"use strict";p();Object.defineProperty(Uge,"__esModule",{value:!0});Uge.MovedText=Uge.LinesDiff=void 0;var RRr=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};Uge.LinesDiff=RRr;var kRr=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()))}};Uge.MovedText=kRr});var kyt=I(DD=>{"use strict";p();Object.defineProperty(DD,"__esModule",{value:!0});DD.RangeMapping=DD.DetailedLineRangeMapping=DD.LineRangeMapping=void 0;DD.lineRangeMappingFromRangeMappings=Uac;DD.getLineRangeMapping=hMi;DD.lineRangeMappingFromChange=Qac;var Fac=El(),dMi=Yu(),Ryt=Ts(),i1=g2(),PD=I_(),L4=qp(),pMi=MMe(),o4e=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 i1.LineRange(s,u.original.startLineNumber),new i1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new i1.LineRange(s,r+1),new i1.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 g6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ryt.BugIndicatingError("not a valid diff");return new g6(new L4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new g6(new L4.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new L4.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(fMi(this.original.endLineNumberExclusive,e)&&fMi(this.modified.endLineNumberExclusive,r))return new g6(new L4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new g6(L4.Range.fromPositions(new PD.Position(this.original.startLineNumber,1),Qge(new PD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),L4.Range.fromPositions(new PD.Position(this.modified.startLineNumber,1),Qge(new PD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new g6(L4.Range.fromPositions(Qge(new PD.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Qge(new PD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),L4.Range.fromPositions(Qge(new PD.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Qge(new PD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Ryt.BugIndicatingError}};DD.LineRangeMapping=o4e;function Qge(t,e){if(t.lineNumber<1)return new PD.Position(1,1);if(t.lineNumber>e.length)return new PD.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new PD.Position(t.lineNumber,r.length+1):t}a(Qge,"normalizePosition");function fMi(t,e){return t>=1&&t<=e.length}a(fMi,"isValidLineNumber");var s4e=class t extends o4e{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 pMi.TextEdit(n)}static fromRangeMappings(e){let r=i1.LineRange.join(e.map(o=>i1.LineRange.fromRangeInclusive(o.originalRange))),n=i1.LineRange.join(e.map(o=>i1.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()])}};DD.DetailedLineRangeMapping=s4e;var g6=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 Ryt.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 pMi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};DD.RangeMapping=g6;function Uac(t,e,r,n=!1){let o=[];for(let s of(0,Fac.groupAdjacentBy)(t.map(c=>hMi(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 s4e(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,dMi.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,dMi.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 i1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new i1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new s4e(s,c,[t])}a(hMi,"getLineRangeMapping");function Qac(t){let e;t.originalEndLineNumber===0?e=new i1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new i1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new i1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new i1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new o4e(e,r)}a(Qac,"lineRangeMappingFromChange")});var jge=I(ER=>{"use strict";p();Object.defineProperty(ER,"__esModule",{value:!0});ER.DateTimeout=ER.InfiniteTimeout=ER.OffsetPair=ER.SequenceDiff=ER.DiffAlgorithmResult=void 0;var qac=El(),mMi=Ts(),qge=sd(),DRr=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new a4e(qge.OffsetRange.ofLength(e.length),qge.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new a4e(qge.OffsetRange.ofLength(e.length),qge.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};ER.DiffAlgorithmResult=DRr;var a4e=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,qac.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():kre.zero,s?s.getStarts():new kre(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new qge.OffsetRange(e.offset1,r.offset1),new qge.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 mMi.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 kre(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new kre(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};ER.SequenceDiff=a4e;var kre=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}};ER.OffsetPair=kre;var NRr=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};ER.InfiniteTimeout=NRr;var MRr=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new mMi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};ER.DateTimeout=MRr});var Pyt=I(Pre=>{"use strict";p();Object.defineProperty(Pre,"__esModule",{value:!0});Pre.LineRangeFragment=Pre.Array2D=void 0;Pre.isSpace=jac;var ORr=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}};Pre.Array2D=ORr;function jac(t){return t===32||t===9}a(jac,"isSpace");var BRr=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(Dyt,"__esModule",{value:!0});Dyt.DynamicProgrammingDiffing=void 0;var gMi=sd(),c4e=jge(),LRr=Pyt(),FRr=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=c4e.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return c4e.DiffAlgorithmResult.trivial(e,r);let s=new LRr.Array2D(e.length,r.length),c=new LRr.Array2D(e.length,r.length),l=new LRr.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 c4e.SequenceDiff(new gMi.OffsetRange(A+1,d),new gMi.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 c4e.DiffAlgorithmResult(u,!1)}};Dyt.DynamicProgrammingDiffing=FRr});var jRr=I(Myt=>{"use strict";p();Object.defineProperty(Myt,"__esModule",{value:!0});Myt.MyersDiffAlgorithm=void 0;var yMi=sd(),l4e=jge(),URr=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=l4e.InfiniteTimeout.instance){if(e.length===0||r.length===0)return l4e.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 Nyt(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 l4e.SequenceDiff(new yMi.OffsetRange(y,g),new yMi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new l4e.DiffAlgorithmResult(m,!1)}};Myt.MyersDiffAlgorithm=URr;var Nyt=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},QRr=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}}},qRr=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 $Rr=I(Byt=>{"use strict";p();Object.defineProperty(Byt,"__esModule",{value:!0});Byt.LinesSliceCharSequence=void 0;var HRr=ZQ(),Oyt=sd(),Hac=I_(),EMi=qp(),Gac=Pyt(),GRr=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=vMi(e>0?this.elements[e-1]:-1),n=vMi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new Hac.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)?EMi.Range.fromPositions(n,n):EMi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!Hge(this.elements[e]))return;let r=e;for(;r>0&&Hge(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!Hge(this.elements[e]))return;let r=e;for(;r>0&&Hge(this.elements[r-1])&&!_Mi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,HRr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Oyt.OffsetRange(r,n)}};Byt.LinesSliceCharSequence=GRr;function Hge(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(Hge,"isWordChar");function _Mi(t){return t>=65&&t<=90}a(_Mi,"isUpperCase");var $ac={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function CMi(t){return $ac[t]}a(CMi,"getCategoryBoundaryScore");function vMi(t){return t===10?8:t===13?7:(0,Gac.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(vMi,"getCategory")});var IMi=I(VRr=>{"use strict";p();Object.defineProperty(VRr,"__esModule",{value:!0});VRr.computeMovedLines=Yac;var Vac=jge(),Lyt=kyt(),F4=El(),u4e=ZQ(),Wac=bP(),o1=g2(),bMi=$Rr(),Fyt=Pyt(),zac=jRr(),SMi=qp();function Yac(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=Jac(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=Zac(u,n,o,e,r,s);return(0,F4.pushMany)(c,d),c=Xac(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&Kac(h,g=>g.length>=2)>=2}),c=ecc(t,c),c}a(Yac,"computeMovedLines");function Kac(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Kac,"countWhere");function Jac(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Fyt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Fyt.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 Lyt.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(Jac,"computeMovesFromSimpleDeletionsToSimpleInsertions");function Zac(t,e,r,n,o,s){let c=[],l=new Wac.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,F4.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 o1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new o1.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,F4.reverseOrder)((0,F4.compareBy)(m=>m.modifiedLineRange.length,F4.numberComparator)));let d=new o1.LineRangeSet,f=new o1.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 Lyt.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,F4.compareBy)(m=>m.original.startLineNumber,F4.numberComparator));let h=new u4e.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,u4e.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)||!TMi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new o1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new o1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!TMi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new o1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new o1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new Lyt.LineRangeMapping(new o1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new o1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(Zac,"computeUnchangedMoves");function TMi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new zac.MyersDiffAlgorithm().compute(new bMi.LinesSliceCharSequence([t],new SMi.Range(1,1,1,t.length),!1),new bMi.LinesSliceCharSequence([e],new SMi.Range(1,1,1,e.length),!1),r),s=0,c=Vac.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Fyt.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(TMi,"areLinesSimilar");function Xac(t){if(t.length===0)return t;t.sort((0,F4.compareBy)(r=>r.original.startLineNumber,F4.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(Xac,"joinCloseConsecutiveMoves");function ecc(t,e){let r=new u4e.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(Dre,"__esModule",{value:!0});Dre.optimizeSequenceDiffs=rcc;Dre.removeShortMatches=icc;Dre.extendDiffsToEntireWordIfAppropriate=occ;Dre.removeVeryShortMatchingLinesBetweenDiffs=acc;Dre.removeVeryShortMatchingTextBetweenLongDiffs=ccc;var tcc=El(),U4=sd(),Q4=jge();function rcc(t,e,r){let n=r;return n=xMi(t,e,n),n=xMi(t,e,n),n=ncc(t,e,n),n}a(rcc,"optimizeSequenceDiffs");function xMi(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(xMi,"joinSequenceDiffsByShifting");function ncc(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(wMi,"shiftDiffToBetterPosition");function icc(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 Q4.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(icc,"removeShortMatches");function occ(t,e,r,n,o=!1){let s=Q4.SequenceDiff.invert(r,t.length),c=[],l=new Q4.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 Q4.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 scc(r,c)}a(occ,"extendDiffsToEntireWordIfAppropriate");function scc(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(scc,"mergeSequenceDiffs");function acc(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(acc,"removeVeryShortMatchingLinesBetweenDiffs");function ccc(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,k=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(k*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,tcc.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 U4.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new U4.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=Q4.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():Q4.OffsetPair.zero,d?d.getStarts():Q4.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(ccc,"removeVeryShortMatchingTextBetweenLongDiffs")});var PMi=I(Uyt=>{"use strict";p();Object.defineProperty(Uyt,"__esModule",{value:!0});Uyt.LineSequence=void 0;var WRr=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:kMi(this.lines[e-1]),n=e===this.lines.length?0:kMi(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]}};Uyt.LineSequence=WRr;function kMi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.DefaultLinesDiffComputer=void 0;var lcc=El(),DMi=Yu(),jyt=g2(),NMi=sd(),MMi=qp(),Qyt=CT(),qyt=PRr(),Mre=kyt(),q4=jge(),ucc=AMi(),dcc=jRr(),fcc=IMi(),Nre=RMi(),OMi=PMi(),BMi=$Rr(),zRr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new ucc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new dcc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,lcc.equals)(e,r,(x,k)=>x===k))return new qyt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new qyt.LinesDiff([new Mre.DetailedLineRangeMapping(new jyt.LineRange(1,e.length+1),new jyt.LineRange(1,r.length+1),[new Mre.RangeMapping(new MMi.Range(1,1,e.length,e[e.length-1].length+1),new MMi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?q4.InfiniteTimeout.instance:new q4.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let k=c.get(x);return k===void 0&&(k=c.size,c.set(x,k)),k}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new OMi.LineSequence(u,e),h=new OMi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,k)=>e[x]===r[k]?r[k].length===0?.1:1+Math.log(1+r[k].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,Nre.optimizeSequenceDiffs)(f,h,g),g=(0,Nre.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],E=a(x=>{if(s)for(let k=0;kx.seq1Range.start-_===x.seq2Range.start-v);let k=x.seq1Range.start-_;E(k),_=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 Qyt.ArrayText(e),T=new Qyt.ArrayText(r),w=(0,Mre.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,DMi.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 k(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(k,"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(!k(D.modified,r)||!k(D.original,e))return!1}return!0}),new qyt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,fcc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new q4.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,Mre.lineRangeMappingFromRangeMappings)(m.mappings,new Qyt.ArrayText(r),new Qyt.ArrayText(n),!0);return new qyt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=pcc(n).toRangeMapping2(e,r),d=new BMi.LinesSliceCharSequence(e,u.originalRange,s),f=new BMi.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&&q4.SequenceDiff.assertSorted(g),g=(0,Nre.optimizeSequenceDiffs)(d,f,g),m&&q4.SequenceDiff.assertSorted(g),g=(0,Nre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&q4.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Nre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&q4.SequenceDiff.assertSorted(g)),g=(0,Nre.removeShortMatches)(d,f,g),m&&q4.SequenceDiff.assertSorted(g),g=(0,Nre.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&q4.SequenceDiff.assertSorted(g);let A=g.map(y=>new Mre.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&Mre.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};Hyt.DefaultLinesDiffComputer=zRr;function pcc(t){return new Mre.LineRangeMapping(new jyt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new jyt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(pcc,"toLineRangeMapping")});var KRr=I(vC=>{"use strict";p();Object.defineProperty(vC,"__esModule",{value:!0});vC.EditDataWithIndex=vC.maxImperfectAgreementLength=vC.maxAgreementOffset=void 0;vC.tryRebase=ycc;vC.checkEditConsistency=FMi;vC.tryRebaseStringEdits=_cc;var hcc=kD(),mcc=L_(),NE=gE(),Gge=sd(),LMi=CT(),gcc=YRr(),Acc=!1;vC.maxAgreementOffset=10;vC.maxImperfectAgreementLength=5;var Gyt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};vC.EditDataWithIndex=Gyt;function ycc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:vC.maxImperfectAgreementLength}){let f=Date.now();try{return Ecc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${mcc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(ycc,"tryRebase");function Ecc(t,e,r,n,o,s,c,l,u,d){if(!FMi(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.lengthNE.AnnotatedStringEdit.create(E))),g=UMi(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=NE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new hcc.SingleEdits(r).apply(t)!==NE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Ecc,"_tryRebase");function FMi(t,e,r,n,o=Acc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(FMi,"checkEditConsistency");function _cc(t,e,r,n,o={maxImperfectAgreementLength:vC.maxImperfectAgreementLength}){return UMi(t,e.mapData(s=>new NE.VoidEditData),r,n,o)?.toStringEdit()}a(_cc,"tryRebaseStringEdits");function UMi(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 NE.AnnotatedStringReplacement(Gge.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=Scc(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 NE.AnnotatedStringReplacement(new Gge.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(;uvC.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 NE.AnnotatedStringReplacement(Gge.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 bcc(t){return vcc.has(t)}a(bcc,"isAutoClosePair");function Scc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uvC.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&bcc(l)&&Ccc(l,e.newText.substring(o))?o:-1}a(Scc,"agreementIndexOf");function Tcc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new gcc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new LMi.StringText(t),f=new LMi.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 NE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Tcc,"computeDiff")});var qMi=I($yt=>{"use strict";p();Object.defineProperty($yt,"__esModule",{value:!0});$yt.RejectionCollector=void 0;var Icc=B5(),QMi=ko(),xcc=y2(),JRr=class extends QMi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new ekr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,xcc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new ZRr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Icc.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,QMi.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()}};$yt.RejectionCollector=JRr;var ZRr=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 XRr(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}},XRr=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()}},ekr=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 rkr=I($ge=>{"use strict";p();Object.defineProperty($ge,"__esModule",{value:!0});$ge.DisposablesLRUCache=$ge.LRUCache=void 0;var d4e=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},Vyt=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 d4e("",null),this._tail=new d4e("",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 d4e(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}};$ge.LRUCache=Vyt;var tkr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new Vyt(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()}};$ge.DisposablesLRUCache=tkr});var jMi=I(zyt=>{"use strict";p();Object.defineProperty(zyt,"__esModule",{value:!0});zyt.RebaseFailureInfo=void 0;var wcc=gE(),nkr=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 wcc.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 = ${Wyt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Wyt(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}), ${Wyt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${Wyt(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(` -`)}};zyt.RebaseFailureInfo=nkr;function Wyt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(Wyt,"toBacktickLiteral")});var GMi=I(Kyt=>{"use strict";p();Object.defineProperty(Kyt,"__esModule",{value:!0});Kyt.NextEditCache=void 0;var f4e=Il(),Rcc=B5(),kcc=rkr(),HMi=ko(),Pcc=HF(),Yyt=KRr(),Dcc=jMi(),ikr=class extends HMi.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 kcc.LRUCache(50),(0,Pcc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new okr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,Rcc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(f4e.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,HMi.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(f4e.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(f4e.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(f4e.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(f4e.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()}};Kyt.NextEditCache=ikr;var okr=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,Yyt.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,Yyt.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,Yyt.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 Dcc.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,Yyt.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 $Mi=I(Jyt=>{"use strict";p();Object.defineProperty(Jyt,"__esModule",{value:!0});Jyt.NextEditResult=void 0;var skr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};Jyt.NextEditResult=skr});var VMi=I(Zyt=>{"use strict";p();Object.defineProperty(Zyt,"__esModule",{value:!0});Zyt.SpeculativeRequestManager=void 0;var Ncc=ko(),akr=class extends Ncc.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 Mcc=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},p4e=jT&&jT.__param||function(t,e){return function(r,n){e(r,n,t)}},ckr;Object.defineProperty(jT,"__esModule",{value:!0});jT.NextEditFetchRequest=jT.NextEditProvider=jT.NesOutcome=void 0;var Occ=require("path"),bC=Il(),Vge=kD(),g4e=byt(),h4e=WA(),Bcc=Kut(),Tf=Pge(),Lcc=B5(),lkr=pp(),Fcc=iMi(),Ucc=Lge(),Qcc=wRr(),qcc=gp(),m4e=L_(),Lg=Gx(),WMi=Yu(),Xyt=Xc(),jcc=DKe(),fkr=Ts(),eEt=ko(),zMi=y2(),YMi=cO(),Hcc=BS(),eOi=um(),KMi=eG(),Ore=gE(),Gcc=I_(),ukr=sd(),JMi=CT(),$cc=KRr(),Vcc=qMi(),Wcc=GMi(),tEt=$Mi(),zcc=VMi();function Ycc(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 ukr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(Ycc,"computeReducedWindow");function ZMi(t,e){let n=new g4e.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r -`)?new Ore.StringEdit(n.replacements.map(o=>new Ore.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r -`)))):n}a(ZMi,"convertLineEditToEdit");function XMi(t,e){return new jcc.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:Ore.StringEdit.empty,nextEdits:[],docId:n}}}throw new fkr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Ore.StringEdit.empty,nextEdits:[],docId:n}})}a(XMi,"createDocStateLookupMap");var A4e;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(A4e||(jT.NesOutcome=A4e={}));var dkr=ckr=class extends eEt.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 Vcc.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 Wcc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new zcc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,zMi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,zMi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,eEt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(bC.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 YMi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(lkr.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(m4e.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 fkr.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 tEt.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(bC.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new y4e(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 F=Q.val.rebasedEdit||Q.val.edit;F?(d.trace("fetch succeeded"),c.setResponseResults([F]),y={actualEdit:F,isFromCursorJump:Q.val.isFromCursorJump},R=Q.val.isFromSpeculativeRequest??!1,x=Q.val.baseCacheEntry??Q.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof Tf.NoNextEditReason.FetchFailure||_ instanceof Tf.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof Tf.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new tEt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof Tf.NoNextEditReason.GotCancelled&&c.setIsSkipped();let k=new tEt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),k;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k;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(),k;c.setResult(g4e.RootedLineEdit.fromEdit(new Vge.RootedEdit(h,new Ore.StringEdit([y.actualEdit])))),(0,WMi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new tEt.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,Xyt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k):(d.trace("returning next edit result"),D)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService),isEagerBackupRequest:this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsEagerBackupRequest,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=g4e.RootedLineEdit.fromEdit(new Vge.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new Tf.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 Lg.Result.error(new Tf.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 if(n.isEagerBackupRequest){d.trace("starting eager backup request in parallel with rebase attempt"),this._pendingStatelessNextEditRequest=null;let B=this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),Q=a(()=>{B.then(F=>F.nextEditRequest.cancellationTokenSource.cancel()).catch(()=>{})},"cancelBackupRequest"),M=await this._joinNextEditRequest(R,L,c,g,l),O=await R.firstEdit.p;if(O.isOk()&&O.val.edit){let F=this._nextEditCache.tryRebaseCacheEntry(O.val,h,m);if(F.edit)return d.trace("rebase succeeded, cancelling eager backup request"),Q(),c.setStatelessNextEditTelemetry(M.telemetry),Lg.Result.ok(F.edit);this._logRebaseFailure(F.failureInfo,g)}if(l.isCancellationRequested)return d.trace("cancelled after rebase failed (eager backup path)"),Q(),c.setStatelessNextEditTelemetry(M.telemetry),Lg.Result.error(new Tf.NoNextEditReason.GotCancelled("afterFailedRebase"));d.trace("rebase failed, using eager backup request");let q=await B;return c.setStatelessNextEditTelemetry(q.nextEditResult.telemetry),q.nextEditResult.nextEdit.isError()?q.nextEditResult.nextEdit:q.nextEditRequest.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 q=this._nextEditCache.tryRebaseCacheEntry(Q.val,h,m);if(q.edit)return c.setStatelessNextEditTelemetry(B.telemetry),Lg.Result.ok(q.edit);this._logRebaseFailure(q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),Lg.Result.error(new Tf.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 q=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(q.telemetry),q.nextEdit.isError()?q.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),k=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:k.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=this._debugRecorder?.getRecentLog(),m=e.log,g=Kcc(n.getDocumentAndIdx(d)),A=r.selection.get()[0],y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new Xyt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new Tf.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.nextEditDoc),g.idx,E,_,v,!1,m,e.log.recordingBookmark,h,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"),m.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,Lcc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(Q=>{b.intermediateUserEdit&&!Q.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(Q),(0,$cc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=XMi(y,E),k=this._statelessNextEditProvider.provideNextEdit(b,f,m,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),q=B.edit,F=new KMi.LineEdit([q]),W=ZMi(F,O.baseDocState).tryRebase(O.editsSoFar);if(W===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(Lg.Result.error(new Tf.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(W);let V;if(W.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(W.replacements.length>1)M.trace(`WARNING: ${D} has ${W.replacements.length} edits, but expected only 1`);else{let G=W.replacements[0];O.nextEdits.push(G),V=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,G,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?A?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),m.setResult(new g4e.RootedLineEdit(O.docContents,F)),_.complete(V?Lg.Result.ok(V):Lg.Result.error(new Tf.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=W.applyOnText(O.docContents),V},"processEdit"),L=a((B,Q)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof Tf.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 Tf.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:W,window:V}=B,G=V?Ycc(V,A,W):void 0;this._nextEditCache.setNoNextEdit(d,W,G,e)}_.isSettled||_.complete(Lg.Result.error(B));let q=x.get(d).nextEdits.length>0?Lg.Result.ok(void 0):Lg.Result.error(B),F=new Tf.StatelessNextEditResult(q,Q);b.setResult(F),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),F},"handleStreamEnd");try{let B=await k.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 k.next();!B.done;){let q=B.value.v;N(q,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await k.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${m4e.ErrorUtils.toString(O)}`);let q=new Tf.NoNextEditReason.Unexpected(m4e.ErrorUtils.fromUnknown(O));L(q,M)}})(),T=new Tf.StatelessNextEditResult(Lg.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new eEt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Xyt.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,eEt.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(bC.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(bC.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(bC.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===h4e.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 Bcc.InlineEditRequestLogContext(n.uri,0,void 0),s=new YMi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(lkr.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 ukr.OffsetRange(d,d),h=[f],m=new Vge.RootedEdit(r.documentBeforeEdits,new Ore.StringEdit([r.edit])),g=new JMi.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(bC.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===h4e.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=ckr.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 y4e(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,eOi.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),k=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:k})}}catch(T){c.trace(`speculative request failed: ${m4e.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 JMi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new Ore.StringEdit([l]),Q=g4e.RootedLineEdit.fromEdit(new Vge.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new Tf.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),Q,r.value.get(),Vge.Edits.single(B),n);return{recentEdit:new Vge.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 Xyt.DeferredPromise,w=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case h4e.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case h4e.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case h4e.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,WMi.assertNever)(w)}let x=new Tf.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 k=`NES | spec | ${(0,Occ.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Fcc.CapturingToken(k,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,k);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=XMi(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(Lg.Result.error(g.value.v)),e.setResult(new Tf.StatelessNextEditResult(Lg.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 KMi.LineEdit([E]),b=ZMi(_,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(Lg.Result.ok(w)),e.setResult(new Tf.StatelessNextEditResult(Lg.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(Lg.Result.error(new Tf.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new Tf.StatelessNextEditResult(Lg.Result.error(new Tf.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: ${m4e.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=A4e.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=A4e.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")}};jT.NextEditProvider=dkr;jT.NextEditProvider=dkr=ckr=Mcc([p4e(5,bC.IConfigurationService),p4e(6,Qcc.ISnippyService),p4e(7,lkr.ILogService),p4e(8,qcc.IExperimentationService),p4e(9,Ucc.IRequestLogger)],dkr);function Kcc(t){if(!t)throw new fkr.BugIndicatingError("expected value to be defined, but it was not");return t}a(Kcc,"assertDefined");var y4e=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,eOi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};jT.NextEditFetchRequest=y4e});var uOi=I(ah=>{"use strict";p();Object.defineProperty(ah,"__esModule",{value:!0});ah.GLOB_SPLIT=ah.GLOBSTAR=void 0;ah.getEmptyExpression=tlc;ah.splitGlobAware=mkr;ah.isEmptyPattern=llc;ah.match=hlc;ah.parse=aOi;ah.isRelativePattern=cOi;ah.getBasenameTerms=mlc;ah.getPathTerms=glc;ah.patternsEquals=Elc;var Jcc=El(),hkr=Xc(),Zcc=JQt(),Xcc=bP(),d$=hA(),elc=eq(),E4e=Gh();function tlc(){return Object.create(null)}a(tlc,"getEmptyExpression");ah.GLOBSTAR="**";ah.GLOB_SPLIT="/";var rEt="[/\\\\]",nEt="[^/\\\\]",rlc=/\//g;function rOi(t,e){switch(t){case 0:return"";case 1:return`${nEt}*?`;default:return`(?:${rEt}|${nEt}+${rEt}${e?`|${rEt}${nEt}+`:""})*?`}}a(rOi,"starsToRegExp");function mkr(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(mkr,"splitGlobAware");function sOi(t){if(!t)return"";let e="",r=mkr(t,ah.GLOB_SPLIT);if(r.every(n=>n===ah.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===ah.GLOBSTAR){if(n)return;e+=rOi(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===ah.GLOB_SPLIT?h="":h=(0,E4e.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${mkr(l,",").map(g=>sOi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=nEt;continue;case"*":e+=rOi(1);continue;default:e+=(0,E4e.escapeRegExpCharacters)(f)}}su===d,endsWith:n?E4e.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,Zcc.isEqualOrParent)(u,d,e.ignoreCase??!elc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=nOi.get(s);if(c)return iOi(c,t,o);let l;return nlc.test(r)?c=ulc(r.substring(4),r,o):(l=ilc.exec(pkr(r,o)))?c=dlc(l[1],r,o):(e.trimForExclusions?slc:olc).test(r)?c=flc(r,o):(l=alc.exec(pkr(r,o)))?c=oOi(l[1].substring(1),r,!0,o):(l=clc.exec(pkr(r,o)))?c=oOi(l[1],r,!1,o):c=plc(r,o),nOi.set(s,c),iOi(c,t,o)}a(Akr,"parsePattern");function iOi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,E4e.ltrim)(o.substring(e.base.length),d$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(iOi,"wrapRelativePattern");function pkr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(pkr,"trimForExclusions");function ulc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(ulc,"trivia1");function dlc(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(dlc,"trivia2");function flc(t,e){let r=lOi(t.slice(1,-1).split(",").map(l=>Akr(l,e)).filter(l=>l!==ND),t),n=r.length;if(!n)return ND;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(flc,"trivia3");function oOi(t,e,r,n){let o=d$.sep===d$.posix.sep,s=o?t:t.replace(rlc,d$.sep),c=d$.sep+s,l=d$.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(oOi,"trivia4and5");function plc(t,e){try{let r=new RegExp(`^${sOi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return ND}}a(plc,"toRegExp");function hlc(t,e,r){return!t||typeof e!="string"?!1:aOi(t,r)(e)}a(hlc,"match");function aOi(t,e={}){if(!t)return gkr;if(typeof t=="string"||cOi(t)){let r=Akr(t,e);if(r===ND)return gkr;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 Alc(t,e)}a(aOi,"parse");function cOi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(cOi,"isRelativePattern");function mlc(t){return t.allBasenames||[]}a(mlc,"getBasenameTerms");function glc(t){return t.allPaths||[]}a(glc,"getPathTerms");function Alc(t,e){let r=lOi(Object.getOwnPropertyNames(t).map(l=>ylc(l,t[l],e)).filter(l=>l!==ND)),n=r.length;if(!n)return ND;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(Alc,"parsedExpression");function ylc(t,e,r){if(e===!1)return ND;let n=Akr(t,r);if(n===ND)return ND;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,hkr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(ylc,"parseExpressionPattern");function lOi(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(lOi,"aggregateBasenameMatches");function Elc(t,e){return(0,Jcc.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(Elc,"patternsEquals")});var oEt=I(kl=>{"use strict";p();var _lc=kl&&kl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=kl&&kl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vlc=kl&&kl.__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,dOi.isEqual)(r.uri,t)||r.uri.path===t.path||Ekr(t,r))}a(ykr,"findNotebook");function Ekr(t,e){if(t.scheme===_4e.Schemas.vscodeNotebookCell||t.scheme===_4e.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,dOi.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(Ekr,"findCell");function blc(t,e){if(t.scheme!==_4e.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=fOi(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(blc,"getNotebookCellOutput");function fOi(t,e){let r=ykr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=Ekr(t,r);return n===void 0?[r,void 0]:[r,n]}a(fOi,"getNotebookAndCellFromUri");function Slc(t){return t.scheme===_4e.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Slc,"isNotebookCellOrNotebookChatInput");function Tlc(t){return t.scheme===_4e.Schemas.vscodeNotebookCell}a(Tlc,"isNotebookCell");function Ilc(t){return t.path.endsWith(".ipynb")}a(Ilc,"isJupyterNotebookUri");function xlc(t){return t.notebookType==="jupyter-notebook"}a(xlc,"isJupyterNotebook");function wlc(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(wlc,"serializeNotebookDocument");function Rlc(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(Rlc,"extractNotebookOutline");function pOi(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||mOi(e.include))}a(pOi,"isDocumentExcludePattern");function hOi(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(hOi,"isFilenamePattern");function mOi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(mOi,"isRelativePattern");function klc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(klc,"isNotebookEditorContribution");function Plc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Plc,"extractEditorAssociation");function gOi(t,e){if(typeof e=="string"&&Wge.match(e.toLowerCase(),(0,zge.basename)(t.fsPath).toLowerCase()))return!0;if(pOi(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Wge.match(r,(0,zge.basename)(t.fsPath).toLowerCase()))return!(n&&Wge.match(n,(0,zge.basename)(t.fsPath).toLowerCase()))}return hOi(e)&&Wge.match(e.filenamePattern,(0,zge.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Wge.match(e.excludeFileNamePattern,(0,zge.basename)(t.fsPath).toLowerCase())):!1}a(gOi,"notebookSelectorMatches");function AOi(t,e){let r=[];for(let n of e)n.filenamePattern&&Wge.match(n.filenamePattern.toLowerCase(),(0,zge.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(AOi,"getNotebookEditorAssociations");function Dlc(t,e,r,n){if(ykr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>gOi(t,l)));if(o.length===0)return!1;let s=AOi(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??iEt.default)===iEt.default)}a(Dlc,"_hasSupportedNotebooks")});var vOi=I(SC=>{"use strict";p();var Nlc=SC&&SC.__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},Mlc=SC&&SC.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(SC,"__esModule",{value:!0});SC.TelemetrySender=SC.NextEditProviderTelemetryBuilder=SC.DiagnosticsTelemetryBuilder=SC.LlmNESTelemetryBuilder=void 0;var yOi=yR(),Olc=B5(),COi=o0(),Blc=oEt(),Llc=Xc(),sEt=ko(),Flc=yK(),EOi=HF(),_Oi=mm(),aEt=class extends sEt.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===Flc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,Blc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(_Oi.Uri.parse(g.id.uri));if(y){let v=y.state.HEAD?.upstream?.remote,b=y.state.remotes.find(T=>T.name===v);b?.fetchUrl&&(d=b.pushUrl||b.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(_Oi.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?.state.HEAD?.upstream?.remote,T=v?.state.remotes.find(w=>w.name===b);T?.fetchUrl&&E.add(T.fetchUrl),T?.pushUrl&&E.add(T.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}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,Olc.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}};SC.LlmNESTelemetryBuilder=aEt;var cEt=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}};SC.DiagnosticsTelemetryBuilder=cEt;var _kr=class t extends sEt.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 aEt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new cEt}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}};SC.NextEditProviderTelemetryBuilder=_kr;var Ckr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new sEt.DisposableStore,this._disposalTracker=new sEt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new Llc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,EOi.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,EOi.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()}},vkr=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 Ckr(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:k,isNextEditorVisible:D,acceptance:N,disposalReason:L,logProbThreshold:B,documentsCount:Q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:F,hadLowLogProbSuggestion:U,nEditsSuggested:W,lineDistanceToMostRecentEdit:V,isCursorAtEndOfLine:G,isInlineSuggestion:Y,debounceTime:re,artificialDelay:j,hasNextEdit:X,notebookCellMarkerCount:ie,notebookCellMarkerIndex:we,notebookId:Ae,notebookCellLines:De,nextEditLogprob:Te,supersededByOpportunityId:Z,noNextEditReasonKind:J,noNextEditReasonMessage:z,fetchStartedAfterMs:le,response:K,configIsDiagnosticsNESEnabled:ae,isNaturalLanguageDominated:Me,diagnosticType:ne,diagnosticDroppedReasons:se,diagnosticHasExistingSameFileImport:Ie,diagnosticIsLocalImport:_e,diagnosticAlternativeImportsCount:Re,diagnosticDistanceToUnknownDiagnostic:Je,diagnosticDistanceToAlternativeDiagnostic:Xe,diagnosticHasAlternativeDiagnosticForSameRange:Ct,hadDiagnosticsNES:Ot,hadLlmNES:$t,pickedNES:Gt,xtabAggressivenessLevel:Ee,xtabUserHappinessScore:Qe,userAggressivenessSetting:nt,modelConfig:mt}=e,xe,He,Ze,at;if(K!==void 0){let{response:ct,ttft:ut,fetchResult:ee,fetchTime:pe}=await K;ct.type===yOi.ChatFetchResponseType.Success&&(xe=ct.usage),He=ut,Ze=ee,at=pe}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:Z,noNextEditReasonKind:J,noNextEditReasonMessage:z,fetchResult:Ze,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:se,pickedNES:Gt,notebookType:b,notebookId:Ae,notebookCellLines:De,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ee,userAggressivenessSetting:nt,modelConfig:mt,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(k),isNextEditorVisible:this._boolToNum(D),hasNotebookCellMarker:ie>0?1:0,notebookCellMarkerCount:ie,notebookCellMarkerIndex:we,logProbThreshold:B,documentsCount:Q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:F,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:W,lineDistanceToMostRecentEdit:V,isCursorAtEndOfLine:this._boolToNum(G),isInlineSuggestion:this._boolToNum(Y),debounceTime:re,artificialDelay:j,fetchStartedAfterMs:le,ttft:He,fetchTime:at,promptTokens:xe?.prompt_tokens,responseTokens:xe?.completion_tokens,cachedTokens:xe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:xe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:xe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(X),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:Te,hadDiagnosticsNES:this._boolToNum(Ot),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ae),isNaturalLanguageDominated:this._boolToNum(Me),diagnosticHasExistingSameFileImport:this._boolToNum(Ie),diagnosticIsLocalImport:this._boolToNum(_e),diagnosticAlternativeImportsCount:Re,diagnosticDistanceToUnknownDiagnostic:Je,diagnosticDistanceToAlternativeDiagnostic:Xe,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(Ct),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:Qe,nDiffsInPrompt:e.nDiffsInPrompt,diffTokensInPrompt:e.diffTokensInPrompt,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent("copilot-nes/provideInlineEdit",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,k=await T?.catch(()=>{});this._telemetryService.sendEnhancedGHTelemetryEvent("copilot-nes/provideInlineEdit",(0,COi.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==yOi.ChatFetchResponseType.Success?void 0:x.response.value,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:k,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)}};SC.TelemetrySender=vkr;SC.TelemetrySender=vkr=Nlc([Mlc(1,COi.ITelemetryService)],vkr)});var Skr=I(Yge=>{"use strict";p();Object.defineProperty(Yge,"__esModule",{value:!0});Yge.NullPowerService=Yge.IPowerService=void 0;var bOi=Sc(),Ulc=Qs();Yge.IPowerService=(0,Ulc.createDecorator)("IPowerService");var bkr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=bOi.Event.None,this.onDidResume=bOi.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};Yge.NullPowerService=bkr});var A6=I(f$=>{"use strict";p();Object.defineProperty(f$,"__esModule",{value:!0});f$.FetchStreamRecorder=f$.FetchStreamSource=f$.IChatMLFetcher=void 0;var Qlc=rn(),qlc=Xc();f$.IChatMLFetcher=(0,Qlc.createServiceIdentifier)("IChatMLFetcher");var Tkr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new qlc.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)}};f$.FetchStreamSource=Tkr;var Ikr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}constructor(e){this.deltas=[],this.callback=async(r,n,o)=>{this._firstTokenEmittedTime===void 0&&(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)&&(this._firstTokenEmittedTime=Date.now());let s=e?await e(r,n,o):void 0;return this.deltas.push(o),s}}};f$.FetchStreamRecorder=Ikr});var xkr=I(lEt=>{"use strict";p();Object.defineProperty(lEt,"__esModule",{value:!0});lEt.IChatQuotaService=void 0;var jlc=rn();lEt.IChatQuotaService=(0,jlc.createServiceIdentifier)("IChatQuotaService")});var wkr=I(uEt=>{"use strict";p();Object.defineProperty(uEt,"__esModule",{value:!0});uEt.IConversationOptions=void 0;var Hlc=rn();uEt.IConversationOptions=(0,Hlc.createServiceIdentifier)("ConversationOptions")});var C4e=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.getTextPart=$lc;Kge.toTextPart=SOi;Kge.toTextParts=Vlc;Kge.roleToString=Wlc;var Bre=wo(),Glc=Yu();function $lc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Bre.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Bre.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a($lc,"getTextPart");function SOi(t){return{type:Bre.Raw.ChatCompletionContentPartKind.Text,text:t}}a(SOi,"toTextPart");function Vlc(t){return[SOi(t)]}a(Vlc,"toTextParts");function Wlc(t){switch(t){case Bre.Raw.ChatRole.System:return"system";case Bre.Raw.ChatRole.User:return"user";case Bre.Raw.ChatRole.Assistant:return"assistant";case Bre.Raw.ChatRole.Tool:return"tool";default:(0,Glc.assertNever)(t,`unknown role (${t})`)}}a(Wlc,"roleToString")});var kkr=I(Jge=>{"use strict";p();Object.defineProperty(Jge,"__esModule",{value:!0});Jge.InteractionService=Jge.IInteractionService=void 0;var zlc=rn(),TOi=um();Jge.IInteractionService=(0,zlc.createServiceIdentifier)("IInteractionService");var Rkr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,TOi.generateUuid)()}startInteraction(){this._interactionId=(0,TOi.generateUuid)()}get interactionId(){return this._interactionId}};Jge.InteractionService=Rkr});var Dkr=I(dEt=>{"use strict";p();Object.defineProperty(dEt,"__esModule",{value:!0});dEt.SSEParser=void 0;var Pkr=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(S4,"__esModule",{value:!0});S4.PendingLoggedChatRequest=S4.IRequestLogger=S4.ChatRequestScheme=void 0;S4.resolveMarkdownContent=Nnc;S4.resolveMarkdownIcon=Mnc;var QDi=dR(),knc=rn(),Dnc=sd(),_wr=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 Dnc.OffsetRange(n.index,n.index+o.length)}})}};S4.ChatRequestScheme=_wr;S4.IRequestLogger=(0,knc.createServiceIdentifier)("IRequestLogger");function Nnc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(Nnc,"resolveMarkdownContent");function Mnc(t){return typeof t.icon=="function"?t.icon():t.icon}a(Mnc,"resolveMarkdownIcon");var vwr=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})}},Cwr=class extends vwr{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===QDi.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===QDi.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})}};S4.PendingLoggedChatRequest=Cwr});var Swr=I(mge=>{"use strict";p();Object.defineProperty(mge,"__esModule",{value:!0});mge.NullSnippyService=mge.ISnippyService=void 0;var Onc=rn();mge.ISnippyService=(0,Onc.createServiceIdentifier)("ISnippyService");var bwr=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};mge.NullSnippyService=bwr});var xwr=I(gge=>{"use strict";p();Object.defineProperty(gge,"__esModule",{value:!0});gge.MovedText=gge.LinesDiff=void 0;var Twr=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};gge.LinesDiff=Twr;var Iwr=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()))}};gge.MovedText=Iwr});var zAt=I(SD=>{"use strict";p();Object.defineProperty(SD,"__esModule",{value:!0});SD.RangeMapping=SD.DetailedLineRangeMapping=SD.LineRangeMapping=void 0;SD.lineRangeMappingFromRangeMappings=Lnc;SD.getLineRangeMapping=GDi;SD.lineRangeMappingFromChange=Fnc;var Bnc=Al(),qDi=Yu(),WAt=Cs(),Kb=c2(),bD=b_(),T4=jp(),HDi=aMe(),D5e=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 Kb.LineRange(s,u.original.startLineNumber),new Kb.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Kb.LineRange(s,r+1),new Kb.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 t6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new WAt.BugIndicatingError("not a valid diff");return new t6(new T4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new T4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new t6(new T4.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new T4.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(jDi(this.original.endLineNumberExclusive,e)&&jDi(this.modified.endLineNumberExclusive,r))return new t6(new T4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new T4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new t6(T4.Range.fromPositions(new bD.Position(this.original.startLineNumber,1),Age(new bD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),T4.Range.fromPositions(new bD.Position(this.modified.startLineNumber,1),Age(new bD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new t6(T4.Range.fromPositions(Age(new bD.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Age(new bD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),T4.Range.fromPositions(Age(new bD.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Age(new bD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new WAt.BugIndicatingError}};SD.LineRangeMapping=D5e;function Age(t,e){if(t.lineNumber<1)return new bD.Position(1,1);if(t.lineNumber>e.length)return new bD.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new bD.Position(t.lineNumber,r.length+1):t}a(Age,"normalizePosition");function jDi(t,e){return t>=1&&t<=e.length}a(jDi,"isValidLineNumber");var N5e=class t extends D5e{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 HDi.TextEdit(n)}static fromRangeMappings(e){let r=Kb.LineRange.join(e.map(o=>Kb.LineRange.fromRangeInclusive(o.originalRange))),n=Kb.LineRange.join(e.map(o=>Kb.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()])}};SD.DetailedLineRangeMapping=N5e;var t6=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 WAt.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 HDi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};SD.RangeMapping=t6;function Lnc(t,e,r,n=!1){let o=[];for(let s of(0,Bnc.groupAdjacentBy)(t.map(c=>GDi(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 N5e(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,qDi.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,qDi.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 Kb.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new Kb.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new N5e(s,c,[t])}a(GDi,"getLineRangeMapping");function Fnc(t){let e;t.originalEndLineNumber===0?e=new Kb.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new Kb.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new Kb.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new Kb.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new D5e(e,r)}a(Fnc,"lineRangeMappingFromChange")});var Ege=I(fR=>{"use strict";p();Object.defineProperty(fR,"__esModule",{value:!0});fR.DateTimeout=fR.InfiniteTimeout=fR.OffsetPair=fR.SequenceDiff=fR.DiffAlgorithmResult=void 0;var Unc=Al(),$Di=Cs(),yge=sd(),wwr=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new M5e(yge.OffsetRange.ofLength(e.length),yge.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new M5e(yge.OffsetRange.ofLength(e.length),yge.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};fR.DiffAlgorithmResult=wwr;var M5e=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,Unc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():pre.zero,s?s.getStarts():new pre(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new yge.OffsetRange(e.offset1,r.offset1),new yge.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 $Di.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 pre(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new pre(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};fR.SequenceDiff=M5e;var pre=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}};fR.OffsetPair=pre;var Rwr=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};fR.InfiniteTimeout=Rwr;var Pwr=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new $Di.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};fR.DateTimeout=Pwr});var YAt=I(hre=>{"use strict";p();Object.defineProperty(hre,"__esModule",{value:!0});hre.LineRangeFragment=hre.Array2D=void 0;hre.isSpace=Qnc;var kwr=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}};hre.Array2D=kwr;function Qnc(t){return t===32||t===9}a(Qnc,"isSpace");var Dwr=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(KAt,"__esModule",{value:!0});KAt.DynamicProgrammingDiffing=void 0;var VDi=sd(),O5e=Ege(),Nwr=YAt(),Mwr=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=O5e.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return O5e.DiffAlgorithmResult.trivial(e,r);let s=new Nwr.Array2D(e.length,r.length),c=new Nwr.Array2D(e.length,r.length),l=new Nwr.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 O5e.SequenceDiff(new VDi.OffsetRange(A+1,d),new VDi.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 O5e.DiffAlgorithmResult(u,!1)}};KAt.DynamicProgrammingDiffing=Mwr});var Fwr=I(ZAt=>{"use strict";p();Object.defineProperty(ZAt,"__esModule",{value:!0});ZAt.MyersDiffAlgorithm=void 0;var zDi=sd(),B5e=Ege(),Owr=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=B5e.InfiniteTimeout.instance){if(e.length===0||r.length===0)return B5e.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 JAt(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 B5e.SequenceDiff(new zDi.OffsetRange(y,g),new zDi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new B5e.DiffAlgorithmResult(m,!1)}};ZAt.MyersDiffAlgorithm=Owr;var JAt=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},Bwr=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}}},Lwr=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 qwr=I(eyt=>{"use strict";p();Object.defineProperty(eyt,"__esModule",{value:!0});eyt.LinesSliceCharSequence=void 0;var Uwr=MQ(),XAt=sd(),qnc=b_(),YDi=jp(),jnc=YAt(),Qwr=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=ZDi(e>0?this.elements[e-1]:-1),n=ZDi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new qnc.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)?YDi.Range.fromPositions(n,n):YDi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!_ge(this.elements[e]))return;let r=e;for(;r>0&&_ge(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!_ge(this.elements[e]))return;let r=e;for(;r>0&&_ge(this.elements[r-1])&&!KDi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,Uwr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new XAt.OffsetRange(r,n)}};eyt.LinesSliceCharSequence=Qwr;function _ge(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(_ge,"isWordChar");function KDi(t){return t>=65&&t<=90}a(KDi,"isUpperCase");var Hnc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function JDi(t){return Hnc[t]}a(JDi,"getCategoryBoundaryScore");function ZDi(t){return t===10?8:t===13?7:(0,jnc.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(ZDi,"getCategory")});var rNi=I(jwr=>{"use strict";p();Object.defineProperty(jwr,"__esModule",{value:!0});jwr.computeMovedLines=Wnc;var Gnc=Ege(),tyt=zAt(),I4=Al(),L5e=MQ(),$nc=gk(),Jb=c2(),XDi=qwr(),ryt=YAt(),Vnc=Fwr(),eNi=jp();function Wnc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=Ync(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=Knc(u,n,o,e,r,s);return(0,I4.pushMany)(c,d),c=Jnc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` +`).length>=15&&znc(h,g=>g.length>=2)>=2}),c=Znc(t,c),c}a(Wnc,"computeMovedLines");function znc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(znc,"countWhere");function Ync(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new ryt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new ryt.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 tyt.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(Ync,"computeMovesFromSimpleDeletionsToSimpleInsertions");function Knc(t,e,r,n,o,s){let c=[],l=new $nc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,I4.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 Jb.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new Jb.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,I4.reverseOrder)((0,I4.compareBy)(m=>m.modifiedLineRange.length,I4.numberComparator)));let d=new Jb.LineRangeSet,f=new Jb.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 tyt.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,I4.compareBy)(m=>m.original.startLineNumber,I4.numberComparator));let h=new L5e.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,L5e.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)||!tNi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new Jb.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new Jb.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!tNi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new Jb.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new Jb.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new tyt.LineRangeMapping(new Jb.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new Jb.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(Knc,"computeUnchangedMoves");function tNi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new Vnc.MyersDiffAlgorithm().compute(new XDi.LinesSliceCharSequence([t],new eNi.Range(1,1,1,t.length),!1),new XDi.LinesSliceCharSequence([e],new eNi.Range(1,1,1,e.length),!1),r),s=0,c=Gnc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,ryt.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(tNi,"areLinesSimilar");function Jnc(t){if(t.length===0)return t;t.sort((0,I4.compareBy)(r=>r.original.startLineNumber,I4.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(Jnc,"joinCloseConsecutiveMoves");function Znc(t,e){let r=new L5e.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(mre,"__esModule",{value:!0});mre.optimizeSequenceDiffs=eic;mre.removeShortMatches=ric;mre.extendDiffsToEntireWordIfAppropriate=nic;mre.removeVeryShortMatchingLinesBetweenDiffs=oic;mre.removeVeryShortMatchingTextBetweenLongDiffs=sic;var Xnc=Al(),x4=sd(),w4=Ege();function eic(t,e,r){let n=r;return n=nNi(t,e,n),n=nNi(t,e,n),n=tic(t,e,n),n}a(eic,"optimizeSequenceDiffs");function nNi(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(nNi,"joinSequenceDiffsByShifting");function tic(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(iNi,"shiftDiffToBetterPosition");function ric(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 w4.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(ric,"removeShortMatches");function nic(t,e,r,n,o=!1){let s=w4.SequenceDiff.invert(r,t.length),c=[],l=new w4.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 w4.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 iic(r,c)}a(nic,"extendDiffsToEntireWordIfAppropriate");function iic(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(iic,"mergeSequenceDiffs");function oic(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(oic,"removeVeryShortMatchingLinesBetweenDiffs");function sic(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,Xnc.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 x4.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new x4.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=w4.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():w4.OffsetPair.zero,d?d.getStarts():w4.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(sic,"removeVeryShortMatchingTextBetweenLongDiffs")});var aNi=I(nyt=>{"use strict";p();Object.defineProperty(nyt,"__esModule",{value:!0});nyt.LineSequence=void 0;var Hwr=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:sNi(this.lines[e-1]),n=e===this.lines.length?0:sNi(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]}};nyt.LineSequence=Hwr;function sNi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(ayt,"__esModule",{value:!0});ayt.DefaultLinesDiffComputer=void 0;var aic=Al(),cNi=Yu(),syt=c2(),lNi=sd(),uNi=jp(),iyt=mT(),oyt=xwr(),Are=zAt(),R4=Ege(),cic=WDi(),lic=Fwr(),uic=rNi(),gre=oNi(),dNi=aNi(),fNi=qwr(),Gwr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new cic.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new lic.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,aic.equals)(e,r,(x,P)=>x===P))return new oyt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new oyt.LinesDiff([new Are.DetailedLineRangeMapping(new syt.LineRange(1,e.length+1),new syt.LineRange(1,r.length+1),[new Are.RangeMapping(new uNi.Range(1,1,e.length,e[e.length-1].length+1),new uNi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?R4.InfiniteTimeout.instance:new R4.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 dNi.LineSequence(u,e),h=new dNi.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,gre.optimizeSequenceDiffs)(f,h,g),g=(0,gre.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 iyt.ArrayText(e),T=new iyt.ArrayText(r),w=(0,Are.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,cNi.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 oyt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,uic.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new R4.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,Are.lineRangeMappingFromRangeMappings)(m.mappings,new iyt.ArrayText(r),new iyt.ArrayText(n),!0);return new oyt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=dic(n).toRangeMapping2(e,r),d=new fNi.LinesSliceCharSequence(e,u.originalRange,s),f=new fNi.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&&R4.SequenceDiff.assertSorted(g),g=(0,gre.optimizeSequenceDiffs)(d,f,g),m&&R4.SequenceDiff.assertSorted(g),g=(0,gre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&R4.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,gre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&R4.SequenceDiff.assertSorted(g)),g=(0,gre.removeShortMatches)(d,f,g),m&&R4.SequenceDiff.assertSorted(g),g=(0,gre.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&R4.SequenceDiff.assertSorted(g);let A=g.map(y=>new Are.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&Are.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};ayt.DefaultLinesDiffComputer=Gwr;function dic(t){return new Are.LineRangeMapping(new syt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new syt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(dic,"toLineRangeMapping")});var Vwr=I(yv=>{"use strict";p();Object.defineProperty(yv,"__esModule",{value:!0});yv.EditDataWithIndex=yv.maxImperfectAgreementLength=yv.maxAgreementOffset=void 0;yv.tryRebase=gic;yv.checkEditConsistency=hNi;yv.tryRebaseStringEdits=yic;var fic=CD(),pic=M_(),PE=pE(),vge=sd(),pNi=mT(),hic=$wr(),mic=!1;yv.maxAgreementOffset=10;yv.maxImperfectAgreementLength=5;var cyt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};yv.EditDataWithIndex=cyt;function gic(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:yv.maxImperfectAgreementLength}){let f=Date.now();try{return Aic(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${pic.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(gic,"tryRebase");function Aic(t,e,r,n,o,s,c,l,u,d){if(!hNi(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.lengthPE.AnnotatedStringEdit.create(E))),g=mNi(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=PE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new fic.SingleEdits(r).apply(t)!==PE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Aic,"_tryRebase");function hNi(t,e,r,n,o=mic){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(hNi,"checkEditConsistency");function yic(t,e,r,n,o={maxImperfectAgreementLength:yv.maxImperfectAgreementLength}){return mNi(t,e.mapData(s=>new PE.VoidEditData),r,n,o)?.toStringEdit()}a(yic,"tryRebaseStringEdits");function mNi(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 PE.AnnotatedStringReplacement(vge.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=Cic(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 PE.AnnotatedStringReplacement(new vge.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(;uyv.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 PE.AnnotatedStringReplacement(vge.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 vic(t){return _ic.has(t)}a(vic,"isAutoClosePair");function Cic(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uyv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&vic(l)&&Eic(l,e.newText.substring(o))?o:-1}a(Cic,"agreementIndexOf");function bic(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new hic.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new pNi.StringText(t),f=new pNi.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 PE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(bic,"computeDiff")});var ANi=I(lyt=>{"use strict";p();Object.defineProperty(lyt,"__esModule",{value:!0});lyt.RejectionCollector=void 0;var Sic=S5(),gNi=wo(),Tic=u2(),Wwr=class extends gNi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new Kwr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,Tic.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new zwr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Sic.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,gNi.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()}};lyt.RejectionCollector=Wwr;var zwr=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 Ywr(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}},Ywr=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()}},Kwr=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 Zwr=I(Cge=>{"use strict";p();Object.defineProperty(Cge,"__esModule",{value:!0});Cge.DisposablesLRUCache=Cge.LRUCache=void 0;var F5e=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},uyt=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 F5e("",null),this._tail=new F5e("",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 F5e(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}};Cge.LRUCache=uyt;var Jwr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new uyt(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()}};Cge.DisposablesLRUCache=Jwr});var yNi=I(fyt=>{"use strict";p();Object.defineProperty(fyt,"__esModule",{value:!0});fyt.RebaseFailureInfo=void 0;var Iic=pE(),Xwr=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 Iic.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 = ${dyt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${dyt(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}), ${dyt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${dyt(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(` +`)}};fyt.RebaseFailureInfo=Xwr;function dyt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(dyt,"toBacktickLiteral")});var _Ni=I(hyt=>{"use strict";p();Object.defineProperty(hyt,"__esModule",{value:!0});hyt.NextEditCache=void 0;var U5e=Sl(),xic=S5(),wic=Zwr(),ENi=wo(),Ric=wF(),pyt=Vwr(),Pic=yNi(),eRr=class extends ENi.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 wic.LRUCache(50),(0,Ric.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new tRr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,xic.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(U5e.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,ENi.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(U5e.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(U5e.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(U5e.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(U5e.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()}};hyt.NextEditCache=eRr;var tRr=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,pyt.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,pyt.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,pyt.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 Pic.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,pyt.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 vNi=I(myt=>{"use strict";p();Object.defineProperty(myt,"__esModule",{value:!0});myt.NextEditResult=void 0;var rRr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};myt.NextEditResult=rRr});var CNi=I(gyt=>{"use strict";p();Object.defineProperty(gyt,"__esModule",{value:!0});gyt.SpeculativeRequestManager=void 0;var kic=wo(),nRr=class extends kic.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 Dic=BT&&BT.__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},Q5e=BT&&BT.__param||function(t,e){return function(r,n){e(r,n,t)}},iRr;Object.defineProperty(BT,"__esModule",{value:!0});BT.NextEditFetchRequest=BT.NextEditProvider=BT.NesOutcome=void 0;var Nic=require("path"),Ev=Sl(),bge=CD(),H5e=qAt(),q5e=ZA(),Mic=hut(),Tf=cge(),Oic=S5(),oRr=hp(),Bic=MDi(),Lic=hge(),Fic=Swr(),Uic=Ap(),j5e=M_(),Ug=Lx(),bNi=Yu(),Ayt=Jc(),Qic=GYe(),cRr=Cs(),yyt=wo(),SNi=u2(),TNi=KM(),qic=RS(),PNi=um(),INi=BH(),yre=pE(),jic=b_(),sRr=sd(),xNi=mT(),Hic=Vwr(),Gic=ANi(),$ic=_Ni(),Eyt=vNi(),Vic=CNi();function Wic(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 sRr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(Wic,"computeReducedWindow");function wNi(t,e){let n=new H5e.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r +`)?new yre.StringEdit(n.replacements.map(o=>new yre.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r +`)))):n}a(wNi,"convertLineEditToEdit");function RNi(t,e){return new Qic.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:yre.StringEdit.empty,nextEdits:[],docId:n}}}throw new cRr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:yre.StringEdit.empty,nextEdits:[],docId:n}})}a(RNi,"createDocStateLookupMap");var G5e;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(G5e||(BT.NesOutcome=G5e={}));var aRr=iRr=class extends yyt.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 Gic.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 $ic.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new Vic.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,SNi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,SNi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,yyt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(Ev.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 TNi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(oRr.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(j5e.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 cRr.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 Eyt.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(Ev.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new $5e(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 Tf.NoNextEditReason.FetchFailure||_ instanceof Tf.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof Tf.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new Eyt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof Tf.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new Eyt.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(H5e.RootedLineEdit.fromEdit(new bge.RootedEdit(h,new yre.StringEdit([y.actualEdit])))),(0,bNi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new Eyt.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,Ayt.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(Ev.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService),isEagerBackupRequest:this._configService.getExperimentBasedConfig(Ev.ConfigKey.TeamInternal.InlineEditsEagerBackupRequest,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=H5e.RootedLineEdit.fromEdit(new bge.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new Tf.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 Ug.Result.error(new Tf.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 if(n.isEagerBackupRequest){d.trace("starting eager backup request in parallel with rebase attempt"),this._pendingStatelessNextEditRequest=null;let B=this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),j=a(()=>{B.then(Q=>Q.nextEditRequest.cancellationTokenSource.cancel()).catch(()=>{})},"cancelBackupRequest"),M=await this._joinNextEditRequest(R,L,c,g,l),O=await R.firstEdit.p;if(O.isOk()&&O.val.edit){let Q=this._nextEditCache.tryRebaseCacheEntry(O.val,h,m);if(Q.edit)return d.trace("rebase succeeded, cancelling eager backup request"),j(),c.setStatelessNextEditTelemetry(M.telemetry),Ug.Result.ok(Q.edit);this._logRebaseFailure(Q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("cancelled after rebase failed (eager backup path)"),j(),c.setStatelessNextEditTelemetry(M.telemetry),Ug.Result.error(new Tf.NoNextEditReason.GotCancelled("afterFailedRebase"));d.trace("rebase failed, using eager backup request");let q=await B;return c.setStatelessNextEditTelemetry(q.nextEditResult.telemetry),q.nextEditResult.nextEdit.isError()?q.nextEditResult.nextEdit:q.nextEditRequest.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 q=this._nextEditCache.tryRebaseCacheEntry(j.val,h,m);if(q.edit)return c.setStatelessNextEditTelemetry(B.telemetry),Ug.Result.ok(q.edit);this._logRebaseFailure(q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),Ug.Result.error(new Tf.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 q=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(q.telemetry),q.nextEdit.isError()?q.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=this._debugRecorder?.getRecentLog(),m=e.log,g=zic(n.getDocumentAndIdx(d)),A=r.selection.get()[0],y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new Ayt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(Ev.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new Tf.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.nextEditDoc),g.idx,E,_,v,!1,m,e.log.recordingBookmark,h,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"),m.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,Oic.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(j=>{b.intermediateUserEdit&&!j.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(j),(0,Hic.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=RNi(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,m,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),q=B.edit,Q=new INi.LineEdit([q]),z=wNi(Q,O.baseDocState).tryRebase(O.editsSoFar);if(z===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(Ug.Result.error(new Tf.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(z);let W;if(z.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(z.replacements.length>1)M.trace(`WARNING: ${D} has ${z.replacements.length} edits, but expected only 1`);else{let $=z.replacements[0];O.nextEdits.push($),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,$,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?A?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),m.setResult(new H5e.RootedLineEdit(O.docContents,Q)),_.complete(W?Ug.Result.ok(W):Ug.Result.error(new Tf.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=z.applyOnText(O.docContents),W},"processEdit"),L=a((B,j)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof Tf.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 Tf.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:z,window:W}=B,$=W?Wic(W,A,z):void 0;this._nextEditCache.setNoNextEdit(d,z,$,e)}_.isSettled||_.complete(Ug.Result.error(B));let q=x.get(d).nextEdits.length>0?Ug.Result.ok(void 0):Ug.Result.error(B),Q=new Tf.StatelessNextEditResult(q,j);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 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 q=B.value.v;N(q,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: ${j5e.ErrorUtils.toString(O)}`);let q=new Tf.NoNextEditReason.Unexpected(j5e.ErrorUtils.fromUnknown(O));L(q,M)}})(),T=new Tf.StatelessNextEditResult(Ug.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new yyt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Ayt.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,yyt.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(Ev.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(Ev.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(Ev.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(Ev.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(Ev.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===q5e.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 Mic.InlineEditRequestLogContext(n.uri,0,void 0),s=new TNi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(oRr.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 sRr.OffsetRange(d,d),h=[f],m=new bge.RootedEdit(r.documentBeforeEdits,new yre.StringEdit([r.edit])),g=new xNi.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(Ev.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===q5e.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=iRr.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 $5e(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,PNi.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: ${j5e.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 xNi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new yre.StringEdit([l]),j=H5e.RootedLineEdit.fromEdit(new bge.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new Tf.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),j,r.value.get(),bge.Edits.single(B),n);return{recentEdit:new bge.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 Ayt.DeferredPromise,w=this._configService.getExperimentBasedConfig(Ev.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case q5e.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case q5e.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(Ev.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case q5e.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(Ev.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,bNi.assertNever)(w)}let x=new Tf.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,Nic.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Bic.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=RNi(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(Ug.Result.error(g.value.v)),e.setResult(new Tf.StatelessNextEditResult(Ug.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 INi.LineEdit([E]),b=wNi(_,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(Ug.Result.ok(w)),e.setResult(new Tf.StatelessNextEditResult(Ug.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(Ug.Result.error(new Tf.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new Tf.StatelessNextEditResult(Ug.Result.error(new Tf.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: ${j5e.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=G5e.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=G5e.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")}};BT.NextEditProvider=aRr;BT.NextEditProvider=aRr=iRr=Dic([Q5e(5,Ev.IConfigurationService),Q5e(6,Fic.ISnippyService),Q5e(7,oRr.ILogService),Q5e(8,Uic.IExperimentationService),Q5e(9,Lic.IRequestLogger)],aRr);function zic(t){if(!t)throw new cRr.BugIndicatingError("expected value to be defined, but it was not");return t}a(zic,"assertDefined");var $5e=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,PNi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};BT.NextEditFetchRequest=$5e});var QNi=I(ch=>{"use strict";p();Object.defineProperty(ch,"__esModule",{value:!0});ch.GLOB_SPLIT=ch.GLOBSTAR=void 0;ch.getEmptyExpression=Xic;ch.splitGlobAware=dRr;ch.isEmptyPattern=aoc;ch.match=foc;ch.parse=LNi;ch.isRelativePattern=FNi;ch.getBasenameTerms=poc;ch.getPathTerms=hoc;ch.patternsEquals=Aoc;var Yic=Al(),uRr=Jc(),Kic=$7t(),Jic=gk(),WG=AA(),Zic=BQ(),V5e=Gh();function Xic(){return Object.create(null)}a(Xic,"getEmptyExpression");ch.GLOBSTAR="**";ch.GLOB_SPLIT="/";var _yt="[/\\\\]",vyt="[^/\\\\]",eoc=/\//g;function DNi(t,e){switch(t){case 0:return"";case 1:return`${vyt}*?`;default:return`(?:${_yt}|${vyt}+${_yt}${e?`|${_yt}${vyt}+`:""})*?`}}a(DNi,"starsToRegExp");function dRr(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(dRr,"splitGlobAware");function BNi(t){if(!t)return"";let e="",r=dRr(t,ch.GLOB_SPLIT);if(r.every(n=>n===ch.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===ch.GLOBSTAR){if(n)return;e+=DNi(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===ch.GLOB_SPLIT?h="":h=(0,V5e.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${dRr(l,",").map(g=>BNi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=vyt;continue;case"*":e+=DNi(1);continue;default:e+=(0,V5e.escapeRegExpCharacters)(f)}}su===d,endsWith:n?V5e.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,Kic.isEqualOrParent)(u,d,e.ignoreCase??!Zic.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=NNi.get(s);if(c)return MNi(c,t,o);let l;return toc.test(r)?c=coc(r.substring(4),r,o):(l=roc.exec(lRr(r,o)))?c=loc(l[1],r,o):(e.trimForExclusions?ioc:noc).test(r)?c=uoc(r,o):(l=ooc.exec(lRr(r,o)))?c=ONi(l[1].substring(1),r,!0,o):(l=soc.exec(lRr(r,o)))?c=ONi(l[1],r,!1,o):c=doc(r,o),NNi.set(s,c),MNi(c,t,o)}a(pRr,"parsePattern");function MNi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,V5e.ltrim)(o.substring(e.base.length),WG.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(MNi,"wrapRelativePattern");function lRr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(lRr,"trimForExclusions");function coc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(coc,"trivia1");function loc(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(loc,"trivia2");function uoc(t,e){let r=UNi(t.slice(1,-1).split(",").map(l=>pRr(l,e)).filter(l=>l!==TD),t),n=r.length;if(!n)return TD;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(uoc,"trivia3");function ONi(t,e,r,n){let o=WG.sep===WG.posix.sep,s=o?t:t.replace(eoc,WG.sep),c=WG.sep+s,l=WG.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(ONi,"trivia4and5");function doc(t,e){try{let r=new RegExp(`^${BNi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return TD}}a(doc,"toRegExp");function foc(t,e,r){return!t||typeof e!="string"?!1:LNi(t,r)(e)}a(foc,"match");function LNi(t,e={}){if(!t)return fRr;if(typeof t=="string"||FNi(t)){let r=pRr(t,e);if(r===TD)return fRr;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 moc(t,e)}a(LNi,"parse");function FNi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(FNi,"isRelativePattern");function poc(t){return t.allBasenames||[]}a(poc,"getBasenameTerms");function hoc(t){return t.allPaths||[]}a(hoc,"getPathTerms");function moc(t,e){let r=UNi(Object.getOwnPropertyNames(t).map(l=>goc(l,t[l],e)).filter(l=>l!==TD)),n=r.length;if(!n)return TD;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(moc,"parsedExpression");function goc(t,e,r){if(e===!1)return TD;let n=pRr(t,r);if(n===TD)return TD;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,uRr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(goc,"parseExpressionPattern");function UNi(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(UNi,"aggregateBasenameMatches");function Aoc(t,e){return(0,Yic.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(Aoc,"patternsEquals")});var byt=I(wl=>{"use strict";p();var yoc=wl&&wl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Eoc=wl&&wl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_oc=wl&&wl.__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,qNi.isEqual)(r.uri,t)||r.uri.path===t.path||mRr(t,r))}a(hRr,"findNotebook");function mRr(t,e){if(t.scheme===W5e.Schemas.vscodeNotebookCell||t.scheme===W5e.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,qNi.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(mRr,"findCell");function voc(t,e){if(t.scheme!==W5e.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=jNi(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(voc,"getNotebookCellOutput");function jNi(t,e){let r=hRr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=mRr(t,r);return n===void 0?[r,void 0]:[r,n]}a(jNi,"getNotebookAndCellFromUri");function Coc(t){return t.scheme===W5e.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Coc,"isNotebookCellOrNotebookChatInput");function boc(t){return t.scheme===W5e.Schemas.vscodeNotebookCell}a(boc,"isNotebookCell");function Soc(t){return t.path.endsWith(".ipynb")}a(Soc,"isJupyterNotebookUri");function Toc(t){return t.notebookType==="jupyter-notebook"}a(Toc,"isJupyterNotebook");function Ioc(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(Ioc,"serializeNotebookDocument");function xoc(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(xoc,"extractNotebookOutline");function HNi(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||$Ni(e.include))}a(HNi,"isDocumentExcludePattern");function GNi(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(GNi,"isFilenamePattern");function $Ni(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a($Ni,"isRelativePattern");function woc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(woc,"isNotebookEditorContribution");function Roc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Roc,"extractEditorAssociation");function VNi(t,e){if(typeof e=="string"&&Sge.match(e.toLowerCase(),(0,Tge.basename)(t.fsPath).toLowerCase()))return!0;if(HNi(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Sge.match(r,(0,Tge.basename)(t.fsPath).toLowerCase()))return!(n&&Sge.match(n,(0,Tge.basename)(t.fsPath).toLowerCase()))}return GNi(e)&&Sge.match(e.filenamePattern,(0,Tge.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Sge.match(e.excludeFileNamePattern,(0,Tge.basename)(t.fsPath).toLowerCase())):!1}a(VNi,"notebookSelectorMatches");function WNi(t,e){let r=[];for(let n of e)n.filenamePattern&&Sge.match(n.filenamePattern.toLowerCase(),(0,Tge.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(WNi,"getNotebookEditorAssociations");function Poc(t,e,r,n){if(hRr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>VNi(t,l)));if(o.length===0)return!1;let s=WNi(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??Cyt.default)===Cyt.default)}a(Poc,"_hasSupportedNotebooks")});var ZNi=I(_v=>{"use strict";p();var koc=_v&&_v.__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},Doc=_v&&_v.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(_v,"__esModule",{value:!0});_v.TelemetrySender=_v.NextEditProviderTelemetryBuilder=_v.DiagnosticsTelemetryBuilder=_v.LlmNESTelemetryBuilder=void 0;var zNi=dR(),Noc=S5(),JNi=o0(),Moc=byt(),Ooc=Jc(),Syt=wo(),Boc=XY(),YNi=wF(),KNi=mm(),Tyt=class extends Syt.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===Boc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,Moc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(KNi.Uri.parse(g.id.uri));if(y){let v=y.state.HEAD?.upstream?.remote,b=y.state.remotes.find(T=>T.name===v);b?.fetchUrl&&(d=b.pushUrl||b.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(KNi.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?.state.HEAD?.upstream?.remote,T=v?.state.remotes.find(w=>w.name===b);T?.fetchUrl&&E.add(T.fetchUrl),T?.pushUrl&&E.add(T.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}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,Noc.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}};_v.LlmNESTelemetryBuilder=Tyt;var Iyt=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}};_v.DiagnosticsTelemetryBuilder=Iyt;var gRr=class t extends Syt.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 Tyt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new Iyt}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}};_v.NextEditProviderTelemetryBuilder=gRr;var ARr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new Syt.DisposableStore,this._disposalTracker=new Syt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new Ooc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,YNi.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,YNi.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()}},yRr=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 ARr(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:q,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:z,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:$,isInlineSuggestion:J,debounceTime:ne,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:ae,notebookCellMarkerIndex:Oe,notebookId:ve,notebookCellLines:Fe,nextEditLogprob:Pe,supersededByOpportunityId:Z,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:fe,response:X,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:qe,diagnosticType:ie,diagnosticDroppedReasons:le,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:tt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:Et,hadDiagnosticsNES:kt,hadLlmNES:Ht,pickedNES:jt,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Ue}=e,de,Se,Le,te;if(X!==void 0){let{response:Te,ttft:Ge,fetchResult:Y,fetchTime:se}=await X;Te.type===zNi.ChatFetchResponseType.Success&&(de=Te.usage),Se=Ge,Le=Y,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:Z,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Le,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ie,diagnosticDroppedReasons:le,pickedNES:jt,notebookType:b,notebookId:ve,notebookCellLines:Fe,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ie,userAggressivenessSetting:be,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:ae>0?1:0,notebookCellMarkerCount:ae,notebookCellMarkerIndex:Oe,logProbThreshold:B,documentsCount:j,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:z,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum($),isInlineSuggestion:this._boolToNum(J),debounceTime:ne,artificialDelay:H,fetchStartedAfterMs:fe,ttft:Se,fetchTime:te,promptTokens:de?.prompt_tokens,responseTokens:de?.completion_tokens,cachedTokens:de?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:de?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:de?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:Pe,hadDiagnosticsNES:this._boolToNum(kt),hadLlmNES:this._boolToNum(Ht),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:tt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(Et),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("copilot-nes/provideInlineEdit",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(()=>{});this._telemetryService.sendEnhancedGHTelemetryEvent("copilot-nes/provideInlineEdit",(0,JNi.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==zNi.ChatFetchResponseType.Success?void 0:x.response.value,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)}};_v.TelemetrySender=yRr;_v.TelemetrySender=yRr=koc([Doc(1,JNi.ITelemetryService)],yRr)});var _Rr=I(Ige=>{"use strict";p();Object.defineProperty(Ige,"__esModule",{value:!0});Ige.NullPowerService=Ige.IPowerService=void 0;var XNi=Cc(),Loc=Ls();Ige.IPowerService=(0,Loc.createDecorator)("IPowerService");var ERr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=XNi.Event.None,this.onDidResume=XNi.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};Ige.NullPowerService=ERr});var r6=I(zG=>{"use strict";p();Object.defineProperty(zG,"__esModule",{value:!0});zG.FetchStreamRecorder=zG.FetchStreamSource=zG.IChatMLFetcher=void 0;var Foc=rn(),Uoc=Jc();zG.IChatMLFetcher=(0,Foc.createServiceIdentifier)("IChatMLFetcher");var vRr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new Uoc.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)}};zG.FetchStreamSource=vRr;var CRr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}constructor(e){this.deltas=[],this.callback=async(r,n,o)=>{this._firstTokenEmittedTime===void 0&&(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)&&(this._firstTokenEmittedTime=Date.now());let s=e?await e(r,n,o):void 0;return this.deltas.push(o),s}}};zG.FetchStreamRecorder=CRr});var bRr=I(xyt=>{"use strict";p();Object.defineProperty(xyt,"__esModule",{value:!0});xyt.IChatQuotaService=void 0;var Qoc=rn();xyt.IChatQuotaService=(0,Qoc.createServiceIdentifier)("IChatQuotaService")});var SRr=I(wyt=>{"use strict";p();Object.defineProperty(wyt,"__esModule",{value:!0});wyt.IConversationOptions=void 0;var qoc=rn();wyt.IConversationOptions=(0,qoc.createServiceIdentifier)("ConversationOptions")});var z5e=I(xge=>{"use strict";p();Object.defineProperty(xge,"__esModule",{value:!0});xge.getTextPart=Hoc;xge.toTextPart=eMi;xge.toTextParts=Goc;xge.roleToString=$oc;var Ere=Io(),joc=Yu();function Hoc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Ere.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Ere.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(Hoc,"getTextPart");function eMi(t){return{type:Ere.Raw.ChatCompletionContentPartKind.Text,text:t}}a(eMi,"toTextPart");function Goc(t){return[eMi(t)]}a(Goc,"toTextParts");function $oc(t){switch(t){case Ere.Raw.ChatRole.System:return"system";case Ere.Raw.ChatRole.User:return"user";case Ere.Raw.ChatRole.Assistant:return"assistant";case Ere.Raw.ChatRole.Tool:return"tool";default:(0,joc.assertNever)(t,`unknown role (${t})`)}}a($oc,"roleToString")});var IRr=I(wge=>{"use strict";p();Object.defineProperty(wge,"__esModule",{value:!0});wge.InteractionService=wge.IInteractionService=void 0;var Voc=rn(),tMi=um();wge.IInteractionService=(0,Voc.createServiceIdentifier)("IInteractionService");var TRr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,tMi.generateUuid)()}startInteraction(){this._interactionId=(0,tMi.generateUuid)()}get interactionId(){return this._interactionId}};wge.InteractionService=TRr});var wRr=I(Ryt=>{"use strict";p();Object.defineProperty(Ryt,"__esModule",{value:!0});Ryt.SSEParser=void 0;var xRr=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(Xi,"__esModule",{value:!0});Xi.getModelCapabilityOverride=tuc;Xi.getModelId=p$;Xi.isHiddenModelA=ruc;Xi.isHiddenModelB=Nkr;Xi.isHiddenModelE=fEt;Xi.isHiddenModelF=pEt;Xi.isHiddenFamilyH=hEt;Xi.isHiddenModelK=nuc;Xi.isGpt54=Mkr;Xi.isGpt55=Okr;Xi.isGpt55EconomicalSearchAndEditExp=iuc;Xi.isGpt55LargePromptSectionsExp=ouc;Xi.isHiddenModelM=b4e;Xi.isGpt53Codex=Bkr;Xi.isVSCModelA=mEt;Xi.isVSCModelB=gEt;Xi.isVSCModelReplaceStringSet=S4e;Xi.isVSCModelC=suc;Xi.isVSCModelD=auc;Xi.isGpt52CodexFamily=Lkr;Xi.isGpt52Family=Fkr;Xi.modelPrefersInstructionsInUserMessage=cuc;Xi.modelPrefersInstructionsAfterHistory=luc;Xi.modelSupportsApplyPatch=uuc;Xi.modelPrefersJsonNotebookRepresentation=duc;Xi.modelSupportsReplaceString=fuc;Xi.modelSupportsMultiReplaceString=MOi;Xi.modelCanUseReplaceStringExclusively=puc;Xi.modelShouldUseReplaceStringHealing=huc;Xi.modelCanUseMcpResultImageURL=muc;Xi.modelCanUseImageURL=guc;Xi.modelSupportsPDFDocuments=Auc;Xi.modelCanUseApplyPatchExclusively=yuc;Xi.modelNeedsStrongReplaceStringHint=Euc;Xi.modelSupportsSimplifiedApplyPatchInstructions=_uc;Xi.isAnthropicFamily=T4e;Xi.isGeminiFamily=Ukr;Xi.isMinimaxFamily=AEt;Xi.isGpt5PlusFamily=yEt;Xi.isGptCodexFamily=Cuc;Xi.isGpt5Family=vuc;Xi.isGptFamily=buc;Xi.isGpt51Family=Suc;Xi.getVerbosityForModelSync=Tuc;Xi.modelSupportsToolSearch=Iuc;Xi.modelSupportsContextEditing=xuc;var _0=Ewr(),v4e=Il(),POi=gp(),Ylc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],DOi=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],IOi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],xOi=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],wOi=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],ROi=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],kOi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],Klc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],Jlc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],Zlc=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],NOi="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",Xlc=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],euc=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function tuc(t,e){return e.getConfig(v4e.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(tuc,"getModelCapabilityOverride");function p$(t){return"id"in t?t.id:t.model}a(p$,"getModelId");function ruc(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Ylc.includes(e)}a(ruc,"isHiddenModelA");function Nkr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return DOi.includes(e)}a(Nkr,"isHiddenModelB");function fEt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Klc.includes(e)}a(fEt,"isHiddenModelE");function pEt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Jlc.includes(e)}a(pEt,"isHiddenModelF");function hEt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Xlc.includes(e)}a(hEt,"isHiddenFamilyH");function nuc(t){return(0,_0.getCachedSha256Hash)(t.family)===NOi}a(nuc,"isHiddenModelK");function Mkr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||Zlc.includes(e)}a(Mkr,"isGpt54");function Okr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||DOi.includes(e)}a(Okr,"isGpt55");function iuc(t,e){let r=t.get(v4e.IConfigurationService),n=t.get(POi.IExperimentationService);return Okr(e)&&r.getExperimentBasedConfig(v4e.ConfigKey.EnableGpt55EconomicalSearchAndEdit,n)}a(iuc,"isGpt55EconomicalSearchAndEditExp");function ouc(t,e){let r=t.get(v4e.IConfigurationService),n=t.get(POi.IExperimentationService);return Okr(e)&&r.getExperimentBasedConfig(v4e.ConfigKey.EnableGpt55LargePromptSections,n)}a(ouc,"isGpt55LargePromptSectionsExp");function b4e(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return euc.includes(e)}a(b4e,"isHiddenModelM");function Bkr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(Bkr,"isGpt53Codex");function mEt(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return IOi.includes(e)||IOi.includes(r)}a(mEt,"isVSCModelA");function gEt(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return xOi.includes(e)||xOi.includes(r)}a(gEt,"isVSCModelB");function S4e(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return kOi.includes(e)||kOi.includes(r)}a(S4e,"isVSCModelReplaceStringSet");function suc(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return wOi.includes(e)||wOi.includes(r)}a(suc,"isVSCModelC");function auc(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return ROi.includes(e)||ROi.includes(r)}a(auc,"isVSCModelD");function Lkr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(Lkr,"isGpt52CodexFamily");function Fkr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(Fkr,"isGpt52Family");function cuc(t){return t.includes("claude-3.5-sonnet")}a(cuc,"modelPrefersInstructionsInUserMessage");function luc(t){return t.includes("claude-3.5-sonnet")}a(luc,"modelPrefersInstructionsAfterHistory");function uuc(t){return S4e(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||Lkr(t.family)||Bkr(t.family)||mEt(t)||gEt(t)||Fkr(t.family)||Mkr(t)||Nkr(t)||b4e(t)}a(uuc,"modelSupportsApplyPatch");function duc(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||Lkr(t.family)||Bkr(t.family)||Fkr(t.family)||Mkr(t)||Nkr(t)||b4e(t)}a(duc,"modelPrefersJsonNotebookRepresentation");function fuc(t){return Ukr(t)||t.family.includes("grok-code")||MOi(t)||pEt(t)||AEt(t)||hEt(t)}a(fuc,"modelSupportsReplaceString");function MOi(t){return T4e(t)||fEt(t)||S4e(t)||AEt(t)||hEt(t)}a(MOi,"modelSupportsMultiReplaceString");function puc(t){return T4e(t)||t.family.includes("grok-code")||fEt(t)||t.family.toLowerCase().includes("gemini-3")||S4e(t)||pEt(t)||AEt(t)||hEt(t)}a(puc,"modelCanUseReplaceStringExclusively");function huc(t){return t.family.includes("gemini-2")}a(huc,"modelShouldUseReplaceStringHealing");function muc(t){return!T4e(t)&&!fEt(t)}a(muc,"modelCanUseMcpResultImageURL");function guc(t){return!0}a(guc,"modelCanUseImageURL");function Auc(t){return T4e(t)||yEt(t)||b4e(t)}a(Auc,"modelSupportsPDFDocuments");function yuc(t){return S4e(t)?!1:yEt(t)||mEt(t)||gEt(t)}a(yuc,"modelCanUseApplyPatchExclusively");function Euc(t){return Ukr(t)||pEt(t)}a(Euc,"modelNeedsStrongReplaceStringHint");function _uc(t){return yEt(t)||mEt(t)||gEt(t)}a(_uc,"modelSupportsSimplifiedApplyPatchInstructions");function T4e(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(T4e,"isAnthropicFamily");function Ukr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,_0.getCachedSha256Hash)(e)===NOi}a(Ukr,"isGeminiFamily");function AEt(t){return t.family.toLowerCase().includes("minimax")}a(AEt,"isMinimaxFamily");function yEt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(yEt,"isGpt5PlusFamily");function Cuc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(Cuc,"isGptCodexFamily");function vuc(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(vuc,"isGpt5Family");function buc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(buc,"isGptFamily");function Suc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(Suc,"isGpt51Family");function Tuc(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(Tuc,"getVerbosityForModelSync");function Iuc(t){let e=typeof t=="string"?t:p$(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"||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4-6")||!s.startsWith("claude-opus-4-1")&&s.startsWith("claude-opus-4-")},"matches");return n(e)||n(r)||b4e(r)}a(Iuc,"modelSupportsToolSearch");function xuc(t){let e=typeof t=="string"?t:p$(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-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-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(xuc,"modelSupportsContextEditing")});var CEt=I(_R=>{"use strict";p();Object.defineProperty(_R,"__esModule",{value:!0});_R.CUSTOM_TOOL_SEARCH_NAME=void 0;_R.modelSupportsInterleavedThinking=Ruc;_R.modelSupportsMemory=kuc;_R.isAnthropicContextEditingEnabled=Puc;_R.modelSupportsExtendedCacheTtl=OOi;_R.isExtendedCacheTtlEnabled=Duc;_R.isExtendedCacheTtlMessagesEnabled=Nuc;_R.buildContextManagement=BOi;_R.getContextManagementFromConfig=Muc;var _Et=Il(),EEt=I4e(),wuc=yR();_R.CUSTOM_TOOL_SEARCH_NAME="tool_search";function Ruc(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(Ruc,"modelSupportsInterleavedThinking");function kuc(t){let e=typeof t=="string"?t:(0,EEt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return 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-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(kuc,"modelSupportsMemory");function Puc(t,e,r){return(typeof t=="string"?(0,EEt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,EEt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(_Et.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(Puc,"isAnthropicContextEditingEnabled");function OOi(t){let e=typeof t=="string"?t:(0,EEt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return 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(OOi,"modelSupportsExtendedCacheTtl");function Duc(t,e,r,n,o){return!OOi(t)||n!==wuc.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(_Et.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(Duc,"isExtendedCacheTtlEnabled");function Nuc(t,e,r){return t?e.getExperimentBasedConfig(_Et.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(Nuc,"isExtendedCacheTtlMessagesEnabled");function BOi(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(BOi,"buildContextManagement");function Muc(t,e,r){let n=t.getExperimentBasedConfig(_Et.ConfigKey.AnthropicContextEditingMode,e);return BOi(n,r)}a(Muc,"getContextManagementFromConfig")});var Qkr=I(vEt=>{"use strict";p();Object.defineProperty(vEt,"__esModule",{value:!0});vEt.IToolDeferralService=void 0;var Ouc=rn();vEt.IToolDeferralService=(0,Ouc.createServiceIdentifier)("IToolDeferralService")});var Gkr=I(ME=>{"use strict";p();var Buc=ME&&ME.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Luc=ME&&ME.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fuc=ME&&ME.__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;oTEt(n,r),e)}a(quc,"arrayHash");function juc(t,e){return e=j4(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=Hkr(n,r),TEt(t[n],r)),e)}a(juc,"objectHash");var Huc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new SEt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof jkr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Zge)},"hashAsync");ME.hashAsync=Huc;function qkr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(qkr,"leftRotate");function Zge(t,e=32){return t instanceof ArrayBuffer?(0,jkr.encodeHex)(jkr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Zge,"toHexString");var SEt=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(bEt.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()),Zge(this._h0)+Zge(this._h1)+Zge(this._h2)+Zge(this._h3)+Zge(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,qkr(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=qkr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=qkr(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}};ME.StringSHA1=SEt});var Xge=I(x4e=>{"use strict";p();Object.defineProperty(x4e,"__esModule",{value:!0});x4e.TelemetryData=void 0;x4e.eventPropertiesToSimpleObject=$uc;var Guc=um(),$kr=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];Vuc(r,this.properties)}};x4e.TelemetryData=$kr;function $uc(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($uc,"eventPropertiesToSimpleObject");function Vuc(t,e){e.unique_id=(0,Guc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(Vuc,"addRequiredProperties")});var LOi=I(Vkr=>{"use strict";p();Object.defineProperty(Vkr,"__esModule",{value:!0});Vkr.extractThinkingDeltaFromChoice=Yuc;function Wuc(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(Wuc,"getThinkingDeltaText");function zuc(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(zuc,"getThinkingDeltaId");function Yuc(t){let e=t.message||t.delta;if(!e)return;let r=zuc(e),n=Wuc(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(Yuc,"extractThinkingDeltaFromChoice")});var wEt=I(Lre=>{"use strict";p();Object.defineProperty(Lre,"__esModule",{value:!0});Lre.SSEProcessor=void 0;Lre.splitChunk=UOi;Lre.convertToAPIJsonData=Zuc;Lre.sendCommunicationErrorTelemetry=eAe;var IEt=pp(),FOi=Xge(),Kuc=LOi(),xEt=f6(),C0=u6(),w4e=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}}},Wkr=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}},zkr=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 Wkr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function UOi(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!==""),r]}a(UOi,"splitChunk");var Ykr=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,xEt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new zkr,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,C0.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,C0.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]=UOi(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}`),eAe(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&&Juc(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}`),eAe(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new w4e(h.model||""),reason:C0.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),eAe(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,xEt.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,xEt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(xEt.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 w4e(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===C0.FinishedCompletionReason.FunctionCall||g.finish_reason===C0.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===C0.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===C0.FinishedCompletionReason.ToolCalls||g.finish_reason===C0.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??C0.FinishedCompletionReason.ClientTrimmed,filterReason:Xuc(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:C0.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}`),eAe(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),eAe(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"?C0.FinishedCompletionReason.FunctionCall:C0.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:C0.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)}`)}};Lre.SSEProcessor=Ykr;function Juc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(Juc,"isCopilotConfirmation");function Zuc(t){return{text:t.text.join(""),tokens:t.text}}a(Zuc,"convertToAPIJsonData");function Xuc(t){if(t.finish_reason===C0.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return C0.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return C0.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return C0.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return C0.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return C0.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return C0.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(Xuc,"choiceToFilterReason");function eAe(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=FOi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:IEt.LogLevel[IEt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=FOi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:IEt.LogLevel[IEt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(eAe,"sendCommunicationErrorTelemetry")});var P4e=I(tAe=>{"use strict";p();Object.defineProperty(tAe,"__esModule",{value:!0});tAe.sendEngineMessagesLengthTelemetry=GOi;tAe.sendEngineMessagesTelemetry=$Oi;tAe.sendResponsesApiCompactionTelemetry=ddc;tAe.prepareChatCompletionForReturn=fdc;var edc=wo(),jOi=Gkr(),kEt=bP(),HOi=um(),tdc=C4e(),Jkr=o0(),k4e=Xge(),rdc=u6(),ndc=wEt();function GOi(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=k4e.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,Jkr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,Jkr.multiplexProperties)(d.properties),d.measurements)}a(GOi,"sendEngineMessagesLengthTelemetry");var QOi=new kEt.LRUCache(1e3),qOi=new kEt.LRUCache(500),R4e=new kEt.LRUCache(1e3),REt={headerRequestId:null},Kkr=new kEt.LRUCache(100);function idc(t){let e=R4e.get(t);if(e!==void 0){let r=e+1;return R4e.set(t,r),r}else return R4e.set(t,1),1}a(idc,"updateHeaderRequestIdTracker");function odc(t){let e=Kkr.get(t);if(e!==void 0){let r=e+1;return Kkr.set(t,r),r}else return Kkr.set(t,1),1}a(odc,"updateConversationTracker");function sdc(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,jOi.hash)(n).toString(),l=qOi.get(c);if(!l)l=(0,HOi.generateUuid)(),qOi.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(D4e,"__esModule",{value:!0});D4e.CompactionDataContainer=void 0;D4e.rawPartAsCompactionData=hdc;var pdc=wo(),VOi=V5e(),Zkr=class extends pdc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:VOi.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};D4e.CompactionDataContainer=Zkr;function hdc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===VOi.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(hdc,"rawPartAsCompactionData")});var YOi=I(N4e=>{"use strict";p();Object.defineProperty(N4e,"__esModule",{value:!0});N4e.PhaseDataContainer=void 0;N4e.rawPartAsPhaseData=gdc;var mdc=wo(),zOi=V5e(),Xkr=class extends mdc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:zOi.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};N4e.PhaseDataContainer=Xkr;function gdc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===zOi.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(gdc,"rawPartAsPhaseData")});var ZOi=I(H4=>{"use strict";p();Object.defineProperty(H4,"__esModule",{value:!0});H4.StatefulMarkerContainer=void 0;H4.rawPartAsStatefulMarker=JOi;H4.encodeStatefulMarker=Adc;H4.decodeStatefulMarker=ydc;H4.getAllStatefulMarkersAndIndicies=rPr;H4.getStatefulMarkerAndIndex=Edc;H4.getIndexOfStatefulMarker=_dc;var ePr=wo(),KOi=V5e(),tPr=class extends ePr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:KOi.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};H4.StatefulMarkerContainer=tPr;function JOi(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===KOi.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(JOi,"rawPartAsStatefulMarker");function Adc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(Adc,"encodeStatefulMarker");function ydc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(ydc,"decodeStatefulMarker");function*rPr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===ePr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===ePr.Raw.ChatCompletionContentPartKind.Opaque){let o=JOi(n);o&&(yield{statefulMarker:o,index:e})}}}}a(rPr,"getAllStatefulMarkersAndIndicies");function Edc(t,e){for(let r of rPr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Edc,"getStatefulMarkerAndIndex");function _dc(t,e){for(let r of rPr(e))if(r.statefulMarker.marker===t)return r.index}a(_dc,"getIndexOfStatefulMarker")});var t5i=I(y6=>{"use strict";p();var Cdc=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]})),vdc=y6&&y6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e5i=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;o{"use strict";p();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.getModelCapabilityOverride=Xoc;Zi.getModelId=YG;Zi.isHiddenModelA=esc;Zi.isHiddenModelB=RRr;Zi.isHiddenModelE=Pyt;Zi.isHiddenModelF=kyt;Zi.isHiddenFamilyH=Dyt;Zi.isHiddenModelK=tsc;Zi.isGpt54=PRr;Zi.isGpt55=kRr;Zi.isGpt55EconomicalSearchAndEditExp=rsc;Zi.isGpt55LargePromptSectionsExp=nsc;Zi.isHiddenModelM=K5e;Zi.isGpt53Codex=DRr;Zi.isVSCModelA=Nyt;Zi.isVSCModelB=Myt;Zi.isVSCModelReplaceStringSet=J5e;Zi.isVSCModelC=isc;Zi.isVSCModelD=osc;Zi.isGpt52CodexFamily=NRr;Zi.isGpt52Family=MRr;Zi.modelPrefersInstructionsInUserMessage=ssc;Zi.modelPrefersInstructionsAfterHistory=asc;Zi.modelSupportsApplyPatch=csc;Zi.modelPrefersJsonNotebookRepresentation=lsc;Zi.modelSupportsReplaceString=usc;Zi.modelSupportsMultiReplaceString=uMi;Zi.modelCanUseReplaceStringExclusively=dsc;Zi.modelShouldUseReplaceStringHealing=fsc;Zi.modelCanUseMcpResultImageURL=psc;Zi.modelCanUseImageURL=hsc;Zi.modelSupportsPDFDocuments=msc;Zi.modelCanUseApplyPatchExclusively=gsc;Zi.modelNeedsStrongReplaceStringHint=Asc;Zi.modelSupportsSimplifiedApplyPatchInstructions=ysc;Zi.isAnthropicFamily=Z5e;Zi.isGeminiFamily=ORr;Zi.isMinimaxFamily=Oyt;Zi.isGpt5PlusFamily=Byt;Zi.isGptCodexFamily=Esc;Zi.isGpt5Family=_sc;Zi.isGptFamily=vsc;Zi.isGpt51Family=Csc;Zi.getVerbosityForModelSync=bsc;Zi.modelSupportsToolSearch=Ssc;Zi.modelSupportsContextEditing=Tsc;var _0=mxr(),Y5e=Sl(),aMi=Ap(),Woc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],cMi=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],rMi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],nMi=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],iMi=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],oMi=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],sMi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],zoc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],Yoc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],Koc=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],lMi="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",Joc=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],Zoc=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function Xoc(t,e){return e.getConfig(Y5e.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(Xoc,"getModelCapabilityOverride");function YG(t){return"id"in t?t.id:t.model}a(YG,"getModelId");function esc(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Woc.includes(e)}a(esc,"isHiddenModelA");function RRr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return cMi.includes(e)}a(RRr,"isHiddenModelB");function Pyt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return zoc.includes(e)}a(Pyt,"isHiddenModelE");function kyt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Yoc.includes(e)}a(kyt,"isHiddenModelF");function Dyt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Joc.includes(e)}a(Dyt,"isHiddenFamilyH");function tsc(t){return(0,_0.getCachedSha256Hash)(t.family)===lMi}a(tsc,"isHiddenModelK");function PRr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||Koc.includes(e)}a(PRr,"isGpt54");function kRr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||cMi.includes(e)}a(kRr,"isGpt55");function rsc(t,e){let r=t.get(Y5e.IConfigurationService),n=t.get(aMi.IExperimentationService);return kRr(e)&&r.getExperimentBasedConfig(Y5e.ConfigKey.EnableGpt55EconomicalSearchAndEdit,n)}a(rsc,"isGpt55EconomicalSearchAndEditExp");function nsc(t,e){let r=t.get(Y5e.IConfigurationService),n=t.get(aMi.IExperimentationService);return kRr(e)&&r.getExperimentBasedConfig(Y5e.ConfigKey.EnableGpt55LargePromptSections,n)}a(nsc,"isGpt55LargePromptSectionsExp");function K5e(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return Zoc.includes(e)}a(K5e,"isHiddenModelM");function DRr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(DRr,"isGpt53Codex");function Nyt(t){let e=(0,_0.getCachedSha256Hash)(YG(t)),r=(0,_0.getCachedSha256Hash)(t.family);return rMi.includes(e)||rMi.includes(r)}a(Nyt,"isVSCModelA");function Myt(t){let e=(0,_0.getCachedSha256Hash)(YG(t)),r=(0,_0.getCachedSha256Hash)(t.family);return nMi.includes(e)||nMi.includes(r)}a(Myt,"isVSCModelB");function J5e(t){let e=(0,_0.getCachedSha256Hash)(YG(t)),r=(0,_0.getCachedSha256Hash)(t.family);return sMi.includes(e)||sMi.includes(r)}a(J5e,"isVSCModelReplaceStringSet");function isc(t){let e=(0,_0.getCachedSha256Hash)(YG(t)),r=(0,_0.getCachedSha256Hash)(t.family);return iMi.includes(e)||iMi.includes(r)}a(isc,"isVSCModelC");function osc(t){let e=(0,_0.getCachedSha256Hash)(YG(t)),r=(0,_0.getCachedSha256Hash)(t.family);return oMi.includes(e)||oMi.includes(r)}a(osc,"isVSCModelD");function NRr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(NRr,"isGpt52CodexFamily");function MRr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(MRr,"isGpt52Family");function ssc(t){return t.includes("claude-3.5-sonnet")}a(ssc,"modelPrefersInstructionsInUserMessage");function asc(t){return t.includes("claude-3.5-sonnet")}a(asc,"modelPrefersInstructionsAfterHistory");function csc(t){return J5e(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||NRr(t.family)||DRr(t.family)||Nyt(t)||Myt(t)||MRr(t.family)||PRr(t)||RRr(t)||K5e(t)}a(csc,"modelSupportsApplyPatch");function lsc(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||NRr(t.family)||DRr(t.family)||MRr(t.family)||PRr(t)||RRr(t)||K5e(t)}a(lsc,"modelPrefersJsonNotebookRepresentation");function usc(t){return ORr(t)||t.family.includes("grok-code")||uMi(t)||kyt(t)||Oyt(t)||Dyt(t)}a(usc,"modelSupportsReplaceString");function uMi(t){return Z5e(t)||Pyt(t)||J5e(t)||Oyt(t)||Dyt(t)}a(uMi,"modelSupportsMultiReplaceString");function dsc(t){return Z5e(t)||t.family.includes("grok-code")||Pyt(t)||t.family.toLowerCase().includes("gemini-3")||J5e(t)||kyt(t)||Oyt(t)||Dyt(t)}a(dsc,"modelCanUseReplaceStringExclusively");function fsc(t){return t.family.includes("gemini-2")}a(fsc,"modelShouldUseReplaceStringHealing");function psc(t){return!Z5e(t)&&!Pyt(t)}a(psc,"modelCanUseMcpResultImageURL");function hsc(t){return!0}a(hsc,"modelCanUseImageURL");function msc(t){return Z5e(t)||Byt(t)||K5e(t)}a(msc,"modelSupportsPDFDocuments");function gsc(t){return J5e(t)?!1:Byt(t)||Nyt(t)||Myt(t)}a(gsc,"modelCanUseApplyPatchExclusively");function Asc(t){return ORr(t)||kyt(t)}a(Asc,"modelNeedsStrongReplaceStringHint");function ysc(t){return Byt(t)||Nyt(t)||Myt(t)}a(ysc,"modelSupportsSimplifiedApplyPatchInstructions");function Z5e(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(Z5e,"isAnthropicFamily");function ORr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,_0.getCachedSha256Hash)(e)===lMi}a(ORr,"isGeminiFamily");function Oyt(t){return t.family.toLowerCase().includes("minimax")}a(Oyt,"isMinimaxFamily");function Byt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(Byt,"isGpt5PlusFamily");function Esc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(Esc,"isGptCodexFamily");function _sc(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(_sc,"isGpt5Family");function vsc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(vsc,"isGptFamily");function Csc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(Csc,"isGpt51Family");function bsc(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(bsc,"getVerbosityForModelSync");function Ssc(t){let e=typeof t=="string"?t:YG(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"||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4-6")||!s.startsWith("claude-opus-4-1")&&s.startsWith("claude-opus-4-")},"matches");return n(e)||n(r)||K5e(r)}a(Ssc,"modelSupportsToolSearch");function Tsc(t){let e=typeof t=="string"?t:YG(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-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-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(Tsc,"modelSupportsContextEditing")});var Uyt=I(pR=>{"use strict";p();Object.defineProperty(pR,"__esModule",{value:!0});pR.CUSTOM_TOOL_SEARCH_NAME=void 0;pR.modelSupportsInterleavedThinking=xsc;pR.modelSupportsMemory=wsc;pR.isAnthropicContextEditingEnabled=Rsc;pR.modelSupportsExtendedCacheTtl=dMi;pR.isExtendedCacheTtlEnabled=Psc;pR.isExtendedCacheTtlMessagesEnabled=ksc;pR.buildContextManagement=fMi;pR.getContextManagementFromConfig=Dsc;var Fyt=Sl(),Lyt=X5e(),Isc=dR();pR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function xsc(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(xsc,"modelSupportsInterleavedThinking");function wsc(t){let e=typeof t=="string"?t:(0,Lyt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return 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-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(wsc,"modelSupportsMemory");function Rsc(t,e,r){return(typeof t=="string"?(0,Lyt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,Lyt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(Fyt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(Rsc,"isAnthropicContextEditingEnabled");function dMi(t){let e=typeof t=="string"?t:(0,Lyt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return 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(dMi,"modelSupportsExtendedCacheTtl");function Psc(t,e,r,n,o){return!dMi(t)||n!==Isc.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(Fyt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(Psc,"isExtendedCacheTtlEnabled");function ksc(t,e,r){return t?e.getExperimentBasedConfig(Fyt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(ksc,"isExtendedCacheTtlMessagesEnabled");function fMi(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(fMi,"buildContextManagement");function Dsc(t,e,r){let n=t.getExperimentBasedConfig(Fyt.ConfigKey.AnthropicContextEditingMode,e);return fMi(n,r)}a(Dsc,"getContextManagementFromConfig")});var BRr=I(Qyt=>{"use strict";p();Object.defineProperty(Qyt,"__esModule",{value:!0});Qyt.IToolDeferralService=void 0;var Nsc=rn();Qyt.IToolDeferralService=(0,Nsc.createServiceIdentifier)("IToolDeferralService")});var QRr=I(kE=>{"use strict";p();var Msc=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]})),Osc=kE&&kE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Bsc=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;oHyt(n,r),e)}a(Usc,"arrayHash");function Qsc(t,e){return e=P4(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=URr(n,r),Hyt(t[n],r)),e)}a(Qsc,"objectHash");var qsc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new jyt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof FRr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Rge)},"hashAsync");kE.hashAsync=qsc;function LRr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(LRr,"leftRotate");function Rge(t,e=32){return t instanceof ArrayBuffer?(0,FRr.encodeHex)(FRr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Rge,"toHexString");var jyt=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(qyt.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()),Rge(this._h0)+Rge(this._h1)+Rge(this._h2)+Rge(this._h3)+Rge(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,LRr(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=LRr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=LRr(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=jyt});var Pge=I(e4e=>{"use strict";p();Object.defineProperty(e4e,"__esModule",{value:!0});e4e.TelemetryData=void 0;e4e.eventPropertiesToSimpleObject=Hsc;var jsc=um(),qRr=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];Gsc(r,this.properties)}};e4e.TelemetryData=qRr;function Hsc(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(Hsc,"eventPropertiesToSimpleObject");function Gsc(t,e){e.unique_id=(0,jsc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(Gsc,"addRequiredProperties")});var pMi=I(jRr=>{"use strict";p();Object.defineProperty(jRr,"__esModule",{value:!0});jRr.extractThinkingDeltaFromChoice=Wsc;function $sc(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($sc,"getThinkingDeltaText");function Vsc(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(Vsc,"getThinkingDeltaId");function Wsc(t){let e=t.message||t.delta;if(!e)return;let r=Vsc(e),n=$sc(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(Wsc,"extractThinkingDeltaFromChoice")});var Vyt=I(_re=>{"use strict";p();Object.defineProperty(_re,"__esModule",{value:!0});_re.SSEProcessor=void 0;_re.splitChunk=mMi;_re.convertToAPIJsonData=Ksc;_re.sendCommunicationErrorTelemetry=kge;var Gyt=hp(),hMi=Pge(),zsc=pMi(),$yt=J8(),v0=Y8(),t4e=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}}},HRr=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}},GRr=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 HRr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function mMi(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!==""),r]}a(mMi,"splitChunk");var $Rr=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,$yt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new GRr,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,v0.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,v0.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]=mMi(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}`),kge(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&&Ysc(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}`),kge(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new t4e(h.model||""),reason:v0.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),kge(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,$yt.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,$yt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every($yt.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 t4e(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===v0.FinishedCompletionReason.FunctionCall||g.finish_reason===v0.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===v0.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===v0.FinishedCompletionReason.ToolCalls||g.finish_reason===v0.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??v0.FinishedCompletionReason.ClientTrimmed,filterReason:Jsc(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:v0.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}`),kge(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),kge(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"?v0.FinishedCompletionReason.FunctionCall:v0.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:v0.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)}`)}};_re.SSEProcessor=$Rr;function Ysc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(Ysc,"isCopilotConfirmation");function Ksc(t){return{text:t.text.join(""),tokens:t.text}}a(Ksc,"convertToAPIJsonData");function Jsc(t){if(t.finish_reason===v0.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return v0.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return v0.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return v0.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return v0.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return v0.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return v0.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(Jsc,"choiceToFilterReason");function kge(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=hMi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Gyt.LogLevel[Gyt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=hMi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Gyt.LogLevel[Gyt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(kge,"sendCommunicationErrorTelemetry")});var i4e=I(Dge=>{"use strict";p();Object.defineProperty(Dge,"__esModule",{value:!0});Dge.sendEngineMessagesLengthTelemetry=_Mi;Dge.sendEngineMessagesTelemetry=vMi;Dge.sendResponsesApiCompactionTelemetry=lac;Dge.prepareChatCompletionForReturn=uac;var Zsc=Io(),yMi=QRr(),zyt=gk(),EMi=um(),Xsc=z5e(),WRr=o0(),n4e=Pge(),eac=Y8(),tac=Vyt();function _Mi(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=n4e.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,WRr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,WRr.multiplexProperties)(d.properties),d.measurements)}a(_Mi,"sendEngineMessagesLengthTelemetry");var gMi=new zyt.LRUCache(1e3),AMi=new zyt.LRUCache(500),r4e=new zyt.LRUCache(1e3),Wyt={headerRequestId:null},VRr=new zyt.LRUCache(100);function rac(t){let e=r4e.get(t);if(e!==void 0){let r=e+1;return r4e.set(t,r),r}else return r4e.set(t,1),1}a(rac,"updateHeaderRequestIdTracker");function nac(t){let e=VRr.get(t);if(e!==void 0){let r=e+1;return VRr.set(t,r),r}else return VRr.set(t,1),1}a(nac,"updateConversationTracker");function iac(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,yMi.hash)(n).toString(),l=AMi.get(c);if(!l)l=(0,EMi.generateUuid)(),AMi.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(o4e,"__esModule",{value:!0});o4e.CompactionDataContainer=void 0;o4e.rawPartAsCompactionData=fac;var dac=Io(),CMi=E5e(),zRr=class extends dac.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:CMi.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};o4e.CompactionDataContainer=zRr;function fac(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===CMi.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(fac,"rawPartAsCompactionData")});var TMi=I(s4e=>{"use strict";p();Object.defineProperty(s4e,"__esModule",{value:!0});s4e.PhaseDataContainer=void 0;s4e.rawPartAsPhaseData=hac;var pac=Io(),SMi=E5e(),YRr=class extends pac.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:SMi.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};s4e.PhaseDataContainer=YRr;function hac(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===SMi.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(hac,"rawPartAsPhaseData")});var wMi=I(k4=>{"use strict";p();Object.defineProperty(k4,"__esModule",{value:!0});k4.StatefulMarkerContainer=void 0;k4.rawPartAsStatefulMarker=xMi;k4.encodeStatefulMarker=mac;k4.decodeStatefulMarker=gac;k4.getAllStatefulMarkersAndIndicies=ZRr;k4.getStatefulMarkerAndIndex=Aac;k4.getIndexOfStatefulMarker=yac;var KRr=Io(),IMi=E5e(),JRr=class extends KRr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:IMi.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};k4.StatefulMarkerContainer=JRr;function xMi(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===IMi.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(xMi,"rawPartAsStatefulMarker");function mac(t,e){return new TextEncoder().encode(t+"\\"+e)}a(mac,"encodeStatefulMarker");function gac(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(gac,"decodeStatefulMarker");function*ZRr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===KRr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===KRr.Raw.ChatCompletionContentPartKind.Opaque){let o=xMi(n);o&&(yield{statefulMarker:o,index:e})}}}}a(ZRr,"getAllStatefulMarkersAndIndicies");function Aac(t,e){for(let r of ZRr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Aac,"getStatefulMarkerAndIndex");function yac(t,e){for(let r of ZRr(e))if(r.statefulMarker.marker===t)return r.index}a(yac,"getIndexOfStatefulMarker")});var kMi=I(n6=>{"use strict";p();var Eac=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]})),_ac=n6&&n6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PMi=n6&&n6.__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 Tdc=TC&&TC.__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},Idc=TC&&TC.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TC,"__esModule",{value:!0});TC.OpenAIResponsesProcessor=void 0;TC.getResponsesApiCompactionThreshold=c5i;TC.createResponsesRequestBody=qdc;TC.getResponsesApiCompactionThresholdFromBody=jdc;TC.responseApiInputToRawMessagesForLogging=Jdc;TC.processResponseFromChatEndpoint=sfc;TC.sendCompletionOutputTelemetry=d5i;var eo=wo(),uPr=El(),xdc=Xc(),wdc=_G(),Rdc=_3(),kdc=Dkr(),G4=BS(),Pdc=um(),r5i=yR(),rAe=Il(),Ddc=pp(),E6=CEt(),Ndc=f6(),If=u6(),Mdc=Qkr(),aPr=P4e(),Odc=_6(),Bdc=gp(),Ldc=I4e(),dPr=WOi(),Fdc=YOi(),n5i=ZOi(),Udc=jwr(),Qdc=t5i();function c5i(t,e,r){if(t.getExperimentBasedConfig(rAe.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!If.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(c5i,"getResponsesApiCompactionThreshold");function qdc(t,e,r,n){let o=t.get(rAe.IConfigurationService),s=t.get(Bdc.IExperimentationService),c=(0,Ldc.getVerbosityForModelSync)(n),l=c5i(o,s,n),u=Hdc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(B=>B.function.name===E6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===r5i.ChatLocation.Agent||e.location===r5i.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(Mdc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let B of e.requestOptions.tools)!B.function.name||B.function.name.length===0||B.function.name===E6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(B.function.name)||E.push({...B.function,type:"function",strict:!1,parameters:B.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(B=>[B.function.name,B])):void 0,b=A?B=>!y.isNonDeferredTool(B):void 0,T={model:r,...Gdc(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:If.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(rAe.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(rAe.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,k=o.getConfig(rAe.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?k||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R;return(D||N)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(rAe.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(qdc,"createResponsesRequestBody");function jdc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===If.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(jdc,"getResponsesApiCompactionThresholdFromBody");function Hdc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(Odc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(Hdc,"resolveWebSocketStatefulMarker");function Gdc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=Vdc(e),d=u!==void 0?$dc(e[u]):void 0,f,h;if(n)h=(0,n5i.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,n5i.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===eo.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===E6.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===eo.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===eo.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of i5i(_,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 eo.Raw.ChatRole.Assistant:if(E.content.length){y.push(...Kdc(E.content)),y.push(...zdc(E.content));let _=E.content.map(Wdc).filter(G4.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:Ydc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===E6.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 eo.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===eo.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?i5i(_,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===eo.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===eo.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===eo.Raw.ChatCompletionContentPartKind.Document).map(l5i).filter(G4.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 eo.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(o5i).filter(G4.isDefined)});break;case eo.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(o5i).filter(G4.isDefined)});break}return{input:y,previous_response_id:f}}a(Gdc,"rawMessagesToResponseAPI");function i5i(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==E6.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(i5i,"buildToolSearchOutputTools");function $dc(t){if(t.role!==eo.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===eo.Raw.ChatCompletionContentPartKind.Opaque&&(0,dPr.rawPartAsCompactionData)(r));if(e.length)return{role:eo.Raw.ChatRole.Assistant,content:e}}a($dc,"createCompactionRoundTripMessage");function Vdc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===eo.Raw.ChatCompletionContentPartKind.Opaque&&(0,dPr.rawPartAsCompactionData)(n))return e}}a(Vdc,"getLatestCompactionMessageIndex");function l5i(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(l5i,"rawDocumentToResponsesInputFile");function o5i(t){switch(t.type){case eo.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case eo.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case eo.Raw.ChatCompletionContentPartKind.Document:return l5i(t);case eo.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(o5i,"rawContentToResponsesContent");function Wdc(t){switch(t.type){case eo.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(Wdc,"rawContentToResponsesAssistantContent");function zdc(t){return(0,uPr.coalesce)(t.map(e=>{if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Udc.rawPartAsThinkingData)(e);if(r)return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(zdc,"extractThinkingData");function Ydc(t){for(let e of t)if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Fdc.rawPartAsPhaseData)(e);if(r)return r}}a(Ydc,"extractPhaseData");function Kdc(t){return(0,uPr.coalesce)(t.map(e=>{if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,dPr.rawPartAsCompactionData)(e);if(r)return{type:If.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(Kdc,"extractCompactionData");function Jdc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:eo.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:eo.Raw.ChatRole.System,content:[{type:eo.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:eo.Raw.ChatRole.User,content:sPr(s.content).map(PEt).filter(G4.isDefined)});break;case"system":case"developer":n(),e.push({role:eo.Raw.ChatRole.System,content:sPr(s.content).map(PEt).filter(G4.isDefined)});break;case"assistant":n(),Zdc(s)?e.push({role:eo.Raw.ChatRole.Assistant,content:s.content.map(efc).filter(G4.isDefined)}):Xdc(s)&&e.push({role:eo.Raw.ChatRole.Assistant,content:sPr(s.content).map(PEt).filter(G4.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=tfc(s.output);e.push({role:eo.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:eo.Raw.ChatRole.Assistant,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` +`),e.info(`[responsesAPI] Dumping SSE stream to ${s}`),new tPr(s)}catch{return RMi}}a(Cac,"createResponsesStreamDumper")});var Jyt=I(vv=>{"use strict";p();var bac=vv&&vv.__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},Sac=vv&&vv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vv,"__esModule",{value:!0});vv.OpenAIResponsesProcessor=void 0;vv.getResponsesApiCompactionThreshold=FMi;vv.createResponsesRequestBody=Uac;vv.getResponsesApiCompactionThresholdFromBody=Qac;vv.responseApiInputToRawMessagesForLogging=Yac;vv.processResponseFromChatEndpoint=icc;vv.sendCompletionOutputTelemetry=qMi;var Xi=Io(),sPr=Al(),Tac=Jc(),Iac=rG(),xac=s3(),wac=wRr(),D4=RS(),Rac=um(),DMi=dR(),Nge=Sl(),Pac=hp(),i6=Uyt(),kac=J8(),If=Y8(),Dac=BRr(),nPr=i4e(),Nac=o6(),Mac=Ap(),Oac=X5e(),aPr=bMi(),Bac=TMi(),NMi=wMi(),Lac=Fxr(),Fac=kMi();function FMi(t,e,r){if(t.getExperimentBasedConfig(Nge.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!If.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(FMi,"getResponsesApiCompactionThreshold");function Uac(t,e,r,n){let o=t.get(Nge.IConfigurationService),s=t.get(Mac.IExperimentationService),c=(0,Oac.getVerbosityForModelSync)(n),l=FMi(o,s,n),u=qac(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(B=>B.function.name===i6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===DMi.ChatLocation.Agent||e.location===DMi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(Dac.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let B of e.requestOptions.tools)!B.function.name||B.function.name.length===0||B.function.name===i6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(B.function.name)||E.push({...B.function,type:"function",strict:!1,parameters:B.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(B=>[B.function.name,B])):void 0,b=A?B=>!y.isNonDeferredTool(B):void 0,T={model:r,...jac(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:If.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(Nge.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(Nge.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(Nge.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R;return(D||N)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(Nge.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(Uac,"createResponsesRequestBody");function Qac(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===If.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(Qac,"getResponsesApiCompactionThresholdFromBody");function qac(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(Nac.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(qac,"resolveWebSocketStatefulMarker");function jac(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=Gac(e),d=u!==void 0?Hac(e[u]):void 0,f,h;if(n)h=(0,NMi.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,NMi.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===i6.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 MMi(_,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(...zac(E.content)),y.push(...Vac(E.content));let _=E.content.map($ac).filter(D4.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:Wac(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===i6.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?MMi(_,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(UMi).filter(D4.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(OMi).filter(D4.isDefined)});break;case Xi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(OMi).filter(D4.isDefined)});break}return{input:y,previous_response_id:f}}a(jac,"rawMessagesToResponseAPI");function MMi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==i6.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(MMi,"buildToolSearchOutputTools");function Hac(t){if(t.role!==Xi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,aPr.rawPartAsCompactionData)(r));if(e.length)return{role:Xi.Raw.ChatRole.Assistant,content:e}}a(Hac,"createCompactionRoundTripMessage");function Gac(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,aPr.rawPartAsCompactionData)(n))return e}}a(Gac,"getLatestCompactionMessageIndex");function UMi(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(UMi,"rawDocumentToResponsesInputFile");function OMi(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 UMi(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(OMi,"rawContentToResponsesContent");function $ac(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a($ac,"rawContentToResponsesAssistantContent");function Vac(t){return(0,sPr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Lac.rawPartAsThinkingData)(e);if(r)return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(Vac,"extractThinkingData");function Wac(t){for(let e of t)if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Bac.rawPartAsPhaseData)(e);if(r)return r}}a(Wac,"extractPhaseData");function zac(t){return(0,sPr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,aPr.rawPartAsCompactionData)(e);if(r)return{type:If.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(zac,"extractCompactionData");function Yac(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:rPr(s.content).map(Yyt).filter(D4.isDefined)});break;case"system":case"developer":n(),e.push({role:Xi.Raw.ChatRole.System,content:rPr(s.content).map(Yyt).filter(D4.isDefined)});break;case"assistant":n(),Kac(s)?e.push({role:Xi.Raw.ChatRole.Assistant,content:s.content.map(Zac).filter(D4.isDefined)}):Jac(s)&&e.push({role:Xi.Raw.ChatRole.Assistant,content:rPr(s.content).map(Yyt).filter(D4.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=Xac(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(` -`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:E6.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:eo.Raw.ChatRole.Tool,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:eo.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(Jdc,"responseApiInputToRawMessagesForLogging");function Zdc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(Zdc,"isResponseOutputMessage");function Xdc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(Xdc,"isResponseInputItemMessage");function sPr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(sPr,"ensureContentArray");function PEt(t){switch(t.type){case"input_text":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:eo.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(PEt,"responseContentToRawContent");function efc(t){switch(t.type){case"output_text":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(efc,"responseOutputToRawContent");function tfc(t){return typeof t=="string"?[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,uPr.coalesce)(t.map(PEt))}a(tfc,"responseFunctionOutputToRawContents");function cPr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===If.openAIContextManagementCompactionType}a(cPr,"isCompactionItem");function rfc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(rfc,"hasOutputItem");function nfc(t){return"response"in t&&Array.isArray(t.response.output)}a(nfc,"hasResponseOutput");function ifc(t){return t.output_index}a(ifc,"getOutputItemIndex");function lPr(t){return cPr(t)}a(lPr,"isCompactionOutputItem");function u5i(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(lPr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&lPr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(u5i,"getLatestCompactionOutput");function ofc(t,e){let r=u5i(t,e);return r?t.filter((n,o)=>!lPr(n)||o===r.outputIndex):t}a(ofc,"keepLatestCompactionOutput");async function sfc(t,e,r,n,o,s,c,l){return new xdc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Pdc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,Ndc.getRequestId)(n.headers),m=t.createInstance(DEt,c,e,d,f,h,l),g=(0,Qdc.createResponsesStreamDumper)(d,r),A=new kdc.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&&(d5i(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(sfc,"processResponseFromChatEndpoint");function d5i(t,e,r,n){let o=(0,If.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,aPr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(d5i,"sendCompletionOutputTelemetry");function afc(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 If.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return If.FilterReason.SelfHarm;if(o.includes("sexual"))return If.FilterReason.Sexual;if(o.includes("violence"))return If.FilterReason.Violence;if(o.includes("hate"))return If.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return If.FilterReason.Hate;if(s.self_harm?.filtered)return If.FilterReason.SelfHarm;if(s.sexual?.filtered)return If.FilterReason.Sexual;if(s.violence?.filtered)return If.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return If.FilterReason.Copyright;if(r.source_type==="prompt")return If.FilterReason.Prompt}a(afc,"extractFilterReasonFromContentFilters");function s5i(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(s5i,"mapResponsesApiError");var DEt=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(rfc(e)&&cPr(e.item)){let n=ifc(e);r.push({item:e.item,outputIndex:n})}if(nfc(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:i6.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(Yac,"responseApiInputToRawMessagesForLogging");function Kac(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(Kac,"isResponseOutputMessage");function Jac(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(Jac,"isResponseInputItemMessage");function rPr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(rPr,"ensureContentArray");function Yyt(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(Yyt,"responseContentToRawContent");function Zac(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(Zac,"responseOutputToRawContent");function Xac(t){return typeof t=="string"?[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,sPr.coalesce)(t.map(Yyt))}a(Xac,"responseFunctionOutputToRawContents");function iPr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===If.openAIContextManagementCompactionType}a(iPr,"isCompactionItem");function ecc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(ecc,"hasOutputItem");function tcc(t){return"response"in t&&Array.isArray(t.response.output)}a(tcc,"hasResponseOutput");function rcc(t){return t.output_index}a(rcc,"getOutputItemIndex");function oPr(t){return iPr(t)}a(oPr,"isCompactionOutputItem");function QMi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(oPr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&oPr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(QMi,"getLatestCompactionOutput");function ncc(t,e){let r=QMi(t,e);return r?t.filter((n,o)=>!oPr(n)||o===r.outputIndex):t}a(ncc,"keepLatestCompactionOutput");async function icc(t,e,r,n,o,s,c,l){return new Tac.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Rac.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,kac.getRequestId)(n.headers),m=t.createInstance(Kyt,c,e,d,f,h,l),g=(0,Fac.createResponsesStreamDumper)(d,r),A=new wac.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&&(qMi(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(icc,"processResponseFromChatEndpoint");function qMi(t,e,r,n){let o=(0,If.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,nPr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(qMi,"sendCompletionOutputTelemetry");function occ(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 If.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return If.FilterReason.SelfHarm;if(o.includes("sexual"))return If.FilterReason.Sexual;if(o.includes("violence"))return If.FilterReason.Violence;if(o.includes("hate"))return If.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return If.FilterReason.Hate;if(s.self_harm?.filtered)return If.FilterReason.SelfHarm;if(s.sexual?.filtered)return If.FilterReason.Sexual;if(s.violence?.filtered)return If.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return If.FilterReason.Copyright;if(r.source_type==="prompt")return If.FilterReason.Prompt}a(occ,"extractFilterReasonFromContentFilters");function BMi(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(BMi,"mapResponsesApiError");var Kyt=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(ecc(e)&&iPr(e.item)){let n=rcc(e);r.push({item:e.item,outputIndex:n})}if(tcc(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 Rdc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...a5i(c,l),top_logprobs:l.top_logprobs?.map(u=>a5i(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:E6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:E6.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:E6.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=ofc(s.response.output,this.latestCompactionOutputIndex),l=u5i(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,aPr.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,aPr.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:If.FinishedCompletionReason.Stop,message:{role:eo.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:eo.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:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(G4.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=If.FinishedCompletionReason.Length:c==="content_filter"?(l=If.FinishedCompletionReason.ContentFilter,u=afc(s.content_filters)):l=If.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:s5i(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,If.FinishedCompletionReason.ServerError,{error:s5i(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:eo.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:eo.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:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(G4.isDefined)}}}};TC.OpenAIResponsesProcessor=DEt;TC.OpenAIResponsesProcessor=DEt=Tdc([Idc(6,Ddc.ILogService)],DEt);function a5i(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,wdc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(a5i,"mapLogProp")});var f5i=I(MEt=>{"use strict";p();Object.defineProperty(MEt,"__esModule",{value:!0});MEt.ChatWebSocketTelemetrySender=void 0;var fPr=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})}};MEt.ChatWebSocketTelemetrySender=fPr});var _6=I(s1=>{"use strict";p();var cfc=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},OEt=s1&&s1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(s1,"__esModule",{value:!0});s1.ChatWebSocketManager=s1.NullChatWebSocketManager=s1.IChatWebSocketManager=void 0;s1.isCAPIWebSocketError=APr;var lfc=rn(),ufc=Ts(),BEt=Sc(),p5i=ko(),h5i=Il(),dfc=PE(),nAe=pp(),ffc=o0(),pfc=ey(),hfc=NEt(),h$=f5i();s1.IChatWebSocketManager=(0,lfc.createServiceIdentifier)("IChatWebSocketManager");var pPr=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(){}};s1.NullChatWebSocketManager=pPr;function APr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(APr,"isCAPIWebSocketError");var mfc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function gfc(t){return mfc[t.type]}a(gfc,"getStreamTerminatingOutcome");var hPr=class extends p5i.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 mPr(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()}};s1.ChatWebSocketManager=hPr;s1.ChatWebSocketManager=hPr=cfc([OEt(0,nAe.ILogService),OEt(1,dfc.ICAPIClientService),OEt(2,ffc.ITelemetryService),OEt(3,h5i.IConfigurationService)],hPr);function LEt(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(LEt,"wsCloseCodeToString");var mPr=class extends p5i.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 BEt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new pfc.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}`),h$.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,nAe.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,nAe.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})`:""}`),h$.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=LEt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),h$.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,nAe.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),h$.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}!APr(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=LEt(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})`),h$.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,nAe.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}`),h$.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,hfc.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 gPr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:q,closeReason:F,serverErrorMessage:U,serverErrorCode:W})=>{this._activeRequest===x&&(this._activeRequest=void 0);let V=Date.now()-(this._connectedTime??Date.now()),G=Date.now()-E,Y=this._totalSentMessageCount-_,re=this._totalReceivedMessageCount-v,j=this._totalSentCharacters-b,X=this._totalReceivedCharacters-T;h$.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:V,requestDurationMs:G,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:Y,requestReceivedMessageCount:re,requestSentCharacters:j,requestReceivedCharacters:X,closeCode:q,closeReason:F,serverErrorMessage:U,serverErrorCode:W})}),this._activeRequest=x;let k=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>k.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})`),h$.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()}},gPr=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 BEt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new BEt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new BEt.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(h5i.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,nAe.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),APr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=gfc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${LEt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${LEt(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 ufc.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 EPr=I($4=>{"use strict";p();Object.defineProperty($4,"__esModule",{value:!0});$4.getImageDimensions=Afc;$4.getImageDimensionsFromBytes=yfc;$4.getPngDimensions=m5i;$4.getGifDimensions=g5i;$4.getJpegDimensions=A5i;$4.getWebPDimensions=C5i;$4.getMimeType=S5i;$4.extractImageAttributes=Cfc;function Afc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(S5i(e)){case"image/png":return m5i(e);case"image/gif":return g5i(e);case"image/jpeg":case"image/jpg":return A5i(e);case"image/webp":return C5i(e);default:throw new Error("Unsupported image format")}}a(Afc,"getImageDimensions");function yfc(t,e){switch(Efc(e)){case"image/png":return y5i(t);case"image/gif":return E5i(t);case"image/jpeg":case"image/jpg":return _5i(t);case"image/webp":return v5i(t);default:throw new Error("Unsupported image format")}}a(yfc,"getImageDimensionsFromBytes");function m5i(t){return y5i(FEt(t.slice(0,50)))}a(m5i,"getPngDimensions");function g5i(t){return E5i(FEt(t.slice(0,50)))}a(g5i,"getGifDimensions");function A5i(t){return _5i(FEt(t))}a(A5i,"getJpegDimensions");function y5i(t){if(!b5i(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(y5i,"getPngDimensionsFromBytes");function E5i(t){if(!yPr(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(E5i,"getGifDimensionsFromBytes");function _5i(t){if(!b5i(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(_5i,"getJpegDimensionsFromBytes");function C5i(t){return v5i(FEt(t))}a(C5i,"getWebPDimensions");function v5i(t){if(!yPr(t,0,"RIFF")||!yPr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=_fc(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(v5i,"getWebPDimensionsFromBytes");function Efc(t){return t?.toLowerCase().split(";")[0].trim()}a(Efc,"normalizeMimeType");function FEt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(FEt,"base64ToBytes");function b5i(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(UEt,"__esModule",{value:!0});UEt.TokenizerType=void 0;var T5i;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(T5i||(UEt.TokenizerType=T5i={}))});var CPr=I(Fre=>{"use strict";p();Object.defineProperty(Fre,"__esModule",{value:!0});Fre.WorkerWithRpcProxy=Fre.RcpResponseHandler=void 0;Fre.createRpcProxy=I5i;var vfc=require("worker_threads"),QEt=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()}};Fre.RcpResponseHandler=QEt;function I5i(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(I5i,"createRpcProxy");var _Pr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new QEt,this.worker=new vfc.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=I5i((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)}};Fre.WorkerWithRpcProxy=_Pr});var x5i=I(CR=>{"use strict";p();Object.defineProperty(CR,"__esModule",{value:!0});CR.SlidingWindowAverage=CR.MovingAverage=CR.Counter=void 0;CR.clamp=Sfc;CR.rot=Tfc;CR.isPointWithinTriangle=Ifc;CR.randomChance=xfc;var bfc=Yu();function Sfc(t,e,r){return Math.min(Math.max(t,e),r)}a(Sfc,"clamp");function Tfc(t,e){return(e+t%e)%e}a(Tfc,"rot");var vPr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};CR.Counter=vPr;var bPr=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}};CR.MovingAverage=bPr;var SPr=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(Ifc,"isPointWithinTriangle");function xfc(t){return(0,bfc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(jEt,"__esModule",{value:!0});jEt.TikTokenImpl=void 0;var TPr=oGe(),qEt=x5i(),wfc=cO(),Rfc=Yvr(),IPr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new qEt.MovingAverage,textLength:new qEt.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?Rfc.parseTikTokenBinary:c=>c;return this._values.push((0,TPr.createTokenizer)(s(e),(0,TPr.getSpecialTokensByEncoder)(r),(0,TPr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=wfc.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 qEt.MovingAverage,this._stats.textLength=new qEt.MovingAverage,this._stats.callCount=0,r}};jEt.TikTokenImpl=IPr});var Ure=I(yp=>{"use strict";p();var P5i=yp&&yp.__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},D5i=yp&&yp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(yp,"__esModule",{value:!0});yp.TokenizerProvider=yp.BaseTokensPerName=yp.BaseTokensPerMessage=yp.BaseTokensPerCompletion=yp.ITokenizerProvider=void 0;yp.calculateImageTokenCost=kPr;yp.estimateDocumentTokenCost=M5i;var m$=wo(),kfc=rkr(),Pfc=EPr(),Dfc=rn(),R5i=iAe(),Nfc=CPr(),Mfc=Yu(),k5i=_3(),xPr=ko(),HEt=hA(),N5i=o0(),wPr=w5i();yp.ITokenizerProvider=(0,Dfc.createServiceIdentifier)("ITokenizerProvider");yp.BaseTokensPerCompletion=3;yp.BaseTokensPerMessage=3;yp.BaseTokensPerName=1;var RPr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new k5i.Lazy(()=>new GEt(e,(0,HEt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new k5i.Lazy(()=>new GEt(e,(0,HEt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case R5i.TokenizerType.CL100K:return this._cl100kTokenizer.value;case R5i.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};yp.TokenizerProvider=RPr;yp.TokenizerProvider=RPr=P5i([D5i(1,N5i.ITelemetryService)],RPr);var GEt=class extends xPr.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 kfc.LRUCache(5e3),this.baseTokensPerMessage=yp.BaseTokensPerMessage,this.baseTokensPerName=yp.BaseTokensPerName,this.mode=m$.OutputMode.Raw}async countMessagesTokens(e){let r=yp.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 m$.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case m$.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case m$.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return kPr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case m$.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case m$.Raw.ChatCompletionContentPartKind.Document:return M5i(e.documentData.data);default:(0,Mfc.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,m$.toMode)(m$.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+=kPr(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,HEt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,HEt.join)(__dirname,"tikTokenizerWorker.js"),n=new Nfc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,xPr.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=wPr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,xPr.toDisposable)(()=>{wPr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>wPr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};GEt=P5i([D5i(3,N5i.ITelemetryService)],GEt);function kPr(t,e){let{width:r,height:n}=(0,Pfc.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(kPr,"calculateImageTokenCost");function M5i(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(M5i,"estimateDocumentTokenCost")});var g$=I(oAe=>{"use strict";p();Object.defineProperty(oAe,"__esModule",{value:!0});oAe.IDomainService=oAe.FEEDBACK_URL=void 0;var Ofc=rn();oAe.FEEDBACK_URL="https://aka.ms/microsoft/vscode-copilot-release";oAe.IDomainService=(0,Ofc.createServiceIdentifier)("IDomainService")});var $Et=I(HT=>{"use strict";p();Object.defineProperty(HT,"__esModule",{value:!0});HT.HeaderContributors=HT.IHeaderContributors=HT.userAgentLibraryHeader=void 0;HT.stringifyUrlOrRequestMetadata=Gfc;HT.createCapiRequestBody=$fc;HT.canRetryOnceNetworkError=B5i;HT.postRequest=Vfc;HT.getRequest=Wfc;var Bfc=rn(),Lfc=iAe(),Ffc=Ts(),Ufc=PE(),Qfc=o0(),qfc=ey(),jfc=u6();HT.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var Hfc=30*1e3;function Gfc(t){return typeof t=="string"?t:JSON.stringify(t)}a(Gfc,"stringifyUrlOrRequestMetadata");function $fc(t,e,r){let n={messages:(0,jfc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a($fc,"createCapiRequestBody");function O5i(t,e){let r=t.get(qfc.IFetcherService),n=t.get(Qfc.ITelemetryService),o=t.get(Ufc.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:Lfc.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:Hfc,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 typeof E.urlOrRequestMetadata=="string"?r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&B5i(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new Ffc.CancellationError:R}):o.makeRequest(T,E.urlOrRequestMetadata)}a(O5i,"networkRequest");function B5i(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(B5i,"canRetryOnceNetworkError");function Vfc(t,e){return O5i(t,{...e,requestType:"POST"})}a(Vfc,"postRequest");function Wfc(t,e){return O5i(t,{...e,requestType:"GET"})}a(Wfc,"getRequest");HT.IHeaderContributors=(0,Bfc.createServiceIdentifier)("headerContributors");var PPr=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}};HT.HeaderContributors=PPr});var Q5i=I(GT=>{"use strict";p();var zfc=GT&>.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yfc=GT&>.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Kfc=GT&>.__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;or.charAt(0).toUpperCase()+r.slice(1)),enumDescriptions:t.map(r=>{switch(r){case"none":return Ep.t("No reasoning applied");case"minimal":return Ep.t("Minimal reasoning for fastest responses");case"low":return Ep.t("Faster responses with less reasoning");case"medium":return Ep.t("Balanced reasoning and speed");case"high":return Ep.t("Greater reasoning depth but slower");case"xhigh":return Ep.t("Highest reasoning depth but slowest");case"max":return Ep.t("Absolute maximum capability with no constraints");default:return r}}),default:U5i(t,e),group:"navigation"}}a(Jfc,"buildReasoningEffortSchemaProperty");function Zfc(t){let e=t.name.toLowerCase(),r=t.family.toLowerCase();if(r.includes("claude")||e.includes("claude")){if(e.includes("opus"))return Ep.t("Most capable Claude model. Excellent for complex analysis, coding tasks, and nuanced creative writing.");if(e.includes("sonnet"))return Ep.t("Balanced Claude model offering strong performance for everyday coding and chat tasks at faster speeds.");if(e.includes("haiku"))return Ep.t("Fastest and most compact Claude model. Ideal for quick responses and simple tasks.")}if(r.includes("gpt")||e.includes("gpt")||r.includes("codex")||e.includes("codex"))return e.includes("codex")||r.includes("codex")?Ep.t("OpenAI Codex model specialized for code generation, debugging, and software development tasks."):e.includes("mini")?Ep.t("Lightweight GPT model for quick responses and simple tasks with low latency."):e.includes("copilot")?Ep.t("GPT model fine-tuned for Copilot code completions."):e.includes("4o")?Ep.t("Optimized GPT-4 model with faster responses and multimodal capabilities."):e.includes("4.1")?Ep.t("Enhanced GPT-4 model with improved instruction following and coding performance."):Ep.t("OpenAI GPT model for coding and general assistance.");if(r.includes("gemini")||e.includes("gemini"))return e.includes("flash")?Ep.t("Fast and efficient Gemini model optimized for quick responses and high throughput."):e.includes("pro")?Ep.t("Google's advanced Gemini Pro model with strong reasoning and coding capabilities."):Ep.t("Google Gemini model with balanced performance for coding and general assistance.");if(r.includes("grok")||e.includes("grok"))return Ep.t("xAI Grok model optimized for fast code generation and development tasks.")}a(Zfc,"getModelCapabilitiesDescription");function L5i(t){return t<.01?t.toExponential(2):t.toFixed(4).replace(/\.?0+$/,"")}a(L5i,"formatAicPrice");function Xfc(t){return Ep.t("In: {0} \xB7 Out: {1} AICs/1M tokens",L5i(t.default.inputPrice),L5i(t.default.outputPrice))}a(Xfc,"formatPricingLabel");var F5i=1e6,DPr=1e9;function epc(t){if(!t)return;let e=t.batch_size??F5i,r=F5i/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,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,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice)&&(s=l)}return{default:o,longContext:s}}if(!(t.input_price===void 0||t.output_price===void 0))return{default:{inputPrice:t.input_price/DPr*r,outputPrice:t.output_price/DPr*r,cachePrice:t.cache_price!==void 0?t.cache_price/DPr*r:void 0}}}a(epc,"normalizeTokenPrices")});var t4i=I(ny=>{"use strict";p();var tpc=ny&&ny.__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},q5i=ny&&ny.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ny,"__esModule",{value:!0});ny.AnthropicMessagesProcessor=void 0;ny.buildToolInputSchema=z5i;ny.createMessagesRequestBody=spc;ny.rawMessagesToMessagesAPI=Y5i;ny.clearAllCacheControl=K5i;ny.addToolsAndSystemCacheControl=J5i;ny.addMessagesApiCacheControl=Z5i;ny.processResponseFromMessagesEndpoint=lpc;ny.processNonStreamingResponseFromMessagesEndpoint=e4i;var MD=wo(),H5i=Xc(),rpc=Dkr(),NPr=um(),npc=yR(),j5i=Il(),G5i=pp(),sAe=CEt(),$5i=f6(),M4e=u6(),ipc=Qkr(),V5i=P4e(),opc=gp(),W5i=o0();function z5i(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(z5i,"buildToolInputSchema");function spc(t,e,r,n){let o=t.get(j5i.IConfigurationService),s=t.get(opc.IExperimentationService),c=t.get(ipc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===sAe.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:z5i(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?new Set(f.map(N=>N.name)):void 0,b=Y5i(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,sAe.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,k=(0,sAe.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;K5i(b),Z5i(b,k),J5i(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:npc.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(spc,"createMessagesRequestBody");function Y5i(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case MD.Raw.ChatRole.System:{n.push(...VEt(c.content).filter(l=>l.type==="text"));break}case MD.Raw.ChatRole.User:{let l=VEt(c.content);l.length>0&&r.push({role:"user",content:l});break}case MD.Raw.ChatRole.Assistant:{let l=VEt(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 MD.Raw.ChatRole.Tool:{if(c.toolCallId){let l=VEt(c.content),u=!1;for(let g of l)O4e(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===sAe.CUSTOM_TOOL_SEARCH_NAME?apc(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(Y5i,"rawMessagesToMessagesAPI");function apc(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(apc,"tryParseToolReferences");function VEt(t){let e=[],r=!1;for(let n of t){switch(n.type){case MD.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case MD.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 MD.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&O4e(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case MD.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 MD.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;s&&o.thinking.encrypted?e.push({type:"thinking",thinking:s,signature:o.thinking.encrypted}):o.thinking.encrypted&&!s&&e.push({type:"redacted_thinking",data:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);O4e(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(VEt,"rawContentToAnthropicContent");function O4e(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(O4e,"contentBlockSupportsCacheControl");function K5i(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(K5i,"clearAllCacheControl");function J5i(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(J5i,"addToolsAndSystemCacheControl");function Z5i(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"&&O4e(c))&&(cpc(s,e),n++)}}a(Z5i,"addMessagesApiCacheControl");function cpc(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"&&O4e(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(cpc,"markLastCacheableBlock");async function lpc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new H5i.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,NPr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,$5i.getRequestId)(n.headers),h=t.createInstance(WEt,s,u,d,f),m=new rpc.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,M4e.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,V5i.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()}):e4i(e,r,n,o,s)}a(lpc,"processResponseFromMessagesEndpoint");function upc(t){switch(t){case"refusal":return M4e.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return M4e.FinishedCompletionReason.Length;default:return M4e.FinishedCompletionReason.Stop}}a(upc,"mapStopReason");function X5i(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(X5i,"buildAnthropicCompletion");async function e4i(t,e,r,n,o){return new H5i.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,$5i.getRequestId)(r.headers),u=c||(0,NPr.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=X5i({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,M4e.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,V5i.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(e4i,"processNonStreamingResponseFromMessagesEndpoint");var WEt=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,NPr.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}})}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 X5i({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}]})}}}};ny.AnthropicMessagesProcessor=WEt;ny.AnthropicMessagesProcessor=WEt=tpc([q5i(4,G5i.ILogService),q5i(5,W5i.ITelemetryService)],WEt)});var r4i=I(C6=>{"use strict";p();var dpc=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]})),fpc=C6&&C6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ppc=C6&&C6.__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===Qre.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(hpc.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===Qre.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===Qre.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==Qre.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:Qre.Raw.ChatCompletionContentPartKind.Text,text:mpc})})}a(gpc,"filterHistoryImages")});var qre=I(a1=>{"use strict";p();var a4i=a1&&a1.__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},v0=a1&&a1.__param||function(t,e){return function(r,n){e(r,n,t)}},BPr;Object.defineProperty(a1,"__esModule",{value:!0});a1.RemoteAgentChatEndpoint=a1.ChatEndpoint=void 0;a1.defaultChatResponseProcessor=FPr;a1.defaultNonStreamChatResponseProcessor=g4i;var MPr=(bre(),Ca(vre)),n4i=wo(),c4i=Xc(),i4i=MJe(),Apc=um(),l4i=Qs(),ypc=SE(),u4i=A6(),Epc=yR(),_pc=C4e(),aAe=Il(),d4i=pp(),o4i=CEt(),Cpc=f6(),vpc=ey(),bpc=$Et(),Spc=P4e(),f4i=_6(),Tpc=wEt(),p4i=gp(),Ipc=o0(),h4i=Ure(),xpc=PE(),B4e=I4e(),m4i=g$(),L4e=IOe(),wpc=Q5i(),s4i=t4i(),OPr=NEt(),Rpc=r4i();async function FPr(t,e,r,n,o,s,c){let u=(await Tpc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return c4i.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,Spc.prepareChatCompletionForReturn)(t,e,f,s)})}a(FPr,"defaultChatResponseProcessor");async function g4i(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,_pc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Apc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Cpc.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 c4i.AsyncIterableObject.fromArray(s)}a(g4i,"defaultNonStreamChatResponseProcessor");var zEt=BPr=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,B4e.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer,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,wpc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice??0,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice??0,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_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,B4e.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,B4e.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(aAe.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,o4i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,o4i.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:MPr.RequestType.ChatResponses}:this.useMessagesApi?{type:MPr.RequestType.ChatMessages}:{type:MPr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(L4e.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(L4e.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(L4e.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(L4e.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(aAe.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(L4e.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===n4i.OpenAI.ChatRole.System?{role:n4i.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(OPr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(s4i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,bpc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,B4e.isAnthropicFamily)(this))return 20;if((0,B4e.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,Rpc.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(aAe.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,OPr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,OPr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,s4i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?FPr(e,r,n,o,s,c,l):g4i(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(aAe.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===Epc.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(BPr,(0,i4i.mixin)((0,i4i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};a1.ChatEndpoint=zEt;a1.ChatEndpoint=zEt=BPr=a4i([v0(1,m4i.IDomainService),v0(2,u4i.IChatMLFetcher),v0(3,h4i.ITokenizerProvider),v0(4,l4i.IInstantiationService),v0(5,aAe.IConfigurationService),v0(6,p4i.IExperimentationService),v0(7,f4i.IChatWebSocketManager),v0(8,d4i.ILogService)],zEt);var LPr=class extends zEt{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 FPr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};a1.RemoteAgentChatEndpoint=LPr;a1.RemoteAgentChatEndpoint=LPr=a4i([v0(2,m4i.IDomainService),v0(3,xpc.ICAPIClientService),v0(4,vpc.IFetcherService),v0(5,Ipc.ITelemetryService),v0(6,ypc.IAuthenticationService),v0(7,u4i.IChatMLFetcher),v0(8,h4i.ITokenizerProvider),v0(9,l4i.IInstantiationService),v0(10,aAe.IConfigurationService),v0(11,p4i.IExperimentationService),v0(12,f4i.IChatWebSocketManager),v0(13,d4i.ILogService)],LPr)});var A4i=I(VT=>{"use strict";p();var kpc=VT&&VT.__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},$T=VT&&VT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(VT,"__esModule",{value:!0});VT.CopilotUtilityChatEndpoint=VT.CopilotUtilitySmallChatEndpoint=VT.CopilotChatEndpoint=void 0;var Ppc=Qs(),Dpc=SE(),Npc=A6(),Mpc=Il(),Opc=a4(),Bpc=pp(),Lpc=ey(),Fpc=_6(),Upc=gp(),Qpc=o0(),qpc=Ure(),jpc=PE(),Hpc=g$(),Gpc=qre(),F4e=class extends Gpc.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)}}};VT.CopilotChatEndpoint=F4e;VT.CopilotChatEndpoint=F4e=kpc([$T(1,Hpc.IDomainService),$T(2,jpc.ICAPIClientService),$T(3,Lpc.IFetcherService),$T(4,Opc.IEnvService),$T(5,Qpc.ITelemetryService),$T(6,Dpc.IAuthenticationService),$T(7,Npc.IChatMLFetcher),$T(8,qpc.ITokenizerProvider),$T(9,Ppc.IInstantiationService),$T(10,Mpc.IConfigurationService),$T(11,Upc.IExperimentationService),$T(12,Fpc.IChatWebSocketManager),$T(13,Bpc.ILogService)],F4e);var UPr=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(F4e,n)}};VT.CopilotUtilitySmallChatEndpoint=UPr;var QPr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(F4e,n)}};VT.CopilotUtilityChatEndpoint=QPr});var qPr=I(V4=>{"use strict";p();var $pc=V4&&V4.__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},WT=V4&&V4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(V4,"__esModule",{value:!0});V4.AutoChatEndpoint=void 0;V4.isAutoModel=chc;var Vpc=Qs(),Wpc=SE(),zpc=A6(),Ypc=Il(),Kpc=a4(),Jpc=pp(),Zpc=ey(),Xpc=_6(),ehc=gp(),thc=o0(),rhc=Ure(),nhc=PE(),ihc=g$(),ohc=qre(),shc=A4i(),U4e=class extends shc.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(ahc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};V4.AutoChatEndpoint=U4e;V4.AutoChatEndpoint=U4e=$pc([WT(4,ihc.IDomainService),WT(5,nhc.ICAPIClientService),WT(6,Zpc.IFetcherService),WT(7,Kpc.IEnvService),WT(8,thc.ITelemetryService),WT(9,Wpc.IAuthenticationService),WT(10,zpc.IChatMLFetcher),WT(11,rhc.ITokenizerProvider),WT(12,Vpc.IInstantiationService),WT(13,Ypc.IConfigurationService),WT(14,ehc.IExperimentationService),WT(15,Xpc.IChatWebSocketManager),WT(16,Jpc.ILogService)],U4e);function ahc(t,e,r){let n;t instanceof ohc.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(ahc,"calculateAutoModelInfo");function chc(t){return t&&(t.model===U4e.pseudoModelId||t instanceof U4e)?1:-1}a(chc,"isAutoModel")});var HPr=I(Q4e=>{"use strict";p();Object.defineProperty(Q4e,"__esModule",{value:!0});Q4e.getImageTelemetryEventMeasurements=lhc;Q4e.getImageTelemetryMeasurementsFromMessages=uhc;Q4e.getImageTelemetryMeasurementsFromReferences=dhc;var v4i=EPr(),y4i="screenshot-focused-window";function b4i(){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(b4i,"createEmptyImageTelemetryMeasurements");function lhc(t){return t.imageCount>0?t:{}}a(lhc,"getImageTelemetryEventMeasurements");function uhc(t){let e=b4i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=_hc(n,"imageUrl"),s=jPr(o,"url");if(!s)continue;let c=fhc(s,jPr(o,"mediaType"));c&&S4i(e,c)}return e}a(uhc,"getImageTelemetryMeasurementsFromMessages");function dhc(t){let e=b4i();for(let r of t??[]){let n=cAe(r.value);if(!n)continue;let o=jPr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=_4i(n.data)??_4i(n.value);S4i(e,{mimeType:o,byteLength:s?.byteLength??C4i(n.data)??C4i(n.value),dimensions:mhc(s,o),source:ghc(r,n)})}return e}a(dhc,"getImageTelemetryMeasurementsFromReferences");function S4i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),phc(t,e.dimensions),T4i(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(S4i,"addImageTelemetryInput");function fhc(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:Ahc(r[2]),dimensions:hhc(t),source:"unknown"}}a(fhc,"getImageTelemetryInputFromUrl");function phc(t,e){if(!e||!E4i(e.width)||!E4i(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(phc,"addImageDimensions");function E4i(t){return Number.isFinite(t)&&t>0}a(E4i,"isValidDimension");function hhc(t){try{return(0,v4i.getImageDimensions)(t)}catch{return}}a(hhc,"getImageDimensionsFromDataUrl");function mhc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||T4i(r)==="unknown"))try{return(0,v4i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(mhc,"getImageDimensionsFromBytes");function T4i(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(T4i,"normalizeMimeType");function ghc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===y4i||e.id===y4i?"screenshot":e.isURL===!1?"file":"unknown"}a(ghc,"getImageSourceFromReference");function Ahc(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(Ahc,"getBase64ByteLength");function _4i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=cAe(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(yhc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(Ehc))return new Uint8Array(o)}a(_4i,"getByteData");function yhc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(yhc,"isArrayIndexKey");function Ehc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(Ehc,"isByteValue");function C4i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=cAe(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(C4i,"getByteLength");function _hc(t,e){return cAe(cAe(t)?.[e])}a(_hc,"getObjectProperty");function jPr(t,e){let r=cAe(t)?.[e];return typeof r=="string"?r:void 0}a(jPr,"getStringProperty");function cAe(t){return typeof t=="object"&&t!==null?t:void 0}a(cAe,"asRecord")});var w4i=I(lAe=>{"use strict";p();Object.defineProperty(lAe,"__esModule",{value:!0});lAe.ChatFailKind=lAe.FetchResponseKind=void 0;var I4i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(I4i||(lAe.FetchResponseKind=I4i={}));var x4i;(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"})(x4i||(lAe.ChatFailKind=x4i={}))});var q4e=I(wu=>{"use strict";p();Object.defineProperty(wu,"__esModule",{value:!0});wu.FILE_TOOL_NAMES=wu.SHELL_TOOL_NAMES=wu.TOOL_PARAM_COMMAND_MAX_LEN=wu.GitHubCopilotAttr=wu.CopilotCliSdkAttr=wu.StdAttr=wu.CopilotChatAttr=wu.GenAiAttr=wu.GenAiToolType=wu.GenAiTokenType=wu.GenAiProviderName=wu.GenAiOperationName=void 0;wu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};wu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};wu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};wu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};wu.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",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",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"};wu.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"};wu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};wu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};wu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",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"};wu.TOOL_PARAM_COMMAND_MAX_LEN=256;wu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);wu.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 $Pr=I(vR=>{"use strict";p();Object.defineProperty(vR,"__esModule",{value:!0});vR.truncateForOTel=Chc;vR.toInputMessages=vhc;vR.toOutputMessages=bhc;vR.toSystemInstructions=Shc;vR.extractTextFromContent=GPr;vR.collectSystemTextsFromRequestBody=Thc;vR.normalizeProviderMessages=Ihc;vR.toToolDefinitions=P4i;vR.stringifyToolDefinitionsForOTel=Nhc;vR.stringifyToolsRawForTelemetry=Mhc;function Chc(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(Chc,"truncateForOTel");function vhc(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(vhc,"toInputMessages");function bhc(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(bhc,"toOutputMessages");function Shc(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(Shc,"toSystemInstructions");function GPr(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(GPr,"extractTextFromContent");function Thc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=GPr(n.content);o&&e.push(o)}}if(e.length===0){let n=GPr(t.system??t.instructions);n&&e.push(n)}return e}a(Thc,"collectSystemTextsFromRequestBody");function Ihc(t){return t.map(e=>{switch(e.type){case"function_call":return xhc(e);case"function_call_output":return whc(e);case"tool_search_output":return Rhc(e);case"reasoning":return khc(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(Ihc,"normalizeProviderMessages");function xhc(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(xhc,"normalizeResponsesFunctionCall");function whc(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(whc,"normalizeResponsesFunctionCallOutput");function Rhc(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(Rhc,"normalizeResponsesToolSearchOutput");function khc(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(khc,"normalizeResponsesReasoning");function P4i(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(P4i,"toToolDefinitions");var R4i=new WeakMap,k4i=new WeakMap,YEt,KEt;function Phc(t){return YEt!==void 0&&YEt===t?YEt:(YEt=t,t)}a(Phc,"internToolDefsString");function Dhc(t){return KEt!==void 0&&KEt===t?KEt:(KEt=t,t)}a(Dhc,"internToolsRawString");function Nhc(t){if(!t||t.length===0)return;let e=R4i.get(t);if(e!==void 0)return e;let r=P4i(t);if(!r)return;let n=Phc(JSON.stringify(r));return R4i.set(t,n),n}a(Nhc,"stringifyToolDefinitionsForOTel");function Mhc(t){if(!t)return;let e=k4i.get(t);if(e!==void 0)return e;let r=Dhc(JSON.stringify(t));return k4i.set(t,r),r}a(Mhc,"stringifyToolsRawForTelemetry")});var VPr=I(JEt=>{"use strict";p();Object.defineProperty(JEt,"__esModule",{value:!0});JEt.resolveWorkspaceOTelMetadata=Ohc;JEt.workspaceMetadataToOTelAttributes=Lhc;var D4i=xP(),N4i=Iwr(),A$=q4e();function Ohc(t,e){let r=t.activeRepository?.get();return r?Bhc(r,e):{}}a(Ohc,"resolveWorkspaceOTelMetadata");function Bhc(t,e){let r,n=Array.from((0,N4i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,N4i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,D4i.isEqualOrParent)(e,t.rootUri)&&(o=(0,D4i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(Bhc,"buildWorkspaceMetadata");function Lhc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[A$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[A$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[A$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[A$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[A$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[A$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=Fhc(t.remoteUrl);r&&(e[A$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[A$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(Lhc,"workspaceMetadataToOTelAttributes");function Fhc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(Fhc,"extractGitHubOrg")});var M4i=I(bR=>{"use strict";p();Object.defineProperty(bR,"__esModule",{value:!0});bR.emitInferenceDetailsEvent=Uhc;bR.emitSessionStartEvent=Qhc;bR.emitToolCallEvent=qhc;bR.emitAgentTurnEvent=jhc;bR.emitEditFeedbackEvent=Hhc;bR.emitEditHunkActionEvent=Ghc;bR.emitInlineDoneEvent=$hc;bR.emitEditSurvivalEvent=Vhc;bR.emitUserFeedbackEvent=Whc;bR.emitCloudSessionInvokeEvent=zhc;var b0=q4e(),uAe=$Pr(),ZEt=VPr();function Uhc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[b0.GenAiAttr.OPERATION_NAME]:b0.GenAiOperationName.CHAT,[b0.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[b0.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[b0.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[b0.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[b0.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[b0.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[b0.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[b0.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[b0.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[b0.GenAiAttr.INPUT_MESSAGES]=(0,uAe.truncateForOTel)(JSON.stringify(c?(0,uAe.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,uAe.toSystemInstructions)(c);l!==void 0&&(o[b0.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,uAe.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,uAe.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[b0.GenAiAttr.TOOL_DEFINITIONS]=(0,uAe.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(Uhc,"emitInferenceDetailsEvent");function Qhc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[b0.GenAiAttr.REQUEST_MODEL]:r,[b0.GenAiAttr.AGENT_NAME]:n})}a(Qhc,"emitSessionStartEvent");function qhc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[b0.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[b0.StdAttr.ERROR_TYPE]:o}:{}})}a(qhc,"emitToolCallEvent");function jhc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[b0.GenAiAttr.USAGE_INPUT_TOKENS]:r,[b0.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(jhc,"emitAgentTurnEvent");function Hhc(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,ZEt.workspaceMetadataToOTelAttributes)(u)})}a(Hhc,"emitEditFeedbackEvent");function Ghc(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,ZEt.workspaceMetadataToOTelAttributes)(l)})}a(Ghc,"emitEditHunkActionEvent");function $hc(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,ZEt.workspaceMetadataToOTelAttributes)(l)})}a($hc,"emitInlineDoneEvent");function Vhc(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,ZEt.workspaceMetadataToOTelAttributes)(l)})}a(Vhc,"emitEditSurvivalEvent");function Whc(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(Whc,"emitUserFeedbackEvent");function zhc(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(zhc,"emitCloudSessionInvokeEvent")});var O4i=I(XEt=>{"use strict";p();Object.defineProperty(XEt,"__esModule",{value:!0});XEt.GenAiMetrics=void 0;var Gc=q4e(),WPr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[Gc.GenAiAttr.OPERATION_NAME]:n.operationName,[Gc.GenAiAttr.PROVIDER_NAME]:n.providerName,[Gc.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Gc.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[Gc.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[Gc.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[Gc.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[Gc.GenAiAttr.OPERATION_NAME]:o.operationName,[Gc.GenAiAttr.PROVIDER_NAME]:o.providerName,[Gc.GenAiAttr.TOKEN_TYPE]:n,[Gc.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[Gc.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[Gc.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[Gc.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[Gc.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[Gc.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[Gc.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[Gc.GenAiAttr.REQUEST_MODEL]:r})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Gc.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Gc.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[Gc.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[Gc.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){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r})}static incrementCloudPrReadyCount(e){e.incrementCounter("copilot_chat.cloud.pr_ready.count")}};XEt.GenAiMetrics=WPr});var YPr=I(e_t=>{"use strict";p();Object.defineProperty(e_t,"__esModule",{value:!0});e_t.NoopOTelService=void 0;var B4i=Sc(),L4i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},zPr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=B4i.Event.None,this.onDidEmitSpanEvent=B4i.Event.None,this.config=e}startSpan(e,r){return L4i}startActiveSpan(e,r,n){return n(L4i)}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){}};e_t.NoopOTelService=zPr});var KPr=I(jre=>{"use strict";p();Object.defineProperty(jre,"__esModule",{value:!0});jre.DEFAULT_OTLP_ENDPOINT=void 0;jre.resolveOTelConfig=Jhc;jre.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function Yhc(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(Yhc,"parseResourceAttributes");function Khc(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(Khc,"parseOtlpEndpoint");function Jhc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return F4i(t);let r=t.settingDbSpanExporter??!1,n=(j4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(j4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return F4i(t);let s;j4e(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??jre.DEFAULT_OTLP_ENDPOINT,d=Khc(u,l)??jre.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=j4e(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=Zhc(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",_=j4e(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=Yhc(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(Jhc,"resolveOTelConfig");function F4i(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(F4i,"createDisabledConfig");function j4e(t){if(t!==void 0)return t==="true"||t==="1"}a(j4e,"envBool");function Zhc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(Zhc,"parseMaxAttributeSizeChars")});var r_t=I(t_t=>{"use strict";p();Object.defineProperty(t_t,"__esModule",{value:!0});t_t.IOTelService=void 0;var Xhc=rn();t_t.IOTelService=(0,Xhc.createServiceIdentifier)("IOTelService")});var U4i=I(JPr=>{"use strict";p();Object.defineProperty(JPr,"__esModule",{value:!0});JPr.normalizeResponseModel=e0c;function e0c(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(e0c,"normalizeResponseModel")});var j4i=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 SR=q4e();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return SR.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return SR.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return SR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return SR.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return SR.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return SR.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return SR.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return SR.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return SR.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return SR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return SR.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return SR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var W4=M4i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return W4.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return W4.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return W4.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return W4.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return W4.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return W4.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return W4.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return W4.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return W4.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return W4.emitUserFeedbackEvent},"get")});var t0c=O4i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return t0c.GenAiMetrics},"get")});var z4=$Pr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return z4.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return z4.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return z4.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return z4.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return z4.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return z4.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return z4.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return z4.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return z4.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return z4.truncateForOTel},"get")});var r0c=YPr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return r0c.NoopOTelService},"get")});var Q4i=KPr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return Q4i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return Q4i.DEFAULT_OTLP_ENDPOINT},"get")});var n0c=r_t();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return n0c.IOTelService},"get")});var i0c=U4i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return i0c.normalizeResponseModel},"get")});var q4i=VPr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return q4i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return q4i.workspaceMetadataToOTelAttributes},"get")})});var e2r=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.AbstractRequestLogger=void 0;y$.getCurrentCapturingToken=c0c;y$.storeCapturingTokenForCorrelation=l0c;y$.retrieveCapturingTokenByCorrelation=u0c;y$.runWithCapturingToken=d0c;var o0c=require("async_hooks"),s0c=Lge(),a0c=ko(),H4e=new o0c.AsyncLocalStorage,ZPr=new Map;function c0c(){return H4e.getStore()}a(c0c,"getCurrentCapturingToken");function l0c(t){let e=H4e.getStore();e&&ZPr.set(t,e)}a(l0c,"storeCapturingTokenForCorrelation");function u0c(t){let e=ZPr.get(t);return e&&ZPr.delete(t),e}a(u0c,"retrieveCapturingTokenByCorrelation");function d0c(t,e){return H4e.run(t,e)}a(d0c,"runWithCapturingToken");var XPr=class extends a0c.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return H4e.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new s0c.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return H4e.getStore()}};y$.AbstractRequestLogger=XPr});var H4i=I(t2r=>{"use strict";p();Object.defineProperty(t2r,"__esModule",{value:!0});t2r.isEncryptedThinkingDelta=f0c;function f0c(t){return t.encrypted!==void 0}a(f0c,"isEncryptedThinkingDelta")});var $4i=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.calculateLineRepetitionStats=h0c;n_t.isRepetitive=m0c;var p0c=[{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 h0c(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(h0c,"calculateLineRepetitionStats");function m0c(t){let e=t.slice();return e.reverse(),G4i(e)||G4i(e.filter(r=>r.trim().length>0))}a(m0c,"isRepetitive");function G4i(t){let e=g0c(t);for(let r of p0c){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(g0c,"kmp_prefix_function")});var r2r=I(Y4=>{"use strict";p();var A0c=Y4&&Y4.__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},E$=Y4&&Y4.__param||function(t,e){return function(r,n){e(r,n,t)}},TR;Object.defineProperty(Y4,"__esModule",{value:!0});Y4.OpenAIEndpoint=void 0;Y4.isBYOKModel=R0c;var y0c=A6(),V4i=yR(),W4i=Il(),E0c=g$(),_0c=qre(),C0c=pp(),v0c=f6(),b0c=$Et(),S0c=_6(),T0c=gp(),I0c=Ure(),x0c=Qs();function w0c(t){return t.type===V4i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===V4i.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 xac.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...LMi(c,l),top_logprobs:l.top_logprobs?.map(u=>LMi(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:i6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:i6.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:i6.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=ncc(s.response.output,this.latestCompactionOutputIndex),l=QMi(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,nPr.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,nPr.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:If.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(D4.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=If.FinishedCompletionReason.Length:c==="content_filter"?(l=If.FinishedCompletionReason.ContentFilter,u=occ(s.content_filters)):l=If.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:BMi(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,If.FinishedCompletionReason.ServerError,{error:BMi(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(D4.isDefined)}}}};vv.OpenAIResponsesProcessor=Kyt;vv.OpenAIResponsesProcessor=Kyt=bac([Sac(6,Pac.ILogService)],Kyt);function LMi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,Iac.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(LMi,"mapLogProp")});var jMi=I(Zyt=>{"use strict";p();Object.defineProperty(Zyt,"__esModule",{value:!0});Zyt.ChatWebSocketTelemetrySender=void 0;var cPr=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})}};Zyt.ChatWebSocketTelemetrySender=cPr});var o6=I(Zb=>{"use strict";p();var scc=Zb&&Zb.__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},Xyt=Zb&&Zb.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Zb,"__esModule",{value:!0});Zb.ChatWebSocketManager=Zb.NullChatWebSocketManager=Zb.IChatWebSocketManager=void 0;Zb.isCAPIWebSocketError=pPr;var acc=rn(),ccc=Cs(),eEt=Cc(),HMi=wo(),GMi=Sl(),lcc=wE(),Mge=hp(),ucc=o0(),dcc=oy(),fcc=Jyt(),KG=jMi();Zb.IChatWebSocketManager=(0,acc.createServiceIdentifier)("IChatWebSocketManager");var lPr=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(){}};Zb.NullChatWebSocketManager=lPr;function pPr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(pPr,"isCAPIWebSocketError");var pcc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function hcc(t){return pcc[t.type]}a(hcc,"getStreamTerminatingOutcome");var uPr=class extends HMi.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 dPr(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()}};Zb.ChatWebSocketManager=uPr;Zb.ChatWebSocketManager=uPr=scc([Xyt(0,Mge.ILogService),Xyt(1,lcc.ICAPIClientService),Xyt(2,ucc.ITelemetryService),Xyt(3,GMi.IConfigurationService)],uPr);function tEt(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(tEt,"wsCloseCodeToString");var dPr=class extends HMi.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 eEt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new dcc.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}`),KG.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,Mge.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,Mge.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})`:""}`),KG.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=tEt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),KG.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,Mge.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),KG.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}!pPr(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=tEt(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})`),KG.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,Mge.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}`),KG.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,fcc.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 fPr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:q,closeReason:Q,serverErrorMessage:U,serverErrorCode:z})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),$=Date.now()-E,J=this._totalSentMessageCount-_,ne=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;KG.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:$,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:J,requestReceivedMessageCount:ne,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:q,closeReason:Q,serverErrorMessage:U,serverErrorCode:z})}),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})`),KG.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()}},fPr=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 eEt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new eEt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new eEt.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(GMi.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,Mge.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),pPr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=hcc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${tEt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${tEt(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 ccc.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 mPr=I(N4=>{"use strict";p();Object.defineProperty(N4,"__esModule",{value:!0});N4.getImageDimensions=mcc;N4.getImageDimensionsFromBytes=gcc;N4.getPngDimensions=$Mi;N4.getGifDimensions=VMi;N4.getJpegDimensions=WMi;N4.getWebPDimensions=JMi;N4.getMimeType=eOi;N4.extractImageAttributes=Ecc;function mcc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(eOi(e)){case"image/png":return $Mi(e);case"image/gif":return VMi(e);case"image/jpeg":case"image/jpg":return WMi(e);case"image/webp":return JMi(e);default:throw new Error("Unsupported image format")}}a(mcc,"getImageDimensions");function gcc(t,e){switch(Acc(e)){case"image/png":return zMi(t);case"image/gif":return YMi(t);case"image/jpeg":case"image/jpg":return KMi(t);case"image/webp":return ZMi(t);default:throw new Error("Unsupported image format")}}a(gcc,"getImageDimensionsFromBytes");function $Mi(t){return zMi(rEt(t.slice(0,50)))}a($Mi,"getPngDimensions");function VMi(t){return YMi(rEt(t.slice(0,50)))}a(VMi,"getGifDimensions");function WMi(t){return KMi(rEt(t))}a(WMi,"getJpegDimensions");function zMi(t){if(!XMi(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(zMi,"getPngDimensionsFromBytes");function YMi(t){if(!hPr(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(YMi,"getGifDimensionsFromBytes");function KMi(t){if(!XMi(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(KMi,"getJpegDimensionsFromBytes");function JMi(t){return ZMi(rEt(t))}a(JMi,"getWebPDimensions");function ZMi(t){if(!hPr(t,0,"RIFF")||!hPr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=ycc(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(ZMi,"getWebPDimensionsFromBytes");function Acc(t){return t?.toLowerCase().split(";")[0].trim()}a(Acc,"normalizeMimeType");function rEt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(rEt,"base64ToBytes");function XMi(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(nEt,"__esModule",{value:!0});nEt.TokenizerType=void 0;var tOi;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(tOi||(nEt.TokenizerType=tOi={}))});var APr=I(vre=>{"use strict";p();Object.defineProperty(vre,"__esModule",{value:!0});vre.WorkerWithRpcProxy=vre.RcpResponseHandler=void 0;vre.createRpcProxy=rOi;var _cc=require("worker_threads"),iEt=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()}};vre.RcpResponseHandler=iEt;function rOi(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(rOi,"createRpcProxy");var gPr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new iEt,this.worker=new _cc.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=rOi((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)}};vre.WorkerWithRpcProxy=gPr});var nOi=I(hR=>{"use strict";p();Object.defineProperty(hR,"__esModule",{value:!0});hR.SlidingWindowAverage=hR.MovingAverage=hR.Counter=void 0;hR.clamp=Ccc;hR.rot=bcc;hR.isPointWithinTriangle=Scc;hR.randomChance=Tcc;var vcc=Yu();function Ccc(t,e,r){return Math.min(Math.max(t,e),r)}a(Ccc,"clamp");function bcc(t,e){return(e+t%e)%e}a(bcc,"rot");var yPr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};hR.Counter=yPr;var EPr=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}};hR.MovingAverage=EPr;var _Pr=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(Scc,"isPointWithinTriangle");function Tcc(t){return(0,vcc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(sEt,"__esModule",{value:!0});sEt.TikTokenImpl=void 0;var vPr=DHe(),oEt=nOi(),Icc=KM(),xcc=$vr(),CPr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new oEt.MovingAverage,textLength:new oEt.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?xcc.parseTikTokenBinary:c=>c;return this._values.push((0,vPr.createTokenizer)(s(e),(0,vPr.getSpecialTokensByEncoder)(r),(0,vPr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=Icc.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 oEt.MovingAverage,this._stats.textLength=new oEt.MovingAverage,this._stats.callCount=0,r}};sEt.TikTokenImpl=CPr});var Cre=I(Ep=>{"use strict";p();var aOi=Ep&&Ep.__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},cOi=Ep&&Ep.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.TokenizerProvider=Ep.BaseTokensPerName=Ep.BaseTokensPerMessage=Ep.BaseTokensPerCompletion=Ep.ITokenizerProvider=void 0;Ep.calculateImageTokenCost=IPr;Ep.estimateDocumentTokenCost=uOi;var JG=Io(),wcc=Zwr(),Rcc=mPr(),Pcc=rn(),oOi=Oge(),kcc=APr(),Dcc=Yu(),sOi=s3(),bPr=wo(),aEt=AA(),lOi=o0(),SPr=iOi();Ep.ITokenizerProvider=(0,Pcc.createServiceIdentifier)("ITokenizerProvider");Ep.BaseTokensPerCompletion=3;Ep.BaseTokensPerMessage=3;Ep.BaseTokensPerName=1;var TPr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new sOi.Lazy(()=>new cEt(e,(0,aEt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new sOi.Lazy(()=>new cEt(e,(0,aEt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case oOi.TokenizerType.CL100K:return this._cl100kTokenizer.value;case oOi.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Ep.TokenizerProvider=TPr;Ep.TokenizerProvider=TPr=aOi([cOi(1,lOi.ITelemetryService)],TPr);var cEt=class extends bPr.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 wcc.LRUCache(5e3),this.baseTokensPerMessage=Ep.BaseTokensPerMessage,this.baseTokensPerName=Ep.BaseTokensPerName,this.mode=JG.OutputMode.Raw}async countMessagesTokens(e){let r=Ep.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 JG.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case JG.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case JG.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return IPr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case JG.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case JG.Raw.ChatCompletionContentPartKind.Document:return uOi(e.documentData.data);default:(0,Dcc.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,JG.toMode)(JG.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+=IPr(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,aEt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,aEt.join)(__dirname,"tikTokenizerWorker.js"),n=new kcc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,bPr.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=SPr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,bPr.toDisposable)(()=>{SPr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>SPr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};cEt=aOi([cOi(3,lOi.ITelemetryService)],cEt);function IPr(t,e){let{width:r,height:n}=(0,Rcc.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(IPr,"calculateImageTokenCost");function uOi(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(uOi,"estimateDocumentTokenCost")});var ZG=I(Bge=>{"use strict";p();Object.defineProperty(Bge,"__esModule",{value:!0});Bge.IDomainService=Bge.FEEDBACK_URL=void 0;var Ncc=rn();Bge.FEEDBACK_URL="https://aka.ms/microsoft/vscode-copilot-release";Bge.IDomainService=(0,Ncc.createServiceIdentifier)("IDomainService")});var lEt=I(LT=>{"use strict";p();Object.defineProperty(LT,"__esModule",{value:!0});LT.HeaderContributors=LT.IHeaderContributors=LT.userAgentLibraryHeader=void 0;LT.stringifyUrlOrRequestMetadata=jcc;LT.createCapiRequestBody=Hcc;LT.canRetryOnceNetworkError=fOi;LT.postRequest=Gcc;LT.getRequest=$cc;var Mcc=rn(),Occ=Oge(),Bcc=Cs(),Lcc=wE(),Fcc=o0(),Ucc=oy(),Qcc=Y8();LT.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var qcc=30*1e3;function jcc(t){return typeof t=="string"?t:JSON.stringify(t)}a(jcc,"stringifyUrlOrRequestMetadata");function Hcc(t,e,r){let n={messages:(0,Qcc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(Hcc,"createCapiRequestBody");function dOi(t,e){let r=t.get(Ucc.IFetcherService),n=t.get(Fcc.ITelemetryService),o=t.get(Lcc.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:Occ.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:qcc,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 typeof E.urlOrRequestMetadata=="string"?r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&fOi(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new Bcc.CancellationError:R}):o.makeRequest(T,E.urlOrRequestMetadata)}a(dOi,"networkRequest");function fOi(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(fOi,"canRetryOnceNetworkError");function Gcc(t,e){return dOi(t,{...e,requestType:"POST"})}a(Gcc,"postRequest");function $cc(t,e){return dOi(t,{...e,requestType:"GET"})}a($cc,"getRequest");LT.IHeaderContributors=(0,Mcc.createServiceIdentifier)("headerContributors");var xPr=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}};LT.HeaderContributors=xPr});var gOi=I(FT=>{"use strict";p();var Vcc=FT&&FT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wcc=FT&&FT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zcc=FT&&FT.__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;or.charAt(0).toUpperCase()+r.slice(1)),enumDescriptions:t.map(r=>{switch(r){case"none":return _p.t("No reasoning applied");case"minimal":return _p.t("Minimal reasoning for fastest responses");case"low":return _p.t("Faster responses with less reasoning");case"medium":return _p.t("Balanced reasoning and speed");case"high":return _p.t("Greater reasoning depth but slower");case"xhigh":return _p.t("Highest reasoning depth but slowest");case"max":return _p.t("Absolute maximum capability with no constraints");default:return r}}),default:mOi(t,e),group:"navigation"}}a(Ycc,"buildReasoningEffortSchemaProperty");function Kcc(t){let e=t.name.toLowerCase(),r=t.family.toLowerCase();if(r.includes("claude")||e.includes("claude")){if(e.includes("opus"))return _p.t("Most capable Claude model. Excellent for complex analysis, coding tasks, and nuanced creative writing.");if(e.includes("sonnet"))return _p.t("Balanced Claude model offering strong performance for everyday coding and chat tasks at faster speeds.");if(e.includes("haiku"))return _p.t("Fastest and most compact Claude model. Ideal for quick responses and simple tasks.")}if(r.includes("gpt")||e.includes("gpt")||r.includes("codex")||e.includes("codex"))return e.includes("codex")||r.includes("codex")?_p.t("OpenAI Codex model specialized for code generation, debugging, and software development tasks."):e.includes("mini")?_p.t("Lightweight GPT model for quick responses and simple tasks with low latency."):e.includes("copilot")?_p.t("GPT model fine-tuned for Copilot code completions."):e.includes("4o")?_p.t("Optimized GPT-4 model with faster responses and multimodal capabilities."):e.includes("4.1")?_p.t("Enhanced GPT-4 model with improved instruction following and coding performance."):_p.t("OpenAI GPT model for coding and general assistance.");if(r.includes("gemini")||e.includes("gemini"))return e.includes("flash")?_p.t("Fast and efficient Gemini model optimized for quick responses and high throughput."):e.includes("pro")?_p.t("Google's advanced Gemini Pro model with strong reasoning and coding capabilities."):_p.t("Google Gemini model with balanced performance for coding and general assistance.");if(r.includes("grok")||e.includes("grok"))return _p.t("xAI Grok model optimized for fast code generation and development tasks.")}a(Kcc,"getModelCapabilitiesDescription");function pOi(t){return t<.01?t.toExponential(2):t.toFixed(4).replace(/\.?0+$/,"")}a(pOi,"formatAicPrice");function Jcc(t){return _p.t("In: {0} \xB7 Out: {1} AICs/1M tokens",pOi(t.default.inputPrice),pOi(t.default.outputPrice))}a(Jcc,"formatPricingLabel");var hOi=1e6,wPr=1e9;function Zcc(t){if(!t)return;let e=t.batch_size??hOi,r=hOi/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,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,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice)&&(s=l)}return{default:o,longContext:s}}if(!(t.input_price===void 0||t.output_price===void 0))return{default:{inputPrice:t.input_price/wPr*r,outputPrice:t.output_price/wPr*r,cachePrice:t.cache_price!==void 0?t.cache_price/wPr*r:void 0}}}a(Zcc,"normalizeTokenPrices")});var kOi=I(cy=>{"use strict";p();var Xcc=cy&&cy.__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},AOi=cy&&cy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(cy,"__esModule",{value:!0});cy.AnthropicMessagesProcessor=void 0;cy.buildToolInputSchema=SOi;cy.createMessagesRequestBody=ilc;cy.rawMessagesToMessagesAPI=TOi;cy.clearAllCacheControl=IOi;cy.addToolsAndSystemCacheControl=xOi;cy.addMessagesApiCacheControl=wOi;cy.processResponseFromMessagesEndpoint=alc;cy.processNonStreamingResponseFromMessagesEndpoint=POi;var ID=Io(),EOi=Jc(),elc=wRr(),RPr=um(),tlc=dR(),yOi=Sl(),_Oi=hp(),Lge=Uyt(),vOi=J8(),a4e=Y8(),rlc=BRr(),COi=i4e(),nlc=Ap(),bOi=o0();function SOi(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(SOi,"buildToolInputSchema");function ilc(t,e,r,n){let o=t.get(yOi.IConfigurationService),s=t.get(nlc.IExperimentationService),c=t.get(rlc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===Lge.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:SOi(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?new Set(f.map(N=>N.name)):void 0,b=TOi(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,Lge.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,Lge.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;IOi(b),wOi(b,P),xOi(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:tlc.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(ilc,"createMessagesRequestBody");function TOi(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case ID.Raw.ChatRole.System:{n.push(...uEt(c.content).filter(l=>l.type==="text"));break}case ID.Raw.ChatRole.User:{let l=uEt(c.content);l.length>0&&r.push({role:"user",content:l});break}case ID.Raw.ChatRole.Assistant:{let l=uEt(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 ID.Raw.ChatRole.Tool:{if(c.toolCallId){let l=uEt(c.content),u=!1;for(let g of l)c4e(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===Lge.CUSTOM_TOOL_SEARCH_NAME?olc(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(TOi,"rawMessagesToMessagesAPI");function olc(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(olc,"tryParseToolReferences");function uEt(t){let e=[],r=!1;for(let n of t){switch(n.type){case ID.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case ID.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 ID.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&c4e(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case ID.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 ID.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;s&&o.thinking.encrypted?e.push({type:"thinking",thinking:s,signature:o.thinking.encrypted}):o.thinking.encrypted&&!s&&e.push({type:"redacted_thinking",data:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);c4e(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(uEt,"rawContentToAnthropicContent");function c4e(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(c4e,"contentBlockSupportsCacheControl");function IOi(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(IOi,"clearAllCacheControl");function xOi(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(xOi,"addToolsAndSystemCacheControl");function wOi(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"&&c4e(c))&&(slc(s,e),n++)}}a(wOi,"addMessagesApiCacheControl");function slc(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"&&c4e(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(slc,"markLastCacheableBlock");async function alc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new EOi.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,RPr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,vOi.getRequestId)(n.headers),h=t.createInstance(dEt,s,u,d,f),m=new elc.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,a4e.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,COi.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()}):POi(e,r,n,o,s)}a(alc,"processResponseFromMessagesEndpoint");function clc(t){switch(t){case"refusal":return a4e.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return a4e.FinishedCompletionReason.Length;default:return a4e.FinishedCompletionReason.Stop}}a(clc,"mapStopReason");function ROi(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(ROi,"buildAnthropicCompletion");async function POi(t,e,r,n,o){return new EOi.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,vOi.getRequestId)(r.headers),u=c||(0,RPr.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=ROi({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,a4e.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,COi.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(POi,"processNonStreamingResponseFromMessagesEndpoint");var dEt=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,RPr.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}})}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 ROi({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}]})}}}};cy.AnthropicMessagesProcessor=dEt;cy.AnthropicMessagesProcessor=dEt=Xcc([AOi(4,_Oi.ILogService),AOi(5,bOi.ITelemetryService)],dEt)});var DOi=I(s6=>{"use strict";p();var llc=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]})),ulc=s6&&s6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dlc=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=0;l--)if(t[l].role===bre.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(flc.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===bre.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===bre.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==bre.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:bre.Raw.ChatCompletionContentPartKind.Text,text:plc})})}a(hlc,"filterHistoryImages")});var Sre=I(Xb=>{"use strict";p();var LOi=Xb&&Xb.__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},C0=Xb&&Xb.__param||function(t,e){return function(r,n){e(r,n,t)}},DPr;Object.defineProperty(Xb,"__esModule",{value:!0});Xb.RemoteAgentChatEndpoint=Xb.ChatEndpoint=void 0;Xb.defaultChatResponseProcessor=MPr;Xb.defaultNonStreamChatResponseProcessor=VOi;var PPr=(sre(),ya(ore)),NOi=Io(),FOi=Jc(),MOi=VKe(),mlc=um(),UOi=Ls(),glc=vE(),QOi=r6(),Alc=dR(),ylc=z5e(),Fge=Sl(),qOi=hp(),OOi=Uyt(),Elc=J8(),_lc=oy(),vlc=lEt(),Clc=i4e(),jOi=o6(),blc=Vyt(),HOi=Ap(),Slc=o0(),GOi=Cre(),Tlc=wE(),l4e=X5e(),$Oi=ZG(),u4e=XMe(),Ilc=gOi(),BOi=kOi(),kPr=Jyt(),xlc=DOi();async function MPr(t,e,r,n,o,s,c){let u=(await blc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return FOi.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,Clc.prepareChatCompletionForReturn)(t,e,f,s)})}a(MPr,"defaultChatResponseProcessor");async function VOi(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,ylc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,mlc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Elc.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 FOi.AsyncIterableObject.fromArray(s)}a(VOi,"defaultNonStreamChatResponseProcessor");var fEt=DPr=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,l4e.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer,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,Ilc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice??0,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice??0,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_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,l4e.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,l4e.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(Fge.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,OOi.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,OOi.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:PPr.RequestType.ChatResponses}:this.useMessagesApi?{type:PPr.RequestType.ChatMessages}:{type:PPr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(u4e.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(u4e.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(u4e.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(u4e.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Fge.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(u4e.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===NOi.OpenAI.ChatRole.System?{role:NOi.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(kPr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(BOi.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,vlc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,l4e.isAnthropicFamily)(this))return 20;if((0,l4e.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,xlc.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(Fge.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,kPr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,kPr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,BOi.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?MPr(e,r,n,o,s,c,l):VOi(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(Fge.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===Alc.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(DPr,(0,MOi.mixin)((0,MOi.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};Xb.ChatEndpoint=fEt;Xb.ChatEndpoint=fEt=DPr=LOi([C0(1,$Oi.IDomainService),C0(2,QOi.IChatMLFetcher),C0(3,GOi.ITokenizerProvider),C0(4,UOi.IInstantiationService),C0(5,Fge.IConfigurationService),C0(6,HOi.IExperimentationService),C0(7,jOi.IChatWebSocketManager),C0(8,qOi.ILogService)],fEt);var NPr=class extends fEt{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 MPr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};Xb.RemoteAgentChatEndpoint=NPr;Xb.RemoteAgentChatEndpoint=NPr=LOi([C0(2,$Oi.IDomainService),C0(3,Tlc.ICAPIClientService),C0(4,_lc.IFetcherService),C0(5,Slc.ITelemetryService),C0(6,glc.IAuthenticationService),C0(7,QOi.IChatMLFetcher),C0(8,GOi.ITokenizerProvider),C0(9,UOi.IInstantiationService),C0(10,Fge.IConfigurationService),C0(11,HOi.IExperimentationService),C0(12,jOi.IChatWebSocketManager),C0(13,qOi.ILogService)],NPr)});var WOi=I(QT=>{"use strict";p();var wlc=QT&&QT.__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},UT=QT&&QT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(QT,"__esModule",{value:!0});QT.CopilotUtilityChatEndpoint=QT.CopilotUtilitySmallChatEndpoint=QT.CopilotChatEndpoint=void 0;var Rlc=Ls(),Plc=vE(),klc=r6(),Dlc=Sl(),Nlc=Y5(),Mlc=hp(),Olc=oy(),Blc=o6(),Llc=Ap(),Flc=o0(),Ulc=Cre(),Qlc=wE(),qlc=ZG(),jlc=Sre(),d4e=class extends jlc.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)}}};QT.CopilotChatEndpoint=d4e;QT.CopilotChatEndpoint=d4e=wlc([UT(1,qlc.IDomainService),UT(2,Qlc.ICAPIClientService),UT(3,Olc.IFetcherService),UT(4,Nlc.IEnvService),UT(5,Flc.ITelemetryService),UT(6,Plc.IAuthenticationService),UT(7,klc.IChatMLFetcher),UT(8,Ulc.ITokenizerProvider),UT(9,Rlc.IInstantiationService),UT(10,Dlc.IConfigurationService),UT(11,Llc.IExperimentationService),UT(12,Blc.IChatWebSocketManager),UT(13,Mlc.ILogService)],d4e);var OPr=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(d4e,n)}};QT.CopilotUtilitySmallChatEndpoint=OPr;var BPr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(d4e,n)}};QT.CopilotUtilityChatEndpoint=BPr});var LPr=I(M4=>{"use strict";p();var Hlc=M4&&M4.__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},qT=M4&&M4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M4,"__esModule",{value:!0});M4.AutoChatEndpoint=void 0;M4.isAutoModel=suc;var Glc=Ls(),$lc=vE(),Vlc=r6(),Wlc=Sl(),zlc=Y5(),Ylc=hp(),Klc=oy(),Jlc=o6(),Zlc=Ap(),Xlc=o0(),euc=Cre(),tuc=wE(),ruc=ZG(),nuc=Sre(),iuc=WOi(),f4e=class extends iuc.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(ouc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};M4.AutoChatEndpoint=f4e;M4.AutoChatEndpoint=f4e=Hlc([qT(4,ruc.IDomainService),qT(5,tuc.ICAPIClientService),qT(6,Klc.IFetcherService),qT(7,zlc.IEnvService),qT(8,Xlc.ITelemetryService),qT(9,$lc.IAuthenticationService),qT(10,Vlc.IChatMLFetcher),qT(11,euc.ITokenizerProvider),qT(12,Glc.IInstantiationService),qT(13,Wlc.IConfigurationService),qT(14,Zlc.IExperimentationService),qT(15,Jlc.IChatWebSocketManager),qT(16,Ylc.ILogService)],f4e);function ouc(t,e,r){let n;t instanceof nuc.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(ouc,"calculateAutoModelInfo");function suc(t){return t&&(t.model===f4e.pseudoModelId||t instanceof f4e)?1:-1}a(suc,"isAutoModel")});var UPr=I(p4e=>{"use strict";p();Object.defineProperty(p4e,"__esModule",{value:!0});p4e.getImageTelemetryEventMeasurements=auc;p4e.getImageTelemetryMeasurementsFromMessages=cuc;p4e.getImageTelemetryMeasurementsFromReferences=luc;var ZOi=mPr(),zOi="screenshot-focused-window";function XOi(){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(XOi,"createEmptyImageTelemetryMeasurements");function auc(t){return t.imageCount>0?t:{}}a(auc,"getImageTelemetryEventMeasurements");function cuc(t){let e=XOi();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=yuc(n,"imageUrl"),s=FPr(o,"url");if(!s)continue;let c=uuc(s,FPr(o,"mediaType"));c&&e5i(e,c)}return e}a(cuc,"getImageTelemetryMeasurementsFromMessages");function luc(t){let e=XOi();for(let r of t??[]){let n=Uge(r.value);if(!n)continue;let o=FPr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=KOi(n.data)??KOi(n.value);e5i(e,{mimeType:o,byteLength:s?.byteLength??JOi(n.data)??JOi(n.value),dimensions:puc(s,o),source:huc(r,n)})}return e}a(luc,"getImageTelemetryMeasurementsFromReferences");function e5i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),duc(t,e.dimensions),t5i(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(e5i,"addImageTelemetryInput");function uuc(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:muc(r[2]),dimensions:fuc(t),source:"unknown"}}a(uuc,"getImageTelemetryInputFromUrl");function duc(t,e){if(!e||!YOi(e.width)||!YOi(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(duc,"addImageDimensions");function YOi(t){return Number.isFinite(t)&&t>0}a(YOi,"isValidDimension");function fuc(t){try{return(0,ZOi.getImageDimensions)(t)}catch{return}}a(fuc,"getImageDimensionsFromDataUrl");function puc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||t5i(r)==="unknown"))try{return(0,ZOi.getImageDimensionsFromBytes)(t,r)}catch{return}}a(puc,"getImageDimensionsFromBytes");function t5i(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(t5i,"normalizeMimeType");function huc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===zOi||e.id===zOi?"screenshot":e.isURL===!1?"file":"unknown"}a(huc,"getImageSourceFromReference");function muc(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(muc,"getBase64ByteLength");function KOi(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=Uge(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(guc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(Auc))return new Uint8Array(o)}a(KOi,"getByteData");function guc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(guc,"isArrayIndexKey");function Auc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(Auc,"isByteValue");function JOi(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=Uge(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(JOi,"getByteLength");function yuc(t,e){return Uge(Uge(t)?.[e])}a(yuc,"getObjectProperty");function FPr(t,e){let r=Uge(t)?.[e];return typeof r=="string"?r:void 0}a(FPr,"getStringProperty");function Uge(t){return typeof t=="object"&&t!==null?t:void 0}a(Uge,"asRecord")});var i5i=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.ChatFailKind=Qge.FetchResponseKind=void 0;var r5i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(r5i||(Qge.FetchResponseKind=r5i={}));var n5i;(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"})(n5i||(Qge.ChatFailKind=n5i={}))});var h4e=I(xu=>{"use strict";p();Object.defineProperty(xu,"__esModule",{value:!0});xu.FILE_TOOL_NAMES=xu.SHELL_TOOL_NAMES=xu.TOOL_PARAM_COMMAND_MAX_LEN=xu.GitHubCopilotAttr=xu.CopilotCliSdkAttr=xu.StdAttr=xu.CopilotChatAttr=xu.GenAiAttr=xu.GenAiToolType=xu.GenAiTokenType=xu.GenAiProviderName=xu.GenAiOperationName=void 0;xu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};xu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};xu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};xu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};xu.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",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",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"};xu.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"};xu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};xu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};xu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",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"};xu.TOOL_PARAM_COMMAND_MAX_LEN=256;xu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);xu.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 qPr=I(mR=>{"use strict";p();Object.defineProperty(mR,"__esModule",{value:!0});mR.truncateForOTel=Euc;mR.toInputMessages=_uc;mR.toOutputMessages=vuc;mR.toSystemInstructions=Cuc;mR.extractTextFromContent=QPr;mR.collectSystemTextsFromRequestBody=buc;mR.normalizeProviderMessages=Suc;mR.toToolDefinitions=a5i;mR.stringifyToolDefinitionsForOTel=kuc;mR.stringifyToolsRawForTelemetry=Duc;function Euc(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(Euc,"truncateForOTel");function _uc(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(_uc,"toInputMessages");function vuc(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(vuc,"toOutputMessages");function Cuc(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(Cuc,"toSystemInstructions");function QPr(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(QPr,"extractTextFromContent");function buc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=QPr(n.content);o&&e.push(o)}}if(e.length===0){let n=QPr(t.system??t.instructions);n&&e.push(n)}return e}a(buc,"collectSystemTextsFromRequestBody");function Suc(t){return t.map(e=>{switch(e.type){case"function_call":return Tuc(e);case"function_call_output":return Iuc(e);case"tool_search_output":return xuc(e);case"reasoning":return wuc(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(Suc,"normalizeProviderMessages");function Tuc(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(Tuc,"normalizeResponsesFunctionCall");function Iuc(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(Iuc,"normalizeResponsesFunctionCallOutput");function xuc(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(xuc,"normalizeResponsesToolSearchOutput");function wuc(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(wuc,"normalizeResponsesReasoning");function a5i(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(a5i,"toToolDefinitions");var o5i=new WeakMap,s5i=new WeakMap,pEt,hEt;function Ruc(t){return pEt!==void 0&&pEt===t?pEt:(pEt=t,t)}a(Ruc,"internToolDefsString");function Puc(t){return hEt!==void 0&&hEt===t?hEt:(hEt=t,t)}a(Puc,"internToolsRawString");function kuc(t){if(!t||t.length===0)return;let e=o5i.get(t);if(e!==void 0)return e;let r=a5i(t);if(!r)return;let n=Ruc(JSON.stringify(r));return o5i.set(t,n),n}a(kuc,"stringifyToolDefinitionsForOTel");function Duc(t){if(!t)return;let e=s5i.get(t);if(e!==void 0)return e;let r=Puc(JSON.stringify(t));return s5i.set(t,r),r}a(Duc,"stringifyToolsRawForTelemetry")});var jPr=I(mEt=>{"use strict";p();Object.defineProperty(mEt,"__esModule",{value:!0});mEt.resolveWorkspaceOTelMetadata=Nuc;mEt.workspaceMetadataToOTelAttributes=Ouc;var c5i=_k(),l5i=Cxr(),XG=h4e();function Nuc(t,e){let r=t.activeRepository?.get();return r?Muc(r,e):{}}a(Nuc,"resolveWorkspaceOTelMetadata");function Muc(t,e){let r,n=Array.from((0,l5i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,l5i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,c5i.isEqualOrParent)(e,t.rootUri)&&(o=(0,c5i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(Muc,"buildWorkspaceMetadata");function Ouc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[XG.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[XG.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[XG.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[XG.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[XG.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[XG.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=Buc(t.remoteUrl);r&&(e[XG.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[XG.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(Ouc,"workspaceMetadataToOTelAttributes");function Buc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(Buc,"extractGitHubOrg")});var u5i=I(gR=>{"use strict";p();Object.defineProperty(gR,"__esModule",{value:!0});gR.emitInferenceDetailsEvent=Luc;gR.emitSessionStartEvent=Fuc;gR.emitToolCallEvent=Uuc;gR.emitAgentTurnEvent=Quc;gR.emitEditFeedbackEvent=quc;gR.emitEditHunkActionEvent=juc;gR.emitInlineDoneEvent=Huc;gR.emitEditSurvivalEvent=Guc;gR.emitUserFeedbackEvent=$uc;gR.emitCloudSessionInvokeEvent=Vuc;var b0=h4e(),qge=qPr(),gEt=jPr();function Luc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[b0.GenAiAttr.OPERATION_NAME]:b0.GenAiOperationName.CHAT,[b0.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[b0.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[b0.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[b0.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[b0.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[b0.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[b0.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[b0.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[b0.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[b0.GenAiAttr.INPUT_MESSAGES]=(0,qge.truncateForOTel)(JSON.stringify(c?(0,qge.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,qge.toSystemInstructions)(c);l!==void 0&&(o[b0.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,qge.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,qge.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[b0.GenAiAttr.TOOL_DEFINITIONS]=(0,qge.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(Luc,"emitInferenceDetailsEvent");function Fuc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[b0.GenAiAttr.REQUEST_MODEL]:r,[b0.GenAiAttr.AGENT_NAME]:n})}a(Fuc,"emitSessionStartEvent");function Uuc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[b0.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[b0.StdAttr.ERROR_TYPE]:o}:{}})}a(Uuc,"emitToolCallEvent");function Quc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[b0.GenAiAttr.USAGE_INPUT_TOKENS]:r,[b0.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(Quc,"emitAgentTurnEvent");function quc(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,gEt.workspaceMetadataToOTelAttributes)(u)})}a(quc,"emitEditFeedbackEvent");function juc(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,gEt.workspaceMetadataToOTelAttributes)(l)})}a(juc,"emitEditHunkActionEvent");function Huc(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,gEt.workspaceMetadataToOTelAttributes)(l)})}a(Huc,"emitInlineDoneEvent");function Guc(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,gEt.workspaceMetadataToOTelAttributes)(l)})}a(Guc,"emitEditSurvivalEvent");function $uc(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($uc,"emitUserFeedbackEvent");function Vuc(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(Vuc,"emitCloudSessionInvokeEvent")});var d5i=I(AEt=>{"use strict";p();Object.defineProperty(AEt,"__esModule",{value:!0});AEt.GenAiMetrics=void 0;var qc=h4e(),HPr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[qc.GenAiAttr.OPERATION_NAME]:n.operationName,[qc.GenAiAttr.PROVIDER_NAME]:n.providerName,[qc.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[qc.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[qc.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[qc.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[qc.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[qc.GenAiAttr.OPERATION_NAME]:o.operationName,[qc.GenAiAttr.PROVIDER_NAME]:o.providerName,[qc.GenAiAttr.TOKEN_TYPE]:n,[qc.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[qc.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[qc.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[qc.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[qc.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[qc.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[qc.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[qc.GenAiAttr.REQUEST_MODEL]:r})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[qc.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[qc.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[qc.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[qc.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){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r})}static incrementCloudPrReadyCount(e){e.incrementCounter("copilot_chat.cloud.pr_ready.count")}};AEt.GenAiMetrics=HPr});var $Pr=I(yEt=>{"use strict";p();Object.defineProperty(yEt,"__esModule",{value:!0});yEt.NoopOTelService=void 0;var f5i=Cc(),p5i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},GPr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=f5i.Event.None,this.onDidEmitSpanEvent=f5i.Event.None,this.config=e}startSpan(e,r){return p5i}startActiveSpan(e,r,n){return n(p5i)}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){}};yEt.NoopOTelService=GPr});var VPr=I(Tre=>{"use strict";p();Object.defineProperty(Tre,"__esModule",{value:!0});Tre.DEFAULT_OTLP_ENDPOINT=void 0;Tre.resolveOTelConfig=Yuc;Tre.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function Wuc(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(Wuc,"parseResourceAttributes");function zuc(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(zuc,"parseOtlpEndpoint");function Yuc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return h5i(t);let r=t.settingDbSpanExporter??!1,n=(m4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(m4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return h5i(t);let s;m4e(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??Tre.DEFAULT_OTLP_ENDPOINT,d=zuc(u,l)??Tre.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=m4e(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=Kuc(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",_=m4e(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=Wuc(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(Yuc,"resolveOTelConfig");function h5i(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(h5i,"createDisabledConfig");function m4e(t){if(t!==void 0)return t==="true"||t==="1"}a(m4e,"envBool");function Kuc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(Kuc,"parseMaxAttributeSizeChars")});var _Et=I(EEt=>{"use strict";p();Object.defineProperty(EEt,"__esModule",{value:!0});EEt.IOTelService=void 0;var Juc=rn();EEt.IOTelService=(0,Juc.createServiceIdentifier)("IOTelService")});var m5i=I(WPr=>{"use strict";p();Object.defineProperty(WPr,"__esModule",{value:!0});WPr.normalizeResponseModel=Zuc;function Zuc(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(Zuc,"normalizeResponseModel")});var y5i=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 AR=h4e();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return AR.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return AR.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return AR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return AR.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return AR.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return AR.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return AR.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return AR.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return AR.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return AR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return AR.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return AR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var O4=u5i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return O4.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return O4.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return O4.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return O4.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return O4.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return O4.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return O4.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return O4.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return O4.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return O4.emitUserFeedbackEvent},"get")});var Xuc=d5i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return Xuc.GenAiMetrics},"get")});var B4=qPr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return B4.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return B4.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return B4.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return B4.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return B4.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return B4.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return B4.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return B4.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return B4.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return B4.truncateForOTel},"get")});var edc=$Pr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return edc.NoopOTelService},"get")});var g5i=VPr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return g5i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return g5i.DEFAULT_OTLP_ENDPOINT},"get")});var tdc=_Et();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return tdc.IOTelService},"get")});var rdc=m5i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return rdc.normalizeResponseModel},"get")});var A5i=jPr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return A5i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return A5i.workspaceMetadataToOTelAttributes},"get")})});var KPr=I(e$=>{"use strict";p();Object.defineProperty(e$,"__esModule",{value:!0});e$.AbstractRequestLogger=void 0;e$.getCurrentCapturingToken=sdc;e$.storeCapturingTokenForCorrelation=adc;e$.retrieveCapturingTokenByCorrelation=cdc;e$.runWithCapturingToken=ldc;var ndc=require("async_hooks"),idc=hge(),odc=wo(),g4e=new ndc.AsyncLocalStorage,zPr=new Map;function sdc(){return g4e.getStore()}a(sdc,"getCurrentCapturingToken");function adc(t){let e=g4e.getStore();e&&zPr.set(t,e)}a(adc,"storeCapturingTokenForCorrelation");function cdc(t){let e=zPr.get(t);return e&&zPr.delete(t),e}a(cdc,"retrieveCapturingTokenByCorrelation");function ldc(t,e){return g4e.run(t,e)}a(ldc,"runWithCapturingToken");var YPr=class extends odc.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return g4e.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new idc.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return g4e.getStore()}};e$.AbstractRequestLogger=YPr});var E5i=I(JPr=>{"use strict";p();Object.defineProperty(JPr,"__esModule",{value:!0});JPr.isEncryptedThinkingDelta=udc;function udc(t){return t.encrypted!==void 0}a(udc,"isEncryptedThinkingDelta")});var v5i=I(vEt=>{"use strict";p();Object.defineProperty(vEt,"__esModule",{value:!0});vEt.calculateLineRepetitionStats=fdc;vEt.isRepetitive=pdc;var ddc=[{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 fdc(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(fdc,"calculateLineRepetitionStats");function pdc(t){let e=t.slice();return e.reverse(),_5i(e)||_5i(e.filter(r=>r.trim().length>0))}a(pdc,"isRepetitive");function _5i(t){let e=hdc(t);for(let r of ddc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(hdc,"kmp_prefix_function")});var ZPr=I(L4=>{"use strict";p();var mdc=L4&&L4.__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},t$=L4&&L4.__param||function(t,e){return function(r,n){e(r,n,t)}},yR;Object.defineProperty(L4,"__esModule",{value:!0});L4.OpenAIEndpoint=void 0;L4.isBYOKModel=xdc;var gdc=r6(),C5i=dR(),b5i=Sl(),Adc=ZG(),ydc=Sre(),Edc=hp(),_dc=J8(),vdc=lEt(),Cdc=o6(),bdc=Ap(),Sdc=Cre(),Tdc=Ls();function Idc(t){return t.type===C5i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===C5i.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(w0c,"hydrateBYOKErrorMessages");function R0c(t){return t?t instanceof i_t||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(R0c,"isBYOKModel");var i_t=class extends _0c.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{TR=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 TR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>TR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${TR._maxCustomHeaderCount}. Only first ${TR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=TR._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>TR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${TR._maxHeaderNameLength} characters, skipping.`);continue}if(!TR._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>TR._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,b0c.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(W4i.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,v0c.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(TR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return w0c(o)}};Y4.OpenAIEndpoint=i_t;Y4.OpenAIEndpoint=i_t=TR=A0c([E$(3,E0c.IDomainService),E$(4,y0c.IChatMLFetcher),E$(5,I0c.ITokenizerProvider),E$(6,x0c.IInstantiationService),E$(7,W4i.IConfigurationService),E$(8,T0c.IExperimentationService),E$(9,S0c.IChatWebSocketManager),E$(10,C0c.ILogService)],i_t)});var z4i=I(OD=>{"use strict";p();Object.defineProperty(OD,"__esModule",{value:!0});OD.EXTENSION_ID=OD.agentsToCommands=OD.GITHUB_PLATFORM_AGENT=void 0;OD.getAgentForIntent=P0c;var k0c=yR();OD.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";OD.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 P0c(t,e){if(Object.keys(OD.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(OD.agentsToCommands))if(!(e===k0c.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(P0c,"getAgentForIntent");OD.EXTENSION_ID="GitHub.copilot-chat"});var J4i=I(o_t=>{"use strict";p();Object.defineProperty(o_t,"__esModule",{value:!0});o_t.ChatMLFetcherTelemetrySender=void 0;var Y4i=qPr(),n2r=HPr(),K4i=r2r();function D0c(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(D0c,"getTurnFromBaseTelemetry");var i2r=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}){e.sendTelemetryEvent("response.success",{github:!0,microsoft:!0},{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:D0c(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,n2r.getImageTelemetryEventMeasurements)(g),isBYOK:(0,K4i.isBYOKModel)(c),isAuto:(0,Y4i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}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:k,isVisionRequest:D,isBYOK:N,isAuto:L,bytesReceived:B,issuedTime:Q,imageTelemetryMeasurements:M}){e.sendTelemetryEvent("response.cancelled",{github:!0,microsoft:!0},{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:k,timeToComplete:k,issuedTime:Q,isVisionRequest:D,...(0,n2r.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}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}){e.sendTelemetryEvent("response.error",{github:!0,microsoft:!0},{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,n2r.getImageTelemetryEventMeasurements)(f),isBYOK:(0,K4i.isBYOKModel)(o),isAuto:(0,Y4i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}};o_t.ChatMLFetcherTelemetrySender=i2r});var oBi=I(YT=>{"use strict";p();var N0c=YT&&YT.__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},IC=YT&&YT.__param||function(t,e){return function(r,n){e(r,n,t)}},l2r;Object.defineProperty(YT,"__esModule",{value:!0});YT.ChatMLFetcherImpl=YT.AbstractChatMLFetcher=void 0;YT.createTelemetryData=iBi;YT.locationToIntent=l_t;var M0c=wo(),O0c=SE(),B0c=A6(),L0c=xkr(),Vn=yR(),F0c=wkr(),G4e=C4e(),U0c=kkr(),_$=Il(),Q0c=PE(),s_t=qPr(),$4e=NEt(),q0c=HPr(),u2r=pp(),o2r=f6(),j0c=ey(),a_t=$Et(),zT=u6(),Z4i=P4e(),nBi=_6(),X4i=wEt(),pn=w4i(),wn=j4i(),H0c=r_t(),G0c=Lge(),s2r=e2r(),$0c=gp(),d2r=o0(),fAe=Xge(),V0c=H4i(),c_t=$4i(),W0c=L_(),eBi=Xc(),tBi=Ts(),z0c=Sc(),Y0c=ko(),K0c=Gh(),a2r=um(),J0c=Qs(),rBi=r2r(),Z0c=z4i(),X0c=Skr(),dAe=J4i(),u_t=class extends Y0c.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new z0c.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===Vn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};YT.AbstractChatMLFetcher=u_t;var f2r=class extends u_t{static{a(this,"ChatMLFetcherImpl")}static{l2r=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??l_t(c);E&&this._consecutiveWebSocketRetryFallbacks>=l2r._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,a2r.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}),k=(0,q0c.getImageTelemetryMeasurementsFromMessages)(l),D=fAe.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Vn.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 B0c.FetchStreamRecorder(s),Q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,q,F,U,W,V,G,Y;try{let re,j=emc(e.messages,R,o,this._configurationService,this._experimentationService);if(!j.isValid)re={type:pn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:pn.ChatFailKind.ValidationFailed,reason:j.reason};else{let ie,we=a(()=>ie??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),Ae;try{Ae=await this._authenticationService.getCopilotToken()}catch{}O=Ae?.username??this._authenticationService.copilotToken?.username;let De=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,Ae,e.location,T,R.n,r,we,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(re=De.result,q=De.fetcher,F=De.bytesReceived,U=De.statusCode,W=De.suspendEventSeen,V=De.resumeEventSeen,G=De.modelCallId,Y=De.otelSpan,Y?.setAttribute(wn.GenAiAttr.AGENT_NAME,n),Y){let J=(x.messages??x.input)?.filter(ae=>ae.role==="user"),z=J?.[J.length-1];if(z?.content){let ae=typeof z.content=="string"?z.content:JSON.stringify(z.content);Y.setAttribute(wn.CopilotChatAttr.USER_REQUEST,(0,wn.truncateForOTel)(ae,this._otelService.config.maxAttributeSizeChars))}let le=(0,wn.collectSystemTextsFromRequestBody)(x),K=(0,wn.toSystemInstructions)(le);K&&Y.setAttribute(wn.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,wn.truncateForOTel)(JSON.stringify(K),this._otelService.config.maxAttributeSizeChars))}if(Y){let Z=x.messages??x.input;if(Z){let K=Z.filter(ae=>ae.role!=="system");Y.setAttribute(wn.GenAiAttr.INPUT_MESSAGES,(0,wn.truncateForOTel)(JSON.stringify((0,wn.normalizeProviderMessages)(K)),this._otelService.config.maxAttributeSizeChars))}let J=(0,wn.stringifyToolDefinitionsForOTel)(x.tools);J&&Y.setAttribute(wn.GenAiAttr.TOOL_DEFINITIONS,(0,wn.truncateForOTel)(J,this._otelService.config.maxAttributeSizeChars));let z=tmc(x);z&&Y.setAttribute(wn.CopilotChatAttr.REQUEST_OPTIONS,(0,wn.truncateForOTel)(JSON.stringify(z),this._otelService.config.maxAttributeSizeChars));let le=rmc(x);le&&Y.setAttribute(wn.CopilotChatAttr.REQUEST_SHAPE,(0,wn.truncateForOTel)(JSON.stringify(le),this._otelService.config.maxAttributeSizeChars))}L=await we();let Te=d?.extensionId??Z0c.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:Te},tokenCount:L})}let X=Date.now()-D.issuedTime;switch(N?.markTimeToFirstToken(X),re.type){case pn.FetchResponseKind.Success:{let ie=await this.processSuccessfulResponse(re,l,k,x,T,w,L,X,B,D,o,h,v,b,q,F,W,V,G);if(ie.type===Vn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ie.category});let we=ie.value[0];if(we){let Ae=ie.category===zT.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: ${we} +`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(Idc,"hydrateBYOKErrorMessages");function xdc(t){return t?t instanceof CEt||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(xdc,"isBYOKModel");var CEt=class extends ydc.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,vdc.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(b5i.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,_dc.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 Idc(o)}};L4.OpenAIEndpoint=CEt;L4.OpenAIEndpoint=CEt=yR=mdc([t$(3,Adc.IDomainService),t$(4,gdc.IChatMLFetcher),t$(5,Sdc.ITokenizerProvider),t$(6,Tdc.IInstantiationService),t$(7,b5i.IConfigurationService),t$(8,bdc.IExperimentationService),t$(9,Cdc.IChatWebSocketManager),t$(10,Edc.ILogService)],CEt)});var S5i=I(xD=>{"use strict";p();Object.defineProperty(xD,"__esModule",{value:!0});xD.EXTENSION_ID=xD.agentsToCommands=xD.GITHUB_PLATFORM_AGENT=void 0;xD.getAgentForIntent=Rdc;var wdc=dR();xD.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";xD.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 Rdc(t,e){if(Object.keys(xD.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(xD.agentsToCommands))if(!(e===wdc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(Rdc,"getAgentForIntent");xD.EXTENSION_ID="GitHub.copilot-chat"});var x5i=I(bEt=>{"use strict";p();Object.defineProperty(bEt,"__esModule",{value:!0});bEt.ChatMLFetcherTelemetrySender=void 0;var T5i=LPr(),XPr=UPr(),I5i=ZPr();function Pdc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(Pdc,"getTurnFromBaseTelemetry");var ekr=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}){e.sendTelemetryEvent("response.success",{github:!0,microsoft:!0},{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:Pdc(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,XPr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,I5i.isBYOKModel)(c),isAuto:(0,T5i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}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}){e.sendTelemetryEvent("response.cancelled",{github:!0,microsoft:!0},{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,XPr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}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}){e.sendTelemetryEvent("response.error",{github:!0,microsoft:!0},{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,XPr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,I5i.isBYOKModel)(o),isAuto:(0,T5i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}};bEt.ChatMLFetcherTelemetrySender=ekr});var O5i=I(HT=>{"use strict";p();var kdc=HT&&HT.__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},Cv=HT&&HT.__param||function(t,e){return function(r,n){e(r,n,t)}},okr;Object.defineProperty(HT,"__esModule",{value:!0});HT.ChatMLFetcherImpl=HT.AbstractChatMLFetcher=void 0;HT.createTelemetryData=M5i;HT.locationToIntent=xEt;var Ddc=Io(),Ndc=vE(),Mdc=r6(),Odc=bRr(),Vn=dR(),Bdc=SRr(),A4e=z5e(),Ldc=IRr(),r$=Sl(),Fdc=wE(),SEt=LPr(),y4e=Jyt(),Udc=UPr(),skr=hp(),tkr=J8(),Qdc=oy(),TEt=lEt(),jT=Y8(),w5i=i4e(),N5i=o6(),R5i=Vyt(),fn=i5i(),xn=y5i(),qdc=_Et(),jdc=hge(),rkr=KPr(),Hdc=Ap(),akr=o0(),Hge=Pge(),Gdc=E5i(),IEt=v5i(),$dc=M_(),P5i=Jc(),k5i=Cs(),Vdc=Cc(),Wdc=wo(),zdc=Gh(),nkr=um(),Ydc=Ls(),D5i=ZPr(),Kdc=S5i(),Jdc=_Rr(),jge=x5i(),wEt=class extends Wdc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new Vdc.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===Vn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};HT.AbstractChatMLFetcher=wEt;var ckr=class extends wEt{static{a(this,"ChatMLFetcherImpl")}static{okr=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??xEt(c);E&&this._consecutiveWebSocketRetryFallbacks>=okr._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,nkr.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,Udc.getImageTelemetryMeasurementsFromMessages)(l),D=Hge.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Vn.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 Mdc.FetchStreamRecorder(s),j=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,q,Q,U,z,W,$,J;try{let ne,H=Zdc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ne={type:fn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:fn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ae,Oe=a(()=>ae??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ve;try{ve=await this._authenticationService.getCopilotToken()}catch{}O=ve?.username??this._authenticationService.copilotToken?.username;let Fe=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,ve,e.location,T,R.n,r,Oe,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ne=Fe.result,q=Fe.fetcher,Q=Fe.bytesReceived,U=Fe.statusCode,z=Fe.suspendEventSeen,W=Fe.resumeEventSeen,$=Fe.modelCallId,J=Fe.otelSpan,J?.setAttribute(xn.GenAiAttr.AGENT_NAME,n),J){let ee=(x.messages??x.input)?.filter(ue=>ue.role==="user"),K=ee?.[ee.length-1];if(K?.content){let ue=typeof K.content=="string"?K.content:JSON.stringify(K.content);J.setAttribute(xn.CopilotChatAttr.USER_REQUEST,(0,xn.truncateForOTel)(ue,this._otelService.config.maxAttributeSizeChars))}let fe=(0,xn.collectSystemTextsFromRequestBody)(x),X=(0,xn.toSystemInstructions)(fe);X&&J.setAttribute(xn.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,xn.truncateForOTel)(JSON.stringify(X),this._otelService.config.maxAttributeSizeChars))}if(J){let Z=x.messages??x.input;if(Z){let X=Z.filter(ue=>ue.role!=="system");J.setAttribute(xn.GenAiAttr.INPUT_MESSAGES,(0,xn.truncateForOTel)(JSON.stringify((0,xn.normalizeProviderMessages)(X)),this._otelService.config.maxAttributeSizeChars))}let ee=(0,xn.stringifyToolDefinitionsForOTel)(x.tools);ee&&J.setAttribute(xn.GenAiAttr.TOOL_DEFINITIONS,(0,xn.truncateForOTel)(ee,this._otelService.config.maxAttributeSizeChars));let K=Xdc(x);K&&J.setAttribute(xn.CopilotChatAttr.REQUEST_OPTIONS,(0,xn.truncateForOTel)(JSON.stringify(K),this._otelService.config.maxAttributeSizeChars));let fe=efc(x);fe&&J.setAttribute(xn.CopilotChatAttr.REQUEST_SHAPE,(0,xn.truncateForOTel)(JSON.stringify(fe),this._otelService.config.maxAttributeSizeChars))}L=await Oe();let Pe=d?.extensionId??Kdc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:Pe},tokenCount:L})}let re=Date.now()-D.issuedTime;switch(N?.markTimeToFirstToken(re),ne.type){case fn.FetchResponseKind.Success:{let ae=await this.processSuccessfulResponse(ne,l,P,x,T,w,L,re,B,D,o,h,v,b,q,Q,z,W,$);if(ae.type===Vn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ae.category});let Oe=ae.value[0];if(Oe){let ve=ae.category===jT.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: ${we} +`:`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} -`,De=[...l,{role:M0c.Raw.ChatRole.User,content:(0,G4e.toTextParts)(Ae)}],Te=await this.fetchMany({...e,debugName:"retry-"+n,messages:De,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ie.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:Q},r);if(N?.resolve(Te,B.deltas),Te.type===Vn.ChatFetchResponseType.Success)return Te}}return{type:Vn.ChatFetchResponseType.Filtered,category:ie.category,reason:"Response got filtered.",requestId:ie.requestId,serverRequestId:ie.serverRequestId}}if(N?.resolve(ie,B.deltas),ie.type===Vn.ChatFetchResponseType.Success&&ie.usage){typeof ie.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ie.usage.copilot_usage.total_nano_aiu,y??A);let we=(0,wn.normalizeResponseModel)(o.model,ie.resolvedModel),Ae={operationName:wn.GenAiOperationName.CHAT,providerName:wn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:we};ie.usage.prompt_tokens&&wn.GenAiMetrics.recordTokenUsage(this._otelService,ie.usage.prompt_tokens,"input",Ae),ie.usage.completion_tokens&&wn.GenAiMetrics.recordTokenUsage(this._otelService,ie.usage.completion_tokens,"output",Ae),Y?.setAttributes({[wn.GenAiAttr.USAGE_INPUT_TOKENS]:ie.usage.prompt_tokens??0,[wn.GenAiAttr.USAGE_OUTPUT_TOKENS]:ie.usage.completion_tokens??0,[wn.GenAiAttr.RESPONSE_MODEL]:we??o.model,[wn.GenAiAttr.RESPONSE_ID]:ie.requestId,[wn.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ie.usage.prompt_tokens_details?.cached_tokens?{[wn.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ie.usage.prompt_tokens_details.cached_tokens}:{},...ie.usage.prompt_tokens_details?.cache_creation_input_tokens?{[wn.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ie.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[wn.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:X,...ie.serverRequestId?{[wn.CopilotChatAttr.SERVER_REQUEST_ID]:ie.serverRequestId}:{},...ie.usage.completion_tokens_details?.reasoning_tokens?{[wn.GenAiAttr.USAGE_REASONING_TOKENS]:ie.usage.completion_tokens_details.reasoning_tokens,[wn.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ie.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ie.usage.copilot_usage?.total_nano_aiu=="number"?{[wn.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ie.usage.copilot_usage.total_nano_aiu}:{}})}if(Y&&ie.type===Vn.ChatFetchResponseType.Success){let we=B.deltas.map(Z=>Z.text).join(""),Ae=B.deltas.filter(Z=>Z.copilotToolCalls?.length).flatMap(Z=>Z.copilotToolCalls.map(J=>({type:"tool_call",id:J.id,name:J.name,arguments:J.arguments}))),De=[];if(we&&De.push({type:"text",content:we}),De.push(...Ae),De.length>0&&Y.setAttribute(wn.GenAiAttr.OUTPUT_MESSAGES,(0,wn.truncateForOTel)(JSON.stringify([{role:"assistant",parts:De}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(Z=>Z.thinking)){let J=B.deltas.filter(z=>z.thinking&&!(0,V0c.isEncryptedThinkingDelta)(z.thinking)&&z.thinking.text).map(z=>{let le=z.thinking;return"encrypted"in le?"":Array.isArray(le.text)?le.text.join(""):le.text??""}).join("");Y.setAttribute(wn.CopilotChatAttr.REASONING_CONTENT,(0,wn.truncateForOTel)(J||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}return(0,wn.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ie.type===Vn.ChatFetchResponseType.Success?{id:ie.requestId,model:(0,wn.normalizeResponseModel)(o.model,ie.resolvedModel),finishReasons:["stop"],inputTokens:ie.usage?.prompt_tokens,outputTokens:ie.usage?.completion_tokens}:void 0),Y?.end(),Y=void 0,X>0&&wn.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,X/1e3),E&&ie.type===Vn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ie}case pn.FetchResponseKind.Canceled:return dAe.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:q,suspendEventSeen:W,resumeEventSeen:V},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:X,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,rBi.isBYOKModel)(o),isAuto:(0,s_t.isAutoModel)(o),bytesReceived:F,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}),N?.resolveWithCancelation(),Y?.setAttributes({[wn.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[wn.CopilotChatAttr.CANCELED]:!0}),Y?.end(),Y=void 0,this.processCanceledResponse(re,T,B,f);case pn.FetchResponseKind.Failed:{let ie=this.processFailedResponse(re,T,(0,s_t.isAutoModel)(o)===1),Ae=this._configurationService.getExperimentBasedConfig(_$.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(Z=>parseInt(Z.trim(),10)),De=Q&&U!==void 0&&Ae.includes(U),Te=Q&&E&&(re.failKind===pn.ChatFailKind.ServerError||re.failKind===pn.ChatFailKind.Unknown);if(De||Te){let{retryResult:Z}=await this._retryAfterError({opts:e,processed:ie,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:X,transport:b,actualFetcher:q,bytesReceived:F,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:W,resumeEventSeen:V,interactionType:v});if(Z)return Z}return dAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ie,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:X,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:b,interactionType:v,fetcher:q,bytesReceived:F,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:W,resumeEventSeen:V}),N?.resolve(ie),ie}}}catch(re){Y&&(Y.setStatus(2,re instanceof Error?re.message:String(re)),Y.setAttribute(wn.StdAttr.ERROR_TYPE,re instanceof Error?re.constructor.name:"Error"),Y.setAttribute(wn.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),Y.recordException(re),Y.end());let j=Date.now()-D.issuedTime;re.fetcherId&&(q=re.fetcherId),re.suspendEventSeen&&(W=!0),re.resumeEventSeen&&(V=!0);let X=this.processError(re,T,re.gitHubRequestId,O,(0,s_t.isAutoModel)(o)===1),ie=Q&&X.type===Vn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(_$.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),we=Q&&E&&(X.type===Vn.ChatFetchResponseType.NetworkError||X.type===Vn.ChatFetchResponseType.Failed);if(ie||we){let{retryResult:Ae,connectivityTestError:De,connectivityTestErrorGitHubRequestId:Te}=await this._retryAfterError({opts:e,processed:X,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:j,transport:b,actualFetcher:q,bytesReceived:re.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:W,resumeEventSeen:V,interactionType:v});if(Ae)return Ae;f={...f,connectivityTestError:De,connectivityTestErrorGitHubRequestId:Te}}return X.type===Vn.ChatFetchResponseType.Canceled?dAe.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:q,suspendEventSeen:W,resumeEventSeen:V},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:j,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,rBi.isBYOKModel)(o),isAuto:(0,s_t.isAutoModel)(o),bytesReceived:re.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}):dAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:X,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:j,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:b,interactionType:v,fetcher:q,bytesReceived:re.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:W,resumeEventSeen:V}),N?.resolve(X),X}}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,u2r.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,k=this._configurationService.getExperimentBasedConfig(_$.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Vn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&k,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};dAe.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===Vn.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(_$.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Vn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,k=!1,D=!1,N=this._powerService.onDidSuspend(()=>{k=!0,this._logService.info(`System suspended during streaming request ${u} (${Vn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Vn.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:k||void 0,resumeEventSeen:D||void 0}}catch(B){throw k&&(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:pn.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,s2r.getCurrentCapturingToken)()?.chatSessionId,k=(0,s2r.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,s2r.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[wn.GenAiAttr.OPERATION_NAME]:wn.GenAiOperationName.CHAT,[wn.GenAiAttr.PROVIDER_NAME]:wn.GenAiProviderName.GITHUB,[wn.GenAiAttr.REQUEST_MODEL]:e.model,[wn.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[wn.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[wn.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[wn.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[wn.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[wn.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[wn.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[wn.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...k?{[wn.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:k}:{},...D?{[wn.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,a_t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${Q} due to missing key`),(0,X4i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${Q} due to missing key`),{result:{type:pn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:pn.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(wn.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;wn.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:wn.GenAiOperationName.CHAT,providerName:wn.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=l_t(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,a2r.generateUuid)(),R=fAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,o2r.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,wn.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,d2r.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,wn.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let k=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($4e.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,$4e.getResponsesApiCompactionThresholdFromBody)(r)),B=new eBi.AsyncIterableObject(async M=>{try{await new Promise((q,F)=>{D.onEvent(U=>{let W=L.push(U,o);if(W&&((0,$4e.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,W,N),M.emitOne(W)),U.type==="response.completed"){let V=U.copilot_quota_snapshots;V&&typeof V=="object"&&this._chatQuotaService.processQuotaSnapshots(V)}}),D.onCAPIError(U=>{let W=new Error(`${U.error.message} (${U.error.code})`);W.gitHubRequestId=x.gitHubRequestId,W.capiWebSocketError=U,F(W)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,tBi.isCancellationError)(U)){F(U);return}let W=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",W.properties,W.measurements);let V=Date.now()-k;R.measurements.totalTimeMs=V,R.properties.error=U.message,this._logService.debug(`request.error: [websocket], took ${V} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),F(U)}),D.done.then(q,F)});let O=Date.now()-k;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 q=(0,$4e.responseApiInputToRawMessagesForLogging)(r);O=(0,zT.rawMessageToCAPI)(q)}catch(q){this._logService.error("Failed to convert Response API input to messages for telemetry:",q),O=[]}(0,Z4i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),Q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:pn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,nBi.isCAPIWebSocketError)(Q)){let M=Date.now()-k;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:pn.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,a2r.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:pn.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=iBi(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 eBi.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:pn.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=fAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.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,wn.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,d2r.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,wn.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=l_t(s);return this._instantiationService.invokeFunction(a_t.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,o2r.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,a_t.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,a_t.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,$4e.responseApiInputToRawMessagesForLogging)(n);E=(0,zT.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,Z4i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,o2r.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:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.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:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.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:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.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:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.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:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service +`,Fe=[...l,{role:Ddc.Raw.ChatRole.User,content:(0,A4e.toTextParts)(ve)}],Pe=await this.fetchMany({...e,debugName:"retry-"+n,messages:Fe,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ae.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:j},r);if(N?.resolve(Pe,B.deltas),Pe.type===Vn.ChatFetchResponseType.Success)return Pe}}return{type:Vn.ChatFetchResponseType.Filtered,category:ae.category,reason:"Response got filtered.",requestId:ae.requestId,serverRequestId:ae.serverRequestId}}if(N?.resolve(ae,B.deltas),ae.type===Vn.ChatFetchResponseType.Success&&ae.usage){typeof ae.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ae.usage.copilot_usage.total_nano_aiu,y??A);let Oe=(0,xn.normalizeResponseModel)(o.model,ae.resolvedModel),ve={operationName:xn.GenAiOperationName.CHAT,providerName:xn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:Oe};ae.usage.prompt_tokens&&xn.GenAiMetrics.recordTokenUsage(this._otelService,ae.usage.prompt_tokens,"input",ve),ae.usage.completion_tokens&&xn.GenAiMetrics.recordTokenUsage(this._otelService,ae.usage.completion_tokens,"output",ve),J?.setAttributes({[xn.GenAiAttr.USAGE_INPUT_TOKENS]:ae.usage.prompt_tokens??0,[xn.GenAiAttr.USAGE_OUTPUT_TOKENS]:ae.usage.completion_tokens??0,[xn.GenAiAttr.RESPONSE_MODEL]:Oe??o.model,[xn.GenAiAttr.RESPONSE_ID]:ae.requestId,[xn.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ae.usage.prompt_tokens_details?.cached_tokens?{[xn.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ae.usage.prompt_tokens_details.cached_tokens}:{},...ae.usage.prompt_tokens_details?.cache_creation_input_tokens?{[xn.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ae.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[xn.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,...ae.serverRequestId?{[xn.CopilotChatAttr.SERVER_REQUEST_ID]:ae.serverRequestId}:{},...ae.usage.completion_tokens_details?.reasoning_tokens?{[xn.GenAiAttr.USAGE_REASONING_TOKENS]:ae.usage.completion_tokens_details.reasoning_tokens,[xn.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ae.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ae.usage.copilot_usage?.total_nano_aiu=="number"?{[xn.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ae.usage.copilot_usage.total_nano_aiu}:{}})}if(J&&ae.type===Vn.ChatFetchResponseType.Success){let Oe=B.deltas.map(Z=>Z.text).join(""),ve=B.deltas.filter(Z=>Z.copilotToolCalls?.length).flatMap(Z=>Z.copilotToolCalls.map(ee=>({type:"tool_call",id:ee.id,name:ee.name,arguments:ee.arguments}))),Fe=[];if(Oe&&Fe.push({type:"text",content:Oe}),Fe.push(...ve),Fe.length>0&&J.setAttribute(xn.GenAiAttr.OUTPUT_MESSAGES,(0,xn.truncateForOTel)(JSON.stringify([{role:"assistant",parts:Fe}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(Z=>Z.thinking)){let ee=B.deltas.filter(K=>K.thinking&&!(0,Gdc.isEncryptedThinkingDelta)(K.thinking)&&K.thinking.text).map(K=>{let fe=K.thinking;return"encrypted"in fe?"":Array.isArray(fe.text)?fe.text.join(""):fe.text??""}).join("");J.setAttribute(xn.CopilotChatAttr.REASONING_CONTENT,(0,xn.truncateForOTel)(ee||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}return(0,xn.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ae.type===Vn.ChatFetchResponseType.Success?{id:ae.requestId,model:(0,xn.normalizeResponseModel)(o.model,ae.resolvedModel),finishReasons:["stop"],inputTokens:ae.usage?.prompt_tokens,outputTokens:ae.usage?.completion_tokens}:void 0),J?.end(),J=void 0,re>0&&xn.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),E&&ae.type===Vn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ae}case fn.FetchResponseKind.Canceled:return jge.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:q,suspendEventSeen:z,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,D5i.isBYOKModel)(o),isAuto:(0,SEt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),J?.setAttributes({[xn.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[xn.CopilotChatAttr.CANCELED]:!0}),J?.end(),J=void 0,this.processCanceledResponse(ne,T,B,f);case fn.FetchResponseKind.Failed:{let ae=this.processFailedResponse(ne,T,(0,SEt.isAutoModel)(o)===1),ve=this._configurationService.getExperimentBasedConfig(r$.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(Z=>parseInt(Z.trim(),10)),Fe=j&&U!==void 0&&ve.includes(U),Pe=j&&E&&(ne.failKind===fn.ChatFailKind.ServerError||ne.failKind===fn.ChatFailKind.Unknown);if(Fe||Pe){let{retryResult:Z}=await this._retryAfterError({opts:e,processed:ae,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:q,bytesReceived:Q,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:z,resumeEventSeen:W,interactionType:v});if(Z)return Z}return jge.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ae,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:q,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:z,resumeEventSeen:W}),N?.resolve(ae),ae}}}catch(ne){J&&(J.setStatus(2,ne instanceof Error?ne.message:String(ne)),J.setAttribute(xn.StdAttr.ERROR_TYPE,ne instanceof Error?ne.constructor.name:"Error"),J.setAttribute(xn.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),J.recordException(ne),J.end());let H=Date.now()-D.issuedTime;ne.fetcherId&&(q=ne.fetcherId),ne.suspendEventSeen&&(z=!0),ne.resumeEventSeen&&(W=!0);let re=this.processError(ne,T,ne.gitHubRequestId,O,(0,SEt.isAutoModel)(o)===1),ae=j&&re.type===Vn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(r$.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Oe=j&&E&&(re.type===Vn.ChatFetchResponseType.NetworkError||re.type===Vn.ChatFetchResponseType.Failed);if(ae||Oe){let{retryResult:ve,connectivityTestError:Fe,connectivityTestErrorGitHubRequestId:Pe}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:q,bytesReceived:ne.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:z,resumeEventSeen:W,interactionType:v});if(ve)return ve;f={...f,connectivityTestError:Fe,connectivityTestErrorGitHubRequestId:Pe}}return re.type===Vn.ChatFetchResponseType.Canceled?jge.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:q,suspendEventSeen:z,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,D5i.isBYOKModel)(o),isAuto:(0,SEt.isAutoModel)(o),bytesReceived:ne.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):jge.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:q,bytesReceived:ne.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:z,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,skr.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(r$.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Vn.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};jge.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===Vn.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(r$.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Vn.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} (${Vn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Vn.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:fn.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,rkr.getCurrentCapturingToken)()?.chatSessionId,P=(0,rkr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,rkr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[xn.GenAiAttr.OPERATION_NAME]:xn.GenAiOperationName.CHAT,[xn.GenAiAttr.PROVIDER_NAME]:xn.GenAiProviderName.GITHUB,[xn.GenAiAttr.REQUEST_MODEL]:e.model,[xn.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[xn.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[xn.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[xn.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[xn.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[xn.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[xn.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[xn.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[xn.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[xn.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,TEt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${j} due to missing key`),(0,R5i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${j} due to missing key`),{result:{type:fn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:fn.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(xn.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;xn.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:xn.GenAiOperationName.CHAT,providerName:xn.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=xEt(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,nkr.generateUuid)(),R=Hge.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,tkr.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,xn.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,akr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,xn.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(y4e.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,y4e.getResponsesApiCompactionThresholdFromBody)(r)),B=new P5i.AsyncIterableObject(async M=>{try{await new Promise((q,Q)=>{D.onEvent(U=>{let z=L.push(U,o);if(z&&((0,y4e.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,z,N),M.emitOne(z)),U.type==="response.completed"){let W=U.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(U=>{let z=new Error(`${U.error.message} (${U.error.code})`);z.gitHubRequestId=x.gitHubRequestId,z.capiWebSocketError=U,Q(z)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,k5i.isCancellationError)(U)){Q(U);return}let z=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",z.properties,z.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(q,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 q=(0,y4e.responseApiInputToRawMessagesForLogging)(r);O=(0,jT.rawMessageToCAPI)(q)}catch(q){this._logService.error("Failed to convert Response API input to messages for telemetry:",q),O=[]}(0,w5i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),j=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:fn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,N5i.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:fn.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,nkr.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:fn.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=M5i(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 P5i.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:fn.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=Hge.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.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,xn.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,akr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,xn.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=xEt(s);return this._instantiationService.invokeFunction(TEt.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,tkr.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,TEt.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,TEt.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,y4e.responseApiInputToRawMessagesForLogging)(n);E=(0,jT.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,w5i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,tkr.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:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.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:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.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:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.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:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.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:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service -`+s};if(r.status===424)return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.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:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.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:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,X4i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.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 k of e.chatCompletions)dAe.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:k,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(k,f?.properties)||T.push(k);let w=new Set([zT.FinishedCompletionReason.Stop,zT.FinishedCompletionReason.ClientTrimmed,zT.FinishedCompletionReason.FunctionCall,zT.FinishedCompletionReason.ToolCalls]),R=T.filter(k=>w.has(k.finishReason));if(R.length>=1)return{type:Vn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(k=>(0,G4e.getTextPart)(k.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case zT.FinishedCompletionReason.ContentFilter:return{type:Vn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??zT.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(k=>(0,G4e.getTextPart)(k.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case zT.FinishedCompletionReason.Length:return{type:Vn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,G4e.getTextPart)(x.message.content)};case zT.FinishedCompletionReason.ServerError:return{type:Vn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:Vn.ChatFetchResponseType.Unknown,reason:Vn.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,c_t.calculateLineRepetitionStats)((0,G4e.getTextPart)(e.message.content)),o=(0,c_t.isRepetitive)(e.tokens);if(o){let s=fAe.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,c_t.calculateLineRepetitionStats)(o);if((0,c_t.isRepetitive)(s)){let d=fAe.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:Vn.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===pn.ChatFailKind.RateLimited)return{type:Vn.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===pn.ChatFailKind.QuotaExceeded)return{type:Vn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===pn.ChatFailKind.OffTopic)return{type:Vn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===pn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Vn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.ServerError)return{type:Vn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.ContentFilter)return{type:Vn.ChatFetchResponseType.PromptFiltered,reason:s,category:zT.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.AgentUnauthorized)return{type:Vn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.AgentFailedDependency)return{type:Vn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Vn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===pn.ChatFailKind.NotFound?{type:Vn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===pn.ChatFailKind.InvalidPreviousResponseId?{type:Vn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Vn.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:Vn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,tBi.isCancellationError)(e))return{type:Vn.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:Vn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(W0c.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,u2r.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Vn.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:Vn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Vn.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:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.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:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.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:Vn.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:Vn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Vn.ChatFetchResponseType.PromptFiltered,reason:c,category:zT.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:Vn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:Vn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:Vn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,K0c.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};YT.ChatMLFetcherImpl=f2r;YT.ChatMLFetcherImpl=f2r=l2r=N0c([IC(0,j0c.IFetcherService),IC(1,d2r.ITelemetryService),IC(2,G0c.IRequestLogger),IC(3,u2r.ILogService),IC(4,O0c.IAuthenticationService),IC(5,U0c.IInteractionService),IC(6,L0c.IChatQuotaService),IC(7,Q0c.ICAPIClientService),IC(8,F0c.IConversationOptions),IC(9,_$.IConfigurationService),IC(10,$0c.IExperimentationService),IC(11,X0c.IPowerService),IC(12,J0c.IInstantiationService),IC(13,nBi.IChatWebSocketManager),IC(14,H0c.IOTelService)],f2r);function emc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:c2r("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:c2r("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:c2r("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>_$.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${_$.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-_$.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(emc,"isValidChatPayload");function c2r(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(c2r,"asUnexpected");function iBi(t,e,r){return fAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.ChatLocation.toString(e),headerRequestId:r})}a(iBi,"createTelemetryData");function l_t(t){switch(t){case Vn.ChatLocation.Panel:return"conversation-panel";case Vn.ChatLocation.Editor:return"conversation-inline";case Vn.ChatLocation.EditingSession:return"conversation-edits";case Vn.ChatLocation.Notebook:return"conversation-notebook";case Vn.ChatLocation.Terminal:return"conversation-terminal";case Vn.ChatLocation.Other:return"conversation-other";case Vn.ChatLocation.Agent:return"conversation-agent";case Vn.ChatLocation.ResponsesProxy:return"responses-proxy";case Vn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(l_t,"locationToIntent");function tmc(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(tmc,"pickCacheRelevantRequestOptions");function rmc(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(rmc,"pickRequestShapeMetadata")});var h2r=I(pAe=>{"use strict";p();Object.defineProperty(pAe,"__esModule",{value:!0});pAe.NullSimilarFilesContextService=pAe.ISimilarFilesContextService=void 0;var nmc=rn();pAe.ISimilarFilesContextService=(0,nmc.createServiceIdentifier)("ISimilarFilesContextService");var p2r=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};pAe.NullSimilarFilesContextService=p2r});var m2r=I(d_t=>{"use strict";p();Object.defineProperty(d_t,"__esModule",{value:!0});d_t.IDiffService=void 0;var imc=rn();d_t.IDiffService=(0,imc.createServiceIdentifier)("IDiffService")});var sBi=I(g2r=>{"use strict";p();Object.defineProperty(g2r,"__esModule",{value:!0});g2r.createProxyXtabEndpoint=cmc;var omc=(bre(),Ca(vre)),smc=iAe(),amc=qre();function cmc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:omc.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:smc.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(amc.ChatEndpoint,r)}a(cmc,"createProxyXtabEndpoint")});var Hre=I(f_t=>{"use strict";p();Object.defineProperty(f_t,"__esModule",{value:!0});f_t.DocumentId=void 0;var lmc=DKe(),aBi=hA(),umc=Ku(),A2r=class t{static{a(this,"DocumentId")}static{this._cache=new lmc.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=umc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,aBi.basename)(this.uri)}get extension(){return(0,aBi.extname)(this.uri)}toUri(){return this._uri}};f_t.DocumentId=A2r});var y2r=I(p_t=>{"use strict";p();Object.defineProperty(p_t,"__esModule",{value:!0});p_t.NextCursorLinePrediction=void 0;var cBi;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(cBi||(p_t.NextCursorLinePrediction=cBi={}))});var h_t=I(C$=>{"use strict";p();Object.defineProperty(C$,"__esModule",{value:!0});C$.NullUndesiredModelsManager=C$.IUndesiredModelsManager=C$.IInlineEditsModelService=void 0;var lBi=rn(),dmc=Sc();C$.IInlineEditsModelService=(0,lBi.createServiceIdentifier)("IInlineEditsModelService");C$.IUndesiredModelsManager=(0,lBi.createServiceIdentifier)("IUndesiredModelsManager");var E2r=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=dmc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};C$.NullUndesiredModelsManager=E2r});var uBi=I(v6=>{"use strict";p();Object.defineProperty(v6,"__esModule",{value:!0});v6.IgnoreWhitespaceOnlyChanges=v6.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;v6.editWouldDeleteWhatWasJustInserted=fmc;v6.editIsDeletion=v2r;v6.editWouldDeleteWhatWasJustInserted2=pmc;var _2r=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}};v6.IgnoreWhitespaceOnlyChanges=C2r;function fmc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!v2r(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(fmc,"editWouldDeleteWhatWasJustInserted");function v2r(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(v2r,"editIsDeletion");function pmc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!v2r(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(pmc,"editWouldDeleteWhatWasJustInserted2")});var S2r=I(hAe=>{"use strict";p();Object.defineProperty(hAe,"__esModule",{value:!0});hAe.NulSimulationTestContext=hAe.ISimulationTestContext=void 0;var hmc=rn();hAe.ISimulationTestContext=(0,hmc.createServiceIdentifier)("ISimulationTestContext");var b2r=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};hAe.NulSimulationTestContext=b2r});function Gre(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(V4e(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(T2r(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(T2r(b));return c=15}if(V4e(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 T2r(t){return t===32||t===9}function V4e(t){return t===10||t===13}function mAe(t){return t>=48&&t<=57}var dBi,m_t=me(()=>{"use strict";p();a(Gre,"createScanner");a(T2r,"isWhiteSpace");a(V4e,"isLineBreak");a(mAe,"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"})(dBi||(dBi={}))});var KT,gAe,I2r,fBi,pBi=me(()=>{p();KT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),gAe=200,I2r={" ":{"\n":new Array(gAe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(gAe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(gAe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}," ":{"\n":new Array(gAe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(gAe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(gAe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}},fBi=[` +`+s};if(r.status===424)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.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:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.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:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,R5i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.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)jge.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([jT.FinishedCompletionReason.Stop,jT.FinishedCompletionReason.ClientTrimmed,jT.FinishedCompletionReason.FunctionCall,jT.FinishedCompletionReason.ToolCalls]),R=T.filter(P=>w.has(P.finishReason));if(R.length>=1)return{type:Vn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(P=>(0,A4e.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case jT.FinishedCompletionReason.ContentFilter:return{type:Vn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??jT.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,A4e.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case jT.FinishedCompletionReason.Length:return{type:Vn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,A4e.getTextPart)(x.message.content)};case jT.FinishedCompletionReason.ServerError:return{type:Vn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:Vn.ChatFetchResponseType.Unknown,reason:Vn.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,IEt.calculateLineRepetitionStats)((0,A4e.getTextPart)(e.message.content)),o=(0,IEt.isRepetitive)(e.tokens);if(o){let s=Hge.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,IEt.calculateLineRepetitionStats)(o);if((0,IEt.isRepetitive)(s)){let d=Hge.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:Vn.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===fn.ChatFailKind.RateLimited)return{type:Vn.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===fn.ChatFailKind.QuotaExceeded)return{type:Vn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===fn.ChatFailKind.OffTopic)return{type:Vn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===fn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Vn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ServerError)return{type:Vn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ContentFilter)return{type:Vn.ChatFetchResponseType.PromptFiltered,reason:s,category:jT.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.AgentUnauthorized)return{type:Vn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.AgentFailedDependency)return{type:Vn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Vn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===fn.ChatFailKind.NotFound?{type:Vn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===fn.ChatFailKind.InvalidPreviousResponseId?{type:Vn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Vn.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:Vn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,k5i.isCancellationError)(e))return{type:Vn.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:Vn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error($dc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,skr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Vn.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:Vn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Vn.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:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.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:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.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:Vn.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:Vn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Vn.ChatFetchResponseType.PromptFiltered,reason:c,category:jT.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:Vn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:Vn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:Vn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,zdc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};HT.ChatMLFetcherImpl=ckr;HT.ChatMLFetcherImpl=ckr=okr=kdc([Cv(0,Qdc.IFetcherService),Cv(1,akr.ITelemetryService),Cv(2,jdc.IRequestLogger),Cv(3,skr.ILogService),Cv(4,Ndc.IAuthenticationService),Cv(5,Ldc.IInteractionService),Cv(6,Odc.IChatQuotaService),Cv(7,Fdc.ICAPIClientService),Cv(8,Bdc.IConversationOptions),Cv(9,r$.IConfigurationService),Cv(10,Hdc.IExperimentationService),Cv(11,Jdc.IPowerService),Cv(12,Ydc.IInstantiationService),Cv(13,N5i.IChatWebSocketManager),Cv(14,qdc.IOTelService)],ckr);function Zdc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:ikr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:ikr("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:ikr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>r$.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${r$.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-r$.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(Zdc,"isValidChatPayload");function ikr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(ikr,"asUnexpected");function M5i(t,e,r){return Hge.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.ChatLocation.toString(e),headerRequestId:r})}a(M5i,"createTelemetryData");function xEt(t){switch(t){case Vn.ChatLocation.Panel:return"conversation-panel";case Vn.ChatLocation.Editor:return"conversation-inline";case Vn.ChatLocation.EditingSession:return"conversation-edits";case Vn.ChatLocation.Notebook:return"conversation-notebook";case Vn.ChatLocation.Terminal:return"conversation-terminal";case Vn.ChatLocation.Other:return"conversation-other";case Vn.ChatLocation.Agent:return"conversation-agent";case Vn.ChatLocation.ResponsesProxy:return"responses-proxy";case Vn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(xEt,"locationToIntent");function Xdc(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(Xdc,"pickCacheRelevantRequestOptions");function efc(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(efc,"pickRequestShapeMetadata")});var ukr=I(Gge=>{"use strict";p();Object.defineProperty(Gge,"__esModule",{value:!0});Gge.NullSimilarFilesContextService=Gge.ISimilarFilesContextService=void 0;var tfc=rn();Gge.ISimilarFilesContextService=(0,tfc.createServiceIdentifier)("ISimilarFilesContextService");var lkr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Gge.NullSimilarFilesContextService=lkr});var dkr=I(REt=>{"use strict";p();Object.defineProperty(REt,"__esModule",{value:!0});REt.IDiffService=void 0;var rfc=rn();REt.IDiffService=(0,rfc.createServiceIdentifier)("IDiffService")});var B5i=I(fkr=>{"use strict";p();Object.defineProperty(fkr,"__esModule",{value:!0});fkr.createProxyXtabEndpoint=sfc;var nfc=(sre(),ya(ore)),ifc=Oge(),ofc=Sre();function sfc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:nfc.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:ifc.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(ofc.ChatEndpoint,r)}a(sfc,"createProxyXtabEndpoint")});var Ire=I(PEt=>{"use strict";p();Object.defineProperty(PEt,"__esModule",{value:!0});PEt.DocumentId=void 0;var afc=GYe(),L5i=AA(),cfc=Ku(),pkr=class t{static{a(this,"DocumentId")}static{this._cache=new afc.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=cfc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,L5i.basename)(this.uri)}get extension(){return(0,L5i.extname)(this.uri)}toUri(){return this._uri}};PEt.DocumentId=pkr});var hkr=I(kEt=>{"use strict";p();Object.defineProperty(kEt,"__esModule",{value:!0});kEt.NextCursorLinePrediction=void 0;var F5i;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(F5i||(kEt.NextCursorLinePrediction=F5i={}))});var DEt=I(n$=>{"use strict";p();Object.defineProperty(n$,"__esModule",{value:!0});n$.NullUndesiredModelsManager=n$.IUndesiredModelsManager=n$.IInlineEditsModelService=void 0;var U5i=rn(),lfc=Cc();n$.IInlineEditsModelService=(0,U5i.createServiceIdentifier)("IInlineEditsModelService");n$.IUndesiredModelsManager=(0,U5i.createServiceIdentifier)("IUndesiredModelsManager");var mkr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=lfc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};n$.NullUndesiredModelsManager=mkr});var Q5i=I(a6=>{"use strict";p();Object.defineProperty(a6,"__esModule",{value:!0});a6.IgnoreWhitespaceOnlyChanges=a6.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;a6.editWouldDeleteWhatWasJustInserted=ufc;a6.editIsDeletion=ykr;a6.editWouldDeleteWhatWasJustInserted2=dfc;var gkr=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}};a6.IgnoreWhitespaceOnlyChanges=Akr;function ufc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!ykr(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(ufc,"editWouldDeleteWhatWasJustInserted");function ykr(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(ykr,"editIsDeletion");function dfc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!ykr(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(dfc,"editWouldDeleteWhatWasJustInserted2")});var _kr=I($ge=>{"use strict";p();Object.defineProperty($ge,"__esModule",{value:!0});$ge.NulSimulationTestContext=$ge.ISimulationTestContext=void 0;var ffc=rn();$ge.ISimulationTestContext=(0,ffc.createServiceIdentifier)("ISimulationTestContext");var Ekr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};$ge.NulSimulationTestContext=Ekr});function xre(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(E4e(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(vkr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(vkr(b));return c=15}if(E4e(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 vkr(t){return t===32||t===9}function E4e(t){return t===10||t===13}function Vge(t){return t>=48&&t<=57}var q5i,NEt=_e(()=>{"use strict";p();a(xre,"createScanner");a(vkr,"isWhiteSpace");a(E4e,"isLineBreak");a(Vge,"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"})(q5i||(q5i={}))});var GT,Wge,Ckr,j5i,H5i=_e(()=>{p();GT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),Wge=200,Ckr={" ":{"\n":new Array(Wge).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(Wge).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Wge).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}," ":{"\n":new Array(Wge).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(Wge).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Wge).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}},j5i=[` `,"\r",`\r -`]});function g_t(t,e,r){let n,o,s,c,l;if(e){for(c=e.offset,l=c+e.length,s=c;s>0&&!W4e(t,s-1);)s--;let w=l;for(;w1)return AAe(u,f)+AAe(m,n+h);let w=m.length*(n+h);return!d||w>I2r[g][u].length?u+AAe(m,n+h):w<=0?u:I2r[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(AAe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?KT[m.length*n]:AAe(m,n);b(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=_(),x="",k=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;b(KT[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,k=R===12,x=k?E():"",R=_()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=E():r.keepLines&&(x=KT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=KT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=KT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=KT[1];break;case 12:x=E();break;case 13:f>0?x=E():k||(x=KT[1]);break;case 6:r.keepLines&&f>0?x=E():k||(x=KT[1]);break;case 10:r.keepLines&&f>0?x=E():R===6&&!k&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=E():(R===12||R===13)&&!k?x=KT[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 AAe(t,e){let r="";for(let n=0;n0&&!_4e(t,s-1);)s--;let w=l;for(;w1)return zge(u,f)+zge(m,n+h);let w=m.length*(n+h);return!d||w>Ckr[g][u].length?u+zge(m,n+h):w<=0?u:Ckr[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(zge(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?GT[m.length*n]:zge(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(GT[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=GT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=GT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=GT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=GT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=GT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=GT[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=GT[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 zge(t,e){let r="";for(let n=0;n{"use strict";p();m_t();pBi();a(g_t,"format");a(AAe,"repeat");a(gmc,"computeIndentLevel");a(Amc,"getEOL");a(W4e,"isEOL")});function hBi(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{K4e(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 y_t(t,e=[],r=z4e.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"),K4e(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:ABi(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 Y4e(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 w2r(t){if(!t.parent||!t.parent.children)return[];let e=w2r(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 A_t(t){switch(t.type){case"array":return t.children.map(A_t);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=A_t(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Emc(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=[],q=[]){if(b(M),O.length+q.length>0){let F=n.getToken();for(;F!==17;){if(O.indexOf(F)!==-1){R();break}else if(q.indexOf(F)!==-1)break;F=R()}}}a(x,"handleError");function k(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(k,"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):(k(!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 k(!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 gBi(t,e){let r=Gre(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 ABi(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 z4e,k2r=me(()=>{"use strict";p();m_t();(function(t){t.DEFAULT={allowTrailingComma:!1}})(z4e||(z4e={}));a(hBi,"getLocation");a(mBi,"parse");a(y_t,"parseTree");a(Y4e,"findNodeAtLocation");a(w2r,"getNodePath");a(A_t,"getNodeValue");a(Emc,"contains");a(R2r,"findNodeAtOffset");a(K4e,"visit");a(gBi,"stripComments");a(ABi,"getNodeType")});function yBi(t,e,r,n){let o=e.slice(),c=y_t(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=Y4e(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=Y4e(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 $re(t,{offset:h,length:m-h,content:""},n)}else return $re(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 $re(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 $re(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 $re(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 $re(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 $re(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function $re(t,e,r){if(!r.formattingOptions)return[e];let n=E_t(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!W4e(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=E_t(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 E_t(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var EBi=me(()=>{"use strict";p();x2r();k2r();a(yBi,"setProperty");a($re,"withFormatting");a(E_t,"applyEdit")});var _Bi={};wi(_Bi,{ParseErrorCode:()=>N2r,ScanError:()=>P2r,SyntaxKind:()=>D2r,applyEdits:()=>Omc,createScanner:()=>vmc,findNodeAtLocation:()=>Imc,findNodeAtOffset:()=>xmc,format:()=>Nmc,getLocation:()=>bmc,getNodePath:()=>wmc,getNodeValue:()=>Rmc,modify:()=>Mmc,parse:()=>Smc,parseTree:()=>Tmc,printParseErrorCode:()=>Dmc,stripComments:()=>Pmc,visit:()=>kmc});function Dmc(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 Nmc(t,e,r){return g_t(t,e,r)}function Mmc(t,e,r,n){return yBi(t,e,r,n)}function Omc(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=E_t(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var vmc,P2r,D2r,bmc,Smc,Tmc,Imc,xmc,wmc,Rmc,kmc,Pmc,N2r,CBi=me(()=>{"use strict";p();x2r();EBi();m_t();k2r();vmc=Gre;(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"})(P2r||(P2r={}));(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"})(D2r||(D2r={}));bmc=hBi,Smc=mBi,Tmc=y_t,Imc=Y4e,xmc=R2r,wmc=w2r,Rmc=A_t,kmc=K4e,Pmc=gBi;(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"})(N2r||(N2r={}));a(Dmc,"printParseErrorCode");a(Nmc,"format");a(Mmc,"modify");a(Omc,"applyEdits")});var C_t=I(__t=>{"use strict";p();Object.defineProperty(__t,"__esModule",{value:!0});__t.BaseAlternativeNotebookContentProvider=void 0;var M2r=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};__t.BaseAlternativeNotebookContentProvider=M2r});var B2r=I(BD=>{"use strict";p();Object.defineProperty(BD,"__esModule",{value:!0});BD.DEFAULT_WORD_REGEXP=BD.USUAL_WORD_SEPARATORS=void 0;BD.ensureValidWordDefinition=vBi;BD.setDefaultGetWordAtTextConfig=Qmc;BD.getWordAtText=bBi;var Bmc=cQt(),Lmc=ko(),Fmc=Ele();BD.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Umc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of BD.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Umc,"createWordRegExp");BD.DEFAULT_WORD_REGEXP=Umc();function vBi(t){let e=BD.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(vBi,"ensureValidWordDefinition");var O2r=new Fmc.LinkedList;O2r.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Qmc(t){let e=O2r.unshift(t);return(0,Lmc.toDisposable)(e)}a(Qmc,"setDefaultGetWordAtTextConfig");function bBi(t,e,r,n,o){if(e=vBi(e),o||(o=Bmc.Iterable.first(O2r)),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),bBi(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=qmc(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(bBi,"getWordAtText");function qmc(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(qmc,"_findRegexMatchEnclosingPosition")});var SBi=I(v_t=>{"use strict";p();Object.defineProperty(v_t,"__esModule",{value:!0});v_t.toUint8=jmc;v_t.toUint32=Hmc;function jmc(t){return t<0?0:t>255?255:t|0}a(jmc,"toUint8");function Hmc(t){return t<0?0:t>4294967295?4294967295:t|0}a(Hmc,"toUint32")});var TBi=I(v$=>{"use strict";p();Object.defineProperty(v$,"__esModule",{value:!0});v$.PrefixSumIndexOfResult=v$.ConstantTimePrefixSumComputer=v$.PrefixSumComputer=void 0;var Gmc=El(),yAe=SBi(),L2r=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,yAe.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,yAe.toUint32)(e),r=(0,yAe.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,yAe.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 EAe(o,e-c)}};v$.PrefixSumComputer=L2r;var F2r=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 EAe(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new EAe(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,Gmc.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))}};v$.ConstantTimePrefixSumComputer=F2r;var EAe=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};v$.PrefixSumIndexOfResult=EAe});var Q2r=I(b_t=>{"use strict";p();Object.defineProperty(b_t,"__esModule",{value:!0});b_t.PositionOffsetTransformer=void 0;var IBi=Gh(),xBi=gE(),$mc=sd(),Vmc=TBi(),Vre=mm(),U2r=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,IBi.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r +`}function _4e(t,e){return`\r +`.indexOf(t.charAt(e))!==-1}var bkr=_e(()=>{"use strict";p();NEt();H5i();a(MEt,"format");a(zge,"repeat");a(hfc,"computeIndentLevel");a(mfc,"getEOL");a(_4e,"isEOL")});function G5i(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{b4e(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 BEt(t,e=[],r=v4e.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"),b4e(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:W5i(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 C4e(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 Skr(t){if(!t.parent||!t.parent.children)return[];let e=Skr(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 OEt(t){switch(t.type){case"array":return t.children.map(OEt);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=OEt(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Afc(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=[],q=[]){if(b(M),O.length+q.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(q.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 V5i(t,e){let r=xre(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 W5i(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 v4e,Ikr=_e(()=>{"use strict";p();NEt();(function(t){t.DEFAULT={allowTrailingComma:!1}})(v4e||(v4e={}));a(G5i,"getLocation");a($5i,"parse");a(BEt,"parseTree");a(C4e,"findNodeAtLocation");a(Skr,"getNodePath");a(OEt,"getNodeValue");a(Afc,"contains");a(Tkr,"findNodeAtOffset");a(b4e,"visit");a(V5i,"stripComments");a(W5i,"getNodeType")});function z5i(t,e,r,n){let o=e.slice(),c=BEt(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=C4e(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=C4e(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 wre(t,{offset:h,length:m-h,content:""},n)}else return wre(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 wre(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 wre(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 wre(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 wre(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 wre(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function wre(t,e,r){if(!r.formattingOptions)return[e];let n=LEt(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!_4e(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=LEt(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 LEt(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var Y5i=_e(()=>{"use strict";p();bkr();Ikr();a(z5i,"setProperty");a(wre,"withFormatting");a(LEt,"applyEdit")});var K5i={};xi(K5i,{ParseErrorCode:()=>Rkr,ScanError:()=>xkr,SyntaxKind:()=>wkr,applyEdits:()=>Nfc,createScanner:()=>_fc,findNodeAtLocation:()=>Sfc,findNodeAtOffset:()=>Tfc,format:()=>kfc,getLocation:()=>vfc,getNodePath:()=>Ifc,getNodeValue:()=>xfc,modify:()=>Dfc,parse:()=>Cfc,parseTree:()=>bfc,printParseErrorCode:()=>Pfc,stripComments:()=>Rfc,visit:()=>wfc});function Pfc(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 kfc(t,e,r){return MEt(t,e,r)}function Dfc(t,e,r,n){return z5i(t,e,r,n)}function Nfc(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=LEt(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var _fc,xkr,wkr,vfc,Cfc,bfc,Sfc,Tfc,Ifc,xfc,wfc,Rfc,Rkr,J5i=_e(()=>{"use strict";p();bkr();Y5i();NEt();Ikr();_fc=xre;(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"})(xkr||(xkr={}));(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"})(wkr||(wkr={}));vfc=G5i,Cfc=$5i,bfc=BEt,Sfc=C4e,Tfc=Tkr,Ifc=Skr,xfc=OEt,wfc=b4e,Rfc=V5i;(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"})(Rkr||(Rkr={}));a(Pfc,"printParseErrorCode");a(kfc,"format");a(Dfc,"modify");a(Nfc,"applyEdits")});var UEt=I(FEt=>{"use strict";p();Object.defineProperty(FEt,"__esModule",{value:!0});FEt.BaseAlternativeNotebookContentProvider=void 0;var Pkr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};FEt.BaseAlternativeNotebookContentProvider=Pkr});var Dkr=I(wD=>{"use strict";p();Object.defineProperty(wD,"__esModule",{value:!0});wD.DEFAULT_WORD_REGEXP=wD.USUAL_WORD_SEPARATORS=void 0;wD.ensureValidWordDefinition=Z5i;wD.setDefaultGetWordAtTextConfig=Ffc;wD.getWordAtText=X5i;var Mfc=r7t(),Ofc=wo(),Bfc=Kce();wD.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Lfc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of wD.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Lfc,"createWordRegExp");wD.DEFAULT_WORD_REGEXP=Lfc();function Z5i(t){let e=wD.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(Z5i,"ensureValidWordDefinition");var kkr=new Bfc.LinkedList;kkr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Ffc(t){let e=kkr.unshift(t);return(0,Ofc.toDisposable)(e)}a(Ffc,"setDefaultGetWordAtTextConfig");function X5i(t,e,r,n,o){if(e=Z5i(e),o||(o=Mfc.Iterable.first(kkr)),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),X5i(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=Ufc(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(X5i,"getWordAtText");function Ufc(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(Ufc,"_findRegexMatchEnclosingPosition")});var e4i=I(QEt=>{"use strict";p();Object.defineProperty(QEt,"__esModule",{value:!0});QEt.toUint8=Qfc;QEt.toUint32=qfc;function Qfc(t){return t<0?0:t>255?255:t|0}a(Qfc,"toUint8");function qfc(t){return t<0?0:t>4294967295?4294967295:t|0}a(qfc,"toUint32")});var t4i=I(i$=>{"use strict";p();Object.defineProperty(i$,"__esModule",{value:!0});i$.PrefixSumIndexOfResult=i$.ConstantTimePrefixSumComputer=i$.PrefixSumComputer=void 0;var jfc=Al(),Yge=e4i(),Nkr=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,Yge.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,Yge.toUint32)(e),r=(0,Yge.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,Yge.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 Kge(o,e-c)}};i$.PrefixSumComputer=Nkr;var Mkr=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 Kge(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new Kge(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,jfc.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))}};i$.ConstantTimePrefixSumComputer=Mkr;var Kge=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};i$.PrefixSumIndexOfResult=Kge});var Bkr=I(qEt=>{"use strict";p();Object.defineProperty(qEt,"__esModule",{value:!0});qEt.PositionOffsetTransformer=void 0;var r4i=Gh(),n4i=pE(),Hfc=sd(),Gfc=t4i(),Rre=mm(),Okr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,r4i.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,IBi.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 Vre.TextEdit(this.validateRange(n.range),n.newText));return new xBi.StringEdit(r.map(n=>new xBi.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Vre.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Vre.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 Vre.Position(r,n):e}validateRange(e){return new Vre.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};b_t.PositionOffsetTransformer=U2r});var j2r=I(Wre=>{"use strict";p();Object.defineProperty(Wre,"__esModule",{value:!0});Wre.SnapshotDocumentLine=Wre.TextDocumentSnapshot=void 0;Wre.isTextDocumentSnapshotJSON=zmc;var S_t=BS(),RBi=Ku(),wBi=B2r(),_Ae=mm(),Wmc=Q2r();function zmc(t){return!t||typeof t!="object"?!1:(0,RBi.isUriComponents)(t.uri)&&(0,S_t.isString)(t._text)&&(0,S_t.isString)(t.languageId)&&(0,S_t.isNumber)(t.version)&&(0,S_t.isNumber)(t.eol)}a(zmc,"isTextDocumentSnapshotJSON");var q2r=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,RBi.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new Wmc.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 _Ae.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 T_t(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,wBi.getWordAtText)(r.character+1,wBi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new _Ae.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 _Ae.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 _Ae.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};Wre.TextDocumentSnapshot=q2r;var T_t=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 _Ae.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new _Ae.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}};Wre.SnapshotDocumentLine=T_t});var w_t=I(x_t=>{"use strict";p();Object.defineProperty(x_t,"__esModule",{value:!0});x_t.AlternativeNotebookDocument=void 0;var kBi=B2r(),I_t=mm(),Ymc=Q2r(),Kmc=j2r(),H2r=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Ymc.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,kBi.getWordAtText)(r.character+1,kBi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new I_t.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 I_t.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 Kmc.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 I_t.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 I_t.Position(r,n):e}};x_t.AlternativeNotebookDocument=H2r});var R_t=I(CAe=>{"use strict";p();Object.defineProperty(CAe,"__esModule",{value:!0});CAe.isUri=Zmc;CAe.isLocation=G2r;CAe.toLocation=Xmc;CAe.isSymbolInformation=egc;var J4e=mm(),Jmc=Ku();function Zmc(t){return Jmc.URI.isUri(t)}a(Zmc,"isUri");function G2r(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(G2r,"isLocation");function Xmc(t){if(G2r(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new J4e.Location(t.uri,new J4e.Range(new J4e.Position(e.line,e.character),new J4e.Position(r.line,r.character)))}else if(G2r(t)&&t.range instanceof J4e.Range)return t}a(Xmc,"toLocation");function egc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(egc,"isSymbolInformation")});var eBe=I(iy=>{"use strict";p();Object.defineProperty(iy,"__esModule",{value:!0});iy.CellIdPatternRe=iy.EOL=iy.LineOfText=void 0;iy.summarize=rgc;iy.notebookCellToCellData=ngc;iy.getCellIdMap=igc;iy.normalizeCellId=ogc;iy.getNotebookId=sgc;iy.getCellId=W2r;iy.getDefaultLanguage=cgc;iy.requestHasNotebookRefs=ugc;iy.parseAndCleanStack=dgc;var PBi=R_t(),OBi=Gkr(),tgc=Gh(),DBi=Ku(),V2r=mm(),$2r=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};iy.LineOfText=$2r;iy.EOL=` -`;function rgc(t){let e=t.kind===V2r.NotebookCellKind.Code?"code":"markdown",r=W2r(t),n=agc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(rgc,"summarize");function ngc(t){let e=new V2r.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(ngc,"notebookCellToCellData");function igc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(W2r(r),r)}),e}a(igc,"getCellIdMap");var NBi=new WeakMap,X4e=8,Z4e="#VSC-";iy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${X4e}})\\b`,"gi");function ogc(t){return t.startsWith(Z4e)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===X4e+3?`${Z4e}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===X4e+7?`${Z4e}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===X4e?`${Z4e}${t}`:t}a(ogc,"normalizeCellId");var MBi=new WeakMap;function sgc(t){let e=MBi.get(t);if(e)return e;let r=new OBi.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),MBi.set(t,e),e}a(sgc,"getNotebookId");function W2r(t){let e=NBi.get(t);if(e)return e;let r=new OBi.StringSHA1;return r.update(t.document.uri.toString()),e=`${Z4e}${r.digest().substring(0,X4e)}`,NBi.set(t,e),e}a(W2r,"getCellId");function agc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(agc,"getCellCode");function cgc(t){let e=t.getCells().find(r=>r.kind===V2r.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(cgc,"getDefaultLanguage");var lgc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function ugc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&lgc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,PBi.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,DBi.isUriComponents)(o.value)?e.hasSupportedNotebooks(DBi.URI.revive(o.value)):(0,PBi.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(ugc,"requestHasNotebookRefs");function dgc(t){try{let e=JSON.parse(t);return(0,tgc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(dgc,"parseAndCleanStack")});var FBi=I(tBe=>{"use strict";p();Object.defineProperty(tBe,"__esModule",{value:!0});tBe.AlternativeJsonNotebookContentProvider=void 0;tBe.isJsonContent=ggc;var fgc=(CBi(),Ca(_Bi)),pgc=Xc(),BBi=Ku(),LD=mm(),hgc=C_t(),mgc=w_t(),vAe=eBe(),LBi=4;function ggc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(ggc,"isJsonContent");var k_t=class extends mgc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,vAe.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 LD.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new LD.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},z2r=class extends hgc.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 k_t(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==LD.NotebookCellKind.Markup:!0).map(c=>{let l=(0,vAe.summarize)(c),u=Agc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,LBi);return new k_t(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,vAe.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,LBi).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(vAe.EOL)}parseAlternateContentImpl(e,r,n){return new pgc.AsyncIterableObject(async o=>{let s=BBi.URI.isUri(e)?new Map:(0,vAe.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:LD.NotebookCellKind.Code,source:[]},f=BBi.URI.isUri(e)?"python":(0,vAe.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"?LD.NotebookCellKind.Markup:LD.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,fgc.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=LD.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?LD.NotebookCellKind.Code:LD.NotebookCellKind.Markup,d.kind===LD.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=LD.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=E);let k=typeof y=="string"?y:`${y||""}`;k.endsWith(` -`)&&(k=k.substr(0,k.length-1)),d.source.push(k)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};tBe.AlternativeJsonNotebookContentProvider=z2r;function Agc(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(Agc,"getCellCode")});var K2r=I(b$=>{"use strict";p();Object.defineProperty(b$,"__esModule",{value:!0});b$.wellKnownLanguages=void 0;b$.getLanguage=UBi;b$.getLanguageForResource=_gc;var ygc=xP(),Egc=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"]}});b$.wellKnownLanguages=new Map(Object.entries(Egc).map(([t,e])=>[t,{languageId:t,...e}]));function UBi(t){return Y2r(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(UBi,"getLanguage");function Y2r(t){return b$.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(Y2r,"_getLanguage");function _gc(t){let e=(0,ygc.extname)(t).toLowerCase();for(let r of b$.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return UBi("plaintext")}a(_gc,"getLanguageForResource")});var jBi=I(S$=>{"use strict";p();Object.defineProperty(S$,"__esModule",{value:!0});S$.AlternativeTextNotebookContentProvider=void 0;S$.generateCellTextMarker=X2r;S$.lineMightHaveCellMarker=eDr;S$.getBlockComment=SAe;S$.getLineCommentStart=TAe;var Z2r=K2r(),Cgc=R_t(),vgc=ZQ(),bAe=mm(),bgc=C_t(),Sgc=w_t(),S0=eBe();function X2r(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(X2r,"generateCellTextMarker");function eDr(t){return t.toLowerCase().includes("vscode.cell")}a(eDr,"lineMightHaveCellMarker");var P_t=class extends Sgc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,S0.summarize)(e),o=TAe(this.notebook),s=X2r(n,o),c=e.document.eol===bAe.EndOfLine.LF?1:2,l=SAe(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===bAe.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,vgc.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}}},J2r=class extends bgc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(S0.EOL);return r.length&&eDr(r[0])?(r.shift(),r.join(S0.EOL)):e}getSummaryOfStructure(e,r,n){let o=SAe(e),s=TAe(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,S0.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(QBi(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(S0.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,Cgc.isUri)(e),s=o?(0,S0.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=TAe(o?e:void 0),m=SAe(o?e:void 0),g=o?(0,Z2r.getLanguage)((0,S0.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||_?qBi(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:bAe.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"?bAe.NotebookCellKind.Markup:bAe.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=SAe(r),o=TAe(r),s=(0,S0.getCellIdMap)(r),c=[],l=e.split(S0.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=S0.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+S0.EOL.length}return new P_t(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==bAe.NotebookCellKind.Markup:!0).map(d=>(0,S0.summarize)(d)),o=SAe(e),s=TAe(e),c=n.map(d=>({...QBi(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(S0.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 P_t(l,u,e)}};S$.AlternativeTextNotebookContentProvider=J2r;function QBi(t,e,r){let n=X2r(t,e),o=t.source.join(S0.EOL),s=t.language==="markdown"?`${n}${S0.EOL}${r[0]}${S0.EOL}`:`${n}${S0.EOL}`;return{content:t.language==="markdown"?`${s}${o}${S0.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(QBi,"generateAlternativeCellTextContent");function SAe(t){return t?(0,Z2r.getLanguage)((0,S0.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(SAe,"getBlockComment");function TAe(t){return t&&(0,Z2r.getLanguage)((0,S0.getDefaultLanguage)(t)).lineComment.start||"#"}a(TAe,"getLineCommentStart");function qBi(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:eDr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(qBi,"extractCellParts")});var $Bi=I(iBe=>{"use strict";p();Object.defineProperty(iBe,"__esModule",{value:!0});iBe.AlternativeXmlNotebookContentProvider=void 0;iBe.isXmlContent=GBi;var Tgc=K2r(),Igc=R_t(),xgc=ZQ(),rBe=mm(),wgc=C_t(),Rgc=w_t(),OE=eBe(),nBe="`}a(tDr,"generateCellMarker");function GBi(t){return t.includes(nBe)||t.includes(T$)||t.includes(D_t)}a(GBi,"isXmlContent");var N_t=class extends Rgc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,OE.summarize)(e),o=tDr(n),s=e.document.eol===rBe.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,xgc.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}}},rDr=class extends wgc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(OE.EOL);return r.length&&(r[0].startsWith(nBe)||r[0].startsWith(D_t))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(T$)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(T$))),r.join(OE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,OE.summarize)(c);o.push(tDr(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(T$)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(OE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,Igc.isUri)(e),s=o?(0,OE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,Tgc.getLanguage)((0,OE.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(D_t))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(T$)),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:rBe.NotebookCellKind.Code},y=HBi(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"?rBe.NotebookCellKind.Markup:rBe.NotebookCellKind.Code),yield A}else g.startsWith(T$)?(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(T$),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,OE.getCellIdMap)(r),o=[],s=e.split(OE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=OE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+OE.EOL.length}return new N_t(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==rBe.NotebookCellKind.Markup:!0).map(l=>(0,OE.summarize)(l)).map(l=>{let d=`${tDr(l)}${OE.EOL}`;return{content:`${d}${l.source.join(OE.EOL)}${OE.EOL}${T$}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(OE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new N_t(s,c,e)}};iBe.AlternativeXmlNotebookContentProvider=rDr;function HBi(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(GBi(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(HBi,"extractCellParts")});var KBi=I(c1=>{"use strict";p();var Pgc=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},VBi=c1&&c1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(c1,"__esModule",{value:!0});c1.AlternativeNotebookContentService=c1.IAlternativeNotebookContentService=void 0;c1.getAlternativeNotebookDocumentProvider=iDr;c1.inferAlternativeNotebookContentFormat=Fgc;c1.getAltNotebookRange=Ugc;var Dgc=oEt(),Ngc=rn(),Mgc=mm(),WBi=Il(),Ogc=I4e(),Bgc=gp(),zBi=FBi(),Lgc=jBi(),YBi=$Bi();function iDr(t){switch(t){case"xml":return new YBi.AlternativeXmlNotebookContentProvider;case"text":return new Lgc.AlternativeTextNotebookContentProvider;case"json":return new zBi.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(iDr,"getAlternativeNotebookDocumentProvider");function Fgc(t){return(0,YBi.isXmlContent)(t)?"xml":(0,zBi.isJsonContent)(t)?"json":"text"}a(Fgc,"inferAlternativeNotebookContentFormat");c1.IAlternativeNotebookContentService=(0,Ngc.createServiceIdentifier)("IAlternativeNotebookContentService");var nDr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,Ogc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(WBi.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return iDr(e)}};c1.AlternativeNotebookContentService=nDr;c1.AlternativeNotebookContentService=nDr=Pgc([VBi(0,WBi.IConfigurationService),VBi(1,Bgc.IExperimentationService)],nDr);function Ugc(t,e,r,n){let o=(0,Dgc.findCell)(e,r);if(!o)return;let s=iDr(n).getAlternativeDocument(r);return new Mgc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(Ugc,"getAltNotebookRange")});var ZBi=I(oBe=>{"use strict";p();Object.defineProperty(oBe,"__esModule",{value:!0});oBe.NotebookDocumentSnapshot=void 0;oBe.isNotebookDocumentSnapshotJSON=jgc;var M_t=BS(),Qgc=Ku(),oDr=mm(),JBi=KBi(),qgc=eBe();function jgc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,Qgc.isUriComponents)(t.uri)&&(0,M_t.isString)(t._text)&&(0,M_t.isString)(t.languageId)&&(0,M_t.isNumber)(t.version)&&(0,M_t.isString)(t.alternativeFormat)}a(jgc,"isNotebookDocumentSnapshotJSON");var sDr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,JBi.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,JBi.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,qgc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new oDr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new oDr.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 oDr.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=sDr});var cDr=I(xC=>{"use strict";p();var Hgc=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]})),Ggc=xC&&xC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$gc=xC&&xC.__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,XBi.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return Zgc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,Vgc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return Jgc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>XBi.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};xC.AbstractWorkspaceService=O_t;function Xgc(t,e){let r=t.getWorkspaceFolder(e);return r?Ygc.posix.relative(r.path,e.path):e.path}a(Xgc,"getWorkspaceFileDisplayPath");var aDr=class extends O_t{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new zgc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new I$.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new I$.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new I$.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new I$.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new I$.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new I$.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new I$.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new I$.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)}};xC.NullWorkspaceService=aDr});var fDr=I(zre=>{"use strict";p();Object.defineProperty(zre,"__esModule",{value:!0});zre.BatchedProcessor=zre.TaskQueue=void 0;zre.raceFilter=eAc;var lDr=Xc(),eLi=Ts(),uDr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new lDr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new lDr.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 eLi.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 eLi.CancellationError)}};zre.TaskQueue=uDr;var dDr=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 lDr.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)}};zre.BatchedProcessor=dDr;function eAc(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(eAc,"raceFilter")});var pDr=I(IAe=>{"use strict";p();Object.defineProperty(IAe,"__esModule",{value:!0});IAe.AsyncIterUtilsExt=IAe.AsyncIterUtils=void 0;var tLi;(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})(tLi||(IAe.AsyncIterUtils=tLi={}));var rLi;(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})(rLi||(IAe.AsyncIterUtilsExt=rLi={}))});var mDr=I(hDr=>{"use strict";p();Object.defineProperty(hDr,"__esModule",{value:!0});hDr.backwardCompatSetting=tAc;function tAc(t,e){return e(t)}a(tAc,"backwardCompatSetting")});var iLi=I(JT=>{"use strict";p();Object.defineProperty(JT,"__esModule",{value:!0});JT.LineWithTokens=JT.Token=void 0;JT.getOrDeduceSelectionFromLastEdit=nAc;JT.clipTokensToRange=nLi;JT.clipTokensToRangeAndAdjustOffsets=oAc;JT.removeTokensInRangeAndAdjustOffsets=sAc;JT.getTokensFromLogProbs=aAc;JT.getTokensFromLinesWithTokens=cAc;JT.mergeOffsetRangesAtDistance=lAc;var rAc=Ts(),xAe=sd();function nAc(t){let e=new xAe.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):iAc(t)}a(nAc,"getOrDeduceSelectionFromLastEdit");function iAc(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 xAe.OffsetRange(c,c))}a(iAc,"deduceSelectionFromLastEdit");var B_t=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 xAe.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)}};JT.Token=B_t;function nLi(t,e){return t.filter(r=>e.intersects(r.range))}a(nLi,"clipTokensToRange");function oAc(t,e){return nLi(t,e).map(r=>r.deltaOffset(-e.start))}a(oAc,"clipTokensToRangeAndAdjustOffsets");function sAc(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(sAc,"removeTokensInRangeAndAdjustOffsets");function aAc(t,e){let r=e;return t.content.map(n=>{let o=new B_t(n.token,n.logprob,r);return r+=o.range.length,o})}a(aAc,"getTokensFromLogProbs");var gDr=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,r4i.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 Rre.TextEdit(this.validateRange(n.range),n.newText));return new n4i.StringEdit(r.map(n=>new n4i.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Rre.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Rre.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 Rre.Position(r,n):e}validateRange(e){return new Rre.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};qEt.PositionOffsetTransformer=Okr});var Fkr=I(Pre=>{"use strict";p();Object.defineProperty(Pre,"__esModule",{value:!0});Pre.SnapshotDocumentLine=Pre.TextDocumentSnapshot=void 0;Pre.isTextDocumentSnapshotJSON=Vfc;var jEt=RS(),o4i=Ku(),i4i=Dkr(),Jge=mm(),$fc=Bkr();function Vfc(t){return!t||typeof t!="object"?!1:(0,o4i.isUriComponents)(t.uri)&&(0,jEt.isString)(t._text)&&(0,jEt.isString)(t.languageId)&&(0,jEt.isNumber)(t.version)&&(0,jEt.isNumber)(t.eol)}a(Vfc,"isTextDocumentSnapshotJSON");var Lkr=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,o4i.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new $fc.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 Jge.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 HEt(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,i4i.getWordAtText)(r.character+1,i4i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new Jge.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 Jge.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 Jge.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};Pre.TextDocumentSnapshot=Lkr;var HEt=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 Jge.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Jge.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}};Pre.SnapshotDocumentLine=HEt});var VEt=I($Et=>{"use strict";p();Object.defineProperty($Et,"__esModule",{value:!0});$Et.AlternativeNotebookDocument=void 0;var s4i=Dkr(),GEt=mm(),Wfc=Bkr(),zfc=Fkr(),Ukr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Wfc.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,s4i.getWordAtText)(r.character+1,s4i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new GEt.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 GEt.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 zfc.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 GEt.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 GEt.Position(r,n):e}};$Et.AlternativeNotebookDocument=Ukr});var WEt=I(Zge=>{"use strict";p();Object.defineProperty(Zge,"__esModule",{value:!0});Zge.isUri=Kfc;Zge.isLocation=Qkr;Zge.toLocation=Jfc;Zge.isSymbolInformation=Zfc;var S4e=mm(),Yfc=Ku();function Kfc(t){return Yfc.URI.isUri(t)}a(Kfc,"isUri");function Qkr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(Qkr,"isLocation");function Jfc(t){if(Qkr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new S4e.Location(t.uri,new S4e.Range(new S4e.Position(e.line,e.character),new S4e.Position(r.line,r.character)))}else if(Qkr(t)&&t.range instanceof S4e.Range)return t}a(Jfc,"toLocation");function Zfc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(Zfc,"isSymbolInformation")});var x4e=I(ly=>{"use strict";p();Object.defineProperty(ly,"__esModule",{value:!0});ly.CellIdPatternRe=ly.EOL=ly.LineOfText=void 0;ly.summarize=epc;ly.notebookCellToCellData=tpc;ly.getCellIdMap=rpc;ly.normalizeCellId=npc;ly.getNotebookId=ipc;ly.getCellId=Hkr;ly.getDefaultLanguage=spc;ly.requestHasNotebookRefs=cpc;ly.parseAndCleanStack=lpc;var a4i=WEt(),d4i=QRr(),Xfc=Gh(),c4i=Ku(),jkr=mm(),qkr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};ly.LineOfText=qkr;ly.EOL=` +`;function epc(t){let e=t.kind===jkr.NotebookCellKind.Code?"code":"markdown",r=Hkr(t),n=opc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(epc,"summarize");function tpc(t){let e=new jkr.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(tpc,"notebookCellToCellData");function rpc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(Hkr(r),r)}),e}a(rpc,"getCellIdMap");var l4i=new WeakMap,I4e=8,T4e="#VSC-";ly.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${I4e}})\\b`,"gi");function npc(t){return t.startsWith(T4e)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===I4e+3?`${T4e}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===I4e+7?`${T4e}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===I4e?`${T4e}${t}`:t}a(npc,"normalizeCellId");var u4i=new WeakMap;function ipc(t){let e=u4i.get(t);if(e)return e;let r=new d4i.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),u4i.set(t,e),e}a(ipc,"getNotebookId");function Hkr(t){let e=l4i.get(t);if(e)return e;let r=new d4i.StringSHA1;return r.update(t.document.uri.toString()),e=`${T4e}${r.digest().substring(0,I4e)}`,l4i.set(t,e),e}a(Hkr,"getCellId");function opc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(opc,"getCellCode");function spc(t){let e=t.getCells().find(r=>r.kind===jkr.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(spc,"getDefaultLanguage");var apc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function cpc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&apc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,a4i.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,c4i.isUriComponents)(o.value)?e.hasSupportedNotebooks(c4i.URI.revive(o.value)):(0,a4i.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(cpc,"requestHasNotebookRefs");function lpc(t){try{let e=JSON.parse(t);return(0,Xfc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(lpc,"parseAndCleanStack")});var h4i=I(w4e=>{"use strict";p();Object.defineProperty(w4e,"__esModule",{value:!0});w4e.AlternativeJsonNotebookContentProvider=void 0;w4e.isJsonContent=hpc;var upc=(J5i(),ya(K5i)),dpc=Jc(),f4i=Ku(),RD=mm(),fpc=UEt(),ppc=VEt(),Xge=x4e(),p4i=4;function hpc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(hpc,"isJsonContent");var zEt=class extends ppc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,Xge.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 RD.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new RD.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},Gkr=class extends fpc.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 zEt(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==RD.NotebookCellKind.Markup:!0).map(c=>{let l=(0,Xge.summarize)(c),u=mpc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,p4i);return new zEt(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,Xge.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,p4i).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(Xge.EOL)}parseAlternateContentImpl(e,r,n){return new dpc.AsyncIterableObject(async o=>{let s=f4i.URI.isUri(e)?new Map:(0,Xge.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:RD.NotebookCellKind.Code,source:[]},f=f4i.URI.isUri(e)?"python":(0,Xge.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"?RD.NotebookCellKind.Markup:RD.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,upc.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=RD.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?RD.NotebookCellKind.Code:RD.NotebookCellKind.Markup,d.kind===RD.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=RD.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)})}};w4e.AlternativeJsonNotebookContentProvider=Gkr;function mpc(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(mpc,"getCellCode")});var Vkr=I(o$=>{"use strict";p();Object.defineProperty(o$,"__esModule",{value:!0});o$.wellKnownLanguages=void 0;o$.getLanguage=m4i;o$.getLanguageForResource=ypc;var gpc=_k(),Apc=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"]}});o$.wellKnownLanguages=new Map(Object.entries(Apc).map(([t,e])=>[t,{languageId:t,...e}]));function m4i(t){return $kr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(m4i,"getLanguage");function $kr(t){return o$.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a($kr,"_getLanguage");function ypc(t){let e=(0,gpc.extname)(t).toLowerCase();for(let r of o$.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return m4i("plaintext")}a(ypc,"getLanguageForResource")});var y4i=I(s$=>{"use strict";p();Object.defineProperty(s$,"__esModule",{value:!0});s$.AlternativeTextNotebookContentProvider=void 0;s$.generateCellTextMarker=Ykr;s$.lineMightHaveCellMarker=Kkr;s$.getBlockComment=tAe;s$.getLineCommentStart=rAe;var zkr=Vkr(),Epc=WEt(),_pc=MQ(),eAe=mm(),vpc=UEt(),Cpc=VEt(),S0=x4e();function Ykr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(Ykr,"generateCellTextMarker");function Kkr(t){return t.toLowerCase().includes("vscode.cell")}a(Kkr,"lineMightHaveCellMarker");var YEt=class extends Cpc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,S0.summarize)(e),o=rAe(this.notebook),s=Ykr(n,o),c=e.document.eol===eAe.EndOfLine.LF?1:2,l=tAe(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===eAe.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,_pc.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}}},Wkr=class extends vpc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(S0.EOL);return r.length&&Kkr(r[0])?(r.shift(),r.join(S0.EOL)):e}getSummaryOfStructure(e,r,n){let o=tAe(e),s=rAe(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,S0.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(g4i(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(S0.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,Epc.isUri)(e),s=o?(0,S0.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=rAe(o?e:void 0),m=tAe(o?e:void 0),g=o?(0,zkr.getLanguage)((0,S0.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||_?A4i(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:eAe.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"?eAe.NotebookCellKind.Markup:eAe.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=tAe(r),o=rAe(r),s=(0,S0.getCellIdMap)(r),c=[],l=e.split(S0.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=S0.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+S0.EOL.length}return new YEt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==eAe.NotebookCellKind.Markup:!0).map(d=>(0,S0.summarize)(d)),o=tAe(e),s=rAe(e),c=n.map(d=>({...g4i(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(S0.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 YEt(l,u,e)}};s$.AlternativeTextNotebookContentProvider=Wkr;function g4i(t,e,r){let n=Ykr(t,e),o=t.source.join(S0.EOL),s=t.language==="markdown"?`${n}${S0.EOL}${r[0]}${S0.EOL}`:`${n}${S0.EOL}`;return{content:t.language==="markdown"?`${s}${o}${S0.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(g4i,"generateAlternativeCellTextContent");function tAe(t){return t?(0,zkr.getLanguage)((0,S0.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(tAe,"getBlockComment");function rAe(t){return t&&(0,zkr.getLanguage)((0,S0.getDefaultLanguage)(t)).lineComment.start||"#"}a(rAe,"getLineCommentStart");function A4i(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:Kkr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(A4i,"extractCellParts")});var v4i=I(k4e=>{"use strict";p();Object.defineProperty(k4e,"__esModule",{value:!0});k4e.AlternativeXmlNotebookContentProvider=void 0;k4e.isXmlContent=_4i;var bpc=Vkr(),Spc=WEt(),Tpc=MQ(),R4e=mm(),Ipc=UEt(),xpc=VEt(),DE=x4e(),P4e="`}a(Jkr,"generateCellMarker");function _4i(t){return t.includes(P4e)||t.includes(a$)||t.includes(KEt)}a(_4i,"isXmlContent");var JEt=class extends xpc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,DE.summarize)(e),o=Jkr(n),s=e.document.eol===R4e.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,Tpc.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}}},Zkr=class extends Ipc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(DE.EOL);return r.length&&(r[0].startsWith(P4e)||r[0].startsWith(KEt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(a$)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(a$))),r.join(DE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,DE.summarize)(c);o.push(Jkr(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(a$)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(DE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,Spc.isUri)(e),s=o?(0,DE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,bpc.getLanguage)((0,DE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(P4e)||g.startsWith(KEt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(a$)),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:R4e.NotebookCellKind.Code},y=E4i(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"?R4e.NotebookCellKind.Markup:R4e.NotebookCellKind.Code),yield A}else g.startsWith(a$)?(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(a$),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,DE.getCellIdMap)(r),o=[],s=e.split(DE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=DE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+DE.EOL.length}return new JEt(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==R4e.NotebookCellKind.Markup:!0).map(l=>(0,DE.summarize)(l)).map(l=>{let d=`${Jkr(l)}${DE.EOL}`;return{content:`${d}${l.source.join(DE.EOL)}${DE.EOL}${a$}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(DE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new JEt(s,c,e)}};k4e.AlternativeXmlNotebookContentProvider=Zkr;function E4i(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(_4i(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(E4i,"extractCellParts")});var I4i=I(e1=>{"use strict";p();var Rpc=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},C4i=e1&&e1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(e1,"__esModule",{value:!0});e1.AlternativeNotebookContentService=e1.IAlternativeNotebookContentService=void 0;e1.getAlternativeNotebookDocumentProvider=e2r;e1.inferAlternativeNotebookContentFormat=Bpc;e1.getAltNotebookRange=Lpc;var Ppc=byt(),kpc=rn(),Dpc=mm(),b4i=Sl(),Npc=X5e(),Mpc=Ap(),S4i=h4i(),Opc=y4i(),T4i=v4i();function e2r(t){switch(t){case"xml":return new T4i.AlternativeXmlNotebookContentProvider;case"text":return new Opc.AlternativeTextNotebookContentProvider;case"json":return new S4i.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(e2r,"getAlternativeNotebookDocumentProvider");function Bpc(t){return(0,T4i.isXmlContent)(t)?"xml":(0,S4i.isJsonContent)(t)?"json":"text"}a(Bpc,"inferAlternativeNotebookContentFormat");e1.IAlternativeNotebookContentService=(0,kpc.createServiceIdentifier)("IAlternativeNotebookContentService");var Xkr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,Npc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(b4i.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return e2r(e)}};e1.AlternativeNotebookContentService=Xkr;e1.AlternativeNotebookContentService=Xkr=Rpc([C4i(0,b4i.IConfigurationService),C4i(1,Mpc.IExperimentationService)],Xkr);function Lpc(t,e,r,n){let o=(0,Ppc.findCell)(e,r);if(!o)return;let s=e2r(n).getAlternativeDocument(r);return new Dpc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(Lpc,"getAltNotebookRange")});var w4i=I(D4e=>{"use strict";p();Object.defineProperty(D4e,"__esModule",{value:!0});D4e.NotebookDocumentSnapshot=void 0;D4e.isNotebookDocumentSnapshotJSON=Qpc;var ZEt=RS(),Fpc=Ku(),t2r=mm(),x4i=I4i(),Upc=x4e();function Qpc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,Fpc.isUriComponents)(t.uri)&&(0,ZEt.isString)(t._text)&&(0,ZEt.isString)(t.languageId)&&(0,ZEt.isNumber)(t.version)&&(0,ZEt.isString)(t.alternativeFormat)}a(Qpc,"isNotebookDocumentSnapshotJSON");var r2r=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,x4i.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,x4i.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,Upc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new t2r.Selection(0,0,this.lineCount,0)}getWholeRange(){return new t2r.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 t2r.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}}};D4e.NotebookDocumentSnapshot=r2r});var i2r=I(bv=>{"use strict";p();var qpc=bv&&bv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jpc=bv&&bv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Hpc=bv&&bv.__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,R4i.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return Kpc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,Gpc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return Ypc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>R4i.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};bv.AbstractWorkspaceService=XEt;function Jpc(t,e){let r=t.getWorkspaceFolder(e);return r?Wpc.posix.relative(r.path,e.path):e.path}a(Jpc,"getWorkspaceFileDisplayPath");var n2r=class extends XEt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new Vpc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new c$.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new c$.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new c$.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new c$.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new c$.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new c$.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new c$.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new c$.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)}};bv.NullWorkspaceService=n2r});var c2r=I(kre=>{"use strict";p();Object.defineProperty(kre,"__esModule",{value:!0});kre.BatchedProcessor=kre.TaskQueue=void 0;kre.raceFilter=Zpc;var o2r=Jc(),P4i=Cs(),s2r=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new o2r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new o2r.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 P4i.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 P4i.CancellationError)}};kre.TaskQueue=s2r;var a2r=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 o2r.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)}};kre.BatchedProcessor=a2r;function Zpc(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(Zpc,"raceFilter")});var l2r=I(nAe=>{"use strict";p();Object.defineProperty(nAe,"__esModule",{value:!0});nAe.AsyncIterUtilsExt=nAe.AsyncIterUtils=void 0;var k4i;(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})(k4i||(nAe.AsyncIterUtils=k4i={}));var D4i;(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})(D4i||(nAe.AsyncIterUtilsExt=D4i={}))});var d2r=I(u2r=>{"use strict";p();Object.defineProperty(u2r,"__esModule",{value:!0});u2r.backwardCompatSetting=Xpc;function Xpc(t,e){return e(t)}a(Xpc,"backwardCompatSetting")});var M4i=I($T=>{"use strict";p();Object.defineProperty($T,"__esModule",{value:!0});$T.LineWithTokens=$T.Token=void 0;$T.getOrDeduceSelectionFromLastEdit=thc;$T.clipTokensToRange=N4i;$T.clipTokensToRangeAndAdjustOffsets=nhc;$T.removeTokensInRangeAndAdjustOffsets=ihc;$T.getTokensFromLogProbs=ohc;$T.getTokensFromLinesWithTokens=shc;$T.mergeOffsetRangesAtDistance=ahc;var ehc=Cs(),iAe=sd();function thc(t){let e=new iAe.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):rhc(t)}a(thc,"getOrDeduceSelectionFromLastEdit");function rhc(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 iAe.OffsetRange(c,c))}a(rhc,"deduceSelectionFromLastEdit");var e_t=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 iAe.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)}};$T.Token=e_t;function N4i(t,e){return t.filter(r=>e.intersects(r.range))}a(N4i,"clipTokensToRange");function nhc(t,e){return N4i(t,e).map(r=>r.deltaOffset(-e.start))}a(nhc,"clipTokensToRangeAndAdjustOffsets");function ihc(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(ihc,"removeTokensInRangeAndAdjustOffsets");function ohc(t,e){let r=e;return t.content.map(n=>{let o=new e_t(n.token,n.logprob,r);return r+=o.range.length,o})}a(ohc,"getTokensFromLogProbs");var f2r=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)}};JT.LineWithTokens=gDr;function cAc(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(cAc,"getTokensFromLinesWithTokens");function lAc(t,e){if(e<0)throw new rAc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new xAe.OffsetRange(o.start-e,o.endExclusive+e)),n=new xAe.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new xAe.OffsetRange(o.start+e,o.endExclusive-e))}a(lAc,"mergeOffsetRangesAtDistance")});var oLi=I(L_t=>{"use strict";p();Object.defineProperty(L_t,"__esModule",{value:!0});L_t.DelaySession=void 0;var ADr=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)}};L_t.DelaySession=ADr});var lLi=I(_p=>{"use strict";p();var uAc=_p&&_p.__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},F_t=_p&&_p.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(_p,"__esModule",{value:!0});_p.UserInteractionMonitor=_p.MAX_INTERACTIONS_STORED=_p.MAX_INTERACTIONS_CONSIDERED=_p.ActionKind=void 0;_p.getWindowWithIgnoredLimit=aLi;_p.getUserHappinessScore=cLi;var wAe=Il(),Yre=WA(),dAc=pp(),fAc=gp(),pAc=o0(),sLi=L_(),hAc=oLi(),ZT;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(ZT||(_p.ActionKind=ZT={}));_p.MAX_INTERACTIONS_CONSIDERED=10;_p.MAX_INTERACTIONS_STORED=30;function aLi(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-_p.MAX_INTERACTIONS_CONSIDERED);let s=[],c=0,l=0;for(let u=t.length-1;u>=0&&s.length<_p.MAX_INTERACTIONS_CONSIDERED;u--){let d=t[u];if(d.kind===ZT.Ignored){let f=!1;if(r&&c>=o&&(f=!0),n&&l>=o&&(f=!0),f)continue;c++,l++}else c=0;s.push(d)}return s.reverse(),s}a(aLi,"getWindowWithIgnoredLimit");function cLi(t,e){if(t.length===0)return .5;let r=aLi(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/_p.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(cLi,"getUserHappinessScore");var yDr=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(ZT.Accepted)}handleRejection(){this._recordUserAction(ZT.Rejected)}handleIgnored(){this._recordUserAction(ZT.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===ZT.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-_p.MAX_INTERACTIONS_STORED),e!==ZT.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-_p.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(wAe.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(wAe.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new hAc.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===ZT.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(wAe.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Yre.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(wAe.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=Yre.AggressivenessLevel.High:c>=s.mediumThreshold?o=Yre.AggressivenessLevel.Medium:o=Yre.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=wAe.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Yre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Yre.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:sLi.ErrorUtils.toString(sLi.ErrorUtils.fromUnknown(n)),configValue:r}),Yre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return cLi(this._recentUserActionsForAggressiveness,e)}};_p.UserInteractionMonitor=yDr;_p.UserInteractionMonitor=yDr=uAc([F_t(0,wAe.IConfigurationService),F_t(1,fAc.IExperimentationService),F_t(2,dAc.ILogService),F_t(3,pAc.ITelemetryService)],yDr)});var uLi=I(EDr=>{"use strict";p();Object.defineProperty(EDr,"__esModule",{value:!0});EDr.isImportStatement=mAc;function mAc(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(mAc,"isImportStatement")});var pLi=I(U_t=>{"use strict";p();Object.defineProperty(U_t,"__esModule",{value:!0});U_t.IgnoreImportChangesAspect=void 0;var dLi=Myr(),gAc=El(),fLi=uLi(),_Dr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,fLi.isImportStatement)(o,r))||AAc(e,n).some(o=>(0,fLi.isImportStatement)(o,r))}static filterEdit(e,r,n=dLi.ImportChanges.None){if(n===dLi.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};U_t.IgnoreImportChangesAspect=_Dr;function AAc(t,e){return(0,gAc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(AAc,"getOldLines")});var vDr=I(Q_t=>{"use strict";p();Object.defineProperty(Q_t,"__esModule",{value:!0});Q_t.FetchStreamError=void 0;var CDr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};Q_t.FetchStreamError=CDr});var hLi=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.DiagnosticData=void 0;var yAc=xP(),bDr=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,yAc.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}};q_t.DiagnosticData=bDr});var x$=I(RAe=>{"use strict";p();Object.defineProperty(RAe,"__esModule",{value:!0});RAe.ResponseTags=RAe.PromptTags=void 0;var mLi;(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})(mLi||(RAe.PromptTags=mLi={}));var gLi;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(gLi||(RAe.ResponseTags=gLi={}))});var wDr=I(b6=>{"use strict";p();var EAc=b6&&b6.__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},_Ac=b6&&b6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(b6,"__esModule",{value:!0});b6.LintErrors=void 0;var CAc=hLi(),IR=WA(),vAc=$G(),bAc=Ts(),SDr=xP(),SAc=qp(),yLi=sd(),TAc=mm(),IAc=x$(),IDr=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 SAc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,SDr.isEqual)(n,s)?H_t.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new xDr(s,l.message,l.severity===TAc.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=kAc(n,e.maxLineDistance),n=ALi(n),n=TDr(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,SDr.isEqual)(l.documentUri,o)?e:{...e,showCode:IR.LintOptionShowCode.NO};return j_t(l,this._document.lines,d)}).join(` -`),c=IAc.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)}};$T.LineWithTokens=f2r;function shc(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(shc,"getTokensFromLinesWithTokens");function ahc(t,e){if(e<0)throw new ehc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new iAe.OffsetRange(o.start-e,o.endExclusive+e)),n=new iAe.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new iAe.OffsetRange(o.start+e,o.endExclusive-e))}a(ahc,"mergeOffsetRangesAtDistance")});var O4i=I(t_t=>{"use strict";p();Object.defineProperty(t_t,"__esModule",{value:!0});t_t.DelaySession=void 0;var p2r=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)}};t_t.DelaySession=p2r});var U4i=I(vp=>{"use strict";p();var chc=vp&&vp.__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},r_t=vp&&vp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vp,"__esModule",{value:!0});vp.UserInteractionMonitor=vp.MAX_INTERACTIONS_STORED=vp.MAX_INTERACTIONS_CONSIDERED=vp.ActionKind=void 0;vp.getWindowWithIgnoredLimit=L4i;vp.getUserHappinessScore=F4i;var oAe=Sl(),Dre=ZA(),lhc=hp(),uhc=Ap(),dhc=o0(),B4i=M_(),fhc=O4i(),VT;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(VT||(vp.ActionKind=VT={}));vp.MAX_INTERACTIONS_CONSIDERED=10;vp.MAX_INTERACTIONS_STORED=30;function L4i(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-vp.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(L4i,"getWindowWithIgnoredLimit");function F4i(t,e){if(t.length===0)return .5;let r=L4i(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/vp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(F4i,"getUserHappinessScore");var h2r=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(VT.Accepted)}handleRejection(){this._recordUserAction(VT.Rejected)}handleIgnored(){this._recordUserAction(VT.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===VT.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-vp.MAX_INTERACTIONS_STORED),e!==VT.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-vp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(oAe.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(oAe.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new fhc.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===VT.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(oAe.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Dre.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(oAe.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=Dre.AggressivenessLevel.High:c>=s.mediumThreshold?o=Dre.AggressivenessLevel.Medium:o=Dre.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=oAe.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Dre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Dre.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:B4i.ErrorUtils.toString(B4i.ErrorUtils.fromUnknown(n)),configValue:r}),Dre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return F4i(this._recentUserActionsForAggressiveness,e)}};vp.UserInteractionMonitor=h2r;vp.UserInteractionMonitor=h2r=chc([r_t(0,oAe.IConfigurationService),r_t(1,uhc.IExperimentationService),r_t(2,lhc.ILogService),r_t(3,dhc.ITelemetryService)],h2r)});var Q4i=I(m2r=>{"use strict";p();Object.defineProperty(m2r,"__esModule",{value:!0});m2r.isImportStatement=phc;function phc(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(phc,"isImportStatement")});var H4i=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.IgnoreImportChangesAspect=void 0;var q4i=PAr(),hhc=Al(),j4i=Q4i(),g2r=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,j4i.isImportStatement)(o,r))||mhc(e,n).some(o=>(0,j4i.isImportStatement)(o,r))}static filterEdit(e,r,n=q4i.ImportChanges.None){if(n===q4i.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};n_t.IgnoreImportChangesAspect=g2r;function mhc(t,e){return(0,hhc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(mhc,"getOldLines")});var y2r=I(i_t=>{"use strict";p();Object.defineProperty(i_t,"__esModule",{value:!0});i_t.FetchStreamError=void 0;var A2r=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};i_t.FetchStreamError=A2r});var G4i=I(o_t=>{"use strict";p();Object.defineProperty(o_t,"__esModule",{value:!0});o_t.DiagnosticData=void 0;var ghc=_k(),E2r=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,ghc.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}};o_t.DiagnosticData=E2r});var l$=I(sAe=>{"use strict";p();Object.defineProperty(sAe,"__esModule",{value:!0});sAe.ResponseTags=sAe.PromptTags=void 0;var $4i;(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})($4i||(sAe.PromptTags=$4i={}));var V4i;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(V4i||(sAe.ResponseTags=V4i={}))});var S2r=I(c6=>{"use strict";p();var Ahc=c6&&c6.__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},yhc=c6&&c6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(c6,"__esModule",{value:!0});c6.LintErrors=void 0;var Ehc=G4i(),ER=ZA(),_hc=xG(),vhc=Cs(),_2r=_k(),Chc=jp(),z4i=sd(),bhc=mm(),Shc=l$(),C2r=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 Chc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,_2r.isEqual)(n,s)?a_t.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new b2r(s,l.message,l.severity===bhc.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=whc(n,e.maxLineDistance),n=W4i(n),n=v2r(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,_2r.isEqual)(l.documentUri,o)?e:{...e,showCode:ER.LintOptionShowCode.NO};return s_t(l,this._document.lines,d)}).join(` +`),c=Shc.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=TDr(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 bAc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,SDr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===IR.LintOptionShowCode.NO)continue;if(ELi(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:IR.LintOptionWarning.YES,showCode:IR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=TDr(r,IR.LintOptionWarning.YES),r=ALi(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:j_t(o,this._document.lines,e),formattedCode:j_t(o,this._document.lines,{...e,showCode:IR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:j_t(o,this._document.lines,{...e,showCode:IR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};b6.LintErrors=IDr;b6.LintErrors=IDr=EAc([_Ac(2,vAc.ILanguageDiagnosticsService)],IDr);function j_t(t,e,r){let n=xAc(t,t.documentRange);if(r.showCode===IR.LintOptionShowCode.NO)return n;let o=wAc(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=v2r(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 vhc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,_2r.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===ER.LintOptionShowCode.NO)continue;if(Y4i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:ER.LintOptionWarning.YES,showCode:ER.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=v2r(r,ER.LintOptionWarning.YES),r=W4i(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:s_t(o,this._document.lines,e),formattedCode:s_t(o,this._document.lines,{...e,showCode:ER.LintOptionShowCode.YES}),formattedCodeWithSurrounding:s_t(o,this._document.lines,{...e,showCode:ER.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};c6.LintErrors=C2r;c6.LintErrors=C2r=Ahc([yhc(2,_hc.ILanguageDiagnosticsService)],C2r);function s_t(t,e,r){let n=Thc(t,t.documentRange);if(r.showCode===ER.LintOptionShowCode.NO)return n;let o=Ihc(t.documentRange,r,e);return n+` `+o.join(` -`)}a(j_t,"formatSingleDiagnostic");function xAc(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(xAc,"formatDiagnosticMessage");function wAc(t,e,r){let o=ELi(t,e).intersect(new yLi.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(kAc,"filterDiagnosticsByDistance");function ALi(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:H_t.compareFn(e.distance,r.distance))}a(ALi,"sortDiagnosticsByDistance");function TDr(t,e){switch(e){case IR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case IR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case IR.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(TDr,"filterDiagnosticsBySeverity");var H_t=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}},xDr=class extends CAc.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 kAe=I(G_t=>{"use strict";p();Object.defineProperty(G_t,"__esModule",{value:!0});G_t.toUniquePath=DAc;G_t.countTokensForLines=NAc;var PAc=yK();function DAc(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===PAc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(DAc,"toUniquePath");function NAc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(NAc,"countTokensForLines")});var _Li=I(RDr=>{"use strict";p();Object.defineProperty(RDr,"__esModule",{value:!0});RDr.getEditDiffHistory=BAc;var MAc=kD(),w$=El(),OAc=kAe();function BAc(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=LAc(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(s_t,"formatSingleDiagnostic");function Thc(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(Thc,"formatDiagnosticMessage");function Ihc(t,e,r){let o=Y4i(t,e).intersect(new z4i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(whc,"filterDiagnosticsByDistance");function W4i(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:a_t.compareFn(e.distance,r.distance))}a(W4i,"sortDiagnosticsByDistance");function v2r(t,e){switch(e){case ER.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case ER.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case ER.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(v2r,"filterDiagnosticsBySeverity");var a_t=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}},b2r=class extends Ehc.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 aAe=I(c_t=>{"use strict";p();Object.defineProperty(c_t,"__esModule",{value:!0});c_t.toUniquePath=Phc;c_t.countTokensForLines=khc;var Rhc=XY();function Phc(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===Rhc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(Phc,"toUniquePath");function khc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(khc,"countTokensForLines")});var K4i=I(T2r=>{"use strict";p();Object.defineProperty(T2r,"__esModule",{value:!0});T2r.getEditDiffHistory=Mhc;var Dhc=CD(),u$=Al(),Nhc=aAe();function Mhc(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=Ohc(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(BAc,"getEditDiffHistory");function LAc(t,e){let r=[],n=MAc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,w$.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,w$.pushMany)(r,d.map(g=>`-${g}`)),(0,w$.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,OAc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,w$.pushMany)(c,r),c.join(` -`)}a(LAc,"generateDocDiff")});var kDr=I(R$=>{"use strict";p();Object.defineProperty(R$,"__esModule",{value:!0});R$.count=FAc;R$.findInsertionIndexInSortedArray=UAc;R$.max=QAc;R$.filterMap=qAc;R$.min=jAc;R$.batchArrayElements=HAc;function FAc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(FAc,"count");function UAc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(UAc,"findInsertionIndexInSortedArray");function QAc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(QAc,"max");function qAc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(qAc,"filterMap");function jAc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var GAc=BE&&BE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Ac=BE&&BE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),VAc=BE&&BE.__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;oBDr(A.entries)):d=bLi(e,t.id,c,l).map(A=>TLi(A));let{snippets:f,docsInPrompt:h}=PLi(d,n,o);r&&ILi(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=xLi(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` +`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(Mhc,"getEditDiffHistory");function Ohc(t,e){let r=[],n=Dhc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,u$.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,u$.pushMany)(r,d.map(g=>`-${g}`)),(0,u$.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,Nhc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,u$.pushMany)(c,r),c.join(` +`)}a(Ohc,"generateDocDiff")});var I2r=I(d$=>{"use strict";p();Object.defineProperty(d$,"__esModule",{value:!0});d$.count=Bhc;d$.findInsertionIndexInSortedArray=Lhc;d$.max=Fhc;d$.filterMap=Uhc;d$.min=Qhc;d$.batchArrayElements=qhc;function Bhc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Bhc,"count");function Lhc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(Lhc,"findInsertionIndexInSortedArray");function Fhc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(Fhc,"max");function Uhc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(Uhc,"filterMap");function Qhc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var jhc=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]})),Hhc=NE&&NE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ghc=NE&&NE.__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;oD2r(A.entries)):d=X4i(e,t.id,c,l).map(A=>tBi(A));let{snippets:f,docsInPrompt:h}=aBi(d,n,o);r&&rBi(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=nBi(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` -`),documents:h,neighborSnippetsResult:m}}a(ZAc,"getRecentCodeSnippets");function XAc(t,e,r){switch(e){case PDr.IncludeLineNumbersOption.WithSpaceAfter:return t.map((n,o)=>`${r+o}| ${n}`);case PDr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case PDr.IncludeLineNumbersOption.None:return t;default:(0,zAc.assertNever)(e)}}a(XAc,"formatLinesWithLineNumbers");function $_t(t,e,r){let n=(0,MDr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=XAc(e,r.includeLineNumbers,r.startLineOffset).join(` -`);return[CLi.PromptTags.RECENT_FILE.start,o,c,CLi.PromptTags.RECENT_FILE.end].join(` -`)}a($_t,"formatCodeSnippet");function bLi(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(bLi,"collectRecentDocuments");function SLi(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(SLi,"collectRecentDocumentsGrouped");function eyc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===NDr.RecentFileClippingStrategy.Proportional?SLi(e,t.id,n,o).map(u=>BDr(u.entries)):bLi(e,t.id,n,o).map(l=>TLi(l))}a(eyc,"prepareRecentCodeSnippets");function ODr(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(ODr,"selectFocalRangesWithinSpanCap");function TLi(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(TLi,"historyEntryToCodeSnippet");function BDr(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(BDr,"historyEntriesToCodeSnippet");function ILi(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===WAc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=DDr.DocumentId.create(l.uri.toString());e.push($_t(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(ILi,"appendLanguageContextSnippets");function xLi(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=DDr.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($_t(DDr.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(xLi,"appendNeighborFileSnippets");function wLi(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,MDr.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($_t(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(wLi,"clipFullDocument");function RLi(t,e,r,n){let o=t.getTransformer(),s=r*3,c=ODr(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,MDr.countTokensForLines)(h.slice(E,_),n)}return A}a(RLi,"computeFocalPageCost");function kLi(t,e,r,n,o,s,c){if(n<=0)return;let l=t.content.getTransformer(),u=e*3,d=ODr(t.focalRanges,b=>l.getPosition(b).lineNumber,u);if(d.length===0)return n;let f=Math.min(...d.map(b=>b.start)),h=Math.max(...d.map(b=>b.endExclusive-1)),m=l.getPosition(f),g=l.getPosition(h),{firstPageIdx:A,lastPageIdxIncl:y,budgetLeft:E}=(0,JAc.expandRangeToPageRange)(t.content.getLines(),new KAc.OffsetRange(m.lineNumber-1,g.lineNumber),e,n,o,!1);if(E===n||E<0)return;let _=A*e,v=t.content.getLines().slice(_,(y+1)*e);return c.docsInPrompt.add(t.id),c.snippets.push($_t(t.id,v,{truncated:v.lengthy.focalRanges!==void 0&&y.focalRanges.length>0?RLi(y.content,y.focalRanges,n,e)??0:0),u=t.length,d=l.reduce((y,E)=>y+E,0);for(;u>0&&d>s;)u--,d-=l[u];if(u===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let f=s-d,h=t.slice(0,u).map(y=>y.editEntryCount??1),m=h.reduce((y,E)=>y+E,0),g=h.map(y=>Math.floor(f*(y/m))),A=0;for(let y=0;y0)A=kLi(E,n,_.length,v,e,c,o)??v;else{let b=(0,vLi.batchArrayElements)(_,n);A=wLi(E,b,_.length,v,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-A}}a(ryc,"buildCodeSnippetsWithProportionalBudget")});var V_t=I(Gd=>{"use strict";p();var nyc=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]})),iyc=Gd&&Gd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oyc=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`${r+o}| ${n}`);case x2r.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case x2r.IncludeLineNumbersOption.None:return t;default:(0,Vhc.assertNever)(e)}}a(Jhc,"formatLinesWithLineNumbers");function l_t(t,e,r){let n=(0,P2r.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=Jhc(e,r.includeLineNumbers,r.startLineOffset).join(` +`);return[J4i.PromptTags.RECENT_FILE.start,o,c,J4i.PromptTags.RECENT_FILE.end].join(` +`)}a(l_t,"formatCodeSnippet");function X4i(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(X4i,"collectRecentDocuments");function eBi(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(eBi,"collectRecentDocumentsGrouped");function Zhc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===R2r.RecentFileClippingStrategy.Proportional?eBi(e,t.id,n,o).map(u=>D2r(u.entries)):X4i(e,t.id,n,o).map(l=>tBi(l))}a(Zhc,"prepareRecentCodeSnippets");function k2r(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(k2r,"selectFocalRangesWithinSpanCap");function tBi(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(tBi,"historyEntryToCodeSnippet");function D2r(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(D2r,"historyEntriesToCodeSnippet");function rBi(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===$hc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=w2r.DocumentId.create(l.uri.toString());e.push(l_t(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(rBi,"appendLanguageContextSnippets");function nBi(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=w2r.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(l_t(w2r.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(nBi,"appendNeighborFileSnippets");function iBi(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,P2r.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(l_t(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(iBi,"clipFullDocument");function oBi(t,e,r,n){let o=t.getTransformer(),s=r*3,c=k2r(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,P2r.countTokensForLines)(h.slice(E,_),n)}return A}a(oBi,"computeFocalPageCost");function sBi(t,e,r,n,o,s,c){if(n<=0)return;let l=t.content.getTransformer(),u=e*3,d=k2r(t.focalRanges,b=>l.getPosition(b).lineNumber,u);if(d.length===0)return n;let f=Math.min(...d.map(b=>b.start)),h=Math.max(...d.map(b=>b.endExclusive-1)),m=l.getPosition(f),g=l.getPosition(h),{firstPageIdx:A,lastPageIdxIncl:y,budgetLeft:E}=(0,Yhc.expandRangeToPageRange)(t.content.getLines(),new zhc.OffsetRange(m.lineNumber-1,g.lineNumber),e,n,o,!1);if(E===n||E<0)return;let _=A*e,v=t.content.getLines().slice(_,(y+1)*e);return c.docsInPrompt.add(t.id),c.snippets.push(l_t(t.id,v,{truncated:v.lengthy.focalRanges!==void 0&&y.focalRanges.length>0?oBi(y.content,y.focalRanges,n,e)??0:0),u=t.length,d=l.reduce((y,E)=>y+E,0);for(;u>0&&d>s;)u--,d-=l[u];if(u===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let f=s-d,h=t.slice(0,u).map(y=>y.editEntryCount??1),m=h.reduce((y,E)=>y+E,0),g=h.map(y=>Math.floor(f*(y/m))),A=0;for(let y=0;y0)A=sBi(E,n,_.length,v,e,c,o)??v;else{let b=(0,Z4i.batchArrayElements)(_,n);A=iBi(E,b,_.length,v,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-A}}a(e0c,"buildCodeSnippetsWithProportionalBudget")});var u_t=I(jd=>{"use strict";p();var t0c=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]})),r0c=jd&&jd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n0c=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;of.add(k)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,sBe.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,sBe.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,BLi.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,z_t.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` +${o}`;break}let D=d.promptingStrategy!==$l.PromptingStrategy.Nes41Miniv3&&d.promptingStrategy!==$l.PromptingStrategy.Codexv21NesUnified&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased01&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased02&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased02WithRecentLineNumbers&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased02WithoutRecentLineNumbers?l0c(x):x;return{prompt:(u0c(v,D,d.languageContext.traitPosition)+T).trim(),nDiffsInPrompt:E,diffTokensInPrompt:_,neighborSnippetsResult:A}}a(s0c,"getUserPrompt");function a0c(t,e,r,n,o,s,c){c0c(c);let l=[],u=[],d=[],f=new Set;f.add(t.id);let h,m="",g=0,A=0,y=(0,N4e.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,N4e.buildCodeSnippetsUsingPagedClipping)(y,n,R);l.push(...x.snippets),x.docsInPrompt.forEach(P=>f.add(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,N4e.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,N4e.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,fBi.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,f_t.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(lyc,"runGlobalBudgetCascade");function uyc(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(uyc,"validateGlobalBudget");function dyc(t){return`\`\`\` +`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(a0c,"runGlobalBudgetCascade");function c0c(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(c0c,"validateGlobalBudget");function l0c(t){return`\`\`\` ${t} -\`\`\``}a(dyc,"wrapInBackticks");function fyc(t,e,r){return r==="before"?MLi(t,e,2):MLi(e,t,2)}a(fyc,"addRelatedInformation");function MLi(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` +\`\`\``}a(l0c,"wrapInBackticks");function u0c(t,e,r){return r==="before"?uBi(t,e,2):uBi(e,t,2)}a(u0c,"addRelatedInformation");function uBi(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 zl.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 zl.PromptingStrategy.Xtab275EditIntentShort:case zl.PromptingStrategy.Xtab275EditIntent:case zl.PromptingStrategy.Xtab275:o=n;break;case zl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===zl.AggressivenessLevel.Medium?n:`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case zl.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 zl.PromptingStrategy.SimplifiedSystemPrompt:case zl.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 \`${ch.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 \`${ch.PromptTags.EDIT_WINDOW.start}\` and \`${ch.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. +`.repeat(o)+e).trim()}a(uBi,"appendWithNewLineIfNeeded");function d0c(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 \`${lh.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 \`${lh.PromptTags.EDIT_WINDOW.start}\` and \`${lh.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 $l.PromptingStrategy.PatchBased01:case $l.PromptingStrategy.Codexv21NesUnified:break;case $l.PromptingStrategy.PatchBased02:case $l.PromptingStrategy.PatchBased02WithRecentLineNumbers:case $l.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 $l.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 \`${lh.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 $l.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 $l.PromptingStrategy.Xtab275EditIntentShort:case $l.PromptingStrategy.Xtab275EditIntent:case $l.PromptingStrategy.Xtab275:o=n;break;case $l.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case $l.PromptingStrategy.Xtab275Aggressiveness:o=`${n} +<|aggressive|>${r}<|/aggressive|>`;break;case $l.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===$l.AggressivenessLevel.Medium?n:`${n} +<|aggressive|>${r}<|/aggressive|>`;break;case $l.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 $l.PromptingStrategy.SimplifiedSystemPrompt:case $l.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 \`${lh.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 \`${lh.PromptTags.EDIT_WINDOW.start}\` and \`${lh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. \`\`\` // Your revised code goes here -\`\`\``;break;default:(0,z_t.assertNever)(t)}return o===void 0?"":` +\`\`\``;break;default:(0,f_t.assertNever)(t)}return o===void 0?"":` -${o}`}a(pyc,"getPostScript");function hyc(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===syc.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(d0c,"getPostScript");function f0c(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===i0c.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(hyc,"getRelatedInformation");function myc(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(myc,"truncateCode");Gd.N_LINES_ABOVE=2;Gd.N_LINES_BELOW=5;Gd.N_LINES_AS_CONTEXT=15;function LLi(t,e,r,n,o,s){let c=Math.ceil(t.length/r);function l(m){let g=m*r,A=Math.min(g+r,t.length),y=t.slice(g,A);return(0,QDr.countTokensForLines)(y,o)}a(l,"computeTokensForPage");let u=Math.floor(e.start/r),d=Math.floor((e.endExclusive-1)/r),f=n-(0,ayc.range)(u,d+1).reduce((m,g)=>m+l(g),0);if(f<0)return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:f};let h=f;if(s){h=f;for(let m=u-1;m>=0&&h>0;--m){let g=l(m),A=h-g;if(A<0)break;u=m,h=A}for(let m=d+1;m0;++m){let g=l(m),A=h-g;if(A<0)break;d=m,h=A}}else{let m=Math.floor(f/2);h=m;for(let g=u-1;g>=0&&h>0;--g){let A=l(g),y=h-A;if(y<0)break;u=g,h=y}h=m;for(let g=d+1;g0;++g){let A=l(g),y=h-A;if(y<0)break;d=g,h=y}}return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:h}}a(LLi,"expandRangeToPageRange");function FLi(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,QDr.countTokensForLines)(s,r);if(c<0)return FDr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=LLi(t,e,n,c,r,o.prioritizeAboveCursor),d=l*n,f=(u+1)*n;return FDr.Result.ok(new OLi.OffsetRange(d,f))}a(FLi,"clipPreservingRange");var W_t=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Gd.ClippedDocument=W_t;function ULi(t,e,r,n,o,s){let c=FLi(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 OLi.OffsetRange(l.start,l.start+u.length);return FDr.Result.ok(new W_t(u,d))}a(ULi,"createTaggedCurrentFileContentUsingPagedClipping");function LDr(t,e){switch(e){case PAe.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case PAe.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case PAe.IncludeLineNumbersOption.None:return[...t];default:(0,z_t.assertNever)(e)}}a(LDr,"addLineNumbers");function gyc(t,e,r,n,o,s){let c=NLi.StringEdit.single(NLi.StringReplacement.insert(t.cursorOffset,ch.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=LDr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[ch.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),ch.PromptTags.EDIT_WINDOW.start,...u,ch.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),ch.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=LDr(f,s.includeLineNumbers.currentFileContent),m=LDr(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 ULi(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` -`)}))}a(gyc,"constructTaggedFile")});var QLi=I(xR=>{"use strict";p();Object.defineProperty(xR,"__esModule",{value:!0});xR.xtab275SystemPrompt=xR.simplifiedPrompt=xR.nes41Miniv3SystemPrompt=xR.unifiedModelSystemPrompt=xR.systemPromptTemplate=void 0;var k$=x$();xR.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 ${k$.PromptTags.EDIT_WINDOW.start} and ${k$.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +`)}`}a(f0c,"getRelatedInformation");function p0c(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(p0c,"truncateCode");jd.N_LINES_ABOVE=2;jd.N_LINES_BELOW=5;jd.N_LINES_AS_CONTEXT=15;function pBi(t,e,r,n,o,s){let c=Math.ceil(t.length/r);function l(m){let g=m*r,A=Math.min(g+r,t.length),y=t.slice(g,A);return(0,B2r.countTokensForLines)(y,o)}a(l,"computeTokensForPage");let u=Math.floor(e.start/r),d=Math.floor((e.endExclusive-1)/r),f=n-(0,o0c.range)(u,d+1).reduce((m,g)=>m+l(g),0);if(f<0)return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:f};let h=f;if(s){h=f;for(let m=u-1;m>=0&&h>0;--m){let g=l(m),A=h-g;if(A<0)break;u=m,h=A}for(let m=d+1;m0;++m){let g=l(m),A=h-g;if(A<0)break;d=m,h=A}}else{let m=Math.floor(f/2);h=m;for(let g=u-1;g>=0&&h>0;--g){let A=l(g),y=h-A;if(y<0)break;u=g,h=y}h=m;for(let g=d+1;g0;++g){let A=l(g),y=h-A;if(y<0)break;d=g,h=y}}return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:h}}a(pBi,"expandRangeToPageRange");function hBi(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,B2r.countTokensForLines)(s,r);if(c<0)return M2r.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=pBi(t,e,n,c,r,o.prioritizeAboveCursor),d=l*n,f=(u+1)*n;return M2r.Result.ok(new dBi.OffsetRange(d,f))}a(hBi,"clipPreservingRange");var d_t=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};jd.ClippedDocument=d_t;function mBi(t,e,r,n,o,s){let c=hBi(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 dBi.OffsetRange(l.start,l.start+u.length);return M2r.Result.ok(new d_t(u,d))}a(mBi,"createTaggedCurrentFileContentUsingPagedClipping");function N2r(t,e){switch(e){case cAe.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case cAe.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case cAe.IncludeLineNumbersOption.None:return[...t];default:(0,f_t.assertNever)(e)}}a(N2r,"addLineNumbers");function h0c(t,e,r,n,o,s){let c=lBi.StringEdit.single(lBi.StringReplacement.insert(t.cursorOffset,lh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=N2r(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[lh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),lh.PromptTags.EDIT_WINDOW.start,...u,lh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),lh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=N2r(f,s.includeLineNumbers.currentFileContent),m=N2r(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 mBi(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` +`)}))}a(h0c,"constructTaggedFile")});var gBi=I(_R=>{"use strict";p();Object.defineProperty(_R,"__esModule",{value:!0});_R.xtab275SystemPrompt=_R.simplifiedPrompt=_R.nes41Miniv3SystemPrompt=_R.unifiedModelSystemPrompt=_R.systemPromptTemplate=void 0;var f$=l$();_R.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 ${f$.PromptTags.EDIT_WINDOW.start} and ${f$.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: @@ -1269,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 ${k$.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 ${f$.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 ${k$.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 ${f$.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 @@ -1282,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 ${k$.PromptTags.EDIT_WINDOW.start} and ${k$.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 ${f$.PromptTags.EDIT_WINDOW.start} and ${f$.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 ${k$.PromptTags.EDIT_WINDOW.start} or ${k$.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 ${f$.PromptTags.EDIT_WINDOW.start} or ${f$.PromptTags.EDIT_WINDOW.end} tags. \`\`\` // Your revised code goes here @@ -1294,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.`;xR.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.`;_R.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: @@ -1323,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.`;xR.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.`;_R.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: @@ -1351,15 +1307,15 @@ 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.`;xR.simplifiedPrompt="Predict next code edit based on the context given by the user.";xR.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 K_t=I(P$=>{"use strict";p();Object.defineProperty(P$,"__esModule",{value:!0});P$.NullTerminalService=P$.ITerminalService=void 0;P$.isTerminalService=Eyc;P$.isNullTerminalService=_yc;var Ayc=rn(),Y_t=Sc(),yyc=ko();P$.ITerminalService=(0,Ayc.createServiceIdentifier)("ITerminalService");var qDr=class t extends yyc.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new Y_t.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new Y_t.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new Y_t.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new Y_t.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){}};P$.NullTerminalService=qDr;function Eyc(t){return t&&typeof t.createTerminal=="function"}a(Eyc,"isTerminalService");function _yc(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(_yc,"isNullTerminalService")});var qLi=I(S6=>{"use strict";p();var Cyc=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},vyc=S6&&S6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(S6,"__esModule",{value:!0});S6.TerminalMonitor=void 0;var byc=K_t(),Syc=ko(),aBe=2e3,jDr=class extends Syc.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:Tyc(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,aBe*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<=aBe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,aBe/2),contentEnd:n.slice(-aBe/2),length:n.length,truncatedChars:n.length-aBe},terminalCount:r};return JSON.stringify(s)}};S6.TerminalMonitor=jDr;S6.TerminalMonitor=jDr=Cyc([vyc(0,byc.ITerminalService)],jDr);function Tyc(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(Tyc,"formatCwd")});var jLi=I(J_t=>{"use strict";p();Object.defineProperty(J_t,"__esModule",{value:!0});J_t.CurrentDocument=void 0;var Iyc=Ts(),HDr=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 Iyc.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}};J_t.CurrentDocument=HDr});var VLi=I(Z_t=>{"use strict";p();Object.defineProperty(Z_t,"__esModule",{value:!0});Z_t.getCurrentLine=wyc;Z_t.isModelLineCompatible=Ryc;var HLi=I_(),xyc=Cyt();function wyc(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new HLi.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?Pyc(n,o,e,r):!1}a(Ryc,"isModelLineCompatible");var kyc=new Set(["()","[]","{}","<>",'""',"''","``"]);function Pyc(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&&$Li(t.inserted,e.inserted):$Li(t.inserted,e.inserted)}a(Pyc,"isUserEditCompatibleWithModelEdit");function $Li(t,e){return e.startsWith(t)?!0:kyc.has(t)?Dyc(t,e):!1}a($Li,"isUserTypingCompatibleWithModelText");function Dyc(t,e){let r=0;for(let n=0;n{"use strict";p();var Nyc=FD&&FD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Myc=FD&&FD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Oyc=FD&&FD.__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(Lyc,"parseEditIntentFromStreamShortName");async function Fyc(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=X_t.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=X_t.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(Fyc,"parseEditIntentFromStreamTags")});var tCt=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.linesWithBackticksRemoved=Qyc;DAe.constructMessages=qyc;DAe.charCount=jyc;DAe.findMergeConflictMarkersRange=Hyc;var $Dr=wo(),WLi=C4e(),Uyc=sd();async function*Qyc(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(Qyc,"linesWithBackticksRemoved");function qyc({systemMsg:t,userMsg:e}){return[{role:$Dr.Raw.ChatRole.System,content:(0,WLi.toTextParts)(t)},{role:$Dr.Raw.ChatRole.User,content:(0,WLi.toTextParts)(e)}]}a(qyc,"constructMessages");function jyc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===$Dr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(jyc,"charCount");function Hyc(t,e,r){for(let n=e.start;n>>>>>>"))return new Uyc.OffsetRange(n,o+1)}}a(Hyc,"findMergeConflictMarkersRange")});var KLi=I(D$=>{"use strict";p();Object.defineProperty(D$,"__esModule",{value:!0});D$.ResponseParseResult=void 0;D$.handleEditWindowOnly=Vyc;D$.handleCodeBlock=Wyc;D$.handleEditWindowWithEditIntent=zyc;D$.handleUnifiedWithXml=Yyc;var cBe=Pge(),zLi=eG(),YLi=g2(),NAe=x$(),Gyc=GDr(),$yc=tCt(),K4;(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})(K4||(D$.ResponseParseResult=K4={}));function Vyc(t){return new K4.EditWindowLines(t)}a(Vyc,"handleEditWindowOnly");function Wyc(t){return new K4.EditWindowLines((0,$yc.linesWithBackticksRemoved)(t))}a(Wyc,"handleCodeBlock");async function zyc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,Gyc.parseEditIntentFromStream)(t,e,r);return new K4.EditWindowLines(o,{intent:n,parseError:s})}a(zyc,"handleEditWindowWithEditIntent");async function Yyc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new K4.Done(new cBe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===NAe.ResponseTags.NO_CHANGE.start)return new K4.Done(new cBe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===NAe.ResponseTags.INSERT.start)return new K4.DirectEdits(Kyc(o,e,r));if(c===NAe.ResponseTags.EDIT.start){let l=Jyc(o);return new K4.EditWindowLines(l)}return new K4.Done(new cBe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(Yyc,"handleUnifiedWithXml");async function*Kyc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorOriginalLinesOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(NAe.ResponseTags.INSERT.end))return new cBe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new zLi.LineReplacement(new YLi.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(NAe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new zLi.LineReplacement(new YLi.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new cBe.NoNextEditReason.NoSuggestions(r,l)}a(Kyc,"generateInsertEdits");async function*Jyc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(NAe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(Jyc,"generateEditLines")});var r3i=I(Jre=>{"use strict";p();Object.defineProperty(Jre,"__esModule",{value:!0});Jre.XtabCustomDiffPatchResponseHandler=Jre.DuplicateAdditionsMode=void 0;Jre.tryRemoveDuplicateAdditions=t3i;var JLi=Hre(),Kre=WA();Object.defineProperty(Jre,"DuplicateAdditionsMode",{enumerable:!0,get:a(function(){return Kre.DuplicateAdditionsMode},"get")});var ZLi=Pge(),Zyc=L_(),Xyc=El(),eEc=hA(),XLi=Ku(),e3i=eG(),tEc=g2(),rEc=vDr(),nEc=kAe(),iEc=x$(),rCt=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))}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 VDr(t){return t.trim().length>1}a(VDr,"isMeaningfulLine");function t3i(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,Xyc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&VDr(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&VDr(c[0])&&VDr(c[1])){let l=c[0],u=c[1];for(let d=1;d{"use strict";p();var oEc=T6&&T6.__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},wR=T6&&T6.__param||function(t,e){return function(r,n){e(r,n,t)}},nCt;Object.defineProperty(T6,"__esModule",{value:!0});T6.XtabEndpoint=void 0;var sEc=SE(),aEc=A6(),zDr=Il(),cEc=PE(),lEc=g$(),uEc=qre(),dEc=pp(),fEc=ey(),pEc=_6(),hEc=gp(),mEc=o0(),gEc=Ure(),AEc=iAe(),yEc=Qs(),YDr=class extends uEc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{nCt=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:AEc.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?{...nCt.chatModelInfo,id:n}:nCt.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(zDr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(zDr.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}}};T6.XtabEndpoint=YDr;T6.XtabEndpoint=YDr=nCt=oEc([wR(3,zDr.IConfigurationService),wR(4,lEc.IDomainService),wR(5,fEc.IFetcherService),wR(6,cEc.ICAPIClientService),wR(7,mEc.ITelemetryService),wR(8,sEc.IAuthenticationService),wR(9,aEc.IChatMLFetcher),wR(10,gEc.ITokenizerProvider),wR(11,yEc.IInstantiationService),wR(12,hEc.IExperimentationService),wR(13,pEc.IChatWebSocketManager),wR(14,dEc.ILogService)],YDr)});var iCt=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.NullProxyModelsService=MAe.IProxyModelsService=void 0;var EEc=rn(),_Ec=Sc();MAe.IProxyModelsService=(0,EEc.createServiceIdentifier)("IProxyModelsService");var KDr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=_Ec.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};MAe.NullProxyModelsService=KDr});var i3i=I(wC=>{"use strict";p();var CEc=wC&&wC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vEc=wC&&wC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bEc=wC&&wC.__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},SEc=wC&&wC.__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 D=="boolean"?D?sCt.IncludeLineNumbersOption.WithSpaceAfter:sCt.IncludeLineNumbersOption.None:D),A=new ZDr.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,d.lines,f,e.langCtx,e.aggressivenessLevel,m,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:h,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:g}}),{prompt:y}=(0,ZDr.getUserPrompt)(A),E=(0,LEc.constructMessages)({systemMsg:c,userMsg:y});n?.setCursorJumpPrompt(E);let _=this.determineModelName();n?.setCursorJumpModelName(_);let v=await this.resolveEndpoint(_,s);if(!v)return UD.Result.fromString("endpointNotResolved");let{endpoint:b,usesResponsesApi:T}=v,w=this.configService.getConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),R=this.configService.getExperimentBasedConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),x={max_tokens:T?Math.max(R,2048):R};w&&(x={...x,secretKey:w});let k=await b.makeChatRequest2({messages:E,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:JDr.ChatLocation.Other,requestOptions:x},o);if(k.type!==JDr.ChatFetchResponseType.Success)return k.type===JDr.ChatFetchResponseType.NotFound&&(s.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),UD.Result.fromString(`fetchError:${k.type}`);try{n?.setCursorJumpResponse(k.value);let D=k.value.trim();return this.parseResponse(D,d.keptRange)}catch(D){return s.trace(`Failed to parse predicted line number from response '${k.value}': ${D}`),UD.Result.fromString(`failedToParseLine:"${k.value}". Error ${DEc.ErrorUtils.fromUnknown(D).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(QD.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(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(xEc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:TEc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:NEc.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(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??FEc}determineLintOptions(){let e=this.configService.getConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...aCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,aCt.parseLintOptionString)(r,aCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):aCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=UEc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return UD.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?UD.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?UD.Result.fromString("crossFileEmptyFilePath"):UD.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?UD.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(UEc,"stripThinkTags")});var v3i=I(Cp=>{"use strict";p();var QEc=Cp&&Cp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qEc=Cp&&Cp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jEc=Cp&&Cp.__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},HEc=Cp&&Cp.__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=I6.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(f_c.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(A_c.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(C_c.XtabNextCursorPredictor,I6.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new ws.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new ws.NoNextEditReason.ActiveDocumentHasNoEdits;return new ws.WithStatelessProviderTelemetry(h,s.build(uCt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,B$.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new ws.WithStatelessProviderTelemetry(d.value,s.build(uCt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof ws.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new ws.WithStatelessProviderTelemetry(f,s.build(uCt.Result.error(f)))}catch(c){let l=M$.ErrorUtils.fromUnknown(c),u=new ws.NoNextEditReason.Unexpected(l);return new ws.WithStatelessProviderTelemetry(u,s.build(uCt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,d_c.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 ws.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 eNr.Position(r.endLineNumber,r.endColumn),E=new y_c.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=y3i(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 fCt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new ws.RequestEditWindowWithCursorJump(w,l):new ws.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,g3i.countTokensForLines)(R,I6.computeTokens)>x)return new ws.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(Te=>Te.includes(f3i.PromptTags.CURSOR)),N=(0,O$.constructTaggedFile)(E,v,_,m,I6.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:ra.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new ws.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(vi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(Q),M!==void 0&&f.setXtabUserHappinessScore(M);let q=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let F=m.neighborFiles.enabled?await(0,N$.raceCancellation)((0,N$.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new m_c.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),W=new O$.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,q,Q,U,I6.computeTokens,m,F),{prompt:V,nDiffsInPrompt:G,diffTokensInPrompt:Y,neighborSnippetsResult:re}=(0,O$.getUserPrompt)(W);f.setNDiffsInPrompt(G),f.setDiffTokensInPrompt(Y),re&&(f.setNNeighborSnippetsComputed(re.nComputed),f.setNNeighborSnippetsInPrompt(re.nIncluded),f.setNeighborSnippetIndicesInPrompt(re.includedIndices));let j=ra.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),X=this.getPredictedOutput(h,R,j),ie=(0,tNr.constructMessages)({systemMsg:E3i(m.promptingStrategy),userMsg:V});d.setPrompt(ie),f.setPrompt(ie);let we=3e4*4;if((0,tNr.charCount)(ie)>we)return new ws.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let Te=U.getData();f.setLintErrors(Te),d.setDiagnosticsData(Te);let Z=this.terminalMonitor.getData();f.setTerminalOutput(Z),d.setTerminalData(Z)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let De={endpoint:A,modelServiceConfig:g,messages:ie,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:b,editWindowLineRange:v},promptPieces:W,prediction:X,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,De,{shouldRemoveCursorTagFromResponse:D,responseFormat:j},{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,h_c.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(vi.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(vi.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,RC.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[RC.AggressivenessSetting.Low]:{minResponseConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[RC.AggressivenessSetting.Medium]:{minResponseConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[RC.AggressivenessSetting.High]:{debounceConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[RC.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(vi.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,m3i.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new u_c.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,r_c.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===s3i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,N$.raceCancellation)((0,N$.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===s3i.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(M$.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]);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 ws.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 i_c.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(vi.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new GEc.FetchStreamSource,E=new o_c.StopWatch,_="",v,b=new N$.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:I6.ID,messages:r,finishedCb:a(async(k,D,N)=>{b.isSettled||b.complete(),v===void 0&&k!==""&&(v=E.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(k,N),_=k,m.setResponse(_)},"finishedCb"),location:xf.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(k=>({response:k,ttft:v}))),m.setFullResponse(T.then(k=>k.type===xf.ChatFetchResponseType.Success?k.value:void 0)),T.then(k=>{k.type!==xf.ChatFetchResponseType.Success?y.reject(new d3i.FetchStreamError(oNr(k))):y.resolve()}).catch(k=>{m.setError(M$.ErrorUtils.fromUnknown(k)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(M$.ErrorUtils.fromUnknown(k))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==xf.ChatFetchResponseType.Success)return w.type===xf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,L$.ModelNotFound.INSTANCE):w.type===xf.ChatFetchResponseType.Unknown&&w.reason===xf.RESPONSE_CONTAINED_NO_CHOICES?new L$.FetchFailure(new ws.NoNextEditReason.NoSuggestions(u,l)):new L$.FetchFailure(oNr(w));let R=a3i.AsyncIterUtilsExt.splitLines(a3i.AsyncIterUtils.map(y.stream,k=>k.delta.text)),x=(async function*(){let k=0;for await(let D of R){let N=`Line ${k++} emitted with latency ${E.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(f3i.PromptTags.CURSOR,""):D}})();return new L$.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,cursorOriginalLinesOffset:x,editWindowLineRange:k}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof L$.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof L$.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:Q}=N,M=s instanceof B$.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case ra.ResponseFormat.EditWindowOnly:{O=(0,Zre.handleEditWindowOnly)(L);break}case ra.ResponseFormat.CodeBlock:{O=(0,Zre.handleCodeBlock)(L);break}case ra.ResponseFormat.EditWindowWithEditIntent:case ra.ResponseFormat.EditWindowWithEditIntentShort:{let re=n.responseFormat===ra.ResponseFormat.EditWindowWithEditIntentShort?h3i.EditIntentParseMode.ShortName:h3i.EditIntentParseMode.Tags;O=await(0,Zre.handleEditWindowWithEditIntent)(L,h,re);break}case ra.ResponseFormat.CustomDiffPatch:{let re=e.getActiveDocument(),j=v.currentDocument,ie=j.lines[E.keptRange.endExclusive-1].length,we=j.transformer.getOffsetRange(new fCt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,ie+1)),Ae=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService);O=new Zre.ResponseParseResult.DirectEdits(E_c.XtabCustomDiffPatchResponseHandler.handleResponse(L,j,re.id,re.workspaceRoot,we,h,Ae));break}case ra.ResponseFormat.UnifiedWithXml:{O=await(0,Zre.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:k,cursorOriginalLinesOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,BAe.assertNever)(n.responseFormat)}if(O instanceof Zre.ResponseParseResult.Done)return O.reason;if(O instanceof Zre.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:re,parseError:j}=O.editIntentMetadata;if(g.setEditIntent(re),j&&g.setEditIntentParseError(j),!ra.EditIntent.shouldShowEdit(re,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${re}" with aggressiveness "${v.aggressivenessLevel}"`),new ws.NoNextEditReason.FilteredOut(`editIntent:${re} aggressivenessLevel:${v.aggressivenessLevel}`)}let q=O.lines,F={emitFastCursorLineChange:o3i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${Q.elapsed()} ms`);let U=(0,n_c.backwardCompatSetting)(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),re=>{switch(re){case!1:case void 0:return RC.EarlyDivergenceCancellationMode.Off;case!0:return RC.EarlyDivergenceCancellationMode.Cursor;case RC.EarlyDivergenceCancellationMode.Off:case RC.EarlyDivergenceCancellationMode.Cursor:case RC.EarlyDivergenceCancellationMode.EditWindow:return re;default:return RC.EarlyDivergenceCancellationMode.Off}}),W=!1,V=U===RC.EarlyDivergenceCancellationMode.Off?q:S_c(q,x,e,k,R,d,l,re=>{W=re},U),G=0,Y=!1;for await(let re of o3i.ResponseProcessor.diff(R,V,x,F)){if(W)break;h.trace(`ResponseProcessor streamed edit #${G} with latency ${Q.elapsed()} ms`);let j=[];if(re.lineRange.startLineNumber===re.lineRange.endLineNumberExclusive||re.newLines.length===0||re.lineRange.endLineNumberExclusive-re.lineRange.startLineNumber===1&&re.newLines.length===1){let X=new dCt.LineReplacement(new u3i.LineRange(re.lineRange.startLineNumber+k.start,re.lineRange.endLineNumberExclusive+k.start),re.newLines);j.push(X)}else{let X=R.slice(re.lineRange.startLineNumber-1,re.lineRange.endLineNumberExclusive-1).join(` -`),ie=await this.diffService.computeDiff(X,re.newLines.join(` -`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${G} with latency ${Q.elapsed()} ms`);let we=k.start+re.lineRange.startLineNumber;for(let Ae of ie.changes){let De=new dCt.LineReplacement(new u3i.LineRange(we+Ae.original.startLineNumber-1,we+Ae.original.endLineNumberExclusive-1),re.newLines.slice(Ae.modified.startLineNumber-1,Ae.modified.endLineNumberExclusive-1));j.push(De)}}m.setResponse(B());for(let X of j){if(h.trace(`extracting edit #${G}: ${X.toString()}`),!Y){Y=!0;let ie=this.determineArtificialDelayMs(c,h,g);if(ie&&(await(0,N$.timeout)(ie),h.trace(`Artificial delay of ${ie} ms completed`),u.isCancellationRequested))return new ws.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:X,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},G++}}return W?new ws.NoNextEditReason.GotCancelled(U===RC.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new ws.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(q){return q instanceof d3i.FetchStreamError?q.reason:(m.setError(q),new ws.NoNextEditReason.Unexpected(M$.ErrorUtils.fromUnknown(q)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new ws.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof B$.Retrying)return m;if(rNr(e))return l.trace("Skipping cursor prediction: user typed during request"),new ws.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,l,u,s);if(s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(rNr(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new ws.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=I6.getNextCursorColumn(b);switch(g){case cCt.NextCursorLinePrediction.Jump:{let w=new eNr.Position(v,T);return new ws.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case cCt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new fCt.Range(v,T,v,T),n,o,s,new B$.Retrying("cursorJump"),d);default:(0,BAe.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,c3i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new ws.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,c3i.isAbsolute)(e.filePath)?l3i.URI.file(e.filePath):l3i.URI.joinPath(m,e.filePath),A=zEc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new eNr.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case cCt.NextCursorLinePrediction.Jump:return new ws.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case cCt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${M$.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new ws.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(rNr(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new ws.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new a_c.StringText(_.getText()),b=new ws.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,KEc.LanguageId.create(_.languageId),v.getLines(),dCt.LineEdit.empty,v,new YEc.Edits(s_c.StringEdit,[])),T=new ws.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new N$.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new fCt.Range(y,1,y,1),s,c,l,new B$.Retrying("cursorJump"),f)}default:(0,BAe.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(vi.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(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??O$.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(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${O$.N_LINES_BELOW}`),u=O$.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new nNr.OffsetRange(d,f),g=(0,tNr.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(vi.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 nNr.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...ra.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:sNr(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService)},languageContext:_3i(e.languageId,{enabled:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:ra.GlobalBudgetOptions.DEFAULT_ORDER,shares:ra.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=ra.applyStrategyConfig(n);return{promptOptions:sNr(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(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(__c.XtabEndpoint,r,n,e):(0,VEc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n){return this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService)?{type:"content",content:C3i(e,r,n)}:void 0}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof B$.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,N$.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){let n=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsAllowImportChanges,this.expService),o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:p_c.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:lCt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(vi.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:lCt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=lCt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=lCt.editWouldDeleteWhatWasJustInserted2;break;default:(0,BAe.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new dCt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(vi.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:A3i(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}};Cp.XtabProvider=iNr;Cp.XtabProvider=iNr=I6=jEc([qD(0,JEc.IInlineEditsModelService),qD(1,XEc.ISimulationTestContext),qD(2,l_c.IInstantiationService),qD(3,t_c.IWorkspaceService),qD(4,$Ec.IDiffService),qD(5,vi.IConfigurationService),qD(6,e_c.IExperimentationService),qD(7,m3i.ILanguageContextProviderService),qD(8,ZEc.ILanguageDiagnosticsService),qD(9,WEc.IIgnoreService),qD(10,g_c.ISimilarFilesContextService)],iNr);function A3i(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(A3i,"filterOutEditsWithSubstrings");function y3i(t){let e=t.cursorLineOffset,r=Math.max(0,e-O$.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+O$.N_LINES_AS_CONTEXT+1);return new nNr.OffsetRange(r,n)}a(y3i,"computeAreaAroundEditWindowLinesRange");function oNr(t){switch(t.type){case xf.ChatFetchResponseType.Canceled:return new ws.NoNextEditReason.GotCancelled("afterFetchCall");case xf.ChatFetchResponseType.OffTopic:case xf.ChatFetchResponseType.Filtered:case xf.ChatFetchResponseType.PromptFiltered:case xf.ChatFetchResponseType.Length:case xf.ChatFetchResponseType.RateLimited:case xf.ChatFetchResponseType.QuotaExceeded:case xf.ChatFetchResponseType.ExtensionBlocked:case xf.ChatFetchResponseType.AgentUnauthorized:case xf.ChatFetchResponseType.AgentFailedDependency:case xf.ChatFetchResponseType.InvalidStatefulMarker:return new ws.NoNextEditReason.Uncategorized(M$.ErrorUtils.fromUnknown(t));case xf.ChatFetchResponseType.BadRequest:case xf.ChatFetchResponseType.NotFound:case xf.ChatFetchResponseType.Failed:case xf.ChatFetchResponseType.NetworkError:case xf.ChatFetchResponseType.Unknown:return new ws.NoNextEditReason.FetchFailure(M$.ErrorUtils.fromUnknown(t))}}a(oNr,"mapChatFetcherErrorToNoNextEditReason");function sNr(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?b_c(t.lintOptions,e.lintOptions):t.lintOptions}}a(sNr,"overrideModelConfig");var v_c={...ra.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function b_c(t,e){return{...t??v_c,...e}}a(b_c,"mergeLintOptions");function E3i(t){switch(t){case ra.PromptingStrategy.UnifiedModel:return lBe.unifiedModelSystemPrompt;case ra.PromptingStrategy.Codexv21NesUnified:case ra.PromptingStrategy.SimplifiedSystemPrompt:return lBe.simplifiedPrompt;case ra.PromptingStrategy.PatchBased:case ra.PromptingStrategy.PatchBased01:case ra.PromptingStrategy.PatchBased02:case ra.PromptingStrategy.PatchBased02WithRecentLineNumbers:case ra.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case ra.PromptingStrategy.Xtab275:case ra.PromptingStrategy.XtabAggressiveness:case ra.PromptingStrategy.Xtab275Aggressiveness:case ra.PromptingStrategy.Xtab275AggressivenessHighLow:case ra.PromptingStrategy.Xtab275EditIntent:case ra.PromptingStrategy.Xtab275EditIntentShort:return lBe.xtab275SystemPrompt;case ra.PromptingStrategy.Nes41Miniv3:return lBe.nes41Miniv3SystemPrompt;case ra.PromptingStrategy.CopilotNesXtab:case void 0:return lBe.systemPromptTemplate;default:(0,BAe.assertNever)(t)}}a(E3i,"pickSystemPrompt");function _3i(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(_3i,"determineLanguageContextOptions");function C3i(t,e,r){if(r===ra.ResponseFormat.UnifiedWithXml)return["",...e,""].join(` -`);if(r===ra.ResponseFormat.EditWindowOnly)return e.join(` -`);if(r===ra.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...e].join(` -`);if(r===ra.ResponseFormat.EditWindowWithEditIntentShort)return["H",...e].join(` -`);if(r===ra.ResponseFormat.CodeBlock)return["```",...e,"```"].join(` -`);if(r===ra.ResponseFormat.CustomDiffPatch){let n=t.workspaceRoot?.path;return`${(0,g3i.toUniquePath)(t.id,n)}:`}else(0,BAe.assertNever)(r)}a(C3i,"getPredictionContents");async function*S_c(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 c_c.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case RC.EarlyDivergenceCancellationMode.Cursor:return E===e;case RC.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,p3i.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,p3i.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(S_c,"linesWithIntermediateEditDivergenceCheck")});var b3i=I(J4=>{"use strict";p();var T_c=J4&&J4.__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},pCt=J4&&J4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(J4,"__esModule",{value:!0});J4.StaticGitHubAuthenticationService=void 0;J4.setCopilotToken=k_c;var I_c=Il(),x_c=pp(),hCt=SE(),w_c=UMe(),R_c=_H(),mCt=class extends hCt.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:hCt.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:hCt.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 hCt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireAuthenticationChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};J4.StaticGitHubAuthenticationService=mCt;J4.StaticGitHubAuthenticationService=mCt=T_c([pCt(1,x_c.ILogService),pCt(2,R_c.ICopilotTokenStore),pCt(3,w_c.ICopilotTokenManager),pCt(4,I_c.IConfigurationService)],mCt);function k_c(t,e){if(!(t instanceof mCt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(k_c,"setCopilotToken")});var w3i=I(kC=>{"use strict";p();Object.defineProperty(kC,"__esModule",{value:!0});kC.GraphQLErrorType=void 0;kC.getErrorCode=I3i;kC.derivePullRequestState=P_c;kC.makeGitHubAPIRequest=x3i;kC.makeGitHubGraphQLRequest=LAe;kC.makeSearchGraphQLRequest=D_c;kC.getPullRequestFromGlobalId=N_c;kC.addPullRequestCommentGraphQLRequest=M_c;kC.closePullRequest=O_c;kC.makeGitHubAPIRequestWithPagination=B_c;kC.getAssignableActorsWithSuggestedActors=L_c;kC.getAssignableActorsWithAssignableUsers=F_c;function S3i(t){return typeof t=="object"&&t!==null}a(S3i,"isObject");var T3i;(function(t){t.Unprocessable="UNPROCESSABLE"})(T3i||(kC.GraphQLErrorType=T3i={}));function I3i(t){if(!S3i(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(S3i(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(I3i,"getErrorCode");function P_c(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(P_c,"derivePullRequestState");async function x3i(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(x3i,"makeGitHubAPIRequest");async function LAe(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(LAe,"makeGitHubGraphQLRequest");async function D_c(t,e,r,n,o,s,c=20){let l=` +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;_R.simplifiedPrompt="Predict next code edit based on the context given by the user.";_R.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 h_t=I(p$=>{"use strict";p();Object.defineProperty(p$,"__esModule",{value:!0});p$.NullTerminalService=p$.ITerminalService=void 0;p$.isTerminalService=A0c;p$.isNullTerminalService=y0c;var m0c=rn(),p_t=Cc(),g0c=wo();p$.ITerminalService=(0,m0c.createServiceIdentifier)("ITerminalService");var L2r=class t extends g0c.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new p_t.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new p_t.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new p_t.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new p_t.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){}};p$.NullTerminalService=L2r;function A0c(t){return t&&typeof t.createTerminal=="function"}a(A0c,"isTerminalService");function y0c(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(y0c,"isNullTerminalService")});var ABi=I(l6=>{"use strict";p();var E0c=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},_0c=l6&&l6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(l6,"__esModule",{value:!0});l6.TerminalMonitor=void 0;var v0c=h_t(),C0c=wo(),M4e=2e3,F2r=class extends C0c.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:b0c(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,M4e*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<=M4e?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,M4e/2),contentEnd:n.slice(-M4e/2),length:n.length,truncatedChars:n.length-M4e},terminalCount:r};return JSON.stringify(s)}};l6.TerminalMonitor=F2r;l6.TerminalMonitor=F2r=E0c([_0c(0,v0c.ITerminalService)],F2r);function b0c(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(b0c,"formatCwd")});var yBi=I(m_t=>{"use strict";p();Object.defineProperty(m_t,"__esModule",{value:!0});m_t.CurrentDocument=void 0;var S0c=Cs(),U2r=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 S0c.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}};m_t.CurrentDocument=U2r});var CBi=I(g_t=>{"use strict";p();Object.defineProperty(g_t,"__esModule",{value:!0});g_t.getCurrentLine=I0c;g_t.isModelLineCompatible=x0c;var EBi=b_(),T0c=UAt();function I0c(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new EBi.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?R0c(n,o,e,r):!1}a(x0c,"isModelLineCompatible");var w0c=new Set(["()","[]","{}","<>",'""',"''","``"]);function R0c(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&&vBi(t.inserted,e.inserted):vBi(t.inserted,e.inserted)}a(R0c,"isUserEditCompatibleWithModelEdit");function vBi(t,e){return e.startsWith(t)?!0:w0c.has(t)?P0c(t,e):!1}a(vBi,"isUserTypingCompatibleWithModelText");function P0c(t,e){let r=0;for(let n=0;n{"use strict";p();var k0c=PD&&PD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D0c=PD&&PD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),N0c=PD&&PD.__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(O0c,"parseEditIntentFromStreamShortName");async function B0c(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=A_t.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=A_t.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(B0c,"parseEditIntentFromStreamTags")});var E_t=I(lAe=>{"use strict";p();Object.defineProperty(lAe,"__esModule",{value:!0});lAe.linesWithBackticksRemoved=F0c;lAe.constructMessages=U0c;lAe.charCount=Q0c;lAe.findMergeConflictMarkersRange=q0c;var q2r=Io(),bBi=z5e(),L0c=sd();async function*F0c(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(F0c,"linesWithBackticksRemoved");function U0c({systemMsg:t,userMsg:e}){return[{role:q2r.Raw.ChatRole.System,content:(0,bBi.toTextParts)(t)},{role:q2r.Raw.ChatRole.User,content:(0,bBi.toTextParts)(e)}]}a(U0c,"constructMessages");function Q0c(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===q2r.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(Q0c,"charCount");function q0c(t,e,r){for(let n=e.start;n>>>>>>"))return new L0c.OffsetRange(n,o+1)}}a(q0c,"findMergeConflictMarkersRange")});var IBi=I(h$=>{"use strict";p();Object.defineProperty(h$,"__esModule",{value:!0});h$.ResponseParseResult=void 0;h$.handleEditWindowOnly=G0c;h$.handleCodeBlock=$0c;h$.handleEditWindowWithEditIntent=V0c;h$.handleUnifiedWithXml=W0c;var O4e=cge(),SBi=BH(),TBi=c2(),uAe=l$(),j0c=Q2r(),H0c=E_t(),F4;(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})(F4||(h$.ResponseParseResult=F4={}));function G0c(t){return new F4.EditWindowLines(t)}a(G0c,"handleEditWindowOnly");function $0c(t){return new F4.EditWindowLines((0,H0c.linesWithBackticksRemoved)(t))}a($0c,"handleCodeBlock");async function V0c(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,j0c.parseEditIntentFromStream)(t,e,r);return new F4.EditWindowLines(o,{intent:n,parseError:s})}a(V0c,"handleEditWindowWithEditIntent");async function W0c(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new F4.Done(new O4e.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===uAe.ResponseTags.NO_CHANGE.start)return new F4.Done(new O4e.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===uAe.ResponseTags.INSERT.start)return new F4.DirectEdits(z0c(o,e,r));if(c===uAe.ResponseTags.EDIT.start){let l=Y0c(o);return new F4.EditWindowLines(l)}return new F4.Done(new O4e.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(W0c,"handleUnifiedWithXml");async function*z0c(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorOriginalLinesOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(uAe.ResponseTags.INSERT.end))return new O4e.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new SBi.LineReplacement(new TBi.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(uAe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new SBi.LineReplacement(new TBi.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new O4e.NoNextEditReason.NoSuggestions(r,l)}a(z0c,"generateInsertEdits");async function*Y0c(t){let e=await t.next();for(;!e.done;){if(e.value.includes(uAe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(Y0c,"generateEditLines")});var DBi=I(Mre=>{"use strict";p();Object.defineProperty(Mre,"__esModule",{value:!0});Mre.XtabCustomDiffPatchResponseHandler=Mre.DuplicateAdditionsMode=void 0;Mre.tryRemoveDuplicateAdditions=kBi;var xBi=Ire(),Nre=ZA();Object.defineProperty(Mre,"DuplicateAdditionsMode",{enumerable:!0,get:a(function(){return Nre.DuplicateAdditionsMode},"get")});var wBi=cge(),K0c=M_(),J0c=Al(),Z0c=AA(),RBi=Ku(),PBi=BH(),X0c=c2(),emc=y2r(),tmc=aAe(),rmc=l$(),__t=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))}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 j2r(t){return t.trim().length>1}a(j2r,"isMeaningfulLine");function kBi(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,J0c.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&j2r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&j2r(c[0])&&j2r(c[1])){let l=c[0],u=c[1];for(let d=1;d{"use strict";p();var nmc=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},vR=u6&&u6.__param||function(t,e){return function(r,n){e(r,n,t)}},v_t;Object.defineProperty(u6,"__esModule",{value:!0});u6.XtabEndpoint=void 0;var imc=vE(),omc=r6(),G2r=Sl(),smc=wE(),amc=ZG(),cmc=Sre(),lmc=hp(),umc=oy(),dmc=o6(),fmc=Ap(),pmc=o0(),hmc=Cre(),mmc=Oge(),gmc=Ls(),$2r=class extends cmc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{v_t=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:mmc.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?{...v_t.chatModelInfo,id:n}:v_t.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(G2r.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(G2r.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}}};u6.XtabEndpoint=$2r;u6.XtabEndpoint=$2r=v_t=nmc([vR(3,G2r.IConfigurationService),vR(4,amc.IDomainService),vR(5,umc.IFetcherService),vR(6,smc.ICAPIClientService),vR(7,pmc.ITelemetryService),vR(8,imc.IAuthenticationService),vR(9,omc.IChatMLFetcher),vR(10,hmc.ITokenizerProvider),vR(11,gmc.IInstantiationService),vR(12,fmc.IExperimentationService),vR(13,dmc.IChatWebSocketManager),vR(14,lmc.ILogService)],$2r)});var C_t=I(dAe=>{"use strict";p();Object.defineProperty(dAe,"__esModule",{value:!0});dAe.NullProxyModelsService=dAe.IProxyModelsService=void 0;var Amc=rn(),ymc=Cc();dAe.IProxyModelsService=(0,Amc.createServiceIdentifier)("IProxyModelsService");var V2r=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=ymc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};dAe.NullProxyModelsService=V2r});var MBi=I(Sv=>{"use strict";p();var Emc=Sv&&Sv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_mc=Sv&&Sv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vmc=Sv&&Sv.__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},Cmc=Sv&&Sv.__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 D=="boolean"?D?S_t.IncludeLineNumbersOption.WithSpaceAfter:S_t.IncludeLineNumbersOption.None:D),A=new z2r.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,d.lines,f,e.langCtx,e.aggressivenessLevel,m,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:h,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:g}}),{prompt:y}=(0,z2r.getUserPrompt)(A),E=(0,Omc.constructMessages)({systemMsg:c,userMsg:y});n?.setCursorJumpPrompt(E);let _=this.determineModelName();n?.setCursorJumpModelName(_);let v=await this.resolveEndpoint(_,s);if(!v)return kD.Result.fromString("endpointNotResolved");let{endpoint:b,usesResponsesApi:T}=v,w=this.configService.getConfig(DD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),R=this.configService.getExperimentBasedConfig(DD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),x={max_tokens:T?Math.max(R,2048):R};w&&(x={...x,secretKey:w});let P=await b.makeChatRequest2({messages:E,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:W2r.ChatLocation.Other,requestOptions:x},o);if(P.type!==W2r.ChatFetchResponseType.Success)return P.type===W2r.ChatFetchResponseType.NotFound&&(s.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),kD.Result.fromString(`fetchError:${P.type}`);try{n?.setCursorJumpResponse(P.value);let D=P.value.trim();return this.parseResponse(D,d.keptRange)}catch(D){return s.trace(`Failed to parse predicted line number from response '${P.value}': ${D}`),kD.Result.fromString(`failedToParseLine:"${P.value}". Error ${Pmc.ErrorUtils.fromUnknown(D).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(DD.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(DD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(Tmc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:bmc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:kmc.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(DD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??Bmc}determineLintOptions(){let e=this.configService.getConfig(DD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...T_t.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(DD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,T_t.parseLintOptionString)(r,T_t.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):T_t.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=Lmc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return kD.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?kD.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?kD.Result.fromString("crossFileEmptyFilePath"):kD.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?kD.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(Lmc,"stripThinkTags")});var ZBi=I(Cp=>{"use strict";p();var Fmc=Cp&&Cp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Umc=Cp&&Cp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qmc=Cp&&Cp.__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},qmc=Cp&&Cp.__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=d6.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(ugc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(mgc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(Egc.XtabNextCursorPredictor,d6.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Ts.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Ts.NoNextEditReason.ActiveDocumentHasNoEdits;return new Ts.WithStatelessProviderTelemetry(h,s.build(w_t.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,y$.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Ts.WithStatelessProviderTelemetry(d.value,s.build(w_t.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Ts.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Ts.WithStatelessProviderTelemetry(f,s.build(w_t.Result.error(f)))}catch(c){let l=g$.ErrorUtils.fromUnknown(c),u=new Ts.NoNextEditReason.Unexpected(l);return new Ts.WithStatelessProviderTelemetry(u,s.build(w_t.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,lgc.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 Ts.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 K2r.Position(r.endLineNumber,r.endColumn),E=new ggc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=zBi(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 P_t.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Ts.RequestEditWindowWithCursorJump(w,l):new Ts.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,VBi.countTokensForLines)(R,d6.computeTokens)>x)return new Ts.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(Pe=>Pe.includes(jBi.PromptTags.CURSOR)),N=(0,A$.constructTaggedFile)(E,v,_,m,d6.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Zs.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Ts.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(vi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(j),M!==void 0&&f.setXtabUserHappinessScore(M);let q=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Ts.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,m$.raceCancellation)((0,m$.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Ts.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new pgc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),z=new A$.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,q,j,U,d6.computeTokens,m,Q),{prompt:W,nDiffsInPrompt:$,diffTokensInPrompt:J,neighborSnippetsResult:ne}=(0,A$.getUserPrompt)(z);f.setNDiffsInPrompt($),f.setDiffTokensInPrompt(J),ne&&(f.setNNeighborSnippetsComputed(ne.nComputed),f.setNNeighborSnippetsInPrompt(ne.nIncluded),f.setNeighborSnippetIndicesInPrompt(ne.includedIndices));let H=Zs.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,R,H),ae=(0,J2r.constructMessages)({systemMsg:YBi(m.promptingStrategy),userMsg:W});d.setPrompt(ae),f.setPrompt(ae);let Oe=3e4*4;if((0,J2r.charCount)(ae)>Oe)return new Ts.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Ts.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let Pe=U.getData();f.setLintErrors(Pe),d.setDiagnosticsData(Pe);let Z=this.terminalMonitor.getData();f.setTerminalOutput(Z),d.setTerminalData(Z)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Fe={endpoint:A,modelServiceConfig:g,messages:ae,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:b,editWindowLineRange:v},promptPieces:z,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Fe,{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,fgc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(vi.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(vi.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Tv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Tv.AggressivenessSetting.Low]:{minResponseConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Tv.AggressivenessSetting.Medium]:{minResponseConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Tv.AggressivenessSetting.High]:{debounceConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Tv.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(vi.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,$Bi.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new cgc.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,egc.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===BBi.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,m$.raceCancellation)((0,m$.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===BBi.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(g$.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]);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 Ts.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 rgc.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(vi.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new jmc.FetchStreamSource,E=new ngc.StopWatch,_="",v,b=new m$.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:d6.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:xf.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===xf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==xf.ChatFetchResponseType.Success?y.reject(new qBi.FetchStreamError(tDr(P))):y.resolve()}).catch(P=>{m.setError(g$.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(g$.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==xf.ChatFetchResponseType.Success)return w.type===xf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,E$.ModelNotFound.INSTANCE):w.type===xf.ChatFetchResponseType.Unknown&&w.reason===xf.RESPONSE_CONTAINED_NO_CHOICES?new E$.FetchFailure(new Ts.NoNextEditReason.NoSuggestions(u,l)):new E$.FetchFailure(tDr(w));let R=LBi.AsyncIterUtilsExt.splitLines(LBi.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(jBi.PromptTags.CURSOR,""):D}})();return new E$.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,cursorOriginalLinesOffset: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 E$.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof E$.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:j}=N,M=s instanceof y$.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case Zs.ResponseFormat.EditWindowOnly:{O=(0,Ore.handleEditWindowOnly)(L);break}case Zs.ResponseFormat.CodeBlock:{O=(0,Ore.handleCodeBlock)(L);break}case Zs.ResponseFormat.EditWindowWithEditIntent:case Zs.ResponseFormat.EditWindowWithEditIntentShort:{let ne=n.responseFormat===Zs.ResponseFormat.EditWindowWithEditIntentShort?GBi.EditIntentParseMode.ShortName:GBi.EditIntentParseMode.Tags;O=await(0,Ore.handleEditWindowWithEditIntent)(L,h,ne);break}case Zs.ResponseFormat.CustomDiffPatch:{let ne=e.getActiveDocument(),H=v.currentDocument,ae=H.lines[E.keptRange.endExclusive-1].length,Oe=H.transformer.getOffsetRange(new P_t.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,ae+1)),ve=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService);O=new Ore.ResponseParseResult.DirectEdits(Agc.XtabCustomDiffPatchResponseHandler.handleResponse(L,H,ne.id,ne.workspaceRoot,Oe,h,ve));break}case Zs.ResponseFormat.UnifiedWithXml:{O=await(0,Ore.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:P,cursorOriginalLinesOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,pAe.assertNever)(n.responseFormat)}if(O instanceof Ore.ResponseParseResult.Done)return O.reason;if(O instanceof Ore.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ne,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ne),H&&g.setEditIntentParseError(H),!Zs.EditIntent.shouldShowEdit(ne,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ne}" with aggressiveness "${v.aggressivenessLevel}"`),new Ts.NoNextEditReason.FilteredOut(`editIntent:${ne} aggressivenessLevel:${v.aggressivenessLevel}`)}let q=O.lines,Q={emitFastCursorLineChange:OBi.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${j.elapsed()} ms`);let U=(0,tgc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ne=>{switch(ne){case!1:case void 0:return Tv.EarlyDivergenceCancellationMode.Off;case!0:return Tv.EarlyDivergenceCancellationMode.Cursor;case Tv.EarlyDivergenceCancellationMode.Off:case Tv.EarlyDivergenceCancellationMode.Cursor:case Tv.EarlyDivergenceCancellationMode.EditWindow:return ne;default:return Tv.EarlyDivergenceCancellationMode.Off}}),z=!1,W=U===Tv.EarlyDivergenceCancellationMode.Off?q:Cgc(q,x,e,P,R,d,l,ne=>{z=ne},U),$=0,J=!1;for await(let ne of OBi.ResponseProcessor.diff(R,W,x,Q)){if(z)break;h.trace(`ResponseProcessor streamed edit #${$} with latency ${j.elapsed()} ms`);let H=[];if(ne.lineRange.startLineNumber===ne.lineRange.endLineNumberExclusive||ne.newLines.length===0||ne.lineRange.endLineNumberExclusive-ne.lineRange.startLineNumber===1&&ne.newLines.length===1){let re=new R_t.LineReplacement(new QBi.LineRange(ne.lineRange.startLineNumber+P.start,ne.lineRange.endLineNumberExclusive+P.start),ne.newLines);H.push(re)}else{let re=R.slice(ne.lineRange.startLineNumber-1,ne.lineRange.endLineNumberExclusive-1).join(` +`),ae=await this.diffService.computeDiff(re,ne.newLines.join(` +`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${$} with latency ${j.elapsed()} ms`);let Oe=P.start+ne.lineRange.startLineNumber;for(let ve of ae.changes){let Fe=new R_t.LineReplacement(new QBi.LineRange(Oe+ve.original.startLineNumber-1,Oe+ve.original.endLineNumberExclusive-1),ne.newLines.slice(ve.modified.startLineNumber-1,ve.modified.endLineNumberExclusive-1));H.push(Fe)}}m.setResponse(B());for(let re of H){if(h.trace(`extracting edit #${$}: ${re.toString()}`),!J){J=!0;let ae=this.determineArtificialDelayMs(c,h,g);if(ae&&(await(0,m$.timeout)(ae),h.trace(`Artificial delay of ${ae} ms completed`),u.isCancellationRequested))return new Ts.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},$++}}return z?new Ts.NoNextEditReason.GotCancelled(U===Tv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Ts.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(q){return q instanceof qBi.FetchStreamError?q.reason:(m.setError(q),new Ts.NoNextEditReason.Unexpected(g$.ErrorUtils.fromUnknown(q)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Ts.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof y$.Retrying)return m;if(Z2r(e))return l.trace("Skipping cursor prediction: user typed during request"),new Ts.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,l,u,s);if(s.isCancellationRequested)return new Ts.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(Z2r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Ts.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=d6.getNextCursorColumn(b);switch(g){case I_t.NextCursorLinePrediction.Jump:{let w=new K2r.Position(v,T);return new Ts.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case I_t.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new P_t.Range(v,T,v,T),n,o,s,new y$.Retrying("cursorJump"),d);default:(0,pAe.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,FBi.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Ts.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,FBi.isAbsolute)(e.filePath)?UBi.URI.file(e.filePath):UBi.URI.joinPath(m,e.filePath),A=Vmc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new K2r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case I_t.NextCursorLinePrediction.Jump:return new Ts.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case I_t.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${g$.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Ts.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Ts.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(Z2r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Ts.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new ogc.StringText(_.getText()),b=new Ts.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,zmc.LanguageId.create(_.languageId),v.getLines(),R_t.LineEdit.empty,v,new Wmc.Edits(igc.StringEdit,[])),T=new Ts.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new m$.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new P_t.Range(y,1,y,1),s,c,l,new y$.Retrying("cursorJump"),f)}default:(0,pAe.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(vi.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(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??A$.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(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${A$.N_LINES_BELOW}`),u=A$.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new X2r.OffsetRange(d,f),g=(0,J2r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(vi.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 X2r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Zs.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:rDr(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService)},languageContext:KBi(e.languageId,{enabled:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:Zs.GlobalBudgetOptions.DEFAULT_ORDER,shares:Zs.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=Zs.applyStrategyConfig(n);return{promptOptions:rDr(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(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(ygc.XtabEndpoint,r,n,e):(0,Gmc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n){return this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService)?{type:"content",content:JBi(e,r,n)}:void 0}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof y$.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,m$.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){let n=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsAllowImportChanges,this.expService),o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:dgc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:x_t.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(vi.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:x_t.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=x_t.editWouldDeleteWhatWasJustInserted;break;case"v2":l=x_t.editWouldDeleteWhatWasJustInserted2;break;default:(0,pAe.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new R_t.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(vi.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:WBi(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}};Cp.XtabProvider=eDr;Cp.XtabProvider=eDr=d6=Qmc([ND(0,Ymc.IInlineEditsModelService),ND(1,Jmc.ISimulationTestContext),ND(2,agc.IInstantiationService),ND(3,Xmc.IWorkspaceService),ND(4,Hmc.IDiffService),ND(5,vi.IConfigurationService),ND(6,Zmc.IExperimentationService),ND(7,$Bi.ILanguageContextProviderService),ND(8,Kmc.ILanguageDiagnosticsService),ND(9,$mc.IIgnoreService),ND(10,hgc.ISimilarFilesContextService)],eDr);function WBi(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(WBi,"filterOutEditsWithSubstrings");function zBi(t){let e=t.cursorLineOffset,r=Math.max(0,e-A$.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+A$.N_LINES_AS_CONTEXT+1);return new X2r.OffsetRange(r,n)}a(zBi,"computeAreaAroundEditWindowLinesRange");function tDr(t){switch(t.type){case xf.ChatFetchResponseType.Canceled:return new Ts.NoNextEditReason.GotCancelled("afterFetchCall");case xf.ChatFetchResponseType.OffTopic:case xf.ChatFetchResponseType.Filtered:case xf.ChatFetchResponseType.PromptFiltered:case xf.ChatFetchResponseType.Length:case xf.ChatFetchResponseType.RateLimited:case xf.ChatFetchResponseType.QuotaExceeded:case xf.ChatFetchResponseType.ExtensionBlocked:case xf.ChatFetchResponseType.AgentUnauthorized:case xf.ChatFetchResponseType.AgentFailedDependency:case xf.ChatFetchResponseType.InvalidStatefulMarker:return new Ts.NoNextEditReason.Uncategorized(g$.ErrorUtils.fromUnknown(t));case xf.ChatFetchResponseType.BadRequest:case xf.ChatFetchResponseType.NotFound:case xf.ChatFetchResponseType.Failed:case xf.ChatFetchResponseType.NetworkError:case xf.ChatFetchResponseType.Unknown:return new Ts.NoNextEditReason.FetchFailure(g$.ErrorUtils.fromUnknown(t))}}a(tDr,"mapChatFetcherErrorToNoNextEditReason");function rDr(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?vgc(t.lintOptions,e.lintOptions):t.lintOptions}}a(rDr,"overrideModelConfig");var _gc={...Zs.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function vgc(t,e){return{...t??_gc,...e}}a(vgc,"mergeLintOptions");function YBi(t){switch(t){case Zs.PromptingStrategy.UnifiedModel:return B4e.unifiedModelSystemPrompt;case Zs.PromptingStrategy.Codexv21NesUnified:case Zs.PromptingStrategy.SimplifiedSystemPrompt:return B4e.simplifiedPrompt;case Zs.PromptingStrategy.PatchBased:case Zs.PromptingStrategy.PatchBased01:case Zs.PromptingStrategy.PatchBased02:case Zs.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Zs.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Zs.PromptingStrategy.Xtab275:case Zs.PromptingStrategy.XtabAggressiveness:case Zs.PromptingStrategy.Xtab275Aggressiveness:case Zs.PromptingStrategy.Xtab275AggressivenessHighLow:case Zs.PromptingStrategy.Xtab275EditIntent:case Zs.PromptingStrategy.Xtab275EditIntentShort:return B4e.xtab275SystemPrompt;case Zs.PromptingStrategy.Nes41Miniv3:return B4e.nes41Miniv3SystemPrompt;case Zs.PromptingStrategy.CopilotNesXtab:case void 0:return B4e.systemPromptTemplate;default:(0,pAe.assertNever)(t)}}a(YBi,"pickSystemPrompt");function KBi(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(KBi,"determineLanguageContextOptions");function JBi(t,e,r){if(r===Zs.ResponseFormat.UnifiedWithXml)return["",...e,""].join(` +`);if(r===Zs.ResponseFormat.EditWindowOnly)return e.join(` +`);if(r===Zs.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...e].join(` +`);if(r===Zs.ResponseFormat.EditWindowWithEditIntentShort)return["H",...e].join(` +`);if(r===Zs.ResponseFormat.CodeBlock)return["```",...e,"```"].join(` +`);if(r===Zs.ResponseFormat.CustomDiffPatch){let n=t.workspaceRoot?.path;return`${(0,VBi.toUniquePath)(t.id,n)}:`}else(0,pAe.assertNever)(r)}a(JBi,"getPredictionContents");async function*Cgc(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 sgc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Tv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Tv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,HBi.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,HBi.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(Cgc,"linesWithIntermediateEditDivergenceCheck")});var XBi=I(U4=>{"use strict";p();var bgc=U4&&U4.__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},k_t=U4&&U4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(U4,"__esModule",{value:!0});U4.StaticGitHubAuthenticationService=void 0;U4.setCopilotToken=wgc;var Sgc=Sl(),Tgc=hp(),D_t=vE(),Igc=fMe(),xgc=rH(),N_t=class extends D_t.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:D_t.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:D_t.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 D_t.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireAuthenticationChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};U4.StaticGitHubAuthenticationService=N_t;U4.StaticGitHubAuthenticationService=N_t=bgc([k_t(1,Tgc.ILogService),k_t(2,xgc.ICopilotTokenStore),k_t(3,Igc.ICopilotTokenManager),k_t(4,Sgc.IConfigurationService)],N_t);function wgc(t,e){if(!(t instanceof N_t))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(wgc,"setCopilotToken")});var iLi=I(Iv=>{"use strict";p();Object.defineProperty(Iv,"__esModule",{value:!0});Iv.GraphQLErrorType=void 0;Iv.getErrorCode=rLi;Iv.derivePullRequestState=Rgc;Iv.makeGitHubAPIRequest=nLi;Iv.makeGitHubGraphQLRequest=hAe;Iv.makeSearchGraphQLRequest=Pgc;Iv.getPullRequestFromGlobalId=kgc;Iv.addPullRequestCommentGraphQLRequest=Dgc;Iv.closePullRequest=Ngc;Iv.makeGitHubAPIRequestWithPagination=Mgc;Iv.getAssignableActorsWithSuggestedActors=Ogc;Iv.getAssignableActorsWithAssignableUsers=Bgc;function eLi(t){return typeof t=="object"&&t!==null}a(eLi,"isObject");var tLi;(function(t){t.Unprocessable="UNPROCESSABLE"})(tLi||(Iv.GraphQLErrorType=tLi={}));function rLi(t){if(!eLi(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(eLi(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(rLi,"getErrorCode");function Rgc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(Rgc,"derivePullRequestState");async function nLi(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(nLi,"makeGitHubAPIRequest");async function hAe(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(hAe,"makeGitHubGraphQLRequest");async function Pgc(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 { @@ -1401,7 +1357,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 LAe(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(D_c,"makeSearchGraphQLRequest");async function N_c(t,e,r,n,o,s){let c=` + `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await hAe(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(Pgc,"makeSearchGraphQLRequest");async function kgc(t,e,r,n,o,s){let c=` query GetPullRequestGlobal($globalId: ID!) { node(id: $globalId) { ... on PullRequest { @@ -1436,7 +1392,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 LAe(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=I3i(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(N_c,"getPullRequestFromGlobalId");async function M_c(t,e,r,n,o,s,c){let l=` + `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await hAe(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=rLi(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(kgc,"getPullRequestFromGlobalId");async function Dgc(t,e,r,n,o,s,c){let l=` mutation AddPullRequestComment($pullRequestId: ID!, $body: String!) { addComment(input: {subjectId: $pullRequestId, body: $body}) { commentEdge { @@ -1452,7 +1408,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 LAe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(M_c,"addPullRequestCommentGraphQLRequest");async function O_c(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await x3i(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(O_c,"closePullRequest");async function B_c(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(B_c,"makeGitHubAPIRequestWithPagination");async function L_c(t,e,r,n,o,s,c){let l=` + `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await hAe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(Dgc,"addPullRequestCommentGraphQLRequest");async function Ngc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await nLi(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(Ngc,"closePullRequest");async function Mgc(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(Mgc,"makeGitHubAPIRequestWithPagination");async function Ogc(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( @@ -1473,7 +1429,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 LAe(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(L_c,"getAssignableActorsWithSuggestedActors");async function F_c(t,e,r,n,o,s,c){let l=` + `,u=[],d=null,f=!0;for(;f;){let m=await hAe(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(Ogc,"getAssignableActorsWithSuggestedActors");async function Bgc(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) { @@ -1490,27 +1446,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 LAe(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(F_c,"getAssignableActorsWithAssignableUsers")});var P3i=I(RR=>{"use strict";p();Object.defineProperty(RR,"__esModule",{value:!0});RR.BaseOctoKitService=RR.PermissiveAuthRequiredError=RR.VSCodeTeamId=RR.IOctoKitService=RR.IGithubRepositoryService=void 0;var k3i=rn(),R3i=_G(),x6=w3i();RR.IGithubRepositoryService=(0,k3i.createServiceIdentifier)("IGithubRepositoryService");RR.IOctoKitService=(0,k3i.createServiceIdentifier)("IOctoKitService");RR.VSCodeTeamId=1682102;var aNr=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};RR.PermissiveAuthRequiredError=aNr;var cNr=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,x6.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,x6.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,x6.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 closePullRequestWithToken(e,r,n,o){return(0,x6.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,x6.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,R3i.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(gCt,"__esModule",{value:!0});gCt.NullBaseOctoKitService=void 0;var U_c=P3i(),lNr=class extends U_c.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};gCt.NullBaseOctoKitService=lNr});var B3i=I(Pl=>{"use strict";p();var bCt=Pl&&Pl.__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},Ru=Pl&&Pl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Pl,"__esModule",{value:!0});Pl.CopilotTokenManagerFromGitHubToken=Pl.CopilotTokenManagerFromDeviceId=Pl.RefreshableCopilotTokenManager=Pl.StaticExtendedTokenInfoCopilotTokenManager=Pl.FixedCopilotTokenManager=Pl.BaseCopilotTokenManager=Pl.tokenErrorString=void 0;Pl.createStaticGitHubTokenProvider=q_c;Pl.getOrCreateTestingCopilotTokenManager=j_c;var uNr=(bre(),Ca(vre)),Q_c=Sc(),N3i=ko(),ACt=qut(),O3i=Il(),SCt=PE(),TCt=g$(),UAe=a4(),ICt=D3i(),xCt=pp(),dBe=ey(),wCt=o0(),M3i=Xge(),w6=c0t(),yCt=UMe();Pl.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 q_c(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(UAe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Pl.tokenErrorString)}}a(q_c,"createStaticGitHubTokenProvider");function j_c(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new ACt.SyncDescriptor(_Ct,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new ACt.SyncDescriptor(vCt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new ACt.SyncDescriptor(ECt,[process.env.GITHUB_PAT]);if(UAe.isScenarioAutomation)return new ACt.SyncDescriptor(CCt,[t]);throw new Error(Pl.tokenErrorString)}a(j_c,"getOrCreateTestingCopilotTokenManager");var FAe=class extends N3i.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 Q_c.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,N3i.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=M3i.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,yCt.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,w6.containsVSCodeOrg)(s.organization_list??[])},d=M3i.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,yCt.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:uNr.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:uNr.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,dBe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,w6.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,w6.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,w6.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:uNr.RequestType.CopilotUserInfo})).json()}};Pl.BaseCopilotTokenManager=FAe;var ECt=class extends FAe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new ICt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,w6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,w6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new w6.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Pl.FixedCopilotTokenManager=ECt;Pl.FixedCopilotTokenManager=ECt=bCt([Ru(1,xCt.ILogService),Ru(2,wCt.ITelemetryService),Ru(3,SCt.ICAPIClientService),Ru(4,TCt.IDomainService),Ru(5,dBe.IFetcherService),Ru(6,UAe.IEnvService)],ECt);var _Ct=class extends FAe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new ICt.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 w6.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Pl.StaticExtendedTokenInfoCopilotTokenManager=_Ct;Pl.StaticExtendedTokenInfoCopilotTokenManager=_Ct=bCt([Ru(1,xCt.ILogService),Ru(2,wCt.ITelemetryService),Ru(3,SCt.ICAPIClientService),Ru(4,TCt.IDomainService),Ru(5,dBe.IFetcherService),Ru(6,UAe.IEnvService)],_Ct);var uBe=class extends FAe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,yCt.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 w6.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,yCt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Pl.RefreshableCopilotTokenManager=uBe;var CCt=class extends uBe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new ICt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Pl.CopilotTokenManagerFromDeviceId=CCt;Pl.CopilotTokenManagerFromDeviceId=CCt=bCt([Ru(1,xCt.ILogService),Ru(2,wCt.ITelemetryService),Ru(3,TCt.IDomainService),Ru(4,SCt.ICAPIClientService),Ru(5,dBe.IFetcherService),Ru(6,UAe.IEnvService),Ru(7,O3i.IConfigurationService)],CCt);var vCt=class extends uBe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new ICt.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)}};Pl.CopilotTokenManagerFromGitHubToken=vCt;Pl.CopilotTokenManagerFromGitHubToken=vCt=bCt([Ru(2,xCt.ILogService),Ru(3,wCt.ITelemetryService),Ru(4,TCt.IDomainService),Ru(5,SCt.ICAPIClientService),Ru(6,dBe.IFetcherService),Ru(7,UAe.IEnvService),Ru(8,O3i.IConfigurationService)],vCt)});var L3i=I(R6=>{"use strict";p();var H_c=R6&&R6.__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},dNr=R6&&R6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(R6,"__esModule",{value:!0});R6.ChatQuotaService=void 0;var G_c=(bre(),Ca(vre)),$_c=Sc(),V_c=ko(),W_c=SE(),z_c=PE(),Y_c=pp(),fNr=class extends V_c.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 $_c.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidAuthenticationChange(()=>{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:G_c.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()}};R6.ChatQuotaService=fNr;R6.ChatQuotaService=fNr=H_c([dNr(0,W_c.IAuthenticationService),dNr(1,Y_c.ILogService),dNr(2,z_c.ICAPIClientService)],fNr)});var U3i=I(RCt=>{"use strict";p();Object.defineProperty(RCt,"__esModule",{value:!0});RCt.DefaultsOnlyConfigurationService=void 0;var F3i=Il(),pNr=class extends F3i.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=F3i.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};RCt.DefaultsOnlyConfigurationService=pNr});var q3i=I(kCt=>{"use strict";p();Object.defineProperty(kCt,"__esModule",{value:!0});kCt.computeDiff=J_c;kCt.computeDiffSync=Q3i;var K_c=YRr();async function J_c(t,e,r){return Q3i(t,e,r)}a(J_c,"computeDiff");function Q3i(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new K_c.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(Q3i,"computeDiffSync")});var $3i=I(jD=>{"use strict";p();var Z_c=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]})),X_c=jD&&jD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G3i=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{let r=oCc([j3i.join(__dirname,"diffWorker.js"),j3i.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new eCc.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 iCc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:gNr(o.changes),moves:o.moves.map(c=>new nCc.MovedText(new hNr.LineRangeMapping(new PCt.LineRange(c[0],c[1]),new PCt.LineRange(c[2],c[3])),gNr(c[4])))}}};jD.DiffServiceImpl=mNr;function gNr(t){return t.map(e=>new hNr.DetailedLineRangeMapping(new PCt.LineRange(e[0],e[1]),new PCt.LineRange(e[2],e[3]),e[4]?.map(r=>new hNr.RangeMapping(new H3i.Range(r[0],r[1],r[2],r[3]),new H3i.Range(r[4],r[5],r[6],r[7])))))}a(gNr,"toLineRangeMappings");function oCc(t){for(let e of t)if((0,rCc.existsSync)(e))return e}a(oCc,"firstExistingPath")});var W3i=I(k6=>{"use strict";p();var sCc=k6&&k6.__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},V3i=k6&&k6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(k6,"__esModule",{value:!0});k6.CAPIClientImpl=void 0;var aCc=a4(),cCc=ey(),lCc=PE(),ANr=class extends lCc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};k6.CAPIClientImpl=ANr;k6.CAPIClientImpl=ANr=sCc([V3i(0,cCc.IFetcherService),V3i(1,aCc.IEnvService)],ANr)});var Y3i=I(P6=>{"use strict";p();var uCc=P6&&P6.__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},yNr=P6&&P6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(P6,"__esModule",{value:!0});P6.DomainService=void 0;var dCc=Sc(),fCc=ko(),pCc=_H(),QAe=Il(),hCc=PE(),z3i="github-enterprise.uri",ENr=class extends fCc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new dCc.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(`${QAe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(z3i))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(QAe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(QAe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(QAe.ConfigKey.Shared.AuthProvider)===QAe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(z3i):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)}};P6.DomainService=ENr;P6.DomainService=ENr=uCc([yNr(0,QAe.IConfigurationService),yNr(1,pCc.ICopilotTokenStore),yNr(2,hCc.ICAPIClientService)],ENr)});var K3i=I(qAe=>{"use strict";p();Object.defineProperty(qAe,"__esModule",{value:!0});qAe.NullNativeEnvService=qAe.NullEnvService=void 0;var mCc=Sc(),gCc=Ku(),DCt=a4(),ACc=wMe(),NCt=class t extends DCt.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 mCc.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 DCt.OperatingSystem.Linux}getEditorInfo(){return new DCt.NameAndVersion("simulation-tests-editor",ACc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new DCt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};qAe.NullEnvService=NCt;var _Nr=class extends NCt{static{a(this,"NullNativeEnvService")}get userHome(){return gCc.URI.file("/home/testuser")}};qAe.NullNativeEnvService=_Nr});var CNr=I(MCt=>{"use strict";p();Object.defineProperty(MCt,"__esModule",{value:!0});MCt.IGitExtensionService=void 0;var yCc=rn();MCt.IGitExtensionService=(0,yCc.createServiceIdentifier)("IGitExtensionService")});var J3i=I(OCt=>{"use strict";p();Object.defineProperty(OCt,"__esModule",{value:!0});OCt.NullGitExtensionService=void 0;var ECc=Sc(),vNr=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=ECc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};OCt.NullGitExtensionService=vNr});var Z3i=I(D6=>{"use strict";p();var _Cc=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},CCc=D6&&D6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(D6,"__esModule",{value:!0});D6.ObservableGit=void 0;var vCc=ko(),F$=y2(),bCc=CNr(),bNr=class extends vCc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,F$.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,F$.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,F$.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,F$.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,F$.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,F$.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,F$.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,F$.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};D6.ObservableGit=bNr;D6.ObservableGit=bNr=_Cc([CCc(0,bCc.IGitExtensionService)],bNr)});var LCt=I(Dl=>{"use strict";p();Object.defineProperty(Dl,"__esModule",{value:!0});Dl.lengthZero=void 0;Dl.lengthDiff=ICc;Dl.lengthIsZero=xCc;Dl.toLength=Xre;Dl.lengthToObj=wCc;Dl.lengthGetLineCount=RCc;Dl.lengthGetColumnCountIfZeroLineCount=kCc;Dl.lengthAdd=eFi;Dl.sumLengths=PCc;Dl.lengthEquals=DCc;Dl.lengthDiffNonNegative=NCc;Dl.lengthLessThan=MCc;Dl.lengthLessThanEqual=OCc;Dl.lengthGreaterThanEqual=BCc;Dl.lengthToPosition=LCc;Dl.positionToLength=FCc;Dl.lengthsToRange=UCc;Dl.lengthOfRange=QCc;Dl.lengthCompare=qCc;Dl.lengthOfString=jCc;Dl.lengthOfStringObj=HCc;Dl.lengthHash=GCc;Dl.lengthMax=$Cc;var X3i=Gh(),SCc=I_(),TCc=qp(),BCt=Zpe();function ICc(t,e,r,n){return t!==r?Xre(r-t,n):Xre(0,n-e)}a(ICc,"lengthDiff");Dl.lengthZero=0;function xCc(t){return t===0}a(xCc,"lengthIsZero");var LE=2**26;function Xre(t,e){return t*LE+e}a(Xre,"toLength");function wCc(t){let e=t,r=Math.floor(e/LE),n=e-r*LE;return new BCt.TextLength(r,n)}a(wCc,"lengthToObj");function RCc(t){return Math.floor(t/LE)}a(RCc,"lengthGetLineCount");function kCc(t){return t}a(kCc,"lengthGetColumnCountIfZeroLineCount");function eFi(t,e){let r=t+e;return e>=LE&&(r=r-t%LE),r}a(eFi,"lengthAdd");function PCc(t,e){return t.reduce((r,n)=>eFi(r,e(n)),Dl.lengthZero)}a(PCc,"sumLengths");function DCc(t,e){return t===e}a(DCc,"lengthEquals");function NCc(t,e){let r=t,n=e;if(n-r<=0)return Dl.lengthZero;let s=Math.floor(r/LE),c=Math.floor(n/LE),l=n-c*LE;if(s===c){let u=r-s*LE;return Xre(0,l-u)}else return Xre(c-s,l)}a(NCc,"lengthDiffNonNegative");function MCc(t,e){return t=e}a(BCc,"lengthGreaterThanEqual");function LCc(t){let e=t,r=Math.floor(e/LE),n=e-r*LE;return new SCc.Position(r+1,n+1)}a(LCc,"lengthToPosition");function FCc(t){return Xre(t.lineNumber-1,t.column-1)}a(FCc,"positionToLength");function UCc(t,e){let r=t,n=Math.floor(r/LE),o=r-n*LE,s=e,c=Math.floor(s/LE),l=s-c*LE;return new TCc.Range(n+1,o+1,c+1,l+1)}a(UCc,"lengthsToRange");function QCc(t){return t.startLineNumber===t.endLineNumber?new BCt.TextLength(0,t.endColumn-t.startColumn):new BCt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(QCc,"lengthOfRange");function qCc(t,e){return t-e}a(qCc,"lengthCompare");function jCc(t){let e=(0,X3i.splitLines)(t);return Xre(e.length-1,e[e.length-1].length)}a(jCc,"lengthOfString");function HCc(t){let e=(0,X3i.splitLines)(t);return new BCt.TextLength(e.length-1,e[e.length-1].length)}a(HCc,"lengthOfStringObj");function GCc(t){return t}a(GCc,"lengthHash");function $Cc(t,e){return t>e?t:e}a($Cc,"lengthMax")});var INr=I(FCt=>{"use strict";p();Object.defineProperty(FCt,"__esModule",{value:!0});FCt.TextEditInfo=void 0;var SNr=LCt(),TNr=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,SNr.lengthToObj)(this.startOffset)}...${(0,SNr.lengthToObj)(this.endOffset)}) -> ${(0,SNr.lengthToObj)(this.newLength)}`}};FCt.TextEditInfo=TNr});var rFi=I(xNr=>{"use strict";p();Object.defineProperty(xNr,"__esModule",{value:!0});xNr.combineTextEditInfos=zCc;var VCc=El(),ym=LCt(),WCc=INr();function zCc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new VCc.ArrayQueue(tFi(t)),n=tFi(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,ym.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,ym.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,ym.lengthIsZero)(d)||f.push(new fBe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,ym.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new WCc.TextEditInfo(m.startOffset,f,(0,ym.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=ym.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,ym.sumLengths)(f,g=>g.lengthBefore),m=(0,ym.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,ym.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(zCc,"combineTextEditInfos");var fBe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,ym.lengthDiffNonNegative)(e,this.lengthAfter);return(0,ym.lengthEquals)(r,ym.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,ym.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,ym.lengthToObj)(this.lengthBefore)} -> ${(0,ym.lengthToObj)(this.lengthAfter)}`}};function tFi(t){let e=[],r=ym.lengthZero;for(let n of t){let o=(0,ym.lengthDiffNonNegative)(r,n.startOffset);(0,ym.lengthIsZero)(o)||e.push(new fBe(!1,o,o));let s=(0,ym.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new fBe(!0,s,n.newLength)),r=n.endOffset}return e}a(tFi,"toLengthMapping")});var iFi=I(jAe=>{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.SingleTextEditLength=jAe.TextLengthEdit=void 0;var YCc=qp(),nFi=Zpe(),KCc=rFi(),pBe=LCt(),JCc=INr(),wNr=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new hBe(n.range,nFi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,pBe.lengthToObj)(n.newLength);return new hBe((0,pBe.lengthsToRange)(n.startOffset,n.endOffset),new nFi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new JCc.TextEditInfo((0,pBe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,pBe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,pBe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,KCc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return YCc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};jAe.TextLengthEdit=wNr;var hBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};jAe.SingleTextEditLength=hBe});var oFi=I(HAe=>{"use strict";p();Object.defineProperty(HAe,"__esModule",{value:!0});HAe.DocumentHistory=HAe.HistoryContext=void 0;var ZCc=Yu(),XCc=kD(),RNr=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,ZCc.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}}};HAe.HistoryContext=RNr;var kNr=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 XCc.RootedEdit(this.base,this.lastEdits.compose())}};HAe.DocumentHistory=kNr});var dFi=I(GAe=>{"use strict";p();Object.defineProperty(GAe,"__esModule",{value:!0});GAe.NesHistoryContextProvider=void 0;GAe.sum=gBe;GAe.editExtends=uFi;var sFi=ko(),aFi=y2(),evc=BS(),mBe=gE(),tvc=MMe(),rvc=CT(),UCt=kD(),nvc=byt(),cFi=iFi(),ivc=B5(),ABe=qDe(),lFi=oFi(),PNr=class extends sFi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new NNr(50),this._register((0,aFi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,ABe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,aFi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new DNr(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,ivc.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,sFi.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 lFi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,ABe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};GAe.NesHistoryContextProvider=PNr;var DNr=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 rvc.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=tvc.TextEdit.fromStringEdit(e,this._currentValue),o=cFi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return gBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&uFi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,ABe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,ABe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new UCt.Edits(mBe.StringEdit,this._edits.map(o=>o.edit));return{history:new lFi.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=mBe.StringEdit.empty,o=cFi.TextLengthEdit.empty,s,c=0,l=mBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,ABe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,evc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=gBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||gBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||gBe(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=mBe.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=UCt.RootedEdit.toLineEdit(new UCt.RootedEdit(r,y)),v=new nvc.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 UCt.Edits(mBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function gBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(gBe,"sum");function uFi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>ovc(n.replaceRange,r))}a(uFi,"editExtends");function ovc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(ovc,"doesTouch");var NNr=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 hFi=I(HD=>{"use strict";p();var svc=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},fFi=HD&&HD.__param||function(t,e){return function(r,n){e(r,n,t)}},ONr;Object.defineProperty(HD,"__esModule",{value:!0});HD.NesXtabHistoryTracker=HD.XtabEditMergeStrategy=void 0;var BNr=Yu(),avc=ko(),cvc=Ele(),lvc=y2(),uvc=HF(),qCt=Il(),dvc=gp(),QCt=kD(),N6=Oyr(),fvc=B5(),MNr=qDe(),LNr;(function(t){t.sameStartLine={kind:N6.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:N6.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:N6.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case N6.DiffHistoryMergeStrategy.Proximity:return e(s);case N6.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case N6.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,BNr.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(LNr||(HD.XtabEditMergeStrategy=LNr={}));function pFi(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(pFi,"areLineEditsWithinProximity");var FNr=class extends avc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{ONr=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 cvc.LinkedList,this.maxHistorySize=r??ONr.MAX_HISTORY_SIZE,this.mergeStrategy=(0,uvc.derived)(s=>LNr.fromConfig(this._configurationService.getExperimentBasedConfigObservable(qCt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(qCt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(qCt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,lvc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,fvc.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,MNr.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case N6.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case N6.DiffHistoryMergeStrategy.Proximity:return pFi(r,e,o.lineGap);case N6.DiffHistoryMergeStrategy.Hybrid:return(0,MNr.now)()-n<=o.splitAfterMs&&pFi(r,e,o.lineGap)}}handleEdits(e,r){(0,BNr.assert)(r.previous!==void 0,"Document has previous version"),(0,BNr.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 QCt.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=QCt.RootedEdit.toLineEdit(l),d=QCt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new QCt.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,MNr.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)}}}};HD.NesXtabHistoryTracker=FNr;HD.NesXtabHistoryTracker=FNr=ONr=svc([fFi(2,qCt.IConfigurationService),fFi(3,dvc.IExperimentationService)],FNr)});var mFi=I(jCt=>{"use strict";p();Object.defineProperty(jCt,"__esModule",{value:!0});jCt.IVSCodeExtensionContext=void 0;var pvc=rn();jCt.IVSCodeExtensionContext=(0,pvc.createServiceIdentifier)("IVSCodeExtensionContext")});var bFi=I($D=>{"use strict";p();var EFi=$D&&$D.__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},U$=$D&&$D.__param||function(t,e){return function(r,n){e(r,n,t)}},EBe;Object.defineProperty($D,"__esModule",{value:!0});$D.UndesiredModels=$D.InlineEditsModelService=void 0;var hvc=kDr(),_Fi=fDr(),gFi=L_(),mvc=El(),AFi=Yu(),CFi=Sc(),vFi=ko(),$Ae=y2(),gvc=_H(),GD=Il(),Avc=mFi(),yvc=pp(),Evc=iCt(),_vc=gp(),Cvc=o0(),yBe=WA(),vvc=h_t(),QNr=class extends vFi.Disposable{static{a(this,"InlineEditsModelService")}static{EBe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:yBe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:yBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:yBe.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,$Ae.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,$Ae.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(GD.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,$Ae.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new _Fi.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,$Ae.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,$Ae.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,$Ae.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=CFi.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(GD.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(GD.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(GD.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,GD.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,hvc.filterMap)(r,f=>{if((0,yBe.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,mvc.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 UNr(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 UNr(r[0])}return UNr(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,AFi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,GD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?EBe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?EBe.COPILOT_NES_CALLISTO:EBe.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,AFi.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=yBe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=gFi.ErrorUtils.toString(gFi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};$D.InlineEditsModelService=QNr;$D.InlineEditsModelService=QNr=EBe=EFi([U$(0,gvc.ICopilotTokenStore),U$(1,Evc.IProxyModelsService),U$(2,vvc.IUndesiredModelsManager),U$(3,GD.IConfigurationService),U$(4,_vc.IExperimentationService),U$(5,Cvc.ITelemetryService),U$(6,yvc.ILogService)],QNr);function UNr(t){let{source:e,...r}=t;return r}a(UNr,"toModelConfiguration");var yFi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends vFi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new CFi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new _Fi.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=EFi([U$(0,Avc.IVSCodeExtensionContext)],r),t.Manager=r})(yFi||($D.UndesiredModels=yFi={}))});var SFi=I(HCt=>{"use strict";p();Object.defineProperty(HCt,"__esModule",{value:!0});HCt.NullLanguageContextProviderService=void 0;var bvc=ko(),qNr=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return bvc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};HCt.NullLanguageContextProviderService=qNr});var TFi=I(GCt=>{"use strict";p();Object.defineProperty(GCt,"__esModule",{value:!0});GCt.TestLanguageDiagnosticsService=void 0;var Svc=Sc(),Tvc=bP(),Ivc=$G(),jNr=class extends Ivc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new Tvc.ResourceMap,this._onDidChangeDiagnostics=new Svc.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())}};GCt.TestLanguageDiagnosticsService=jNr});var IFi=I(VCt=>{"use strict";p();Object.defineProperty(VCt,"__esModule",{value:!0});VCt.ResponseStream=void 0;var xvc=L_(),$Ct=Gx(),wvc=Xc(),Rvc=BS(),HNr=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new wvc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return $Ct.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return $Ct.Result.error(l)}}),this.stream=kvc(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,Rvc.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}}};VCt.ResponseStream=HNr;async function*kvc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=xvc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?$Ct.Result.error(n):$Ct.Result.ok(r))}}a(kvc,"streamWithAggregation")});var xFi=I(GNr=>{"use strict";p();Object.defineProperty(GNr,"__esModule",{value:!0});GNr.jsonlStreamToCompletions=Pvc;async function*Pvc(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(Pvc,"jsonlStreamToCompletions")});var RFi=I(M6=>{"use strict";p();var Dvc=M6&&M6.__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},$Nr=M6&&M6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M6,"__esModule",{value:!0});M6.CompletionsFetchService=void 0;var Nvc=pDr(),wFi=L_(),ene=Gx(),Mvc=Cpr(),Ovc=SE(),Bvc=f6(),Lvc=ey(),Fvc=Lge(),Q$=ayt(),Uvc=IFi(),Qvc=xFi(),VNr=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=ene.Result.error(new Q$.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=Nvc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,Qvc.jsonlStreamToCompletions)(f),m=new Uvc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=ene.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new Q$.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>jvc(d.val.body).catch(()=>"")),h=ene.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())),ene.Result.error(new Q$.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=qvc(u,s);return ene.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Bvc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return ene.Result.error(new Q$.Completions.RequestCancelled);let l=wFi.ErrorUtils.fromUnknown(c);return ene.Result.error(new Q$.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 Q$.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof Q$.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof Q$.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:Mvc.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}}};M6.CompletionsFetchService=VNr;M6.CompletionsFetchService=VNr=Dvc([$Nr(0,Ovc.IAuthenticationService),$Nr(1,Lvc.IFetcherService),$Nr(2,Fvc.IRequestLogger)],VNr);async function*qvc(t,e){try{for await(let r of t)yield r}catch(r){throw wFi.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(qvc,"streamWithCleanup");async function jvc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(jvc,"collectAsyncIterableToString")});var PFi=I(WCt=>{"use strict";p();Object.defineProperty(WCt,"__esModule",{value:!0});WCt.WireTypes=void 0;var q$=KH(),kFi;(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,q$.vObj)({promptStrategy:(0,q$.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,q$.vObj)({serviceType:(0,q$.vString)(),name:(0,q$.vString)(),provider:(0,q$.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,q$.vObj)({models:(0,q$.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={}))})(kFi||(WCt.WireTypes=kFi={}))});var NFi=I(O6=>{"use strict";p();var Hvc=O6&&O6.__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},zCt=O6&&O6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(O6,"__esModule",{value:!0});O6.ProxyModelsService=void 0;var Gvc=require("util"),WNr=L_(),$vc=SP(),Vvc=Sc(),Wvc=ko(),DFi=y2(),zvc=_H(),Yvc=PE(),Kvc=PFi(),Jvc=pp(),Zvc=ey(),zNr=class extends Wvc.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 Vvc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,DFi.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,DFi.autorun)(c=>{let l=s.read(c),u=new $vc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,Gvc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=WNr.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=WNr.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=Kvc.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=WNr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};O6.ProxyModelsService=zNr;O6.ProxyModelsService=zNr=Hvc([zCt(0,zvc.ICopilotTokenStore),zCt(1,Yvc.ICAPIClientService),zCt(2,Zvc.IFetcherService),zCt(3,Jvc.ILogService)],zNr)});var MFi=I(YCt=>{"use strict";p();Object.defineProperty(YCt,"__esModule",{value:!0});YCt.NullRequestLogger=void 0;var Xvc=e2r(),ebc=Sc(),YNr=class extends Xvc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=ebc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};YCt.NullRequestLogger=YNr});var uMr=I(fd=>{"use strict";p();var iMr=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},VD=fd&&fd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fd,"__esModule",{value:!0});fd.SimpleExperimentationService=fd.LogLevel=fd.ILanguageContextProviderService=fd.IIgnoreService=fd.IExperimentationService=fd.IEndpointProvider=fd.ICAPIClientService=fd.IAuthenticationService=void 0;fd.createNESProvider=Wbc;fd.createInlineCompletionsProvider=Ybc;var tbc=Nti(),OFi=See(),BFi=bvi(),LFi=pme(),rbc=l0t(),FFi=Ovr(),nbc=Bvr(),PC=vE(),UFi=jvr(),ibc=nxi(),obc=VA(),QFi=Sbr(),sbc=bG(),qFi=kbr(),jFi=UOe(),HFi=Kbr(),GFi=Zbr(),$Fi=hwr(),JNr=Jmt(),abc=UNi(),cbc=QNi(),_Be=xl(),lbc=Sge(),ubc=Uvr(),VFi=Wwr(),WFi=nbr(),zFi=iyt(),YFi=KIr(),KFi=jgt(),CBe=qgt(),JFi=qG(),ZFi=tAt(),dbc=GNi(),fbc=Zgt(),XFi=nEr(),e8i=zb(),t8i=QMe(),r8i=tre(),pbc=nMi(),hbc=tOi(),ZNr=vOi(),n8i=Skr(),mbc=oBi(),i8i=h2r(),gbc=v3i(),oMr=SE();Object.defineProperty(fd,"IAuthenticationService",{enumerable:!0,get:a(function(){return oMr.IAuthenticationService},"get")});var Abc=UMe(),o8i=_H(),ybc=b3i(),Ebc=B3i(),_bc=A6(),Cbc=xkr(),vbc=L3i(),bbc=wkr(),s8i=kkr(),Z4=Il(),Sbc=U3i(),Tbc=m2r(),Ibc=$3i(),sMr=PE();Object.defineProperty(fd,"ICAPIClientService",{enumerable:!0,get:a(function(){return sMr.ICAPIClientService},"get")});var xbc=g$(),aMr=IOe();Object.defineProperty(fd,"IEndpointProvider",{enumerable:!0,get:a(function(){return aMr.IEndpointProvider},"get")});var p8i=W3i(),wbc=Y3i(),tne=a4(),Rbc=K3i(),kbc=CNr(),h8i=J3i(),vBe=Bte();Object.defineProperty(fd,"IIgnoreService",{enumerable:!0,get:a(function(){return vBe.IIgnoreService},"get")});var Pbc=Hre(),Dbc=Kut(),KNr=h_t(),Nbc=Z3i(),Mbc=dFi(),Obc=hFi(),Bbc=bFi(),cMr=Fgt();Object.defineProperty(fd,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return cMr.ILanguageContextProviderService},"get")});var m8i=SFi(),g8i=$G(),A8i=TFi(),WD=pp(),Lbc=ayt(),Fbc=RFi(),lMr=ey(),a8i=_6(),Ubc=YPr(),Qbc=KPr(),qbc=r_t(),jbc=iCt(),Hbc=NFi(),y8i=Lge(),E8i=MFi(),c8i=S2r(),l8i=wRr(),SBe=gp();Object.defineProperty(fd,"IExperimentationService",{enumerable:!0,get:a(function(){return SBe.IExperimentationService},"get")});var _8i=o0(),u8i=Xge(),Gbc=Cyr(),d8i=K_t(),f8i=Ure(),XNr=cDr(),C8i=rn(),$bc=SP(),bBe=Sc(),XCt=ko(),Vbc=um(),hi=qut(),v8i=Qs(),rne;(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"})(rne||(fd.LogLevel=rne={}));function Wbc(t){return zbc(t).createInstance(eMr,t)}a(Wbc,"createNESProvider");var eMr=class extends XCt.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(gbc.XtabProvider),l=r.createInstance(Nbc.ObservableGit),u=new Mbc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(Z4.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new Obc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new pbc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(hbc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(ZNr.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=Pbc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Vbc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Dbc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new ZNr.NextEditProviderTelemetryBuilder(new h8i.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 nne&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=Z4.globalConfigRegistry.configs.get(`${Z4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};eMr=iMr([VD(1,v8i.IInstantiationService),VD(2,SBe.IExperimentationService),VD(3,Z4.IConfigurationService),VD(4,XNr.IWorkspaceService)],eMr);function zbc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new C8i.InstantiationServiceBuilder;s.define(Z4.IConfigurationService,new hi.SyncDescriptor(KCt,[t.configOverrides??new Map])),s.define(SBe.IExperimentationService,new hi.SyncDescriptor(nne,[t.waitForTreatmentVariables])),s.define(c8i.ISimulationTestContext,new hi.SyncDescriptor(c8i.NulSimulationTestContext)),s.define(XNr.IWorkspaceService,new hi.SyncDescriptor(XNr.NullWorkspaceService)),s.define(Tbc.IDiffService,new hi.SyncDescriptor(Ibc.DiffServiceImpl,[!1])),s.define(WD.ILogService,new hi.SyncDescriptor(WD.LogServiceImpl,[[o||new WD.ConsoleLog(void 0,WD.LogLevel.Trace)]])),s.define(kbc.IGitExtensionService,new hi.SyncDescriptor(h8i.NullGitExtensionService)),s.define(cMr.ILanguageContextProviderService,new hi.SyncDescriptor(m8i.NullLanguageContextProviderService)),s.define(g8i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(A8i.TestLanguageDiagnosticsService)),s.define(vBe.IIgnoreService,new hi.SyncDescriptor(vBe.NullIgnoreService)),s.define(l8i.ISnippyService,new hi.SyncDescriptor(l8i.NullSnippyService)),s.define(xbc.IDomainService,new hi.SyncDescriptor(wbc.DomainService)),s.define(sMr.ICAPIClientService,new hi.SyncDescriptor(p8i.CAPIClientImpl)),s.define(o8i.ICopilotTokenStore,new hi.SyncDescriptor(o8i.CopilotTokenStore)),s.define(tne.IEnvService,new hi.SyncDescriptor(Rbc.NullEnvService)),s.define(lMr.IFetcherService,new hi.SyncDescriptor(JCt,[e])),s.define(_8i.ITelemetryService,new hi.SyncDescriptor(ZCt,[n])),s.define(oMr.IAuthenticationService,new hi.SyncDescriptor(ybc.StaticGitHubAuthenticationService,[(0,Ebc.createStaticGitHubTokenProvider)()])),s.define(Abc.ICopilotTokenManager,r),s.define(n8i.IPowerService,new hi.SyncDescriptor(n8i.NullPowerService)),s.define(_bc.IChatMLFetcher,new hi.SyncDescriptor(mbc.ChatMLFetcherImpl)),s.define(a8i.IChatWebSocketManager,new hi.SyncDescriptor(a8i.NullChatWebSocketManager)),s.define(qbc.IOTelService,new Ubc.NoopOTelService((0,Qbc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(Cbc.IChatQuotaService,new hi.SyncDescriptor(vbc.ChatQuotaService)),s.define(s8i.IInteractionService,new hi.SyncDescriptor(s8i.InteractionService)),s.define(y8i.IRequestLogger,new hi.SyncDescriptor(E8i.NullRequestLogger)),s.define(f8i.ITokenizerProvider,new hi.SyncDescriptor(f8i.TokenizerProvider,[!1])),s.define(bbc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(jbc.IProxyModelsService,new hi.SyncDescriptor(Hbc.ProxyModelsService)),s.define(KNr.IInlineEditsModelService,new hi.SyncDescriptor(Bbc.InlineEditsModelService)),s.define(KNr.IUndesiredModelsManager,t.undesiredModelsManager||new hi.SyncDescriptor(KNr.NullUndesiredModelsManager)),s.define(d8i.ITerminalService,t.terminalService||new hi.SyncDescriptor(d8i.NullTerminalService)),s.define(i8i.ISimilarFilesContextService,new hi.SyncDescriptor(i8i.NullSimilarFilesContextService)),s.define(aMr.IEndpointProvider,new tMr);let c=new PC.InMemoryConfigProvider(new PC.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(PC.ICompletionsConfigProvider,c),s.seal()}a(zbc,"setupServices");var KCt=class extends Sbc.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)}},tMr=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=bBe.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},nne=class extends XCt.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new bBe.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()}};fd.SimpleExperimentationService=nne;fd.SimpleExperimentationService=nne=iMr([VD(1,Z4.IConfigurationService)],nne);var JCt=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=bBe.Event.None,this.onDidCompleteFetch=bBe.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 lMr.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)}},ZCt=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,u8i.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,u8i.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function Ybc(t){return Kbc(t).createInstance(rMr)}a(Ybc,"createInlineCompletionsProvider");var rMr=class extends XCt.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(abc.GhostText)}updateTreatmentVariables(e){this._expService instanceof nne&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=Z4.globalConfigRegistry.configs.get(`${Z4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof PC.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new ZNr.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??$bc.CancellationToken.None,o,new tbc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};rMr=iMr([VD(0,v8i.IInstantiationService),VD(1,SBe.IExperimentationService),VD(2,JNr.ICompletionsSpeculativeRequestCache),VD(3,WD.ILogService),VD(4,Z4.IConfigurationService),VD(5,PC.ICompletionsConfigProvider)],rMr);var nMr=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,Gbc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function Kbc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new WD.ConsoleLog(void 0,WD.LogLevel.Trace),f=new C8i.InstantiationServiceBuilder;f.define(_Be.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case _Be.LogLevel.DEBUG:return rne.Debug;case _Be.LogLevel.INFO:return rne.Info;case _Be.LogLevel.WARN:return rne.Warning;case _Be.LogLevel.ERROR:return rne.Error;default:return rne.Info}}}),f.define(oMr.IAuthenticationService,r),f.define(WD.ILogService,new hi.SyncDescriptor(WD.LogServiceImpl,[[d||new WD.ConsoleLog(void 0,WD.LogLevel.Trace)]])),f.define(vBe.IIgnoreService,t.ignoreService||new vBe.NullIgnoreService),f.define(_8i.ITelemetryService,new hi.SyncDescriptor(ZCt,[new nMr(c)])),f.define(Z4.IConfigurationService,new hi.SyncDescriptor(KCt,[t.configOverrides??new Map])),f.define(SBe.IExperimentationService,new hi.SyncDescriptor(nne,[t.waitForTreatmentVariables])),f.define(aMr.IEndpointProvider,t.endpointProvider),f.define(sMr.ICAPIClientService,t.capiClientService||new hi.SyncDescriptor(p8i.CAPIClientImpl)),f.define(lMr.IFetcherService,new hi.SyncDescriptor(JCt,[e])),f.define(OFi.ICompletionsTelemetryService,new hi.SyncDescriptor(OFi.CompletionsTelemetryServiceBridge)),f.define(r8i.ICompletionsRuntimeModeService,r8i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(jFi.ICompletionsCacheService,new jFi.CompletionsCache);let h=new PC.InMemoryConfigProvider(new PC.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(PC.ICompletionsConfigProvider,h),f.define($Fi.ICompletionsLastGhostText,new $Fi.LastGhostText),f.define(GFi.ICompletionsCurrentGhostText,new GFi.CurrentGhostText),f.define(JNr.ICompletionsSpeculativeRequestCache,new JNr.SpeculativeRequestCache),f.define(ubc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(PC.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(BFi.ICompletionsExtensionStatus,new BFi.CopilotExtensionStatus),f.define(obc.ICompletionsFeaturesService,new hi.SyncDescriptor(ibc.Features)),f.define(nbc.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(zFi.ICompletionsStatusReporter,new class extends zFi.StatusReporter{didChange(m){n.didChange(m)}}),f.define(LFi.ICompletionsCopilotTokenManager,new hi.SyncDescriptor(LFi.CopilotTokenManagerImpl,[!1])),f.define(e8i.ICompletionsTextDocumentManagerService,new hi.SyncDescriptor(class extends e8i.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(QFi.ICompletionsFileReaderService,new hi.SyncDescriptor(QFi.FileReader)),f.define(HFi.ICompletionsBlockModeConfig,new hi.SyncDescriptor(HFi.ConfigBlockModeConfig)),f.define(XFi.ICompletionsTelemetryUserConfigService,new hi.SyncDescriptor(XFi.TelemetryUserConfig)),f.define(ZFi.ICompletionsRecentEditsProviderService,new hi.SyncDescriptor(ZFi.FullRecentEditsProvider,[void 0])),f.define(FFi.ICompletionsNotifierService,new hi.SyncDescriptor(FFi.CompletionNotifier)),f.define(VFi.ICompletionsOpenAIFetcherService,new hi.SyncDescriptor(VFi.LiveOpenAIFetcher)),f.define(Lbc.ICompletionsFetchService,new hi.SyncDescriptor(Fbc.CompletionsFetchService)),f.define(WFi.ICompletionsModelManagerService,new hi.SyncDescriptor(WFi.AvailableModelsManager,[!0])),f.define(qFi.ICompletionsAsyncManagerService,new hi.SyncDescriptor(qFi.AsyncCompletionManager)),f.define(KFi.ICompletionsContextProviderBridgeService,new hi.SyncDescriptor(KFi.ContextProviderBridge)),f.define(UFi.ICompletionsUserErrorNotifierService,new hi.SyncDescriptor(UFi.UserErrorNotifier)),f.define(fbc.ICompletionsRelatedFilesProviderService,new hi.SyncDescriptor(dbc.CompositeRelatedFilesProvider)),f.define(sbc.ICompletionsFileSystemService,new cbc.LocalFileSystem),f.define(CBe.ICompletionsContextProviderRegistryService,new hi.SyncDescriptor(CBe.CachedContextProviderRegistry,[CBe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(t8i.ICompletionsPromiseQueueService,new t8i.PromiseQueue),f.define(rbc.ICompletionsCitationManager,new class{register(){return XCt.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(JFi.ICompletionsContextProviderService,new JFi.ContextProviderStatistics),f.define(YFi.ICompletionsPromptFactoryService,new hi.SyncDescriptor(YFi.CompletionsPromptFactory)),f.define(lbc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(CBe.ICompletionsDefaultContextProviders,new CBe.DefaultContextProvidersContainer),f.define(tne.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=bBe.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?tne.OperatingSystem.Macintosh:process.platform==="win32"?tne.OperatingSystem.Windows:tne.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return PC.BuildInfo.isProduction()}isPreRelease(){return PC.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return PC.BuildInfo.getBuildType()===PC.BuildType.DEV?"dev":"prod"}getVersion(){return PC.BuildInfo.getVersion()}getBuild(){return PC.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new tne.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new tne.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(cMr.ILanguageContextProviderService,t.languageContextProvider??new m8i.NullLanguageContextProviderService),f.define(g8i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(A8i.TestLanguageDiagnosticsService)),f.define(y8i.IRequestLogger,new hi.SyncDescriptor(E8i.NullRequestLogger)),f.seal()}a(Kbc,"setupCompletionServices")});function Lt(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 ye(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 l1=me(()=>{p();a(Lt,"__classPrivateFieldSet");a(ye,"__classPrivateFieldGet")});var ZAe,dvt=me(()=>{p();ZAe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return ZAe=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 Q6(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var NBe,XAe=me(()=>{p();a(Q6,"isAbortError");NBe=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 dr,lh,oy,j$,eye,tye,rye,nye,iye,oye,sye,aye,cye,wf=me(()=>{p();XAe();dr=class extends Error{static{a(this,"AnthropicError")}},lh=class t extends dr{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 j$({message:n,cause:NBe(r)});let s=r,c=s?.error?.type;return e===400?new tye(e,s,n,o,c):e===401?new rye(e,s,n,o,c):e===403?new nye(e,s,n,o,c):e===404?new iye(e,s,n,o,c):e===409?new oye(e,s,n,o,c):e===422?new sye(e,s,n,o,c):e===429?new aye(e,s,n,o,c):e>=500?new cye(e,s,n,o,c):new t(e,s,n,o,c)}},oy=class extends lh{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},j$=class extends lh{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},eye=class extends j${static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},tye=class extends lh{static{a(this,"BadRequestError")}},rye=class extends lh{static{a(this,"AuthenticationError")}},nye=class extends lh{static{a(this,"PermissionDeniedError")}},iye=class extends lh{static{a(this,"NotFoundError")}},oye=class extends lh{static{a(this,"ConflictError")}},sye=class extends lh{static{a(this,"UnprocessableEntityError")}},aye=class extends lh{static{a(this,"RateLimitError")}},cye=class extends lh{static{a(this,"InternalServerError")}}});function fvt(t){return typeof t!="object"?{}:t??{}}function HMr(t){if(!t)return!0;for(let e in t)return!1;return!0}function R6i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var LSc,w6i,FE,jMr,k6i,pvt,X4=me(()=>{p();wf();LSc=/^[a-z][a-z0-9+.-]*:/i,w6i=a(t=>LSc.test(t),"isAbsoluteURL"),FE=a(t=>(FE=Array.isArray,FE(t)),"isArray"),jMr=FE;a(fvt,"maybeObj");a(HMr,"isEmptyObj");a(R6i,"hasOwn");k6i=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new dr(`${t} must be an integer`);if(e<0)throw new dr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),pvt=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var YD,lye=me(()=>{p();YD=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 kR,MBe=me(()=>{p();kR="0.98.0"});function FSc(){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 QSc(){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 M6i,USc,P6i,D6i,N6i,OBe,hvt=me(()=>{p();MBe();M6i=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(FSc,"getDetectedPlatform");USc=a(()=>{let t=FSc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kR,"X-Stainless-OS":D6i(Deno.build.os),"X-Stainless-Arch":P6i(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":kR,"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":kR,"X-Stainless-OS":D6i(globalThis.process.platform??"unknown"),"X-Stainless-Arch":P6i(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=QSc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kR,"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":kR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(QSc,"getBrowserInfo");P6i=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),D6i=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"),OBe=a(()=>N6i??(N6i=USc()),"getPlatformHeaders")});function O6i(){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 GMr(...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 mvt(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return GMr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function BBe(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 B6i(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 uye=me(()=>{p();a(O6i,"getDefaultFetch");a(GMr,"makeReadableStream");a(mvt,"ReadableStreamFrom");a(BBe,"ReadableStreamToAsyncIterable");a(B6i,"CancelReadableStream")});var L6i,F6i=me(()=>{p();L6i=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var $Mr,VMr,WMr,U6i,zMr=me(()=>{p();$Mr="RFC3986",VMr=a(t=>String(t),"default_formatter"),WMr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:VMr},U6i="RFC1738"});function q6i(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function KMr(t,e){if(FE(t)){let r=[];for(let n=0;n{p();zMr();X4();gvt=a((t,e)=>(gvt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),gvt(t,e)),"has"),eB=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),YMr=1024,Q6i=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=YMr?s.slice(l,l+YMr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===U6i&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=eB[h];continue}if(h<2048){d[d.length]=eB[192|h>>6]+eB[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=eB[224|h>>12]+eB[128|h>>6&63]+eB[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=eB[240|h>>18]+eB[128|h>>12&63]+eB[128|h>>6&63]+eB[128|h&63]}c+=d.join("")}return c},"encode");a(q6i,"is_buffer");a(KMr,"maybe_map")});function HSc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function V6i(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(JMr))!==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(JMr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&FE(v)&&(v=KMr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,Em.encoder,E,"key",g):e;v=""}if(HSc(v)||q6i(v)){if(u){let N=y?e:u(e,Em.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,Em.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&FE(v))y&&u&&(v=KMr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(FE(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let k=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&FE(v)&&v.length===1?k+"[]":k;if(o&&FE(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:Em.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Em.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Em.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Em.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Em.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Em.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Em.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Em.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Em.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Em.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Em.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Em.strictNullHandling}}function W6i(t,e={}){let r=t,n=GSc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):FE(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=G6i[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 G6i,$6i,H6i,Em,JMr,z6i=me(()=>{p();j6i();zMr();X4();G6i={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},$6i=a(function(t,e){Array.prototype.push.apply(t,FE(e)?e:[e])},"push_to_array"),Em={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Q6i,encodeValuesOnly:!1,format:$Mr,formatter:VMr,indices:!1,serializeDate(t){return(H6i??(H6i=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(HSc,"is_non_nullish_primitive");JMr={};a(V6i,"inner_stringify");a(GSc,"normalize_stringify_options");a(W6i,"stringify")});function Y6i(t){return W6i(t,{arrayFormat:"brackets"})}var ZMr=me(()=>{p();z6i();a(Y6i,"stringifyQuery")});function yvt(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new $c(`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 $c(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Evt(t,e){let r=await WSc(t),n;try{n=JSON.parse(r)}catch{throw new $c(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,u1(r),e)}if(!n.access_token)throw new $c(`Token endpoint response missing access_token: ${JSON.stringify(u1(n))}`,t.status,u1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new $c(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,u1(n),e);return n}function u1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=XMr?t:t.slice(0,XMr)+`... <${t.length-XMr} more chars>`}return JSON.stringify(u1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))VSc.has(r)&&(e[r]=n);return e}return null}async function _vt(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 $c(`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 $c(`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 Cvt(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 WSc(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>K6i){let l=K6i-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 J6i,Z6i,Avt,ine,X6i,e9i,dye,t9i,K6i,XMr,VSc,$c,fye=me(()=>{p();wf();J6i="urn:ietf:params:oauth:grant-type:jwt-bearer",Z6i="refresh_token",Avt="/v1/oauth/token",ine="oauth-2025-04-20",X6i="oidc-federation-2026-04-01",e9i=120,dye=30,t9i=5,K6i=1<<20;a(yvt,"requireSecureTokenEndpoint");a(Evt,"parseTokenResponse");XMr=2e3,VSc=new Set(["error","error_description","error_uri"]);a(u1,"redactSensitive");a(_vt,"checkCredentialsFileSafety");a(Cvt,"writeCredentialsFileAtomic");a(WSc,"readLimitedText");$c=class extends dr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function KD(){return Math.floor(Date.now()/1e3)}var LBe=me(()=>{p();a(KD,"nowAsSeconds")});var vvt,r9i=me(()=>{p();fye();LBe();vvt=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-KD();return n>e9i?r.token:n>dye?(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||KD()-this.lastAdvisoryError{this.lastAdvisoryError=KD(),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 ya,FBe=me(()=>{p();ya=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 o9i(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 pye(t){let e;return(n9i??(e=new globalThis.TextEncoder,n9i=e.encode.bind(e)))(t)}function eOr(t){let e;return(i9i??(e=new globalThis.TextDecoder,i9i=e.decode.bind(e)))(t)}var n9i,i9i,bvt=me(()=>{p();a(o9i,"concatBytes");a(pye,"encodeUTF8");a(eOr,"decodeUTF8")});var s9i=me(()=>{p();wf();bvt()});function UBe(){}function Svt(t,e,r){return!e||Tvt[t]>Tvt[r]?UBe:e[t].bind(e)}function dl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return zSc;let n=a9i.get(e);if(n&&n[0]===r)return n[1];let o={error:Svt("error",e,r),warn:Svt("warn",e,r),info:Svt("info",e,r),debug:Svt("debug",e,r)};return a9i.set(e,[r,o]),o}var Tvt,tOr,zSc,a9i,q6,j6=me(()=>{p();X4();Tvt={off:0,error:200,warn:300,info:400,debug:500},tOr=a((t,e,r)=>{if(t){if(R6i(Tvt,t))return t;dl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Tvt))}`)}},"parseLogLevel");a(UBe,"noop");a(Svt,"makeLogFn");zSc={error:UBe,warn:UBe,info:UBe,debug:UBe},a9i=new WeakMap;a(dl,"loggerFor");q6=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 rOr=me(()=>{p();X4();s9i();FBe();j6();dvt();lye();ZMr()});function c9i(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(!YSc.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var Ivt,YSc,l9i,u9i,nOr,KSc,d9i,iOr=me(()=>{p();hvt();rOr();Ivt="1.0",YSc=/^[A-Za-z0-9_.-]+$/;a(c9i,"validateProfileName");l9i=a(async t=>{var e,r;let n=await nOr();if(n===null)return null;let o=t??await d9i();if(o===null)return null;c9i(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=ya("ANTHROPIC_ORGANIZATION_ID"),m=ya("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=ya("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:ya("ANTHROPIC_WORKSPACE_ID"),base_url:ya("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:ya("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:ya("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=ya("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=ya("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=ya("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=ya("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=ya("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=ya("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=ya("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),u9i=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await nOr();if(!r)return null;let n=e??await d9i();return n?(c9i(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),nOr=a(async()=>{if(!KSc())return null;let t=await import("node:path"),e=ya("ANTHROPIC_CONFIG_DIR");if(e)return e;if(OBe()["X-Stainless-OS"]==="Windows"){let s=ya("APPDATA");if(s)return t.join(s,"Anthropic");let c=ya("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=ya("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=ya("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),KSc=a(()=>{let t=OBe()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),d9i=a(async()=>{let t=await nOr();if(!t)return null;let e=ya("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 oOr(t){if(!t)throw new dr("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 dr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new dr(`Identity token file at ${t} is empty`);return n}}function f9i(t){if(!t)throw new dr("Identity token value is empty");return()=>t}var p9i=me(()=>{p();wf();a(oOr,"identityTokenFromFile");a(f9i,"identityTokenFromValue")});function h9i(t){return async()=>{yvt(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new $c(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:J6i,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}${Avt}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${ine},${X6i}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${kR} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new $c(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=u1(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 $c(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Evt(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new $c(`Token endpoint response missing required fields: ${JSON.stringify(u1(c))}`,o.status,u1(c),s);return{token:c.access_token,expiresAt:KD()+l}}}var m9i=me(()=>{p();fye();LBe();MBe();a(h9i,"oidcFederationProvider")});function g9i(t){return async e=>{let r=await import("node:fs");await _vt(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new $c(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new $c(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new $c(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||KD()"");throw new $c(`User OAuth refresh failed (HTTP ${f.status}): ${u1(E)}`,f.status,u1(E),h)}let m=await Evt(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new $c(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(u1(m))}`,f.status,u1(m),h);let A=KD()+g,y=m.refresh_token||l;return await Cvt(t.credentialsPath,{...o,version:Ivt,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var A9i=me(()=>{p();iOr();fye();LBe();MBe();a(g9i,"userOAuthProvider")});function sOr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=JSc(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 y9i(t,e){let r=await l9i(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 u9i(n,e)??void 0}};return sOr(s,t)}function JSc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=ZSc(o);if(!s)throw new $c("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 $c("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 $c("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=h9i({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?XSc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new $c("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return g9i({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 $c(`authentication.type "${o}" is not a known authentication type`)}}}function ZSc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new $c(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new $c('identity_token.source "file" requires a non-empty path');return oOr(t.identity_token.path)}let e=ya("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return oOr(e);let r=ya("ANTHROPIC_IDENTITY_TOKEN");return r?f9i(r):null}function XSc(t,e,r,n){return async o=>{let s=await import("node:fs");await _vt(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||KD(){p();FBe();iOr();fye();LBe();p9i();m9i();A9i();a(sOr,"resolveCredentialsFromConfig");a(y9i,"defaultCredentials");a(JSc,"buildProvider");a(ZSc,"resolveIdentityTokenProvider");a(XSc,"cachedExchangeProvider")});function eTc(t,e){for(let o=e??0;o{p();l1();bvt();H6=class{static{a(this,"LineDecoder")}constructor(){eI.set(this,void 0),tI.set(this,void 0),Lt(this,eI,new Uint8Array,"f"),Lt(this,tI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?pye(e):e;Lt(this,eI,o9i([ye(this,eI,"f"),r]),"f");let n=[],o;for(;(o=eTc(ye(this,eI,"f"),ye(this,tI,"f")))!=null;){if(o.carriage&&ye(this,tI,"f")==null){Lt(this,tI,o.index,"f");continue}if(ye(this,tI,"f")!=null&&(o.index!==ye(this,tI,"f")+1||o.carriage)){n.push(eOr(ye(this,eI,"f").subarray(0,ye(this,tI,"f")-1))),Lt(this,eI,ye(this,eI,"f").subarray(ye(this,tI,"f")),"f"),Lt(this,tI,null,"f");continue}let s=ye(this,tI,"f")!==null?o.preceding-1:o.preceding,c=eOr(ye(this,eI,"f").subarray(0,s));n.push(c),Lt(this,eI,ye(this,eI,"f").subarray(o.index),"f"),Lt(this,tI,null,"f")}return n}flush(){return ye(this,eI,"f").length?this.decode(` -`):[]}};eI=new WeakMap,tI=new WeakMap;H6.NEWLINE_CHARS=new Set([` -`,"\r"]);H6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(eTc,"findNewlineIndex");a(_9i,"findDoubleNewlineIndex")});async function*tTc(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new dr("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 dr("Attempted to iterate over a response with no body");let r=new cOr,n=new H6,o=BBe(t.body);for await(let s of rTc(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*rTc(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"?pye(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=_9i(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function nTc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var QBe,tB,cOr,lOr=me(()=>{p();l1();wf();uye();aOr();uye();XAe();X4();bvt();j6();wf();tB=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,QBe.set(this,void 0),this.controller=r,Lt(this,QBe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?dl(n):console;async function*c(){if(o)throw new dr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of tTc(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=pvt(u.data)??u.data,f=d?.error?.type;throw new lh(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(Q6(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 H6,u=BBe(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 dr("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(Q6(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(QBe=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,ye(this,QBe,"f")),new t(()=>o(r),this.controller,ye(this,QBe,"f"))]}toReadableStream(){let e=this,r;return GMr({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=pye(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(tTc,"_iterSSEMessages");a(rTc,"iterSSEChunks");cOr=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]=nTc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(nTc,"partition")});async function xvt(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return dl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):tB.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 uOr(m,r)}return await r.text()})();return dl(t).debug(`[${n}] response parsed`,q6({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function uOr(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 dOr=me(()=>{p();lOr();j6();a(xvt,"defaultParseResponse");a(uOr,"addRequestID")});var qBe,one,wvt=me(()=>{p();l1();dOr();one=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=xvt){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,qBe.set(this,void 0),Lt(this,qBe,e,"f")}_thenUnwrap(e){return new t(ye(this,qBe,"f"),this.responsePromise,async(r,n)=>uOr(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(ye(this,qBe,"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)}};qBe=new WeakMap});var Rvt,kvt,jBe,PR,Ea,pd=me(()=>{p();l1();wf();dOr();wvt();X4();kvt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){Rvt.set(this,void 0),Lt(this,Rvt,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 dr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ye(this,Rvt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(Rvt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},jBe=class extends one{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await xvt(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},PR=class extends kvt{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:{...fvt(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...fvt(this.options.query),after_id:e}}:null}},Ea=class extends kvt{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:{...fvt(this.options.query),page:e}}:null}}});function sne(t,e,r){return pOr(),new File(t,e??"unknown_file",r)}function HBe(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 oTc(t){let e=typeof t=="function"?t:t.fetch,r=C9i.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 C9i.set(e,n),n}var pOr,hOr,hye,C9i,sTc,aTc,fOr,mye=me(()=>{p();uye();pOr=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(sne,"makeFile");a(HBe,"getName");hOr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),hye=a(async(t,e,r=!0)=>({...t,body:await sTc(t.body,e,r)}),"multipartFormRequestOptions"),C9i=new WeakMap;a(oTc,"supportsFormData");sTc=a(async(t,e,r=!0)=>{if(!await oTc(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])=>fOr(n,o,s,r))),n},"createForm"),aTc=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),fOr=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,sne([await r.blob()],HBe(r,n),o))}else if(hOr(r))t.append(e,sne([await new Response(mvt(r)).blob()],HBe(r,n)));else if(aTc(r))t.append(e,sne([r],HBe(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>fOr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>fOr(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 Pvt(t,e,r){if(pOr(),t=await t,e||(e=HBe(t,!0)),cTc(t))return t instanceof File&&e==null&&r==null?t:sne([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(lTc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),sne(await mOr(o),e,r)}let n=await mOr(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 sne(n,e,r)}async function mOr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(v9i(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(hOr(t))for await(let r of t)e.push(...await mOr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${uTc(t)}`)}return e}function uTc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var v9i,cTc,lTc,b9i=me(()=>{p();mye();mye();v9i=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"),cTc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&v9i(t),"isFileLike"),lTc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(Pvt,"toFile");a(mOr,"getBytes");a(uTc,"propsForError")});var gOr=me(()=>{p();b9i()});var S9i=me(()=>{p()});var mi,Ml=me(()=>{p();mi=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*fTc(t){if(!t)return;if(T9i 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():jMr(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=jMr(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 T9i,At,Ac=me(()=>{p();X4();T9i=Symbol.for("brand.privateNullableHeaders");a(fTc,"iterateHeaders");At=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of fTc(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{[T9i]:!0,values:e,nulls:r}},"buildHeaders")});function Dvt(t){return typeof t=="object"&&t!==null&&GBe in t}function AOr(t,e){let r=new Set;if(t)for(let n of t)Dvt(n)&&r.add(n[GBe]);if(e){for(let n of e)if(Dvt(n)&&r.add(n[GBe]),Array.isArray(n.content))for(let o of n.content)Dvt(o)&&r.add(o[GBe])}return Array.from(r)}function Nvt(t,e){let r=AOr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function I9i(t){return Dvt(t)?{"x-stainless-helper":t[GBe]}:{}}var GBe,$Be=me(()=>{p();GBe=Symbol("anthropic.sdk.stainlessHelper");a(Dvt,"wasCreatedByStainlessHelper");a(AOr,"collectStainlessHelpers");a(Nvt,"stainlessHelperHeader");a(I9i,"stainlessHelperHeaderFromFile")});function w9i(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var x9i,pTc,nr,Rf=me(()=>{p();wf();a(w9i,"encodeURIPath");x9i=Object.freeze(Object.create(null)),pTc=a((t=w9i)=>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??x9i)??x9i)?.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 dr(`Path parameters result in path with invalid segments: + `,u=[],d=null,f=!0;for(;f;){let m=await hAe(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(Bgc,"getAssignableActorsWithAssignableUsers")});var aLi=I(CR=>{"use strict";p();Object.defineProperty(CR,"__esModule",{value:!0});CR.BaseOctoKitService=CR.PermissiveAuthRequiredError=CR.VSCodeTeamId=CR.IOctoKitService=CR.IGithubRepositoryService=void 0;var sLi=rn(),oLi=rG(),f6=iLi();CR.IGithubRepositoryService=(0,sLi.createServiceIdentifier)("IGithubRepositoryService");CR.IOctoKitService=(0,sLi.createServiceIdentifier)("IOctoKitService");CR.VSCodeTeamId=1682102;var nDr=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};CR.PermissiveAuthRequiredError=nDr;var iDr=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,f6.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,f6.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,f6.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 closePullRequestWithToken(e,r,n,o){return(0,f6.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,f6.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,oLi.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(M_t,"__esModule",{value:!0});M_t.NullBaseOctoKitService=void 0;var Lgc=aLi(),oDr=class extends Lgc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};M_t.NullBaseOctoKitService=oDr});var fLi=I(Rl=>{"use strict";p();var q_t=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},wu=Rl&&Rl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Rl,"__esModule",{value:!0});Rl.CopilotTokenManagerFromGitHubToken=Rl.CopilotTokenManagerFromDeviceId=Rl.RefreshableCopilotTokenManager=Rl.StaticExtendedTokenInfoCopilotTokenManager=Rl.FixedCopilotTokenManager=Rl.BaseCopilotTokenManager=Rl.tokenErrorString=void 0;Rl.createStaticGitHubTokenProvider=Ugc;Rl.getOrCreateTestingCopilotTokenManager=Qgc;var sDr=(sre(),ya(ore)),Fgc=Cc(),lLi=wo(),O_t=iut(),dLi=Sl(),j_t=wE(),H_t=ZG(),gAe=Y5(),G_t=cLi(),$_t=hp(),F4e=oy(),V_t=o0(),uLi=Pge(),p6=Iht(),B_t=fMe();Rl.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 Ugc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(gAe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Rl.tokenErrorString)}}a(Ugc,"createStaticGitHubTokenProvider");function Qgc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new O_t.SyncDescriptor(F_t,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new O_t.SyncDescriptor(Q_t,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new O_t.SyncDescriptor(L_t,[process.env.GITHUB_PAT]);if(gAe.isScenarioAutomation)return new O_t.SyncDescriptor(U_t,[t]);throw new Error(Rl.tokenErrorString)}a(Qgc,"getOrCreateTestingCopilotTokenManager");var mAe=class extends lLi.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 Fgc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,lLi.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=uLi.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,B_t.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,p6.containsVSCodeOrg)(s.organization_list??[])},d=uLi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,B_t.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:sDr.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:sDr.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,F4e.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,p6.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,p6.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,p6.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:sDr.RequestType.CopilotUserInfo})).json()}};Rl.BaseCopilotTokenManager=mAe;var L_t=class extends mAe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new G_t.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,p6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,p6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new p6.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Rl.FixedCopilotTokenManager=L_t;Rl.FixedCopilotTokenManager=L_t=q_t([wu(1,$_t.ILogService),wu(2,V_t.ITelemetryService),wu(3,j_t.ICAPIClientService),wu(4,H_t.IDomainService),wu(5,F4e.IFetcherService),wu(6,gAe.IEnvService)],L_t);var F_t=class extends mAe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new G_t.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 p6.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Rl.StaticExtendedTokenInfoCopilotTokenManager=F_t;Rl.StaticExtendedTokenInfoCopilotTokenManager=F_t=q_t([wu(1,$_t.ILogService),wu(2,V_t.ITelemetryService),wu(3,j_t.ICAPIClientService),wu(4,H_t.IDomainService),wu(5,F4e.IFetcherService),wu(6,gAe.IEnvService)],F_t);var L4e=class extends mAe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,B_t.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 p6.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,B_t.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Rl.RefreshableCopilotTokenManager=L4e;var U_t=class extends L4e{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new G_t.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Rl.CopilotTokenManagerFromDeviceId=U_t;Rl.CopilotTokenManagerFromDeviceId=U_t=q_t([wu(1,$_t.ILogService),wu(2,V_t.ITelemetryService),wu(3,H_t.IDomainService),wu(4,j_t.ICAPIClientService),wu(5,F4e.IFetcherService),wu(6,gAe.IEnvService),wu(7,dLi.IConfigurationService)],U_t);var Q_t=class extends L4e{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new G_t.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)}};Rl.CopilotTokenManagerFromGitHubToken=Q_t;Rl.CopilotTokenManagerFromGitHubToken=Q_t=q_t([wu(2,$_t.ILogService),wu(3,V_t.ITelemetryService),wu(4,H_t.IDomainService),wu(5,j_t.ICAPIClientService),wu(6,F4e.IFetcherService),wu(7,gAe.IEnvService),wu(8,dLi.IConfigurationService)],Q_t)});var pLi=I(h6=>{"use strict";p();var qgc=h6&&h6.__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},aDr=h6&&h6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(h6,"__esModule",{value:!0});h6.ChatQuotaService=void 0;var jgc=(sre(),ya(ore)),Hgc=Cc(),Ggc=wo(),$gc=vE(),Vgc=wE(),Wgc=hp(),cDr=class extends Ggc.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 Hgc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidAuthenticationChange(()=>{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:jgc.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()}};h6.ChatQuotaService=cDr;h6.ChatQuotaService=cDr=qgc([aDr(0,$gc.IAuthenticationService),aDr(1,Wgc.ILogService),aDr(2,Vgc.ICAPIClientService)],cDr)});var mLi=I(W_t=>{"use strict";p();Object.defineProperty(W_t,"__esModule",{value:!0});W_t.DefaultsOnlyConfigurationService=void 0;var hLi=Sl(),lDr=class extends hLi.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=hLi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};W_t.DefaultsOnlyConfigurationService=lDr});var ALi=I(z_t=>{"use strict";p();Object.defineProperty(z_t,"__esModule",{value:!0});z_t.computeDiff=Ygc;z_t.computeDiffSync=gLi;var zgc=$wr();async function Ygc(t,e,r){return gLi(t,e,r)}a(Ygc,"computeDiff");function gLi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new zgc.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(gLi,"computeDiffSync")});var vLi=I(MD=>{"use strict";p();var Kgc=MD&&MD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Jgc=MD&&MD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_Li=MD&&MD.__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=nAc([yLi.join(__dirname,"diffWorker.js"),yLi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new Zgc.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 rAc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:fDr(o.changes),moves:o.moves.map(c=>new tAc.MovedText(new uDr.LineRangeMapping(new Y_t.LineRange(c[0],c[1]),new Y_t.LineRange(c[2],c[3])),fDr(c[4])))}}};MD.DiffServiceImpl=dDr;function fDr(t){return t.map(e=>new uDr.DetailedLineRangeMapping(new Y_t.LineRange(e[0],e[1]),new Y_t.LineRange(e[2],e[3]),e[4]?.map(r=>new uDr.RangeMapping(new ELi.Range(r[0],r[1],r[2],r[3]),new ELi.Range(r[4],r[5],r[6],r[7])))))}a(fDr,"toLineRangeMappings");function nAc(t){for(let e of t)if((0,eAc.existsSync)(e))return e}a(nAc,"firstExistingPath")});var bLi=I(m6=>{"use strict";p();var iAc=m6&&m6.__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},CLi=m6&&m6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(m6,"__esModule",{value:!0});m6.CAPIClientImpl=void 0;var oAc=Y5(),sAc=oy(),aAc=wE(),pDr=class extends aAc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};m6.CAPIClientImpl=pDr;m6.CAPIClientImpl=pDr=iAc([CLi(0,sAc.IFetcherService),CLi(1,oAc.IEnvService)],pDr)});var TLi=I(g6=>{"use strict";p();var cAc=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},hDr=g6&&g6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(g6,"__esModule",{value:!0});g6.DomainService=void 0;var lAc=Cc(),uAc=wo(),dAc=rH(),AAe=Sl(),fAc=wE(),SLi="github-enterprise.uri",mDr=class extends uAc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new lAc.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(`${AAe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(SLi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(AAe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(AAe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(AAe.ConfigKey.Shared.AuthProvider)===AAe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(SLi):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)}};g6.DomainService=mDr;g6.DomainService=mDr=cAc([hDr(0,AAe.IConfigurationService),hDr(1,dAc.ICopilotTokenStore),hDr(2,fAc.ICAPIClientService)],mDr)});var ILi=I(yAe=>{"use strict";p();Object.defineProperty(yAe,"__esModule",{value:!0});yAe.NullNativeEnvService=yAe.NullEnvService=void 0;var pAc=Cc(),hAc=Ku(),K_t=Y5(),mAc=tMe(),J_t=class t extends K_t.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 pAc.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 K_t.OperatingSystem.Linux}getEditorInfo(){return new K_t.NameAndVersion("simulation-tests-editor",mAc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new K_t.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};yAe.NullEnvService=J_t;var gDr=class extends J_t{static{a(this,"NullNativeEnvService")}get userHome(){return hAc.URI.file("/home/testuser")}};yAe.NullNativeEnvService=gDr});var ADr=I(Z_t=>{"use strict";p();Object.defineProperty(Z_t,"__esModule",{value:!0});Z_t.IGitExtensionService=void 0;var gAc=rn();Z_t.IGitExtensionService=(0,gAc.createServiceIdentifier)("IGitExtensionService")});var xLi=I(X_t=>{"use strict";p();Object.defineProperty(X_t,"__esModule",{value:!0});X_t.NullGitExtensionService=void 0;var AAc=Cc(),yDr=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=AAc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};X_t.NullGitExtensionService=yDr});var wLi=I(A6=>{"use strict";p();var yAc=A6&&A6.__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},EAc=A6&&A6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(A6,"__esModule",{value:!0});A6.ObservableGit=void 0;var _Ac=wo(),_$=u2(),vAc=ADr(),EDr=class extends _Ac.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,_$.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,_$.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,_$.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,_$.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,_$.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,_$.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,_$.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,_$.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};A6.ObservableGit=EDr;A6.ObservableGit=EDr=yAc([EAc(0,vAc.IGitExtensionService)],EDr)});var tvt=I(Pl=>{"use strict";p();Object.defineProperty(Pl,"__esModule",{value:!0});Pl.lengthZero=void 0;Pl.lengthDiff=SAc;Pl.lengthIsZero=TAc;Pl.toLength=Bre;Pl.lengthToObj=IAc;Pl.lengthGetLineCount=xAc;Pl.lengthGetColumnCountIfZeroLineCount=wAc;Pl.lengthAdd=PLi;Pl.sumLengths=RAc;Pl.lengthEquals=PAc;Pl.lengthDiffNonNegative=kAc;Pl.lengthLessThan=DAc;Pl.lengthLessThanEqual=NAc;Pl.lengthGreaterThanEqual=MAc;Pl.lengthToPosition=OAc;Pl.positionToLength=BAc;Pl.lengthsToRange=LAc;Pl.lengthOfRange=FAc;Pl.lengthCompare=UAc;Pl.lengthOfString=QAc;Pl.lengthOfStringObj=qAc;Pl.lengthHash=jAc;Pl.lengthMax=HAc;var RLi=Gh(),CAc=b_(),bAc=jp(),evt=Rpe();function SAc(t,e,r,n){return t!==r?Bre(r-t,n):Bre(0,n-e)}a(SAc,"lengthDiff");Pl.lengthZero=0;function TAc(t){return t===0}a(TAc,"lengthIsZero");var ME=2**26;function Bre(t,e){return t*ME+e}a(Bre,"toLength");function IAc(t){let e=t,r=Math.floor(e/ME),n=e-r*ME;return new evt.TextLength(r,n)}a(IAc,"lengthToObj");function xAc(t){return Math.floor(t/ME)}a(xAc,"lengthGetLineCount");function wAc(t){return t}a(wAc,"lengthGetColumnCountIfZeroLineCount");function PLi(t,e){let r=t+e;return e>=ME&&(r=r-t%ME),r}a(PLi,"lengthAdd");function RAc(t,e){return t.reduce((r,n)=>PLi(r,e(n)),Pl.lengthZero)}a(RAc,"sumLengths");function PAc(t,e){return t===e}a(PAc,"lengthEquals");function kAc(t,e){let r=t,n=e;if(n-r<=0)return Pl.lengthZero;let s=Math.floor(r/ME),c=Math.floor(n/ME),l=n-c*ME;if(s===c){let u=r-s*ME;return Bre(0,l-u)}else return Bre(c-s,l)}a(kAc,"lengthDiffNonNegative");function DAc(t,e){return t=e}a(MAc,"lengthGreaterThanEqual");function OAc(t){let e=t,r=Math.floor(e/ME),n=e-r*ME;return new CAc.Position(r+1,n+1)}a(OAc,"lengthToPosition");function BAc(t){return Bre(t.lineNumber-1,t.column-1)}a(BAc,"positionToLength");function LAc(t,e){let r=t,n=Math.floor(r/ME),o=r-n*ME,s=e,c=Math.floor(s/ME),l=s-c*ME;return new bAc.Range(n+1,o+1,c+1,l+1)}a(LAc,"lengthsToRange");function FAc(t){return t.startLineNumber===t.endLineNumber?new evt.TextLength(0,t.endColumn-t.startColumn):new evt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(FAc,"lengthOfRange");function UAc(t,e){return t-e}a(UAc,"lengthCompare");function QAc(t){let e=(0,RLi.splitLines)(t);return Bre(e.length-1,e[e.length-1].length)}a(QAc,"lengthOfString");function qAc(t){let e=(0,RLi.splitLines)(t);return new evt.TextLength(e.length-1,e[e.length-1].length)}a(qAc,"lengthOfStringObj");function jAc(t){return t}a(jAc,"lengthHash");function HAc(t,e){return t>e?t:e}a(HAc,"lengthMax")});var CDr=I(rvt=>{"use strict";p();Object.defineProperty(rvt,"__esModule",{value:!0});rvt.TextEditInfo=void 0;var _Dr=tvt(),vDr=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,_Dr.lengthToObj)(this.startOffset)}...${(0,_Dr.lengthToObj)(this.endOffset)}) -> ${(0,_Dr.lengthToObj)(this.newLength)}`}};rvt.TextEditInfo=vDr});var DLi=I(bDr=>{"use strict";p();Object.defineProperty(bDr,"__esModule",{value:!0});bDr.combineTextEditInfos=VAc;var GAc=Al(),ym=tvt(),$Ac=CDr();function VAc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new GAc.ArrayQueue(kLi(t)),n=kLi(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,ym.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,ym.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,ym.lengthIsZero)(d)||f.push(new U4e(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,ym.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new $Ac.TextEditInfo(m.startOffset,f,(0,ym.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=ym.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,ym.sumLengths)(f,g=>g.lengthBefore),m=(0,ym.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,ym.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(VAc,"combineTextEditInfos");var U4e=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,ym.lengthDiffNonNegative)(e,this.lengthAfter);return(0,ym.lengthEquals)(r,ym.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,ym.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,ym.lengthToObj)(this.lengthBefore)} -> ${(0,ym.lengthToObj)(this.lengthAfter)}`}};function kLi(t){let e=[],r=ym.lengthZero;for(let n of t){let o=(0,ym.lengthDiffNonNegative)(r,n.startOffset);(0,ym.lengthIsZero)(o)||e.push(new U4e(!1,o,o));let s=(0,ym.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new U4e(!0,s,n.newLength)),r=n.endOffset}return e}a(kLi,"toLengthMapping")});var MLi=I(EAe=>{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.SingleTextEditLength=EAe.TextLengthEdit=void 0;var WAc=jp(),NLi=Rpe(),zAc=DLi(),Q4e=tvt(),YAc=CDr(),SDr=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new q4e(n.range,NLi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,Q4e.lengthToObj)(n.newLength);return new q4e((0,Q4e.lengthsToRange)(n.startOffset,n.endOffset),new NLi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new YAc.TextEditInfo((0,Q4e.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,Q4e.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,Q4e.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,zAc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return WAc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};EAe.TextLengthEdit=SDr;var q4e=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};EAe.SingleTextEditLength=q4e});var OLi=I(_Ae=>{"use strict";p();Object.defineProperty(_Ae,"__esModule",{value:!0});_Ae.DocumentHistory=_Ae.HistoryContext=void 0;var KAc=Yu(),JAc=CD(),TDr=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,KAc.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}}};_Ae.HistoryContext=TDr;var IDr=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 JAc.RootedEdit(this.base,this.lastEdits.compose())}};_Ae.DocumentHistory=IDr});var qLi=I(vAe=>{"use strict";p();Object.defineProperty(vAe,"__esModule",{value:!0});vAe.NesHistoryContextProvider=void 0;vAe.sum=H4e;vAe.editExtends=QLi;var BLi=wo(),LLi=u2(),ZAc=RS(),j4e=pE(),XAc=aMe(),eyc=mT(),nvt=CD(),tyc=qAt(),FLi=MLi(),ryc=S5(),G4e=hDe(),ULi=OLi(),xDr=class extends BLi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new RDr(50),this._register((0,LLi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,G4e.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,LLi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new wDr(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,ryc.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,BLi.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 ULi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,G4e.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};vAe.NesHistoryContextProvider=xDr;var wDr=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 eyc.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=XAc.TextEdit.fromStringEdit(e,this._currentValue),o=FLi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return H4e(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&QLi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,G4e.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,G4e.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new nvt.Edits(j4e.StringEdit,this._edits.map(o=>o.edit));return{history:new ULi.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=j4e.StringEdit.empty,o=FLi.TextLengthEdit.empty,s,c=0,l=j4e.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,G4e.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,ZAc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=H4e(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||H4e(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||H4e(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=j4e.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=nvt.RootedEdit.toLineEdit(new nvt.RootedEdit(r,y)),v=new tyc.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 nvt.Edits(j4e.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function H4e(t,e){let r=0;for(let n of t)r+=e(n);return r}a(H4e,"sum");function QLi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>nyc(n.replaceRange,r))}a(QLi,"editExtends");function nyc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(nyc,"doesTouch");var RDr=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 GLi=I(OD=>{"use strict";p();var iyc=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},jLi=OD&&OD.__param||function(t,e){return function(r,n){e(r,n,t)}},kDr;Object.defineProperty(OD,"__esModule",{value:!0});OD.NesXtabHistoryTracker=OD.XtabEditMergeStrategy=void 0;var DDr=Yu(),oyc=wo(),syc=Kce(),ayc=u2(),cyc=wF(),ovt=Sl(),lyc=Ap(),ivt=CD(),y6=kAr(),uyc=S5(),PDr=hDe(),NDr;(function(t){t.sameStartLine={kind:y6.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:y6.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:y6.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case y6.DiffHistoryMergeStrategy.Proximity:return e(s);case y6.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case y6.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,DDr.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(NDr||(OD.XtabEditMergeStrategy=NDr={}));function HLi(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(HLi,"areLineEditsWithinProximity");var MDr=class extends oyc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{kDr=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 syc.LinkedList,this.maxHistorySize=r??kDr.MAX_HISTORY_SIZE,this.mergeStrategy=(0,cyc.derived)(s=>NDr.fromConfig(this._configurationService.getExperimentBasedConfigObservable(ovt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(ovt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(ovt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,ayc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,uyc.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,PDr.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case y6.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case y6.DiffHistoryMergeStrategy.Proximity:return HLi(r,e,o.lineGap);case y6.DiffHistoryMergeStrategy.Hybrid:return(0,PDr.now)()-n<=o.splitAfterMs&&HLi(r,e,o.lineGap)}}handleEdits(e,r){(0,DDr.assert)(r.previous!==void 0,"Document has previous version"),(0,DDr.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 ivt.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=ivt.RootedEdit.toLineEdit(l),d=ivt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new ivt.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,PDr.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)}}}};OD.NesXtabHistoryTracker=MDr;OD.NesXtabHistoryTracker=MDr=kDr=iyc([jLi(2,ovt.IConfigurationService),jLi(3,lyc.IExperimentationService)],MDr)});var $Li=I(svt=>{"use strict";p();Object.defineProperty(svt,"__esModule",{value:!0});svt.IVSCodeExtensionContext=void 0;var dyc=rn();svt.IVSCodeExtensionContext=(0,dyc.createServiceIdentifier)("IVSCodeExtensionContext")});var XLi=I(LD=>{"use strict";p();var YLi=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},v$=LD&&LD.__param||function(t,e){return function(r,n){e(r,n,t)}},V4e;Object.defineProperty(LD,"__esModule",{value:!0});LD.UndesiredModels=LD.InlineEditsModelService=void 0;var fyc=I2r(),KLi=c2r(),VLi=M_(),pyc=Al(),WLi=Yu(),JLi=Cc(),ZLi=wo(),CAe=u2(),hyc=rH(),BD=Sl(),myc=$Li(),gyc=hp(),Ayc=C_t(),yyc=Ap(),Eyc=o0(),$4e=ZA(),_yc=DEt(),BDr=class extends ZLi.Disposable{static{a(this,"InlineEditsModelService")}static{V4e=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:$4e.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:$4e.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:$4e.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,CAe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,CAe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(BD.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(BD.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(BD.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(BD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(BD.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,CAe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new KLi.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,CAe.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,CAe.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,CAe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=JLi.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(BD.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(BD.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(BD.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,BD.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,fyc.filterMap)(r,f=>{if((0,$4e.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,pyc.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 ODr(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 ODr(r[0])}return ODr(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,WLi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,BD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?V4e.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?V4e.COPILOT_NES_CALLISTO:V4e.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,WLi.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=$4e.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=VLi.ErrorUtils.toString(VLi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};LD.InlineEditsModelService=BDr;LD.InlineEditsModelService=BDr=V4e=YLi([v$(0,hyc.ICopilotTokenStore),v$(1,Ayc.IProxyModelsService),v$(2,_yc.IUndesiredModelsManager),v$(3,BD.IConfigurationService),v$(4,yyc.IExperimentationService),v$(5,Eyc.ITelemetryService),v$(6,gyc.ILogService)],BDr);function ODr(t){let{source:e,...r}=t;return r}a(ODr,"toModelConfiguration");var zLi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends ZLi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new JLi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new KLi.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=YLi([v$(0,myc.IVSCodeExtensionContext)],r),t.Manager=r})(zLi||(LD.UndesiredModels=zLi={}))});var e3i=I(avt=>{"use strict";p();Object.defineProperty(avt,"__esModule",{value:!0});avt.NullLanguageContextProviderService=void 0;var vyc=wo(),LDr=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return vyc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};avt.NullLanguageContextProviderService=LDr});var t3i=I(cvt=>{"use strict";p();Object.defineProperty(cvt,"__esModule",{value:!0});cvt.TestLanguageDiagnosticsService=void 0;var Cyc=Cc(),byc=gk(),Syc=xG(),FDr=class extends Syc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new byc.ResourceMap,this._onDidChangeDiagnostics=new Cyc.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())}};cvt.TestLanguageDiagnosticsService=FDr});var r3i=I(uvt=>{"use strict";p();Object.defineProperty(uvt,"__esModule",{value:!0});uvt.ResponseStream=void 0;var Tyc=M_(),lvt=Lx(),Iyc=Jc(),xyc=RS(),UDr=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new Iyc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return lvt.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return lvt.Result.error(l)}}),this.stream=wyc(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,xyc.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}}};uvt.ResponseStream=UDr;async function*wyc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=Tyc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?lvt.Result.error(n):lvt.Result.ok(r))}}a(wyc,"streamWithAggregation")});var n3i=I(QDr=>{"use strict";p();Object.defineProperty(QDr,"__esModule",{value:!0});QDr.jsonlStreamToCompletions=Ryc;async function*Ryc(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(Ryc,"jsonlStreamToCompletions")});var o3i=I(E6=>{"use strict";p();var Pyc=E6&&E6.__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},qDr=E6&&E6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(E6,"__esModule",{value:!0});E6.CompletionsFetchService=void 0;var kyc=l2r(),i3i=M_(),Lre=Lx(),Dyc=Afr(),Nyc=vE(),Myc=J8(),Oyc=oy(),Byc=hge(),C$=TAt(),Lyc=r3i(),Fyc=n3i(),jDr=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=Lre.Result.error(new C$.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=kyc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,Fyc.jsonlStreamToCompletions)(f),m=new Lyc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=Lre.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new C$.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>Qyc(d.val.body).catch(()=>"")),h=Lre.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())),Lre.Result.error(new C$.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=Uyc(u,s);return Lre.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Myc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return Lre.Result.error(new C$.Completions.RequestCancelled);let l=i3i.ErrorUtils.fromUnknown(c);return Lre.Result.error(new C$.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 C$.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof C$.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof C$.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:Dyc.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}}};E6.CompletionsFetchService=jDr;E6.CompletionsFetchService=jDr=Pyc([qDr(0,Nyc.IAuthenticationService),qDr(1,Oyc.IFetcherService),qDr(2,Byc.IRequestLogger)],jDr);async function*Uyc(t,e){try{for await(let r of t)yield r}catch(r){throw i3i.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(Uyc,"streamWithCleanup");async function Qyc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(Qyc,"collectAsyncIterableToString")});var a3i=I(dvt=>{"use strict";p();Object.defineProperty(dvt,"__esModule",{value:!0});dvt.WireTypes=void 0;var b$=DH(),s3i;(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,b$.vObj)({promptStrategy:(0,b$.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,b$.vObj)({serviceType:(0,b$.vString)(),name:(0,b$.vString)(),provider:(0,b$.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,b$.vObj)({models:(0,b$.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={}))})(s3i||(dvt.WireTypes=s3i={}))});var l3i=I(_6=>{"use strict";p();var qyc=_6&&_6.__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},fvt=_6&&_6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(_6,"__esModule",{value:!0});_6.ProxyModelsService=void 0;var jyc=require("util"),HDr=M_(),Hyc=Ak(),Gyc=Cc(),$yc=wo(),c3i=u2(),Vyc=rH(),Wyc=wE(),zyc=a3i(),Yyc=hp(),Kyc=oy(),GDr=class extends $yc.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 Gyc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,c3i.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,c3i.autorun)(c=>{let l=s.read(c),u=new Hyc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,jyc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=HDr.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=HDr.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=zyc.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=HDr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};_6.ProxyModelsService=GDr;_6.ProxyModelsService=GDr=qyc([fvt(0,Vyc.ICopilotTokenStore),fvt(1,Wyc.ICAPIClientService),fvt(2,Kyc.IFetcherService),fvt(3,Yyc.ILogService)],GDr)});var u3i=I(pvt=>{"use strict";p();Object.defineProperty(pvt,"__esModule",{value:!0});pvt.NullRequestLogger=void 0;var Jyc=KPr(),Zyc=Cc(),$Dr=class extends Jyc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=Zyc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};pvt.NullRequestLogger=$Dr});var sNr=I(fd=>{"use strict";p();var eNr=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},FD=fd&&fd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fd,"__esModule",{value:!0});fd.SimpleExperimentationService=fd.LogLevel=fd.ILanguageContextProviderService=fd.IIgnoreService=fd.IExperimentationService=fd.IEndpointProvider=fd.ICAPIClientService=fd.IAuthenticationService=void 0;fd.createNESProvider=$Ec;fd.createInlineCompletionsProvider=WEc;var Xyc=lei(),d3i=aee(),f3i=X_i(),p3i=G0e(),eEc=xht(),h3i=kvr(),tEc=Dvr(),xv=EE(),m3i=Fvr(),rEc=NTi(),nEc=JA(),g3i=_Cr(),iEc=oG(),A3i=ICr(),y3i=fOe(),E3i=VCr(),_3i=zCr(),v3i=uxr(),WDr=mmt(),oEc=mDi(),sEc=gDi(),W4e=Tl(),aEc=tge(),cEc=Ovr(),C3i=Hxr(),b3i=Xvr(),S3i=CAt(),T3i=VTr(),I3i=sgt(),z4e=ogt(),x3i=bG(),w3i=Egt(),lEc=_Di(),uEc=ggt(),R3i=XAr(),P3i=Qb(),k3i=pMe(),D3i=Fte(),dEc=NDi(),fEc=kNi(),zDr=ZNi(),N3i=_Rr(),pEc=O5i(),M3i=ukr(),hEc=ZBi(),tNr=vE();Object.defineProperty(fd,"IAuthenticationService",{enumerable:!0,get:a(function(){return tNr.IAuthenticationService},"get")});var mEc=fMe(),O3i=rH(),gEc=XBi(),AEc=fLi(),yEc=r6(),EEc=bRr(),_Ec=pLi(),vEc=SRr(),B3i=IRr(),Q4=Sl(),CEc=mLi(),bEc=dkr(),SEc=vLi(),rNr=wE();Object.defineProperty(fd,"ICAPIClientService",{enumerable:!0,get:a(function(){return rNr.ICAPIClientService},"get")});var TEc=ZG(),nNr=XMe();Object.defineProperty(fd,"IEndpointProvider",{enumerable:!0,get:a(function(){return nNr.IEndpointProvider},"get")});var H3i=bLi(),IEc=TLi(),Fre=Y5(),xEc=ILi(),wEc=ADr(),G3i=xLi(),Y4e=Ete();Object.defineProperty(fd,"IIgnoreService",{enumerable:!0,get:a(function(){return Y4e.IIgnoreService},"get")});var REc=Ire(),PEc=hut(),VDr=DEt(),kEc=wLi(),DEc=qLi(),NEc=GLi(),MEc=XLi(),iNr=rgt();Object.defineProperty(fd,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return iNr.ILanguageContextProviderService},"get")});var $3i=e3i(),V3i=xG(),W3i=t3i(),UD=hp(),OEc=TAt(),BEc=o3i(),oNr=oy(),L3i=o6(),LEc=$Pr(),FEc=VPr(),UEc=_Et(),QEc=C_t(),qEc=l3i(),z3i=hge(),Y3i=u3i(),F3i=_kr(),U3i=Swr(),J4e=Ap();Object.defineProperty(fd,"IExperimentationService",{enumerable:!0,get:a(function(){return J4e.IExperimentationService},"get")});var K3i=o0(),Q3i=Pge(),jEc=AAr(),q3i=h_t(),j3i=Cre(),YDr=i2r(),J3i=rn(),HEc=Ak(),K4e=Cc(),Avt=wo(),GEc=um(),hi=iut(),Z3i=Ls(),Ure;(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"})(Ure||(fd.LogLevel=Ure={}));function $Ec(t){return VEc(t).createInstance(KDr,t)}a($Ec,"createNESProvider");var KDr=class extends Avt.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(hEc.XtabProvider),l=r.createInstance(kEc.ObservableGit),u=new DEc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(Q4.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new NEc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new dEc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(fEc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(zDr.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=REc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,GEc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new PEc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new zDr.NextEditProviderTelemetryBuilder(new G3i.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 Qre&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=Q4.globalConfigRegistry.configs.get(`${Q4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};KDr=eNr([FD(1,Z3i.IInstantiationService),FD(2,J4e.IExperimentationService),FD(3,Q4.IConfigurationService),FD(4,YDr.IWorkspaceService)],KDr);function VEc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new J3i.InstantiationServiceBuilder;s.define(Q4.IConfigurationService,new hi.SyncDescriptor(hvt,[t.configOverrides??new Map])),s.define(J4e.IExperimentationService,new hi.SyncDescriptor(Qre,[t.waitForTreatmentVariables])),s.define(F3i.ISimulationTestContext,new hi.SyncDescriptor(F3i.NulSimulationTestContext)),s.define(YDr.IWorkspaceService,new hi.SyncDescriptor(YDr.NullWorkspaceService)),s.define(bEc.IDiffService,new hi.SyncDescriptor(SEc.DiffServiceImpl,[!1])),s.define(UD.ILogService,new hi.SyncDescriptor(UD.LogServiceImpl,[[o||new UD.ConsoleLog(void 0,UD.LogLevel.Trace)]])),s.define(wEc.IGitExtensionService,new hi.SyncDescriptor(G3i.NullGitExtensionService)),s.define(iNr.ILanguageContextProviderService,new hi.SyncDescriptor($3i.NullLanguageContextProviderService)),s.define(V3i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(W3i.TestLanguageDiagnosticsService)),s.define(Y4e.IIgnoreService,new hi.SyncDescriptor(Y4e.NullIgnoreService)),s.define(U3i.ISnippyService,new hi.SyncDescriptor(U3i.NullSnippyService)),s.define(TEc.IDomainService,new hi.SyncDescriptor(IEc.DomainService)),s.define(rNr.ICAPIClientService,new hi.SyncDescriptor(H3i.CAPIClientImpl)),s.define(O3i.ICopilotTokenStore,new hi.SyncDescriptor(O3i.CopilotTokenStore)),s.define(Fre.IEnvService,new hi.SyncDescriptor(xEc.NullEnvService)),s.define(oNr.IFetcherService,new hi.SyncDescriptor(mvt,[e])),s.define(K3i.ITelemetryService,new hi.SyncDescriptor(gvt,[n])),s.define(tNr.IAuthenticationService,new hi.SyncDescriptor(gEc.StaticGitHubAuthenticationService,[(0,AEc.createStaticGitHubTokenProvider)()])),s.define(mEc.ICopilotTokenManager,r),s.define(N3i.IPowerService,new hi.SyncDescriptor(N3i.NullPowerService)),s.define(yEc.IChatMLFetcher,new hi.SyncDescriptor(pEc.ChatMLFetcherImpl)),s.define(L3i.IChatWebSocketManager,new hi.SyncDescriptor(L3i.NullChatWebSocketManager)),s.define(UEc.IOTelService,new LEc.NoopOTelService((0,FEc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(EEc.IChatQuotaService,new hi.SyncDescriptor(_Ec.ChatQuotaService)),s.define(B3i.IInteractionService,new hi.SyncDescriptor(B3i.InteractionService)),s.define(z3i.IRequestLogger,new hi.SyncDescriptor(Y3i.NullRequestLogger)),s.define(j3i.ITokenizerProvider,new hi.SyncDescriptor(j3i.TokenizerProvider,[!1])),s.define(vEc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(QEc.IProxyModelsService,new hi.SyncDescriptor(qEc.ProxyModelsService)),s.define(VDr.IInlineEditsModelService,new hi.SyncDescriptor(MEc.InlineEditsModelService)),s.define(VDr.IUndesiredModelsManager,t.undesiredModelsManager||new hi.SyncDescriptor(VDr.NullUndesiredModelsManager)),s.define(q3i.ITerminalService,t.terminalService||new hi.SyncDescriptor(q3i.NullTerminalService)),s.define(M3i.ISimilarFilesContextService,new hi.SyncDescriptor(M3i.NullSimilarFilesContextService)),s.define(nNr.IEndpointProvider,new JDr);let c=new xv.InMemoryConfigProvider(new xv.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(xv.ICompletionsConfigProvider,c),s.seal()}a(VEc,"setupServices");var hvt=class extends CEc.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)}},JDr=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=K4e.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},Qre=class extends Avt.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new K4e.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()}};fd.SimpleExperimentationService=Qre;fd.SimpleExperimentationService=Qre=eNr([FD(1,Q4.IConfigurationService)],Qre);var mvt=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=K4e.Event.None,this.onDidCompleteFetch=K4e.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 oNr.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)}},gvt=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,Q3i.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,Q3i.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function WEc(t){return zEc(t).createInstance(ZDr)}a(WEc,"createInlineCompletionsProvider");var ZDr=class extends Avt.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(oEc.GhostText)}updateTreatmentVariables(e){this._expService instanceof Qre&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=Q4.globalConfigRegistry.configs.get(`${Q4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof xv.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new zDr.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??HEc.CancellationToken.None,o,new Xyc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};ZDr=eNr([FD(0,Z3i.IInstantiationService),FD(1,J4e.IExperimentationService),FD(2,WDr.ICompletionsSpeculativeRequestCache),FD(3,UD.ILogService),FD(4,Q4.IConfigurationService),FD(5,xv.ICompletionsConfigProvider)],ZDr);var XDr=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,jEc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function zEc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new UD.ConsoleLog(void 0,UD.LogLevel.Trace),f=new J3i.InstantiationServiceBuilder;f.define(W4e.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case W4e.LogLevel.DEBUG:return Ure.Debug;case W4e.LogLevel.INFO:return Ure.Info;case W4e.LogLevel.WARN:return Ure.Warning;case W4e.LogLevel.ERROR:return Ure.Error;default:return Ure.Info}}}),f.define(tNr.IAuthenticationService,r),f.define(UD.ILogService,new hi.SyncDescriptor(UD.LogServiceImpl,[[d||new UD.ConsoleLog(void 0,UD.LogLevel.Trace)]])),f.define(Y4e.IIgnoreService,t.ignoreService||new Y4e.NullIgnoreService),f.define(K3i.ITelemetryService,new hi.SyncDescriptor(gvt,[new XDr(c)])),f.define(Q4.IConfigurationService,new hi.SyncDescriptor(hvt,[t.configOverrides??new Map])),f.define(J4e.IExperimentationService,new hi.SyncDescriptor(Qre,[t.waitForTreatmentVariables])),f.define(nNr.IEndpointProvider,t.endpointProvider),f.define(rNr.ICAPIClientService,t.capiClientService||new hi.SyncDescriptor(H3i.CAPIClientImpl)),f.define(oNr.IFetcherService,new hi.SyncDescriptor(mvt,[e])),f.define(d3i.ICompletionsTelemetryService,new hi.SyncDescriptor(d3i.CompletionsTelemetryServiceBridge)),f.define(D3i.ICompletionsRuntimeModeService,D3i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(y3i.ICompletionsCacheService,new y3i.CompletionsCache);let h=new xv.InMemoryConfigProvider(new xv.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(xv.ICompletionsConfigProvider,h),f.define(v3i.ICompletionsLastGhostText,new v3i.LastGhostText),f.define(_3i.ICompletionsCurrentGhostText,new _3i.CurrentGhostText),f.define(WDr.ICompletionsSpeculativeRequestCache,new WDr.SpeculativeRequestCache),f.define(cEc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(xv.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(f3i.ICompletionsExtensionStatus,new f3i.CopilotExtensionStatus),f.define(nEc.ICompletionsFeaturesService,new hi.SyncDescriptor(rEc.Features)),f.define(tEc.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(S3i.ICompletionsStatusReporter,new class extends S3i.StatusReporter{didChange(m){n.didChange(m)}}),f.define(p3i.ICompletionsCopilotTokenManager,new hi.SyncDescriptor(p3i.CopilotTokenManagerImpl,[!1])),f.define(P3i.ICompletionsTextDocumentManagerService,new hi.SyncDescriptor(class extends P3i.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(g3i.ICompletionsFileReaderService,new hi.SyncDescriptor(g3i.FileReader)),f.define(E3i.ICompletionsBlockModeConfig,new hi.SyncDescriptor(E3i.ConfigBlockModeConfig)),f.define(R3i.ICompletionsTelemetryUserConfigService,new hi.SyncDescriptor(R3i.TelemetryUserConfig)),f.define(w3i.ICompletionsRecentEditsProviderService,new hi.SyncDescriptor(w3i.FullRecentEditsProvider,[void 0])),f.define(h3i.ICompletionsNotifierService,new hi.SyncDescriptor(h3i.CompletionNotifier)),f.define(C3i.ICompletionsOpenAIFetcherService,new hi.SyncDescriptor(C3i.LiveOpenAIFetcher)),f.define(OEc.ICompletionsFetchService,new hi.SyncDescriptor(BEc.CompletionsFetchService)),f.define(b3i.ICompletionsModelManagerService,new hi.SyncDescriptor(b3i.AvailableModelsManager,[!0])),f.define(A3i.ICompletionsAsyncManagerService,new hi.SyncDescriptor(A3i.AsyncCompletionManager)),f.define(I3i.ICompletionsContextProviderBridgeService,new hi.SyncDescriptor(I3i.ContextProviderBridge)),f.define(m3i.ICompletionsUserErrorNotifierService,new hi.SyncDescriptor(m3i.UserErrorNotifier)),f.define(uEc.ICompletionsRelatedFilesProviderService,new hi.SyncDescriptor(lEc.CompositeRelatedFilesProvider)),f.define(iEc.ICompletionsFileSystemService,new sEc.LocalFileSystem),f.define(z4e.ICompletionsContextProviderRegistryService,new hi.SyncDescriptor(z4e.CachedContextProviderRegistry,[z4e.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(k3i.ICompletionsPromiseQueueService,new k3i.PromiseQueue),f.define(eEc.ICompletionsCitationManager,new class{register(){return Avt.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(x3i.ICompletionsContextProviderService,new x3i.ContextProviderStatistics),f.define(T3i.ICompletionsPromptFactoryService,new hi.SyncDescriptor(T3i.CompletionsPromptFactory)),f.define(aEc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(z4e.ICompletionsDefaultContextProviders,new z4e.DefaultContextProvidersContainer),f.define(Fre.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=K4e.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?Fre.OperatingSystem.Macintosh:process.platform==="win32"?Fre.OperatingSystem.Windows:Fre.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return xv.BuildInfo.isProduction()}isPreRelease(){return xv.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return xv.BuildInfo.getBuildType()===xv.BuildType.DEV?"dev":"prod"}getVersion(){return xv.BuildInfo.getVersion()}getBuild(){return xv.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new Fre.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new Fre.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(iNr.ILanguageContextProviderService,t.languageContextProvider??new $3i.NullLanguageContextProviderService),f.define(V3i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(W3i.TestLanguageDiagnosticsService)),f.define(z3i.IRequestLogger,new hi.SyncDescriptor(Y3i.NullRequestLogger)),f.seal()}a(zEc,"setupCompletionServices")});function Ft(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 t1=_e(()=>{p();a(Ft,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var RAe,Rvt=_e(()=>{p();RAe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return RAe=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 T6(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var sBe,PAe=_e(()=>{p();a(T6,"isAbortError");sBe=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 dr,uh,uy,S$,kAe,DAe,NAe,MAe,OAe,BAe,LAe,FAe,UAe,wf=_e(()=>{p();PAe();dr=class extends Error{static{a(this,"AnthropicError")}},uh=class t extends dr{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 S$({message:n,cause:sBe(r)});let s=r,c=s?.error?.type;return e===400?new DAe(e,s,n,o,c):e===401?new NAe(e,s,n,o,c):e===403?new MAe(e,s,n,o,c):e===404?new OAe(e,s,n,o,c):e===409?new BAe(e,s,n,o,c):e===422?new LAe(e,s,n,o,c):e===429?new FAe(e,s,n,o,c):e>=500?new UAe(e,s,n,o,c):new t(e,s,n,o,c)}},uy=class extends uh{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},S$=class extends uh{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},kAe=class extends S${static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},DAe=class extends uh{static{a(this,"BadRequestError")}},NAe=class extends uh{static{a(this,"AuthenticationError")}},MAe=class extends uh{static{a(this,"PermissionDeniedError")}},OAe=class extends uh{static{a(this,"NotFoundError")}},BAe=class extends uh{static{a(this,"ConflictError")}},LAe=class extends uh{static{a(this,"UnprocessableEntityError")}},FAe=class extends uh{static{a(this,"RateLimitError")}},UAe=class extends uh{static{a(this,"InternalServerError")}}});function Pvt(t){return typeof t!="object"?{}:t??{}}function UNr(t){if(!t)return!0;for(let e in t)return!1;return!0}function o8i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Ovc,i8i,OE,FNr,s8i,kvt,q4=_e(()=>{p();wf();Ovc=/^[a-z][a-z0-9+.-]*:/i,i8i=a(t=>Ovc.test(t),"isAbsoluteURL"),OE=a(t=>(OE=Array.isArray,OE(t)),"isArray"),FNr=OE;a(Pvt,"maybeObj");a(UNr,"isEmptyObj");a(o8i,"hasOwn");s8i=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new dr(`${t} must be an integer`);if(e<0)throw new dr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),kvt=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var qD,QAe=_e(()=>{p();qD=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 bR,aBe=_e(()=>{p();bR="0.98.0"});function Bvc(){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 Fvc(){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 u8i,Lvc,a8i,c8i,l8i,cBe,Dvt=_e(()=>{p();aBe();u8i=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(Bvc,"getDetectedPlatform");Lvc=a(()=>{let t=Bvc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":bR,"X-Stainless-OS":c8i(Deno.build.os),"X-Stainless-Arch":a8i(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":bR,"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":bR,"X-Stainless-OS":c8i(globalThis.process.platform??"unknown"),"X-Stainless-Arch":a8i(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=Fvc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":bR,"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":bR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(Fvc,"getBrowserInfo");a8i=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),c8i=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"),cBe=a(()=>l8i??(l8i=Lvc()),"getPlatformHeaders")});function d8i(){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 QNr(...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 Nvt(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return QNr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function lBe(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 f8i(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 qAe=_e(()=>{p();a(d8i,"getDefaultFetch");a(QNr,"makeReadableStream");a(Nvt,"ReadableStreamFrom");a(lBe,"ReadableStreamToAsyncIterable");a(f8i,"CancelReadableStream")});var p8i,h8i=_e(()=>{p();p8i=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var qNr,jNr,HNr,m8i,GNr=_e(()=>{p();qNr="RFC3986",jNr=a(t=>String(t),"default_formatter"),HNr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:jNr},m8i="RFC1738"});function A8i(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function VNr(t,e){if(OE(t)){let r=[];for(let n=0;n{p();GNr();q4();Mvt=a((t,e)=>(Mvt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),Mvt(t,e)),"has"),j4=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),$Nr=1024,g8i=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=$Nr?s.slice(l,l+$Nr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===m8i&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=j4[h];continue}if(h<2048){d[d.length]=j4[192|h>>6]+j4[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=j4[224|h>>12]+j4[128|h>>6&63]+j4[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=j4[240|h>>18]+j4[128|h>>12&63]+j4[128|h>>6&63]+j4[128|h&63]}c+=d.join("")}return c},"encode");a(A8i,"is_buffer");a(VNr,"maybe_map")});function qvc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function C8i(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(WNr))!==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(WNr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&OE(v)&&(v=VNr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,Em.encoder,E,"key",g):e;v=""}if(qvc(v)||A8i(v)){if(u){let N=y?e:u(e,Em.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,Em.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&OE(v))y&&u&&(v=VNr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(OE(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&&OE(v)&&v.length===1?P+"[]":P;if(o&&OE(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:Em.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Em.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Em.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Em.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Em.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Em.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Em.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Em.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Em.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Em.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Em.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Em.strictNullHandling}}function b8i(t,e={}){let r=t,n=jvc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):OE(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=_8i[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 _8i,v8i,E8i,Em,WNr,S8i=_e(()=>{p();y8i();GNr();q4();_8i={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},v8i=a(function(t,e){Array.prototype.push.apply(t,OE(e)?e:[e])},"push_to_array"),Em={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:g8i,encodeValuesOnly:!1,format:qNr,formatter:jNr,indices:!1,serializeDate(t){return(E8i??(E8i=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(qvc,"is_non_nullish_primitive");WNr={};a(C8i,"inner_stringify");a(jvc,"normalize_stringify_options");a(b8i,"stringify")});function T8i(t){return b8i(t,{arrayFormat:"brackets"})}var zNr=_e(()=>{p();S8i();a(T8i,"stringifyQuery")});function Bvt(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new jc(`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 jc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Lvt(t,e){let r=await $vc(t),n;try{n=JSON.parse(r)}catch{throw new jc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,r1(r),e)}if(!n.access_token)throw new jc(`Token endpoint response missing access_token: ${JSON.stringify(r1(n))}`,t.status,r1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new jc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,r1(n),e);return n}function r1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=YNr?t:t.slice(0,YNr)+`... <${t.length-YNr} more chars>`}return JSON.stringify(r1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))Gvc.has(r)&&(e[r]=n);return e}return null}async function Fvt(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 jc(`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 jc(`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 Uvt(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 $vc(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>I8i){let l=I8i-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 x8i,w8i,Ovt,qre,R8i,P8i,jAe,k8i,I8i,YNr,Gvc,jc,HAe=_e(()=>{p();wf();x8i="urn:ietf:params:oauth:grant-type:jwt-bearer",w8i="refresh_token",Ovt="/v1/oauth/token",qre="oauth-2025-04-20",R8i="oidc-federation-2026-04-01",P8i=120,jAe=30,k8i=5,I8i=1<<20;a(Bvt,"requireSecureTokenEndpoint");a(Lvt,"parseTokenResponse");YNr=2e3,Gvc=new Set(["error","error_description","error_uri"]);a(r1,"redactSensitive");a(Fvt,"checkCredentialsFileSafety");a(Uvt,"writeCredentialsFileAtomic");a($vc,"readLimitedText");jc=class extends dr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function jD(){return Math.floor(Date.now()/1e3)}var uBe=_e(()=>{p();a(jD,"nowAsSeconds")});var Qvt,D8i=_e(()=>{p();HAe();uBe();Qvt=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-jD();return n>P8i?r.token:n>jAe?(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||jD()-this.lastAdvisoryError{this.lastAdvisoryError=jD(),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 ma,dBe=_e(()=>{p();ma=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 O8i(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 GAe(t){let e;return(N8i??(e=new globalThis.TextEncoder,N8i=e.encode.bind(e)))(t)}function KNr(t){let e;return(M8i??(e=new globalThis.TextDecoder,M8i=e.decode.bind(e)))(t)}var N8i,M8i,qvt=_e(()=>{p();a(O8i,"concatBytes");a(GAe,"encodeUTF8");a(KNr,"decodeUTF8")});var B8i=_e(()=>{p();wf();qvt()});function fBe(){}function jvt(t,e,r){return!e||Hvt[t]>Hvt[r]?fBe:e[t].bind(e)}function ll(t){let e=t.logger,r=t.logLevel??"off";if(!e)return Vvc;let n=L8i.get(e);if(n&&n[0]===r)return n[1];let o={error:jvt("error",e,r),warn:jvt("warn",e,r),info:jvt("info",e,r),debug:jvt("debug",e,r)};return L8i.set(e,[r,o]),o}var Hvt,JNr,Vvc,L8i,I6,x6=_e(()=>{p();q4();Hvt={off:0,error:200,warn:300,info:400,debug:500},JNr=a((t,e,r)=>{if(t){if(o8i(Hvt,t))return t;ll(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Hvt))}`)}},"parseLogLevel");a(fBe,"noop");a(jvt,"makeLogFn");Vvc={error:fBe,warn:fBe,info:fBe,debug:fBe},L8i=new WeakMap;a(ll,"loggerFor");I6=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 ZNr=_e(()=>{p();q4();B8i();dBe();x6();Rvt();QAe();zNr()});function F8i(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(!Wvc.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var Gvt,Wvc,U8i,Q8i,XNr,zvc,q8i,eMr=_e(()=>{p();Dvt();ZNr();Gvt="1.0",Wvc=/^[A-Za-z0-9_.-]+$/;a(F8i,"validateProfileName");U8i=a(async t=>{var e,r;let n=await XNr();if(n===null)return null;let o=t??await q8i();if(o===null)return null;F8i(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=ma("ANTHROPIC_ORGANIZATION_ID"),m=ma("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=ma("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:ma("ANTHROPIC_WORKSPACE_ID"),base_url:ma("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:ma("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:ma("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=ma("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=ma("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=ma("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=ma("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=ma("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=ma("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=ma("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),Q8i=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await XNr();if(!r)return null;let n=e??await q8i();return n?(F8i(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),XNr=a(async()=>{if(!zvc())return null;let t=await import("node:path"),e=ma("ANTHROPIC_CONFIG_DIR");if(e)return e;if(cBe()["X-Stainless-OS"]==="Windows"){let s=ma("APPDATA");if(s)return t.join(s,"Anthropic");let c=ma("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=ma("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=ma("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),zvc=a(()=>{let t=cBe()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),q8i=a(async()=>{let t=await XNr();if(!t)return null;let e=ma("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 tMr(t){if(!t)throw new dr("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 dr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new dr(`Identity token file at ${t} is empty`);return n}}function j8i(t){if(!t)throw new dr("Identity token value is empty");return()=>t}var H8i=_e(()=>{p();wf();a(tMr,"identityTokenFromFile");a(j8i,"identityTokenFromValue")});function G8i(t){return async()=>{Bvt(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new jc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:x8i,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}${Ovt}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${qre},${R8i}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${bR} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new jc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=r1(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 jc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Lvt(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new jc(`Token endpoint response missing required fields: ${JSON.stringify(r1(c))}`,o.status,r1(c),s);return{token:c.access_token,expiresAt:jD()+l}}}var $8i=_e(()=>{p();HAe();uBe();aBe();a(G8i,"oidcFederationProvider")});function V8i(t){return async e=>{let r=await import("node:fs");await Fvt(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new jc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new jc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new jc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||jD()"");throw new jc(`User OAuth refresh failed (HTTP ${f.status}): ${r1(E)}`,f.status,r1(E),h)}let m=await Lvt(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new jc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(r1(m))}`,f.status,r1(m),h);let A=jD()+g,y=m.refresh_token||l;return await Uvt(t.credentialsPath,{...o,version:Gvt,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var W8i=_e(()=>{p();eMr();HAe();uBe();aBe();a(V8i,"userOAuthProvider")});function rMr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=Yvc(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 z8i(t,e){let r=await U8i(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 Q8i(n,e)??void 0}};return rMr(s,t)}function Yvc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=Kvc(o);if(!s)throw new jc("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 jc("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 jc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=G8i({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?Jvc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new jc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return V8i({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 jc(`authentication.type "${o}" is not a known authentication type`)}}}function Kvc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new jc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new jc('identity_token.source "file" requires a non-empty path');return tMr(t.identity_token.path)}let e=ma("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return tMr(e);let r=ma("ANTHROPIC_IDENTITY_TOKEN");return r?j8i(r):null}function Jvc(t,e,r,n){return async o=>{let s=await import("node:fs");await Fvt(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||jD(){p();dBe();eMr();HAe();uBe();H8i();$8i();W8i();a(rMr,"resolveCredentialsFromConfig");a(z8i,"defaultCredentials");a(Yvc,"buildProvider");a(Kvc,"resolveIdentityTokenProvider");a(Jvc,"cachedExchangeProvider")});function Zvc(t,e){for(let o=e??0;o{p();t1();qvt();w6=class{static{a(this,"LineDecoder")}constructor(){zT.set(this,void 0),YT.set(this,void 0),Ft(this,zT,new Uint8Array,"f"),Ft(this,YT,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?GAe(e):e;Ft(this,zT,O8i([xe(this,zT,"f"),r]),"f");let n=[],o;for(;(o=Zvc(xe(this,zT,"f"),xe(this,YT,"f")))!=null;){if(o.carriage&&xe(this,YT,"f")==null){Ft(this,YT,o.index,"f");continue}if(xe(this,YT,"f")!=null&&(o.index!==xe(this,YT,"f")+1||o.carriage)){n.push(KNr(xe(this,zT,"f").subarray(0,xe(this,YT,"f")-1))),Ft(this,zT,xe(this,zT,"f").subarray(xe(this,YT,"f")),"f"),Ft(this,YT,null,"f");continue}let s=xe(this,YT,"f")!==null?o.preceding-1:o.preceding,c=KNr(xe(this,zT,"f").subarray(0,s));n.push(c),Ft(this,zT,xe(this,zT,"f").subarray(o.index),"f"),Ft(this,YT,null,"f")}return n}flush(){return xe(this,zT,"f").length?this.decode(` +`):[]}};zT=new WeakMap,YT=new WeakMap;w6.NEWLINE_CHARS=new Set([` +`,"\r"]);w6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(Zvc,"findNewlineIndex");a(K8i,"findDoubleNewlineIndex")});async function*Xvc(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new dr("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 dr("Attempted to iterate over a response with no body");let r=new iMr,n=new w6,o=lBe(t.body);for await(let s of eCc(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*eCc(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"?GAe(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=K8i(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function tCc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var pBe,H4,iMr,oMr=_e(()=>{p();t1();wf();qAe();nMr();qAe();PAe();q4();qvt();x6();wf();H4=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,pBe.set(this,void 0),this.controller=r,Ft(this,pBe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?ll(n):console;async function*c(){if(o)throw new dr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of Xvc(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=kvt(u.data)??u.data,f=d?.error?.type;throw new uh(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(T6(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 w6,u=lBe(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 dr("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(T6(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(pBe=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,pBe,"f")),new t(()=>o(r),this.controller,xe(this,pBe,"f"))]}toReadableStream(){let e=this,r;return QNr({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=GAe(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(Xvc,"_iterSSEMessages");a(eCc,"iterSSEChunks");iMr=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]=tCc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(tCc,"partition")});async function $vt(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return ll(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):H4.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 sMr(m,r)}return await r.text()})();return ll(t).debug(`[${n}] response parsed`,I6({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function sMr(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 aMr=_e(()=>{p();oMr();x6();a($vt,"defaultParseResponse");a(sMr,"addRequestID")});var hBe,jre,Vvt=_e(()=>{p();t1();aMr();jre=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=$vt){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,hBe.set(this,void 0),Ft(this,hBe,e,"f")}_thenUnwrap(e){return new t(xe(this,hBe,"f"),this.responsePromise,async(r,n)=>sMr(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,hBe,"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)}};hBe=new WeakMap});var Wvt,zvt,mBe,SR,ga,pd=_e(()=>{p();t1();wf();aMr();Vvt();q4();zvt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){Wvt.set(this,void 0),Ft(this,Wvt,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 dr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await xe(this,Wvt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(Wvt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},mBe=class extends jre{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await $vt(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},SR=class extends zvt{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:{...Pvt(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...Pvt(this.options.query),after_id:e}}:null}},ga=class extends zvt{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:{...Pvt(this.options.query),page:e}}:null}}});function Hre(t,e,r){return lMr(),new File(t,e??"unknown_file",r)}function gBe(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 nCc(t){let e=typeof t=="function"?t:t.fetch,r=J8i.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 J8i.set(e,n),n}var lMr,uMr,$Ae,J8i,iCc,oCc,cMr,VAe=_e(()=>{p();qAe();lMr=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(Hre,"makeFile");a(gBe,"getName");uMr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),$Ae=a(async(t,e,r=!0)=>({...t,body:await iCc(t.body,e,r)}),"multipartFormRequestOptions"),J8i=new WeakMap;a(nCc,"supportsFormData");iCc=a(async(t,e,r=!0)=>{if(!await nCc(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])=>cMr(n,o,s,r))),n},"createForm"),oCc=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),cMr=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,Hre([await r.blob()],gBe(r,n),o))}else if(uMr(r))t.append(e,Hre([await new Response(Nvt(r)).blob()],gBe(r,n)));else if(oCc(r))t.append(e,Hre([r],gBe(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>cMr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>cMr(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 Yvt(t,e,r){if(lMr(),t=await t,e||(e=gBe(t,!0)),sCc(t))return t instanceof File&&e==null&&r==null?t:Hre([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(aCc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),Hre(await dMr(o),e,r)}let n=await dMr(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 Hre(n,e,r)}async function dMr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(Z8i(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(uMr(t))for await(let r of t)e.push(...await dMr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${cCc(t)}`)}return e}function cCc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var Z8i,sCc,aCc,X8i=_e(()=>{p();VAe();VAe();Z8i=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"),sCc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&Z8i(t),"isFileLike"),aCc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(Yvt,"toFile");a(dMr,"getBytes");a(cCc,"propsForError")});var fMr=_e(()=>{p();X8i()});var e6i=_e(()=>{p()});var mi,Dl=_e(()=>{p();mi=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*uCc(t){if(!t)return;if(t6i 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():FNr(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=FNr(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 t6i,vt,mc=_e(()=>{p();q4();t6i=Symbol.for("brand.privateNullableHeaders");a(uCc,"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 uCc(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{[t6i]:!0,values:e,nulls:r}},"buildHeaders")});function Kvt(t){return typeof t=="object"&&t!==null&&ABe in t}function pMr(t,e){let r=new Set;if(t)for(let n of t)Kvt(n)&&r.add(n[ABe]);if(e){for(let n of e)if(Kvt(n)&&r.add(n[ABe]),Array.isArray(n.content))for(let o of n.content)Kvt(o)&&r.add(o[ABe])}return Array.from(r)}function Jvt(t,e){let r=pMr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function r6i(t){return Kvt(t)?{"x-stainless-helper":t[ABe]}:{}}var ABe,yBe=_e(()=>{p();ABe=Symbol("anthropic.sdk.stainlessHelper");a(Kvt,"wasCreatedByStainlessHelper");a(pMr,"collectStainlessHelpers");a(Jvt,"stainlessHelperHeader");a(r6i,"stainlessHelperHeaderFromFile")});function i6i(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var n6i,dCc,nr,Rf=_e(()=>{p();wf();a(i6i,"encodeURIPath");n6i=Object.freeze(Object.create(null)),dCc=a((t=i6i)=>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??n6i)??n6i)?.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 dr(`Path parameters result in path with invalid segments: ${s.map(m=>m.error).join(` `)} ${c} -${h}`)}return c},"path"),"createPathTagFunction"),nr=pTc(w9i)});var gye,yOr=me(()=>{p();Ml();pd();Ac();$Be();mye();Rf();gye=class extends mi{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",PR,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/files/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/files/${e}/content?beta=true`,{...n,headers:At([{"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(nr`/v1/files/${e}?beta=true`,{...n,headers:At([{"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",hye({body:o,...r,headers:At([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},I9i(o.file),r?.headers])},this._client))}}});var Aye,EOr=me(()=>{p();Ml();pd();Ac();Rf();Aye=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/models/${e}?beta=true`,{...n,headers:At([{...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",PR,{query:o,...r,headers:At([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var yye,_Or=me(()=>{p();Ml();pd();Ac();Rf();yye=class extends mi{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:At([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/user_profiles/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:At([{"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",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var k9i=I(Mvt=>{"use strict";p();Object.defineProperty(Mvt,"__esModule",{value:!0});Mvt.timingSafeEqual=void 0;function R9i(t,e=""){if(!t)throw new Error(e)}a(R9i,"assert");function ATc(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)),R9i(t instanceof DataView),R9i(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var yTc=rI&&rI.__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(rI,"__esModule",{value:!0});var T0=256,COr=(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&T0,l|=d&T0,l|=f&T0,l|=h&T0;if(c>>4,l|=u&T0,l|=d&T0),c>>2,l|=f&T0),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=T0;return r+=(42-e&e-44)>>>8&-T0+e-43+62,r+=(46-e&e-48)>>>8&-T0+e-47+63,r+=(47-e&e-58)>>>8&-T0+e-48+52,r+=(64-e&e-91)>>>8&-T0+e-65+0,r+=(96-e&e-123)>>>8&-T0+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})();rI.Coder=COr;var VBe=new COr;function ETc(t){return VBe.encode(t)}a(ETc,"encode");rI.encode=ETc;function _Tc(t){return VBe.decode(t)}a(_Tc,"decode");rI.decode=_Tc;var P9i=(function(t){yTc(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=T0;return n+=(44-r&r-46)>>>8&-T0+r-45+62,n+=(94-r&r-96)>>>8&-T0+r-95+63,n+=(47-r&r-58)>>>8&-T0+r-48+52,n+=(64-r&r-91)>>>8&-T0+r-65+0,n+=(96-r&r-123)>>>8&-T0+r-97+26,n},e})(COr);rI.URLSafeCoder=P9i;var D9i=new P9i;function CTc(t){return D9i.encode(t)}a(CTc,"encodeURLSafe");rI.encodeURLSafe=CTc;function vTc(t){return D9i.decode(t)}a(vTc,"decodeURLSafe");rI.decodeURLSafe=vTc;rI.encodedLength=function(t){return VBe.encodedLength(t)};rI.maxDecodedLength=function(t){return VBe.maxDecodedLength(t)};rI.decodedLength=function(t){return VBe.decodedLength(t)}});var O9i=I((M9i,Ovt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof Ovt=="object"&&typeof Ovt.exports=="object"?Ovt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(M9i,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,k,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++)k=h[D-2],L=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,k=h[D-15],B=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>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(Eye,"__esModule",{value:!0});Eye.Webhook=Eye.WebhookVerificationError=void 0;var bTc=k9i(),B9i=N9i(),STc=O9i(),L9i=300,vOr=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}},H$=class t extends vOr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};Eye.WebhookVerificationError=H$;var Bvt=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=B9i.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 H$("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,bTc.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new H$("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,${B9i.encode(STc.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new H$("Invalid Signature Headers");if(r-n>L9i)throw new H$("Message timestamp too old");if(n>r+L9i)throw new H$("Message timestamp too new");return new Date(n*1e3)}};Eye.Webhook=Bvt;Bvt.prefix="whsec_"});var U9i,_ye,bOr=me(()=>{p();Ml();U9i=ce(F9i(),1),_ye=class extends mi{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 U9i.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var Cye,SOr=me(()=>{p();Ml();pd();Ac();Rf();Cye=class extends mi{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/agents/${e}/versions?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var ane,TOr=me(()=>{p();Ml();SOr();SOr();pd();Ac();Rf();ane=class extends mi{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new Cye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(nr`/v1/agents/${e}?beta=true`,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/agents/${e}?beta=true`,{body:s,...n,headers:At([{"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",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/agents/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ane.Versions=Cye});function cne(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 Lvt=me(()=>{p();a(cne,"linkAbort")});function G$(t,e){return t instanceof lh&&t.status===e}function Q9i(t){return t instanceof lh&&typeof t.status=="number"&&t.status>=400&&t.status<500}function $$(t){return Q9i(t)&&!G$(t,408)&&!G$(t,409)&&!G$(t,429)}function q9i(t,e,r){return Math.min(e*2**t,r)}function IOr(t,e){return t+Math.random()*(e-t)}function j9i(t){return t*(1-Math.random()*.25)}var WBe=me(()=>{p();wf();a(G$,"isStatus");a(Q9i,"is4xx");a($$,"isFatal4xx");a(q9i,"backoff");a(IOr,"jitter");a(j9i,"applyJitter")});function Fvt(t,{authToken:e,helper:r}){if(!e)throw new dr(`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=At([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var xOr=me(()=>{p();wf();Ac();a(Fvt,"copyClientForHelper")});function PTc(t){return q9i(t,RTc,kTc)}function DTc(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${ZAe()}`:ZAe()}var vye,Uvt,DR,Qvt,qvt,jvt,zBe,YBe,bye,wTc,RTc,kTc,V$,Hvt=me(()=>{p();l1();wf();j6();lye();dvt();Lvt();Ac();WBe();xOr();WBe();wTc=999,RTc=1e3,kTc=6e4,V$=class{static{a(this,"WorkPoller")}constructor(e){vye.set(this,void 0),Uvt.set(this,!1),DR.set(this,void 0),Qvt.set(this,void 0),qvt.set(this,void 0),jvt.set(this,void 0),zBe.set(this,void 0),YBe.set(this,void 0),bye.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??DTc(),Lt(this,vye,Fvt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Lt(this,qvt,e.autoStop??!0,"f"),Lt(this,jvt,e.drain??!1,"f"),Lt(this,zBe,e.blockMs===void 0?wTc:e.blockMs,"f"),Lt(this,YBe,e.reclaimOlderThanMs??null,"f"),Lt(this,bye,e.requestOptions,"f"),Lt(this,DR,new AbortController,"f"),Lt(this,Qvt,cne(e.signal,ye(this,DR,"f")),"f")}get signal(){return ye(this,DR,"f").signal}abort(){ye(this,DR,"f").abort()}async*[(vye=new WeakMap,Uvt=new WeakMap,DR=new WeakMap,Qvt=new WeakMap,qvt=new WeakMap,jvt=new WeakMap,zBe=new WeakMap,YBe=new WeakMap,bye=new WeakMap,Symbol.asyncIterator)](){if(ye(this,Uvt,"f"))throw new dr("Cannot iterate over a consumed WorkPoller");Lt(this,Uvt,!0,"f");let e=dl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!ye(this,DR,"f").signal.aborted;){let n;try{n=await ye(this,vye,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...ye(this,zBe,"f")!==null?{block_ms:ye(this,zBe,"f")}:{},...ye(this,YBe,"f")!==null?{reclaim_older_than_ms:ye(this,YBe,"f")}:{}},{headers:At([ye(this,bye,"f")?.headers]),signal:ye(this,DR,"f").signal})}catch(o){if(ye(this,DR,"f").signal.aborted)return;if($$(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=j9i(PTc(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await YD(s,ye(this,DR,"f").signal);continue}if(r=0,n==null){if(ye(this,jvt,"f"))return;await YD(IOr(1e3,3e3),ye(this,DR,"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 ye(this,vye,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:At([ye(this,bye,"f")?.headers]),signal:ye(this,DR,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(ye(this,qvt,"f"))try{await ye(this,vye,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:At([ye(this,bye,"f")?.headers])})}catch(o){G$(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{ye(this,Qvt,"f").call(this)}}};a(PTc,"backoff");a(DTc,"defaultWorkerId")});var Sye,W$,Tye,Gvt,H9i=me(()=>{p();l1();Gvt=class{static{a(this,"AsyncQueue")}constructor(){Sye.set(this,[]),W$.set(this,[]),Tye.set(this,!1)}push(e){if(ye(this,Tye,"f"))return!1;let r=ye(this,W$,"f").shift();return r?r({done:!1,value:e}):ye(this,Sye,"f").push(e),!0}close(){if(!ye(this,Tye,"f"))for(Lt(this,Tye,!0,"f");ye(this,W$,"f").length>0;)ye(this,W$,"f").shift()({done:!0,value:void 0})}next(e){return ye(this,Sye,"f").length>0?Promise.resolve({done:!1,value:ye(this,Sye,"f").shift()}):ye(this,Tye,"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=ye(this,W$,"f").indexOf(n);s>=0&&ye(this,W$,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");ye(this,W$,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return ye(this,Sye,"f").shift()}};Sye=new WeakMap,W$=new WeakMap,Tye=new WeakMap});var Co,lne=me(()=>{p();Co=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 wOr(t){return"name"in t?t.name:t.mcp_server_name}function NTc(t){return t instanceof Co?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function G9i(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:NTc(n),isError:!0}}}var $9i=me(()=>{p();lne();a(wOr,"toolName");a(NTc,"toolErrorContent");a(G9i,"runRunnableTool")});function Z9i(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function UTc(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 QTc(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 _m,$vt,sy,Vvt,JBe,zvt,UE,Iye,rB,une,G6,ZBe,xye,Wvt,X9i,V9i,W9i,z9i,ROr,KBe,kOr,Y9i,eUi,MTc,K9i,OTc,BTc,LTc,J9i,FTc,z$,Yvt=me(()=>{p();l1();wf();j6();lye();WBe();Lvt();H9i();Ac();$9i();MTc="SessionToolRunner",K9i=500,OTc=1e4,BTc=12e4,LTc=3e4,J9i=3,FTc=6e4;a(Z9i,"isEndTurnIdle");z$=class{static{a(this,"SessionToolRunner")}constructor(e,r){_m.add(this),$vt.set(this,!1),sy.set(this,void 0),Vvt.set(this,void 0),JBe.set(this,void 0),zvt.set(this,void 0),UE.set(this,void 0),Iye.set(this,new Set),rB.set(this,new Set),une.set(this,new Gvt),G6.set(this,0),ZBe.set(this,null),xye.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??FTc,Lt(this,UE,dl(r.client),"f"),Lt(this,zvt,new Map(r.tools.map(n=>[wOr(n),n])),"f"),Lt(this,sy,new AbortController,"f"),Lt(this,Vvt,cne(r.signal,ye(this,sy,"f")),"f"),Lt(this,JBe,r.requestOptions,"f")}get signal(){return ye(this,sy,"f").signal}abort(){ye(this,sy,"f").abort()}async*[($vt=new WeakMap,sy=new WeakMap,Vvt=new WeakMap,JBe=new WeakMap,zvt=new WeakMap,UE=new WeakMap,Iye=new WeakMap,rB=new WeakMap,une=new WeakMap,G6=new WeakMap,ZBe=new WeakMap,xye=new WeakMap,_m=new WeakSet,Symbol.asyncIterator)](){if(ye(this,$vt,"f"))throw new dr("Cannot iterate over a consumed SessionToolRunner");Lt(this,$vt,!0,"f"),ye(this,UE,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=ye(this,_m,"m",X9i).call(this).catch(r=>{ye(this,sy,"f").signal.aborted||ye(this,UE,"f").error("stream loop failed",{error:String(r)}),ye(this,sy,"f").abort()});try{for(;;){let n=await ye(this,une,"f").next(ye(this,sy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=ye(this,une,"f").tryShift())!==void 0;)yield r}finally{ye(this,sy,"f").abort(),ye(this,_m,"m",KBe).call(this),await e;try{await ye(this,_m,"m",eUi).call(this)}catch(r){ye(this,UE,"f").warn("drain failed",{error:String(r)})}ye(this,une,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){ye(this,UE,"f").warn("tool.close failed",{tool:wOr(r),error:String(n)})}ye(this,Vvt,"f").call(this)}}};Wvt=a(function(){return{...ye(this,JBe,"f"),headers:At([{"x-stainless-helper":MTc},ye(this,JBe,"f")?.headers]),signal:ye(this,sy,"f").signal}},"_SessionToolRunner_requestOptions"),X9i=a(async function(){let e=ye(this,sy,"f"),r=K9i;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},ye(this,_m,"m",Wvt).call(this));await ye(this,_m,"m",V9i).call(this);for await(let o of n)if(r=K9i,await ye(this,_m,"m",z9i).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),$$(n))throw ye(this,UE,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;ye(this,UE,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await YD(r,e.signal),r=Math.min(r*2,OTc)}},"_SessionToolRunner_streamLoop"),V9i=a(async function(){let e=ye(this,sy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},ye(this,_m,"m",Wvt).call(this)))ye(this,_m,"m",W9i).call(this,s,r),n=Z9i(s)}catch(s){e.signal.throwIfAborted(),ye(this,UE,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)ye(this,Iye,"f").delete(c.id);return}let o=r.filter(s=>!ye(this,rB,"f").has(s.id));n&&o.length===0?ye(this,_m,"m",ROr).call(this):ye(this,_m,"m",KBe).call(this);for(let s of o)await ye(this,_m,"m",kOr).call(this,s)},"_SessionToolRunner_reconcile"),W9i=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(ye(this,Iye,"f").add(e.id),ye(this,rB,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?ye(this,rB,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&ye(this,rB,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),z9i=a(async function(e){switch(Z9i(e)?ye(this,_m,"m",ROr).call(this):ye(this,_m,"m",KBe).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return ye(this,Iye,"f").has(e.id)||(ye(this,Iye,"f").add(e.id),await ye(this,_m,"m",kOr).call(this,e)),!1;case"user.tool_result":return ye(this,rB,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return ye(this,rB,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return ye(this,UE,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),ye(this,sy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),ROr=a(function(){ye(this,_m,"m",KBe).call(this),!(this.maxIdleMs<=0)&&Lt(this,xye,setTimeout(()=>{ye(this,UE,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),ye(this,sy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),KBe=a(function(){ye(this,xye,"f")!==void 0&&(clearTimeout(ye(this,xye,"f")),Lt(this,xye,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),kOr=a(async function(e){var r,n;if(!ye(this,rB,"f").has(e.id)){ye(this,UE,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Lt(this,G6,(r=ye(this,G6,"f"),r++,r),"f");try{let o=ye(this,zvt,"f").get(e.name);if(!o){ye(this,UE,"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}),ye(this,une,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=cne(ye(this,sy,"f").signal,l),d=setTimeout(()=>l.abort(),BTc);try{let m=await G9i(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=UTc(e,c,QTc(s)),h=await ye(this,_m,"m",Y9i).call(this,f,e.id);ye(this,une,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{Lt(this,G6,(n=ye(this,G6,"f"),n--,n),"f"),ye(this,G6,"f")===0&&ye(this,ZBe,"f")?.call(this)}}},"_SessionToolRunner_execute"),Y9i=a(async function(e,r){let n=ye(this,sy,"f"),o;for(let s=0;sLt(this,ZBe,e,"f")),YD(LTc)]),Lt(this,ZBe,null,"f"),ye(this,G6,"f")>0&&ye(this,UE,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(UTc,"buildResultEvent");a(QTc,"toSessionContent")});var tUi=me(()=>{p();rOr()});function dne(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 rUi=me(()=>{p();POr();tUi();a(dne,"betaTool")});function wye(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var DOr=me(()=>{p();a(wye,"promiseWithResolvers")});async function jTc(t){try{return await nI.realpath(t)}catch{return t}}async function HTc(t){let e=[],r=t;for(;;){let n;try{n=await nI.realpath(r)}catch{let o=!1;try{o=(await nI.lstat(r)).isSymbolicLink()}catch{}if(o){r=Cm.resolve(Cm.dirname(r),await nI.readlink(r));continue}let s=Cm.dirname(r);if(s===r)return t;e.push(Cm.basename(r)),r=s;continue}return e.length?Cm.join(n,...e.reverse()):n}}async function iUi(t,e,r){let n=r?.allowOutside??!1;if(Cm.isAbsolute(e)){if(!n)throw new Co(`absolute path ${JSON.stringify(e)} not permitted`);return Cm.resolve(e)}let o=await jTc(Cm.resolve(t)),s=Cm.resolve(o,e);if(n)return s;let c=await HTc(s),l=o.endsWith(Cm.sep)?o:o+Cm.sep;if(c!==o&&!c.startsWith(l))throw new Co(`path ${JSON.stringify(e)} escapes workdir`);return c}async function NOr(t,e){let r=Cm.dirname(t),n=Cm.join(r,`.tmp-${process.pid}-${(0,nUi.randomUUID)()}`),o;try{o=await nI.open(n,"wx",qTc),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await nI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await nI.unlink(n).catch(()=>{}),s}}function eLe(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 nI,Cm,nUi,XBe,qTc,MOr=me(()=>{p();nI=ce(require("node:fs/promises"),1),Cm=ce(require("node:path"),1),nUi=require("node:crypto");lne();XBe=493,qTc=420;a(jTc,"realpathOrSelf");a(HTc,"canonicalize");a(iUi,"confineToRoot");a(NOr,"atomicWriteFile");a(eLe,"fsErrorMessage")});async function uUi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=dl(e),o=await e.beta.sessions.retrieve(r),s=ay.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await BOr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=ay.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=ay.resolve(s,f);if(h!==s&&!h.startsWith(s+ay.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 d1.rm(h,{recursive:!0,force:!0}),await d1.mkdir(h,{recursive:!0,mode:XBe}),c.push(h),await LOr(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 d1.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 BOr(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 dr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function $Tc(t){for(let e of t.split(` -`)){let r=e.trim();if(r&&(ay.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new dr(`refusing to extract unsafe archive member: ${r}`)}}function VTc(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 dr("refusing to extract archive with symlink/hardlink/device member")}}async function OOr(t,e){try{let{stdout:r}=await GTc(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new dr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function WTc(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 LOr(t,e){let r=ay.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new dr("skill download response had no body");await(0,lUi.pipeline)(cUi.Readable.fromWeb(t.body),oUi.createWriteStream(r));let n=ay.join(ay.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await zTc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await OOr(c,s?["-Z1",r]:["-tf",r]);$Tc(l),VTc(await OOr(c,s?["-Z",r]:["-tvf",r]));let u=WTc(l);await d1.mkdir(n,{recursive:!0,mode:XBe}),await OOr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?ay.join(n,u):n;for(let f of await d1.readdir(d))await d1.rename(ay.join(d,f),ay.join(e,f))}finally{await d1.rm(r,{force:!0}),await d1.rm(n,{recursive:!0,force:!0})}}async function zTc(t,e){let r=await d1.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 d1,oUi,ay,sUi,aUi,cUi,lUi,GTc,dUi=me(()=>{p();d1=ce(require("node:fs/promises"),1),oUi=ce(require("node:fs"),1),ay=ce(require("node:path"),1),sUi=require("node:child_process"),aUi=require("node:util"),cUi=require("node:stream"),lUi=require("node:stream/promises");wf();j6();MOr();GTc=(0,aUi.promisify)(sUi.execFile);a(uUi,"setupSkills");a(BOr,"resolveSkillVersion");a($Tc,"assertSafeMemberNames");a(VTc,"assertNoSpecialMembers");a(OOr,"runArchiveTool");a(WTc,"archiveTopDir");a(LOr,"extractSkillArchive");a(zTc,"readHead")});var SUi={};wi(SUi,{BashSession:()=>Jvt,betaAgentToolset20260401:()=>XTc,betaBashTool:()=>yUi,betaEditTool:()=>CUi,betaGlobTool:()=>vUi,betaGrepTool:()=>bUi,betaReadTool:()=>EUi,betaWriteTool:()=>_Ui,extractSkillArchive:()=>LOr,resolvePath:()=>Rye,resolveSkillVersion:()=>BOr,setupSkills:()=>uUi});function XTc(t){return[yUi(t),EUi(t),_Ui(t),CUi(t),vUi(t),bUi(t)]}function Rye(t,e){return iUi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function eIc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function yUi(t){let e,r=Promise.resolve();return dne({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=wye();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new Co("bash: command is required")}e??(e=new Jvt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??AUi,signal:c?.signal});if(f!==0)throw new Co(d||`exit ${f}`);return d}catch(d){throw d instanceof Co?d:(e.close(),e=void 0,new Co(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function EUi(t){return dne({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 Co("read: file_path is required");let n=await Rye(t,e),o;try{let f=await QE.stat(n);if(!f.isFile())throw new Co(`read: ${e} is not a regular file`);if(f.size>UOr)throw new Co(`read: ${e} is ${f.size} bytes, exceeds ${UOr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await QE.readFile(n,"utf8")}catch(f){throw f instanceof Co?f:new Co(`read: ${eLe(f,e)}`)}if(!r)return o;if(r.length!==2)throw new Co("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` +${h}`)}return c},"path"),"createPathTagFunction"),nr=dCc(i6i)});var WAe,hMr=_e(()=>{p();Dl();pd();mc();yBe();VAe();Rf();WAe=class extends mi{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",SR,{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(nr`/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(nr`/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(nr`/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",$Ae({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r6i(o.file),r?.headers])},this._client))}}});var zAe,mMr=_e(()=>{p();Dl();pd();mc();Rf();zAe=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/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",SR,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var YAe,gMr=_e(()=>{p();Dl();pd();mc();Rf();YAe=class extends mi{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(nr`/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(nr`/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",ga,{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(nr`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var s6i=I(Zvt=>{"use strict";p();Object.defineProperty(Zvt,"__esModule",{value:!0});Zvt.timingSafeEqual=void 0;function o6i(t,e=""){if(!t)throw new Error(e)}a(o6i,"assert");function mCc(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)),o6i(t instanceof DataView),o6i(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var gCc=KT&&KT.__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(KT,"__esModule",{value:!0});var T0=256,AMr=(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&T0,l|=d&T0,l|=f&T0,l|=h&T0;if(c>>4,l|=u&T0,l|=d&T0),c>>2,l|=f&T0),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=T0;return r+=(42-e&e-44)>>>8&-T0+e-43+62,r+=(46-e&e-48)>>>8&-T0+e-47+63,r+=(47-e&e-58)>>>8&-T0+e-48+52,r+=(64-e&e-91)>>>8&-T0+e-65+0,r+=(96-e&e-123)>>>8&-T0+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})();KT.Coder=AMr;var EBe=new AMr;function ACc(t){return EBe.encode(t)}a(ACc,"encode");KT.encode=ACc;function yCc(t){return EBe.decode(t)}a(yCc,"decode");KT.decode=yCc;var a6i=(function(t){gCc(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=T0;return n+=(44-r&r-46)>>>8&-T0+r-45+62,n+=(94-r&r-96)>>>8&-T0+r-95+63,n+=(47-r&r-58)>>>8&-T0+r-48+52,n+=(64-r&r-91)>>>8&-T0+r-65+0,n+=(96-r&r-123)>>>8&-T0+r-97+26,n},e})(AMr);KT.URLSafeCoder=a6i;var c6i=new a6i;function ECc(t){return c6i.encode(t)}a(ECc,"encodeURLSafe");KT.encodeURLSafe=ECc;function _Cc(t){return c6i.decode(t)}a(_Cc,"decodeURLSafe");KT.decodeURLSafe=_Cc;KT.encodedLength=function(t){return EBe.encodedLength(t)};KT.maxDecodedLength=function(t){return EBe.maxDecodedLength(t)};KT.decodedLength=function(t){return EBe.decodedLength(t)}});var d6i=I((u6i,Xvt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof Xvt=="object"&&typeof Xvt.exports=="object"?Xvt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(u6i,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(KAe,"__esModule",{value:!0});KAe.Webhook=KAe.WebhookVerificationError=void 0;var vCc=s6i(),f6i=l6i(),CCc=d6i(),p6i=300,yMr=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}},T$=class t extends yMr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};KAe.WebhookVerificationError=T$;var eCt=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=f6i.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 T$("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,vCc.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new T$("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,${f6i.encode(CCc.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new T$("Invalid Signature Headers");if(r-n>p6i)throw new T$("Message timestamp too old");if(n>r+p6i)throw new T$("Message timestamp too new");return new Date(n*1e3)}};KAe.Webhook=eCt;eCt.prefix="whsec_"});var m6i,JAe,EMr=_e(()=>{p();Dl();m6i=he(h6i(),1),JAe=class extends mi{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 m6i.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var ZAe,_Mr=_e(()=>{p();Dl();pd();mc();Rf();ZAe=class extends mi{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/agents/${e}/versions?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Gre,vMr=_e(()=>{p();Dl();_Mr();_Mr();pd();mc();Rf();Gre=class extends mi{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new ZAe(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(nr`/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(nr`/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",ga,{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(nr`/v1/agents/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Gre.Versions=ZAe});function $re(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 tCt=_e(()=>{p();a($re,"linkAbort")});function I$(t,e){return t instanceof uh&&t.status===e}function g6i(t){return t instanceof uh&&typeof t.status=="number"&&t.status>=400&&t.status<500}function x$(t){return g6i(t)&&!I$(t,408)&&!I$(t,409)&&!I$(t,429)}function A6i(t,e,r){return Math.min(e*2**t,r)}function CMr(t,e){return t+Math.random()*(e-t)}function y6i(t){return t*(1-Math.random()*.25)}var _Be=_e(()=>{p();wf();a(I$,"isStatus");a(g6i,"is4xx");a(x$,"isFatal4xx");a(A6i,"backoff");a(CMr,"jitter");a(y6i,"applyJitter")});function rCt(t,{authToken:e,helper:r}){if(!e)throw new dr(`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 bMr=_e(()=>{p();wf();mc();a(rCt,"copyClientForHelper")});function RCc(t){return A6i(t,xCc,wCc)}function PCc(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${RAe()}`:RAe()}var XAe,nCt,TR,iCt,oCt,sCt,vBe,CBe,eye,ICc,xCc,wCc,w$,aCt=_e(()=>{p();t1();wf();x6();QAe();Rvt();tCt();mc();_Be();bMr();_Be();ICc=999,xCc=1e3,wCc=6e4,w$=class{static{a(this,"WorkPoller")}constructor(e){XAe.set(this,void 0),nCt.set(this,!1),TR.set(this,void 0),iCt.set(this,void 0),oCt.set(this,void 0),sCt.set(this,void 0),vBe.set(this,void 0),CBe.set(this,void 0),eye.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??PCc(),Ft(this,XAe,rCt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Ft(this,oCt,e.autoStop??!0,"f"),Ft(this,sCt,e.drain??!1,"f"),Ft(this,vBe,e.blockMs===void 0?ICc:e.blockMs,"f"),Ft(this,CBe,e.reclaimOlderThanMs??null,"f"),Ft(this,eye,e.requestOptions,"f"),Ft(this,TR,new AbortController,"f"),Ft(this,iCt,$re(e.signal,xe(this,TR,"f")),"f")}get signal(){return xe(this,TR,"f").signal}abort(){xe(this,TR,"f").abort()}async*[(XAe=new WeakMap,nCt=new WeakMap,TR=new WeakMap,iCt=new WeakMap,oCt=new WeakMap,sCt=new WeakMap,vBe=new WeakMap,CBe=new WeakMap,eye=new WeakMap,Symbol.asyncIterator)](){if(xe(this,nCt,"f"))throw new dr("Cannot iterate over a consumed WorkPoller");Ft(this,nCt,!0,"f");let e=ll(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,TR,"f").signal.aborted;){let n;try{n=await xe(this,XAe,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,vBe,"f")!==null?{block_ms:xe(this,vBe,"f")}:{},...xe(this,CBe,"f")!==null?{reclaim_older_than_ms:xe(this,CBe,"f")}:{}},{headers:vt([xe(this,eye,"f")?.headers]),signal:xe(this,TR,"f").signal})}catch(o){if(xe(this,TR,"f").signal.aborted)return;if(x$(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=y6i(RCc(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await qD(s,xe(this,TR,"f").signal);continue}if(r=0,n==null){if(xe(this,sCt,"f"))return;await qD(CMr(1e3,3e3),xe(this,TR,"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,XAe,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,eye,"f")?.headers]),signal:xe(this,TR,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,oCt,"f"))try{await xe(this,XAe,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,eye,"f")?.headers])})}catch(o){I$(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,iCt,"f").call(this)}}};a(RCc,"backoff");a(PCc,"defaultWorkerId")});var tye,R$,rye,cCt,E6i=_e(()=>{p();t1();cCt=class{static{a(this,"AsyncQueue")}constructor(){tye.set(this,[]),R$.set(this,[]),rye.set(this,!1)}push(e){if(xe(this,rye,"f"))return!1;let r=xe(this,R$,"f").shift();return r?r({done:!1,value:e}):xe(this,tye,"f").push(e),!0}close(){if(!xe(this,rye,"f"))for(Ft(this,rye,!0,"f");xe(this,R$,"f").length>0;)xe(this,R$,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,tye,"f").length>0?Promise.resolve({done:!1,value:xe(this,tye,"f").shift()}):xe(this,rye,"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,R$,"f").indexOf(n);s>=0&&xe(this,R$,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,R$,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,tye,"f").shift()}};tye=new WeakMap,R$=new WeakMap,rye=new WeakMap});var _o,Vre=_e(()=>{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 SMr(t){return"name"in t?t.name:t.mcp_server_name}function kCc(t){return t instanceof _o?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function _6i(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:kCc(n),isError:!0}}}var v6i=_e(()=>{p();Vre();a(SMr,"toolName");a(kCc,"toolErrorContent");a(_6i,"runRunnableTool")});function w6i(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function LCc(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 FCc(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 _m,lCt,dy,uCt,SBe,fCt,BE,nye,G4,Wre,R6,TBe,iye,dCt,R6i,C6i,b6i,S6i,TMr,bBe,IMr,T6i,P6i,DCc,I6i,NCc,MCc,OCc,x6i,BCc,P$,pCt=_e(()=>{p();t1();wf();x6();QAe();_Be();tCt();E6i();mc();v6i();DCc="SessionToolRunner",I6i=500,NCc=1e4,MCc=12e4,OCc=3e4,x6i=3,BCc=6e4;a(w6i,"isEndTurnIdle");P$=class{static{a(this,"SessionToolRunner")}constructor(e,r){_m.add(this),lCt.set(this,!1),dy.set(this,void 0),uCt.set(this,void 0),SBe.set(this,void 0),fCt.set(this,void 0),BE.set(this,void 0),nye.set(this,new Set),G4.set(this,new Set),Wre.set(this,new cCt),R6.set(this,0),TBe.set(this,null),iye.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??BCc,Ft(this,BE,ll(r.client),"f"),Ft(this,fCt,new Map(r.tools.map(n=>[SMr(n),n])),"f"),Ft(this,dy,new AbortController,"f"),Ft(this,uCt,$re(r.signal,xe(this,dy,"f")),"f"),Ft(this,SBe,r.requestOptions,"f")}get signal(){return xe(this,dy,"f").signal}abort(){xe(this,dy,"f").abort()}async*[(lCt=new WeakMap,dy=new WeakMap,uCt=new WeakMap,SBe=new WeakMap,fCt=new WeakMap,BE=new WeakMap,nye=new WeakMap,G4=new WeakMap,Wre=new WeakMap,R6=new WeakMap,TBe=new WeakMap,iye=new WeakMap,_m=new WeakSet,Symbol.asyncIterator)](){if(xe(this,lCt,"f"))throw new dr("Cannot iterate over a consumed SessionToolRunner");Ft(this,lCt,!0,"f"),xe(this,BE,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,_m,"m",R6i).call(this).catch(r=>{xe(this,dy,"f").signal.aborted||xe(this,BE,"f").error("stream loop failed",{error:String(r)}),xe(this,dy,"f").abort()});try{for(;;){let n=await xe(this,Wre,"f").next(xe(this,dy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,Wre,"f").tryShift())!==void 0;)yield r}finally{xe(this,dy,"f").abort(),xe(this,_m,"m",bBe).call(this),await e;try{await xe(this,_m,"m",P6i).call(this)}catch(r){xe(this,BE,"f").warn("drain failed",{error:String(r)})}xe(this,Wre,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,BE,"f").warn("tool.close failed",{tool:SMr(r),error:String(n)})}xe(this,uCt,"f").call(this)}}};dCt=a(function(){return{...xe(this,SBe,"f"),headers:vt([{"x-stainless-helper":DCc},xe(this,SBe,"f")?.headers]),signal:xe(this,dy,"f").signal}},"_SessionToolRunner_requestOptions"),R6i=a(async function(){let e=xe(this,dy,"f"),r=I6i;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,_m,"m",dCt).call(this));await xe(this,_m,"m",C6i).call(this);for await(let o of n)if(r=I6i,await xe(this,_m,"m",S6i).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),x$(n))throw xe(this,BE,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,BE,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await qD(r,e.signal),r=Math.min(r*2,NCc)}},"_SessionToolRunner_streamLoop"),C6i=a(async function(){let e=xe(this,dy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,_m,"m",dCt).call(this)))xe(this,_m,"m",b6i).call(this,s,r),n=w6i(s)}catch(s){e.signal.throwIfAborted(),xe(this,BE,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,nye,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,G4,"f").has(s.id));n&&o.length===0?xe(this,_m,"m",TMr).call(this):xe(this,_m,"m",bBe).call(this);for(let s of o)await xe(this,_m,"m",IMr).call(this,s)},"_SessionToolRunner_reconcile"),b6i=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,nye,"f").add(e.id),xe(this,G4,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,G4,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,G4,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),S6i=a(async function(e){switch(w6i(e)?xe(this,_m,"m",TMr).call(this):xe(this,_m,"m",bBe).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,nye,"f").has(e.id)||(xe(this,nye,"f").add(e.id),await xe(this,_m,"m",IMr).call(this,e)),!1;case"user.tool_result":return xe(this,G4,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,G4,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,BE,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,dy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),TMr=a(function(){xe(this,_m,"m",bBe).call(this),!(this.maxIdleMs<=0)&&Ft(this,iye,setTimeout(()=>{xe(this,BE,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,dy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),bBe=a(function(){xe(this,iye,"f")!==void 0&&(clearTimeout(xe(this,iye,"f")),Ft(this,iye,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),IMr=a(async function(e){var r,n;if(!xe(this,G4,"f").has(e.id)){xe(this,BE,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ft(this,R6,(r=xe(this,R6,"f"),r++,r),"f");try{let o=xe(this,fCt,"f").get(e.name);if(!o){xe(this,BE,"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,Wre,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=$re(xe(this,dy,"f").signal,l),d=setTimeout(()=>l.abort(),MCc);try{let m=await _6i(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=LCc(e,c,FCc(s)),h=await xe(this,_m,"m",T6i).call(this,f,e.id);xe(this,Wre,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{Ft(this,R6,(n=xe(this,R6,"f"),n--,n),"f"),xe(this,R6,"f")===0&&xe(this,TBe,"f")?.call(this)}}},"_SessionToolRunner_execute"),T6i=a(async function(e,r){let n=xe(this,dy,"f"),o;for(let s=0;sFt(this,TBe,e,"f")),qD(OCc)]),Ft(this,TBe,null,"f"),xe(this,R6,"f")>0&&xe(this,BE,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(LCc,"buildResultEvent");a(FCc,"toSessionContent")});var k6i=_e(()=>{p();ZNr()});function zre(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 D6i=_e(()=>{p();xMr();k6i();a(zre,"betaTool")});function oye(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var wMr=_e(()=>{p();a(oye,"promiseWithResolvers")});async function QCc(t){try{return await JT.realpath(t)}catch{return t}}async function qCc(t){let e=[],r=t;for(;;){let n;try{n=await JT.realpath(r)}catch{let o=!1;try{o=(await JT.lstat(r)).isSymbolicLink()}catch{}if(o){r=vm.resolve(vm.dirname(r),await JT.readlink(r));continue}let s=vm.dirname(r);if(s===r)return t;e.push(vm.basename(r)),r=s;continue}return e.length?vm.join(n,...e.reverse()):n}}async function M6i(t,e,r){let n=r?.allowOutside??!1;if(vm.isAbsolute(e)){if(!n)throw new _o(`absolute path ${JSON.stringify(e)} not permitted`);return vm.resolve(e)}let o=await QCc(vm.resolve(t)),s=vm.resolve(o,e);if(n)return s;let c=await qCc(s),l=o.endsWith(vm.sep)?o:o+vm.sep;if(c!==o&&!c.startsWith(l))throw new _o(`path ${JSON.stringify(e)} escapes workdir`);return c}async function RMr(t,e){let r=vm.dirname(t),n=vm.join(r,`.tmp-${process.pid}-${(0,N6i.randomUUID)()}`),o;try{o=await JT.open(n,"wx",UCc),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await JT.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await JT.unlink(n).catch(()=>{}),s}}function xBe(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 JT,vm,N6i,IBe,UCc,PMr=_e(()=>{p();JT=he(require("node:fs/promises"),1),vm=he(require("node:path"),1),N6i=require("node:crypto");Vre();IBe=493,UCc=420;a(QCc,"realpathOrSelf");a(qCc,"canonicalize");a(M6i,"confineToRoot");a(RMr,"atomicWriteFile");a(xBe,"fsErrorMessage")});async function Q6i(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=ll(e),o=await e.beta.sessions.retrieve(r),s=fy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await DMr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=fy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=fy.resolve(s,f);if(h!==s&&!h.startsWith(s+fy.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 n1.rm(h,{recursive:!0,force:!0}),await n1.mkdir(h,{recursive:!0,mode:IBe}),c.push(h),await NMr(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 n1.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 DMr(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 dr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function HCc(t){for(let e of t.split(` +`)){let r=e.trim();if(r&&(fy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new dr(`refusing to extract unsafe archive member: ${r}`)}}function GCc(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 dr("refusing to extract archive with symlink/hardlink/device member")}}async function kMr(t,e){try{let{stdout:r}=await jCc(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new dr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function $Cc(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 NMr(t,e){let r=fy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new dr("skill download response had no body");await(0,U6i.pipeline)(F6i.Readable.fromWeb(t.body),O6i.createWriteStream(r));let n=fy.join(fy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await VCc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await kMr(c,s?["-Z1",r]:["-tf",r]);HCc(l),GCc(await kMr(c,s?["-Z",r]:["-tvf",r]));let u=$Cc(l);await n1.mkdir(n,{recursive:!0,mode:IBe}),await kMr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?fy.join(n,u):n;for(let f of await n1.readdir(d))await n1.rename(fy.join(d,f),fy.join(e,f))}finally{await n1.rm(r,{force:!0}),await n1.rm(n,{recursive:!0,force:!0})}}async function VCc(t,e){let r=await n1.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 n1,O6i,fy,B6i,L6i,F6i,U6i,jCc,q6i=_e(()=>{p();n1=he(require("node:fs/promises"),1),O6i=he(require("node:fs"),1),fy=he(require("node:path"),1),B6i=require("node:child_process"),L6i=require("node:util"),F6i=require("node:stream"),U6i=require("node:stream/promises");wf();x6();PMr();jCc=(0,L6i.promisify)(B6i.execFile);a(Q6i,"setupSkills");a(DMr,"resolveSkillVersion");a(HCc,"assertSafeMemberNames");a(GCc,"assertNoSpecialMembers");a(kMr,"runArchiveTool");a($Cc,"archiveTopDir");a(NMr,"extractSkillArchive");a(VCc,"readHead")});var e9i={};xi(e9i,{BashSession:()=>mCt,betaAgentToolset20260401:()=>JCc,betaBashTool:()=>z6i,betaEditTool:()=>J6i,betaGlobTool:()=>Z6i,betaGrepTool:()=>X6i,betaReadTool:()=>Y6i,betaWriteTool:()=>K6i,extractSkillArchive:()=>NMr,resolvePath:()=>sye,resolveSkillVersion:()=>DMr,setupSkills:()=>Q6i});function JCc(t){return[z6i(t),Y6i(t),K6i(t),J6i(t),Z6i(t),X6i(t)]}function sye(t,e){return M6i(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function ZCc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function z6i(t){let e,r=Promise.resolve();return zre({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=oye();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 mCt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??W6i,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 Y6i(t){return zre({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 sye(t,e),o;try{let f=await LE.stat(n);if(!f.isFile())throw new _o(`read: ${e} is not a regular file`);if(f.size>OMr)throw new _o(`read: ${e} is ${f.size} bytes, exceeds ${OMr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await LE.readFile(n,"utf8")}catch(f){throw f instanceof _o?f:new _o(`read: ${xBe(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 _Ui(t){return dne({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 Co("write: file_path is required");let n=await Rye(t,e);try{await QE.mkdir(kf.dirname(n),{recursive:!0,mode:XBe}),await NOr(n,r??"")}catch(o){throw new Co(`write: ${eLe(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function CUi(t){return dne({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 Co("edit: file_path is required");if(!r)throw new Co("edit: old_string is required");let s=await Rye(t,e),c;try{let d=await QE.stat(s);if(!d.isFile())throw new Co(`edit: ${e} is not a regular file`);if(d.size>pUi)throw new Co(`edit: ${e} is ${d.size} bytes, exceeds ${pUi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await QE.readFile(s,"utf8")}catch(d){throw d instanceof Co?d:new Co(`edit: ${eLe(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new Co(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new Co(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await NOr(s,u)}catch(d){throw new Co(`edit: write: ${eLe(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function vUi(t){return dne({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 Co("glob: pattern is required");let n=kf.resolve(t.workdir),o=e;if(kf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new Co("glob: absolute pattern not permitted");n=kf.parse(e).root,o=kf.relative(n,e)}else r&&(n=await Rye(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new Co('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of ZTc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=kf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!nIc(n,l))continue;let u=0;try{u=(await QE.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new Co(`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,KTc).map(c=>c.path).join(` -`))},"run")})}function bUi(t){return dne({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 Co("grep: pattern is required");let o=kf.resolve(t.workdir);r&&(o=await Rye(t,r));let s=await aIc();return s?tIc(s,e,o,n?.signal):rIc(e,o,n?.signal)},"run")})}function tIc(t,e,r,n){return new Promise((o,s)=>{let c=QOr.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>rLe&&(d=!0,l=l.slice(0,rLe),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new Co("grep: aborted"));if(d)return o(l+` -[output truncated at ${rLe} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new Co(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new Co("grep: aborted"));s(new Co(`grep: rg failed: ${f.message}`))})})}async function rIc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new Co(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=rLe,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${rLe} bytes]`),!1):(o.push(u),!0)),"push");if((await QE.stat(e).catch(()=>null))?.isFile()?await hUi(e,n,c):await sIc(e,"",u=>hUi(kf.join(e,u),n,c),r),r?.aborted)throw new Co("grep: aborted");return o.length===0?"no matches":o.join(` -`)}async function hUi(t,e,r){let n=Zvt.createReadStream(t,{encoding:"utf8"}),o=gUi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>YTc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function nIc(t,e){let r=kf.relative(t,e);return r===""||!r.startsWith(".."+kf.sep)&&r!==".."&&!kf.isAbsolute(r)}async function sIc(t,e,r,n){let o=oIc;async function s(c,l){if(l>iIc)return!0;if(n?.aborted)return!1;let u;try{u=await QE.readdir(kf.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?kf.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 aIc(){let t=(process.env.PATH??"").split(kf.delimiter);for(let e of t){let r=kf.join(e,"rg");try{return await QE.access(r,Zvt.constants.X_OK),r}catch{}}return null}var QE,Zvt,kf,QOr,mUi,gUi,Kvt,NC,f1,tLe,fne,NR,FOr,fUi,AUi,UOr,pUi,rLe,YTc,KTc,JTc,ZTc,Jvt,iIc,oIc,TUi=me(()=>{p();l1();QE=ce(require("node:fs/promises"),1),Zvt=ce(require("node:fs"),1),kf=ce(require("node:path"),1),QOr=ce(require("node:child_process"),1),mUi=ce(require("node:crypto"),1),gUi=ce(require("node:readline"),1);wf();lne();rUi();DOr();MOr();dUi();fUi=100*1024,AUi=12e4,UOr=256*1024,pUi=UOr,rLe=100*1024,YTc=2e3,KTc=200,JTc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,ZTc=QE.glob;a(XTc,"betaAgentToolset20260401");a(Rye,"resolvePath");a(eIc,"scrubbedShellEnv");Jvt=class{static{a(this,"BashSession")}constructor(e,r=eIc()){Kvt.add(this),NC.set(this,void 0),f1.set(this,""),tLe.set(this,!1),fne.set(this,!1),NR.set(this,null),Lt(this,NC,QOr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),ye(this,NC,"f").stdout.setEncoding("utf8"),ye(this,NC,"f").stderr.setEncoding("utf8"),ye(this,NC,"f").stdout.on("data",n=>ye(this,Kvt,"m",FOr).call(this,n)),ye(this,NC,"f").stderr.on("data",n=>ye(this,Kvt,"m",FOr).call(this,n)),ye(this,NC,"f").once("close",()=>{Lt(this,fne,!0,"f");let n=ye(this,NR,"f");Lt(this,NR,null,"f"),n?.resolve()})}get closed(){return ye(this,fne,"f")}async exec(e,r={}){if(ye(this,fne,"f"))throw new dr("bash session terminated");let n=r.timeoutMs??AUi,o=r.signal;if(o?.aborted)throw new dr("bash command aborted");Lt(this,f1,"","f"),Lt(this,tLe,!1,"f");let s=`__ANT_CMD_${mUi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} +`)},"run")})}function K6i(t){return zre({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 sye(t,e);try{await LE.mkdir(Pf.dirname(n),{recursive:!0,mode:IBe}),await RMr(n,r??"")}catch(o){throw new _o(`write: ${xBe(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function J6i(t){return zre({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 sye(t,e),c;try{let d=await LE.stat(s);if(!d.isFile())throw new _o(`edit: ${e} is not a regular file`);if(d.size>H6i)throw new _o(`edit: ${e} is ${d.size} bytes, exceeds ${H6i}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await LE.readFile(s,"utf8")}catch(d){throw d instanceof _o?d:new _o(`edit: ${xBe(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 RMr(s,u)}catch(d){throw new _o(`edit: write: ${xBe(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function Z6i(t){return zre({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=Pf.resolve(t.workdir),o=e;if(Pf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new _o("glob: absolute pattern not permitted");n=Pf.parse(e).root,o=Pf.relative(n,e)}else r&&(n=await sye(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 KCc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Pf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!tbc(n,l))continue;let u=0;try{u=(await LE.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,zCc).map(c=>c.path).join(` +`))},"run")})}function X6i(t){return zre({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=Pf.resolve(t.workdir);r&&(o=await sye(t,r));let s=await obc();return s?XCc(s,e,o,n?.signal):ebc(e,o,n?.signal)},"run")})}function XCc(t,e,r,n){return new Promise((o,s)=>{let c=BMr.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>RBe&&(d=!0,l=l.slice(0,RBe),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 ${RBe} 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 ebc(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=RBe,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${RBe} bytes]`),!1):(o.push(u),!0)),"push");if((await LE.stat(e).catch(()=>null))?.isFile()?await G6i(e,n,c):await ibc(e,"",u=>G6i(Pf.join(e,u),n,c),r),r?.aborted)throw new _o("grep: aborted");return o.length===0?"no matches":o.join(` +`)}async function G6i(t,e,r){let n=gCt.createReadStream(t,{encoding:"utf8"}),o=V6i.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>WCc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function tbc(t,e){let r=Pf.relative(t,e);return r===""||!r.startsWith(".."+Pf.sep)&&r!==".."&&!Pf.isAbsolute(r)}async function ibc(t,e,r,n){let o=nbc;async function s(c,l){if(l>rbc)return!0;if(n?.aborted)return!1;let u;try{u=await LE.readdir(Pf.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?Pf.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 obc(){let t=(process.env.PATH??"").split(Pf.delimiter);for(let e of t){let r=Pf.join(e,"rg");try{return await LE.access(r,gCt.constants.X_OK),r}catch{}}return null}var LE,gCt,Pf,BMr,$6i,V6i,hCt,Rv,i1,wBe,Yre,IR,MMr,j6i,W6i,OMr,H6i,RBe,WCc,zCc,YCc,KCc,mCt,rbc,nbc,t9i=_e(()=>{p();t1();LE=he(require("node:fs/promises"),1),gCt=he(require("node:fs"),1),Pf=he(require("node:path"),1),BMr=he(require("node:child_process"),1),$6i=he(require("node:crypto"),1),V6i=he(require("node:readline"),1);wf();Vre();D6i();wMr();PMr();q6i();j6i=100*1024,W6i=12e4,OMr=256*1024,H6i=OMr,RBe=100*1024,WCc=2e3,zCc=200,YCc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,KCc=LE.glob;a(JCc,"betaAgentToolset20260401");a(sye,"resolvePath");a(ZCc,"scrubbedShellEnv");mCt=class{static{a(this,"BashSession")}constructor(e,r=ZCc()){hCt.add(this),Rv.set(this,void 0),i1.set(this,""),wBe.set(this,!1),Yre.set(this,!1),IR.set(this,null),Ft(this,Rv,BMr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,Rv,"f").stdout.setEncoding("utf8"),xe(this,Rv,"f").stderr.setEncoding("utf8"),xe(this,Rv,"f").stdout.on("data",n=>xe(this,hCt,"m",MMr).call(this,n)),xe(this,Rv,"f").stderr.on("data",n=>xe(this,hCt,"m",MMr).call(this,n)),xe(this,Rv,"f").once("close",()=>{Ft(this,Yre,!0,"f");let n=xe(this,IR,"f");Ft(this,IR,null,"f"),n?.resolve()})}get closed(){return xe(this,Yre,"f")}async exec(e,r={}){if(xe(this,Yre,"f"))throw new dr("bash session terminated");let n=r.timeoutMs??W6i,o=r.signal;if(o?.aborted)throw new dr("bash command aborted");Ft(this,i1,"","f"),Ft(this,wBe,!1,"f");let s=`__ANT_CMD_${$6i.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} } &1; printf '\\n${c}%d\\n' $? -`;if(ye(this,NC,"f").stdin.write(l),ye(this,f1,"f").indexOf(s)<0){let{promise:g,resolve:A}=wye();Lt(this,NR,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new dr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new dr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),Lt(this,NR,null,"f")}}let u=ye(this,f1,"f").indexOf(s);if(u<0)throw new dr("bash session terminated");let f=ye(this,f1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=ye(this,f1,"f").slice(0,u).replace(JTc,"").replace(/\n+$/,"");return ye(this,tLe,"f")&&(m=`[output truncated] -${m}`),{output:m,exitCode:h}}close(){if(ye(this,fne,"f"))return;Lt(this,fne,!0,"f");let e=ye(this,NR,"f");Lt(this,NR,null,"f"),e?.resolve(),ye(this,NC,"f").stdout.destroy(),ye(this,NC,"f").stderr.destroy(),ye(this,NC,"f").stdin.destroy();try{process.kill(-ye(this,NC,"f").pid,"SIGKILL")}catch{ye(this,NC,"f").kill("SIGKILL")}ye(this,NC,"f").unref()}};NC=new WeakMap,f1=new WeakMap,tLe=new WeakMap,fne=new WeakMap,NR=new WeakMap,Kvt=new WeakSet,FOr=a(function(e){if(Lt(this,f1,ye(this,f1,"f")+e,"f"),ye(this,f1,"f").length>fUi&&(Lt(this,f1,ye(this,f1,"f").slice(ye(this,f1,"f").length-fUi),"f"),Lt(this,tLe,!0,"f")),ye(this,NR,"f")&&ye(this,f1,"f").indexOf(ye(this,NR,"f").sentinel)>=0){let r=ye(this,NR,"f");Lt(this,NR,null,"f"),r.resolve()}},"_BashSession_append");a(yUi,"betaBashTool");a(EUi,"betaReadTool");a(_Ui,"betaWriteTool");a(CUi,"betaEditTool");a(vUi,"betaGlobTool");a(bUi,"betaGrepTool");a(tIc,"runRipgrep");a(rIc,"runWalkGrep");a(hUi,"grepFile");a(nIc,"isWithin");iIc=40,oIc=5e4;a(sIc,"walk");a(aIc,"findRg")});async function lIc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:At([n?.headers])})}catch(o){G$(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function uIc(t,e,r,n,o){let s=IUi,c=cIc,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:At([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,IUi))),(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(),$$(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 YD(s,r.signal),r.signal.throwIfAborted(),await l()}var Xvt,nLe,qOr,IUi,cIc,kye,jOr=me(()=>{p();l1();wf();j6();FBe();lye();WBe();Lvt();Ac();Yvt();Hvt();xOr();IUi=3e4,cIc="NO_HEARTBEAT",kye=class{static{a(this,"EnvironmentWorker")}constructor(e){Xvt.add(this),nLe.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,Lt(this,nLe,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new dr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??ye(this,nLe,"f"),s=new V$({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 ye(this,Xvt,"m",qOr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??ya("ANTHROPIC_WORK_ID"),n=e?.environmentId??ya("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??ya("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??ya("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new dr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new dr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new dr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new dr("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 ye(this,Xvt,"m",qOr).call(this,c,s,e?.signal??ye(this,nLe,"f"))}};nLe=new WeakMap,Xvt=new WeakSet,qOr=a(async function(e,r,n){let o=dl(this.client),s=Fvt(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(()=>(TUi(),SUi)),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=cne(n,h),g=uIc(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 z$(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 lIc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(lIc,"forceStop");a(uIc,"heartbeatLoop")});var Y$,HOr=me(()=>{p();Ml();pd();Ac();Rf();Hvt();jOr();Hvt();jOr();Y$=class extends mi{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(nr`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:At([{"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(nr`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/environments/${e}/work?beta=true`,Ea,{query:s,...n,headers:At([{"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(nr`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:At([{"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(nr`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:At([{"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(nr`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:At([{"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(nr`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:At([{"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(nr`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new V$({...e,client:this._client})}worker(e){return new kye({...e,client:this._client})}};Y$.WorkPoller=V$;Y$.EnvironmentWorker=kye});var pne,GOr=me(()=>{p();Ml();HOr();HOr();pd();Ac();Rf();pne=class extends mi{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new Y$(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/environments/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/environments/${e}?beta=true`,{body:s,...n,headers:At([{"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",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/environments/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/environments/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pne.Work=Y$});var Pye,$Or=me(()=>{p();Ml();pd();Ac();Rf();Pye=class extends mi{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(nr`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:At([{"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(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:At([{"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(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:At([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/memory_stores/${e}/memories?beta=true`,Ea,{query:s,...n,headers:At([{"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(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:At([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Dye,VOr=me(()=>{p();Ml();pd();Ac();Rf();Dye=class extends mi{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(nr`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/memory_stores/${e}/memory_versions?beta=true`,Ea,{query:s,...n,headers:At([{"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(nr`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var K$,WOr=me(()=>{p();Ml();$Or();$Or();VOr();VOr();pd();Ac();Rf();K$=class extends mi{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new Pye(this._client),this.memoryVersions=new Dye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/memory_stores/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:At([{"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",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/memory_stores/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};K$.Memories=Pye;K$.MemoryVersions=Dye});var Nye=me(()=>{p();wf()});var Mye,zOr=me(()=>{p();wf();uye();aOr();Mye=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new H6;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 dr("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 dr("Attempted to iterate over a response with no body");return new t(BBe(e.body),r)}}});var Oye,YOr=me(()=>{p();Ml();pd();Ac();zOr();Nye();Rf();Oye=class extends mi{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:At([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/messages/batches/${e}?beta=true`,{...n,headers:At([{"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",PR,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/messages/batches/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:At([{"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 dr(`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:At([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>Mye.fromResponse(l.response,l.controller))}}});var ebt,KOr=me(()=>{p();ebt={"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 xUi(t){return t?.output_format??t?.output_config?.format}function JOr(t,e,r){let n=xUi(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}:ZOr(t,e,r)}function ZOr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=AIc(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 AIc(t,e){let r=xUi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dr(`Failed to parse structured output: ${n}`)}}var XOr=me(()=>{p();wf();a(xUi,"getOutputFormat");a(JOr,"maybeParseBetaMessage");a(ZOr,"parseBetaMessage");a(AIc,"parseBetaOutputFormat")});var yIc,Bye,EIc,_Ic,tbt,e5r=me(()=>{p();yIc=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),Bye(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),Bye(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),Bye(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),Bye(t);break;case"delimiter":return t=t.slice(0,t.length-1),Bye(t);break}return t},"strip"),EIc=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"),_Ic=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),tbt=a(t=>JSON.parse(_Ic(EIc(Bye(yIc(t))))),"partialParse")});var t5r=me(()=>{p();lOr()});function PUi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var MR,J$,Lye,iLe,rbt,oLe,sLe,nbt,aLe,$6,cLe,ibt,obt,hne,sbt,abt,lLe,r5r,wUi,cbt,n5r,i5r,o5r,RUi,kUi,lbt,DUi=me(()=>{p();l1();e5r();Nye();XAe();t5r();XOr();kUi="__json_buf";a(PUi,"tracksToolInput");lbt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){MR.add(this),this.messages=[],this.receivedMessages=[],J$.set(this,void 0),Lye.set(this,null),this.controller=new AbortController,iLe.set(this,void 0),rbt.set(this,()=>{}),oLe.set(this,()=>{}),sLe.set(this,void 0),nbt.set(this,()=>{}),aLe.set(this,()=>{}),$6.set(this,{}),cLe.set(this,!1),ibt.set(this,!1),obt.set(this,!1),hne.set(this,!1),sbt.set(this,void 0),abt.set(this,void 0),lLe.set(this,void 0),cbt.set(this,n=>{if(Lt(this,ibt,!0,"f"),Q6(n)&&(n=new oy),n instanceof oy)return Lt(this,obt,!0,"f"),this._emit("abort",n);if(n instanceof dr)return this._emit("error",n);if(n instanceof Error){let o=new dr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new dr(String(n)))}),Lt(this,iLe,new Promise((n,o)=>{Lt(this,rbt,n,"f"),Lt(this,oLe,o,"f")}),"f"),Lt(this,sLe,new Promise((n,o)=>{Lt(this,nbt,n,"f"),Lt(this,aLe,o,"f")}),"f"),ye(this,iLe,"f").catch(()=>{}),ye(this,sLe,"f").catch(()=>{}),Lt(this,Lye,e,"f"),Lt(this,lLe,r?.logger??console,"f")}get response(){return ye(this,sbt,"f")}get request_id(){return ye(this,abt,"f")}async withResponse(){Lt(this,hne,!0,"f");let e=await ye(this,iLe,"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 Lt(s,Lye,{...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")},ye(this,cbt,"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{ye(this,MR,"m",n5r).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)ye(this,MR,"m",i5r).call(this,u);if(l.controller.signal?.aborted)throw new oy;ye(this,MR,"m",o5r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Lt(this,sbt,e,"f"),Lt(this,abt,e?.headers.get("request-id"),"f"),ye(this,rbt,"f").call(this,e),this._emit("connect"))}get ended(){return ye(this,cLe,"f")}get errored(){return ye(this,ibt,"f")}get aborted(){return ye(this,obt,"f")}abort(){this.controller.abort()}on(e,r){return(ye(this,$6,"f")[e]||(ye(this,$6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ye(this,$6,"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(ye(this,$6,"f")[e]||(ye(this,$6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Lt(this,hne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Lt(this,hne,!0,"f"),await ye(this,sLe,"f")}get currentMessage(){return ye(this,J$,"f")}async finalMessage(){return await this.done(),ye(this,MR,"m",r5r).call(this)}async finalText(){return await this.done(),ye(this,MR,"m",wUi).call(this)}_emit(e,...r){if(ye(this,cLe,"f"))return;e==="end"&&(Lt(this,cLe,!0,"f"),ye(this,nbt,"f").call(this));let n=ye(this,$6,"f")[e];if(n&&(ye(this,$6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ye(this,hne,"f")&&!n?.length&&Promise.reject(o),ye(this,oLe,"f").call(this,o),ye(this,aLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ye(this,hne,"f")&&!n?.length&&Promise.reject(o),ye(this,oLe,"f").call(this,o),ye(this,aLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ye(this,MR,"m",r5r).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{ye(this,MR,"m",n5r).call(this),this._connected(null);let s=tB.fromReadableStream(e,this.controller);for await(let c of s)ye(this,MR,"m",i5r).call(this,c);if(s.controller.signal?.aborted)throw new oy;ye(this,MR,"m",o5r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(J$=new WeakMap,Lye=new WeakMap,iLe=new WeakMap,rbt=new WeakMap,oLe=new WeakMap,sLe=new WeakMap,nbt=new WeakMap,aLe=new WeakMap,$6=new WeakMap,cLe=new WeakMap,ibt=new WeakMap,obt=new WeakMap,hne=new WeakMap,sbt=new WeakMap,abt=new WeakMap,lLe=new WeakMap,cbt=new WeakMap,MR=new WeakSet,r5r=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),wUi=a(function(){if(this.receivedMessages.length===0)throw new dr("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 dr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),n5r=a(function(){this.ended||Lt(this,J$,void 0,"f")},"_BetaMessageStream_beginRequest"),i5r=a(function(r){if(this.ended)return;let n=ye(this,MR,"m",RUi).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":{PUi(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(JOr(n,ye(this,Lye,"f"),{logger:ye(this,lLe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Lt(this,J$,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),o5r=a(function(){if(this.ended)throw new dr("stream has ended, this shouldn't happen");let r=ye(this,J$,"f");if(!r)throw new dr("request ended without sending any chunks");return Lt(this,J$,void 0,"f"),JOr(r,ye(this,Lye,"f"),{logger:ye(this,lLe,"f")})},"_BetaMessageStream_endRequest"),RUi=a(function(r){let n=ye(this,J$,"f");if(r.type==="message_start"){if(n)throw new dr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new dr(`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&&PUi(o)){let s=o[kUi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,kUi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=tbt(s)}catch(l){let u=new dr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);ye(this,cbt,"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 tB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var NUi,MUi=me(()=>{p();NUi=`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(xe(this,Rv,"f").stdin.write(l),xe(this,i1,"f").indexOf(s)<0){let{promise:g,resolve:A}=oye();Ft(this,IR,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new dr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new dr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),Ft(this,IR,null,"f")}}let u=xe(this,i1,"f").indexOf(s);if(u<0)throw new dr("bash session terminated");let f=xe(this,i1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,i1,"f").slice(0,u).replace(YCc,"").replace(/\n+$/,"");return xe(this,wBe,"f")&&(m=`[output truncated] +${m}`),{output:m,exitCode:h}}close(){if(xe(this,Yre,"f"))return;Ft(this,Yre,!0,"f");let e=xe(this,IR,"f");Ft(this,IR,null,"f"),e?.resolve(),xe(this,Rv,"f").stdout.destroy(),xe(this,Rv,"f").stderr.destroy(),xe(this,Rv,"f").stdin.destroy();try{process.kill(-xe(this,Rv,"f").pid,"SIGKILL")}catch{xe(this,Rv,"f").kill("SIGKILL")}xe(this,Rv,"f").unref()}};Rv=new WeakMap,i1=new WeakMap,wBe=new WeakMap,Yre=new WeakMap,IR=new WeakMap,hCt=new WeakSet,MMr=a(function(e){if(Ft(this,i1,xe(this,i1,"f")+e,"f"),xe(this,i1,"f").length>j6i&&(Ft(this,i1,xe(this,i1,"f").slice(xe(this,i1,"f").length-j6i),"f"),Ft(this,wBe,!0,"f")),xe(this,IR,"f")&&xe(this,i1,"f").indexOf(xe(this,IR,"f").sentinel)>=0){let r=xe(this,IR,"f");Ft(this,IR,null,"f"),r.resolve()}},"_BashSession_append");a(z6i,"betaBashTool");a(Y6i,"betaReadTool");a(K6i,"betaWriteTool");a(J6i,"betaEditTool");a(Z6i,"betaGlobTool");a(X6i,"betaGrepTool");a(XCc,"runRipgrep");a(ebc,"runWalkGrep");a(G6i,"grepFile");a(tbc,"isWithin");rbc=40,nbc=5e4;a(ibc,"walk");a(obc,"findRg")});async function abc(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){I$(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function cbc(t,e,r,n,o){let s=r9i,c=sbc,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,r9i))),(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(),x$(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 qD(s,r.signal),r.signal.throwIfAborted(),await l()}var ACt,PBe,LMr,r9i,sbc,aye,FMr=_e(()=>{p();t1();wf();x6();dBe();QAe();_Be();tCt();mc();pCt();aCt();bMr();r9i=3e4,sbc="NO_HEARTBEAT",aye=class{static{a(this,"EnvironmentWorker")}constructor(e){ACt.add(this),PBe.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,Ft(this,PBe,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new dr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??xe(this,PBe,"f"),s=new w$({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,ACt,"m",LMr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??ma("ANTHROPIC_WORK_ID"),n=e?.environmentId??ma("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??ma("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??ma("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new dr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new dr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new dr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new dr("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,ACt,"m",LMr).call(this,c,s,e?.signal??xe(this,PBe,"f"))}};PBe=new WeakMap,ACt=new WeakSet,LMr=a(async function(e,r,n){let o=ll(this.client),s=rCt(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(()=>(t9i(),e9i)),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=$re(n,h),g=cbc(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 P$(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 abc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(abc,"forceStop");a(cbc,"heartbeatLoop")});var k$,UMr=_e(()=>{p();Dl();pd();mc();Rf();aCt();FMr();aCt();FMr();k$=class extends mi{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(nr`/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(nr`/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(nr`/v1/environments/${e}/work?beta=true`,ga,{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(nr`/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(nr`/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(nr`/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(nr`/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(nr`/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 w$({...e,client:this._client})}worker(e){return new aye({...e,client:this._client})}};k$.WorkPoller=w$;k$.EnvironmentWorker=aye});var Kre,QMr=_e(()=>{p();Dl();UMr();UMr();pd();mc();Rf();Kre=class extends mi{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new k$(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(nr`/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(nr`/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",ga,{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(nr`/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(nr`/v1/environments/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Kre.Work=k$});var cye,qMr=_e(()=>{p();Dl();pd();mc();Rf();cye=class extends mi{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(nr`/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(nr`/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(nr`/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(nr`/v1/memory_stores/${e}/memories?beta=true`,ga,{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(nr`/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 lye,jMr=_e(()=>{p();Dl();pd();mc();Rf();lye=class extends mi{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(nr`/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(nr`/v1/memory_stores/${e}/memory_versions?beta=true`,ga,{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(nr`/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 D$,HMr=_e(()=>{p();Dl();qMr();qMr();jMr();jMr();pd();mc();Rf();D$=class extends mi{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new cye(this._client),this.memoryVersions=new lye(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(nr`/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(nr`/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",ga,{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(nr`/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(nr`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};D$.Memories=cye;D$.MemoryVersions=lye});var uye=_e(()=>{p();wf()});var dye,GMr=_e(()=>{p();wf();qAe();nMr();dye=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new w6;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 dr("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 dr("Attempted to iterate over a response with no body");return new t(lBe(e.body),r)}}});var fye,$Mr=_e(()=>{p();Dl();pd();mc();GMr();uye();Rf();fye=class extends mi{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(nr`/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",SR,{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(nr`/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(nr`/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 dr(`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)=>dye.fromResponse(l.response,l.controller))}}});var yCt,VMr=_e(()=>{p();yCt={"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 n9i(t){return t?.output_format??t?.output_config?.format}function WMr(t,e,r){let n=n9i(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}:zMr(t,e,r)}function zMr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=mbc(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 mbc(t,e){let r=n9i(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dr(`Failed to parse structured output: ${n}`)}}var YMr=_e(()=>{p();wf();a(n9i,"getOutputFormat");a(WMr,"maybeParseBetaMessage");a(zMr,"parseBetaMessage");a(mbc,"parseBetaOutputFormat")});var gbc,pye,Abc,ybc,ECt,KMr=_e(()=>{p();gbc=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),pye(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),pye(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),pye(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),pye(t);break;case"delimiter":return t=t.slice(0,t.length-1),pye(t);break}return t},"strip"),Abc=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"),ybc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),ECt=a(t=>JSON.parse(ybc(Abc(pye(gbc(t))))),"partialParse")});var JMr=_e(()=>{p();oMr()});function a9i(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var xR,N$,hye,kBe,_Ct,DBe,NBe,vCt,MBe,P6,OBe,CCt,bCt,Jre,SCt,TCt,BBe,ZMr,i9i,ICt,XMr,eOr,tOr,o9i,s9i,xCt,c9i=_e(()=>{p();t1();KMr();uye();PAe();JMr();YMr();s9i="__json_buf";a(a9i,"tracksToolInput");xCt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){xR.add(this),this.messages=[],this.receivedMessages=[],N$.set(this,void 0),hye.set(this,null),this.controller=new AbortController,kBe.set(this,void 0),_Ct.set(this,()=>{}),DBe.set(this,()=>{}),NBe.set(this,void 0),vCt.set(this,()=>{}),MBe.set(this,()=>{}),P6.set(this,{}),OBe.set(this,!1),CCt.set(this,!1),bCt.set(this,!1),Jre.set(this,!1),SCt.set(this,void 0),TCt.set(this,void 0),BBe.set(this,void 0),ICt.set(this,n=>{if(Ft(this,CCt,!0,"f"),T6(n)&&(n=new uy),n instanceof uy)return Ft(this,bCt,!0,"f"),this._emit("abort",n);if(n instanceof dr)return this._emit("error",n);if(n instanceof Error){let o=new dr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new dr(String(n)))}),Ft(this,kBe,new Promise((n,o)=>{Ft(this,_Ct,n,"f"),Ft(this,DBe,o,"f")}),"f"),Ft(this,NBe,new Promise((n,o)=>{Ft(this,vCt,n,"f"),Ft(this,MBe,o,"f")}),"f"),xe(this,kBe,"f").catch(()=>{}),xe(this,NBe,"f").catch(()=>{}),Ft(this,hye,e,"f"),Ft(this,BBe,r?.logger??console,"f")}get response(){return xe(this,SCt,"f")}get request_id(){return xe(this,TCt,"f")}async withResponse(){Ft(this,Jre,!0,"f");let e=await xe(this,kBe,"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 Ft(s,hye,{...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,ICt,"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,xR,"m",XMr).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,xR,"m",eOr).call(this,u);if(l.controller.signal?.aborted)throw new uy;xe(this,xR,"m",tOr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Ft(this,SCt,e,"f"),Ft(this,TCt,e?.headers.get("request-id"),"f"),xe(this,_Ct,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,OBe,"f")}get errored(){return xe(this,CCt,"f")}get aborted(){return xe(this,bCt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,P6,"f")[e]||(xe(this,P6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,P6,"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,P6,"f")[e]||(xe(this,P6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Ft(this,Jre,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Ft(this,Jre,!0,"f"),await xe(this,NBe,"f")}get currentMessage(){return xe(this,N$,"f")}async finalMessage(){return await this.done(),xe(this,xR,"m",ZMr).call(this)}async finalText(){return await this.done(),xe(this,xR,"m",i9i).call(this)}_emit(e,...r){if(xe(this,OBe,"f"))return;e==="end"&&(Ft(this,OBe,!0,"f"),xe(this,vCt,"f").call(this));let n=xe(this,P6,"f")[e];if(n&&(xe(this,P6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Jre,"f")&&!n?.length&&Promise.reject(o),xe(this,DBe,"f").call(this,o),xe(this,MBe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Jre,"f")&&!n?.length&&Promise.reject(o),xe(this,DBe,"f").call(this,o),xe(this,MBe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,xR,"m",ZMr).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,xR,"m",XMr).call(this),this._connected(null);let s=H4.fromReadableStream(e,this.controller);for await(let c of s)xe(this,xR,"m",eOr).call(this,c);if(s.controller.signal?.aborted)throw new uy;xe(this,xR,"m",tOr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(N$=new WeakMap,hye=new WeakMap,kBe=new WeakMap,_Ct=new WeakMap,DBe=new WeakMap,NBe=new WeakMap,vCt=new WeakMap,MBe=new WeakMap,P6=new WeakMap,OBe=new WeakMap,CCt=new WeakMap,bCt=new WeakMap,Jre=new WeakMap,SCt=new WeakMap,TCt=new WeakMap,BBe=new WeakMap,ICt=new WeakMap,xR=new WeakSet,ZMr=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),i9i=a(function(){if(this.receivedMessages.length===0)throw new dr("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 dr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),XMr=a(function(){this.ended||Ft(this,N$,void 0,"f")},"_BetaMessageStream_beginRequest"),eOr=a(function(r){if(this.ended)return;let n=xe(this,xR,"m",o9i).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":{a9i(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(WMr(n,xe(this,hye,"f"),{logger:xe(this,BBe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Ft(this,N$,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),tOr=a(function(){if(this.ended)throw new dr("stream has ended, this shouldn't happen");let r=xe(this,N$,"f");if(!r)throw new dr("request ended without sending any chunks");return Ft(this,N$,void 0,"f"),WMr(r,xe(this,hye,"f"),{logger:xe(this,BBe,"f")})},"_BetaMessageStream_endRequest"),o9i=a(function(r){let n=xe(this,N$,"f");if(r.type==="message_start"){if(n)throw new dr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new dr(`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&&a9i(o)){let s=o[s9i]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,s9i,{value:s,enumerable:!1,writable:!0}),s)try{c.input=ECt(s)}catch(l){let u=new dr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);xe(this,ICt,"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 H4(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var l9i,u9i=_e(()=>{p();l9i=`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 @@ -1532,65 +1488,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 vIc(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 Co?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var uLe,Fye,mne,vm,p1,iI,V6,Z$,dLe,OUi,s5r,Uye,a5r=me(()=>{p();l1();lne();wf();Ac();DOr();MUi();$Be();Uye=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){uLe.add(this),this.client=e,Fye.set(this,!1),mne.set(this,!1),vm.set(this,void 0),p1.set(this,void 0),iI.set(this,void 0),V6.set(this,void 0),Z$.set(this,void 0),dLe.set(this,0),Lt(this,vm,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...AOr(r.tools,r.messages)].join(", ");Lt(this,p1,{...n,headers:At([{"x-stainless-helper":s},n?.headers])},"f"),Lt(this,Z$,wye(),"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*[(Fye=new WeakMap,mne=new WeakMap,vm=new WeakMap,p1=new WeakMap,iI=new WeakMap,V6=new WeakMap,Z$=new WeakMap,dLe=new WeakMap,uLe=new WeakSet,OUi=a(async function(){let r=ye(this,vm,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(ye(this,iI,"f")!==void 0)try{let d=await ye(this,iI,"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:ye(this,vm,"f").params.max_tokens},{signal:ye(this,p1,"f").signal,headers:At([ye(this,p1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new dr("Expected text response for compaction");return ye(this,vm,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(ye(this,Fye,"f"))throw new dr("Cannot iterate over a consumed stream");Lt(this,Fye,!0,"f"),Lt(this,mne,!0,"f"),Lt(this,V6,void 0,"f");try{for(;;){let r;try{if(ye(this,vm,"f").params.max_iterations&&ye(this,dLe,"f")>=ye(this,vm,"f").params.max_iterations)break;Lt(this,mne,!1,"f"),Lt(this,V6,void 0,"f"),Lt(this,dLe,(e=ye(this,dLe,"f"),e++,e),"f"),Lt(this,iI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=ye(this,vm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},ye(this,p1,"f")),Lt(this,iI,r.finalMessage(),"f"),ye(this,iI,"f").catch(()=>{}),yield r):(Lt(this,iI,this.client.beta.messages.create({...s,stream:!1},ye(this,p1,"f")),"f"),yield ye(this,iI,"f")),!await ye(this,uLe,"m",OUi).call(this)){if(!ye(this,mne,"f")){let{role:u,content:d}=await ye(this,iI,"f");ye(this,vm,"f").params.messages.push({role:u,content:d})}let l=await ye(this,uLe,"m",s5r).call(this,ye(this,vm,"f").params.messages.at(-1));if(l)ye(this,vm,"f").params.messages.push(l);else if(!ye(this,mne,"f"))break}}finally{r&&r.abort()}}if(!ye(this,iI,"f"))throw new dr("ToolRunner concluded without a message from the server");ye(this,Z$,"f").resolve(await ye(this,iI,"f"))}catch(r){throw Lt(this,Fye,!1,"f"),ye(this,Z$,"f").promise.catch(()=>{}),ye(this,Z$,"f").reject(r),Lt(this,Z$,wye(),"f"),r}}setMessagesParams(e){typeof e=="function"?ye(this,vm,"f").params=e(ye(this,vm,"f").params):ye(this,vm,"f").params=e,Lt(this,mne,!0,"f"),Lt(this,V6,void 0,"f")}setRequestOptions(e){typeof e=="function"?Lt(this,p1,e(ye(this,p1,"f")),"f"):Lt(this,p1,{...ye(this,p1,"f"),...e},"f")}async generateToolResponse(e=ye(this,p1,"f").signal){let r=await ye(this,iI,"f")??this.params.messages.at(-1);return r?ye(this,uLe,"m",s5r).call(this,r,e):null}done(){return ye(this,Z$,"f").promise}async runUntilDone(){if(!ye(this,Fye,"f"))for await(let e of this);return this.done()}get params(){return ye(this,vm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};s5r=a(async function(e,r=ye(this,p1,"f").signal){return ye(this,V6,"f")!==void 0?ye(this,V6,"f"):(Lt(this,V6,vIc(ye(this,vm,"f").params,e,{...ye(this,p1,"f"),signal:r}),"f"),ye(this,V6,"f"))},"_BetaToolRunner_generateToolResponse");a(vIc,"generateToolResponse")});function LUi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new dr("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 BUi,bIc,W6,c5r=me(()=>{p();Nye();YOr();Ml();KOr();Ac();$Be();XOr();DUi();a5r();lne();YOr();a5r();lne();BUi={"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"},bIc=["claude-mythos-preview","claude-opus-4-6"],W6=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Oye(this._client)}create(e,r){let n=LUi(e),{betas:o,...s}=n;s.model in BUi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${BUi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),bIc.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=ebt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=Nvt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:At([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:At([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>ZOr(n,e,{logger:this._client.logger??console}))}stream(e,r){return lbt.createMessage(this,e,r)}countTokens(e,r){let n=LUi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:At([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new Uye(this._client,e,r)}};a(LUi,"transformOutputFormat");W6.Batches=Oye;W6.BetaToolRunner=Uye;W6.ToolError=Co});var gne,l5r=me(()=>{p();Ml();pd();Ac();Rf();Yvt();Yvt();gne=class extends mi{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/events?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new z$(e,{...r,client:this._client})}};gne.SessionToolRunner=z$});var Qye,u5r=me(()=>{p();Ml();pd();Ac();Rf();Qye=class extends mi{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:At([{"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(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/resources?beta=true`,Ea,{query:s,...n,headers:At([{"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(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var qye,d5r=me(()=>{p();Ml();pd();Ac();Rf();qye=class extends mi{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(nr`/v1/sessions/${o}/threads/${e}/events?beta=true`,Ea,{query:c,...n,headers:At([{"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(nr`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Ane,f5r=me(()=>{p();Ml();d5r();d5r();pd();Ac();Rf();Ane=class extends mi{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new qye(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/threads?beta=true`,Ea,{query:s,...n,headers:At([{"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(nr`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Ane.Events=qye});var z6,p5r=me(()=>{p();Ml();l5r();l5r();u5r();u5r();f5r();f5r();pd();Ac();Rf();z6=class extends mi{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new gne(this._client),this.resources=new Qye(this._client),this.threads=new Ane(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/sessions/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:At([{"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",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/sessions/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/sessions/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};z6.Events=gne;z6.Resources=Qye;z6.Threads=Ane});var jye,h5r=me(()=>{p();Ml();pd();Ac();mye();Rf();jye=class extends mi{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(nr`/v1/skills/${e}/versions?beta=true`,hye({body:s,...n,headers:At([{"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(nr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/skills/${e}/versions?beta=true`,Ea,{query:s,...n,headers:At([{"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(nr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:At([{"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(nr`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var yne,m5r=me(()=>{p();Ml();h5r();h5r();pd();Ac();mye();Rf();yne=class extends mi{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new jye(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",hye({body:o,...r,headers:At([{"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(nr`/v1/skills/${e}?beta=true`,{...n,headers:At([{"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",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/skills/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};yne.Versions=jye});var Hye,g5r=me(()=>{p();Ml();pd();Ac();Rf();Hye=class extends mi{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:At([{"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(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:At([{"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(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/vaults/${e}/credentials?beta=true`,Ea,{query:s,...n,headers:At([{"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(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:At([{"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(nr`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:At([{"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(nr`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Ene,A5r=me(()=>{p();Ml();g5r();g5r();pd();Ac();Rf();Ene=class extends mi{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new Hye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/vaults/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:At([{"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",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/vaults/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/vaults/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Ene.Credentials=Hye});var Fg,y5r=me(()=>{p();Ml();yOr();yOr();EOr();EOr();_Or();_Or();bOr();bOr();TOr();TOr();GOr();GOr();WOr();WOr();c5r();c5r();p5r();p5r();m5r();m5r();A5r();A5r();Fg=class extends mi{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new Aye(this._client),this.messages=new W6(this._client),this.agents=new ane(this._client),this.environments=new pne(this._client),this.sessions=new z6(this._client),this.vaults=new Ene(this._client),this.memoryStores=new K$(this._client),this.files=new gye(this._client),this.skills=new yne(this._client),this.webhooks=new _ye(this._client),this.userProfiles=new yye(this._client)}};Fg.Models=Aye;Fg.Messages=W6;Fg.Agents=ane;Fg.Environments=pne;Fg.Sessions=z6;Fg.Vaults=Ene;Fg.MemoryStores=K$;Fg.Files=gye;Fg.Skills=yne;Fg.Webhooks=_ye;Fg.UserProfiles=yye});var _ne,E5r=me(()=>{p();Ml();Ac();_ne=class extends mi{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:At([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function FUi(t){return t?.output_config?.format}function _5r(t,e,r){let n=FUi(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}:C5r(t,e,r)}function C5r(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=MIc(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 MIc(t,e){let r=FUi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dr(`Failed to parse structured output: ${n}`)}}var v5r=me(()=>{p();wf();a(FUi,"getOutputFormat");a(_5r,"maybeParseMessage");a(C5r,"parseMessage");a(MIc,"parseOutputFormat")});function jUi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var OR,X$,Gye,fLe,ubt,pLe,hLe,dbt,mLe,Y6,gLe,fbt,pbt,Cne,hbt,mbt,ALe,b5r,UUi,S5r,T5r,I5r,x5r,QUi,qUi,gbt,HUi=me(()=>{p();l1();XAe();Nye();t5r();e5r();v5r();qUi="__json_buf";a(jUi,"tracksToolInput");gbt=class t{static{a(this,"MessageStream")}constructor(e,r){OR.add(this),this.messages=[],this.receivedMessages=[],X$.set(this,void 0),Gye.set(this,null),this.controller=new AbortController,fLe.set(this,void 0),ubt.set(this,()=>{}),pLe.set(this,()=>{}),hLe.set(this,void 0),dbt.set(this,()=>{}),mLe.set(this,()=>{}),Y6.set(this,{}),gLe.set(this,!1),fbt.set(this,!1),pbt.set(this,!1),Cne.set(this,!1),hbt.set(this,void 0),mbt.set(this,void 0),ALe.set(this,void 0),S5r.set(this,n=>{if(Lt(this,fbt,!0,"f"),Q6(n)&&(n=new oy),n instanceof oy)return Lt(this,pbt,!0,"f"),this._emit("abort",n);if(n instanceof dr)return this._emit("error",n);if(n instanceof Error){let o=new dr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new dr(String(n)))}),Lt(this,fLe,new Promise((n,o)=>{Lt(this,ubt,n,"f"),Lt(this,pLe,o,"f")}),"f"),Lt(this,hLe,new Promise((n,o)=>{Lt(this,dbt,n,"f"),Lt(this,mLe,o,"f")}),"f"),ye(this,fLe,"f").catch(()=>{}),ye(this,hLe,"f").catch(()=>{}),Lt(this,Gye,e,"f"),Lt(this,ALe,r?.logger??console,"f")}get response(){return ye(this,hbt,"f")}get request_id(){return ye(this,mbt,"f")}async withResponse(){Lt(this,Cne,!0,"f");let e=await ye(this,fLe,"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 Lt(s,Gye,{...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")},ye(this,S5r,"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{ye(this,OR,"m",T5r).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)ye(this,OR,"m",I5r).call(this,u);if(l.controller.signal?.aborted)throw new oy;ye(this,OR,"m",x5r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Lt(this,hbt,e,"f"),Lt(this,mbt,e?.headers.get("request-id"),"f"),ye(this,ubt,"f").call(this,e),this._emit("connect"))}get ended(){return ye(this,gLe,"f")}get errored(){return ye(this,fbt,"f")}get aborted(){return ye(this,pbt,"f")}abort(){this.controller.abort()}on(e,r){return(ye(this,Y6,"f")[e]||(ye(this,Y6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ye(this,Y6,"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(ye(this,Y6,"f")[e]||(ye(this,Y6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Lt(this,Cne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Lt(this,Cne,!0,"f"),await ye(this,hLe,"f")}get currentMessage(){return ye(this,X$,"f")}async finalMessage(){return await this.done(),ye(this,OR,"m",b5r).call(this)}async finalText(){return await this.done(),ye(this,OR,"m",UUi).call(this)}_emit(e,...r){if(ye(this,gLe,"f"))return;e==="end"&&(Lt(this,gLe,!0,"f"),ye(this,dbt,"f").call(this));let n=ye(this,Y6,"f")[e];if(n&&(ye(this,Y6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ye(this,Cne,"f")&&!n?.length&&Promise.reject(o),ye(this,pLe,"f").call(this,o),ye(this,mLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ye(this,Cne,"f")&&!n?.length&&Promise.reject(o),ye(this,pLe,"f").call(this,o),ye(this,mLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ye(this,OR,"m",b5r).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{ye(this,OR,"m",T5r).call(this),this._connected(null);let s=tB.fromReadableStream(e,this.controller);for await(let c of s)ye(this,OR,"m",I5r).call(this,c);if(s.controller.signal?.aborted)throw new oy;ye(this,OR,"m",x5r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(X$=new WeakMap,Gye=new WeakMap,fLe=new WeakMap,ubt=new WeakMap,pLe=new WeakMap,hLe=new WeakMap,dbt=new WeakMap,mLe=new WeakMap,Y6=new WeakMap,gLe=new WeakMap,fbt=new WeakMap,pbt=new WeakMap,Cne=new WeakMap,hbt=new WeakMap,mbt=new WeakMap,ALe=new WeakMap,S5r=new WeakMap,OR=new WeakSet,b5r=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),UUi=a(function(){if(this.receivedMessages.length===0)throw new dr("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 dr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),T5r=a(function(){this.ended||Lt(this,X$,void 0,"f")},"_MessageStream_beginRequest"),I5r=a(function(r){if(this.ended)return;let n=ye(this,OR,"m",QUi).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":{jUi(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(_5r(n,ye(this,Gye,"f"),{logger:ye(this,ALe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Lt(this,X$,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),x5r=a(function(){if(this.ended)throw new dr("stream has ended, this shouldn't happen");let r=ye(this,X$,"f");if(!r)throw new dr("request ended without sending any chunks");return Lt(this,X$,void 0,"f"),_5r(r,ye(this,Gye,"f"),{logger:ye(this,ALe,"f")})},"_MessageStream_endRequest"),QUi=a(function(r){let n=ye(this,X$,"f");if(r.type==="message_start"){if(n)throw new dr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new dr(`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&&jUi(o)){let s=o[qUi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,qUi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=tbt(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 tB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var $ye,w5r=me(()=>{p();Ml();pd();Ac();zOr();Nye();Rf();$ye=class extends mi{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(nr`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",PR,{query:e,...r})}delete(e,r){return this._client.delete(nr`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(nr`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new dr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:At([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>Mye.fromResponse(s.response,s.controller))}}});var eV,GUi,BIc,R5r=me(()=>{p();Ml();Ac();$Be();HUi();v5r();w5r();w5r();KOr();eV=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new $ye(this._client)}create(e,r){e.model in GUi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${GUi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),BIc.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=ebt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=Nvt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:At([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>C5r(n,e,{logger:this._client.logger??console}))}stream(e,r){return gbt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},GUi={"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"},BIc=["claude-mythos-preview","claude-opus-4-6"];eV.Batches=$ye});var vne,k5r=me(()=>{p();Ml();pd();Ac();Rf();vne=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/models/${e}`,{...n,headers:At([{...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",PR,{query:o,...r,headers:At([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var $Ui=me(()=>{p();S9i();y5r();E5r();R5r();k5r()});var P5r,D5r,Abt,VUi,WUi,zUi,Pf,nB,N5r=me(()=>{p();l1();dvt();X4();lye();XAe();hvt();uye();F6i();ZMr();MBe();wf();fye();r9i();E9i();pd();gOr();$Ui();wvt();E5r();k5r();y5r();R5r();hvt();Ac();FBe();j6();X4();WUi="\\n\\nHuman:",zUi="\\n\\nAssistant:",Pf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=ya("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=ya("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(P5r.add(this),this._requestAuthFlags=new WeakMap,Abt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:ya("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:ya("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&&M6i())throw new dr(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function _bc(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 LBe,mye,Zre,Cm,o1,ZT,k6,M$,FBe,d9i,rOr,gye,nOr=_e(()=>{p();t1();Vre();wf();mc();wMr();u9i();yBe();gye=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){LBe.add(this),this.client=e,mye.set(this,!1),Zre.set(this,!1),Cm.set(this,void 0),o1.set(this,void 0),ZT.set(this,void 0),k6.set(this,void 0),M$.set(this,void 0),FBe.set(this,0),Ft(this,Cm,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...pMr(r.tools,r.messages)].join(", ");Ft(this,o1,{...n,headers:vt([{"x-stainless-helper":s},n?.headers])},"f"),Ft(this,M$,oye(),"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*[(mye=new WeakMap,Zre=new WeakMap,Cm=new WeakMap,o1=new WeakMap,ZT=new WeakMap,k6=new WeakMap,M$=new WeakMap,FBe=new WeakMap,LBe=new WeakSet,d9i=a(async function(){let r=xe(this,Cm,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,ZT,"f")!==void 0)try{let d=await xe(this,ZT,"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,Cm,"f").params.max_tokens},{signal:xe(this,o1,"f").signal,headers:vt([xe(this,o1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new dr("Expected text response for compaction");return xe(this,Cm,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,mye,"f"))throw new dr("Cannot iterate over a consumed stream");Ft(this,mye,!0,"f"),Ft(this,Zre,!0,"f"),Ft(this,k6,void 0,"f");try{for(;;){let r;try{if(xe(this,Cm,"f").params.max_iterations&&xe(this,FBe,"f")>=xe(this,Cm,"f").params.max_iterations)break;Ft(this,Zre,!1,"f"),Ft(this,k6,void 0,"f"),Ft(this,FBe,(e=xe(this,FBe,"f"),e++,e),"f"),Ft(this,ZT,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,Cm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,o1,"f")),Ft(this,ZT,r.finalMessage(),"f"),xe(this,ZT,"f").catch(()=>{}),yield r):(Ft(this,ZT,this.client.beta.messages.create({...s,stream:!1},xe(this,o1,"f")),"f"),yield xe(this,ZT,"f")),!await xe(this,LBe,"m",d9i).call(this)){if(!xe(this,Zre,"f")){let{role:u,content:d}=await xe(this,ZT,"f");xe(this,Cm,"f").params.messages.push({role:u,content:d})}let l=await xe(this,LBe,"m",rOr).call(this,xe(this,Cm,"f").params.messages.at(-1));if(l)xe(this,Cm,"f").params.messages.push(l);else if(!xe(this,Zre,"f"))break}}finally{r&&r.abort()}}if(!xe(this,ZT,"f"))throw new dr("ToolRunner concluded without a message from the server");xe(this,M$,"f").resolve(await xe(this,ZT,"f"))}catch(r){throw Ft(this,mye,!1,"f"),xe(this,M$,"f").promise.catch(()=>{}),xe(this,M$,"f").reject(r),Ft(this,M$,oye(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,Cm,"f").params=e(xe(this,Cm,"f").params):xe(this,Cm,"f").params=e,Ft(this,Zre,!0,"f"),Ft(this,k6,void 0,"f")}setRequestOptions(e){typeof e=="function"?Ft(this,o1,e(xe(this,o1,"f")),"f"):Ft(this,o1,{...xe(this,o1,"f"),...e},"f")}async generateToolResponse(e=xe(this,o1,"f").signal){let r=await xe(this,ZT,"f")??this.params.messages.at(-1);return r?xe(this,LBe,"m",rOr).call(this,r,e):null}done(){return xe(this,M$,"f").promise}async runUntilDone(){if(!xe(this,mye,"f"))for await(let e of this);return this.done()}get params(){return xe(this,Cm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};rOr=a(async function(e,r=xe(this,o1,"f").signal){return xe(this,k6,"f")!==void 0?xe(this,k6,"f"):(Ft(this,k6,_bc(xe(this,Cm,"f").params,e,{...xe(this,o1,"f"),signal:r}),"f"),xe(this,k6,"f"))},"_BetaToolRunner_generateToolResponse");a(_bc,"generateToolResponse")});function p9i(t){if(!t.output_format)return t;if(t.output_config?.format)throw new dr("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 f9i,vbc,D6,iOr=_e(()=>{p();uye();$Mr();Dl();VMr();mc();yBe();YMr();c9i();nOr();Vre();$Mr();nOr();Vre();f9i={"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"},vbc=["claude-mythos-preview","claude-opus-4-6"],D6=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new fye(this._client)}create(e,r){let n=p9i(e),{betas:o,...s}=n;s.model in f9i&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${f9i[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),vbc.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=yCt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=Jvt(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=>zMr(n,e,{logger:this._client.logger??console}))}stream(e,r){return xCt.createMessage(this,e,r)}countTokens(e,r){let n=p9i(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 gye(this._client,e,r)}};a(p9i,"transformOutputFormat");D6.Batches=fye;D6.BetaToolRunner=gye;D6.ToolError=_o});var Xre,oOr=_e(()=>{p();Dl();pd();mc();Rf();pCt();pCt();Xre=class extends mi{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/events?beta=true`,ga,{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(nr`/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(nr`/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 P$(e,{...r,client:this._client})}};Xre.SessionToolRunner=P$});var Aye,sOr=_e(()=>{p();Dl();pd();mc();Rf();Aye=class extends mi{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/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(nr`/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(nr`/v1/sessions/${e}/resources?beta=true`,ga,{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(nr`/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(nr`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var yye,aOr=_e(()=>{p();Dl();pd();mc();Rf();yye=class extends mi{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(nr`/v1/sessions/${o}/threads/${e}/events?beta=true`,ga,{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(nr`/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 ene,cOr=_e(()=>{p();Dl();aOr();aOr();pd();mc();Rf();ene=class extends mi{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new yye(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/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(nr`/v1/sessions/${e}/threads?beta=true`,ga,{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(nr`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ene.Events=yye});var N6,lOr=_e(()=>{p();Dl();oOr();oOr();sOr();sOr();cOr();cOr();pd();mc();Rf();N6=class extends mi{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new Xre(this._client),this.resources=new Aye(this._client),this.threads=new ene(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(nr`/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(nr`/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",ga,{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(nr`/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(nr`/v1/sessions/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};N6.Events=Xre;N6.Resources=Aye;N6.Threads=ene});var Eye,uOr=_e(()=>{p();Dl();pd();mc();VAe();Rf();Eye=class extends mi{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(nr`/v1/skills/${e}/versions?beta=true`,$Ae({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(nr`/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(nr`/v1/skills/${e}/versions?beta=true`,ga,{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(nr`/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(nr`/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 tne,dOr=_e(()=>{p();Dl();uOr();uOr();pd();mc();VAe();Rf();tne=class extends mi{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new Eye(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",$Ae({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(nr`/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",ga,{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(nr`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};tne.Versions=Eye});var _ye,fOr=_e(()=>{p();Dl();pd();mc();Rf();_ye=class extends mi{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/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(nr`/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(nr`/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(nr`/v1/vaults/${e}/credentials?beta=true`,ga,{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(nr`/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(nr`/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(nr`/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 rne,pOr=_e(()=>{p();Dl();fOr();fOr();pd();mc();Rf();rne=class extends mi{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new _ye(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(nr`/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(nr`/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",ga,{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(nr`/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(nr`/v1/vaults/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};rne.Credentials=_ye});var Qg,hOr=_e(()=>{p();Dl();hMr();hMr();mMr();mMr();gMr();gMr();EMr();EMr();vMr();vMr();QMr();QMr();HMr();HMr();iOr();iOr();lOr();lOr();dOr();dOr();pOr();pOr();Qg=class extends mi{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new zAe(this._client),this.messages=new D6(this._client),this.agents=new Gre(this._client),this.environments=new Kre(this._client),this.sessions=new N6(this._client),this.vaults=new rne(this._client),this.memoryStores=new D$(this._client),this.files=new WAe(this._client),this.skills=new tne(this._client),this.webhooks=new JAe(this._client),this.userProfiles=new YAe(this._client)}};Qg.Models=zAe;Qg.Messages=D6;Qg.Agents=Gre;Qg.Environments=Kre;Qg.Sessions=N6;Qg.Vaults=rne;Qg.MemoryStores=D$;Qg.Files=WAe;Qg.Skills=tne;Qg.Webhooks=JAe;Qg.UserProfiles=YAe});var nne,mOr=_e(()=>{p();Dl();mc();nne=class extends mi{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 h9i(t){return t?.output_config?.format}function gOr(t,e,r){let n=h9i(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}:AOr(t,e,r)}function AOr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=Dbc(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 Dbc(t,e){let r=h9i(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dr(`Failed to parse structured output: ${n}`)}}var yOr=_e(()=>{p();wf();a(h9i,"getOutputFormat");a(gOr,"maybeParseMessage");a(AOr,"parseMessage");a(Dbc,"parseOutputFormat")});function y9i(t){return t.type==="tool_use"||t.type==="server_tool_use"}var wR,O$,vye,UBe,wCt,QBe,qBe,RCt,jBe,M6,HBe,PCt,kCt,ine,DCt,NCt,GBe,EOr,m9i,_Or,vOr,COr,bOr,g9i,A9i,MCt,E9i=_e(()=>{p();t1();PAe();uye();JMr();KMr();yOr();A9i="__json_buf";a(y9i,"tracksToolInput");MCt=class t{static{a(this,"MessageStream")}constructor(e,r){wR.add(this),this.messages=[],this.receivedMessages=[],O$.set(this,void 0),vye.set(this,null),this.controller=new AbortController,UBe.set(this,void 0),wCt.set(this,()=>{}),QBe.set(this,()=>{}),qBe.set(this,void 0),RCt.set(this,()=>{}),jBe.set(this,()=>{}),M6.set(this,{}),HBe.set(this,!1),PCt.set(this,!1),kCt.set(this,!1),ine.set(this,!1),DCt.set(this,void 0),NCt.set(this,void 0),GBe.set(this,void 0),_Or.set(this,n=>{if(Ft(this,PCt,!0,"f"),T6(n)&&(n=new uy),n instanceof uy)return Ft(this,kCt,!0,"f"),this._emit("abort",n);if(n instanceof dr)return this._emit("error",n);if(n instanceof Error){let o=new dr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new dr(String(n)))}),Ft(this,UBe,new Promise((n,o)=>{Ft(this,wCt,n,"f"),Ft(this,QBe,o,"f")}),"f"),Ft(this,qBe,new Promise((n,o)=>{Ft(this,RCt,n,"f"),Ft(this,jBe,o,"f")}),"f"),xe(this,UBe,"f").catch(()=>{}),xe(this,qBe,"f").catch(()=>{}),Ft(this,vye,e,"f"),Ft(this,GBe,r?.logger??console,"f")}get response(){return xe(this,DCt,"f")}get request_id(){return xe(this,NCt,"f")}async withResponse(){Ft(this,ine,!0,"f");let e=await xe(this,UBe,"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 Ft(s,vye,{...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,_Or,"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,wR,"m",vOr).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,wR,"m",COr).call(this,u);if(l.controller.signal?.aborted)throw new uy;xe(this,wR,"m",bOr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Ft(this,DCt,e,"f"),Ft(this,NCt,e?.headers.get("request-id"),"f"),xe(this,wCt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,HBe,"f")}get errored(){return xe(this,PCt,"f")}get aborted(){return xe(this,kCt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,M6,"f")[e]||(xe(this,M6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,M6,"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,M6,"f")[e]||(xe(this,M6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Ft(this,ine,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Ft(this,ine,!0,"f"),await xe(this,qBe,"f")}get currentMessage(){return xe(this,O$,"f")}async finalMessage(){return await this.done(),xe(this,wR,"m",EOr).call(this)}async finalText(){return await this.done(),xe(this,wR,"m",m9i).call(this)}_emit(e,...r){if(xe(this,HBe,"f"))return;e==="end"&&(Ft(this,HBe,!0,"f"),xe(this,RCt,"f").call(this));let n=xe(this,M6,"f")[e];if(n&&(xe(this,M6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,ine,"f")&&!n?.length&&Promise.reject(o),xe(this,QBe,"f").call(this,o),xe(this,jBe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,ine,"f")&&!n?.length&&Promise.reject(o),xe(this,QBe,"f").call(this,o),xe(this,jBe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,wR,"m",EOr).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,wR,"m",vOr).call(this),this._connected(null);let s=H4.fromReadableStream(e,this.controller);for await(let c of s)xe(this,wR,"m",COr).call(this,c);if(s.controller.signal?.aborted)throw new uy;xe(this,wR,"m",bOr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(O$=new WeakMap,vye=new WeakMap,UBe=new WeakMap,wCt=new WeakMap,QBe=new WeakMap,qBe=new WeakMap,RCt=new WeakMap,jBe=new WeakMap,M6=new WeakMap,HBe=new WeakMap,PCt=new WeakMap,kCt=new WeakMap,ine=new WeakMap,DCt=new WeakMap,NCt=new WeakMap,GBe=new WeakMap,_Or=new WeakMap,wR=new WeakSet,EOr=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),m9i=a(function(){if(this.receivedMessages.length===0)throw new dr("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 dr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),vOr=a(function(){this.ended||Ft(this,O$,void 0,"f")},"_MessageStream_beginRequest"),COr=a(function(r){if(this.ended)return;let n=xe(this,wR,"m",g9i).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":{y9i(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(gOr(n,xe(this,vye,"f"),{logger:xe(this,GBe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Ft(this,O$,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),bOr=a(function(){if(this.ended)throw new dr("stream has ended, this shouldn't happen");let r=xe(this,O$,"f");if(!r)throw new dr("request ended without sending any chunks");return Ft(this,O$,void 0,"f"),gOr(r,xe(this,vye,"f"),{logger:xe(this,GBe,"f")})},"_MessageStream_endRequest"),g9i=a(function(r){let n=xe(this,O$,"f");if(r.type==="message_start"){if(n)throw new dr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new dr(`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&&y9i(o)){let s=o[A9i]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,A9i,{value:s,enumerable:!1,writable:!0}),s&&(c.input=ECt(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 H4(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Cye,SOr=_e(()=>{p();Dl();pd();mc();GMr();uye();Rf();Cye=class extends mi{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(nr`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",SR,{query:e,...r})}delete(e,r){return this._client.delete(nr`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(nr`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new dr(`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)=>dye.fromResponse(s.response,s.controller))}}});var B$,_9i,Mbc,TOr=_e(()=>{p();Dl();mc();yBe();E9i();yOr();SOr();SOr();VMr();B$=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Cye(this._client)}create(e,r){e.model in _9i&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${_9i[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),Mbc.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=yCt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=Jvt(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=>AOr(n,e,{logger:this._client.logger??console}))}stream(e,r){return MCt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},_9i={"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"},Mbc=["claude-mythos-preview","claude-opus-4-6"];B$.Batches=Cye});var one,IOr=_e(()=>{p();Dl();pd();mc();Rf();one=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/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",SR,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var v9i=_e(()=>{p();e6i();hOr();mOr();TOr();IOr()});var xOr,wOr,OCt,C9i,b9i,S9i,kf,$4,ROr=_e(()=>{p();t1();Rvt();q4();QAe();PAe();Dvt();qAe();h8i();zNr();aBe();wf();HAe();D8i();Y8i();pd();fMr();v9i();Vvt();mOr();IOr();hOr();TOr();Dvt();mc();dBe();x6();q4();b9i="\\n\\nHuman:",S9i="\\n\\nAssistant:",kf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=ma("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=ma("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(xOr.add(this),this._requestAuthFlags=new WeakMap,OCt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:ma("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:ma("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&&u8i())throw new dr(`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??D5r.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=tOr(c.logLevel,"ClientOptions.logLevel",this)??tOr(ya("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??O6i(),Lt(this,Abt,L6i,"f");let u=ya("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=sOr(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=>{dl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{dl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new vvt(e,r=>{dl(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 y9i(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 dr(`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,At([{Authorization:`Bearer ${r}`}])}return At([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return At([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return At([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Y6i(e)}getUserAgent(){return`${this.constructor.name}/JS ${kR}`}defaultIdempotencyKey(){return`stainless-node-retry-${ZAe()}`}makeStatusError(e,r,n,o){return lh.generate(e,r,n,o)}buildURL(e,r,n){let o=!ye(this,P5r,"m",VUi).call(this)&&n||this.baseURL,s=w6i(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!HMr(c)||!HMr(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 dr("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(ine)||o.append("anthropic-beta",ine),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 one(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(dl(this).debug(`[${d}] sending request`,q6({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new oy;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(NBe),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new oy;let v=Q6(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return dl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),dl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,q6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw dl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),dl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,q6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new eye:new j$({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 B6i(g.body),dl(this).info(`${E} - ${x}`),dl(this).debug(`[${d}] response error (${x})`,q6({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";dl(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>NBe(x).message),T=pvt(b),w=T?void 0:b;throw dl(this).debug(`[${d}] response error (${v})`,q6({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 dl(this).info(E),dl(this).debug(`[${d}] response start`,q6({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 jBe(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 YD(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 dr("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&&k6i("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=At([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))}:{},...OBe(),...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=At([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:mvt(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)}:ye(this,Abt,"f").call(this,{body:e,headers:n})}};D5r=Pf,Abt=new WeakMap,P5r=new WeakSet,VUi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Pf.Anthropic=D5r;Pf.HUMAN_PROMPT=WUi;Pf.AI_PROMPT=zUi;Pf.DEFAULT_TIMEOUT=6e5;Pf.AnthropicError=dr;Pf.APIError=lh;Pf.APIConnectionError=j$;Pf.APIConnectionTimeoutError=eye;Pf.APIUserAbortError=oy;Pf.NotFoundError=iye;Pf.ConflictError=oye;Pf.RateLimitError=aye;Pf.BadRequestError=tye;Pf.AuthenticationError=rye;Pf.InternalServerError=cye;Pf.PermissionDeniedError=nye;Pf.UnprocessableEntityError=sye;Pf.toFile=Pvt;nB=class extends Pf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new _ne(this),this.messages=new eV(this),this.models=new vne(this),this.beta=new Fg(this)}};nB.Completions=_ne;nB.Messages=eV;nB.Models=vne;nB.Beta=Fg});var POr=me(()=>{p();N5r();gOr();wvt();N5r();pd();wf()});var p4r=I((e1h,Dqi)=>{p();var NLe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,UPc=typeof AbortController=="function",o1t=UPc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new Rqi}abort(){this.signal.dispatchEvent("abort")}},QPc=typeof AbortSignal=="function",qPc=typeof o1t.AbortSignal=="function",Rqi=QPc?AbortSignal:qPc?o1t.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))}},d4r=new Set,c4r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;s1t(r)&&f4r(r,`${t} option`,`options.${e}`,lEe)},"deprecatedOption"),l4r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(s1t(r)){let{prototype:n}=lEe,{get:o}=Object.getOwnPropertyDescriptor(n,t);f4r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),jPc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(s1t(r)){let{prototype:n}=lEe,{get:o}=Object.getOwnPropertyDescriptor(n,t);f4r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),kqi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),s1t=a(t=>!d4r.has(t),"shouldWarn"),f4r=a((t,e,r,n)=>{d4r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;kqi(o,"DeprecationWarning",t,n)},"warn"),xne=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Pqi=a(t=>xne(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cEe:null:null,"getUintArray"),cEe=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},u4r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=Pqi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},lEe=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&&!xne(r))throw new TypeError("max option must be a nonnegative integer");let R=r?Pqi(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 u4r(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(!xne(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=xne(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!xne(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";s1t(x)&&(d4r.add(x),kqi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&c4r("stale","allowStale"),T&&c4r("maxAge","ttl"),b&&c4r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new cEe(this.max),this.starts=new cEe(this.max),this.setItemTTL=(n,o,s=NLe.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?NLe.now():0};let e=0,r=a(()=>{let n=NLe.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 cEe(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!xne(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!xne(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 l4r("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=NLe.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=NLe.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 o1t,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 l4r("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 l4r("reset","clear"),this.clear}get length(){return jPc("length","size"),this.size}static get AbortController(){return o1t}static get AbortSignal(){return Rqi}};Dqi.exports=lEe});var g4r=I((n1h,Nqi)=>{"use strict";p();var MLe=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}},h4r=class extends MLe{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)}},m4r=class extends MLe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};Nqi.exports={FetchBaseError:MLe,FetchError:h4r,AbortError:m4r}});var Z6=I((s1h,Oqi)=>{"use strict";p();var{constants:{MAX_LENGTH:HPc}}=require("buffer"),{pipeline:a1t,PassThrough:GPc}=require("stream"),{promisify:$Pc}=require("util"),{createGunzip:VPc,createInflate:WPc,createBrotliDecompress:zPc,constants:{Z_SYNC_FLUSH:Mqi}}=require("zlib"),YPc=Wk()("helix-fetch:utils"),KPc=$Pc(a1t),JPc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),ZPc=a((t,e,r,n)=>{if(!JPc(t,e))return r;let o=a(s=>{s&&(YPc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return a1t(r,VPc({flush:Mqi,finishFlush:Mqi}),o);case"deflate":case"x-deflate":return a1t(r,WPc(),o);case"br":return a1t(r,zPc(),o);default:return r}},"decodeStream"),XPc=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"),c1t=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)?e2c(t,e):t2c(t,e);default:return 0}},"calcSize"),e2c=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:c1t(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),t2c=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+=c1t(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=c1t(t[o],e)}),r},"calcObjectSize"),r2c=a(t=>c1t(t,new WeakSet),"sizeof"),n2c=a(async t=>{let e=new GPc,r=0,n=[];return e.on("data",o=>{if(r+o.length>HPc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await KPc(t,e),Buffer.concat(n,r)},"streamToBuffer");Oqi.exports={decodeStream:ZPc,isPlainObject:XPc,sizeof:r2c,streamToBuffer:n2c}});var u1t=I((l1h,Uqi)=>{"use strict";p();var{PassThrough:Bqi,Readable:X6}=require("stream"),{types:{isAnyArrayBuffer:Fqi}}=require("util"),{FetchError:i2c,FetchBaseError:o2c}=g4r(),{streamToBuffer:s2c}=Z6(),a2c=Buffer.alloc(0),FR=Symbol("Body internals"),c2c=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),Lqi=a(async t=>{if(t[FR].disturbed)throw new TypeError("Already read");if(t[FR].error)throw new TypeError(`Stream had error: ${t[FR].error.message}`);t[FR].disturbed=!0;let{stream:e}=t[FR];return e===null?a2c:s2c(e)},"consume"),l1t=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=X6.from(e.toString()):e instanceof X6?r=e:Buffer.isBuffer(e)?r=X6.from(e):Fqi(e)?r=X6.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=X6.from(e):r=X6.from(String(e)),this[FR]={stream:r,disturbed:!1,error:null},e instanceof X6&&r.on("error",n=>{let o=n instanceof o2c?n:new i2c(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[FR].error=o})}get body(){return this[FR].stream}get bodyUsed(){return this[FR].disturbed}async buffer(){return Lqi(this)}async arrayBuffer(){return c2c(await this.buffer())}async text(){return(await Lqi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(l1t.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var l2c=a(t=>{if(t[FR].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[FR],r=e;if(e instanceof X6){r=new Bqi;let n=new Bqi;e.pipe(r),e.pipe(n),t[FR].stream=n}return r},"cloneStream"),u2c=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)||Fqi(t)||t instanceof X6?null:"text/plain; charset=utf-8","guessContentType");Uqi.exports={Body:l1t,cloneStream:l2c,guessContentType:u2c}});var uEe=I((f1h,Hqi)=>{"use strict";p();var{validateHeaderName:Qqi,validateHeaderValue:qqi}=require("http"),{isPlainObject:d2c}=Z6(),e9=Symbol("Headers internals"),OLe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof Qqi=="function")Qqi(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"),jqi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof qqi=="function")qqi(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"),d1t=class t{static{a(this,"Headers")}constructor(e={}){if(this[e9]={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(d2c(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[e9].map.set(OLe(e),jqi(r,e))}has(e){return this[e9].map.has(OLe(e))}get(e){let r=this[e9].map.get(OLe(e));return r===void 0?null:r}append(e,r){let n=OLe(e),o=jqi(r,e),s=this[e9].map.get(n);this[e9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[e9].map.delete(OLe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[e9].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[e9].map)}};Object.defineProperties(d1t.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));Hqi.exports={Headers:d1t}});var A4r=I((m1h,Gqi)=>{"use strict";p();var{EventEmitter:f2c}=require("events"),nN=Symbol("AbortSignal internals"),dEe=class{static{a(this,"AbortSignal")}constructor(){this[nN]={eventEmitter:new f2c,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(dEe.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var p1t=class extends dEe{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(p1t.prototype,{clear:{enumerable:!0}});var f1t=Symbol("AbortController internals"),h1t=class{static{a(this,"AbortController")}constructor(){this[f1t]={signal:new dEe}}get signal(){return this[f1t].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[f1t].signal.aborted||this[f1t].signal.fire()}};Object.defineProperties(h1t.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});Gqi.exports={AbortController:h1t,AbortSignal:dEe,TimeoutSignal:p1t}});var BLe=I((y1h,Wqi)=>{"use strict";p();var{randomBytes:p2c}=require("crypto"),{Readable:h2c}=require("stream"),E4r=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"),m2c=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"),$qi=a(t=>`--${t}--\r +`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??wOr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=JNr(c.logLevel,"ClientOptions.logLevel",this)??JNr(ma("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??d8i(),Ft(this,OCt,p8i,"f");let u=ma("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=rMr(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=>{ll(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{ll(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new Qvt(e,r=>{ll(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 z8i(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 dr(`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 T8i(e)}getUserAgent(){return`${this.constructor.name}/JS ${bR}`}defaultIdempotencyKey(){return`stainless-node-retry-${RAe()}`}makeStatusError(e,r,n,o){return uh.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,xOr,"m",C9i).call(this)&&n||this.baseURL,s=i8i(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!UNr(c)||!UNr(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 dr("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(qre)||o.append("anthropic-beta",qre),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 jre(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(ll(this).debug(`[${d}] sending request`,I6({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new uy;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(sBe),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new uy;let v=T6(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return ll(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),ll(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,I6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw ll(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),ll(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,I6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new kAe:new S$({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 f8i(g.body),ll(this).info(`${E} - ${x}`),ll(this).debug(`[${d}] response error (${x})`,I6({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";ll(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>sBe(x).message),T=kvt(b),w=T?void 0:b;throw ll(this).debug(`[${d}] response error (${v})`,I6({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 ll(this).info(E),ll(this).debug(`[${d}] response start`,I6({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 mBe(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 qD(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 dr("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&&s8i("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))}:{},...cBe(),...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:Nvt(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,OCt,"f").call(this,{body:e,headers:n})}};wOr=kf,OCt=new WeakMap,xOr=new WeakSet,C9i=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");kf.Anthropic=wOr;kf.HUMAN_PROMPT=b9i;kf.AI_PROMPT=S9i;kf.DEFAULT_TIMEOUT=6e5;kf.AnthropicError=dr;kf.APIError=uh;kf.APIConnectionError=S$;kf.APIConnectionTimeoutError=kAe;kf.APIUserAbortError=uy;kf.NotFoundError=OAe;kf.ConflictError=BAe;kf.RateLimitError=FAe;kf.BadRequestError=DAe;kf.AuthenticationError=NAe;kf.InternalServerError=UAe;kf.PermissionDeniedError=MAe;kf.UnprocessableEntityError=LAe;kf.toFile=Yvt;$4=class extends kf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new nne(this),this.messages=new B$(this),this.models=new one(this),this.beta=new Qg(this)}};$4.Completions=nne;$4.Messages=B$;$4.Models=one;$4.Beta=Qg});var xMr=_e(()=>{p();ROr();fMr();Vvt();ROr();pd();wf()});var l5r=I((_Eh,lQi)=>{p();var sLe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Bxc=typeof AbortController=="function",bbt=Bxc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new sQi}abort(){this.signal.dispatchEvent("abort")}},Lxc=typeof AbortSignal=="function",Fxc=typeof bbt.AbortSignal=="function",sQi=Lxc?AbortSignal:Fxc?bbt.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))}},a5r=new Set,i5r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;Sbt(r)&&c5r(r,`${t} option`,`options.${e}`,Qye)},"deprecatedOption"),o5r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(Sbt(r)){let{prototype:n}=Qye,{get:o}=Object.getOwnPropertyDescriptor(n,t);c5r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),Uxc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(Sbt(r)){let{prototype:n}=Qye,{get:o}=Object.getOwnPropertyDescriptor(n,t);c5r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),aQi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),Sbt=a(t=>!a5r.has(t),"shouldWarn"),c5r=a((t,e,r,n)=>{a5r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;aQi(o,"DeprecationWarning",t,n)},"warn"),une=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),cQi=a(t=>une(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Uye:null:null,"getUintArray"),Uye=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},s5r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=cQi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Qye=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&&!une(r))throw new TypeError("max option must be a nonnegative integer");let R=r?cQi(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 s5r(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(!une(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=une(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!une(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";Sbt(x)&&(a5r.add(x),aQi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&i5r("stale","allowStale"),T&&i5r("maxAge","ttl"),b&&i5r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Uye(this.max),this.starts=new Uye(this.max),this.setItemTTL=(n,o,s=sLe.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?sLe.now():0};let e=0,r=a(()=>{let n=sLe.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 Uye(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!une(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!une(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 o5r("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=sLe.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=sLe.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 bbt,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 o5r("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 o5r("reset","clear"),this.clear}get length(){return Uxc("length","size"),this.size}static get AbortController(){return bbt}static get AbortSignal(){return sQi}};lQi.exports=Qye});var f5r=I((bEh,uQi)=>{"use strict";p();var aLe=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}},u5r=class extends aLe{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)}},d5r=class extends aLe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};uQi.exports={FetchBaseError:aLe,FetchError:u5r,AbortError:d5r}});var L6=I((IEh,fQi)=>{"use strict";p();var{constants:{MAX_LENGTH:Qxc}}=require("buffer"),{pipeline:Tbt,PassThrough:qxc}=require("stream"),{promisify:jxc}=require("util"),{createGunzip:Hxc,createInflate:Gxc,createBrotliDecompress:$xc,constants:{Z_SYNC_FLUSH:dQi}}=require("zlib"),Vxc=QP()("helix-fetch:utils"),Wxc=jxc(Tbt),zxc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),Yxc=a((t,e,r,n)=>{if(!zxc(t,e))return r;let o=a(s=>{s&&(Vxc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return Tbt(r,Hxc({flush:dQi,finishFlush:dQi}),o);case"deflate":case"x-deflate":return Tbt(r,Gxc(),o);case"br":return Tbt(r,$xc(),o);default:return r}},"decodeStream"),Kxc=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"),Ibt=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)?Jxc(t,e):Zxc(t,e);default:return 0}},"calcSize"),Jxc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:Ibt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),Zxc=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+=Ibt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=Ibt(t[o],e)}),r},"calcObjectSize"),Xxc=a(t=>Ibt(t,new WeakSet),"sizeof"),ewc=a(async t=>{let e=new qxc,r=0,n=[];return e.on("data",o=>{if(r+o.length>Qxc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await Wxc(t,e),Buffer.concat(n,r)},"streamToBuffer");fQi.exports={decodeStream:Yxc,isPlainObject:Kxc,sizeof:Xxc,streamToBuffer:ewc}});var wbt=I((REh,gQi)=>{"use strict";p();var{PassThrough:pQi,Readable:F6}=require("stream"),{types:{isAnyArrayBuffer:mQi}}=require("util"),{FetchError:twc,FetchBaseError:rwc}=f5r(),{streamToBuffer:nwc}=L6(),iwc=Buffer.alloc(0),kR=Symbol("Body internals"),owc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),hQi=a(async t=>{if(t[kR].disturbed)throw new TypeError("Already read");if(t[kR].error)throw new TypeError(`Stream had error: ${t[kR].error.message}`);t[kR].disturbed=!0;let{stream:e}=t[kR];return e===null?iwc:nwc(e)},"consume"),xbt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=F6.from(e.toString()):e instanceof F6?r=e:Buffer.isBuffer(e)?r=F6.from(e):mQi(e)?r=F6.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=F6.from(e):r=F6.from(String(e)),this[kR]={stream:r,disturbed:!1,error:null},e instanceof F6&&r.on("error",n=>{let o=n instanceof rwc?n:new twc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[kR].error=o})}get body(){return this[kR].stream}get bodyUsed(){return this[kR].disturbed}async buffer(){return hQi(this)}async arrayBuffer(){return owc(await this.buffer())}async text(){return(await hQi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(xbt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var swc=a(t=>{if(t[kR].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[kR],r=e;if(e instanceof F6){r=new pQi;let n=new pQi;e.pipe(r),e.pipe(n),t[kR].stream=n}return r},"cloneStream"),awc=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)||mQi(t)||t instanceof F6?null:"text/plain; charset=utf-8","guessContentType");gQi.exports={Body:xbt,cloneStream:swc,guessContentType:awc}});var qye=I((DEh,_Qi)=>{"use strict";p();var{validateHeaderName:AQi,validateHeaderValue:yQi}=require("http"),{isPlainObject:cwc}=L6(),U6=Symbol("Headers internals"),cLe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof AQi=="function")AQi(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"),EQi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof yQi=="function")yQi(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"),Rbt=class t{static{a(this,"Headers")}constructor(e={}){if(this[U6]={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(cwc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[U6].map.set(cLe(e),EQi(r,e))}has(e){return this[U6].map.has(cLe(e))}get(e){let r=this[U6].map.get(cLe(e));return r===void 0?null:r}append(e,r){let n=cLe(e),o=EQi(r,e),s=this[U6].map.get(n);this[U6].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[U6].map.delete(cLe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[U6].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[U6].map)}};Object.defineProperties(Rbt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));_Qi.exports={Headers:Rbt}});var p5r=I((OEh,vQi)=>{"use strict";p();var{EventEmitter:lwc}=require("events"),YD=Symbol("AbortSignal internals"),jye=class{static{a(this,"AbortSignal")}constructor(){this[YD]={eventEmitter:new lwc,onabort:null,aborted:!1}}get aborted(){return this[YD].aborted}get onabort(){return this[YD].onabort}set onabort(e){this[YD].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[YD].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[YD].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[YD][n]=="function"&&this[n](r),this[YD].eventEmitter.emit(e,r)}fire(){this[YD].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(jye.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var kbt=class extends jye{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[YD].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[YD].timerId)}};Object.defineProperties(kbt.prototype,{clear:{enumerable:!0}});var Pbt=Symbol("AbortController internals"),Dbt=class{static{a(this,"AbortController")}constructor(){this[Pbt]={signal:new jye}}get signal(){return this[Pbt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[Pbt].signal.aborted||this[Pbt].signal.fire()}};Object.defineProperties(Dbt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});vQi.exports={AbortController:Dbt,AbortSignal:jye,TimeoutSignal:kbt}});var lLe=I((FEh,SQi)=>{"use strict";p();var{randomBytes:uwc}=require("crypto"),{Readable:dwc}=require("stream"),m5r=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"),fwc=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"),CQi=a(t=>`--${t}--\r \r -`,"getFooter"),Vqi=a((t,e,r)=>{let n="";return n+=`--${t}\r -`,n+=`Content-Disposition: form-data; name="${e}"`,E4r(r)&&(n+=`; filename="${r.name}"\r +`,"getFooter"),bQi=a((t,e,r)=>{let n="";return n+=`--${t}\r +`,n+=`Content-Disposition: form-data; name="${e}"`,m5r(r)&&(n+=`; filename="${r.name}"\r `,n+=`Content-Type: ${r.type||"application/octet-stream"}`),`${n}\r \r -`},"getHeader");async function*g2c(t,e){for(let[r,n]of t)yield Vqi(e,r,n),E4r(n)?yield*n.stream():yield n,yield`\r -`;yield $qi(e)}a(g2c,"formDataIterator");var A2c=a((t,e)=>{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(Vqi(e,n,o)),r+=E4r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r -`);return r+=Buffer.byteLength($qi(e)),r},"getFormDataLength"),y4r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=p2c(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=A2c(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return h2c.from(g2c(this.fd,this.boundary))}};Wqi.exports={isFormData:m2c,FormDataSerializer:y4r}});var Yqi=I((v1h,zqi)=>{"use strict";p();var{AbortSignal:C1h}=A4r(),{Body:y2c,cloneStream:E2c,guessContentType:_2c}=u1t(),{Headers:C2c}=uEe(),{isPlainObject:v2c}=Z6(),{isFormData:b2c,FormDataSerializer:S2c}=BLe(),T2c=20,sV=Symbol("Request internals"),m1t=class t extends y2c{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?E2c(n):null),l=new C2c(r.headers||n&&n.headers||{});if(b2c(c)&&!l.has("content-type")){let h=new S2c(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(v2c(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=_2c(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[sV]={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=T2c: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[sV].method}get url(){return this[sV].parsedURL.toString()}get headers(){return this[sV].headers}get redirect(){return this[sV].redirect}get cache(){return this[sV].cache}get signal(){return this[sV].signal}clone(){return new t(this)}get init(){return this[sV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(m1t.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});zqi.exports={Request:m1t}});var _4r=I((T1h,Kqi)=>{"use strict";p();var{Body:I2c,cloneStream:x2c,guessContentType:w2c}=u1t(),{Headers:R2c}=uEe(),{isPlainObject:k2c}=Z6(),{isFormData:P2c,FormDataSerializer:D2c}=BLe(),iN=Symbol("Response internals"),g1t=class t extends I2c{static{a(this,"Response")}constructor(e=null,r={}){let n=new R2c(r.headers),o=e;if(P2c(o)&&!n.has("content-type")){let s=new D2c(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(k2c(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=w2c(o);s&&n.set("content-type",s)}super(o),this[iN]={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[iN].url||""}get status(){return this[iN].status}get statusText(){return this[iN].statusText}get ok(){return this[iN].status>=200&&this[iN].status<300}get redirected(){return this[iN].counter>0}get headers(){return this[iN].headers}get httpVersion(){return this[iN].httpVersion}get decoded(){return this[iN].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(x2c(this),{...this[iN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(g1t.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Kqi.exports={Response:g1t}});var Zqi=I((R1h,Jqi)=>{"use strict";p();var N2c=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),M2c=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),O2c=new Set([500,502,503,504]),B2c={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},L2c={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function wne(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(wne,"toNumberOrZero");function F2c(t){return t?O2c.has(t.status):!0}a(F2c,"isErrorResponse");function C4r(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(C4r,"parseCacheControl");function U2c(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(U2c,"formatCacheControl");Jqi.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=C4r(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=C4r(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":U2c(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())&&M2c.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||N2c.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=C4r(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)B2c[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 wne(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 wne(this._rescc["s-maxage"])}if(this._rescc["max-age"])return wne(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+wne(this._rescc["stale-if-error"]),n=e+wne(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+wne(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+wne(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()&&F2c(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&&!L2c[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 rji=I((D1h,tji)=>{"use strict";p();var Q2c=Zqi(),{Headers:q2c}=uEe(),Xqi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),eji=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),v4r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new Q2c(Xqi(e),eji(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(Xqi(e))}responseHeaders(e){return new q2c(this.policy.responseHeaders(eji(e)))}timeToLive(){return this.policy.timeToLive()}};tji.exports=v4r});var oji=I((O1h,iji)=>{"use strict";p();var{Readable:j2c}=require("stream"),{Headers:nji}=uEe(),{Response:H2c}=_4r(),aV=Symbol("CacheableResponse internals"),G2c=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),b4r=class t extends H2c{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new nji(r.headers);this[aV]={headers:n,bufferedBody:e}}get headers(){return this[aV].headers}set headers(e){if(e instanceof nji)this[aV].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return j2c.from(this[aV].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[aV].bufferedBody}async arrayBuffer(){return G2c(this[aV].bufferedBody)}async text(){return this[aV].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[aV].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},$2c=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 b4r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");iji.exports={cacheableResponse:$2c}});var A1t=I((F1h,sji)=>{"use strict";p();var S4r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};sji.exports={RequestAbortedError:S4r}});var dji=I((q1h,uji)=>{"use strict";p();var cji=require("http"),lji=require("https"),{Readable:V2c}=require("stream"),t9=Wk()("helix-fetch:h1"),{RequestAbortedError:aji}=A1t(),{decodeStream:W2c}=Z6(),z2c=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 lji.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new cji.Agent(n),r.httpAgent):void 0},"getAgent"),Y2c=a(t=>{t.h1={}},"setupContext"),K2c=a(async({h1:t})=>{t.httpAgent&&(t9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(t9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),J2c=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?W2c(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"),Z2c=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?lji:cji,o=z2c(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)=>{t9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{t9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{t9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(t9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new aji),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new aji);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(t9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(J2c(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(t9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(t9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof V2c?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");uji.exports={request:Z2c,setupContext:Y2c,resetContext:K2c}});var mji=I((G1h,hji)=>{"use strict";p();var{connect:X2c,constants:eDc}=require("http2"),{Readable:tDc}=require("stream"),hd=Wk()("helix-fetch:h2"),{RequestAbortedError:fji}=A1t(),{decodeStream:rDc}=Z6(),{NGHTTP2_CANCEL:LLe}=eDc,nDc=300*1e3,iDc=5e3,oDc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),sDc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),hd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),pji=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?rDc(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"),aDc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=iDc}}}=t,d=o[":path"],f=`${e}${d}`;hd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(LLe)},"rejectPush")),n.on("push",(h,m)=>{hd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{hd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(LLe)}),l&&l(f,o,pji(h,n,r))}),n.on("aborted",()=>{hd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{hd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{hd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),cDc=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=nDc,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=()=>(hd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=X2c(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{hd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{hd(`session ${n} established`),hd(`caching session ${n}`),d[n]=w}),w.on("localSettings",Q=>{hd(`session ${n} localSettings: ${JSON.stringify(Q)}`)}),w.on("remoteSettings",Q=>{hd(`session ${n} remoteSettings: ${JSON.stringify(Q)}`)}),w.once("close",()=>{hd(`session ${n} closed`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.once("error",Q=>{hd(`session ${n} encountered error: ${Q}`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(Q,M,O)=>{hd(`session ${n} encountered frameError: type: ${Q}, code: ${M}, id: ${O}`)}),w.once("goaway",(Q,M,O)=>{hd(`session ${n} received GOAWAY frame: errorCode: ${Q}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(Q,M,O)=>{aDc(t,n,v,Q,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(hd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());hd(`${A} ${e.host}${l}`);let R,{signal:x}=g,k=a(()=>{x.removeEventListener("abort",k),T(new fji),R&&R.close(LLe)},"onAbortSignal");if(x){if(x.aborted){T(new fji);return}x.addEventListener("abort",k)}let D=a(N=>{hd(`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",k),b(pji(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",k),R.rstCode!==LLe&&(hd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(LLe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),hd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{hd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof tDc?_.pipe(R):(_&&R.write(_),R.end())})},"request");hji.exports={request:cDc,setupContext:oDc,resetContext:sDc}});var Aji=I((W1h,gji)=>{"use strict";p();var{EventEmitter:lDc}=require("events"),uDc=a(()=>{let t={},e=new lDc;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");gji.exports=uDc});var yji=I((K1h,dDc)=>{dDc.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 bji=I((J1h,vji)=>{"use strict";p();var{Readable:fDc}=require("stream"),pDc=require("tls"),{types:{isAnyArrayBuffer:hDc}}=require("util"),mDc=p4r(),T4r=Wk()("helix-fetch:core"),{RequestAbortedError:y1t}=A1t(),I4r=dji(),E1t=mji(),gDc=Aji(),{isPlainObject:ADc}=Z6(),{isFormData:yDc,FormDataSerializer:EDc}=BLe(),{version:_Dc}=yji(),x4r="h2",w4r="h2c",R4r="http/1.0",Rne="http/1.1",CDc=100,vDc=3600*1e3,bDc=[x4r,Rne,R4r],SDc=`helix-fetch/${_Dc}`,TDc={method:"GET",compress:!0,decode:!0},Eji=0,_ji=gDc(),Cji=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new y1t;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new y1t);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof y1t||(T4r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=pDc.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),Eji+=1,s.id=Eji,s.secureConnecting=!1,T4r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),IDc=a(async(t,e)=>{let r=await _ji.acquire(t.origin);try{return r||(r=await Cji(t,e)),r}finally{_ji.release(t.origin,r)}},"connect"),xDc=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=Rne,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=w4r,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 IDc(e,d);return o=f.alpnProtocol,o||(o=Rne),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),wDc=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),RDc=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 Cji(e,d);return{protocol:f.alpnProtocol||Rne,socket:f}}return{protocol:l.alpnProtocol||Rne,socket:l}},"getProtocolAndSocketFromFactory"),kDc=a(async(t,e,r)=>{let n=new URL(e),o={...TDc,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=wDc(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(yDc(o.body)){let d=new EDc(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":ADc(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):hDc(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 fDc||(!(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 RDc(t.socketFactory,n,o,t.alpnProtocols):await xDc(t,n,c);switch(T4r(`${n.host} -> ${l}`),l){case x4r:try{return await E1t.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 w4r:return E1t.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case R4r:case Rne:return I4r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),PDc=a(async t=>(t.alpnCache.clear(),Promise.all([I4r.resetContext(t),E1t.resetContext(t)])),"resetContext"),DDc=a(t=>{let{options:{alpnProtocols:e=bDc,alpnCacheTTL:r=vDc,alpnCacheSize:n=CDc,userAgent:o=SDc,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new mDc({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,I4r.setupContext(t),E1t.setupContext(t)},"setupContext");vji.exports={request:kDc,setupContext:DDc,resetContext:PDc,RequestAbortedError:y1t,ALPN_HTTP2:x4r,ALPN_HTTP2C:w4r,ALPN_HTTP1_1:Rne,ALPN_HTTP1_0:R4r}});var Tji=I((eSh,Sji)=>{"use strict";p();var NDc=Wk()("helix-fetch:core"),{request:MDc,setupContext:ODc,resetContext:BDc,RequestAbortedError:LDc,ALPN_HTTP2:FDc,ALPN_HTTP2C:UDc,ALPN_HTTP1_1:QDc,ALPN_HTTP1_0:qDc}=bji(),k4r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},ODc(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:LDc,ALPN_HTTP2:FDc,ALPN_HTTP2C:UDc,ALPN_HTTP1_1:QDc,ALPN_HTTP1_0:qDc}}async request(e,r){return MDc(this,e,r)}setCA(e){this.options.ca=e}async reset(){return NDc("resetting context"),BDc(this)}};Sji.exports=new k4r().api()});var kji=I((nSh,Rji)=>{"use strict";p();var{EventEmitter:jDc}=require("events"),{Readable:FLe}=require("stream"),P4r=Wk()("helix-fetch"),HDc=p4r(),{Body:GDc}=u1t(),{Headers:O4r}=uEe(),{Request:kne}=Yqi(),{Response:N4r}=_4r(),{FetchBaseError:$Dc,FetchError:ULe,AbortError:_1t}=g4r(),{AbortController:VDc,AbortSignal:WDc,TimeoutSignal:zDc}=A4r(),YDc=rji(),{cacheableResponse:KDc}=oji(),{sizeof:JDc}=Z6(),{isFormData:ZDc}=BLe(),{context:XDc,RequestAbortedError:eNc}=Tji(),Iji=["GET","HEAD"],tNc=500,rNc=100*1024*1024,D4r="push",xji=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof kne&&typeof r>"u"?e:new kne(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 _1t("The operation was aborted.");throw o.init.body instanceof FLe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof FLe)&&!ZDc(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof FLe&&m.destroy(w),w instanceof TypeError?w:w instanceof eNc?new _1t("The operation was aborted."):new ULe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new _1t("The operation was aborted.");o.init.body instanceof FLe&&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 ULe(`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 ULe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new O4r(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 FLe)throw l&&l.removeEventListener("abort",A),new ULe("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),xji(t,new kne(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new N4r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),wji=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!Iji.includes(e.method))return r;let n=new YDc(e,r,{shared:!1});if(n.storable()){let o=await KDc(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),nNc=a(async(t,e,r)=>{let n=new kne(e,r);if(t.options.maxCacheSize!==0&&Iji.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 O4r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await xji(t,n);return n.cache!=="no-store"?wji(t,n,s):s},"cachingFetch"),iNc=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"),oNc=a(t=>new zDc(t),"timeoutSignal"),M4r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:rNc,o=tNc;n===0&&(n=1,o=1);let s=a(({response:l},u)=>JDc(l),"sizeCalculation");this.cache=new HDc({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new jDc,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 N4r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=XDc(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:GDc,Headers:O4r,Request:kne,Response:N4r,AbortController:VDc,AbortSignal:WDc,FetchBaseError:$Dc,FetchError:ULe,AbortError:_1t,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:iNc,timeoutSignal:oNc,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 nNc(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(D4r,e)}offPush(e){return this.eventEmitter.off(D4r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){P4r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new kne(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(P4r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){P4r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await wji(this,new kne(e,{headers:r}),n);this.eventEmitter.emit(D4r,e,o)}};Rji.exports=new M4r().api()});var Dji=I((sSh,Pji)=>{"use strict";p();Pji.exports=kji()});var eHi=I((lxh,Xji)=>{"use strict";p();function Zji(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(Zji,"validateParameter");function DNc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(DNc,"hasOwnProperty");function NNc(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(NNc,"defineOperation");Xji.exports={defineOperation:NNc,validateParameter:Zji}});var q4r=I((fxh,nHi)=>{"use strict";p();var AEe=g8e()("kerberos"),gEe=AEe.KerberosClient,tHi=AEe.KerberosServer,lV=eHi().defineOperation,MNc=1,ONc=2,BNc=4,LNc=8,FNc=16,UNc=32,QNc=64,qNc=128,jNc=256,rHi=0,HNc=9,GNc=6;gEe.prototype.step=lV(gEe.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);gEe.prototype.wrap=lV(gEe.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);gEe.prototype.unwrap=lV(gEe.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);tHi.prototype.step=lV(tHi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var $Nc=lV(AEe.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}]),VNc=lV(AEe.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),WNc=lV(AEe.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:rHi}},{name:"callback",type:"function",required:!1}]),zNc=lV(AEe.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);nHi.exports={initializeClient:WNc,initializeServer:zNc,principalDetails:VNc,checkPassword:$Nc,GSS_C_DELEG_FLAG:MNc,GSS_C_MUTUAL_FLAG:ONc,GSS_C_REPLAY_FLAG:BNc,GSS_C_SEQUENCE_FLAG:LNc,GSS_C_CONF_FLAG:FNc,GSS_C_INTEG_FLAG:UNc,GSS_C_ANON_FLAG:QNc,GSS_C_PROT_READY_FLAG:qNc,GSS_C_TRANS_FLAG:jNc,GSS_C_NO_OID:rHi,GSS_MECH_OID_KRB5:HNc,GSS_MECH_OID_SPNEGO:GNc}});var iHi=I((hxh,YNc)=>{YNc.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 sHi=I((mxh,oHi)=>{"use strict";p();var KNc=require("dns"),JNc=q4r(),j4r=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=ZNc(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();KNc.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}`;JNc.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 ZNc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=XNc(t),r(null,o)})}}a(ZNc,"firstTransition");function XNc(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=eMc(t),r(null,o||"")})}}a(XNc,"secondTransition");function eMc(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=tMc(t),r(null,c)})})}}a(eMc,"thirdTransition");function tMc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(tMc,"fourthTransition");oHi.exports={MongoAuthProcess:j4r}});var cHi=I((yxh,jLe)=>{"use strict";p();var aHi=q4r();jLe.exports=aHi;jLe.exports.Kerberos=aHi;jLe.exports.version=iHi().version;jLe.exports.processes={MongoAuthProcess:sHi().MongoAuthProcess}});var QXi={};wi(QXi,{AbortError:()=>g1,DirectConnectError:()=>GR,DirectConnectTransport:()=>WLr,EXIT_REASONS:()=>Q5c,HOOK_EVENTS:()=>zTt,InMemorySessionStore:()=>zBr,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>q5c,createSdkMcpServer:()=>EGc,deleteSession:()=>Ezc,filterEscalatingDefaultMode:()=>izc,foldSessionSummary:()=>NVi,forkSession:()=>_zc,getSessionInfo:()=>gzc,getSessionMessages:()=>hzc,getSubagentMessages:()=>Szc,importSessionToStore:()=>Czc,listSessions:()=>mzc,listSubagents:()=>bzc,parseDirectConnectUrl:()=>vGc,query:()=>fzc,renameSession:()=>Azc,resolveSettings:()=>szc,startup:()=>pzc,tagSession:()=>yzc,tool:()=>yGc});function oOc(t){return this[t]}function lOc(t,e){this[t]=cOc.bind(null,e)}function WBr(t=F5c){let e=new AbortController;return(0,wVi.setMaxListeners)(t,e.signal),e}function RVi(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 U5c(t,e){t(Error(e))}function Qne(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(U5c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function A3r(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=H5c.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(!j5c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function NVi(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=W5c(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)}z5c(c,l);for(let[d,f]of Object.entries(G5c)){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 $5c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=fV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=fV(r.customTitle)||fV(r.aiTitle)||void 0,s=o||fV(r.lastPrompt)||fV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:fV(r.gitBranch)||void 0,cwd:fV(r.cwd)||e||void 0,tag:fV(r.tag)||void 0,createdAt:V5c(r.createdAt)}:null}function fV(t){return typeof t=="string"?t:void 0}function V5c(t){return typeof t=="number"?t:void 0}function W5c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function z5c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=A3r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function MVi(){return process.versions.bun!==void 0}function HE(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 tFe(){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 t4c(t){var e=X5c.call(t,VLe),r=t[VLe];try{t[VLe]=void 0;var n=!0}catch{}var o=e4c.call(t);return n&&(e?t[VLe]=r:delete t[VLe]),o}function o4c(t){return i4c.call(t)}function l4c(t){return t==null?t===void 0?c4c:a4c:eGi&&eGi in Object(t)?r4c(t):s4c(t)}function u4c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function m4c(t){if(!p9(t))return!1;var e=rFe(t);return e==f4c||e==p4c||e==d4c||e==h4c}function A4c(t){return!!tGi&&tGi in t}function C4c(t){if(t!=null){try{return _4c.call(t)}catch{}try{return t+""}catch{}}return""}function k4c(t){if(!p9(t)||y4c(t))return!1;var e=y3r(t)?R4c:S4c;return e.test(v4c(t))}function D4c(t,e){return t?.[e]}function M4c(t,e){var r=N4c(t,e);return P4c(r)?r:void 0}function B4c(){this.__data__=I3e?I3e(null):{},this.size=0}function F4c(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function H4c(t){var e=this.__data__;if(I3e){var r=e[t];return r===Q4c?void 0:r}return j4c.call(e,t)?e[t]:void 0}function W4c(t){var e=this.__data__;return I3e?e[t]!==void 0:V4c.call(e,t)}function K4c(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=I3e&&e===void 0?Y4c:e,this}function p_e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function uBc(t,e){var r=this.__data__,n=KTt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function h_e(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 BBc(){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 jVi(...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 HVi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return jVi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function b3r(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 LBc(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 UBc(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 xi(`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 $Vi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Jl(`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 Jl(`Refusing to send credential over non-https token endpoint "${t}"`)}async function VVi(t,e){let r=await VBc(t),n;try{n=JSON.parse(r)}catch{throw new Jl(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,$R(r),e)}if(!n.access_token)throw new Jl(`Token endpoint response missing access_token: ${JSON.stringify($R(n))}`,t.status,$R(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Jl(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,$R(n),e);return n}function $R(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=mBr?t:t.slice(0,mBr)+`... <${t.length-mBr} more chars>`}return JSON.stringify($R(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))$Bc.has(r)&&(e[r]=n);return e}return null}async function WVi(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 Jl(`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 Jl(`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 zVi(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 VBc(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>cGi){let l=cGi-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 qne(){return Math.floor(Date.now()/1e3)}function WBc(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 T3r(t){let e;return(lGi??(e=new globalThis.TextEncoder,lGi=e.encode.bind(e)))(t)}function dGi(t){let e;return(uGi??(e=new globalThis.TextDecoder,uGi=e.decode.bind(e)))(t)}function p3e(){}function K1t(t,e,r){return!e||DSt[t]>DSt[r]?p3e:e[t].bind(e)}function Ug(t){let e=t.logger,r=t.logLevel??"off";if(!e)return zBc;let n=pGi.get(e);if(n&&n[0]===r)return n[1];let o={error:K1t("error",e,r),warn:K1t("warn",e,r),info:K1t("info",e,r),debug:K1t("debug",e,r)};return pGi.set(e,[r,o]),o}function KVi(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(!YBc.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function hGi(t){if(!t)throw new xi("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 xi(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new xi(`Identity token file at ${t} is empty`);return n}}function XBc(t){if(!t)throw new xi("Identity token value is empty");return()=>t}function eLc(t){return async()=>{$Vi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new Jl(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:QBc,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}${GVi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${PSt},${jBc}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${_V} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Jl(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=$R(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 Jl(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await VVi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Jl(`Token endpoint response missing required fields: ${JSON.stringify($R(c))}`,o.status,$R(c),s);return{token:c.access_token,expiresAt:qne()+l}}}function tLc(t){return async e=>{let r=await import("node:fs");await WVi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Jl(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Jl(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Jl(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||qne()"");throw new Jl(`User OAuth refresh failed (HTTP ${f.status}): ${$R(E)}`,f.status,$R(E),h)}let m=await VVi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Jl(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify($R(m))}`,f.status,$R(m),h);let A=qne()+g,y=m.refresh_token||l;return await zVi(t.credentialsPath,{...o,version:YVi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function ZVi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=nLc(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 rLc(t,e){let r=await KBc(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 JBc(n,e)??void 0}};return ZVi(s,t)}function nLc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=iLc(o);if(!s)throw new Jl("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 Jl("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 Jl("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=eLc({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?oLc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Jl("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return tLc({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 Jl(`authentication.type "${o}" is not a known authentication type`)}}}function iLc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Jl(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Jl('identity_token.source "file" requires a non-empty path');return hGi(t.identity_token.path)}let e=Yl("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return hGi(e);let r=Yl("ANTHROPIC_IDENTITY_TOKEN");return r?XBc(r):null}function oLc(t,e,r,n){return async o=>{let s=await import("node:fs");await WVi(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||qne()0&&(yield e)}function uLc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function XVi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return Ug(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Wne.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 eWi(u,r)}return await r.text()})();return Ug(t).debug(`[${n}] response parsed`,Fne({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function eWi(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 FEe(t,e,r){return tWi(),new File(t,e??"unknown_file",r)}function gSt(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 dLc(t){let e=typeof t=="function"?t:t.fetch,r=mGi.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 mGi.set(e,n),n}async function gLc(t,e,r){if(tWi(),t=await t,e||(e=gSt(t,!0)),hLc(t))return t instanceof File&&e==null&&r==null?t:FEe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(mLc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),FEe(await rLr(o),e,r)}let n=await rLr(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 FEe(n,e,r)}async function rLr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(nWi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(rWi(t))for await(let r of t)e.push(...await rLr(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${ALc(t)}`)}return e}function ALc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*yLc(t){if(!t)return;if(iWi 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():nGi(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=nGi(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 oWi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function ASt(t){return typeof t=="object"&&t!==null&&v3e in t}function sWi(t,e){let r=new Set;if(t)for(let n of t)ASt(n)&&r.add(n[v3e]);if(e){for(let n of e)if(ASt(n)&&r.add(n[v3e]),Array.isArray(n.content))for(let o of n.content)ASt(o)&&r.add(o[v3e])}return Array.from(r)}function aWi(t,e){let r=sWi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function _Lc(t){return ASt(t)?{"x-stainless-helper":t[v3e]}:{}}function lWi(t){return t?.output_format??t?.output_config?.format}function AGi(t,e,r){let n=lWi(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}:uWi(t,e,r)}function uWi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=CLc(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 CLc(t,e){let r=lWi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new xi(`Failed to parse structured output: ${n}`)}}function CGi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function bGi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function xLc(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 GSt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function TGi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new xi("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 fWi(t){return t?.output_config?.format}function IGi(t,e,r){let n=fWi(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}:pWi(t,e,r)}function pWi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=RLc(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 RLc(t,e){let r=fWi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new xi(`Failed to parse structured output: ${n}`)}}function kGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function nFe(t){return t instanceof Error?t:Error(String(t))}function ESt(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 iFe(t){return pI(t)==="ENOENT"}function mWi(t){return pI(t)==="EISDIR"}function NLc(t){let e=pI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function BLc(t,e,r){let n=`${t}.tmp.${(0,yWi.randomBytes)(4).toString("hex")}`;try{await(0,cB.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,cB.rename)(n,t)}catch(o){let s=pI(o);if(s!==void 0&&MLc.has(s)){try{await(0,cB.copyFile)(n,t)}catch(c){throw OLc.has(pI(c)??"")&&await(0,cB.unlink)(t).catch(()=>{}),c}await(0,cB.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,cB.unlink)(n).catch(()=>{}),o}}function XSt(){return LLc.getStore()??new cLr}function EWi(){if(wEe)return wEe;if(!HE(process.env.DEBUG_CLAUDE_AGENT_SDK))return jne=null,wEe=Promise.resolve(),wEe;let t=(0,aLr.join)(g_e(),"debug");return jne=(0,aLr.join)(t,`sdk-${(0,gWi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${jne} -`),wEe=XSt().mkdir(t).catch(()=>{}),wEe}function FLc(){return EWi(),jne??null}function jR(t){if(jne===null)return;let e=`${new Date().toISOString()} ${t} -`;EWi().then(()=>{jne&&XSt().append(jne,e).catch(()=>{})})}function ULc(){this.__data__=new JTt,this.size=0}function qLc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function HLc(t){return this.__data__.get(t)}function $Lc(t){return this.__data__.has(t)}function zLc(t,e){var r=this.__data__;if(r instanceof JTt){var n=r.__data__;if(!LVi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=C3c}function W3c(t){return y_e(t)&&P3r(t.length)&&!!md[rFe(t)]}function Y3c(t){return function(e){return t(e)}}function rFc(t,e){var r=IV(t),n=!r&&D3e(t),o=!r&&!n&&k3r(t),s=!r&&!n&&!o&&SWi(t),c=r||n||o||s,l=c?o3c(t.length,String):[],u=l.length;for(var d in t)(e||tFc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||XTt(d,u)))&&l.push(d);return l}function oFc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||iFc;return t===r}function sFc(t,e){return function(r){return t(e(r))}}function cFc(t){return t!=null&&P3r(t.length)&&!y3r(t)}function lFc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function pFc(t){if(!p9(t))return uFc(t);var e=TWi(t),r=[];for(var n in t)n=="constructor"&&(e||!fFc.call(t,n))||r.push(n);return r}function mFc(t){return D3r(t)?nFc(t,!0):hFc(t)}function AFc(t,e){if(e)return t.slice();var r=t.length,n=FGi?FGi(r):new t.constructor(r);return t.copy(n),n}function yFc(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 R8c(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function P8c(t){return k8c.register(t)}function N8c(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 M8c(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 O8c(t,e){if(!e)return!0;let r=N8c(t);return M8c(r,e)}function B8c(t){return/^[\\/]{2}/.test(t)}function L8c(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function HGi(t){try{return L8c(MWi.realpathSync.native(t))}catch{return null}}function F8c(t,e){let r=(0,lB.resolve)(e).toLowerCase(),n=(0,lB.resolve)(t).toLowerCase();if((0,lB.dirname)(n)===r||n.startsWith(r+lB.sep))return!0;let o=HGi(e)?.toLowerCase();if(o==null)return!1;let s=HGi((0,lB.dirname)((0,lB.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+lB.sep)}function OWi(t,e){if(B8c(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 hI(){return Q8c}function q8c(t,e){t.destroyed||t.write(e)}function j8c(t){q8c(process.stderr,t)}function H8c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function G8c(t,e,r=e+"s"){return t===1?e:r}function $8c(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function Y8c(t){return z8c.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function K8c(t){VGi??=Y8c(!0);for(let e of VGi)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 tIt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function e6c(t){if(!pLr()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=X8c();return O8c(t,e)}async function FWi(t,e,r=r6c){if(c3e<0?c3e=await(0,VE.stat)(t).then(n=>n.size).catch(()=>0):c3e+=e,!(c3e<=r||xBr)){xBr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,VE.rename)(t,n)}catch(o){iFe(o)||(await(0,VE.unlink)(n).catch(()=>{}),await(0,VE.rename)(t,n).catch(()=>(0,VE.unlink)(t).catch(()=>{})))}c3e=0}finally{xBr=!1}}}function UWi(t){return hLr=(0,eie.join)(t,`${NWi()}.txt`),hLr}async function n6c(t,e,r,n){t&&await(0,VE.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,VE.appendFile)(r,n)}catch(s){if(!mWi(s))throw s;o=UWi(r),await(0,VE.appendFile)(o,n)}await FWi(o,Buffer.byteLength(n)).catch(mLr),qWi()}function mLr(){}function i6c(){if(!dSt){let t=null;dSt=w8c({writeFn:a(e=>{let r=QWi(),n=(0,eie.dirname)(r),o=t!==n;if(t=n,pLr()){if(o)try{hI().mkdirSync(n)}catch{}let s=r;try{hI().appendFileSync(r,e)}catch(c){if(!mWi(c))throw c;s=UWi(r),hI().appendFileSync(s,e)}FWi(s,Buffer.byteLength(e)).catch(mLr),qWi();return}IBr=IBr.then(n6c.bind(null,o,n,r,e)).catch(mLr)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:pLr()}),P8c(async()=>{dSt?.dispose(),await IBr})}return dSt}function Kl(t,{level:e}={level:"debug"}){if(fLr[e]t.endsWith(e))}function h6c(t,e){return(0,PVi.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 m6c(){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 g6c(t,e=process.platform,r=process.arch,n=jWi.existsSync,o=m6c()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${REe}-linux-${r}-android`]:e==="linux"?o?[`${REe}-linux-${r}-musl`,`${REe}-linux-${r}`]:[`${REe}-linux-${r}`,`${REe}-linux-${r}-musl`]:[`${REe}-${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 A6c(){return{eventQueue:[],sink:null}}function F3r(t,e){let r=y6c;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function HWi(t){F3r("tengu_feature_ok",{feature_name:t})}function GWi(t,e,r){F3r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function E6c(t,e,r){F3r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function s9(t,e,r){try{let n=await e();return HWi(t),n}catch(n){throw GWi(t,r?.(n)??"error"),n}}function C6c(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 S3e(t){if(typeof t=="string")return C6c(t);if(Array.isArray(t))return t.map(S3e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[S3e(r)]=S3e(n);return e}return t}function v6c(){return process.platform==="win32"}function S6c(t){let e=wBr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,KWi.join)(r,"System32","where.exe");try{let o=(0,YWi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:b6c,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!F8c(c,s))return wBr.set(t,c),c;return null}catch(o){return T6c(o)&&wBr.set(t,null),null}}function T6c(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 I6c(t){return!v6c()||t.includes("/")||t.includes("\\")?t:S6c(t)}async function oFe(t){let e=I6c("git");if(e===null)return[];try{let{stdout:r}=await x6c(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 w6c(t){let e=0;for(let r=0;ro&&(n=JWi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function CLr(t,e){let r=(0,VWi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` -`)||await(0,_Lr.once)(r,"drain");r.end(),await(0,_Lr.once)(r,"finish")}catch(n){throw r.destroy(),n}}function ZWi(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=A3r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function k6c(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=A3r(r,e);if(n!==void 0)return n}return e.commandFallback}async function XWi(t){try{let e=await(0,lN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(u9),o=await e.read(n,0,u9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-u9),l=s;if(c>0){let u=await e.read(n,0,u9,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 P6c(t){return Math.abs(w6c(t)).toString(36)}function sFe(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=N3e?e:`${e.slice(0,N3e)}-${P6c(t)}`}function PV(){return(0,WEe.join)(g_e(),"projects")}function D6c(t){return(0,WEe.join)(PV(),sFe(t))}async function aFe(t){try{return(await(0,lN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function aN(t){let e=D6c(t),r=[];try{await(0,lN.readdir)(e),r.push(e)}catch{}let n=sFe(t);if(n.length<=N3e)return r;let o=n.slice(0,N3e)+"-",s=PV();try{for(let c of await(0,lN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,WEe.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function rIt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,WEe.join)(c,r);try{let d=await(0,lN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await aFe(e);for(let u of await aN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await oFe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await aN(u)){let f=await n(d,u);if(f)return f}return}let o=PV(),s;try{s=await(0,lN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,WEe.join)(o,c),void 0);if(l)return l}}function B6c(){return O6c??=Buffer.from('"compact_boundary"')}function ezi(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 Hne(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 oTt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function Q6c(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(M3e);if(o===-1||o>=r)return 0;let s=o+1;if(oTt(n,sTt,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 H6c(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 G6c(t){if(t.carryLen>0){let e=t.carryBuf;oTt(e,sTt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Hne(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==M3e&&Hne(t.out,F6c,0,1),Hne(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function $6c(t,e){let r=B6c(),n=N6c,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,lN.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=q6c(o,f,r);j6c(o,f,s,h.lastSnapStart,h.lastSnapEnd),H6c(o,f,h.trailStart),o.bufFileOff+=h.trailStart}G6c(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function V6c(t,e){try{return e>M6c&&!HE(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await $6c(t,e)).postBoundaryBuf:await(0,$Wi.readFile)(t)}catch{return null}}function W6c(t){let e=[];try{let o=Vd(e,zd`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=a6c(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{Wd(e,r,n)}}function z6c(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(),K6c(e,d,f)}function kBr(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 Y6c(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 K6c(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=kBr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=kBr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(Y6c(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=kBr(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 J6c(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function tzi(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 rzi(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 Z6c(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 nzi(r,e)}function nzi(t,e){let r=z6c(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>J6c(s,n)).map(s=>tzi(s));return rzi(o,e)}async function X6c(t,e){if(!uh(t))return[];let r=await rIt(t,e?.dir);if(!r)return[];let n=await V6c(r.filePath,r.fileSize);return n?nzi(W6c(n),e):[]}function nIt(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=HR(o,"customTitle")||HR(n,"customTitle")||HR(o,"aiTitle")||HR(n,"aiTitle")||void 0,f=ZWi(n)||void 0,h=RBr(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||HR(o,"lastPrompt")||HR(o,"summary")||f;if(!g)return null;let A=HR(o,"gitBranch")||RBr(n,"gitBranch")||void 0,y=RBr(n,"cwd")||r||void 0,E=o.split(` -`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&HR(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 y3e(t,e,r){let n;try{n=await(0,E_e.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=uh(o.slice(0,-6));if(!s)return null;let c=(0,__e.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,E_e.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function izi(t){let e=await XWi(t.filePath);if(!e)return null;let r=nIt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function t9c(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function r9c(t,e,r){t.sort(t9c);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 i9c(t,e,r){let n=await aFe(t),o;if(e)try{o=await oFe(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await aN(n))h.push(...await y3e(m,r,n));return h}let s=PV(),c=process.platform==="win32",l=o.map(h=>{let m=sFe(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,E_e.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await aN(n))h.push(...await y3e(m,r,n));return h}let d=[],f=new Set;for(let h of await aN(n)){let m=(0,__e.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await y3e(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>=N3e&&m.startsWith(A+"-")){f.add(m),d.push(...await y3e((0,__e.join)(s,h.name),r,g));break}}}return d}async function o9c(t){let e=PV(),r;try{r=await(0,E_e.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>y3e((0,__e.join)(e,n.name),t)))).flat()}async function s9c(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 i9c(e,o??!0,c):await o9c(c);return c?r9c(l,r,s):n9c(l)}async function a9c(t,e={}){let r=uh(t);if(!r)return;let n=await rIt(r,e.dir);if(!n)return;let o=await XWi(n.filePath);if(o)return nIt(r,o,n.projectPath)??void 0}async function c9c(t,e,r={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=I0({type:"custom-title",customTitle:e.trim(),sessionId:t})+` -`;await ozi(t,n,r)}async function l9c(t,e,r={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=S3e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=I0({type:"tag",tag:e??"",sessionId:t})+` -`;await ozi(t,n,r)}async function u9c(t,e={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await d9c(e)){let n=(0,Gne.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,uB.stat)(n))}catch(s){let c=pI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,uB.rm)(n,{force:!0}),await(0,uB.rm)((0,Gne.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 d9c(t){if(t.dir){let r=await aFe(t.dir),n=await aN(r),o;try{o=await oFe(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await aN(s));return n}let e=PV();try{return(await(0,uB.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Gne.join)(e,r.name))}catch{return[]}}async function ozi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await aFe(r.dir);for(let u of await aN(c))if(await PBr((0,Gne.join)(u,n),e))return;let l;try{l=await oFe(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await aN(u))if(await PBr((0,Gne.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=PV(),s;try{s=await(0,uB.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await PBr((0,Gne.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function PBr(t,e){let r;try{r=await(0,uB.open)(t,vLr.constants.O_WRONLY|vLr.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 f9c(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await XSt().readBytes((0,aTt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await aFe(e);for(let u of await aN(c)){let d=await n(u);if(d)return d}let l;try{l=await oFe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await aN(u)){let f=await n(d);if(f)return f}return null}let o=PV(),s;try{s=await XSt().list(o)}catch{return null}for(let c of s){let l=await n((0,aTt.join)(o,c));if(l)return l}return null}function h9c(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{szi(hN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function m9c(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||szi(o,e,r,n);return{transcript:r,contentReplacements:n}}function szi(t,e,r,n){p9c.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 g9c(t,e={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!uh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await f9c(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}=A9c(r.buf,t,e);return await CLr((0,aTt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function A9c(t,e,r){let n=h9c(t,e);return azi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,u9)),c=t.toString("utf-8",Math.max(0,o-u9));return HR(c,"customTitle")||HR(s,"customTitle")||HR(c,"aiTitle")||HR(s,"aiTitle")||ZWi(s)})}function y9c(t,e,r){let n=m9c(t,e);return azi(n,e,r,()=>E9c(t))}function E9c(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||k6c(t)||void 0}function azi(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,E3e.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,E3e.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,E3e.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,E3e.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function czi(t,e){let r=await rIt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,cTt.join)(n,"subagents")}async function lzi(t){let e=[];async function r(n){let o;try{o=await(0,O3e.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,cTt.join)(n,s.name)})}else s.isDirectory()&&await r((0,cTt.join)(n,s.name))}return a(r,"J"),await r(t),e}function _9c(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=hN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function C9c(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 v9c(t,e){if(!uh(t))return[];let r=await czi(t,e?.dir);return r?(await lzi(r)).map(n=>n.agentId):[]}async function b9c(t,e,r){if(!uh(t))return[];if(!e)return[];let n=await czi(t,r?.dir);if(!n)return[];let o=(await lzi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,O3e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=hN(await(0,O3e.readFile)(l,"utf-8")).toolUseId}catch{}return uzi(s,r,c)}function uzi(t,e,r){if(t.length===0)return[];let n=_9c(t),o=C9c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>tzi(s,r));return rzi(o,e)}function pzi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function hzi(t){return[...new Set(t)]}function S9c(){return"prod"}function k9c(){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 D9c(){let t=(()=>{switch(S9c()){case"local":return k9c();case"staging":return R9c??YGi;case"prod":return YGi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!P9c.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 M9c(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"):g_e(),o=r?"":`-${(0,dzi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${D9c().OAUTH_FILE_SUFFIX}${t}${o}`}function B9c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,fzi.userInfo)().username}catch{t="claude-code-user"}return O9c.test(t)?t:"claude-code-user"}function bLr(){return F9c}function ln(t,e){let r=bLr(),n=SLr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===B3e?void 0:B3e].filter(o=>!!o)});t.common.issues.push(n)}function Yo(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 Azi(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 tUc(t){return new RegExp(`^${Azi(t)}$`)}function rUc(t){let e=`${gzi}T${Azi(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 nUc(t,e){return!!((e==="v4"||!e)&&z9c.test(t)||(e==="v6"||!e)&&K9c.test(t))}function iUc(t,e){if(!G9c.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 oUc(t,e){return!!((e==="v4"||!e)&&Y9c.test(t)||(e==="v6"||!e)&&J9c.test(t))}function sUc(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 NEe(t){if(t instanceof mI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=zR.create(NEe(n))}return new mI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof wV?new wV({...t._def,type:NEe(t.element)}):t instanceof zR?zR.create(NEe(t.unwrap())):t instanceof m9?m9.create(NEe(t.unwrap())):t instanceof h9?h9.create(t.items.map(e=>NEe(e))):t}function ILr(t,e){let r=yV(t),n=yV(e);if(t===e)return{valid:!0,data:t};if(r===Rn.object&&n===Rn.object){let o=lc.objectKeys(e),s=lc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=ILr(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 QC(t){return t&&Object.assign(fTt,t),fTt}function cUc(t){return t}function lUc(t){return t}function uUc(t){}function dUc(t){throw Error()}function fUc(t){}function q3r(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 $r(t,e="|"){return t.map(r=>os(r)).join(e)}function vzi(t,e){return typeof e=="bigint"?e.toString():e}function iIt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function tie(t){return t==null}function oIt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function bzi(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 Vc(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 j3r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function pUc(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function hUc(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 yUc(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 os(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Izi(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function EUc(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 mN(t,{...t._zod.def,shape:r,checks:[]})}function _Uc(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 mN(t,{...t._zod.def,shape:r,checks:[]})}function CUc(t,e){if(!z3e(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 j3r(this,"shape",n),n},checks:[]};return mN(t,r)}function vUc(t,e){return mN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return j3r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function bUc(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 mN(e,{...e._zod.def,shape:o,checks:[]})}function SUc(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 mN(e,{...e._zod.def,shape:o,checks:[]})}function UEe(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function C3e(t){return typeof t=="string"?t:t?.message}function dN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=C3e(t.inst?._zod.def?.error?.(t))??C3e(e?.error?.(t))??C3e(r.customError?.(t))??C3e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function sIt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function aIt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Rzi(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function TUc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function $3r(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 V3r(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 ${Dzi(n.path)}`);return e.join(` -`)}function Hzi(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Xzi(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 eYi(t){return new RegExp(`^${Xzi(t)}$`)}function tYi(t){let e=Xzi({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(`^${Jzi}T(?:${n})$`)}function e$i(t,e,r){t.issues.length&&e.issues.push(...VR(r,t.issues))}function tFr(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function JYi(t){if(!Z3r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return tFr(r)}function eKi(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 t$i(t,e,r){t.issues.length&&e.issues.push(...VR(r,t.issues)),e.value[r]=t.value}function fSt(t,e,r){t.issues.length&&e.issues.push(...VR(r,t.issues)),e.value[r]=t.value}function r$i(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(...VR(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function n$i(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=>dN(s,n,QC())))}),e}function kLr(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(z3e(t)&&z3e(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=kLr(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;ndN(l,c,QC()))})),e.issues.length&&(pTt.has(typeof n)?r.issues.push(...VR(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>dN(l,c,QC()))})),r.value.set(t.value,e.value)}function s$i(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function a$i(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function c$i(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 l$i(t,e,r){return UEe(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function u$i(t){return t.value=Object.freeze(t.value),t}function d$i(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(Rzi(o))}}function LUc(){return{localeError:BUc()}}function UUc(){return{localeError:FUc()}}function f$i(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 qUc(){return{localeError:QUc()}}function HUc(){return{localeError:jUc()}}function $Uc(){return{localeError:GUc()}}function WUc(){return{localeError:VUc()}}function NKi(){return{localeError:YUc()}}function ZUc(){return{localeError:JUc()}}function e7c(){return{localeError:XUc()}}function r7c(){return{localeError:t7c()}}function i7c(){return{localeError:n7c()}}function s7c(){return{localeError:o7c()}}function c7c(){return{localeError:a7c()}}function u7c(){return{localeError:l7c()}}function f7c(){return{localeError:d7c()}}function h7c(){return{localeError:p7c()}}function g7c(){return{localeError:m7c()}}function y7c(){return{localeError:A7c()}}function _7c(){return{localeError:E7c()}}function v7c(){return{localeError:C7c()}}function S7c(){return{localeError:b7c()}}function I7c(){return{localeError:T7c()}}function w7c(){return{localeError:x7c()}}function k7c(){return{localeError:R7c()}}function D7c(){return{localeError:P7c()}}function M7c(){return{localeError:N7c()}}function B7c(){return{localeError:O7c()}}function F7c(){return{localeError:L7c()}}function p$i(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 Q7c(){return{localeError:U7c()}}function j7c(){return{localeError:q7c()}}function G7c(){return{localeError:H7c()}}function V7c(){return{localeError:$7c()}}function z7c(){return{localeError:W7c()}}function J7c(){return{localeError:K7c()}}function X7c(){return{localeError:Z7c()}}function tQc(){return{localeError:eQc()}}function nQc(){return{localeError:rQc()}}function oQc(){return{localeError:iQc()}}function aQc(){return{localeError:sQc()}}function dFr(){return new Y3e}function BKi(t,e){return new t({type:"string",...Ir(e)})}function LKi(t,e){return new t({type:"string",coerce:!0,...Ir(e)})}function fFr(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Ir(e)})}function yTt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Ir(e)})}function pFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Ir(e)})}function hFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ir(e)})}function mFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ir(e)})}function gFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ir(e)})}function AFr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ir(e)})}function yFr(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Ir(e)})}function EFr(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ir(e)})}function _Fr(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Ir(e)})}function CFr(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ir(e)})}function vFr(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Ir(e)})}function bFr(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Ir(e)})}function SFr(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ir(e)})}function TFr(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ir(e)})}function IFr(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ir(e)})}function xFr(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ir(e)})}function wFr(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ir(e)})}function RFr(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Ir(e)})}function kFr(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Ir(e)})}function PFr(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Ir(e)})}function DFr(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Ir(e)})}function UKi(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ir(e)})}function QKi(t,e){return new t({type:"string",format:"date",check:"string_format",...Ir(e)})}function qKi(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Ir(e)})}function jKi(t,e){return new t({type:"string",format:"duration",check:"string_format",...Ir(e)})}function HKi(t,e){return new t({type:"number",checks:[],...Ir(e)})}function GKi(t,e){return new t({type:"number",coerce:!0,checks:[],...Ir(e)})}function $Ki(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ir(e)})}function VKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Ir(e)})}function WKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Ir(e)})}function zKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Ir(e)})}function YKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Ir(e)})}function KKi(t,e){return new t({type:"boolean",...Ir(e)})}function JKi(t,e){return new t({type:"boolean",coerce:!0,...Ir(e)})}function ZKi(t,e){return new t({type:"bigint",...Ir(e)})}function XKi(t,e){return new t({type:"bigint",coerce:!0,...Ir(e)})}function eJi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ir(e)})}function tJi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ir(e)})}function rJi(t,e){return new t({type:"symbol",...Ir(e)})}function nJi(t,e){return new t({type:"undefined",...Ir(e)})}function iJi(t,e){return new t({type:"null",...Ir(e)})}function oJi(t){return new t({type:"any"})}function ETt(t){return new t({type:"unknown"})}function sJi(t,e){return new t({type:"never",...Ir(e)})}function aJi(t,e){return new t({type:"void",...Ir(e)})}function cJi(t,e){return new t({type:"date",...Ir(e)})}function lJi(t,e){return new t({type:"date",coerce:!0,...Ir(e)})}function uJi(t,e){return new t({type:"nan",...Ir(e)})}function Jne(t,e){return new X3r({check:"less_than",...Ir(e),value:t,inclusive:!1})}function cN(t,e){return new X3r({check:"less_than",...Ir(e),value:t,inclusive:!0})}function Zne(t,e){return new eFr({check:"greater_than",...Ir(e),value:t,inclusive:!1})}function dI(t,e){return new eFr({check:"greater_than",...Ir(e),value:t,inclusive:!0})}function dJi(t){return Zne(0,t)}function fJi(t){return Jne(0,t)}function pJi(t){return cN(0,t)}function hJi(t){return dI(0,t)}function K3e(t,e){return new fYi({check:"multiple_of",...Ir(e),value:t})}function dIt(t,e){return new mYi({check:"max_size",...Ir(e),maximum:t})}function J3e(t,e){return new gYi({check:"min_size",...Ir(e),minimum:t})}function NFr(t,e){return new AYi({check:"size_equals",...Ir(e),size:t})}function fIt(t,e){return new yYi({check:"max_length",...Ir(e),maximum:t})}function c_e(t,e){return new EYi({check:"min_length",...Ir(e),minimum:t})}function pIt(t,e){return new _Yi({check:"length_equals",...Ir(e),length:t})}function MFr(t,e){return new CYi({check:"string_format",format:"regex",...Ir(e),pattern:t})}function OFr(t){return new vYi({check:"string_format",format:"lowercase",...Ir(t)})}function BFr(t){return new bYi({check:"string_format",format:"uppercase",...Ir(t)})}function LFr(t,e){return new SYi({check:"string_format",format:"includes",...Ir(e),includes:t})}function FFr(t,e){return new TYi({check:"string_format",format:"starts_with",...Ir(e),prefix:t})}function UFr(t,e){return new IYi({check:"string_format",format:"ends_with",...Ir(e),suffix:t})}function mJi(t,e,r){return new xYi({check:"property",property:t,schema:e,...Ir(r)})}function QFr(t,e){return new wYi({check:"mime_type",mime:t,...Ir(e)})}function nie(t){return new RYi({check:"overwrite",tx:t})}function qFr(t){return nie(e=>e.normalize(t))}function jFr(){return nie(t=>t.trim())}function HFr(){return nie(t=>t.toLowerCase())}function GFr(){return nie(t=>t.toUpperCase())}function $Fr(t,e,r){return new t({type:"array",element:e,...Ir(r)})}function cQc(t,e,r){return new t({type:"union",options:e,...Ir(r)})}function lQc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Ir(n)})}function uQc(t,e,r){return new t({type:"intersection",left:e,right:r})}function gJi(t,e,r,n){let o=r instanceof bo;return new t({type:"tuple",items:e,rest:o?r:null,...Ir(o?n:r)})}function dQc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Ir(n)})}function fQc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Ir(n)})}function pQc(t,e,r){return new t({type:"set",valueType:e,...Ir(r)})}function hQc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Ir(r)})}function mQc(t,e,r){return new t({type:"enum",entries:e,...Ir(r)})}function gQc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Ir(r)})}function AJi(t,e){return new t({type:"file",...Ir(e)})}function AQc(t,e){return new t({type:"transform",transform:e})}function yQc(t,e){return new t({type:"optional",innerType:e})}function EQc(t,e){return new t({type:"nullable",innerType:e})}function _Qc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function CQc(t,e,r){return new t({type:"nonoptional",innerType:e,...Ir(r)})}function vQc(t,e){return new t({type:"success",innerType:e})}function bQc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function SQc(t,e,r){return new t({type:"pipe",in:e,out:r})}function TQc(t,e){return new t({type:"readonly",innerType:e})}function IQc(t,e,r){return new t({type:"template_literal",parts:e,...Ir(r)})}function xQc(t,e){return new t({type:"lazy",getter:e})}function wQc(t,e){return new t({type:"promise",innerType:e})}function yJi(t,e,r){let n=Ir(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function EJi(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Ir(r)})}function _Ji(t,e){let r=Ir(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??lFr,u=t.Boolean??nFr,d=t.String??uFe,f=new(t.Transform??cFr)({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 CJi(t,e,r,n={}){let o=Ir(n),s={...Ir(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 vJi(t){return new _Tt({type:"function",input:Array.isArray(t?.input)?gJi(uIt,t?.input):t?.input??$Fr(oFr,ETt(ATt)),output:t?.output??ETt(ATt)})}function VFr(t,e){if(t instanceof Y3e){let n=new Z3e(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 Z3e(e);return r.process(t),r.emit(t,e)}function Sm(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 Sm(n.element,r);case"object":{for(let o in n.shape)if(Sm(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(Sm(o,r))return!0;return!1}case"intersection":return Sm(n.left,r)||Sm(n.right,r);case"tuple":{for(let o of n.items)if(Sm(o,r))return!0;return!!(n.rest&&Sm(n.rest,r))}case"record":return Sm(n.keyType,r)||Sm(n.valueType,r);case"map":return Sm(n.keyType,r)||Sm(n.valueType,r);case"set":return Sm(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Sm(n.innerType,r);case"lazy":return Sm(n.getter(),r);case"default":return Sm(n.innerType,r);case"prefault":return Sm(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Sm(n.in,r)||Sm(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function h$i(t,e){let r={type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},...Hs.normalizeParams(e)};return new PQc(r)}function fB(t){return!!t._zod}function OEe(t){let e=Object.values(t);if(e.length===0)return h$i({});let r=e.every(fB),n=e.every(o=>!fB(o));if(r)return h$i(t);if(n)return aUc(t);throw Error("Mixed Zod versions detected in object shape.")}function T3e(t,e){return fB(t)?cIt(t,e):t.safeParse(e)}async function NBr(t,e){return fB(t)?await lIt(t,e):await t.safeParseAsync(e)}function dFe(t){if(!t)return;let e;if(fB(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function l3e(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 OEe(t)}}if(fB(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 MBr(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 DQc(t){return t.description}function NQc(t){if(fB(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function bJi(t){if(fB(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 SJi(t){return UKi(zFr,t)}function TJi(t){return QKi(YFr,t)}function IJi(t){return qKi(KFr,t)}function xJi(t){return jKi(JFr,t)}function bt(t){return BKi(hIt,t)}function OQc(t){return fFr(XFr,t)}function BQc(t){return yTt(CTt,t)}function LQc(t){return pFr(f9,t)}function FQc(t){return hFr(f9,t)}function UQc(t){return mFr(f9,t)}function QQc(t){return gFr(f9,t)}function qQc(t){return AFr(e8r,t)}function jQc(t){return yFr(t8r,t)}function HQc(t){return EFr(r8r,t)}function GQc(t){return _Fr(n8r,t)}function $Qc(t){return CFr(i8r,t)}function VQc(t){return vFr(o8r,t)}function WQc(t){return bFr(s8r,t)}function zQc(t){return SFr(a8r,t)}function YQc(t){return TFr(c8r,t)}function KQc(t){return IFr(l8r,t)}function JQc(t){return xFr(u8r,t)}function ZQc(t){return wFr(d8r,t)}function XQc(t){return RFr(f8r,t)}function eqc(t){return kFr(p8r,t)}function tqc(t){return PFr(h8r,t)}function rqc(t){return DFr(m8r,t)}function nqc(t,e,r={}){return CJi(NJi,t,e,r)}function Dc(t){return HKi(mIt,t)}function PLr(t){return $Ki(C_e,t)}function iqc(t){return VKi(C_e,t)}function oqc(t){return WKi(C_e,t)}function sqc(t){return zKi(C_e,t)}function aqc(t){return YKi(C_e,t)}function Tm(t){return KKi(gIt,t)}function cqc(t){return ZKi(AIt,t)}function lqc(t){return eJi(g8r,t)}function uqc(t){return tJi(g8r,t)}function dqc(t){return rJi(MJi,t)}function fqc(t){return nJi(OJi,t)}function A8r(t){return iJi(BJi,t)}function pqc(){return oJi(LJi)}function Kd(){return ETt(FJi)}function yIt(t){return sJi(UJi,t)}function hqc(t){return aJi(QJi,t)}function mqc(t){return cJi(y8r,t)}function _a(t,e){return $Fr(qJi,t,e)}function gqc(t){let e=t._zod.def.shape;return ei(Object.keys(e))}function Cn(t,e){let r={type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},...Hs.normalizeParams(e)};return new EIt(r)}function Aqc(t,e){return new EIt({type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},catchall:yIt(),...Hs.normalizeParams(e)})}function LC(t,e){return new EIt({type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},catchall:Kd(),...Hs.normalizeParams(e)})}function Xl(t,e){return new E8r({type:"union",options:t,...Hs.normalizeParams(e)})}function _8r(t,e,r){return new jJi({type:"union",options:e,discriminator:t,...Hs.normalizeParams(r)})}function _It(t,e){return new HJi({type:"intersection",left:t,right:e})}function yqc(t,e,r){let n=e instanceof bo,o=n?r:e;return new GJi({type:"tuple",items:t,rest:n?e:null,...Hs.normalizeParams(o)})}function Zl(t,e,r){return new C8r({type:"record",keyType:t,valueType:e,...Hs.normalizeParams(r)})}function Eqc(t,e,r){return new C8r({type:"record",keyType:Xl([t,yIt()]),valueType:e,...Hs.normalizeParams(r)})}function _qc(t,e,r){return new $Ji({type:"map",keyType:t,valueType:e,...Hs.normalizeParams(r)})}function Cqc(t,e){return new VJi({type:"set",valueType:t,...Hs.normalizeParams(e)})}function _1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new X3e({type:"enum",entries:r,...Hs.normalizeParams(e)})}function vqc(t,e){return new X3e({type:"enum",entries:t,...Hs.normalizeParams(e)})}function ei(t,e){return new WJi({type:"literal",values:Array.isArray(t)?t:[t],...Hs.normalizeParams(e)})}function bqc(t){return AJi(zJi,t)}function b8r(t){return new v8r({type:"transform",transform:t})}function gd(t){return new S8r({type:"optional",innerType:t})}function vTt(t){return new YJi({type:"nullable",innerType:t})}function Sqc(t){return gd(vTt(t))}function JJi(t,e){return new KJi({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function XJi(t,e){return new ZJi({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function eZi(t,e){return new T8r({type:"nonoptional",innerType:t,...Hs.normalizeParams(e)})}function Tqc(t){return new tZi({type:"success",innerType:t})}function nZi(t,e){return new rZi({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Iqc(t){return uJi(iZi,t)}function bTt(t,e){return new I8r({type:"pipe",in:t,out:e})}function sZi(t){return new oZi({type:"readonly",innerType:t})}function xqc(t,e){return new aZi({type:"template_literal",parts:t,...Hs.normalizeParams(e)})}function lZi(t){return new cZi({type:"lazy",getter:t})}function wqc(t){return new uZi({type:"promise",innerType:t})}function dZi(t,e){let r=new dh({check:"custom",...Hs.normalizeParams(e)});return r._zod.check=t,r}function fZi(t,e){return yJi(CIt,t??(()=>!0),e)}function pZi(t,e={}){return EJi(CIt,t,e)}function hZi(t,e){let r=dZi(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Hs.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(Hs.issue(s))}},t(n.value,n)),e);return r}function Rqc(t,e={error:`Input not instance of ${t.name}`}){let r=new CIt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Hs.normalizeParams(e)});return r._zod.bag.Class=t,r}function Pqc(t){let e=lZi(()=>Xl([bt(t),Dc(),Tm(),A8r(),_a(e),Zl(bt(),e)]));return e}function x8r(t,e){return bTt(b8r(t),e)}function Nqc(t){QC({customError:t})}function Mqc(){return QC().customError}function Oqc(t){return LKi(hIt,t)}function Bqc(t){return GKi(mIt,t)}function Lqc(t){return JKi(gIt,t)}function Fqc(t){return XKi(AIt,t)}function Uqc(t){return lJi(y8r,t)}function hHc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function mHc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Lne(t){return t==="completed"||t==="failed"||t==="cancelled"}function NZi(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function fl(t,e,r,n,o){t[e]=r,NZi(t,e,n,o)}function E1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?MZi(e,t.currentPath):e.join("/")}}function bHc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==vr.ZodAny&&(r.items=Pc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&fl(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&fl(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(fl(r,"minItems",t.exactLength.value,t.exactLength.message,e),fl(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function SHc(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?fl(r,"minimum",n.value,n.message,e):fl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),fl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?fl(r,"maximum",n.value,n.message,e):fl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),fl(r,"maximum",n.value,n.message,e));break;case"multipleOf":fl(r,"multipleOf",n.value,n.message,e);break}return r}function THc(){return{type:"boolean"}}function OZi(t,e){return Pc(t.type._def,e)}function BZi(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>BZi(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 xHc(t,e)}}function wHc(t,e){return{...Pc(t.innerType._def,e),default:t.defaultValue()}}function RHc(t,e){return e.effectStrategy==="input"?Pc(t.schema._def,e):E1(e)}function kHc(t){return{type:"string",enum:Array.from(t.values)}}function DHc(t,e){let r=[Pc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Pc(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(PHc(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 NHc(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 LZi(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":fl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":fl(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":sN(r,"email",n.message,e);break;case"format:idn-email":sN(r,"idn-email",n.message,e);break;case"pattern:zod":BC(r,oN.email,n.message,e);break}break;case"url":sN(r,"uri",n.message,e);break;case"uuid":sN(r,"uuid",n.message,e);break;case"regex":BC(r,n.regex,n.message,e);break;case"cuid":BC(r,oN.cuid,n.message,e);break;case"cuid2":BC(r,oN.cuid2,n.message,e);break;case"startsWith":BC(r,RegExp(`^${BBr(n.value,e)}`),n.message,e);break;case"endsWith":BC(r,RegExp(`${BBr(n.value,e)}$`),n.message,e);break;case"datetime":sN(r,"date-time",n.message,e);break;case"date":sN(r,"date",n.message,e);break;case"time":sN(r,"time",n.message,e);break;case"duration":sN(r,"duration",n.message,e);break;case"length":fl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),fl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{BC(r,RegExp(BBr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&sN(r,"ipv4",n.message,e),n.version!=="v4"&&sN(r,"ipv6",n.message,e);break}case"base64url":BC(r,oN.base64url,n.message,e);break;case"jwt":BC(r,oN.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&BC(r,oN.ipv4Cidr,n.message,e),n.version!=="v4"&&BC(r,oN.ipv6Cidr,n.message,e);break}case"emoji":BC(r,oN.emoji(),n.message,e);break;case"ulid":{BC(r,oN.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{sN(r,"binary",n.message,e);break}case"contentEncoding:base64":{fl(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{BC(r,oN.base64,n.message,e);break}}break}case"nanoid":BC(r,oN.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function BBr(t,e){return e.patternStrategy==="escape"?OHc(t):t}function OHc(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}}})):fl(t,"format",e,r,n)}function BC(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:A$i(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):fl(t,"pattern",A$i(e,n),r,n)}function A$i(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(bQi(e,n,o)),r+=m5r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r +`);return r+=Buffer.byteLength(CQi(e)),r},"getFormDataLength"),h5r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=uwc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=hwc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return dwc.from(pwc(this.fd,this.boundary))}};SQi.exports={isFormData:fwc,FormDataSerializer:h5r}});var IQi=I((jEh,TQi)=>{"use strict";p();var{AbortSignal:qEh}=p5r(),{Body:mwc,cloneStream:gwc,guessContentType:Awc}=wbt(),{Headers:ywc}=qye(),{isPlainObject:Ewc}=L6(),{isFormData:_wc,FormDataSerializer:vwc}=lLe(),Cwc=20,j$=Symbol("Request internals"),Nbt=class t extends mwc{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?gwc(n):null),l=new ywc(r.headers||n&&n.headers||{});if(_wc(c)&&!l.has("content-type")){let h=new vwc(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(Ewc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=Awc(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[j$]={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=Cwc: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[j$].method}get url(){return this[j$].parsedURL.toString()}get headers(){return this[j$].headers}get redirect(){return this[j$].redirect}get cache(){return this[j$].cache}get signal(){return this[j$].signal}clone(){return new t(this)}get init(){return this[j$].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(Nbt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});TQi.exports={Request:Nbt}});var g5r=I(($Eh,xQi)=>{"use strict";p();var{Body:bwc,cloneStream:Swc,guessContentType:Twc}=wbt(),{Headers:Iwc}=qye(),{isPlainObject:xwc}=L6(),{isFormData:wwc,FormDataSerializer:Rwc}=lLe(),KD=Symbol("Response internals"),Mbt=class t extends bwc{static{a(this,"Response")}constructor(e=null,r={}){let n=new Iwc(r.headers),o=e;if(wwc(o)&&!n.has("content-type")){let s=new Rwc(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(xwc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=Twc(o);s&&n.set("content-type",s)}super(o),this[KD]={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[KD].url||""}get status(){return this[KD].status}get statusText(){return this[KD].statusText}get ok(){return this[KD].status>=200&&this[KD].status<300}get redirected(){return this[KD].counter>0}get headers(){return this[KD].headers}get httpVersion(){return this[KD].httpVersion}get decoded(){return this[KD].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(Swc(this),{...this[KD]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(Mbt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});xQi.exports={Response:Mbt}});var RQi=I((YEh,wQi)=>{"use strict";p();var Pwc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),kwc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),Dwc=new Set([500,502,503,504]),Nwc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},Mwc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function dne(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(dne,"toNumberOrZero");function Owc(t){return t?Dwc.has(t.status):!0}a(Owc,"isErrorResponse");function A5r(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(A5r,"parseCacheControl");function Bwc(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(Bwc,"formatCacheControl");wQi.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=A5r(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=A5r(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":Bwc(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())&&kwc.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||Pwc.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=A5r(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)Nwc[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 dne(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 dne(this._rescc["s-maxage"])}if(this._rescc["max-age"])return dne(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+dne(this._rescc["stale-if-error"]),n=e+dne(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+dne(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+dne(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()&&Owc(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&&!Mwc[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 NQi=I((ZEh,DQi)=>{"use strict";p();var Lwc=RQi(),{Headers:Fwc}=qye(),PQi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),kQi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),y5r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new Lwc(PQi(e),kQi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(PQi(e))}responseHeaders(e){return new Fwc(this.policy.responseHeaders(kQi(e)))}timeToLive(){return this.policy.timeToLive()}};DQi.exports=y5r});var BQi=I((t_h,OQi)=>{"use strict";p();var{Readable:Uwc}=require("stream"),{Headers:MQi}=qye(),{Response:Qwc}=g5r(),H$=Symbol("CacheableResponse internals"),qwc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),E5r=class t extends Qwc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new MQi(r.headers);this[H$]={headers:n,bufferedBody:e}}get headers(){return this[H$].headers}set headers(e){if(e instanceof MQi)this[H$].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return Uwc.from(this[H$].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[H$].bufferedBody}async arrayBuffer(){return qwc(this[H$].bufferedBody)}async text(){return this[H$].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[H$].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},jwc=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 E5r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");OQi.exports={cacheableResponse:jwc}});var Obt=I((i_h,LQi)=>{"use strict";p();var _5r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};LQi.exports={RequestAbortedError:_5r}});var jQi=I((a_h,qQi)=>{"use strict";p();var UQi=require("http"),QQi=require("https"),{Readable:Hwc}=require("stream"),Q6=QP()("helix-fetch:h1"),{RequestAbortedError:FQi}=Obt(),{decodeStream:Gwc}=L6(),$wc=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 QQi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new UQi.Agent(n),r.httpAgent):void 0},"getAgent"),Vwc=a(t=>{t.h1={}},"setupContext"),Wwc=a(async({h1:t})=>{t.httpAgent&&(Q6("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(Q6("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),zwc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?Gwc(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"),Ywc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?QQi:UQi,o=$wc(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)=>{Q6(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{Q6(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{Q6(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(Q6(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new FQi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new FQi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(Q6(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(zwc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(Q6(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(Q6(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof Hwc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");qQi.exports={request:Ywc,setupContext:Vwc,resetContext:Wwc}});var VQi=I((u_h,$Qi)=>{"use strict";p();var{connect:Kwc,constants:Jwc}=require("http2"),{Readable:Zwc}=require("stream"),hd=QP()("helix-fetch:h2"),{RequestAbortedError:HQi}=Obt(),{decodeStream:Xwc}=L6(),{NGHTTP2_CANCEL:uLe}=Jwc,eRc=300*1e3,tRc=5e3,rRc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),nRc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),hd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),GQi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?Xwc(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"),iRc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=tRc}}}=t,d=o[":path"],f=`${e}${d}`;hd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(uLe)},"rejectPush")),n.on("push",(h,m)=>{hd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{hd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(uLe)}),l&&l(f,o,GQi(h,n,r))}),n.on("aborted",()=>{hd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{hd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{hd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),oRc=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=eRc,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=()=>(hd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=Kwc(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{hd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{hd(`session ${n} established`),hd(`caching session ${n}`),d[n]=w}),w.on("localSettings",j=>{hd(`session ${n} localSettings: ${JSON.stringify(j)}`)}),w.on("remoteSettings",j=>{hd(`session ${n} remoteSettings: ${JSON.stringify(j)}`)}),w.once("close",()=>{hd(`session ${n} closed`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.once("error",j=>{hd(`session ${n} encountered error: ${j}`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(j,M,O)=>{hd(`session ${n} encountered frameError: type: ${j}, code: ${M}, id: ${O}`)}),w.once("goaway",(j,M,O)=>{hd(`session ${n} received GOAWAY frame: errorCode: ${j}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(j,M,O)=>{iRc(t,n,v,j,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(hd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());hd(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new HQi),R&&R.close(uLe)},"onAbortSignal");if(x){if(x.aborted){T(new HQi);return}x.addEventListener("abort",P)}let D=a(N=>{hd(`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(GQi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==uLe&&(hd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(uLe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),hd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{hd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof Zwc?_.pipe(R):(_&&R.write(_),R.end())})},"request");$Qi.exports={request:oRc,setupContext:rRc,resetContext:nRc}});var zQi=I((p_h,WQi)=>{"use strict";p();var{EventEmitter:sRc}=require("events"),aRc=a(()=>{let t={},e=new sRc;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");WQi.exports=aRc});var YQi=I((g_h,cRc)=>{cRc.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 eqi=I((A_h,XQi)=>{"use strict";p();var{Readable:lRc}=require("stream"),uRc=require("tls"),{types:{isAnyArrayBuffer:dRc}}=require("util"),fRc=l5r(),v5r=QP()("helix-fetch:core"),{RequestAbortedError:Bbt}=Obt(),C5r=jQi(),Lbt=VQi(),pRc=zQi(),{isPlainObject:hRc}=L6(),{isFormData:mRc,FormDataSerializer:gRc}=lLe(),{version:ARc}=YQi(),b5r="h2",S5r="h2c",T5r="http/1.0",fne="http/1.1",yRc=100,ERc=3600*1e3,_Rc=[b5r,fne,T5r],vRc=`helix-fetch/${ARc}`,CRc={method:"GET",compress:!0,decode:!0},KQi=0,JQi=pRc(),ZQi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new Bbt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new Bbt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof Bbt||(v5r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=uRc.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),KQi+=1,s.id=KQi,s.secureConnecting=!1,v5r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),bRc=a(async(t,e)=>{let r=await JQi.acquire(t.origin);try{return r||(r=await ZQi(t,e)),r}finally{JQi.release(t.origin,r)}},"connect"),SRc=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=fne,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=S5r,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 bRc(e,d);return o=f.alpnProtocol,o||(o=fne),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),TRc=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),IRc=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 ZQi(e,d);return{protocol:f.alpnProtocol||fne,socket:f}}return{protocol:l.alpnProtocol||fne,socket:l}},"getProtocolAndSocketFromFactory"),xRc=a(async(t,e,r)=>{let n=new URL(e),o={...CRc,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=TRc(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(mRc(o.body)){let d=new gRc(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":hRc(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):dRc(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 lRc||(!(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 IRc(t.socketFactory,n,o,t.alpnProtocols):await SRc(t,n,c);switch(v5r(`${n.host} -> ${l}`),l){case b5r:try{return await Lbt.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 S5r:return Lbt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case T5r:case fne:return C5r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),wRc=a(async t=>(t.alpnCache.clear(),Promise.all([C5r.resetContext(t),Lbt.resetContext(t)])),"resetContext"),RRc=a(t=>{let{options:{alpnProtocols:e=_Rc,alpnCacheTTL:r=ERc,alpnCacheSize:n=yRc,userAgent:o=vRc,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new fRc({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,C5r.setupContext(t),Lbt.setupContext(t)},"setupContext");XQi.exports={request:xRc,setupContext:RRc,resetContext:wRc,RequestAbortedError:Bbt,ALPN_HTTP2:b5r,ALPN_HTTP2C:S5r,ALPN_HTTP1_1:fne,ALPN_HTTP1_0:T5r}});var rqi=I((__h,tqi)=>{"use strict";p();var PRc=QP()("helix-fetch:core"),{request:kRc,setupContext:DRc,resetContext:NRc,RequestAbortedError:MRc,ALPN_HTTP2:ORc,ALPN_HTTP2C:BRc,ALPN_HTTP1_1:LRc,ALPN_HTTP1_0:FRc}=eqi(),I5r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},DRc(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:MRc,ALPN_HTTP2:ORc,ALPN_HTTP2C:BRc,ALPN_HTTP1_1:LRc,ALPN_HTTP1_0:FRc}}async request(e,r){return kRc(this,e,r)}setCA(e){this.options.ca=e}async reset(){return PRc("resetting context"),NRc(this)}};tqi.exports=new I5r().api()});var aqi=I((b_h,sqi)=>{"use strict";p();var{EventEmitter:URc}=require("events"),{Readable:dLe}=require("stream"),x5r=QP()("helix-fetch"),QRc=l5r(),{Body:qRc}=wbt(),{Headers:k5r}=qye(),{Request:pne}=IQi(),{Response:R5r}=g5r(),{FetchBaseError:jRc,FetchError:fLe,AbortError:Fbt}=f5r(),{AbortController:HRc,AbortSignal:GRc,TimeoutSignal:$Rc}=p5r(),VRc=NQi(),{cacheableResponse:WRc}=BQi(),{sizeof:zRc}=L6(),{isFormData:YRc}=lLe(),{context:KRc,RequestAbortedError:JRc}=rqi(),nqi=["GET","HEAD"],ZRc=500,XRc=100*1024*1024,w5r="push",iqi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof pne&&typeof r>"u"?e:new pne(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 Fbt("The operation was aborted.");throw o.init.body instanceof dLe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof dLe)&&!YRc(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof dLe&&m.destroy(w),w instanceof TypeError?w:w instanceof JRc?new Fbt("The operation was aborted."):new fLe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new Fbt("The operation was aborted.");o.init.body instanceof dLe&&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 fLe(`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 fLe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new k5r(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 dLe)throw l&&l.removeEventListener("abort",A),new fLe("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),iqi(t,new pne(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new R5r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),oqi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!nqi.includes(e.method))return r;let n=new VRc(e,r,{shared:!1});if(n.storable()){let o=await WRc(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),ePc=a(async(t,e,r)=>{let n=new pne(e,r);if(t.options.maxCacheSize!==0&&nqi.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 k5r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await iqi(t,n);return n.cache!=="no-store"?oqi(t,n,s):s},"cachingFetch"),tPc=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"),rPc=a(t=>new $Rc(t),"timeoutSignal"),P5r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:XRc,o=ZRc;n===0&&(n=1,o=1);let s=a(({response:l},u)=>zRc(l),"sizeCalculation");this.cache=new QRc({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new URc,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 R5r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=KRc(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:qRc,Headers:k5r,Request:pne,Response:R5r,AbortController:HRc,AbortSignal:GRc,FetchBaseError:jRc,FetchError:fLe,AbortError:Fbt,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:tPc,timeoutSignal:rPc,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 ePc(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(w5r,e)}offPush(e){return this.eventEmitter.off(w5r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){x5r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new pne(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(x5r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){x5r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await oqi(this,new pne(e,{headers:r}),n);this.eventEmitter.emit(w5r,e,o)}};sqi.exports=new P5r().api()});var lqi=I((I_h,cqi)=>{"use strict";p();cqi.exports=aqi()});var kqi=I((Rbh,Pqi)=>{"use strict";p();function Rqi(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(Rqi,"validateParameter");function RPc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(RPc,"hasOwnProperty");function PPc(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(PPc,"defineOperation");Pqi.exports={defineOperation:PPc,validateParameter:Rqi}});var L5r=I((Dbh,Mqi)=>{"use strict";p();var zye=jFe()("kerberos"),Wye=zye.KerberosClient,Dqi=zye.KerberosServer,$$=kqi().defineOperation,kPc=1,DPc=2,NPc=4,MPc=8,OPc=16,BPc=32,LPc=64,FPc=128,UPc=256,Nqi=0,QPc=9,qPc=6;Wye.prototype.step=$$(Wye.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Wye.prototype.wrap=$$(Wye.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);Wye.prototype.unwrap=$$(Wye.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Dqi.prototype.step=$$(Dqi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var jPc=$$(zye.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}]),HPc=$$(zye.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),GPc=$$(zye.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:Nqi}},{name:"callback",type:"function",required:!1}]),$Pc=$$(zye.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);Mqi.exports={initializeClient:GPc,initializeServer:$Pc,principalDetails:HPc,checkPassword:jPc,GSS_C_DELEG_FLAG:kPc,GSS_C_MUTUAL_FLAG:DPc,GSS_C_REPLAY_FLAG:NPc,GSS_C_SEQUENCE_FLAG:MPc,GSS_C_CONF_FLAG:OPc,GSS_C_INTEG_FLAG:BPc,GSS_C_ANON_FLAG:LPc,GSS_C_PROT_READY_FLAG:FPc,GSS_C_TRANS_FLAG:UPc,GSS_C_NO_OID:Nqi,GSS_MECH_OID_KRB5:QPc,GSS_MECH_OID_SPNEGO:qPc}});var Oqi=I((Mbh,VPc)=>{VPc.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 Lqi=I((Obh,Bqi)=>{"use strict";p();var WPc=require("dns"),zPc=L5r(),F5r=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=YPc(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();WPc.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}`;zPc.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 YPc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=KPc(t),r(null,o)})}}a(YPc,"firstTransition");function KPc(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=JPc(t),r(null,o||"")})}}a(KPc,"secondTransition");function JPc(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=ZPc(t),r(null,c)})})}}a(JPc,"thirdTransition");function ZPc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(ZPc,"fourthTransition");Bqi.exports={MongoAuthProcess:F5r}});var Uqi=I((Fbh,mLe)=>{"use strict";p();var Fqi=L5r();mLe.exports=Fqi;mLe.exports.Kerberos=Fqi;mLe.exports.version=Oqi().version;mLe.exports.processes={MongoAuthProcess:Lqi().MongoAuthProcess}});var AZi={};xi(AZi,{AbortError:()=>c1,DirectConnectError:()=>LR,DirectConnectTransport:()=>HBr,EXIT_REASONS:()=>LDc,HOOK_EVENTS:()=>fTt,InMemorySessionStore:()=>G4r,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>FDc,createSdkMcpServer:()=>gQc,deleteSession:()=>gGc,filterEscalatingDefaultMode:()=>tGc,foldSessionSummary:()=>u$i,forkSession:()=>AGc,getSessionInfo:()=>pGc,getSessionMessages:()=>dGc,getSubagentMessages:()=>vGc,importSessionToStore:()=>yGc,listSessions:()=>fGc,listSubagents:()=>_Gc,parseDirectConnectUrl:()=>EQc,query:()=>lGc,renameSession:()=>hGc,resolveSettings:()=>nGc,startup:()=>uGc,tagSession:()=>mGc,tool:()=>mQc});function r2c(t){return this[t]}function s2c(t,e){this[t]=o2c.bind(null,e)}function H4r(t=ODc){let e=new AbortController;return(0,o$i.setMaxListeners)(t,e.signal),e}function s$i(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 BDc(t,e){t(Error(e))}function bne(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(BDc,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function pLr(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=QDc.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(!UDc.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function u$i(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=GDc(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)}$Dc(c,l);for(let[d,f]of Object.entries(qDc)){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 jDc(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=z$(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=z$(r.customTitle)||z$(r.aiTitle)||void 0,s=o||z$(r.lastPrompt)||z$(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:z$(r.gitBranch)||void 0,cwd:z$(r.cwd)||e||void 0,tag:z$(r.tag)||void 0,createdAt:HDc(r.createdAt)}:null}function z$(t){return typeof t=="string"?t:void 0}function HDc(t){return typeof t=="number"?t:void 0}function GDc(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function $Dc(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=pLr(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function d$i(){return process.versions.bun!==void 0}function QE(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 w3e(){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 ZDc(t){var e=KDc.call(t,ELe),r=t[ELe];try{t[ELe]=void 0;var n=!0}catch{}var o=JDc.call(t);return n&&(e?t[ELe]=r:delete t[ELe]),o}function rNc(t){return tNc.call(t)}function sNc(t){return t==null?t===void 0?oNc:iNc:kji&&kji in Object(t)?XDc(t):nNc(t)}function aNc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function fNc(t){if(!Z6(t))return!1;var e=R3e(t);return e==lNc||e==uNc||e==cNc||e==dNc}function hNc(t){return!!Dji&&Dji in t}function yNc(t){if(t!=null){try{return ANc.call(t)}catch{}try{return t+""}catch{}}return""}function xNc(t){if(!Z6(t)||mNc(t))return!1;var e=hLr(t)?INc:vNc;return e.test(ENc(t))}function RNc(t,e){return t?.[e]}function kNc(t,e){var r=PNc(t,e);return wNc(r)?r:void 0}function NNc(){this.__data__=XLe?XLe(null):{},this.size=0}function ONc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function QNc(t){var e=this.__data__;if(XLe){var r=e[t];return r===LNc?void 0:r}return UNc.call(e,t)?e[t]:void 0}function GNc(t){var e=this.__data__;return XLe?e[t]!==void 0:HNc.call(e,t)}function WNc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=XLe&&e===void 0?VNc:e,this}function GEe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function aMc(t,e){var r=this.__data__,n=hTt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function $Ee(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 NMc(){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 E$i(...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 _$i(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return E$i({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function ELr(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 MMc(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 BMc(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 Ii(`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 C$i(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new zl(`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 zl(`Refusing to send credential over non-https token endpoint "${t}"`)}async function b$i(t,e){let r=await HMc(t),n;try{n=JSON.parse(r)}catch{throw new zl(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,FR(r),e)}if(!n.access_token)throw new zl(`Token endpoint response missing access_token: ${JSON.stringify(FR(n))}`,t.status,FR(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new zl(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,FR(n),e);return n}function FR(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=d4r?t:t.slice(0,d4r)+`... <${t.length-d4r} more chars>`}return JSON.stringify(FR(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))jMc.has(r)&&(e[r]=n);return e}return null}async function S$i(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 zl(`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 zl(`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 T$i(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 HMc(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>Uji){let l=Uji-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 Sne(){return Math.floor(Date.now()/1e3)}function GMc(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 vLr(t){let e;return(Qji??(e=new globalThis.TextEncoder,Qji=e.encode.bind(e)))(t)}function jji(t){let e;return(qji??(e=new globalThis.TextDecoder,qji=e.decode.bind(e)))(t)}function QLe(){}function h1t(t,e,r){return!e||K1t[t]>K1t[r]?QLe:e[t].bind(e)}function qg(t){let e=t.logger,r=t.logLevel??"off";if(!e)return $Mc;let n=Gji.get(e);if(n&&n[0]===r)return n[1];let o={error:h1t("error",e,r),warn:h1t("warn",e,r),info:h1t("info",e,r),debug:h1t("debug",e,r)};return Gji.set(e,[r,o]),o}function x$i(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(!VMc.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function $ji(t){if(!t)throw new Ii("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 Ii(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ii(`Identity token file at ${t} is empty`);return n}}function KMc(t){if(!t)throw new Ii("Identity token value is empty");return()=>t}function JMc(t){return async()=>{C$i(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new zl(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:LMc,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}${v$i}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${Y1t},${UMc}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${rV} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new zl(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=FR(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 zl(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await b$i(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new zl(`Token endpoint response missing required fields: ${JSON.stringify(FR(c))}`,o.status,FR(c),s);return{token:c.access_token,expiresAt:Sne()+l}}}function ZMc(t){return async e=>{let r=await import("node:fs");await S$i(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new zl(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new zl(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new zl(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Sne()"");throw new zl(`User OAuth refresh failed (HTTP ${f.status}): ${FR(E)}`,f.status,FR(E),h)}let m=await b$i(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new zl(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(FR(m))}`,f.status,FR(m),h);let A=Sne()+g,y=m.refresh_token||l;return await T$i(t.credentialsPath,{...o,version:I$i,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function R$i(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=eOc(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 XMc(t,e){let r=await WMc(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 zMc(n,e)??void 0}};return R$i(s,t)}function eOc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=tOc(o);if(!s)throw new zl("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 zl("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 zl("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=JMc({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?rOc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new zl("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return ZMc({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 zl(`authentication.type "${o}" is not a known authentication type`)}}}function tOc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new zl(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new zl('identity_token.source "file" requires a non-empty path');return $ji(t.identity_token.path)}let e=Vl("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return $ji(e);let r=Vl("ANTHROPIC_IDENTITY_TOKEN");return r?KMc(r):null}function rOc(t,e,r,n){return async o=>{let s=await import("node:fs");await S$i(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||Sne()0&&(yield e)}function aOc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function P$i(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return qg(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Pne.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 k$i(u,r)}return await r.text()})();return qg(t).debug(`[${n}] response parsed`,vne({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function k$i(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 mEe(t,e,r){return D$i(),new File(t,e??"unknown_file",r)}function M1t(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 cOc(t){let e=typeof t=="function"?t:t.fetch,r=Vji.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 Vji.set(e,n),n}async function pOc(t,e,r){if(D$i(),t=await t,e||(e=M1t(t,!0)),dOc(t))return t instanceof File&&e==null&&r==null?t:mEe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(fOc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),mEe(await Z4r(o),e,r)}let n=await Z4r(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 mEe(n,e,r)}async function Z4r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(M$i(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(N$i(t))for await(let r of t)e.push(...await Z4r(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${hOc(t)}`)}return e}function hOc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*mOc(t){if(!t)return;if(O$i 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():Mji(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=Mji(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 B$i(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function O1t(t){return typeof t=="object"&&t!==null&&YLe in t}function L$i(t,e){let r=new Set;if(t)for(let n of t)O1t(n)&&r.add(n[YLe]);if(e){for(let n of e)if(O1t(n)&&r.add(n[YLe]),Array.isArray(n.content))for(let o of n.content)O1t(o)&&r.add(o[YLe])}return Array.from(r)}function F$i(t,e){let r=L$i(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function AOc(t){return O1t(t)?{"x-stainless-helper":t[YLe]}:{}}function Q$i(t){return t?.output_format??t?.output_config?.format}function zji(t,e,r){let n=Q$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}:q$i(t,e,r)}function q$i(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=yOc(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 yOc(t,e){let r=Q$i(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ii(`Failed to parse structured output: ${n}`)}}function Zji(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function eHi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function SOc(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 cSt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function rHi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ii("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 H$i(t){return t?.output_config?.format}function nHi(t,e,r){let n=H$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}:G$i(t,e,r)}function G$i(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=IOc(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 IOc(t,e){let r=H$i(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ii(`Failed to parse structured output: ${n}`)}}function aHi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function P3e(t){return t instanceof Error?t:Error(String(t))}function L1t(t){return t instanceof Error?t.message:String(t)}function aI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function k3e(t){return aI(t)==="ENOENT"}function V$i(t){return aI(t)==="EISDIR"}function POc(t){let e=aI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function NOc(t,e,r){let n=`${t}.tmp.${(0,Y$i.randomBytes)(4).toString("hex")}`;try{await(0,K4.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,K4.rename)(n,t)}catch(o){let s=aI(o);if(s!==void 0&&kOc.has(s)){try{await(0,K4.copyFile)(n,t)}catch(c){throw DOc.has(aI(c)??"")&&await(0,K4.unlink)(t).catch(()=>{}),c}await(0,K4.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,K4.unlink)(n).catch(()=>{}),o}}function ASt(){return MOc.getStore()??new iBr}function K$i(){if(oEe)return oEe;if(!QE(process.env.DEBUG_CLAUDE_AGENT_SDK))return Tne=null,oEe=Promise.resolve(),oEe;let t=(0,nBr.join)(WEe(),"debug");return Tne=(0,nBr.join)(t,`sdk-${(0,W$i.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${Tne} +`),oEe=ASt().mkdir(t).catch(()=>{}),oEe}function OOc(){return K$i(),Tne??null}function OR(t){if(Tne===null)return;let e=`${new Date().toISOString()} ${t} +`;K$i().then(()=>{Tne&&ASt().append(Tne,e).catch(()=>{})})}function BOc(){this.__data__=new mTt,this.size=0}function FOc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function QOc(t){return this.__data__.get(t)}function jOc(t){return this.__data__.has(t)}function $Oc(t,e){var r=this.__data__;if(r instanceof mTt){var n=r.__data__;if(!h$i||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=y5c}function G5c(t){return YEe(t)&&xLr(t.length)&&!!md[R3e(t)]}function V5c(t){return function(e){return t(e)}}function X5c(t,e){var r=cV(t),n=!r&&o3e(t),o=!r&&!n&&ILr(t),s=!r&&!n&&!o&&tVi(t),c=r||n||o||s,l=c?r5c(t.length,String):[],u=l.length;for(var d in t)(e||Z5c.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ATt(d,u)))&&l.push(d);return l}function r4c(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||t4c;return t===r}function n4c(t,e){return function(r){return t(e(r))}}function o4c(t){return t!=null&&xLr(t.length)&&!hLr(t)}function s4c(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function u4c(t){if(!Z6(t))return a4c(t);var e=rVi(t),r=[];for(var n in t)n=="constructor"&&(e||!l4c.call(t,n))||r.push(n);return r}function f4c(t){return wLr(t)?e4c(t,!0):d4c(t)}function h4c(t,e){if(e)return t.slice();var r=t.length,n=mHi?mHi(r):new t.constructor(r);return t.copy(n),n}function m4c(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 IBc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function wBc(t){return xBc.register(t)}function PBc(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 kBc(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 DBc(t,e){if(!e)return!0;let r=PBc(t);return kBc(r,e)}function NBc(t){return/^[\\/]{2}/.test(t)}function MBc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function _Hi(t){try{return MBc(dVi.realpathSync.native(t))}catch{return null}}function OBc(t,e){let r=(0,J4.resolve)(e).toLowerCase(),n=(0,J4.resolve)(t).toLowerCase();if((0,J4.dirname)(n)===r||n.startsWith(r+J4.sep))return!0;let o=_Hi(e)?.toLowerCase();if(o==null)return!1;let s=_Hi((0,J4.dirname)((0,J4.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+J4.sep)}function fVi(t,e){if(NBc(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 cI(){return LBc}function FBc(t,e){t.destroyed||t.write(e)}function UBc(t){FBc(process.stderr,t)}function QBc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function qBc(t,e,r=e+"s"){return t===1?e:r}function jBc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function VBc(t){return $Bc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function WBc(t){bHi??=VBc(!0);for(let e of bHi)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 ETt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function JBc(t){if(!lBr()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=KBc();return DBc(t,e)}async function mVi(t,e,r=XBc){if(OLe<0?OLe=await(0,HE.stat)(t).then(n=>n.size).catch(()=>0):OLe+=e,!(OLe<=r||b4r)){b4r=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,HE.rename)(t,n)}catch(o){k3e(o)||(await(0,HE.unlink)(n).catch(()=>{}),await(0,HE.rename)(t,n).catch(()=>(0,HE.unlink)(t).catch(()=>{})))}OLe=0}finally{b4r=!1}}}function gVi(t){return uBr=(0,Lne.join)(t,`${uVi()}.txt`),uBr}async function eLc(t,e,r,n){t&&await(0,HE.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,HE.appendFile)(r,n)}catch(s){if(!V$i(s))throw s;o=gVi(r),await(0,HE.appendFile)(o,n)}await mVi(o,Buffer.byteLength(n)).catch(dBr),yVi()}function dBr(){}function tLc(){if(!R1t){let t=null;R1t=TBc({writeFn:a(e=>{let r=AVi(),n=(0,Lne.dirname)(r),o=t!==n;if(t=n,lBr()){if(o)try{cI().mkdirSync(n)}catch{}let s=r;try{cI().appendFileSync(r,e)}catch(c){if(!V$i(c))throw c;s=gVi(r),cI().appendFileSync(s,e)}mVi(s,Buffer.byteLength(e)).catch(dBr),yVi();return}C4r=C4r.then(eLc.bind(null,o,n,r,e)).catch(dBr)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:lBr()}),wBc(async()=>{R1t?.dispose(),await C4r})}return R1t}function Wl(t,{level:e}={level:"debug"}){if(cBr[e]t.endsWith(e))}function dLc(t,e){return(0,c$i.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 fLc(){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 pLc(t,e=process.platform,r=process.arch,n=EVi.existsSync,o=fLc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${sEe}-linux-${r}-android`]:e==="linux"?o?[`${sEe}-linux-${r}-musl`,`${sEe}-linux-${r}`]:[`${sEe}-linux-${r}`,`${sEe}-linux-${r}-musl`]:[`${sEe}-${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 hLc(){return{eventQueue:[],sink:null}}function MLr(t,e){let r=mLc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function _Vi(t){MLr("tengu_feature_ok",{feature_name:t})}function vVi(t,e,r){MLr("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function gLc(t,e,r){MLr("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function $6(t,e,r){try{let n=await e();return _Vi(t),n}catch(n){throw vVi(t,r?.(n)??"error"),n}}function yLc(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 JLe(t){if(typeof t=="string")return yLc(t);if(Array.isArray(t))return t.map(JLe);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[JLe(r)]=JLe(n);return e}return t}function ELc(){return process.platform==="win32"}function vLc(t){let e=S4r.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,xVi.join)(r,"System32","where.exe");try{let o=(0,IVi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:_Lc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!OBc(c,s))return S4r.set(t,c),c;return null}catch(o){return CLc(o)&&S4r.set(t,null),null}}function CLc(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 bLc(t){return!ELc()||t.includes("/")||t.includes("\\")?t:vLc(t)}async function D3e(t){let e=bLc("git");if(e===null)return[];try{let{stdout:r}=await SLc(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 TLc(t){let e=0;for(let r=0;ro&&(n=wVi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function ABr(t,e){let r=(0,bVi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` +`)||await(0,gBr.once)(r,"drain");r.end(),await(0,gBr.once)(r,"finish")}catch(n){throw r.destroy(),n}}function RVi(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=pLr(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function xLc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=pLr(r,e);if(n!==void 0)return n}return e.commandFallback}async function PVi(t){try{let e=await(0,tN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(Y6),o=await e.read(n,0,Y6,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-Y6),l=s;if(c>0){let u=await e.read(n,0,Y6,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 wLc(t){return Math.abs(TLc(t)).toString(36)}function N3e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=s3e?e:`${e.slice(0,s3e)}-${wLc(t)}`}function pV(){return(0,SEe.join)(WEe(),"projects")}function RLc(t){return(0,SEe.join)(pV(),N3e(t))}async function M3e(t){try{return(await(0,tN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function XD(t){let e=RLc(t),r=[];try{await(0,tN.readdir)(e),r.push(e)}catch{}let n=N3e(t);if(n.length<=s3e)return r;let o=n.slice(0,s3e)+"-",s=pV();try{for(let c of await(0,tN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,SEe.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function _Tt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,SEe.join)(c,r);try{let d=await(0,tN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await M3e(e);for(let u of await XD(c)){let d=await n(u,c);if(d)return d}let l;try{l=await D3e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await XD(u)){let f=await n(d,u);if(f)return f}return}let o=pV(),s;try{s=await(0,tN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,SEe.join)(o,c),void 0);if(l)return l}}function NLc(){return DLc??=Buffer.from('"compact_boundary"')}function kVi(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 Ine(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 bSt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function LLc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(a3e);if(o===-1||o>=r)return 0;let s=o+1;if(bSt(n,SSt,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 QLc(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 qLc(t){if(t.carryLen>0){let e=t.carryBuf;bSt(e,SSt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Ine(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==a3e&&Ine(t.out,OLc,0,1),Ine(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function jLc(t,e){let r=NLc(),n=PLc,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,tN.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=FLc(o,f,r);ULc(o,f,s,h.lastSnapStart,h.lastSnapEnd),QLc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}qLc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function HLc(t,e){try{return e>kLc&&!QE(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await jLc(t,e)).postBoundaryBuf:await(0,CVi.readFile)(t)}catch{return null}}function GLc(t){let e=[];try{let o=Gd(e,Vd`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=iLc(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{$d(e,r,n)}}function $Lc(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(),WLc(e,d,f)}function I4r(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 VLc(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 WLc(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=I4r(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=I4r(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(VLc(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=I4r(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 zLc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function DVi(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 NVi(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 YLc(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 MVi(r,e)}function MVi(t,e){let r=$Lc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>zLc(s,n)).map(s=>DVi(s));return NVi(o,e)}async function KLc(t,e){if(!dh(t))return[];let r=await _Tt(t,e?.dir);if(!r)return[];let n=await HLc(r.filePath,r.fileSize);return n?MVi(GLc(n),e):[]}function vTt(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=BR(o,"customTitle")||BR(n,"customTitle")||BR(o,"aiTitle")||BR(n,"aiTitle")||void 0,f=RVi(n)||void 0,h=T4r(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||BR(o,"lastPrompt")||BR(o,"summary")||f;if(!g)return null;let A=BR(o,"gitBranch")||T4r(n,"gitBranch")||void 0,y=T4r(n,"cwd")||r||void 0,E=o.split(` +`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&BR(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 $Le(t,e,r){let n;try{n=await(0,KEe.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=dh(o.slice(0,-6));if(!s)return null;let c=(0,JEe.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,KEe.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function OVi(t){let e=await PVi(t.filePath);if(!e)return null;let r=vTt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function ZLc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function XLc(t,e,r){t.sort(ZLc);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 t3c(t,e,r){let n=await M3e(t),o;if(e)try{o=await D3e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await XD(n))h.push(...await $Le(m,r,n));return h}let s=pV(),c=process.platform==="win32",l=o.map(h=>{let m=N3e(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,KEe.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await XD(n))h.push(...await $Le(m,r,n));return h}let d=[],f=new Set;for(let h of await XD(n)){let m=(0,JEe.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await $Le(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>=s3e&&m.startsWith(A+"-")){f.add(m),d.push(...await $Le((0,JEe.join)(s,h.name),r,g));break}}}return d}async function r3c(t){let e=pV(),r;try{r=await(0,KEe.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>$Le((0,JEe.join)(e,n.name),t)))).flat()}async function n3c(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 t3c(e,o??!0,c):await r3c(c);return c?XLc(l,r,s):e3c(l)}async function i3c(t,e={}){let r=dh(t);if(!r)return;let n=await _Tt(r,e.dir);if(!n)return;let o=await PVi(n.filePath);if(o)return vTt(r,o,n.projectPath)??void 0}async function o3c(t,e,r={}){if(!dh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=I0({type:"custom-title",customTitle:e.trim(),sessionId:t})+` +`;await BVi(t,n,r)}async function s3c(t,e,r={}){if(!dh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=JLe(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=I0({type:"tag",tag:e??"",sessionId:t})+` +`;await BVi(t,n,r)}async function a3c(t,e={}){if(!dh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await c3c(e)){let n=(0,xne.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,Z4.stat)(n))}catch(s){let c=aI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,Z4.rm)(n,{force:!0}),await(0,Z4.rm)((0,xne.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 c3c(t){if(t.dir){let r=await M3e(t.dir),n=await XD(r),o;try{o=await D3e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await XD(s));return n}let e=pV();try{return(await(0,Z4.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,xne.join)(e,r.name))}catch{return[]}}async function BVi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await M3e(r.dir);for(let u of await XD(c))if(await x4r((0,xne.join)(u,n),e))return;let l;try{l=await D3e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await XD(u))if(await x4r((0,xne.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=pV(),s;try{s=await(0,Z4.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await x4r((0,xne.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function x4r(t,e){let r;try{r=await(0,Z4.open)(t,yBr.constants.O_WRONLY|yBr.constants.O_APPEND)}catch(n){let o=aI(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 l3c(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await ASt().readBytes((0,TSt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await M3e(e);for(let u of await XD(c)){let d=await n(u);if(d)return d}let l;try{l=await D3e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await XD(u)){let f=await n(d);if(f)return f}return null}let o=pV(),s;try{s=await ASt().list(o)}catch{return null}for(let c of s){let l=await n((0,TSt.join)(o,c));if(l)return l}return null}function d3c(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{LVi(sN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function f3c(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||LVi(o,e,r,n);return{transcript:r,contentReplacements:n}}function LVi(t,e,r,n){u3c.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 p3c(t,e={}){if(!dh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!dh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await l3c(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}=h3c(r.buf,t,e);return await ABr((0,TSt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function h3c(t,e,r){let n=d3c(t,e);return FVi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,Y6)),c=t.toString("utf-8",Math.max(0,o-Y6));return BR(c,"customTitle")||BR(s,"customTitle")||BR(c,"aiTitle")||BR(s,"aiTitle")||RVi(s)})}function m3c(t,e,r){let n=f3c(t,e);return FVi(n,e,r,()=>g3c(t))}function g3c(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||xLc(t)||void 0}function FVi(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,VLe.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,VLe.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,VLe.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,VLe.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function UVi(t,e){let r=await _Tt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,ISt.join)(n,"subagents")}async function QVi(t){let e=[];async function r(n){let o;try{o=await(0,c3e.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,ISt.join)(n,s.name)})}else s.isDirectory()&&await r((0,ISt.join)(n,s.name))}return a(r,"J"),await r(t),e}function A3c(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=sN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function y3c(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 E3c(t,e){if(!dh(t))return[];let r=await UVi(t,e?.dir);return r?(await QVi(r)).map(n=>n.agentId):[]}async function _3c(t,e,r){if(!dh(t))return[];if(!e)return[];let n=await UVi(t,r?.dir);if(!n)return[];let o=(await QVi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,c3e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=sN(await(0,c3e.readFile)(l,"utf-8")).toolUseId}catch{}return qVi(s,r,c)}function qVi(t,e,r){if(t.length===0)return[];let n=A3c(t),o=y3c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>DVi(s,r));return NVi(o,e)}function GVi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function $Vi(t){return[...new Set(t)]}function v3c(){return"prod"}function x3c(){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 R3c(){let t=(()=>{switch(v3c()){case"local":return x3c();case"staging":return I3c??IHi;case"prod":return IHi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!w3c.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 k3c(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"):WEe(),o=r?"":`-${(0,jVi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${R3c().OAUTH_FILE_SUFFIX}${t}${o}`}function N3c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,HVi.userInfo)().username}catch{t="claude-code-user"}return D3c.test(t)?t:"claude-code-user"}function EBr(){return O3c}function cn(t,e){let r=EBr(),n=_Br({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===l3e?void 0:l3e].filter(o=>!!o)});t.common.issues.push(n)}function $o(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 zVi(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 Z3c(t){return new RegExp(`^${zVi(t)}$`)}function X3c(t){let e=`${WVi}T${zVi(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 eFc(t,e){return!!((e==="v4"||!e)&&$3c.test(t)||(e==="v6"||!e)&&W3c.test(t))}function tFc(t,e){if(!q3c.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 rFc(t,e){return!!((e==="v4"||!e)&&V3c.test(t)||(e==="v6"||!e)&&z3c.test(t))}function nFc(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 uEe(t){if(t instanceof lI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=qR.create(uEe(n))}return new lI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof uV?new uV({...t._def,type:uEe(t.element)}):t instanceof qR?qR.create(uEe(t.unwrap())):t instanceof e9?e9.create(uEe(t.unwrap())):t instanceof X6?X6.create(t.items.map(e=>uEe(e))):t}function CBr(t,e){let r=eV(t),n=eV(e);if(t===e)return{valid:!0,data:t};if(r===wn.object&&n===wn.object){let o=ac.objectKeys(e),s=ac.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=CBr(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===wn.array&&n===wn.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 Bv(t){return t&&Object.assign(PSt,t),PSt}function oFc(t){return t}function sFc(t){return t}function aFc(t){}function cFc(t){throw Error()}function lFc(t){}function LLr(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 $r(t,e="|"){return t.map(r=>ns(r)).join(e)}function XVi(t,e){return typeof e=="bigint"?e.toString():e}function CTt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function Fne(t){return t==null}function bTt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function eWi(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 Hc(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 FLr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function uFc(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function dFc(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 mFc(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 ns(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function nWi(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function gFc(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 aN(t,{...t._zod.def,shape:r,checks:[]})}function AFc(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 aN(t,{...t._zod.def,shape:r,checks:[]})}function yFc(t,e){if(!v3e(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 FLr(this,"shape",n),n},checks:[]};return aN(t,r)}function EFc(t,e){return aN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return FLr(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function _Fc(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 aN(e,{...e._zod.def,shape:o,checks:[]})}function vFc(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 aN(e,{...e._zod.def,shape:o,checks:[]})}function gEe(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function zLe(t){return typeof t=="string"?t:t?.message}function nN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=zLe(t.inst?._zod.def?.error?.(t))??zLe(e?.error?.(t))??zLe(r.customError?.(t))??zLe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function STt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function TTt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function sWi(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function CFc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function qLr(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 jLr(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 ${lWi(n.path)}`);return e.join(` +`)}function _Wi(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function PWi(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 kWi(t){return new RegExp(`^${PWi(t)}$`)}function DWi(t){let e=PWi({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(`^${wWi}T(?:${n})$`)}function kHi(t,e,r){t.issues.length&&e.issues.push(...UR(r,t.issues))}function JLr(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function wzi(t){if(!zLr.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return JLr(r)}function kzi(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 DHi(t,e,r){t.issues.length&&e.issues.push(...UR(r,t.issues)),e.value[r]=t.value}function P1t(t,e,r){t.issues.length&&e.issues.push(...UR(r,t.issues)),e.value[r]=t.value}function NHi(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(...UR(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function MHi(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=>nN(s,n,Bv())))}),e}function IBr(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(v3e(t)&&v3e(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=IBr(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;nnN(l,c,Bv()))})),e.issues.length&&(kSt.has(typeof n)?r.issues.push(...UR(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>nN(l,c,Bv()))})),r.value.set(t.value,e.value)}function LHi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function FHi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function UHi(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 QHi(t,e,r){return gEe(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function qHi(t){return t.value=Object.freeze(t.value),t}function jHi(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(sWi(o))}}function MFc(){return{localeError:NFc()}}function BFc(){return{localeError:OFc()}}function HHi(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 FFc(){return{localeError:LFc()}}function QFc(){return{localeError:UFc()}}function jFc(){return{localeError:qFc()}}function GFc(){return{localeError:HFc()}}function uYi(){return{localeError:VFc()}}function YFc(){return{localeError:zFc()}}function JFc(){return{localeError:KFc()}}function XFc(){return{localeError:ZFc()}}function t8c(){return{localeError:e8c()}}function n8c(){return{localeError:r8c()}}function o8c(){return{localeError:i8c()}}function a8c(){return{localeError:s8c()}}function l8c(){return{localeError:c8c()}}function d8c(){return{localeError:u8c()}}function p8c(){return{localeError:f8c()}}function m8c(){return{localeError:h8c()}}function A8c(){return{localeError:g8c()}}function E8c(){return{localeError:y8c()}}function v8c(){return{localeError:_8c()}}function b8c(){return{localeError:C8c()}}function T8c(){return{localeError:S8c()}}function x8c(){return{localeError:I8c()}}function R8c(){return{localeError:w8c()}}function k8c(){return{localeError:P8c()}}function N8c(){return{localeError:D8c()}}function O8c(){return{localeError:M8c()}}function GHi(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 L8c(){return{localeError:B8c()}}function U8c(){return{localeError:F8c()}}function q8c(){return{localeError:Q8c()}}function H8c(){return{localeError:j8c()}}function $8c(){return{localeError:G8c()}}function z8c(){return{localeError:W8c()}}function K8c(){return{localeError:Y8c()}}function Z8c(){return{localeError:J8c()}}function e6c(){return{localeError:X8c()}}function r6c(){return{localeError:t6c()}}function i6c(){return{localeError:n6c()}}function a3r(){return new C3e}function pYi(t,e){return new t({type:"string",...Ir(e)})}function hYi(t,e){return new t({type:"string",coerce:!0,...Ir(e)})}function c3r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Ir(e)})}function BSt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Ir(e)})}function l3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Ir(e)})}function u3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ir(e)})}function d3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ir(e)})}function f3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ir(e)})}function p3r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ir(e)})}function h3r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Ir(e)})}function m3r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ir(e)})}function g3r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Ir(e)})}function A3r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ir(e)})}function y3r(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Ir(e)})}function E3r(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Ir(e)})}function _3r(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ir(e)})}function v3r(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ir(e)})}function C3r(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ir(e)})}function b3r(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ir(e)})}function S3r(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ir(e)})}function T3r(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Ir(e)})}function I3r(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Ir(e)})}function x3r(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Ir(e)})}function w3r(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Ir(e)})}function gYi(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ir(e)})}function AYi(t,e){return new t({type:"string",format:"date",check:"string_format",...Ir(e)})}function yYi(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Ir(e)})}function EYi(t,e){return new t({type:"string",format:"duration",check:"string_format",...Ir(e)})}function _Yi(t,e){return new t({type:"number",checks:[],...Ir(e)})}function vYi(t,e){return new t({type:"number",coerce:!0,checks:[],...Ir(e)})}function CYi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ir(e)})}function bYi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Ir(e)})}function SYi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Ir(e)})}function TYi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Ir(e)})}function IYi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Ir(e)})}function xYi(t,e){return new t({type:"boolean",...Ir(e)})}function wYi(t,e){return new t({type:"boolean",coerce:!0,...Ir(e)})}function RYi(t,e){return new t({type:"bigint",...Ir(e)})}function PYi(t,e){return new t({type:"bigint",coerce:!0,...Ir(e)})}function kYi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ir(e)})}function DYi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ir(e)})}function NYi(t,e){return new t({type:"symbol",...Ir(e)})}function MYi(t,e){return new t({type:"undefined",...Ir(e)})}function OYi(t,e){return new t({type:"null",...Ir(e)})}function BYi(t){return new t({type:"any"})}function LSt(t){return new t({type:"unknown"})}function LYi(t,e){return new t({type:"never",...Ir(e)})}function FYi(t,e){return new t({type:"void",...Ir(e)})}function UYi(t,e){return new t({type:"date",...Ir(e)})}function QYi(t,e){return new t({type:"date",coerce:!0,...Ir(e)})}function qYi(t,e){return new t({type:"nan",...Ir(e)})}function Mne(t,e){return new YLr({check:"less_than",...Ir(e),value:t,inclusive:!1})}function eN(t,e){return new YLr({check:"less_than",...Ir(e),value:t,inclusive:!0})}function One(t,e){return new KLr({check:"greater_than",...Ir(e),value:t,inclusive:!1})}function oI(t,e){return new KLr({check:"greater_than",...Ir(e),value:t,inclusive:!0})}function jYi(t){return One(0,t)}function HYi(t){return Mne(0,t)}function GYi(t){return eN(0,t)}function $Yi(t){return oI(0,t)}function b3e(t,e){return new HWi({check:"multiple_of",...Ir(e),value:t})}function RTt(t,e){return new VWi({check:"max_size",...Ir(e),maximum:t})}function S3e(t,e){return new WWi({check:"min_size",...Ir(e),minimum:t})}function R3r(t,e){return new zWi({check:"size_equals",...Ir(e),size:t})}function PTt(t,e){return new YWi({check:"max_length",...Ir(e),maximum:t})}function UEe(t,e){return new KWi({check:"min_length",...Ir(e),minimum:t})}function kTt(t,e){return new JWi({check:"length_equals",...Ir(e),length:t})}function P3r(t,e){return new ZWi({check:"string_format",format:"regex",...Ir(e),pattern:t})}function k3r(t){return new XWi({check:"string_format",format:"lowercase",...Ir(t)})}function D3r(t){return new ezi({check:"string_format",format:"uppercase",...Ir(t)})}function N3r(t,e){return new tzi({check:"string_format",format:"includes",...Ir(e),includes:t})}function M3r(t,e){return new rzi({check:"string_format",format:"starts_with",...Ir(e),prefix:t})}function O3r(t,e){return new nzi({check:"string_format",format:"ends_with",...Ir(e),suffix:t})}function VYi(t,e,r){return new izi({check:"property",property:t,schema:e,...Ir(r)})}function B3r(t,e){return new ozi({check:"mime_type",mime:t,...Ir(e)})}function Qne(t){return new szi({check:"overwrite",tx:t})}function L3r(t){return Qne(e=>e.normalize(t))}function F3r(){return Qne(t=>t.trim())}function U3r(){return Qne(t=>t.toLowerCase())}function Q3r(){return Qne(t=>t.toUpperCase())}function q3r(t,e,r){return new t({type:"array",element:e,...Ir(r)})}function o6c(t,e,r){return new t({type:"union",options:e,...Ir(r)})}function s6c(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Ir(n)})}function a6c(t,e,r){return new t({type:"intersection",left:e,right:r})}function WYi(t,e,r,n){let o=r instanceof Co;return new t({type:"tuple",items:e,rest:o?r:null,...Ir(o?n:r)})}function c6c(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Ir(n)})}function l6c(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Ir(n)})}function u6c(t,e,r){return new t({type:"set",valueType:e,...Ir(r)})}function d6c(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Ir(r)})}function f6c(t,e,r){return new t({type:"enum",entries:e,...Ir(r)})}function p6c(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Ir(r)})}function zYi(t,e){return new t({type:"file",...Ir(e)})}function h6c(t,e){return new t({type:"transform",transform:e})}function m6c(t,e){return new t({type:"optional",innerType:e})}function g6c(t,e){return new t({type:"nullable",innerType:e})}function A6c(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function y6c(t,e,r){return new t({type:"nonoptional",innerType:e,...Ir(r)})}function E6c(t,e){return new t({type:"success",innerType:e})}function _6c(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function v6c(t,e,r){return new t({type:"pipe",in:e,out:r})}function C6c(t,e){return new t({type:"readonly",innerType:e})}function b6c(t,e,r){return new t({type:"template_literal",parts:e,...Ir(r)})}function S6c(t,e){return new t({type:"lazy",getter:e})}function T6c(t,e){return new t({type:"promise",innerType:e})}function YYi(t,e,r){let n=Ir(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function KYi(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Ir(r)})}function JYi(t,e){let r=Ir(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??o3r,u=t.Boolean??XLr,d=t.String??L3e,f=new(t.Transform??i3r)({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 ZYi(t,e,r,n={}){let o=Ir(n),s={...Ir(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 XYi(t){return new FSt({type:"function",input:Array.isArray(t?.input)?WYi(wTt,t?.input):t?.input??q3r(t3r,LSt(OSt)),output:t?.output??LSt(OSt)})}function j3r(t,e){if(t instanceof C3e){let n=new T3e(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 T3e(e);return r.process(t),r.emit(t,e)}function Sm(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 Sm(n.element,r);case"object":{for(let o in n.shape)if(Sm(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(Sm(o,r))return!0;return!1}case"intersection":return Sm(n.left,r)||Sm(n.right,r);case"tuple":{for(let o of n.items)if(Sm(o,r))return!0;return!!(n.rest&&Sm(n.rest,r))}case"record":return Sm(n.keyType,r)||Sm(n.valueType,r);case"map":return Sm(n.keyType,r)||Sm(n.valueType,r);case"set":return Sm(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Sm(n.innerType,r);case"lazy":return Sm(n.getter(),r);case"default":return Sm(n.innerType,r);case"prefault":return Sm(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Sm(n.in,r)||Sm(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function $Hi(t,e){let r={type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},...Qs.normalizeParams(e)};return new w6c(r)}function eB(t){return!!t._zod}function fEe(t){let e=Object.values(t);if(e.length===0)return $Hi({});let r=e.every(eB),n=e.every(o=>!eB(o));if(r)return $Hi(t);if(n)return iFc(t);throw Error("Mixed Zod versions detected in object shape.")}function ZLe(t,e){return eB(t)?ITt(t,e):t.safeParse(e)}async function R4r(t,e){return eB(t)?await xTt(t,e):await t.safeParseAsync(e)}function F3e(t){if(!t)return;let e;if(eB(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function BLe(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 fEe(t)}}if(eB(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 P4r(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 R6c(t){return t.description}function P6c(t){if(eB(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function eKi(t){if(eB(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 tKi(t){return gYi(G3r,t)}function rKi(t){return AYi($3r,t)}function nKi(t){return yYi(V3r,t)}function iKi(t){return EYi(W3r,t)}function It(t){return pYi(DTt,t)}function D6c(t){return c3r(Y3r,t)}function N6c(t){return BSt(USt,t)}function M6c(t){return l3r(J6,t)}function O6c(t){return u3r(J6,t)}function B6c(t){return d3r(J6,t)}function L6c(t){return f3r(J6,t)}function F6c(t){return p3r(K3r,t)}function U6c(t){return h3r(J3r,t)}function Q6c(t){return m3r(Z3r,t)}function q6c(t){return g3r(X3r,t)}function j6c(t){return A3r(eFr,t)}function H6c(t){return y3r(tFr,t)}function G6c(t){return E3r(rFr,t)}function $6c(t){return _3r(nFr,t)}function V6c(t){return v3r(iFr,t)}function W6c(t){return C3r(oFr,t)}function z6c(t){return b3r(sFr,t)}function Y6c(t){return S3r(aFr,t)}function K6c(t){return T3r(cFr,t)}function J6c(t){return I3r(lFr,t)}function Z6c(t){return x3r(uFr,t)}function X6c(t){return w3r(dFr,t)}function e9c(t,e,r={}){return ZYi(uKi,t,e,r)}function Pc(t){return _Yi(NTt,t)}function xBr(t){return CYi(ZEe,t)}function t9c(t){return bYi(ZEe,t)}function r9c(t){return SYi(ZEe,t)}function n9c(t){return TYi(ZEe,t)}function i9c(t){return IYi(ZEe,t)}function Tm(t){return xYi(MTt,t)}function o9c(t){return RYi(OTt,t)}function s9c(t){return kYi(fFr,t)}function a9c(t){return DYi(fFr,t)}function c9c(t){return NYi(dKi,t)}function l9c(t){return MYi(fKi,t)}function pFr(t){return OYi(pKi,t)}function u9c(){return BYi(hKi)}function zd(){return LSt(mKi)}function BTt(t){return LYi(gKi,t)}function d9c(t){return FYi(AKi,t)}function f9c(t){return UYi(hFr,t)}function Aa(t,e){return q3r(yKi,t,e)}function p9c(t){let e=t._zod.def.shape;return ei(Object.keys(e))}function vn(t,e){let r={type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},...Qs.normalizeParams(e)};return new LTt(r)}function h9c(t,e){return new LTt({type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},catchall:BTt(),...Qs.normalizeParams(e)})}function Nv(t,e){return new LTt({type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},catchall:zd(),...Qs.normalizeParams(e)})}function Kl(t,e){return new mFr({type:"union",options:t,...Qs.normalizeParams(e)})}function gFr(t,e,r){return new EKi({type:"union",options:e,discriminator:t,...Qs.normalizeParams(r)})}function FTt(t,e){return new _Ki({type:"intersection",left:t,right:e})}function m9c(t,e,r){let n=e instanceof Co,o=n?r:e;return new vKi({type:"tuple",items:t,rest:n?e:null,...Qs.normalizeParams(o)})}function Yl(t,e,r){return new AFr({type:"record",keyType:t,valueType:e,...Qs.normalizeParams(r)})}function g9c(t,e,r){return new AFr({type:"record",keyType:Kl([t,BTt()]),valueType:e,...Qs.normalizeParams(r)})}function A9c(t,e,r){return new CKi({type:"map",keyType:t,valueType:e,...Qs.normalizeParams(r)})}function y9c(t,e){return new bKi({type:"set",valueType:t,...Qs.normalizeParams(e)})}function f1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new I3e({type:"enum",entries:r,...Qs.normalizeParams(e)})}function E9c(t,e){return new I3e({type:"enum",entries:t,...Qs.normalizeParams(e)})}function ei(t,e){return new SKi({type:"literal",values:Array.isArray(t)?t:[t],...Qs.normalizeParams(e)})}function _9c(t){return zYi(TKi,t)}function EFr(t){return new yFr({type:"transform",transform:t})}function gd(t){return new _Fr({type:"optional",innerType:t})}function QSt(t){return new IKi({type:"nullable",innerType:t})}function v9c(t){return gd(QSt(t))}function wKi(t,e){return new xKi({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function PKi(t,e){return new RKi({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function kKi(t,e){return new vFr({type:"nonoptional",innerType:t,...Qs.normalizeParams(e)})}function C9c(t){return new DKi({type:"success",innerType:t})}function MKi(t,e){return new NKi({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function b9c(t){return qYi(OKi,t)}function qSt(t,e){return new CFr({type:"pipe",in:t,out:e})}function LKi(t){return new BKi({type:"readonly",innerType:t})}function S9c(t,e){return new FKi({type:"template_literal",parts:t,...Qs.normalizeParams(e)})}function QKi(t){return new UKi({type:"lazy",getter:t})}function T9c(t){return new qKi({type:"promise",innerType:t})}function jKi(t,e){let r=new fh({check:"custom",...Qs.normalizeParams(e)});return r._zod.check=t,r}function HKi(t,e){return YYi(UTt,t??(()=>!0),e)}function GKi(t,e={}){return KYi(UTt,t,e)}function $Ki(t,e){let r=jKi(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Qs.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(Qs.issue(s))}},t(n.value,n)),e);return r}function I9c(t,e={error:`Input not instance of ${t.name}`}){let r=new UTt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Qs.normalizeParams(e)});return r._zod.bag.Class=t,r}function w9c(t){let e=QKi(()=>Kl([It(t),Pc(),Tm(),pFr(),Aa(e),Yl(It(),e)]));return e}function bFr(t,e){return qSt(EFr(t),e)}function P9c(t){Bv({customError:t})}function k9c(){return Bv().customError}function D9c(t){return hYi(DTt,t)}function N9c(t){return vYi(NTt,t)}function M9c(t){return wYi(MTt,t)}function O9c(t){return PYi(OTt,t)}function B9c(t){return QYi(hFr,t)}function d7c(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function f7c(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function _ne(t){return t==="completed"||t==="failed"||t==="cancelled"}function uJi(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function ul(t,e,r,n,o){t[e]=r,uJi(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"?dJi(e,t.currentPath):e.join("/")}}function _7c(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Rc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&ul(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&ul(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(ul(r,"minItems",t.exactLength.value,t.exactLength.message,e),ul(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function v7c(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?ul(r,"minimum",n.value,n.message,e):ul(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),ul(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?ul(r,"maximum",n.value,n.message,e):ul(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),ul(r,"maximum",n.value,n.message,e));break;case"multipleOf":ul(r,"multipleOf",n.value,n.message,e);break}return r}function C7c(){return{type:"boolean"}}function fJi(t,e){return Rc(t.type._def,e)}function pJi(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>pJi(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 S7c(t,e)}}function T7c(t,e){return{...Rc(t.innerType._def,e),default:t.defaultValue()}}function I7c(t,e){return e.effectStrategy==="input"?Rc(t.schema._def,e):d1(e)}function x7c(t){return{type:"string",enum:Array.from(t.values)}}function R7c(t,e){let r=[Rc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Rc(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(w7c(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 P7c(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 hJi(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":ul(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":ul(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":ZD(r,"email",n.message,e);break;case"format:idn-email":ZD(r,"idn-email",n.message,e);break;case"pattern:zod":Dv(r,JD.email,n.message,e);break}break;case"url":ZD(r,"uri",n.message,e);break;case"uuid":ZD(r,"uuid",n.message,e);break;case"regex":Dv(r,n.regex,n.message,e);break;case"cuid":Dv(r,JD.cuid,n.message,e);break;case"cuid2":Dv(r,JD.cuid2,n.message,e);break;case"startsWith":Dv(r,RegExp(`^${D4r(n.value,e)}`),n.message,e);break;case"endsWith":Dv(r,RegExp(`${D4r(n.value,e)}$`),n.message,e);break;case"datetime":ZD(r,"date-time",n.message,e);break;case"date":ZD(r,"date",n.message,e);break;case"time":ZD(r,"time",n.message,e);break;case"duration":ZD(r,"duration",n.message,e);break;case"length":ul(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),ul(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Dv(r,RegExp(D4r(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&ZD(r,"ipv4",n.message,e),n.version!=="v4"&&ZD(r,"ipv6",n.message,e);break}case"base64url":Dv(r,JD.base64url,n.message,e);break;case"jwt":Dv(r,JD.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Dv(r,JD.ipv4Cidr,n.message,e),n.version!=="v4"&&Dv(r,JD.ipv6Cidr,n.message,e);break}case"emoji":Dv(r,JD.emoji(),n.message,e);break;case"ulid":{Dv(r,JD.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{ZD(r,"binary",n.message,e);break}case"contentEncoding:base64":{ul(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Dv(r,JD.base64,n.message,e);break}}break}case"nanoid":Dv(r,JD.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function D4r(t,e){return e.patternStrategy==="escape"?D7c(t):t}function D7c(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}}})):ul(t,"format",e,r,n)}function Dv(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:zHi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):ul(t,"pattern",zHi(e,n),r,n)}function zHi(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]:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??E1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===vr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=LZi(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===vr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===vr.ZodBranded&&t.keyType._def.type._def.typeName===vr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=OZi(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function BHc(t,e){if(e.mapStrategy==="record")return FZi(t,e);let r=Pc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||E1(e),n=Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||E1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function LHc(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 FHc(t){return t.target==="openAi"?void 0:{not:E1({...t,currentPath:[...t.currentPath,"not"]})}}function UHc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function QHc(t,e){if(e.target==="openApi3")return y$i(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in RTt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=RTt[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 y$i(t,e)}function qHc(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:RTt[t.innerType._def.typeName],nullable:!0}:{type:[RTt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function jHc(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",NZi(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?fl(r,"minimum",n.value,n.message,e):fl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),fl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?fl(r,"maximum",n.value,n.message,e):fl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),fl(r,"maximum",n.value,n.message,e));break;case"multipleOf":fl(r,"multipleOf",n.value,n.message,e);break}return r}function HHc(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=$Hc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Pc(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=GHc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function GHc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Pc(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 $Hc(t){try{return t.isOptional()}catch{return!0}}function zHc(t,e){return Pc(t.type._def,e)}function YHc(t,e){let r={type:"array",uniqueItems:!0,items:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&fl(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&fl(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function KHc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Pc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Pc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Pc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function JHc(t){return{not:E1(t)}}function ZHc(t){return E1(t)}function Pc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==_Hc)return l}if(n&&!r){let l=tGc(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=eGc(t,t.typeName,e),c=typeof s=="function"?Pc(s(),e):s;if(c&&rGc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function iGc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function E$i(t,e){return fB(t)?VFr(t,{target:iGc(e?.target),io:e?.pipeStrategy??"input"}):nGc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function _$i(t){let e=dFe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=bJi(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function C$i(t,e){let r=T3e(t,e);if(!r.success)throw r.error;return r.data}function v$i(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function sGc(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];v$i(c)&&v$i(s)?r[o]={...c,...s}:r[o]=s}return r}function lGc(){let t=new aGc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return cGc.default(t),t}function uGc(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 dGc(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 b$i(t){return!!t&&typeof t=="object"&&UZi in t}function fGc(t){return t[UZi]?.complete}function hGc(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"),!pGc.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 mGc(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 T$i(t){let e=hGc(t);return mGc(t,e.warnings),e.isValid}function QZi(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function qZi(t){return"_def"in t||"_zod"in t||QZi(t)}function VLr(t){return typeof t!="object"||t===null||qZi(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(QZi)}function I$i(t){if(t){if(VLr(t))return OEe(t);if(!qZi(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function AGc(t){let e=dFe(t);return e?Object.entries(e).map(([r,n])=>{let o=DQc(n),s=NQc(n);return{name:r,description:o,required:!s}}):[]}function gV(t){let e=dFe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=bJi(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function x$i(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function yGc(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 EGc(t){let e=new $Lr({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(!_Gc(n))continue;let o=n.description;o&&!d9.has(n)&&d9.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 _Gc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function xr(t){let e;return()=>e??=t()}function vGc(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 GR("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 bGc(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:I0(r)})}catch(s){throw new GR(`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 GR(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=CGc().safeParse(await n.json());if(!o.success)throw new GR(`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 R$i(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function zLr(t,e,r){let n=SGc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=hI(),c=I0(o)+` -`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,HZi.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function SGc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function TGc(t){let{buffer:e,bytesRead:r}=hI().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 IGc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function xGc(t){let e=hI(),{resolvedPath:r,isSymlink:n}=OWi(e,t);n&&Kl(`Reading through symlink: ${t} -> ${r}`);let o=TGc(r),s=e.readFileSync(r,{encoding:o}),c=IGc(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 mJi(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]:Rc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??d1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Rc(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}=hJi(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}=fJi(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function N7c(t,e){if(e.mapStrategy==="record")return mJi(t,e);let r=Rc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||d1(e),n=Rc(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 M7c(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 O7c(t){return t.target==="openAi"?void 0:{not:d1({...t,currentPath:[...t.currentPath,"not"]})}}function B7c(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function L7c(t,e){if(e.target==="openApi3")return YHi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in WSt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=WSt[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 YHi(t,e)}function F7c(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:WSt[t.innerType._def.typeName],nullable:!0}:{type:[WSt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Rc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Rc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function U7c(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",uJi(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?ul(r,"minimum",n.value,n.message,e):ul(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),ul(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?ul(r,"maximum",n.value,n.message,e):ul(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),ul(r,"maximum",n.value,n.message,e));break;case"multipleOf":ul(r,"multipleOf",n.value,n.message,e);break}return r}function Q7c(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=j7c(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Rc(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=q7c(t,e);return c!==void 0&&(n.additionalProperties=c),n}function q7c(t,e){if(t.catchall._def.typeName!=="ZodNever")return Rc(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 j7c(t){try{return t.isOptional()}catch{return!0}}function $7c(t,e){return Rc(t.type._def,e)}function V7c(t,e){let r={type:"array",uniqueItems:!0,items:Rc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&ul(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&ul(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function W7c(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Rc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Rc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Rc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function z7c(t){return{not:d1(t)}}function Y7c(t){return d1(t)}function Rc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==A7c)return l}if(n&&!r){let l=Z7c(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=J7c(t,t.typeName,e),c=typeof s=="function"?Rc(s(),e):s;if(c&&X7c(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function tQc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function KHi(t,e){return eB(t)?j3r(t,{target:tQc(e?.target),io:e?.pipeStrategy??"input"}):eQc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function JHi(t){let e=F3e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=eKi(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function ZHi(t,e){let r=ZLe(t,e);if(!r.success)throw r.error;return r.data}function XHi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function nQc(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];XHi(c)&&XHi(s)?r[o]={...c,...s}:r[o]=s}return r}function sQc(){let t=new iQc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return oQc.default(t),t}function aQc(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 cQc(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 eGi(t){return!!t&&typeof t=="object"&&gJi in t}function lQc(t){return t[gJi]?.complete}function dQc(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"),!uQc.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 fQc(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 rGi(t){let e=dQc(t);return fQc(t,e.warnings),e.isValid}function AJi(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function yJi(t){return"_def"in t||"_zod"in t||AJi(t)}function jBr(t){return typeof t!="object"||t===null||yJi(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(AJi)}function nGi(t){if(t){if(jBr(t))return fEe(t);if(!yJi(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function hQc(t){let e=F3e(t);return e?Object.entries(e).map(([r,n])=>{let o=R6c(n),s=P6c(n);return{name:r,description:o,required:!s}}):[]}function Z$(t){let e=F3e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=eKi(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function iGi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function mQc(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 gQc(t){let e=new qBr({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(!AQc(n))continue;let o=n.description;o&&!K6.has(n)&&K6.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 AQc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function xr(t){let e;return()=>e??=t()}function EQc(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 LR("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 _Qc(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:I0(r)})}catch(s){throw new LR(`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 LR(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=yQc().safeParse(await n.json());if(!o.success)throw new LR(`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 sGi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function GBr(t,e,r){let n=vQc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=cI(),c=I0(o)+` +`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,_Ji.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function vQc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function CQc(t){let{buffer:e,bytesRead:r}=cI().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 bQc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function SQc(t){let e=cI(),{resolvedPath:r,isSymlink:n}=fVi(e,t);n&&Wl(`Reading through symlink: ${t} -> ${r}`);let o=CQc(r),s=e.readFileSync(r,{encoding:o}),c=bQc(s.slice(0,4096));return{content:s.replaceAll(`\r `,` -`),encoding:o,lineEndings:c}}function TIt(t){return xGc(t).content}function GZi(t){return t.startsWith("\uFEFF")?t.slice(1):t}function PGc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),kTt.default.platform==="darwin"?wGc(t):kTt.default.platform==="win32"?RGc(t):kGc(t)}function DGc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||HE(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function NGc(){return DGc()==="essential-traffic"}function OGc(t){LBr.length>=MGc&&LBr.shift(),LBr.push(t)}function $Zi(t){let e=nFe(t);try{if(HE(process.env.CLAUDE_CODE_USE_BEDROCK)||HE(process.env.CLAUDE_CODE_USE_VERTEX)||HE(process.env.CLAUDE_CODE_USE_FOUNDRY)||HE(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||HE(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||NGc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(OGc(r),O$i===null){BGc.push({type:"error",error:e});return}O$i.logError(e)}catch{}}function FGc(t,e,r=100){let n=new JLr({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 YZi(t,e){try{return{ok:!0,value:JSON.parse(GZi(t))}}catch(r){return e&&$Zi(r),{ok:!1}}}function JGc(){let t=H.object({type:H.literal("command").describe("Shell command hook type"),command:H.string().describe("Shell command to execute"),args:H.array(H.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:d3e(),shell:H.enum(KGc).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:H.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:H.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:H.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:H.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=H.object({type:H.literal("prompt").describe("LLM prompt hook type"),prompt:H.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:H.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:H.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:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=H.object({type:H.literal("mcp_tool").describe("MCP tool hook type"),server:H.string().describe("Name of an already-configured MCP server to invoke"),tool:H.string().describe("Name of the tool on that server to call"),input:H.record(H.string(),H.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:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=H.object({type:H.literal("http").describe("HTTP hook type"),url:H.string().url().describe("URL to POST the hook input JSON to"),if:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:H.record(H.string(),H.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:H.array(H.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:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=H.object({type:H.literal("agent").describe("Agentic verifier hook type"),prompt:H.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:H.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.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 f$c(t){return XZi.has(t.toLowerCase())?!1:d$c.test(t)?!0:u$c.test(t)}function O$c(t){let e=N$c();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=M$c().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(Kl(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(Kl(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function cXi(){return V$c.filter(t=>wIt[t].buildGate())}function W$c(t){let e={};for(let r of t)e={...e,...wIt[r].shape()};return e}function z$c(t){let e={};for(let r of t)e={...e,...wIt[r].permissionsShape?.()};return e}function Y$c(t){let e=[];for(let r of t)e.push(...wIt[r].permissionModes?.()??[]);return e}function K$c(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 PEe(t){return Object.hasOwn(q$i,t)?q$i[t]:t}function J$c(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function Z$c(t){let e=X$c(t,"(");if(e===-1)return{toolName:PEe(t)};let r=eVc(t,")");if(r===-1||r<=e)return{toolName:PEe(t)};if(r!==t.length-1)return{toolName:PEe(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:PEe(t)};if(o===""||o==="*")return{toolName:PEe(n)};let s=J$c(o);return{toolName:PEe(n),ruleContent:s}}function X$c(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function eVc(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 tVc(t){return MTt.filePatternTools.includes(t)}function rVc(t){return MTt.bashPrefixTools.includes(t)}function nVc(t){return Object.hasOwn(MTt.customValidation,t)?MTt.customValidation[t]:void 0}function uXi(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function UBr(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 "${H8c(String(n.toolName))}"`};let s=nVc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(rVc(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(tVc(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 fXi(t){return H.object({allow:H.array(QBr()).optional().describe("List of permission rules for allowed operations"),deny:H.array(QBr()).optional().describe("List of permission rules for denied operations"),ask:H.array(QBr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:H.enum([...Z8r,...Y$c(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:H.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...z$c(t),additionalDirectories:H.array(H.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function cVc(t){return H.object({$schema:H.literal($$c).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:H.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:H.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:H.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:H.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:H.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),policyHelper:aVc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...HE(process.env.CLAUDE_CODE_ENABLE_XAA)&&{xaaIdp:H.object({issuer:H.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:H.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:H.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:H.object({type:H.literal("command"),command:H.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:H.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:H.object({enabled:H.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:H.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:H.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 15)"),message:H.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:H.object({enabled:H.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:H.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:H.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:H.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:H.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:H.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:H.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:oVc().optional().describe("Environment variables to set for Claude Code sessions"),attribution:H.object({commit:H.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:H.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:H.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:H.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:fXi(t).optional().describe("Tool usage permissions configuration"),model:H.string().optional().describe("Override the default model used by Claude Code"),availableModels:H.array(H.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:H.record(H.string(),H.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:H.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:H.array(H.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:H.array(H.string()).optional().describe("List of rejected MCP servers from .mcp.json"),skillOverrides:H.record(H.string(),H.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:H.array(pXi()).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:H.array(hXi()).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:DTt().optional().describe("Custom commands to run before/after tool executions"),worktree:H.object({symlinkDirectories:H.array(H.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:H.array(H.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:H.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:H.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:H.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:H.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:H.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:H.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),enableWorkflows:H.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:H.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:H.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:H.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:H.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:H.array(H.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:H.array(H.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:H.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:H.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:H.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:H.preprocess(e=>Array.isArray(e)?e.filter(r=>j$i.includes(r)):e,H.union([H.boolean(),H.array(H.enum(j$i))])).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:H.object({type:H.literal("command"),command:H.string(),padding:H.number().optional(),refreshInterval:H.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:H.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:H.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:H.object({type:H.literal("command"),command:H.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:H.record(H.string(),H.union([H.array(H.string()),H.boolean(),H.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:H.record(H.string(),sVc()).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:H.array(NTt()).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:H.array(NTt()).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:H.array(H.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:H.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),parentSettingsBehavior:H.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:H.union([H.string(),H.array(H.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:H.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:H.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:H.string().optional().describe("Controls the output style for assistant responses"),viewMode:H.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:H.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:H.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:jGc().optional(),feedbackSurveyRate:H.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:H.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:H.object({mode:H.enum(["append","replace"]),verbs:H.array(H.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:H.object({excludeDefault:H.boolean().optional(),tips:H.array(H.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:H.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:H.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:H.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:H.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:H.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:H.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:H.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:H.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:H.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:H.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),awaySummaryEnabled:H.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:H.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:H.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:H.array(H.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:H.record(H.string(),H.object({mcpServers:H.record(H.string(),H.record(H.string(),H.union([H.string(),H.number(),H.boolean(),H.array(H.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:H.record(H.string(),H.union([H.string(),H.number(),H.boolean(),H.array(H.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:H.object({defaultEnvironmentId:H.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:H.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:H.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:H.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:H.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:H.object({enabled:H.boolean().optional(),mode:H.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:H.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:H.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:H.array(H.object({marketplace:H.string(),plugin:H.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:H.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:H.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:H.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:H.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:H.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:H.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:H.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:H.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:H.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:H.array(H.object({id:H.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:H.string().describe("Display name for the SSH connection"),sshHost:H.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:H.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:H.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:H.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:H.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:H.array(H.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:H.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:H.union([H.enum(WGc),H.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:H.enum(GGc).optional().catch(void 0).describe("Key binding mode for the prompt input"),verbose:H.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:H.enum(HGc).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:H.boolean().optional().describe("Automatically compact conversation when context fills"),autoScrollEnabled:H.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),fileCheckpointingEnabled:H.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:H.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:H.boolean().optional().describe("Stamp each assistant message with its arrival time"),terminalProgressBarEnabled:H.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:H.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:H.enum($Gc).optional().catch(void 0).describe("How spawned teammates execute (tmux, in-process, auto)"),remoteControlAtStartup:H.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:H.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:H.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:H.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:H.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:H.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...W$c(t)}).passthrough()}function dVc(t){let e=lVc.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=uVc[$8c(t.path,".")]),r}function H$i(t){return t.code==="invalid_type"}function G$i(t){return t.code==="invalid_value"}function fVc(t){return t.code==="unrecognized_keys"}function $$i(t){return t.code==="too_small"}function qEe(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function V$i(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function EFe(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(G$i(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(H$i(r)){l=r.expected;let h=V$i(r.message);u=h??qEe(r.input),d=h??qEe(r.input)}else $$i(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=dVc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(G$i(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(H$i(r)){let h=V$i(r.message)??qEe(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(fVc(r)){let h=r.keys.join(", ");o=`Unrecognized ${G8c(r.keys.length,"field")}: ${h}`}else $$i(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 pVc(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=dXi(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 mVc(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=qEe(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(!hVc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${zTt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=qEe(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 AVc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of gVc){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 ${qEe(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,AXi.execFile)(t,e,{encoding:"utf-8",timeout:_Vc},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function bVc(){return(async()=>{if(process.platform==="darwin"){let t=CVc(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,yXi.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await f3e(yVc,[...EVc,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([f3e(t,["query",r3r,"/v",LEe]),f3e(t,["query",n3r,"/v",LEe])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(gXi()){let[t,e]=await Promise.all([f3e(z$i,["query",r3r,"/v",LEe]),f3e(z$i,["query",n3r,"/v",LEe])]);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 SVc(){return vVc}function TVc(){BTt||(BTt=(async()=>{let t=Date.now(),e=SVc()??bVc(),{mdm:r,hkcu:n,wslInherits:o}=kVc(await e);EXi=r,_Xi=n,CXi=o;let s=Date.now()-t;if(Kl(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){Kl(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{zLr("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function IVc(){BTt||TVc(),await BTt}function xVc(){return EXi??EV}function wVc(){return _Xi??EV}function RVc(){return CXi}function qBr(t,e){let r=xV(IIt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=T_e(r,e),o=S_e().safeParse(r);if(!o.success){let s=EFe(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function Y$i(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 kVc(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=qBr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:EV,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=Y$i(t.hklmStdout);c&&(r=qBr(c,`Registry: ${r3r}\\${LEe}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:EV,o=gXi(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||DVc(),!s))return{mdm:n,hkcu:EV,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:EV,wslInherits:s}}if(PVc(s))return{mdm:n,hkcu:EV,wslInherits:s};if(t.hkcuStdout){let c=Y$i(t.hkcuStdout);if(c){let l=qBr(c,`Registry: ${n3r}\\${LEe}`);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:EV,wslInherits:s}}function PVc(t){return t&&J$i(OTt)?!0:J$i(eFe())}function K$i(t){let e=xV(IIt(TIt(t),!1));if(!e||typeof e!="object")return!1;T_e(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function DVc(){function t(e){try{let r=IIt(TIt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,$ne.join)(OTt,"managed-settings.json")))return!0;try{let e=(0,$ne.join)(OTt,"managed-settings.d");for(let r of hI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,$ne.join)(e,r.name)))return!0}catch{}return!1}function J$i(t){try{if(K$i((0,$ne.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,$ne.join)(t,"managed-settings.d"),r=hI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(K$i((0,$ne.join)(e,n.name)))return!0}catch{}}catch{}return!1}function NVc(t,e,r){(r!==void 0&&!YTt(t[e],r)||r===void 0&&!(e in t))&&R3r(t,e,r)}function MVc(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 FVc(t){return y_e(t)&&D3r(t)}function $Vc(t){if(!y_e(t)||rFe(t)!=QVc)return!1;var e=RWi(t);if(e===null)return!0;var r=HVc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&vXi.call(r)==GVc}function WVc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function zVc(t){return n3c(t,IWi(t))}function KVc(t,e,r,n,o,s,c){var l=o3r(t,r),u=o3r(e,r),d=c.get(u);if(d){i3r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=IV(u),g=!m&&k3r(u),A=!m&&!g&&SWi(u);f=u,m||g||A?IV(l)?f=l:UVc(l)?f=EFc(l):g?(h=!1,f=wWi(u,!0)):A?(h=!1,f=xFc(u,!0)):f=[]:VVc(u)||D3e(u)?(f=l,D3e(l)?f=YVc(l):(!p9(l)||y3r(l))&&(f=PFc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),i3r(t,r,f)}function bXi(t,e,r,n,o){t!==e&&LVc(e,function(s,c){if(o||(o=new KLc),p9(s))JVc(t,e,c,r,bXi,n,o);else{var l=n?n(o3r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),i3r(t,c,l)}},IWi)}function XVc(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 tWc(t,e,r){return e=Z$i(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=Z$i(n.length-e,0),c=Array(s);++o0){if(++e>=sWc)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function fWc(t,e){return TXi(SXi(t,e,PWi),t+"")}function hWc(t,e,r){if(!p9(r))return!1;var n=typeof e;return(n=="number"?D3r(r)&&XTt(e,r.length):n=="string"&&e in r)?YTt(r[e],t):!1}function gWc(t){return pWc(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&&mWc(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?IXi(l,e-1,r,n,o):CFc(o,l):n||(o[o.length]=l)}return o}function wWc(t){var e=t==null?0:t.length;return e?xWc(t,1):[]}function kWc(t){return TXi(SXi(t,void 0,RWc),t+"")}function OWc(){return void 0??(0,xXi.join)(g_e(),NWc)}function BWc(){try{let t=TIt(OWc()),e=hN(GZi(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function LWc(){if(!void 0&&MWc!==!0)return null;if(HBr)return HBr;let t=BWc();return t?(HBr=t,L3r(),t):null}function e6r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),G$c.filter(r=>e.has(r))}function FWc(){return(0,ly.join)(eFe(),"managed-settings.json")}function wXi(t){if(xIt()==="wsl"&&t.wslInherits?.()){let e=GBr(OTt);if(e.settings)return e;let r=GBr(eFe());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return GBr(eFe())}function GBr(t){let e=[],r={},n=!1,{settings:o,errors:s}=LTt((0,ly.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=vV(r,o,bV),n=!0);let c=(0,ly.join)(t,"managed-settings.d");try{let d=hI().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}=LTt((0,ly.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=vV(r,h,bV),n=!0)}}catch(d){let f=pI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&Kl(`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 UWc(t,e){iFe(t)?Kl(`Broken symlink or missing file encountered for settings.json at path: ${e}`):Kl(`settings file read failed at ${e}: ${t}`,{level:"error"})}function LTt(t,e){let r=h8c(t);if(r)return{settings:r.settings?xV(r.settings):null,errors:r.errors};let n=QWc(t,e);return m8c(t,n),{settings:n.settings?xV(n.settings):null,errors:n.errors}}function RXi(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 kXi(t){let e=t?.remote?t.remote():LWc();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=xV(e),n=T_e(r,"remote managed settings"),o=S_e().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...EFe(o.error,"remote managed settings")]}}function PXi(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=xV(e),n=T_e(r,"parent managed settings"),o=S_e().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...EFe(o.error,"parent managed settings")]}}function DXi(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=xV(e),n=T_e(r,"SDK inline settings"),o=S_e().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...EFe(o.error,"SDK inline settings")]}}function QWc(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=OWi(hI(),t);r=TIt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=xV(IIt(r,!1)),o=T_e(n,t),s=S_e().safeParse(n);if(!s.success){let c=EFe(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return UWc(r,t),{settings:null,errors:[]}}}function eVi(t,e){switch(t){case"userSettings":return(0,ly.resolve)(g_e());case"policySettings":case"projectSettings":case"localSettings":return(0,ly.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,ly.dirname)((0,ly.resolve)(e.flagPath)):(0,ly.resolve)(e.cwd)}}function qWc(t){return t.coworkPlugins||HE(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function FTt(t,e){switch(t){case"userSettings":return(0,ly.join)(eVi(t,e),qWc(e));case"projectSettings":case"localSettings":return(0,ly.join)(eVi(t,e),jWc(t));case"policySettings":return FWc();case"flagSettings":return e.flagPath}}function jWc(t){switch(t){case"projectSettings":return(0,ly.join)(".claude","settings.json");case"localSettings":return(0,ly.join)(".claude","settings.local.json")}}function NXi(t,e){let r=d8c(t);if(r!==void 0)return r;let n=WWc(t,e);return f8c(t,n),n}function HWc(t){return!t||t.parentSettingsBehavior==="merge"}function GWc(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=jBr(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=jBr(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=jBr(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 $Wc(t){if(t.helper?.())return"helper";if(kXi(t).settings)return"remote";if(RXi(t).settings)return xIt()==="macos"?"plist":"hklm";if((t.file?.()??wXi(t)).settings)return"file";if(PXi(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function VWc(t){let e=[],{settings:r,errors:n}=kXi(t);e.push(...n);let{settings:o,errors:s}=RXi(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??wXi(t);e.push(...l);let{settings:u,errors:d}=PXi(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&&HWc(h)?GWc(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function MXi(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=VWc(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:vV({},n??{},r??{},bV),errors:o}}function WWc(t,e){if(t==="policySettings")return MXi(e).settings;let r=FTt(t,e),{settings:n}=r?LTt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=DXi(e);if(o)return vV(n||{},o,bV)}return n}function zWc(t,e){return hzi([...t,...e])}function bV(t,e){if(Array.isArray(t)&&Array.isArray(e))return zWc(t,e)}function YWc(t){if($Br)return{settings:{},errors:[]};let e=Date.now();zLr("info","settings_load_started"),$Br=!0;try{let r=A8c(),n={};r&&(n=vV(n,r,bV));let o=[],s=new Set,c=new Set;for(let l of e6r(t)){if(l==="policySettings"){let{settings:d,errors:f}=MXi(t);d&&(n=vV(n,d,bV));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=FTt(l,t);if(u){let d=(0,ly.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=LTt(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=vV(n,f,bV))}}if(l==="flagSettings"){let{settings:d,errors:f}=DXi(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=vV(n,d,bV))}}return zLr("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{$Br=!1}}function KWc(t){let e=l8c();if(e!==null)return e;let r=YWc(t);return u8c(r),r}function JWc(t){let{settings:e}=KWc(t);return e||{}}function ZWc(t){L3r();let e=[];for(let r of e6r(t)){let n=NXi(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:JWc(t),sources:e}}function XWc(t,e){let r=e6r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(NXi(o,e)?.[t]!==void 0)return o}return null}function izc(t){let e=t.effective.permissions?.defaultMode;if(!e||!rzc.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(nzc.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function ozc(t={}){await IVc();let e={cwd:(0,jZi.resolve)(t.cwd??hI().cwd()),allowedSources:(t.settingSources??tzc).map(r=>ezc[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:xVc,hkcu:wVc,wslInherits:RVc,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=ZWc(e),o=$Wc(e)??void 0,s=n.map(({source:l,settings:u})=>({source:tVi[l],settings:u,path:l==="policySettings"?void 0:FTt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=XWc(l,e);u&&(c[l]={source:tVi[u],path:u==="policySettings"?void 0:FTt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{L3r()}}async function szc(t){return ozc(t)}async function azc(t,e){try{await(0,GE.copyFile)(t,e)}catch(r){if(!iFe(r))throw r}}async function czc(t,e){if(!t)return;let r=t;try{let n=hN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=I0(n))}catch{}await(0,GE.writeFile)(e,r,{mode:384})}function lzc(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=M9c(N9c);return new Promise(e=>{(0,SVi.execFile)("security",["find-generic-password","-a",B9c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function OXi(t,e,r,n,o=6e4){if(!uh(e))return;let s=ZR(r),c=await Qne(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,cc.join)((0,jEe.tmpdir)(),`claude-resume-${(0,VTt.randomUUID)()}`);try{let u=(0,cc.join)(l,"projects",s);await(0,GE.mkdir)(u,{recursive:!0});let d=(0,cc.join)(u,`${e}.jsonl`);await CLr(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,cc.join)((0,jEe.homedir)(),".claude"),m;try{m=await(0,GE.readFile)((0,cc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!iFe(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await lzc()??m),await czc(m,(0,cc.join)(l,".credentials.json")),await azc((0,cc.join)(f??(0,jEe.homedir)(),".claude.json"),(0,cc.join)(l,".claude.json")),t.listSubkeys){let g=(0,cc.join)(u,e),A=await Qne(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,cc.resolve)(g,y+".jsonl");if(!y||(0,cc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+cc.sep)){Kl(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Qne(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 _)c3r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,GE.mkdir)((0,cc.dirname)(E),{recursive:!0}),await CLr(E,b)),v.length>0){let T=v.at(-1),w=(0,cc.resolve)(g,y+".meta.json");await(0,GE.mkdir)((0,cc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,GE.writeFile)(w,I0(x),{mode:384})}}}return l}catch(u){throw await UTt(l),u}}function s3r(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=WBr(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:k=[],tools:D,env:N,executable:L=MVi()?"bun":"node",executableArgs:B=[],extraArgs:Q={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:q,forkSession:F,hooks:U,includeHookEvents:W,includePartialMessages:V,forwardSubagentText:G,onElicitation:Y,persistSession:re,sessionStore:j,sessionStoreFlush:X,thinking:ie,effort:we,maxThinkingTokens:Ae,maxTurns:De,maxBudgetUsd:Te,taskBudget:Z,mcpServers:J,model:z,outputFormat:le,permissionMode:K="default",allowDangerouslySkipPermissions:ae=!1,permissionPromptToolName:Me,plugins:ne,getOAuthToken:se,getHostAuthToken:Ie,workload:_e,resume:Re,resumeSessionAt:Je,sessionId:Xe,skills:Ct,stderr:Ot,strictMcpConfig:$t}=d;if(j&&re===!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(j&&T&&!Re&&!j.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(j&&O)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");j&&d.spawnClaudeCodeProcess&&Kl("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 ut=(0,xVi.fileURLToPath)(importMetaUrlShim),ee=(0,TVi.createRequire)(ut),pe=g6c(ke=>ee.resolve(ke));if(!pe)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=pe}let Ee=le?.type==="json_schema"?le.schema:void 0,Qe=N?{...N}:{...process.env};Qe.CLAUDE_CODE_ENTRYPOINT||(Qe.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),Qe.CLAUDE_AGENT_SDK_VERSION||(Qe.CLAUDE_AGENT_SDK_VERSION="0.3.159"),O&&(Qe.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),se&&(Qe.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ie&&(Qe.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),q?.askUserQuestion?.previewFormat&&(Qe.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=q.askUserQuestion.previewFormat);let nt={};if(zGi.propagation.inject(zGi.context.active(),nt),"traceparent"in nt)for(let ut of["TRACEPARENT","TRACESTATE"])ut in(N??{})||delete Qe[ut];for(let[ut,ee]of Object.entries(nt)){let pe=ut.toUpperCase();pe in(N??{})||(Qe[pe]=ee)}let mt={},xe=new Map;if(J)for(let[ut,ee]of Object.entries(J))ee.type==="sdk"&&ee.instance?xe.set(ut,ee.instance):mt[ut]=ee;let He;if(ie)switch(ie.type){case"adaptive":He={type:"adaptive",display:ie.display};break;case"enabled":He={type:"enabled",budgetTokens:ie.budgetTokens,display:ie.display};break;case"disabled":He={type:"disabled"};break}else Ae!==void 0&&(He=Ae===0?{type:"disabled"}:{type:"enabled",budgetTokens:Ae});r&&(Qe.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(Qe.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 Ze=new gLr({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:_e?{...Q,workload:_e}:Q,pathToClaudeCodeExecutable:Gt,env:Qe,forkSession:F,stderr:Ot,thinkingConfig:He,effort:we,maxTurns:De,maxBudgetUsd:Te,taskBudget:Z,model:z,fallbackModel:M,jsonSchema:Ee,permissionMode:K,allowDangerouslySkipPermissions:ae,permissionPromptToolName:Me,continueConversation:j?void 0:T,resume:Re,resumeSessionAt:Je,sessionId:Xe,settings:typeof s=="object"?I0(s):s,managedSettings:c?I0(c):void 0,settingSources:l,skills:Ct,allowedTools:_,disallowedTools:k,tools:D,mcpServers:mt,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:W,includePartialMessages:V,persistSession:re,sessionMirror:!!j,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),at={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:Ct,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:G},ct=new yLr(Ze,e,b,U,g,xe,Ee,at,Y,se,Ie);if(j){let ut=a(()=>(0,cc.join)(Qe.CLAUDE_CONFIG_DIR??(0,cc.join)((0,jEe.homedir)(),".claude"),"projects"),"S6"),ee=X==="eager",pe=new ELr(async(ke,Le)=>{let Ve=oVi(ke,ut());Ve?await j.append(Ve,Le):Kl(`[SessionStore] dropping mirror frame: filePath ${ke} is not under ${ut()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(ke,Le)=>{let Ve=oVi(ke,ut());Ve&&ct.reportMirrorError(Ve,Le.message)},ee?0:U3r,ee?0:Q3r);ct.setTranscriptMirrorBatcher(pe)}return{queryInstance:ct,transport:Ze,abortController:g,processEnv:Qe}}function a3r(t,e,r,n){typeof r=="string"?e.write(I0({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 UTt(t){for(let e=0;;e++)try{return await(0,GE.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!uzc.has(pI(r)??""))return;await RVi((e+1)*100)}}function dzc(t,e){t.waitForExit().catch(()=>{}).finally(()=>UTt(e))}function fzc({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=s3r({...e},typeof t=="string",void 0,!0),d=(0,cc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Qne(f.listSessions(ZR(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return OXi(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(()=>dzc(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=nFe(g);c.spawnAbort(A),s.setError(A)}),a3r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=s3r(e,typeof t=="string");return a3r(r,n,t,o),r}async function pzc({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,cc.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 Qne(t.sessionStore.listSessions(ZR(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await OXi(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=s3r(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(()=>UTt(g))})}await Qne(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{a3r(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(()=>UTt(r))}throw await c,l}}async function hzc(t,e){return e?.sessionStore?xzc(e.sessionStore,t,e):X6c(t,e)}async function mzc(t){return t?.sessionStore?Tzc(t.sessionStore,t):s9c(t)}async function gzc(t,e){return e?.sessionStore?wzc(e.sessionStore,t,e):a9c(t,e)}async function Azc(t,e,r){return r?.sessionStore?Rzc(r.sessionStore,t,e,r.dir):c9c(t,e,r)}async function yzc(t,e,r){return r?.sessionStore?kzc(r.sessionStore,t,e,r.dir):l9c(t,e,r)}async function Ezc(t,e){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=ZR(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return u9c(t,e)}async function _zc(t,e){return e?.sessionStore?Pzc(e.sessionStore,t,e):g9c(t,e)}async function Czc(t,e,r){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);let n=await rIt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=ZR(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:U3r;if(await rVi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,cc.join)(c,"subagents");for(let u of await vzc(l)){let d=(0,cc.relative)(c,u).split(cc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await rVi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=hN(await(0,GE.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!iFe(m))throw m}}}async function rVi(t,e,r,n){let o=(0,IVi.createInterface)({input:(0,WTt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(hN(l)),c+=l.length,(s.length>=n||c>=Q3r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function vzc(t){let e=[];async function r(n){let o;try{o=await(0,GE.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,cc.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 bzc(t,e){return e?.sessionStore?Dzc(e.sessionStore,t,e.dir):v9c(t,e)}async function Szc(t,e,r){return r?.sessionStore?Nzc(r.sessionStore,t,e,r):b9c(t,e,r)}function BXi(t){let e=(0,cc.resolve)(t??"."),r;try{r=(0,WTt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function ZR(t){return sFe(BXi(t))}function LXi(t){return t.map(e=>I0(e)).join(` +`),encoding:o,lineEndings:c}}function HTt(t){return SQc(t).content}function vJi(t){return t.startsWith("\uFEFF")?t.slice(1):t}function wQc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),zSt.default.platform==="darwin"?TQc(t):zSt.default.platform==="win32"?IQc(t):xQc(t)}function RQc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||QE(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function PQc(){return RQc()==="essential-traffic"}function DQc(t){N4r.length>=kQc&&N4r.shift(),N4r.push(t)}function CJi(t){let e=P3e(t);try{if(QE(process.env.CLAUDE_CODE_USE_BEDROCK)||QE(process.env.CLAUDE_CODE_USE_VERTEX)||QE(process.env.CLAUDE_CODE_USE_FOUNDRY)||QE(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||QE(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||PQc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(DQc(r),fGi===null){NQc.push({type:"error",error:e});return}fGi.logError(e)}catch{}}function OQc(t,e,r=100){let n=new WBr({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 IJi(t,e){try{return{ok:!0,value:JSON.parse(vJi(t))}}catch(r){return e&&CJi(r),{ok:!1}}}function zQc(){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:FLe(),shell:G.enum(WQc).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:FLe(),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:FLe(),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:FLe(),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:FLe(),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 lqc(t){return PJi.has(t.toLowerCase())?!1:cqc.test(t)?!0:aqc.test(t)}function Dqc(t){let e=Pqc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=kqc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(Wl(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(Wl(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function UJi(){return Hqc.filter(t=>VTt[t].buildGate())}function Gqc(t){let e={};for(let r of t)e={...e,...VTt[r].shape()};return e}function $qc(t){let e={};for(let r of t)e={...e,...VTt[r].permissionsShape?.()};return e}function Vqc(t){let e=[];for(let r of t)e.push(...VTt[r].permissionModes?.()??[]);return e}function Wqc(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 cEe(t){return Object.hasOwn(yGi,t)?yGi[t]:t}function zqc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function Yqc(t){let e=Kqc(t,"(");if(e===-1)return{toolName:cEe(t)};let r=Jqc(t,")");if(r===-1||r<=e)return{toolName:cEe(t)};if(r!==t.length-1)return{toolName:cEe(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:cEe(t)};if(o===""||o==="*")return{toolName:cEe(n)};let s=zqc(o);return{toolName:cEe(n),ruleContent:s}}function Kqc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function Jqc(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 Zqc(t){return ZSt.filePatternTools.includes(t)}function Xqc(t){return ZSt.bashPrefixTools.includes(t)}function ejc(t){return Object.hasOwn(ZSt.customValidation,t)?ZSt.customValidation[t]:void 0}function qJi(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function O4r(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 "${QBc(String(n.toolName))}"`};let s=ejc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(Xqc(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(Zqc(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 HJi(t){return G.object({allow:G.array(B4r()).optional().describe("List of permission rules for allowed operations"),deny:G.array(B4r()).optional().describe("List of permission rules for denied operations"),ask:G.array(B4r()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...zFr,...Vqc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...$qc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function ojc(t){return G.object({$schema:G.literal(jqc).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:ijc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...QE(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:rjc().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:HJi(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(GJi()).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($Ji()).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:KSt().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=>EGi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(EGi))])).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(),njc()).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(JSt()).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(JSt()).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:UQc().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(GQc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(qQc).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(QQc).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(jQc).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"),...Gqc(t)}).passthrough()}function cjc(t){let e=sjc.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=ajc[jBc(t.path,".")]),r}function _Gi(t){return t.code==="invalid_type"}function vGi(t){return t.code==="invalid_value"}function ljc(t){return t.code==="unrecognized_keys"}function CGi(t){return t.code==="too_small"}function yEe(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function bGi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function V3e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(vGi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(_Gi(r)){l=r.expected;let h=bGi(r.message);u=h??yEe(r.input),d=h??yEe(r.input)}else CGi(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=cjc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(vGi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(_Gi(r)){let h=bGi(r.message)??yEe(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(ljc(r)){let h=r.keys.join(", ");o=`Unrecognized ${qBc(r.keys.length,"field")}: ${h}`}else CGi(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 ujc(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=jJi(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 fjc(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=yEe(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(!djc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${fTt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=yEe(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 hjc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of pjc){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 ${yEe(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,zJi.execFile)(t,e,{encoding:"utf-8",timeout:Ajc},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function _jc(){return(async()=>{if(process.platform==="darwin"){let t=yjc(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,YJi.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await ULe(mjc,[...gjc,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([ULe(t,["query",ZBr,"/v",hEe]),ULe(t,["query",XBr,"/v",hEe])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(WJi()){let[t,e]=await Promise.all([ULe(TGi,["query",ZBr,"/v",hEe]),ULe(TGi,["query",XBr,"/v",hEe])]);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 vjc(){return Ejc}function Cjc(){eTt||(eTt=(async()=>{let t=Date.now(),e=vjc()??_jc(),{mdm:r,hkcu:n,wslInherits:o}=xjc(await e);KJi=r,JJi=n,ZJi=o;let s=Date.now()-t;if(Wl(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){Wl(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{GBr("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function bjc(){eTt||Cjc(),await eTt}function Sjc(){return KJi??tV}function Tjc(){return JJi??tV}function Ijc(){return ZJi}function L4r(t,e){let r=lV(GTt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=r_e(r,e),o=t_e().safeParse(r);if(!o.success){let s=V3e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function IGi(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 xjc(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=L4r(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:tV,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=IGi(t.hklmStdout);c&&(r=L4r(c,`Registry: ${ZBr}\\${hEe}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:tV,o=WJi(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||Rjc(),!s))return{mdm:n,hkcu:tV,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:tV,wslInherits:s}}if(wjc(s))return{mdm:n,hkcu:tV,wslInherits:s};if(t.hkcuStdout){let c=IGi(t.hkcuStdout);if(c){let l=L4r(c,`Registry: ${XBr}\\${hEe}`);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:tV,wslInherits:s}}function wjc(t){return t&&wGi(XSt)?!0:wGi(x3e())}function xGi(t){let e=lV(GTt(HTt(t),!1));if(!e||typeof e!="object")return!1;r_e(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function Rjc(){function t(e){try{let r=GTt(HTt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,wne.join)(XSt,"managed-settings.json")))return!0;try{let e=(0,wne.join)(XSt,"managed-settings.d");for(let r of cI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,wne.join)(e,r.name)))return!0}catch{}return!1}function wGi(t){try{if(xGi((0,wne.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,wne.join)(t,"managed-settings.d"),r=cI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(xGi((0,wne.join)(e,n.name)))return!0}catch{}}catch{}return!1}function Pjc(t,e,r){(r!==void 0&&!pTt(t[e],r)||r===void 0&&!(e in t))&&TLr(t,e,r)}function kjc(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 Ojc(t){return YEe(t)&&wLr(t)}function jjc(t){if(!YEe(t)||R3e(t)!=Ljc)return!1;var e=sVi(t);if(e===null)return!0;var r=Qjc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&XJi.call(r)==qjc}function Gjc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function $jc(t){return e5c(t,nVi(t))}function Wjc(t,e,r,n,o,s,c){var l=tLr(t,r),u=tLr(e,r),d=c.get(u);if(d){eLr(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=cV(u),g=!m&&ILr(u),A=!m&&!g&&tVi(u);f=u,m||g||A?cV(l)?f=l:Bjc(l)?f=g4c(l):g?(h=!1,f=oVi(u,!0)):A?(h=!1,f=S4c(u,!0)):f=[]:Hjc(u)||o3e(u)?(f=l,o3e(l)?f=Vjc(l):(!Z6(l)||hLr(l))&&(f=w4c(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),eLr(t,r,f)}function eZi(t,e,r,n,o){t!==e&&Mjc(e,function(s,c){if(o||(o=new WOc),Z6(s))zjc(t,e,c,r,eZi,n,o);else{var l=n?n(tLr(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),eLr(t,c,l)}},nVi)}function Kjc(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 Zjc(t,e,r){return e=RGi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=RGi(n.length-e,0),c=Array(s);++o0){if(++e>=nHc)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function lHc(t,e){return rZi(tZi(t,e,cVi),t+"")}function dHc(t,e,r){if(!Z6(r))return!1;var n=typeof e;return(n=="number"?wLr(r)&&ATt(e,r.length):n=="string"&&e in r)?pTt(r[e],t):!1}function pHc(t){return uHc(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&&fHc(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?nZi(l,e-1,r,n,o):y4c(o,l):n||(o[o.length]=l)}return o}function THc(t){var e=t==null?0:t.length;return e?SHc(t,1):[]}function xHc(t){return rZi(tZi(t,void 0,IHc),t+"")}function DHc(){return void 0??(0,iZi.join)(WEe(),PHc)}function NHc(){try{let t=HTt(DHc()),e=sN(vJi(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function MHc(){if(!void 0&&kHc!==!0)return null;if(U4r)return U4r;let t=NHc();return t?(U4r=t,NLr(),t):null}function KFr(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),qqc.filter(r=>e.has(r))}function OHc(){return(0,hy.join)(x3e(),"managed-settings.json")}function oZi(t){if($Tt()==="wsl"&&t.wslInherits?.()){let e=Q4r(XSt);if(e.settings)return e;let r=Q4r(x3e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return Q4r(x3e())}function Q4r(t){let e=[],r={},n=!1,{settings:o,errors:s}=tTt((0,hy.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=iV(r,o,oV),n=!0);let c=(0,hy.join)(t,"managed-settings.d");try{let d=cI().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}=tTt((0,hy.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=iV(r,h,oV),n=!0)}}catch(d){let f=aI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&Wl(`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 BHc(t,e){k3e(t)?Wl(`Broken symlink or missing file encountered for settings.json at path: ${e}`):Wl(`settings file read failed at ${e}: ${t}`,{level:"error"})}function tTt(t,e){let r=dBc(t);if(r)return{settings:r.settings?lV(r.settings):null,errors:r.errors};let n=LHc(t,e);return fBc(t,n),{settings:n.settings?lV(n.settings):null,errors:n.errors}}function sZi(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 aZi(t){let e=t?.remote?t.remote():MHc();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=lV(e),n=r_e(r,"remote managed settings"),o=t_e().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...V3e(o.error,"remote managed settings")]}}function cZi(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=lV(e),n=r_e(r,"parent managed settings"),o=t_e().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...V3e(o.error,"parent managed settings")]}}function lZi(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=lV(e),n=r_e(r,"SDK inline settings"),o=t_e().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...V3e(o.error,"SDK inline settings")]}}function LHc(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=fVi(cI(),t);r=HTt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=lV(GTt(r,!1)),o=r_e(n,t),s=t_e().safeParse(n);if(!s.success){let c=V3e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return BHc(r,t),{settings:null,errors:[]}}}function kGi(t,e){switch(t){case"userSettings":return(0,hy.resolve)(WEe());case"policySettings":case"projectSettings":case"localSettings":return(0,hy.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,hy.dirname)((0,hy.resolve)(e.flagPath)):(0,hy.resolve)(e.cwd)}}function FHc(t){return t.coworkPlugins||QE(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function rTt(t,e){switch(t){case"userSettings":return(0,hy.join)(kGi(t,e),FHc(e));case"projectSettings":case"localSettings":return(0,hy.join)(kGi(t,e),UHc(t));case"policySettings":return OHc();case"flagSettings":return e.flagPath}}function UHc(t){switch(t){case"projectSettings":return(0,hy.join)(".claude","settings.json");case"localSettings":return(0,hy.join)(".claude","settings.local.json")}}function uZi(t,e){let r=cBc(t);if(r!==void 0)return r;let n=GHc(t,e);return lBc(t,n),n}function QHc(t){return!t||t.parentSettingsBehavior==="merge"}function qHc(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=F4r(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=F4r(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=F4r(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 jHc(t){if(t.helper?.())return"helper";if(aZi(t).settings)return"remote";if(sZi(t).settings)return $Tt()==="macos"?"plist":"hklm";if((t.file?.()??oZi(t)).settings)return"file";if(cZi(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function HHc(t){let e=[],{settings:r,errors:n}=aZi(t);e.push(...n);let{settings:o,errors:s}=sZi(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??oZi(t);e.push(...l);let{settings:u,errors:d}=cZi(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&&QHc(h)?qHc(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function dZi(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=HHc(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:iV({},n??{},r??{},oV),errors:o}}function GHc(t,e){if(t==="policySettings")return dZi(e).settings;let r=rTt(t,e),{settings:n}=r?tTt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=lZi(e);if(o)return iV(n||{},o,oV)}return n}function $Hc(t,e){return $Vi([...t,...e])}function oV(t,e){if(Array.isArray(t)&&Array.isArray(e))return $Hc(t,e)}function VHc(t){if(q4r)return{settings:{},errors:[]};let e=Date.now();GBr("info","settings_load_started"),q4r=!0;try{let r=hBc(),n={};r&&(n=iV(n,r,oV));let o=[],s=new Set,c=new Set;for(let l of KFr(t)){if(l==="policySettings"){let{settings:d,errors:f}=dZi(t);d&&(n=iV(n,d,oV));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=rTt(l,t);if(u){let d=(0,hy.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=tTt(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=iV(n,f,oV))}}if(l==="flagSettings"){let{settings:d,errors:f}=lZi(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=iV(n,d,oV))}}return GBr("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{q4r=!1}}function WHc(t){let e=sBc();if(e!==null)return e;let r=VHc(t);return aBc(r),r}function zHc(t){let{settings:e}=WHc(t);return e||{}}function YHc(t){NLr();let e=[];for(let r of KFr(t)){let n=uZi(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:zHc(t),sources:e}}function KHc(t,e){let r=KFr(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(uZi(o,e)?.[t]!==void 0)return o}return null}function tGc(t){let e=t.effective.permissions?.defaultMode;if(!e||!XHc.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(eGc.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function rGc(t={}){await bjc();let e={cwd:(0,EJi.resolve)(t.cwd??cI().cwd()),allowedSources:(t.settingSources??ZHc).map(r=>JHc[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:Sjc,hkcu:Tjc,wslInherits:Ijc,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=YHc(e),o=jHc(e)??void 0,s=n.map(({source:l,settings:u})=>({source:DGi[l],settings:u,path:l==="policySettings"?void 0:rTt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=KHc(l,e);u&&(c[l]={source:DGi[u],path:u==="policySettings"?void 0:rTt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{NLr()}}async function nGc(t){return rGc(t)}async function iGc(t,e){try{await(0,qE.copyFile)(t,e)}catch(r){if(!k3e(r))throw r}}async function oGc(t,e){if(!t)return;let r=t;try{let n=sN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=I0(n))}catch{}await(0,qE.writeFile)(e,r,{mode:384})}function sGc(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=k3c(P3c);return new Promise(e=>{(0,t$i.execFile)("security",["find-generic-password","-a",N3c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function fZi(t,e,r,n,o=6e4){if(!dh(e))return;let s=$R(r),c=await bne(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,sc.join)((0,EEe.tmpdir)(),`claude-resume-${(0,uTt.randomUUID)()}`);try{let u=(0,sc.join)(l,"projects",s);await(0,qE.mkdir)(u,{recursive:!0});let d=(0,sc.join)(u,`${e}.jsonl`);await ABr(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,sc.join)((0,EEe.homedir)(),".claude"),m;try{m=await(0,qE.readFile)((0,sc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!k3e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await sGc()??m),await oGc(m,(0,sc.join)(l,".credentials.json")),await iGc((0,sc.join)(f??(0,EEe.homedir)(),".claude.json"),(0,sc.join)(l,".claude.json")),t.listSubkeys){let g=(0,sc.join)(u,e),A=await bne(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,sc.resolve)(g,y+".jsonl");if(!y||(0,sc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+sc.sep)){Wl(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await bne(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 _)iLr(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,qE.mkdir)((0,sc.dirname)(E),{recursive:!0}),await ABr(E,b)),v.length>0){let T=v.at(-1),w=(0,sc.resolve)(g,y+".meta.json");await(0,qE.mkdir)((0,sc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,qE.writeFile)(w,I0(x),{mode:384})}}}return l}catch(u){throw await nTt(l),u}}function rLr(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=H4r(),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=d$i()?"bun":"node",executableArgs:B=[],extraArgs:j={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:q,forkSession:Q,hooks:U,includeHookEvents:z,includePartialMessages:W,forwardSubagentText:$,onElicitation:J,persistSession:ne,sessionStore:H,sessionStoreFlush:re,thinking:ae,effort:Oe,maxThinkingTokens:ve,maxTurns:Fe,maxBudgetUsd:Pe,taskBudget:Z,mcpServers:ee,model:K,outputFormat:fe,permissionMode:X="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:qe,plugins:ie,getOAuthToken:le,getHostAuthToken:Ne,workload:we,resume:Be,resumeSessionAt:tt,sessionId:st,skills:Et,stderr:kt,strictMcpConfig:Ht}=d;if(H&&ne===!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&&Wl("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 jt=d.pathToClaudeCodeExecutable;if(!jt){let Ge=(0,i$i.fileURLToPath)(importMetaUrlShim),Y=(0,r$i.createRequire)(Ge),se=pLc(pe=>Y.resolve(pe));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.`);jt=se}let Ie=fe?.type==="json_schema"?fe.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"),le&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),q?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=q.askUserQuestion.previewFormat);let be={};if(THi.propagation.inject(THi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,Y]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=Y)}let Ue={},de=new Map;if(ee)for(let[Ge,Y]of Object.entries(ee))Y.type==="sdk"&&Y.instance?de.set(Ge,Y.instance):Ue[Ge]=Y;let Se;if(ae)switch(ae.type){case"adaptive":Se={type:"adaptive",display:ae.display};break;case"enabled":Se={type:"enabled",budgetTokens:ae.budgetTokens,display:ae.display};break;case"disabled":Se={type:"disabled"};break}else ve!==void 0&&(Se=ve===0?{type:"disabled"}:{type:"enabled",budgetTokens:ve});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 Le=new fBr({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:we?{...j,workload:we}:j,pathToClaudeCodeExecutable:jt,env:F,forkSession:Q,stderr:kt,thinkingConfig:Se,effort:Oe,maxTurns:Fe,maxBudgetUsd:Pe,taskBudget:Z,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:X,allowDangerouslySkipPermissions:ue,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:tt,sessionId:st,settings:typeof s=="object"?I0(s):s,managedSettings:c?I0(c):void 0,settingSources:l,skills:Et,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Ue,strictMcpConfig:Ht,canUseTool:!!b,hooks:!!U,includeHookEvents:z,includePartialMessages:W,persistSession:ne,sessionMirror:!!H,plugins:ie,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:Et,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:$},Te=new hBr(Le,e,b,U,g,de,Ie,te,J,le,Ne);if(H){let Ge=a(()=>(0,sc.join)(F.CLAUDE_CONFIG_DIR??(0,sc.join)((0,EEe.homedir)(),".claude"),"projects"),"S6"),Y=re==="eager",se=new mBr(async(pe,Ce)=>{let He=BGi(pe,Ge());He?await H.append(He,Ce):Wl(`[SessionStore] dropping mirror frame: filePath ${pe} is not under ${Ge()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(pe,Ce)=>{let He=BGi(pe,Ge());He&&Te.reportMirrorError(He,Ce.message)},Y?0:OLr,Y?0:BLr);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Le,abortController:g,processEnv:F}}function nLr(t,e,r,n){typeof r=="string"?e.write(I0({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 nTt(t){for(let e=0;;e++)try{return await(0,qE.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!aGc.has(aI(r)??""))return;await s$i((e+1)*100)}}function cGc(t,e){t.waitForExit().catch(()=>{}).finally(()=>nTt(e))}function lGc({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=rLr({...e},typeof t=="string",void 0,!0),d=(0,sc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await bne(f.listSessions($R(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return fZi(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(()=>cGc(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=P3e(g);c.spawnAbort(A),s.setError(A)}),nLr(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=rLr(e,typeof t=="string");return nLr(r,n,t,o),r}async function uGc({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,sc.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 bne(t.sessionStore.listSessions($R(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await fZi(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=rLr(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(()=>nTt(g))})}await bne(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{nLr(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(()=>nTt(r))}throw await c,l}}async function dGc(t,e){return e?.sessionStore?SGc(e.sessionStore,t,e):KLc(t,e)}async function fGc(t){return t?.sessionStore?CGc(t.sessionStore,t):n3c(t)}async function pGc(t,e){return e?.sessionStore?TGc(e.sessionStore,t,e):i3c(t,e)}async function hGc(t,e,r){return r?.sessionStore?IGc(r.sessionStore,t,e,r.dir):o3c(t,e,r)}async function mGc(t,e,r){return r?.sessionStore?xGc(r.sessionStore,t,e,r.dir):s3c(t,e,r)}async function gGc(t,e){if(!dh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=$R(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return a3c(t,e)}async function AGc(t,e){return e?.sessionStore?wGc(e.sessionStore,t,e):p3c(t,e)}async function yGc(t,e,r){if(!dh(t))throw Error(`Invalid sessionId: ${t}`);let n=await _Tt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=$R(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:OLr;if(await NGi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,sc.join)(c,"subagents");for(let u of await EGc(l)){let d=(0,sc.relative)(c,u).split(sc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await NGi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=sN(await(0,qE.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!k3e(m))throw m}}}async function NGi(t,e,r,n){let o=(0,n$i.createInterface)({input:(0,dTt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(sN(l)),c+=l.length,(s.length>=n||c>=BLr)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function EGc(t){let e=[];async function r(n){let o;try{o=await(0,qE.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,sc.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 _Gc(t,e){return e?.sessionStore?RGc(e.sessionStore,t,e.dir):E3c(t,e)}async function vGc(t,e,r){return r?.sessionStore?PGc(r.sessionStore,t,e,r):_3c(t,e,r)}function pZi(t){let e=(0,sc.resolve)(t??"."),r;try{r=(0,dTt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function $R(t){return N3e(pZi(t))}function hZi(t){return t.map(e=>I0(e)).join(` `)+` -`}function nVi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function c3r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function Tzc(t,e){let r=BXi(e.dir),n=sFe(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 Kl("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=nVi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await iVi(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=nVi(c,s,o);return iVi(t,l,e.dir,r)}async function iVi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await UXi(t,o.sessionId,r);if(!s)return null;let c=nIt(o.sessionId,FXi(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 FXi(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,u9).toString("utf-8"),s=n>u9?r.subarray(n-u9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function Izc(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` -`)+1);try{let n=hN(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 UXi(t,e,r){let n=ZR(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:LXi(o)}async function xzc(t,e,r){if(!uh(e))return[];let n=ZR(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:Z6c(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function wzc(t,e,r){if(!uh(e))return;let n=await UXi(t,e,r.dir);if(!n)return;let o=FXi(n,Izc(n));return nIt(e,o)??void 0}async function Rzc(t,e,r,n){if(!uh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=ZR(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,VTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function kzc(t,e,r,n){if(!uh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=S3e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=ZR(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,VTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function Pzc(t,e,r){if(!uh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!uh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=ZR(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}=y9c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function Dzc(t,e,r){if(!uh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=ZR(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 Nzc(t,e,r,n){if(!uh(e))return[];if(!r)return[];let o=ZR(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(c3r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!c3r(f));return d.length===0?[]:uzi(Buffer.from(LXi(d)),{limit:n.limit,offset:n.offset},u)}function oVi(t,e){let r=(0,cc.relative)(e,t),n=r.split(cc.sep);if(n[0]===".."||(0,cc.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 sVi,SVi,VTt,WTt,GE,TVi,jEe,cc,IVi,xVi,wVi,kVi,PVi,DVi,FVi,UVi,gWi,aLr,AWi,Qg,yWi,cB,uLr,DWi,tTt,VE,eie,vo,xm,MWi,lB,jWi,$Wi,_Lr,VWi,lN,WEe,WWi,zWi,YWi,KWi,E_e,__e,vLr,uB,Gne,E3e,aTt,O3e,cTt,dzi,fzi,jZi,$ne,HZi,Yd,Y8r,kTt,KZi,JZi,J8r,ZLr,mXi,AXi,yXi,ly,xXi,tOc,rOc,VBr,nOc,iOc,sOc,aOc,l3r,Ut,cOc,pB,uOc,dOc,fOc,Vd,Wd,pOc,hOc,mOc,aVi,gOc,u_e,AOc,u3r,yOc,d_e,EOc,_Oc,cVi,QTt,COc,lVi,vOc,uVi,bOc,qTt,dVi,d3r,f3r,fVi,p3r,pVi,hVi,SOc,mVi,TOc,IOc,xOc,wOc,ROc,kOc,POc,DOc,NOc,MOc,OOc,BOc,LOc,FOc,UOc,QOc,qOc,jOc,_St,XHi,Rs,uc,kV,jTt,HOc,gVi,AVi,CSt,GOc,pN,$Oc,VOc,yVi,WOc,HTt,GTt,h3r,$Tt,m3r,zOc,EVi,YOc,KOc,JOc,ZOc,XOc,e5c,t5c,r5c,n5c,i5c,o5c,s5c,a5c,c5c,l5c,g3r,u5c,d5c,f5c,p5c,_Vi,CVi,h5c,m5c,g5c,A5c,y5c,vVi,E5c,_5c,C5c,v5c,b5c,S5c,T5c,I5c,x5c,w5c,R5c,k5c,P5c,D5c,N5c,M5c,bVi,O5c,B5c,L5c,F5c,zTt,Q5c,q5c,j5c,H5c,G5c,zBr,g1,Y5c,OVi,K5c,J5c,f_e,Z5c,TV,BVi,X5c,e4c,VLe,r4c,n4c,i4c,s4c,a4c,c4c,eGi,rFe,p9,d4c,f4c,p4c,h4c,y3r,g4c,hBr,tGi,y4c,E4c,_4c,v4c,b4c,S4c,T4c,I4c,x4c,w4c,R4c,P4c,N4c,E3r,O4c,I3e,L4c,U4c,Q4c,q4c,j4c,G4c,$4c,V4c,z4c,Y4c,J4c,rGi,X4c,YTt,KTt,rBc,nBc,oBc,aBc,lBc,dBc,JTt,fBc,LVi,hBc,gBc,ZTt,EBc,CBc,bBc,TBc,_3r,IBc,uy,g_e,G4h,QVi,YBr,xi,FC,fI,HEe,vSt,bSt,SSt,TSt,ISt,xSt,wSt,RSt,kSt,xBc,wBc,KBr,nGi,kBc,qVi,PBc,_V,DBc,MBc,oGi,sGi,aGi,v3r,FBc,QBc,qBc,GVi,PSt,jBc,HBc,S3r,GBc,cGi,mBr,$Bc,Jl,ZBr,Yl,lGi,uGi,DSt,fGi,zBc,pGi,Fne,YVi,YBc,KBc,JBc,I3r,ZBc,JVi,lI,uI,Vne,WLe,Wne,XBr,h3e,NSt,J1t,MSt,eLr,zne,$E,tWi,rWi,x3r,mGi,fLc,pLc,tLr,nWi,hLc,mLc,Ad,iWi,hr,gGi,ELc,Gn,OSt,v3e,BSt,LSt,FSt,USt,w3e,QSt,qSt,GEe,jSt,HSt,cWi,vLc,DEe,bLc,SLc,dWi,QR,pV,TEe,zLe,Z1t,YLe,KLe,X1t,JLe,i9,ZLe,eSt,tSt,Mne,rSt,nSt,XLe,gBr,yGi,iSt,ABr,yBr,EBr,EGi,_Gi,nLr,GSt,TLc,ILc,e3e,IEe,One,bm,m1,cI,l9,hV,t3e,vGi,iLr,$St,SGi,wLc,Yne,VSt,WSt,$Ee,zSt,R3e,YSt,k3e,A1,KSt,qR,mV,xEe,r3e,oSt,n3e,i3e,sSt,o3e,o9,s3e,aSt,cSt,Bne,lSt,uSt,a3e,_Br,xGi,CBr,vBr,bBr,SBr,wGi,RGi,oLr,JSt,P3e,PGi,kLc,ZSt,sLr,w3r,ySt,hWi,PLc,DLc,bp,VEe,MLc,OLc,cLr,LLc,jne,wEe,QLc,jLc,GLc,VLc,WLc,YLc,KLc,JLc,eTt,R3r,XLc,e3c,_Wi,n3c,o3c,y_e,a3c,DGi,CWi,l3c,u3c,d3c,D3e,f3c,IV,m3e,h3c,vWi,NGi,m3c,MGi,g3c,A3c,k3r,y3c,E3c,XTt,C3c,P3r,b3c,S3c,T3c,I3c,x3c,w3c,R3c,k3c,P3c,D3c,N3c,M3c,O3c,B3c,L3c,F3c,U3c,Q3c,q3c,j3c,H3c,G3c,$3c,V3c,md,z3c,K3c,g3e,bWi,b3e,J3c,TBr,Z3c,lLr,OGi,X3c,SWi,eFc,tFc,nFc,iFc,TWi,aFc,D3r,uFc,dFc,fFc,hFc,IWi,A3e,xWi,BGi,gFc,LGi,FGi,wWi,EFc,CFc,vFc,RWi,bFc,UGi,TFc,xFc,QGi,wFc,RFc,PFc,DFc,N3r,MFc,OFc,LFc,FFc,QFc,qFc,jFc,HFc,GFc,VFc,WFc,qGi,jGi,zFc,KFc,eIt,ZFc,M3r,t8c,n8c,o8c,a8c,PWi,O3r,rTt,p8c,B3r,g8c,E8c,C8c,v8c,b8c,$4h,S8c,V4h,T8c,W4h,I8c,z4h,x8c,Y4h,dLr,k8c,D8c,U8c,Q8c,K4h,J4h,V8c,GGi,$Gi,W8c,z8c,VGi,fLr,J8c,Z8c,pLr,X8c,BWi,LWi,t6c,r6c,dSt,IBr,c3e,xBr,hLr,qWi,Z4h,o6c,zd,hN,u6c,nTt,WGi,gLr,REe,iTt,y6c,ALr,yLr,U3r,Q3r,_6c,ELr,zGi,wBr,b6c,x6c,u9,R6c,N3e,N6c,M6c,O6c,sTt,L6c,M3e,F6c,U6c,e9c,p9c,T9c,mzi,I9c,x9c,w9c,eBh,YGi,R9c,P9c,N9c,O9c,lc,KGi,Rn,yV,pr,WR,L9c,B3e,F9c,SLr,UC,to,_3e,y1,JGi,ZGi,zEe,lTt,Kn,YR,XGi,ks,U9c,Q9c,q9c,j9c,H9c,G9c,$9c,V9c,W9c,DBr,z9c,Y9c,K9c,J9c,Z9c,X9c,gzi,eUc,YEe,L3e,F3e,U3e,Q3e,q3e,KEe,JEe,j3e,SV,dB,H3e,wV,mI,ZEe,a9,TLr,XEe,h9,xLr,G3e,$3e,wLr,e_e,t_e,r_e,n_e,Kne,uN,zR,m9,i_e,o_e,V3e,uTt,dTt,s_e,tBh,vr,rBh,nBh,iBh,oBh,sBh,aBh,cBh,lBh,uBh,dBh,fBh,pBh,hBh,mBh,aUc,gBh,ABh,yBh,EBh,_Bh,CBh,vBh,bBh,SBh,TBh,IBh,xBh,wBh,RBh,kBh,PBh,DBh,NBh,MBh,Ezi,_zi,Czi,RV,fTt,Hs,H3r,Szi,AUc,pTt,Tzi,xzi,wzi,RLr,kzi,G3r,cFe,W3r,hTt,z3r,mTt,Y3r,cIt,K3r,lIt,J3r,Mzi,Ozi,Bzi,Lzi,Fzi,Uzi,Qzi,IUc,qzi,a_e,xUc,wUc,RUc,jzi,kUc,PUc,DUc,NUc,MUc,Gzi,$zi,Vzi,Wzi,zzi,Z3r,Yzi,OUc,Kzi,Jzi,Zzi,rYi,nYi,iYi,oYi,sYi,aYi,cYi,lYi,uYi,dh,dYi,X3r,eFr,fYi,pYi,hYi,mYi,gYi,AYi,yYi,EYi,_Yi,lFe,CYi,vYi,bYi,SYi,TYi,IYi,xYi,wYi,RYi,gTt,kYi,bo,uFe,ku,PYi,DYi,NYi,MYi,OYi,BYi,LYi,FYi,UYi,QYi,qYi,jYi,HYi,GYi,$Yi,VYi,WYi,zYi,YYi,KYi,ZYi,XYi,tKi,rKi,rFr,nKi,nFr,iFr,iKi,oKi,sKi,aKi,cKi,ATt,lKi,uKi,dKi,oFr,sFr,aFr,fKi,pKi,uIt,hKi,mKi,gKi,AKi,yKi,EKi,cFr,_Ki,CKi,vKi,bKi,SKi,TKi,IKi,xKi,lFr,wKi,RKi,kKi,PKi,DKi,uFr,BUc,FUc,QUc,jUc,GUc,VUc,zUc,YUc,KUc,JUc,XUc,t7c,n7c,o7c,a7c,l7c,d7c,p7c,m7c,A7c,E7c,C7c,b7c,T7c,x7c,R7c,P7c,N7c,O7c,L7c,U7c,q7c,H7c,$7c,W7c,Y7c,K7c,Z7c,eQc,rQc,iQc,sQc,MKi,OKi,Y3e,d9,FKi,_Tt,Z3e,RQc,kQc,PQc,H,WFr,zFr,YFr,KFr,JFr,wJi,MQc,fFe,RJi,kJi,PJi,DJi,Ps,ZFr,hIt,yd,XFr,CTt,f9,e8r,t8r,r8r,n8r,i8r,o8r,s8r,a8r,c8r,l8r,u8r,d8r,f8r,p8r,h8r,m8r,NJi,mIt,C_e,gIt,AIt,g8r,MJi,OJi,BJi,LJi,FJi,UJi,QJi,y8r,qJi,EIt,E8r,jJi,HJi,GJi,C8r,$Ji,VJi,X3e,WJi,zJi,v8r,S8r,YJi,KJi,ZJi,T8r,tZi,rZi,iZi,I8r,oZi,aZi,cZi,uZi,CIt,kqc,Dqc,mZi,Qqc,gZi,AZi,qqc,Une,vIt,Im,yZi,EZi,OBh,jqc,Hqc,w8r,gI,pFe,Gqc,dy,KR,JR,fy,bIt,_Zi,m$i,CZi,$qc,R8r,hSt,Bi,k8r,Vqc,BBh,LBh,P8r,Wqc,D8r,zqc,hFe,l_e,vZi,Yqc,Kqc,Jqc,Zqc,Xqc,ejc,bZi,tjc,rjc,SZi,N8r,njc,ijc,M8r,ojc,mFe,gFe,sjc,AFe,SIt,ajc,STt,O8r,B8r,L8r,FBh,F8r,U8r,Q8r,cjc,TZi,IZi,q8r,xZi,yFe,v_e,wZi,ljc,DLr,ujc,NLr,djc,j8r,fjc,MLr,pjc,hjc,mjc,gjc,Ajc,yjc,Ejc,_jc,Cjc,vjc,OLr,bjc,Sjc,BLr,H8r,G8r,$8r,Tjc,Ijc,xjc,V8r,wjc,Rjc,kjc,Pjc,Djc,RZi,LLr,Njc,W8r,UBh,Mjc,TTt,Ojc,QBh,ITt,Bjc,kZi,Ljc,Fjc,Ujc,Qjc,qjc,jjc,Hjc,xTt,Gjc,$jc,Vjc,z8r,PZi,Wjc,zjc,Yjc,Kjc,Jjc,Zjc,Xjc,eHc,tHc,rHc,nHc,iHc,oHc,sHc,aHc,cHc,lHc,uHc,wTt,dHc,fHc,pHc,FLr,gHc,AHc,yHc,DZi,EHc,qBh,jBh,HBh,GBh,$Bh,VBh,li,ULr,_Hc,g$i,CHc,vHc,MZi,IHc,xHc,PHc,OBr,oN,MHc,RTt,y$i,VHc,WHc,XHc,eGc,tGc,rGc,nGc,oGc,QLr,aGc,cGc,qLr,jLr,HLr,UZi,S$i,pGc,GLr,$Lr,gGc,u3e,w$i,CGc,GR,WLr,k$i,WBh,zBh,P$i,D$i,N$i,M$i,CV,K8r,BEe,wGc,RGc,kGc,YBh,MGc,LBr,BGc,O$i,KBh,kEe,VZi,YLr,WZi,PTt,B$i,LGc,AV,zZi,QEe,KLr,JLr,UGc,L$i,IIt,xIt,ZBh,XBh,eLh,eFe,tLh,QGc,qGc,jGc,HGc,GGc,$Gc,VGc,WGc,rLh,Z8r,zGc,YGc,nLh,iLh,KGc,d3e,ZGc,XGc,DTt,oLh,sLh,b_e,DV,e$c,t$c,ZZi,r$c,n$c,i$c,o$c,s$c,a$c,c$c,l$c,XLr,aLh,XZi,u$c,d$c,fN,Xne,F$i,e3r,t3r,eXi,X8r,p$c,cLh,h$c,m$c,g$c,A$c,y$c,tXi,rXi,E$c,U$i,_$c,C$c,nXi,v$c,b$c,Q$i,S$c,T$c,iXi,I$c,oXi,x$c,w$c,R$c,NTt,FBr,sXi,k$c,P$c,D$c,N$c,M$c,lLh,aXi,B$c,L$c,F$c,U$c,Q$c,q$c,j$c,uLh,H$c,dLh,G$c,$$c,V$c,mSt,wIt,q$i,lXi,fLh,pLh,MTt,QBr,oVc,hLh,sVc,pXi,hXi,aVc,j$i,S_e,c9,lVc,uVc,mLh,hVc,gVc,W$i,r3r,n3r,LEe,yVc,EVc,_Vc,z$i,OTt,vVc,EV,EXi,_Xi,CXi,BTt,i3r,OVc,BVc,LVc,UVc,QVc,qVc,jVc,vXi,HVc,GVc,VVc,o3r,YVc,JVc,ZVc,eWc,Z$i,SXi,nWc,iWc,oWc,sWc,aWc,cWc,uWc,dWc,TXi,pWc,mWc,AWc,yWc,vV,_Wc,vWc,SWc,X$i,IWc,xWc,RWc,PWc,DWc,jBr,NWc,HBr,MWc,$Br,ezc,tVi,tzc,rzc,nzc,uzc,qXi=me(()=>{p();sVi=require("node:module"),SVi=require("child_process"),VTt=require("crypto"),WTt=require("fs"),GE=require("fs/promises"),TVi=require("module"),jEe=require("os"),cc=require("path"),IVi=require("readline"),xVi=require("url"),wVi=require("events"),kVi=require("child_process"),PVi=require("fs"),DVi=require("readline"),FVi=require("os"),UVi=require("path"),gWi=require("crypto"),aLr=require("path"),AWi=require("async_hooks"),Qg=require("fs/promises"),yWi=require("crypto"),cB=require("fs/promises"),uLr=require("fs"),DWi=require("process"),tTt=require("crypto"),VE=require("fs/promises"),eie=require("path"),vo=ce(require("fs"),1),xm=require("fs/promises"),MWi=require("fs"),lB=require("path"),jWi=require("fs"),$Wi=require("fs/promises"),_Lr=require("events"),VWi=require("fs"),lN=require("fs/promises"),WEe=require("path"),WWi=require("child_process"),zWi=require("util"),YWi=require("child_process"),KWi=require("path"),E_e=require("fs/promises"),__e=require("path"),vLr=require("fs"),uB=require("fs/promises"),Gne=require("path"),E3e=require("crypto"),aTt=require("path"),O3e=require("fs/promises"),cTt=require("path"),dzi=require("crypto"),fzi=require("os"),jZi=require("path"),$ne=require("path"),HZi=require("path"),Yd=ce(require("node:path"),1),Y8r=ce(require("node:os"),1),kTt=ce(require("node:process"),1),KZi=require("path"),JZi=require("fs/promises"),J8r=require("os"),ZLr=require("path"),mXi=require("os"),AXi=require("child_process"),yXi=require("fs"),ly=require("path"),xXi=require("path"),tOc=Object.create,{getPrototypeOf:rOc,defineProperty:VBr,getOwnPropertyNames:nOc}=Object,iOc=Object.prototype.hasOwnProperty;a(oOc,"a_");l3r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?sOc??=new WeakMap:aOc??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?tOc(rOc(t)):{};let c=e||!t||!t.__esModule?VBr(r,"default",{value:t,enumerable:!0}):r;for(let l of nOc(t))iOc.call(c,l)||VBr(c,l,{get:oOc.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),Ut=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),cOc=a(t=>t,"$k");a(lOc,"Qk");pB=a((t,e)=>{for(var r in e)VBr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:lOc.bind(e,r)})},"M4"),uOc=(0,sVi.createRequire)(importMetaUrlShim),dOc=Symbol.dispose||Symbol.for("Symbol.dispose"),fOc=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Vd=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[fOc]),n===void 0&&(n=e[dOc]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),Wd=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$"),pOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),hOc=Ut(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(pOc(),t)}),mOc=Ut(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(hOc(),t)}),aVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),gOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=aVi(),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)}),u_e=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=mOc(),r=aVi(),n=gOc(),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}),AOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=u_e();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")}),u3r=Ut(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={}))}),yOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=u3r();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}),d_e=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=AOc(),r=yOc(),n=u3r(),o=u_e(),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}),EOc=Ut(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}),_Oc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),cVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=d_e(),r=EOc(),n=_Oc(),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}),QTt=Ut(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}),COc=Ut(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}),vOc=Ut(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={}))}),uVi=Ut(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)}}}),bOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=QTt();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}),qTt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=bOc(),r=u_e(),n=d_e(),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}),dVi=Ut(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={}))}),d3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=dVi();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),f3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=d3r();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}),fVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=QTt(),r=f3r(),n=qTt(),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}),p3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=d3r(),r=f3r(),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}),pVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=qTt(),r=fVi(),n=f3r(),o=p3r(),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")}),hVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=pVi(),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}),SOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=pVi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),mVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=hVi(),r=SOc(),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}),TOc=Ut(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={}))}),IOc=Ut(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={}))}),xOc=Ut(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={}))}),wOc=Ut(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}),ROc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=wOc(),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}),kOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=ROc();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),POc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=qTt();t.context=e.ContextAPI.getInstance()}),DOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=d_e();t.diag=e.DiagAPI.instance()}),NOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=lVi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),MOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=NOc(),r=u_e(),n=d_e(),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}),OOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=MOc();t.metrics=e.MetricsAPI.getInstance()}),BOc=Ut(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}),LOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=qTt(),r=QTt(),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}),FOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=u_e(),r=BOc(),n=uVi(),o=LOc(),s=cVi(),c=d_e(),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}),UOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=FOc();t.propagation=e.PropagationAPI.getInstance()}),QOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=u_e(),r=mVi(),n=p3r(),o=fVi(),s=d_e(),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}),qOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=QOc();t.trace=e.TraceAPI.getInstance()}),jOc=Ut(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=cVi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=QTt();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=COc();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=u3r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=lVi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=vOc();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=uVi();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=hVi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=mVi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=TOc();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=IOc();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=xOc();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=dVi();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=kOc();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=p3r();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=d3r();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 _=POc();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=DOc();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=OOc();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=UOc();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=qOc();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}}),_St=Ut(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=_St();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}),Rs=Ut(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=_St(),r=XHi(),n=_St();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=XHi();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(j,X){return this}}class c extends s{static{a(this,"Lj")}constructor(j,X,ie){super(),this.varKind=j,this.name=X,this.rhs=ie}render({es5:j,_n:X}){let ie=j?r.varKinds.var:this.varKind,we=this.rhs===void 0?"":` = ${this.rhs}`;return`${ie} ${this.name}${we};`+X}optimizeNames(j,X){if(j[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,j,X)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(j,X,ie){super(),this.lhs=j,this.rhs=X,this.sideEffects=ie}render({_n:j}){return`${this.lhs} = ${this.rhs};`+j}optimizeNames(j,X){if(!(this.lhs instanceof e.Name&&!j[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,j,X),this}get names(){let j=this.lhs instanceof e.Name?{}:{...this.lhs.names};return Q(j,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(j,X,ie,we){super(j,ie,we),this.op=X}render({_n:j}){return`${this.lhs} ${this.op}= ${this.rhs};`+j}}class d extends s{static{a(this,"Aj")}constructor(j){super(),this.label=j,this.names={}}render({_n:j}){return`${this.label}:`+j}}class f extends s{static{a(this,"Ij")}constructor(j){super(),this.label=j,this.names={}}render({_n:j}){return`break${this.label?` ${this.label}`:""};`+j}}class h extends s{static{a(this,"Rj")}constructor(j){super(),this.error=j}render({_n:j}){return`throw ${this.error};`+j}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(j){super(),this.code=j}render({_n:j}){return`${this.code};`+j}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(j,X){return this.code=M(this.code,j,X),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(j=[]){super(),this.nodes=j}render(j){return this.nodes.reduce((X,ie)=>X+ie.render(j),"")}optimizeNodes(){let{nodes:j}=this,X=j.length;for(;X--;){let ie=j[X].optimizeNodes();Array.isArray(ie)?j.splice(X,1,...ie):ie?j[X]=ie:j.splice(X,1)}return j.length>0?this:void 0}optimizeNames(j,X){let{nodes:ie}=this,we=ie.length;for(;we--;){let Ae=ie[we];Ae.optimizeNames(j,X)||(O(j,Ae.names),ie.splice(we,1))}return ie.length>0?this:void 0}get names(){return this.nodes.reduce((j,X)=>B(j,X.names),{})}}class A extends g{static{a(this,"f1")}render(j){return"{"+j._n+super.render(j)+"}"+j._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(j,X){super(X),this.condition=j}render(j){let X=`if(${this.condition})`+super.render(j);return this.else&&(X+="else "+this.else.render(j)),X}optimizeNodes(){super.optimizeNodes();let j=this.condition;if(j===!0)return this.nodes;let X=this.else;if(X){let ie=X.optimizeNodes();X=this.else=Array.isArray(ie)?new E(ie):ie}if(X)return j===!1?X instanceof _?X:X.nodes:this.nodes.length?this:new _(q(j),X instanceof _?[X]:X.nodes);if(!(j===!1||!this.nodes.length))return this}optimizeNames(j,X){var ie;if(this.else=(ie=this.else)===null||ie===void 0?void 0:ie.optimizeNames(j,X),!!(super.optimizeNames(j,X)||this.else))return this.condition=M(this.condition,j,X),this}get names(){let j=super.names;return Q(j,this.condition),this.else&&B(j,this.else.names),j}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b extends v{static{a(this,"bj")}constructor(j){super(),this.iteration=j}render(j){return`for(${this.iteration})`+super.render(j)}optimizeNames(j,X){if(super.optimizeNames(j,X))return this.iteration=M(this.iteration,j,X),this}get names(){return B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(j,X,ie,we){super(),this.varKind=j,this.name=X,this.from=ie,this.to=we}render(j){let X=j.es5?r.varKinds.var:this.varKind,{name:ie,from:we,to:Ae}=this;return`for(${X} ${ie}=${we}; ${ie}<${Ae}; ${ie}++)`+super.render(j)}get names(){let j=Q(super.names,this.from);return Q(j,this.to)}}class w extends v{static{a(this,"BB")}constructor(j,X,ie,we){super(),this.loop=j,this.varKind=X,this.name=ie,this.iterable=we}render(j){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(j)}optimizeNames(j,X){if(super.optimizeNames(j,X))return this.iterable=M(this.iterable,j,X),this}get names(){return B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(j,X,ie){super(),this.name=j,this.args=X,this.async=ie}render(j){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(j)}}R.kind="func";class x extends g{static{a(this,"OW")}render(j){return"return "+super.render(j)}}x.kind="return";class k extends A{static{a(this,"kj")}render(j){let X="try"+super.render(j);return this.catch&&(X+=this.catch.render(j)),this.finally&&(X+=this.finally.render(j)),X}optimizeNodes(){var j,X;return super.optimizeNodes(),(j=this.catch)===null||j===void 0||j.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(j,X){var ie,we;return super.optimizeNames(j,X),(ie=this.catch)===null||ie===void 0||ie.optimizeNames(j,X),(we=this.finally)===null||we===void 0||we.optimizeNames(j,X),this}get names(){let j=super.names;return this.catch&&B(j,this.catch.names),this.finally&&B(j,this.finally.names),j}}class D extends A{static{a(this,"DW")}constructor(j){super(),this.error=j}render(j){return`catch(${this.error})`+super.render(j)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(j){return"finally"+super.render(j)}}N.kind="finally";class L{static{a(this,"Sj")}constructor(j,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?` -`:""},this._extScope=j,this._scope=new r.Scope({parent:j}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(j){return this._scope.name(j)}scopeName(j){return this._extScope.name(j)}scopeValue(j,X){let ie=this._extScope.value(j,X);return(this._values[ie.prefix]||(this._values[ie.prefix]=new Set)).add(ie),ie}getScopeValue(j,X){return this._extScope.getValue(j,X)}scopeRefs(j){return this._extScope.scopeRefs(j,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(j,X,ie,we){let Ae=this._scope.toName(X);return ie!==void 0&&we&&(this._constants[Ae.str]=ie),this._leafNode(new c(j,Ae,ie)),Ae}const(j,X,ie){return this._def(r.varKinds.const,j,X,ie)}let(j,X,ie){return this._def(r.varKinds.let,j,X,ie)}var(j,X,ie){return this._def(r.varKinds.var,j,X,ie)}assign(j,X,ie){return this._leafNode(new l(j,X,ie))}add(j,X){return this._leafNode(new u(j,t.operators.ADD,X))}code(j){return typeof j=="function"?j():j!==e.nil&&this._leafNode(new m(j)),this}object(...j){let X=["{"];for(let[ie,we]of j)X.length>1&&X.push(","),X.push(ie),(ie!==we||this.opts.es5)&&(X.push(":"),(0,e.addCodeArg)(X,we));return X.push("}"),new e._Code(X)}if(j,X,ie){if(this._blockNode(new _(j)),X&&ie)this.code(X).else().code(ie).endIf();else if(X)this.code(X).endIf();else if(ie)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(j){return this._elseNode(new _(j))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(_,E)}_for(j,X){return this._blockNode(j),X&&this.code(X).endFor(),this}for(j,X){return this._for(new b(j),X)}forRange(j,X,ie,we,Ae=this.opts.es5?r.varKinds.var:r.varKinds.let){let De=this._scope.toName(j);return this._for(new T(Ae,De,X,ie),()=>we(De))}forOf(j,X,ie,we=r.varKinds.const){let Ae=this._scope.toName(j);if(this.opts.es5){let De=X instanceof e.Name?X:this.var("_arr",X);return this.forRange("_i",0,e._`${De}.length`,Te=>{this.var(Ae,e._`${De}[${Te}]`),ie(Ae)})}return this._for(new w("of",we,Ae,X),()=>ie(Ae))}forIn(j,X,ie,we=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(j,e._`Object.keys(${X})`,ie);let Ae=this._scope.toName(j);return this._for(new w("in",we,Ae,X),()=>ie(Ae))}endFor(){return this._endBlockNode(v)}label(j){return this._leafNode(new d(j))}break(j){return this._leafNode(new f(j))}return(j){let X=new x;if(this._blockNode(X),this.code(j),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(j,X,ie){if(!X&&!ie)throw Error('CodeGen: "try" without "catch" and "finally"');let we=new k;if(this._blockNode(we),this.code(j),X){let Ae=this.name("e");this._currNode=we.catch=new D(Ae),X(Ae)}return ie&&(this._currNode=we.finally=new N,this.code(ie)),this._endBlockNode(D,N)}throw(j){return this._leafNode(new h(j))}block(j,X){return this._blockStarts.push(this._nodes.length),j&&this.code(j).endBlock(X),this}endBlock(j){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let ie=this._nodes.length-X;if(ie<0||j!==void 0&&ie!==j)throw Error(`CodeGen: wrong number of nodes: ${ie} vs ${j} expected`);return this._nodes.length=X,this}func(j,X=e.nil,ie,we){return this._blockNode(new R(j,X,ie)),we&&this.code(we).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(j=1){for(;j-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(j){return this._currNode.nodes.push(j),this}_blockNode(j){this._currNode.nodes.push(j),this._nodes.push(j)}_endBlockNode(j,X){let ie=this._currNode;if(ie instanceof j||X&&ie instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${j.kind}/${X.kind}`:j.kind}"`)}_elseNode(j){let X=this._currNode;if(!(X instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=j,this}get _root(){return this._nodes[0]}get _currNode(){let j=this._nodes;return j[j.length-1]}set _currNode(j){let X=this._nodes;X[X.length-1]=j}}t.CodeGen=L;function B(re,j){for(let X in j)re[X]=(re[X]||0)+(j[X]||0);return re}a(B,"v0");function Q(re,j){return j instanceof e._CodeOrName?B(re,j.names):re}a(Q,"ZW");function M(re,j,X){if(re instanceof e.Name)return ie(re);if(!we(re))return re;return new e._Code(re._items.reduce((Ae,De)=>(De instanceof e.Name&&(De=ie(De)),De instanceof e._Code?Ae.push(...De._items):Ae.push(De),Ae),[]));function ie(Ae){let De=X[Ae.str];return De===void 0||j[Ae.str]!==1?Ae:(delete j[Ae.str],De)}function we(Ae){return Ae instanceof e._Code&&Ae._items.some(De=>De instanceof e.Name&&j[De.str]===1&&X[De.str]!==void 0)}}a(M,"V9");function O(re,j){for(let X in j)re[X]=(re[X]||0)-(j[X]||0)}a(O,"dp");function q(re){return typeof re=="boolean"||typeof re=="number"||re===null?!re:e._`!${Y(re)}`}a(q,"vj"),t.not=q;var F=G(t.operators.AND);function U(...re){return re.reduce(F)}a(U,"np"),t.and=U;var W=G(t.operators.OR);function V(...re){return re.reduce(W)}a(V,"op"),t.or=V;function G(re){return(j,X)=>j===e.nil?X:X===e.nil?j:e._`${Y(j)} ${re} ${Y(X)}`}a(G,"Cj");function Y(re){return re instanceof e.Name?re:e._`(${re})`}a(Y,"zB")}),uc=Ut(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=Rs(),r=_St();function n(R){let x={};for(let k of R)x[k]=!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:k,self:D}=R;if(!k.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 k in R)if(x[k])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let k in R)if(k!=="$ref"&&x.all[k])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},k,D,N){if(!N){if(typeof k=="number"||typeof k=="boolean")return k;if(typeof k=="string")return e._`${k}`}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 k of R)x(k);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:k,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):k(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,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(k,!0),()=>R.assign(k,e._`${k} || {}`).code(e._`Object.assign(${k}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>{x===!0?R.assign(k,!0):(R.assign(k,e._`${k} || {}`),E(R,k,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>R.assign(k,e._`${x} === true ? true : ${k} > ${x} ? ${k} : ${x}`)),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>R.assign(k,x===!0?!0:e._`${k} > ${x} ? ${k} : ${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 k=R.var("props",e._`{}`);return x!==void 0&&E(R,k,x),k}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,k){Object.keys(k).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,k){if(R instanceof e.Name){let D=x===b.Num;return k?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return k?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,k=R.opts.strictSchema){if(k){if(x=`strict mode: ${x}`,k===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),kV=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),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}),jTt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Rs(),r=uc(),n=kV();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,k=h(E,_,v);b??(R||x)?u(w,k):d(T,e._`[${k}]`)}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:k,propertyName:D,topSchemaRef:N,schemaPath:L}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),k.messages&&b.push([f.message,typeof v=="function"?v(E):v]),k.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),HOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=jTt(),r=Rs(),n=kV(),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")}),gVi=Ut(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}),AVi=Ut(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}),CSt=Ut(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=gVi(),r=AVi(),n=jTt(),o=Rs(),s=uc(),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,k=h(T,x.coerceTypes),D=T.length>0&&!(k.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,()=>{k.length?m(b,T,k):_(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:k}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);k.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,k.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&k.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 MGi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function iLr(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function CGc(t,e){let r=pZi(e.dir),n=N3e(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 Wl("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=MGi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await OGi(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=MGi(c,s,o);return OGi(t,l,e.dir,r)}async function OGi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await gZi(t,o.sessionId,r);if(!s)return null;let c=vTt(o.sessionId,mZi(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 mZi(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,Y6).toString("utf-8"),s=n>Y6?r.subarray(n-Y6).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function bGc(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` +`)+1);try{let n=sN(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 gZi(t,e,r){let n=$R(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:hZi(o)}async function SGc(t,e,r){if(!dh(e))return[];let n=$R(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:YLc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function TGc(t,e,r){if(!dh(e))return;let n=await gZi(t,e,r.dir);if(!n)return;let o=mZi(n,bGc(n));return vTt(e,o)??void 0}async function IGc(t,e,r,n){if(!dh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=$R(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,uTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function xGc(t,e,r,n){if(!dh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=JLe(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=$R(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,uTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function wGc(t,e,r){if(!dh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!dh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=$R(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}=m3c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function RGc(t,e,r){if(!dh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=$R(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 PGc(t,e,r,n){if(!dh(e))return[];if(!r)return[];let o=$R(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(iLr),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!iLr(f));return d.length===0?[]:qVi(Buffer.from(hZi(d)),{limit:n.limit,offset:n.offset},u)}function BGi(t,e){let r=(0,sc.relative)(e,t),n=r.split(sc.sep);if(n[0]===".."||(0,sc.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 LGi,t$i,uTt,dTt,qE,r$i,EEe,sc,n$i,i$i,o$i,a$i,c$i,l$i,m$i,g$i,W$i,nBr,z$i,jg,Y$i,K4,sBr,lVi,ESt,HE,Lne,vo,xm,dVi,J4,EVi,CVi,gBr,bVi,tN,SEe,SVi,TVi,IVi,xVi,KEe,JEe,yBr,Z4,xne,VLe,TSt,c3e,ISt,jVi,HVi,EJi,wne,_Ji,Wd,$Fr,zSt,xJi,wJi,WFr,zBr,VJi,zJi,YJi,hy,iZi,Zkc,Xkc,j4r,e2c,t2c,n2c,i2c,oLr,qt,o2c,tB,a2c,c2c,l2c,Gd,$d,u2c,d2c,f2c,FGi,p2c,qEe,h2c,sLr,m2c,jEe,g2c,A2c,UGi,iTt,y2c,QGi,E2c,qGi,_2c,oTt,jGi,aLr,cLr,HGi,lLr,GGi,$Gi,v2c,VGi,C2c,b2c,S2c,T2c,I2c,x2c,w2c,R2c,P2c,k2c,D2c,N2c,M2c,O2c,B2c,L2c,F2c,U2c,F1t,Pji,Is,cc,fV,sTt,Q2c,WGi,zGi,U1t,q2c,oN,j2c,H2c,YGi,G2c,aTt,cTt,uLr,lTt,dLr,$2c,KGi,V2c,W2c,z2c,Y2c,K2c,J2c,Z2c,X2c,eDc,tDc,rDc,nDc,iDc,oDc,sDc,fLr,aDc,cDc,lDc,uDc,JGi,ZGi,dDc,fDc,pDc,hDc,mDc,XGi,gDc,ADc,yDc,EDc,_Dc,vDc,CDc,bDc,SDc,TDc,IDc,xDc,wDc,RDc,PDc,kDc,e$i,DDc,NDc,MDc,ODc,fTt,LDc,FDc,UDc,QDc,qDc,G4r,c1,VDc,f$i,WDc,zDc,HEe,YDc,aV,p$i,KDc,JDc,ELe,XDc,eNc,tNc,nNc,iNc,oNc,kji,R3e,Z6,cNc,lNc,uNc,dNc,hLr,pNc,u4r,Dji,mNc,gNc,ANc,ENc,_Nc,vNc,CNc,bNc,SNc,TNc,INc,wNc,PNc,mLr,DNc,XLe,MNc,BNc,LNc,FNc,UNc,qNc,jNc,HNc,$Nc,VNc,zNc,Nji,KNc,pTt,hTt,XNc,eMc,rMc,iMc,sMc,cMc,mTt,lMc,h$i,dMc,pMc,gTt,gMc,yMc,_Mc,CMc,gLr,bMc,my,WEe,sNh,A$i,$4r,Ii,Mv,sI,_Ee,Q1t,q1t,j1t,H1t,G1t,$1t,V1t,W1t,z1t,SMc,TMc,V4r,Mji,xMc,y$i,wMc,rV,RMc,kMc,Bji,Lji,Fji,yLr,OMc,LMc,FMc,v$i,Y1t,UMc,QMc,_Lr,qMc,Uji,d4r,jMc,zl,z4r,Vl,Qji,qji,K1t,Hji,$Mc,Gji,vne,I$i,VMc,WMc,zMc,CLr,YMc,w$i,nI,iI,Rne,_Le,Pne,Y4r,qLe,J1t,m1t,Z1t,K4r,kne,jE,D$i,N$i,bLr,Vji,lOc,uOc,J4r,M$i,dOc,fOc,Ad,O$i,mr,Wji,gOc,Gn,X1t,YLe,eSt,tSt,rSt,nSt,t3e,iSt,oSt,vEe,sSt,aSt,U$i,EOc,lEe,_Oc,vOc,j$i,NR,Y$,rEe,vLe,g1t,CLe,bLe,A1t,SLe,H6,TLe,y1t,E1t,Ane,_1t,v1t,ILe,f4r,Yji,C1t,p4r,h4r,m4r,Kji,Jji,X4r,cSt,COc,bOc,xLe,nEe,yne,bm,a1,rI,z6,K$,wLe,Xji,eBr,lSt,tHi,TOc,Dne,uSt,dSt,CEe,fSt,r3e,pSt,n3e,l1,hSt,MR,J$,iEe,RLe,b1t,PLe,kLe,S1t,DLe,G6,NLe,T1t,I1t,Ene,x1t,w1t,MLe,g4r,iHi,A4r,y4r,E4r,_4r,oHi,sHi,tBr,mSt,i3e,cHi,xOc,gSt,rBr,SLr,B1t,$$i,wOc,ROc,Sp,bEe,kOc,DOc,iBr,MOc,Tne,oEe,LOc,UOc,qOc,HOc,GOc,VOc,WOc,zOc,ySt,TLr,KOc,JOc,J$i,e5c,r5c,YEe,i5c,lHi,Z$i,s5c,a5c,c5c,o3e,l5c,cV,jLe,d5c,X$i,uHi,f5c,dHi,p5c,h5c,ILr,m5c,g5c,ATt,y5c,xLr,_5c,v5c,C5c,b5c,S5c,T5c,I5c,x5c,w5c,R5c,P5c,k5c,D5c,N5c,M5c,O5c,B5c,L5c,F5c,U5c,Q5c,q5c,j5c,H5c,md,$5c,W5c,HLe,eVi,KLe,z5c,v4r,Y5c,oBr,fHi,K5c,tVi,J5c,Z5c,e4c,t4c,rVi,i4c,wLr,a4c,c4c,l4c,d4c,nVi,GLe,iVi,pHi,p4c,hHi,mHi,oVi,g4c,y4c,E4c,sVi,_4c,gHi,C4c,S4c,AHi,T4c,I4c,w4c,R4c,RLr,k4c,D4c,M4c,O4c,L4c,F4c,U4c,Q4c,q4c,H4c,G4c,yHi,EHi,$4c,W4c,yTt,Y4c,PLr,Z4c,eBc,rBc,iBc,cVi,kLr,_St,uBc,DLr,pBc,gBc,yBc,EBc,_Bc,aNh,vBc,cNh,CBc,lNh,bBc,uNh,SBc,dNh,aBr,xBc,RBc,BBc,LBc,fNh,pNh,HBc,vHi,CHi,GBc,$Bc,bHi,cBr,zBc,YBc,lBr,KBc,pVi,hVi,ZBc,XBc,R1t,C4r,OLe,b4r,uBr,yVi,hNh,rLc,Vd,sN,aLc,vSt,SHi,fBr,sEe,CSt,mLc,pBr,hBr,OLr,BLr,ALc,mBr,THi,S4r,_Lc,SLc,Y6,ILc,s3e,PLc,kLc,DLc,SSt,MLc,a3e,OLc,BLc,JLc,u3c,C3c,VVi,b3c,S3c,T3c,gNh,IHi,I3c,w3c,P3c,D3c,ac,xHi,wn,eV,hr,QR,M3c,l3e,O3c,_Br,Ov,eo,WLe,u1,wHi,RHi,TEe,xSt,Kn,jR,PHi,xs,B3c,L3c,F3c,U3c,Q3c,q3c,j3c,H3c,G3c,w4r,$3c,V3c,W3c,z3c,Y3c,K3c,WVi,J3c,IEe,u3e,d3e,f3e,p3e,h3e,xEe,wEe,m3e,sV,X4,g3e,uV,lI,REe,V6,vBr,PEe,X6,bBr,A3e,y3e,SBr,kEe,DEe,NEe,MEe,Nne,rN,qR,e9,OEe,BEe,E3e,wSt,RSt,LEe,ANh,Cr,yNh,ENh,_Nh,vNh,CNh,bNh,SNh,TNh,INh,xNh,wNh,RNh,PNh,kNh,iFc,DNh,NNh,MNh,ONh,BNh,LNh,FNh,UNh,QNh,qNh,jNh,HNh,GNh,$Nh,VNh,WNh,zNh,YNh,KNh,KVi,JVi,ZVi,dV,PSt,Qs,ULr,tWi,hFc,kSt,rWi,iWi,oWi,TBr,aWi,QLr,O3e,HLr,DSt,GLr,NSt,$Lr,ITt,VLr,xTt,WLr,dWi,fWi,pWi,hWi,mWi,gWi,AWi,bFc,yWi,FEe,SFc,TFc,IFc,EWi,xFc,wFc,RFc,PFc,kFc,vWi,CWi,bWi,SWi,TWi,zLr,IWi,DFc,xWi,wWi,RWi,NWi,MWi,OWi,BWi,LWi,FWi,UWi,QWi,qWi,fh,jWi,YLr,KLr,HWi,GWi,$Wi,VWi,WWi,zWi,YWi,KWi,JWi,B3e,ZWi,XWi,ezi,tzi,rzi,nzi,izi,ozi,szi,MSt,azi,Co,L3e,Ru,czi,lzi,uzi,dzi,fzi,pzi,hzi,mzi,gzi,Azi,yzi,Ezi,_zi,vzi,Czi,bzi,Szi,Tzi,Izi,xzi,Rzi,Pzi,Dzi,Nzi,ZLr,Mzi,XLr,e3r,Ozi,Bzi,Lzi,Fzi,Uzi,OSt,Qzi,qzi,jzi,t3r,r3r,n3r,Hzi,Gzi,wTt,$zi,Vzi,Wzi,zzi,Yzi,Kzi,i3r,Jzi,Zzi,Xzi,eYi,tYi,rYi,nYi,iYi,o3r,oYi,sYi,aYi,cYi,lYi,s3r,NFc,OFc,LFc,UFc,qFc,HFc,$Fc,VFc,WFc,zFc,KFc,ZFc,e8c,r8c,i8c,s8c,c8c,u8c,f8c,h8c,g8c,y8c,_8c,C8c,S8c,I8c,w8c,P8c,D8c,M8c,B8c,F8c,Q8c,j8c,G8c,V8c,W8c,Y8c,J8c,X8c,t6c,n6c,dYi,fYi,C3e,K6,mYi,FSt,T3e,I6c,x6c,w6c,G,H3r,G3r,$3r,V3r,W3r,oKi,k6c,U3e,sKi,aKi,cKi,lKi,ws,z3r,DTt,yd,Y3r,USt,J6,K3r,J3r,Z3r,X3r,eFr,tFr,rFr,nFr,iFr,oFr,sFr,aFr,cFr,lFr,uFr,dFr,uKi,NTt,ZEe,MTt,OTt,fFr,dKi,fKi,pKi,hKi,mKi,gKi,AKi,hFr,yKi,LTt,mFr,EKi,_Ki,vKi,AFr,CKi,bKi,I3e,SKi,TKi,yFr,_Fr,IKi,xKi,RKi,vFr,DKi,NKi,OKi,CFr,BKi,FKi,UKi,qKi,UTt,x9c,R9c,VKi,L9c,WKi,zKi,F9c,Cne,QTt,Im,YKi,KKi,JNh,U9c,Q9c,SFr,uI,Q3e,q9c,gy,HR,GR,Ay,qTt,JKi,VHi,ZKi,j9c,TFr,D1t,Oi,IFr,H9c,ZNh,XNh,xFr,G9c,wFr,$9c,q3e,QEe,XKi,V9c,W9c,z9c,Y9c,K9c,J9c,eJi,Z9c,X9c,tJi,RFr,eUc,tUc,PFr,rUc,j3e,H3e,nUc,G3e,jTt,iUc,jSt,kFr,DFr,NFr,eMh,MFr,OFr,BFr,oUc,rJi,nJi,LFr,iJi,$3e,XEe,oJi,sUc,wBr,aUc,RBr,cUc,FFr,lUc,PBr,uUc,dUc,fUc,pUc,hUc,mUc,gUc,AUc,yUc,EUc,kBr,_Uc,vUc,DBr,UFr,QFr,qFr,CUc,bUc,SUc,jFr,TUc,IUc,xUc,wUc,RUc,sJi,NBr,PUc,HFr,tMh,kUc,HSt,DUc,rMh,GSt,NUc,aJi,MUc,OUc,BUc,LUc,FUc,UUc,QUc,$St,qUc,jUc,HUc,GFr,cJi,GUc,$Uc,VUc,WUc,zUc,YUc,KUc,JUc,ZUc,XUc,e7c,t7c,r7c,n7c,i7c,o7c,s7c,a7c,VSt,c7c,l7c,u7c,MBr,p7c,h7c,m7c,lJi,g7c,nMh,iMh,oMh,sMh,aMh,cMh,ui,OBr,A7c,WHi,y7c,E7c,dJi,b7c,S7c,w7c,k4r,JD,k7c,WSt,YHi,H7c,G7c,K7c,J7c,Z7c,X7c,eQc,rQc,BBr,iQc,oQc,LBr,FBr,UBr,gJi,tGi,uQc,QBr,qBr,pQc,LLe,oGi,yQc,LR,HBr,aGi,lMh,uMh,cGi,lGi,uGi,dGi,nV,VFr,pEe,TQc,IQc,xQc,dMh,kQc,N4r,NQc,fGi,fMh,aEe,bJi,$Br,SJi,YSt,pGi,MQc,X$,TJi,AEe,VBr,WBr,BQc,hGi,GTt,$Tt,hMh,mMh,gMh,x3e,AMh,LQc,FQc,UQc,QQc,qQc,jQc,HQc,GQc,yMh,zFr,$Qc,VQc,EMh,_Mh,WQc,FLe,YQc,KQc,KSt,vMh,CMh,e_e,hV,JQc,ZQc,RJi,XQc,eqc,tqc,rqc,nqc,iqc,oqc,sqc,YBr,bMh,PJi,aqc,cqc,iN,Bne,mGi,KBr,JBr,kJi,YFr,uqc,SMh,dqc,fqc,pqc,hqc,mqc,DJi,NJi,gqc,gGi,Aqc,yqc,MJi,Eqc,_qc,AGi,vqc,Cqc,OJi,bqc,BJi,Sqc,Tqc,Iqc,JSt,M4r,LJi,xqc,wqc,Rqc,Pqc,kqc,TMh,FJi,Nqc,Mqc,Oqc,Bqc,Lqc,Fqc,Uqc,IMh,Qqc,xMh,qqc,jqc,Hqc,N1t,VTt,yGi,QJi,wMh,RMh,ZSt,B4r,rjc,PMh,njc,GJi,$Ji,ijc,EGi,t_e,W6,sjc,ajc,kMh,djc,pjc,SGi,ZBr,XBr,hEe,mjc,gjc,Ajc,TGi,XSt,Ejc,tV,KJi,JJi,ZJi,eTt,eLr,Djc,Njc,Mjc,Bjc,Ljc,Fjc,Ujc,XJi,Qjc,qjc,Hjc,tLr,Vjc,zjc,Yjc,Jjc,RGi,tZi,eHc,tHc,rHc,nHc,iHc,oHc,aHc,cHc,rZi,uHc,fHc,hHc,mHc,iV,AHc,EHc,vHc,PGi,bHc,SHc,IHc,wHc,RHc,F4r,PHc,U4r,kHc,q4r,JHc,DGi,ZHc,XHc,eGc,aGc,yZi=_e(()=>{p();LGi=require("node:module"),t$i=require("child_process"),uTt=require("crypto"),dTt=require("fs"),qE=require("fs/promises"),r$i=require("module"),EEe=require("os"),sc=require("path"),n$i=require("readline"),i$i=require("url"),o$i=require("events"),a$i=require("child_process"),c$i=require("fs"),l$i=require("readline"),m$i=require("os"),g$i=require("path"),W$i=require("crypto"),nBr=require("path"),z$i=require("async_hooks"),jg=require("fs/promises"),Y$i=require("crypto"),K4=require("fs/promises"),sBr=require("fs"),lVi=require("process"),ESt=require("crypto"),HE=require("fs/promises"),Lne=require("path"),vo=he(require("fs"),1),xm=require("fs/promises"),dVi=require("fs"),J4=require("path"),EVi=require("fs"),CVi=require("fs/promises"),gBr=require("events"),bVi=require("fs"),tN=require("fs/promises"),SEe=require("path"),SVi=require("child_process"),TVi=require("util"),IVi=require("child_process"),xVi=require("path"),KEe=require("fs/promises"),JEe=require("path"),yBr=require("fs"),Z4=require("fs/promises"),xne=require("path"),VLe=require("crypto"),TSt=require("path"),c3e=require("fs/promises"),ISt=require("path"),jVi=require("crypto"),HVi=require("os"),EJi=require("path"),wne=require("path"),_Ji=require("path"),Wd=he(require("node:path"),1),$Fr=he(require("node:os"),1),zSt=he(require("node:process"),1),xJi=require("path"),wJi=require("fs/promises"),WFr=require("os"),zBr=require("path"),VJi=require("os"),zJi=require("child_process"),YJi=require("fs"),hy=require("path"),iZi=require("path"),Zkc=Object.create,{getPrototypeOf:Xkc,defineProperty:j4r,getOwnPropertyNames:e2c}=Object,t2c=Object.prototype.hasOwnProperty;a(r2c,"a_");oLr=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?n2c??=new WeakMap:i2c??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?Zkc(Xkc(t)):{};let c=e||!t||!t.__esModule?j4r(r,"default",{value:t,enumerable:!0}):r;for(let l of e2c(t))t2c.call(c,l)||j4r(c,l,{get:r2c.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),qt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),o2c=a(t=>t,"$k");a(s2c,"Qk");tB=a((t,e)=>{for(var r in e)j4r(t,r,{get:e[r],enumerable:!0,configurable:!0,set:s2c.bind(e,r)})},"M4"),a2c=(0,LGi.createRequire)(importMetaUrlShim),c2c=Symbol.dispose||Symbol.for("Symbol.dispose"),l2c=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Gd=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[l2c]),n===void 0&&(n=e[c2c]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),$d=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$"),u2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),d2c=qt(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(u2c(),t)}),f2c=qt(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(d2c(),t)}),FGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),p2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=FGi(),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)}),qEe=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=f2c(),r=FGi(),n=p2c(),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}),h2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=qEe();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")}),sLr=qt(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={}))}),m2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=sLr();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}),jEe=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=h2c(),r=m2c(),n=sLr(),o=qEe(),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}),g2c=qt(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}),A2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),UGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=jEe(),r=g2c(),n=A2c(),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}),iTt=qt(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}),y2c=qt(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}),E2c=qt(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={}))}),qGi=qt(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)}}}),_2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=iTt();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}),oTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=_2c(),r=qEe(),n=jEe(),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}),jGi=qt(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={}))}),aLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=jGi();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),cLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=aLr();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}),HGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=iTt(),r=cLr(),n=oTt(),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}),lLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=aLr(),r=cLr(),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}),GGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=oTt(),r=HGi(),n=cLr(),o=lLr(),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")}),$Gi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=GGi(),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}),v2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=GGi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),VGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=$Gi(),r=v2c(),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}),C2c=qt(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={}))}),b2c=qt(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={}))}),S2c=qt(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={}))}),T2c=qt(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}),I2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=T2c(),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}),x2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=I2c();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),w2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=oTt();t.context=e.ContextAPI.getInstance()}),R2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=jEe();t.diag=e.DiagAPI.instance()}),P2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=QGi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),k2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=P2c(),r=qEe(),n=jEe(),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}),D2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=k2c();t.metrics=e.MetricsAPI.getInstance()}),N2c=qt(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}),M2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=oTt(),r=iTt(),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}),O2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=qEe(),r=N2c(),n=qGi(),o=M2c(),s=UGi(),c=jEe(),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}),B2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=O2c();t.propagation=e.PropagationAPI.getInstance()}),L2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=qEe(),r=VGi(),n=lLr(),o=HGi(),s=jEe(),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}),F2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=L2c();t.trace=e.TraceAPI.getInstance()}),U2c=qt(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=UGi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=iTt();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=y2c();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=sLr();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=QGi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=E2c();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=qGi();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=$Gi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=VGi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=C2c();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=b2c();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=S2c();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=jGi();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=x2c();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=lLr();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=aLr();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 _=w2c();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=R2c();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=D2c();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=B2c();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=F2c();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}}),F1t=qt(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=F1t();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}),Is=qt(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=F1t(),r=Pji(),n=F1t();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=Pji();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,ae){super(),this.varKind=H,this.name=re,this.rhs=ae}render({es5:H,_n:re}){let ae=H?r.varKinds.var:this.varKind,Oe=this.rhs===void 0?"":` = ${this.rhs}`;return`${ae} ${this.name}${Oe};`+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,ae){super(),this.lhs=H,this.rhs=re,this.sideEffects=ae}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 j(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,ae,Oe){super(H,ae,Oe),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,ae)=>re+ae.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let ae=H[re].optimizeNodes();Array.isArray(ae)?H.splice(re,1,...ae):ae?H[re]=ae:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:ae}=this,Oe=ae.length;for(;Oe--;){let ve=ae[Oe];ve.optimizeNames(H,re)||(O(H,ve.names),ae.splice(Oe,1))}return ae.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 ae=re.optimizeNodes();re=this.else=Array.isArray(ae)?new E(ae):ae}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(q(H),re instanceof _?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var ae;if(this.else=(ae=this.else)===null||ae===void 0?void 0:ae.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 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,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,ae,Oe){super(),this.varKind=H,this.name=re,this.from=ae,this.to=Oe}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:ae,from:Oe,to:ve}=this;return`for(${re} ${ae}=${Oe}; ${ae}<${ve}; ${ae}++)`+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,re,ae,Oe){super(),this.loop=H,this.varKind=re,this.name=ae,this.iterable=Oe}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,ae){super(),this.name=H,this.args=re,this.async=ae}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 ae,Oe;return super.optimizeNames(H,re),(ae=this.catch)===null||ae===void 0||ae.optimizeNames(H,re),(Oe=this.finally)===null||Oe===void 0||Oe.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 ae=this._extScope.value(H,re);return(this._values[ae.prefix]||(this._values[ae.prefix]=new Set)).add(ae),ae}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,ae,Oe){let ve=this._scope.toName(re);return ae!==void 0&&Oe&&(this._constants[ve.str]=ae),this._leafNode(new c(H,ve,ae)),ve}const(H,re,ae){return this._def(r.varKinds.const,H,re,ae)}let(H,re,ae){return this._def(r.varKinds.let,H,re,ae)}var(H,re,ae){return this._def(r.varKinds.var,H,re,ae)}assign(H,re,ae){return this._leafNode(new l(H,re,ae))}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[ae,Oe]of H)re.length>1&&re.push(","),re.push(ae),(ae!==Oe||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Oe));return re.push("}"),new e._Code(re)}if(H,re,ae){if(this._blockNode(new _(H)),re&&ae)this.code(re).else().code(ae).endIf();else if(re)this.code(re).endIf();else if(ae)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,ae,Oe,ve=this.opts.es5?r.varKinds.var:r.varKinds.let){let Fe=this._scope.toName(H);return this._for(new T(ve,Fe,re,ae),()=>Oe(Fe))}forOf(H,re,ae,Oe=r.varKinds.const){let ve=this._scope.toName(H);if(this.opts.es5){let Fe=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Fe}.length`,Pe=>{this.var(ve,e._`${Fe}[${Pe}]`),ae(ve)})}return this._for(new w("of",Oe,ve,re),()=>ae(ve))}forIn(H,re,ae,Oe=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,ae);let ve=this._scope.toName(H);return this._for(new w("in",Oe,ve,re),()=>ae(ve))}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,ae){if(!re&&!ae)throw Error('CodeGen: "try" without "catch" and "finally"');let Oe=new P;if(this._blockNode(Oe),this.code(H),re){let ve=this.name("e");this._currNode=Oe.catch=new D(ve),re(ve)}return ae&&(this._currNode=Oe.finally=new N,this.code(ae)),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 ae=this._nodes.length-re;if(ae<0||H!==void 0&&ae!==H)throw Error(`CodeGen: wrong number of nodes: ${ae} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,ae,Oe){return this._blockNode(new R(H,re,ae)),Oe&&this.code(Oe).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 ae=this._currNode;if(ae instanceof H||re&&ae 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(ne,H){for(let re in H)ne[re]=(ne[re]||0)+(H[re]||0);return ne}a(B,"v0");function j(ne,H){return H instanceof e._CodeOrName?B(ne,H.names):ne}a(j,"ZW");function M(ne,H,re){if(ne instanceof e.Name)return ae(ne);if(!Oe(ne))return ne;return new e._Code(ne._items.reduce((ve,Fe)=>(Fe instanceof e.Name&&(Fe=ae(Fe)),Fe instanceof e._Code?ve.push(...Fe._items):ve.push(Fe),ve),[]));function ae(ve){let Fe=re[ve.str];return Fe===void 0||H[ve.str]!==1?ve:(delete H[ve.str],Fe)}function Oe(ve){return ve instanceof e._Code&&ve._items.some(Fe=>Fe instanceof e.Name&&H[Fe.str]===1&&re[Fe.str]!==void 0)}}a(M,"V9");function O(ne,H){for(let re in H)ne[re]=(ne[re]||0)-(H[re]||0)}a(O,"dp");function q(ne){return typeof ne=="boolean"||typeof ne=="number"||ne===null?!ne:e._`!${J(ne)}`}a(q,"vj"),t.not=q;var Q=$(t.operators.AND);function U(...ne){return ne.reduce(Q)}a(U,"np"),t.and=U;var z=$(t.operators.OR);function W(...ne){return ne.reduce(z)}a(W,"op"),t.or=W;function $(ne){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${J(H)} ${ne} ${J(re)}`}a($,"Cj");function J(ne){return ne instanceof e.Name?ne:e._`(${ne})`}a(J,"zB")}),cc=qt(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=Is(),r=F1t();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}),fV=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),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}),sTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Is(),r=cc(),n=fV();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")}),Q2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=sTt(),r=Is(),n=fV(),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")}),WGi=qt(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}),zGi=qt(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}),U1t=qt(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=WGi(),r=zGi(),n=sTt(),o=Is(),s=cc(),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,k;switch(b){case"null":return o._`${T} ${x} null`;case"array":k=o._`Array.isArray(${T})`;break;case"object":k=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":k=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":k=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?k:(0,o.not)(k);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,k=(0,s.toHash)(b);if(k.array&&k.object){let D=o._`typeof ${T} != "object"`;x=k.null?D:o._`!${T} || ${D}`,delete k.null,delete k.array,delete k.object}else x=o.nil;k.number&&delete k.integer;for(let D in k)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")}),GOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Rs(),r=uc();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")}),pN=Ut(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=Rs(),r=uc(),n=kV(),o=uc();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(k=>(0,e.and)(h(b,T,k,w.ownProperties),e._`${x} = ${k}`)))}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:k},it:D},N,L,B){let Q=B?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,k)],[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,k=x(w,R);return b.scopeValue("pattern",{key:k.toString(),ref:k,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,k=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(k,!0),D(()=>T.break()),k;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},k),T.if((0,e.not)(k),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 k=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(k,e._`${k} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(k))})),b.result(k,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),$Oc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Rs(),r=kV(),n=pN(),o=jTt();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),k=E.let("valid");g.block$data(k,D),g.ok((y=A.valid)!==null&&y!==void 0?y:k);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(k,!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,q=!("compile"in A&&!T||A.schema===!1);E.assign(k,e._`${M}${(0,n.callValidateCode)(g,x,O,q)}`,A.modifying)}a(B,"O");function Q(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:k),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}),VOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Rs(),r=uc();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}),yVi=Ut((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},"$")}),WOc=Ut((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=uc(),r=yVi(),n=WOc(),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={},k=new Set;return n(E,{allKeys:!0},(L,B,Q,M)=>{if(M===void 0)return;let O=R+B,q=w[M];typeof L[v]=="string"&&(q=F.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=q;function F(W){let V=this.opts.uriResolver.resolve;if(W=m(q?V(q,W):W),k.has(W))throw N(W);k.add(W);let G=this.refs[W];return typeof G=="string"&&(G=this.refs[G]),typeof G=="object"?D(L,G.schema,W):W!==m(O)&&(W[0]==="#"?(D(L,x[W],W),x[W]=L):this.refs[W]=O),W}a(F,"M");function U(W){if(typeof W=="string"){if(!A.test(W))throw Error(`invalid anchor "${W}"`);F.call(this,`#${W}`)}}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}),GTt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=HOc(),r=CSt(),n=AVi(),o=CSt(),s=GOc(),c=$Oc(),l=VOc(),u=Rs(),d=kV(),f=HTt(),h=uc(),m=jTt();function g(J){if(R(J)&&(k(J),w(J))){_(J);return}A(J,()=>(0,e.topBoolOrEmptySchema)(J))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:J,validateName:z,schema:le,schemaEnv:K,opts:ae},Me){ae.code.es5?J.func(z,u._`${d.default.data}, ${d.default.valCxt}`,K.$async,()=>{J.code(u._`"use strict"; ${b(le,ae)}`),E(J,ae),J.code(Me)}):J.func(z,u._`${d.default.data}, ${y(ae)}`,K.$async,()=>J.code(b(le,ae)).code(Me))}a(A,"mA");function y(J){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${J.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}a(y,"An");function E(J,z){J.if(d.default.valCxt,()=>{J.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),J.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),J.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),J.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),z.dynamicRef&&J.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{J.var(d.default.instancePath,u._`""`),J.var(d.default.parentData,u._`undefined`),J.var(d.default.parentDataProperty,u._`undefined`),J.var(d.default.rootData,d.default.data),z.dynamicRef&&J.var(d.default.dynamicAnchors,u._`{}`)})}a(E,"In");function _(J){let{schema:z,opts:le,gen:K}=J;A(J,()=>{le.$comment&&z.$comment&&M(J),L(J),K.let(d.default.vErrors,null),K.let(d.default.errors,0),le.unevaluated&&v(J),D(J),O(J)})}a(_,"Rn");function v(J){let{gen:z,validateName:le}=J;J.evaluated=z.const("evaluated",u._`${le}.evaluated`),z.if(u._`${J.evaluated}.dynamicProps`,()=>z.assign(u._`${J.evaluated}.props`,u._`undefined`)),z.if(u._`${J.evaluated}.dynamicItems`,()=>z.assign(u._`${J.evaluated}.items`,u._`undefined`))}a(v,"Pn");function b(J,z){let le=typeof J=="object"&&J[z.schemaId];return le&&(z.code.source||z.code.process)?u._`/*# sourceURL=${le} */`:u.nil}a(b,"fA");function T(J,z){if(R(J)&&(k(J),w(J))){x(J,z);return}(0,e.boolOrEmptySchema)(J,z)}a(T,"En");function w({schema:J,self:z}){if(typeof J=="boolean")return!J;for(let le in J)if(z.RULES.all[le])return!0;return!1}a(w,"lA");function R(J){return typeof J.schema!="boolean"}a(R,"cA");function x(J,z){let{schema:le,gen:K,opts:ae}=J;ae.$comment&&le.$comment&&M(J),B(J),Q(J);let Me=K.const("_errs",d.default.errors);D(J,Me),K.var(z,u._`${Me} === ${d.default.errors}`)}a(x,"bn");function k(J){(0,h.checkUnknownRules)(J),N(J)}a(k,"pA");function D(J,z){if(J.opts.jtd)return F(J,[],!1,z);let le=(0,r.getSchemaTypes)(J.schema),K=(0,r.coerceAndCheckDataType)(J,le);F(J,le,!K,z)}a(D,"dA");function N(J){let{schema:z,errSchemaPath:le,opts:K,self:ae}=J;z.$ref&&K.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(z,ae.RULES)&&ae.logger.warn(`$ref: keywords ignored in schema at path "${le}"`)}a(N,"_n");function L(J){let{schema:z,opts:le}=J;z.default!==void 0&&le.useDefaults&&le.strictSchema&&(0,h.checkStrictMode)(J,"default is ignored in the schema root")}a(L,"kn");function B(J){let z=J.schema[J.opts.schemaId];z&&(J.baseId=(0,f.resolveUrl)(J.opts.uriResolver,J.baseId,z))}a(B,"Sn");function Q(J){if(J.schema.$async&&!J.schemaEnv.$async)throw Error("async schema in sync schema")}a(Q,"vn");function M({gen:J,schemaEnv:z,schema:le,errSchemaPath:K,opts:ae}){let Me=le.$comment;if(ae.$comment===!0)J.code(u._`${d.default.self}.logger.log(${Me})`);else if(typeof ae.$comment=="function"){let ne=u.str`${K}/$comment`,se=J.scopeValue("root",{ref:z.root});J.code(u._`${d.default.self}.opts.$comment(${Me}, ${ne}, ${se}.schema)`)}}a(M,"iA");function O(J){let{gen:z,schemaEnv:le,validateName:K,ValidationError:ae,opts:Me}=J;le.$async?z.if(u._`${d.default.errors} === 0`,()=>z.return(d.default.data),()=>z.throw(u._`new ${ae}(${d.default.vErrors})`)):(z.assign(u._`${K}.errors`,d.default.vErrors),Me.unevaluated&&q(J),z.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function q({gen:J,evaluated:z,props:le,items:K}){le instanceof u.Name&&J.assign(u._`${z}.props`,le),K instanceof u.Name&&J.assign(u._`${z}.items`,K)}a(q,"Tn");function F(J,z,le,K){let{gen:ae,schema:Me,data:ne,allErrors:se,opts:Ie,self:_e}=J,{RULES:Re}=_e;if(Me.$ref&&(Ie.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(Me,Re))){ae.block(()=>Ae(J,"$ref",Re.all.$ref.definition));return}Ie.jtd||W(J,z),ae.block(()=>{for(let Xe of Re.rules)Je(Xe);Je(Re.post)});function Je(Xe){(0,n.shouldUseGroup)(Me,Xe)&&(Xe.type?(ae.if((0,o.checkDataType)(Xe.type,ne,Ie.strictNumbers)),U(J,Xe),z.length===1&&z[0]===Xe.type&&le&&(ae.else(),(0,o.reportTypeError)(J)),ae.endIf()):U(J,Xe),se||ae.if(u._`${d.default.errors} === ${K||0}`))}a(Je,"B")}a(F,"gA");function U(J,z){let{gen:le,schema:K,opts:{useDefaults:ae}}=J;ae&&(0,s.assignDefaults)(J,z.type),le.block(()=>{for(let Me of z.rules)(0,n.shouldUseRule)(K,Me)&&Ae(J,Me.keyword,Me.definition,z.type)})}a(U,"hA");function W(J,z){J.schemaEnv.meta||!J.opts.strictTypes||(V(J,z),!J.opts.allowUnionTypes&&G(J,z),Y(J,J.dataTypes))}a(W,"xn");function V(J,z){if(z.length){if(!J.dataTypes.length){J.dataTypes=z;return}z.forEach(le=>{j(J.dataTypes,le)||ie(J,`type "${le}" not allowed by context "${J.dataTypes.join(",")}"`)}),X(J,z)}}a(V,"yn");function G(J,z){z.length>1&&!(z.length===2&&z.includes("null"))&&ie(J,"use allowUnionTypes to allow union type keyword")}a(G,"fn");function Y(J,z){let le=J.self.RULES.all;for(let K in le){let ae=le[K];if(typeof ae=="object"&&(0,n.shouldUseRule)(J.schema,ae)){let{type:Me}=ae.definition;Me.length&&!Me.some(ne=>re(z,ne))&&ie(J,`missing type "${Me.join(",")}" for keyword "${K}"`)}}}a(Y,"gn");function re(J,z){return J.includes(z)||z==="number"&&J.includes("integer")}a(re,"hn");function j(J,z){return J.includes(z)||z==="integer"&&J.includes("number")}a(j,"nA");function X(J,z){let le=[];for(let K of J.dataTypes)j(z,K)?le.push(K):z.includes("integer")&&K==="number"&&le.push("integer");J.dataTypes=le}a(X,"un");function ie(J,z){let le=J.schemaEnv.baseId+J.errSchemaPath;z+=` at "${le}" (strictTypes)`,(0,h.checkStrictMode)(J,z,J.opts.strictTypes)}a(ie,"SB");class we{static{a(this,"vB")}constructor(z,le,K){if((0,c.validateKeywordUsage)(z,le,K),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=K,this.data=z.data,this.schema=z.schema[K],this.$data=le.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(z,this.schema,K,this.$data),this.schemaType=le.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=le,this.$data)this.schemaCode=z.gen.const("vSchema",Z(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,le.schemaType,le.allowUndefined))throw Error(`${K} value must be ${JSON.stringify(le.schemaType)}`);("code"in le?le.trackErrors:le.errors!==!1)&&(this.errsCount=z.gen.const("_errs",d.default.errors))}result(z,le,K){this.failResult((0,u.not)(z),le,K)}failResult(z,le,K){this.gen.if(z),K?K():this.error(),le?(this.gen.else(),le(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,le){this.failResult((0,u.not)(z),void 0,le)}fail(z){if(z===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);let{schemaCode:le}=this;this.fail(u._`${le} !== undefined && (${(0,u.or)(this.invalid$data(),z)})`)}error(z,le,K){if(le){this.setParams(le),this._error(z,K),this.setParams({});return}this._error(z,K)}_error(z,le){(z?m.reportExtraError:m.reportError)(this,this.def.error,le)}$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(z){this.allErrors||this.gen.if(z)}setParams(z,le){le?Object.assign(this.params,z):this.params=z}block$data(z,le,K=u.nil){this.gen.block(()=>{this.check$data(z,K),le()})}check$data(z=u.nil,le=u.nil){if(!this.$data)return;let{gen:K,schemaCode:ae,schemaType:Me,def:ne}=this;K.if((0,u.or)(u._`${ae} === undefined`,le)),z!==u.nil&&K.assign(z,!0),(Me.length||ne.validateSchema)&&(K.elseIf(this.invalid$data()),this.$dataError(),z!==u.nil&&K.assign(z,!1)),K.else()}invalid$data(){let{gen:z,schemaCode:le,schemaType:K,def:ae,it:Me}=this;return(0,u.or)(ne(),se());function ne(){if(K.length){if(!(le instanceof u.Name))throw Error("ajv implementation error");let Ie=Array.isArray(K)?K:[K];return u._`${(0,o.checkDataTypes)(Ie,le,Me.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function se(){if(ae.validateSchema){let Ie=z.scopeValue("validate$data",{ref:ae.validateSchema});return u._`!${Ie}(${le})`}return u.nil}}subschema(z,le){let K=(0,l.getSubschema)(this.it,z);(0,l.extendSubschemaData)(K,this.it,z),(0,l.extendSubschemaMode)(K,z);let ae={...this.it,...K,items:void 0,props:void 0};return T(ae,le),ae}mergeEvaluated(z,le){let{it:K,gen:ae}=this;K.opts.unevaluated&&(K.props!==!0&&z.props!==void 0&&(K.props=h.mergeEvaluated.props(ae,z.props,K.props,le)),K.items!==!0&&z.items!==void 0&&(K.items=h.mergeEvaluated.items(ae,z.items,K.items,le)))}mergeValidEvaluated(z,le){let{it:K,gen:ae}=this;if(K.opts.unevaluated&&(K.props!==!0||K.items!==!0))return ae.if(le,()=>this.mergeEvaluated(z,u.Name)),!0}}t.KeywordCxt=we;function Ae(J,z,le,K){let ae=new we(J,le,z);"code"in le?le.code(ae,K):ae.$data&&le.validate?(0,c.funcKeywordCode)(ae,le):"macro"in le?(0,c.macroKeywordCode)(ae,le):(le.compile||le.validate)&&(0,c.funcKeywordCode)(ae,le)}a(Ae,"rA");var De=/^\/(?:[^~]|~0|~1)*$/,Te=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Z(J,{dataLevel:z,dataNames:le,dataPathArr:K}){let ae,Me;if(J==="")return d.default.rootData;if(J[0]==="/"){if(!De.test(J))throw Error(`Invalid JSON-pointer: ${J}`);ae=J,Me=d.default.rootData}else{let _e=Te.exec(J);if(!_e)throw Error(`Invalid JSON-pointer: ${J}`);let Re=+_e[1];if(ae=_e[2],ae==="#"){if(Re>=z)throw Error(Ie("property/index",Re));return K[z-Re]}if(Re>z)throw Error(Ie("data",Re));if(Me=le[z-Re],!ae)return Me}let ne=Me,se=ae.split("/");for(let _e of se)_e&&(Me=u._`${Me}${(0,u.getProperty)((0,h.unescapeJsonPointer)(_e))}`,ne=u._`${ne} && ${Me}`);return ne;function Ie(_e,Re){return`Cannot access ${_e} ${Re} levels up, current level is ${z}`}}a(Z,"oA"),t.getData=Z}),h3r=Ut(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}),$Tt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HTt();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}),m3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Rs(),r=h3r(),n=kV(),o=HTt(),s=uc(),c=GTt();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}),k;_.$async&&(k=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:k,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:k}=this.opts;x&&(R=new l({schema:x,schemaId:k,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 k=A.call(this,_,x);return typeof k?.schema!="object"?void 0:E.call(this,b,k)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:k}=x,{schemaId:D}=this.opts,N=k[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:k,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 k of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(k)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(k)&&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 k=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,k)}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")}),zOc=Ut((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}}),EVi=Ut((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 k="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N]}return k}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,k,D){if(x.length){let N=l(x);if(N!=="")k.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let k=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(q==="%"){if(!M(L,N,D))break;M=d}else{L.push(q);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 k=h(x);if(k.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=k;return k.zone&&(D+="%"+k.zone,N+="%25"+k.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,k){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,k=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=EVi(),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 k=String(x.scheme).toLowerCase()==="https";return(x.port===(k?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[k,D]=x.resourceName.split("?");x.path=k&&k!=="/"?k:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,k){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=k.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let L=`${N}:${k.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.parse(x,k))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,k){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=k.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),L=`${D}:${k.nid||N}`,B=R(L);B&&(x=B.serialize(x,k));let Q=x,M=x.nss;return Q.path=`${N||k.nid}:${M}`,k.skipEscape=!0,Q}a(m,"Er");function g(x,k){let D=x;return D.uuid=D.nss,D.nss=void 0,!k.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let k=x;return k.nss=(x.uuid||"").toLowerCase(),k}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}}),KOc=Ut((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=EVi(),{SCHEMES:h,getSchemeHandler:m}=YOc();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=k(N,B),M=k(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 q=o(B);if(q!==void 0&&(Q.reference!=="suffix"&&M.push("//"),M.push(q),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let F=B.path;!Q.absolutePath&&(!O||!O.absolutePath)&&(F=n(F)),q===void 0&&F[0]==="/"&&F[1]==="/"&&(F="/%2F"+F.slice(2)),M.push(F)}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 q=N.match(v);if(q){Q.scheme=q[1],Q.userinfo=q[3],Q.host=q[4],Q.port=parseInt(q[5],10),Q.path=q[6]||"",Q.query=q[7],Q.fragment=q[8],isNaN(Q.port)&&(Q.port=q[5]);let F=b(Q,q);if(F!==void 0&&(Q.error=Q.error||F,M=!0),Q.host)if(d(Q.host)===!1){let W=r(Q.host);Q.host=W.host.toLowerCase(),O=W.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(W){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+W}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 k(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(k,"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}),JOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=KOc();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),ZOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=GTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Rs();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=h3r(),o=$Tt(),s=gVi(),c=m3r(),l=Rs(),u=HTt(),d=CSt(),f=uc(),h=zOc(),m=JOc(),g=a((V,G)=>new RegExp(V,G),"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(V){var G,Y,re,j,X,ie,we,Ae,De,Te,Z,J,z,le,K,ae,Me,ne,se,Ie,_e,Re,Je,Xe,Ct;let Ot=V.strict,$t=(G=V.code)===null||G===void 0?void 0:G.optimize,Gt=$t===!0||$t===void 0?1:$t||0,Ee=(re=(Y=V.code)===null||Y===void 0?void 0:Y.regExp)!==null&&re!==void 0?re:g,Qe=(j=V.uriResolver)!==null&&j!==void 0?j:m.default;return{strictSchema:(ie=(X=V.strictSchema)!==null&&X!==void 0?X:Ot)!==null&&ie!==void 0?ie:!0,strictNumbers:(Ae=(we=V.strictNumbers)!==null&&we!==void 0?we:Ot)!==null&&Ae!==void 0?Ae:!0,strictTypes:(Te=(De=V.strictTypes)!==null&&De!==void 0?De:Ot)!==null&&Te!==void 0?Te:"log",strictTuples:(J=(Z=V.strictTuples)!==null&&Z!==void 0?Z:Ot)!==null&&J!==void 0?J:"log",strictRequired:(le=(z=V.strictRequired)!==null&&z!==void 0?z:Ot)!==null&&le!==void 0?le:!1,code:V.code?{...V.code,optimize:Gt,regExp:Ee}:{optimize:Gt,regExp:Ee},loopRequired:(K=V.loopRequired)!==null&&K!==void 0?K:v,loopEnum:(ae=V.loopEnum)!==null&&ae!==void 0?ae:v,meta:(Me=V.meta)!==null&&Me!==void 0?Me:!0,messages:(ne=V.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(se=V.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(Ie=V.schemaId)!==null&&Ie!==void 0?Ie:"$id",addUsedSchema:(_e=V.addUsedSchema)!==null&&_e!==void 0?_e:!0,validateSchema:(Re=V.validateSchema)!==null&&Re!==void 0?Re:!0,validateFormats:(Je=V.validateFormats)!==null&&Je!==void 0?Je:!0,unicodeRegExp:(Xe=V.unicodeRegExp)!==null&&Xe!==void 0?Xe:!0,int32range:(Ct=V.int32range)!==null&&Ct!==void 0?Ct:!0,uriResolver:Qe}}a(b,"Wo");class T{static{a(this,"CW")}constructor(G={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,G=this.opts={...G,...b(G)};let{es5:Y,lines:re}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:Y,lines:re}),this.logger=B(G.logger);let j=G.validateFormats;G.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,G,"NOT SUPPORTED"),w.call(this,_,G,"DEPRECATED","warn"),this._metaOpts=N.call(this),G.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),G.keywords&&D.call(this,G.keywords),typeof G.meta=="object"&&this.addMetaSchema(G.meta),x.call(this),G.validateFormats=j}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:G,meta:Y,schemaId:re}=this.opts,j=h;re==="id"&&(j={...h},j.id=j.$id,delete j.$id),Y&&G&&this.addMetaSchema(j,j[re],!1)}defaultMeta(){let{meta:G,schemaId:Y}=this.opts;return this.opts.defaultMeta=typeof G=="object"?G[Y]||G:void 0}validate(G,Y){let re;if(typeof G=="string"){if(re=this.getSchema(G),!re)throw Error(`no schema with key or ref "${G}"`)}else re=this.compile(G);let j=re(Y);return"$async"in re||(this.errors=re.errors),j}compile(G,Y){let re=this._addSchema(G,Y);return re.validate||this._compileSchemaEnv(re)}compileAsync(G,Y){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:re}=this.opts;return j.call(this,G,Y);async function j(Te,Z){await X.call(this,Te.$schema);let J=this._addSchema(Te,Z);return J.validate||ie.call(this,J)}async function X(Te){Te&&!this.getSchema(Te)&&await j.call(this,{$ref:Te},!0)}async function ie(Te){try{return this._compileSchemaEnv(Te)}catch(Z){if(!(Z instanceof o.default))throw Z;return we.call(this,Z),await Ae.call(this,Z.missingSchema),ie.call(this,Te)}}function we({missingSchema:Te,missingRef:Z}){if(this.refs[Te])throw Error(`AnySchema ${Te} is loaded but ${Z} cannot be resolved`)}async function Ae(Te){let Z=await De.call(this,Te);this.refs[Te]||await X.call(this,Z.$schema),this.refs[Te]||this.addSchema(Z,Te,Y)}async function De(Te){let Z=this._loading[Te];if(Z)return Z;try{return await(this._loading[Te]=re(Te))}finally{delete this._loading[Te]}}}addSchema(G,Y,re,j=this.opts.validateSchema){if(Array.isArray(G)){for(let ie of G)this.addSchema(ie,void 0,re,j);return this}let X;if(typeof G=="object"){let{schemaId:ie}=this.opts;if(X=G[ie],X!==void 0&&typeof X!="string")throw Error(`schema ${ie} must be string`)}return Y=(0,u.normalizeId)(Y||X),this._checkUnique(Y),this.schemas[Y]=this._addSchema(G,re,Y,j,!0),this}addMetaSchema(G,Y,re=this.opts.validateSchema){return this.addSchema(G,Y,!0,re),this}validateSchema(G,Y){if(typeof G=="boolean")return!0;let re;if(re=G.$schema,re!==void 0&&typeof re!="string")throw Error("$schema must be a string");if(re=re||this.opts.defaultMeta||this.defaultMeta(),!re)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let j=this.validate(re,G);if(!j&&Y){let X="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(X);else throw Error(X)}return j}getSchema(G){let Y;for(;typeof(Y=R.call(this,G))=="string";)G=Y;if(Y===void 0){let{schemaId:re}=this.opts,j=new c.SchemaEnv({schema:{},schemaId:re});if(Y=c.resolveSchema.call(this,j,G),!Y)return;this.refs[G]=Y}return Y.validate||this._compileSchemaEnv(Y)}removeSchema(G){if(G instanceof RegExp)return this._removeAllSchemas(this.schemas,G),this._removeAllSchemas(this.refs,G),this;switch(typeof G){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Y=R.call(this,G);return typeof Y=="object"&&this._cache.delete(Y.schema),delete this.schemas[G],delete this.refs[G],this}case"object":{let Y=G;this._cache.delete(Y);let re=G[this.opts.schemaId];return re&&(re=(0,u.normalizeId)(re),delete this.schemas[re],delete this.refs[re]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(G){for(let Y of G)this.addKeyword(Y);return this}addKeyword(G,Y){let re;if(typeof G=="string")re=G,typeof Y=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Y.keyword=re);else if(typeof G=="object"&&Y===void 0){if(Y=G,re=Y.keyword,Array.isArray(re)&&!re.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,re,Y),!Y)return(0,f.eachItem)(re,X=>O.call(this,X)),this;F.call(this,Y);let j={...Y,type:(0,d.getJSONTypes)(Y.type),schemaType:(0,d.getJSONTypes)(Y.schemaType)};return(0,f.eachItem)(re,j.type.length===0?X=>O.call(this,X,j):X=>j.type.forEach(ie=>O.call(this,X,j,ie))),this}getKeyword(G){let Y=this.RULES.all[G];return typeof Y=="object"?Y.definition:!!Y}removeKeyword(G){let{RULES:Y}=this;delete Y.keywords[G],delete Y.all[G];for(let re of Y.rules){let j=re.rules.findIndex(X=>X.keyword===G);j>=0&&re.rules.splice(j,1)}return this}addFormat(G,Y){return typeof Y=="string"&&(Y=new RegExp(Y)),this.formats[G]=Y,this}errorsText(G=this.errors,{separator:Y=", ",dataVar:re="data"}={}){return!G||G.length===0?"No errors":G.map(j=>`${re}${j.instancePath} ${j.message}`).reduce((j,X)=>j+Y+X)}$dataMetaSchema(G,Y){let re=this.RULES.all;G=JSON.parse(JSON.stringify(G));for(let j of Y){let X=j.split("/").slice(1),ie=G;for(let we of X)ie=ie[we];for(let we in re){let Ae=re[we];if(typeof Ae!="object")continue;let{$data:De}=Ae.definition,Te=ie[we];De&&Te&&(ie[we]=W(Te))}}return G}_removeAllSchemas(G,Y){for(let re in G){let j=G[re];(!Y||Y.test(re))&&(typeof j=="string"?delete G[re]:j&&!j.meta&&(this._cache.delete(j.schema),delete G[re]))}}_addSchema(G,Y,re,j=this.opts.validateSchema,X=this.opts.addUsedSchema){let ie,{schemaId:we}=this.opts;if(typeof G=="object")ie=G[we];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof G!="boolean")throw Error("schema must be object or boolean")}let Ae=this._cache.get(G);if(Ae!==void 0)return Ae;re=(0,u.normalizeId)(ie||re);let De=u.getSchemaRefs.call(this,G,re);return Ae=new c.SchemaEnv({schema:G,schemaId:we,meta:Y,baseId:re,localRefs:De}),this._cache.set(Ae.schema,Ae),X&&!re.startsWith("#")&&(re&&this._checkUnique(re),this.refs[re]=Ae),j&&this.validateSchema(G,!0),Ae}_checkUnique(G){if(this.schemas[G]||this.refs[G])throw Error(`schema with key or id "${G}" already exists`)}_compileSchemaEnv(G){if(G.meta?this._compileMetaSchema(G):c.compileSchema.call(this,G),!G.validate)throw Error("ajv implementation error");return G.validate}_compileMetaSchema(G){let Y=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,G)}finally{this.opts=Y}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(V,G,Y,re="error"){for(let j in V){let X=j;X in G&&this.logger[re](`${Y}: option ${j}. ${V[X]}`)}}a(w,"_I");function R(V){return V=(0,u.normalizeId)(V),this.schemas[V]||this.refs[V]}a(R,"kI");function x(){let V=this.opts.schemas;if(V)if(Array.isArray(V))this.addSchema(V);else for(let G in V)this.addSchema(V[G],G)}a(x,"Go");function k(){for(let V in this.opts.formats){let G=this.opts.formats[V];G&&this.addFormat(V,G)}}a(k,"Uo");function D(V){if(Array.isArray(V)){this.addVocabulary(V);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let G in V){let Y=V[G];Y.keyword||(Y.keyword=G),this.addKeyword(Y)}}a(D,"Ho");function N(){let V={...this.opts};for(let G of A)delete V[G];return V}a(N,"Ko");var L={log(){},warn(){},error(){}};function B(V){if(V===!1)return L;if(V===void 0)return console;if(V.log&&V.warn&&V.error)return V;throw Error("logger must implement log, warn and error methods")}a(B,"Vo");var Q=/^[a-z_$][a-z0-9_$:-]*$/i;function M(V,G){let{RULES:Y}=this;if((0,f.eachItem)(V,re=>{if(Y.keywords[re])throw Error(`Keyword ${re} is already defined`);if(!Q.test(re))throw Error(`Keyword ${re} has invalid name`)}),!!G&&G.$data&&!("code"in G||"validate"in G))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(V,G,Y){var re;let j=G?.post;if(Y&&j)throw Error('keyword with "post" flag cannot have "type"');let{RULES:X}=this,ie=j?X.post:X.rules.find(({type:Ae})=>Ae===Y);if(ie||(ie={type:Y,rules:[]},X.rules.push(ie)),X.keywords[V]=!0,!G)return;let we={keyword:V,definition:{...G,type:(0,d.getJSONTypes)(G.type),schemaType:(0,d.getJSONTypes)(G.schemaType)}};G.before?q.call(this,ie,we,G.before):ie.rules.push(we),X.all[V]=we,(re=G.implements)===null||re===void 0||re.forEach(Ae=>this.addKeyword(Ae))}a(O,"lB");function q(V,G,Y){let re=V.rules.findIndex(j=>j.keyword===Y);re>=0?V.rules.splice(re,0,G):(V.rules.push(G),this.logger.warn(`rule ${Y} is not defined`))}a(q,"No");function F(V){let{metaSchema:G}=V;G!==void 0&&(V.$data&&this.opts.$data&&(G=W(G)),V.validateSchema=this.compile(G,!0))}a(F,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function W(V){return{anyOf:[V,U]}}a(W,"CI")}),XOc=Ut(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}),e5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=$Tt(),r=pN(),n=Rs(),o=kV(),s=m3r(),c=uc(),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 k=h.scopeValue("root",{ref:b});return d(f,n._`${k}.validate`,b,b.$async)}function R(k){let D=u(f,k);d(f,D,k,k.$async)}function x(k){let D=h.scopeValue("schema",_.code.source===!0?{ref:k,code:(0,n.stringify)(k)}:{ref:k}),N=h.name("valid"),L=f.subschema({schema:k,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 k=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(k,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(k,!1)}),f.ok(k)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(k){let D=n._`${k}.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(k){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._`${k}.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._`${k}.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}),t5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=XOc(),r=e5c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),r5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),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}),n5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),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}),i5c=Ut(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=Rs(),r=uc(),n=i5c(),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}),s5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=uc(),n=Rs(),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}),a5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),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}),c5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=Rs(),n=uc(),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}),l5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),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}),g3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=yVi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),u5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=CSt(),r=Rs(),n=uc(),o=g3r(),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"),k=(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(k,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),k=u.name("outer");u.label(k).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(k)})))}a(T,"N")}};t.default=c}),d5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n=g3r(),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}),f5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n=g3r(),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}),p5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=r5c(),r=n5c(),n=o5c(),o=s5c(),s=a5c(),c=c5c(),l=l5c(),u=u5c(),d=d5c(),f=f5c(),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}),_Vi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Rs(),r=uc(),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}),CVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Rs(),r=uc(),n=pN(),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}),h5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=CVi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),m5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n=pN(),o=_Vi(),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}),g5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),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}),A5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Rs(),r=uc(),n=pN();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")}),q2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Is(),r=cc();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")}),oN=qt(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=Is(),r=cc(),n=fV(),o=cc();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}),j2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Is(),r=fV(),n=oN(),o=sTt();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,q=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,q)}`,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}),H2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Is(),r=cc();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}),YGi=qt((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},"$")}),G2c=qt((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=cc(),r=YGi(),n=G2c(),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,q=w[M];typeof L[v]=="string"&&(q=Q.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=q;function Q(z){let W=this.opts.uriResolver.resolve;if(z=m(q?W(q,z):z),P.has(z))throw N(z);P.add(z);let $=this.refs[z];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?D(L,$.schema,z):z!==m(O)&&(z[0]==="#"?(D(L,x[z],z),x[z]=L):this.refs[z]=O),z}a(Q,"M");function U(z){if(typeof z=="string"){if(!A.test(z))throw Error(`invalid anchor "${z}"`);Q.call(this,`#${z}`)}}a(U,"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}),cTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=Q2c(),r=U1t(),n=zGi(),o=U1t(),s=q2c(),c=j2c(),l=H2c(),u=Is(),d=fV(),f=aTt(),h=cc(),m=sTt();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:fe,schemaEnv:X,opts:ue},qe){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,X.$async,()=>{ee.code(u._`"use strict"; ${b(fe,ue)}`),E(ee,ue),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,X.$async,()=>ee.code(b(fe,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:fe,gen:X}=ee;A(ee,()=>{fe.$comment&&K.$comment&&M(ee),L(ee),X.let(d.default.vErrors,null),X.let(d.default.errors,0),fe.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"Rn");function v(ee){let{gen:K,validateName:fe}=ee;ee.evaluated=K.const("evaluated",u._`${fe}.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 fe=typeof ee=="object"&&ee[K.schemaId];return fe&&(K.code.source||K.code.process)?u._`/*# sourceURL=${fe} */`: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 fe in ee)if(K.RULES.all[fe])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:fe,gen:X,opts:ue}=ee;ue.$comment&&fe.$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 fe=(0,r.getSchemaTypes)(ee.schema),X=(0,r.coerceAndCheckDataType)(ee,fe);Q(ee,fe,!X,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:fe,opts:X,self:ue}=ee;K.$ref&&X.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${fe}"`)}a(N,"_n");function L(ee){let{schema:K,opts:fe}=ee;K.default!==void 0&&fe.useDefaults&&fe.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:fe,errSchemaPath:X,opts:ue}){let qe=fe.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof ue.$comment=="function"){let ie=u.str`${X}/$comment`,le=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ie}, ${le}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:fe,validateName:X,ValidationError:ue,opts:qe}=ee;fe.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${ue}(${d.default.vErrors})`)):(K.assign(u._`${X}.errors`,d.default.vErrors),qe.unevaluated&&q(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function q({gen:ee,evaluated:K,props:fe,items:X}){fe instanceof u.Name&&ee.assign(u._`${K}.props`,fe),X instanceof u.Name&&ee.assign(u._`${K}.items`,X)}a(q,"Tn");function Q(ee,K,fe,X){let{gen:ue,schema:qe,data:ie,allErrors:le,opts:Ne,self:we}=ee,{RULES:Be}=we;if(qe.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){ue.block(()=>ve(ee,"$ref",Be.all.$ref.definition));return}Ne.jtd||z(ee,K),ue.block(()=>{for(let st of Be.rules)tt(st);tt(Be.post)});function tt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ie,Ne.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&fe&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),le||ue.if(u._`${d.default.errors} === ${X||0}`))}a(tt,"B")}a(Q,"gA");function U(ee,K){let{gen:fe,schema:X,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),fe.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(X,qe)&&ve(ee,qe.keyword,qe.definition,K.type)})}a(U,"hA");function z(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&$(ee,K),J(ee,ee.dataTypes))}a(z,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(fe=>{H(ee.dataTypes,fe)||ae(ee,`type "${fe}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a(W,"yn");function $(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&ae(ee,"use allowUnionTypes to allow union type keyword")}a($,"fn");function J(ee,K){let fe=ee.self.RULES.all;for(let X in fe){let ue=fe[X];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:qe}=ue.definition;qe.length&&!qe.some(ie=>ne(K,ie))&&ae(ee,`missing type "${qe.join(",")}" for keyword "${X}"`)}}}a(J,"gn");function ne(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ne,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let fe=[];for(let X of ee.dataTypes)H(K,X)?fe.push(X):K.includes("integer")&&X==="number"&&fe.push("integer");ee.dataTypes=fe}a(re,"un");function ae(ee,K){let fe=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${fe}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(ae,"SB");class Oe{static{a(this,"vB")}constructor(K,fe,X){if((0,c.validateKeywordUsage)(K,fe,X),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=X,this.data=K.data,this.schema=K.schema[X],this.$data=fe.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,X,this.$data),this.schemaType=fe.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=fe,this.$data)this.schemaCode=K.gen.const("vSchema",Z(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,fe.schemaType,fe.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(fe.schemaType)}`);("code"in fe?fe.trackErrors:fe.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,fe,X){this.failResult((0,u.not)(K),fe,X)}failResult(K,fe,X){this.gen.if(K),X?X():this.error(),fe?(this.gen.else(),fe(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,fe){this.failResult((0,u.not)(K),void 0,fe)}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:fe}=this;this.fail(u._`${fe} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,fe,X){if(fe){this.setParams(fe),this._error(K,X),this.setParams({});return}this._error(K,X)}_error(K,fe){(K?m.reportExtraError:m.reportError)(this,this.def.error,fe)}$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,fe){fe?Object.assign(this.params,K):this.params=K}block$data(K,fe,X=u.nil){this.gen.block(()=>{this.check$data(K,X),fe()})}check$data(K=u.nil,fe=u.nil){if(!this.$data)return;let{gen:X,schemaCode:ue,schemaType:qe,def:ie}=this;X.if((0,u.or)(u._`${ue} === undefined`,fe)),K!==u.nil&&X.assign(K,!0),(qe.length||ie.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&X.assign(K,!1)),X.else()}invalid$data(){let{gen:K,schemaCode:fe,schemaType:X,def:ue,it:qe}=this;return(0,u.or)(ie(),le());function ie(){if(X.length){if(!(fe instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(X)?X:[X];return u._`${(0,o.checkDataTypes)(Ne,fe,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function le(){if(ue.validateSchema){let Ne=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Ne}(${fe})`}return u.nil}}subschema(K,fe){let X=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(X,this.it,K),(0,l.extendSubschemaMode)(X,K);let ue={...this.it,...X,items:void 0,props:void 0};return T(ue,fe),ue}mergeEvaluated(K,fe){let{it:X,gen:ue}=this;X.opts.unevaluated&&(X.props!==!0&&K.props!==void 0&&(X.props=h.mergeEvaluated.props(ue,K.props,X.props,fe)),X.items!==!0&&K.items!==void 0&&(X.items=h.mergeEvaluated.items(ue,K.items,X.items,fe)))}mergeValidEvaluated(K,fe){let{it:X,gen:ue}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return ue.if(fe,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Oe;function ve(ee,K,fe,X){let ue=new Oe(ee,fe,K);"code"in fe?fe.code(ue,X):ue.$data&&fe.validate?(0,c.funcKeywordCode)(ue,fe):"macro"in fe?(0,c.macroKeywordCode)(ue,fe):(fe.compile||fe.validate)&&(0,c.funcKeywordCode)(ue,fe)}a(ve,"rA");var Fe=/^\/(?:[^~]|~0|~1)*$/,Pe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Z(ee,{dataLevel:K,dataNames:fe,dataPathArr:X}){let ue,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Fe.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,qe=d.default.rootData}else{let we=Pe.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 X[K-Be]}if(Be>K)throw Error(Ne("data",Be));if(qe=fe[K-Be],!ue)return qe}let ie=qe,le=ue.split("/");for(let we of le)we&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ie=u._`${ie} && ${qe}`);return ie;function Ne(we,Be){return`Cannot access ${we} ${Be} levels up, current level is ${K}`}}a(Z,"oA"),t.getData=Z}),uLr=qt(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}),lTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=aTt();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}),dLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Is(),r=uLr(),n=fV(),o=aTt(),s=cc(),c=cTt();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")}),$2c=qt((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}}),KGi=qt((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(q==="%"){if(!M(L,N,D))break;M=d}else{L.push(q);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}=KGi(),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}}),W2c=qt((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=KGi(),{SCHEMES:h,getSchemeHandler:m}=V2c();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 q=o(B);if(q!==void 0&&(j.reference!=="suffix"&&M.push("//"),M.push(q),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let Q=B.path;!j.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),q===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 q=N.match(v);if(q){j.scheme=q[1],j.userinfo=q[3],j.host=q[4],j.port=parseInt(q[5],10),j.path=q[6]||"",j.query=q[7],j.fragment=q[8],isNaN(j.port)&&(j.port=q[5]);let Q=b(j,q);if(Q!==void 0&&(j.error=j.error||Q,M=!0),j.host)if(d(j.host)===!1){let z=r(j.host);j.host=z.host.toLowerCase(),O=z.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 U=m(B.scheme||j.scheme);if(!B.unicodeSupport&&(!U||!U.unicodeSupport)&&j.host&&(B.domainHost||U&&U.domainHost)&&O===!1&&f(j.host))try{j.host=URL.domainToASCII(j.host.toLowerCase())}catch(z){j.error=j.error||"Host's domain name can not be converted to ASCII: "+z}if((!U||U&&!U.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"}U&&U.parse&&U.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}),z2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=W2c();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),Y2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=cTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Is();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=uLr(),o=lTt(),s=WGi(),c=dLr(),l=Is(),u=aTt(),d=U1t(),f=cc(),h=$2c(),m=z2c(),g=a((W,$)=>new RegExp(W,$),"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 $,J,ne,H,re,ae,Oe,ve,Fe,Pe,Z,ee,K,fe,X,ue,qe,ie,le,Ne,we,Be,tt,st,Et;let kt=W.strict,Ht=($=W.code)===null||$===void 0?void 0:$.optimize,jt=Ht===!0||Ht===void 0?1:Ht||0,Ie=(ne=(J=W.code)===null||J===void 0?void 0:J.regExp)!==null&&ne!==void 0?ne:g,F=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(ae=(re=W.strictSchema)!==null&&re!==void 0?re:kt)!==null&&ae!==void 0?ae:!0,strictNumbers:(ve=(Oe=W.strictNumbers)!==null&&Oe!==void 0?Oe:kt)!==null&&ve!==void 0?ve:!0,strictTypes:(Pe=(Fe=W.strictTypes)!==null&&Fe!==void 0?Fe:kt)!==null&&Pe!==void 0?Pe:"log",strictTuples:(ee=(Z=W.strictTuples)!==null&&Z!==void 0?Z:kt)!==null&&ee!==void 0?ee:"log",strictRequired:(fe=(K=W.strictRequired)!==null&&K!==void 0?K:kt)!==null&&fe!==void 0?fe:!1,code:W.code?{...W.code,optimize:jt,regExp:Ie}:{optimize:jt,regExp:Ie},loopRequired:(X=W.loopRequired)!==null&&X!==void 0?X:v,loopEnum:(ue=W.loopEnum)!==null&&ue!==void 0?ue:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ie=W.messages)!==null&&ie!==void 0?ie:!0,inlineRefs:(le=W.inlineRefs)!==null&&le!==void 0?le:!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:(tt=W.validateFormats)!==null&&tt!==void 0?tt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(Et=W.int32range)!==null&&Et!==void 0?Et:!0,uriResolver:F}}a(b,"Wo");class T{static{a(this,"CW")}constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...b($)};let{es5:J,lines:ne}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:J,lines:ne}),this.logger=B($.logger);let H=$.validateFormats;$.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,$,"NOT SUPPORTED"),w.call(this,_,$,"DEPRECATED","warn"),this._metaOpts=N.call(this),$.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords&&D.call(this,$.keywords),typeof $.meta=="object"&&this.addMetaSchema($.meta),x.call(this),$.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:J,schemaId:ne}=this.opts,H=h;ne==="id"&&(H={...h},H.id=H.$id,delete H.$id),J&&$&&this.addMetaSchema(H,H[ne],!1)}defaultMeta(){let{meta:$,schemaId:J}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[J]||$:void 0}validate($,J){let ne;if(typeof $=="string"){if(ne=this.getSchema($),!ne)throw Error(`no schema with key or ref "${$}"`)}else ne=this.compile($);let H=ne(J);return"$async"in ne||(this.errors=ne.errors),H}compile($,J){let ne=this._addSchema($,J);return ne.validate||this._compileSchemaEnv(ne)}compileAsync($,J){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ne}=this.opts;return H.call(this,$,J);async function H(Pe,Z){await re.call(this,Pe.$schema);let ee=this._addSchema(Pe,Z);return ee.validate||ae.call(this,ee)}async function re(Pe){Pe&&!this.getSchema(Pe)&&await H.call(this,{$ref:Pe},!0)}async function ae(Pe){try{return this._compileSchemaEnv(Pe)}catch(Z){if(!(Z instanceof o.default))throw Z;return Oe.call(this,Z),await ve.call(this,Z.missingSchema),ae.call(this,Pe)}}function Oe({missingSchema:Pe,missingRef:Z}){if(this.refs[Pe])throw Error(`AnySchema ${Pe} is loaded but ${Z} cannot be resolved`)}async function ve(Pe){let Z=await Fe.call(this,Pe);this.refs[Pe]||await re.call(this,Z.$schema),this.refs[Pe]||this.addSchema(Z,Pe,J)}async function Fe(Pe){let Z=this._loading[Pe];if(Z)return Z;try{return await(this._loading[Pe]=ne(Pe))}finally{delete this._loading[Pe]}}}addSchema($,J,ne,H=this.opts.validateSchema){if(Array.isArray($)){for(let ae of $)this.addSchema(ae,void 0,ne,H);return this}let re;if(typeof $=="object"){let{schemaId:ae}=this.opts;if(re=$[ae],re!==void 0&&typeof re!="string")throw Error(`schema ${ae} must be string`)}return J=(0,u.normalizeId)(J||re),this._checkUnique(J),this.schemas[J]=this._addSchema($,ne,J,H,!0),this}addMetaSchema($,J,ne=this.opts.validateSchema){return this.addSchema($,J,!0,ne),this}validateSchema($,J){if(typeof $=="boolean")return!0;let ne;if(ne=$.$schema,ne!==void 0&&typeof ne!="string")throw Error("$schema must be a string");if(ne=ne||this.opts.defaultMeta||this.defaultMeta(),!ne)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ne,$);if(!H&&J){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema($){let J;for(;typeof(J=R.call(this,$))=="string";)$=J;if(J===void 0){let{schemaId:ne}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ne});if(J=c.resolveSchema.call(this,H,$),!J)return;this.refs[$]=J}return J.validate||this._compileSchemaEnv(J)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let J=R.call(this,$);return typeof J=="object"&&this._cache.delete(J.schema),delete this.schemas[$],delete this.refs[$],this}case"object":{let J=$;this._cache.delete(J);let ne=$[this.opts.schemaId];return ne&&(ne=(0,u.normalizeId)(ne),delete this.schemas[ne],delete this.refs[ne]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let J of $)this.addKeyword(J);return this}addKeyword($,J){let ne;if(typeof $=="string")ne=$,typeof J=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),J.keyword=ne);else if(typeof $=="object"&&J===void 0){if(J=$,ne=J.keyword,Array.isArray(ne)&&!ne.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ne,J),!J)return(0,f.eachItem)(ne,re=>O.call(this,re)),this;Q.call(this,J);let H={...J,type:(0,d.getJSONTypes)(J.type),schemaType:(0,d.getJSONTypes)(J.schemaType)};return(0,f.eachItem)(ne,H.type.length===0?re=>O.call(this,re,H):re=>H.type.forEach(ae=>O.call(this,re,H,ae))),this}getKeyword($){let J=this.RULES.all[$];return typeof J=="object"?J.definition:!!J}removeKeyword($){let{RULES:J}=this;delete J.keywords[$],delete J.all[$];for(let ne of J.rules){let H=ne.rules.findIndex(re=>re.keyword===$);H>=0&&ne.rules.splice(H,1)}return this}addFormat($,J){return typeof J=="string"&&(J=new RegExp(J)),this.formats[$]=J,this}errorsText($=this.errors,{separator:J=", ",dataVar:ne="data"}={}){return!$||$.length===0?"No errors":$.map(H=>`${ne}${H.instancePath} ${H.message}`).reduce((H,re)=>H+J+re)}$dataMetaSchema($,J){let ne=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let H of J){let re=H.split("/").slice(1),ae=$;for(let Oe of re)ae=ae[Oe];for(let Oe in ne){let ve=ne[Oe];if(typeof ve!="object")continue;let{$data:Fe}=ve.definition,Pe=ae[Oe];Fe&&Pe&&(ae[Oe]=z(Pe))}}return $}_removeAllSchemas($,J){for(let ne in $){let H=$[ne];(!J||J.test(ne))&&(typeof H=="string"?delete $[ne]:H&&!H.meta&&(this._cache.delete(H.schema),delete $[ne]))}}_addSchema($,J,ne,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let ae,{schemaId:Oe}=this.opts;if(typeof $=="object")ae=$[Oe];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof $!="boolean")throw Error("schema must be object or boolean")}let ve=this._cache.get($);if(ve!==void 0)return ve;ne=(0,u.normalizeId)(ae||ne);let Fe=u.getSchemaRefs.call(this,$,ne);return ve=new c.SchemaEnv({schema:$,schemaId:Oe,meta:J,baseId:ne,localRefs:Fe}),this._cache.set(ve.schema,ve),re&&!ne.startsWith("#")&&(ne&&this._checkUnique(ne),this.refs[ne]=ve),H&&this.validateSchema($,!0),ve}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta?this._compileMetaSchema($):c.compileSchema.call(this,$),!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let J=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,$)}finally{this.opts=J}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,$,J,ne="error"){for(let H in W){let re=H;re in $&&this.logger[ne](`${J}: 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 $ in W)this.addSchema(W[$],$)}a(x,"Go");function P(){for(let W in this.opts.formats){let $=this.opts.formats[W];$&&this.addFormat(W,$)}}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 $ in W){let J=W[$];J.keyword||(J.keyword=$),this.addKeyword(J)}}a(D,"Ho");function N(){let W={...this.opts};for(let $ of A)delete W[$];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,$){let{RULES:J}=this;if((0,f.eachItem)(W,ne=>{if(J.keywords[ne])throw Error(`Keyword ${ne} is already defined`);if(!j.test(ne))throw Error(`Keyword ${ne} has invalid name`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(W,$,J){var ne;let H=$?.post;if(J&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,ae=H?re.post:re.rules.find(({type:ve})=>ve===J);if(ae||(ae={type:J,rules:[]},re.rules.push(ae)),re.keywords[W]=!0,!$)return;let Oe={keyword:W,definition:{...$,type:(0,d.getJSONTypes)($.type),schemaType:(0,d.getJSONTypes)($.schemaType)}};$.before?q.call(this,ae,Oe,$.before):ae.rules.push(Oe),re.all[W]=Oe,(ne=$.implements)===null||ne===void 0||ne.forEach(ve=>this.addKeyword(ve))}a(O,"lB");function q(W,$,J){let ne=W.rules.findIndex(H=>H.keyword===J);ne>=0?W.rules.splice(ne,0,$):(W.rules.push($),this.logger.warn(`rule ${J} is not defined`))}a(q,"No");function Q(W){let{metaSchema:$}=W;$!==void 0&&(W.$data&&this.opts.$data&&($=z($)),W.validateSchema=this.compile($,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z(W){return{anyOf:[W,U]}}a(z,"CI")}),K2c=qt(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}),J2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=lTt(),r=oN(),n=Is(),o=fV(),s=dLr(),c=cc(),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}),Z2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=K2c(),r=J2c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),X2c=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),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}),eDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),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}),tDc=qt(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=Is(),r=cc(),n=tDc(),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}),nDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oN(),r=cc(),n=Is(),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}),iDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),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}),oDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oN(),r=Is(),n=cc(),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}),sDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),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}),fLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=YGi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),aDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=U1t(),r=Is(),n=cc(),o=fLr(),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}),cDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=cc(),n=fLr(),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}),lDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=cc(),n=fLr(),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}),uDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=X2c(),r=eDc(),n=rDc(),o=nDc(),s=iDc(),c=oDc(),l=sDc(),u=aDc(),d=cDc(),f=lDc(),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}),JGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Is(),r=cc(),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}),ZGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Is(),r=cc(),n=oN(),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}),dDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ZGi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),fDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=cc(),n=oN(),o=JGi(),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}),pDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=cc(),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}),hDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Is(),r=cc(),n=oN();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}),y5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),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}),vVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=Rs(),n=kV(),o=uc(),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 k;if(E.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");k=(0,e.isOwnProperty)(u,D,x)}else E.length?k=(0,r.or)(...E.map(D=>r._`${x} === ${D}`)):k=r.nil;return _.length&&(k=(0,r.or)(k,..._.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(k)}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 k=u.name("valid");y.removeAdditional==="failing"?(R(x,k,!1),u.if((0,r.not)(k),()=>{l.reset(),T(x)})):(R(x,k),!A&&u.if((0,r.not)(k),()=>u.break()))}}a(w,"w");function R(x,k,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,k)}a(R,"O")}};t.default=c}),E5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=GTt(),r=pN(),n=uc(),o=vVi(),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}),_5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=Rs(),n=uc(),o=uc(),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}),C5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),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}),v5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),b5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),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}),S5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),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}),T5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),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}),I5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),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}),x5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=_Vi(),r=h5c(),n=CVi(),o=m5c(),s=g5c(),c=A5c(),l=y5c(),u=vVi(),d=E5c(),f=_5c(),h=C5c(),m=v5c(),g=b5c(),A=S5c(),y=T5c(),E=I5c();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=_}),w5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),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 k=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${k} : ${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(k());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 k(){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(k,"S")}a(_,"N")}};t.default=n}),R5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=w5c(),r=[e.default];t.default=r}),k5c=Ut(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"]}),P5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=t5c(),r=p5c(),n=x5c(),o=R5c(),s=k5c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),D5c=Ut(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={}))}),N5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=D5c(),n=m3r(),o=$Tt(),s=uc(),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),k=!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}}),bVi=Ut((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=ZOc(),n=P5c(),o=N5c(),s=M5c(),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=GTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Rs();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=h3r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=$Tt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),O5c=Ut(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:k},double:{type:"number",validate:k},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||V>59||L&&!F)return!1;if(M<=23&&O<=59&&q<60)return!0;let G=O-V*U,Y=M-W*U-(G<0?1:0);return(Y===23||Y===-1)&&(G===59||G===-1)&&q<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 k(){return!0}a(k,"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")}),B5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=bVi(),r=Rs(),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}),L5c=Ut((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=O5c(),n=B5c(),o=Rs(),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}),F5c=50;a(WBr,"g9");a(RVi,"K5");a(U5c,"Uk");a(Qne,"v4");zTt=["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"],Q5c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],q5c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",j5c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,H5c=/(.*?)<\/command-name>/;a(A3r,"h9");G5c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(NVi,"q5");a($5c,"JN");a(fV,"G1");a(V5c,"zk");a(W5c,"Nk");a(z5c,"wk");zBr=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=NVi(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()}},g1=class extends Error{static{a(this,"W6")}};a(MVi,"V5");a(HE,"R$");a(tFe,"U1");Y5c=typeof global=="object"&&global&&global.Object===Object&&global,OVi=Y5c,K5c=typeof self=="object"&&self&&self.Object===Object&&self,J5c=OVi||K5c||Function("return this")(),f_e=J5c,Z5c=f_e.Symbol,TV=Z5c,BVi=Object.prototype,X5c=BVi.hasOwnProperty,e4c=BVi.toString,VLe=TV?TV.toStringTag:void 0;a(t4c,"Ak");r4c=t4c,n4c=Object.prototype,i4c=n4c.toString;a(o4c,"Pk");s4c=o4c,a4c="[object Null]",c4c="[object Undefined]",eGi=TV?TV.toStringTag:void 0;a(l4c,"_k");rFe=l4c;a(u4c,"kk");p9=u4c,d4c="[object AsyncFunction]",f4c="[object Function]",p4c="[object GeneratorFunction]",h4c="[object Proxy]";a(m4c,"xk");y3r=m4c,g4c=f_e["__core-js_shared__"],hBr=g4c,tGi=(function(){var t=/[^.]+$/.exec(hBr&&hBr.keys&&hBr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(A4c,"fk");y4c=A4c,E4c=Function.prototype,_4c=E4c.toString;a(C4c,"uk");v4c=C4c,b4c=/[\\^$.*+?()[\]{}|]/g,S4c=/^\[object .+?Constructor\]$/,T4c=Function.prototype,I4c=Object.prototype,x4c=T4c.toString,w4c=I4c.hasOwnProperty,R4c=RegExp("^"+x4c.call(w4c).replace(b4c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(k4c,"rk");P4c=k4c;a(D4c,"ok");N4c=D4c;a(M4c,"tk");E3r=M4c,O4c=E3r(Object,"create"),I3e=O4c;a(B4c,"sk");L4c=B4c;a(F4c,"ek");U4c=F4c,Q4c="__lodash_hash_undefined__",q4c=Object.prototype,j4c=q4c.hasOwnProperty;a(H4c,"XS");G4c=H4c,$4c=Object.prototype,V4c=$4c.hasOwnProperty;a(W4c,"GS");z4c=W4c,Y4c="__lodash_hash_undefined__";a(K4c,"HS");J4c=K4c;a(p_e,"a0");p_e.prototype.clear=L4c;p_e.prototype.delete=U4c;p_e.prototype.get=G4c;p_e.prototype.has=z4c;p_e.prototype.set=J4c;rGi=p_e;a(Z4c,"KS");X4c=Z4c;a(eBc,"qS");YTt=eBc;a(tBc,"VS");KTt=tBc,rBc=Array.prototype,nBc=rBc.splice;a(iBc,"NS");oBc=iBc;a(sBc,"wS");aBc=sBc;a(cBc,"OS");lBc=cBc;a(uBc,"DS");dBc=uBc;a(h_e,"s0");h_e.prototype.clear=X4c;h_e.prototype.delete=oBc;h_e.prototype.get=aBc;h_e.prototype.has=lBc;h_e.prototype.set=dBc;JTt=h_e,fBc=E3r(f_e,"Map"),LVi=fBc;a(pBc,"ZS");hBc=pBc;a(mBc,"MS");gBc=mBc;a(ABc,"LS");ZTt=ABc;a(yBc,"jS");EBc=yBc;a(_Bc,"AS");CBc=_Bc;a(vBc,"IS");bBc=vBc;a(SBc,"RS");TBc=SBc;a(m_e,"e0");m_e.prototype.clear=hBc;m_e.prototype.delete=EBc;m_e.prototype.get=CBc;m_e.prototype.has=bBc;m_e.prototype.set=TBc;_3r=m_e,IBc="Expected a function";a(C3r,"MG");C3r.Cache=_3r;uy=C3r,g_e=uy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,UVi.join)((0,FVi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),G4h=uy(()=>HE(process.env.CLAUDE_CODE_SUPERVISED));a(gn,"y");a(ft,"Z");QVi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return QVi=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(x3e,"T4");YBr=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"),xi=class extends Error{static{a(this,"g")}},FC=class t extends xi{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 HEe({message:n,cause:YBr(r)});let s=r,c=s?.error?.type;return e===400?new bSt(e,s,n,o,c):e===401?new SSt(e,s,n,o,c):e===403?new TSt(e,s,n,o,c):e===404?new ISt(e,s,n,o,c):e===409?new xSt(e,s,n,o,c):e===422?new wSt(e,s,n,o,c):e===429?new RSt(e,s,n,o,c):e>=500?new kSt(e,s,n,o,c):new t(e,s,n,o,c)}},fI=class extends FC{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},HEe=class extends FC{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},vSt=class extends HEe{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},bSt=class extends FC{static{a(this,"p9")}},SSt=class extends FC{static{a(this,"d9")}},TSt=class extends FC{static{a(this,"i9")}},ISt=class extends FC{static{a(this,"n9")}},xSt=class extends FC{static{a(this,"r9")}},wSt=class extends FC{static{a(this,"o9")}},RSt=class extends FC{static{a(this,"t9")}},kSt=class extends FC{static{a(this,"a9")}},xBc=/^[a-z][a-z0-9+.-]*:/i,wBc=a(t=>xBc.test(t),"bN"),KBr=a(t=>(KBr=Array.isArray,KBr(t)),"jG"),nGi=KBr;a(JBr,"w5");a(iGi,"IG");a(RBc,"_N");kBc=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new xi(`${t} must be an integer`);if(e<0)throw new xi(`${t} must be a positive integer`);return e},"kN"),qVi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),PBc=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),_V="0.94.0",DBc=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(NBc,"SS");MBc=a(()=>{let t=NBc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_V,"X-Stainless-OS":sGi(Deno.build.os),"X-Stainless-Arch":oGi(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":_V,"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":_V,"X-Stainless-OS":sGi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":oGi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=OBc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_V,"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":_V,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(OBc,"CS");oGi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),sGi=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"),v3r=a(()=>aGi??(aGi=MBc()),"s9");a(BBc,"yN");a(jVi,"RG");a(HVi,"D5");a(b3r,"e9");a(LBc,"fN");FBc=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(UBc,"hN");QBc="urn:ietf:params:oauth:grant-type:jwt-bearer",qBc="refresh_token",GVi="/v1/oauth/token",PSt="oauth-2025-04-20",jBc="oidc-federation-2026-04-01",HBc=120,S3r=30,GBc=5,cGi=1048576;a($Vi,"Z5");a(VVi,"M5");mBr=2e3,$Bc=new Set(["error","error_description","error_uri"]);a($R,"Z6");a(WVi,"L5");a(zVi,"j5");a(VBc,"fS");Jl=class extends xi{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(qne,"Y4");ZBr=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-qne();return n>HBc?r.token:n>S3r?(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||qne()-this.lastAdvisoryError{this.lastAdvisoryError=qne(),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}},Yl=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(WBc,"rN");a(T3r,"Q8");a(dGi,"bG");DSt={off:0,error:200,warn:300,info:400,debug:500},fGi=a((t,e,r)=>{if(t){if(RBc(DSt,t))return t;Ug(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(DSt))}`)}},"_G");a(p3e,"$Q");a(K1t,"A5");zBc={error:p3e,warn:p3e,info:p3e,debug:p3e},pGi=new WeakMap;a(Ug,"m$");Fne=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"),YVi="1.0",YBc=/^[A-Za-z0-9_.-]+$/;a(KVi,"tN");KBc=a(async t=>{var e,r;let n=await I3r();if(n===null)return null;let o=t??await JVi();if(o===null)return null;KVi(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=Yl("ANTHROPIC_ORGANIZATION_ID"),h=Yl("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Yl("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:Yl("ANTHROPIC_WORKSPACE_ID"),base_url:Yl("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Yl("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:Yl("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=Yl("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=Yl("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=Yl("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=Yl("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=Yl("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=Yl("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=Yl("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),JBc=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await I3r();if(!r)return null;let n=e??await JVi();return n?(KVi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),I3r=a(async()=>{if(!ZBc())return null;let t=await import("node:path"),e=Yl("ANTHROPIC_CONFIG_DIR");if(e)return e;if(v3r()["X-Stainless-OS"]==="Windows"){let o=Yl("APPDATA");if(o)return t.join(o,"Anthropic");let s=Yl("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=Yl("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=Yl("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),ZBc=a(()=>{let t=v3r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),JVi=a(async()=>{let t=await I3r();if(!t)return null;let e=Yl("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(hGi,"SG");a(XBc,"$w");a(eLc,"Qw");a(tLc,"Jw");a(ZVi,"vG");a(rLc,"Xw");a(nLc,"mS");a(iLc,"lS");a(oLc,"cS");Vne=class{static{a(this,"B1")}constructor(){lI.set(this,void 0),uI.set(this,void 0),gn(this,lI,new Uint8Array,"f"),gn(this,uI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?T3r(e):e;gn(this,lI,WBc([ft(this,lI,"f"),r]),"f");let n=[],o;for(;(o=sLc(ft(this,lI,"f"),ft(this,uI,"f")))!=null;){if(o.carriage&&ft(this,uI,"f")==null){gn(this,uI,o.index,"f");continue}if(ft(this,uI,"f")!=null&&(o.index!==ft(this,uI,"f")+1||o.carriage)){n.push(dGi(ft(this,lI,"f").subarray(0,ft(this,uI,"f")-1))),gn(this,lI,ft(this,lI,"f").subarray(ft(this,uI,"f")),"f"),gn(this,uI,null,"f");continue}let s=ft(this,uI,"f")!==null?o.preceding-1:o.preceding,c=dGi(ft(this,lI,"f").subarray(0,s));n.push(c),gn(this,lI,ft(this,lI,"f").subarray(o.index),"f"),gn(this,uI,null,"f")}return n}flush(){return ft(this,lI,"f").length?this.decode(` -`):[]}};lI=new WeakMap,uI=new WeakMap;Vne.NEWLINE_CHARS=new Set([` -`,"\r"]);Vne.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(sLc,"pS");a(aLc,"Yw");Wne=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,WLe.set(this,void 0),this.controller=r,gn(this,WLe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?Ug(n):console;async function*c(){if(o)throw new xi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of cLc(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=qVi(u.data)??u.data,f=d?.error?.type;throw new FC(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(x3e(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 Vne,u=b3r(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 xi("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(x3e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(WLe=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,ft(this,WLe,"f")),new t(()=>o(r),this.controller,ft(this,WLe,"f"))]}toReadableStream(){let e=this,r;return jVi({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=T3r(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(cLc,"dS");a(lLc,"iS");XBr=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]=uLc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(uLc,"nS");a(XVi,"P5");a(eWi,"CG");NSt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=XVi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,h3e.set(this,void 0),gn(this,h3e,e,"f")}_thenUnwrap(e){return new t(ft(this,h3e,"f"),this.responsePromise,async(r,n)=>eWi(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(ft(this,h3e,"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)}};h3e=new WeakMap;MSt=class{static{a(this,"TG")}constructor(e,r,n,o){J1t.set(this,void 0),gn(this,J1t,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 xi("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ft(this,J1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(J1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},eLr=class extends NSt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await XVi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},zne=class extends MSt{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:{...JBr(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...JBr(this.options.query),after_id:e}}:null}},$E=class extends MSt{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:{...JBr(this.options.query),page:e}}:null}},tWi=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(FEe,"J0");a(gSt,"XQ");rWi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),x3r=a(async(t,e,r=!0)=>({...t,body:await fLc(t.body,e,r)}),"J8"),mGi=new WeakMap;a(dLc,"oS");fLc=a(async(t,e,r=!0)=>{if(!await dLc(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])=>tLr(n,o,s,r))),n},"tS"),pLc=a(t=>t instanceof Blob&&"name"in t,"aS"),tLr=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,FEe([await r.blob()],gSt(r,n),o))}else if(rWi(r))t.append(e,FEe([await new Response(HVi(r)).blob()],gSt(r,n)));else if(pLc(r))t.append(e,FEe([r],gSt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>tLr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>tLr(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"),nWi=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"),hLc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&nWi(t),"sS"),mLc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(gLc,"_5");a(rLr,"gG");a(ALc,"$v");Ad=class{static{a(this,"t")}constructor(e){this._client=e}},iWi=Symbol.for("brand.privateNullableHeaders");a(yLc,"Jv");hr=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of yLc(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{[iWi]:!0,values:e,nulls:r}},"R");a(oWi,"qw");gGi=Object.freeze(Object.create(null)),ELc=a((t=oWi)=>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??gGi)??gGi)?.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 xi(`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}),mDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=cc(),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}),XGi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oN(),r=Is(),n=fV(),o=cc(),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}),gDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=cTt(),r=oN(),n=cc(),o=XGi(),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}),ADc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oN(),r=Is(),n=cc(),o=cc(),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}),yDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=cc(),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}),EDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),_Dc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=cc(),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}),vDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=cc(),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}),CDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=cc(),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}),bDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=cc(),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}),SDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JGi(),r=dDc(),n=ZGi(),o=fDc(),s=pDc(),c=hDc(),l=mDc(),u=XGi(),d=gDc(),f=ADc(),h=yDc(),m=EDc(),g=_Dc(),A=vDc(),y=CDc(),E=bDc();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=_}),TDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),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}),IDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=TDc(),r=[e.default];t.default=r}),xDc=qt(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"]}),wDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Z2c(),r=uDc(),n=SDc(),o=IDc(),s=xDc(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),RDc=qt(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={}))}),PDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Is(),r=RDc(),n=dLr(),o=lTt(),s=cc(),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}}),e$i=qt((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=Y2c(),n=wDc(),o=PDc(),s=kDc(),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=cTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Is();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=uLr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=lTt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),DDc=qt(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&&q<60)return!0;let $=O-W*U,J=M-z*U-($<0?1:0);return(J===23||J===-1)&&($===59||$===-1)&&q<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")}),NDc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=e$i(),r=Is(),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}),MDc=qt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=DDc(),n=NDc(),o=Is(),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}),ODc=50;a(H4r,"g9");a(s$i,"K5");a(BDc,"Uk");a(bne,"v4");fTt=["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"],LDc=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],FDc="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",UDc=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,QDc=/(.*?)<\/command-name>/;a(pLr,"h9");qDc={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(u$i,"q5");a(jDc,"JN");a(z$,"G1");a(HDc,"zk");a(GDc,"Nk");a($Dc,"wk");G4r=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=u$i(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()}},c1=class extends Error{static{a(this,"W6")}};a(d$i,"V5");a(QE,"R$");a(w3e,"U1");VDc=typeof global=="object"&&global&&global.Object===Object&&global,f$i=VDc,WDc=typeof self=="object"&&self&&self.Object===Object&&self,zDc=f$i||WDc||Function("return this")(),HEe=zDc,YDc=HEe.Symbol,aV=YDc,p$i=Object.prototype,KDc=p$i.hasOwnProperty,JDc=p$i.toString,ELe=aV?aV.toStringTag:void 0;a(ZDc,"Ak");XDc=ZDc,eNc=Object.prototype,tNc=eNc.toString;a(rNc,"Pk");nNc=rNc,iNc="[object Null]",oNc="[object Undefined]",kji=aV?aV.toStringTag:void 0;a(sNc,"_k");R3e=sNc;a(aNc,"kk");Z6=aNc,cNc="[object AsyncFunction]",lNc="[object Function]",uNc="[object GeneratorFunction]",dNc="[object Proxy]";a(fNc,"xk");hLr=fNc,pNc=HEe["__core-js_shared__"],u4r=pNc,Dji=(function(){var t=/[^.]+$/.exec(u4r&&u4r.keys&&u4r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(hNc,"fk");mNc=hNc,gNc=Function.prototype,ANc=gNc.toString;a(yNc,"uk");ENc=yNc,_Nc=/[\\^$.*+?()[\]{}|]/g,vNc=/^\[object .+?Constructor\]$/,CNc=Function.prototype,bNc=Object.prototype,SNc=CNc.toString,TNc=bNc.hasOwnProperty,INc=RegExp("^"+SNc.call(TNc).replace(_Nc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(xNc,"rk");wNc=xNc;a(RNc,"ok");PNc=RNc;a(kNc,"tk");mLr=kNc,DNc=mLr(Object,"create"),XLe=DNc;a(NNc,"sk");MNc=NNc;a(ONc,"ek");BNc=ONc,LNc="__lodash_hash_undefined__",FNc=Object.prototype,UNc=FNc.hasOwnProperty;a(QNc,"XS");qNc=QNc,jNc=Object.prototype,HNc=jNc.hasOwnProperty;a(GNc,"GS");$Nc=GNc,VNc="__lodash_hash_undefined__";a(WNc,"HS");zNc=WNc;a(GEe,"a0");GEe.prototype.clear=MNc;GEe.prototype.delete=BNc;GEe.prototype.get=qNc;GEe.prototype.has=$Nc;GEe.prototype.set=zNc;Nji=GEe;a(YNc,"KS");KNc=YNc;a(JNc,"qS");pTt=JNc;a(ZNc,"VS");hTt=ZNc,XNc=Array.prototype,eMc=XNc.splice;a(tMc,"NS");rMc=tMc;a(nMc,"wS");iMc=nMc;a(oMc,"OS");sMc=oMc;a(aMc,"DS");cMc=aMc;a($Ee,"s0");$Ee.prototype.clear=KNc;$Ee.prototype.delete=rMc;$Ee.prototype.get=iMc;$Ee.prototype.has=sMc;$Ee.prototype.set=cMc;mTt=$Ee,lMc=mLr(HEe,"Map"),h$i=lMc;a(uMc,"ZS");dMc=uMc;a(fMc,"MS");pMc=fMc;a(hMc,"LS");gTt=hMc;a(mMc,"jS");gMc=mMc;a(AMc,"AS");yMc=AMc;a(EMc,"IS");_Mc=EMc;a(vMc,"RS");CMc=vMc;a(VEe,"e0");VEe.prototype.clear=dMc;VEe.prototype.delete=gMc;VEe.prototype.get=yMc;VEe.prototype.has=_Mc;VEe.prototype.set=CMc;gLr=VEe,bMc="Expected a function";a(ALr,"MG");ALr.Cache=gLr;my=ALr,WEe=my(()=>(process.env.CLAUDE_CONFIG_DIR??(0,g$i.join)((0,m$i.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),sNh=my(()=>QE(process.env.CLAUDE_CODE_SUPERVISED));a(mn,"y");a(gt,"Z");A$i=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return A$i=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(e3e,"T4");$4r=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"),Ii=class extends Error{static{a(this,"g")}},Mv=class t extends Ii{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 _Ee({message:n,cause:$4r(r)});let s=r,c=s?.error?.type;return e===400?new q1t(e,s,n,o,c):e===401?new j1t(e,s,n,o,c):e===403?new H1t(e,s,n,o,c):e===404?new G1t(e,s,n,o,c):e===409?new $1t(e,s,n,o,c):e===422?new V1t(e,s,n,o,c):e===429?new W1t(e,s,n,o,c):e>=500?new z1t(e,s,n,o,c):new t(e,s,n,o,c)}},sI=class extends Mv{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},_Ee=class extends Mv{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},Q1t=class extends _Ee{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},q1t=class extends Mv{static{a(this,"p9")}},j1t=class extends Mv{static{a(this,"d9")}},H1t=class extends Mv{static{a(this,"i9")}},G1t=class extends Mv{static{a(this,"n9")}},$1t=class extends Mv{static{a(this,"r9")}},V1t=class extends Mv{static{a(this,"o9")}},W1t=class extends Mv{static{a(this,"t9")}},z1t=class extends Mv{static{a(this,"a9")}},SMc=/^[a-z][a-z0-9+.-]*:/i,TMc=a(t=>SMc.test(t),"bN"),V4r=a(t=>(V4r=Array.isArray,V4r(t)),"jG"),Mji=V4r;a(W4r,"w5");a(Oji,"IG");a(IMc,"_N");xMc=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ii(`${t} must be an integer`);if(e<0)throw new Ii(`${t} must be a positive integer`);return e},"kN"),y$i=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),wMc=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),rV="0.94.0",RMc=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(PMc,"SS");kMc=a(()=>{let t=PMc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rV,"X-Stainless-OS":Lji(Deno.build.os),"X-Stainless-Arch":Bji(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":rV,"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":rV,"X-Stainless-OS":Lji(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Bji(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=DMc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rV,"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":rV,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(DMc,"CS");Bji=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),Lji=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"),yLr=a(()=>Fji??(Fji=kMc()),"s9");a(NMc,"yN");a(E$i,"RG");a(_$i,"D5");a(ELr,"e9");a(MMc,"fN");OMc=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(BMc,"hN");LMc="urn:ietf:params:oauth:grant-type:jwt-bearer",FMc="refresh_token",v$i="/v1/oauth/token",Y1t="oauth-2025-04-20",UMc="oidc-federation-2026-04-01",QMc=120,_Lr=30,qMc=5,Uji=1048576;a(C$i,"Z5");a(b$i,"M5");d4r=2e3,jMc=new Set(["error","error_description","error_uri"]);a(FR,"Z6");a(S$i,"L5");a(T$i,"j5");a(HMc,"fS");zl=class extends Ii{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Sne,"Y4");z4r=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-Sne();return n>QMc?r.token:n>_Lr?(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||Sne()-this.lastAdvisoryError{this.lastAdvisoryError=Sne(),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}},Vl=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(GMc,"rN");a(vLr,"Q8");a(jji,"bG");K1t={off:0,error:200,warn:300,info:400,debug:500},Hji=a((t,e,r)=>{if(t){if(IMc(K1t,t))return t;qg(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(K1t))}`)}},"_G");a(QLe,"$Q");a(h1t,"A5");$Mc={error:QLe,warn:QLe,info:QLe,debug:QLe},Gji=new WeakMap;a(qg,"m$");vne=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"),I$i="1.0",VMc=/^[A-Za-z0-9_.-]+$/;a(x$i,"tN");WMc=a(async t=>{var e,r;let n=await CLr();if(n===null)return null;let o=t??await w$i();if(o===null)return null;x$i(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=Vl("ANTHROPIC_ORGANIZATION_ID"),h=Vl("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Vl("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:Vl("ANTHROPIC_WORKSPACE_ID"),base_url:Vl("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Vl("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:Vl("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=Vl("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=Vl("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=Vl("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=Vl("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=Vl("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=Vl("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=Vl("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),zMc=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await CLr();if(!r)return null;let n=e??await w$i();return n?(x$i(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),CLr=a(async()=>{if(!YMc())return null;let t=await import("node:path"),e=Vl("ANTHROPIC_CONFIG_DIR");if(e)return e;if(yLr()["X-Stainless-OS"]==="Windows"){let o=Vl("APPDATA");if(o)return t.join(o,"Anthropic");let s=Vl("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=Vl("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=Vl("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),YMc=a(()=>{let t=yLr()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),w$i=a(async()=>{let t=await CLr();if(!t)return null;let e=Vl("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($ji,"SG");a(KMc,"$w");a(JMc,"Qw");a(ZMc,"Jw");a(R$i,"vG");a(XMc,"Xw");a(eOc,"mS");a(tOc,"lS");a(rOc,"cS");Rne=class{static{a(this,"B1")}constructor(){nI.set(this,void 0),iI.set(this,void 0),mn(this,nI,new Uint8Array,"f"),mn(this,iI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?vLr(e):e;mn(this,nI,GMc([gt(this,nI,"f"),r]),"f");let n=[],o;for(;(o=nOc(gt(this,nI,"f"),gt(this,iI,"f")))!=null;){if(o.carriage&>(this,iI,"f")==null){mn(this,iI,o.index,"f");continue}if(gt(this,iI,"f")!=null&&(o.index!==gt(this,iI,"f")+1||o.carriage)){n.push(jji(gt(this,nI,"f").subarray(0,gt(this,iI,"f")-1))),mn(this,nI,gt(this,nI,"f").subarray(gt(this,iI,"f")),"f"),mn(this,iI,null,"f");continue}let s=gt(this,iI,"f")!==null?o.preceding-1:o.preceding,c=jji(gt(this,nI,"f").subarray(0,s));n.push(c),mn(this,nI,gt(this,nI,"f").subarray(o.index),"f"),mn(this,iI,null,"f")}return n}flush(){return gt(this,nI,"f").length?this.decode(` +`):[]}};nI=new WeakMap,iI=new WeakMap;Rne.NEWLINE_CHARS=new Set([` +`,"\r"]);Rne.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(nOc,"pS");a(iOc,"Yw");Pne=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,_Le.set(this,void 0),this.controller=r,mn(this,_Le,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?qg(n):console;async function*c(){if(o)throw new Ii("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of oOc(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=y$i(u.data)??u.data,f=d?.error?.type;throw new Mv(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(e3e(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 Rne,u=ELr(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 Ii("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(e3e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(_Le=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,_Le,"f")),new t(()=>o(r),this.controller,gt(this,_Le,"f"))]}toReadableStream(){let e=this,r;return E$i({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=vLr(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(oOc,"dS");a(sOc,"iS");Y4r=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]=aOc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(aOc,"nS");a(P$i,"P5");a(k$i,"CG");J1t=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=P$i){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,qLe.set(this,void 0),mn(this,qLe,e,"f")}_thenUnwrap(e){return new t(gt(this,qLe,"f"),this.responsePromise,async(r,n)=>k$i(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,qLe,"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)}};qLe=new WeakMap;Z1t=class{static{a(this,"TG")}constructor(e,r,n,o){m1t.set(this,void 0),mn(this,m1t,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 Ii("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,m1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(m1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},K4r=class extends J1t{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await P$i(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},kne=class extends Z1t{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:{...W4r(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...W4r(this.options.query),after_id:e}}:null}},jE=class extends Z1t{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:{...W4r(this.options.query),page:e}}:null}},D$i=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(mEe,"J0");a(M1t,"XQ");N$i=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),bLr=a(async(t,e,r=!0)=>({...t,body:await lOc(t.body,e,r)}),"J8"),Vji=new WeakMap;a(cOc,"oS");lOc=a(async(t,e,r=!0)=>{if(!await cOc(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])=>J4r(n,o,s,r))),n},"tS"),uOc=a(t=>t instanceof Blob&&"name"in t,"aS"),J4r=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,mEe([await r.blob()],M1t(r,n),o))}else if(N$i(r))t.append(e,mEe([await new Response(_$i(r)).blob()],M1t(r,n)));else if(uOc(r))t.append(e,mEe([r],M1t(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>J4r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>J4r(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"),M$i=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"),dOc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&M$i(t),"sS"),fOc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(pOc,"_5");a(Z4r,"gG");a(hOc,"$v");Ad=class{static{a(this,"t")}constructor(e){this._client=e}},O$i=Symbol.for("brand.privateNullableHeaders");a(mOc,"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 mOc(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{[O$i]:!0,values:e,nulls:r}},"R");a(B$i,"qw");Wji=Object.freeze(Object.create(null)),gOc=a((t=B$i)=>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??Wji)??Wji)?.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 Ii(`Path parameters result in path with invalid segments: ${o.map(h=>h.error).join(` `)} ${s} -${f}`)}return s},"Xv"),Gn=ELc(oWi),OSt=class extends Ad{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/environments/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/environments/${e}?beta=true`,{body:s,...n,headers:hr([{"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",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/environments/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/environments/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},v3e=Symbol("anthropic.sdk.stainlessHelper");a(ASt,"k5");a(sWi,"hG");a(aWi,"S5");a(_Lc,"Vw");BSt=class extends Ad{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",zne,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/files/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/files/${e}/content?beta=true`,{...n,headers:hr([{"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(Gn`/v1/files/${e}?beta=true`,{...n,headers:hr([{"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",x3r({body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},_Lc(o.file),r?.headers])},this._client))}},LSt=class extends Ad{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/models/${e}?beta=true`,{...n,headers:hr([{...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",zne,{query:o,...r,headers:hr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},FSt=class extends Ad{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:hr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/user_profiles/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:hr([{"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",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},USt=class extends Ad{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/agents/${e}/versions?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},w3e=class extends Ad{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new USt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(Gn`/v1/agents/${e}?beta=true`,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/agents/${e}?beta=true`,{body:s,...n,headers:hr([{"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",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/agents/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};w3e.Versions=USt;QSt=class extends Ad{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(Gn`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:hr([{"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(Gn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:hr([{"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(Gn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:hr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/memory_stores/${e}/memories?beta=true`,$E,{query:s,...n,headers:hr([{"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(Gn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:hr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},qSt=class extends Ad{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Gn`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/memory_stores/${e}/memory_versions?beta=true`,$E,{query:s,...n,headers:hr([{"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(Gn`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},GEe=class extends Ad{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new QSt(this._client),this.memoryVersions=new qSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/memory_stores/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:hr([{"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",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/memory_stores/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};GEe.Memories=QSt;GEe.MemoryVersions=qSt;jSt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Vne;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 xi("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 xi("Attempted to iterate over a response with no body");return new t(b3r(e.body),r)}},HSt=class extends Ad{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:hr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/messages/batches/${e}?beta=true`,{...n,headers:hr([{"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",zne,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/messages/batches/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:hr([{"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 xi(`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:hr([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>jSt.fromResponse(l.response,l.controller))}},cWi={"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(lWi,"Bw");a(AGi,"uG");a(uWi,"mG");a(CLc,"Nv");vLc=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),DEe(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),DEe(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),DEe(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),DEe(t);break;case"delimiter":return t=t.slice(0,t.length-1),DEe(t)}return t},"W8"),bLc=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"),SLc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),dWi=a(t=>JSON.parse(SLc(bLc(DEe(vLc(t))))),"C5"),_Gi="__json_buf";a(CGi,"Ow");nLr=class t{static{a(this,"ZQ")}constructor(e,r){QR.add(this),this.messages=[],this.receivedMessages=[],pV.set(this,void 0),TEe.set(this,null),this.controller=new AbortController,zLe.set(this,void 0),Z1t.set(this,()=>{}),YLe.set(this,()=>{}),KLe.set(this,void 0),X1t.set(this,()=>{}),JLe.set(this,()=>{}),i9.set(this,{}),ZLe.set(this,!1),eSt.set(this,!1),tSt.set(this,!1),Mne.set(this,!1),rSt.set(this,void 0),nSt.set(this,void 0),XLe.set(this,void 0),iSt.set(this,n=>{if(gn(this,eSt,!0,"f"),x3e(n)&&(n=new fI),n instanceof fI)return gn(this,tSt,!0,"f"),this._emit("abort",n);if(n instanceof xi)return this._emit("error",n);if(n instanceof Error){let o=new xi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new xi(String(n)))}),gn(this,zLe,new Promise((n,o)=>{gn(this,Z1t,n,"f"),gn(this,YLe,o,"f")}),"f"),gn(this,KLe,new Promise((n,o)=>{gn(this,X1t,n,"f"),gn(this,JLe,o,"f")}),"f"),ft(this,zLe,"f").catch(()=>{}),ft(this,KLe,"f").catch(()=>{}),gn(this,TEe,e,"f"),gn(this,XLe,r?.logger??console,"f")}get response(){return ft(this,rSt,"f")}get request_id(){return ft(this,nSt,"f")}async withResponse(){gn(this,Mne,!0,"f");let e=await ft(this,zLe,"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 gn(s,TEe,{...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")},ft(this,iSt,"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{ft(this,QR,"m",ABr).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)ft(this,QR,"m",yBr).call(this,u);if(l.controller.signal?.aborted)throw new fI;ft(this,QR,"m",EBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(gn(this,rSt,e,"f"),gn(this,nSt,e?.headers.get("request-id"),"f"),ft(this,Z1t,"f").call(this,e),this._emit("connect"))}get ended(){return ft(this,ZLe,"f")}get errored(){return ft(this,eSt,"f")}get aborted(){return ft(this,tSt,"f")}abort(){this.controller.abort()}on(e,r){return(ft(this,i9,"f")[e]||(ft(this,i9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ft(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(ft(this,i9,"f")[e]||(ft(this,i9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{gn(this,Mne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){gn(this,Mne,!0,"f"),await ft(this,KLe,"f")}get currentMessage(){return ft(this,pV,"f")}async finalMessage(){return await this.done(),ft(this,QR,"m",gBr).call(this)}async finalText(){return await this.done(),ft(this,QR,"m",yGi).call(this)}_emit(e,...r){if(ft(this,ZLe,"f"))return;e==="end"&&(gn(this,ZLe,!0,"f"),ft(this,X1t,"f").call(this));let n=ft(this,i9,"f")[e];if(n&&(ft(this,i9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ft(this,Mne,"f")&&!n?.length&&Promise.reject(o),ft(this,YLe,"f").call(this,o),ft(this,JLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ft(this,Mne,"f")&&!n?.length&&Promise.reject(o),ft(this,YLe,"f").call(this,o),ft(this,JLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ft(this,QR,"m",gBr).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{ft(this,QR,"m",ABr).call(this),this._connected(null);let s=Wne.fromReadableStream(e,this.controller);for await(let c of s)ft(this,QR,"m",yBr).call(this,c);if(s.controller.signal?.aborted)throw new fI;ft(this,QR,"m",EBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(pV=new WeakMap,TEe=new WeakMap,zLe=new WeakMap,Z1t=new WeakMap,YLe=new WeakMap,KLe=new WeakMap,X1t=new WeakMap,JLe=new WeakMap,i9=new WeakMap,ZLe=new WeakMap,eSt=new WeakMap,tSt=new WeakMap,Mne=new WeakMap,rSt=new WeakMap,nSt=new WeakMap,XLe=new WeakMap,iSt=new WeakMap,QR=new WeakSet,gBr=a(function(){if(this.receivedMessages.length===0)throw new xi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),yGi=a(function(){if(this.receivedMessages.length===0)throw new xi("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 xi("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),ABr=a(function(){this.ended||gn(this,pV,void 0,"f")},"cG"),yBr=a(function(e){if(this.ended)return;let r=ft(this,QR,"m",EGi).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":{CGi(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(AGi(r,ft(this,TEe,"f"),{logger:ft(this,XLe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{gn(this,pV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),EBr=a(function(){if(this.ended)throw new xi("stream has ended, this shouldn't happen");let e=ft(this,pV,"f");if(!e)throw new xi("request ended without sending any chunks");return gn(this,pV,void 0,"f"),AGi(e,ft(this,TEe,"f"),{logger:ft(this,XLe,"f")})},"dG"),EGi=a(function(e){let r=ft(this,pV,"f");if(e.type==="message_start"){if(r)throw new xi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new xi(`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&&CGi(n)){let o=n[_Gi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,_Gi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=dWi(o)}catch(c){let l=new xi(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);ft(this,iSt,"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 Wne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},GSt=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}},TLc=1e5,ILc=`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"),Gn=gOc(B$i),X1t=class extends Ad{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(Gn`/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(Gn`/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",jE,{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(Gn`/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(Gn`/v1/environments/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},YLe=Symbol("anthropic.sdk.stainlessHelper");a(O1t,"k5");a(L$i,"hG");a(F$i,"S5");a(AOc,"Vw");eSt=class extends Ad{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",kne,{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(Gn`/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(Gn`/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(Gn`/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",bLr({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},AOc(o.file),r?.headers])},this._client))}},tSt=class extends Ad{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/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",kne,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},rSt=class extends Ad{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(Gn`/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(Gn`/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",jE,{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(Gn`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},nSt=class extends Ad{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/agents/${e}/versions?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},t3e=class extends Ad{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new nSt(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(Gn`/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(Gn`/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",jE,{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(Gn`/v1/agents/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};t3e.Versions=nSt;iSt=class extends Ad{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(Gn`/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(Gn`/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(Gn`/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(Gn`/v1/memory_stores/${e}/memories?beta=true`,jE,{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(Gn`/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])})}},oSt=class extends Ad{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Gn`/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(Gn`/v1/memory_stores/${e}/memory_versions?beta=true`,jE,{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(Gn`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},vEe=class extends Ad{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new iSt(this._client),this.memoryVersions=new oSt(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(Gn`/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(Gn`/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",jE,{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(Gn`/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(Gn`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};vEe.Memories=iSt;vEe.MemoryVersions=oSt;sSt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Rne;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 Ii("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 Ii("Attempted to iterate over a response with no body");return new t(ELr(e.body),r)}},aSt=class extends Ad{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(Gn`/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",kne,{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(Gn`/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(Gn`/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 Ii(`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)=>sSt.fromResponse(l.response,l.controller))}},U$i={"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(Q$i,"Bw");a(zji,"uG");a(q$i,"mG");a(yOc,"Nv");EOc=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),lEe(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),lEe(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),lEe(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),lEe(t);break;case"delimiter":return t=t.slice(0,t.length-1),lEe(t)}return t},"W8"),_Oc=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"),vOc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),j$i=a(t=>JSON.parse(vOc(_Oc(lEe(EOc(t))))),"C5"),Jji="__json_buf";a(Zji,"Ow");X4r=class t{static{a(this,"ZQ")}constructor(e,r){NR.add(this),this.messages=[],this.receivedMessages=[],Y$.set(this,void 0),rEe.set(this,null),this.controller=new AbortController,vLe.set(this,void 0),g1t.set(this,()=>{}),CLe.set(this,()=>{}),bLe.set(this,void 0),A1t.set(this,()=>{}),SLe.set(this,()=>{}),H6.set(this,{}),TLe.set(this,!1),y1t.set(this,!1),E1t.set(this,!1),Ane.set(this,!1),_1t.set(this,void 0),v1t.set(this,void 0),ILe.set(this,void 0),C1t.set(this,n=>{if(mn(this,y1t,!0,"f"),e3e(n)&&(n=new sI),n instanceof sI)return mn(this,E1t,!0,"f"),this._emit("abort",n);if(n instanceof Ii)return this._emit("error",n);if(n instanceof Error){let o=new Ii(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ii(String(n)))}),mn(this,vLe,new Promise((n,o)=>{mn(this,g1t,n,"f"),mn(this,CLe,o,"f")}),"f"),mn(this,bLe,new Promise((n,o)=>{mn(this,A1t,n,"f"),mn(this,SLe,o,"f")}),"f"),gt(this,vLe,"f").catch(()=>{}),gt(this,bLe,"f").catch(()=>{}),mn(this,rEe,e,"f"),mn(this,ILe,r?.logger??console,"f")}get response(){return gt(this,_1t,"f")}get request_id(){return gt(this,v1t,"f")}async withResponse(){mn(this,Ane,!0,"f");let e=await gt(this,vLe,"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 mn(s,rEe,{...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,C1t,"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,NR,"m",p4r).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,NR,"m",h4r).call(this,u);if(l.controller.signal?.aborted)throw new sI;gt(this,NR,"m",m4r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(mn(this,_1t,e,"f"),mn(this,v1t,e?.headers.get("request-id"),"f"),gt(this,g1t,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,TLe,"f")}get errored(){return gt(this,y1t,"f")}get aborted(){return gt(this,E1t,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,H6,"f")[e]||(gt(this,H6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,H6,"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,H6,"f")[e]||(gt(this,H6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{mn(this,Ane,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){mn(this,Ane,!0,"f"),await gt(this,bLe,"f")}get currentMessage(){return gt(this,Y$,"f")}async finalMessage(){return await this.done(),gt(this,NR,"m",f4r).call(this)}async finalText(){return await this.done(),gt(this,NR,"m",Yji).call(this)}_emit(e,...r){if(gt(this,TLe,"f"))return;e==="end"&&(mn(this,TLe,!0,"f"),gt(this,A1t,"f").call(this));let n=gt(this,H6,"f")[e];if(n&&(gt(this,H6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Ane,"f")&&!n?.length&&Promise.reject(o),gt(this,CLe,"f").call(this,o),gt(this,SLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Ane,"f")&&!n?.length&&Promise.reject(o),gt(this,CLe,"f").call(this,o),gt(this,SLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,NR,"m",f4r).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,NR,"m",p4r).call(this),this._connected(null);let s=Pne.fromReadableStream(e,this.controller);for await(let c of s)gt(this,NR,"m",h4r).call(this,c);if(s.controller.signal?.aborted)throw new sI;gt(this,NR,"m",m4r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(Y$=new WeakMap,rEe=new WeakMap,vLe=new WeakMap,g1t=new WeakMap,CLe=new WeakMap,bLe=new WeakMap,A1t=new WeakMap,SLe=new WeakMap,H6=new WeakMap,TLe=new WeakMap,y1t=new WeakMap,E1t=new WeakMap,Ane=new WeakMap,_1t=new WeakMap,v1t=new WeakMap,ILe=new WeakMap,C1t=new WeakMap,NR=new WeakSet,f4r=a(function(){if(this.receivedMessages.length===0)throw new Ii("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),Yji=a(function(){if(this.receivedMessages.length===0)throw new Ii("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 Ii("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),p4r=a(function(){this.ended||mn(this,Y$,void 0,"f")},"cG"),h4r=a(function(e){if(this.ended)return;let r=gt(this,NR,"m",Kji).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":{Zji(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(zji(r,gt(this,rEe,"f"),{logger:gt(this,ILe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{mn(this,Y$,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),m4r=a(function(){if(this.ended)throw new Ii("stream has ended, this shouldn't happen");let e=gt(this,Y$,"f");if(!e)throw new Ii("request ended without sending any chunks");return mn(this,Y$,void 0,"f"),zji(e,gt(this,rEe,"f"),{logger:gt(this,ILe,"f")})},"dG"),Kji=a(function(e){let r=gt(this,Y$,"f");if(e.type==="message_start"){if(r)throw new Ii(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ii(`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&&Zji(n)){let o=n[Jji]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,Jji,{value:o,enumerable:!1,writable:!0}),o)try{s.input=j$i(o)}catch(c){let l=new Ii(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,C1t,"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 Pne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},cSt=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}},COc=1e5,bOc=`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 @@ -1612,24 +1568,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(bGi,"Lw");$St=class{static{a(this,"jQ")}constructor(e,r,n){e3e.add(this),this.client=e,IEe.set(this,!1),One.set(this,!1),bm.set(this,void 0),m1.set(this,void 0),cI.set(this,void 0),l9.set(this,void 0),hV.set(this,void 0),t3e.set(this,0),gn(this,bm,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...sWi(r.tools,r.messages)].join(", ");gn(this,m1,{...n,headers:hr([{"x-stainless-helper":o},n?.headers])},"f"),gn(this,hV,bGi(),"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*[(IEe=new WeakMap,One=new WeakMap,bm=new WeakMap,m1=new WeakMap,cI=new WeakMap,l9=new WeakMap,hV=new WeakMap,t3e=new WeakMap,e3e=new WeakSet,vGi=a(async function(){let e=ft(this,bm,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(ft(this,cI,"f")!==void 0)try{let u=await ft(this,cI,"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??TLc;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:ft(this,bm,"f").params.max_tokens},{signal:ft(this,m1,"f").signal,headers:hr([ft(this,m1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new xi("Expected text response for compaction");return ft(this,bm,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(ft(this,IEe,"f"))throw new xi("Cannot iterate over a consumed stream");gn(this,IEe,!0,"f"),gn(this,One,!0,"f"),gn(this,l9,void 0,"f");try{for(;;){let r;try{if(ft(this,bm,"f").params.max_iterations&&ft(this,t3e,"f")>=ft(this,bm,"f").params.max_iterations)break;gn(this,One,!1,"f"),gn(this,l9,void 0,"f"),gn(this,t3e,(e=ft(this,t3e,"f"),e++,e),"f"),gn(this,cI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=ft(this,bm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},ft(this,m1,"f")),gn(this,cI,r.finalMessage(),"f"),ft(this,cI,"f").catch(()=>{}),yield r):(gn(this,cI,this.client.beta.messages.create({...s,stream:!1},ft(this,m1,"f")),"f"),yield ft(this,cI,"f")),!await ft(this,e3e,"m",vGi).call(this)){if(!ft(this,One,"f")){let{role:l,content:u}=await ft(this,cI,"f");ft(this,bm,"f").params.messages.push({role:l,content:u})}let c=await ft(this,e3e,"m",iLr).call(this,ft(this,bm,"f").params.messages.at(-1));if(c)ft(this,bm,"f").params.messages.push(c);else if(!ft(this,One,"f"))break}}finally{r&&r.abort()}}if(!ft(this,cI,"f"))throw new xi("ToolRunner concluded without a message from the server");ft(this,hV,"f").resolve(await ft(this,cI,"f"))}catch(r){throw gn(this,IEe,!1,"f"),ft(this,hV,"f").promise.catch(()=>{}),ft(this,hV,"f").reject(r),gn(this,hV,bGi(),"f"),r}}setMessagesParams(e){typeof e=="function"?ft(this,bm,"f").params=e(ft(this,bm,"f").params):ft(this,bm,"f").params=e,gn(this,One,!0,"f"),gn(this,l9,void 0,"f")}setRequestOptions(e){typeof e=="function"?gn(this,m1,e(ft(this,m1,"f")),"f"):gn(this,m1,{...ft(this,m1,"f"),...e},"f")}async generateToolResponse(e=ft(this,m1,"f").signal){let r=await ft(this,cI,"f")??this.params.messages.at(-1);return r?ft(this,e3e,"m",iLr).call(this,r,e):null}done(){return ft(this,hV,"f").promise}async runUntilDone(){if(!ft(this,IEe,"f"))for await(let e of this);return this.done()}get params(){return ft(this,bm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};iLr=a(async function(t,e=ft(this,m1,"f").signal){return ft(this,l9,"f")!==void 0?ft(this,l9,"f"):(gn(this,l9,xLc(ft(this,bm,"f").params,t,{...ft(this,m1,"f"),signal:e}),"f"),ft(this,l9,"f"))},"iG");a(xLc,"Fv");SGi={"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"},wLc=["claude-mythos-preview","claude-opus-4-6"],Yne=class extends Ad{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new HSt(this._client)}create(e,r){let n=TGi(e),{betas:o,...s}=n;s.model in SGi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${SGi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),wLc.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=cWi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=aWi(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:hr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:hr([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>uWi(n,e,{logger:this._client.logger??console}))}stream(e,r){return nLr.createMessage(this,e,r)}countTokens(e,r){let n=TGi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:hr([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new $St(this._client,e,r)}};a(TGi,"Aw");Yne.Batches=HSt;Yne.BetaToolRunner=$St;Yne.ToolError=GSt;VSt=class extends Ad{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/sessions/${e}/events?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},WSt=class extends Ad{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(Gn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:hr([{"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(Gn`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/sessions/${e}/resources?beta=true`,$E,{query:s,...n,headers:hr([{"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(Gn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},$Ee=class extends Ad{static{a(this,"G0")}constructor(){super(...arguments),this.events=new VSt(this._client),this.resources=new WSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/sessions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:hr([{"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",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/sessions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/sessions/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};$Ee.Events=VSt;$Ee.Resources=WSt;zSt=class extends Ad{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(Gn`/v1/skills/${e}/versions?beta=true`,x3r({body:s,...n,headers:hr([{"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(Gn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/skills/${e}/versions?beta=true`,$E,{query:s,...n,headers:hr([{"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(Gn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},R3e=class extends Ad{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new zSt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",x3r({body:o,...r,headers:hr([{"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(Gn`/v1/skills/${e}?beta=true`,{...n,headers:hr([{"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",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/skills/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};R3e.Versions=zSt;YSt=class extends Ad{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:hr([{"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(Gn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:hr([{"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(Gn`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/vaults/${e}/credentials?beta=true`,$E,{query:s,...n,headers:hr([{"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(Gn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:hr([{"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(Gn`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},k3e=class extends Ad{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new YSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/vaults/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:hr([{"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",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/vaults/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/vaults/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};k3e.Credentials=YSt;A1=class extends Ad{static{a(this,"G6")}constructor(){super(...arguments),this.models=new LSt(this._client),this.messages=new Yne(this._client),this.agents=new w3e(this._client),this.environments=new OSt(this._client),this.sessions=new $Ee(this._client),this.vaults=new k3e(this._client),this.memoryStores=new GEe(this._client),this.files=new BSt(this._client),this.skills=new R3e(this._client),this.userProfiles=new FSt(this._client)}};A1.Models=LSt;A1.Messages=Yne;A1.Agents=w3e;A1.Environments=OSt;A1.Sessions=$Ee;A1.Vaults=k3e;A1.MemoryStores=GEe;A1.Files=BSt;A1.Skills=R3e;A1.UserProfiles=FSt;KSt=class extends Ad{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:hr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(fWi,"Iw");a(IGi,"nG");a(pWi,"rG");a(RLc,"bv");RGi="__json_buf";a(kGi,"bw");oLr=class t{static{a(this,"CQ")}constructor(e,r){qR.add(this),this.messages=[],this.receivedMessages=[],mV.set(this,void 0),xEe.set(this,null),this.controller=new AbortController,r3e.set(this,void 0),oSt.set(this,()=>{}),n3e.set(this,()=>{}),i3e.set(this,void 0),sSt.set(this,()=>{}),o3e.set(this,()=>{}),o9.set(this,{}),s3e.set(this,!1),aSt.set(this,!1),cSt.set(this,!1),Bne.set(this,!1),lSt.set(this,void 0),uSt.set(this,void 0),a3e.set(this,void 0),CBr.set(this,n=>{if(gn(this,aSt,!0,"f"),x3e(n)&&(n=new fI),n instanceof fI)return gn(this,cSt,!0,"f"),this._emit("abort",n);if(n instanceof xi)return this._emit("error",n);if(n instanceof Error){let o=new xi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new xi(String(n)))}),gn(this,r3e,new Promise((n,o)=>{gn(this,oSt,n,"f"),gn(this,n3e,o,"f")}),"f"),gn(this,i3e,new Promise((n,o)=>{gn(this,sSt,n,"f"),gn(this,o3e,o,"f")}),"f"),ft(this,r3e,"f").catch(()=>{}),ft(this,i3e,"f").catch(()=>{}),gn(this,xEe,e,"f"),gn(this,a3e,r?.logger??console,"f")}get response(){return ft(this,lSt,"f")}get request_id(){return ft(this,uSt,"f")}async withResponse(){gn(this,Bne,!0,"f");let e=await ft(this,r3e,"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 gn(s,xEe,{...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")},ft(this,CBr,"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{ft(this,qR,"m",vBr).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)ft(this,qR,"m",bBr).call(this,u);if(l.controller.signal?.aborted)throw new fI;ft(this,qR,"m",SBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(gn(this,lSt,e,"f"),gn(this,uSt,e?.headers.get("request-id"),"f"),ft(this,oSt,"f").call(this,e),this._emit("connect"))}get ended(){return ft(this,s3e,"f")}get errored(){return ft(this,aSt,"f")}get aborted(){return ft(this,cSt,"f")}abort(){this.controller.abort()}on(e,r){return(ft(this,o9,"f")[e]||(ft(this,o9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ft(this,o9,"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(ft(this,o9,"f")[e]||(ft(this,o9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{gn(this,Bne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){gn(this,Bne,!0,"f"),await ft(this,i3e,"f")}get currentMessage(){return ft(this,mV,"f")}async finalMessage(){return await this.done(),ft(this,qR,"m",_Br).call(this)}async finalText(){return await this.done(),ft(this,qR,"m",xGi).call(this)}_emit(e,...r){if(ft(this,s3e,"f"))return;e==="end"&&(gn(this,s3e,!0,"f"),ft(this,sSt,"f").call(this));let n=ft(this,o9,"f")[e];if(n&&(ft(this,o9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ft(this,Bne,"f")&&!n?.length&&Promise.reject(o),ft(this,n3e,"f").call(this,o),ft(this,o3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ft(this,Bne,"f")&&!n?.length&&Promise.reject(o),ft(this,n3e,"f").call(this,o),ft(this,o3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ft(this,qR,"m",_Br).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{ft(this,qR,"m",vBr).call(this),this._connected(null);let s=Wne.fromReadableStream(e,this.controller);for await(let c of s)ft(this,qR,"m",bBr).call(this,c);if(s.controller.signal?.aborted)throw new fI;ft(this,qR,"m",SBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(mV=new WeakMap,xEe=new WeakMap,r3e=new WeakMap,oSt=new WeakMap,n3e=new WeakMap,i3e=new WeakMap,sSt=new WeakMap,o3e=new WeakMap,o9=new WeakMap,s3e=new WeakMap,aSt=new WeakMap,cSt=new WeakMap,Bne=new WeakMap,lSt=new WeakMap,uSt=new WeakMap,a3e=new WeakMap,CBr=new WeakMap,qR=new WeakSet,_Br=a(function(){if(this.receivedMessages.length===0)throw new xi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),xGi=a(function(){if(this.receivedMessages.length===0)throw new xi("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 xi("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),vBr=a(function(){this.ended||gn(this,mV,void 0,"f")},"aG"),bBr=a(function(e){if(this.ended)return;let r=ft(this,qR,"m",wGi).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":{kGi(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(IGi(r,ft(this,xEe,"f"),{logger:ft(this,a3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{gn(this,mV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),SBr=a(function(){if(this.ended)throw new xi("stream has ended, this shouldn't happen");let e=ft(this,mV,"f");if(!e)throw new xi("request ended without sending any chunks");return gn(this,mV,void 0,"f"),IGi(e,ft(this,xEe,"f"),{logger:ft(this,a3e,"f")})},"eG"),wGi=a(function(e){let r=ft(this,mV,"f");if(e.type==="message_start"){if(r)throw new xi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new xi(`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&&kGi(n)){let o=n[RGi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,RGi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=dWi(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 Wne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},JSt=class extends Ad{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(Gn`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",zne,{query:e,...r})}delete(e,r){return this._client.delete(Gn`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(Gn`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new xi(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:hr([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>jSt.fromResponse(s.response,s.controller))}},P3e=class extends Ad{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new JSt(this._client)}create(e,r){e.model in PGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${PGi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),kLc.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=cWi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=aWi(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:hr([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>pWi(n,e,{logger:this._client.logger??console}))}stream(e,r){return oLr.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},PGi={"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"},kLc=["claude-mythos-preview","claude-opus-4-6"];P3e.Batches=JSt;ZSt=class extends Ad{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/models/${e}`,{...n,headers:hr([{...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",zne,{query:o,...r,headers:hr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},PLc="\\n\\nHuman:",DLc="\\n\\nAssistant:",bp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=Yl("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(sLr.add(this),this._requestAuthFlags=new WeakMap,ySt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:Yl("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:Yl("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&&DBc())throw new xi(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`;a(eHi,"Lw");lSt=class{static{a(this,"jQ")}constructor(e,r,n){xLe.add(this),this.client=e,nEe.set(this,!1),yne.set(this,!1),bm.set(this,void 0),a1.set(this,void 0),rI.set(this,void 0),z6.set(this,void 0),K$.set(this,void 0),wLe.set(this,0),mn(this,bm,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...L$i(r.tools,r.messages)].join(", ");mn(this,a1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),mn(this,K$,eHi(),"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*[(nEe=new WeakMap,yne=new WeakMap,bm=new WeakMap,a1=new WeakMap,rI=new WeakMap,z6=new WeakMap,K$=new WeakMap,wLe=new WeakMap,xLe=new WeakSet,Xji=a(async function(){let e=gt(this,bm,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,rI,"f")!==void 0)try{let u=await gt(this,rI,"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??COc;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,bm,"f").params.max_tokens},{signal:gt(this,a1,"f").signal,headers:mr([gt(this,a1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ii("Expected text response for compaction");return gt(this,bm,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,nEe,"f"))throw new Ii("Cannot iterate over a consumed stream");mn(this,nEe,!0,"f"),mn(this,yne,!0,"f"),mn(this,z6,void 0,"f");try{for(;;){let r;try{if(gt(this,bm,"f").params.max_iterations&>(this,wLe,"f")>=gt(this,bm,"f").params.max_iterations)break;mn(this,yne,!1,"f"),mn(this,z6,void 0,"f"),mn(this,wLe,(e=gt(this,wLe,"f"),e++,e),"f"),mn(this,rI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,bm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,a1,"f")),mn(this,rI,r.finalMessage(),"f"),gt(this,rI,"f").catch(()=>{}),yield r):(mn(this,rI,this.client.beta.messages.create({...s,stream:!1},gt(this,a1,"f")),"f"),yield gt(this,rI,"f")),!await gt(this,xLe,"m",Xji).call(this)){if(!gt(this,yne,"f")){let{role:l,content:u}=await gt(this,rI,"f");gt(this,bm,"f").params.messages.push({role:l,content:u})}let c=await gt(this,xLe,"m",eBr).call(this,gt(this,bm,"f").params.messages.at(-1));if(c)gt(this,bm,"f").params.messages.push(c);else if(!gt(this,yne,"f"))break}}finally{r&&r.abort()}}if(!gt(this,rI,"f"))throw new Ii("ToolRunner concluded without a message from the server");gt(this,K$,"f").resolve(await gt(this,rI,"f"))}catch(r){throw mn(this,nEe,!1,"f"),gt(this,K$,"f").promise.catch(()=>{}),gt(this,K$,"f").reject(r),mn(this,K$,eHi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,bm,"f").params=e(gt(this,bm,"f").params):gt(this,bm,"f").params=e,mn(this,yne,!0,"f"),mn(this,z6,void 0,"f")}setRequestOptions(e){typeof e=="function"?mn(this,a1,e(gt(this,a1,"f")),"f"):mn(this,a1,{...gt(this,a1,"f"),...e},"f")}async generateToolResponse(e=gt(this,a1,"f").signal){let r=await gt(this,rI,"f")??this.params.messages.at(-1);return r?gt(this,xLe,"m",eBr).call(this,r,e):null}done(){return gt(this,K$,"f").promise}async runUntilDone(){if(!gt(this,nEe,"f"))for await(let e of this);return this.done()}get params(){return gt(this,bm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};eBr=a(async function(t,e=gt(this,a1,"f").signal){return gt(this,z6,"f")!==void 0?gt(this,z6,"f"):(mn(this,z6,SOc(gt(this,bm,"f").params,t,{...gt(this,a1,"f"),signal:e}),"f"),gt(this,z6,"f"))},"iG");a(SOc,"Fv");tHi={"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"},TOc=["claude-mythos-preview","claude-opus-4-6"],Dne=class extends Ad{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new aSt(this._client)}create(e,r){let n=rHi(e),{betas:o,...s}=n;s.model in tHi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${tHi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),TOc.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=U$i[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=F$i(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=>q$i(n,e,{logger:this._client.logger??console}))}stream(e,r){return X4r.createMessage(this,e,r)}countTokens(e,r){let n=rHi(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 lSt(this._client,e,r)}};a(rHi,"Aw");Dne.Batches=aSt;Dne.BetaToolRunner=lSt;Dne.ToolError=cSt;uSt=class extends Ad{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/sessions/${e}/events?beta=true`,jE,{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(Gn`/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(Gn`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},dSt=class extends Ad{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(Gn`/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(Gn`/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(Gn`/v1/sessions/${e}/resources?beta=true`,jE,{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(Gn`/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(Gn`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},CEe=class extends Ad{static{a(this,"G0")}constructor(){super(...arguments),this.events=new uSt(this._client),this.resources=new dSt(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(Gn`/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(Gn`/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",jE,{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(Gn`/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(Gn`/v1/sessions/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};CEe.Events=uSt;CEe.Resources=dSt;fSt=class extends Ad{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(Gn`/v1/skills/${e}/versions?beta=true`,bLr({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(Gn`/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(Gn`/v1/skills/${e}/versions?beta=true`,jE,{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(Gn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},r3e=class extends Ad{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new fSt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",bLr({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(Gn`/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",jE,{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(Gn`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};r3e.Versions=fSt;pSt=class extends Ad{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/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(Gn`/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(Gn`/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(Gn`/v1/vaults/${e}/credentials?beta=true`,jE,{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(Gn`/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(Gn`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},n3e=class extends Ad{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new pSt(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(Gn`/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(Gn`/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",jE,{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(Gn`/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(Gn`/v1/vaults/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};n3e.Credentials=pSt;l1=class extends Ad{static{a(this,"G6")}constructor(){super(...arguments),this.models=new tSt(this._client),this.messages=new Dne(this._client),this.agents=new t3e(this._client),this.environments=new X1t(this._client),this.sessions=new CEe(this._client),this.vaults=new n3e(this._client),this.memoryStores=new vEe(this._client),this.files=new eSt(this._client),this.skills=new r3e(this._client),this.userProfiles=new rSt(this._client)}};l1.Models=tSt;l1.Messages=Dne;l1.Agents=t3e;l1.Environments=X1t;l1.Sessions=CEe;l1.Vaults=n3e;l1.MemoryStores=vEe;l1.Files=eSt;l1.Skills=r3e;l1.UserProfiles=rSt;hSt=class extends Ad{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(H$i,"Iw");a(nHi,"nG");a(G$i,"rG");a(IOc,"bv");sHi="__json_buf";a(aHi,"bw");tBr=class t{static{a(this,"CQ")}constructor(e,r){MR.add(this),this.messages=[],this.receivedMessages=[],J$.set(this,void 0),iEe.set(this,null),this.controller=new AbortController,RLe.set(this,void 0),b1t.set(this,()=>{}),PLe.set(this,()=>{}),kLe.set(this,void 0),S1t.set(this,()=>{}),DLe.set(this,()=>{}),G6.set(this,{}),NLe.set(this,!1),T1t.set(this,!1),I1t.set(this,!1),Ene.set(this,!1),x1t.set(this,void 0),w1t.set(this,void 0),MLe.set(this,void 0),A4r.set(this,n=>{if(mn(this,T1t,!0,"f"),e3e(n)&&(n=new sI),n instanceof sI)return mn(this,I1t,!0,"f"),this._emit("abort",n);if(n instanceof Ii)return this._emit("error",n);if(n instanceof Error){let o=new Ii(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ii(String(n)))}),mn(this,RLe,new Promise((n,o)=>{mn(this,b1t,n,"f"),mn(this,PLe,o,"f")}),"f"),mn(this,kLe,new Promise((n,o)=>{mn(this,S1t,n,"f"),mn(this,DLe,o,"f")}),"f"),gt(this,RLe,"f").catch(()=>{}),gt(this,kLe,"f").catch(()=>{}),mn(this,iEe,e,"f"),mn(this,MLe,r?.logger??console,"f")}get response(){return gt(this,x1t,"f")}get request_id(){return gt(this,w1t,"f")}async withResponse(){mn(this,Ene,!0,"f");let e=await gt(this,RLe,"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 mn(s,iEe,{...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,A4r,"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,MR,"m",y4r).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,MR,"m",E4r).call(this,u);if(l.controller.signal?.aborted)throw new sI;gt(this,MR,"m",_4r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(mn(this,x1t,e,"f"),mn(this,w1t,e?.headers.get("request-id"),"f"),gt(this,b1t,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,NLe,"f")}get errored(){return gt(this,T1t,"f")}get aborted(){return gt(this,I1t,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,G6,"f")[e]||(gt(this,G6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,G6,"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,G6,"f")[e]||(gt(this,G6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{mn(this,Ene,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){mn(this,Ene,!0,"f"),await gt(this,kLe,"f")}get currentMessage(){return gt(this,J$,"f")}async finalMessage(){return await this.done(),gt(this,MR,"m",g4r).call(this)}async finalText(){return await this.done(),gt(this,MR,"m",iHi).call(this)}_emit(e,...r){if(gt(this,NLe,"f"))return;e==="end"&&(mn(this,NLe,!0,"f"),gt(this,S1t,"f").call(this));let n=gt(this,G6,"f")[e];if(n&&(gt(this,G6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Ene,"f")&&!n?.length&&Promise.reject(o),gt(this,PLe,"f").call(this,o),gt(this,DLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Ene,"f")&&!n?.length&&Promise.reject(o),gt(this,PLe,"f").call(this,o),gt(this,DLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,MR,"m",g4r).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,MR,"m",y4r).call(this),this._connected(null);let s=Pne.fromReadableStream(e,this.controller);for await(let c of s)gt(this,MR,"m",E4r).call(this,c);if(s.controller.signal?.aborted)throw new sI;gt(this,MR,"m",_4r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(J$=new WeakMap,iEe=new WeakMap,RLe=new WeakMap,b1t=new WeakMap,PLe=new WeakMap,kLe=new WeakMap,S1t=new WeakMap,DLe=new WeakMap,G6=new WeakMap,NLe=new WeakMap,T1t=new WeakMap,I1t=new WeakMap,Ene=new WeakMap,x1t=new WeakMap,w1t=new WeakMap,MLe=new WeakMap,A4r=new WeakMap,MR=new WeakSet,g4r=a(function(){if(this.receivedMessages.length===0)throw new Ii("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),iHi=a(function(){if(this.receivedMessages.length===0)throw new Ii("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 Ii("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),y4r=a(function(){this.ended||mn(this,J$,void 0,"f")},"aG"),E4r=a(function(e){if(this.ended)return;let r=gt(this,MR,"m",oHi).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":{aHi(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(nHi(r,gt(this,iEe,"f"),{logger:gt(this,MLe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{mn(this,J$,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),_4r=a(function(){if(this.ended)throw new Ii("stream has ended, this shouldn't happen");let e=gt(this,J$,"f");if(!e)throw new Ii("request ended without sending any chunks");return mn(this,J$,void 0,"f"),nHi(e,gt(this,iEe,"f"),{logger:gt(this,MLe,"f")})},"eG"),oHi=a(function(e){let r=gt(this,J$,"f");if(e.type==="message_start"){if(r)throw new Ii(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ii(`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&&aHi(n)){let o=n[sHi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,sHi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=j$i(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 Pne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},mSt=class extends Ad{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(Gn`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",kne,{query:e,...r})}delete(e,r){return this._client.delete(Gn`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(Gn`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new Ii(`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)=>sSt.fromResponse(s.response,s.controller))}},i3e=class extends Ad{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new mSt(this._client)}create(e,r){e.model in cHi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${cHi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),xOc.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=U$i[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=F$i(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=>G$i(n,e,{logger:this._client.logger??console}))}stream(e,r){return tBr.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},cHi={"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"},xOc=["claude-mythos-preview","claude-opus-4-6"];i3e.Batches=mSt;gSt=class extends Ad{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/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",kne,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},wOc="\\n\\nHuman:",ROc="\\n\\nAssistant:",Sp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=Vl("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(rBr.add(this),this._requestAuthFlags=new WeakMap,B1t.set(this,void 0),r===void 0&&(r=o.profile!=null?null:Vl("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:Vl("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&&RMc())throw new Ii(`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??w3r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=fGi(s.logLevel,"ClientOptions.logLevel",this)??fGi(Yl("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??BBc(),gn(this,ySt,FBc,"f");let l=Yl("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=ZVi(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=>{Ug(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{Ug(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new ZBr(e,r=>{Ug(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 rLc(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 xi(`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,hr([{Authorization:`Bearer ${r}`}])}return hr([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return hr([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return hr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return UBc(e)}getUserAgent(){return`${this.constructor.name}/JS ${_V}`}defaultIdempotencyKey(){return`stainless-node-retry-${QVi()}`}makeStatusError(e,r,n,o){return FC.generate(e,r,n,o)}buildURL(e,r,n){let o=!ft(this,sLr,"m",hWi).call(this)&&n||this.baseURL,s=wBc(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!iGi(c)||!iGi(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 xi("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(PSt)||o.append("anthropic-beta",PSt),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 NSt(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(Ug(this).debug(`[${d}] sending request`,Fne({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new fI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(YBr),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new fI;let v=x3e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return Ug(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),Ug(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,Fne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw Ug(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),Ug(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Fne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new vSt:new HEe({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 LBc(g.body),Ug(this).info(`${E} - ${R}`),Ug(this).debug(`[${d}] response error (${R})`,Fne({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";Ug(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>YBr(R).message),T=qVi(b),w=T?void 0:b;throw Ug(this).debug(`[${d}] response error (${v})`,Fne({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 Ug(this).info(E),Ug(this).debug(`[${d}] response start`,Fne({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 eLr(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 PBc(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 xi("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&&kBc("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=hr([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))}:{},...v3r(),...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=hr([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:HVi(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)}:ft(this,ySt,"f").call(this,{body:e,headers:n})}};w3r=bp,ySt=new WeakMap,sLr=new WeakSet,hWi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");bp.Anthropic=w3r;bp.HUMAN_PROMPT=PLc;bp.AI_PROMPT=DLc;bp.DEFAULT_TIMEOUT=6e5;bp.AnthropicError=xi;bp.APIError=FC;bp.APIConnectionError=HEe;bp.APIConnectionTimeoutError=vSt;bp.APIUserAbortError=fI;bp.NotFoundError=ISt;bp.ConflictError=xSt;bp.RateLimitError=RSt;bp.BadRequestError=bSt;bp.AuthenticationError=SSt;bp.InternalServerError=kSt;bp.PermissionDeniedError=TSt;bp.UnprocessableEntityError=wSt;bp.toFile=gLc;VEe=class extends bp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new KSt(this),this.messages=new P3e(this),this.models=new ZSt(this),this.beta=new A1(this)}};VEe.Completions=KSt;VEe.Messages=P3e;VEe.Models=ZSt;VEe.Beta=A1;a(nFe,"j4");a(ESt,"N8");a(pI,"o$");a(iFe,"D1");a(mWi,"JU");a(NLc,"Tw");MLc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),OLc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(BLc,"xw");cLr=class{static{a(this,"gw")}read(e){return(0,Qg.readFile)(e,"utf8")}readBytes(e){return(0,Qg.readFile)(e)}write(e,r,n){return(0,Qg.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,Qg.mkdir)(e,{recursive:!0})}catch(r){if(pI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return BLc(e,r,n)}delete(e){return(0,Qg.unlink)(e)}list(e){return(0,Qg.readdir)(e)}append(e,r,n){return(0,Qg.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,Qg.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,Qg.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,Qg.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,Qg.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},LLc=new AWi.AsyncLocalStorage;a(XSt,"w8");wEe=null;a(EWi,"uw");a(FLc,"mw");a(jR,"L6");a(ULc,"dv");QLc=ULc;a(qLc,"iv");jLc=qLc;a(HLc,"nv");GLc=HLc;a($Lc,"rv");VLc=$Lc,WLc=200;a(zLc,"tv");YLc=zLc;a(A_e,"D8");A_e.prototype.clear=QLc;A_e.prototype.delete=jLc;A_e.prototype.get=GLc;A_e.prototype.has=VLc;A_e.prototype.set=YLc;KLc=A_e,JLc=(function(){try{var t=E3r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),eTt=JLc;a(ZLc,"sv");R3r=ZLc,XLc=Object.prototype,e3c=XLc.hasOwnProperty;a(t3c,"QC");_Wi=t3c;a(r3c,"JC");n3c=r3c;a(i3c,"XC");o3c=i3c;a(s3c,"YC");y_e=s3c,a3c="[object Arguments]";a(c3c,"GC");DGi=c3c,CWi=Object.prototype,l3c=CWi.hasOwnProperty,u3c=CWi.propertyIsEnumerable,d3c=DGi((function(){return arguments})())?DGi:function(t){return y_e(t)&&l3c.call(t,"callee")&&!u3c.call(t,"callee")},D3e=d3c,f3c=Array.isArray,IV=f3c,m3e={};pB(m3e,{default:a(()=>k3r,"default")});a(p3c,"VC");h3c=p3c,vWi=typeof m3e=="object"&&m3e&&!m3e.nodeType&&m3e,NGi=vWi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,m3c=NGi&&NGi.exports===vWi,MGi=m3c?f_e.Buffer:void 0,g3c=MGi?MGi.isBuffer:void 0,A3c=g3c||h3c,k3r=A3c,y3c=9007199254740991,E3c=/^(?:0|[1-9]\d*)$/;a(_3c,"DC");XTt=_3c,C3c=9007199254740991;a(v3c,"ZC");P3r=v3c,b3c="[object Arguments]",S3c="[object Array]",T3c="[object Boolean]",I3c="[object Date]",x3c="[object Error]",w3c="[object Function]",R3c="[object Map]",k3c="[object Number]",P3c="[object Object]",D3c="[object RegExp]",N3c="[object Set]",M3c="[object String]",O3c="[object WeakMap]",B3c="[object ArrayBuffer]",L3c="[object DataView]",F3c="[object Float32Array]",U3c="[object Float64Array]",Q3c="[object Int8Array]",q3c="[object Int16Array]",j3c="[object Int32Array]",H3c="[object Uint8Array]",G3c="[object Uint8ClampedArray]",$3c="[object Uint16Array]",V3c="[object Uint32Array]",md={};md[F3c]=md[U3c]=md[Q3c]=md[q3c]=md[j3c]=md[H3c]=md[G3c]=md[$3c]=md[V3c]=!0;md[b3c]=md[S3c]=md[B3c]=md[T3c]=md[L3c]=md[I3c]=md[x3c]=md[w3c]=md[R3c]=md[k3c]=md[P3c]=md[D3c]=md[N3c]=md[M3c]=md[O3c]=!1;a(W3c,"pC");z3c=W3c;a(Y3c,"dC");K3c=Y3c,g3e={};pB(g3e,{default:a(()=>lLr,"default")});bWi=typeof g3e=="object"&&g3e&&!g3e.nodeType&&g3e,b3e=bWi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,J3c=b3e&&b3e.exports===bWi,TBr=J3c&&OVi.process,Z3c=(function(){try{var t=b3e&&b3e.require&&b3e.require("util").types;return t||TBr&&TBr.binding&&TBr.binding("util")}catch{}})(),lLr=Z3c,OGi=lLr&&lLr.isTypedArray,X3c=OGi?K3c(OGi):z3c,SWi=X3c,eFc=Object.prototype,tFc=eFc.hasOwnProperty;a(rFc,"aC");nFc=rFc,iFc=Object.prototype;a(oFc,"eC");TWi=oFc;a(sFc,"$T");aFc=sFc;a(cFc,"QT");D3r=cFc;a(lFc,"JT");uFc=lFc,dFc=Object.prototype,fFc=dFc.hasOwnProperty;a(pFc,"WT");hFc=pFc;a(mFc,"GT");IWi=mFc,A3e={};pB(A3e,{default:a(()=>wWi,"default")});xWi=typeof A3e=="object"&&A3e&&!A3e.nodeType&&A3e,BGi=xWi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,gFc=BGi&&BGi.exports===xWi,LGi=gFc?f_e.Buffer:void 0,FGi=LGi?LGi.allocUnsafe:void 0;a(AFc,"HT");wWi=AFc;a(yFc,"KT");EFc=yFc;a(_Fc,"qT");CFc=_Fc,vFc=aFc(Object.getPrototypeOf,Object),RWi=vFc,bFc=f_e.Uint8Array,UGi=bFc;a(SFc,"zT");TFc=SFc;a(IFc,"NT");xFc=IFc,QGi=Object.create,wFc=(function(){function t(){}return a(t,"$"),function(e){if(!p9(e))return{};if(QGi)return QGi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),RFc=wFc;a(kFc,"OT");PFc=kFc,DFc="[object Symbol]";a(NFc,"FT");N3r=NFc,MFc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OFc=/^\w*$/;a(BFc,"LT");LFc=BFc,FFc=500;a(UFc,"AT");QFc=UFc,qFc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jFc=/\\(\\)?/g,HFc=QFc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(qFc,function(r,n,o,s){e.push(o?s.replace(jFc,"$1"):n||r)}),e}),GFc=HFc;a($Fc,"ET");VFc=$Fc,WFc=1/0,qGi=TV?TV.prototype:void 0,jGi=qGi?qGi.toString:void 0;a(kWi,"PO");zFc=kWi;a(YFc,"_T");KFc=YFc;a(JFc,"kT");eIt=JFc,ZFc=1/0;a(XFc,"vT");M3r=XFc;a(e8c,"CT");t8c=e8c;a(r8c,"TT");n8c=r8c;a(i8c,"xT");o8c=i8c;a(s8c,"yT");a8c=s8c;a(c8c,"fT");PWi=c8c,O3r=null;a(l8c,"CO");a(u8c,"TO");rTt=new Map;a(d8c,"xO");a(f8c,"yO");B3r=new Map;a(h8c,"fO");a(m8c,"gO");a(L3r,"V0");a(A8c,"hO");a(y8c,"uO");E8c={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(_8c,"lT");C8c=_8c(),v8c=a(()=>{},"pT");a(NWi,"VU");b8c=tFe(),$4h=b8c.subscribe,S8c=tFe(),V4h=S8c.subscribe,T8c=tFe(),W4h=T8c.subscribe,I8c=tFe(),z4h=I8c.subscribe,x8c=tFe(),Y4h=x8c.subscribe;a(w8c,"lO");a(R8c,"tT");dLr=class{static{a(this,"cO")}#e=new Set;register(e){let r=R8c(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}},k8c=new dLr;a(P8c,"pO");D8c=uy(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(N8c,"sT");a(M8c,"eT");a(O8c,"iO");a(B8c,"tO");a(L8c,"Qx");a(HGi,"oO");a(F8c,"aO");a(OWi,"HX");U8c={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=Vd(e,zd`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},async stat(t){return(0,xm.stat)(t)},async readdir(t){return(0,xm.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,xm.unlink)(t)},async rmdir(t){return(0,xm.rmdir)(t)},async rm(t,e){return(0,xm.rm)(t,e)},async mkdir(t,e){try{await(0,xm.mkdir)(t,{recursive:!0,...e})}catch(r){if(pI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,xm.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,xm.rename)(t,e)},statSync(t){let e=[];try{let o=Vd(e,zd`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},lstatSync(t){let e=[];try{let o=Vd(e,zd`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},readFileSync(t,e){let r=[];try{let s=Vd(r,zd`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=Vd(e,zd`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},readSync(t,e){let r=[];try{let s=Vd(r,zd`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{Wd(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=Vd(n,zd`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{Wd(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=Vd(r,zd`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},unlinkSync(t){let e=[];try{let o=Vd(e,zd`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},renameSync(t,e){let r=[];try{let s=Vd(r,zd`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},linkSync(t,e){let r=[];try{let s=Vd(r,zd`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=Vd(n,zd`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{Wd(n,o,s)}},readlinkSync(t){let e=[];try{let o=Vd(e,zd`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},realpathSync(t){let e=[];try{let o=Vd(e,zd`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=Vd(r,zd`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{Wd(r,n,o)}},readdirSync(t){let e=[];try{let o=Vd(e,zd`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},readdirStringSync(t){let e=[];try{let o=Vd(e,zd`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=Vd(e,zd`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},rmdirSync(t){let e=[];try{let o=Vd(e,zd`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},rmSync(t,e){let r=[];try{let s=Vd(r,zd`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,xm.readFile)(t);let r=await(0,xm.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(${W8c}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"}],VGi=null;a(Y8c,"Ox");a(K8c,"W2");fLr={verbose:0,debug:1,info:2,warn:3,error:4},J8c=uy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(fLr,t)?t:"debug"}),Z8c=!1;a(tIt,"qX");pLr=uy(()=>{let t=tIt();return Z8c||HE(process.env.DEBUG)||HE(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||BWi()||t.some(e=>e.startsWith("--debug="))||LWi()!==null}),X8c=uy(()=>{let t=tIt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return D8c(e)}),BWi=uy(()=>{let t=tIt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),LWi=uy(()=>{let t=tIt();for(let e=0;e{try{let t=QWi(),e=(0,eie.dirname)(t),r=(0,eie.join)(e,"latest");await(0,VE.unlink)(r).catch(()=>{}),await(0,VE.symlink)(t,r)}catch{}}),Z4h=(()=>{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})(),o6c={[Symbol.dispose](){}};a(s6c,"_x");zd=s6c;a(I0,"B$");hN=a((t,e)=>{let r=[];try{let s=Vd(r,zd`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},"d$");a(a6c,"w2");a(xV,"A4");a(c6c,"kx");a(l6c,"O2");u6c=2e3,nTt=new Set,WGi=!1;a(d6c,"xx");a(f6c,"yx");gLr=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=WBr();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||WBr(),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(nFe(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 MVi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=HE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,kVi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(HE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();jR(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:k=[],tools:D,mcpServers:N,strictMcpConfig:L,canUseTool:B,includePartialMessages:Q,plugins:M,sandbox:O}=this.options,{allowedTools:q=[]}=this.options;if(x!==void 0){let j=x==="all"?["Skill"]:x.map(ie=>`Skill(${ie})`),X=new Set(q);q=[...q,...j.filter(ie=>!X.has(ie))]}let F=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?F.push("--thinking","adaptive"):F.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":F.push("--thinking","disabled");break;case"adaptive":F.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&F.push("--thinking-display",f.display)}if(this.options.effort&&F.push("--effort",this.options.effort),h&&F.push("--max-turns",h.toString()),m!==void 0&&F.push("--max-budget-usd",m.toString()),g&&F.push("--task-budget",g.total.toString()),A&&F.push("--model",A),r&&F.push("--agent",r),n&&n.length>0&&F.push("--betas",n.join(",")),E&&F.push("--json-schema",I0(E)),this.options.debugFile?F.push("--debug-file",this.options.debugFile):this.options.debug&&F.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let j=FLc();j&&F.push("--debug-file",j)}if(B){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");F.push("--permission-prompt-tool","stdio")}else b&&F.push("--permission-prompt-tool",b);if(T&&F.push("--continue"),w&&F.push("--resume",w),this.options.assistant&&F.push("--assistant"),this.options.channels&&this.options.channels.length>0&&F.push("--channels",...this.options.channels),q.length>0&&F.push("--allowedTools",q.join(",")),k.length>0&&F.push("--disallowedTools",k.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?F.push("--tools",""):F.push("--tools",D.join(",")):F.push("--tools","default")),N&&Object.keys(N).length>0&&F.push("--mcp-config",I0({mcpServers:N})),R!==void 0&&F.push(`--setting-sources=${R.join(",")}`),L&&F.push("--strict-mcp-config"),_&&F.push("--permission-mode",_),v&&F.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.");F.push("--fallback-model",y)}this.options.includeHookEvents&&F.push("--include-hook-events"),Q&&F.push("--include-partial-messages"),this.options.sessionMirror&&F.push("--session-mirror");for(let j of e)F.push("--add-dir",j);if(M&&M.length>0)for(let j of M)if(j.type==="local")F.push("--plugin-dir",j.path);else throw Error(`Unsupported plugin type: ${j.type}`);this.options.forkSession&&F.push("--fork-session"),this.options.resumeSessionAt&&F.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&F.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&F.push("--no-session-persistence"),this.options.managedSettings&&F.push("--managed-settings",this.options.managedSettings);let U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let W=l6c(U,O);for(let[j,X]of Object.entries(W))X===null?F.push(`--${j}`):F.push(`--${j}`,X);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,HE(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let V=p6c(u),G=V?u:s,Y=V?[...c,...F]:[...c,u,...F],re={command:G,args:Y,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(jR(`Spawning Claude Code (custom): ${G} ${Y.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(re)):(jR(`Spawning Claude Code: ${G} ${Y.join(" ")}`),this.process=this.spawnLocalProcess(re)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,f6c(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close(),this.process.on("error",j=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new g1("Claude Code process aborted by user");else if(NLc(j)){let X=h6c(u,V);this.exitError=ReferenceError(X),jR(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${j.message}`),jR(this.exitError.message)}),this.process.on("exit",(j,X)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new g1("Claude Code process aborted by user");else{let ie=this.getProcessExitError(j,X);ie&&(this.exitError=ie,jR(ie.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 g1("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){jR("[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}`);jR(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||jR("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${ESt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new g1("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()},u6c,r,e).unref(),r.once("exit",()=>nTt.delete(r))):r&&(nTt.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,DVi.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=hN(n)}catch{jR(`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 g1("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(p6c,"fx");a(h6c,"gx");REe="@anthropic-ai/claude-agent-sdk";a(m6c,"ux");a(g6c,"F2");iTt=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(A6c,"mx");y6c=A6c();a(F3r,"BX");a(HWi,"AU");a(GWi,"IU");a(E6c,"Z2");a(s9,"I4");ALr=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?.())}},yLr=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new iTt;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,tTt.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&&(Kl("[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 g1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);Kl(`[Query.readMessages] Replacing exit error with result text. Original: ${ESt(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(I0(o)+` -`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:ESt(n)}};try{await Promise.resolve(this.transport.write(I0(o)+` -`))}catch(s){Kl(`[Query.handleControlRequest] Error-response write failed: ${ESt(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 s9("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 s9("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 s9("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 s9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return s9("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(I0(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 s9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return s9("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 s9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return s9("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){Kl("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,Kl(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(I0(n)+` -`))}Kl(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(Kl("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),Kl("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof g1))throw r}}waitForFirstResult(){return this.firstResultReceived?(Kl("[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 ALr(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),Kl(`[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,tTt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(I0(n)+` -`)).catch(o=>{Kl(`[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}})}},U3r=500,Q3r=1048576,_6c=[200,800],ELr=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=U3r,s=Q3r,c=_6c){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=I0(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 Qne(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=nFe(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await RVi(f)}if(l){Kl(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){Kl(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},zGi=l3r(jOc(),1);a(C6c,"Ug");a(S3e,"O0");a(v6c,"qg");wBr=new Map,b6c=5e3;a(S6c,"Bg");a(T6c,"zg");a(I6c,"OZ");x6c=(0,zWi.promisify)(WWi.execFile);a(oFe,"m4");a(w6c,"jH");u9=65536,R6c=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(uh,"L$");a(JWi,"ZZ");a(RBr,"IX");a(HR,"A6");a(CLr,"rQ");a(ZWi,"RX");a(k6c,"MZ");a(XWi,"PX");N3e=200;a(P6c,"Lg");a(sFe,"F0");a(PV,"U4");a(D6c,"jg");a(aFe,"M1");a(aN,"j6");a(rIt,"L1");N6c=1048576,M6c=5242880;a(B6c,"Rg");a(ezi,"jZ");a(Hne,"D0");a(oTt,"jX");sTt=Buffer.from('{"type":"attribution-snapshot"'),L6c=Buffer.from('{"type":"system"'),M3e=10,F6c=Buffer.from([M3e]),U6c=256;a(Q6c,"_g");a(q6c,"kg");a(j6c,"Sg");a(H6c,"vg");a(G6c,"Cg");a($6c,"AZ");a(V6c,"xg");a(W6c,"yg");a(z6c,"fg");a(kBr,"IH");a(Y6c,"gg");a(K6c,"hg");a(J6c,"ug");a(tzi,"RH");a(rzi,"PH");a(Z6c,"IZ");a(nzi,"RZ");a(X6c,"PZ");a(nIt,"k8");a(y3e,"oQ");a(izi,"EZ");e9c=32;a(t9c,"pg");a(r9c,"dg");a(n9c,"ig");a(i9c,"ng");a(o9c,"rg");a(s9c,"bZ");a(a9c,"_Z");a(c9c,"CZ");a(l9c,"TZ");a(u9c,"xZ");a(d9c,"ag");a(ozi,"yZ");a(PBr,"_H");a(f9c,"sg");p9c=new Set(["user","assistant","attachment","system","progress"]);a(h9c,"$h");a(m9c,"Qh");a(szi,"fZ");a(g9c,"gZ");a(A9c,"Jh");a(y9c,"hZ");a(E9c,"Xh");a(azi,"uZ");a(czi,"lZ");a(lzi,"cZ");a(_9c,"Wh");a(C9c,"Gh");a(v9c,"pZ");a(b9c,"dZ");a(uzi,"vH");a(pzi,"CH");a(hzi,"bX");a(S9c,"Uh");T9c="user:inference",mzi="user:profile",I9c="org:create_api_key",x9c=[I9c,mzi],w9c=[mzi,T9c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],eBh=hzi([...x9c,...w9c]),YGi={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}"},R9c=void 0;a(k9c,"zh");P9c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(D9c,"rZ");N9c="-credentials";a(M9c,"tZ");O9c=/^[a-zA-Z0-9._-]+$/;a(B9c,"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})(lc||(lc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(KGi||(KGi={}));Rn=lc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),yV=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"),pr=lc.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"]),WR=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()}};WR.create=t=>new WR(t);L9c=a((t,e)=>{let r;switch(t.code){case pr.invalid_type:t.received===Rn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case pr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,lc.jsonStringifyReplacer)}`;break;case pr.unrecognized_keys:r=`Unrecognized key(s) in object: ${lc.joinValues(t.keys,", ")}`;break;case pr.invalid_union:r="Invalid input";break;case pr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${lc.joinValues(t.options)}`;break;case pr.invalid_enum_value:r=`Invalid enum value. Expected ${lc.joinValues(t.options)}, received '${t.received}'`;break;case pr.invalid_arguments:r="Invalid function arguments";break;case pr.invalid_return_type:r="Invalid function return type";break;case pr.invalid_date:r="Invalid date";break;case pr.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}"`:lc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case pr.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 pr.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 pr.custom:r="Invalid input";break;case pr.invalid_intersection_types:r="Intersection results could not be merged";break;case pr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case pr.not_finite:r="Number must be finite";break;default:r=e.defaultError,lc.assertNever(t)}return{message:r}},"Fh"),B3e=L9c,F9c=B3e;a(bLr,"tQ");SLr=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");UC=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 to;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 to;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}}},to=Object.freeze({status:"aborted"}),_3e=a(t=>({status:"dirty",value:t}),"v8"),y1=a(t=>({status:"valid",value:t}),"z6"),JGi=a(t=>t.status==="aborted","TH"),ZGi=a(t=>t.status==="dirty","xH"),zEe=a(t=>t.status==="valid","Z0"),lTt=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={}));YR=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}},XGi=a((t,e)=>{if(zEe(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 WR(t.common.issues);return this._error=r,this._error}}},"eZ");a(Yo,"e");ks=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return yV(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:yV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new UC,ctx:{common:e.parent.common,data:e.data,parsedType:yV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(lTt(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:yV(e)},o=this._parseSync({data:e,path:n.path,parent:n});return XGi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yV(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return zEe(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=>zEe(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:yV(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(lTt(o)?o:Promise.resolve(o));return XGi(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:pr.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 uN({schema:this,typeName:vr.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 zR.create(this,this._def)}nullable(){return m9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wV.create(this)}promise(){return Kne.create(this,this._def)}or(e){return ZEe.create([this,e],this._def)}and(e){return XEe.create(this,e,this._def)}transform(e){return new uN({...Yo(this._def),schema:this,typeName:vr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new i_e({...Yo(this._def),innerType:this,defaultValue:r,typeName:vr.ZodDefault})}brand(){return new uTt({typeName:vr.ZodBranded,type:this,...Yo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new o_e({...Yo(this._def),innerType:this,catchValue:r,typeName:vr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return dTt.create(this,e)}readonly(){return s_e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},U9c=/^c[^\s-]{8,}$/i,Q9c=/^[0-9a-z]+$/,q9c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j9c=/^[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,H9c=/^[a-z0-9_-]{21}$/i,G9c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$9c=/^[-+]?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)?)??$/,V9c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W9c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",z9c=/^(?:(?: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])$/,Y9c=/^(?:(?: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])$/,K9c=/^(([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]))$/,J9c=/^(([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])$/,Z9c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,X9c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gzi="((\\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])))",eUc=new RegExp(`^${gzi}$`);a(Azi,"QM");a(tUc,"yh");a(rUc,"fh");a(nUc,"gh");a(iUc,"hh");a(oUc,"uh");YEe=class t extends ks{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 ln(o,{code:pr.invalid_type,expected:Rn.string,received:o.parsedType}),to}let r=new UC,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:pr.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:pr.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 YEe({checks:[],typeName:vr.ZodString,coerce:t?.coerce??!1,...Yo(t)});a(sUc,"mh");L3e=class t extends ks{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 ln(o,{code:pr.invalid_type,expected:Rn.number,received:o.parsedType}),to}let r,n=new UC;for(let o of this._def.checks)o.kind==="int"?lc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.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:pr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?sUc(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.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:pr.not_finite,message:o.message}),n.dirty()):lc.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"&&lc.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 L3e({checks:[],typeName:vr.ZodNumber,coerce:t?.coerce||!1,...Yo(t)});F3e=class t extends ks{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 UC;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:pr.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:pr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):lc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.bigint,received:r.parsedType}),to}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 F3e({checks:[],typeName:vr.ZodBigInt,coerce:t?.coerce??!1,...Yo(t)});U3e=class extends ks{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 ln(r,{code:pr.invalid_type,expected:Rn.boolean,received:r.parsedType}),to}return y1(e.data)}};U3e.create=t=>new U3e({typeName:vr.ZodBoolean,coerce:t?.coerce||!1,...Yo(t)});Q3e=class t extends ks{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 ln(o,{code:pr.invalid_type,expected:Rn.date,received:o.parsedType}),to}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ln(o,{code:pr.invalid_date}),to}let r=new UC,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:pr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):lc.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 Q3e({checks:[],coerce:t?.coerce||!1,typeName:vr.ZodDate,...Yo(t)});q3e=class extends ks{static{a(this,"SX")}_parse(e){if(this._getType(e)!==Rn.symbol){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.symbol,received:r.parsedType}),to}return y1(e.data)}};q3e.create=t=>new q3e({typeName:vr.ZodSymbol,...Yo(t)});KEe=class extends ks{static{a(this,"$7")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.undefined,received:r.parsedType}),to}return y1(e.data)}};KEe.create=t=>new KEe({typeName:vr.ZodUndefined,...Yo(t)});JEe=class extends ks{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==Rn.null){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.null,received:r.parsedType}),to}return y1(e.data)}};JEe.create=t=>new JEe({typeName:vr.ZodNull,...Yo(t)});j3e=class extends ks{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return y1(e.data)}};j3e.create=t=>new j3e({typeName:vr.ZodAny,...Yo(t)});SV=class extends ks{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return y1(e.data)}};SV.create=t=>new SV({typeName:vr.ZodUnknown,...Yo(t)});dB=class extends ks{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.never,received:r.parsedType}),to}};dB.create=t=>new dB({typeName:vr.ZodNever,...Yo(t)});H3e=class extends ks{static{a(this,"CX")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.void,received:r.parsedType}),to}return y1(e.data)}};H3e.create=t=>new H3e({typeName:vr.ZodVoid,...Yo(t)});wV=class t extends ks{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==Rn.array)return ln(r,{code:pr.invalid_type,expected:Rn.array,received:r.parsedType}),to;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(ln(r,{code:pr.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 YR(r,c,r.path,l)))).then(c=>UC.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new YR(r,c,r.path,l)));return UC.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)}};wV.create=(t,e)=>new wV({type:t,minLength:null,maxLength:null,exactLength:null,typeName:vr.ZodArray,...Yo(e)});a(NEe,"C8");mI=class t extends ks{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=lc.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 ln(u,{code:pr.invalid_type,expected:Rn.object,received:u.parsedType}),to}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof dB&&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 YR(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof dB){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:pr.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 YR(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=>UC.mergeObjectSync(r,u)):UC.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:vr.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 lc.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 lc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return NEe(this)}partial(e){let r={};for(let n of lc.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 lc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof zR;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return yzi(lc.objectKeys(this.shape))}};mI.create=(t,e)=>new mI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:dB.create(),typeName:vr.ZodObject,...Yo(e)});mI.strictCreate=(t,e)=>new mI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:dB.create(),typeName:vr.ZodObject,...Yo(e)});mI.lazycreate=(t,e)=>new mI({shape:t,unknownKeys:"strip",catchall:dB.create(),typeName:vr.ZodObject,...Yo(e)});ZEe=class extends ks{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 WR(l.ctx.common.issues));return ln(r,{code:pr.invalid_union,unionErrors:c}),to}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 WR(u));return ln(r,{code:pr.invalid_union,unionErrors:l}),to}}get options(){return this._def.options}};ZEe.create=(t,e)=>new ZEe({options:t,typeName:vr.ZodUnion,...Yo(e)});a9=a(t=>t instanceof e_e?a9(t.schema):t instanceof uN?a9(t.innerType()):t instanceof t_e?[t.value]:t instanceof r_e?t.options:t instanceof n_e?lc.objectValues(t.enum):t instanceof i_e?a9(t._def.innerType):t instanceof KEe?[void 0]:t instanceof JEe?[null]:t instanceof zR?[void 0,...a9(t.unwrap())]:t instanceof m9?[null,...a9(t.unwrap())]:t instanceof uTt||t instanceof s_e?a9(t.unwrap()):t instanceof o_e?a9(t._def.innerType):[],"c4"),TLr=class t extends ks{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.object)return ln(r,{code:pr.invalid_type,expected:Rn.object,received:r.parsedType}),to;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:pr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),to)}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=a9(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:vr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Yo(n)})}};a(ILr,"fH");XEe=class extends ks{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(JGi(s)||JGi(c))return to;let l=ILr(s.value,c.value);return l.valid?((ZGi(s)||ZGi(c))&&r.dirty(),{status:r.value,value:l.data}):(ln(n,{code:pr.invalid_intersection_types}),to)},"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}))}};XEe.create=(t,e,r)=>new XEe({left:t,right:e,typeName:vr.ZodIntersection,...Yo(r)});h9=class t extends ks{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.array)return ln(n,{code:pr.invalid_type,expected:Rn.array,received:n.parsedType}),to;if(n.data.lengththis._def.items.length&&(ln(n,{code:pr.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 YR(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>UC.mergeArray(r,s)):UC.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};h9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new h9({items:t,typeName:vr.ZodTuple,rest:null,...Yo(e)})};xLr=class t extends ks{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 ln(n,{code:pr.invalid_type,expected:Rn.object,received:n.parsedType}),to;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new YR(n,l,n.path,l)),value:c._parse(new YR(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?UC.mergeObjectAsync(r,o):UC.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ks?new t({keyType:e,valueType:r,typeName:vr.ZodRecord,...Yo(n)}):new t({keyType:YEe.create(),valueType:e,typeName:vr.ZodRecord,...Yo(r)})}},G3e=class extends ks{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 ln(n,{code:pr.invalid_type,expected:Rn.map,received:n.parsedType}),to;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new YR(n,l,n.path,[d,"key"])),value:s._parse(new YR(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 to;(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 to;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};G3e.create=(t,e,r)=>new G3e({valueType:e,keyType:t,typeName:vr.ZodMap,...Yo(r)});$3e=class t extends ks{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.set)return ln(n,{code:pr.invalid_type,expected:Rn.set,received:n.parsedType}),to;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ln(n,{code:pr.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 to;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 YR(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)}};$3e.create=(t,e)=>new $3e({valueType:t,minSize:null,maxSize:null,typeName:vr.ZodSet,...Yo(e)});wLr=class t extends ks{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 ln(r,{code:pr.invalid_type,expected:Rn.function,received:r.parsedType}),to;function n(l,u){return SLr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bLr(),B3e].filter(d=>!!d),issueData:{code:pr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return SLr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bLr(),B3e].filter(d=>!!d),issueData:{code:pr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Kne){let l=this;return y1(async function(...u){let d=new WR([]),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 y1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new WR([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new WR([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:h9.create(e).rest(SV.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||h9.create([]).rest(SV.create()),returns:r||SV.create(),typeName:vr.ZodFunction,...Yo(n)})}},e_e=class extends ks{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})}};e_e.create=(t,e)=>new e_e({getter:t,typeName:vr.ZodLazy,...Yo(e)});t_e=class extends ks{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ln(r,{received:r.data,code:pr.invalid_literal,expected:this._def.value}),to}return{status:"valid",value:e.data}}get value(){return this._def.value}};t_e.create=(t,e)=>new t_e({value:t,typeName:vr.ZodLiteral,...Yo(e)});a(yzi,"JM");r_e=class t extends ks{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{expected:lc.joinValues(n),received:r.parsedType,code:pr.invalid_type}),to}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:pr.invalid_enum_value,options:n}),to}return y1(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})}};r_e.create=yzi;n_e=class extends ks{static{a(this,"G7")}_parse(e){let r=lc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Rn.string&&n.parsedType!==Rn.number){let o=lc.objectValues(r);return ln(n,{expected:lc.joinValues(o),received:n.parsedType,code:pr.invalid_type}),to}if(this._cache||(this._cache=new Set(lc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=lc.objectValues(r);return ln(n,{received:n.data,code:pr.invalid_enum_value,options:o}),to}return y1(e.data)}get enum(){return this._def.values}};n_e.create=(t,e)=>new n_e({values:t,typeName:vr.ZodNativeEnum,...Yo(e)});Kne=class extends ks{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 ln(r,{code:pr.invalid_type,expected:Rn.promise,received:r.parsedType}),to;let n=r.parsedType===Rn.promise?r.data:Promise.resolve(r.data);return y1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Kne.create=(t,e)=>new Kne({type:t,typeName:vr.ZodPromise,...Yo(e)});uN=class extends ks{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vr.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 to;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?to:u.status==="dirty"||r.value==="dirty"?_3e(u.value):u});{if(r.value==="aborted")return to;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?to:l.status==="dirty"||r.value==="dirty"?_3e(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"?to:(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"?to:(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(!zEe(c))return to;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=>zEe(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):to);lc.assertNever(o)}};uN.create=(t,e,r)=>new uN({schema:t,typeName:vr.ZodEffects,effect:e,...Yo(r)});uN.createWithPreprocess=(t,e,r)=>new uN({schema:e,effect:{type:"preprocess",transform:t},typeName:vr.ZodEffects,...Yo(r)});zR=class extends ks{static{a(this,"o6")}_parse(e){return this._getType(e)===Rn.undefined?y1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zR.create=(t,e)=>new zR({innerType:t,typeName:vr.ZodOptional,...Yo(e)});m9=class extends ks{static{a(this,"A1")}_parse(e){return this._getType(e)===Rn.null?y1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};m9.create=(t,e)=>new m9({innerType:t,typeName:vr.ZodNullable,...Yo(e)});i_e=class extends ks{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}};i_e.create=(t,e)=>new i_e({innerType:t,typeName:vr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Yo(e)});o_e=class extends ks{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 lTt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new WR(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new WR(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o_e.create=(t,e)=>new o_e({innerType:t,typeName:vr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Yo(e)});V3e=class extends ks{static{a(this,"yX")}_parse(e){if(this._getType(e)!==Rn.nan){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.nan,received:r.parsedType}),to}return{status:"valid",value:e.data}}};V3e.create=t=>new V3e({typeName:vr.ZodNaN,...Yo(t)});uTt=class extends ks{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}},dTt=class t extends ks{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"?to:o.status==="dirty"?(r.dirty(),_3e(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"?to: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:vr.ZodPipeline})}},s_e=class extends ks{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(zEe(o)&&(o.value=Object.freeze(o.value)),o),"J");return lTt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};s_e.create=(t,e)=>new s_e({innerType:t,typeName:vr.ZodReadonly,...Yo(e)});tBh={object:mI.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"})(vr||(vr={}));rBh=YEe.create,nBh=L3e.create,iBh=V3e.create,oBh=F3e.create,sBh=U3e.create,aBh=Q3e.create,cBh=q3e.create,lBh=KEe.create,uBh=JEe.create,dBh=j3e.create,fBh=SV.create,pBh=dB.create,hBh=H3e.create,mBh=wV.create,aUc=mI.create,gBh=mI.strictCreate,ABh=ZEe.create,yBh=TLr.create,EBh=XEe.create,_Bh=h9.create,CBh=xLr.create,vBh=G3e.create,bBh=$3e.create,SBh=wLr.create,TBh=e_e.create,IBh=t_e.create,xBh=r_e.create,wBh=n_e.create,RBh=Kne.create,kBh=uN.create,PBh=zR.create,DBh=m9.create,NBh=uN.createWithPreprocess,MBh=dTt.create,Ezi={};pB(Ezi,{version:a(()=>kYi,"version"),util:a(()=>Hs,"util"),treeifyError:a(()=>Pzi,"treeifyError"),toJSONSchema:a(()=>VFr,"toJSONSchema"),toDotPath:a(()=>Dzi,"toDotPath"),safeParseAsync:a(()=>lIt,"safeParseAsync"),safeParse:a(()=>cIt,"safeParse"),registry:a(()=>dFr,"registry"),regexes:a(()=>J3r,"regexes"),prettifyError:a(()=>Nzi,"prettifyError"),parseAsync:a(()=>mTt,"parseAsync"),parse:a(()=>hTt,"parse"),locales:a(()=>uFr,"locales"),isValidJWT:a(()=>eKi,"isValidJWT"),isValidBase64URL:a(()=>JYi,"isValidBase64URL"),isValidBase64:a(()=>tFr,"isValidBase64"),globalRegistry:a(()=>d9,"globalRegistry"),globalConfig:a(()=>fTt,"globalConfig"),function:a(()=>vJi,"function"),formatError:a(()=>V3r,"formatError"),flattenError:a(()=>$3r,"flattenError"),config:a(()=>QC,"config"),clone:a(()=>mN,"clone"),_xid:a(()=>bFr,"_xid"),_void:a(()=>aJi,"_void"),_uuidv7:a(()=>gFr,"_uuidv7"),_uuidv6:a(()=>mFr,"_uuidv6"),_uuidv4:a(()=>hFr,"_uuidv4"),_uuid:a(()=>pFr,"_uuid"),_url:a(()=>AFr,"_url"),_uppercase:a(()=>BFr,"_uppercase"),_unknown:a(()=>ETt,"_unknown"),_union:a(()=>cQc,"_union"),_undefined:a(()=>nJi,"_undefined"),_ulid:a(()=>vFr,"_ulid"),_uint64:a(()=>tJi,"_uint64"),_uint32:a(()=>YKi,"_uint32"),_tuple:a(()=>gJi,"_tuple"),_trim:a(()=>jFr,"_trim"),_transform:a(()=>AQc,"_transform"),_toUpperCase:a(()=>GFr,"_toUpperCase"),_toLowerCase:a(()=>HFr,"_toLowerCase"),_templateLiteral:a(()=>IQc,"_templateLiteral"),_symbol:a(()=>rJi,"_symbol"),_success:a(()=>vQc,"_success"),_stringbool:a(()=>_Ji,"_stringbool"),_stringFormat:a(()=>CJi,"_stringFormat"),_string:a(()=>BKi,"_string"),_startsWith:a(()=>FFr,"_startsWith"),_size:a(()=>NFr,"_size"),_set:a(()=>pQc,"_set"),_safeParseAsync:a(()=>K3r,"_safeParseAsync"),_safeParse:a(()=>Y3r,"_safeParse"),_regex:a(()=>MFr,"_regex"),_refine:a(()=>EJi,"_refine"),_record:a(()=>dQc,"_record"),_readonly:a(()=>TQc,"_readonly"),_property:a(()=>mJi,"_property"),_promise:a(()=>wQc,"_promise"),_positive:a(()=>dJi,"_positive"),_pipe:a(()=>SQc,"_pipe"),_parseAsync:a(()=>z3r,"_parseAsync"),_parse:a(()=>W3r,"_parse"),_overwrite:a(()=>nie,"_overwrite"),_optional:a(()=>yQc,"_optional"),_number:a(()=>HKi,"_number"),_nullable:a(()=>EQc,"_nullable"),_null:a(()=>iJi,"_null"),_normalize:a(()=>qFr,"_normalize"),_nonpositive:a(()=>pJi,"_nonpositive"),_nonoptional:a(()=>CQc,"_nonoptional"),_nonnegative:a(()=>hJi,"_nonnegative"),_never:a(()=>sJi,"_never"),_negative:a(()=>fJi,"_negative"),_nativeEnum:a(()=>mQc,"_nativeEnum"),_nanoid:a(()=>EFr,"_nanoid"),_nan:a(()=>uJi,"_nan"),_multipleOf:a(()=>K3e,"_multipleOf"),_minSize:a(()=>J3e,"_minSize"),_minLength:a(()=>c_e,"_minLength"),_min:a(()=>dI,"_min"),_mime:a(()=>QFr,"_mime"),_maxSize:a(()=>dIt,"_maxSize"),_maxLength:a(()=>fIt,"_maxLength"),_max:a(()=>cN,"_max"),_map:a(()=>fQc,"_map"),_lte:a(()=>cN,"_lte"),_lt:a(()=>Jne,"_lt"),_lowercase:a(()=>OFr,"_lowercase"),_literal:a(()=>gQc,"_literal"),_length:a(()=>pIt,"_length"),_lazy:a(()=>xQc,"_lazy"),_ksuid:a(()=>SFr,"_ksuid"),_jwt:a(()=>DFr,"_jwt"),_isoTime:a(()=>qKi,"_isoTime"),_isoDuration:a(()=>jKi,"_isoDuration"),_isoDateTime:a(()=>UKi,"_isoDateTime"),_isoDate:a(()=>QKi,"_isoDate"),_ipv6:a(()=>IFr,"_ipv6"),_ipv4:a(()=>TFr,"_ipv4"),_intersection:a(()=>uQc,"_intersection"),_int64:a(()=>eJi,"_int64"),_int32:a(()=>zKi,"_int32"),_int:a(()=>$Ki,"_int"),_includes:a(()=>LFr,"_includes"),_guid:a(()=>yTt,"_guid"),_gte:a(()=>dI,"_gte"),_gt:a(()=>Zne,"_gt"),_float64:a(()=>WKi,"_float64"),_float32:a(()=>VKi,"_float32"),_file:a(()=>AJi,"_file"),_enum:a(()=>hQc,"_enum"),_endsWith:a(()=>UFr,"_endsWith"),_emoji:a(()=>yFr,"_emoji"),_email:a(()=>fFr,"_email"),_e164:a(()=>PFr,"_e164"),_discriminatedUnion:a(()=>lQc,"_discriminatedUnion"),_default:a(()=>_Qc,"_default"),_date:a(()=>cJi,"_date"),_custom:a(()=>yJi,"_custom"),_cuid2:a(()=>CFr,"_cuid2"),_cuid:a(()=>_Fr,"_cuid"),_coercedString:a(()=>LKi,"_coercedString"),_coercedNumber:a(()=>GKi,"_coercedNumber"),_coercedDate:a(()=>lJi,"_coercedDate"),_coercedBoolean:a(()=>JKi,"_coercedBoolean"),_coercedBigint:a(()=>XKi,"_coercedBigint"),_cidrv6:a(()=>wFr,"_cidrv6"),_cidrv4:a(()=>xFr,"_cidrv4"),_catch:a(()=>bQc,"_catch"),_boolean:a(()=>KKi,"_boolean"),_bigint:a(()=>ZKi,"_bigint"),_base64url:a(()=>kFr,"_base64url"),_base64:a(()=>RFr,"_base64"),_array:a(()=>$Fr,"_array"),_any:a(()=>oJi,"_any"),TimePrecision:a(()=>FKi,"TimePrecision"),NEVER:a(()=>_zi,"NEVER"),JSONSchemaGenerator:a(()=>Z3e,"JSONSchemaGenerator"),JSONSchema:a(()=>RQc,"JSONSchema"),Doc:a(()=>gTt,"Doc"),$output:a(()=>MKi,"$output"),$input:a(()=>OKi,"$input"),$constructor:a(()=>st,"$constructor"),$brand:a(()=>Czi,"$brand"),$ZodXID:a(()=>QYi,"$ZodXID"),$ZodVoid:a(()=>uKi,"$ZodVoid"),$ZodUnknown:a(()=>ATt,"$ZodUnknown"),$ZodUnion:a(()=>aFr,"$ZodUnion"),$ZodUndefined:a(()=>sKi,"$ZodUndefined"),$ZodUUID:a(()=>DYi,"$ZodUUID"),$ZodURL:a(()=>MYi,"$ZodURL"),$ZodULID:a(()=>UYi,"$ZodULID"),$ZodType:a(()=>bo,"$ZodType"),$ZodTuple:a(()=>uIt,"$ZodTuple"),$ZodTransform:a(()=>cFr,"$ZodTransform"),$ZodTemplateLiteral:a(()=>RKi,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>oKi,"$ZodSymbol"),$ZodSuccess:a(()=>TKi,"$ZodSuccess"),$ZodStringFormat:a(()=>ku,"$ZodStringFormat"),$ZodString:a(()=>uFe,"$ZodString"),$ZodSet:a(()=>gKi,"$ZodSet"),$ZodRegistry:a(()=>Y3e,"$ZodRegistry"),$ZodRecord:a(()=>hKi,"$ZodRecord"),$ZodRealError:a(()=>cFe,"$ZodRealError"),$ZodReadonly:a(()=>wKi,"$ZodReadonly"),$ZodPromise:a(()=>kKi,"$ZodPromise"),$ZodPrefault:a(()=>bKi,"$ZodPrefault"),$ZodPipe:a(()=>lFr,"$ZodPipe"),$ZodOptional:a(()=>_Ki,"$ZodOptional"),$ZodObject:a(()=>sFr,"$ZodObject"),$ZodNumberFormat:a(()=>nKi,"$ZodNumberFormat"),$ZodNumber:a(()=>rFr,"$ZodNumber"),$ZodNullable:a(()=>CKi,"$ZodNullable"),$ZodNull:a(()=>aKi,"$ZodNull"),$ZodNonOptional:a(()=>SKi,"$ZodNonOptional"),$ZodNever:a(()=>lKi,"$ZodNever"),$ZodNanoID:a(()=>BYi,"$ZodNanoID"),$ZodNaN:a(()=>xKi,"$ZodNaN"),$ZodMap:a(()=>mKi,"$ZodMap"),$ZodLiteral:a(()=>yKi,"$ZodLiteral"),$ZodLazy:a(()=>PKi,"$ZodLazy"),$ZodKSUID:a(()=>qYi,"$ZodKSUID"),$ZodJWT:a(()=>tKi,"$ZodJWT"),$ZodIntersection:a(()=>pKi,"$ZodIntersection"),$ZodISOTime:a(()=>GYi,"$ZodISOTime"),$ZodISODuration:a(()=>$Yi,"$ZodISODuration"),$ZodISODateTime:a(()=>jYi,"$ZodISODateTime"),$ZodISODate:a(()=>HYi,"$ZodISODate"),$ZodIPv6:a(()=>WYi,"$ZodIPv6"),$ZodIPv4:a(()=>VYi,"$ZodIPv4"),$ZodGUID:a(()=>PYi,"$ZodGUID"),$ZodFunction:a(()=>_Tt,"$ZodFunction"),$ZodFile:a(()=>EKi,"$ZodFile"),$ZodError:a(()=>G3r,"$ZodError"),$ZodEnum:a(()=>AKi,"$ZodEnum"),$ZodEmoji:a(()=>OYi,"$ZodEmoji"),$ZodEmail:a(()=>NYi,"$ZodEmail"),$ZodE164:a(()=>XYi,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>fKi,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>vKi,"$ZodDefault"),$ZodDate:a(()=>dKi,"$ZodDate"),$ZodCustomStringFormat:a(()=>rKi,"$ZodCustomStringFormat"),$ZodCustom:a(()=>DKi,"$ZodCustom"),$ZodCheckUpperCase:a(()=>bYi,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>lFe,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>TYi,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>AYi,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>CYi,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>xYi,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>RYi,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>pYi,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>fYi,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>gYi,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>EYi,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>wYi,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>mYi,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>yYi,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>vYi,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>X3r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>_Yi,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>SYi,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>eFr,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>IYi,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>hYi,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>dh,"$ZodCheck"),$ZodCatch:a(()=>IKi,"$ZodCatch"),$ZodCUID2:a(()=>FYi,"$ZodCUID2"),$ZodCUID:a(()=>LYi,"$ZodCUID"),$ZodCIDRv6:a(()=>YYi,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>zYi,"$ZodCIDRv4"),$ZodBoolean:a(()=>nFr,"$ZodBoolean"),$ZodBigIntFormat:a(()=>iKi,"$ZodBigIntFormat"),$ZodBigInt:a(()=>iFr,"$ZodBigInt"),$ZodBase64URL:a(()=>ZYi,"$ZodBase64URL"),$ZodBase64:a(()=>KYi,"$ZodBase64"),$ZodAsyncError:a(()=>RV,"$ZodAsyncError"),$ZodArray:a(()=>oFr,"$ZodArray"),$ZodAny:a(()=>cKi,"$ZodAny")});_zi=Object.freeze({status:"aborted"});a(st,"F");Czi=Symbol("zod_brand"),RV=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},fTt={};a(QC,"c$");Hs={};pB(Hs,{unwrapMessage:a(()=>C3e,"unwrapMessage"),stringifyPrimitive:a(()=>os,"stringifyPrimitive"),required:a(()=>SUc,"required"),randomString:a(()=>mUc,"randomString"),propertyKeyTypes:a(()=>pTt,"propertyKeyTypes"),promiseAllObject:a(()=>hUc,"promiseAllObject"),primitiveTypes:a(()=>Tzi,"primitiveTypes"),prefixIssues:a(()=>VR,"prefixIssues"),pick:a(()=>EUc,"pick"),partial:a(()=>bUc,"partial"),optionalKeys:a(()=>Izi,"optionalKeys"),omit:a(()=>_Uc,"omit"),numKeys:a(()=>gUc,"numKeys"),nullish:a(()=>tie,"nullish"),normalizeParams:a(()=>Ir,"normalizeParams"),merge:a(()=>vUc,"merge"),jsonStringifyReplacer:a(()=>vzi,"jsonStringifyReplacer"),joinValues:a(()=>$r,"joinValues"),issue:a(()=>Rzi,"issue"),isPlainObject:a(()=>z3e,"isPlainObject"),isObject:a(()=>W3e,"isObject"),getSizableOrigin:a(()=>sIt,"getSizableOrigin"),getParsedType:a(()=>AUc,"getParsedType"),getLengthableOrigin:a(()=>aIt,"getLengthableOrigin"),getEnumValues:a(()=>q3r,"getEnumValues"),getElementAtPath:a(()=>pUc,"getElementAtPath"),floatSafeRemainder:a(()=>bzi,"floatSafeRemainder"),finalizeIssue:a(()=>dN,"finalizeIssue"),extend:a(()=>CUc,"extend"),escapeRegex:a(()=>rie,"escapeRegex"),esc:a(()=>MEe,"esc"),defineLazy:a(()=>Vc,"defineLazy"),createTransparentProxy:a(()=>yUc,"createTransparentProxy"),clone:a(()=>mN,"clone"),cleanRegex:a(()=>oIt,"cleanRegex"),cleanEnum:a(()=>TUc,"cleanEnum"),captureStackTrace:a(()=>H3r,"captureStackTrace"),cached:a(()=>iIt,"cached"),assignProp:a(()=>j3r,"assignProp"),assertNotEqual:a(()=>lUc,"assertNotEqual"),assertNever:a(()=>dUc,"assertNever"),assertIs:a(()=>uUc,"assertIs"),assertEqual:a(()=>cUc,"assertEqual"),assert:a(()=>fUc,"assert"),allowsEval:a(()=>Szi,"allowsEval"),aborted:a(()=>UEe,"aborted"),NUMBER_FORMAT_RANGES:a(()=>xzi,"NUMBER_FORMAT_RANGES"),Class:a(()=>RLr,"Class"),BIGINT_FORMAT_RANGES:a(()=>wzi,"BIGINT_FORMAT_RANGES")});a(cUc,"lh");a(lUc,"ch");a(uUc,"ph");a(dUc,"dh");a(fUc,"ih");a(q3r,"B7");a($r,"P");a(vzi,"mH");a(iIt,"z7");a(tie,"I1");a(oIt,"N7");a(bzi,"lH");a(Vc,"N$");a(j3r,"cH");a(pUc,"nh");a(hUc,"rh");a(mUc,"oh");a(MEe,"j0");H3r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(W3e,"g8");Szi=iIt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(z3e,"h8");a(gUc,"th");AUc=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"),pTt=new Set(["string","number","symbol"]),Tzi=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(rie,"r4");a(mN,"H6");a(Ir,"k");a(yUc,"sh");a(os,"x");a(Izi,"iH");xzi={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]},wzi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(EUc,"eh");a(_Uc,"$u");a(CUc,"Qu");a(vUc,"Ju");a(bUc,"Xu");a(SUc,"Yu");a(UEe,"A0");a(VR,"I6");a(C3e,"V7");a(dN,"g6");a(sIt,"O7");a(aIt,"D7");a(Rzi,"oH");a(TUc,"Wu");RLr=class{static{a(this,"YM")}constructor(...e){}},kzi=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,vzi,2)},enumerable:!0})},"WM"),G3r=st("$ZodError",kzi),cFe=st("$ZodError",kzi,{Parent:Error});a($3r,"m8");a(V3r,"l8");a(Pzi,"mX");a(Dzi,"GM");a(Nzi,"lX");W3r=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 RV;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>dN(u,s,QC())));throw H3r(l,o?.callee),l}return c.value},"cX"),hTt=W3r(cFe),z3r=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=>dN(u,s,QC())));throw H3r(l,o?.callee),l}return c.value},"pX"),mTt=z3r(cFe),Y3r=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 RV;return s.issues.length?{success:!1,error:new(t??G3r)(s.issues.map(c=>dN(c,o,QC())))}:{success:!0,data:s.value}},"dX"),cIt=Y3r(cFe),K3r=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=>dN(c,o,QC())))}:{success:!0,data:s.value}},"iX"),lIt=K3r(cFe),J3r={};pB(J3r,{xid:a(()=>Lzi,"xid"),uuid7:a(()=>RUc,"uuid7"),uuid6:a(()=>wUc,"uuid6"),uuid4:a(()=>xUc,"uuid4"),uuid:a(()=>a_e,"uuid"),uppercase:a(()=>uYi,"uppercase"),unicodeEmail:a(()=>DUc,"unicodeEmail"),undefined:a(()=>cYi,"undefined"),ulid:a(()=>Bzi,"ulid"),time:a(()=>eYi,"time"),string:a(()=>rYi,"string"),rfc5322Email:a(()=>PUc,"rfc5322Email"),number:a(()=>oYi,"number"),null:a(()=>aYi,"null"),nanoid:a(()=>Uzi,"nanoid"),lowercase:a(()=>lYi,"lowercase"),ksuid:a(()=>Fzi,"ksuid"),ipv6:a(()=>$zi,"ipv6"),ipv4:a(()=>Gzi,"ipv4"),integer:a(()=>iYi,"integer"),html5Email:a(()=>kUc,"html5Email"),hostname:a(()=>Yzi,"hostname"),guid:a(()=>qzi,"guid"),extendedDuration:a(()=>IUc,"extendedDuration"),emoji:a(()=>Hzi,"emoji"),email:a(()=>jzi,"email"),e164:a(()=>Kzi,"e164"),duration:a(()=>Qzi,"duration"),domain:a(()=>OUc,"domain"),datetime:a(()=>tYi,"datetime"),date:a(()=>Zzi,"date"),cuid2:a(()=>Ozi,"cuid2"),cuid:a(()=>Mzi,"cuid"),cidrv6:a(()=>Wzi,"cidrv6"),cidrv4:a(()=>Vzi,"cidrv4"),browserEmail:a(()=>NUc,"browserEmail"),boolean:a(()=>sYi,"boolean"),bigint:a(()=>nYi,"bigint"),base64url:a(()=>Z3r,"base64url"),base64:a(()=>zzi,"base64"),_emoji:a(()=>MUc,"_emoji")});Mzi=/^[cC][^\s-]{8,}$/,Ozi=/^[0-9a-z]+$/,Bzi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Lzi=/^[0-9a-vA-V]{20}$/,Fzi=/^[A-Za-z0-9]{27}$/,Uzi=/^[a-zA-Z0-9_-]{21}$/,Qzi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,IUc=/^[-+]?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)?)??$/,qzi=/^([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})$/,a_e=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"),xUc=a_e(4),wUc=a_e(6),RUc=a_e(7),jzi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kUc=/^[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])?)*$/,PUc=/^(([^<>()\[\]\\.,;:\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,}))$/,DUc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,NUc=/^[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])?)*$/,MUc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(Hzi,"WK");Gzi=/^(?:(?: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])$/,$zi=/^(([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})$/,Vzi=/^((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])$/,Wzi=/^(([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])$/,zzi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Z3r=/^[A-Za-z0-9_-]*$/,Yzi=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,OUc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Kzi=/^\+(?:[0-9]){6,14}[0-9]$/,Jzi="(?:(?:\\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])))",Zzi=new RegExp(`^${Jzi}$`);a(Xzi,"HM");a(eYi,"NK");a(tYi,"wK");rYi=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),nYi=/^\d+n?$/,iYi=/^\d+$/,oYi=/^-?\d+(?:\.\d+)?/i,sYi=/true|false/i,aYi=/null/i,cYi=/undefined/i,lYi=/^[^A-Z]*$/,uYi=/^[^a-z]*$/,dh=st("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),dYi={number:"number",bigint:"bigint",object:"date"},X3r=st("$ZodCheckLessThan",(t,e)=>{dh.init(t,e);let r=dYi[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{dh.init(t,e);let r=dYi[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})}}),fYi=st("$ZodCheckMultipleOf",(t,e)=>{dh.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):bzi(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})}}),pYi=st("$ZodCheckNumberFormat",(t,e)=>{dh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=xzi[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=iYi)}),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})}}),hYi=st("$ZodCheckBigIntFormat",(t,e)=>{dh.init(t,e);let[r,n]=wzi[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})}}),mYi=st("$ZodCheckMaxSize",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(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:sIt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),gYi=st("$ZodCheckMinSize",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(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:sIt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),AYi=st("$ZodCheckSizeEquals",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(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:sIt(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})}}),yYi=st("$ZodCheckMaxLength",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(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=aIt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),EYi=st("$ZodCheckMinLength",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(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=aIt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),_Yi=st("$ZodCheckLengthEquals",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(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=aIt(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})}}),lFe=st("$ZodCheckStringFormat",(t,e)=>{var r,n;dh.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=()=>{})}),CYi=st("$ZodCheckRegex",(t,e)=>{lFe.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})}}),vYi=st("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=lYi),lFe.init(t,e)}),bYi=st("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=uYi),lFe.init(t,e)}),SYi=st("$ZodCheckIncludes",(t,e)=>{dh.init(t,e);let r=rie(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})}}),TYi=st("$ZodCheckStartsWith",(t,e)=>{dh.init(t,e);let r=new RegExp(`^${rie(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})}}),IYi=st("$ZodCheckEndsWith",(t,e)=>{dh.init(t,e);let r=new RegExp(`.*${rie(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(e$i,"KM");xYi=st("$ZodCheckProperty",(t,e)=>{dh.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=>e$i(o,r,e.property));e$i(n,r,e.property)}}),wYi=st("$ZodCheckMimeType",(t,e)=>{dh.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})}}),RYi=st("$ZodCheckOverwrite",(t,e)=>{dh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),gTt=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??SLr.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=Hji(s.logLevel,"ClientOptions.logLevel",this)??Hji(Vl("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??NMc(),mn(this,B1t,OMc,"f");let l=Vl("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=R$i(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=>{qg(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{qg(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new z4r(e,r=>{qg(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 XMc(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 Ii(`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 BMc(e)}getUserAgent(){return`${this.constructor.name}/JS ${rV}`}defaultIdempotencyKey(){return`stainless-node-retry-${A$i()}`}makeStatusError(e,r,n,o){return Mv.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,rBr,"m",$$i).call(this)&&n||this.baseURL,s=TMc(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!Oji(c)||!Oji(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 Ii("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(Y1t)||o.append("anthropic-beta",Y1t),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 J1t(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(qg(this).debug(`[${d}] sending request`,vne({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new sI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch($4r),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new sI;let v=e3e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return qg(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),qg(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,vne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw qg(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),qg(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,vne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new Q1t:new _Ee({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 MMc(g.body),qg(this).info(`${E} - ${R}`),qg(this).debug(`[${d}] response error (${R})`,vne({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";qg(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>$4r(R).message),T=y$i(b),w=T?void 0:b;throw qg(this).debug(`[${d}] response error (${v})`,vne({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 qg(this).info(E),qg(this).debug(`[${d}] response start`,vne({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 K4r(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 wMc(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 Ii("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&&xMc("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))}:{},...yLr(),...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:_$i(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,B1t,"f").call(this,{body:e,headers:n})}};SLr=Sp,B1t=new WeakMap,rBr=new WeakSet,$$i=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Sp.Anthropic=SLr;Sp.HUMAN_PROMPT=wOc;Sp.AI_PROMPT=ROc;Sp.DEFAULT_TIMEOUT=6e5;Sp.AnthropicError=Ii;Sp.APIError=Mv;Sp.APIConnectionError=_Ee;Sp.APIConnectionTimeoutError=Q1t;Sp.APIUserAbortError=sI;Sp.NotFoundError=G1t;Sp.ConflictError=$1t;Sp.RateLimitError=W1t;Sp.BadRequestError=q1t;Sp.AuthenticationError=j1t;Sp.InternalServerError=z1t;Sp.PermissionDeniedError=H1t;Sp.UnprocessableEntityError=V1t;Sp.toFile=pOc;bEe=class extends Sp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new hSt(this),this.messages=new i3e(this),this.models=new gSt(this),this.beta=new l1(this)}};bEe.Completions=hSt;bEe.Messages=i3e;bEe.Models=gSt;bEe.Beta=l1;a(P3e,"j4");a(L1t,"N8");a(aI,"o$");a(k3e,"D1");a(V$i,"JU");a(POc,"Tw");kOc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),DOc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(NOc,"xw");iBr=class{static{a(this,"gw")}read(e){return(0,jg.readFile)(e,"utf8")}readBytes(e){return(0,jg.readFile)(e)}write(e,r,n){return(0,jg.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,jg.mkdir)(e,{recursive:!0})}catch(r){if(aI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return NOc(e,r,n)}delete(e){return(0,jg.unlink)(e)}list(e){return(0,jg.readdir)(e)}append(e,r,n){return(0,jg.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,jg.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,jg.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,jg.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,jg.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},MOc=new z$i.AsyncLocalStorage;a(ASt,"w8");oEe=null;a(K$i,"uw");a(OOc,"mw");a(OR,"L6");a(BOc,"dv");LOc=BOc;a(FOc,"iv");UOc=FOc;a(QOc,"nv");qOc=QOc;a(jOc,"rv");HOc=jOc,GOc=200;a($Oc,"tv");VOc=$Oc;a(zEe,"D8");zEe.prototype.clear=LOc;zEe.prototype.delete=UOc;zEe.prototype.get=qOc;zEe.prototype.has=HOc;zEe.prototype.set=VOc;WOc=zEe,zOc=(function(){try{var t=mLr(Object,"defineProperty");return t({},"",{}),t}catch{}})(),ySt=zOc;a(YOc,"sv");TLr=YOc,KOc=Object.prototype,JOc=KOc.hasOwnProperty;a(ZOc,"QC");J$i=ZOc;a(XOc,"JC");e5c=XOc;a(t5c,"XC");r5c=t5c;a(n5c,"YC");YEe=n5c,i5c="[object Arguments]";a(o5c,"GC");lHi=o5c,Z$i=Object.prototype,s5c=Z$i.hasOwnProperty,a5c=Z$i.propertyIsEnumerable,c5c=lHi((function(){return arguments})())?lHi:function(t){return YEe(t)&&s5c.call(t,"callee")&&!a5c.call(t,"callee")},o3e=c5c,l5c=Array.isArray,cV=l5c,jLe={};tB(jLe,{default:a(()=>ILr,"default")});a(u5c,"VC");d5c=u5c,X$i=typeof jLe=="object"&&jLe&&!jLe.nodeType&&jLe,uHi=X$i&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,f5c=uHi&&uHi.exports===X$i,dHi=f5c?HEe.Buffer:void 0,p5c=dHi?dHi.isBuffer:void 0,h5c=p5c||d5c,ILr=h5c,m5c=9007199254740991,g5c=/^(?:0|[1-9]\d*)$/;a(A5c,"DC");ATt=A5c,y5c=9007199254740991;a(E5c,"ZC");xLr=E5c,_5c="[object Arguments]",v5c="[object Array]",C5c="[object Boolean]",b5c="[object Date]",S5c="[object Error]",T5c="[object Function]",I5c="[object Map]",x5c="[object Number]",w5c="[object Object]",R5c="[object RegExp]",P5c="[object Set]",k5c="[object String]",D5c="[object WeakMap]",N5c="[object ArrayBuffer]",M5c="[object DataView]",O5c="[object Float32Array]",B5c="[object Float64Array]",L5c="[object Int8Array]",F5c="[object Int16Array]",U5c="[object Int32Array]",Q5c="[object Uint8Array]",q5c="[object Uint8ClampedArray]",j5c="[object Uint16Array]",H5c="[object Uint32Array]",md={};md[O5c]=md[B5c]=md[L5c]=md[F5c]=md[U5c]=md[Q5c]=md[q5c]=md[j5c]=md[H5c]=!0;md[_5c]=md[v5c]=md[N5c]=md[C5c]=md[M5c]=md[b5c]=md[S5c]=md[T5c]=md[I5c]=md[x5c]=md[w5c]=md[R5c]=md[P5c]=md[k5c]=md[D5c]=!1;a(G5c,"pC");$5c=G5c;a(V5c,"dC");W5c=V5c,HLe={};tB(HLe,{default:a(()=>oBr,"default")});eVi=typeof HLe=="object"&&HLe&&!HLe.nodeType&&HLe,KLe=eVi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,z5c=KLe&&KLe.exports===eVi,v4r=z5c&&f$i.process,Y5c=(function(){try{var t=KLe&&KLe.require&&KLe.require("util").types;return t||v4r&&v4r.binding&&v4r.binding("util")}catch{}})(),oBr=Y5c,fHi=oBr&&oBr.isTypedArray,K5c=fHi?W5c(fHi):$5c,tVi=K5c,J5c=Object.prototype,Z5c=J5c.hasOwnProperty;a(X5c,"aC");e4c=X5c,t4c=Object.prototype;a(r4c,"eC");rVi=r4c;a(n4c,"$T");i4c=n4c;a(o4c,"QT");wLr=o4c;a(s4c,"JT");a4c=s4c,c4c=Object.prototype,l4c=c4c.hasOwnProperty;a(u4c,"WT");d4c=u4c;a(f4c,"GT");nVi=f4c,GLe={};tB(GLe,{default:a(()=>oVi,"default")});iVi=typeof GLe=="object"&&GLe&&!GLe.nodeType&&GLe,pHi=iVi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,p4c=pHi&&pHi.exports===iVi,hHi=p4c?HEe.Buffer:void 0,mHi=hHi?hHi.allocUnsafe:void 0;a(h4c,"HT");oVi=h4c;a(m4c,"KT");g4c=m4c;a(A4c,"qT");y4c=A4c,E4c=i4c(Object.getPrototypeOf,Object),sVi=E4c,_4c=HEe.Uint8Array,gHi=_4c;a(v4c,"zT");C4c=v4c;a(b4c,"NT");S4c=b4c,AHi=Object.create,T4c=(function(){function t(){}return a(t,"$"),function(e){if(!Z6(e))return{};if(AHi)return AHi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),I4c=T4c;a(x4c,"OT");w4c=x4c,R4c="[object Symbol]";a(P4c,"FT");RLr=P4c,k4c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,D4c=/^\w*$/;a(N4c,"LT");M4c=N4c,O4c=500;a(B4c,"AT");L4c=B4c,F4c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,U4c=/\\(\\)?/g,Q4c=L4c(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(F4c,function(r,n,o,s){e.push(o?s.replace(U4c,"$1"):n||r)}),e}),q4c=Q4c;a(j4c,"ET");H4c=j4c,G4c=1/0,yHi=aV?aV.prototype:void 0,EHi=yHi?yHi.toString:void 0;a(aVi,"PO");$4c=aVi;a(V4c,"_T");W4c=V4c;a(z4c,"kT");yTt=z4c,Y4c=1/0;a(K4c,"vT");PLr=K4c;a(J4c,"CT");Z4c=J4c;a(X4c,"TT");eBc=X4c;a(tBc,"xT");rBc=tBc;a(nBc,"yT");iBc=nBc;a(oBc,"fT");cVi=oBc,kLr=null;a(sBc,"CO");a(aBc,"TO");_St=new Map;a(cBc,"xO");a(lBc,"yO");DLr=new Map;a(dBc,"fO");a(fBc,"gO");a(NLr,"V0");a(hBc,"hO");a(mBc,"uO");gBc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(ABc,"lT");yBc=ABc(),EBc=a(()=>{},"pT");a(uVi,"VU");_Bc=w3e(),aNh=_Bc.subscribe,vBc=w3e(),cNh=vBc.subscribe,CBc=w3e(),lNh=CBc.subscribe,bBc=w3e(),uNh=bBc.subscribe,SBc=w3e(),dNh=SBc.subscribe;a(TBc,"lO");a(IBc,"tT");aBr=class{static{a(this,"cO")}#e=new Set;register(e){let r=IBc(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}},xBc=new aBr;a(wBc,"pO");RBc=my(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(PBc,"sT");a(kBc,"eT");a(DBc,"iO");a(NBc,"tO");a(MBc,"Qx");a(_Hi,"oO");a(OBc,"aO");a(fVi,"HX");BBc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=Gd(e,Vd`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},async stat(t){return(0,xm.stat)(t)},async readdir(t){return(0,xm.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,xm.unlink)(t)},async rmdir(t){return(0,xm.rmdir)(t)},async rm(t,e){return(0,xm.rm)(t,e)},async mkdir(t,e){try{await(0,xm.mkdir)(t,{recursive:!0,...e})}catch(r){if(aI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,xm.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,xm.rename)(t,e)},statSync(t){let e=[];try{let o=Gd(e,Vd`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},lstatSync(t){let e=[];try{let o=Gd(e,Vd`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},readFileSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{$d(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=Gd(e,Vd`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},readSync(t,e){let r=[];try{let s=Gd(r,Vd`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{$d(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=Gd(n,Vd`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(aI(l)!=="EEXIST")throw l}vo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{$d(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},unlinkSync(t){let e=[];try{let o=Gd(e,Vd`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},renameSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},linkSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=Gd(n,Vd`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{$d(n,o,s)}},readlinkSync(t){let e=[];try{let o=Gd(e,Vd`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},realpathSync(t){let e=[];try{let o=Gd(e,Vd`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{$d(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{vo.mkdirSync(t,c)}catch(l){if(aI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{$d(r,n,o)}},readdirSync(t){let e=[];try{let o=Gd(e,Vd`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{$d(e,r,n)}},readdirStringSync(t){let e=[];try{let o=Gd(e,Vd`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=Gd(e,Vd`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{$d(e,r,n)}},rmdirSync(t){let e=[];try{let o=Gd(e,Vd`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},rmSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,xm.readFile)(t);let r=await(0,xm.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(${GBc}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"}],bHi=null;a(VBc,"Ox");a(WBc,"W2");cBr={verbose:0,debug:1,info:2,warn:3,error:4},zBc=my(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(cBr,t)?t:"debug"}),YBc=!1;a(ETt,"qX");lBr=my(()=>{let t=ETt();return YBc||QE(process.env.DEBUG)||QE(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||pVi()||t.some(e=>e.startsWith("--debug="))||hVi()!==null}),KBc=my(()=>{let t=ETt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return RBc(e)}),pVi=my(()=>{let t=ETt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),hVi=my(()=>{let t=ETt();for(let e=0;e{try{let t=AVi(),e=(0,Lne.dirname)(t),r=(0,Lne.join)(e,"latest");await(0,HE.unlink)(r).catch(()=>{}),await(0,HE.symlink)(t,r)}catch{}}),hNh=(()=>{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})(),rLc={[Symbol.dispose](){}};a(nLc,"_x");Vd=nLc;a(I0,"B$");sN=a((t,e)=>{let r=[];try{let s=Gd(r,Vd`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},"d$");a(iLc,"w2");a(lV,"A4");a(oLc,"kx");a(sLc,"O2");aLc=2e3,vSt=new Set,SHi=!1;a(cLc,"xx");a(lLc,"yx");fBr=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=H4r();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||H4r(),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(P3e(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 d$i()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=QE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,a$i.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(QE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();OR(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:q=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(ae=>`Skill(${ae})`),re=new Set(q);q=[...q,...H.filter(ae=>!re.has(ae))]}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",I0(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=OOc();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),q.length>0&&Q.push("--allowedTools",q.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",I0({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 U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let z=sLc(U,O);for(let[H,re]of Object.entries(z))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,QE(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=uLc(u),$=W?u:s,J=W?[...c,...Q]:[...c,u,...Q],ne={command:$,args:J,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(OR(`Spawning Claude Code (custom): ${$} ${J.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ne)):(OR(`Spawning Claude Code: ${$} ${J.join(" ")}`),this.process=this.spawnLocalProcess(ne)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,lLc(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 c1("Claude Code process aborted by user");else if(POc(H)){let re=dLc(u,W);this.exitError=ReferenceError(re),OR(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),OR(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new c1("Claude Code process aborted by user");else{let ae=this.getProcessExitError(H,re);ae&&(this.exitError=ae,OR(ae.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 c1("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){OR("[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}`);OR(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||OR("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${L1t(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new c1("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()},aLc,r,e).unref(),r.once("exit",()=>vSt.delete(r))):r&&(vSt.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,l$i.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=sN(n)}catch{OR(`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 c1("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(uLc,"fx");a(dLc,"gx");sEe="@anthropic-ai/claude-agent-sdk";a(fLc,"ux");a(pLc,"F2");CSt=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(hLc,"mx");mLc=hLc();a(MLr,"BX");a(_Vi,"AU");a(vVi,"IU");a(gLc,"Z2");a($6,"I4");pBr=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?.())}},hBr=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new CSt;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,ESt.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&&(Wl("[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 c1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);Wl(`[Query.readMessages] Replacing exit error with result text. Original: ${L1t(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(I0(o)+` +`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:L1t(n)}};try{await Promise.resolve(this.transport.write(I0(o)+` +`))}catch(s){Wl(`[Query.handleControlRequest] Error-response write failed: ${L1t(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 $6("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 $6("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 $6("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 $6("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return $6("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(I0(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 $6("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return $6("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 $6("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return $6("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){Wl("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,Wl(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(I0(n)+` +`))}Wl(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(Wl("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),Wl("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof c1))throw r}}waitForFirstResult(){return this.firstResultReceived?(Wl("[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 pBr(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),Wl(`[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,ESt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(I0(n)+` +`)).catch(o=>{Wl(`[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}})}},OLr=500,BLr=1048576,ALc=[200,800],mBr=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=OLr,s=BLr,c=ALc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=I0(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 bne(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=P3e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await s$i(f)}if(l){Wl(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){Wl(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},THi=oLr(U2c(),1);a(yLc,"Ug");a(JLe,"O0");a(ELc,"qg");S4r=new Map,_Lc=5e3;a(vLc,"Bg");a(CLc,"zg");a(bLc,"OZ");SLc=(0,TVi.promisify)(SVi.execFile);a(D3e,"m4");a(TLc,"jH");Y6=65536,ILc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(dh,"L$");a(wVi,"ZZ");a(T4r,"IX");a(BR,"A6");a(ABr,"rQ");a(RVi,"RX");a(xLc,"MZ");a(PVi,"PX");s3e=200;a(wLc,"Lg");a(N3e,"F0");a(pV,"U4");a(RLc,"jg");a(M3e,"M1");a(XD,"j6");a(_Tt,"L1");PLc=1048576,kLc=5242880;a(NLc,"Rg");a(kVi,"jZ");a(Ine,"D0");a(bSt,"jX");SSt=Buffer.from('{"type":"attribution-snapshot"'),MLc=Buffer.from('{"type":"system"'),a3e=10,OLc=Buffer.from([a3e]),BLc=256;a(LLc,"_g");a(FLc,"kg");a(ULc,"Sg");a(QLc,"vg");a(qLc,"Cg");a(jLc,"AZ");a(HLc,"xg");a(GLc,"yg");a($Lc,"fg");a(I4r,"IH");a(VLc,"gg");a(WLc,"hg");a(zLc,"ug");a(DVi,"RH");a(NVi,"PH");a(YLc,"IZ");a(MVi,"RZ");a(KLc,"PZ");a(vTt,"k8");a($Le,"oQ");a(OVi,"EZ");JLc=32;a(ZLc,"pg");a(XLc,"dg");a(e3c,"ig");a(t3c,"ng");a(r3c,"rg");a(n3c,"bZ");a(i3c,"_Z");a(o3c,"CZ");a(s3c,"TZ");a(a3c,"xZ");a(c3c,"ag");a(BVi,"yZ");a(x4r,"_H");a(l3c,"sg");u3c=new Set(["user","assistant","attachment","system","progress"]);a(d3c,"$h");a(f3c,"Qh");a(LVi,"fZ");a(p3c,"gZ");a(h3c,"Jh");a(m3c,"hZ");a(g3c,"Xh");a(FVi,"uZ");a(UVi,"lZ");a(QVi,"cZ");a(A3c,"Wh");a(y3c,"Gh");a(E3c,"pZ");a(_3c,"dZ");a(qVi,"vH");a(GVi,"CH");a($Vi,"bX");a(v3c,"Uh");C3c="user:inference",VVi="user:profile",b3c="org:create_api_key",S3c=[b3c,VVi],T3c=[VVi,C3c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],gNh=$Vi([...S3c,...T3c]),IHi={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}"},I3c=void 0;a(x3c,"zh");w3c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(R3c,"rZ");P3c="-credentials";a(k3c,"tZ");D3c=/^[a-zA-Z0-9._-]+$/;a(N3c,"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})(ac||(ac={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(xHi||(xHi={}));wn=ac.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),eV=a(t=>{switch(typeof t){case"undefined":return wn.undefined;case"string":return wn.string;case"number":return Number.isNaN(t)?wn.nan:wn.number;case"boolean":return wn.boolean;case"function":return wn.function;case"bigint":return wn.bigint;case"symbol":return wn.symbol;case"object":return Array.isArray(t)?wn.array:t===null?wn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?wn.promise:typeof Map<"u"&&t instanceof Map?wn.map:typeof Set<"u"&&t instanceof Set?wn.set:typeof Date<"u"&&t instanceof Date?wn.date:wn.object;default:return wn.unknown}},"l4"),hr=ac.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"]),QR=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()}};QR.create=t=>new QR(t);M3c=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===wn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ac.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${ac.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ac.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${ac.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}"`:ac.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,ac.assertNever(t)}return{message:r}},"Fh"),l3e=M3c,O3c=l3e;a(EBr,"tQ");_Br=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(cn,"f");Ov=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"}),WLe=a(t=>({status:"dirty",value:t}),"v8"),u1=a(t=>({status:"valid",value:t}),"z6"),wHi=a(t=>t.status==="aborted","TH"),RHi=a(t=>t.status==="dirty","xH"),TEe=a(t=>t.status==="valid","Z0"),xSt=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={}));jR=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}},PHi=a((t,e)=>{if(TEe(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 QR(t.common.issues);return this._error=r,this._error}}},"eZ");a($o,"e");xs=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return eV(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:eV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ov,ctx:{common:e.parent.common,data:e.data,parsedType:eV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(xSt(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:eV(e)},o=this._parseSync({data:e,path:n.path,parent:n});return PHi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eV(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return TEe(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=>TEe(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:eV(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(xSt(o)?o:Promise.resolve(o));return PHi(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 rN({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 qR.create(this,this._def)}nullable(){return e9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return uV.create(this)}promise(){return Nne.create(this,this._def)}or(e){return REe.create([this,e],this._def)}and(e){return PEe.create(this,e,this._def)}transform(e){return new rN({...$o(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new OEe({...$o(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new wSt({typeName:Cr.ZodBranded,type:this,...$o(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new BEe({...$o(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return RSt.create(this,e)}readonly(){return LEe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},B3c=/^c[^\s-]{8,}$/i,L3c=/^[0-9a-z]+$/,F3c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U3c=/^[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,Q3c=/^[a-z0-9_-]{21}$/i,q3c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,j3c=/^[-+]?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)?)??$/,H3c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,G3c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$3c=/^(?:(?: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])$/,V3c=/^(?:(?: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])$/,W3c=/^(([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]))$/,z3c=/^(([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])$/,Y3c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K3c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,WVi="((\\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])))",J3c=new RegExp(`^${WVi}$`);a(zVi,"QM");a(Z3c,"yh");a(X3c,"fh");a(eFc,"gh");a(tFc,"hh");a(rFc,"uh");IEe=class t extends xs{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==wn.string){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:wn.string,received:o.parsedType}),eo}let r=new Ov,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),cn(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 IEe({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...$o(t)});a(nFc,"mh");u3e=class t extends xs{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)!==wn.number){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:wn.number,received:o.parsedType}),eo}let r,n=new Ov;for(let o of this._def.checks)o.kind==="int"?ac.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),cn(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),cn(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?nFc(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),cn(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),cn(r,{code:hr.not_finite,message:o.message}),n.dirty()):ac.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"&&ac.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 u3e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...$o(t)});d3e=class t extends xs{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)!==wn.bigint)return this._getInvalidInput(e);let r,n=new Ov;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),cn(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),cn(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):ac.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.bigint,received:r.parsedType}),eo}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 d3e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...$o(t)});f3e=class extends xs{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==wn.boolean){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.boolean,received:r.parsedType}),eo}return u1(e.data)}};f3e.create=t=>new f3e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...$o(t)});p3e=class t extends xs{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==wn.date){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:wn.date,received:o.parsedType}),eo}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_date}),eo}let r=new Ov,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),cn(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):ac.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 p3e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...$o(t)});h3e=class extends xs{static{a(this,"SX")}_parse(e){if(this._getType(e)!==wn.symbol){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.symbol,received:r.parsedType}),eo}return u1(e.data)}};h3e.create=t=>new h3e({typeName:Cr.ZodSymbol,...$o(t)});xEe=class extends xs{static{a(this,"$7")}_parse(e){if(this._getType(e)!==wn.undefined){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.undefined,received:r.parsedType}),eo}return u1(e.data)}};xEe.create=t=>new xEe({typeName:Cr.ZodUndefined,...$o(t)});wEe=class extends xs{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==wn.null){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.null,received:r.parsedType}),eo}return u1(e.data)}};wEe.create=t=>new wEe({typeName:Cr.ZodNull,...$o(t)});m3e=class extends xs{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return u1(e.data)}};m3e.create=t=>new m3e({typeName:Cr.ZodAny,...$o(t)});sV=class extends xs{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return u1(e.data)}};sV.create=t=>new sV({typeName:Cr.ZodUnknown,...$o(t)});X4=class extends xs{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.never,received:r.parsedType}),eo}};X4.create=t=>new X4({typeName:Cr.ZodNever,...$o(t)});g3e=class extends xs{static{a(this,"CX")}_parse(e){if(this._getType(e)!==wn.undefined){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.void,received:r.parsedType}),eo}return u1(e.data)}};g3e.create=t=>new g3e({typeName:Cr.ZodVoid,...$o(t)});uV=class t extends xs{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==wn.array)return cn(r,{code:hr.invalid_type,expected:wn.array,received:r.parsedType}),eo;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(cn(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 jR(r,c,r.path,l)))).then(c=>Ov.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new jR(r,c,r.path,l)));return Ov.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)}};uV.create=(t,e)=>new uV({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...$o(e)});a(uEe,"C8");lI=class t extends xs{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=ac.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==wn.object){let u=this._getOrReturnCtx(e);return cn(u,{code:hr.invalid_type,expected:wn.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 X4&&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 jR(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof X4){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&&(cn(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 jR(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=>Ov.mergeObjectSync(r,u)):Ov.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 ac.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 ac.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return uEe(this)}partial(e){let r={};for(let n of ac.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 ac.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof qR;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return YVi(ac.objectKeys(this.shape))}};lI.create=(t,e)=>new lI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:X4.create(),typeName:Cr.ZodObject,...$o(e)});lI.strictCreate=(t,e)=>new lI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:X4.create(),typeName:Cr.ZodObject,...$o(e)});lI.lazycreate=(t,e)=>new lI({shape:t,unknownKeys:"strip",catchall:X4.create(),typeName:Cr.ZodObject,...$o(e)});REe=class extends xs{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 QR(l.ctx.common.issues));return cn(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 QR(u));return cn(r,{code:hr.invalid_union,unionErrors:l}),eo}}get options(){return this._def.options}};REe.create=(t,e)=>new REe({options:t,typeName:Cr.ZodUnion,...$o(e)});V6=a(t=>t instanceof kEe?V6(t.schema):t instanceof rN?V6(t.innerType()):t instanceof DEe?[t.value]:t instanceof NEe?t.options:t instanceof MEe?ac.objectValues(t.enum):t instanceof OEe?V6(t._def.innerType):t instanceof xEe?[void 0]:t instanceof wEe?[null]:t instanceof qR?[void 0,...V6(t.unwrap())]:t instanceof e9?[null,...V6(t.unwrap())]:t instanceof wSt||t instanceof LEe?V6(t.unwrap()):t instanceof BEe?V6(t._def.innerType):[],"c4"),vBr=class t extends xs{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==wn.object)return cn(r,{code:hr.invalid_type,expected:wn.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}):(cn(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=V6(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,...$o(n)})}};a(CBr,"fH");PEe=class extends xs{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(wHi(s)||wHi(c))return eo;let l=CBr(s.value,c.value);return l.valid?((RHi(s)||RHi(c))&&r.dirty(),{status:r.value,value:l.data}):(cn(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}))}};PEe.create=(t,e,r)=>new PEe({left:t,right:e,typeName:Cr.ZodIntersection,...$o(r)});X6=class t extends xs{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==wn.array)return cn(n,{code:hr.invalid_type,expected:wn.array,received:n.parsedType}),eo;if(n.data.lengththis._def.items.length&&(cn(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 jR(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Ov.mergeArray(r,s)):Ov.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};X6.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new X6({items:t,typeName:Cr.ZodTuple,rest:null,...$o(e)})};bBr=class t extends xs{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!==wn.object)return cn(n,{code:hr.invalid_type,expected:wn.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 jR(n,l,n.path,l)),value:c._parse(new jR(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Ov.mergeObjectAsync(r,o):Ov.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xs?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...$o(n)}):new t({keyType:IEe.create(),valueType:e,typeName:Cr.ZodRecord,...$o(r)})}},A3e=class extends xs{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!==wn.map)return cn(n,{code:hr.invalid_type,expected:wn.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 jR(n,l,n.path,[d,"key"])),value:s._parse(new jR(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}}}};A3e.create=(t,e,r)=>new A3e({valueType:e,keyType:t,typeName:Cr.ZodMap,...$o(r)});y3e=class t extends xs{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==wn.set)return cn(n,{code:hr.invalid_type,expected:wn.set,received:n.parsedType}),eo;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(cn(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 jR(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)}};y3e.create=(t,e)=>new y3e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...$o(e)});SBr=class t extends xs{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==wn.function)return cn(r,{code:hr.invalid_type,expected:wn.function,received:r.parsedType}),eo;function n(l,u){return _Br({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,EBr(),l3e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return _Br({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,EBr(),l3e].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 Nne){let l=this;return u1(async function(...u){let d=new QR([]),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 u1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new QR([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new QR([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:X6.create(e).rest(sV.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||X6.create([]).rest(sV.create()),returns:r||sV.create(),typeName:Cr.ZodFunction,...$o(n)})}},kEe=class extends xs{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})}};kEe.create=(t,e)=>new kEe({getter:t,typeName:Cr.ZodLazy,...$o(e)});DEe=class extends xs{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return cn(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}};DEe.create=(t,e)=>new DEe({value:t,typeName:Cr.ZodLiteral,...$o(e)});a(YVi,"JM");NEe=class t extends xs{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return cn(r,{expected:ac.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 cn(r,{received:r.data,code:hr.invalid_enum_value,options:n}),eo}return u1(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})}};NEe.create=YVi;MEe=class extends xs{static{a(this,"G7")}_parse(e){let r=ac.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==wn.string&&n.parsedType!==wn.number){let o=ac.objectValues(r);return cn(n,{expected:ac.joinValues(o),received:n.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(ac.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ac.objectValues(r);return cn(n,{received:n.data,code:hr.invalid_enum_value,options:o}),eo}return u1(e.data)}get enum(){return this._def.values}};MEe.create=(t,e)=>new MEe({values:t,typeName:Cr.ZodNativeEnum,...$o(e)});Nne=class extends xs{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==wn.promise&&r.common.async===!1)return cn(r,{code:hr.invalid_type,expected:wn.promise,received:r.parsedType}),eo;let n=r.parsedType===wn.promise?r.data:Promise.resolve(r.data);return u1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Nne.create=(t,e)=>new Nne({type:t,typeName:Cr.ZodPromise,...$o(e)});rN=class extends xs{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=>{cn(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"?WLe(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"?WLe(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(!TEe(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=>TEe(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):eo);ac.assertNever(o)}};rN.create=(t,e,r)=>new rN({schema:t,typeName:Cr.ZodEffects,effect:e,...$o(r)});rN.createWithPreprocess=(t,e,r)=>new rN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...$o(r)});qR=class extends xs{static{a(this,"o6")}_parse(e){return this._getType(e)===wn.undefined?u1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};qR.create=(t,e)=>new qR({innerType:t,typeName:Cr.ZodOptional,...$o(e)});e9=class extends xs{static{a(this,"A1")}_parse(e){return this._getType(e)===wn.null?u1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};e9.create=(t,e)=>new e9({innerType:t,typeName:Cr.ZodNullable,...$o(e)});OEe=class extends xs{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===wn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};OEe.create=(t,e)=>new OEe({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...$o(e)});BEe=class extends xs{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 xSt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new QR(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new QR(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};BEe.create=(t,e)=>new BEe({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...$o(e)});E3e=class extends xs{static{a(this,"yX")}_parse(e){if(this._getType(e)!==wn.nan){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.nan,received:r.parsedType}),eo}return{status:"valid",value:e.data}}};E3e.create=t=>new E3e({typeName:Cr.ZodNaN,...$o(t)});wSt=class extends xs{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}},RSt=class t extends xs{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(),WLe(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})}},LEe=class extends xs{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(TEe(o)&&(o.value=Object.freeze(o.value)),o),"J");return xSt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};LEe.create=(t,e)=>new LEe({innerType:t,typeName:Cr.ZodReadonly,...$o(e)});ANh={object:lI.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={}));yNh=IEe.create,ENh=u3e.create,_Nh=E3e.create,vNh=d3e.create,CNh=f3e.create,bNh=p3e.create,SNh=h3e.create,TNh=xEe.create,INh=wEe.create,xNh=m3e.create,wNh=sV.create,RNh=X4.create,PNh=g3e.create,kNh=uV.create,iFc=lI.create,DNh=lI.strictCreate,NNh=REe.create,MNh=vBr.create,ONh=PEe.create,BNh=X6.create,LNh=bBr.create,FNh=A3e.create,UNh=y3e.create,QNh=SBr.create,qNh=kEe.create,jNh=DEe.create,HNh=NEe.create,GNh=MEe.create,$Nh=Nne.create,VNh=rN.create,WNh=qR.create,zNh=e9.create,YNh=rN.createWithPreprocess,KNh=RSt.create,KVi={};tB(KVi,{version:a(()=>azi,"version"),util:a(()=>Qs,"util"),treeifyError:a(()=>cWi,"treeifyError"),toJSONSchema:a(()=>j3r,"toJSONSchema"),toDotPath:a(()=>lWi,"toDotPath"),safeParseAsync:a(()=>xTt,"safeParseAsync"),safeParse:a(()=>ITt,"safeParse"),registry:a(()=>a3r,"registry"),regexes:a(()=>WLr,"regexes"),prettifyError:a(()=>uWi,"prettifyError"),parseAsync:a(()=>NSt,"parseAsync"),parse:a(()=>DSt,"parse"),locales:a(()=>s3r,"locales"),isValidJWT:a(()=>kzi,"isValidJWT"),isValidBase64URL:a(()=>wzi,"isValidBase64URL"),isValidBase64:a(()=>JLr,"isValidBase64"),globalRegistry:a(()=>K6,"globalRegistry"),globalConfig:a(()=>PSt,"globalConfig"),function:a(()=>XYi,"function"),formatError:a(()=>jLr,"formatError"),flattenError:a(()=>qLr,"flattenError"),config:a(()=>Bv,"config"),clone:a(()=>aN,"clone"),_xid:a(()=>E3r,"_xid"),_void:a(()=>FYi,"_void"),_uuidv7:a(()=>f3r,"_uuidv7"),_uuidv6:a(()=>d3r,"_uuidv6"),_uuidv4:a(()=>u3r,"_uuidv4"),_uuid:a(()=>l3r,"_uuid"),_url:a(()=>p3r,"_url"),_uppercase:a(()=>D3r,"_uppercase"),_unknown:a(()=>LSt,"_unknown"),_union:a(()=>o6c,"_union"),_undefined:a(()=>MYi,"_undefined"),_ulid:a(()=>y3r,"_ulid"),_uint64:a(()=>DYi,"_uint64"),_uint32:a(()=>IYi,"_uint32"),_tuple:a(()=>WYi,"_tuple"),_trim:a(()=>F3r,"_trim"),_transform:a(()=>h6c,"_transform"),_toUpperCase:a(()=>Q3r,"_toUpperCase"),_toLowerCase:a(()=>U3r,"_toLowerCase"),_templateLiteral:a(()=>b6c,"_templateLiteral"),_symbol:a(()=>NYi,"_symbol"),_success:a(()=>E6c,"_success"),_stringbool:a(()=>JYi,"_stringbool"),_stringFormat:a(()=>ZYi,"_stringFormat"),_string:a(()=>pYi,"_string"),_startsWith:a(()=>M3r,"_startsWith"),_size:a(()=>R3r,"_size"),_set:a(()=>u6c,"_set"),_safeParseAsync:a(()=>VLr,"_safeParseAsync"),_safeParse:a(()=>$Lr,"_safeParse"),_regex:a(()=>P3r,"_regex"),_refine:a(()=>KYi,"_refine"),_record:a(()=>c6c,"_record"),_readonly:a(()=>C6c,"_readonly"),_property:a(()=>VYi,"_property"),_promise:a(()=>T6c,"_promise"),_positive:a(()=>jYi,"_positive"),_pipe:a(()=>v6c,"_pipe"),_parseAsync:a(()=>GLr,"_parseAsync"),_parse:a(()=>HLr,"_parse"),_overwrite:a(()=>Qne,"_overwrite"),_optional:a(()=>m6c,"_optional"),_number:a(()=>_Yi,"_number"),_nullable:a(()=>g6c,"_nullable"),_null:a(()=>OYi,"_null"),_normalize:a(()=>L3r,"_normalize"),_nonpositive:a(()=>GYi,"_nonpositive"),_nonoptional:a(()=>y6c,"_nonoptional"),_nonnegative:a(()=>$Yi,"_nonnegative"),_never:a(()=>LYi,"_never"),_negative:a(()=>HYi,"_negative"),_nativeEnum:a(()=>f6c,"_nativeEnum"),_nanoid:a(()=>m3r,"_nanoid"),_nan:a(()=>qYi,"_nan"),_multipleOf:a(()=>b3e,"_multipleOf"),_minSize:a(()=>S3e,"_minSize"),_minLength:a(()=>UEe,"_minLength"),_min:a(()=>oI,"_min"),_mime:a(()=>B3r,"_mime"),_maxSize:a(()=>RTt,"_maxSize"),_maxLength:a(()=>PTt,"_maxLength"),_max:a(()=>eN,"_max"),_map:a(()=>l6c,"_map"),_lte:a(()=>eN,"_lte"),_lt:a(()=>Mne,"_lt"),_lowercase:a(()=>k3r,"_lowercase"),_literal:a(()=>p6c,"_literal"),_length:a(()=>kTt,"_length"),_lazy:a(()=>S6c,"_lazy"),_ksuid:a(()=>_3r,"_ksuid"),_jwt:a(()=>w3r,"_jwt"),_isoTime:a(()=>yYi,"_isoTime"),_isoDuration:a(()=>EYi,"_isoDuration"),_isoDateTime:a(()=>gYi,"_isoDateTime"),_isoDate:a(()=>AYi,"_isoDate"),_ipv6:a(()=>C3r,"_ipv6"),_ipv4:a(()=>v3r,"_ipv4"),_intersection:a(()=>a6c,"_intersection"),_int64:a(()=>kYi,"_int64"),_int32:a(()=>TYi,"_int32"),_int:a(()=>CYi,"_int"),_includes:a(()=>N3r,"_includes"),_guid:a(()=>BSt,"_guid"),_gte:a(()=>oI,"_gte"),_gt:a(()=>One,"_gt"),_float64:a(()=>SYi,"_float64"),_float32:a(()=>bYi,"_float32"),_file:a(()=>zYi,"_file"),_enum:a(()=>d6c,"_enum"),_endsWith:a(()=>O3r,"_endsWith"),_emoji:a(()=>h3r,"_emoji"),_email:a(()=>c3r,"_email"),_e164:a(()=>x3r,"_e164"),_discriminatedUnion:a(()=>s6c,"_discriminatedUnion"),_default:a(()=>A6c,"_default"),_date:a(()=>UYi,"_date"),_custom:a(()=>YYi,"_custom"),_cuid2:a(()=>A3r,"_cuid2"),_cuid:a(()=>g3r,"_cuid"),_coercedString:a(()=>hYi,"_coercedString"),_coercedNumber:a(()=>vYi,"_coercedNumber"),_coercedDate:a(()=>QYi,"_coercedDate"),_coercedBoolean:a(()=>wYi,"_coercedBoolean"),_coercedBigint:a(()=>PYi,"_coercedBigint"),_cidrv6:a(()=>S3r,"_cidrv6"),_cidrv4:a(()=>b3r,"_cidrv4"),_catch:a(()=>_6c,"_catch"),_boolean:a(()=>xYi,"_boolean"),_bigint:a(()=>RYi,"_bigint"),_base64url:a(()=>I3r,"_base64url"),_base64:a(()=>T3r,"_base64"),_array:a(()=>q3r,"_array"),_any:a(()=>BYi,"_any"),TimePrecision:a(()=>mYi,"TimePrecision"),NEVER:a(()=>JVi,"NEVER"),JSONSchemaGenerator:a(()=>T3e,"JSONSchemaGenerator"),JSONSchema:a(()=>I6c,"JSONSchema"),Doc:a(()=>MSt,"Doc"),$output:a(()=>dYi,"$output"),$input:a(()=>fYi,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>ZVi,"$brand"),$ZodXID:a(()=>Azi,"$ZodXID"),$ZodVoid:a(()=>qzi,"$ZodVoid"),$ZodUnknown:a(()=>OSt,"$ZodUnknown"),$ZodUnion:a(()=>n3r,"$ZodUnion"),$ZodUndefined:a(()=>Lzi,"$ZodUndefined"),$ZodUUID:a(()=>lzi,"$ZodUUID"),$ZodURL:a(()=>dzi,"$ZodURL"),$ZodULID:a(()=>gzi,"$ZodULID"),$ZodType:a(()=>Co,"$ZodType"),$ZodTuple:a(()=>wTt,"$ZodTuple"),$ZodTransform:a(()=>i3r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>sYi,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Bzi,"$ZodSymbol"),$ZodSuccess:a(()=>rYi,"$ZodSuccess"),$ZodStringFormat:a(()=>Ru,"$ZodStringFormat"),$ZodString:a(()=>L3e,"$ZodString"),$ZodSet:a(()=>Wzi,"$ZodSet"),$ZodRegistry:a(()=>C3e,"$ZodRegistry"),$ZodRecord:a(()=>$zi,"$ZodRecord"),$ZodRealError:a(()=>O3e,"$ZodRealError"),$ZodReadonly:a(()=>oYi,"$ZodReadonly"),$ZodPromise:a(()=>aYi,"$ZodPromise"),$ZodPrefault:a(()=>eYi,"$ZodPrefault"),$ZodPipe:a(()=>o3r,"$ZodPipe"),$ZodOptional:a(()=>Jzi,"$ZodOptional"),$ZodObject:a(()=>r3r,"$ZodObject"),$ZodNumberFormat:a(()=>Mzi,"$ZodNumberFormat"),$ZodNumber:a(()=>ZLr,"$ZodNumber"),$ZodNullable:a(()=>Zzi,"$ZodNullable"),$ZodNull:a(()=>Fzi,"$ZodNull"),$ZodNonOptional:a(()=>tYi,"$ZodNonOptional"),$ZodNever:a(()=>Qzi,"$ZodNever"),$ZodNanoID:a(()=>pzi,"$ZodNanoID"),$ZodNaN:a(()=>iYi,"$ZodNaN"),$ZodMap:a(()=>Vzi,"$ZodMap"),$ZodLiteral:a(()=>Yzi,"$ZodLiteral"),$ZodLazy:a(()=>cYi,"$ZodLazy"),$ZodKSUID:a(()=>yzi,"$ZodKSUID"),$ZodJWT:a(()=>Dzi,"$ZodJWT"),$ZodIntersection:a(()=>Gzi,"$ZodIntersection"),$ZodISOTime:a(()=>vzi,"$ZodISOTime"),$ZodISODuration:a(()=>Czi,"$ZodISODuration"),$ZodISODateTime:a(()=>Ezi,"$ZodISODateTime"),$ZodISODate:a(()=>_zi,"$ZodISODate"),$ZodIPv6:a(()=>Szi,"$ZodIPv6"),$ZodIPv4:a(()=>bzi,"$ZodIPv4"),$ZodGUID:a(()=>czi,"$ZodGUID"),$ZodFunction:a(()=>FSt,"$ZodFunction"),$ZodFile:a(()=>Kzi,"$ZodFile"),$ZodError:a(()=>QLr,"$ZodError"),$ZodEnum:a(()=>zzi,"$ZodEnum"),$ZodEmoji:a(()=>fzi,"$ZodEmoji"),$ZodEmail:a(()=>uzi,"$ZodEmail"),$ZodE164:a(()=>Pzi,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>Hzi,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>Xzi,"$ZodDefault"),$ZodDate:a(()=>jzi,"$ZodDate"),$ZodCustomStringFormat:a(()=>Nzi,"$ZodCustomStringFormat"),$ZodCustom:a(()=>lYi,"$ZodCustom"),$ZodCheckUpperCase:a(()=>ezi,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>B3e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>rzi,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>zWi,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>ZWi,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>izi,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>szi,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>GWi,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>HWi,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>WWi,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>KWi,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>ozi,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>VWi,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>YWi,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>XWi,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>YLr,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>JWi,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>tzi,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>KLr,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>nzi,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>$Wi,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>fh,"$ZodCheck"),$ZodCatch:a(()=>nYi,"$ZodCatch"),$ZodCUID2:a(()=>mzi,"$ZodCUID2"),$ZodCUID:a(()=>hzi,"$ZodCUID"),$ZodCIDRv6:a(()=>Izi,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>Tzi,"$ZodCIDRv4"),$ZodBoolean:a(()=>XLr,"$ZodBoolean"),$ZodBigIntFormat:a(()=>Ozi,"$ZodBigIntFormat"),$ZodBigInt:a(()=>e3r,"$ZodBigInt"),$ZodBase64URL:a(()=>Rzi,"$ZodBase64URL"),$ZodBase64:a(()=>xzi,"$ZodBase64"),$ZodAsyncError:a(()=>dV,"$ZodAsyncError"),$ZodArray:a(()=>t3r,"$ZodArray"),$ZodAny:a(()=>Uzi,"$ZodAny")});JVi=Object.freeze({status:"aborted"});a(ft,"F");ZVi=Symbol("zod_brand"),dV=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},PSt={};a(Bv,"c$");Qs={};tB(Qs,{unwrapMessage:a(()=>zLe,"unwrapMessage"),stringifyPrimitive:a(()=>ns,"stringifyPrimitive"),required:a(()=>vFc,"required"),randomString:a(()=>fFc,"randomString"),propertyKeyTypes:a(()=>kSt,"propertyKeyTypes"),promiseAllObject:a(()=>dFc,"promiseAllObject"),primitiveTypes:a(()=>rWi,"primitiveTypes"),prefixIssues:a(()=>UR,"prefixIssues"),pick:a(()=>gFc,"pick"),partial:a(()=>_Fc,"partial"),optionalKeys:a(()=>nWi,"optionalKeys"),omit:a(()=>AFc,"omit"),numKeys:a(()=>pFc,"numKeys"),nullish:a(()=>Fne,"nullish"),normalizeParams:a(()=>Ir,"normalizeParams"),merge:a(()=>EFc,"merge"),jsonStringifyReplacer:a(()=>XVi,"jsonStringifyReplacer"),joinValues:a(()=>$r,"joinValues"),issue:a(()=>sWi,"issue"),isPlainObject:a(()=>v3e,"isPlainObject"),isObject:a(()=>_3e,"isObject"),getSizableOrigin:a(()=>STt,"getSizableOrigin"),getParsedType:a(()=>hFc,"getParsedType"),getLengthableOrigin:a(()=>TTt,"getLengthableOrigin"),getEnumValues:a(()=>LLr,"getEnumValues"),getElementAtPath:a(()=>uFc,"getElementAtPath"),floatSafeRemainder:a(()=>eWi,"floatSafeRemainder"),finalizeIssue:a(()=>nN,"finalizeIssue"),extend:a(()=>yFc,"extend"),escapeRegex:a(()=>Une,"escapeRegex"),esc:a(()=>dEe,"esc"),defineLazy:a(()=>Hc,"defineLazy"),createTransparentProxy:a(()=>mFc,"createTransparentProxy"),clone:a(()=>aN,"clone"),cleanRegex:a(()=>bTt,"cleanRegex"),cleanEnum:a(()=>CFc,"cleanEnum"),captureStackTrace:a(()=>ULr,"captureStackTrace"),cached:a(()=>CTt,"cached"),assignProp:a(()=>FLr,"assignProp"),assertNotEqual:a(()=>sFc,"assertNotEqual"),assertNever:a(()=>cFc,"assertNever"),assertIs:a(()=>aFc,"assertIs"),assertEqual:a(()=>oFc,"assertEqual"),assert:a(()=>lFc,"assert"),allowsEval:a(()=>tWi,"allowsEval"),aborted:a(()=>gEe,"aborted"),NUMBER_FORMAT_RANGES:a(()=>iWi,"NUMBER_FORMAT_RANGES"),Class:a(()=>TBr,"Class"),BIGINT_FORMAT_RANGES:a(()=>oWi,"BIGINT_FORMAT_RANGES")});a(oFc,"lh");a(sFc,"ch");a(aFc,"ph");a(cFc,"dh");a(lFc,"ih");a(LLr,"B7");a($r,"P");a(XVi,"mH");a(CTt,"z7");a(Fne,"I1");a(bTt,"N7");a(eWi,"lH");a(Hc,"N$");a(FLr,"cH");a(uFc,"nh");a(dFc,"rh");a(fFc,"oh");a(dEe,"j0");ULr=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(_3e,"g8");tWi=CTt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(v3e,"h8");a(pFc,"th");hFc=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"),kSt=new Set(["string","number","symbol"]),rWi=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(Une,"r4");a(aN,"H6");a(Ir,"k");a(mFc,"sh");a(ns,"x");a(nWi,"iH");iWi={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]},oWi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(gFc,"eh");a(AFc,"$u");a(yFc,"Qu");a(EFc,"Ju");a(_Fc,"Xu");a(vFc,"Yu");a(gEe,"A0");a(UR,"I6");a(zLe,"V7");a(nN,"g6");a(STt,"O7");a(TTt,"D7");a(sWi,"oH");a(CFc,"Wu");TBr=class{static{a(this,"YM")}constructor(...e){}},aWi=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,XVi,2)},enumerable:!0})},"WM"),QLr=ft("$ZodError",aWi),O3e=ft("$ZodError",aWi,{Parent:Error});a(qLr,"m8");a(jLr,"l8");a(cWi,"mX");a(lWi,"GM");a(uWi,"lX");HLr=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 dV;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>nN(u,s,Bv())));throw ULr(l,o?.callee),l}return c.value},"cX"),DSt=HLr(O3e),GLr=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=>nN(u,s,Bv())));throw ULr(l,o?.callee),l}return c.value},"pX"),NSt=GLr(O3e),$Lr=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 dV;return s.issues.length?{success:!1,error:new(t??QLr)(s.issues.map(c=>nN(c,o,Bv())))}:{success:!0,data:s.value}},"dX"),ITt=$Lr(O3e),VLr=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=>nN(c,o,Bv())))}:{success:!0,data:s.value}},"iX"),xTt=VLr(O3e),WLr={};tB(WLr,{xid:a(()=>hWi,"xid"),uuid7:a(()=>IFc,"uuid7"),uuid6:a(()=>TFc,"uuid6"),uuid4:a(()=>SFc,"uuid4"),uuid:a(()=>FEe,"uuid"),uppercase:a(()=>qWi,"uppercase"),unicodeEmail:a(()=>RFc,"unicodeEmail"),undefined:a(()=>UWi,"undefined"),ulid:a(()=>pWi,"ulid"),time:a(()=>kWi,"time"),string:a(()=>NWi,"string"),rfc5322Email:a(()=>wFc,"rfc5322Email"),number:a(()=>BWi,"number"),null:a(()=>FWi,"null"),nanoid:a(()=>gWi,"nanoid"),lowercase:a(()=>QWi,"lowercase"),ksuid:a(()=>mWi,"ksuid"),ipv6:a(()=>CWi,"ipv6"),ipv4:a(()=>vWi,"ipv4"),integer:a(()=>OWi,"integer"),html5Email:a(()=>xFc,"html5Email"),hostname:a(()=>IWi,"hostname"),guid:a(()=>yWi,"guid"),extendedDuration:a(()=>bFc,"extendedDuration"),emoji:a(()=>_Wi,"emoji"),email:a(()=>EWi,"email"),e164:a(()=>xWi,"e164"),duration:a(()=>AWi,"duration"),domain:a(()=>DFc,"domain"),datetime:a(()=>DWi,"datetime"),date:a(()=>RWi,"date"),cuid2:a(()=>fWi,"cuid2"),cuid:a(()=>dWi,"cuid"),cidrv6:a(()=>SWi,"cidrv6"),cidrv4:a(()=>bWi,"cidrv4"),browserEmail:a(()=>PFc,"browserEmail"),boolean:a(()=>LWi,"boolean"),bigint:a(()=>MWi,"bigint"),base64url:a(()=>zLr,"base64url"),base64:a(()=>TWi,"base64"),_emoji:a(()=>kFc,"_emoji")});dWi=/^[cC][^\s-]{8,}$/,fWi=/^[0-9a-z]+$/,pWi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hWi=/^[0-9a-vA-V]{20}$/,mWi=/^[A-Za-z0-9]{27}$/,gWi=/^[a-zA-Z0-9_-]{21}$/,AWi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bFc=/^[-+]?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)?)??$/,yWi=/^([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})$/,FEe=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"),SFc=FEe(4),TFc=FEe(6),IFc=FEe(7),EWi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xFc=/^[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])?)*$/,wFc=/^(([^<>()\[\]\\.,;:\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,}))$/,RFc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,PFc=/^[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])?)*$/,kFc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(_Wi,"WK");vWi=/^(?:(?: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])$/,CWi=/^(([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})$/,bWi=/^((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])$/,SWi=/^(([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])$/,TWi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zLr=/^[A-Za-z0-9_-]*$/,IWi=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,DFc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,xWi=/^\+(?:[0-9]){6,14}[0-9]$/,wWi="(?:(?:\\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])))",RWi=new RegExp(`^${wWi}$`);a(PWi,"HM");a(kWi,"NK");a(DWi,"wK");NWi=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),MWi=/^\d+n?$/,OWi=/^\d+$/,BWi=/^-?\d+(?:\.\d+)?/i,LWi=/true|false/i,FWi=/null/i,UWi=/undefined/i,QWi=/^[^A-Z]*$/,qWi=/^[^a-z]*$/,fh=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),jWi={number:"number",bigint:"bigint",object:"date"},YLr=ft("$ZodCheckLessThan",(t,e)=>{fh.init(t,e);let r=jWi[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{fh.init(t,e);let r=jWi[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})}}),HWi=ft("$ZodCheckMultipleOf",(t,e)=>{fh.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):eWi(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})}}),GWi=ft("$ZodCheckNumberFormat",(t,e)=>{fh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=iWi[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=OWi)}),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})}}),$Wi=ft("$ZodCheckBigIntFormat",(t,e)=>{fh.init(t,e);let[r,n]=oWi[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})}}),VWi=ft("$ZodCheckMaxSize",(t,e)=>{fh.init(t,e),t._zod.when=r=>{let n=r.value;return!Fne(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:STt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),WWi=ft("$ZodCheckMinSize",(t,e)=>{fh.init(t,e),t._zod.when=r=>{let n=r.value;return!Fne(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:STt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),zWi=ft("$ZodCheckSizeEquals",(t,e)=>{fh.init(t,e),t._zod.when=r=>{let n=r.value;return!Fne(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:STt(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})}}),YWi=ft("$ZodCheckMaxLength",(t,e)=>{fh.init(t,e),t._zod.when=r=>{let n=r.value;return!Fne(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=TTt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),KWi=ft("$ZodCheckMinLength",(t,e)=>{fh.init(t,e),t._zod.when=r=>{let n=r.value;return!Fne(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=TTt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),JWi=ft("$ZodCheckLengthEquals",(t,e)=>{fh.init(t,e),t._zod.when=r=>{let n=r.value;return!Fne(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=TTt(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})}}),B3e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;fh.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=()=>{})}),ZWi=ft("$ZodCheckRegex",(t,e)=>{B3e.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})}}),XWi=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=QWi),B3e.init(t,e)}),ezi=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=qWi),B3e.init(t,e)}),tzi=ft("$ZodCheckIncludes",(t,e)=>{fh.init(t,e);let r=Une(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})}}),rzi=ft("$ZodCheckStartsWith",(t,e)=>{fh.init(t,e);let r=new RegExp(`^${Une(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})}}),nzi=ft("$ZodCheckEndsWith",(t,e)=>{fh.init(t,e);let r=new RegExp(`.*${Une(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(kHi,"KM");izi=ft("$ZodCheckProperty",(t,e)=>{fh.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=>kHi(o,r,e.property));kHi(n,r,e.property)}}),ozi=ft("$ZodCheckMimeType",(t,e)=>{fh.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})}}),szi=ft("$ZodCheckOverwrite",(t,e)=>{fh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),MSt=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(` -`))}},kYi={major:4,minor:0,patch:0},bo=st("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=kYi;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=UEe(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 RV;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=UEe(s,h)))});else{if(s.issues.length===h)continue;u||(u=UEe(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 RV;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=cIt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return lIt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),uFe=st("$ZodString",(t,e)=>{bo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??rYi(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}}),ku=st("$ZodStringFormat",(t,e)=>{lFe.init(t,e),uFe.init(t,e)}),PYi=st("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=qzi),ku.init(t,e)}),DYi=st("$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=a_e(r))}else e.pattern??(e.pattern=a_e());ku.init(t,e)}),NYi=st("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=jzi),ku.init(t,e)}),MYi=st("$ZodURL",(t,e)=>{ku.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:Yzi.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})}}}),OYi=st("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Hzi()),ku.init(t,e)}),BYi=st("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Uzi),ku.init(t,e)}),LYi=st("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Mzi),ku.init(t,e)}),FYi=st("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Ozi),ku.init(t,e)}),UYi=st("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Bzi),ku.init(t,e)}),QYi=st("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Lzi),ku.init(t,e)}),qYi=st("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Fzi),ku.init(t,e)}),jYi=st("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=tYi(e)),ku.init(t,e)}),HYi=st("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Zzi),ku.init(t,e)}),GYi=st("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=eYi(e)),ku.init(t,e)}),$Yi=st("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Qzi),ku.init(t,e)}),VYi=st("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Gzi),ku.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),WYi=st("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=$zi),ku.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})}}}),zYi=st("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Vzi),ku.init(t,e)}),YYi=st("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Wzi),ku.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(tFr,"oK");KYi=st("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=zzi),ku.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{tFr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(JYi,"AM");ZYi=st("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Z3r),ku.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{JYi(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),XYi=st("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Kzi),ku.init(t,e)});a(eKi,"IM");tKi=st("$ZodJWT",(t,e)=>{ku.init(t,e),t._zod.check=r=>{eKi(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),rKi=st("$ZodCustomStringFormat",(t,e)=>{ku.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})}}),rFr=st("$ZodNumber",(t,e)=>{bo.init(t,e),t._zod.pattern=t._zod.bag.pattern??oYi,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}}),nKi=st("$ZodNumber",(t,e)=>{pYi.init(t,e),rFr.init(t,e)}),nFr=st("$ZodBoolean",(t,e)=>{bo.init(t,e),t._zod.pattern=sYi,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}}),iFr=st("$ZodBigInt",(t,e)=>{bo.init(t,e),t._zod.pattern=nYi,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}}),iKi=st("$ZodBigInt",(t,e)=>{hYi.init(t,e),iFr.init(t,e)}),oKi=st("$ZodSymbol",(t,e)=>{bo.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}}),sKi=st("$ZodUndefined",(t,e)=>{bo.init(t,e),t._zod.pattern=cYi,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}}),aKi=st("$ZodNull",(t,e)=>{bo.init(t,e),t._zod.pattern=aYi,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}}),cKi=st("$ZodAny",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),ATt=st("$ZodUnknown",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),lKi=st("$ZodNever",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),uKi=st("$ZodVoid",(t,e)=>{bo.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}}),dKi=st("$ZodDate",(t,e)=>{bo.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(t$i,"BM");oFr=st("$ZodArray",(t,e)=>{bo.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;ct$i(d,r,c))):t$i(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(fSt,"aX");a(r$i,"zM");sFr=st("$ZodObject",(t,e)=>{bo.init(t,e);let r=iIt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof bo))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=Izi(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});Vc(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 gTt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=MEe(_);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=MEe(_);h.write(` +`))}},azi={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=azi;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=gEe(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 dV;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=gEe(s,h)))});else{if(s.issues.length===h)continue;u||(u=gEe(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 dV;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=ITt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return xTt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),L3e=ft("$ZodString",(t,e)=>{Co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??NWi(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}}),Ru=ft("$ZodStringFormat",(t,e)=>{B3e.init(t,e),L3e.init(t,e)}),czi=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=yWi),Ru.init(t,e)}),lzi=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=FEe(r))}else e.pattern??(e.pattern=FEe());Ru.init(t,e)}),uzi=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=EWi),Ru.init(t,e)}),dzi=ft("$ZodURL",(t,e)=>{Ru.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:IWi.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})}}}),fzi=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=_Wi()),Ru.init(t,e)}),pzi=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=gWi),Ru.init(t,e)}),hzi=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=dWi),Ru.init(t,e)}),mzi=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=fWi),Ru.init(t,e)}),gzi=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=pWi),Ru.init(t,e)}),Azi=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=hWi),Ru.init(t,e)}),yzi=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=mWi),Ru.init(t,e)}),Ezi=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=DWi(e)),Ru.init(t,e)}),_zi=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=RWi),Ru.init(t,e)}),vzi=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=kWi(e)),Ru.init(t,e)}),Czi=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=AWi),Ru.init(t,e)}),bzi=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=vWi),Ru.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Szi=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=CWi),Ru.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})}}}),Tzi=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=bWi),Ru.init(t,e)}),Izi=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=SWi),Ru.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(JLr,"oK");xzi=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=TWi),Ru.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{JLr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(wzi,"AM");Rzi=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=zLr),Ru.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{wzi(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Pzi=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=xWi),Ru.init(t,e)});a(kzi,"IM");Dzi=ft("$ZodJWT",(t,e)=>{Ru.init(t,e),t._zod.check=r=>{kzi(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Nzi=ft("$ZodCustomStringFormat",(t,e)=>{Ru.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})}}),ZLr=ft("$ZodNumber",(t,e)=>{Co.init(t,e),t._zod.pattern=t._zod.bag.pattern??BWi,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}}),Mzi=ft("$ZodNumber",(t,e)=>{GWi.init(t,e),ZLr.init(t,e)}),XLr=ft("$ZodBoolean",(t,e)=>{Co.init(t,e),t._zod.pattern=LWi,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}}),e3r=ft("$ZodBigInt",(t,e)=>{Co.init(t,e),t._zod.pattern=MWi,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}}),Ozi=ft("$ZodBigInt",(t,e)=>{$Wi.init(t,e),e3r.init(t,e)}),Bzi=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}}),Lzi=ft("$ZodUndefined",(t,e)=>{Co.init(t,e),t._zod.pattern=UWi,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}}),Fzi=ft("$ZodNull",(t,e)=>{Co.init(t,e),t._zod.pattern=FWi,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}}),Uzi=ft("$ZodAny",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),OSt=ft("$ZodUnknown",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),Qzi=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)}),qzi=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}}),jzi=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(DHi,"BM");t3r=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;cDHi(d,r,c))):DHi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(P1t,"aX");a(NHi,"zM");r3r=ft("$ZodObject",(t,e)=>{Co.init(t,e);let r=CTt(()=>{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=nWi(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});Hc(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 MSt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=dEe(_);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=dEe(_);h.write(` if (${v}.issues.length) { if (input[${b}] === undefined) { if (${b} in input) { @@ -1651,80 +1607,80 @@ 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 ? [${MEe(_)}, ...iss.path] : [${MEe(_)}] - })));`),h.write(`newResult[${MEe(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=W3e,c=!fTt.jitless,l=c&&Szi.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?r$i(x,f,b,m):fSt(x,f,b))):R?r$i(w,f,b,m):fSt(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=>fSt(T,f,v))):fSt(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(n$i,"NM");aFr=st("$ZodUnion",(t,e)=>{bo.init(t,e),Vc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Vc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Vc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Vc(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=>oIt(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=>n$i(c,r,t,n)):n$i(s,r,t,n)}}),fKi=st("$ZodDiscriminatedUnion",(t,e)=>{aFr.init(t,e);let r=t._zod.parse;Vc(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=iIt(()=>{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(!W3e(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)}}),pKi=st("$ZodIntersection",(t,e)=>{bo.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])=>i$i(r,l,u)):i$i(r,s,c)}});a(kLr,"pK");a(i$i,"wM");uIt=st("$ZodTuple",(t,e)=>{bo.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=>pSt(h,o,u))):pSt(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=>pSt(m,o,u))):pSt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(pSt,"sX");hKi=st("$ZodRecord",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!z3e(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(...VR(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...VR(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=>dN(d,n,QC())),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(...VR(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...VR(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),mKi=st("$ZodMap",(t,e)=>{bo.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])=>{o$i(f,h,r,c,o,t,n)})):o$i(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(o$i,"OM");gKi=st("$ZodSet",(t,e)=>{bo.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=>s$i(u,r))):s$i(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(s$i,"DM");AKi=st("$ZodEnum",(t,e)=>{bo.init(t,e);let r=q3r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>pTt.has(typeof n)).map(n=>typeof n=="string"?rie(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}}),yKi=st("$ZodLiteral",(t,e)=>{bo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?rie(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}}),EKi=st("$ZodFile",(t,e)=>{bo.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}}),cFr=st("$ZodTransform",(t,e)=>{bo.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 RV;return r.value=o,r}}),_Ki=st("$ZodOptional",(t,e)=>{bo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Vc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Vc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${oIt(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)}),CKi=st("$ZodNullable",(t,e)=>{bo.init(t,e),Vc(t._zod,"optin",()=>e.innerType._zod.optin),Vc(t._zod,"optout",()=>e.innerType._zod.optout),Vc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${oIt(r.source)}|null)$`):void 0}),Vc(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)}),vKi=st("$ZodDefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",Vc(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=>a$i(s,e)):a$i(o,e)}});a(a$i,"FM");bKi=st("$ZodPrefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",Vc(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))}),SKi=st("$ZodNonOptional",(t,e)=>{bo.init(t,e),Vc(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=>c$i(s,t)):c$i(o,t)}});a(c$i,"ZM");TKi=st("$ZodSuccess",(t,e)=>{bo.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)}}),IKi=st("$ZodCatch",(t,e)=>{bo.init(t,e),t._zod.optin="optional",Vc(t._zod,"optout",()=>e.innerType._zod.optout),Vc(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=>dN(c,n,QC()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>dN(s,n,QC()))},input:r.value}),r.issues=[]),r)}}),xKi=st("$ZodNaN",(t,e)=>{bo.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)}),lFr=st("$ZodPipe",(t,e)=>{bo.init(t,e),Vc(t._zod,"values",()=>e.in._zod.values),Vc(t._zod,"optin",()=>e.in._zod.optin),Vc(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=>l$i(s,e,n)):l$i(o,e,n)}});a(l$i,"MM");wKi=st("$ZodReadonly",(t,e)=>{bo.init(t,e),Vc(t._zod,"propValues",()=>e.innerType._zod.propValues),Vc(t._zod,"values",()=>e.innerType._zod.values),Vc(t._zod,"optin",()=>e.innerType._zod.optin),Vc(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(u$i):u$i(o)}});a(u$i,"LM");RKi=st("$ZodTemplateLiteral",(t,e)=>{bo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof bo){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||Tzi.has(typeof n))r.push(rie(`${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)}),kKi=st("$ZodPromise",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),PKi=st("$ZodLazy",(t,e)=>{bo.init(t,e),Vc(t._zod,"innerType",()=>e.getter()),Vc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Vc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Vc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Vc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),DKi=st("$ZodCustom",(t,e)=>{dh.init(t,e),bo.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=>d$i(s,r,n,t));d$i(o,r,n,t)}});a(d$i,"jM");uFr={};pB(uFr,{zhTW:a(()=>aQc,"zhTW"),zhCN:a(()=>oQc,"zhCN"),vi:a(()=>nQc,"vi"),ur:a(()=>tQc,"ur"),ua:a(()=>X7c,"ua"),tr:a(()=>J7c,"tr"),th:a(()=>z7c,"th"),ta:a(()=>V7c,"ta"),sv:a(()=>G7c,"sv"),sl:a(()=>j7c,"sl"),ru:a(()=>Q7c,"ru"),pt:a(()=>F7c,"pt"),ps:a(()=>M7c,"ps"),pl:a(()=>B7c,"pl"),ota:a(()=>D7c,"ota"),no:a(()=>k7c,"no"),nl:a(()=>w7c,"nl"),ms:a(()=>I7c,"ms"),mk:a(()=>S7c,"mk"),ko:a(()=>v7c,"ko"),kh:a(()=>_7c,"kh"),ja:a(()=>y7c,"ja"),it:a(()=>g7c,"it"),id:a(()=>h7c,"id"),hu:a(()=>f7c,"hu"),he:a(()=>u7c,"he"),frCA:a(()=>c7c,"frCA"),fr:a(()=>s7c,"fr"),fi:a(()=>i7c,"fi"),fa:a(()=>r7c,"fa"),es:a(()=>e7c,"es"),eo:a(()=>ZUc,"eo"),en:a(()=>NKi,"en"),de:a(()=>WUc,"de"),cs:a(()=>$Uc,"cs"),ca:a(()=>HUc,"ca"),be:a(()=>qUc,"be"),az:a(()=>UUc,"az"),ar:a(()=>LUc,"ar")});BUc=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 ${os(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: ${$r(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":""}: ${$r(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(LUc,"tK");FUc=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 ${os(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$r(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":""}: ${$r(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(UUc,"aK");a(f$i,"PM");QUc=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 ${os(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 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=f$i(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=f$i(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"}: ${$r(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(qUc,"sK");jUc=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 ${os(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$r(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":""}: ${$r(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(HUc,"eK");GUc=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 ${os(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$r(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: ${$r(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($Uc,"$q");VUc=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 ${os(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$r(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"}: ${$r(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(WUc,"Qq");zUc=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"),YUc=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 ${zUc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${os(n.values[0])}`:`Invalid option: expected one of ${$r(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":""}: ${$r(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(NKi,"A7");KUc=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"),JUc=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 ${KUc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${os(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$r(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":""}: ${$r(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(ZUc,"Jq");XUc=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 ${os(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$r(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":""}: ${$r(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(e7c,"Xq");t7c=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 ${os(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 ${$r(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: ${$r(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(r7c,"Yq");n7c=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 ${os(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$r(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"}: ${$r(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(i7c,"Wq");o7c=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 : ${os(o.values[0])} attendu`:`Option invalide : une valeur parmi ${$r(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":""} : ${$r(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(s7c,"Gq");a7c=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 ${os(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$r(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":""} : ${$r(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(c7c,"Uq");l7c=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 ${os(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 ${$r(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"}: ${$r(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(u7c,"Hq");d7c=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 ${os(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$r(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":""}: ${$r(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(f7c,"Kq");p7c=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 ${os(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$r(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":""}: ${$r(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(h7c,"qq");m7c=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 ${os(o.values[0])}`:`Opzione non valida: atteso uno tra ${$r(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"}: ${$r(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(g7c,"Vq");A7c=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: ${os(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$r(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":""}: ${$r(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(y7c,"Bq");E7c=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 ${os(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 ${$r(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 ${$r(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(_7c,"zq");C7c=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 ${os(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$r(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: ${$r(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(v7c,"Nq");b7c=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 ${os(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 ${$r(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"}: ${$r(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(S7c,"wq");T7c=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 ${os(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$r(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: ${$r(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(I7c,"Oq");x7c=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 ${os(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$r(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":""}: ${$r(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(w7c,"Dq");R7c=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 ${os(o.values[0])}`:`Ugyldig valg: forventet en av ${$r(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"}: ${$r(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(k7c,"Fq");P7c=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 ${os(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$r(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":""}: ${$r(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(D7c,"Zq");N7c=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 ${os(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${$r(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"}: ${$r(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(M7c,"Mq");O7c=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 ${os(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$r(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":""}: ${$r(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(B7c,"Lq");L7c=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 ${os(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$r(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":""}: ${$r(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(F7c,"jq");a(p$i,"EM");U7c=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 ${os(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 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=p$i(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=p$i(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":""}: ${$r(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(Q7c,"Aq");q7c=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 ${os(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$r(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"}: ${$r(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(j7c,"Iq");H7c=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 ${os(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$r(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"}: ${$r(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(G7c,"Rq");$7c=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 ${os(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 ${$r(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":""}: ${$r(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(V7c,"Pq");W7c=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 ${os(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 ${$r(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: ${$r(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(z7c,"Eq");Y7c=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"),K7c=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 ${Y7c(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${os(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$r(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":""}: ${$r(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(J7c,"bq");Z7c=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 ${os(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 ${$r(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":""}: ${$r(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(X7c,"_q");eQc=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: ${os(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$r(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":""}: ${$r(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(tQc,"kq");rQc=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 ${os(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 ${$r(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: ${$r(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(nQc,"Sq");iQc=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 ${os(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$r(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): ${$r(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(oQc,"vq");sQc=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 ${os(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$r(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${$r(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(aQc,"Cq");MKi=Symbol("ZodOutput"),OKi=Symbol("ZodInput"),Y3e=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(dFr,"R7");d9=dFr();a(BKi,"aY");a(LKi,"Tq");a(fFr,"P7");a(yTt,"o8");a(pFr,"E7");a(hFr,"b7");a(mFr,"_7");a(gFr,"k7");a(AFr,"S7");a(yFr,"v7");a(EFr,"C7");a(_Fr,"T7");a(CFr,"x7");a(vFr,"y7");a(bFr,"f7");a(SFr,"g7");a(TFr,"h7");a(IFr,"u7");a(xFr,"m7");a(wFr,"l7");a(RFr,"c7");a(kFr,"p7");a(PFr,"d7");a(DFr,"i7");FKi={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(UKi,"xq");a(QKi,"yq");a(qKi,"fq");a(jKi,"gq");a(HKi,"eY");a(GKi,"hq");a($Ki,"$3");a(VKi,"Q3");a(WKi,"J3");a(zKi,"X3");a(YKi,"Y3");a(KKi,"W3");a(JKi,"uq");a(ZKi,"G3");a(XKi,"mq");a(eJi,"U3");a(tJi,"H3");a(rJi,"K3");a(nJi,"q3");a(iJi,"V3");a(oJi,"B3");a(ETt,"b0");a(sJi,"z3");a(aJi,"N3");a(cJi,"w3");a(lJi,"lq");a(uJi,"O3");a(Jne,"o4");a(cN,"t6");a(Zne,"t4");a(dI,"P6");a(dJi,"cq");a(fJi,"pq");a(pJi,"dq");a(hJi,"iq");a(K3e,"_0");a(dIt,"t8");a(J3e,"k0");a(NFr,"n7");a(fIt,"a8");a(c_e,"k1");a(pIt,"s8");a(MFr,"r7");a(OFr,"o7");a(BFr,"t7");a(LFr,"a7");a(FFr,"s7");a(UFr,"e7");a(mJi,"nq");a(QFr,"$J");a(nie,"a4");a(qFr,"QJ");a(jFr,"JJ");a(HFr,"XJ");a(GFr,"YJ");a($Fr,"WJ");a(cQc,"Wm");a(lQc,"Gm");a(uQc,"Um");a(gJi,"rq");a(dQc,"Hm");a(fQc,"Km");a(pQc,"qm");a(hQc,"Vm");a(mQc,"Bm");a(gQc,"zm");a(AJi,"D3");a(AQc,"Nm");a(yQc,"wm");a(EQc,"Om");a(_Qc,"Dm");a(CQc,"Fm");a(vQc,"Zm");a(bQc,"Mm");a(SQc,"Lm");a(TQc,"jm");a(IQc,"Am");a(xQc,"Im");a(wQc,"Rm");a(yJi,"F3");a(EJi,"Z3");a(_Ji,"M3");a(CJi,"L3");_Tt=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?hTt(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?hTt(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 mTt(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?mTt(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 uIt({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(vJi,"j3");Z3e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??d9,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=q3r(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"&&Sm(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 ? [${dEe(_)}, ...iss.path] : [${dEe(_)}] + })));`),h.write(`newResult[${dEe(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=_3e,c=!PSt.jitless,l=c&&tWi.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?NHi(x,f,b,m):P1t(x,f,b))):R?NHi(w,f,b,m):P1t(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=>P1t(T,f,v))):P1t(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(MHi,"NM");n3r=ft("$ZodUnion",(t,e)=>{Co.init(t,e),Hc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Hc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Hc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Hc(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=>bTt(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=>MHi(c,r,t,n)):MHi(s,r,t,n)}}),Hzi=ft("$ZodDiscriminatedUnion",(t,e)=>{n3r.init(t,e);let r=t._zod.parse;Hc(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=CTt(()=>{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(!_3e(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)}}),Gzi=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])=>OHi(r,l,u)):OHi(r,s,c)}});a(IBr,"pK");a(OHi,"wM");wTt=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=>k1t(h,o,u))):k1t(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=>k1t(m,o,u))):k1t(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(k1t,"sX");$zi=ft("$ZodRecord",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!v3e(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(...UR(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...UR(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=>nN(d,n,Bv())),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(...UR(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...UR(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Vzi=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])=>{BHi(f,h,r,c,o,t,n)})):BHi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(BHi,"OM");Wzi=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=>LHi(u,r))):LHi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(LHi,"DM");zzi=ft("$ZodEnum",(t,e)=>{Co.init(t,e);let r=LLr(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>kSt.has(typeof n)).map(n=>typeof n=="string"?Une(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}}),Yzi=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"?Une(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}}),Kzi=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}}),i3r=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 dV;return r.value=o,r}}),Jzi=ft("$ZodOptional",(t,e)=>{Co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Hc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Hc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bTt(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)}),Zzi=ft("$ZodNullable",(t,e)=>{Co.init(t,e),Hc(t._zod,"optin",()=>e.innerType._zod.optin),Hc(t._zod,"optout",()=>e.innerType._zod.optout),Hc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bTt(r.source)}|null)$`):void 0}),Hc(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)}),Xzi=ft("$ZodDefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Hc(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=>FHi(s,e)):FHi(o,e)}});a(FHi,"FM");eYi=ft("$ZodPrefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Hc(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))}),tYi=ft("$ZodNonOptional",(t,e)=>{Co.init(t,e),Hc(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=>UHi(s,t)):UHi(o,t)}});a(UHi,"ZM");rYi=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)}}),nYi=ft("$ZodCatch",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Hc(t._zod,"optout",()=>e.innerType._zod.optout),Hc(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=>nN(c,n,Bv()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>nN(s,n,Bv()))},input:r.value}),r.issues=[]),r)}}),iYi=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)}),o3r=ft("$ZodPipe",(t,e)=>{Co.init(t,e),Hc(t._zod,"values",()=>e.in._zod.values),Hc(t._zod,"optin",()=>e.in._zod.optin),Hc(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=>QHi(s,e,n)):QHi(o,e,n)}});a(QHi,"MM");oYi=ft("$ZodReadonly",(t,e)=>{Co.init(t,e),Hc(t._zod,"propValues",()=>e.innerType._zod.propValues),Hc(t._zod,"values",()=>e.innerType._zod.values),Hc(t._zod,"optin",()=>e.innerType._zod.optin),Hc(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(qHi):qHi(o)}});a(qHi,"LM");sYi=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||rWi.has(typeof n))r.push(Une(`${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)}),aYi=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))}),cYi=ft("$ZodLazy",(t,e)=>{Co.init(t,e),Hc(t._zod,"innerType",()=>e.getter()),Hc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Hc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Hc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Hc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),lYi=ft("$ZodCustom",(t,e)=>{fh.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=>jHi(s,r,n,t));jHi(o,r,n,t)}});a(jHi,"jM");s3r={};tB(s3r,{zhTW:a(()=>i6c,"zhTW"),zhCN:a(()=>r6c,"zhCN"),vi:a(()=>e6c,"vi"),ur:a(()=>Z8c,"ur"),ua:a(()=>K8c,"ua"),tr:a(()=>z8c,"tr"),th:a(()=>$8c,"th"),ta:a(()=>H8c,"ta"),sv:a(()=>q8c,"sv"),sl:a(()=>U8c,"sl"),ru:a(()=>L8c,"ru"),pt:a(()=>O8c,"pt"),ps:a(()=>k8c,"ps"),pl:a(()=>N8c,"pl"),ota:a(()=>R8c,"ota"),no:a(()=>x8c,"no"),nl:a(()=>T8c,"nl"),ms:a(()=>b8c,"ms"),mk:a(()=>v8c,"mk"),ko:a(()=>E8c,"ko"),kh:a(()=>A8c,"kh"),ja:a(()=>m8c,"ja"),it:a(()=>p8c,"it"),id:a(()=>d8c,"id"),hu:a(()=>l8c,"hu"),he:a(()=>a8c,"he"),frCA:a(()=>o8c,"frCA"),fr:a(()=>n8c,"fr"),fi:a(()=>t8c,"fi"),fa:a(()=>XFc,"fa"),es:a(()=>JFc,"es"),eo:a(()=>YFc,"eo"),en:a(()=>uYi,"en"),de:a(()=>GFc,"de"),cs:a(()=>jFc,"cs"),ca:a(()=>QFc,"ca"),be:a(()=>FFc,"be"),az:a(()=>BFc,"az"),ar:a(()=>MFc,"ar")});NFc=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 ${ns(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: ${$r(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":""}: ${$r(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(MFc,"tK");OFc=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 ${ns(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$r(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":""}: ${$r(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(BFc,"aK");a(HHi,"PM");LFc=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 ${ns(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 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=HHi(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=HHi(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"}: ${$r(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(FFc,"sK");UFc=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 ${ns(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$r(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":""}: ${$r(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(QFc,"eK");qFc=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 ${ns(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$r(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: ${$r(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(jFc,"$q");HFc=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 ${ns(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$r(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"}: ${$r(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(GFc,"Qq");$Fc=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"),VFc=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 ${$Fc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${ns(n.values[0])}`:`Invalid option: expected one of ${$r(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":""}: ${$r(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(uYi,"A7");WFc=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"),zFc=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 ${WFc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${ns(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$r(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":""}: ${$r(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(YFc,"Jq");KFc=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 ${ns(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$r(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":""}: ${$r(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(JFc,"Xq");ZFc=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 ${ns(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 ${$r(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: ${$r(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(XFc,"Yq");e8c=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 ${ns(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$r(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"}: ${$r(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(t8c,"Wq");r8c=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 : ${ns(o.values[0])} attendu`:`Option invalide : une valeur parmi ${$r(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":""} : ${$r(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(n8c,"Gq");i8c=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 ${ns(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$r(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":""} : ${$r(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(o8c,"Uq");s8c=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 ${ns(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 ${$r(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"}: ${$r(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(a8c,"Hq");c8c=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 ${ns(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$r(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":""}: ${$r(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(l8c,"Kq");u8c=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 ${ns(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$r(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":""}: ${$r(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(d8c,"qq");f8c=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 ${ns(o.values[0])}`:`Opzione non valida: atteso uno tra ${$r(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"}: ${$r(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(p8c,"Vq");h8c=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: ${ns(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$r(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":""}: ${$r(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(m8c,"Bq");g8c=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 ${ns(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 ${$r(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 ${$r(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(A8c,"zq");y8c=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 ${ns(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$r(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: ${$r(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(E8c,"Nq");_8c=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 ${ns(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 ${$r(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"}: ${$r(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(v8c,"wq");C8c=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 ${ns(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$r(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: ${$r(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(b8c,"Oq");S8c=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 ${ns(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$r(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":""}: ${$r(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(T8c,"Dq");I8c=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 ${ns(o.values[0])}`:`Ugyldig valg: forventet en av ${$r(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"}: ${$r(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(x8c,"Fq");w8c=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 ${ns(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$r(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":""}: ${$r(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(R8c,"Zq");P8c=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 ${ns(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${$r(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"}: ${$r(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(k8c,"Mq");D8c=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 ${ns(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$r(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":""}: ${$r(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(N8c,"Lq");M8c=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 ${ns(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$r(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":""}: ${$r(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(O8c,"jq");a(GHi,"EM");B8c=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 ${ns(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 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=GHi(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=GHi(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":""}: ${$r(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(L8c,"Aq");F8c=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 ${ns(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$r(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"}: ${$r(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(U8c,"Iq");Q8c=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 ${ns(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$r(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"}: ${$r(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(q8c,"Rq");j8c=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 ${ns(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 ${$r(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":""}: ${$r(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(H8c,"Pq");G8c=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 ${ns(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 ${$r(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: ${$r(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($8c,"Eq");V8c=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"),W8c=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 ${V8c(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${ns(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$r(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":""}: ${$r(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(z8c,"bq");Y8c=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 ${ns(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 ${$r(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":""}: ${$r(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(K8c,"_q");J8c=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: ${ns(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$r(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":""}: ${$r(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(Z8c,"kq");X8c=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 ${ns(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 ${$r(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: ${$r(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(e6c,"Sq");t6c=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 ${ns(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$r(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): ${$r(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(r6c,"vq");n6c=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 ${ns(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$r(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${$r(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(i6c,"Cq");dYi=Symbol("ZodOutput"),fYi=Symbol("ZodInput"),C3e=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(a3r,"R7");K6=a3r();a(pYi,"aY");a(hYi,"Tq");a(c3r,"P7");a(BSt,"o8");a(l3r,"E7");a(u3r,"b7");a(d3r,"_7");a(f3r,"k7");a(p3r,"S7");a(h3r,"v7");a(m3r,"C7");a(g3r,"T7");a(A3r,"x7");a(y3r,"y7");a(E3r,"f7");a(_3r,"g7");a(v3r,"h7");a(C3r,"u7");a(b3r,"m7");a(S3r,"l7");a(T3r,"c7");a(I3r,"p7");a(x3r,"d7");a(w3r,"i7");mYi={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(gYi,"xq");a(AYi,"yq");a(yYi,"fq");a(EYi,"gq");a(_Yi,"eY");a(vYi,"hq");a(CYi,"$3");a(bYi,"Q3");a(SYi,"J3");a(TYi,"X3");a(IYi,"Y3");a(xYi,"W3");a(wYi,"uq");a(RYi,"G3");a(PYi,"mq");a(kYi,"U3");a(DYi,"H3");a(NYi,"K3");a(MYi,"q3");a(OYi,"V3");a(BYi,"B3");a(LSt,"b0");a(LYi,"z3");a(FYi,"N3");a(UYi,"w3");a(QYi,"lq");a(qYi,"O3");a(Mne,"o4");a(eN,"t6");a(One,"t4");a(oI,"P6");a(jYi,"cq");a(HYi,"pq");a(GYi,"dq");a($Yi,"iq");a(b3e,"_0");a(RTt,"t8");a(S3e,"k0");a(R3r,"n7");a(PTt,"a8");a(UEe,"k1");a(kTt,"s8");a(P3r,"r7");a(k3r,"o7");a(D3r,"t7");a(N3r,"a7");a(M3r,"s7");a(O3r,"e7");a(VYi,"nq");a(B3r,"$J");a(Qne,"a4");a(L3r,"QJ");a(F3r,"JJ");a(U3r,"XJ");a(Q3r,"YJ");a(q3r,"WJ");a(o6c,"Wm");a(s6c,"Gm");a(a6c,"Um");a(WYi,"rq");a(c6c,"Hm");a(l6c,"Km");a(u6c,"qm");a(d6c,"Vm");a(f6c,"Bm");a(p6c,"zm");a(zYi,"D3");a(h6c,"Nm");a(m6c,"wm");a(g6c,"Om");a(A6c,"Dm");a(y6c,"Fm");a(E6c,"Zm");a(_6c,"Mm");a(v6c,"Lm");a(C6c,"jm");a(b6c,"Am");a(S6c,"Im");a(T6c,"Rm");a(YYi,"F3");a(KYi,"Z3");a(JYi,"M3");a(ZYi,"L3");FSt=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?DSt(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?DSt(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 NSt(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?NSt(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 wTt({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(XYi,"j3");T3e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??K6,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=LLr(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"&&Sm(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(VFr,"e8");a(Sm,"t$");RQc={},kQc=st("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");bo.init(t,e),t.def=e,t.parse=(r,n)=>hTt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>cIt(t,r,n),t.parseAsync=async(r,n)=>mTt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>lIt(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)=>mN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),PQc=st("ZodMiniObject",(t,e)=>{sFr.init(t,e),kQc.init(t,e),Hs.defineLazy(t,"shape",()=>e.shape)});a(h$i,"tq");a(fB,"a6");a(OEe,"S0");a(T3e,"S1");a(NBr,"I3");a(dFe,"v1");a(l3e,"$9");a(MBr,"R3");a(DQc,"_M");a(NQc,"kM");a(bJi,"P3");H={};pB(H,{xid:a(()=>WQc,"xid"),void:a(()=>hqc,"void"),uuidv7:a(()=>QQc,"uuidv7"),uuidv6:a(()=>UQc,"uuidv6"),uuidv4:a(()=>FQc,"uuidv4"),uuid:a(()=>LQc,"uuid"),url:a(()=>qQc,"url"),uppercase:a(()=>BFr,"uppercase"),unknown:a(()=>Kd,"unknown"),union:a(()=>Xl,"union"),undefined:a(()=>fqc,"undefined"),ulid:a(()=>VQc,"ulid"),uint64:a(()=>uqc,"uint64"),uint32:a(()=>aqc,"uint32"),tuple:a(()=>yqc,"tuple"),trim:a(()=>jFr,"trim"),treeifyError:a(()=>Pzi,"treeifyError"),transform:a(()=>b8r,"transform"),toUpperCase:a(()=>GFr,"toUpperCase"),toLowerCase:a(()=>HFr,"toLowerCase"),toJSONSchema:a(()=>VFr,"toJSONSchema"),templateLiteral:a(()=>xqc,"templateLiteral"),symbol:a(()=>dqc,"symbol"),superRefine:a(()=>hZi,"superRefine"),success:a(()=>Tqc,"success"),stringbool:a(()=>kqc,"stringbool"),stringFormat:a(()=>nqc,"stringFormat"),string:a(()=>bt,"string"),strictObject:a(()=>Aqc,"strictObject"),startsWith:a(()=>FFr,"startsWith"),size:a(()=>NFr,"size"),setErrorMap:a(()=>Nqc,"setErrorMap"),set:a(()=>Cqc,"set"),safeParseAsync:a(()=>DJi,"safeParseAsync"),safeParse:a(()=>PJi,"safeParse"),registry:a(()=>dFr,"registry"),regexes:a(()=>J3r,"regexes"),regex:a(()=>MFr,"regex"),refine:a(()=>pZi,"refine"),record:a(()=>Zl,"record"),readonly:a(()=>sZi,"readonly"),property:a(()=>mJi,"property"),promise:a(()=>wqc,"promise"),prettifyError:a(()=>Nzi,"prettifyError"),preprocess:a(()=>x8r,"preprocess"),prefault:a(()=>XJi,"prefault"),positive:a(()=>dJi,"positive"),pipe:a(()=>bTt,"pipe"),partialRecord:a(()=>Eqc,"partialRecord"),parseAsync:a(()=>kJi,"parseAsync"),parse:a(()=>RJi,"parse"),overwrite:a(()=>nie,"overwrite"),optional:a(()=>gd,"optional"),object:a(()=>Cn,"object"),number:a(()=>Dc,"number"),nullish:a(()=>Sqc,"nullish"),nullable:a(()=>vTt,"nullable"),null:a(()=>A8r,"null"),normalize:a(()=>qFr,"normalize"),nonpositive:a(()=>pJi,"nonpositive"),nonoptional:a(()=>eZi,"nonoptional"),nonnegative:a(()=>hJi,"nonnegative"),never:a(()=>yIt,"never"),negative:a(()=>fJi,"negative"),nativeEnum:a(()=>vqc,"nativeEnum"),nanoid:a(()=>HQc,"nanoid"),nan:a(()=>Iqc,"nan"),multipleOf:a(()=>K3e,"multipleOf"),minSize:a(()=>J3e,"minSize"),minLength:a(()=>c_e,"minLength"),mime:a(()=>QFr,"mime"),maxSize:a(()=>dIt,"maxSize"),maxLength:a(()=>fIt,"maxLength"),map:a(()=>_qc,"map"),lte:a(()=>cN,"lte"),lt:a(()=>Jne,"lt"),lowercase:a(()=>OFr,"lowercase"),looseObject:a(()=>LC,"looseObject"),locales:a(()=>uFr,"locales"),literal:a(()=>ei,"literal"),length:a(()=>pIt,"length"),lazy:a(()=>lZi,"lazy"),ksuid:a(()=>zQc,"ksuid"),keyof:a(()=>gqc,"keyof"),jwt:a(()=>rqc,"jwt"),json:a(()=>Pqc,"json"),iso:a(()=>WFr,"iso"),ipv6:a(()=>KQc,"ipv6"),ipv4:a(()=>YQc,"ipv4"),intersection:a(()=>_It,"intersection"),int64:a(()=>lqc,"int64"),int32:a(()=>sqc,"int32"),int:a(()=>PLr,"int"),instanceof:a(()=>Rqc,"instanceof"),includes:a(()=>LFr,"includes"),guid:a(()=>BQc,"guid"),gte:a(()=>dI,"gte"),gt:a(()=>Zne,"gt"),globalRegistry:a(()=>d9,"globalRegistry"),getErrorMap:a(()=>Mqc,"getErrorMap"),function:a(()=>vJi,"function"),formatError:a(()=>V3r,"formatError"),float64:a(()=>oqc,"float64"),float32:a(()=>iqc,"float32"),flattenError:a(()=>$3r,"flattenError"),file:a(()=>bqc,"file"),enum:a(()=>_1,"enum"),endsWith:a(()=>UFr,"endsWith"),emoji:a(()=>jQc,"emoji"),email:a(()=>OQc,"email"),e164:a(()=>tqc,"e164"),discriminatedUnion:a(()=>_8r,"discriminatedUnion"),date:a(()=>mqc,"date"),custom:a(()=>fZi,"custom"),cuid2:a(()=>$Qc,"cuid2"),cuid:a(()=>GQc,"cuid"),core:a(()=>Ezi,"core"),config:a(()=>QC,"config"),coerce:a(()=>mZi,"coerce"),clone:a(()=>mN,"clone"),cidrv6:a(()=>ZQc,"cidrv6"),cidrv4:a(()=>JQc,"cidrv4"),check:a(()=>dZi,"check"),catch:a(()=>nZi,"catch"),boolean:a(()=>Tm,"boolean"),bigint:a(()=>cqc,"bigint"),base64url:a(()=>eqc,"base64url"),base64:a(()=>XQc,"base64"),array:a(()=>_a,"array"),any:a(()=>pqc,"any"),_default:a(()=>JJi,"_default"),_ZodString:a(()=>ZFr,"_ZodString"),ZodXID:a(()=>s8r,"ZodXID"),ZodVoid:a(()=>QJi,"ZodVoid"),ZodUnknown:a(()=>FJi,"ZodUnknown"),ZodUnion:a(()=>E8r,"ZodUnion"),ZodUndefined:a(()=>OJi,"ZodUndefined"),ZodUUID:a(()=>f9,"ZodUUID"),ZodURL:a(()=>e8r,"ZodURL"),ZodULID:a(()=>o8r,"ZodULID"),ZodType:a(()=>Ps,"ZodType"),ZodTuple:a(()=>GJi,"ZodTuple"),ZodTransform:a(()=>v8r,"ZodTransform"),ZodTemplateLiteral:a(()=>aZi,"ZodTemplateLiteral"),ZodSymbol:a(()=>MJi,"ZodSymbol"),ZodSuccess:a(()=>tZi,"ZodSuccess"),ZodStringFormat:a(()=>yd,"ZodStringFormat"),ZodString:a(()=>hIt,"ZodString"),ZodSet:a(()=>VJi,"ZodSet"),ZodRecord:a(()=>C8r,"ZodRecord"),ZodRealError:a(()=>fFe,"ZodRealError"),ZodReadonly:a(()=>oZi,"ZodReadonly"),ZodPromise:a(()=>uZi,"ZodPromise"),ZodPrefault:a(()=>ZJi,"ZodPrefault"),ZodPipe:a(()=>I8r,"ZodPipe"),ZodOptional:a(()=>S8r,"ZodOptional"),ZodObject:a(()=>EIt,"ZodObject"),ZodNumberFormat:a(()=>C_e,"ZodNumberFormat"),ZodNumber:a(()=>mIt,"ZodNumber"),ZodNullable:a(()=>YJi,"ZodNullable"),ZodNull:a(()=>BJi,"ZodNull"),ZodNonOptional:a(()=>T8r,"ZodNonOptional"),ZodNever:a(()=>UJi,"ZodNever"),ZodNanoID:a(()=>r8r,"ZodNanoID"),ZodNaN:a(()=>iZi,"ZodNaN"),ZodMap:a(()=>$Ji,"ZodMap"),ZodLiteral:a(()=>WJi,"ZodLiteral"),ZodLazy:a(()=>cZi,"ZodLazy"),ZodKSUID:a(()=>a8r,"ZodKSUID"),ZodJWT:a(()=>m8r,"ZodJWT"),ZodIssueCode:a(()=>Dqc,"ZodIssueCode"),ZodIntersection:a(()=>HJi,"ZodIntersection"),ZodISOTime:a(()=>KFr,"ZodISOTime"),ZodISODuration:a(()=>JFr,"ZodISODuration"),ZodISODateTime:a(()=>zFr,"ZodISODateTime"),ZodISODate:a(()=>YFr,"ZodISODate"),ZodIPv6:a(()=>l8r,"ZodIPv6"),ZodIPv4:a(()=>c8r,"ZodIPv4"),ZodGUID:a(()=>CTt,"ZodGUID"),ZodFile:a(()=>zJi,"ZodFile"),ZodError:a(()=>MQc,"ZodError"),ZodEnum:a(()=>X3e,"ZodEnum"),ZodEmoji:a(()=>t8r,"ZodEmoji"),ZodEmail:a(()=>XFr,"ZodEmail"),ZodE164:a(()=>h8r,"ZodE164"),ZodDiscriminatedUnion:a(()=>jJi,"ZodDiscriminatedUnion"),ZodDefault:a(()=>KJi,"ZodDefault"),ZodDate:a(()=>y8r,"ZodDate"),ZodCustomStringFormat:a(()=>NJi,"ZodCustomStringFormat"),ZodCustom:a(()=>CIt,"ZodCustom"),ZodCatch:a(()=>rZi,"ZodCatch"),ZodCUID2:a(()=>i8r,"ZodCUID2"),ZodCUID:a(()=>n8r,"ZodCUID"),ZodCIDRv6:a(()=>d8r,"ZodCIDRv6"),ZodCIDRv4:a(()=>u8r,"ZodCIDRv4"),ZodBoolean:a(()=>gIt,"ZodBoolean"),ZodBigIntFormat:a(()=>g8r,"ZodBigIntFormat"),ZodBigInt:a(()=>AIt,"ZodBigInt"),ZodBase64URL:a(()=>p8r,"ZodBase64URL"),ZodBase64:a(()=>f8r,"ZodBase64"),ZodArray:a(()=>qJi,"ZodArray"),ZodAny:a(()=>LJi,"ZodAny"),TimePrecision:a(()=>FKi,"TimePrecision"),NEVER:a(()=>_zi,"NEVER"),$output:a(()=>MKi,"$output"),$input:a(()=>OKi,"$input"),$brand:a(()=>Czi,"$brand")});WFr={};pB(WFr,{time:a(()=>IJi,"time"),duration:a(()=>xJi,"duration"),datetime:a(()=>SJi,"datetime"),date:a(()=>TJi,"date"),ZodISOTime:a(()=>KFr,"ZodISOTime"),ZodISODuration:a(()=>JFr,"ZodISODuration"),ZodISODateTime:a(()=>zFr,"ZodISODateTime"),ZodISODate:a(()=>YFr,"ZodISODate")});zFr=st("ZodISODateTime",(t,e)=>{jYi.init(t,e),yd.init(t,e)});a(SJi,"aq");YFr=st("ZodISODate",(t,e)=>{HYi.init(t,e),yd.init(t,e)});a(TJi,"sq");KFr=st("ZodISOTime",(t,e)=>{GYi.init(t,e),yd.init(t,e)});a(IJi,"eq");JFr=st("ZodISODuration",(t,e)=>{$Yi.init(t,e),yd.init(t,e)});a(xJi,"$V");wJi=a((t,e)=>{G3r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>V3r(t,r),"value")},flatten:{value:a(r=>$3r(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"),MQc=st("ZodError",wJi),fFe=st("ZodError",wJi,{Parent:Error}),RJi=W3r(fFe),kJi=z3r(fFe),PJi=Y3r(fFe),DJi=K3r(fFe),Ps=st("ZodType",(t,e)=>(bo.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)=>mN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>RJi(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>PJi(t,r,n),t.parseAsync=async(r,n)=>kJi(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>DJi(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(pZi(r,n)),t.superRefine=r=>t.check(hZi(r)),t.overwrite=r=>t.check(nie(r)),t.optional=()=>gd(t),t.nullable=()=>vTt(t),t.nullish=()=>gd(vTt(t)),t.nonoptional=r=>eZi(t,r),t.array=()=>_a(t),t.or=r=>Xl([t,r]),t.and=r=>_It(t,r),t.transform=r=>bTt(t,b8r(r)),t.default=r=>JJi(t,r),t.prefault=r=>XJi(t,r),t.catch=r=>nZi(t,r),t.pipe=r=>bTt(t,r),t.readonly=()=>sZi(t),t.describe=r=>{let n=t.clone();return d9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return d9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return d9.get(t);let n=t.clone();return d9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ZFr=st("_ZodString",(t,e)=>{uFe.init(t,e),Ps.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(MFr(...n)),t.includes=(...n)=>t.check(LFr(...n)),t.startsWith=(...n)=>t.check(FFr(...n)),t.endsWith=(...n)=>t.check(UFr(...n)),t.min=(...n)=>t.check(c_e(...n)),t.max=(...n)=>t.check(fIt(...n)),t.length=(...n)=>t.check(pIt(...n)),t.nonempty=(...n)=>t.check(c_e(1,...n)),t.lowercase=n=>t.check(OFr(n)),t.uppercase=n=>t.check(BFr(n)),t.trim=()=>t.check(jFr()),t.normalize=(...n)=>t.check(qFr(...n)),t.toLowerCase=()=>t.check(HFr()),t.toUpperCase=()=>t.check(GFr())}),hIt=st("ZodString",(t,e)=>{uFe.init(t,e),ZFr.init(t,e),t.email=r=>t.check(fFr(XFr,r)),t.url=r=>t.check(AFr(e8r,r)),t.jwt=r=>t.check(DFr(m8r,r)),t.emoji=r=>t.check(yFr(t8r,r)),t.guid=r=>t.check(yTt(CTt,r)),t.uuid=r=>t.check(pFr(f9,r)),t.uuidv4=r=>t.check(hFr(f9,r)),t.uuidv6=r=>t.check(mFr(f9,r)),t.uuidv7=r=>t.check(gFr(f9,r)),t.nanoid=r=>t.check(EFr(r8r,r)),t.guid=r=>t.check(yTt(CTt,r)),t.cuid=r=>t.check(_Fr(n8r,r)),t.cuid2=r=>t.check(CFr(i8r,r)),t.ulid=r=>t.check(vFr(o8r,r)),t.base64=r=>t.check(RFr(f8r,r)),t.base64url=r=>t.check(kFr(p8r,r)),t.xid=r=>t.check(bFr(s8r,r)),t.ksuid=r=>t.check(SFr(a8r,r)),t.ipv4=r=>t.check(TFr(c8r,r)),t.ipv6=r=>t.check(IFr(l8r,r)),t.cidrv4=r=>t.check(xFr(u8r,r)),t.cidrv6=r=>t.check(wFr(d8r,r)),t.e164=r=>t.check(PFr(h8r,r)),t.datetime=r=>t.check(SJi(r)),t.date=r=>t.check(TJi(r)),t.time=r=>t.check(IJi(r)),t.duration=r=>t.check(xJi(r))});a(bt,"L");yd=st("ZodStringFormat",(t,e)=>{ku.init(t,e),ZFr.init(t,e)}),XFr=st("ZodEmail",(t,e)=>{NYi.init(t,e),yd.init(t,e)});a(OQc,"Cm");CTt=st("ZodGUID",(t,e)=>{PYi.init(t,e),yd.init(t,e)});a(BQc,"Tm");f9=st("ZodUUID",(t,e)=>{DYi.init(t,e),yd.init(t,e)});a(LQc,"xm");a(FQc,"ym");a(UQc,"fm");a(QQc,"gm");e8r=st("ZodURL",(t,e)=>{MYi.init(t,e),yd.init(t,e)});a(qQc,"hm");t8r=st("ZodEmoji",(t,e)=>{OYi.init(t,e),yd.init(t,e)});a(jQc,"um");r8r=st("ZodNanoID",(t,e)=>{BYi.init(t,e),yd.init(t,e)});a(HQc,"mm");n8r=st("ZodCUID",(t,e)=>{LYi.init(t,e),yd.init(t,e)});a(GQc,"lm");i8r=st("ZodCUID2",(t,e)=>{FYi.init(t,e),yd.init(t,e)});a($Qc,"cm");o8r=st("ZodULID",(t,e)=>{UYi.init(t,e),yd.init(t,e)});a(VQc,"pm");s8r=st("ZodXID",(t,e)=>{QYi.init(t,e),yd.init(t,e)});a(WQc,"dm");a8r=st("ZodKSUID",(t,e)=>{qYi.init(t,e),yd.init(t,e)});a(zQc,"im");c8r=st("ZodIPv4",(t,e)=>{VYi.init(t,e),yd.init(t,e)});a(YQc,"nm");l8r=st("ZodIPv6",(t,e)=>{WYi.init(t,e),yd.init(t,e)});a(KQc,"rm");u8r=st("ZodCIDRv4",(t,e)=>{zYi.init(t,e),yd.init(t,e)});a(JQc,"om");d8r=st("ZodCIDRv6",(t,e)=>{YYi.init(t,e),yd.init(t,e)});a(ZQc,"tm");f8r=st("ZodBase64",(t,e)=>{KYi.init(t,e),yd.init(t,e)});a(XQc,"am");p8r=st("ZodBase64URL",(t,e)=>{ZYi.init(t,e),yd.init(t,e)});a(eqc,"sm");h8r=st("ZodE164",(t,e)=>{XYi.init(t,e),yd.init(t,e)});a(tqc,"em");m8r=st("ZodJWT",(t,e)=>{tKi.init(t,e),yd.init(t,e)});a(rqc,"$l");NJi=st("ZodCustomStringFormat",(t,e)=>{rKi.init(t,e),yd.init(t,e)});a(nqc,"Ql");mIt=st("ZodNumber",(t,e)=>{rFr.init(t,e),Ps.init(t,e),t.gt=(n,o)=>t.check(Zne(n,o)),t.gte=(n,o)=>t.check(dI(n,o)),t.min=(n,o)=>t.check(dI(n,o)),t.lt=(n,o)=>t.check(Jne(n,o)),t.lte=(n,o)=>t.check(cN(n,o)),t.max=(n,o)=>t.check(cN(n,o)),t.int=n=>t.check(PLr(n)),t.safe=n=>t.check(PLr(n)),t.positive=n=>t.check(Zne(0,n)),t.nonnegative=n=>t.check(dI(0,n)),t.negative=n=>t.check(Jne(0,n)),t.nonpositive=n=>t.check(cN(0,n)),t.multipleOf=(n,o)=>t.check(K3e(n,o)),t.step=(n,o)=>t.check(K3e(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(Dc,"z$");C_e=st("ZodNumberFormat",(t,e)=>{nKi.init(t,e),mIt.init(t,e)});a(PLr,"WV");a(iqc,"Jl");a(oqc,"Xl");a(sqc,"Yl");a(aqc,"Wl");gIt=st("ZodBoolean",(t,e)=>{nFr.init(t,e),Ps.init(t,e)});a(Tm,"i$");AIt=st("ZodBigInt",(t,e)=>{iFr.init(t,e),Ps.init(t,e),t.gte=(n,o)=>t.check(dI(n,o)),t.min=(n,o)=>t.check(dI(n,o)),t.gt=(n,o)=>t.check(Zne(n,o)),t.gte=(n,o)=>t.check(dI(n,o)),t.min=(n,o)=>t.check(dI(n,o)),t.lt=(n,o)=>t.check(Jne(n,o)),t.lte=(n,o)=>t.check(cN(n,o)),t.max=(n,o)=>t.check(cN(n,o)),t.positive=n=>t.check(Zne(BigInt(0),n)),t.negative=n=>t.check(Jne(BigInt(0),n)),t.nonpositive=n=>t.check(cN(BigInt(0),n)),t.nonnegative=n=>t.check(dI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(K3e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(cqc,"Gl");g8r=st("ZodBigIntFormat",(t,e)=>{iKi.init(t,e),AIt.init(t,e)});a(lqc,"Ul");a(uqc,"Hl");MJi=st("ZodSymbol",(t,e)=>{oKi.init(t,e),Ps.init(t,e)});a(dqc,"Kl");OJi=st("ZodUndefined",(t,e)=>{sKi.init(t,e),Ps.init(t,e)});a(fqc,"ql");BJi=st("ZodNull",(t,e)=>{aKi.init(t,e),Ps.init(t,e)});a(A8r,"T3");LJi=st("ZodAny",(t,e)=>{cKi.init(t,e),Ps.init(t,e)});a(pqc,"Vl");FJi=st("ZodUnknown",(t,e)=>{ATt.init(t,e),Ps.init(t,e)});a(Kd,"S$");UJi=st("ZodNever",(t,e)=>{lKi.init(t,e),Ps.init(t,e)});a(yIt,"x3");QJi=st("ZodVoid",(t,e)=>{uKi.init(t,e),Ps.init(t,e)});a(hqc,"Bl");y8r=st("ZodDate",(t,e)=>{dKi.init(t,e),Ps.init(t,e),t.min=(n,o)=>t.check(dI(n,o)),t.max=(n,o)=>t.check(cN(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(mqc,"zl");qJi=st("ZodArray",(t,e)=>{oFr.init(t,e),Ps.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(c_e(r,n)),t.nonempty=r=>t.check(c_e(1,r)),t.max=(r,n)=>t.check(fIt(r,n)),t.length=(r,n)=>t.check(pIt(r,n)),t.unwrap=()=>t.element});a(_a,"W$");a(gqc,"Nl");EIt=st("ZodObject",(t,e)=>{sFr.init(t,e),Ps.init(t,e),Hs.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>_1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Kd()}),t.loose=()=>t.clone({...t._zod.def,catchall:Kd()}),t.strict=()=>t.clone({...t._zod.def,catchall:yIt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Hs.extend(t,r),t.merge=r=>Hs.merge(t,r),t.pick=r=>Hs.pick(t,r),t.omit=r=>Hs.omit(t,r),t.partial=(...r)=>Hs.partial(S8r,t,r[0]),t.required=(...r)=>Hs.required(T8r,t,r[0])});a(Cn,"h");a(Aqc,"wl");a(LC,"K6");E8r=st("ZodUnion",(t,e)=>{aFr.init(t,e),Ps.init(t,e),t.options=e.options});a(Xl,"A$");jJi=st("ZodDiscriminatedUnion",(t,e)=>{E8r.init(t,e),fKi.init(t,e)});a(_8r,"g3");HJi=st("ZodIntersection",(t,e)=>{pKi.init(t,e),Ps.init(t,e)});a(_It,"VJ");GJi=st("ZodTuple",(t,e)=>{uIt.init(t,e),Ps.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(yqc,"Ol");C8r=st("ZodRecord",(t,e)=>{hKi.init(t,e),Ps.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(Zl,"I$");a(Eqc,"Dl");$Ji=st("ZodMap",(t,e)=>{mKi.init(t,e),Ps.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(_qc,"Fl");VJi=st("ZodSet",(t,e)=>{gKi.init(t,e),Ps.init(t,e),t.min=(...r)=>t.check(J3e(...r)),t.nonempty=r=>t.check(J3e(1,r)),t.max=(...r)=>t.check(dIt(...r)),t.size=(...r)=>t.check(NFr(...r))});a(Cqc,"Zl");X3e=st("ZodEnum",(t,e)=>{AKi.init(t,e),Ps.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 X3e({...e,checks:[],...Hs.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 X3e({...e,checks:[],...Hs.normalizeParams(o),entries:s})}});a(_1,"N6");a(vqc,"Ml");WJi=st("ZodLiteral",(t,e)=>{yKi.init(t,e),Ps.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(ei,"l");zJi=st("ZodFile",(t,e)=>{EKi.init(t,e),Ps.init(t,e),t.min=(r,n)=>t.check(J3e(r,n)),t.max=(r,n)=>t.check(dIt(r,n)),t.mime=(r,n)=>t.check(QFr(Array.isArray(r)?r:[r],n))});a(bqc,"Ll");v8r=st("ZodTransform",(t,e)=>{cFr.init(t,e),Ps.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Hs.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(Hs.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(b8r,"bV");S8r=st("ZodOptional",(t,e)=>{_Ki.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(gd,"_$");YJi=st("ZodNullable",(t,e)=>{CKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(vTt,"v3");a(Sqc,"jl");KJi=st("ZodDefault",(t,e)=>{vKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(JJi,"aM");ZJi=st("ZodPrefault",(t,e)=>{bKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(XJi,"eM");T8r=st("ZodNonOptional",(t,e)=>{SKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(eZi,"$L");tZi=st("ZodSuccess",(t,e)=>{TKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Tqc,"Al");rZi=st("ZodCatch",(t,e)=>{IKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(nZi,"XL");iZi=st("ZodNaN",(t,e)=>{xKi.init(t,e),Ps.init(t,e)});a(Iqc,"Il");I8r=st("ZodPipe",(t,e)=>{lFr.init(t,e),Ps.init(t,e),t.in=e.in,t.out=e.out});a(bTt,"C3");oZi=st("ZodReadonly",(t,e)=>{wKi.init(t,e),Ps.init(t,e)});a(sZi,"GL");aZi=st("ZodTemplateLiteral",(t,e)=>{RKi.init(t,e),Ps.init(t,e)});a(xqc,"Rl");cZi=st("ZodLazy",(t,e)=>{PKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(lZi,"KL");uZi=st("ZodPromise",(t,e)=>{kKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(wqc,"Pl");CIt=st("ZodCustom",(t,e)=>{DKi.init(t,e),Ps.init(t,e)});a(dZi,"VL");a(fZi,"vV");a(pZi,"BL");a(hZi,"zL");a(Rqc,"El");kqc=a((...t)=>_Ji({Pipe:I8r,Boolean:gIt,String:hIt,Transform:v8r},...t),"bl");a(Pqc,"_l");a(x8r,"u3");Dqc={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(Nqc,"Sl");a(Mqc,"vl");mZi={};pB(mZi,{string:a(()=>Oqc,"string"),number:a(()=>Bqc,"number"),date:a(()=>Uqc,"date"),boolean:a(()=>Lqc,"boolean"),bigint:a(()=>Fqc,"bigint")});a(Oqc,"Cl");a(Bqc,"Tl");a(Lqc,"xl");a(Fqc,"yl");a(Uqc,"fl");QC(NKi());Qqc=H,gZi=Qqc,AZi="2025-11-25",qqc=[AZi,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Une="io.modelcontextprotocol/related-task",vIt="2.0",Im=fZi(t=>t!==null&&(typeof t=="object"||typeof t=="function")),yZi=Xl([bt(),Dc().int()]),EZi=bt(),OBh=LC({ttl:Dc().optional(),pollInterval:Dc().optional()}),jqc=Cn({ttl:Dc().optional()}),Hqc=Cn({taskId:bt()}),w8r=LC({progressToken:yZi.optional(),[Une]:Hqc.optional()}),gI=Cn({_meta:w8r.optional()}),pFe=gI.extend({task:jqc.optional()}),Gqc=a(t=>pFe.safeParse(t).success,"FL"),dy=Cn({method:bt(),params:gI.loose().optional()}),KR=Cn({_meta:w8r.optional()}),JR=Cn({method:bt(),params:KR.loose().optional()}),fy=LC({_meta:w8r.optional()}),bIt=Xl([bt(),Dc().int()]),_Zi=Cn({jsonrpc:ei(vIt),id:bIt,...dy.shape}).strict(),m$i=a(t=>_Zi.safeParse(t).success,"fV"),CZi=Cn({jsonrpc:ei(vIt),...JR.shape}).strict(),$qc=a(t=>CZi.safeParse(t).success,"LL"),R8r=Cn({jsonrpc:ei(vIt),id:bIt,result:fy}).strict(),hSt=a(t=>R8r.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={}));k8r=Cn({jsonrpc:ei(vIt),id:bIt.optional(),error:Cn({code:Dc().int(),message:bt(),data:Kd().optional()})}).strict(),Vqc=a(t=>k8r.safeParse(t).success,"jL"),BBh=Xl([_Zi,CZi,R8r,k8r]),LBh=Xl([R8r,k8r]),P8r=fy.strict(),Wqc=KR.extend({requestId:bIt.optional(),reason:bt().optional()}),D8r=JR.extend({method:ei("notifications/cancelled"),params:Wqc}),zqc=Cn({src:bt(),mimeType:bt().optional(),sizes:_a(bt()).optional(),theme:_1(["light","dark"]).optional()}),hFe=Cn({icons:_a(zqc).optional()}),l_e=Cn({name:bt(),title:bt().optional()}),vZi=l_e.extend({...l_e.shape,...hFe.shape,version:bt(),websiteUrl:bt().optional(),description:bt().optional()}),Yqc=_It(Cn({applyDefaults:Tm().optional()}),Zl(bt(),Kd())),Kqc=x8r(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,_It(Cn({form:Yqc.optional(),url:Im.optional()}),Zl(bt(),Kd()).optional())),Jqc=LC({list:Im.optional(),cancel:Im.optional(),requests:LC({sampling:LC({createMessage:Im.optional()}).optional(),elicitation:LC({create:Im.optional()}).optional()}).optional()}),Zqc=LC({list:Im.optional(),cancel:Im.optional(),requests:LC({tools:LC({call:Im.optional()}).optional()}).optional()}),Xqc=Cn({experimental:Zl(bt(),Im).optional(),sampling:Cn({context:Im.optional(),tools:Im.optional()}).optional(),elicitation:Kqc.optional(),roots:Cn({listChanged:Tm().optional()}).optional(),tasks:Jqc.optional(),extensions:Zl(bt(),Im).optional()}),ejc=gI.extend({protocolVersion:bt(),capabilities:Xqc,clientInfo:vZi}),bZi=dy.extend({method:ei("initialize"),params:ejc}),tjc=Cn({experimental:Zl(bt(),Im).optional(),logging:Im.optional(),completions:Im.optional(),prompts:Cn({listChanged:Tm().optional()}).optional(),resources:Cn({subscribe:Tm().optional(),listChanged:Tm().optional()}).optional(),tools:Cn({listChanged:Tm().optional()}).optional(),tasks:Zqc.optional(),extensions:Zl(bt(),Im).optional()}),rjc=fy.extend({protocolVersion:bt(),capabilities:tjc,serverInfo:vZi,instructions:bt().optional()}),SZi=JR.extend({method:ei("notifications/initialized"),params:KR.optional()}),N8r=dy.extend({method:ei("ping"),params:gI.optional()}),njc=Cn({progress:Dc(),total:gd(Dc()),message:gd(bt())}),ijc=Cn({...KR.shape,...njc.shape,progressToken:yZi}),M8r=JR.extend({method:ei("notifications/progress"),params:ijc}),ojc=gI.extend({cursor:EZi.optional()}),mFe=dy.extend({params:ojc.optional()}),gFe=fy.extend({nextCursor:EZi.optional()}),sjc=_1(["working","input_required","completed","failed","cancelled"]),AFe=Cn({taskId:bt(),status:sjc,ttl:Xl([Dc(),A8r()]),createdAt:bt(),lastUpdatedAt:bt(),pollInterval:gd(Dc()),statusMessage:gd(bt())}),SIt=fy.extend({task:AFe}),ajc=KR.merge(AFe),STt=JR.extend({method:ei("notifications/tasks/status"),params:ajc}),O8r=dy.extend({method:ei("tasks/get"),params:gI.extend({taskId:bt()})}),B8r=fy.merge(AFe),L8r=dy.extend({method:ei("tasks/result"),params:gI.extend({taskId:bt()})}),FBh=fy.loose(),F8r=mFe.extend({method:ei("tasks/list")}),U8r=gFe.extend({tasks:_a(AFe)}),Q8r=dy.extend({method:ei("tasks/cancel"),params:gI.extend({taskId:bt()})}),cjc=fy.merge(AFe),TZi=Cn({uri:bt(),mimeType:gd(bt()),_meta:Zl(bt(),Kd()).optional()}),IZi=TZi.extend({text:bt()}),q8r=bt().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),xZi=TZi.extend({blob:q8r}),yFe=_1(["user","assistant"]),v_e=Cn({audience:_a(yFe).optional(),priority:Dc().min(0).max(1).optional(),lastModified:WFr.datetime({offset:!0}).optional()}),wZi=Cn({...l_e.shape,...hFe.shape,uri:bt(),description:gd(bt()),mimeType:gd(bt()),size:gd(Dc()),annotations:v_e.optional(),_meta:gd(LC({}))}),ljc=Cn({...l_e.shape,...hFe.shape,uriTemplate:bt(),description:gd(bt()),mimeType:gd(bt()),annotations:v_e.optional(),_meta:gd(LC({}))}),DLr=mFe.extend({method:ei("resources/list")}),ujc=gFe.extend({resources:_a(wZi)}),NLr=mFe.extend({method:ei("resources/templates/list")}),djc=gFe.extend({resourceTemplates:_a(ljc)}),j8r=gI.extend({uri:bt()}),fjc=j8r,MLr=dy.extend({method:ei("resources/read"),params:fjc}),pjc=fy.extend({contents:_a(Xl([IZi,xZi]))}),hjc=JR.extend({method:ei("notifications/resources/list_changed"),params:KR.optional()}),mjc=j8r,gjc=dy.extend({method:ei("resources/subscribe"),params:mjc}),Ajc=j8r,yjc=dy.extend({method:ei("resources/unsubscribe"),params:Ajc}),Ejc=KR.extend({uri:bt()}),_jc=JR.extend({method:ei("notifications/resources/updated"),params:Ejc}),Cjc=Cn({name:bt(),description:gd(bt()),required:gd(Tm())}),vjc=Cn({...l_e.shape,...hFe.shape,description:gd(bt()),arguments:gd(_a(Cjc)),_meta:gd(LC({}))}),OLr=mFe.extend({method:ei("prompts/list")}),bjc=gFe.extend({prompts:_a(vjc)}),Sjc=gI.extend({name:bt(),arguments:Zl(bt(),bt()).optional()}),BLr=dy.extend({method:ei("prompts/get"),params:Sjc}),H8r=Cn({type:ei("text"),text:bt(),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),G8r=Cn({type:ei("image"),data:q8r,mimeType:bt(),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),$8r=Cn({type:ei("audio"),data:q8r,mimeType:bt(),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),Tjc=Cn({type:ei("tool_use"),name:bt(),id:bt(),input:Zl(bt(),Kd()),_meta:Zl(bt(),Kd()).optional()}),Ijc=Cn({type:ei("resource"),resource:Xl([IZi,xZi]),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),xjc=wZi.extend({type:ei("resource_link")}),V8r=Xl([H8r,G8r,$8r,xjc,Ijc]),wjc=Cn({role:yFe,content:V8r}),Rjc=fy.extend({description:bt().optional(),messages:_a(wjc)}),kjc=JR.extend({method:ei("notifications/prompts/list_changed"),params:KR.optional()}),Pjc=Cn({title:bt().optional(),readOnlyHint:Tm().optional(),destructiveHint:Tm().optional(),idempotentHint:Tm().optional(),openWorldHint:Tm().optional()}),Djc=Cn({taskSupport:_1(["required","optional","forbidden"]).optional()}),RZi=Cn({...l_e.shape,...hFe.shape,description:bt().optional(),inputSchema:Cn({type:ei("object"),properties:Zl(bt(),Im).optional(),required:_a(bt()).optional()}).catchall(Kd()),outputSchema:Cn({type:ei("object"),properties:Zl(bt(),Im).optional(),required:_a(bt()).optional()}).catchall(Kd()).optional(),annotations:Pjc.optional(),execution:Djc.optional(),_meta:Zl(bt(),Kd()).optional()}),LLr=mFe.extend({method:ei("tools/list")}),Njc=gFe.extend({tools:_a(RZi)}),W8r=fy.extend({content:_a(V8r).default([]),structuredContent:Zl(bt(),Kd()).optional(),isError:Tm().optional()}),UBh=W8r.or(fy.extend({toolResult:Kd()})),Mjc=pFe.extend({name:bt(),arguments:Zl(bt(),Kd()).optional()}),TTt=dy.extend({method:ei("tools/call"),params:Mjc}),Ojc=JR.extend({method:ei("notifications/tools/list_changed"),params:KR.optional()}),QBh=Cn({autoRefresh:Tm().default(!0),debounceMs:Dc().int().nonnegative().default(300)}),ITt=_1(["debug","info","notice","warning","error","critical","alert","emergency"]),Bjc=gI.extend({level:ITt}),kZi=dy.extend({method:ei("logging/setLevel"),params:Bjc}),Ljc=KR.extend({level:ITt,logger:bt().optional(),data:Kd()}),Fjc=JR.extend({method:ei("notifications/message"),params:Ljc}),Ujc=Cn({name:bt().optional()}),Qjc=Cn({hints:_a(Ujc).optional(),costPriority:Dc().min(0).max(1).optional(),speedPriority:Dc().min(0).max(1).optional(),intelligencePriority:Dc().min(0).max(1).optional()}),qjc=Cn({mode:_1(["auto","required","none"]).optional()}),jjc=Cn({type:ei("tool_result"),toolUseId:bt().describe("The unique identifier for the corresponding tool call."),content:_a(V8r).default([]),structuredContent:Cn({}).loose().optional(),isError:Tm().optional(),_meta:Zl(bt(),Kd()).optional()}),Hjc=_8r("type",[H8r,G8r,$8r]),xTt=_8r("type",[H8r,G8r,$8r,Tjc,jjc]),Gjc=Cn({role:yFe,content:Xl([xTt,_a(xTt)]),_meta:Zl(bt(),Kd()).optional()}),$jc=pFe.extend({messages:_a(Gjc),modelPreferences:Qjc.optional(),systemPrompt:bt().optional(),includeContext:_1(["none","thisServer","allServers"]).optional(),temperature:Dc().optional(),maxTokens:Dc().int(),stopSequences:_a(bt()).optional(),metadata:Im.optional(),tools:_a(RZi).optional(),toolChoice:qjc.optional()}),Vjc=dy.extend({method:ei("sampling/createMessage"),params:$jc}),z8r=fy.extend({model:bt(),stopReason:gd(_1(["endTurn","stopSequence","maxTokens"]).or(bt())),role:yFe,content:Hjc}),PZi=fy.extend({model:bt(),stopReason:gd(_1(["endTurn","stopSequence","maxTokens","toolUse"]).or(bt())),role:yFe,content:Xl([xTt,_a(xTt)])}),Wjc=Cn({type:ei("boolean"),title:bt().optional(),description:bt().optional(),default:Tm().optional()}),zjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),minLength:Dc().optional(),maxLength:Dc().optional(),format:_1(["email","uri","date","date-time"]).optional(),default:bt().optional()}),Yjc=Cn({type:_1(["number","integer"]),title:bt().optional(),description:bt().optional(),minimum:Dc().optional(),maximum:Dc().optional(),default:Dc().optional()}),Kjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),enum:_a(bt()),default:bt().optional()}),Jjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),oneOf:_a(Cn({const:bt(),title:bt()})),default:bt().optional()}),Zjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),enum:_a(bt()),enumNames:_a(bt()).optional(),default:bt().optional()}),Xjc=Xl([Kjc,Jjc]),eHc=Cn({type:ei("array"),title:bt().optional(),description:bt().optional(),minItems:Dc().optional(),maxItems:Dc().optional(),items:Cn({type:ei("string"),enum:_a(bt())}),default:_a(bt()).optional()}),tHc=Cn({type:ei("array"),title:bt().optional(),description:bt().optional(),minItems:Dc().optional(),maxItems:Dc().optional(),items:Cn({anyOf:_a(Cn({const:bt(),title:bt()}))}),default:_a(bt()).optional()}),rHc=Xl([eHc,tHc]),nHc=Xl([Zjc,Xjc,rHc]),iHc=Xl([nHc,Wjc,zjc,Yjc]),oHc=pFe.extend({mode:ei("form").optional(),message:bt(),requestedSchema:Cn({type:ei("object"),properties:Zl(bt(),iHc),required:_a(bt()).optional()})}),sHc=pFe.extend({mode:ei("url"),message:bt(),elicitationId:bt(),url:bt().url()}),aHc=Xl([oHc,sHc]),cHc=dy.extend({method:ei("elicitation/create"),params:aHc}),lHc=KR.extend({elicitationId:bt()}),uHc=JR.extend({method:ei("notifications/elicitation/complete"),params:lHc}),wTt=fy.extend({action:_1(["accept","decline","cancel"]),content:x8r(t=>t===null?void 0:t,Zl(bt(),Xl([bt(),Dc(),Tm(),_a(bt())])).optional())}),dHc=Cn({type:ei("ref/resource"),uri:bt()}),fHc=Cn({type:ei("ref/prompt"),name:bt()}),pHc=gI.extend({ref:Xl([fHc,dHc]),argument:Cn({name:bt(),value:bt()}),context:Cn({arguments:Zl(bt(),bt()).optional()}).optional()}),FLr=dy.extend({method:ei("completion/complete"),params:pHc});a(hHc,"kL");a(mHc,"SL");gHc=fy.extend({completion:LC({values:_a(bt()).max(100),total:gd(Dc().int()),hasMore:gd(Tm())})}),AHc=Cn({uri:bt().startsWith("file://"),name:bt().optional(),_meta:Zl(bt(),Kd()).optional()}),yHc=dy.extend({method:ei("roots/list"),params:gI.optional()}),DZi=fy.extend({roots:_a(AHc)}),EHc=JR.extend({method:ei("notifications/roots/list_changed"),params:KR.optional()}),qBh=Xl([N8r,bZi,FLr,kZi,BLr,OLr,DLr,NLr,MLr,gjc,yjc,TTt,LLr,O8r,L8r,F8r,Q8r]),jBh=Xl([D8r,M8r,SZi,EHc,STt]),HBh=Xl([P8r,z8r,PZi,wTt,DZi,B8r,U8r,SIt]),GBh=Xl([N8r,Vjc,cHc,yHc,O8r,L8r,F8r,Q8r]),$Bh=Xl([D8r,M8r,Fjc,_jc,hjc,Ojc,kjc,STt,uHc]),VBh=Xl([P8r,rjc,gHc,Rjc,bjc,ujc,djc,pjc,W8r,Njc,B8r,U8r,SIt]),li=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 ULr(o.elicitations,r)}return new t(e,r,n)}},ULr=class extends li{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(Lne,"T1");_Hc=Symbol("Let zodToJsonSchema decide on which parser to use"),g$i={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"},CHc=a(t=>typeof t=="string"?{...g$i,name:t}:{...g$i,...t},"xL"),vHc=a(t=>{let e=CHc(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(NZi,"aV");a(fl,"H$");MZi=a((t,e)=>{let r=0;for(;rPc(t.innerType._def,e),"uL");a(BZi,"sV");xHc=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":fl(r,"minimum",n.value,n.message,e);break;case"max":fl(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(wHc,"mL");a(RHc,"lL");a(kHc,"cL");PHc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(DHc,"pL");a(NHc,"dL");OBr=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(()=>(OBr===void 0&&(OBr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),OBr),"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(LZi,"qW");a(BBr,"$B");MHc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(OHc,"Np");a(sN,"V4");a(BC,"w6");a(A$i,"iL");a(FZi,"VW");a(BHc,"nL");a(LHc,"rL");a(FHc,"oL");a(UHc,"tL");RTt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(QHc,"sL");y$i=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Pc(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(qHc,"eL");a(jHc,"$j");a(HHc,"Qj");a(GHc,"wp");a($Hc,"Op");VHc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Pc(t.innerType._def,e);let r=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:E1(e)},r]}:E1(e)},"Jj"),WHc=a((t,e)=>{if(e.pipeStrategy==="input")return Pc(t.in._def,e);if(e.pipeStrategy==="output")return Pc(t.out._def,e);let r=Pc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Pc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(zHc,"Yj");a(YHc,"Wj");a(KHc,"Gj");a(JHc,"Uj");a(ZHc,"Hj");XHc=a((t,e)=>Pc(t.innerType._def,e),"Kj"),eGc=a((t,e,r)=>{switch(e){case vr.ZodString:return LZi(t,r);case vr.ZodNumber:return jHc(t,r);case vr.ZodObject:return HHc(t,r);case vr.ZodBigInt:return SHc(t,r);case vr.ZodBoolean:return THc();case vr.ZodDate:return BZi(t,r);case vr.ZodUndefined:return JHc(r);case vr.ZodNull:return UHc(r);case vr.ZodArray:return bHc(t,r);case vr.ZodUnion:case vr.ZodDiscriminatedUnion:return QHc(t,r);case vr.ZodIntersection:return DHc(t,r);case vr.ZodTuple:return KHc(t,r);case vr.ZodRecord:return FZi(t,r);case vr.ZodLiteral:return NHc(t,r);case vr.ZodEnum:return kHc(t);case vr.ZodNativeEnum:return LHc(t);case vr.ZodNullable:return qHc(t,r);case vr.ZodOptional:return VHc(t,r);case vr.ZodMap:return BHc(t,r);case vr.ZodSet:return YHc(t,r);case vr.ZodLazy:return()=>t.getter()._def;case vr.ZodPromise:return zHc(t,r);case vr.ZodNaN:case vr.ZodNever:return FHc(r);case vr.ZodEffects:return RHc(t,r);case vr.ZodAny:return E1(r);case vr.ZodUnknown:return ZHc(r);case vr.ZodDefault:return wHc(t,r);case vr.ZodBranded:return OZi(t,r);case vr.ZodReadonly:return XHc(t,r);case vr.ZodCatch:return IHc(t,r);case vr.ZodPipeline:return WHc(t,r);case vr.ZodFunction:case vr.ZodVoid:case vr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Pc,"r");tGc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:MZi(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`),E1(e)):e.$refStrategy==="seen"?E1(e):void 0}},"Dp"),rGc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),nGc=a((t,e)=>{let r=vHc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Pc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??E1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Pc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??E1(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(iGc,"Zp");a(E$i,"JB");a(_$i,"XB");a(C$i,"YB");oGc=6e4,QLr=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(D8r,r=>{this._oncancel(r)}),this.setNotificationHandler(M8r,r=>{this._onprogress(r)}),this.setRequestHandler(N8r,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(O8r,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new li(Bi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(L8r,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 li(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 li(Bi.InvalidParams,`Task not found: ${s}`);if(!Lne(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Lne(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Une]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(F8r,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 li(Bi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Q8r,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new li(Bi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Lne(o.status))throw new li(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 li(Bi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof li?o:new li(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),li.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),hSt(s)||Vqc(s)?this._onresponse(s):m$i(s)?this._onrequest(s,c):$qc(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=li.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?.[Une]?.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=Gqc(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 li(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),hSt(e))n(e);else{let c=new li(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(hSt(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),hSt(e))o(e);else{let c=li.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 li?c:new li(Bi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,SIt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new li(Bi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Lne(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new li(Bi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new li(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 li?c:new li(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||{},[Une]: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 li?v:new li(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=T3e(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??oGc,E=a(()=>A(li.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},B8r,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},U8r,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},cjc,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||{},[Une]: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||{},[Une]: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||{},[Une]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=_$i(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=C$i(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=_$i(e);this._notificationHandlers.set(n,o=>{let s=C$i(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"&&m$i(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new li(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 li(Bi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new li(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 li(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=STt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Lne(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 li(Bi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Lne(l.status))throw new li(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=STt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Lne(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(v$i,"Vj");a(sGc,"Bj");aGc=l3r(bVi(),1),cGc=l3r(L5c(),1);a(lGc,"ps");qLr=class{static{a(this,"qz")}constructor(e){this._ajv=e??lGc()}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)}}},jLr=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},z8r,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},wTt,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(uGc,"tP");a(dGc,"aP");HLr=class extends QLr{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ITt.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(SZi,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(kZi,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=ITt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new jLr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=sGc(this._capabilities,e)}setRequestHandler(e,r){let n=dFe(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(fB(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=T3e(TTt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new li(Bi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=T3e(SIt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new li(Bi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=T3e(W8r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new li(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){dGc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&uGc(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:qqc.includes(r)?r:AZi,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"},P8r)}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},PZi,r):this.request({method:"sampling/createMessage",params:e},z8r,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},wTt,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},wTt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new li(Bi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof li?s:new li(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},DZi,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"})}},UZi=Symbol.for("mcp.completable");a(b$i,"zz");a(fGc,"$E");(function(t){t.Completable="McpCompletable"})(S$i||(S$i={}));pGc=/^[A-Za-z0-9._-]{1,128}$/;a(hGc,"is");a(mGc,"ns");a(T$i,"Nz");GLr=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)}},$Lr=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 HLr(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new GLr(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(gV(LLr)),this.server.assertCanSetRequestHandler(gV(TTt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(LLr,()=>({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=l3e(r.inputSchema);return o?E$i(o,{strictUnions:!0,pipeStrategy:"input"}):gGc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=l3e(r.outputSchema);o&&(n.outputSchema=E$i(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(TTt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new li(Bi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new li(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 li(Bi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new li(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 li&&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=l3e(e.inputSchema)??e.inputSchema,s=await NBr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=MBr(c);throw new li(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 li(Bi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=l3e(e.outputSchema),s=await NBr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=MBr(c);throw new li(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 li(Bi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(gV(FLr)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(FLr,async e=>{switch(e.params.ref.type){case"ref/prompt":return hHc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return mHc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new li(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 li(Bi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new li(Bi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return u3e;let o=dFe(n.argsSchema)?.[e.params.argument.name];if(!b$i(o))return u3e;let s=fGc(o);if(!s)return u3e;let c=await s(e.params.argument.value,e.params.context);return x$i(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 u3e;throw new li(Bi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return u3e;let s=await o(e.params.argument.value,e.params.context);return x$i(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(gV(DLr)),this.server.assertCanSetRequestHandler(gV(NLr)),this.server.assertCanSetRequestHandler(gV(MLr)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(DLr,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(NLr,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(MLr,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new li(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 li(Bi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(gV(OLr)),this.server.assertCanSetRequestHandler(gV(BLr)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(OLr,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?AGc(r.argsSchema):void 0}))})),this.server.setRequestHandler(BLr,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new li(Bi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new li(Bi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=l3e(n.argsSchema),s=await NBr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=MBr(u);throw new li(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:OEe(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=OEe(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 zR?l._def?.innerType:l;return b$i(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){T$i(e);let f={title:r,description:n,inputSchema:I$i(o),outputSchema:I$i(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"&&T$i(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=OEe(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=OEe(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(VLr(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!VLr(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()}},gGc={type:"object",properties:{}};a(QZi,"XE");a(qZi,"YE");a(VLr,"Oz");a(I$i,"QE");a(AGc,"os");a(gV,"l1");a(x$i,"JE");u3e={completion:{values:[],hasMore:!1}};a(yGc,"ts");a(EGc,"as");a(_Gc,"ss");a(xr,"b");w$i=15e3,CGc=xr(()=>H.object({session_id:H.string(),ws_url:H.string(),work_dir:H.string().optional(),session_key:H.string().optional()})),GR=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},WLr=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new iTt;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 g1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new g1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await bGc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=nFe(s);if(!(c instanceof g1)){let l=c instanceof GR&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&R$i(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 GR(`WebSocket connection timeout after ${w$i}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},w$i,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,jR(`[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(j3r,"e8");a(Sm,"t$");I6c={},x6c=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");Co.init(t,e),t.def=e,t.parse=(r,n)=>DSt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>ITt(t,r,n),t.parseAsync=async(r,n)=>NSt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>xTt(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)=>aN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),w6c=ft("ZodMiniObject",(t,e)=>{r3r.init(t,e),x6c.init(t,e),Qs.defineLazy(t,"shape",()=>e.shape)});a($Hi,"tq");a(eB,"a6");a(fEe,"S0");a(ZLe,"S1");a(R4r,"I3");a(F3e,"v1");a(BLe,"$9");a(P4r,"R3");a(R6c,"_M");a(P6c,"kM");a(eKi,"P3");G={};tB(G,{xid:a(()=>G6c,"xid"),void:a(()=>d9c,"void"),uuidv7:a(()=>L6c,"uuidv7"),uuidv6:a(()=>B6c,"uuidv6"),uuidv4:a(()=>O6c,"uuidv4"),uuid:a(()=>M6c,"uuid"),url:a(()=>F6c,"url"),uppercase:a(()=>D3r,"uppercase"),unknown:a(()=>zd,"unknown"),union:a(()=>Kl,"union"),undefined:a(()=>l9c,"undefined"),ulid:a(()=>H6c,"ulid"),uint64:a(()=>a9c,"uint64"),uint32:a(()=>i9c,"uint32"),tuple:a(()=>m9c,"tuple"),trim:a(()=>F3r,"trim"),treeifyError:a(()=>cWi,"treeifyError"),transform:a(()=>EFr,"transform"),toUpperCase:a(()=>Q3r,"toUpperCase"),toLowerCase:a(()=>U3r,"toLowerCase"),toJSONSchema:a(()=>j3r,"toJSONSchema"),templateLiteral:a(()=>S9c,"templateLiteral"),symbol:a(()=>c9c,"symbol"),superRefine:a(()=>$Ki,"superRefine"),success:a(()=>C9c,"success"),stringbool:a(()=>x9c,"stringbool"),stringFormat:a(()=>e9c,"stringFormat"),string:a(()=>It,"string"),strictObject:a(()=>h9c,"strictObject"),startsWith:a(()=>M3r,"startsWith"),size:a(()=>R3r,"size"),setErrorMap:a(()=>P9c,"setErrorMap"),set:a(()=>y9c,"set"),safeParseAsync:a(()=>lKi,"safeParseAsync"),safeParse:a(()=>cKi,"safeParse"),registry:a(()=>a3r,"registry"),regexes:a(()=>WLr,"regexes"),regex:a(()=>P3r,"regex"),refine:a(()=>GKi,"refine"),record:a(()=>Yl,"record"),readonly:a(()=>LKi,"readonly"),property:a(()=>VYi,"property"),promise:a(()=>T9c,"promise"),prettifyError:a(()=>uWi,"prettifyError"),preprocess:a(()=>bFr,"preprocess"),prefault:a(()=>PKi,"prefault"),positive:a(()=>jYi,"positive"),pipe:a(()=>qSt,"pipe"),partialRecord:a(()=>g9c,"partialRecord"),parseAsync:a(()=>aKi,"parseAsync"),parse:a(()=>sKi,"parse"),overwrite:a(()=>Qne,"overwrite"),optional:a(()=>gd,"optional"),object:a(()=>vn,"object"),number:a(()=>Pc,"number"),nullish:a(()=>v9c,"nullish"),nullable:a(()=>QSt,"nullable"),null:a(()=>pFr,"null"),normalize:a(()=>L3r,"normalize"),nonpositive:a(()=>GYi,"nonpositive"),nonoptional:a(()=>kKi,"nonoptional"),nonnegative:a(()=>$Yi,"nonnegative"),never:a(()=>BTt,"never"),negative:a(()=>HYi,"negative"),nativeEnum:a(()=>E9c,"nativeEnum"),nanoid:a(()=>Q6c,"nanoid"),nan:a(()=>b9c,"nan"),multipleOf:a(()=>b3e,"multipleOf"),minSize:a(()=>S3e,"minSize"),minLength:a(()=>UEe,"minLength"),mime:a(()=>B3r,"mime"),maxSize:a(()=>RTt,"maxSize"),maxLength:a(()=>PTt,"maxLength"),map:a(()=>A9c,"map"),lte:a(()=>eN,"lte"),lt:a(()=>Mne,"lt"),lowercase:a(()=>k3r,"lowercase"),looseObject:a(()=>Nv,"looseObject"),locales:a(()=>s3r,"locales"),literal:a(()=>ei,"literal"),length:a(()=>kTt,"length"),lazy:a(()=>QKi,"lazy"),ksuid:a(()=>$6c,"ksuid"),keyof:a(()=>p9c,"keyof"),jwt:a(()=>X6c,"jwt"),json:a(()=>w9c,"json"),iso:a(()=>H3r,"iso"),ipv6:a(()=>W6c,"ipv6"),ipv4:a(()=>V6c,"ipv4"),intersection:a(()=>FTt,"intersection"),int64:a(()=>s9c,"int64"),int32:a(()=>n9c,"int32"),int:a(()=>xBr,"int"),instanceof:a(()=>I9c,"instanceof"),includes:a(()=>N3r,"includes"),guid:a(()=>N6c,"guid"),gte:a(()=>oI,"gte"),gt:a(()=>One,"gt"),globalRegistry:a(()=>K6,"globalRegistry"),getErrorMap:a(()=>k9c,"getErrorMap"),function:a(()=>XYi,"function"),formatError:a(()=>jLr,"formatError"),float64:a(()=>r9c,"float64"),float32:a(()=>t9c,"float32"),flattenError:a(()=>qLr,"flattenError"),file:a(()=>_9c,"file"),enum:a(()=>f1,"enum"),endsWith:a(()=>O3r,"endsWith"),emoji:a(()=>U6c,"emoji"),email:a(()=>D6c,"email"),e164:a(()=>Z6c,"e164"),discriminatedUnion:a(()=>gFr,"discriminatedUnion"),date:a(()=>f9c,"date"),custom:a(()=>HKi,"custom"),cuid2:a(()=>j6c,"cuid2"),cuid:a(()=>q6c,"cuid"),core:a(()=>KVi,"core"),config:a(()=>Bv,"config"),coerce:a(()=>VKi,"coerce"),clone:a(()=>aN,"clone"),cidrv6:a(()=>Y6c,"cidrv6"),cidrv4:a(()=>z6c,"cidrv4"),check:a(()=>jKi,"check"),catch:a(()=>MKi,"catch"),boolean:a(()=>Tm,"boolean"),bigint:a(()=>o9c,"bigint"),base64url:a(()=>J6c,"base64url"),base64:a(()=>K6c,"base64"),array:a(()=>Aa,"array"),any:a(()=>u9c,"any"),_default:a(()=>wKi,"_default"),_ZodString:a(()=>z3r,"_ZodString"),ZodXID:a(()=>rFr,"ZodXID"),ZodVoid:a(()=>AKi,"ZodVoid"),ZodUnknown:a(()=>mKi,"ZodUnknown"),ZodUnion:a(()=>mFr,"ZodUnion"),ZodUndefined:a(()=>fKi,"ZodUndefined"),ZodUUID:a(()=>J6,"ZodUUID"),ZodURL:a(()=>K3r,"ZodURL"),ZodULID:a(()=>tFr,"ZodULID"),ZodType:a(()=>ws,"ZodType"),ZodTuple:a(()=>vKi,"ZodTuple"),ZodTransform:a(()=>yFr,"ZodTransform"),ZodTemplateLiteral:a(()=>FKi,"ZodTemplateLiteral"),ZodSymbol:a(()=>dKi,"ZodSymbol"),ZodSuccess:a(()=>DKi,"ZodSuccess"),ZodStringFormat:a(()=>yd,"ZodStringFormat"),ZodString:a(()=>DTt,"ZodString"),ZodSet:a(()=>bKi,"ZodSet"),ZodRecord:a(()=>AFr,"ZodRecord"),ZodRealError:a(()=>U3e,"ZodRealError"),ZodReadonly:a(()=>BKi,"ZodReadonly"),ZodPromise:a(()=>qKi,"ZodPromise"),ZodPrefault:a(()=>RKi,"ZodPrefault"),ZodPipe:a(()=>CFr,"ZodPipe"),ZodOptional:a(()=>_Fr,"ZodOptional"),ZodObject:a(()=>LTt,"ZodObject"),ZodNumberFormat:a(()=>ZEe,"ZodNumberFormat"),ZodNumber:a(()=>NTt,"ZodNumber"),ZodNullable:a(()=>IKi,"ZodNullable"),ZodNull:a(()=>pKi,"ZodNull"),ZodNonOptional:a(()=>vFr,"ZodNonOptional"),ZodNever:a(()=>gKi,"ZodNever"),ZodNanoID:a(()=>Z3r,"ZodNanoID"),ZodNaN:a(()=>OKi,"ZodNaN"),ZodMap:a(()=>CKi,"ZodMap"),ZodLiteral:a(()=>SKi,"ZodLiteral"),ZodLazy:a(()=>UKi,"ZodLazy"),ZodKSUID:a(()=>nFr,"ZodKSUID"),ZodJWT:a(()=>dFr,"ZodJWT"),ZodIssueCode:a(()=>R9c,"ZodIssueCode"),ZodIntersection:a(()=>_Ki,"ZodIntersection"),ZodISOTime:a(()=>V3r,"ZodISOTime"),ZodISODuration:a(()=>W3r,"ZodISODuration"),ZodISODateTime:a(()=>G3r,"ZodISODateTime"),ZodISODate:a(()=>$3r,"ZodISODate"),ZodIPv6:a(()=>oFr,"ZodIPv6"),ZodIPv4:a(()=>iFr,"ZodIPv4"),ZodGUID:a(()=>USt,"ZodGUID"),ZodFile:a(()=>TKi,"ZodFile"),ZodError:a(()=>k6c,"ZodError"),ZodEnum:a(()=>I3e,"ZodEnum"),ZodEmoji:a(()=>J3r,"ZodEmoji"),ZodEmail:a(()=>Y3r,"ZodEmail"),ZodE164:a(()=>uFr,"ZodE164"),ZodDiscriminatedUnion:a(()=>EKi,"ZodDiscriminatedUnion"),ZodDefault:a(()=>xKi,"ZodDefault"),ZodDate:a(()=>hFr,"ZodDate"),ZodCustomStringFormat:a(()=>uKi,"ZodCustomStringFormat"),ZodCustom:a(()=>UTt,"ZodCustom"),ZodCatch:a(()=>NKi,"ZodCatch"),ZodCUID2:a(()=>eFr,"ZodCUID2"),ZodCUID:a(()=>X3r,"ZodCUID"),ZodCIDRv6:a(()=>aFr,"ZodCIDRv6"),ZodCIDRv4:a(()=>sFr,"ZodCIDRv4"),ZodBoolean:a(()=>MTt,"ZodBoolean"),ZodBigIntFormat:a(()=>fFr,"ZodBigIntFormat"),ZodBigInt:a(()=>OTt,"ZodBigInt"),ZodBase64URL:a(()=>lFr,"ZodBase64URL"),ZodBase64:a(()=>cFr,"ZodBase64"),ZodArray:a(()=>yKi,"ZodArray"),ZodAny:a(()=>hKi,"ZodAny"),TimePrecision:a(()=>mYi,"TimePrecision"),NEVER:a(()=>JVi,"NEVER"),$output:a(()=>dYi,"$output"),$input:a(()=>fYi,"$input"),$brand:a(()=>ZVi,"$brand")});H3r={};tB(H3r,{time:a(()=>nKi,"time"),duration:a(()=>iKi,"duration"),datetime:a(()=>tKi,"datetime"),date:a(()=>rKi,"date"),ZodISOTime:a(()=>V3r,"ZodISOTime"),ZodISODuration:a(()=>W3r,"ZodISODuration"),ZodISODateTime:a(()=>G3r,"ZodISODateTime"),ZodISODate:a(()=>$3r,"ZodISODate")});G3r=ft("ZodISODateTime",(t,e)=>{Ezi.init(t,e),yd.init(t,e)});a(tKi,"aq");$3r=ft("ZodISODate",(t,e)=>{_zi.init(t,e),yd.init(t,e)});a(rKi,"sq");V3r=ft("ZodISOTime",(t,e)=>{vzi.init(t,e),yd.init(t,e)});a(nKi,"eq");W3r=ft("ZodISODuration",(t,e)=>{Czi.init(t,e),yd.init(t,e)});a(iKi,"$V");oKi=a((t,e)=>{QLr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>jLr(t,r),"value")},flatten:{value:a(r=>qLr(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"),k6c=ft("ZodError",oKi),U3e=ft("ZodError",oKi,{Parent:Error}),sKi=HLr(U3e),aKi=GLr(U3e),cKi=$Lr(U3e),lKi=VLr(U3e),ws=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)=>aN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>sKi(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>cKi(t,r,n),t.parseAsync=async(r,n)=>aKi(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>lKi(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(GKi(r,n)),t.superRefine=r=>t.check($Ki(r)),t.overwrite=r=>t.check(Qne(r)),t.optional=()=>gd(t),t.nullable=()=>QSt(t),t.nullish=()=>gd(QSt(t)),t.nonoptional=r=>kKi(t,r),t.array=()=>Aa(t),t.or=r=>Kl([t,r]),t.and=r=>FTt(t,r),t.transform=r=>qSt(t,EFr(r)),t.default=r=>wKi(t,r),t.prefault=r=>PKi(t,r),t.catch=r=>MKi(t,r),t.pipe=r=>qSt(t,r),t.readonly=()=>LKi(t),t.describe=r=>{let n=t.clone();return K6.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return K6.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return K6.get(t);let n=t.clone();return K6.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),z3r=ft("_ZodString",(t,e)=>{L3e.init(t,e),ws.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(P3r(...n)),t.includes=(...n)=>t.check(N3r(...n)),t.startsWith=(...n)=>t.check(M3r(...n)),t.endsWith=(...n)=>t.check(O3r(...n)),t.min=(...n)=>t.check(UEe(...n)),t.max=(...n)=>t.check(PTt(...n)),t.length=(...n)=>t.check(kTt(...n)),t.nonempty=(...n)=>t.check(UEe(1,...n)),t.lowercase=n=>t.check(k3r(n)),t.uppercase=n=>t.check(D3r(n)),t.trim=()=>t.check(F3r()),t.normalize=(...n)=>t.check(L3r(...n)),t.toLowerCase=()=>t.check(U3r()),t.toUpperCase=()=>t.check(Q3r())}),DTt=ft("ZodString",(t,e)=>{L3e.init(t,e),z3r.init(t,e),t.email=r=>t.check(c3r(Y3r,r)),t.url=r=>t.check(p3r(K3r,r)),t.jwt=r=>t.check(w3r(dFr,r)),t.emoji=r=>t.check(h3r(J3r,r)),t.guid=r=>t.check(BSt(USt,r)),t.uuid=r=>t.check(l3r(J6,r)),t.uuidv4=r=>t.check(u3r(J6,r)),t.uuidv6=r=>t.check(d3r(J6,r)),t.uuidv7=r=>t.check(f3r(J6,r)),t.nanoid=r=>t.check(m3r(Z3r,r)),t.guid=r=>t.check(BSt(USt,r)),t.cuid=r=>t.check(g3r(X3r,r)),t.cuid2=r=>t.check(A3r(eFr,r)),t.ulid=r=>t.check(y3r(tFr,r)),t.base64=r=>t.check(T3r(cFr,r)),t.base64url=r=>t.check(I3r(lFr,r)),t.xid=r=>t.check(E3r(rFr,r)),t.ksuid=r=>t.check(_3r(nFr,r)),t.ipv4=r=>t.check(v3r(iFr,r)),t.ipv6=r=>t.check(C3r(oFr,r)),t.cidrv4=r=>t.check(b3r(sFr,r)),t.cidrv6=r=>t.check(S3r(aFr,r)),t.e164=r=>t.check(x3r(uFr,r)),t.datetime=r=>t.check(tKi(r)),t.date=r=>t.check(rKi(r)),t.time=r=>t.check(nKi(r)),t.duration=r=>t.check(iKi(r))});a(It,"L");yd=ft("ZodStringFormat",(t,e)=>{Ru.init(t,e),z3r.init(t,e)}),Y3r=ft("ZodEmail",(t,e)=>{uzi.init(t,e),yd.init(t,e)});a(D6c,"Cm");USt=ft("ZodGUID",(t,e)=>{czi.init(t,e),yd.init(t,e)});a(N6c,"Tm");J6=ft("ZodUUID",(t,e)=>{lzi.init(t,e),yd.init(t,e)});a(M6c,"xm");a(O6c,"ym");a(B6c,"fm");a(L6c,"gm");K3r=ft("ZodURL",(t,e)=>{dzi.init(t,e),yd.init(t,e)});a(F6c,"hm");J3r=ft("ZodEmoji",(t,e)=>{fzi.init(t,e),yd.init(t,e)});a(U6c,"um");Z3r=ft("ZodNanoID",(t,e)=>{pzi.init(t,e),yd.init(t,e)});a(Q6c,"mm");X3r=ft("ZodCUID",(t,e)=>{hzi.init(t,e),yd.init(t,e)});a(q6c,"lm");eFr=ft("ZodCUID2",(t,e)=>{mzi.init(t,e),yd.init(t,e)});a(j6c,"cm");tFr=ft("ZodULID",(t,e)=>{gzi.init(t,e),yd.init(t,e)});a(H6c,"pm");rFr=ft("ZodXID",(t,e)=>{Azi.init(t,e),yd.init(t,e)});a(G6c,"dm");nFr=ft("ZodKSUID",(t,e)=>{yzi.init(t,e),yd.init(t,e)});a($6c,"im");iFr=ft("ZodIPv4",(t,e)=>{bzi.init(t,e),yd.init(t,e)});a(V6c,"nm");oFr=ft("ZodIPv6",(t,e)=>{Szi.init(t,e),yd.init(t,e)});a(W6c,"rm");sFr=ft("ZodCIDRv4",(t,e)=>{Tzi.init(t,e),yd.init(t,e)});a(z6c,"om");aFr=ft("ZodCIDRv6",(t,e)=>{Izi.init(t,e),yd.init(t,e)});a(Y6c,"tm");cFr=ft("ZodBase64",(t,e)=>{xzi.init(t,e),yd.init(t,e)});a(K6c,"am");lFr=ft("ZodBase64URL",(t,e)=>{Rzi.init(t,e),yd.init(t,e)});a(J6c,"sm");uFr=ft("ZodE164",(t,e)=>{Pzi.init(t,e),yd.init(t,e)});a(Z6c,"em");dFr=ft("ZodJWT",(t,e)=>{Dzi.init(t,e),yd.init(t,e)});a(X6c,"$l");uKi=ft("ZodCustomStringFormat",(t,e)=>{Nzi.init(t,e),yd.init(t,e)});a(e9c,"Ql");NTt=ft("ZodNumber",(t,e)=>{ZLr.init(t,e),ws.init(t,e),t.gt=(n,o)=>t.check(One(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(Mne(n,o)),t.lte=(n,o)=>t.check(eN(n,o)),t.max=(n,o)=>t.check(eN(n,o)),t.int=n=>t.check(xBr(n)),t.safe=n=>t.check(xBr(n)),t.positive=n=>t.check(One(0,n)),t.nonnegative=n=>t.check(oI(0,n)),t.negative=n=>t.check(Mne(0,n)),t.nonpositive=n=>t.check(eN(0,n)),t.multipleOf=(n,o)=>t.check(b3e(n,o)),t.step=(n,o)=>t.check(b3e(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(Pc,"z$");ZEe=ft("ZodNumberFormat",(t,e)=>{Mzi.init(t,e),NTt.init(t,e)});a(xBr,"WV");a(t9c,"Jl");a(r9c,"Xl");a(n9c,"Yl");a(i9c,"Wl");MTt=ft("ZodBoolean",(t,e)=>{XLr.init(t,e),ws.init(t,e)});a(Tm,"i$");OTt=ft("ZodBigInt",(t,e)=>{e3r.init(t,e),ws.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(One(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(Mne(n,o)),t.lte=(n,o)=>t.check(eN(n,o)),t.max=(n,o)=>t.check(eN(n,o)),t.positive=n=>t.check(One(BigInt(0),n)),t.negative=n=>t.check(Mne(BigInt(0),n)),t.nonpositive=n=>t.check(eN(BigInt(0),n)),t.nonnegative=n=>t.check(oI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(b3e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(o9c,"Gl");fFr=ft("ZodBigIntFormat",(t,e)=>{Ozi.init(t,e),OTt.init(t,e)});a(s9c,"Ul");a(a9c,"Hl");dKi=ft("ZodSymbol",(t,e)=>{Bzi.init(t,e),ws.init(t,e)});a(c9c,"Kl");fKi=ft("ZodUndefined",(t,e)=>{Lzi.init(t,e),ws.init(t,e)});a(l9c,"ql");pKi=ft("ZodNull",(t,e)=>{Fzi.init(t,e),ws.init(t,e)});a(pFr,"T3");hKi=ft("ZodAny",(t,e)=>{Uzi.init(t,e),ws.init(t,e)});a(u9c,"Vl");mKi=ft("ZodUnknown",(t,e)=>{OSt.init(t,e),ws.init(t,e)});a(zd,"S$");gKi=ft("ZodNever",(t,e)=>{Qzi.init(t,e),ws.init(t,e)});a(BTt,"x3");AKi=ft("ZodVoid",(t,e)=>{qzi.init(t,e),ws.init(t,e)});a(d9c,"Bl");hFr=ft("ZodDate",(t,e)=>{jzi.init(t,e),ws.init(t,e),t.min=(n,o)=>t.check(oI(n,o)),t.max=(n,o)=>t.check(eN(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(f9c,"zl");yKi=ft("ZodArray",(t,e)=>{t3r.init(t,e),ws.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(UEe(r,n)),t.nonempty=r=>t.check(UEe(1,r)),t.max=(r,n)=>t.check(PTt(r,n)),t.length=(r,n)=>t.check(kTt(r,n)),t.unwrap=()=>t.element});a(Aa,"W$");a(p9c,"Nl");LTt=ft("ZodObject",(t,e)=>{r3r.init(t,e),ws.init(t,e),Qs.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:zd()}),t.loose=()=>t.clone({...t._zod.def,catchall:zd()}),t.strict=()=>t.clone({...t._zod.def,catchall:BTt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Qs.extend(t,r),t.merge=r=>Qs.merge(t,r),t.pick=r=>Qs.pick(t,r),t.omit=r=>Qs.omit(t,r),t.partial=(...r)=>Qs.partial(_Fr,t,r[0]),t.required=(...r)=>Qs.required(vFr,t,r[0])});a(vn,"h");a(h9c,"wl");a(Nv,"K6");mFr=ft("ZodUnion",(t,e)=>{n3r.init(t,e),ws.init(t,e),t.options=e.options});a(Kl,"A$");EKi=ft("ZodDiscriminatedUnion",(t,e)=>{mFr.init(t,e),Hzi.init(t,e)});a(gFr,"g3");_Ki=ft("ZodIntersection",(t,e)=>{Gzi.init(t,e),ws.init(t,e)});a(FTt,"VJ");vKi=ft("ZodTuple",(t,e)=>{wTt.init(t,e),ws.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(m9c,"Ol");AFr=ft("ZodRecord",(t,e)=>{$zi.init(t,e),ws.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(Yl,"I$");a(g9c,"Dl");CKi=ft("ZodMap",(t,e)=>{Vzi.init(t,e),ws.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(A9c,"Fl");bKi=ft("ZodSet",(t,e)=>{Wzi.init(t,e),ws.init(t,e),t.min=(...r)=>t.check(S3e(...r)),t.nonempty=r=>t.check(S3e(1,r)),t.max=(...r)=>t.check(RTt(...r)),t.size=(...r)=>t.check(R3r(...r))});a(y9c,"Zl");I3e=ft("ZodEnum",(t,e)=>{zzi.init(t,e),ws.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 I3e({...e,checks:[],...Qs.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 I3e({...e,checks:[],...Qs.normalizeParams(o),entries:s})}});a(f1,"N6");a(E9c,"Ml");SKi=ft("ZodLiteral",(t,e)=>{Yzi.init(t,e),ws.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(ei,"l");TKi=ft("ZodFile",(t,e)=>{Kzi.init(t,e),ws.init(t,e),t.min=(r,n)=>t.check(S3e(r,n)),t.max=(r,n)=>t.check(RTt(r,n)),t.mime=(r,n)=>t.check(B3r(Array.isArray(r)?r:[r],n))});a(_9c,"Ll");yFr=ft("ZodTransform",(t,e)=>{i3r.init(t,e),ws.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Qs.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(Qs.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(EFr,"bV");_Fr=ft("ZodOptional",(t,e)=>{Jzi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(gd,"_$");IKi=ft("ZodNullable",(t,e)=>{Zzi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(QSt,"v3");a(v9c,"jl");xKi=ft("ZodDefault",(t,e)=>{Xzi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(wKi,"aM");RKi=ft("ZodPrefault",(t,e)=>{eYi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(PKi,"eM");vFr=ft("ZodNonOptional",(t,e)=>{tYi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(kKi,"$L");DKi=ft("ZodSuccess",(t,e)=>{rYi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(C9c,"Al");NKi=ft("ZodCatch",(t,e)=>{nYi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(MKi,"XL");OKi=ft("ZodNaN",(t,e)=>{iYi.init(t,e),ws.init(t,e)});a(b9c,"Il");CFr=ft("ZodPipe",(t,e)=>{o3r.init(t,e),ws.init(t,e),t.in=e.in,t.out=e.out});a(qSt,"C3");BKi=ft("ZodReadonly",(t,e)=>{oYi.init(t,e),ws.init(t,e)});a(LKi,"GL");FKi=ft("ZodTemplateLiteral",(t,e)=>{sYi.init(t,e),ws.init(t,e)});a(S9c,"Rl");UKi=ft("ZodLazy",(t,e)=>{cYi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(QKi,"KL");qKi=ft("ZodPromise",(t,e)=>{aYi.init(t,e),ws.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(T9c,"Pl");UTt=ft("ZodCustom",(t,e)=>{lYi.init(t,e),ws.init(t,e)});a(jKi,"VL");a(HKi,"vV");a(GKi,"BL");a($Ki,"zL");a(I9c,"El");x9c=a((...t)=>JYi({Pipe:CFr,Boolean:MTt,String:DTt,Transform:yFr},...t),"bl");a(w9c,"_l");a(bFr,"u3");R9c={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(P9c,"Sl");a(k9c,"vl");VKi={};tB(VKi,{string:a(()=>D9c,"string"),number:a(()=>N9c,"number"),date:a(()=>B9c,"date"),boolean:a(()=>M9c,"boolean"),bigint:a(()=>O9c,"bigint")});a(D9c,"Cl");a(N9c,"Tl");a(M9c,"xl");a(O9c,"yl");a(B9c,"fl");Bv(uYi());L9c=G,WKi=L9c,zKi="2025-11-25",F9c=[zKi,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Cne="io.modelcontextprotocol/related-task",QTt="2.0",Im=HKi(t=>t!==null&&(typeof t=="object"||typeof t=="function")),YKi=Kl([It(),Pc().int()]),KKi=It(),JNh=Nv({ttl:Pc().optional(),pollInterval:Pc().optional()}),U9c=vn({ttl:Pc().optional()}),Q9c=vn({taskId:It()}),SFr=Nv({progressToken:YKi.optional(),[Cne]:Q9c.optional()}),uI=vn({_meta:SFr.optional()}),Q3e=uI.extend({task:U9c.optional()}),q9c=a(t=>Q3e.safeParse(t).success,"FL"),gy=vn({method:It(),params:uI.loose().optional()}),HR=vn({_meta:SFr.optional()}),GR=vn({method:It(),params:HR.loose().optional()}),Ay=Nv({_meta:SFr.optional()}),qTt=Kl([It(),Pc().int()]),JKi=vn({jsonrpc:ei(QTt),id:qTt,...gy.shape}).strict(),VHi=a(t=>JKi.safeParse(t).success,"fV"),ZKi=vn({jsonrpc:ei(QTt),...GR.shape}).strict(),j9c=a(t=>ZKi.safeParse(t).success,"LL"),TFr=vn({jsonrpc:ei(QTt),id:qTt,result:Ay}).strict(),D1t=a(t=>TFr.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"})(Oi||(Oi={}));IFr=vn({jsonrpc:ei(QTt),id:qTt.optional(),error:vn({code:Pc().int(),message:It(),data:zd().optional()})}).strict(),H9c=a(t=>IFr.safeParse(t).success,"jL"),ZNh=Kl([JKi,ZKi,TFr,IFr]),XNh=Kl([TFr,IFr]),xFr=Ay.strict(),G9c=HR.extend({requestId:qTt.optional(),reason:It().optional()}),wFr=GR.extend({method:ei("notifications/cancelled"),params:G9c}),$9c=vn({src:It(),mimeType:It().optional(),sizes:Aa(It()).optional(),theme:f1(["light","dark"]).optional()}),q3e=vn({icons:Aa($9c).optional()}),QEe=vn({name:It(),title:It().optional()}),XKi=QEe.extend({...QEe.shape,...q3e.shape,version:It(),websiteUrl:It().optional(),description:It().optional()}),V9c=FTt(vn({applyDefaults:Tm().optional()}),Yl(It(),zd())),W9c=bFr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,FTt(vn({form:V9c.optional(),url:Im.optional()}),Yl(It(),zd()).optional())),z9c=Nv({list:Im.optional(),cancel:Im.optional(),requests:Nv({sampling:Nv({createMessage:Im.optional()}).optional(),elicitation:Nv({create:Im.optional()}).optional()}).optional()}),Y9c=Nv({list:Im.optional(),cancel:Im.optional(),requests:Nv({tools:Nv({call:Im.optional()}).optional()}).optional()}),K9c=vn({experimental:Yl(It(),Im).optional(),sampling:vn({context:Im.optional(),tools:Im.optional()}).optional(),elicitation:W9c.optional(),roots:vn({listChanged:Tm().optional()}).optional(),tasks:z9c.optional(),extensions:Yl(It(),Im).optional()}),J9c=uI.extend({protocolVersion:It(),capabilities:K9c,clientInfo:XKi}),eJi=gy.extend({method:ei("initialize"),params:J9c}),Z9c=vn({experimental:Yl(It(),Im).optional(),logging:Im.optional(),completions:Im.optional(),prompts:vn({listChanged:Tm().optional()}).optional(),resources:vn({subscribe:Tm().optional(),listChanged:Tm().optional()}).optional(),tools:vn({listChanged:Tm().optional()}).optional(),tasks:Y9c.optional(),extensions:Yl(It(),Im).optional()}),X9c=Ay.extend({protocolVersion:It(),capabilities:Z9c,serverInfo:XKi,instructions:It().optional()}),tJi=GR.extend({method:ei("notifications/initialized"),params:HR.optional()}),RFr=gy.extend({method:ei("ping"),params:uI.optional()}),eUc=vn({progress:Pc(),total:gd(Pc()),message:gd(It())}),tUc=vn({...HR.shape,...eUc.shape,progressToken:YKi}),PFr=GR.extend({method:ei("notifications/progress"),params:tUc}),rUc=uI.extend({cursor:KKi.optional()}),j3e=gy.extend({params:rUc.optional()}),H3e=Ay.extend({nextCursor:KKi.optional()}),nUc=f1(["working","input_required","completed","failed","cancelled"]),G3e=vn({taskId:It(),status:nUc,ttl:Kl([Pc(),pFr()]),createdAt:It(),lastUpdatedAt:It(),pollInterval:gd(Pc()),statusMessage:gd(It())}),jTt=Ay.extend({task:G3e}),iUc=HR.merge(G3e),jSt=GR.extend({method:ei("notifications/tasks/status"),params:iUc}),kFr=gy.extend({method:ei("tasks/get"),params:uI.extend({taskId:It()})}),DFr=Ay.merge(G3e),NFr=gy.extend({method:ei("tasks/result"),params:uI.extend({taskId:It()})}),eMh=Ay.loose(),MFr=j3e.extend({method:ei("tasks/list")}),OFr=H3e.extend({tasks:Aa(G3e)}),BFr=gy.extend({method:ei("tasks/cancel"),params:uI.extend({taskId:It()})}),oUc=Ay.merge(G3e),rJi=vn({uri:It(),mimeType:gd(It()),_meta:Yl(It(),zd()).optional()}),nJi=rJi.extend({text:It()}),LFr=It().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),iJi=rJi.extend({blob:LFr}),$3e=f1(["user","assistant"]),XEe=vn({audience:Aa($3e).optional(),priority:Pc().min(0).max(1).optional(),lastModified:H3r.datetime({offset:!0}).optional()}),oJi=vn({...QEe.shape,...q3e.shape,uri:It(),description:gd(It()),mimeType:gd(It()),size:gd(Pc()),annotations:XEe.optional(),_meta:gd(Nv({}))}),sUc=vn({...QEe.shape,...q3e.shape,uriTemplate:It(),description:gd(It()),mimeType:gd(It()),annotations:XEe.optional(),_meta:gd(Nv({}))}),wBr=j3e.extend({method:ei("resources/list")}),aUc=H3e.extend({resources:Aa(oJi)}),RBr=j3e.extend({method:ei("resources/templates/list")}),cUc=H3e.extend({resourceTemplates:Aa(sUc)}),FFr=uI.extend({uri:It()}),lUc=FFr,PBr=gy.extend({method:ei("resources/read"),params:lUc}),uUc=Ay.extend({contents:Aa(Kl([nJi,iJi]))}),dUc=GR.extend({method:ei("notifications/resources/list_changed"),params:HR.optional()}),fUc=FFr,pUc=gy.extend({method:ei("resources/subscribe"),params:fUc}),hUc=FFr,mUc=gy.extend({method:ei("resources/unsubscribe"),params:hUc}),gUc=HR.extend({uri:It()}),AUc=GR.extend({method:ei("notifications/resources/updated"),params:gUc}),yUc=vn({name:It(),description:gd(It()),required:gd(Tm())}),EUc=vn({...QEe.shape,...q3e.shape,description:gd(It()),arguments:gd(Aa(yUc)),_meta:gd(Nv({}))}),kBr=j3e.extend({method:ei("prompts/list")}),_Uc=H3e.extend({prompts:Aa(EUc)}),vUc=uI.extend({name:It(),arguments:Yl(It(),It()).optional()}),DBr=gy.extend({method:ei("prompts/get"),params:vUc}),UFr=vn({type:ei("text"),text:It(),annotations:XEe.optional(),_meta:Yl(It(),zd()).optional()}),QFr=vn({type:ei("image"),data:LFr,mimeType:It(),annotations:XEe.optional(),_meta:Yl(It(),zd()).optional()}),qFr=vn({type:ei("audio"),data:LFr,mimeType:It(),annotations:XEe.optional(),_meta:Yl(It(),zd()).optional()}),CUc=vn({type:ei("tool_use"),name:It(),id:It(),input:Yl(It(),zd()),_meta:Yl(It(),zd()).optional()}),bUc=vn({type:ei("resource"),resource:Kl([nJi,iJi]),annotations:XEe.optional(),_meta:Yl(It(),zd()).optional()}),SUc=oJi.extend({type:ei("resource_link")}),jFr=Kl([UFr,QFr,qFr,SUc,bUc]),TUc=vn({role:$3e,content:jFr}),IUc=Ay.extend({description:It().optional(),messages:Aa(TUc)}),xUc=GR.extend({method:ei("notifications/prompts/list_changed"),params:HR.optional()}),wUc=vn({title:It().optional(),readOnlyHint:Tm().optional(),destructiveHint:Tm().optional(),idempotentHint:Tm().optional(),openWorldHint:Tm().optional()}),RUc=vn({taskSupport:f1(["required","optional","forbidden"]).optional()}),sJi=vn({...QEe.shape,...q3e.shape,description:It().optional(),inputSchema:vn({type:ei("object"),properties:Yl(It(),Im).optional(),required:Aa(It()).optional()}).catchall(zd()),outputSchema:vn({type:ei("object"),properties:Yl(It(),Im).optional(),required:Aa(It()).optional()}).catchall(zd()).optional(),annotations:wUc.optional(),execution:RUc.optional(),_meta:Yl(It(),zd()).optional()}),NBr=j3e.extend({method:ei("tools/list")}),PUc=H3e.extend({tools:Aa(sJi)}),HFr=Ay.extend({content:Aa(jFr).default([]),structuredContent:Yl(It(),zd()).optional(),isError:Tm().optional()}),tMh=HFr.or(Ay.extend({toolResult:zd()})),kUc=Q3e.extend({name:It(),arguments:Yl(It(),zd()).optional()}),HSt=gy.extend({method:ei("tools/call"),params:kUc}),DUc=GR.extend({method:ei("notifications/tools/list_changed"),params:HR.optional()}),rMh=vn({autoRefresh:Tm().default(!0),debounceMs:Pc().int().nonnegative().default(300)}),GSt=f1(["debug","info","notice","warning","error","critical","alert","emergency"]),NUc=uI.extend({level:GSt}),aJi=gy.extend({method:ei("logging/setLevel"),params:NUc}),MUc=HR.extend({level:GSt,logger:It().optional(),data:zd()}),OUc=GR.extend({method:ei("notifications/message"),params:MUc}),BUc=vn({name:It().optional()}),LUc=vn({hints:Aa(BUc).optional(),costPriority:Pc().min(0).max(1).optional(),speedPriority:Pc().min(0).max(1).optional(),intelligencePriority:Pc().min(0).max(1).optional()}),FUc=vn({mode:f1(["auto","required","none"]).optional()}),UUc=vn({type:ei("tool_result"),toolUseId:It().describe("The unique identifier for the corresponding tool call."),content:Aa(jFr).default([]),structuredContent:vn({}).loose().optional(),isError:Tm().optional(),_meta:Yl(It(),zd()).optional()}),QUc=gFr("type",[UFr,QFr,qFr]),$St=gFr("type",[UFr,QFr,qFr,CUc,UUc]),qUc=vn({role:$3e,content:Kl([$St,Aa($St)]),_meta:Yl(It(),zd()).optional()}),jUc=Q3e.extend({messages:Aa(qUc),modelPreferences:LUc.optional(),systemPrompt:It().optional(),includeContext:f1(["none","thisServer","allServers"]).optional(),temperature:Pc().optional(),maxTokens:Pc().int(),stopSequences:Aa(It()).optional(),metadata:Im.optional(),tools:Aa(sJi).optional(),toolChoice:FUc.optional()}),HUc=gy.extend({method:ei("sampling/createMessage"),params:jUc}),GFr=Ay.extend({model:It(),stopReason:gd(f1(["endTurn","stopSequence","maxTokens"]).or(It())),role:$3e,content:QUc}),cJi=Ay.extend({model:It(),stopReason:gd(f1(["endTurn","stopSequence","maxTokens","toolUse"]).or(It())),role:$3e,content:Kl([$St,Aa($St)])}),GUc=vn({type:ei("boolean"),title:It().optional(),description:It().optional(),default:Tm().optional()}),$Uc=vn({type:ei("string"),title:It().optional(),description:It().optional(),minLength:Pc().optional(),maxLength:Pc().optional(),format:f1(["email","uri","date","date-time"]).optional(),default:It().optional()}),VUc=vn({type:f1(["number","integer"]),title:It().optional(),description:It().optional(),minimum:Pc().optional(),maximum:Pc().optional(),default:Pc().optional()}),WUc=vn({type:ei("string"),title:It().optional(),description:It().optional(),enum:Aa(It()),default:It().optional()}),zUc=vn({type:ei("string"),title:It().optional(),description:It().optional(),oneOf:Aa(vn({const:It(),title:It()})),default:It().optional()}),YUc=vn({type:ei("string"),title:It().optional(),description:It().optional(),enum:Aa(It()),enumNames:Aa(It()).optional(),default:It().optional()}),KUc=Kl([WUc,zUc]),JUc=vn({type:ei("array"),title:It().optional(),description:It().optional(),minItems:Pc().optional(),maxItems:Pc().optional(),items:vn({type:ei("string"),enum:Aa(It())}),default:Aa(It()).optional()}),ZUc=vn({type:ei("array"),title:It().optional(),description:It().optional(),minItems:Pc().optional(),maxItems:Pc().optional(),items:vn({anyOf:Aa(vn({const:It(),title:It()}))}),default:Aa(It()).optional()}),XUc=Kl([JUc,ZUc]),e7c=Kl([YUc,KUc,XUc]),t7c=Kl([e7c,GUc,$Uc,VUc]),r7c=Q3e.extend({mode:ei("form").optional(),message:It(),requestedSchema:vn({type:ei("object"),properties:Yl(It(),t7c),required:Aa(It()).optional()})}),n7c=Q3e.extend({mode:ei("url"),message:It(),elicitationId:It(),url:It().url()}),i7c=Kl([r7c,n7c]),o7c=gy.extend({method:ei("elicitation/create"),params:i7c}),s7c=HR.extend({elicitationId:It()}),a7c=GR.extend({method:ei("notifications/elicitation/complete"),params:s7c}),VSt=Ay.extend({action:f1(["accept","decline","cancel"]),content:bFr(t=>t===null?void 0:t,Yl(It(),Kl([It(),Pc(),Tm(),Aa(It())])).optional())}),c7c=vn({type:ei("ref/resource"),uri:It()}),l7c=vn({type:ei("ref/prompt"),name:It()}),u7c=uI.extend({ref:Kl([l7c,c7c]),argument:vn({name:It(),value:It()}),context:vn({arguments:Yl(It(),It()).optional()}).optional()}),MBr=gy.extend({method:ei("completion/complete"),params:u7c});a(d7c,"kL");a(f7c,"SL");p7c=Ay.extend({completion:Nv({values:Aa(It()).max(100),total:gd(Pc().int()),hasMore:gd(Tm())})}),h7c=vn({uri:It().startsWith("file://"),name:It().optional(),_meta:Yl(It(),zd()).optional()}),m7c=gy.extend({method:ei("roots/list"),params:uI.optional()}),lJi=Ay.extend({roots:Aa(h7c)}),g7c=GR.extend({method:ei("notifications/roots/list_changed"),params:HR.optional()}),nMh=Kl([RFr,eJi,MBr,aJi,DBr,kBr,wBr,RBr,PBr,pUc,mUc,HSt,NBr,kFr,NFr,MFr,BFr]),iMh=Kl([wFr,PFr,tJi,g7c,jSt]),oMh=Kl([xFr,GFr,cJi,VSt,lJi,DFr,OFr,jTt]),sMh=Kl([RFr,HUc,o7c,m7c,kFr,NFr,MFr,BFr]),aMh=Kl([wFr,PFr,OUc,AUc,dUc,DUc,xUc,jSt,a7c]),cMh=Kl([xFr,X9c,p7c,IUc,_Uc,aUc,cUc,uUc,HFr,PUc,DFr,OFr,jTt]),ui=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===Oi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new OBr(o.elicitations,r)}return new t(e,r,n)}},OBr=class extends ui{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Oi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(_ne,"T1");A7c=Symbol("Let zodToJsonSchema decide on which parser to use"),WHi={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"},y7c=a(t=>typeof t=="string"?{...WHi,name:t}:{...WHi,...t},"xL"),E7c=a(t=>{let e=y7c(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(uJi,"aV");a(ul,"H$");dJi=a((t,e)=>{let r=0;for(;rRc(t.innerType._def,e),"uL");a(pJi,"sV");S7c=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":ul(r,"minimum",n.value,n.message,e);break;case"max":ul(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(T7c,"mL");a(I7c,"lL");a(x7c,"cL");w7c=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(R7c,"pL");a(P7c,"dL");k4r=void 0,JD={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(()=>(k4r===void 0&&(k4r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),k4r),"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(hJi,"qW");a(D4r,"$B");k7c=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(D7c,"Np");a(ZD,"V4");a(Dv,"w6");a(zHi,"iL");a(mJi,"VW");a(N7c,"nL");a(M7c,"rL");a(O7c,"oL");a(B7c,"tL");WSt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(L7c,"sL");YHi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Rc(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(F7c,"eL");a(U7c,"$j");a(Q7c,"Qj");a(q7c,"wp");a(j7c,"Op");H7c=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Rc(t.innerType._def,e);let r=Rc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:d1(e)},r]}:d1(e)},"Jj"),G7c=a((t,e)=>{if(e.pipeStrategy==="input")return Rc(t.in._def,e);if(e.pipeStrategy==="output")return Rc(t.out._def,e);let r=Rc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Rc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a($7c,"Yj");a(V7c,"Wj");a(W7c,"Gj");a(z7c,"Uj");a(Y7c,"Hj");K7c=a((t,e)=>Rc(t.innerType._def,e),"Kj"),J7c=a((t,e,r)=>{switch(e){case Cr.ZodString:return hJi(t,r);case Cr.ZodNumber:return U7c(t,r);case Cr.ZodObject:return Q7c(t,r);case Cr.ZodBigInt:return v7c(t,r);case Cr.ZodBoolean:return C7c();case Cr.ZodDate:return pJi(t,r);case Cr.ZodUndefined:return z7c(r);case Cr.ZodNull:return B7c(r);case Cr.ZodArray:return _7c(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return L7c(t,r);case Cr.ZodIntersection:return R7c(t,r);case Cr.ZodTuple:return W7c(t,r);case Cr.ZodRecord:return mJi(t,r);case Cr.ZodLiteral:return P7c(t,r);case Cr.ZodEnum:return x7c(t);case Cr.ZodNativeEnum:return M7c(t);case Cr.ZodNullable:return F7c(t,r);case Cr.ZodOptional:return H7c(t,r);case Cr.ZodMap:return N7c(t,r);case Cr.ZodSet:return V7c(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return $7c(t,r);case Cr.ZodNaN:case Cr.ZodNever:return O7c(r);case Cr.ZodEffects:return I7c(t,r);case Cr.ZodAny:return d1(r);case Cr.ZodUnknown:return Y7c(r);case Cr.ZodDefault:return T7c(t,r);case Cr.ZodBranded:return fJi(t,r);case Cr.ZodReadonly:return K7c(t,r);case Cr.ZodCatch:return b7c(t,r);case Cr.ZodPipeline:return G7c(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Rc,"r");Z7c=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:dJi(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"),X7c=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),eQc=a((t,e)=>{let r=E7c(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Rc(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=Rc(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(tQc,"Zp");a(KHi,"JB");a(JHi,"XB");a(ZHi,"YB");rQc=6e4,BBr=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(wFr,r=>{this._oncancel(r)}),this.setNotificationHandler(PFr,r=>{this._onprogress(r)}),this.setRequestHandler(RFr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(kFr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ui(Oi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(NFr,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 ui(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 ui(Oi.InvalidParams,`Task not found: ${s}`);if(!_ne(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(_ne(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Cne]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(MFr,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 ui(Oi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(BFr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ui(Oi.InvalidParams,`Task not found: ${r.params.taskId}`);if(_ne(o.status))throw new ui(Oi.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 ui(Oi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof ui?o:new ui(Oi.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),ui.fromError(Oi.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),D1t(s)||H9c(s)?this._onresponse(s):VHi(s)?this._onrequest(s,c):j9c(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=ui.fromError(Oi.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?.[Cne]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Oi.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=q9c(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 ui(Oi.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:Oi.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),D1t(e))n(e);else{let c=new ui(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(D1t(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),D1t(e))o(e);else{let c=ui.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 ui?c:new ui(Oi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,jTt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new ui(Oi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},_ne(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new ui(Oi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new ui(Oi.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 ui?c:new ui(Oi.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||{},[Cne]: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 ui?v:new ui(Oi.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=ZLe(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??rQc,E=a(()=>A(ui.fromError(Oi.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},DFr,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},OFr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},oUc,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||{},[Cne]: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||{},[Cne]: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||{},[Cne]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=JHi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=ZHi(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=JHi(e);this._notificationHandlers.set(n,o=>{let s=ZHi(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"&&VHi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new ui(Oi.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 ui(Oi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new ui(Oi.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 ui(Oi.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=jSt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),_ne(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 ui(Oi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(_ne(l.status))throw new ui(Oi.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=jSt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),_ne(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(XHi,"Vj");a(nQc,"Bj");iQc=oLr(e$i(),1),oQc=oLr(MDc(),1);a(sQc,"ps");LBr=class{static{a(this,"qz")}constructor(e){this._ajv=e??sQc()}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)}}},FBr=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},GFr,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},VSt,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(aQc,"tP");a(cQc,"aP");UBr=class extends BBr{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(GSt.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(tJi,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(aJi,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=GSt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new FBr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=nQc(this._capabilities,e)}setRequestHandler(e,r){let n=F3e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(eB(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=ZLe(HSt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new ui(Oi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=ZLe(jTt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new ui(Oi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=ZLe(HFr,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new ui(Oi.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){cQc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&aQc(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:F9c.includes(r)?r:zKi,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"},xFr)}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},cJi,r):this.request({method:"sampling/createMessage",params:e},GFr,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},VSt,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},VSt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new ui(Oi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof ui?s:new ui(Oi.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},lJi,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"})}},gJi=Symbol.for("mcp.completable");a(eGi,"zz");a(lQc,"$E");(function(t){t.Completable="McpCompletable"})(tGi||(tGi={}));uQc=/^[A-Za-z0-9._-]{1,128}$/;a(dQc,"is");a(fQc,"ns");a(rGi,"Nz");QBr=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)}},qBr=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 UBr(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new QBr(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Z$(NBr)),this.server.assertCanSetRequestHandler(Z$(HSt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(NBr,()=>({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=BLe(r.inputSchema);return o?KHi(o,{strictUnions:!0,pipeStrategy:"input"}):pQc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=BLe(r.outputSchema);o&&(n.outputSchema=KHi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(HSt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new ui(Oi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new ui(Oi.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 ui(Oi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new ui(Oi.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 ui&&n.code===Oi.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=BLe(e.inputSchema)??e.inputSchema,s=await R4r(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=P4r(c);throw new ui(Oi.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 ui(Oi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=BLe(e.outputSchema),s=await R4r(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=P4r(c);throw new ui(Oi.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 ui(Oi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Z$(MBr)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(MBr,async e=>{switch(e.params.ref.type){case"ref/prompt":return d7c(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return f7c(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ui(Oi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new ui(Oi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new ui(Oi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return LLe;let o=F3e(n.argsSchema)?.[e.params.argument.name];if(!eGi(o))return LLe;let s=lQc(o);if(!s)return LLe;let c=await s(e.params.argument.value,e.params.context);return iGi(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 LLe;throw new ui(Oi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return LLe;let s=await o(e.params.argument.value,e.params.context);return iGi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Z$(wBr)),this.server.assertCanSetRequestHandler(Z$(RBr)),this.server.assertCanSetRequestHandler(Z$(PBr)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(wBr,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(RBr,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(PBr,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new ui(Oi.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 ui(Oi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Z$(kBr)),this.server.assertCanSetRequestHandler(Z$(DBr)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(kBr,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?hQc(r.argsSchema):void 0}))})),this.server.setRequestHandler(DBr,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new ui(Oi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new ui(Oi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=BLe(n.argsSchema),s=await R4r(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=P4r(u);throw new ui(Oi.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:fEe(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=fEe(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 qR?l._def?.innerType:l;return eGi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){rGi(e);let f={title:r,description:n,inputSchema:nGi(o),outputSchema:nGi(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"&&rGi(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=fEe(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=fEe(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(jBr(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!jBr(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()}},pQc={type:"object",properties:{}};a(AJi,"XE");a(yJi,"YE");a(jBr,"Oz");a(nGi,"QE");a(hQc,"os");a(Z$,"l1");a(iGi,"JE");LLe={completion:{values:[],hasMore:!1}};a(mQc,"ts");a(gQc,"as");a(AQc,"ss");a(xr,"b");oGi=15e3,yQc=xr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),LR=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},HBr=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new CSt;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 c1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new c1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await _Qc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=P3e(s);if(!(c instanceof c1)){let l=c instanceof LR&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&sGi(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 LR(`WebSocket connection timeout after ${oGi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},oGi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,OR(`[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=hN(f)}catch(m){jR(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new GR("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 GR(`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"?HWi("transport_direct_connect"):e==="bad"?GWi("transport_direct_connect",r??"unknown"):E6c("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 g1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new GR("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&&R$i(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(vGc,"$e");a(bGc,"Qe");a(R$i,"GE");a(zLr,"nJ");a(SGc,"Xe");a(TGc,"Ye");a(IGc,"We");a(xGc,"Ge");a(TIt,"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"})(k$i||(k$i={}));WBh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),zBh={" ":{"\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=sN(f)}catch(m){OR(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new LR("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 LR(`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"?_Vi("transport_direct_connect"):e==="bad"?vVi("transport_direct_connect",r??"unknown"):gLc("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 c1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new LR("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&&sGi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(EQc,"$e");a(_Qc,"Qe");a(sGi,"GE");a(GBr,"nJ");a(vQc,"Xe");a(CQc,"Ye");a(bQc,"We");a(SQc,"Ge");a(HTt,"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"})(aGi||(aGi={}));lMh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),uMh={" ":{"\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}})(P$i||(P$i={}));(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"})(D$i||(D$i={}));(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"})(N$i||(N$i={}));(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"})(M$i||(M$i={}));a(GZi,"rW");CV=Y8r.default.homedir(),K8r=Y8r.default.tmpdir(),{env:BEe}=kTt.default,wGc=a(t=>{let e=Yd.default.join(CV,"Library");return{data:Yd.default.join(e,"Application Support",t),config:Yd.default.join(e,"Preferences",t),cache:Yd.default.join(e,"Caches",t),log:Yd.default.join(e,"Logs",t),temp:Yd.default.join(K8r,t)}},"Oe"),RGc=a(t=>{let e=BEe.APPDATA||Yd.default.join(CV,"AppData","Roaming"),r=BEe.LOCALAPPDATA||Yd.default.join(CV,"AppData","Local");return{data:Yd.default.join(r,t,"Data"),config:Yd.default.join(e,t,"Config"),cache:Yd.default.join(r,t,"Cache"),log:Yd.default.join(r,t,"Log"),temp:Yd.default.join(K8r,t)}},"De"),kGc=a(t=>{let e=Yd.default.basename(CV);return{data:Yd.default.join(BEe.XDG_DATA_HOME||Yd.default.join(CV,".local","share"),t),config:Yd.default.join(BEe.XDG_CONFIG_HOME||Yd.default.join(CV,".config"),t),cache:Yd.default.join(BEe.XDG_CACHE_HOME||Yd.default.join(CV,".cache"),t),log:Yd.default.join(BEe.XDG_STATE_HOME||Yd.default.join(CV,".local","state"),t),temp:Yd.default.join(K8r,e,t)}},"Fe");a(PGc,"Mz");YBh=PGc("claude-cli");a(DGc,"Ze");a(NGc,"wE");MGc=100,LBr=[];a(OGc,"Le");BGc=[],O$i=null,KBh=uy(()=>process.argv.includes("--hard-fail"));a($Zi,"oW");kEe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,VZi=new Set,YLr=typeof process=="object"&&process?process:{},WZi=a((t,e,r,n)=>{typeof YLr.emitWarning=="function"?YLr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),PTt=globalThis.AbortController,B$i=globalThis.AbortSignal;if(typeof PTt>"u"){B$i=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},PTt=class{static{a(this,"tW")}constructor(){e()}signal=new B$i;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=YLr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,WZi("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")}LGc=a(t=>!VZi.has(t),"Ae"),AV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),zZi=a(t=>AV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?QEe:null:null,"ME"),QEe=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},KLr=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=zZi(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]}},JLr=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;#C;#m;#b;#T;#E;#v;#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.#C,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&&!AV(r))throw TypeError("max option must be a nonnegative integer");let x=r?zZi(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.#C=KLr.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.#v=!!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&&!AV(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!AV(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=AV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!AV(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&&LGc("LRU_CACHE_UNBOUNDED")&&(VZi.add("LRU_CACHE_UNBOUNDED"),WZi("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 QEe(this.#e),r=new QEe(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=kEe.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?kEe.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=kEe.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");#B=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new QEe(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!AV(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!AV(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");#L=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-(kEe.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=kEe.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=kEe.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.#L(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.#C.length!==0?this.#C.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.#v&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#v&&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.#B(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.#v||this.#y)&&(this.#v&&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.#C.push(r)),this.#s===1?(this.#A=this.#h=0,this.#C.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 PTt,{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 PTt}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),k=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",k&&R&&(_.returnedStale=!0)),k?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.#v||this.#y)&&(this.#v&&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.#C.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.#v&&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.#C.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(FGc,"LE");UGc=8192;a(YZi,"AE");L$i=FGc(YZi,t=>t,50),IIt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>UGc?YZi(t,e):L$i(t,e);return r.ok?r.value:null},{cache:L$i.cache}),xIt=uy(()=>{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=hI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){Kl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return $Zi(t),"unknown"}}),ZBh=uy(()=>{if(process.platform==="linux")try{let t=hI().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){Kl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),XBh=uy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,J8r.release)()};try{let e=await(0,JZi.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}),eLh=uy(()=>{if(process.platform!=="darwin")return;let t=(0,J8r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),eFe=uy(function(){switch(xIt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),tLh=uy(function(){return(0,KZi.join)(eFe(),"managed-settings.d")}),QGc=xr(()=>H.object({allowedDomains:H.array(H.string()).optional(),deniedDomains:H.array(H.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:H.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:H.array(H.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:H.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:H.boolean().optional(),allowMachLookup:H.array(H.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:H.number().optional(),socksProxyPort:H.number().optional(),tlsTerminate:H.object({caCertPath:H.string().min(1).optional(),caKeyPath:H.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()),qGc=xr(()=>H.object({allowWrite:H.array(H.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:H.array(H.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:H.array(H.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:H.array(H.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:H.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),jGc=xr(()=>H.object({enabled:H.boolean().optional(),failIfUnavailable:H.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:H.boolean().optional(),allowUnsandboxedCommands:H.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:QGc(),filesystem:qGc(),ignoreViolations:H.record(H.string(),H.array(H.string())).optional(),enableWeakerNestedSandbox:H.boolean().optional(),enableWeakerNetworkIsolation:H.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:H.array(H.string()).optional(),ripgrep:H.object({command:H.string(),args:H.array(H.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:H.preprocess(t=>typeof t=="string"&&(0,ZLr.isAbsolute)(t)?t:void 0,H.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:H.preprocess(t=>typeof t=="string"&&(0,ZLr.isAbsolute)(t)?t:void 0,H.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()),HGc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],GGc=["normal","vim"],$Gc=["auto","tmux","in-process"],VGc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],WGc=["auto",...VGc],rLh=xIt()==="macos"?"\u23FA":"\u25CF",Z8r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],zGc=[...Z8r,"bubble"],YGc=zGc,nLh=xr(()=>gZi.enum(YGc)),iLh=xr(()=>gZi.enum(Z8r)),KGc=["bash","powershell"],d3e=xr(()=>H.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(JGc,"Se");ZGc=xr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=JGc();return H.discriminatedUnion("type",[t,e,r,n,o])}),XGc=xr(()=>H.object({matcher:H.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:H.array(ZGc()).describe("List of hooks to execute when the matcher matches")})),DTt=xr(()=>H.partialRecord(H.enum(zTt),H.array(XGc()))),oLh=xr(()=>H.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),sLh=xr(()=>H.enum(["stdio","sse","sse-ide","http","ws","sdk"])),b_e=xr(()=>H.literal("comms").optional().catch(void 0)),DV=xr(()=>H.number().int().positive()),e$c=xr(()=>H.object({type:H.literal("stdio").optional(),command:H.string().min(1,"Command cannot be empty"),args:H.array(H.string()).default([]),env:H.record(H.string(),H.string()).optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),t$c=xr(()=>H.boolean()),ZZi=xr(()=>H.object({clientId:H.string().optional(),callbackPort:H.number().int().positive().optional(),authServerMetadataUrl:H.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:H.string().min(1).optional(),xaa:t$c().optional()})),r$c=xr(()=>H.object({type:H.literal("sse"),url:H.string(),headers:H.record(H.string(),H.string()).optional(),headersHelper:H.string().optional(),oauth:ZZi().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),n$c=xr(()=>H.object({type:H.literal("sse-ide"),url:H.string(),ideName:H.string(),ideRunningInWindows:H.boolean().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),i$c=xr(()=>H.object({type:H.literal("ws-ide"),url:H.string(),ideName:H.string(),authToken:H.string().optional(),ideRunningInWindows:H.boolean().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),o$c=xr(()=>H.object({type:H.enum(["http","streamable-http"]).transform(()=>"http"),url:H.string(),headers:H.record(H.string(),H.string()).optional(),headersHelper:H.string().optional(),oauth:ZZi().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),s$c=xr(()=>H.object({type:H.literal("ws"),url:H.string(),headers:H.record(H.string(),H.string()).optional(),headersHelper:H.string().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),a$c=xr(()=>H.object({type:H.literal("sdk"),name:H.string(),timeout:DV().optional(),alwaysLoad:H.boolean().optional()})),c$c=xr(()=>H.enum(["allow","ask","blocked"])),l$c=xr(()=>H.object({type:H.literal("claudeai-proxy"),url:H.string(),id:H.string(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),toolPermissions:H.record(H.string(),c$c()).optional()})),XLr=xr(()=>H.union([e$c(),r$c(),n$c(),i$c(),o$c(),s$c(),a$c(),l$c()])),aLh=xr(()=>H.object({mcpServers:H.record(H.string(),XLr())})),XZi=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"]),u$c=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,d$c=/[^\u0020-\u007E]/;a(f$c,"pe");fN=xr(()=>H.string().startsWith("./")),Xne=xr(()=>fN().endsWith(".json")),F$i=xr(()=>H.union([fN().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"),H.string().url().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),e3r=xr(()=>fN().endsWith(".md")),t3r=xr(()=>H.union([e3r(),fN()])),eXi=xr(()=>H.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=>!f$c(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/'})),X8r=xr(()=>H.object({name:H.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:H.string().optional().describe("Contact email for support or feedback"),url:H.string().optional().describe("Website, GitHub profile, or organization URL")})),p$c=xr(()=>H.object({$schema:H.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:H.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:H.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:H.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:H.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:X8r().optional().describe("Information about the plugin creator or maintainer"),homepage:H.string().url().optional().describe("Plugin homepage or documentation URL"),repository:H.string().optional().describe("Source code repository URL"),license:H.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:H.array(H.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:H.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:H.array(L$c()).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.`)})),cLh=xr(()=>H.object({description:H.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:H.lazy(()=>DTt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),h$c=xr(()=>H.object({hooks:H.union([Xne().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),H.lazy(()=>DTt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),H.array(H.union([Xne().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),H.lazy(()=>DTt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),m$c=xr(()=>H.object({source:t3r().optional().describe("Path to command markdown file, relative to plugin root"),content:H.string().optional().describe("Inline markdown content for the command"),description:H.string().optional().describe("Command description override"),argumentHint:H.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:H.string().optional().describe("Default model for this command"),allowedTools:H.array(H.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'})),g$c=xr(()=>H.object({commands:H.union([t3r().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."),H.array(t3r().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."),H.record(H.string(),m$c()).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")')])})),A$c=xr(()=>H.object({agents:H.union([e3r().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."),H.array(e3r().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.")])})),y$c=xr(()=>H.object({skills:H.union([fN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),H.array(fN().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.")])})),tXi=xr(()=>H.object({outputStyles:H.union([fN().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."),H.array(fN().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.")])})),rXi=xr(()=>H.object({themes:H.union([fN().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."),H.array(fN().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.")])})),E$c=xr(()=>H.object({})),U$i=xr(()=>H.string().min(1)),_$c=xr(()=>H.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),C$c=xr(()=>H.object({mcpServers:H.union([Xne().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),F$i().describe("Path or URL to MCPB file containing MCP server configuration"),H.record(H.string(),XLr()).describe("MCP server configurations keyed by server name"),H.array(H.union([Xne().describe("Path to MCP servers configuration file"),F$i().describe("Path or URL to MCPB file"),H.record(H.string(),XLr()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),nXi=xr(()=>H.object({type:H.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:H.string().describe("Human-readable label shown in the config dialog"),description:H.string().describe("Help text shown beneath the field in the config dialog"),required:H.boolean().optional().describe("If true, validation fails when this field is empty"),default:H.union([H.string(),H.number(),H.boolean(),H.array(H.string())]).optional().describe("Default value used when the user provides nothing"),multiple:H.boolean().optional().describe("For string type: allow an array of strings"),sensitive:H.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:H.number().optional().describe("Minimum value (number type only)"),max:H.number().optional().describe("Maximum value (number type only)")}).strict()),v$c=xr(()=>H.object({userConfig:H.record(H.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"),nXi()).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.")})),b$c=xr(()=>H.object({channels:H.array(H.object({server:H.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:H.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:H.record(H.string(),nXi()).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.")})),Q$i=xr(()=>H.strictObject({command:H.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:H.array(U$i()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:H.record(_$c(),U$i()).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:H.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:H.record(H.string(),H.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:H.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:H.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:H.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:H.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:H.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:H.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:H.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),S$c=xr(()=>H.strictObject({name:H.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:H.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:H.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:H.union([H.literal("always"),H.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).')})),T$c=xr(()=>H.array(S$c()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),iXi=xr(()=>H.object({monitors:H.union([Xne().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),T$c()]).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.")})),I$c=xr(()=>H.object({lspServers:H.union([Xne().describe("Path to .lsp.json configuration file relative to plugin root"),H.record(H.string(),Q$i()).describe("LSP server configurations keyed by server name"),H.array(H.union([Xne().describe("Path to LSP configuration file"),H.record(H.string(),Q$i()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),oXi=xr(()=>H.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")),x$c=xr(()=>H.object({settings:H.record(H.string(),H.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),w$c=xr(()=>H.object({experimental:H.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,H.object({...rXi().partial().shape,...iXi().partial().shape,...tXi().partial().shape,evals:H.union([H.string(),H.array(H.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."))})),R$c=xr(()=>H.object({...p$c().shape,...h$c().partial().shape,...g$c().partial().shape,...A$c().partial().shape,...y$c().partial().shape,...tXi().partial().shape,...rXi().partial().shape,...E$c().shape,...b$c().partial().shape,...C$c().partial().shape,...I$c().partial().shape,...iXi().partial().shape,...x$c().partial().shape,...v$c().partial().shape,...w$c().partial().shape})),NTt=xr(()=>H.discriminatedUnion("source",[H.object({source:H.literal("url"),url:H.string().url().describe("Direct URL to marketplace.json file"),headers:H.record(H.string(),H.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),H.object({source:H.literal("github"),repo:H.string().describe("GitHub repository in owner/repo format"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:H.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:H.array(H.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:H.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.")}),H.object({source:H.literal("git"),url:H.string().describe("Full git repository URL"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:H.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:H.array(H.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:H.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.")}),H.object({source:H.literal("npm"),package:oXi().describe("NPM package containing marketplace.json")}),H.object({source:H.literal("file"),path:H.string().describe("Local file path to marketplace.json")}),H.object({source:H.literal("directory"),path:H.string().describe("Local directory containing .claude-plugin/marketplace.json")}),H.object({source:H.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."),H.object({source:H.literal("hostPattern"),hostPattern:H.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$").')}),H.object({source:H.literal("pathPattern"),pathPattern:H.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.')}),H.object({source:H.literal("settings"),name:eXi().refine(t=>!XZi.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:H.array(k$c()).describe("Plugin entries declared inline in settings.json"),owner:X8r().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).")])),FBr=xr(()=>H.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),sXi=xr(()=>H.union([fN().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),H.object({source:H.literal("npm"),package:oXi().or(H.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:H.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:H.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),H.object({source:H.literal("url"),url:H.string().describe("Full git repository URL (https:// or git@)"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:FBr().optional().describe("Specific commit SHA to use")}),H.object({source:H.literal("github"),repo:H.string().describe("GitHub repository in owner/repo format"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:FBr().optional().describe("Specific commit SHA to use")}),H.object({source:H.literal("git-subdir"),url:H.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:H.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:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:FBr().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."),H.object({source:H.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.')])),k$c=xr(()=>H.object({name:H.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:sXi().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:H.string().optional(),version:H.string().optional(),strict:H.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)."})),P$c=xr(()=>H.object({cli:H.array(H.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:H.array(H.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:H.array(H.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:H.array(H.object({file:H.string().max(256),pattern:H.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:H.array(H.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.`)})),D$c=xr(()=>H.object({topic:H.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:P$c().optional().describe("Matchers that determine when the plugin is relevant.")})),N$c=xr(()=>R$c().partial().extend({name:H.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:sXi().describe("Where to fetch the plugin from"),category:H.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:H.array(H.string()).optional().describe("Tags for searchability and discovery"),strict:H.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:H.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,D$c().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.`)})),M$c=xr(()=>H.object({name:H.string().min(1).refine(t=>!t.includes(" "))}));a(O$c,"z$$");lLh=xr(()=>H.object({$schema:H.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:eXi(),version:H.string().optional().describe("Marketplace manifest version"),description:H.string().optional().describe("Human-readable description of this marketplace"),owner:X8r().describe("Marketplace maintainer or curator information"),plugins:H.array(H.unknown()).transform(O$c).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:H.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:H.object({pluginRoot:H.string().optional().describe("Base path for relative plugin sources"),version:H.string().optional().describe("Marketplace version"),description:H.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:H.array(H.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust.")})),aXi=xr(()=>H.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")),B$c=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,L$c=xr(()=>H.union([H.string().regex(B$c,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(t=>t.replace(/@\^[^@]*$/,"")),H.object({name:H.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:H.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(t=>t.marketplace?`${t.name}@${t.marketplace}`:t.name)])),F$c=xr(()=>H.object({version:H.string().describe("Currently installed version"),installedAt:H.string().describe("ISO 8601 timestamp of installation"),lastUpdated:H.string().optional().describe("ISO 8601 timestamp of last update"),installPath:H.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:H.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:H.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:H.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).")})),U$c=xr(()=>H.object({version:H.literal(1).describe("Schema version 1"),plugins:H.record(aXi(),F$c()).describe("Map of plugin IDs to their installation metadata")})),Q$c=xr(()=>H.enum(["managed","user","project","local"])),q$c=xr(()=>H.object({scope:Q$c().describe("Installation scope"),projectPath:H.string().optional().describe("Project path (required for project/local scopes)"),installPath:H.string().describe("Absolute path to the versioned plugin directory"),version:H.string().optional().describe("Currently installed version"),installedAt:H.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:H.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:H.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:H.string().optional().describe("Tag-derived semver this install resolved to"),auto:H.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),j$c=xr(()=>H.object({version:H.literal(2).describe("Schema version 2"),plugins:H.record(aXi(),H.array(q$c())).describe("Map of plugin IDs to arrays of installation entries")})),uLh=xr(()=>H.union([U$c(),j$c()])),H$c=xr(()=>H.object({source:NTt().describe("Where to fetch the marketplace from"),installLocation:H.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:H.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:H.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),dLh=xr(()=>H.record(H.string(),H$c())),G$c=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],$$c="https://json.schemastore.org/claude-code-settings.json",V$c=["autoMode","deepLink","voice","assistant","briefView"],mSt={},wIt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>mSt,"shape"),permissionsShape:a(()=>mSt,"permissionsShape"),permissionModes:a(()=>[],"permissionModes")},deepLink:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({disableDeepLinkRegistration:H.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")}),"shape")},voice:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>mSt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>mSt,"shape")},briefView:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({defaultView:H.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")}),"shape")}};a(cXi,"Ez");a(W$c,"tE");a(z$c,"aE");a(Y$c,"sE");a(K$c,"eE");q$i={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(PEe,"E9");lXi="workspace",fLh=`mcp__${lXi}__bash`,pLh=`mcp__${lXi}__web_fetch`;a(J$c,"A$$");a(Z$c,"Jb");a(X$c,"I$$");a(eVc,"R$$");MTt={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(tVc,"Xb");a(rVc,"Yb");a(nVc,"Wb");a(uXi,"Gb");a(UBr,"bz");a(iVc,"P$$");a(dXi,"_z");QBr=xr(()=>H.string().superRefine((t,e)=>{let r=dXi(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:H.ZodIssueCode.custom,message:n,params:{received:t}})}})),oVc=xr(()=>H.record(H.string(),H.coerce.string()));a(fXi,"Hb");hLh=xr(()=>fXi(cXi())),sVc=xr(()=>H.object({source:NTt().describe("Where to fetch the marketplace from"),installLocation:H.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:H.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),pXi=xr(()=>H.object({serverName:H.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:H.array(H.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:H.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(t=>pzi([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"'})),hXi=xr(()=>H.object({serverName:H.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:H.array(H.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:H.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(t=>pzi([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"'})),aVc=xr(()=>H.object({path:H.string().describe("Absolute path to the helper executable"),timeoutMs:H.number().int().min(1e3).optional(),refreshIntervalMs:H.union([H.literal(0),H.number().int().min(6e4)]).optional()})),j$i=["skills","agents","hooks","mcp"];a(cVc,"Kb");S_e=xr(()=>cVc(cXi())),c9="https://code.claude.com/docs/en",lVc=[{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:`${c9}/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:`${c9}/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:`${c9}/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:`${c9}/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:`${c9}/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:`${c9}/iam#working-directories`}}],uVc={permissions:`${c9}/iam#configuring-permissions`,env:`${c9}/settings#environment-variables`,hooks:`${c9}/hooks`};a(dVc,"qb");mLh=xr(()=>S_e().strict());a(H$i,"Vb");a(G$i,"Bb");a(fVc,"v$$");a($$i,"zb");a(qEe,"b9");a(V$i,"Nb");a(EFe,"d0");a(pVc,"C$$");hVc=new Set(zTt);a(mVc,"x$$");gVc=[{key:"allowedMcpServers",schema:pXi},{key:"deniedMcpServers",schema:hXi}];a(AVc,"f$$");a(T_e,"i1");W$i="com.anthropic.claudecode",r3r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",n3r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",LEe="Settings",yVc="/usr/bin/plutil",EVc=["-convert","json","-o","-","--"],_Vc=5e3,z$i="/mnt/c/Windows/System32/reg.exe",OTt="/mnt/c/Program Files/ClaudeCode";a(gXi,"XG");a(CVc,"Zb");vVc=null;a(f3e,"$5");a(bVc,"Mb");a(SVc,"Lb");EV=Object.freeze({settings:{},errors:[]}),EXi=null,_Xi=null,CXi=!1,BTt=null;a(TVc,"l$$");a(IVc,"bb");a(xVc,"_b");a(wVc,"kb");a(RVc,"Sb");a(qBr,"Cz");a(Y$i,"jb");a(kVc,"c$$");a(PVc,"p$$");a(K$i,"Ab");a(DVc,"d$$");a(J$i,"Ib");a(NVc,"i$$");i3r=NVc;a(MVc,"n$$");OVc=MVc,BVc=OVc(),LVc=BVc;a(FVc,"o$$");UVc=FVc,QVc="[object Object]",qVc=Function.prototype,jVc=Object.prototype,vXi=qVc.toString,HVc=jVc.hasOwnProperty,GVc=vXi.call(Object);a($Vc,"Q6$");VVc=$Vc;a(WVc,"J6$");o3r=WVc;a(zVc,"X6$");YVc=zVc;a(KVc,"Y6$");JVc=KVc;a(bXi,"hb");ZVc=bXi;a(XVc,"W6$");eWc=XVc,Z$i=Math.max;a(tWc,"G6$");SXi=tWc;a(rWc,"U6$");nWc=rWc,iWc=eTt?function(t,e){return eTt(t,"toString",{configurable:!0,enumerable:!1,value:nWc(e),writable:!0})}:PWi,oWc=iWc,sWc=800,aWc=16,cWc=Date.now;a(lWc,"B6$");uWc=lWc,dWc=uWc(oWc),TXi=dWc;a(fWc,"N6$");pWc=fWc;a(hWc,"w6$");mWc=hWc;a(gWc,"O6$");AWc=gWc,yWc=AWc(function(t,e,r,n){ZVc(t,e,r,n)}),vV=yWc;a(EWc,"F6$");_Wc=EWc;a(CWc,"Z6$");vWc=CWc;a(bWc,"M6$");SWc=bWc,X$i=TV?TV.isConcatSpreadable:void 0;a(TWc,"L6$");IWc=TWc;a(IXi,"$_");xWc=IXi;a(wWc,"j6$");RWc=wWc;a(kWc,"A6$");PWc=kWc,DWc=PWc(function(t,e){return t==null?{}:SWc(t,e)}),jBr=DWc,NWc="remote-settings.json",HBr=null;a(OWc,"b6$");a(BWc,"_6$");a(LWc,"W_");a(e6r,"fz");a(FWc,"S6$");a(wXi,"U_");a(GBr,"xz");a(UWc,"v6$");a(LTt,"HG");a(RXi,"H_");a(kXi,"K_");a(PXi,"q_");a(DXi,"V_");a(QWc,"C6$");a(eVi,"G_");a(qWc,"T6$");a(FTt,"Y5");a(jWc,"x6$");a(NXi,"B_");a(HWc,"y6$");a(GWc,"f6$");a($Wc,"z_");a(VWc,"g6$");a(MXi,"N_");a(WWc,"h6$");a(zWc,"u6$");a(bV,"o1");$Br=!1;a(YWc,"m6$");a(KWc,"l6$");a(JWc,"c6$");a(ZWc,"w_");a(XWc,"O_");ezc={user:"userSettings",project:"projectSettings",local:"localSettings"},tVi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},tzc=["user","project","local"],rzc=new Set(["bypassPermissions","auto","acceptEdits"]),nzc=new Set(["project"]);a(izc,"o6$");a(ozc,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(szc,"LA$");a(azc,"G4$");a(czc,"U4$");a(lzc,"H4$");a(OXi,"b_");a(s3r,"uz");a(a3r,"mz");uzc=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(UTt,"KG");a(dzc,"q4$");a(fzc,"jA$");a(pzc,"AA$");a(hzc,"IA$");a(mzc,"RA$");a(gzc,"PA$");a(Azc,"EA$");a(yzc,"bA$");a(Ezc,"_A$");a(_zc,"kA$");a(Czc,"SA$");a(rVi,"M_");a(vzc,"V4$");a(bzc,"vA$");a(Szc,"CA$");a(BXi,"__");a(ZR,"J4");a(LXi,"k_");a(nVi,"L_");a(c3r,"lz");a(Tzc,"B4$");a(iVi,"j_");a(FXi,"S_");a(Izc,"z4$");a(UXi,"v_");a(xzc,"N4$");a(wzc,"w4$");a(Rzc,"O4$");a(kzc,"D4$");a(Pzc,"F4$");a(Dzc,"Z4$");a(Nzc,"M4$");a(oVi,"A_")});var rto=I((x6r,tto)=>{p();x6r.createWatcher=g8e()("vscode-policy-watcher");if(require.main===tto){let t=process.platform;x6r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var Fto=I(O6r=>{p();var Lto="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");O6r.encode=function(t){if(0<=t&&t{p();var Uto=Fto(),B6r=5,Qto=1<>1;return e?-r:r}a(SKc,"fromVLQSigned");L6r.encode=a(function(e){var r="",n,o=bKc(e);do n=o&qto,o>>>=B6r,o>0&&(n|=jto),r+=Uto.encode(n);while(o>0);return r},"base64VLQ_encode");L6r.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=Uto.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&jto),u&=qto,s=s+(u<{p();function TKc(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(TKc,"getArg");KE.getArg=TKc;var Hto=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,IKc=/^data:.+\,.+$/;function KFe(t){var e=t.match(Hto);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(KFe,"urlParse");KE.urlParse=KFe;function j_e(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(j_e,"urlGenerate");KE.urlGenerate=j_e;function U6r(t){var e=t,r=KFe(t);if(r){if(!r.path)return t;e=r.path}for(var n=KE.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,j_e(r)):e}a(U6r,"normalize");KE.normalize=U6r;function Gto(t,e){t===""&&(t="."),e===""&&(e=".");var r=KFe(e),n=KFe(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),j_e(r);if(r||e.match(IKc))return e;if(n&&!n.host&&!n.path)return n.host=e,j_e(n);var o=e.charAt(0)==="/"?e:U6r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,j_e(n)):o}a(Gto,"join");KE.join=Gto;KE.isAbsolute=function(t){return t.charAt(0)==="/"||Hto.test(t)};function xKc(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(xKc,"relative");KE.relative=xKc;var $to=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Vto(t){return t}a(Vto,"identity");function wKc(t){return Wto(t)?"$"+t:t}a(wKc,"toSetString");KE.toSetString=$to?Vto:wKc;function RKc(t){return Wto(t)?t.slice(1):t}a(RKc,"fromSetString");KE.fromSetString=$to?Vto:RKc;function Wto(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(Wto,"isProtoString");function kKc(t,e,r){var n=H_e(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:H_e(t.name,e.name)}a(kKc,"compareByOriginalPositions");KE.compareByOriginalPositions=kKc;function PKc(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=H_e(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:H_e(t.name,e.name)}a(PKc,"compareByGeneratedPositionsDeflated");KE.compareByGeneratedPositionsDeflated=PKc;function H_e(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(H_e,"strcmp");function DKc(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=H_e(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:H_e(t.name,e.name)}a(DKc,"compareByGeneratedPositionsInflated");KE.compareByGeneratedPositionsInflated=DKc;function NKc(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(NKc,"parseSourceMapInput");KE.parseSourceMapInput=NKc;function MKc(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=KFe(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=Gto(j_e(n),e)}return U6r(e)}a(MKc,"computeSourceURL");KE.computeSourceURL=MKc});var j6r=I(zto=>{p();var Q6r=G_e(),q6r=Object.prototype.hasOwnProperty,cie=typeof Map<"u";function E9(){this._array=[],this._set=cie?new Map:Object.create(null)}a(E9,"ArraySet");E9.fromArray=a(function(e,r){for(var n=new E9,o=0,s=e.length;o=0)return r}else{var n=Q6r.toSetString(e);if(q6r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");E9.prototype.at=a(function(e){if(e>=0&&e{p();var Yto=G_e();function OKc(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Yto.compareByGeneratedPositionsInflated(t,e)<=0}a(OKc,"generatedPositionAfter");function ewt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(ewt,"MappingList");ewt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");ewt.prototype.add=a(function(e){OKc(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");ewt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Yto.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Kto.MappingList=ewt});var H6r=I(Zto=>{p();var JFe=F6r(),x0=G_e(),twt=j6r().ArraySet,BKc=Jto().MappingList;function rk(t){t||(t={}),this._file=x0.getArg(t,"file",null),this._sourceRoot=x0.getArg(t,"sourceRoot",null),this._skipValidation=x0.getArg(t,"skipValidation",!1),this._sources=new twt,this._names=new twt,this._mappings=new BKc,this._sourcesContents=null}a(rk,"SourceMapGenerator");rk.prototype._version=3;rk.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new rk({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=x0.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=x0.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");rk.prototype.addMapping=a(function(e){var r=x0.getArg(e,"generated"),n=x0.getArg(e,"original",null),o=x0.getArg(e,"source",null),s=x0.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");rk.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=x0.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[x0.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[x0.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");rk.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=x0.relative(s,o));var c=new twt,l=new twt;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=x0.join(n,u.source)),s!=null&&(u.source=x0.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=x0.join(n,u)),s!=null&&(u=x0.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");rk.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");rk.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(!x0.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=JFe.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=JFe.encode(h-c),c=h,u+=JFe.encode(d.originalLine-1-o),o=d.originalLine-1,u+=JFe.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=JFe.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");rk.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=x0.relative(r,n));var o=x0.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");rk.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");rk.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Zto.SourceMapGenerator=rk});var Xto=I(lie=>{p();lie.GREATEST_LOWER_BOUND=1;lie.LEAST_UPPER_BOUND=2;function G6r(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?G6r(c,e,r,n,o,s):s==lie.LEAST_UPPER_BOUND?e1?G6r(t,c,r,n,o,s):s==lie.LEAST_UPPER_BOUND?c:t<0?-1:t}a(G6r,"recursiveSearch");lie.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=G6r(-1,r.length,e,r,n,o||lie.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 tro=I(ero=>{p();function $6r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a($6r,"swap");function LKc(t,e){return Math.round(t+Math.random()*(e-t))}a(LKc,"randomIntInRange");function V6r(t,e,r,n){if(r{p();var Qn=G_e(),W6r=Xto(),$_e=j6r().ArraySet,FKc=F6r(),ZFe=tro().quickSort;function Ed(t,e){var r=t;return typeof t=="string"&&(r=Qn.parseSourceMapInput(t)),r.sections!=null?new CN(r,e):new py(r,e)}a(Ed,"SourceMapConsumer");Ed.fromSourceMap=function(t,e){return py.fromSourceMap(t,e)};Ed.prototype._version=3;Ed.prototype.__generatedMappings=null;Object.defineProperty(Ed.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Ed.prototype.__originalMappings=null;Object.defineProperty(Ed.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Ed.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Ed.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Ed.GENERATED_ORDER=1;Ed.ORIGINAL_ORDER=2;Ed.GREATEST_LOWER_BOUND=1;Ed.LEAST_UPPER_BOUND=2;Ed.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Ed.GENERATED_ORDER,c;switch(s){case Ed.GENERATED_ORDER:c=this._generatedMappings;break;case Ed.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=Qn.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");Ed.prototype.allGeneratedPositionsFor=a(function(e){var r=Qn.getArg(e,"line"),n={source:Qn.getArg(e,"source"),originalLine:r,originalColumn:Qn.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",Qn.compareByOriginalPositions,W6r.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:Qn.getArg(c,"generatedLine",null),column:Qn.getArg(c,"generatedColumn",null),lastColumn:Qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:Qn.getArg(c,"generatedLine",null),column:Qn.getArg(c,"generatedColumn",null),lastColumn:Qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");rwt.SourceMapConsumer=Ed;function py(t,e){var r=t;typeof t=="string"&&(r=Qn.parseSourceMapInput(t));var n=Qn.getArg(r,"version"),o=Qn.getArg(r,"sources"),s=Qn.getArg(r,"names",[]),c=Qn.getArg(r,"sourceRoot",null),l=Qn.getArg(r,"sourcesContent",null),u=Qn.getArg(r,"mappings"),d=Qn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=Qn.normalize(c)),o=o.map(String).map(Qn.normalize).map(function(f){return c&&Qn.isAbsolute(c)&&Qn.isAbsolute(f)?Qn.relative(c,f):f}),this._names=$_e.fromArray(s.map(String),!0),this._sources=$_e.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return Qn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(py,"BasicSourceMapConsumer");py.prototype=Object.create(Ed.prototype);py.prototype.consumer=Ed;py.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Qn.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)}ZFe(A,Qn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,ZFe(g,Qn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");py.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 W6r.search(e,r,s,c)},"SourceMapConsumer_findMapping");py.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=Qn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=Qn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=Qn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:Qn.getArg(o,"originalLine",null),column:Qn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");py.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");py.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=Qn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=Qn.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");py.prototype.generatedPositionFor=a(function(e){var r=Qn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Qn.getArg(e,"line"),originalColumn:Qn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Qn.compareByOriginalPositions,Qn.getArg(e,"bias",Ed.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:Qn.getArg(s,"generatedLine",null),column:Qn.getArg(s,"generatedColumn",null),lastColumn:Qn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");rwt.BasicSourceMapConsumer=py;function CN(t,e){var r=t;typeof t=="string"&&(r=Qn.parseSourceMapInput(t));var n=Qn.getArg(r,"version"),o=Qn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new $_e,this._names=new $_e;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=Qn.getArg(c,"offset"),u=Qn.getArg(l,"line"),d=Qn.getArg(l,"column");if(u{p();var UKc=H6r().SourceMapGenerator,nwt=G_e(),QKc=/(\r?\n)/,qKc=10,V_e="$$$isSourceNode$$$";function EI(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[V_e]=!0,n!=null&&this.add(n)}a(EI,"SourceNode");EI.fromStringWithSourceMap=a(function(e,r,n){var o=new EI,s=e.split(QKc),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[V_e]||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");EI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();iwt.SourceMapGenerator=H6r().SourceMapGenerator;iwt.SourceMapConsumer=nro().SourceMapConsumer;iwt.SourceNode=oro().SourceNode});var cro=I((BKh,aro)=>{p();var jKc=Object.prototype.toString,z6r=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function HKc(t){return jKc.call(t).slice(8,-1)==="ArrayBuffer"}a(HKc,"isArrayBuffer");function GKc(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 z6r?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(GKc,"fromArrayBuffer");function $Kc(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return z6r?Buffer.from(t,e):new Buffer(t,e)}a($Kc,"fromString");function VKc(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return HKc(t)?GKc(t,e,r):typeof t=="string"?$Kc(t,e):z6r?Buffer.from(t):new Buffer(t)}a(VKc,"bufferFrom");aro.exports=VKc});var gro=I((die,Z6r)=>{p();var WKc=sro().SourceMapConsumer,Y6r=require("path"),AB;try{AB=require("fs"),(!AB.existsSync||!AB.readFileSync)&&(AB=null)}catch{}var zKc=cro();function lro(t,e){return t.require(e)}a(lro,"dynamicRequire");var uro=!1,dro=!1,K6r=!1,XFe="auto",uie={},e8e={},YKc=/^data:application\/json[^,]+base64,/,UV=[],QV=[];function X6r(){return XFe==="browser"?!0:XFe==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(X6r,"isInBrowser");function KKc(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(KKc,"hasGlobalProcessEventEmitter");function JKc(){return typeof process=="object"&&process!==null?process.version:""}a(JKc,"globalProcessVersion");function ZKc(){if(typeof process=="object"&&process!==null)return process.stderr}a(ZKc,"globalProcessStderr");function XKc(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(XKc,"globalProcessExit");function owt(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(tJc,"CallSiteToString");function fro(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=tJc,e}a(fro,"cloneCallSite");function hro(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(JKc())?0:62;n===1&&o>c&&!X6r()&&!t.isEval()&&(o-=c);var l=r9r({source:r,line:n,column:o});e.curPosition=l,t=fro(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=pro(d),t=fro(t),t.getEvalOrigin=function(){return d}),t}a(hro,"wrapCallSite");function rJc(t,e){K6r&&(uie={},e8e={});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 `+hro(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(rJc,"prepareStackTrace");function mro(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=uie[r];if(!s&&AB&&AB.existsSync(r))try{s=AB.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}})(cGi||(cGi={}));(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"})(lGi||(lGi={}));(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"})(uGi||(uGi={}));(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"})(dGi||(dGi={}));a(vJi,"rW");nV=$Fr.default.homedir(),VFr=$Fr.default.tmpdir(),{env:pEe}=zSt.default,TQc=a(t=>{let e=Wd.default.join(nV,"Library");return{data:Wd.default.join(e,"Application Support",t),config:Wd.default.join(e,"Preferences",t),cache:Wd.default.join(e,"Caches",t),log:Wd.default.join(e,"Logs",t),temp:Wd.default.join(VFr,t)}},"Oe"),IQc=a(t=>{let e=pEe.APPDATA||Wd.default.join(nV,"AppData","Roaming"),r=pEe.LOCALAPPDATA||Wd.default.join(nV,"AppData","Local");return{data:Wd.default.join(r,t,"Data"),config:Wd.default.join(e,t,"Config"),cache:Wd.default.join(r,t,"Cache"),log:Wd.default.join(r,t,"Log"),temp:Wd.default.join(VFr,t)}},"De"),xQc=a(t=>{let e=Wd.default.basename(nV);return{data:Wd.default.join(pEe.XDG_DATA_HOME||Wd.default.join(nV,".local","share"),t),config:Wd.default.join(pEe.XDG_CONFIG_HOME||Wd.default.join(nV,".config"),t),cache:Wd.default.join(pEe.XDG_CACHE_HOME||Wd.default.join(nV,".cache"),t),log:Wd.default.join(pEe.XDG_STATE_HOME||Wd.default.join(nV,".local","state"),t),temp:Wd.default.join(VFr,e,t)}},"Fe");a(wQc,"Mz");dMh=wQc("claude-cli");a(RQc,"Ze");a(PQc,"wE");kQc=100,N4r=[];a(DQc,"Le");NQc=[],fGi=null,fMh=my(()=>process.argv.includes("--hard-fail"));a(CJi,"oW");aEe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,bJi=new Set,$Br=typeof process=="object"&&process?process:{},SJi=a((t,e,r,n)=>{typeof $Br.emitWarning=="function"?$Br.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),YSt=globalThis.AbortController,pGi=globalThis.AbortSignal;if(typeof YSt>"u"){pGi=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},YSt=class{static{a(this,"tW")}constructor(){e()}signal=new pGi;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=$Br.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,SJi("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")}MQc=a(t=>!bJi.has(t),"Ae"),X$=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),TJi=a(t=>X$(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?AEe:null:null,"ME"),AEe=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},VBr=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=TJi(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]}},WBr=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&&!X$(r))throw TypeError("max option must be a nonnegative integer");let x=r?TJi(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=VBr.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&&!X$(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!X$(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=X$(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!X$(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#P()}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&&MQc("LRU_CACHE_UNBOUNDED")&&(bJi.add("LRU_CACHE_UNBOUNDED"),SJi("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}#P(){let e=new AEe(this.#e),r=new AEe(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=aEe.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?aEe.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=aEe.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");#B=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new AEe(this.#e);this.#a=0,this.#b=e,this.#k=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!X$(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!X$(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)}}#k=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#L=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-(aEe.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=aEe.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=aEe.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.#L(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.#k(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.#P(),this.#E&&(d||this.#B(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.#k(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 YSt,{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 YSt}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.#k(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(OQc,"LE");BQc=8192;a(IJi,"AE");hGi=OQc(IJi,t=>t,50),GTt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>BQc?IJi(t,e):hGi(t,e);return r.ok?r.value:null},{cache:hGi.cache}),$Tt=my(()=>{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=cI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){Wl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return CJi(t),"unknown"}}),hMh=my(()=>{if(process.platform==="linux")try{let t=cI().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){Wl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),mMh=my(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,WFr.release)()};try{let e=await(0,wJi.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}),gMh=my(()=>{if(process.platform!=="darwin")return;let t=(0,WFr.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),x3e=my(function(){switch($Tt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),AMh=my(function(){return(0,xJi.join)(x3e(),"managed-settings.d")}),LQc=xr(()=>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()),FQc=xr(()=>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()),UQc=xr(()=>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:LQc(),filesystem:FQc(),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,zBr.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,zBr.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()),QQc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],qQc=["normal","vim"],jQc=["auto","tmux","in-process"],HQc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],GQc=["auto",...HQc],yMh=$Tt()==="macos"?"\u23FA":"\u25CF",zFr=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],$Qc=[...zFr,"bubble"],VQc=$Qc,EMh=xr(()=>WKi.enum(VQc)),_Mh=xr(()=>WKi.enum(zFr)),WQc=["bash","powershell"],FLe=xr(()=>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(zQc,"Se");YQc=xr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=zQc();return G.discriminatedUnion("type",[t,e,r,n,o])}),KQc=xr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(YQc()).describe("List of hooks to execute when the matcher matches")})),KSt=xr(()=>G.partialRecord(G.enum(fTt),G.array(KQc()))),vMh=xr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),CMh=xr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),e_e=xr(()=>G.literal("comms").optional().catch(void 0)),hV=xr(()=>G.number().int().positive()),JQc=xr(()=>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:hV().optional(),alwaysLoad:G.boolean().optional(),role:e_e()})),ZQc=xr(()=>G.boolean()),RJi=xr(()=>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:ZQc().optional()})),XQc=xr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:RJi().optional(),timeout:hV().optional(),alwaysLoad:G.boolean().optional(),role:e_e()})),eqc=xr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:hV().optional(),alwaysLoad:G.boolean().optional(),role:e_e()})),tqc=xr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:hV().optional(),alwaysLoad:G.boolean().optional(),role:e_e()})),rqc=xr(()=>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:RJi().optional(),timeout:hV().optional(),alwaysLoad:G.boolean().optional(),role:e_e()})),nqc=xr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:hV().optional(),alwaysLoad:G.boolean().optional(),role:e_e()})),iqc=xr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:hV().optional(),alwaysLoad:G.boolean().optional()})),oqc=xr(()=>G.enum(["allow","ask","blocked"])),sqc=xr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:hV().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),oqc()).optional()})),YBr=xr(()=>G.union([JQc(),XQc(),eqc(),tqc(),rqc(),nqc(),iqc(),sqc()])),bMh=xr(()=>G.object({mcpServers:G.record(G.string(),YBr())})),PJi=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"]),aqc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,cqc=/[^\u0020-\u007E]/;a(lqc,"pe");iN=xr(()=>G.string().startsWith("./")),Bne=xr(()=>iN().endsWith(".json")),mGi=xr(()=>G.union([iN().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")])),KBr=xr(()=>iN().endsWith(".md")),JBr=xr(()=>G.union([KBr(),iN()])),kJi=xr(()=>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=>!lqc(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/'})),YFr=xr(()=>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")})),uqc=xr(()=>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:YFr().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(Mqc()).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.`)})),SMh=xr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>KSt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),dqc=xr(()=>G.object({hooks:G.union([Bne().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(()=>KSt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([Bne().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(()=>KSt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),fqc=xr(()=>G.object({source:JBr().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'})),pqc=xr(()=>G.object({commands:G.union([JBr().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(JBr().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(),fqc()).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")')])})),hqc=xr(()=>G.object({agents:G.union([KBr().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(KBr().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.")])})),mqc=xr(()=>G.object({skills:G.union([iN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(iN().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.")])})),DJi=xr(()=>G.object({outputStyles:G.union([iN().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(iN().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.")])})),NJi=xr(()=>G.object({themes:G.union([iN().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(iN().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.")])})),gqc=xr(()=>G.object({})),gGi=xr(()=>G.string().min(1)),Aqc=xr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),yqc=xr(()=>G.object({mcpServers:G.union([Bne().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),mGi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),YBr()).describe("MCP server configurations keyed by server name"),G.array(G.union([Bne().describe("Path to MCP servers configuration file"),mGi().describe("Path or URL to MCPB file"),G.record(G.string(),YBr()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),MJi=xr(()=>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()),Eqc=xr(()=>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"),MJi()).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.")})),_qc=xr(()=>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(),MJi()).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.")})),AGi=xr(()=>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(gGi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(Aqc(),gGi()).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")})),vqc=xr(()=>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).')})),Cqc=xr(()=>G.array(vqc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),OJi=xr(()=>G.object({monitors:G.union([Bne().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),Cqc()]).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.")})),bqc=xr(()=>G.object({lspServers:G.union([Bne().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),AGi()).describe("LSP server configurations keyed by server name"),G.array(G.union([Bne().describe("Path to LSP configuration file"),G.record(G.string(),AGi()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),BJi=xr(()=>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")),Sqc=xr(()=>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.")})),Tqc=xr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...NJi().partial().shape,...OJi().partial().shape,...DJi().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."))})),Iqc=xr(()=>G.object({...uqc().shape,...dqc().partial().shape,...pqc().partial().shape,...hqc().partial().shape,...mqc().partial().shape,...DJi().partial().shape,...NJi().partial().shape,...gqc().shape,..._qc().partial().shape,...yqc().partial().shape,...bqc().partial().shape,...OJi().partial().shape,...Sqc().partial().shape,...Eqc().partial().shape,...Tqc().partial().shape})),JSt=xr(()=>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:BJi().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:kJi().refine(t=>!PJi.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(xqc()).describe("Plugin entries declared inline in settings.json"),owner:YFr().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).")])),M4r=xr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),LJi=xr(()=>G.union([iN().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:BJi().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:M4r().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:M4r().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:M4r().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.')])),xqc=xr(()=>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:LJi().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)."})),wqc=xr(()=>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.`)})),Rqc=xr(()=>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:wqc().optional().describe("Matchers that determine when the plugin is relevant.")})),Pqc=xr(()=>Iqc().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:LJi().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,Rqc().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.`)})),kqc=xr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(Dqc,"z$$");TMh=xr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:kJi(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:YFr().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(Dqc).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.")})),FJi=xr(()=>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")),Nqc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,Mqc=xr(()=>G.union([G.string().regex(Nqc,"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)])),Oqc=xr(()=>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).")})),Bqc=xr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(FJi(),Oqc()).describe("Map of plugin IDs to their installation metadata")})),Lqc=xr(()=>G.enum(["managed","user","project","local"])),Fqc=xr(()=>G.object({scope:Lqc().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.")})),Uqc=xr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(FJi(),G.array(Fqc())).describe("Map of plugin IDs to arrays of installation entries")})),IMh=xr(()=>G.union([Bqc(),Uqc()])),Qqc=xr(()=>G.object({source:JSt().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")})),xMh=xr(()=>G.record(G.string(),Qqc())),qqc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],jqc="https://json.schemastore.org/claude-code-settings.json",Hqc=["autoMode","deepLink","voice","assistant","briefView"],N1t={},VTt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>N1t,"shape"),permissionsShape:a(()=>N1t,"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(()=>N1t,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>N1t,"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(UJi,"Ez");a(Gqc,"tE");a($qc,"aE");a(Vqc,"sE");a(Wqc,"eE");yGi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(cEe,"E9");QJi="workspace",wMh=`mcp__${QJi}__bash`,RMh=`mcp__${QJi}__web_fetch`;a(zqc,"A$$");a(Yqc,"Jb");a(Kqc,"I$$");a(Jqc,"R$$");ZSt={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(Zqc,"Xb");a(Xqc,"Yb");a(ejc,"Wb");a(qJi,"Gb");a(O4r,"bz");a(tjc,"P$$");a(jJi,"_z");B4r=xr(()=>G.string().superRefine((t,e)=>{let r=jJi(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}})}})),rjc=xr(()=>G.record(G.string(),G.coerce.string()));a(HJi,"Hb");PMh=xr(()=>HJi(UJi())),njc=xr(()=>G.object({source:JSt().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")})),GJi=xr(()=>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=>GVi([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"'})),$Ji=xr(()=>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=>GVi([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"'})),ijc=xr(()=>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()})),EGi=["skills","agents","hooks","mcp"];a(ojc,"Kb");t_e=xr(()=>ojc(UJi())),W6="https://code.claude.com/docs/en",sjc=[{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:`${W6}/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:`${W6}/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:`${W6}/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:`${W6}/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:`${W6}/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:`${W6}/iam#working-directories`}}],ajc={permissions:`${W6}/iam#configuring-permissions`,env:`${W6}/settings#environment-variables`,hooks:`${W6}/hooks`};a(cjc,"qb");kMh=xr(()=>t_e().strict());a(_Gi,"Vb");a(vGi,"Bb");a(ljc,"v$$");a(CGi,"zb");a(yEe,"b9");a(bGi,"Nb");a(V3e,"d0");a(ujc,"C$$");djc=new Set(fTt);a(fjc,"x$$");pjc=[{key:"allowedMcpServers",schema:GJi},{key:"deniedMcpServers",schema:$Ji}];a(hjc,"f$$");a(r_e,"i1");SGi="com.anthropic.claudecode",ZBr="HKLM\\SOFTWARE\\Policies\\ClaudeCode",XBr="HKCU\\SOFTWARE\\Policies\\ClaudeCode",hEe="Settings",mjc="/usr/bin/plutil",gjc=["-convert","json","-o","-","--"],Ajc=5e3,TGi="/mnt/c/Windows/System32/reg.exe",XSt="/mnt/c/Program Files/ClaudeCode";a(WJi,"XG");a(yjc,"Zb");Ejc=null;a(ULe,"$5");a(_jc,"Mb");a(vjc,"Lb");tV=Object.freeze({settings:{},errors:[]}),KJi=null,JJi=null,ZJi=!1,eTt=null;a(Cjc,"l$$");a(bjc,"bb");a(Sjc,"_b");a(Tjc,"kb");a(Ijc,"Sb");a(L4r,"Cz");a(IGi,"jb");a(xjc,"c$$");a(wjc,"p$$");a(xGi,"Ab");a(Rjc,"d$$");a(wGi,"Ib");a(Pjc,"i$$");eLr=Pjc;a(kjc,"n$$");Djc=kjc,Njc=Djc(),Mjc=Njc;a(Ojc,"o$$");Bjc=Ojc,Ljc="[object Object]",Fjc=Function.prototype,Ujc=Object.prototype,XJi=Fjc.toString,Qjc=Ujc.hasOwnProperty,qjc=XJi.call(Object);a(jjc,"Q6$");Hjc=jjc;a(Gjc,"J6$");tLr=Gjc;a($jc,"X6$");Vjc=$jc;a(Wjc,"Y6$");zjc=Wjc;a(eZi,"hb");Yjc=eZi;a(Kjc,"W6$");Jjc=Kjc,RGi=Math.max;a(Zjc,"G6$");tZi=Zjc;a(Xjc,"U6$");eHc=Xjc,tHc=ySt?function(t,e){return ySt(t,"toString",{configurable:!0,enumerable:!1,value:eHc(e),writable:!0})}:cVi,rHc=tHc,nHc=800,iHc=16,oHc=Date.now;a(sHc,"B6$");aHc=sHc,cHc=aHc(rHc),rZi=cHc;a(lHc,"N6$");uHc=lHc;a(dHc,"w6$");fHc=dHc;a(pHc,"O6$");hHc=pHc,mHc=hHc(function(t,e,r,n){Yjc(t,e,r,n)}),iV=mHc;a(gHc,"F6$");AHc=gHc;a(yHc,"Z6$");EHc=yHc;a(_Hc,"M6$");vHc=_Hc,PGi=aV?aV.isConcatSpreadable:void 0;a(CHc,"L6$");bHc=CHc;a(nZi,"$_");SHc=nZi;a(THc,"j6$");IHc=THc;a(xHc,"A6$");wHc=xHc,RHc=wHc(function(t,e){return t==null?{}:vHc(t,e)}),F4r=RHc,PHc="remote-settings.json",U4r=null;a(DHc,"b6$");a(NHc,"_6$");a(MHc,"W_");a(KFr,"fz");a(OHc,"S6$");a(oZi,"U_");a(Q4r,"xz");a(BHc,"v6$");a(tTt,"HG");a(sZi,"H_");a(aZi,"K_");a(cZi,"q_");a(lZi,"V_");a(LHc,"C6$");a(kGi,"G_");a(FHc,"T6$");a(rTt,"Y5");a(UHc,"x6$");a(uZi,"B_");a(QHc,"y6$");a(qHc,"f6$");a(jHc,"z_");a(HHc,"g6$");a(dZi,"N_");a(GHc,"h6$");a($Hc,"u6$");a(oV,"o1");q4r=!1;a(VHc,"m6$");a(WHc,"l6$");a(zHc,"c6$");a(YHc,"w_");a(KHc,"O_");JHc={user:"userSettings",project:"projectSettings",local:"localSettings"},DGi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},ZHc=["user","project","local"],XHc=new Set(["bypassPermissions","auto","acceptEdits"]),eGc=new Set(["project"]);a(tGc,"o6$");a(rGc,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(nGc,"LA$");a(iGc,"G4$");a(oGc,"U4$");a(sGc,"H4$");a(fZi,"b_");a(rLr,"uz");a(nLr,"mz");aGc=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(nTt,"KG");a(cGc,"q4$");a(lGc,"jA$");a(uGc,"AA$");a(dGc,"IA$");a(fGc,"RA$");a(pGc,"PA$");a(hGc,"EA$");a(mGc,"bA$");a(gGc,"_A$");a(AGc,"kA$");a(yGc,"SA$");a(NGi,"M_");a(EGc,"V4$");a(_Gc,"vA$");a(vGc,"CA$");a(pZi,"__");a($R,"J4");a(hZi,"k_");a(MGi,"L_");a(iLr,"lz");a(CGc,"B4$");a(OGi,"j_");a(mZi,"S_");a(bGc,"z4$");a(gZi,"v_");a(SGc,"N4$");a(TGc,"w4$");a(IGc,"O4$");a(xGc,"D4$");a(wGc,"F4$");a(RGc,"Z4$");a(PGc,"M4$");a(BGi,"A_")});var NXi=I((b8r,DXi)=>{p();b8r.createWatcher=jFe()("vscode-policy-watcher");if(require.main===DXi){let t=process.platform;b8r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var meo=I(k8r=>{p();var heo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");k8r.encode=function(t){if(0<=t&&t{p();var geo=meo(),D8r=5,Aeo=1<>1;return e?-r:r}a(vVc,"fromVLQSigned");N8r.encode=a(function(e){var r="",n,o=_Vc(e);do n=o&yeo,o>>>=D8r,o>0&&(n|=Eeo),r+=geo.encode(n);while(o>0);return r},"base64VLQ_encode");N8r.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=geo.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Eeo),u&=yeo,s=s+(u<{p();function CVc(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(CVc,"getArg");WE.getArg=CVc;var _eo=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,bVc=/^data:.+\,.+$/;function CFe(t){var e=t.match(_eo);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(CFe,"urlParse");WE.urlParse=CFe;function E_e(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(E_e,"urlGenerate");WE.urlGenerate=E_e;function O8r(t){var e=t,r=CFe(t);if(r){if(!r.path)return t;e=r.path}for(var n=WE.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,E_e(r)):e}a(O8r,"normalize");WE.normalize=O8r;function veo(t,e){t===""&&(t="."),e===""&&(e=".");var r=CFe(e),n=CFe(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),E_e(r);if(r||e.match(bVc))return e;if(n&&!n.host&&!n.path)return n.host=e,E_e(n);var o=e.charAt(0)==="/"?e:O8r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,E_e(n)):o}a(veo,"join");WE.join=veo;WE.isAbsolute=function(t){return t.charAt(0)==="/"||_eo.test(t)};function SVc(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(SVc,"relative");WE.relative=SVc;var Ceo=(function(){var t=Object.create(null);return!("__proto__"in t)})();function beo(t){return t}a(beo,"identity");function TVc(t){return Seo(t)?"$"+t:t}a(TVc,"toSetString");WE.toSetString=Ceo?beo:TVc;function IVc(t){return Seo(t)?t.slice(1):t}a(IVc,"fromSetString");WE.fromSetString=Ceo?beo:IVc;function Seo(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(Seo,"isProtoString");function xVc(t,e,r){var n=__e(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:__e(t.name,e.name)}a(xVc,"compareByOriginalPositions");WE.compareByOriginalPositions=xVc;function wVc(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=__e(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:__e(t.name,e.name)}a(wVc,"compareByGeneratedPositionsDeflated");WE.compareByGeneratedPositionsDeflated=wVc;function __e(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(__e,"strcmp");function RVc(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=__e(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:__e(t.name,e.name)}a(RVc,"compareByGeneratedPositionsInflated");WE.compareByGeneratedPositionsInflated=RVc;function PVc(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(PVc,"parseSourceMapInput");WE.parseSourceMapInput=PVc;function kVc(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=CFe(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=veo(E_e(n),e)}return O8r(e)}a(kVc,"computeSourceURL");WE.computeSourceURL=kVc});var F8r=I(Teo=>{p();var B8r=v_e(),L8r=Object.prototype.hasOwnProperty,$ne=typeof Map<"u";function i9(){this._array=[],this._set=$ne?new Map:Object.create(null)}a(i9,"ArraySet");i9.fromArray=a(function(e,r){for(var n=new i9,o=0,s=e.length;o=0)return r}else{var n=B8r.toSetString(e);if(L8r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");i9.prototype.at=a(function(e){if(e>=0&&e{p();var Ieo=v_e();function DVc(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Ieo.compareByGeneratedPositionsInflated(t,e)<=0}a(DVc,"generatedPositionAfter");function yxt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(yxt,"MappingList");yxt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");yxt.prototype.add=a(function(e){DVc(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");yxt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Ieo.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");xeo.MappingList=yxt});var U8r=I(Reo=>{p();var bFe=M8r(),x0=v_e(),Ext=F8r().ArraySet,NVc=weo().MappingList;function YR(t){t||(t={}),this._file=x0.getArg(t,"file",null),this._sourceRoot=x0.getArg(t,"sourceRoot",null),this._skipValidation=x0.getArg(t,"skipValidation",!1),this._sources=new Ext,this._names=new Ext,this._mappings=new NVc,this._sourcesContents=null}a(YR,"SourceMapGenerator");YR.prototype._version=3;YR.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new YR({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=x0.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=x0.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");YR.prototype.addMapping=a(function(e){var r=x0.getArg(e,"generated"),n=x0.getArg(e,"original",null),o=x0.getArg(e,"source",null),s=x0.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");YR.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=x0.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[x0.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[x0.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");YR.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=x0.relative(s,o));var c=new Ext,l=new Ext;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=x0.join(n,u.source)),s!=null&&(u.source=x0.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=x0.join(n,u)),s!=null&&(u=x0.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");YR.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");YR.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(!x0.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=bFe.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=bFe.encode(h-c),c=h,u+=bFe.encode(d.originalLine-1-o),o=d.originalLine-1,u+=bFe.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=bFe.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");YR.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=x0.relative(r,n));var o=x0.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");YR.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");YR.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Reo.SourceMapGenerator=YR});var Peo=I(Vne=>{p();Vne.GREATEST_LOWER_BOUND=1;Vne.LEAST_UPPER_BOUND=2;function Q8r(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?Q8r(c,e,r,n,o,s):s==Vne.LEAST_UPPER_BOUND?e1?Q8r(t,c,r,n,o,s):s==Vne.LEAST_UPPER_BOUND?c:t<0?-1:t}a(Q8r,"recursiveSearch");Vne.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=Q8r(-1,r.length,e,r,n,o||Vne.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 Deo=I(keo=>{p();function q8r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(q8r,"swap");function MVc(t,e){return Math.round(t+Math.random()*(e-t))}a(MVc,"randomIntInRange");function j8r(t,e,r,n){if(r{p();var Qn=v_e(),H8r=Peo(),C_e=F8r().ArraySet,OVc=M8r(),SFe=Deo().quickSort;function Ed(t,e){var r=t;return typeof t=="string"&&(r=Qn.parseSourceMapInput(t)),r.sections!=null?new pN(r,e):new yy(r,e)}a(Ed,"SourceMapConsumer");Ed.fromSourceMap=function(t,e){return yy.fromSourceMap(t,e)};Ed.prototype._version=3;Ed.prototype.__generatedMappings=null;Object.defineProperty(Ed.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Ed.prototype.__originalMappings=null;Object.defineProperty(Ed.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Ed.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Ed.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Ed.GENERATED_ORDER=1;Ed.ORIGINAL_ORDER=2;Ed.GREATEST_LOWER_BOUND=1;Ed.LEAST_UPPER_BOUND=2;Ed.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Ed.GENERATED_ORDER,c;switch(s){case Ed.GENERATED_ORDER:c=this._generatedMappings;break;case Ed.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=Qn.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");Ed.prototype.allGeneratedPositionsFor=a(function(e){var r=Qn.getArg(e,"line"),n={source:Qn.getArg(e,"source"),originalLine:r,originalColumn:Qn.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",Qn.compareByOriginalPositions,H8r.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:Qn.getArg(c,"generatedLine",null),column:Qn.getArg(c,"generatedColumn",null),lastColumn:Qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:Qn.getArg(c,"generatedLine",null),column:Qn.getArg(c,"generatedColumn",null),lastColumn:Qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");_xt.SourceMapConsumer=Ed;function yy(t,e){var r=t;typeof t=="string"&&(r=Qn.parseSourceMapInput(t));var n=Qn.getArg(r,"version"),o=Qn.getArg(r,"sources"),s=Qn.getArg(r,"names",[]),c=Qn.getArg(r,"sourceRoot",null),l=Qn.getArg(r,"sourcesContent",null),u=Qn.getArg(r,"mappings"),d=Qn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=Qn.normalize(c)),o=o.map(String).map(Qn.normalize).map(function(f){return c&&Qn.isAbsolute(c)&&Qn.isAbsolute(f)?Qn.relative(c,f):f}),this._names=C_e.fromArray(s.map(String),!0),this._sources=C_e.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return Qn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(yy,"BasicSourceMapConsumer");yy.prototype=Object.create(Ed.prototype);yy.prototype.consumer=Ed;yy.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Qn.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)}SFe(A,Qn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,SFe(g,Qn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");yy.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 H8r.search(e,r,s,c)},"SourceMapConsumer_findMapping");yy.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=Qn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=Qn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=Qn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:Qn.getArg(o,"originalLine",null),column:Qn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");yy.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");yy.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=Qn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=Qn.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");yy.prototype.generatedPositionFor=a(function(e){var r=Qn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Qn.getArg(e,"line"),originalColumn:Qn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Qn.compareByOriginalPositions,Qn.getArg(e,"bias",Ed.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:Qn.getArg(s,"generatedLine",null),column:Qn.getArg(s,"generatedColumn",null),lastColumn:Qn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");_xt.BasicSourceMapConsumer=yy;function pN(t,e){var r=t;typeof t=="string"&&(r=Qn.parseSourceMapInput(t));var n=Qn.getArg(r,"version"),o=Qn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new C_e,this._names=new C_e;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=Qn.getArg(c,"offset"),u=Qn.getArg(l,"line"),d=Qn.getArg(l,"column");if(u{p();var BVc=U8r().SourceMapGenerator,vxt=v_e(),LVc=/(\r?\n)/,FVc=10,b_e="$$$isSourceNode$$$";function pI(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[b_e]=!0,n!=null&&this.add(n)}a(pI,"SourceNode");pI.fromStringWithSourceMap=a(function(e,r,n){var o=new pI,s=e.split(LVc),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[b_e]||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");pI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();Cxt.SourceMapGenerator=U8r().SourceMapGenerator;Cxt.SourceMapConsumer=Meo().SourceMapConsumer;Cxt.SourceNode=Beo().SourceNode});var Ueo=I((M$h,Feo)=>{p();var UVc=Object.prototype.toString,G8r=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function QVc(t){return UVc.call(t).slice(8,-1)==="ArrayBuffer"}a(QVc,"isArrayBuffer");function qVc(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 G8r?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(qVc,"fromArrayBuffer");function jVc(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return G8r?Buffer.from(t,e):new Buffer(t,e)}a(jVc,"fromString");function HVc(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return QVc(t)?qVc(t,e,r):typeof t=="string"?jVc(t,e):G8r?Buffer.from(t):new Buffer(t)}a(HVc,"bufferFrom");Feo.exports=HVc});var Weo=I((zne,z8r)=>{p();var GVc=Leo().SourceMapConsumer,$8r=require("path"),oB;try{oB=require("fs"),(!oB.existsSync||!oB.readFileSync)&&(oB=null)}catch{}var $Vc=Ueo();function Qeo(t,e){return t.require(e)}a(Qeo,"dynamicRequire");var qeo=!1,jeo=!1,V8r=!1,TFe="auto",Wne={},IFe={},VVc=/^data:application\/json[^,]+base64,/,vV=[],CV=[];function Y8r(){return TFe==="browser"?!0:TFe==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(Y8r,"isInBrowser");function WVc(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(WVc,"hasGlobalProcessEventEmitter");function zVc(){return typeof process=="object"&&process!==null?process.version:""}a(zVc,"globalProcessVersion");function YVc(){if(typeof process=="object"&&process!==null)return process.stderr}a(YVc,"globalProcessStderr");function KVc(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(KVc,"globalProcessExit");function bxt(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(ZVc,"CallSiteToString");function Heo(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=ZVc,e}a(Heo,"cloneCallSite");function $eo(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(zVc())?0:62;n===1&&o>c&&!Y8r()&&!t.isEval()&&(o-=c);var l=Z8r({source:r,line:n,column:o});e.curPosition=l,t=Heo(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=Geo(d),t=Heo(t),t.getEvalOrigin=function(){return d}),t}a($eo,"wrapCallSite");function XVc(t,e){V8r&&(Wne={},IFe={});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 `+$eo(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(XVc,"prepareStackTrace");function Veo(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=Wne[r];if(!s&&oB&&oB.existsSync(r))try{s=oB.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(mro,"getErrorSource");function nJc(t){var e=mro(t),r=ZKc();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),XKc(1)}a(nJc,"printErrorAndExit");function iJc(){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 nJc(arguments[1])}return t.apply(this,arguments)}}a(iJc,"shimEmitUncaughtException");var oJc=UV.slice(0),sJc=QV.slice(0);die.wrapCallSite=hro;die.getErrorSource=mro;die.mapSourcePosition=r9r;die.retrieveSourceMap=t9r;die.install=function(t){if(t=t||{},t.environment&&(XFe=t.environment,["node","browser","auto"].indexOf(XFe)===-1))throw new Error("environment "+XFe+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(UV.length=0),UV.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(QV.length=0),QV.unshift(t.retrieveSourceMap)),t.hookRequire&&!X6r()){var e=lro(Z6r,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return uie[c]=s,e8e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(K6r||(K6r="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),uro||(uro=!0,Error.prepareStackTrace=rJc),!dro){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=lro(Z6r,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&KKc()&&(dro=!0,iJc())}};die.resetRetrieveHandlers=function(){UV.length=0,QV.length=0,UV=oJc.slice(0),QV=sJc.slice(0),t9r=owt(QV),e9r=owt(UV)}});var Aro=I(()=>{p();gro().install()});var lJc={};wi(lJc,{getTokenizer:()=>Ss,getTokenizerAsync:()=>aGe,main:()=>Ero});module.exports=Ca(lJc);p();p();p();p();var Df=class{static{a(this,"LogTarget")}},yB=class{static{a(this,"TelemetryLogSender")}},ge=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Df).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(yB).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Dr=new ge("default");p();p();p();var cwt="github.copilot",a9r="github-enterprise";p();var Ds=a((t,e)=>({editorId:t,displayName:e}),"id"),Tro=Ds("unknown","Unknown"),c9r=Ds("eclipse","Eclipse"),l9r=Ds("xcode","Xcode"),_9=Ds("vim","Vim/Neovim"),u9r=Ds("helix","Helix"),Iro={"copilot-eclipse":c9r,Copilot4Eclipse:c9r,"copilot-xcode":l9r,"Copilot for Xcode":l9r,"copilot-vs":Ds("visual-studio","Visual Studio"),"copilot.vim":_9,"copilot.lua":_9,"Github Copilot LSP for Neovim":_9,"coc-github-copilot":_9,"nvim-lspconfig":_9,"copilot-lsp-client-neovim":_9,"neovim-copilot-lsp":_9,"sidekick.nvim":_9,"helix-copilot":u9r,"copilot-helix":u9r,"copilot-sublime":Ds("sublime-text","Sublime Text"),"zed-copilot":Ds("zed","Zed"),RStudio:Ds("rstudio","RStudio"),"obsidian-copilot":Ds("obsidian","Obsidian"),marimo:Ds("marimo","marimo"),"Qt Creator Copilot plugin":Ds("qt-creator","Qt Creator"),"godot-copilot":Ds("godot","Godot"),"kakoune-lsp":Ds("kakoune","Kakoune"),"typora-copilot":Ds("typora","Typora"),"Copilot for Nova":Ds("nova","Nova")},xro={IU:Ds("intellij","IntelliJ IDEA"),IC:Ds("intellij","IntelliJ IDEA"),IE:Ds("intellij","IntelliJ IDEA"),PY:Ds("pycharm","PyCharm"),PC:Ds("pycharm","PyCharm"),PE:Ds("pycharm","PyCharm"),WS:Ds("webstorm","WebStorm"),PS:Ds("phpstorm","PhpStorm"),RD:Ds("rider","Rider"),RM:Ds("rubymine","RubyMine"),CL:Ds("clion","CLion"),GO:Ds("goland","GoLand"),RR:Ds("rustrover","RustRover"),DB:Ds("datagrip","DataGrip"),DS:Ds("dataspell","DataSpell"),AI:Ds("android-studio","Android Studio"),QA:Ds("aqua","Aqua"),MPS:Ds("mps","MPS"),JBC:Ds("jetbrains-client","JetBrains Client"),GW:Ds("jetbrains-gateway","JetBrains Gateway")},d9r="JetBrains-",wro=Ds("jetbrains","JetBrains IDE");function f9r(t){let e=t.plugin.name?.trim();if(!e)return Tro;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(d9r)){let n=xro[r.slice(d9r.length)];if(n)return n}return wro}return Iro[e]??Ds(e,e)}a(f9r,"resolveEditorIdentity");p();p();p();p();p();p();var ik=class{static{a(this,"InlineCompletionsUnification")}},Rro={codeUnification:!1,modelUnification:!1,expAssignments:[]},fie=class extends ik{constructor(){super(...arguments);this.inlineCompletionsUnificationState=Rro;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};p();p();async function doo(){let{getDeviceId:t}=await Promise.resolve().then(()=>ce(G7r()));return t()}a(doo,"loadDeviceId");var CI=class{constructor(e=doo){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();var r_="X-Copilot-RelatedPluginVersion-",yie=(G=>(G.Market="X-MSEdge-Market",G.CorpNet="X-FD-Corpnet",G.Build="X-VSCode-Build",G.ApplicationVersion="X-VSCode-AppVersion",G.TargetPopulation="X-VSCode-TargetPopulation",G.ClientId="X-MSEdge-ClientId",G.DevDeviceId="X-VSCode-DevDeviceId",G.ExtensionName="X-VSCode-ExtensionName",G.ExtensionVersion="X-VSCode-ExtensionVersion",G.ExtensionRelease="X-VSCode-ExtensionRelease",G.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",G.Language="X-VSCode-Language",G.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",G.CopilotEngine="X-Copilot-Engine",G.CopilotOverrideEngine="X-Copilot-OverrideEngine",G.CopilotRepository="X-Copilot-Repository",G.CopilotFileType="X-Copilot-FileType",G.CopilotUserKind="X-Copilot-UserKind",G.CopilotDogfood="X-Copilot-Dogfood",G.CopilotCustomModel="X-Copilot-CustomModel",G.CopilotOrgs="X-Copilot-Orgs",G.CopilotTrackingId="X-Copilot-CopilotTrackingId",G.CopilotClientVersion="X-Copilot-ClientVersion",G.CopilotSku="X-GitHub-Copilot-SKU",G.CopilotRelatedPluginVersionCppTools=r_+"msvscodecpptools",G.CopilotRelatedPluginVersionCMakeTools=r_+"msvscodecmaketools",G.CopilotRelatedPluginVersionMakefileTools=r_+"msvscodemakefiletools",G.CopilotRelatedPluginVersionCSharpDevKit=r_+"msdotnettoolscsdevkit",G.CopilotRelatedPluginVersionPython=r_+"mspythonpython",G.CopilotRelatedPluginVersionPylance=r_+"mspythonvscodepylance",G.CopilotRelatedPluginVersionJavaPack=r_+"vscjavavscodejavapack",G.CopilotRelatedPluginVersionJavaManager=r_+"vscjavavscodejavadependency",G.CopilotRelatedPluginVersionTypescript=r_+"vscodetypescriptlanguagefeatures",G.CopilotRelatedPluginVersionTypescriptNext=r_+"msvscodevscodetypescriptnext",G.CopilotRelatedPluginVersionCSharp=r_+"msdotnettoolscsharp",G.CopilotRelatedPluginVersionGithubCopilotChat=r_+"githubcopilotchat",G.CopilotRelatedPluginVersionGithubCopilot=r_+"githubcopilot",G))(yie||{});var foo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},SB=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=foo[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 Es(t,e){let r=Pm(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(Es,"onCopilotToken");function Dwt(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(Dwt,"propertiesFromCopilotToken");var Nf=class{constructor(e){this.#e={};this.optedIn=!1;this.ftFlag="";Es(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=Dwt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};var n6e=ce(IB()),i6e=ce(require("os"));var poo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function hoo(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(poo),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(hoo,"buildExceptionDetail");function Owt(t,e){let r=t.get(Lr),n=r.getEditorInfo(),o=t.get(Nf),s={"#editor":n.devName??n.name,"#editor_version":C1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":C1(r.getEditorPluginInfo()),"#session_id":t.get(Fa).sessionId,"#machine_id":t.get(Fa).machineId,"#architecture":i6e.arch(),"#os_platform":i6e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(Owt,"buildContext");function ZQr(t,e,r){let n=t.get(ss),o=t.get(Lr).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:Owt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=hoo(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,n6e.SHA256)(n6e.enc.Utf16.parse(f.join(` -`))).toString()),c}a(ZQr,"buildPayload");p();var cCe=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 eqr=ce(IB());var nn=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)}},sk=class extends nn{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"}},o6e=class extends nn{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 tqr=7*86400*1e3,bN=class{constructor(e=5){this.perWeek=e;this.cache=new nn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-tqr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(rqr(t.replace(/\\/g,"/")),"gi"):new RegExp(rqr(t),"gi"));function goo(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(Aoo,"removePropertiesWithPossibleUserInfo");function yoo(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(yoo,"redactPaths");function iqr(t,e=moo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=Aoo(s);if(c!==s){r[n]=c;continue}s=goo(s,e);for(let l of e)s=s.replace(l,"");s=yoo(s),r[n]=s}return r}a(iqr,"sanitizeTelemetryProperties");function R9(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(R9,"filterTelemetryProperties");p();var vI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:sqr(r,n),verboseLogging:_oo(r,n),testMode:e,simulation:Eoo(n)})}};function v1(t){return t.get(vI).flags.testMode}a(v1,"isRunningInTest");function Eie(t){return v1(t)}a(Eie,"shouldFailForDebugPurposes");function lCe(t){return t.get(vI).flags.debug}a(lCe,"isDebugEnabled");function oqr(t){return t.get(vI).flags.verboseLogging}a(oqr,"isVerboseLoggingEnabled");function sqr(t,e){return t.includes("--debug")||Lwt(e,"DEBUG")}a(sqr,"determineDebugFlag");function Eoo(t){return Lwt(t,"SIMULATION")}a(Eoo,"determineSimulationFlag");function a6e(t){return t.get(vI).flags.simulation}a(a6e,"isRunningInSimulation");function _oo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||Lwt(e,"VERBOSE")||sqr(t,e)}a(_oo,"determineVerboseLoggingEnabled");function Lwt(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(Lwt,"determineEnvFlagEnabled");p();var _d=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 lqr=require("os"),uqr=ce(require("path"));function uCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(uCe,"redactPaths");var Coo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),voo=[/^[\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 Uwt(t){if(Coo.has(t))return t;for(let e of voo)if(e.test(t))return t;return uCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(Uwt,"redactMessage");function c6e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(c6e,"escapeForRegExp");var boo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+c6e((0,lqr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function Fwt(t){return t.replace(boo,"~")}a(Fwt,"redactHomeDir");var dqr="[\\\\/]?([^:)]*)(?=:\\d)",aqr=new RegExp(c6e(uqr.sep),"g"),cqr=new RegExp(c6e(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+dqr,"gi");function Qwt(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(cqr.test(l))o.stack+=` -${uCe(l.replace(cqr,(u,d)=>"./"+d.replace(aqr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` -${uCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(c6e(f.replace(/[\\/]$/,""))+dqr,"gi");if(h.test(l)){o.stack+=` -${uCe(l.replace(h,(m,g)=>d+g.replace(aqr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` -${Fwt(l)}`:o.stack+=` - at [redacted]:0:0`}}else r&&s&&(o.stack=Fwt(s));return t.cause instanceof Error&&(o.cause=Qwt(t.cause,e,r,n)),o}a(Qwt,"cloneError");function fqr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(fqr,"errorMessageWithoutPath");function pqr(t,e){return Qwt(t,a(function(n){return Fwt(fqr(n))},"prepareMessage"),!0,e)}a(pqr,"prepareErrorForRestrictedTelemetry");function hqr(t,e,r=!1){return Qwt(t,a(function(o){if(r)return Uwt(fqr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=uCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(hqr,"redactError");p();p();var my={};wi(my,{HasPropertyKey:()=>l6e,IsArray:()=>Sp,IsAsyncIterator:()=>qwt,IsBigInt:()=>dCe,IsBoolean:()=>xB,IsDate:()=>GV,IsFunction:()=>jwt,IsIterator:()=>Hwt,IsNull:()=>Gwt,IsNumber:()=>b1,IsObject:()=>Wc,IsRegExp:()=>fCe,IsString:()=>Ol,IsSymbol:()=>$wt,IsUint8Array:()=>wB,IsUndefined:()=>Tp});p();function l6e(t,e){return e in t}a(l6e,"HasPropertyKey");function qwt(t){return Wc(t)&&!Sp(t)&&!wB(t)&&Symbol.asyncIterator in t}a(qwt,"IsAsyncIterator");function Sp(t){return Array.isArray(t)}a(Sp,"IsArray");function dCe(t){return typeof t=="bigint"}a(dCe,"IsBigInt");function xB(t){return typeof t=="boolean"}a(xB,"IsBoolean");function GV(t){return t instanceof globalThis.Date}a(GV,"IsDate");function jwt(t){return typeof t=="function"}a(jwt,"IsFunction");function Hwt(t){return Wc(t)&&!Sp(t)&&!wB(t)&&Symbol.iterator in t}a(Hwt,"IsIterator");function Gwt(t){return t===null}a(Gwt,"IsNull");function b1(t){return typeof t=="number"}a(b1,"IsNumber");function Wc(t){return typeof t=="object"&&t!==null}a(Wc,"IsObject");function fCe(t){return t instanceof globalThis.RegExp}a(fCe,"IsRegExp");function Ol(t){return typeof t=="string"}a(Ol,"IsString");function $wt(t){return typeof t=="symbol"}a($wt,"IsSymbol");function wB(t){return t instanceof globalThis.Uint8Array}a(wB,"IsUint8Array");function Tp(t){return t===void 0}a(Tp,"IsUndefined");function Soo(t){return t.map(e=>u6e(e))}a(Soo,"ArrayType");function Too(t){return new Date(t.getTime())}a(Too,"DateType");function Ioo(t){return new Uint8Array(t)}a(Ioo,"Uint8ArrayType");function xoo(t){return new RegExp(t.source,t.flags)}a(xoo,"RegExpType");function woo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=u6e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=u6e(t[r]);return e}a(woo,"ObjectType");function u6e(t){return Sp(t)?Soo(t):GV(t)?Too(t):wB(t)?Ioo(t):fCe(t)?xoo(t):Wc(t)?woo(t):t}a(u6e,"Visit");function Pu(t){return u6e(t)}a(Pu,"Clone");function _ie(t,e){return e===void 0?Pu(t):Pu({...e,...t})}a(_ie,"CloneType");p();p();p();function d6e(t){return So(t)&&globalThis.Symbol.asyncIterator in t}a(d6e,"IsAsyncIterator");function f6e(t){return So(t)&&globalThis.Symbol.iterator in t}a(f6e,"IsIterator");function Vwt(t){return So(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(Vwt,"IsStandardObject");function p6e(t){return t instanceof globalThis.Promise}a(p6e,"IsPromise");function n_(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(n_,"IsDate");function mqr(t){return t instanceof globalThis.Map}a(mqr,"IsMap");function gqr(t){return t instanceof globalThis.Set}a(gqr,"IsSet");function bI(t){return globalThis.ArrayBuffer.isView(t)}a(bI,"IsTypedArray");function Cie(t){return t instanceof globalThis.Uint8Array}a(Cie,"IsUint8Array");function Qi(t,e){return e in t}a(Qi,"HasPropertyKey");function So(t){return t!==null&&typeof t=="object"}a(So,"IsObject");function Ri(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Ri,"IsArray");function Du(t){return t===void 0}a(Du,"IsUndefined");function RB(t){return t===null}a(RB,"IsNull");function SN(t){return typeof t=="boolean"}a(SN,"IsBoolean");function oi(t){return typeof t=="number"}a(oi,"IsNumber");function h6e(t){return globalThis.Number.isInteger(t)}a(h6e,"IsInteger");function Wg(t){return typeof t=="bigint"}a(Wg,"IsBigInt");function va(t){return typeof t=="string"}a(va,"IsString");function k9(t){return typeof t=="function"}a(k9,"IsFunction");function kB(t){return typeof t=="symbol"}a(kB,"IsSymbol");function S1(t){return Wg(t)||SN(t)||RB(t)||oi(t)||va(t)||kB(t)||Du(t)}a(S1,"IsValueType");var eu;(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=So(c);return t.AllowArrayObject?l:l&&!Ri(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?oi(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Du(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(eu||(eu={}));p();function Roo(t){return globalThis.Object.freeze(t).map(e=>pCe(e))}a(Roo,"ImmutableArray");function koo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=pCe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=pCe(t[r]);return globalThis.Object.freeze(e)}a(koo,"ImmutableObject");function pCe(t){return Sp(t)?Roo(t):GV(t)?t:wB(t)?t:fCe(t)?t:Wc(t)?koo(t):t}a(pCe,"Immutable");function Tt(t,e){let r=e!==void 0?{...e,...t}:t;switch(eu.InstanceMode){case"freeze":return pCe(r);case"clone":return Pu(r);default:return r}}a(Tt,"CreateType");p();var qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var Cd=Symbol.for("TypeBox.Transform"),ak=Symbol.for("TypeBox.Readonly"),zg=Symbol.for("TypeBox.Optional"),SI=Symbol.for("TypeBox.Hint"),_t=Symbol.for("TypeBox.Kind");function vie(t){return Wc(t)&&t[ak]==="Readonly"}a(vie,"IsReadonly");function GC(t){return Wc(t)&&t[zg]==="Optional"}a(GC,"IsOptional");function Wwt(t){return ia(t,"Any")}a(Wwt,"IsAny");function zwt(t){return ia(t,"Argument")}a(zwt,"IsArgument");function ck(t){return ia(t,"Array")}a(ck,"IsArray");function $V(t){return ia(t,"AsyncIterator")}a($V,"IsAsyncIterator");function VV(t){return ia(t,"BigInt")}a(VV,"IsBigInt");function PB(t){return ia(t,"Boolean")}a(PB,"IsBoolean");function lk(t){return ia(t,"Computed")}a(lk,"IsComputed");function uk(t){return ia(t,"Constructor")}a(uk,"IsConstructor");function Poo(t){return ia(t,"Date")}a(Poo,"IsDate");function dk(t){return ia(t,"Function")}a(dk,"IsFunction");function fk(t){return ia(t,"Integer")}a(fk,"IsInteger");function Zd(t){return ia(t,"Intersect")}a(Zd,"IsIntersect");function WV(t){return ia(t,"Iterator")}a(WV,"IsIterator");function ia(t,e){return Wc(t)&&_t in t&&t[_t]===e}a(ia,"IsKindOf");function m6e(t){return xB(t)||b1(t)||Ol(t)}a(m6e,"IsLiteralValue");function T1(t){return ia(t,"Literal")}a(T1,"IsLiteral");function I1(t){return ia(t,"MappedKey")}a(I1,"IsMappedKey");function Nu(t){return ia(t,"MappedResult")}a(Nu,"IsMappedResult");function P9(t){return ia(t,"Never")}a(P9,"IsNever");function Doo(t){return ia(t,"Not")}a(Doo,"IsNot");function hCe(t){return ia(t,"Null")}a(hCe,"IsNull");function pk(t){return ia(t,"Number")}a(pk,"IsNumber");function Ip(t){return ia(t,"Object")}a(Ip,"IsObject");function zV(t){return ia(t,"Promise")}a(zV,"IsPromise");function YV(t){return ia(t,"Record")}a(YV,"IsRecord");function Mf(t){return ia(t,"Ref")}a(Mf,"IsRef");function Ywt(t){return ia(t,"RegExp")}a(Ywt,"IsRegExp");function DB(t){return ia(t,"String")}a(DB,"IsString");function mCe(t){return ia(t,"Symbol")}a(mCe,"IsSymbol");function x1(t){return ia(t,"TemplateLiteral")}a(x1,"IsTemplateLiteral");function Noo(t){return ia(t,"This")}a(Noo,"IsThis");function Za(t){return Wc(t)&&Cd in t}a(Za,"IsTransform");function w1(t){return ia(t,"Tuple")}a(w1,"IsTuple");function NB(t){return ia(t,"Undefined")}a(NB,"IsUndefined");function ba(t){return ia(t,"Union")}a(ba,"IsUnion");function Moo(t){return ia(t,"Uint8Array")}a(Moo,"IsUint8Array");function Ooo(t){return ia(t,"Unknown")}a(Ooo,"IsUnknown");function Boo(t){return ia(t,"Unsafe")}a(Boo,"IsUnsafe");function Loo(t){return ia(t,"Void")}a(Loo,"IsVoid");function D9(t){return Wc(t)&&_t in t&&Ol(t[_t])}a(D9,"IsKind");function vd(t){return Wwt(t)||zwt(t)||ck(t)||PB(t)||VV(t)||$V(t)||lk(t)||uk(t)||Poo(t)||dk(t)||fk(t)||Zd(t)||WV(t)||T1(t)||I1(t)||Nu(t)||P9(t)||Doo(t)||hCe(t)||pk(t)||Ip(t)||zV(t)||YV(t)||Mf(t)||Ywt(t)||DB(t)||mCe(t)||x1(t)||Noo(t)||w1(t)||NB(t)||ba(t)||Moo(t)||Ooo(t)||Boo(t)||Loo(t)||D9(t)}a(vd,"IsSchema");var ze={};wi(ze,{IsAny:()=>_qr,IsArgument:()=>Cqr,IsArray:()=>vqr,IsAsyncIterator:()=>bqr,IsBigInt:()=>Sqr,IsBoolean:()=>Tqr,IsComputed:()=>Iqr,IsConstructor:()=>xqr,IsDate:()=>wqr,IsFunction:()=>Rqr,IsImport:()=>Hoo,IsInteger:()=>kqr,IsIntersect:()=>Pqr,IsIterator:()=>Dqr,IsKind:()=>ijr,IsKindOf:()=>Ms,IsLiteral:()=>ACe,IsLiteralBoolean:()=>Goo,IsLiteralNumber:()=>Mqr,IsLiteralString:()=>Nqr,IsLiteralValue:()=>Oqr,IsMappedKey:()=>Bqr,IsMappedResult:()=>Lqr,IsNever:()=>Fqr,IsNot:()=>Uqr,IsNull:()=>Qqr,IsNumber:()=>qqr,IsObject:()=>jqr,IsOptional:()=>joo,IsPromise:()=>Hqr,IsProperties:()=>g6e,IsReadonly:()=>qoo,IsRecord:()=>Gqr,IsRecursive:()=>$oo,IsRef:()=>$qr,IsRegExp:()=>Vqr,IsSchema:()=>Mu,IsString:()=>Wqr,IsSymbol:()=>zqr,IsTemplateLiteral:()=>Yqr,IsThis:()=>Kqr,IsTransform:()=>Jqr,IsTuple:()=>Zqr,IsUint8Array:()=>ejr,IsUndefined:()=>Xqr,IsUnion:()=>Xwt,IsUnionLiteral:()=>Voo,IsUnknown:()=>tjr,IsUnsafe:()=>rjr,IsVoid:()=>njr,TypeGuardUnknownTypeError:()=>Kwt});p();var Kwt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},Foo=["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 Aqr(t){try{return new RegExp(t),!0}catch{return!1}}a(Aqr,"IsPattern");function Jwt(t){if(!Ol(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(Jwt,"IsControlCharacterFree");function yqr(t){return Zwt(t)||Mu(t)}a(yqr,"IsAdditionalProperties");function gCe(t){return Tp(t)||dCe(t)}a(gCe,"IsOptionalBigInt");function Bl(t){return Tp(t)||b1(t)}a(Bl,"IsOptionalNumber");function Zwt(t){return Tp(t)||xB(t)}a(Zwt,"IsOptionalBoolean");function zc(t){return Tp(t)||Ol(t)}a(zc,"IsOptionalString");function Uoo(t){return Tp(t)||Ol(t)&&Jwt(t)&&Aqr(t)}a(Uoo,"IsOptionalPattern");function Qoo(t){return Tp(t)||Ol(t)&&Jwt(t)}a(Qoo,"IsOptionalFormat");function Eqr(t){return Tp(t)||Mu(t)}a(Eqr,"IsOptionalSchema");function qoo(t){return Wc(t)&&t[ak]==="Readonly"}a(qoo,"IsReadonly");function joo(t){return Wc(t)&&t[zg]==="Optional"}a(joo,"IsOptional");function _qr(t){return Ms(t,"Any")&&zc(t.$id)}a(_qr,"IsAny");function Cqr(t){return Ms(t,"Argument")&&b1(t.index)}a(Cqr,"IsArgument");function vqr(t){return Ms(t,"Array")&&t.type==="array"&&zc(t.$id)&&Mu(t.items)&&Bl(t.minItems)&&Bl(t.maxItems)&&Zwt(t.uniqueItems)&&Eqr(t.contains)&&Bl(t.minContains)&&Bl(t.maxContains)}a(vqr,"IsArray");function bqr(t){return Ms(t,"AsyncIterator")&&t.type==="AsyncIterator"&&zc(t.$id)&&Mu(t.items)}a(bqr,"IsAsyncIterator");function Sqr(t){return Ms(t,"BigInt")&&t.type==="bigint"&&zc(t.$id)&&gCe(t.exclusiveMaximum)&&gCe(t.exclusiveMinimum)&&gCe(t.maximum)&&gCe(t.minimum)&&gCe(t.multipleOf)}a(Sqr,"IsBigInt");function Tqr(t){return Ms(t,"Boolean")&&t.type==="boolean"&&zc(t.$id)}a(Tqr,"IsBoolean");function Iqr(t){return Ms(t,"Computed")&&Ol(t.target)&&Sp(t.parameters)&&t.parameters.every(e=>Mu(e))}a(Iqr,"IsComputed");function xqr(t){return Ms(t,"Constructor")&&t.type==="Constructor"&&zc(t.$id)&&Sp(t.parameters)&&t.parameters.every(e=>Mu(e))&&Mu(t.returns)}a(xqr,"IsConstructor");function wqr(t){return Ms(t,"Date")&&t.type==="Date"&&zc(t.$id)&&Bl(t.exclusiveMaximumTimestamp)&&Bl(t.exclusiveMinimumTimestamp)&&Bl(t.maximumTimestamp)&&Bl(t.minimumTimestamp)&&Bl(t.multipleOfTimestamp)}a(wqr,"IsDate");function Rqr(t){return Ms(t,"Function")&&t.type==="Function"&&zc(t.$id)&&Sp(t.parameters)&&t.parameters.every(e=>Mu(e))&&Mu(t.returns)}a(Rqr,"IsFunction");function Hoo(t){return Ms(t,"Import")&&l6e(t,"$defs")&&Wc(t.$defs)&&g6e(t.$defs)&&l6e(t,"$ref")&&Ol(t.$ref)&&t.$ref in t.$defs}a(Hoo,"IsImport");function kqr(t){return Ms(t,"Integer")&&t.type==="integer"&&zc(t.$id)&&Bl(t.exclusiveMaximum)&&Bl(t.exclusiveMinimum)&&Bl(t.maximum)&&Bl(t.minimum)&&Bl(t.multipleOf)}a(kqr,"IsInteger");function g6e(t){return Wc(t)&&Object.entries(t).every(([e,r])=>Jwt(e)&&Mu(r))}a(g6e,"IsProperties");function Pqr(t){return Ms(t,"Intersect")&&!(Ol(t.type)&&t.type!=="object")&&Sp(t.allOf)&&t.allOf.every(e=>Mu(e)&&!Jqr(e))&&zc(t.type)&&(Zwt(t.unevaluatedProperties)||Eqr(t.unevaluatedProperties))&&zc(t.$id)}a(Pqr,"IsIntersect");function Dqr(t){return Ms(t,"Iterator")&&t.type==="Iterator"&&zc(t.$id)&&Mu(t.items)}a(Dqr,"IsIterator");function Ms(t,e){return Wc(t)&&_t in t&&t[_t]===e}a(Ms,"IsKindOf");function Nqr(t){return ACe(t)&&Ol(t.const)}a(Nqr,"IsLiteralString");function Mqr(t){return ACe(t)&&b1(t.const)}a(Mqr,"IsLiteralNumber");function Goo(t){return ACe(t)&&xB(t.const)}a(Goo,"IsLiteralBoolean");function ACe(t){return Ms(t,"Literal")&&zc(t.$id)&&Oqr(t.const)}a(ACe,"IsLiteral");function Oqr(t){return xB(t)||b1(t)||Ol(t)}a(Oqr,"IsLiteralValue");function Bqr(t){return Ms(t,"MappedKey")&&Sp(t.keys)&&t.keys.every(e=>b1(e)||Ol(e))}a(Bqr,"IsMappedKey");function Lqr(t){return Ms(t,"MappedResult")&&g6e(t.properties)}a(Lqr,"IsMappedResult");function Fqr(t){return Ms(t,"Never")&&Wc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Fqr,"IsNever");function Uqr(t){return Ms(t,"Not")&&Mu(t.not)}a(Uqr,"IsNot");function Qqr(t){return Ms(t,"Null")&&t.type==="null"&&zc(t.$id)}a(Qqr,"IsNull");function qqr(t){return Ms(t,"Number")&&t.type==="number"&&zc(t.$id)&&Bl(t.exclusiveMaximum)&&Bl(t.exclusiveMinimum)&&Bl(t.maximum)&&Bl(t.minimum)&&Bl(t.multipleOf)}a(qqr,"IsNumber");function jqr(t){return Ms(t,"Object")&&t.type==="object"&&zc(t.$id)&&g6e(t.properties)&&yqr(t.additionalProperties)&&Bl(t.minProperties)&&Bl(t.maxProperties)}a(jqr,"IsObject");function Hqr(t){return Ms(t,"Promise")&&t.type==="Promise"&&zc(t.$id)&&Mu(t.item)}a(Hqr,"IsPromise");function Gqr(t){return Ms(t,"Record")&&t.type==="object"&&zc(t.$id)&&yqr(t.additionalProperties)&&Wc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&Aqr(r[0])&&Wc(e.patternProperties)&&Mu(e.patternProperties[r[0]])})(t)}a(Gqr,"IsRecord");function $oo(t){return Wc(t)&&SI in t&&t[SI]==="Recursive"}a($oo,"IsRecursive");function $qr(t){return Ms(t,"Ref")&&zc(t.$id)&&Ol(t.$ref)}a($qr,"IsRef");function Vqr(t){return Ms(t,"RegExp")&&zc(t.$id)&&Ol(t.source)&&Ol(t.flags)&&Bl(t.maxLength)&&Bl(t.minLength)}a(Vqr,"IsRegExp");function Wqr(t){return Ms(t,"String")&&t.type==="string"&&zc(t.$id)&&Bl(t.minLength)&&Bl(t.maxLength)&&Uoo(t.pattern)&&Qoo(t.format)}a(Wqr,"IsString");function zqr(t){return Ms(t,"Symbol")&&t.type==="symbol"&&zc(t.$id)}a(zqr,"IsSymbol");function Yqr(t){return Ms(t,"TemplateLiteral")&&t.type==="string"&&Ol(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Yqr,"IsTemplateLiteral");function Kqr(t){return Ms(t,"This")&&zc(t.$id)&&Ol(t.$ref)}a(Kqr,"IsThis");function Jqr(t){return Wc(t)&&Cd in t}a(Jqr,"IsTransform");function Zqr(t){return Ms(t,"Tuple")&&t.type==="array"&&zc(t.$id)&&b1(t.minItems)&&b1(t.maxItems)&&t.minItems===t.maxItems&&(Tp(t.items)&&Tp(t.additionalItems)&&t.minItems===0||Sp(t.items)&&t.items.every(e=>Mu(e)))}a(Zqr,"IsTuple");function Xqr(t){return Ms(t,"Undefined")&&t.type==="undefined"&&zc(t.$id)}a(Xqr,"IsUndefined");function Voo(t){return Xwt(t)&&t.anyOf.every(e=>Nqr(e)||Mqr(e))}a(Voo,"IsUnionLiteral");function Xwt(t){return Ms(t,"Union")&&zc(t.$id)&&Wc(t)&&Sp(t.anyOf)&&t.anyOf.every(e=>Mu(e))}a(Xwt,"IsUnion");function ejr(t){return Ms(t,"Uint8Array")&&t.type==="Uint8Array"&&zc(t.$id)&&Bl(t.minByteLength)&&Bl(t.maxByteLength)}a(ejr,"IsUint8Array");function tjr(t){return Ms(t,"Unknown")&&zc(t.$id)}a(tjr,"IsUnknown");function rjr(t){return Ms(t,"Unsafe")}a(rjr,"IsUnsafe");function njr(t){return Ms(t,"Void")&&t.type==="void"&&zc(t.$id)}a(njr,"IsVoid");function ijr(t){return Wc(t)&&_t in t&&Ol(t[_t])&&!Foo.includes(t[_t])}a(ijr,"IsKind");function Mu(t){return Wc(t)&&(_qr(t)||Cqr(t)||vqr(t)||Tqr(t)||Sqr(t)||bqr(t)||Iqr(t)||xqr(t)||wqr(t)||Rqr(t)||kqr(t)||Pqr(t)||Dqr(t)||ACe(t)||Bqr(t)||Lqr(t)||Fqr(t)||Uqr(t)||Qqr(t)||qqr(t)||jqr(t)||Hqr(t)||Gqr(t)||$qr(t)||Vqr(t)||Wqr(t)||zqr(t)||Yqr(t)||Kqr(t)||Zqr(t)||Xqr(t)||Xwt(t)||ejr(t)||tjr(t)||rjr(t)||njr(t)||ijr(t))}a(Mu,"IsSchema");p();var eRt="(true|false)",yCe="(0|[1-9][0-9]*)",tRt="(.*)",Woo="(?!.*)",Jnl=`^${eRt}$`,N9=`^${yCe}$`,M9=`^${tRt}$`,ojr=`^${Woo}$`;p();var hk={};wi(hk,{Clear:()=>Yoo,Delete:()=>Koo,Entries:()=>zoo,Get:()=>Xoo,Has:()=>Joo,Set:()=>Zoo});p();var bie=new Map;function zoo(){return new Map(bie)}a(zoo,"Entries");function Yoo(){return bie.clear()}a(Yoo,"Clear");function Koo(t){return bie.delete(t)}a(Koo,"Delete");function Joo(t){return bie.has(t)}a(Joo,"Has");function Zoo(t,e){bie.set(t,e)}a(Zoo,"Set");function Xoo(t){return bie.get(t)}a(Xoo,"Get");var i_={};wi(i_,{Clear:()=>tso,Delete:()=>rso,Entries:()=>eso,Get:()=>oso,Has:()=>nso,Set:()=>iso});p();var Sie=new Map;function eso(){return new Map(Sie)}a(eso,"Entries");function tso(){return Sie.clear()}a(tso,"Clear");function rso(t){return Sie.delete(t)}a(rso,"Delete");function nso(t){return Sie.has(t)}a(nso,"Has");function iso(t,e){Sie.set(t,e)}a(iso,"Set");function oso(t){return Sie.get(t)}a(oso,"Get");p();function sjr(t,e){return t.includes(e)}a(sjr,"SetIncludes");function ajr(t){return[...new Set(t)]}a(ajr,"SetDistinct");function sso(t,e){return t.filter(r=>e.includes(r))}a(sso,"SetIntersect");function aso(t,e){return t.reduce((r,n)=>sso(r,n),e)}a(aso,"SetIntersectManyResolve");function cjr(t){return t.length===1?t[0]:t.length>1?aso(t.slice(1),t[0]):[]}a(cjr,"SetIntersectMany");function ljr(t){let e=[];for(let r of t)e.push(...r);return e}a(ljr,"SetUnionMany");p();function O9(t){return Tt({[_t]:"Any"},t)}a(O9,"Any");p();function Tie(t,e){return Tt({[_t]:"Array",type:"array",items:t},e)}a(Tie,"Array");p();function ujr(t){return Tt({[_t]:"Argument",index:t})}a(ujr,"Argument");p();function Iie(t,e){return Tt({[_t]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Iie,"AsyncIterator");p();p();function tu(t,e,r){return Tt({[_t]:"Computed",target:t,parameters:e},r)}a(tu,"Computed");p();p();function cso(t,e){let{[e]:r,...n}=t;return n}a(cso,"DiscardKey");function Xd(t,e){return e.reduce((r,n)=>cso(r,n),t)}a(Xd,"Discard");p();function Ko(t){return Tt({[_t]:"Never",not:{}},t)}a(Ko,"Never");p();p();function Ua(t){return Tt({[_t]:"MappedResult",properties:t})}a(Ua,"MappedResult");p();p();function xie(t,e,r){return Tt({[_t]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(xie,"Constructor");p();function TN(t,e,r){return Tt({[_t]:"Function",type:"Function",parameters:t,returns:e},r)}a(TN,"Function");p();p();p();p();function ECe(t,e){return Tt({[_t]:"Union",anyOf:t},e)}a(ECe,"UnionCreate");function lso(t){return t.some(e=>GC(e))}a(lso,"IsUnionOptional");function djr(t){return t.map(e=>GC(e)?uso(e):e)}a(djr,"RemoveOptionalFromRest");function uso(t){return Xd(t,[zg])}a(uso,"RemoveOptionalFromType");function dso(t,e){return lso(t)?gy(ECe(djr(t),e)):ECe(djr(t),e)}a(dso,"ResolveUnion");function IN(t,e){return t.length===1?Tt(t[0],e):t.length===0?Ko(e):dso(t,e)}a(IN,"UnionEvaluated");p();function Xa(t,e){return t.length===0?Ko(e):t.length===1?Tt(t[0],e):ECe(t,e)}a(Xa,"Union");p();p();p();var A6e=class extends qi{static{a(this,"TemplateLiteralParserError")}};function fso(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(fso,"Unescape");function rRt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(rRt,"IsNonEscaped");function OB(t,e){return rRt(t,e,"(")}a(OB,"IsOpenParen");function _Ce(t,e){return rRt(t,e,")")}a(_Ce,"IsCloseParen");function fjr(t,e){return rRt(t,e,"|")}a(fjr,"IsSeparator");function pso(t){if(!(OB(t,0)&&_Ce(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(wie(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(wie(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(Aso,"Or");function yso(t){function e(o,s){if(!OB(o,s))throw new A6e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(wie(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(yso,"And");function wie(t){return pso(t)?wie(hso(t)):mso(t)?Aso(t):gso(t)?yso(t):{type:"const",const:fso(t)}}a(wie,"TemplateLiteralParse");function Rie(t){return wie(t.slice(1,t.length-1))}a(Rie,"TemplateLiteralParseExact");var nRt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function Eso(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(Eso,"IsNumberExpression");function _so(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(_so,"IsBooleanExpression");function Cso(t){return t.type==="const"&&t.const===".*"}a(Cso,"IsStringExpression");function KV(t){return Eso(t)||Cso(t)?!1:_so(t)?!0:t.type==="and"?t.expr.every(e=>KV(e)):t.type==="or"?t.expr.every(e=>KV(e)):t.type==="const"?!0:(()=>{throw new nRt("Unknown expression type")})()}a(KV,"IsTemplateLiteralExpressionFinite");function y6e(t){let e=Rie(t.pattern);return KV(e)}a(y6e,"IsTemplateLiteralFinite");p();var iRt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*pjr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of pjr(t.slice(1)))yield`${e}${r}`}a(pjr,"GenerateReduce");function*vso(t){return yield*pjr(t.expr.map(e=>[...CCe(e)]))}a(vso,"GenerateAnd");function*bso(t){for(let e of t.expr)yield*CCe(e)}a(bso,"GenerateOr");function*Sso(t){return yield t.const}a(Sso,"GenerateConst");function*CCe(t){return t.type==="and"?yield*vso(t):t.type==="or"?yield*bso(t):t.type==="const"?yield*Sso(t):(()=>{throw new iRt("Unknown expression")})()}a(CCe,"TemplateLiteralExpressionGenerate");function kie(t){let e=Rie(t.pattern);return KV(e)?[...CCe(e)]:[]}a(kie,"TemplateLiteralGenerate");p();p();function oa(t,e){return Tt({[_t]:"Literal",const:t,type:typeof t},e)}a(oa,"Literal");p();function E6e(t){return Tt({[_t]:"Boolean",type:"boolean"},t)}a(E6e,"Boolean");p();function Pie(t){return Tt({[_t]:"BigInt",type:"bigint"},t)}a(Pie,"BigInt");p();function TI(t){return Tt({[_t]:"Number",type:"number"},t)}a(TI,"Number");p();function o_(t){return Tt({[_t]:"String",type:"string"},t)}a(o_,"String");function*Tso(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield E6e():e==="number"?yield TI():e==="bigint"?yield Pie():e==="string"?yield o_():yield(()=>{let r=e.split("|").map(n=>oa(n.trim()));return r.length===0?Ko():r.length===1?r[0]:IN(r)})()}a(Tso,"FromUnion");function*Iso(t){if(t[1]!=="{"){let e=oa("$"),r=oRt(t.slice(1));return yield*[e,...r]}for(let e=2;emjr(r,e)).join("|")})`:pk(t)?`${e}${yCe}`:fk(t)?`${e}${yCe}`:VV(t)?`${e}${yCe}`:DB(t)?`${e}${tRt}`:T1(t)?`${e}${xso(t.const.toString())}`:PB(t)?`${e}${eRt}`:(()=>{throw new sRt(`Unexpected Kind '${t[_t]}'`)})()}a(mjr,"Visit");function aRt(t){return`^${t.map(e=>mjr(e,"")).join("")}$`}a(aRt,"TemplateLiteralPattern");p();function JV(t){let r=kie(t).map(n=>oa(n));return IN(r)}a(JV,"TemplateLiteralToUnion");p();function _6e(t,e){let r=Ol(t)?aRt(hjr(t)):aRt(t);return Tt({[_t]:"TemplateLiteral",type:"string",pattern:r},e)}a(_6e,"TemplateLiteral");function wso(t){return kie(t).map(r=>r.toString())}a(wso,"FromTemplateLiteral");function Rso(t){let e=[];for(let r of t)e.push(...$C(r));return e}a(Rso,"FromUnion");function kso(t){return[t.toString()]}a(kso,"FromLiteral");function $C(t){return[...new Set(x1(t)?wso(t):ba(t)?Rso(t.anyOf):T1(t)?kso(t.const):pk(t)?["[number]"]:fk(t)?["[number]"]:[])]}a($C,"IndexPropertyKeys");p();function Pso(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=B9(t,$C(e[o]),r);return n}a(Pso,"FromProperties");function Dso(t,e,r){return Pso(t,e.properties,r)}a(Dso,"FromMappedResult");function gjr(t,e,r){let n=Dso(t,e,r);return Ua(n)}a(gjr,"IndexFromMappedResult");function yjr(t,e){return t.map(r=>Ejr(r,e))}a(yjr,"FromRest");function Nso(t){return t.filter(e=>!P9(e))}a(Nso,"FromIntersectRest");function Mso(t,e){return C6e(Nso(yjr(t,e)))}a(Mso,"FromIntersect");function Oso(t){return t.some(e=>P9(e))?[]:t}a(Oso,"FromUnionRest");function Bso(t,e){return IN(Oso(yjr(t,e)))}a(Bso,"FromUnion");function Lso(t,e){return e in t?t[e]:e==="[number]"?IN(t):Ko()}a(Lso,"FromTuple");function Fso(t,e){return e==="[number]"?t:Ko()}a(Fso,"FromArray");function Uso(t,e){return e in t?t[e]:Ko()}a(Uso,"FromProperty");function Ejr(t,e){return Zd(t)?Mso(t.allOf,e):ba(t)?Bso(t.anyOf,e):w1(t)?Lso(t.items??[],e):ck(t)?Fso(t.items,e):Ip(t)?Uso(t.properties,e):Ko()}a(Ejr,"IndexFromPropertyKey");function vCe(t,e){return e.map(r=>Ejr(t,r))}a(vCe,"IndexFromPropertyKeys");function Ajr(t,e){return IN(vCe(t,e))}a(Ajr,"FromSchema");function B9(t,e,r){if(Mf(t)||Mf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!vd(t)||!vd(e))throw new qi(n);return tu("Index",[t,e])}return Nu(e)?gjr(t,e,r):I1(e)?_jr(t,e,r):Tt(vd(e)?Ajr(t,$C(e)):Ajr(t,e),r)}a(B9,"Index");function Qso(t,e,r){return{[e]:B9(t,[e],Pu(r))}}a(Qso,"MappedIndexPropertyKey");function qso(t,e,r){return e.reduce((n,o)=>({...n,...Qso(t,o,r)}),{})}a(qso,"MappedIndexPropertyKeys");function jso(t,e,r){return qso(t,e.keys,r)}a(jso,"MappedIndexProperties");function _jr(t,e,r){let n=jso(t,e,r);return Ua(n)}a(_jr,"IndexFromMappedKey");p();function Die(t,e){return Tt({[_t]:"Iterator",type:"Iterator",items:t},e)}a(Die,"Iterator");p();function Hso(t){return globalThis.Object.keys(t).filter(e=>!GC(t[e]))}a(Hso,"RequiredArray");function Gso(t,e){let r=Hso(t),n=r.length>0?{[_t]:"Object",type:"object",required:r,properties:t}:{[_t]:"Object",type:"object",properties:t};return Tt(n,e)}a(Gso,"_Object");var ec=Gso;p();function v6e(t,e){return Tt({[_t]:"Promise",type:"Promise",item:t},e)}a(v6e,"Promise");p();p();function $so(t){return Tt(Xd(t,[ak]))}a($so,"RemoveReadonly");function Vso(t){return Tt({...t,[ak]:"Readonly"})}a(Vso,"AddReadonly");function Wso(t,e){return e===!1?$so(t):Vso(t)}a(Wso,"ReadonlyWithFlag");function VC(t,e){let r=e??!0;return Nu(t)?Cjr(t,r):Wso(t,r)}a(VC,"Readonly");function zso(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=VC(t[n],e);return r}a(zso,"FromProperties");function Yso(t,e){return zso(t.properties,e)}a(Yso,"FromMappedResult");function Cjr(t,e){let r=Yso(t,e);return Ua(r)}a(Cjr,"ReadonlyFromMappedResult");p();function II(t,e){return Tt(t.length>0?{[_t]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[_t]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(II,"Tuple");function vjr(t,e){return t in e?xI(t,e[t]):Ua(e)}a(vjr,"FromMappedResult");function Kso(t){return{[t]:oa(t)}}a(Kso,"MappedKeyToKnownMappedResultProperties");function Jso(t){let e={};for(let r of t)e[r]=oa(r);return e}a(Jso,"MappedKeyToUnknownMappedResultProperties");function Zso(t,e){return sjr(e,t)?Kso(t):Jso(e)}a(Zso,"MappedKeyToMappedResultProperties");function Xso(t,e){let r=Zso(t,e);return vjr(t,r)}a(Xso,"FromMappedKey");function bCe(t,e){return e.map(r=>xI(t,r))}a(bCe,"FromRest");function eao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=xI(t,e[n]);return r}a(eao,"FromProperties");function xI(t,e){let r={...e};return GC(e)?gy(xI(t,Xd(e,[zg]))):vie(e)?VC(xI(t,Xd(e,[ak]))):Nu(e)?vjr(t,e.properties):I1(e)?Xso(t,e.keys):uk(e)?xie(bCe(t,e.parameters),xI(t,e.returns),r):dk(e)?TN(bCe(t,e.parameters),xI(t,e.returns),r):$V(e)?Iie(xI(t,e.items),r):WV(e)?Die(xI(t,e.items),r):Zd(e)?Ay(bCe(t,e.allOf),r):ba(e)?Xa(bCe(t,e.anyOf),r):w1(e)?II(bCe(t,e.items??[]),r):Ip(e)?ec(eao(t,e.properties),r):ck(e)?Tie(xI(t,e.items),r):zV(e)?v6e(xI(t,e.item),r):e}a(xI,"FromSchemaType");function tao(t,e){let r={};for(let n of t)r[n]=xI(n,e);return r}a(tao,"MappedFunctionReturnType");function bjr(t,e,r){let n=vd(t)?$C(t):t,o=e({[_t]:"MappedKey",keys:n}),s=tao(n,o);return ec(s,r)}a(bjr,"Mapped");p();function rao(t){return Tt(Xd(t,[zg]))}a(rao,"RemoveOptional");function nao(t){return Tt({...t,[zg]:"Optional"})}a(nao,"AddOptional");function iao(t,e){return e===!1?rao(t):nao(t)}a(iao,"OptionalWithFlag");function gy(t,e){let r=e??!0;return Nu(t)?Sjr(t,r):iao(t,r)}a(gy,"Optional");function oao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=gy(t[n],e);return r}a(oao,"FromProperties");function sao(t,e){return oao(t.properties,e)}a(sao,"FromMappedResult");function Sjr(t,e){let r=sao(t,e);return Ua(r)}a(Sjr,"OptionalFromMappedResult");p();function SCe(t,e={}){let r=t.every(o=>Ip(o)),n=vd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return Tt(e.unevaluatedProperties===!1||vd(e.unevaluatedProperties)||r?{...n,[_t]:"Intersect",type:"object",allOf:t}:{...n,[_t]:"Intersect",allOf:t},e)}a(SCe,"IntersectCreate");function aao(t){return t.every(e=>GC(e))}a(aao,"IsIntersectOptional");function cao(t){return Xd(t,[zg])}a(cao,"RemoveOptionalFromType");function Tjr(t){return t.map(e=>GC(e)?cao(e):e)}a(Tjr,"RemoveOptionalFromRest");function lao(t,e){return aao(t)?gy(SCe(Tjr(t),e)):SCe(Tjr(t),e)}a(lao,"ResolveIntersect");function C6e(t,e={}){if(t.length===1)return Tt(t[0],e);if(t.length===0)return Ko(e);if(t.some(r=>Za(r)))throw new Error("Cannot intersect transform types");return lao(t,e)}a(C6e,"IntersectEvaluated");p();function Ay(t,e){if(t.length===1)return Tt(t[0],e);if(t.length===0)return Ko(e);if(t.some(r=>Za(r)))throw new Error("Cannot intersect transform types");return SCe(t,e)}a(Ay,"Intersect");p();function wI(...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 Tt({[_t]:"Ref",$ref:e},r)}a(wI,"Ref");function uao(t,e){return tu("Awaited",[tu(t,e)])}a(uao,"FromComputed");function dao(t){return tu("Awaited",[wI(t)])}a(dao,"FromRef");function fao(t){return Ay(Ijr(t))}a(fao,"FromIntersect");function pao(t){return Xa(Ijr(t))}a(pao,"FromUnion");function hao(t){return Nie(t)}a(hao,"FromPromise");function Ijr(t){return t.map(e=>Nie(e))}a(Ijr,"FromRest");function Nie(t,e){return Tt(lk(t)?uao(t.target,t.parameters):Zd(t)?fao(t.allOf):ba(t)?pao(t.anyOf):zV(t)?hao(t.item):Mf(t)?dao(t.$ref):t,e)}a(Nie,"Awaited");p();p();p();p();function xjr(t){let e=[];for(let r of t)e.push(WC(r));return e}a(xjr,"FromRest");function mao(t){let e=xjr(t);return ljr(e)}a(mao,"FromIntersect");function gao(t){let e=xjr(t);return cjr(e)}a(gao,"FromUnion");function Aao(t){return t.map((e,r)=>r.toString())}a(Aao,"FromTuple");function yao(t){return["[number]"]}a(yao,"FromArray");function Eao(t){return globalThis.Object.getOwnPropertyNames(t)}a(Eao,"FromProperties");function _ao(t){return cRt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(_ao,"FromPatternProperties");function WC(t){return Zd(t)?mao(t.allOf):ba(t)?gao(t.anyOf):w1(t)?Aao(t.items??[]):ck(t)?yao(t.items):Ip(t)?Eao(t.properties):YV(t)?_ao(t.patternProperties):[]}a(WC,"KeyOfPropertyKeys");var cRt=!1;function BB(t){cRt=!0;let e=WC(t);return cRt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(BB,"KeyOfPattern");function Cao(t,e){return tu("KeyOf",[tu(t,e)])}a(Cao,"FromComputed");function vao(t){return tu("KeyOf",[wI(t)])}a(vao,"FromRef");function bao(t,e){let r=WC(t),n=Sao(r),o=IN(n);return Tt(o,e)}a(bao,"KeyOfFromType");function Sao(t){return t.map(e=>e==="[number]"?TI():oa(e))}a(Sao,"KeyOfPropertyKeysToRest");function Mie(t,e){return lk(t)?Cao(t.target,t.parameters):Mf(t)?vao(t.$ref):Nu(t)?wjr(t,e):bao(t,e)}a(Mie,"KeyOf");function Tao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Mie(t[n],Pu(e));return r}a(Tao,"FromProperties");function Iao(t,e){return Tao(t.properties,e)}a(Iao,"FromMappedResult");function wjr(t,e){let r=Iao(t,e);return Ua(r)}a(wjr,"KeyOfFromMappedResult");p();function b6e(t){let e=WC(t),r=vCe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(b6e,"KeyOfPropertyEntries");function xao(t){let e=[];for(let r of t)e.push(...WC(r));return ajr(e)}a(xao,"CompositeKeys");function wao(t){return t.filter(e=>!P9(e))}a(wao,"FilterNever");function Rao(t,e){let r=[];for(let n of t)r.push(...vCe(n,[e]));return wao(r)}a(Rao,"CompositeProperty");function kao(t,e){let r={};for(let n of e)r[n]=C6e(Rao(t,n));return r}a(kao,"CompositeProperties");function Rjr(t,e){let r=xao(t),n=kao(t,r);return ec(n,e)}a(Rjr,"Composite");p();p();function S6e(t){return Tt({[_t]:"Date",type:"Date"},t)}a(S6e,"Date");p();function T6e(t){return Tt({[_t]:"Null",type:"null"},t)}a(T6e,"Null");p();function I6e(t){return Tt({[_t]:"Symbol",type:"symbol"},t)}a(I6e,"Symbol");p();function x6e(t){return Tt({[_t]:"Undefined",type:"undefined"},t)}a(x6e,"Undefined");p();function w6e(t){return Tt({[_t]:"Uint8Array",type:"Uint8Array"},t)}a(w6e,"Uint8Array");p();function mk(t){return Tt({[_t]:"Unknown"},t)}a(mk,"Unknown");function Pao(t){return t.map(e=>lRt(e,!1))}a(Pao,"FromArray");function Dao(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=VC(lRt(t[r],!1));return e}a(Dao,"FromProperties");function R6e(t,e){return e===!0?t:VC(t)}a(R6e,"ConditionalReadonly");function lRt(t,e){return qwt(t)?R6e(O9(),e):Hwt(t)?R6e(O9(),e):Sp(t)?VC(II(Pao(t))):wB(t)?w6e():GV(t)?S6e():Wc(t)?R6e(ec(Dao(t)),e):jwt(t)?R6e(TN([],mk()),e):Tp(t)?x6e():Gwt(t)?T6e():$wt(t)?I6e():dCe(t)?Pie():b1(t)?oa(t):xB(t)?oa(t):Ol(t)?oa(t):ec({})}a(lRt,"FromValue");function kjr(t,e){return Tt(lRt(t,!0),e)}a(kjr,"Const");p();function Pjr(t,e){return uk(t)?II(t.parameters,e):Ko(e)}a(Pjr,"ConstructorParameters");p();function Djr(t,e){if(Tp(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=>oa(s));return Xa(o,{...e,[SI]:"Enum"})}a(Djr,"Enum");p();p();p();var dRt=class extends qi{static{a(this,"ExtendsResolverError")}},xt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(xt||(xt={}));function RI(t){return t===xt.False?t:xt.True}a(RI,"IntoBooleanResult");function Oie(t){throw new dRt(t)}a(Oie,"Throw");function ph(t){return ze.IsNever(t)||ze.IsIntersect(t)||ze.IsUnion(t)||ze.IsUnknown(t)||ze.IsAny(t)}a(ph,"IsStructuralRight");function hh(t,e){return ze.IsNever(e)?Ujr(t,e):ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)?mRt(t,e):ze.IsUnknown(e)?Hjr(t,e):ze.IsAny(e)?hRt(t,e):Oie("StructuralRight")}a(hh,"StructuralRight");function hRt(t,e){return xt.True}a(hRt,"FromAnyRight");function Nao(t,e){return ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)&&e.anyOf.some(r=>ze.IsAny(r)||ze.IsUnknown(r))?xt.True:ze.IsUnion(e)?xt.Union:ze.IsUnknown(e)||ze.IsAny(e)?xt.True:xt.Union}a(Nao,"FromAny");function Mao(t,e){return ze.IsUnknown(t)?xt.False:ze.IsAny(t)?xt.Union:ze.IsNever(t)?xt.True:xt.False}a(Mao,"FromArrayRight");function Oao(t,e){return ze.IsObject(e)&&P6e(e)?xt.True:ph(e)?hh(t,e):ze.IsArray(e)?RI(Yc(t.items,e.items)):xt.False}a(Oao,"FromArray");function Bao(t,e){return ph(e)?hh(t,e):ze.IsAsyncIterator(e)?RI(Yc(t.items,e.items)):xt.False}a(Bao,"FromAsyncIterator");function Lao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsBigInt(e)?xt.True:xt.False}a(Lao,"FromBigInt");function Ljr(t,e){return ze.IsLiteralBoolean(t)||ze.IsBoolean(t)?xt.True:xt.False}a(Ljr,"FromBooleanRight");function Fao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsBoolean(e)?xt.True:xt.False}a(Fao,"FromBoolean");function Uao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsConstructor(e)?t.parameters.length>e.parameters.length?xt.False:t.parameters.every((r,n)=>RI(Yc(e.parameters[n],r))===xt.True)?RI(Yc(t.returns,e.returns)):xt.False:xt.False}a(Uao,"FromConstructor");function Qao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsDate(e)?xt.True:xt.False}a(Qao,"FromDate");function qao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsFunction(e)?t.parameters.length>e.parameters.length?xt.False:t.parameters.every((r,n)=>RI(Yc(e.parameters[n],r))===xt.True)?RI(Yc(t.returns,e.returns)):xt.False:xt.False}a(qao,"FromFunction");function Fjr(t,e){return ze.IsLiteral(t)&&my.IsNumber(t.const)||ze.IsNumber(t)||ze.IsInteger(t)?xt.True:xt.False}a(Fjr,"FromIntegerRight");function jao(t,e){return ze.IsInteger(e)||ze.IsNumber(e)?xt.True:ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):xt.False}a(jao,"FromInteger");function k6e(t,e){return e.allOf.every(r=>Yc(t,r)===xt.True)?xt.True:xt.False}a(k6e,"FromIntersectRight");function Hao(t,e){return t.allOf.some(r=>Yc(r,e)===xt.True)?xt.True:xt.False}a(Hao,"FromIntersect");function Gao(t,e){return ph(e)?hh(t,e):ze.IsIterator(e)?RI(Yc(t.items,e.items)):xt.False}a(Gao,"FromIterator");function $ao(t,e){return ze.IsLiteral(e)&&e.const===t.const?xt.True:ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsString(e)?jjr(t,e):ze.IsNumber(e)?Qjr(t,e):ze.IsInteger(e)?Fjr(t,e):ze.IsBoolean(e)?Ljr(t,e):xt.False}a($ao,"FromLiteral");function Ujr(t,e){return xt.False}a(Ujr,"FromNeverRight");function Vao(t,e){return xt.True}a(Vao,"FromNever");function Njr(t){let[e,r]=[t,0];for(;ze.IsNot(e);)e=e.not,r+=1;return r%2===0?e:mk()}a(Njr,"UnwrapTNot");function Wao(t,e){return ze.IsNot(t)?Yc(Njr(t),e):ze.IsNot(e)?Yc(t,Njr(e)):Oie("Invalid fallthrough for Not")}a(Wao,"FromNot");function zao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsNull(e)?xt.True:xt.False}a(zao,"FromNull");function Qjr(t,e){return ze.IsLiteralNumber(t)||ze.IsNumber(t)||ze.IsInteger(t)?xt.True:xt.False}a(Qjr,"FromNumberRight");function Yao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsInteger(e)||ze.IsNumber(e)?xt.True:xt.False}a(Yao,"FromNumber");function zC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(zC,"IsObjectPropertyCount");function Mjr(t){return P6e(t)}a(Mjr,"IsObjectStringLike");function Ojr(t){return zC(t,0)||zC(t,1)&&"description"in t.properties&&ze.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(ze.IsString(t.properties.description.anyOf[0])&&ze.IsUndefined(t.properties.description.anyOf[1])||ze.IsString(t.properties.description.anyOf[1])&&ze.IsUndefined(t.properties.description.anyOf[0]))}a(Ojr,"IsObjectSymbolLike");function uRt(t){return zC(t,0)}a(uRt,"IsObjectNumberLike");function Bjr(t){return zC(t,0)}a(Bjr,"IsObjectBooleanLike");function Kao(t){return zC(t,0)}a(Kao,"IsObjectBigIntLike");function Jao(t){return zC(t,0)}a(Jao,"IsObjectDateLike");function Zao(t){return P6e(t)}a(Zao,"IsObjectUint8ArrayLike");function Xao(t){let e=TI();return zC(t,0)||zC(t,1)&&"length"in t.properties&&RI(Yc(t.properties.length,e))===xt.True}a(Xao,"IsObjectFunctionLike");function eco(t){return zC(t,0)}a(eco,"IsObjectConstructorLike");function P6e(t){let e=TI();return zC(t,0)||zC(t,1)&&"length"in t.properties&&RI(Yc(t.properties.length,e))===xt.True}a(P6e,"IsObjectArrayLike");function tco(t){let e=TN([O9()],O9());return zC(t,0)||zC(t,1)&&"then"in t.properties&&RI(Yc(t.properties.then,e))===xt.True}a(tco,"IsObjectPromiseLike");function qjr(t,e){return Yc(t,e)===xt.False||ze.IsOptional(t)&&!ze.IsOptional(e)?xt.False:xt.True}a(qjr,"Property");function yy(t,e){return ze.IsUnknown(t)?xt.False:ze.IsAny(t)?xt.Union:ze.IsNever(t)||ze.IsLiteralString(t)&&Mjr(e)||ze.IsLiteralNumber(t)&&uRt(e)||ze.IsLiteralBoolean(t)&&Bjr(e)||ze.IsSymbol(t)&&Ojr(e)||ze.IsBigInt(t)&&Kao(e)||ze.IsString(t)&&Mjr(e)||ze.IsSymbol(t)&&Ojr(e)||ze.IsNumber(t)&&uRt(e)||ze.IsInteger(t)&&uRt(e)||ze.IsBoolean(t)&&Bjr(e)||ze.IsUint8Array(t)&&Zao(e)||ze.IsDate(t)&&Jao(e)||ze.IsConstructor(t)&&eco(e)||ze.IsFunction(t)&&Xao(e)?xt.True:ze.IsRecord(t)&&ze.IsString(fRt(t))?e[SI]==="Record"?xt.True:xt.False:ze.IsRecord(t)&&ze.IsNumber(fRt(t))&&zC(e,0)?xt.True:xt.False}a(yy,"FromObjectRight");function rco(t,e){return ph(e)?hh(t,e):ze.IsRecord(e)?kI(t,e):ze.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!ze.IsOptional(e.properties[r]))return xt.False;if(ze.IsOptional(e.properties[r]))return xt.True;if(qjr(t.properties[r],e.properties[r])===xt.False)return xt.False}return xt.True})():xt.False}a(rco,"FromObject");function nco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)&&tco(e)?xt.True:ze.IsPromise(e)?RI(Yc(t.item,e.item)):xt.False}a(nco,"FromPromise");function fRt(t){return N9 in t.patternProperties?TI():M9 in t.patternProperties?o_():Oie("Unknown record key pattern")}a(fRt,"RecordKey");function pRt(t){return N9 in t.patternProperties?t.patternProperties[N9]:M9 in t.patternProperties?t.patternProperties[M9]:Oie("Unable to get record value schema")}a(pRt,"RecordValue");function kI(t,e){let[r,n]=[fRt(e),pRt(e)];return ze.IsLiteralString(t)&&ze.IsNumber(r)&&RI(Yc(t,n))===xt.True?xt.True:ze.IsUint8Array(t)&&ze.IsNumber(r)||ze.IsString(t)&&ze.IsNumber(r)||ze.IsArray(t)&&ze.IsNumber(r)?Yc(t,n):ze.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(qjr(n,t.properties[o])===xt.False)return xt.False;return xt.True})():xt.False}a(kI,"FromRecordRight");function ico(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?Yc(pRt(t),pRt(e)):xt.False}a(ico,"FromRecord");function oco(t,e){let r=ze.IsRegExp(t)?o_():t,n=ze.IsRegExp(e)?o_():e;return Yc(r,n)}a(oco,"FromRegExp");function jjr(t,e){return ze.IsLiteral(t)&&my.IsString(t.const)||ze.IsString(t)?xt.True:xt.False}a(jjr,"FromStringRight");function sco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsString(e)?xt.True:xt.False}a(sco,"FromString");function aco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsSymbol(e)?xt.True:xt.False}a(aco,"FromSymbol");function cco(t,e){return ze.IsTemplateLiteral(t)?Yc(JV(t),e):ze.IsTemplateLiteral(e)?Yc(t,JV(e)):Oie("Invalid fallthrough for TemplateLiteral")}a(cco,"FromTemplateLiteral");function lco(t,e){return ze.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Yc(r,e.items)===xt.True)}a(lco,"IsArrayOfTuple");function uco(t,e){return ze.IsNever(t)?xt.True:ze.IsUnknown(t)?xt.False:ze.IsAny(t)?xt.Union:xt.False}a(uco,"FromTupleRight");function dco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)&&P6e(e)||ze.IsArray(e)&&lco(t,e)?xt.True:ze.IsTuple(e)?my.IsUndefined(t.items)&&!my.IsUndefined(e.items)||!my.IsUndefined(t.items)&&my.IsUndefined(e.items)?xt.False:my.IsUndefined(t.items)&&!my.IsUndefined(e.items)||t.items.every((r,n)=>Yc(r,e.items[n])===xt.True)?xt.True:xt.False:xt.False}a(dco,"FromTuple");function fco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsUint8Array(e)?xt.True:xt.False}a(fco,"FromUint8Array");function pco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsVoid(e)?gco(t,e):ze.IsUndefined(e)?xt.True:xt.False}a(pco,"FromUndefined");function mRt(t,e){return e.anyOf.some(r=>Yc(t,r)===xt.True)?xt.True:xt.False}a(mRt,"FromUnionRight");function hco(t,e){return t.anyOf.every(r=>Yc(r,e)===xt.True)?xt.True:xt.False}a(hco,"FromUnion");function Hjr(t,e){return xt.True}a(Hjr,"FromUnknownRight");function mco(t,e){return ze.IsNever(e)?Ujr(t,e):ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)?mRt(t,e):ze.IsAny(e)?hRt(t,e):ze.IsString(e)?jjr(t,e):ze.IsNumber(e)?Qjr(t,e):ze.IsInteger(e)?Fjr(t,e):ze.IsBoolean(e)?Ljr(t,e):ze.IsArray(e)?Mao(t,e):ze.IsTuple(e)?uco(t,e):ze.IsObject(e)?yy(t,e):ze.IsUnknown(e)?xt.True:xt.False}a(mco,"FromUnknown");function gco(t,e){return ze.IsUndefined(t)||ze.IsUndefined(t)?xt.True:xt.False}a(gco,"FromVoidRight");function Aco(t,e){return ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)?mRt(t,e):ze.IsUnknown(e)?Hjr(t,e):ze.IsAny(e)?hRt(t,e):ze.IsObject(e)?yy(t,e):ze.IsVoid(e)?xt.True:xt.False}a(Aco,"FromVoid");function Yc(t,e){return ze.IsTemplateLiteral(t)||ze.IsTemplateLiteral(e)?cco(t,e):ze.IsRegExp(t)||ze.IsRegExp(e)?oco(t,e):ze.IsNot(t)||ze.IsNot(e)?Wao(t,e):ze.IsAny(t)?Nao(t,e):ze.IsArray(t)?Oao(t,e):ze.IsBigInt(t)?Lao(t,e):ze.IsBoolean(t)?Fao(t,e):ze.IsAsyncIterator(t)?Bao(t,e):ze.IsConstructor(t)?Uao(t,e):ze.IsDate(t)?Qao(t,e):ze.IsFunction(t)?qao(t,e):ze.IsInteger(t)?jao(t,e):ze.IsIntersect(t)?Hao(t,e):ze.IsIterator(t)?Gao(t,e):ze.IsLiteral(t)?$ao(t,e):ze.IsNever(t)?Vao(t,e):ze.IsNull(t)?zao(t,e):ze.IsNumber(t)?Yao(t,e):ze.IsObject(t)?rco(t,e):ze.IsRecord(t)?ico(t,e):ze.IsString(t)?sco(t,e):ze.IsSymbol(t)?aco(t,e):ze.IsTuple(t)?dco(t,e):ze.IsPromise(t)?nco(t,e):ze.IsUint8Array(t)?fco(t,e):ze.IsUndefined(t)?pco(t,e):ze.IsUnion(t)?hco(t,e):ze.IsUnknown(t)?mco(t,e):ze.IsVoid(t)?Aco(t,e):Oie(`Unknown left type operand '${t[_t]}'`)}a(Yc,"Visit");function L9(t,e){return Yc(t,e)}a(L9,"ExtendsCheck");p();p();p();function yco(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Bie(t[c],e,r,n,Pu(o));return s}a(yco,"FromProperties");function Eco(t,e,r,n,o){return yco(t.properties,e,r,n,o)}a(Eco,"FromMappedResult");function Gjr(t,e,r,n,o){let s=Eco(t,e,r,n,o);return Ua(s)}a(Gjr,"ExtendsFromMappedResult");function _co(t,e,r,n){let o=L9(t,e);return o===xt.Union?Xa([r,n]):o===xt.True?r:n}a(_co,"ExtendsResolve");function Bie(t,e,r,n,o){return Nu(t)?Gjr(t,e,r,n,o):I1(t)?Tt($jr(t,e,r,n,o)):Tt(_co(t,e,r,n),o)}a(Bie,"Extends");function Cco(t,e,r,n,o){return{[t]:Bie(oa(t),e,r,n,Pu(o))}}a(Cco,"FromPropertyKey");function vco(t,e,r,n,o){return t.reduce((s,c)=>({...s,...Cco(c,e,r,n,o)}),{})}a(vco,"FromPropertyKeys");function bco(t,e,r,n,o){return vco(t.keys,e,r,n,o)}a(bco,"FromMappedKey");function $jr(t,e,r,n,o){let s=bco(t,e,r,n,o);return Ua(s)}a($jr,"ExtendsFromMappedKey");p();function Sco(t){return t.allOf.every(e=>LB(e))}a(Sco,"Intersect");function Tco(t){return t.anyOf.some(e=>LB(e))}a(Tco,"Union");function Ico(t){return!LB(t.not)}a(Ico,"Not");function LB(t){return t[_t]==="Intersect"?Sco(t):t[_t]==="Union"?Tco(t):t[_t]==="Not"?Ico(t):t[_t]==="Undefined"}a(LB,"ExtendsUndefinedCheck");p();function Vjr(t,e){return Lie(JV(t),e)}a(Vjr,"ExcludeFromTemplateLiteral");function xco(t,e){let r=t.filter(n=>L9(n,e)===xt.False);return r.length===1?r[0]:Xa(r)}a(xco,"ExcludeRest");function Lie(t,e,r={}){return x1(t)?Tt(Vjr(t,e),r):Nu(t)?Tt(Wjr(t,e),r):Tt(ba(t)?xco(t.anyOf,e):L9(t,e)!==xt.False?Ko():t,r)}a(Lie,"Exclude");function wco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Lie(t[n],e);return r}a(wco,"FromProperties");function Rco(t,e){return wco(t.properties,e)}a(Rco,"FromMappedResult");function Wjr(t,e){let r=Rco(t,e);return Ua(r)}a(Wjr,"ExcludeFromMappedResult");p();p();p();function zjr(t,e){return Fie(JV(t),e)}a(zjr,"ExtractFromTemplateLiteral");function kco(t,e){let r=t.filter(n=>L9(n,e)!==xt.False);return r.length===1?r[0]:Xa(r)}a(kco,"ExtractRest");function Fie(t,e,r){return x1(t)?Tt(zjr(t,e),r):Nu(t)?Tt(Yjr(t,e),r):Tt(ba(t)?kco(t.anyOf,e):L9(t,e)!==xt.False?t:Ko(),r)}a(Fie,"Extract");function Pco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Fie(t[n],e);return r}a(Pco,"FromProperties");function Dco(t,e){return Pco(t.properties,e)}a(Dco,"FromMappedResult");function Yjr(t,e){let r=Dco(t,e);return Ua(r)}a(Yjr,"ExtractFromMappedResult");p();function Kjr(t,e){return uk(t)?Tt(t.returns,e):Ko(e)}a(Kjr,"InstanceType");p();p();function D6e(t){return VC(gy(t))}a(D6e,"ReadonlyOptional");p();function ZV(t,e,r){return Tt({[_t]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(ZV,"RecordCreateFromPattern");function gRt(t,e,r){let n={};for(let o of t)n[o]=e;return ec(n,{...r,[SI]:"Record"})}a(gRt,"RecordCreateFromKeys");function Nco(t,e,r){return y6e(t)?gRt($C(t),e,r):ZV(t.pattern,e,r)}a(Nco,"FromTemplateLiteralKey");function Mco(t,e,r){return gRt($C(Xa(t)),e,r)}a(Mco,"FromUnionKey");function Oco(t,e,r){return gRt([t.toString()],e,r)}a(Oco,"FromLiteralKey");function Bco(t,e,r){return ZV(t.source,e,r)}a(Bco,"FromRegExpKey");function Lco(t,e,r){let n=Tp(t.pattern)?M9:t.pattern;return ZV(n,e,r)}a(Lco,"FromStringKey");function Fco(t,e,r){return ZV(M9,e,r)}a(Fco,"FromAnyKey");function Uco(t,e,r){return ZV(ojr,e,r)}a(Uco,"FromNeverKey");function Qco(t,e,r){return ec({true:e,false:e},r)}a(Qco,"FromBooleanKey");function qco(t,e,r){return ZV(N9,e,r)}a(qco,"FromIntegerKey");function jco(t,e,r){return ZV(N9,e,r)}a(jco,"FromNumberKey");function N6e(t,e,r={}){return ba(t)?Mco(t.anyOf,e,r):x1(t)?Nco(t,e,r):T1(t)?Oco(t.const,e,r):PB(t)?Qco(t,e,r):fk(t)?qco(t,e,r):pk(t)?jco(t,e,r):Ywt(t)?Bco(t,e,r):DB(t)?Lco(t,e,r):Wwt(t)?Fco(t,e,r):P9(t)?Uco(t,e,r):Ko(r)}a(N6e,"Record");function M6e(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(M6e,"RecordPattern");function Jjr(t){let e=M6e(t);return e===M9?o_():e===N9?TI():o_({pattern:e})}a(Jjr,"RecordKey");function O6e(t){return t.patternProperties[M6e(t)]}a(O6e,"RecordValue");function Hco(t,e){return e.parameters=TCe(t,e.parameters),e.returns=gk(t,e.returns),e}a(Hco,"FromConstructor");function Gco(t,e){return e.parameters=TCe(t,e.parameters),e.returns=gk(t,e.returns),e}a(Gco,"FromFunction");function $co(t,e){return e.allOf=TCe(t,e.allOf),e}a($co,"FromIntersect");function Vco(t,e){return e.anyOf=TCe(t,e.anyOf),e}a(Vco,"FromUnion");function Wco(t,e){return Tp(e.items)||(e.items=TCe(t,e.items)),e}a(Wco,"FromTuple");function zco(t,e){return e.items=gk(t,e.items),e}a(zco,"FromArray");function Yco(t,e){return e.items=gk(t,e.items),e}a(Yco,"FromAsyncIterator");function Kco(t,e){return e.items=gk(t,e.items),e}a(Kco,"FromIterator");function Jco(t,e){return e.item=gk(t,e.item),e}a(Jco,"FromPromise");function Zco(t,e){let r=rlo(t,e.properties);return{...e,...ec(r)}}a(Zco,"FromObject");function Xco(t,e){let r=gk(t,Jjr(e)),n=gk(t,O6e(e)),o=N6e(r,n);return{...e,...o}}a(Xco,"FromRecord");function elo(t,e){return e.index in t?t[e.index]:mk()}a(elo,"FromArgument");function tlo(t,e){let r=vie(e),n=GC(e),o=gk(t,e);return r&&n?D6e(o):r&&!n?VC(o):!r&&n?gy(o):o}a(tlo,"FromProperty");function rlo(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:tlo(t,e[n])}),{})}a(rlo,"FromProperties");function TCe(t,e){return e.map(r=>gk(t,r))}a(TCe,"FromTypes");function gk(t,e){return uk(e)?Hco(t,e):dk(e)?Gco(t,e):Zd(e)?$co(t,e):ba(e)?Vco(t,e):w1(e)?Wco(t,e):ck(e)?zco(t,e):$V(e)?Yco(t,e):WV(e)?Kco(t,e):zV(e)?Jco(t,e):Ip(e)?Zco(t,e):YV(e)?Xco(t,e):zwt(e)?elo(t,e):e}a(gk,"FromType");function Zjr(t,e){return gk(e,_ie(t))}a(Zjr,"Instantiate");p();function Xjr(t){return Tt({[_t]:"Integer",type:"integer"},t)}a(Xjr,"Integer");p();p();p();function nlo(t,e,r){return{[t]:Ak(oa(t),e,Pu(r))}}a(nlo,"MappedIntrinsicPropertyKey");function ilo(t,e,r){return t.reduce((o,s)=>({...o,...nlo(s,e,r)}),{})}a(ilo,"MappedIntrinsicPropertyKeys");function olo(t,e,r){return ilo(t.keys,e,r)}a(olo,"MappedIntrinsicProperties");function eHr(t,e,r){let n=olo(t,e,r);return Ua(n)}a(eHr,"IntrinsicFromMappedKey");function slo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(slo,"ApplyUncapitalize");function alo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(alo,"ApplyCapitalize");function clo(t){return t.toUpperCase()}a(clo,"ApplyUppercase");function llo(t){return t.toLowerCase()}a(llo,"ApplyLowercase");function ulo(t,e,r){let n=Rie(t.pattern);if(!KV(n))return{...t,pattern:tHr(t.pattern,e)};let c=[...CCe(n)].map(d=>oa(d)),l=rHr(c,e),u=Xa(l);return _6e([u],r)}a(ulo,"FromTemplateLiteral");function tHr(t,e){return typeof t=="string"?e==="Uncapitalize"?slo(t):e==="Capitalize"?alo(t):e==="Uppercase"?clo(t):e==="Lowercase"?llo(t):t:t.toString()}a(tHr,"FromLiteralValue");function rHr(t,e){return t.map(r=>Ak(r,e))}a(rHr,"FromRest");function Ak(t,e,r={}){return I1(t)?eHr(t,e,r):x1(t)?ulo(t,e,r):ba(t)?Xa(rHr(t.anyOf,e),r):T1(t)?oa(tHr(t.const,e),r):Tt(t,r)}a(Ak,"Intrinsic");function nHr(t,e={}){return Ak(t,"Capitalize",e)}a(nHr,"Capitalize");p();function iHr(t,e={}){return Ak(t,"Lowercase",e)}a(iHr,"Lowercase");p();function oHr(t,e={}){return Ak(t,"Uncapitalize",e)}a(oHr,"Uncapitalize");p();function sHr(t,e={}){return Ak(t,"Uppercase",e)}a(sHr,"Uppercase");p();p();p();p();p();function dlo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=F9(t[o],e,Pu(r));return n}a(dlo,"FromProperties");function flo(t,e,r){return dlo(t.properties,e,r)}a(flo,"FromMappedResult");function aHr(t,e,r){let n=flo(t,e,r);return Ua(n)}a(aHr,"OmitFromMappedResult");function plo(t,e){return t.map(r=>ARt(r,e))}a(plo,"FromIntersect");function hlo(t,e){return t.map(r=>ARt(r,e))}a(hlo,"FromUnion");function mlo(t,e){let{[e]:r,...n}=t;return n}a(mlo,"FromProperty");function glo(t,e){return e.reduce((r,n)=>mlo(r,n),t)}a(glo,"FromProperties");function Alo(t,e,r){let n=Xd(t,[Cd,"$id","required","properties"]),o=glo(r,e);return ec(o,n)}a(Alo,"FromObject");function ylo(t){let e=t.reduce((r,n)=>m6e(n)?[...r,oa(n)]:r,[]);return Xa(e)}a(ylo,"UnionFromPropertyKeys");function ARt(t,e){return Zd(t)?Ay(plo(t.allOf,e)):ba(t)?Xa(hlo(t.anyOf,e)):Ip(t)?Alo(t,e,t.properties):ec({})}a(ARt,"OmitResolve");function F9(t,e,r){let n=Sp(e)?ylo(e):e,o=vd(e)?$C(e):e,s=Mf(t),c=Mf(e);return Nu(t)?aHr(t,o,r):I1(e)?cHr(t,e,r):s&&c?tu("Omit",[t,n],r):!s&&c?tu("Omit",[t,n],r):s&&!c?tu("Omit",[t,n],r):Tt({...ARt(t,o),...r})}a(F9,"Omit");function Elo(t,e,r){return{[e]:F9(t,[e],Pu(r))}}a(Elo,"FromPropertyKey");function _lo(t,e,r){return e.reduce((n,o)=>({...n,...Elo(t,o,r)}),{})}a(_lo,"FromPropertyKeys");function Clo(t,e,r){return _lo(t,e.keys,r)}a(Clo,"FromMappedKey");function cHr(t,e,r){let n=Clo(t,e,r);return Ua(n)}a(cHr,"OmitFromMappedKey");p();p();p();function vlo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=U9(t[o],e,Pu(r));return n}a(vlo,"FromProperties");function blo(t,e,r){return vlo(t.properties,e,r)}a(blo,"FromMappedResult");function lHr(t,e,r){let n=blo(t,e,r);return Ua(n)}a(lHr,"PickFromMappedResult");function Slo(t,e){return t.map(r=>yRt(r,e))}a(Slo,"FromIntersect");function Tlo(t,e){return t.map(r=>yRt(r,e))}a(Tlo,"FromUnion");function Ilo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(Ilo,"FromProperties");function xlo(t,e,r){let n=Xd(t,[Cd,"$id","required","properties"]),o=Ilo(r,e);return ec(o,n)}a(xlo,"FromObject");function wlo(t){let e=t.reduce((r,n)=>m6e(n)?[...r,oa(n)]:r,[]);return Xa(e)}a(wlo,"UnionFromPropertyKeys");function yRt(t,e){return Zd(t)?Ay(Slo(t.allOf,e)):ba(t)?Xa(Tlo(t.anyOf,e)):Ip(t)?xlo(t,e,t.properties):ec({})}a(yRt,"PickResolve");function U9(t,e,r){let n=Sp(e)?wlo(e):e,o=vd(e)?$C(e):e,s=Mf(t),c=Mf(e);return Nu(t)?lHr(t,o,r):I1(e)?uHr(t,e,r):s&&c?tu("Pick",[t,n],r):!s&&c?tu("Pick",[t,n],r):s&&!c?tu("Pick",[t,n],r):Tt({...yRt(t,o),...r})}a(U9,"Pick");function Rlo(t,e,r){return{[e]:U9(t,[e],Pu(r))}}a(Rlo,"FromPropertyKey");function klo(t,e,r){return e.reduce((n,o)=>({...n,...Rlo(t,o,r)}),{})}a(klo,"FromPropertyKeys");function Plo(t,e,r){return klo(t,e.keys,r)}a(Plo,"FromMappedKey");function uHr(t,e,r){let n=Plo(t,e,r);return Ua(n)}a(uHr,"PickFromMappedKey");p();p();function Dlo(t,e){return tu("Partial",[tu(t,e)])}a(Dlo,"FromComputed");function Nlo(t){return tu("Partial",[wI(t)])}a(Nlo,"FromRef");function Mlo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=gy(t[r]);return e}a(Mlo,"FromProperties");function Olo(t,e){let r=Xd(t,[Cd,"$id","required","properties"]),n=Mlo(e);return ec(n,r)}a(Olo,"FromObject");function dHr(t){return t.map(e=>fHr(e))}a(dHr,"FromRest");function fHr(t){return lk(t)?Dlo(t.target,t.parameters):Mf(t)?Nlo(t.$ref):Zd(t)?Ay(dHr(t.allOf)):ba(t)?Xa(dHr(t.anyOf)):Ip(t)?Olo(t,t.properties):VV(t)||PB(t)||fk(t)||T1(t)||hCe(t)||pk(t)||DB(t)||mCe(t)||NB(t)?t:ec({})}a(fHr,"PartialResolve");function Uie(t,e){return Nu(t)?pHr(t,e):Tt({...fHr(t),...e})}a(Uie,"Partial");function Blo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Uie(t[n],Pu(e));return r}a(Blo,"FromProperties");function Llo(t,e){return Blo(t.properties,e)}a(Llo,"FromMappedResult");function pHr(t,e){let r=Llo(t,e);return Ua(r)}a(pHr,"PartialFromMappedResult");p();p();function Flo(t,e){return tu("Required",[tu(t,e)])}a(Flo,"FromComputed");function Ulo(t){return tu("Required",[wI(t)])}a(Ulo,"FromRef");function Qlo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Xd(t[r],[zg]);return e}a(Qlo,"FromProperties");function qlo(t,e){let r=Xd(t,[Cd,"$id","required","properties"]),n=Qlo(e);return ec(n,r)}a(qlo,"FromObject");function hHr(t){return t.map(e=>mHr(e))}a(hHr,"FromRest");function mHr(t){return lk(t)?Flo(t.target,t.parameters):Mf(t)?Ulo(t.$ref):Zd(t)?Ay(hHr(t.allOf)):ba(t)?Xa(hHr(t.anyOf)):Ip(t)?qlo(t,t.properties):VV(t)||PB(t)||fk(t)||T1(t)||hCe(t)||pk(t)||DB(t)||mCe(t)||NB(t)?t:ec({})}a(mHr,"RequiredResolve");function Qie(t,e){return Nu(t)?gHr(t,e):Tt({...mHr(t),...e})}a(Qie,"Required");function jlo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qie(t[n],e);return r}a(jlo,"FromProperties");function Hlo(t,e){return jlo(t.properties,e)}a(Hlo,"FromMappedResult");function gHr(t,e){let r=Hlo(t,e);return Ua(r)}a(gHr,"RequiredFromMappedResult");function Glo(t,e){return e.map(r=>Mf(r)?ERt(t,r.$ref):R1(t,r))}a(Glo,"DereferenceParameters");function ERt(t,e){return e in t?Mf(t[e])?ERt(t,t[e].$ref):R1(t,t[e]):Ko()}a(ERt,"Dereference");function $lo(t){return Nie(t[0])}a($lo,"FromAwaited");function Vlo(t){return B9(t[0],t[1])}a(Vlo,"FromIndex");function Wlo(t){return Mie(t[0])}a(Wlo,"FromKeyOf");function zlo(t){return Uie(t[0])}a(zlo,"FromPartial");function Ylo(t){return F9(t[0],t[1])}a(Ylo,"FromOmit");function Klo(t){return U9(t[0],t[1])}a(Klo,"FromPick");function Jlo(t){return Qie(t[0])}a(Jlo,"FromRequired");function Zlo(t,e,r){let n=Glo(t,r);return e==="Awaited"?$lo(n):e==="Index"?Vlo(n):e==="KeyOf"?Wlo(n):e==="Partial"?zlo(n):e==="Omit"?Ylo(n):e==="Pick"?Klo(n):e==="Required"?Jlo(n):Ko()}a(Zlo,"FromComputed");function Xlo(t,e){return Tie(R1(t,e))}a(Xlo,"FromArray");function euo(t,e){return Iie(R1(t,e))}a(euo,"FromAsyncIterator");function tuo(t,e,r){return xie(ICe(t,e),R1(t,r))}a(tuo,"FromConstructor");function ruo(t,e,r){return TN(ICe(t,e),R1(t,r))}a(ruo,"FromFunction");function nuo(t,e){return Ay(ICe(t,e))}a(nuo,"FromIntersect");function iuo(t,e){return Die(R1(t,e))}a(iuo,"FromIterator");function ouo(t,e){return ec(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:R1(t,e[n])}),{}))}a(ouo,"FromObject");function suo(t,e){let[r,n]=[R1(t,O6e(e)),M6e(e)],o=_ie(e);return o.patternProperties[n]=r,o}a(suo,"FromRecord");function auo(t,e){return Mf(e)?{...ERt(t,e.$ref),[Cd]:e[Cd]}:e}a(auo,"FromTransform");function cuo(t,e){return II(ICe(t,e))}a(cuo,"FromTuple");function luo(t,e){return Xa(ICe(t,e))}a(luo,"FromUnion");function ICe(t,e){return e.map(r=>R1(t,r))}a(ICe,"FromTypes");function R1(t,e){return GC(e)?Tt(R1(t,Xd(e,[zg])),e):vie(e)?Tt(R1(t,Xd(e,[ak])),e):Za(e)?Tt(auo(t,e),e):ck(e)?Tt(Xlo(t,e.items),e):$V(e)?Tt(euo(t,e.items),e):lk(e)?Tt(Zlo(t,e.target,e.parameters)):uk(e)?Tt(tuo(t,e.parameters,e.returns),e):dk(e)?Tt(ruo(t,e.parameters,e.returns),e):Zd(e)?Tt(nuo(t,e.allOf),e):WV(e)?Tt(iuo(t,e.items),e):Ip(e)?Tt(ouo(t,e.properties),e):YV(e)?Tt(suo(t,e)):w1(e)?Tt(cuo(t,e.items||[]),e):ba(e)?Tt(luo(t,e.anyOf),e):e}a(R1,"FromType");function uuo(t,e){return e in t?R1(t,t[e]):Ko()}a(uuo,"ComputeType");function AHr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:uuo(t,r)}),{})}a(AHr,"ComputeModuleProperties");var _Rt=class{static{a(this,"TModule")}constructor(e){let r=AHr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:Tt(this.$defs[e],r)};return Tt({[_t]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function yHr(t){return new _Rt(t)}a(yHr,"Module");p();function EHr(t,e){return Tt({[_t]:"Not",not:t},e)}a(EHr,"Not");p();function _Hr(t,e){return dk(t)?II(t.parameters,e):Ko()}a(_Hr,"Parameters");p();var duo=0;function CHr(t,e={}){Tp(e.$id)&&(e.$id=`T${duo++}`);let r=_ie(t({[_t]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,Tt({[SI]:"Recursive",...r},e)}a(CHr,"Recursive");p();function vHr(t,e){let r=Ol(t)?new globalThis.RegExp(t):t;return Tt({[_t]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(vHr,"RegExp");p();function fuo(t){return Zd(t)?t.allOf:ba(t)?t.anyOf:w1(t)?t.items??[]:[]}a(fuo,"RestResolve");function bHr(t){return fuo(t)}a(bHr,"Rest");p();function SHr(t,e){return dk(t)?Tt(t.returns,e):Ko(e)}a(SHr,"ReturnType");p();var CRt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new vRt(this.schema,e)}},vRt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Cd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Cd].Decode(c)),"Decode")};return{...r,[Cd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Cd]:n}}Encode(e){return Za(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function THr(t){return new CRt(t)}a(THr,"Transform");p();function IHr(t={}){return Tt({[_t]:t[_t]??"Unsafe"},t)}a(IHr,"Unsafe");p();function xHr(t){return Tt({[_t]:"Void",type:"void"},t)}a(xHr,"Void");p();var bRt={};wi(bRt,{Any:()=>O9,Argument:()=>ujr,Array:()=>Tie,AsyncIterator:()=>Iie,Awaited:()=>Nie,BigInt:()=>Pie,Boolean:()=>E6e,Capitalize:()=>nHr,Composite:()=>Rjr,Const:()=>kjr,Constructor:()=>xie,ConstructorParameters:()=>Pjr,Date:()=>S6e,Enum:()=>Djr,Exclude:()=>Lie,Extends:()=>Bie,Extract:()=>Fie,Function:()=>TN,Index:()=>B9,InstanceType:()=>Kjr,Instantiate:()=>Zjr,Integer:()=>Xjr,Intersect:()=>Ay,Iterator:()=>Die,KeyOf:()=>Mie,Literal:()=>oa,Lowercase:()=>iHr,Mapped:()=>bjr,Module:()=>yHr,Never:()=>Ko,Not:()=>EHr,Null:()=>T6e,Number:()=>TI,Object:()=>ec,Omit:()=>F9,Optional:()=>gy,Parameters:()=>_Hr,Partial:()=>Uie,Pick:()=>U9,Promise:()=>v6e,Readonly:()=>VC,ReadonlyOptional:()=>D6e,Record:()=>N6e,Recursive:()=>CHr,Ref:()=>wI,RegExp:()=>vHr,Required:()=>Qie,Rest:()=>bHr,ReturnType:()=>SHr,String:()=>o_,Symbol:()=>I6e,TemplateLiteral:()=>_6e,Transform:()=>THr,Tuple:()=>II,Uint8Array:()=>w6e,Uncapitalize:()=>oHr,Undefined:()=>x6e,Union:()=>Xa,Unknown:()=>mk,Unsafe:()=>IHr,Uppercase:()=>sHr,Void:()=>xHr});p();var S=bRt;p();p();function puo(t){switch(t.errorType){case Et.ArrayContains:return"Expected array to contain at least one matching value";case Et.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case Et.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case Et.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case Et.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case Et.ArrayUniqueItems:return"Expected array elements to be unique";case Et.Array:return"Expected array";case Et.AsyncIterator:return"Expected AsyncIterator";case Et.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case Et.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case Et.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case Et.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case Et.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case Et.BigInt:return"Expected bigint";case Et.Boolean:return"Expected boolean";case Et.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case Et.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case Et.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case Et.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case Et.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case Et.Date:return"Expected Date";case Et.Function:return"Expected function";case Et.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case Et.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case Et.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case Et.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case Et.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case Et.Integer:return"Expected integer";case Et.IntersectUnevaluatedProperties:return"Unexpected property";case Et.Intersect:return"Expected all values to match";case Et.Iterator:return"Expected Iterator";case Et.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case Et.Never:return"Never";case Et.Not:return"Value should not match";case Et.Null:return"Expected null";case Et.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case Et.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case Et.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case Et.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case Et.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case Et.Number:return"Expected number";case Et.Object:return"Expected object";case Et.ObjectAdditionalProperties:return"Unexpected property";case Et.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case Et.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case Et.ObjectRequiredProperty:return"Expected required property";case Et.Promise:return"Expected Promise";case Et.RegExp:return"Expected string to match regular expression";case Et.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case Et.StringFormat:return`Expected string to match '${t.schema.format}' format`;case Et.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case Et.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case Et.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case Et.String:return"Expected string";case Et.Symbol:return"Expected symbol";case Et.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case Et.Tuple:return"Expected tuple";case Et.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case Et.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case Et.Uint8Array:return"Expected Uint8Array";case Et.Undefined:return"Expected undefined";case Et.Union:return"Expected union value";case Et.Void:return"Expected void";case Et.Kind:return`Expected kind '${t.schema[_t]}'`;default:return"Unknown error type"}}a(puo,"DefaultErrorFunction");var huo=puo;function wHr(){return huo}a(wHr,"GetErrorFunction");p();var SRt=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function muo(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new SRt(t);return Sa(r,e)}a(muo,"Resolve");function Dm(t,e){return!va(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Dm,"Pushref");function Sa(t,e){return t[_t]==="This"||t[_t]==="Ref"?muo(t,e):t}a(Sa,"Deref");p();var TRt=class extends qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},k1;(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"})(k1||(k1={}));var qie=BigInt("14695981039346656037"),[guo,Auo]=[BigInt("1099511628211"),BigInt("18446744073709551616")],yuo=Array.from({length:256}).map((t,e)=>BigInt(e)),RHr=new Float64Array(1),kHr=new DataView(RHr.buffer),PHr=new Uint8Array(RHr.buffer);function*Euo(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(Euo,"NumberToBytes");function _uo(t){Ey(k1.Array);for(let e of t)jie(e)}a(_uo,"ArrayType");function Cuo(t){Ey(k1.Boolean),Ey(t?1:0)}a(Cuo,"BooleanType");function vuo(t){Ey(k1.BigInt),kHr.setBigInt64(0,t);for(let e of PHr)Ey(e)}a(vuo,"BigIntType");function buo(t){Ey(k1.Date),jie(t.getTime())}a(buo,"DateType");function Suo(t){Ey(k1.Null)}a(Suo,"NullType");function Tuo(t){Ey(k1.Number),kHr.setFloat64(0,t);for(let e of PHr)Ey(e)}a(Tuo,"NumberType");function Iuo(t){Ey(k1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())jie(e),jie(t[e])}a(Iuo,"ObjectType");function xuo(t){Ey(k1.String);for(let e=0;e=t.minItems)||Gs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Nm(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=Q9(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(Gs(t.contains)||oi(t.minContains)||oi(t.maxContains)))return!0;let n=Gs(t.contains)?t.contains:Ko(),o=r.reduce((s,c)=>Nm(n,e,c)?s+1:s,0);return!(o===0||oi(t.minContains)&&ot.maxContains)}a(Muo,"FromArray");function Ouo(t,e,r){return d6e(r)}a(Ouo,"FromAsyncIterator");function Buo(t,e,r){return!(!Wg(r)||Gs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Gs(t.maximum)&&!(r<=t.maximum)||Gs(t.minimum)&&!(r>=t.minimum)||Gs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(Buo,"FromBigInt");function Luo(t,e,r){return SN(r)}a(Luo,"FromBoolean");function Fuo(t,e,r){return Nm(t.returns,e,r.prototype)}a(Fuo,"FromConstructor");function Uuo(t,e,r){return!(!n_(r)||Gs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||Gs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||Gs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||Gs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Uuo,"FromDate");function Quo(t,e,r){return k9(r)}a(Quo,"FromFunction");function quo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Nm(o,[...e,...n],r)}a(quo,"FromImport");function juo(t,e,r){return!(!h6e(r)||Gs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Gs(t.maximum)&&!(r<=t.maximum)||Gs(t.minimum)&&!(r>=t.minimum)||Gs(t.multipleOf)&&r%t.multipleOf!==0)}a(juo,"FromInteger");function Huo(t,e,r){let n=t.allOf.every(o=>Nm(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(BB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(vd(t.unevaluatedProperties)){let o=new RegExp(BB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Nm(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Huo,"FromIntersect");function Guo(t,e,r){return f6e(r)}a(Guo,"FromIterator");function $uo(t,e,r){return r===t.const}a($uo,"FromLiteral");function Vuo(t,e,r){return!1}a(Vuo,"FromNever");function Wuo(t,e,r){return!Nm(t.not,e,r)}a(Wuo,"FromNot");function zuo(t,e,r){return RB(r)}a(zuo,"FromNull");function Yuo(t,e,r){return!(!eu.IsNumberLike(r)||Gs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Gs(t.minimum)&&!(r>=t.minimum)||Gs(t.maximum)&&!(r<=t.maximum)||Gs(t.multipleOf)&&r%t.multipleOf!==0)}a(Yuo,"FromNumber");function Kuo(t,e,r){if(!eu.IsObjectLike(r)||Gs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Gs(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(!Nm(s,e,r[o])||(LB(s)||Puo(s))&&!(o in r))return!1}else if(eu.IsExactOptionalProperty(r,o)&&!Nm(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)||Nm(t.additionalProperties,e,r[s])):!0}a(Kuo,"FromObject");function Juo(t,e,r){return p6e(r)}a(Juo,"FromPromise");function Zuo(t,e,r){if(!eu.IsRecordLike(r)||Gs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Gs(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)?Nm(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Nm(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Zuo,"FromRecord");function Xuo(t,e,r){return Nm(Sa(t,e),e,r)}a(Xuo,"FromRef");function edo(t,e,r){let n=new RegExp(t.source,t.flags);return Gs(t.minLength)&&!(r.length>=t.minLength)||Gs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(edo,"FromRegExp");function tdo(t,e,r){return!va(r)||Gs(t.minLength)&&!(r.length>=t.minLength)||Gs(t.maxLength)&&!(r.length<=t.maxLength)||Gs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:Gs(t.format)?hk.Has(t.format)?hk.Get(t.format)(r):!1:!0}a(tdo,"FromString");function rdo(t,e,r){return kB(r)}a(rdo,"FromSymbol");function ndo(t,e,r){return va(r)&&new RegExp(t.pattern).test(r)}a(ndo,"FromTemplateLiteral");function ido(t,e,r){return Nm(Sa(t,e),e,r)}a(ido,"FromThis");function odo(t,e,r){if(!Ri(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nNm(n,e,r))}a(ado,"FromUnion");function cdo(t,e,r){return!(!Cie(r)||Gs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||Gs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(cdo,"FromUint8Array");function ldo(t,e,r){return!0}a(ldo,"FromUnknown");function udo(t,e,r){return eu.IsVoidLike(r)}a(udo,"FromVoid");function ddo(t,e,r){return i_.Has(t[_t])?i_.Get(t[_t])(t,r):!1}a(ddo,"FromKind");function Nm(t,e,r){let n=Gs(t.$id)?Dm(t,e):e,o=t;switch(o[_t]){case"Any":return Duo(o,n,r);case"Argument":return Nuo(o,n,r);case"Array":return Muo(o,n,r);case"AsyncIterator":return Ouo(o,n,r);case"BigInt":return Buo(o,n,r);case"Boolean":return Luo(o,n,r);case"Constructor":return Fuo(o,n,r);case"Date":return Uuo(o,n,r);case"Function":return Quo(o,n,r);case"Import":return quo(o,n,r);case"Integer":return juo(o,n,r);case"Intersect":return Huo(o,n,r);case"Iterator":return Guo(o,n,r);case"Literal":return $uo(o,n,r);case"Never":return Vuo(o,n,r);case"Not":return Wuo(o,n,r);case"Null":return zuo(o,n,r);case"Number":return Yuo(o,n,r);case"Object":return Kuo(o,n,r);case"Promise":return Juo(o,n,r);case"Record":return Zuo(o,n,r);case"Ref":return Xuo(o,n,r);case"RegExp":return edo(o,n,r);case"String":return tdo(o,n,r);case"Symbol":return rdo(o,n,r);case"TemplateLiteral":return ndo(o,n,r);case"This":return ido(o,n,r);case"Tuple":return odo(o,n,r);case"Undefined":return sdo(o,n,r);case"Union":return ado(o,n,r);case"Uint8Array":return cdo(o,n,r);case"Unknown":return ldo(o,n,r);case"Void":return udo(o,n,r);default:if(!i_.Has(o[_t]))throw new IRt(o);return ddo(o,n,r)}}a(Nm,"Visit");function Jo(...t){return t.length===3?Nm(t[0],t[1],t[2]):Nm(t[0],[],t[1])}a(Jo,"Check");var Et;(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"})(Et||(Et={}));var xRt=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function FB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(FB,"EscapeKey");function $s(t){return t!==void 0}a($s,"IsDefined");var q9=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 on(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:wHr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(on,"Create");function*fdo(t,e,r,n){}a(fdo,"FromAny");function*pdo(t,e,r,n){}a(pdo,"FromArgument");function*hdo(t,e,r,n){if(!Ri(n))return yield on(Et.Array,t,r,n);$s(t.minItems)&&!(n.length>=t.minItems)&&(yield on(Et.ArrayMinItems,t,r,n)),$s(t.maxItems)&&!(n.length<=t.maxItems)&&(yield on(Et.ArrayMaxItems,t,r,n));for(let c=0;cMm(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield on(Et.ArrayContains,t,r,n)),oi(t.minContains)&&st.maxContains&&(yield on(Et.ArrayMaxContains,t,r,n))}a(hdo,"FromArray");function*mdo(t,e,r,n){d6e(n)||(yield on(Et.AsyncIterator,t,r,n))}a(mdo,"FromAsyncIterator");function*gdo(t,e,r,n){if(!Wg(n))return yield on(Et.BigInt,t,r,n);$s(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(Et.BigIntExclusiveMinimum,t,r,n)),$s(t.maximum)&&!(n<=t.maximum)&&(yield on(Et.BigIntMaximum,t,r,n)),$s(t.minimum)&&!(n>=t.minimum)&&(yield on(Et.BigIntMinimum,t,r,n)),$s(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield on(Et.BigIntMultipleOf,t,r,n))}a(gdo,"FromBigInt");function*Ado(t,e,r,n){SN(n)||(yield on(Et.Boolean,t,r,n))}a(Ado,"FromBoolean");function*ydo(t,e,r,n){yield*Mm(t.returns,e,r,n.prototype)}a(ydo,"FromConstructor");function*Edo(t,e,r,n){if(!n_(n))return yield on(Et.Date,t,r,n);$s(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield on(Et.DateExclusiveMinimumTimestamp,t,r,n)),$s(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield on(Et.DateMaximumTimestamp,t,r,n)),$s(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield on(Et.DateMinimumTimestamp,t,r,n)),$s(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield on(Et.DateMultipleOfTimestamp,t,r,n))}a(Edo,"FromDate");function*_do(t,e,r,n){k9(n)||(yield on(Et.Function,t,r,n))}a(_do,"FromFunction");function*Cdo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Mm(s,[...e,...o],r,n)}a(Cdo,"FromImport");function*vdo(t,e,r,n){if(!h6e(n))return yield on(Et.Integer,t,r,n);$s(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(Et.IntegerExclusiveMinimum,t,r,n)),$s(t.maximum)&&!(n<=t.maximum)&&(yield on(Et.IntegerMaximum,t,r,n)),$s(t.minimum)&&!(n>=t.minimum)&&(yield on(Et.IntegerMinimum,t,r,n)),$s(t.multipleOf)&&n%t.multipleOf!==0&&(yield on(Et.IntegerMultipleOf,t,r,n))}a(vdo,"FromInteger");function*bdo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Mm(s,e,r,n))o=!0,yield c;if(o)return yield on(Et.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(BB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield on(Et.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(BB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Mm(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(bdo,"FromIntersect");function*Sdo(t,e,r,n){f6e(n)||(yield on(Et.Iterator,t,r,n))}a(Sdo,"FromIterator");function*Tdo(t,e,r,n){n!==t.const&&(yield on(Et.Literal,t,r,n))}a(Tdo,"FromLiteral");function*Ido(t,e,r,n){yield on(Et.Never,t,r,n)}a(Ido,"FromNever");function*xdo(t,e,r,n){Mm(t.not,e,r,n).next().done===!0&&(yield on(Et.Not,t,r,n))}a(xdo,"FromNot");function*wdo(t,e,r,n){RB(n)||(yield on(Et.Null,t,r,n))}a(wdo,"FromNull");function*Rdo(t,e,r,n){if(!eu.IsNumberLike(n))return yield on(Et.Number,t,r,n);$s(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(Et.NumberExclusiveMinimum,t,r,n)),$s(t.maximum)&&!(n<=t.maximum)&&(yield on(Et.NumberMaximum,t,r,n)),$s(t.minimum)&&!(n>=t.minimum)&&(yield on(Et.NumberMinimum,t,r,n)),$s(t.multipleOf)&&n%t.multipleOf!==0&&(yield on(Et.NumberMultipleOf,t,r,n))}a(Rdo,"FromNumber");function*kdo(t,e,r,n){if(!eu.IsObjectLike(n))return yield on(Et.Object,t,r,n);$s(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield on(Et.ObjectMinProperties,t,r,n)),$s(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield on(Et.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 on(Et.ObjectRequiredProperty,t.properties[l],`${r}/${FB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield on(Et.ObjectAdditionalProperties,t,`${r}/${FB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Mm(t.additionalProperties,e,`${r}/${FB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Mm(u,e,`${r}/${FB(l)}`,n[l]),LB(t)&&!(l in n)&&(yield on(Et.ObjectRequiredProperty,u,`${r}/${FB(l)}`,void 0))):eu.IsExactOptionalProperty(n,l)&&(yield*Mm(u,e,`${r}/${FB(l)}`,n[l]))}}a(kdo,"FromObject");function*Pdo(t,e,r,n){p6e(n)||(yield on(Et.Promise,t,r,n))}a(Pdo,"FromPromise");function*Ddo(t,e,r,n){if(!eu.IsRecordLike(n))return yield on(Et.Object,t,r,n);$s(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield on(Et.ObjectMinProperties,t,r,n)),$s(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield on(Et.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*Mm(s,e,`${r}/${FB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Mm(t.additionalProperties,e,`${r}/${FB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield on(Et.ObjectAdditionalProperties,t,`${r}/${FB(l)}`,u)}}a(Ddo,"FromRecord");function*Ndo(t,e,r,n){yield*Mm(Sa(t,e),e,r,n)}a(Ndo,"FromRef");function*Mdo(t,e,r,n){if(!va(n))return yield on(Et.String,t,r,n);if($s(t.minLength)&&!(n.length>=t.minLength)&&(yield on(Et.StringMinLength,t,r,n)),$s(t.maxLength)&&!(n.length<=t.maxLength)&&(yield on(Et.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield on(Et.RegExp,t,r,n)}a(Mdo,"FromRegExp");function*Odo(t,e,r,n){if(!va(n))return yield on(Et.String,t,r,n);$s(t.minLength)&&!(n.length>=t.minLength)&&(yield on(Et.StringMinLength,t,r,n)),$s(t.maxLength)&&!(n.length<=t.maxLength)&&(yield on(Et.StringMaxLength,t,r,n)),va(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield on(Et.StringPattern,t,r,n))),va(t.format)&&(hk.Has(t.format)?hk.Get(t.format)(n)||(yield on(Et.StringFormat,t,r,n)):yield on(Et.StringFormatUnknown,t,r,n))}a(Odo,"FromString");function*Bdo(t,e,r,n){kB(n)||(yield on(Et.Symbol,t,r,n))}a(Bdo,"FromSymbol");function*Ldo(t,e,r,n){if(!va(n))return yield on(Et.String,t,r,n);new RegExp(t.pattern).test(n)||(yield on(Et.StringPattern,t,r,n))}a(Ldo,"FromTemplateLiteral");function*Fdo(t,e,r,n){yield*Mm(Sa(t,e),e,r,n)}a(Fdo,"FromThis");function*Udo(t,e,r,n){if(!Ri(n))return yield on(Et.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield on(Et.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield on(Et.TupleLength,t,r,n);if(t.items)for(let o=0;onew q9(Mm(s,e,r,n)));yield on(Et.Union,t,r,n,o)}a(qdo,"FromUnion");function*jdo(t,e,r,n){if(!Cie(n))return yield on(Et.Uint8Array,t,r,n);$s(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield on(Et.Uint8ArrayMaxByteLength,t,r,n)),$s(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield on(Et.Uint8ArrayMinByteLength,t,r,n))}a(jdo,"FromUint8Array");function*Hdo(t,e,r,n){}a(Hdo,"FromUnknown");function*Gdo(t,e,r,n){eu.IsVoidLike(n)||(yield on(Et.Void,t,r,n))}a(Gdo,"FromVoid");function*$do(t,e,r,n){i_.Get(t[_t])(t,n)||(yield on(Et.Kind,t,r,n))}a($do,"FromKind");function*Mm(t,e,r,n){let o=$s(t.$id)?[...e,t]:e,s=t;switch(s[_t]){case"Any":return yield*fdo(s,o,r,n);case"Argument":return yield*pdo(s,o,r,n);case"Array":return yield*hdo(s,o,r,n);case"AsyncIterator":return yield*mdo(s,o,r,n);case"BigInt":return yield*gdo(s,o,r,n);case"Boolean":return yield*Ado(s,o,r,n);case"Constructor":return yield*ydo(s,o,r,n);case"Date":return yield*Edo(s,o,r,n);case"Function":return yield*_do(s,o,r,n);case"Import":return yield*Cdo(s,o,r,n);case"Integer":return yield*vdo(s,o,r,n);case"Intersect":return yield*bdo(s,o,r,n);case"Iterator":return yield*Sdo(s,o,r,n);case"Literal":return yield*Tdo(s,o,r,n);case"Never":return yield*Ido(s,o,r,n);case"Not":return yield*xdo(s,o,r,n);case"Null":return yield*wdo(s,o,r,n);case"Number":return yield*Rdo(s,o,r,n);case"Object":return yield*kdo(s,o,r,n);case"Promise":return yield*Pdo(s,o,r,n);case"Record":return yield*Ddo(s,o,r,n);case"Ref":return yield*Ndo(s,o,r,n);case"RegExp":return yield*Mdo(s,o,r,n);case"String":return yield*Odo(s,o,r,n);case"Symbol":return yield*Bdo(s,o,r,n);case"TemplateLiteral":return yield*Ldo(s,o,r,n);case"This":return yield*Fdo(s,o,r,n);case"Tuple":return yield*Udo(s,o,r,n);case"Undefined":return yield*Qdo(s,o,r,n);case"Union":return yield*qdo(s,o,r,n);case"Uint8Array":return yield*jdo(s,o,r,n);case"Unknown":return yield*Hdo(s,o,r,n);case"Void":return yield*Gdo(s,o,r,n);default:if(!i_.Has(s[_t]))throw new xRt(t);return yield*$do(s,o,r,n)}}a(Mm,"Visit");function xN(...t){let e=t.length===3?Mm(t[0],t[1],"",t[2]):Mm(t[0],[],"",t[1]);return new q9(e)}a(xN,"Errors");p();p();var Hie=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}},wRt=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 bd(t,e,r){try{return Za(t)?t[Cd].Decode(r):r}catch(n){throw new wRt(t,e,r,n)}}a(bd,"Default");function Vdo(t,e,r,n){return Ri(n)?bd(t,r,n.map((o,s)=>yk(t.items,e,`${r}/${s}`,o))):bd(t,r,n)}a(Vdo,"FromArray");function Wdo(t,e,r,n){if(!So(n)||S1(n))return bd(t,r,n);let o=b6e(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=yk(h,e,`${r}/${f}`,c[f]));if(!Za(t.unevaluatedProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a(Wdo,"FromIntersect");function zdo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=yk(s,[...e,...o],r,n);return bd(t,r,c)}a(zdo,"FromImport");function Ydo(t,e,r,n){return bd(t,r,yk(t.not,e,r,n))}a(Ydo,"FromNot");function Kdo(t,e,r,n){if(!So(n))return bd(t,r,n);let o=WC(t),s={...n};for(let d of o)Qi(s,d)&&(Du(s[d])&&(!NB(t.properties[d])||eu.IsExactOptionalProperty(s,d))||(s[d]=yk(t.properties[d],e,`${r}/${d}`,s[d])));if(!vd(t.additionalProperties))return bd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=bd(l,`${r}/${d}`,u[d]));return bd(t,r,u)}a(Kdo,"FromObject");function Jdo(t,e,r,n){if(!So(n))return bd(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]=yk(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!vd(t.additionalProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a(Jdo,"FromRecord");function Zdo(t,e,r,n){let o=Sa(t,e);return bd(t,r,yk(o,e,r,n))}a(Zdo,"FromRef");function Xdo(t,e,r,n){let o=Sa(t,e);return bd(t,r,yk(o,e,r,n))}a(Xdo,"FromThis");function efo(t,e,r,n){return Ri(n)&&Ri(t.items)?bd(t,r,t.items.map((o,s)=>yk(o,e,`${r}/${s}`,n[s]))):bd(t,r,n)}a(efo,"FromTuple");function tfo(t,e,r,n){for(let o of t.anyOf){if(!Jo(o,e,n))continue;let s=yk(o,e,r,n);return bd(t,r,s)}return bd(t,r,n)}a(tfo,"FromUnion");function yk(t,e,r,n){let o=Dm(t,e),s=t;switch(t[_t]){case"Array":return Vdo(s,o,r,n);case"Import":return zdo(s,o,r,n);case"Intersect":return Wdo(s,o,r,n);case"Not":return Ydo(s,o,r,n);case"Object":return Kdo(s,o,r,n);case"Record":return Jdo(s,o,r,n);case"Ref":return Zdo(s,o,r,n);case"Symbol":return bd(s,r,n);case"This":return Xdo(s,o,r,n);case"Tuple":return efo(s,o,r,n);case"Union":return tfo(s,o,r,n);default:return bd(s,r,n)}}a(yk,"Visit");function Gie(t,e,r){return yk(t,e,"",r)}a(Gie,"TransformDecode");p();var $ie=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}},RRt=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 Yg(t,e,r){try{return Za(t)?t[Cd].Encode(r):r}catch(n){throw new RRt(t,e,r,n)}}a(Yg,"Default");function rfo(t,e,r,n){let o=Yg(t,r,n);return Ri(o)?o.map((s,c)=>Ek(t.items,e,`${r}/${c}`,s)):o}a(rfo,"FromArray");function nfo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Yg(t,r,n);return Ek(s,[...e,...o],r,c)}a(nfo,"FromImport");function ifo(t,e,r,n){let o=Yg(t,r,n);if(!So(n)||S1(n))return o;let s=b6e(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=Ek(m,e,`${r}/${h}`,l[h]));if(!Za(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=Yg(d,`${r}/${h}`,f[h]));return f}a(ifo,"FromIntersect");function ofo(t,e,r,n){return Yg(t.not,r,Yg(t,r,n))}a(ofo,"FromNot");function sfo(t,e,r,n){let o=Yg(t,r,n);if(!So(o))return o;let s=WC(t),c={...o};for(let f of s)Qi(c,f)&&(Du(c[f])&&(!NB(t.properties[f])||eu.IsExactOptionalProperty(c,f))||(c[f]=Ek(t.properties[f],e,`${r}/${f}`,c[f])));if(!vd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Yg(u,`${r}/${f}`,d[f]));return d}a(sfo,"FromObject");function afo(t,e,r,n){let o=Yg(t,r,n);if(!So(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]=Ek(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!vd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=Yg(d,`${r}/${h}`,f[h]));return f}a(afo,"FromRecord");function cfo(t,e,r,n){let o=Sa(t,e),s=Ek(o,e,r,n);return Yg(t,r,s)}a(cfo,"FromRef");function lfo(t,e,r,n){let o=Sa(t,e),s=Ek(o,e,r,n);return Yg(t,r,s)}a(lfo,"FromThis");function ufo(t,e,r,n){let o=Yg(t,r,n);return Ri(t.items)?t.items.map((s,c)=>Ek(s,e,`${r}/${c}`,o[c])):[]}a(ufo,"FromTuple");function dfo(t,e,r,n){for(let o of t.anyOf){if(!Jo(o,e,n))continue;let s=Ek(o,e,r,n);return Yg(t,r,s)}for(let o of t.anyOf){let s=Ek(o,e,r,n);if(Jo(t,e,s))return Yg(t,r,s)}return Yg(t,r,n)}a(dfo,"FromUnion");function Ek(t,e,r,n){let o=Dm(t,e),s=t;switch(t[_t]){case"Array":return rfo(s,o,r,n);case"Import":return nfo(s,o,r,n);case"Intersect":return ifo(s,o,r,n);case"Not":return ofo(s,o,r,n);case"Object":return sfo(s,o,r,n);case"Record":return afo(s,o,r,n);case"Ref":return cfo(s,o,r,n);case"This":return lfo(s,o,r,n);case"Tuple":return ufo(s,o,r,n);case"Union":return dfo(s,o,r,n);default:return Yg(s,r,n)}}a(Ek,"Visit");function Vie(t,e,r){return Ek(t,e,"",r)}a(Vie,"TransformEncode");p();function ffo(t,e){return Za(t)||R0(t.items,e)}a(ffo,"FromArray");function pfo(t,e){return Za(t)||R0(t.items,e)}a(pfo,"FromAsyncIterator");function hfo(t,e){return Za(t)||R0(t.returns,e)||t.parameters.some(r=>R0(r,e))}a(hfo,"FromConstructor");function mfo(t,e){return Za(t)||R0(t.returns,e)||t.parameters.some(r=>R0(r,e))}a(mfo,"FromFunction");function gfo(t,e){return Za(t)||Za(t.unevaluatedProperties)||t.allOf.some(r=>R0(r,e))}a(gfo,"FromIntersect");function Afo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return Za(t)||R0(n,[...r,...e])}a(Afo,"FromImport");function yfo(t,e){return Za(t)||R0(t.items,e)}a(yfo,"FromIterator");function Efo(t,e){return Za(t)||R0(t.not,e)}a(Efo,"FromNot");function _fo(t,e){return Za(t)||Object.values(t.properties).some(r=>R0(r,e))||vd(t.additionalProperties)&&R0(t.additionalProperties,e)}a(_fo,"FromObject");function Cfo(t,e){return Za(t)||R0(t.item,e)}a(Cfo,"FromPromise");function vfo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return Za(t)||R0(n,e)||vd(t.additionalProperties)&&Za(t.additionalProperties)}a(vfo,"FromRecord");function bfo(t,e){return Za(t)?!0:R0(Sa(t,e),e)}a(bfo,"FromRef");function Sfo(t,e){return Za(t)?!0:R0(Sa(t,e),e)}a(Sfo,"FromThis");function Tfo(t,e){return Za(t)||!Du(t.items)&&t.items.some(r=>R0(r,e))}a(Tfo,"FromTuple");function Ifo(t,e){return Za(t)||t.anyOf.some(r=>R0(r,e))}a(Ifo,"FromUnion");function R0(t,e){let r=Dm(t,e),n=t;if(t.$id&&kRt.has(t.$id))return!1;switch(t.$id&&kRt.add(t.$id),t[_t]){case"Array":return ffo(n,r);case"AsyncIterator":return pfo(n,r);case"Constructor":return hfo(n,r);case"Function":return mfo(n,r);case"Import":return Afo(n,r);case"Intersect":return gfo(n,r);case"Iterator":return yfo(n,r);case"Not":return Efo(n,r);case"Object":return _fo(n,r);case"Promise":return Cfo(n,r);case"Record":return vfo(n,r);case"Ref":return bfo(n,r);case"This":return Sfo(n,r);case"Tuple":return Tfo(n,r);case"Union":return Ifo(n,r);default:return Za(t)}}a(R0,"Visit");var kRt=new Set;function UB(t,e){return kRt.clear(),R0(t,e)}a(UB,"HasTransform");var PRt=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=UB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return xN(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Hie(this.schema,e,this.Errors(e).First());return this.hasTransform?Gie(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Vie(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new $ie(this.schema,e,this.Errors(e).First());return r}},QB;(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})(QB||(QB={}));var B6e;(function(t){function e(s){return s.length===0?!1:QB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${Z.minItems}`);let ae=Y(Z.items,J,"value");if(yield`((array) => { for(const ${le} of array) if(!(${ae})) { return false }; return true; })(${z})`,Mu(Z.contains)||oi(Z.minContains)||oi(Z.maxContains)){let Me=Mu(Z.contains)?Z.contains:Ko(),ne=Y(Me,J,"value"),se=oi(Z.minContains)?[`(count >= ${Z.minContains})`]:[],Ie=oi(Z.maxContains)?[`(count <= ${Z.maxContains})`]:[],_e=`const count = value.reduce((${K}, ${le}) => ${ne} ? acc + 1 : acc, 0)`,Re=["(count > 0)",...se,...Ie].join(" && ");yield`((${le}) => { ${_e}; return ${Re}})(${z})`}Z.uniqueItems===!0&&(yield`((${le}) => { 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 } )(${z})`)}a(o,"FromArray");function*s(Z,J,z){yield`(typeof value === 'object' && Symbol.asyncIterator in ${z})`}a(s,"FromAsyncIterator");function*c(Z,J,z){yield`(typeof ${z} === 'bigint')`,Wg(Z.exclusiveMaximum)&&(yield`${z} < BigInt(${Z.exclusiveMaximum})`),Wg(Z.exclusiveMinimum)&&(yield`${z} > BigInt(${Z.exclusiveMinimum})`),Wg(Z.maximum)&&(yield`${z} <= BigInt(${Z.maximum})`),Wg(Z.minimum)&&(yield`${z} >= BigInt(${Z.minimum})`),Wg(Z.multipleOf)&&(yield`(${z} % BigInt(${Z.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(Z,J,z){yield`(typeof ${z} === 'boolean')`}a(l,"FromBoolean");function*u(Z,J,z){yield*V(Z.returns,J,`${z}.prototype`)}a(u,"FromConstructor");function*d(Z,J,z){yield`(${z} instanceof Date) && Number.isFinite(${z}.getTime())`,oi(Z.exclusiveMaximumTimestamp)&&(yield`${z}.getTime() < ${Z.exclusiveMaximumTimestamp}`),oi(Z.exclusiveMinimumTimestamp)&&(yield`${z}.getTime() > ${Z.exclusiveMinimumTimestamp}`),oi(Z.maximumTimestamp)&&(yield`${z}.getTime() <= ${Z.maximumTimestamp}`),oi(Z.minimumTimestamp)&&(yield`${z}.getTime() >= ${Z.minimumTimestamp}`),oi(Z.multipleOfTimestamp)&&(yield`(${z}.getTime() % ${Z.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(Z,J,z){yield`(typeof ${z} === 'function')`}a(f,"FromFunction");function*h(Z,J,z){let le=globalThis.Object.getOwnPropertyNames(Z.$defs).reduce((K,ae)=>[...K,Z.$defs[ae]],[]);yield*V(wI(Z.$ref),[...J,...le],z)}a(h,"FromImport");function*m(Z,J,z){yield`Number.isInteger(${z})`,oi(Z.exclusiveMaximum)&&(yield`${z} < ${Z.exclusiveMaximum}`),oi(Z.exclusiveMinimum)&&(yield`${z} > ${Z.exclusiveMinimum}`),oi(Z.maximum)&&(yield`${z} <= ${Z.maximum}`),oi(Z.minimum)&&(yield`${z} >= ${Z.minimum}`),oi(Z.multipleOf)&&(yield`(${z} % ${Z.multipleOf}) === 0`)}a(m,"FromInteger");function*g(Z,J,z){let le=Z.allOf.map(K=>Y(K,J,z)).join(" && ");if(Z.unevaluatedProperties===!1){let K=j(`${new RegExp(BB(Z))};`),ae=`Object.getOwnPropertyNames(${z}).every(key => ${K}.test(key))`;yield`(${le} && ${ae})`}else if(Mu(Z.unevaluatedProperties)){let K=j(`${new RegExp(BB(Z))};`),ae=`Object.getOwnPropertyNames(${z}).every(key => ${K}.test(key) || ${Y(Z.unevaluatedProperties,J,`${z}[key]`)})`;yield`(${le} && ${ae})`}else yield`(${le})`}a(g,"FromIntersect");function*A(Z,J,z){yield`(typeof value === 'object' && Symbol.iterator in ${z})`}a(A,"FromIterator");function*y(Z,J,z){typeof Z.const=="number"||typeof Z.const=="boolean"?yield`(${z} === ${Z.const})`:yield`(${z} === '${NRt.Escape(Z.const)}')`}a(y,"FromLiteral");function*E(Z,J,z){yield"false"}a(E,"FromNever");function*_(Z,J,z){yield`(!${Y(Z.not,J,z)})`}a(_,"FromNot");function*v(Z,J,z){yield`(${z} === null)`}a(v,"FromNull");function*b(Z,J,z){yield XV.IsNumberLike(z),oi(Z.exclusiveMaximum)&&(yield`${z} < ${Z.exclusiveMaximum}`),oi(Z.exclusiveMinimum)&&(yield`${z} > ${Z.exclusiveMinimum}`),oi(Z.maximum)&&(yield`${z} <= ${Z.maximum}`),oi(Z.minimum)&&(yield`${z} >= ${Z.minimum}`),oi(Z.multipleOf)&&(yield`(${z} % ${Z.multipleOf}) === 0`)}a(b,"FromNumber");function*T(Z,J,z){yield XV.IsObjectLike(z),oi(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${z}).length >= ${Z.minProperties}`),oi(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${z}).length <= ${Z.maxProperties}`);let le=Object.getOwnPropertyNames(Z.properties);for(let K of le){let ae=B6e.Encode(z,K),Me=Z.properties[K];if(Z.required&&Z.required.includes(K))yield*V(Me,J,ae),(LB(Me)||e(Me))&&(yield`('${K}' in ${z})`);else{let ne=Y(Me,J,ae);yield XV.IsExactOptionalProperty(z,K,ne)}}if(Z.additionalProperties===!1)if(Z.required&&Z.required.length===le.length)yield`Object.getOwnPropertyNames(${z}).length === ${le.length}`;else{let K=`[${le.map(ae=>`'${ae}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${z}).every(key => ${K}.includes(key))`}if(typeof Z.additionalProperties=="object"){let K=Y(Z.additionalProperties,J,`${z}[key]`),ae=`[${le.map(Me=>`'${Me}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${z}).every(key => ${ae}.includes(key) || ${K}))`}}a(T,"FromObject");function*w(Z,J,z){yield`${z} instanceof Promise`}a(w,"FromPromise");function*R(Z,J,z){yield XV.IsRecordLike(z),oi(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${z}).length >= ${Z.minProperties}`),oi(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${z}).length <= ${Z.maxProperties}`);let[le,K]=Object.entries(Z.patternProperties)[0],ae=j(`${new RegExp(le)}`),Me=Y(K,J,"value"),ne=Mu(Z.additionalProperties)?Y(Z.additionalProperties,J,z):Z.additionalProperties===!1?"false":"true",se=`(${ae}.test(key) ? ${Me} : ${ne})`;yield`(Object.entries(${z}).every(([key, value]) => ${se}))`}a(R,"FromRecord");function*x(Z,J,z){let le=Sa(Z,J);if(G.functions.has(Z.$ref))return yield`${re(Z.$ref)}(${z})`;yield*V(le,J,z)}a(x,"FromRef");function*k(Z,J,z){let le=j(`${new RegExp(Z.source,Z.flags)};`);yield`(typeof ${z} === 'string')`,oi(Z.maxLength)&&(yield`${z}.length <= ${Z.maxLength}`),oi(Z.minLength)&&(yield`${z}.length >= ${Z.minLength}`),yield`${le}.test(${z})`}a(k,"FromRegExp");function*D(Z,J,z){yield`(typeof ${z} === 'string')`,oi(Z.maxLength)&&(yield`${z}.length <= ${Z.maxLength}`),oi(Z.minLength)&&(yield`${z}.length >= ${Z.minLength}`),Z.pattern!==void 0&&(yield`${j(`${new RegExp(Z.pattern)};`)}.test(${z})`),Z.format!==void 0&&(yield`format('${Z.format}', ${z})`)}a(D,"FromString");function*N(Z,J,z){yield`(typeof ${z} === 'symbol')`}a(N,"FromSymbol");function*L(Z,J,z){yield`(typeof ${z} === 'string')`,yield`${j(`${new RegExp(Z.pattern)};`)}.test(${z})`}a(L,"FromTemplateLiteral");function*B(Z,J,z){yield`${re(Z.$ref)}(${z})`}a(B,"FromThis");function*Q(Z,J,z){if(yield`Array.isArray(${z})`,Z.items===void 0)return yield`${z}.length === 0`;yield`(${z}.length === ${Z.maxItems})`;for(let le=0;leY(K,J,z)).join(" || ")})`}a(O,"FromUnion");function*q(Z,J,z){yield`${z} instanceof Uint8Array`,oi(Z.maxByteLength)&&(yield`(${z}.length <= ${Z.maxByteLength})`),oi(Z.minByteLength)&&(yield`(${z}.length >= ${Z.minByteLength})`)}a(q,"FromUint8Array");function*F(Z,J,z){yield"true"}a(F,"FromUnknown");function*U(Z,J,z){yield XV.IsVoidLike(z)}a(U,"FromVoid");function*W(Z,J,z){let le=G.instances.size;G.instances.set(le,Z),yield`kind('${Z[_t]}', ${le}, ${z})`}a(W,"FromKind");function*V(Z,J,z,le=!0){let K=va(Z.$id)?[...J,Z]:J,ae=Z;if(le&&va(Z.$id)){let Me=re(Z.$id);if(G.functions.has(Me))return yield`${Me}(${z})`;{G.functions.set(Me,"");let ne=X(Me,Z,J,"value",!1);return G.functions.set(Me,ne),yield`${Me}(${z})`}}switch(ae[_t]){case"Any":return yield*r(ae,K,z);case"Argument":return yield*n(ae,K,z);case"Array":return yield*o(ae,K,z);case"AsyncIterator":return yield*s(ae,K,z);case"BigInt":return yield*c(ae,K,z);case"Boolean":return yield*l(ae,K,z);case"Constructor":return yield*u(ae,K,z);case"Date":return yield*d(ae,K,z);case"Function":return yield*f(ae,K,z);case"Import":return yield*h(ae,K,z);case"Integer":return yield*m(ae,K,z);case"Intersect":return yield*g(ae,K,z);case"Iterator":return yield*A(ae,K,z);case"Literal":return yield*y(ae,K,z);case"Never":return yield*E(ae,K,z);case"Not":return yield*_(ae,K,z);case"Null":return yield*v(ae,K,z);case"Number":return yield*b(ae,K,z);case"Object":return yield*T(ae,K,z);case"Promise":return yield*w(ae,K,z);case"Record":return yield*R(ae,K,z);case"Ref":return yield*x(ae,K,z);case"RegExp":return yield*k(ae,K,z);case"String":return yield*D(ae,K,z);case"Symbol":return yield*N(ae,K,z);case"TemplateLiteral":return yield*L(ae,K,z);case"This":return yield*B(ae,K,z);case"Tuple":return yield*Q(ae,K,z);case"Undefined":return yield*M(ae,K,z);case"Union":return yield*O(ae,K,z);case"Uint8Array":return yield*q(ae,K,z);case"Unknown":return yield*F(ae,K,z);case"Void":return yield*U(ae,K,z);default:if(!i_.Has(ae[_t]))throw new MRt(Z);return yield*W(ae,K,z)}}a(V,"Visit");let G={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Y(Z,J,z,le=!0){return`(${[...V(Z,J,z,le)].join(" && ")})`}a(Y,"CreateExpression");function re(Z){return`check_${DRt.Encode(Z)}`}a(re,"CreateFunctionName");function j(Z){let J=`local_${G.variables.size}`;return G.variables.set(J,`const ${J} = ${Z}`),J}a(j,"CreateVariable");function X(Z,J,z,le,K=!0){let[ae,Me]=[` -`,_e=>"".padStart(_e," ")],ne=ie("value","any"),se=we("boolean"),Ie=[...V(J,z,le,K)].map(_e=>`${Me(4)}${_e}`).join(` &&${ae}`);return`function ${Z}(${ne})${se} {${ae}${Me(2)}return (${ae}${Ie}${ae}${Me(2)}) -}`}a(X,"CreateFunction");function ie(Z,J){let z=G.language==="typescript"?`: ${J}`:"";return`${Z}${z}`}a(ie,"CreateParameter");function we(Z){return G.language==="typescript"?`: ${Z}`:""}a(we,"CreateReturns");function Ae(Z,J,z){let le=X("check",Z,J,"value"),K=ie("value","any"),ae=we("boolean"),Me=[...G.functions.values()],ne=[...G.variables.values()],se=va(Z.$id)?`return function check(${K})${ae} { - return ${re(Z.$id)}(value) -}`:`return ${le}`;return[...ne,...Me,se].join(` -`)}a(Ae,"Build");function De(...Z){let J={language:"javascript"},[z,le,K]=Z.length===2&&Ri(Z[1])?[Z[0],Z[1],J]:Z.length===2&&!Ri(Z[1])?[Z[0],[],Z[1]]:Z.length===3?[Z[0],Z[1],Z[2]]:Z.length===1?[Z[0],[],J]:[null,[],J];if(G.language=K.language,G.variables.clear(),G.functions.clear(),G.instances.clear(),!Mu(z))throw new L6e(z);for(let ae of le)if(!Mu(ae))throw new L6e(ae);return Ae(z,le,K)}a(De,"Code"),t.Code=De;function Te(Z,J=[]){let z=De(Z,J,{language:"javascript"}),le=globalThis.Function("kind","format","hash",z),K=new Map(G.instances);function ae(Ie,_e,Re){if(!i_.Has(Ie)||!K.has(_e))return!1;let Je=i_.Get(Ie),Xe=K.get(_e);return Je(Xe,Re)}a(ae,"typeRegistryFunction");function Me(Ie,_e){return hk.Has(Ie)?hk.Get(Ie)(_e):!1}a(Me,"formatRegistryFunction");function ne(Ie){return Q9(Ie)}a(ne,"hashFunction");let se=le(ae,Me,ne);return new PRt(Z,J,se,z)}a(Te,"Compile"),t.Compile=Te})(Ou||(Ou={}));var b9e=ce(IB()),poe=ce(require("os"));Ns();var S9e=ce(ti());function foe(t){return t===1}a(foe,"isRestricted");var kpo=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],LCe=8192,Ppo=21;var k0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return foe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(moe(e))return this.reporterRestricted;if(Eie(e))return new cCe}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}getFTReporter(e){if(aWr(e))return this.reporterFT;if(Eie(e))return new cCe}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterFT,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterFT=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},Dpo=S.Object({},{additionalProperties:S.String()}),Npo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),Mpo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function Opo(t){return Mpo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(Opo,"isOomError");function Bpo(t){return OI(t)?"network":Opo(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(Bpo,"getErrorType");var jt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=Ou.Compile(Dpo)}static{this.validateTelemetryMeasurements=Ou.Compile(Npo)}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||{},pl())}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=pl())}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=C1(e.get(Lr).getEditorInfo()),this.properties.editor_plugin_version=C1(e.get(Lr).getEditorPluginInfo());let r=e.get(Fa);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${N1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Lr);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=C1(r.getEditorInfo());let n=e.get(ar);this.properties.fetcher=n.name;let o=e.get(Zo).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=pWr(e);r["copilot.build"]=hWr(e),r["copilot.buildType"]=J9(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(foe(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>LCe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+LCe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(hoe,"telemetrizePromptLength");function pl(){return performance.now()}a(pl,"now");function qpo(t){return Math.floor(t/1e3)}a(qpo,"nowSeconds");function moe(t){return t.get(Nf).optedIn}a(moe,"shouldSendRestricted");function aWr(t){return t.get(Nf).ftFlag!==""}a(aWr,"shouldSendFinetuningTelemetry");function ht(t,e,r,n){return t.get(_d).register(jpo(t,e,pl(),r?.extendedBy(),n))}a(ht,"telemetry");function MI(t,e,r){return t.get(_d).register(I9e(t,e,r?.extendedBy()))}a(MI,"telemetryMsft");function gt(t,e,r,n){let o=jt.createAndMarkAsIssued(r,n);return t.get(_d).register(I9e(t,e,o))}a(gt,"telemetryMs");function T9e(t,e,r,n){let o=(n||jt.createAndMarkAsIssued()).extendedBy(cWr(r));return t.get(_d).register(I9e(t,e,o))}a(T9e,"telemetryMsftWithError");function gi(t,e,r,n,o){let s=jt.createAndMarkAsIssued({...n,...cWr(r)},o);return t.get(_d).register(I9e(t,e,s))}a(gi,"telemetryMsWithError");function cWr(t){let e={};if(t){let r=$po(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(cWr,"buildErrorProperties");async function jpo(t,e,r,n,o=0){let s=n||jt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!foe(o)||moe(t))&&FCe(t,o,e,s),foe(o)&&kpo.includes(e)&&aWr(t)&&Qpo(t,o,e,s),Lpo(t,e,s)}a(jpo,"_telemetry");async function I9e(t,e,r){let n=r||jt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Upo(t,e,n)}a(I9e,"_telemetryMsft");function x9e(t,e){return t.get(_d).register(Hpo(t,e,pl()))}a(x9e,"telemetryExpProblem");async function Hpo(t,e,r){let n="expProblem",o=jt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),FCe(t,0,n,o)}a(Hpo,"_telemetryExpProblem");function goe(t,e,r,n,o=0){let s={...r,...lWr(t)};FCe(t,o,e,{properties:s,measurements:n})}a(goe,"telemetryRaw");function lWr(t){let e=t.get(Lr),r={unique_id:gr(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:C1(e.getEditorInfo())};return{...t.get(Nf).getProperties(),...r}}a(lWr,"createRequiredProperties");var cPt=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,b9e.SHA256)(b9e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function _s(t,e,r,n,o){return t.get(_d).register(uWr(t,e,pl(),r,{...n},o))}a(_s,"telemetryException");async function uWr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||P0(c)||c instanceof S9e.ConnectionError||c instanceof S9e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new cPt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} +`+new Array(o).join(" ")+"^"}}return null}a(Veo,"getErrorSource");function eWc(t){var e=Veo(t),r=YVc();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),KVc(1)}a(eWc,"printErrorAndExit");function tWc(){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 eWc(arguments[1])}return t.apply(this,arguments)}}a(tWc,"shimEmitUncaughtException");var rWc=vV.slice(0),nWc=CV.slice(0);zne.wrapCallSite=$eo;zne.getErrorSource=Veo;zne.mapSourcePosition=Z8r;zne.retrieveSourceMap=J8r;zne.install=function(t){if(t=t||{},t.environment&&(TFe=t.environment,["node","browser","auto"].indexOf(TFe)===-1))throw new Error("environment "+TFe+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(vV.length=0),vV.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(CV.length=0),CV.unshift(t.retrieveSourceMap)),t.hookRequire&&!Y8r()){var e=Qeo(z8r,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return Wne[c]=s,IFe[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(V8r||(V8r="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),qeo||(qeo=!0,Error.prepareStackTrace=XVc),!jeo){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Qeo(z8r,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&WVc()&&(jeo=!0,tWc())}};zne.resetRetrieveHandlers=function(){vV.length=0,CV.length=0,vV=rWc.slice(0),CV=nWc.slice(0),J8r=bxt(CV),K8r=bxt(vV)}});var zeo=I(()=>{p();Weo().install()});var sWc={};xi(sWc,{getTokenizer:()=>Ds,getTokenizerAsync:()=>MHe,main:()=>Keo});module.exports=ya(sWc);p();p();p();p();var Df=class{static{a(this,"LogTarget")}},sB=class{static{a(this,"TelemetryLogSender")}},Ee=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Df).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(sB).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Dr=new Ee("default");p();p();p();var Ixt="github.copilot",n6r="github-enterprise";p();var Rs=a((t,e)=>({editorId:t,displayName:e}),"id"),rto=Rs("unknown","Unknown"),i6r=Rs("eclipse","Eclipse"),o6r=Rs("xcode","Xcode"),o9=Rs("vim","Vim/Neovim"),s6r=Rs("helix","Helix"),nto={"copilot-eclipse":i6r,Copilot4Eclipse:i6r,"copilot-xcode":o6r,"Copilot for Xcode":o6r,"copilot-vs":Rs("visual-studio","Visual Studio"),"copilot.vim":o9,"copilot.lua":o9,"Github Copilot LSP for Neovim":o9,"coc-github-copilot":o9,"nvim-lspconfig":o9,"copilot-lsp-client-neovim":o9,"neovim-copilot-lsp":o9,"sidekick.nvim":o9,"helix-copilot":s6r,"copilot-helix":s6r,"copilot-sublime":Rs("sublime-text","Sublime Text"),"zed-copilot":Rs("zed","Zed"),RStudio:Rs("rstudio","RStudio"),"obsidian-copilot":Rs("obsidian","Obsidian"),marimo:Rs("marimo","marimo"),"Qt Creator Copilot plugin":Rs("qt-creator","Qt Creator"),"godot-copilot":Rs("godot","Godot"),"kakoune-lsp":Rs("kakoune","Kakoune"),"typora-copilot":Rs("typora","Typora"),"Copilot for Nova":Rs("nova","Nova")},ito={IU:Rs("intellij","IntelliJ IDEA"),IC:Rs("intellij","IntelliJ IDEA"),IE:Rs("intellij","IntelliJ IDEA"),PY:Rs("pycharm","PyCharm"),PC:Rs("pycharm","PyCharm"),PE:Rs("pycharm","PyCharm"),WS:Rs("webstorm","WebStorm"),PS:Rs("phpstorm","PhpStorm"),RD:Rs("rider","Rider"),RM:Rs("rubymine","RubyMine"),CL:Rs("clion","CLion"),GO:Rs("goland","GoLand"),RR:Rs("rustrover","RustRover"),DB:Rs("datagrip","DataGrip"),DS:Rs("dataspell","DataSpell"),AI:Rs("android-studio","Android Studio"),QA:Rs("aqua","Aqua"),MPS:Rs("mps","MPS"),JBC:Rs("jetbrains-client","JetBrains Client"),GW:Rs("jetbrains-gateway","JetBrains Gateway")},a6r="JetBrains-",oto=Rs("jetbrains","JetBrains IDE");function c6r(t){let e=t.plugin.name?.trim();if(!e)return rto;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(a6r)){let n=ito[r.slice(a6r.length)];if(n)return n}return oto}return nto[e]??Rs(e,e)}a(c6r,"resolveEditorIdentity");p();p();p();p();p();p();var JR=class{static{a(this,"InlineCompletionsUnification")}},sto={codeUnification:!1,modelUnification:!1,expAssignments:[]},Yne=class extends JR{constructor(){super(...arguments);this.inlineCompletionsUnificationState=sto;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};p();p();async function jno(){let{getDeviceId:t}=await Promise.resolve().then(()=>he(QUr()));return t()}a(jno,"loadDeviceId");var mI=class{constructor(e=jno){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();var XE="X-Copilot-RelatedPluginVersion-",tie=($=>($.Market="X-MSEdge-Market",$.CorpNet="X-FD-Corpnet",$.Build="X-VSCode-Build",$.ApplicationVersion="X-VSCode-AppVersion",$.TargetPopulation="X-VSCode-TargetPopulation",$.ClientId="X-MSEdge-ClientId",$.DevDeviceId="X-VSCode-DevDeviceId",$.ExtensionName="X-VSCode-ExtensionName",$.ExtensionVersion="X-VSCode-ExtensionVersion",$.ExtensionRelease="X-VSCode-ExtensionRelease",$.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",$.Language="X-VSCode-Language",$.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",$.CopilotEngine="X-Copilot-Engine",$.CopilotOverrideEngine="X-Copilot-OverrideEngine",$.CopilotRepository="X-Copilot-Repository",$.CopilotFileType="X-Copilot-FileType",$.CopilotUserKind="X-Copilot-UserKind",$.CopilotDogfood="X-Copilot-Dogfood",$.CopilotCustomModel="X-Copilot-CustomModel",$.CopilotOrgs="X-Copilot-Orgs",$.CopilotTrackingId="X-Copilot-CopilotTrackingId",$.CopilotClientVersion="X-Copilot-ClientVersion",$.CopilotSku="X-GitHub-Copilot-SKU",$.CopilotRelatedPluginVersionCppTools=XE+"msvscodecpptools",$.CopilotRelatedPluginVersionCMakeTools=XE+"msvscodecmaketools",$.CopilotRelatedPluginVersionMakefileTools=XE+"msvscodemakefiletools",$.CopilotRelatedPluginVersionCSharpDevKit=XE+"msdotnettoolscsdevkit",$.CopilotRelatedPluginVersionPython=XE+"mspythonpython",$.CopilotRelatedPluginVersionPylance=XE+"mspythonvscodepylance",$.CopilotRelatedPluginVersionJavaPack=XE+"vscjavavscodejavapack",$.CopilotRelatedPluginVersionJavaManager=XE+"vscjavavscodejavadependency",$.CopilotRelatedPluginVersionTypescript=XE+"vscodetypescriptlanguagefeatures",$.CopilotRelatedPluginVersionTypescriptNext=XE+"msvscodevscodetypescriptnext",$.CopilotRelatedPluginVersionCSharp=XE+"msdotnettoolscsharp",$.CopilotRelatedPluginVersionGithubCopilotChat=XE+"githubcopilotchat",$.CopilotRelatedPluginVersionGithubCopilot=XE+"githubcopilot",$))(tie||{});var Hno={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},fB=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=Hno[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 ys(t,e){let r=km(t,e,"event.CopilotToken");return t.get(Ut).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(ys,"onCopilotToken");function Kxt(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(Kxt,"propertiesFromCopilotToken");var Nf=class{constructor(e){this.#e={};this.optedIn=!1;this.ftFlag="";ys(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=Kxt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};var R8e=he(h9()),P8e=he(require("os"));var Gno=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function $no(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(Gno),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($no,"buildExceptionDetail");function Xxt(t,e){let r=t.get(Lr),n=r.getEditorInfo(),o=t.get(Nf),s={"#editor":n.devName??n.name,"#editor_version":p1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":p1(r.getEditorPluginInfo()),"#session_id":t.get(Oa).sessionId,"#machine_id":t.get(Oa).machineId,"#architecture":P8e.arch(),"#os_platform":P8e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(Xxt,"buildContext");function z7r(t,e,r){let n=t.get(is),o=t.get(Lr).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:Xxt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=$no(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,R8e.SHA256)(R8e.enc.Utf16.parse(f.join(` +`))).toString()),c}a(z7r,"buildPayload");p();var U_e=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 K7r=he(h9());var yn=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)}},XR=class extends yn{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"}},k8e=class extends yn{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 J7r=7*86400*1e3,mN=class{constructor(e=5){this.perWeek=e;this.cache=new yn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-J7r);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(Z7r(t.replace(/\\/g,"/")),"gi"):new RegExp(Z7r(t),"gi"));function Wno(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(zno,"removePropertiesWithPossibleUserInfo");function Yno(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(Yno,"redactPaths");function eQr(t,e=Vno){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=zno(s);if(c!==s){r[n]=c;continue}s=Wno(s,e);for(let l of e)s=s.replace(l,"");s=Yno(s),r[n]=s}return r}a(eQr,"sanitizeTelemetryProperties");function m9(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(m9,"filterTelemetryProperties");p();var gI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:rQr(r,n),verboseLogging:Jno(r,n),testMode:e,simulation:Kno(n)})}};function h1(t){return t.get(gI).flags.testMode}a(h1,"isRunningInTest");function rie(t){return h1(t)}a(rie,"shouldFailForDebugPurposes");function Q_e(t){return t.get(gI).flags.debug}a(Q_e,"isDebugEnabled");function tQr(t){return t.get(gI).flags.verboseLogging}a(tQr,"isVerboseLoggingEnabled");function rQr(t,e){return t.includes("--debug")||twt(e,"DEBUG")}a(rQr,"determineDebugFlag");function Kno(t){return twt(t,"SIMULATION")}a(Kno,"determineSimulationFlag");function N8e(t){return t.get(gI).flags.simulation}a(N8e,"isRunningInSimulation");function Jno(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||twt(e,"VERBOSE")||rQr(t,e)}a(Jno,"determineVerboseLoggingEnabled");function twt(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(twt,"determineEnvFlagEnabled");p();var _d=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 oQr=require("os"),sQr=he(require("path"));function q_e(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(q_e,"redactPaths");var Zno=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),Xno=[/^[\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 nwt(t){if(Zno.has(t))return t;for(let e of Xno)if(e.test(t))return t;return q_e(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(nwt,"redactMessage");function M8e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(M8e,"escapeForRegExp");var eio=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+M8e((0,oQr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function rwt(t){return t.replace(eio,"~")}a(rwt,"redactHomeDir");var aQr="[\\\\/]?([^:)]*)(?=:\\d)",nQr=new RegExp(M8e(sQr.sep),"g"),iQr=new RegExp(M8e(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+aQr,"gi");function iwt(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(iQr.test(l))o.stack+=` +${q_e(l.replace(iQr,(u,d)=>"./"+d.replace(nQr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` +${q_e(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(M8e(f.replace(/[\\/]$/,""))+aQr,"gi");if(h.test(l)){o.stack+=` +${q_e(l.replace(h,(m,g)=>d+g.replace(nQr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` +${rwt(l)}`:o.stack+=` + at [redacted]:0:0`}}else r&&s&&(o.stack=rwt(s));return t.cause instanceof Error&&(o.cause=iwt(t.cause,e,r,n)),o}a(iwt,"cloneError");function cQr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(cQr,"errorMessageWithoutPath");function lQr(t,e){return iwt(t,a(function(n){return rwt(cQr(n))},"prepareMessage"),!0,e)}a(lQr,"prepareErrorForRestrictedTelemetry");function uQr(t,e,r=!1){return iwt(t,a(function(o){if(r)return nwt(cQr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=q_e(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(uQr,"redactError");p();p();var _y={};xi(_y,{HasPropertyKey:()=>O8e,IsArray:()=>Tp,IsAsyncIterator:()=>owt,IsBigInt:()=>j_e,IsBoolean:()=>hB,IsDate:()=>IV,IsFunction:()=>swt,IsIterator:()=>awt,IsNull:()=>cwt,IsNumber:()=>m1,IsObject:()=>Gc,IsRegExp:()=>H_e,IsString:()=>Nl,IsSymbol:()=>lwt,IsUint8Array:()=>mB,IsUndefined:()=>Ip});p();function O8e(t,e){return e in t}a(O8e,"HasPropertyKey");function owt(t){return Gc(t)&&!Tp(t)&&!mB(t)&&Symbol.asyncIterator in t}a(owt,"IsAsyncIterator");function Tp(t){return Array.isArray(t)}a(Tp,"IsArray");function j_e(t){return typeof t=="bigint"}a(j_e,"IsBigInt");function hB(t){return typeof t=="boolean"}a(hB,"IsBoolean");function IV(t){return t instanceof globalThis.Date}a(IV,"IsDate");function swt(t){return typeof t=="function"}a(swt,"IsFunction");function awt(t){return Gc(t)&&!Tp(t)&&!mB(t)&&Symbol.iterator in t}a(awt,"IsIterator");function cwt(t){return t===null}a(cwt,"IsNull");function m1(t){return typeof t=="number"}a(m1,"IsNumber");function Gc(t){return typeof t=="object"&&t!==null}a(Gc,"IsObject");function H_e(t){return t instanceof globalThis.RegExp}a(H_e,"IsRegExp");function Nl(t){return typeof t=="string"}a(Nl,"IsString");function lwt(t){return typeof t=="symbol"}a(lwt,"IsSymbol");function mB(t){return t instanceof globalThis.Uint8Array}a(mB,"IsUint8Array");function Ip(t){return t===void 0}a(Ip,"IsUndefined");function tio(t){return t.map(e=>B8e(e))}a(tio,"ArrayType");function rio(t){return new Date(t.getTime())}a(rio,"DateType");function nio(t){return new Uint8Array(t)}a(nio,"Uint8ArrayType");function iio(t){return new RegExp(t.source,t.flags)}a(iio,"RegExpType");function oio(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=B8e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=B8e(t[r]);return e}a(oio,"ObjectType");function B8e(t){return Tp(t)?tio(t):IV(t)?rio(t):mB(t)?nio(t):H_e(t)?iio(t):Gc(t)?oio(t):t}a(B8e,"Visit");function Pu(t){return B8e(t)}a(Pu,"Clone");function nie(t,e){return e===void 0?Pu(t):Pu({...e,...t})}a(nie,"CloneType");p();p();p();function L8e(t){return bo(t)&&globalThis.Symbol.asyncIterator in t}a(L8e,"IsAsyncIterator");function F8e(t){return bo(t)&&globalThis.Symbol.iterator in t}a(F8e,"IsIterator");function uwt(t){return bo(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(uwt,"IsStandardObject");function U8e(t){return t instanceof globalThis.Promise}a(U8e,"IsPromise");function e_(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(e_,"IsDate");function dQr(t){return t instanceof globalThis.Map}a(dQr,"IsMap");function fQr(t){return t instanceof globalThis.Set}a(fQr,"IsSet");function AI(t){return globalThis.ArrayBuffer.isView(t)}a(AI,"IsTypedArray");function iie(t){return t instanceof globalThis.Uint8Array}a(iie,"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 wi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(wi,"IsArray");function ku(t){return t===void 0}a(ku,"IsUndefined");function gB(t){return t===null}a(gB,"IsNull");function gN(t){return typeof t=="boolean"}a(gN,"IsBoolean");function si(t){return typeof t=="number"}a(si,"IsNumber");function Q8e(t){return globalThis.Number.isInteger(t)}a(Q8e,"IsInteger");function Yg(t){return typeof t=="bigint"}a(Yg,"IsBigInt");function Ea(t){return typeof t=="string"}a(Ea,"IsString");function g9(t){return typeof t=="function"}a(g9,"IsFunction");function AB(t){return typeof t=="symbol"}a(AB,"IsSymbol");function g1(t){return Yg(t)||gN(t)||gB(t)||si(t)||Ea(t)||AB(t)||ku(t)}a(g1,"IsValueType");var Jl;(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&&!wi(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=ku(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(Jl||(Jl={}));p();function sio(t){return globalThis.Object.freeze(t).map(e=>G_e(e))}a(sio,"ImmutableArray");function aio(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=G_e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=G_e(t[r]);return globalThis.Object.freeze(e)}a(aio,"ImmutableObject");function G_e(t){return Tp(t)?sio(t):IV(t)?t:mB(t)?t:H_e(t)?t:Gc(t)?aio(t):t}a(G_e,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(Jl.InstanceMode){case"freeze":return G_e(r);case"clone":return Pu(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 vd=Symbol.for("TypeBox.Transform"),eP=Symbol.for("TypeBox.Readonly"),Kg=Symbol.for("TypeBox.Optional"),yI=Symbol.for("TypeBox.Hint"),Tt=Symbol.for("TypeBox.Kind");function oie(t){return Gc(t)&&t[eP]==="Readonly"}a(oie,"IsReadonly");function Qv(t){return Gc(t)&&t[Kg]==="Optional"}a(Qv,"IsOptional");function dwt(t){return ea(t,"Any")}a(dwt,"IsAny");function fwt(t){return ea(t,"Argument")}a(fwt,"IsArgument");function tP(t){return ea(t,"Array")}a(tP,"IsArray");function xV(t){return ea(t,"AsyncIterator")}a(xV,"IsAsyncIterator");function wV(t){return ea(t,"BigInt")}a(wV,"IsBigInt");function yB(t){return ea(t,"Boolean")}a(yB,"IsBoolean");function rP(t){return ea(t,"Computed")}a(rP,"IsComputed");function nP(t){return ea(t,"Constructor")}a(nP,"IsConstructor");function cio(t){return ea(t,"Date")}a(cio,"IsDate");function iP(t){return ea(t,"Function")}a(iP,"IsFunction");function oP(t){return ea(t,"Integer")}a(oP,"IsInteger");function Kd(t){return ea(t,"Intersect")}a(Kd,"IsIntersect");function RV(t){return ea(t,"Iterator")}a(RV,"IsIterator");function ea(t,e){return Gc(t)&&Tt in t&&t[Tt]===e}a(ea,"IsKindOf");function q8e(t){return hB(t)||m1(t)||Nl(t)}a(q8e,"IsLiteralValue");function A1(t){return ea(t,"Literal")}a(A1,"IsLiteral");function y1(t){return ea(t,"MappedKey")}a(y1,"IsMappedKey");function Du(t){return ea(t,"MappedResult")}a(Du,"IsMappedResult");function A9(t){return ea(t,"Never")}a(A9,"IsNever");function lio(t){return ea(t,"Not")}a(lio,"IsNot");function $_e(t){return ea(t,"Null")}a($_e,"IsNull");function sP(t){return ea(t,"Number")}a(sP,"IsNumber");function xp(t){return ea(t,"Object")}a(xp,"IsObject");function PV(t){return ea(t,"Promise")}a(PV,"IsPromise");function kV(t){return ea(t,"Record")}a(kV,"IsRecord");function Mf(t){return ea(t,"Ref")}a(Mf,"IsRef");function pwt(t){return ea(t,"RegExp")}a(pwt,"IsRegExp");function EB(t){return ea(t,"String")}a(EB,"IsString");function V_e(t){return ea(t,"Symbol")}a(V_e,"IsSymbol");function E1(t){return ea(t,"TemplateLiteral")}a(E1,"IsTemplateLiteral");function uio(t){return ea(t,"This")}a(uio,"IsThis");function Ka(t){return Gc(t)&&vd in t}a(Ka,"IsTransform");function _1(t){return ea(t,"Tuple")}a(_1,"IsTuple");function _B(t){return ea(t,"Undefined")}a(_B,"IsUndefined");function _a(t){return ea(t,"Union")}a(_a,"IsUnion");function dio(t){return ea(t,"Uint8Array")}a(dio,"IsUint8Array");function fio(t){return ea(t,"Unknown")}a(fio,"IsUnknown");function pio(t){return ea(t,"Unsafe")}a(pio,"IsUnsafe");function hio(t){return ea(t,"Void")}a(hio,"IsVoid");function y9(t){return Gc(t)&&Tt in t&&Nl(t[Tt])}a(y9,"IsKind");function Cd(t){return dwt(t)||fwt(t)||tP(t)||yB(t)||wV(t)||xV(t)||rP(t)||nP(t)||cio(t)||iP(t)||oP(t)||Kd(t)||RV(t)||A1(t)||y1(t)||Du(t)||A9(t)||lio(t)||$_e(t)||sP(t)||xp(t)||PV(t)||kV(t)||Mf(t)||pwt(t)||EB(t)||V_e(t)||E1(t)||uio(t)||_1(t)||_B(t)||_a(t)||dio(t)||fio(t)||pio(t)||hio(t)||y9(t)}a(Cd,"IsSchema");var nt={};xi(nt,{IsAny:()=>gQr,IsArgument:()=>AQr,IsArray:()=>yQr,IsAsyncIterator:()=>EQr,IsBigInt:()=>_Qr,IsBoolean:()=>vQr,IsComputed:()=>CQr,IsConstructor:()=>bQr,IsDate:()=>SQr,IsFunction:()=>TQr,IsImport:()=>_io,IsInteger:()=>IQr,IsIntersect:()=>xQr,IsIterator:()=>wQr,IsKind:()=>eqr,IsKindOf:()=>Ps,IsLiteral:()=>z_e,IsLiteralBoolean:()=>vio,IsLiteralNumber:()=>PQr,IsLiteralString:()=>RQr,IsLiteralValue:()=>kQr,IsMappedKey:()=>DQr,IsMappedResult:()=>NQr,IsNever:()=>MQr,IsNot:()=>OQr,IsNull:()=>BQr,IsNumber:()=>LQr,IsObject:()=>FQr,IsOptional:()=>Eio,IsPromise:()=>UQr,IsProperties:()=>j8e,IsReadonly:()=>yio,IsRecord:()=>QQr,IsRecursive:()=>Cio,IsRef:()=>qQr,IsRegExp:()=>jQr,IsSchema:()=>Nu,IsString:()=>HQr,IsSymbol:()=>GQr,IsTemplateLiteral:()=>$Qr,IsThis:()=>VQr,IsTransform:()=>WQr,IsTuple:()=>zQr,IsUint8Array:()=>KQr,IsUndefined:()=>YQr,IsUnion:()=>Awt,IsUnionLiteral:()=>bio,IsUnknown:()=>JQr,IsUnsafe:()=>ZQr,IsVoid:()=>XQr,TypeGuardUnknownTypeError:()=>hwt});p();var hwt=class extends Qi{static{a(this,"TypeGuardUnknownTypeError")}},mio=["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 pQr(t){try{return new RegExp(t),!0}catch{return!1}}a(pQr,"IsPattern");function mwt(t){if(!Nl(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(mwt,"IsControlCharacterFree");function hQr(t){return gwt(t)||Nu(t)}a(hQr,"IsAdditionalProperties");function W_e(t){return Ip(t)||j_e(t)}a(W_e,"IsOptionalBigInt");function Ml(t){return Ip(t)||m1(t)}a(Ml,"IsOptionalNumber");function gwt(t){return Ip(t)||hB(t)}a(gwt,"IsOptionalBoolean");function $c(t){return Ip(t)||Nl(t)}a($c,"IsOptionalString");function gio(t){return Ip(t)||Nl(t)&&mwt(t)&&pQr(t)}a(gio,"IsOptionalPattern");function Aio(t){return Ip(t)||Nl(t)&&mwt(t)}a(Aio,"IsOptionalFormat");function mQr(t){return Ip(t)||Nu(t)}a(mQr,"IsOptionalSchema");function yio(t){return Gc(t)&&t[eP]==="Readonly"}a(yio,"IsReadonly");function Eio(t){return Gc(t)&&t[Kg]==="Optional"}a(Eio,"IsOptional");function gQr(t){return Ps(t,"Any")&&$c(t.$id)}a(gQr,"IsAny");function AQr(t){return Ps(t,"Argument")&&m1(t.index)}a(AQr,"IsArgument");function yQr(t){return Ps(t,"Array")&&t.type==="array"&&$c(t.$id)&&Nu(t.items)&&Ml(t.minItems)&&Ml(t.maxItems)&&gwt(t.uniqueItems)&&mQr(t.contains)&&Ml(t.minContains)&&Ml(t.maxContains)}a(yQr,"IsArray");function EQr(t){return Ps(t,"AsyncIterator")&&t.type==="AsyncIterator"&&$c(t.$id)&&Nu(t.items)}a(EQr,"IsAsyncIterator");function _Qr(t){return Ps(t,"BigInt")&&t.type==="bigint"&&$c(t.$id)&&W_e(t.exclusiveMaximum)&&W_e(t.exclusiveMinimum)&&W_e(t.maximum)&&W_e(t.minimum)&&W_e(t.multipleOf)}a(_Qr,"IsBigInt");function vQr(t){return Ps(t,"Boolean")&&t.type==="boolean"&&$c(t.$id)}a(vQr,"IsBoolean");function CQr(t){return Ps(t,"Computed")&&Nl(t.target)&&Tp(t.parameters)&&t.parameters.every(e=>Nu(e))}a(CQr,"IsComputed");function bQr(t){return Ps(t,"Constructor")&&t.type==="Constructor"&&$c(t.$id)&&Tp(t.parameters)&&t.parameters.every(e=>Nu(e))&&Nu(t.returns)}a(bQr,"IsConstructor");function SQr(t){return Ps(t,"Date")&&t.type==="Date"&&$c(t.$id)&&Ml(t.exclusiveMaximumTimestamp)&&Ml(t.exclusiveMinimumTimestamp)&&Ml(t.maximumTimestamp)&&Ml(t.minimumTimestamp)&&Ml(t.multipleOfTimestamp)}a(SQr,"IsDate");function TQr(t){return Ps(t,"Function")&&t.type==="Function"&&$c(t.$id)&&Tp(t.parameters)&&t.parameters.every(e=>Nu(e))&&Nu(t.returns)}a(TQr,"IsFunction");function _io(t){return Ps(t,"Import")&&O8e(t,"$defs")&&Gc(t.$defs)&&j8e(t.$defs)&&O8e(t,"$ref")&&Nl(t.$ref)&&t.$ref in t.$defs}a(_io,"IsImport");function IQr(t){return Ps(t,"Integer")&&t.type==="integer"&&$c(t.$id)&&Ml(t.exclusiveMaximum)&&Ml(t.exclusiveMinimum)&&Ml(t.maximum)&&Ml(t.minimum)&&Ml(t.multipleOf)}a(IQr,"IsInteger");function j8e(t){return Gc(t)&&Object.entries(t).every(([e,r])=>mwt(e)&&Nu(r))}a(j8e,"IsProperties");function xQr(t){return Ps(t,"Intersect")&&!(Nl(t.type)&&t.type!=="object")&&Tp(t.allOf)&&t.allOf.every(e=>Nu(e)&&!WQr(e))&&$c(t.type)&&(gwt(t.unevaluatedProperties)||mQr(t.unevaluatedProperties))&&$c(t.$id)}a(xQr,"IsIntersect");function wQr(t){return Ps(t,"Iterator")&&t.type==="Iterator"&&$c(t.$id)&&Nu(t.items)}a(wQr,"IsIterator");function Ps(t,e){return Gc(t)&&Tt in t&&t[Tt]===e}a(Ps,"IsKindOf");function RQr(t){return z_e(t)&&Nl(t.const)}a(RQr,"IsLiteralString");function PQr(t){return z_e(t)&&m1(t.const)}a(PQr,"IsLiteralNumber");function vio(t){return z_e(t)&&hB(t.const)}a(vio,"IsLiteralBoolean");function z_e(t){return Ps(t,"Literal")&&$c(t.$id)&&kQr(t.const)}a(z_e,"IsLiteral");function kQr(t){return hB(t)||m1(t)||Nl(t)}a(kQr,"IsLiteralValue");function DQr(t){return Ps(t,"MappedKey")&&Tp(t.keys)&&t.keys.every(e=>m1(e)||Nl(e))}a(DQr,"IsMappedKey");function NQr(t){return Ps(t,"MappedResult")&&j8e(t.properties)}a(NQr,"IsMappedResult");function MQr(t){return Ps(t,"Never")&&Gc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(MQr,"IsNever");function OQr(t){return Ps(t,"Not")&&Nu(t.not)}a(OQr,"IsNot");function BQr(t){return Ps(t,"Null")&&t.type==="null"&&$c(t.$id)}a(BQr,"IsNull");function LQr(t){return Ps(t,"Number")&&t.type==="number"&&$c(t.$id)&&Ml(t.exclusiveMaximum)&&Ml(t.exclusiveMinimum)&&Ml(t.maximum)&&Ml(t.minimum)&&Ml(t.multipleOf)}a(LQr,"IsNumber");function FQr(t){return Ps(t,"Object")&&t.type==="object"&&$c(t.$id)&&j8e(t.properties)&&hQr(t.additionalProperties)&&Ml(t.minProperties)&&Ml(t.maxProperties)}a(FQr,"IsObject");function UQr(t){return Ps(t,"Promise")&&t.type==="Promise"&&$c(t.$id)&&Nu(t.item)}a(UQr,"IsPromise");function QQr(t){return Ps(t,"Record")&&t.type==="object"&&$c(t.$id)&&hQr(t.additionalProperties)&&Gc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&pQr(r[0])&&Gc(e.patternProperties)&&Nu(e.patternProperties[r[0]])})(t)}a(QQr,"IsRecord");function Cio(t){return Gc(t)&&yI in t&&t[yI]==="Recursive"}a(Cio,"IsRecursive");function qQr(t){return Ps(t,"Ref")&&$c(t.$id)&&Nl(t.$ref)}a(qQr,"IsRef");function jQr(t){return Ps(t,"RegExp")&&$c(t.$id)&&Nl(t.source)&&Nl(t.flags)&&Ml(t.maxLength)&&Ml(t.minLength)}a(jQr,"IsRegExp");function HQr(t){return Ps(t,"String")&&t.type==="string"&&$c(t.$id)&&Ml(t.minLength)&&Ml(t.maxLength)&&gio(t.pattern)&&Aio(t.format)}a(HQr,"IsString");function GQr(t){return Ps(t,"Symbol")&&t.type==="symbol"&&$c(t.$id)}a(GQr,"IsSymbol");function $Qr(t){return Ps(t,"TemplateLiteral")&&t.type==="string"&&Nl(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a($Qr,"IsTemplateLiteral");function VQr(t){return Ps(t,"This")&&$c(t.$id)&&Nl(t.$ref)}a(VQr,"IsThis");function WQr(t){return Gc(t)&&vd in t}a(WQr,"IsTransform");function zQr(t){return Ps(t,"Tuple")&&t.type==="array"&&$c(t.$id)&&m1(t.minItems)&&m1(t.maxItems)&&t.minItems===t.maxItems&&(Ip(t.items)&&Ip(t.additionalItems)&&t.minItems===0||Tp(t.items)&&t.items.every(e=>Nu(e)))}a(zQr,"IsTuple");function YQr(t){return Ps(t,"Undefined")&&t.type==="undefined"&&$c(t.$id)}a(YQr,"IsUndefined");function bio(t){return Awt(t)&&t.anyOf.every(e=>RQr(e)||PQr(e))}a(bio,"IsUnionLiteral");function Awt(t){return Ps(t,"Union")&&$c(t.$id)&&Gc(t)&&Tp(t.anyOf)&&t.anyOf.every(e=>Nu(e))}a(Awt,"IsUnion");function KQr(t){return Ps(t,"Uint8Array")&&t.type==="Uint8Array"&&$c(t.$id)&&Ml(t.minByteLength)&&Ml(t.maxByteLength)}a(KQr,"IsUint8Array");function JQr(t){return Ps(t,"Unknown")&&$c(t.$id)}a(JQr,"IsUnknown");function ZQr(t){return Ps(t,"Unsafe")}a(ZQr,"IsUnsafe");function XQr(t){return Ps(t,"Void")&&t.type==="void"&&$c(t.$id)}a(XQr,"IsVoid");function eqr(t){return Gc(t)&&Tt in t&&Nl(t[Tt])&&!mio.includes(t[Tt])}a(eqr,"IsKind");function Nu(t){return Gc(t)&&(gQr(t)||AQr(t)||yQr(t)||vQr(t)||_Qr(t)||EQr(t)||CQr(t)||bQr(t)||SQr(t)||TQr(t)||IQr(t)||xQr(t)||wQr(t)||z_e(t)||DQr(t)||NQr(t)||MQr(t)||OQr(t)||BQr(t)||LQr(t)||FQr(t)||UQr(t)||QQr(t)||qQr(t)||jQr(t)||HQr(t)||GQr(t)||$Qr(t)||VQr(t)||zQr(t)||YQr(t)||Awt(t)||KQr(t)||JQr(t)||ZQr(t)||XQr(t)||eqr(t))}a(Nu,"IsSchema");p();var ywt="(true|false)",Y_e="(0|[1-9][0-9]*)",Ewt="(.*)",Sio="(?!.*)",zXc=`^${ywt}$`,E9=`^${Y_e}$`,_9=`^${Ewt}$`,tqr=`^${Sio}$`;p();var aP={};xi(aP,{Clear:()=>Iio,Delete:()=>xio,Entries:()=>Tio,Get:()=>Pio,Has:()=>wio,Set:()=>Rio});p();var sie=new Map;function Tio(){return new Map(sie)}a(Tio,"Entries");function Iio(){return sie.clear()}a(Iio,"Clear");function xio(t){return sie.delete(t)}a(xio,"Delete");function wio(t){return sie.has(t)}a(wio,"Has");function Rio(t,e){sie.set(t,e)}a(Rio,"Set");function Pio(t){return sie.get(t)}a(Pio,"Get");var t_={};xi(t_,{Clear:()=>Dio,Delete:()=>Nio,Entries:()=>kio,Get:()=>Bio,Has:()=>Mio,Set:()=>Oio});p();var aie=new Map;function kio(){return new Map(aie)}a(kio,"Entries");function Dio(){return aie.clear()}a(Dio,"Clear");function Nio(t){return aie.delete(t)}a(Nio,"Delete");function Mio(t){return aie.has(t)}a(Mio,"Has");function Oio(t,e){aie.set(t,e)}a(Oio,"Set");function Bio(t){return aie.get(t)}a(Bio,"Get");p();function rqr(t,e){return t.includes(e)}a(rqr,"SetIncludes");function nqr(t){return[...new Set(t)]}a(nqr,"SetDistinct");function Lio(t,e){return t.filter(r=>e.includes(r))}a(Lio,"SetIntersect");function Fio(t,e){return t.reduce((r,n)=>Lio(r,n),e)}a(Fio,"SetIntersectManyResolve");function iqr(t){return t.length===1?t[0]:t.length>1?Fio(t.slice(1),t[0]):[]}a(iqr,"SetIntersectMany");function oqr(t){let e=[];for(let r of t)e.push(...r);return e}a(oqr,"SetUnionMany");p();function v9(t){return wt({[Tt]:"Any"},t)}a(v9,"Any");p();function cie(t,e){return wt({[Tt]:"Array",type:"array",items:t},e)}a(cie,"Array");p();function sqr(t){return wt({[Tt]:"Argument",index:t})}a(sqr,"Argument");p();function lie(t,e){return wt({[Tt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(lie,"AsyncIterator");p();p();function Zl(t,e,r){return wt({[Tt]:"Computed",target:t,parameters:e},r)}a(Zl,"Computed");p();p();function Uio(t,e){let{[e]:r,...n}=t;return n}a(Uio,"DiscardKey");function Jd(t,e){return e.reduce((r,n)=>Uio(r,n),t)}a(Jd,"Discard");p();function Vo(t){return wt({[Tt]:"Never",not:{}},t)}a(Vo,"Never");p();p();function Ba(t){return wt({[Tt]:"MappedResult",properties:t})}a(Ba,"MappedResult");p();p();function uie(t,e,r){return wt({[Tt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(uie,"Constructor");p();function AN(t,e,r){return wt({[Tt]:"Function",type:"Function",parameters:t,returns:e},r)}a(AN,"Function");p();p();p();p();function K_e(t,e){return wt({[Tt]:"Union",anyOf:t},e)}a(K_e,"UnionCreate");function Qio(t){return t.some(e=>Qv(e))}a(Qio,"IsUnionOptional");function aqr(t){return t.map(e=>Qv(e)?qio(e):e)}a(aqr,"RemoveOptionalFromRest");function qio(t){return Jd(t,[Kg])}a(qio,"RemoveOptionalFromType");function jio(t,e){return Qio(t)?vy(K_e(aqr(t),e)):K_e(aqr(t),e)}a(jio,"ResolveUnion");function yN(t,e){return t.length===1?wt(t[0],e):t.length===0?Vo(e):jio(t,e)}a(yN,"UnionEvaluated");p();function Ja(t,e){return t.length===0?Vo(e):t.length===1?wt(t[0],e):K_e(t,e)}a(Ja,"Union");p();p();p();var H8e=class extends Qi{static{a(this,"TemplateLiteralParserError")}};function Hio(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(Hio,"Unescape");function _wt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(_wt,"IsNonEscaped");function CB(t,e){return _wt(t,e,"(")}a(CB,"IsOpenParen");function J_e(t,e){return _wt(t,e,")")}a(J_e,"IsCloseParen");function cqr(t,e){return _wt(t,e,"|")}a(cqr,"IsSeparator");function Gio(t){if(!(CB(t,0)&&J_e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(die(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(die(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(zio,"Or");function Yio(t){function e(o,s){if(!CB(o,s))throw new H8e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(die(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(Yio,"And");function die(t){return Gio(t)?die($io(t)):Vio(t)?zio(t):Wio(t)?Yio(t):{type:"const",const:Hio(t)}}a(die,"TemplateLiteralParse");function fie(t){return die(t.slice(1,t.length-1))}a(fie,"TemplateLiteralParseExact");var vwt=class extends Qi{static{a(this,"TemplateLiteralFiniteError")}};function Kio(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(Kio,"IsNumberExpression");function Jio(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(Jio,"IsBooleanExpression");function Zio(t){return t.type==="const"&&t.const===".*"}a(Zio,"IsStringExpression");function DV(t){return Kio(t)||Zio(t)?!1:Jio(t)?!0:t.type==="and"?t.expr.every(e=>DV(e)):t.type==="or"?t.expr.every(e=>DV(e)):t.type==="const"?!0:(()=>{throw new vwt("Unknown expression type")})()}a(DV,"IsTemplateLiteralExpressionFinite");function G8e(t){let e=fie(t.pattern);return DV(e)}a(G8e,"IsTemplateLiteralFinite");p();var Cwt=class extends Qi{static{a(this,"TemplateLiteralGenerateError")}};function*lqr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of lqr(t.slice(1)))yield`${e}${r}`}a(lqr,"GenerateReduce");function*Xio(t){return yield*lqr(t.expr.map(e=>[...Z_e(e)]))}a(Xio,"GenerateAnd");function*eoo(t){for(let e of t.expr)yield*Z_e(e)}a(eoo,"GenerateOr");function*too(t){return yield t.const}a(too,"GenerateConst");function*Z_e(t){return t.type==="and"?yield*Xio(t):t.type==="or"?yield*eoo(t):t.type==="const"?yield*too(t):(()=>{throw new Cwt("Unknown expression")})()}a(Z_e,"TemplateLiteralExpressionGenerate");function pie(t){let e=fie(t.pattern);return DV(e)?[...Z_e(e)]:[]}a(pie,"TemplateLiteralGenerate");p();p();function ta(t,e){return wt({[Tt]:"Literal",const:t,type:typeof t},e)}a(ta,"Literal");p();function $8e(t){return wt({[Tt]:"Boolean",type:"boolean"},t)}a($8e,"Boolean");p();function hie(t){return wt({[Tt]:"BigInt",type:"bigint"},t)}a(hie,"BigInt");p();function EI(t){return wt({[Tt]:"Number",type:"number"},t)}a(EI,"Number");p();function r_(t){return wt({[Tt]:"String",type:"string"},t)}a(r_,"String");function*roo(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield $8e():e==="number"?yield EI():e==="bigint"?yield hie():e==="string"?yield r_():yield(()=>{let r=e.split("|").map(n=>ta(n.trim()));return r.length===0?Vo():r.length===1?r[0]:yN(r)})()}a(roo,"FromUnion");function*noo(t){if(t[1]!=="{"){let e=ta("$"),r=bwt(t.slice(1));return yield*[e,...r]}for(let e=2;edqr(r,e)).join("|")})`:sP(t)?`${e}${Y_e}`:oP(t)?`${e}${Y_e}`:wV(t)?`${e}${Y_e}`:EB(t)?`${e}${Ewt}`:A1(t)?`${e}${ioo(t.const.toString())}`:yB(t)?`${e}${ywt}`:(()=>{throw new Swt(`Unexpected Kind '${t[Tt]}'`)})()}a(dqr,"Visit");function Twt(t){return`^${t.map(e=>dqr(e,"")).join("")}$`}a(Twt,"TemplateLiteralPattern");p();function NV(t){let r=pie(t).map(n=>ta(n));return yN(r)}a(NV,"TemplateLiteralToUnion");p();function V8e(t,e){let r=Nl(t)?Twt(uqr(t)):Twt(t);return wt({[Tt]:"TemplateLiteral",type:"string",pattern:r},e)}a(V8e,"TemplateLiteral");function ooo(t){return pie(t).map(r=>r.toString())}a(ooo,"FromTemplateLiteral");function soo(t){let e=[];for(let r of t)e.push(...qv(r));return e}a(soo,"FromUnion");function aoo(t){return[t.toString()]}a(aoo,"FromLiteral");function qv(t){return[...new Set(E1(t)?ooo(t):_a(t)?soo(t.anyOf):A1(t)?aoo(t.const):sP(t)?["[number]"]:oP(t)?["[number]"]:[])]}a(qv,"IndexPropertyKeys");p();function coo(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=C9(t,qv(e[o]),r);return n}a(coo,"FromProperties");function loo(t,e,r){return coo(t,e.properties,r)}a(loo,"FromMappedResult");function fqr(t,e,r){let n=loo(t,e,r);return Ba(n)}a(fqr,"IndexFromMappedResult");function hqr(t,e){return t.map(r=>mqr(r,e))}a(hqr,"FromRest");function uoo(t){return t.filter(e=>!A9(e))}a(uoo,"FromIntersectRest");function doo(t,e){return W8e(uoo(hqr(t,e)))}a(doo,"FromIntersect");function foo(t){return t.some(e=>A9(e))?[]:t}a(foo,"FromUnionRest");function poo(t,e){return yN(foo(hqr(t,e)))}a(poo,"FromUnion");function hoo(t,e){return e in t?t[e]:e==="[number]"?yN(t):Vo()}a(hoo,"FromTuple");function moo(t,e){return e==="[number]"?t:Vo()}a(moo,"FromArray");function goo(t,e){return e in t?t[e]:Vo()}a(goo,"FromProperty");function mqr(t,e){return Kd(t)?doo(t.allOf,e):_a(t)?poo(t.anyOf,e):_1(t)?hoo(t.items??[],e):tP(t)?moo(t.items,e):xp(t)?goo(t.properties,e):Vo()}a(mqr,"IndexFromPropertyKey");function X_e(t,e){return e.map(r=>mqr(t,r))}a(X_e,"IndexFromPropertyKeys");function pqr(t,e){return yN(X_e(t,e))}a(pqr,"FromSchema");function C9(t,e,r){if(Mf(t)||Mf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Cd(t)||!Cd(e))throw new Qi(n);return Zl("Index",[t,e])}return Du(e)?fqr(t,e,r):y1(e)?gqr(t,e,r):wt(Cd(e)?pqr(t,qv(e)):pqr(t,e),r)}a(C9,"Index");function Aoo(t,e,r){return{[e]:C9(t,[e],Pu(r))}}a(Aoo,"MappedIndexPropertyKey");function yoo(t,e,r){return e.reduce((n,o)=>({...n,...Aoo(t,o,r)}),{})}a(yoo,"MappedIndexPropertyKeys");function Eoo(t,e,r){return yoo(t,e.keys,r)}a(Eoo,"MappedIndexProperties");function gqr(t,e,r){let n=Eoo(t,e,r);return Ba(n)}a(gqr,"IndexFromMappedKey");p();function mie(t,e){return wt({[Tt]:"Iterator",type:"Iterator",items:t},e)}a(mie,"Iterator");p();function _oo(t){return globalThis.Object.keys(t).filter(e=>!Qv(t[e]))}a(_oo,"RequiredArray");function voo(t,e){let r=_oo(t),n=r.length>0?{[Tt]:"Object",type:"object",required:r,properties:t}:{[Tt]:"Object",type:"object",properties:t};return wt(n,e)}a(voo,"_Object");var Za=voo;p();function z8e(t,e){return wt({[Tt]:"Promise",type:"Promise",item:t},e)}a(z8e,"Promise");p();p();function Coo(t){return wt(Jd(t,[eP]))}a(Coo,"RemoveReadonly");function boo(t){return wt({...t,[eP]:"Readonly"})}a(boo,"AddReadonly");function Soo(t,e){return e===!1?Coo(t):boo(t)}a(Soo,"ReadonlyWithFlag");function jv(t,e){let r=e??!0;return Du(t)?Aqr(t,r):Soo(t,r)}a(jv,"Readonly");function Too(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=jv(t[n],e);return r}a(Too,"FromProperties");function Ioo(t,e){return Too(t.properties,e)}a(Ioo,"FromMappedResult");function Aqr(t,e){let r=Ioo(t,e);return Ba(r)}a(Aqr,"ReadonlyFromMappedResult");p();function _I(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(_I,"Tuple");function yqr(t,e){return t in e?vI(t,e[t]):Ba(e)}a(yqr,"FromMappedResult");function xoo(t){return{[t]:ta(t)}}a(xoo,"MappedKeyToKnownMappedResultProperties");function woo(t){let e={};for(let r of t)e[r]=ta(r);return e}a(woo,"MappedKeyToUnknownMappedResultProperties");function Roo(t,e){return rqr(e,t)?xoo(t):woo(e)}a(Roo,"MappedKeyToMappedResultProperties");function Poo(t,e){let r=Roo(t,e);return yqr(t,r)}a(Poo,"FromMappedKey");function eve(t,e){return e.map(r=>vI(t,r))}a(eve,"FromRest");function koo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=vI(t,e[n]);return r}a(koo,"FromProperties");function vI(t,e){let r={...e};return Qv(e)?vy(vI(t,Jd(e,[Kg]))):oie(e)?jv(vI(t,Jd(e,[eP]))):Du(e)?yqr(t,e.properties):y1(e)?Poo(t,e.keys):nP(e)?uie(eve(t,e.parameters),vI(t,e.returns),r):iP(e)?AN(eve(t,e.parameters),vI(t,e.returns),r):xV(e)?lie(vI(t,e.items),r):RV(e)?mie(vI(t,e.items),r):Kd(e)?Cy(eve(t,e.allOf),r):_a(e)?Ja(eve(t,e.anyOf),r):_1(e)?_I(eve(t,e.items??[]),r):xp(e)?Za(koo(t,e.properties),r):tP(e)?cie(vI(t,e.items),r):PV(e)?z8e(vI(t,e.item),r):e}a(vI,"FromSchemaType");function Doo(t,e){let r={};for(let n of t)r[n]=vI(n,e);return r}a(Doo,"MappedFunctionReturnType");function Eqr(t,e,r){let n=Cd(t)?qv(t):t,o=e({[Tt]:"MappedKey",keys:n}),s=Doo(n,o);return Za(s,r)}a(Eqr,"Mapped");p();function Noo(t){return wt(Jd(t,[Kg]))}a(Noo,"RemoveOptional");function Moo(t){return wt({...t,[Kg]:"Optional"})}a(Moo,"AddOptional");function Ooo(t,e){return e===!1?Noo(t):Moo(t)}a(Ooo,"OptionalWithFlag");function vy(t,e){let r=e??!0;return Du(t)?_qr(t,r):Ooo(t,r)}a(vy,"Optional");function Boo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=vy(t[n],e);return r}a(Boo,"FromProperties");function Loo(t,e){return Boo(t.properties,e)}a(Loo,"FromMappedResult");function _qr(t,e){let r=Loo(t,e);return Ba(r)}a(_qr,"OptionalFromMappedResult");p();function tve(t,e={}){let r=t.every(o=>xp(o)),n=Cd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||Cd(e.unevaluatedProperties)||r?{...n,[Tt]:"Intersect",type:"object",allOf:t}:{...n,[Tt]:"Intersect",allOf:t},e)}a(tve,"IntersectCreate");function Foo(t){return t.every(e=>Qv(e))}a(Foo,"IsIntersectOptional");function Uoo(t){return Jd(t,[Kg])}a(Uoo,"RemoveOptionalFromType");function vqr(t){return t.map(e=>Qv(e)?Uoo(e):e)}a(vqr,"RemoveOptionalFromRest");function Qoo(t,e){return Foo(t)?vy(tve(vqr(t),e)):tve(vqr(t),e)}a(Qoo,"ResolveIntersect");function W8e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return Vo(e);if(t.some(r=>Ka(r)))throw new Error("Cannot intersect transform types");return Qoo(t,e)}a(W8e,"IntersectEvaluated");p();function Cy(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return Vo(e);if(t.some(r=>Ka(r)))throw new Error("Cannot intersect transform types");return tve(t,e)}a(Cy,"Intersect");p();function CI(...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(CI,"Ref");function qoo(t,e){return Zl("Awaited",[Zl(t,e)])}a(qoo,"FromComputed");function joo(t){return Zl("Awaited",[CI(t)])}a(joo,"FromRef");function Hoo(t){return Cy(Cqr(t))}a(Hoo,"FromIntersect");function Goo(t){return Ja(Cqr(t))}a(Goo,"FromUnion");function $oo(t){return gie(t)}a($oo,"FromPromise");function Cqr(t){return t.map(e=>gie(e))}a(Cqr,"FromRest");function gie(t,e){return wt(rP(t)?qoo(t.target,t.parameters):Kd(t)?Hoo(t.allOf):_a(t)?Goo(t.anyOf):PV(t)?$oo(t.item):Mf(t)?joo(t.$ref):t,e)}a(gie,"Awaited");p();p();p();p();function bqr(t){let e=[];for(let r of t)e.push(Hv(r));return e}a(bqr,"FromRest");function Voo(t){let e=bqr(t);return oqr(e)}a(Voo,"FromIntersect");function Woo(t){let e=bqr(t);return iqr(e)}a(Woo,"FromUnion");function zoo(t){return t.map((e,r)=>r.toString())}a(zoo,"FromTuple");function Yoo(t){return["[number]"]}a(Yoo,"FromArray");function Koo(t){return globalThis.Object.getOwnPropertyNames(t)}a(Koo,"FromProperties");function Joo(t){return Iwt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(Joo,"FromPatternProperties");function Hv(t){return Kd(t)?Voo(t.allOf):_a(t)?Woo(t.anyOf):_1(t)?zoo(t.items??[]):tP(t)?Yoo(t.items):xp(t)?Koo(t.properties):kV(t)?Joo(t.patternProperties):[]}a(Hv,"KeyOfPropertyKeys");var Iwt=!1;function bB(t){Iwt=!0;let e=Hv(t);return Iwt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(bB,"KeyOfPattern");function Zoo(t,e){return Zl("KeyOf",[Zl(t,e)])}a(Zoo,"FromComputed");function Xoo(t){return Zl("KeyOf",[CI(t)])}a(Xoo,"FromRef");function eso(t,e){let r=Hv(t),n=tso(r),o=yN(n);return wt(o,e)}a(eso,"KeyOfFromType");function tso(t){return t.map(e=>e==="[number]"?EI():ta(e))}a(tso,"KeyOfPropertyKeysToRest");function Aie(t,e){return rP(t)?Zoo(t.target,t.parameters):Mf(t)?Xoo(t.$ref):Du(t)?Sqr(t,e):eso(t,e)}a(Aie,"KeyOf");function rso(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Aie(t[n],Pu(e));return r}a(rso,"FromProperties");function nso(t,e){return rso(t.properties,e)}a(nso,"FromMappedResult");function Sqr(t,e){let r=nso(t,e);return Ba(r)}a(Sqr,"KeyOfFromMappedResult");p();function Y8e(t){let e=Hv(t),r=X_e(t,e);return e.map((n,o)=>[e[o],r[o]])}a(Y8e,"KeyOfPropertyEntries");function iso(t){let e=[];for(let r of t)e.push(...Hv(r));return nqr(e)}a(iso,"CompositeKeys");function oso(t){return t.filter(e=>!A9(e))}a(oso,"FilterNever");function sso(t,e){let r=[];for(let n of t)r.push(...X_e(n,[e]));return oso(r)}a(sso,"CompositeProperty");function aso(t,e){let r={};for(let n of e)r[n]=W8e(sso(t,n));return r}a(aso,"CompositeProperties");function Tqr(t,e){let r=iso(t),n=aso(t,r);return Za(n,e)}a(Tqr,"Composite");p();p();function K8e(t){return wt({[Tt]:"Date",type:"Date"},t)}a(K8e,"Date");p();function J8e(t){return wt({[Tt]:"Null",type:"null"},t)}a(J8e,"Null");p();function Z8e(t){return wt({[Tt]:"Symbol",type:"symbol"},t)}a(Z8e,"Symbol");p();function X8e(t){return wt({[Tt]:"Undefined",type:"undefined"},t)}a(X8e,"Undefined");p();function e6e(t){return wt({[Tt]:"Uint8Array",type:"Uint8Array"},t)}a(e6e,"Uint8Array");p();function cP(t){return wt({[Tt]:"Unknown"},t)}a(cP,"Unknown");function cso(t){return t.map(e=>xwt(e,!1))}a(cso,"FromArray");function lso(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=jv(xwt(t[r],!1));return e}a(lso,"FromProperties");function t6e(t,e){return e===!0?t:jv(t)}a(t6e,"ConditionalReadonly");function xwt(t,e){return owt(t)?t6e(v9(),e):awt(t)?t6e(v9(),e):Tp(t)?jv(_I(cso(t))):mB(t)?e6e():IV(t)?K8e():Gc(t)?t6e(Za(lso(t)),e):swt(t)?t6e(AN([],cP()),e):Ip(t)?X8e():cwt(t)?J8e():lwt(t)?Z8e():j_e(t)?hie():m1(t)?ta(t):hB(t)?ta(t):Nl(t)?ta(t):Za({})}a(xwt,"FromValue");function Iqr(t,e){return wt(xwt(t,!0),e)}a(Iqr,"Const");p();function xqr(t,e){return nP(t)?_I(t.parameters,e):Vo(e)}a(xqr,"ConstructorParameters");p();function wqr(t,e){if(Ip(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=>ta(s));return Ja(o,{...e,[yI]:"Enum"})}a(wqr,"Enum");p();p();p();var Rwt=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 bI(t){return t===Rt.False?t:Rt.True}a(bI,"IntoBooleanResult");function yie(t){throw new Rwt(t)}a(yie,"Throw");function hh(t){return nt.IsNever(t)||nt.IsIntersect(t)||nt.IsUnion(t)||nt.IsUnknown(t)||nt.IsAny(t)}a(hh,"IsStructuralRight");function mh(t,e){return nt.IsNever(e)?Oqr(t,e):nt.IsIntersect(e)?r6e(t,e):nt.IsUnion(e)?Nwt(t,e):nt.IsUnknown(e)?Uqr(t,e):nt.IsAny(e)?Dwt(t,e):yie("StructuralRight")}a(mh,"StructuralRight");function Dwt(t,e){return Rt.True}a(Dwt,"FromAnyRight");function uso(t,e){return nt.IsIntersect(e)?r6e(t,e):nt.IsUnion(e)&&e.anyOf.some(r=>nt.IsAny(r)||nt.IsUnknown(r))?Rt.True:nt.IsUnion(e)?Rt.Union:nt.IsUnknown(e)||nt.IsAny(e)?Rt.True:Rt.Union}a(uso,"FromAny");function dso(t,e){return nt.IsUnknown(t)?Rt.False:nt.IsAny(t)?Rt.Union:nt.IsNever(t)?Rt.True:Rt.False}a(dso,"FromArrayRight");function fso(t,e){return nt.IsObject(e)&&n6e(e)?Rt.True:hh(e)?mh(t,e):nt.IsArray(e)?bI(Vc(t.items,e.items)):Rt.False}a(fso,"FromArray");function pso(t,e){return hh(e)?mh(t,e):nt.IsAsyncIterator(e)?bI(Vc(t.items,e.items)):Rt.False}a(pso,"FromAsyncIterator");function hso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsBigInt(e)?Rt.True:Rt.False}a(hso,"FromBigInt");function Nqr(t,e){return nt.IsLiteralBoolean(t)||nt.IsBoolean(t)?Rt.True:Rt.False}a(Nqr,"FromBooleanRight");function mso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsBoolean(e)?Rt.True:Rt.False}a(mso,"FromBoolean");function gso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>bI(Vc(e.parameters[n],r))===Rt.True)?bI(Vc(t.returns,e.returns)):Rt.False:Rt.False}a(gso,"FromConstructor");function Aso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsDate(e)?Rt.True:Rt.False}a(Aso,"FromDate");function yso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>bI(Vc(e.parameters[n],r))===Rt.True)?bI(Vc(t.returns,e.returns)):Rt.False:Rt.False}a(yso,"FromFunction");function Mqr(t,e){return nt.IsLiteral(t)&&_y.IsNumber(t.const)||nt.IsNumber(t)||nt.IsInteger(t)?Rt.True:Rt.False}a(Mqr,"FromIntegerRight");function Eso(t,e){return nt.IsInteger(e)||nt.IsNumber(e)?Rt.True:hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):Rt.False}a(Eso,"FromInteger");function r6e(t,e){return e.allOf.every(r=>Vc(t,r)===Rt.True)?Rt.True:Rt.False}a(r6e,"FromIntersectRight");function _so(t,e){return t.allOf.some(r=>Vc(r,e)===Rt.True)?Rt.True:Rt.False}a(_so,"FromIntersect");function vso(t,e){return hh(e)?mh(t,e):nt.IsIterator(e)?bI(Vc(t.items,e.items)):Rt.False}a(vso,"FromIterator");function Cso(t,e){return nt.IsLiteral(e)&&e.const===t.const?Rt.True:hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsString(e)?Fqr(t,e):nt.IsNumber(e)?Bqr(t,e):nt.IsInteger(e)?Mqr(t,e):nt.IsBoolean(e)?Nqr(t,e):Rt.False}a(Cso,"FromLiteral");function Oqr(t,e){return Rt.False}a(Oqr,"FromNeverRight");function bso(t,e){return Rt.True}a(bso,"FromNever");function Rqr(t){let[e,r]=[t,0];for(;nt.IsNot(e);)e=e.not,r+=1;return r%2===0?e:cP()}a(Rqr,"UnwrapTNot");function Sso(t,e){return nt.IsNot(t)?Vc(Rqr(t),e):nt.IsNot(e)?Vc(t,Rqr(e)):yie("Invalid fallthrough for Not")}a(Sso,"FromNot");function Tso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsNull(e)?Rt.True:Rt.False}a(Tso,"FromNull");function Bqr(t,e){return nt.IsLiteralNumber(t)||nt.IsNumber(t)||nt.IsInteger(t)?Rt.True:Rt.False}a(Bqr,"FromNumberRight");function Iso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsInteger(e)||nt.IsNumber(e)?Rt.True:Rt.False}a(Iso,"FromNumber");function Gv(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(Gv,"IsObjectPropertyCount");function Pqr(t){return n6e(t)}a(Pqr,"IsObjectStringLike");function kqr(t){return Gv(t,0)||Gv(t,1)&&"description"in t.properties&&nt.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(nt.IsString(t.properties.description.anyOf[0])&&nt.IsUndefined(t.properties.description.anyOf[1])||nt.IsString(t.properties.description.anyOf[1])&&nt.IsUndefined(t.properties.description.anyOf[0]))}a(kqr,"IsObjectSymbolLike");function wwt(t){return Gv(t,0)}a(wwt,"IsObjectNumberLike");function Dqr(t){return Gv(t,0)}a(Dqr,"IsObjectBooleanLike");function xso(t){return Gv(t,0)}a(xso,"IsObjectBigIntLike");function wso(t){return Gv(t,0)}a(wso,"IsObjectDateLike");function Rso(t){return n6e(t)}a(Rso,"IsObjectUint8ArrayLike");function Pso(t){let e=EI();return Gv(t,0)||Gv(t,1)&&"length"in t.properties&&bI(Vc(t.properties.length,e))===Rt.True}a(Pso,"IsObjectFunctionLike");function kso(t){return Gv(t,0)}a(kso,"IsObjectConstructorLike");function n6e(t){let e=EI();return Gv(t,0)||Gv(t,1)&&"length"in t.properties&&bI(Vc(t.properties.length,e))===Rt.True}a(n6e,"IsObjectArrayLike");function Dso(t){let e=AN([v9()],v9());return Gv(t,0)||Gv(t,1)&&"then"in t.properties&&bI(Vc(t.properties.then,e))===Rt.True}a(Dso,"IsObjectPromiseLike");function Lqr(t,e){return Vc(t,e)===Rt.False||nt.IsOptional(t)&&!nt.IsOptional(e)?Rt.False:Rt.True}a(Lqr,"Property");function by(t,e){return nt.IsUnknown(t)?Rt.False:nt.IsAny(t)?Rt.Union:nt.IsNever(t)||nt.IsLiteralString(t)&&Pqr(e)||nt.IsLiteralNumber(t)&&wwt(e)||nt.IsLiteralBoolean(t)&&Dqr(e)||nt.IsSymbol(t)&&kqr(e)||nt.IsBigInt(t)&&xso(e)||nt.IsString(t)&&Pqr(e)||nt.IsSymbol(t)&&kqr(e)||nt.IsNumber(t)&&wwt(e)||nt.IsInteger(t)&&wwt(e)||nt.IsBoolean(t)&&Dqr(e)||nt.IsUint8Array(t)&&Rso(e)||nt.IsDate(t)&&wso(e)||nt.IsConstructor(t)&&kso(e)||nt.IsFunction(t)&&Pso(e)?Rt.True:nt.IsRecord(t)&&nt.IsString(Pwt(t))?e[yI]==="Record"?Rt.True:Rt.False:nt.IsRecord(t)&&nt.IsNumber(Pwt(t))&&Gv(e,0)?Rt.True:Rt.False}a(by,"FromObjectRight");function Nso(t,e){return hh(e)?mh(t,e):nt.IsRecord(e)?SI(t,e):nt.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!nt.IsOptional(e.properties[r]))return Rt.False;if(nt.IsOptional(e.properties[r]))return Rt.True;if(Lqr(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(Nso,"FromObject");function Mso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)&&Dso(e)?Rt.True:nt.IsPromise(e)?bI(Vc(t.item,e.item)):Rt.False}a(Mso,"FromPromise");function Pwt(t){return E9 in t.patternProperties?EI():_9 in t.patternProperties?r_():yie("Unknown record key pattern")}a(Pwt,"RecordKey");function kwt(t){return E9 in t.patternProperties?t.patternProperties[E9]:_9 in t.patternProperties?t.patternProperties[_9]:yie("Unable to get record value schema")}a(kwt,"RecordValue");function SI(t,e){let[r,n]=[Pwt(e),kwt(e)];return nt.IsLiteralString(t)&&nt.IsNumber(r)&&bI(Vc(t,n))===Rt.True?Rt.True:nt.IsUint8Array(t)&&nt.IsNumber(r)||nt.IsString(t)&&nt.IsNumber(r)||nt.IsArray(t)&&nt.IsNumber(r)?Vc(t,n):nt.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(Lqr(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(SI,"FromRecordRight");function Oso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?Vc(kwt(t),kwt(e)):Rt.False}a(Oso,"FromRecord");function Bso(t,e){let r=nt.IsRegExp(t)?r_():t,n=nt.IsRegExp(e)?r_():e;return Vc(r,n)}a(Bso,"FromRegExp");function Fqr(t,e){return nt.IsLiteral(t)&&_y.IsString(t.const)||nt.IsString(t)?Rt.True:Rt.False}a(Fqr,"FromStringRight");function Lso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsString(e)?Rt.True:Rt.False}a(Lso,"FromString");function Fso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsSymbol(e)?Rt.True:Rt.False}a(Fso,"FromSymbol");function Uso(t,e){return nt.IsTemplateLiteral(t)?Vc(NV(t),e):nt.IsTemplateLiteral(e)?Vc(t,NV(e)):yie("Invalid fallthrough for TemplateLiteral")}a(Uso,"FromTemplateLiteral");function Qso(t,e){return nt.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Vc(r,e.items)===Rt.True)}a(Qso,"IsArrayOfTuple");function qso(t,e){return nt.IsNever(t)?Rt.True:nt.IsUnknown(t)?Rt.False:nt.IsAny(t)?Rt.Union:Rt.False}a(qso,"FromTupleRight");function jso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)&&n6e(e)||nt.IsArray(e)&&Qso(t,e)?Rt.True:nt.IsTuple(e)?_y.IsUndefined(t.items)&&!_y.IsUndefined(e.items)||!_y.IsUndefined(t.items)&&_y.IsUndefined(e.items)?Rt.False:_y.IsUndefined(t.items)&&!_y.IsUndefined(e.items)||t.items.every((r,n)=>Vc(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(jso,"FromTuple");function Hso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsUint8Array(e)?Rt.True:Rt.False}a(Hso,"FromUint8Array");function Gso(t,e){return hh(e)?mh(t,e):nt.IsObject(e)?by(t,e):nt.IsRecord(e)?SI(t,e):nt.IsVoid(e)?Wso(t,e):nt.IsUndefined(e)?Rt.True:Rt.False}a(Gso,"FromUndefined");function Nwt(t,e){return e.anyOf.some(r=>Vc(t,r)===Rt.True)?Rt.True:Rt.False}a(Nwt,"FromUnionRight");function $so(t,e){return t.anyOf.every(r=>Vc(r,e)===Rt.True)?Rt.True:Rt.False}a($so,"FromUnion");function Uqr(t,e){return Rt.True}a(Uqr,"FromUnknownRight");function Vso(t,e){return nt.IsNever(e)?Oqr(t,e):nt.IsIntersect(e)?r6e(t,e):nt.IsUnion(e)?Nwt(t,e):nt.IsAny(e)?Dwt(t,e):nt.IsString(e)?Fqr(t,e):nt.IsNumber(e)?Bqr(t,e):nt.IsInteger(e)?Mqr(t,e):nt.IsBoolean(e)?Nqr(t,e):nt.IsArray(e)?dso(t,e):nt.IsTuple(e)?qso(t,e):nt.IsObject(e)?by(t,e):nt.IsUnknown(e)?Rt.True:Rt.False}a(Vso,"FromUnknown");function Wso(t,e){return nt.IsUndefined(t)||nt.IsUndefined(t)?Rt.True:Rt.False}a(Wso,"FromVoidRight");function zso(t,e){return nt.IsIntersect(e)?r6e(t,e):nt.IsUnion(e)?Nwt(t,e):nt.IsUnknown(e)?Uqr(t,e):nt.IsAny(e)?Dwt(t,e):nt.IsObject(e)?by(t,e):nt.IsVoid(e)?Rt.True:Rt.False}a(zso,"FromVoid");function Vc(t,e){return nt.IsTemplateLiteral(t)||nt.IsTemplateLiteral(e)?Uso(t,e):nt.IsRegExp(t)||nt.IsRegExp(e)?Bso(t,e):nt.IsNot(t)||nt.IsNot(e)?Sso(t,e):nt.IsAny(t)?uso(t,e):nt.IsArray(t)?fso(t,e):nt.IsBigInt(t)?hso(t,e):nt.IsBoolean(t)?mso(t,e):nt.IsAsyncIterator(t)?pso(t,e):nt.IsConstructor(t)?gso(t,e):nt.IsDate(t)?Aso(t,e):nt.IsFunction(t)?yso(t,e):nt.IsInteger(t)?Eso(t,e):nt.IsIntersect(t)?_so(t,e):nt.IsIterator(t)?vso(t,e):nt.IsLiteral(t)?Cso(t,e):nt.IsNever(t)?bso(t,e):nt.IsNull(t)?Tso(t,e):nt.IsNumber(t)?Iso(t,e):nt.IsObject(t)?Nso(t,e):nt.IsRecord(t)?Oso(t,e):nt.IsString(t)?Lso(t,e):nt.IsSymbol(t)?Fso(t,e):nt.IsTuple(t)?jso(t,e):nt.IsPromise(t)?Mso(t,e):nt.IsUint8Array(t)?Hso(t,e):nt.IsUndefined(t)?Gso(t,e):nt.IsUnion(t)?$so(t,e):nt.IsUnknown(t)?Vso(t,e):nt.IsVoid(t)?zso(t,e):yie(`Unknown left type operand '${t[Tt]}'`)}a(Vc,"Visit");function b9(t,e){return Vc(t,e)}a(b9,"ExtendsCheck");p();p();p();function Yso(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Eie(t[c],e,r,n,Pu(o));return s}a(Yso,"FromProperties");function Kso(t,e,r,n,o){return Yso(t.properties,e,r,n,o)}a(Kso,"FromMappedResult");function Qqr(t,e,r,n,o){let s=Kso(t,e,r,n,o);return Ba(s)}a(Qqr,"ExtendsFromMappedResult");function Jso(t,e,r,n){let o=b9(t,e);return o===Rt.Union?Ja([r,n]):o===Rt.True?r:n}a(Jso,"ExtendsResolve");function Eie(t,e,r,n,o){return Du(t)?Qqr(t,e,r,n,o):y1(t)?wt(qqr(t,e,r,n,o)):wt(Jso(t,e,r,n),o)}a(Eie,"Extends");function Zso(t,e,r,n,o){return{[t]:Eie(ta(t),e,r,n,Pu(o))}}a(Zso,"FromPropertyKey");function Xso(t,e,r,n,o){return t.reduce((s,c)=>({...s,...Zso(c,e,r,n,o)}),{})}a(Xso,"FromPropertyKeys");function eao(t,e,r,n,o){return Xso(t.keys,e,r,n,o)}a(eao,"FromMappedKey");function qqr(t,e,r,n,o){let s=eao(t,e,r,n,o);return Ba(s)}a(qqr,"ExtendsFromMappedKey");p();function tao(t){return t.allOf.every(e=>SB(e))}a(tao,"Intersect");function rao(t){return t.anyOf.some(e=>SB(e))}a(rao,"Union");function nao(t){return!SB(t.not)}a(nao,"Not");function SB(t){return t[Tt]==="Intersect"?tao(t):t[Tt]==="Union"?rao(t):t[Tt]==="Not"?nao(t):t[Tt]==="Undefined"}a(SB,"ExtendsUndefinedCheck");p();function jqr(t,e){return _ie(NV(t),e)}a(jqr,"ExcludeFromTemplateLiteral");function iao(t,e){let r=t.filter(n=>b9(n,e)===Rt.False);return r.length===1?r[0]:Ja(r)}a(iao,"ExcludeRest");function _ie(t,e,r={}){return E1(t)?wt(jqr(t,e),r):Du(t)?wt(Hqr(t,e),r):wt(_a(t)?iao(t.anyOf,e):b9(t,e)!==Rt.False?Vo():t,r)}a(_ie,"Exclude");function oao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=_ie(t[n],e);return r}a(oao,"FromProperties");function sao(t,e){return oao(t.properties,e)}a(sao,"FromMappedResult");function Hqr(t,e){let r=sao(t,e);return Ba(r)}a(Hqr,"ExcludeFromMappedResult");p();p();p();function Gqr(t,e){return vie(NV(t),e)}a(Gqr,"ExtractFromTemplateLiteral");function aao(t,e){let r=t.filter(n=>b9(n,e)!==Rt.False);return r.length===1?r[0]:Ja(r)}a(aao,"ExtractRest");function vie(t,e,r){return E1(t)?wt(Gqr(t,e),r):Du(t)?wt($qr(t,e),r):wt(_a(t)?aao(t.anyOf,e):b9(t,e)!==Rt.False?t:Vo(),r)}a(vie,"Extract");function cao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=vie(t[n],e);return r}a(cao,"FromProperties");function lao(t,e){return cao(t.properties,e)}a(lao,"FromMappedResult");function $qr(t,e){let r=lao(t,e);return Ba(r)}a($qr,"ExtractFromMappedResult");p();function Vqr(t,e){return nP(t)?wt(t.returns,e):Vo(e)}a(Vqr,"InstanceType");p();p();function i6e(t){return jv(vy(t))}a(i6e,"ReadonlyOptional");p();function MV(t,e,r){return wt({[Tt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(MV,"RecordCreateFromPattern");function Mwt(t,e,r){let n={};for(let o of t)n[o]=e;return Za(n,{...r,[yI]:"Record"})}a(Mwt,"RecordCreateFromKeys");function uao(t,e,r){return G8e(t)?Mwt(qv(t),e,r):MV(t.pattern,e,r)}a(uao,"FromTemplateLiteralKey");function dao(t,e,r){return Mwt(qv(Ja(t)),e,r)}a(dao,"FromUnionKey");function fao(t,e,r){return Mwt([t.toString()],e,r)}a(fao,"FromLiteralKey");function pao(t,e,r){return MV(t.source,e,r)}a(pao,"FromRegExpKey");function hao(t,e,r){let n=Ip(t.pattern)?_9:t.pattern;return MV(n,e,r)}a(hao,"FromStringKey");function mao(t,e,r){return MV(_9,e,r)}a(mao,"FromAnyKey");function gao(t,e,r){return MV(tqr,e,r)}a(gao,"FromNeverKey");function Aao(t,e,r){return Za({true:e,false:e},r)}a(Aao,"FromBooleanKey");function yao(t,e,r){return MV(E9,e,r)}a(yao,"FromIntegerKey");function Eao(t,e,r){return MV(E9,e,r)}a(Eao,"FromNumberKey");function o6e(t,e,r={}){return _a(t)?dao(t.anyOf,e,r):E1(t)?uao(t,e,r):A1(t)?fao(t.const,e,r):yB(t)?Aao(t,e,r):oP(t)?yao(t,e,r):sP(t)?Eao(t,e,r):pwt(t)?pao(t,e,r):EB(t)?hao(t,e,r):dwt(t)?mao(t,e,r):A9(t)?gao(t,e,r):Vo(r)}a(o6e,"Record");function s6e(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(s6e,"RecordPattern");function Wqr(t){let e=s6e(t);return e===_9?r_():e===E9?EI():r_({pattern:e})}a(Wqr,"RecordKey");function a6e(t){return t.patternProperties[s6e(t)]}a(a6e,"RecordValue");function _ao(t,e){return e.parameters=rve(t,e.parameters),e.returns=lP(t,e.returns),e}a(_ao,"FromConstructor");function vao(t,e){return e.parameters=rve(t,e.parameters),e.returns=lP(t,e.returns),e}a(vao,"FromFunction");function Cao(t,e){return e.allOf=rve(t,e.allOf),e}a(Cao,"FromIntersect");function bao(t,e){return e.anyOf=rve(t,e.anyOf),e}a(bao,"FromUnion");function Sao(t,e){return Ip(e.items)||(e.items=rve(t,e.items)),e}a(Sao,"FromTuple");function Tao(t,e){return e.items=lP(t,e.items),e}a(Tao,"FromArray");function Iao(t,e){return e.items=lP(t,e.items),e}a(Iao,"FromAsyncIterator");function xao(t,e){return e.items=lP(t,e.items),e}a(xao,"FromIterator");function wao(t,e){return e.item=lP(t,e.item),e}a(wao,"FromPromise");function Rao(t,e){let r=Nao(t,e.properties);return{...e,...Za(r)}}a(Rao,"FromObject");function Pao(t,e){let r=lP(t,Wqr(e)),n=lP(t,a6e(e)),o=o6e(r,n);return{...e,...o}}a(Pao,"FromRecord");function kao(t,e){return e.index in t?t[e.index]:cP()}a(kao,"FromArgument");function Dao(t,e){let r=oie(e),n=Qv(e),o=lP(t,e);return r&&n?i6e(o):r&&!n?jv(o):!r&&n?vy(o):o}a(Dao,"FromProperty");function Nao(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:Dao(t,e[n])}),{})}a(Nao,"FromProperties");function rve(t,e){return e.map(r=>lP(t,r))}a(rve,"FromTypes");function lP(t,e){return nP(e)?_ao(t,e):iP(e)?vao(t,e):Kd(e)?Cao(t,e):_a(e)?bao(t,e):_1(e)?Sao(t,e):tP(e)?Tao(t,e):xV(e)?Iao(t,e):RV(e)?xao(t,e):PV(e)?wao(t,e):xp(e)?Rao(t,e):kV(e)?Pao(t,e):fwt(e)?kao(t,e):e}a(lP,"FromType");function zqr(t,e){return lP(e,nie(t))}a(zqr,"Instantiate");p();function Yqr(t){return wt({[Tt]:"Integer",type:"integer"},t)}a(Yqr,"Integer");p();p();p();function Mao(t,e,r){return{[t]:uP(ta(t),e,Pu(r))}}a(Mao,"MappedIntrinsicPropertyKey");function Oao(t,e,r){return t.reduce((o,s)=>({...o,...Mao(s,e,r)}),{})}a(Oao,"MappedIntrinsicPropertyKeys");function Bao(t,e,r){return Oao(t.keys,e,r)}a(Bao,"MappedIntrinsicProperties");function Kqr(t,e,r){let n=Bao(t,e,r);return Ba(n)}a(Kqr,"IntrinsicFromMappedKey");function Lao(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Lao,"ApplyUncapitalize");function Fao(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(Fao,"ApplyCapitalize");function Uao(t){return t.toUpperCase()}a(Uao,"ApplyUppercase");function Qao(t){return t.toLowerCase()}a(Qao,"ApplyLowercase");function qao(t,e,r){let n=fie(t.pattern);if(!DV(n))return{...t,pattern:Jqr(t.pattern,e)};let c=[...Z_e(n)].map(d=>ta(d)),l=Zqr(c,e),u=Ja(l);return V8e([u],r)}a(qao,"FromTemplateLiteral");function Jqr(t,e){return typeof t=="string"?e==="Uncapitalize"?Lao(t):e==="Capitalize"?Fao(t):e==="Uppercase"?Uao(t):e==="Lowercase"?Qao(t):t:t.toString()}a(Jqr,"FromLiteralValue");function Zqr(t,e){return t.map(r=>uP(r,e))}a(Zqr,"FromRest");function uP(t,e,r={}){return y1(t)?Kqr(t,e,r):E1(t)?qao(t,e,r):_a(t)?Ja(Zqr(t.anyOf,e),r):A1(t)?ta(Jqr(t.const,e),r):wt(t,r)}a(uP,"Intrinsic");function Xqr(t,e={}){return uP(t,"Capitalize",e)}a(Xqr,"Capitalize");p();function ejr(t,e={}){return uP(t,"Lowercase",e)}a(ejr,"Lowercase");p();function tjr(t,e={}){return uP(t,"Uncapitalize",e)}a(tjr,"Uncapitalize");p();function rjr(t,e={}){return uP(t,"Uppercase",e)}a(rjr,"Uppercase");p();p();p();p();p();function jao(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=S9(t[o],e,Pu(r));return n}a(jao,"FromProperties");function Hao(t,e,r){return jao(t.properties,e,r)}a(Hao,"FromMappedResult");function njr(t,e,r){let n=Hao(t,e,r);return Ba(n)}a(njr,"OmitFromMappedResult");function Gao(t,e){return t.map(r=>Owt(r,e))}a(Gao,"FromIntersect");function $ao(t,e){return t.map(r=>Owt(r,e))}a($ao,"FromUnion");function Vao(t,e){let{[e]:r,...n}=t;return n}a(Vao,"FromProperty");function Wao(t,e){return e.reduce((r,n)=>Vao(r,n),t)}a(Wao,"FromProperties");function zao(t,e,r){let n=Jd(t,[vd,"$id","required","properties"]),o=Wao(r,e);return Za(o,n)}a(zao,"FromObject");function Yao(t){let e=t.reduce((r,n)=>q8e(n)?[...r,ta(n)]:r,[]);return Ja(e)}a(Yao,"UnionFromPropertyKeys");function Owt(t,e){return Kd(t)?Cy(Gao(t.allOf,e)):_a(t)?Ja($ao(t.anyOf,e)):xp(t)?zao(t,e,t.properties):Za({})}a(Owt,"OmitResolve");function S9(t,e,r){let n=Tp(e)?Yao(e):e,o=Cd(e)?qv(e):e,s=Mf(t),c=Mf(e);return Du(t)?njr(t,o,r):y1(e)?ijr(t,e,r):s&&c?Zl("Omit",[t,n],r):!s&&c?Zl("Omit",[t,n],r):s&&!c?Zl("Omit",[t,n],r):wt({...Owt(t,o),...r})}a(S9,"Omit");function Kao(t,e,r){return{[e]:S9(t,[e],Pu(r))}}a(Kao,"FromPropertyKey");function Jao(t,e,r){return e.reduce((n,o)=>({...n,...Kao(t,o,r)}),{})}a(Jao,"FromPropertyKeys");function Zao(t,e,r){return Jao(t,e.keys,r)}a(Zao,"FromMappedKey");function ijr(t,e,r){let n=Zao(t,e,r);return Ba(n)}a(ijr,"OmitFromMappedKey");p();p();p();function Xao(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=T9(t[o],e,Pu(r));return n}a(Xao,"FromProperties");function eco(t,e,r){return Xao(t.properties,e,r)}a(eco,"FromMappedResult");function ojr(t,e,r){let n=eco(t,e,r);return Ba(n)}a(ojr,"PickFromMappedResult");function tco(t,e){return t.map(r=>Bwt(r,e))}a(tco,"FromIntersect");function rco(t,e){return t.map(r=>Bwt(r,e))}a(rco,"FromUnion");function nco(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(nco,"FromProperties");function ico(t,e,r){let n=Jd(t,[vd,"$id","required","properties"]),o=nco(r,e);return Za(o,n)}a(ico,"FromObject");function oco(t){let e=t.reduce((r,n)=>q8e(n)?[...r,ta(n)]:r,[]);return Ja(e)}a(oco,"UnionFromPropertyKeys");function Bwt(t,e){return Kd(t)?Cy(tco(t.allOf,e)):_a(t)?Ja(rco(t.anyOf,e)):xp(t)?ico(t,e,t.properties):Za({})}a(Bwt,"PickResolve");function T9(t,e,r){let n=Tp(e)?oco(e):e,o=Cd(e)?qv(e):e,s=Mf(t),c=Mf(e);return Du(t)?ojr(t,o,r):y1(e)?sjr(t,e,r):s&&c?Zl("Pick",[t,n],r):!s&&c?Zl("Pick",[t,n],r):s&&!c?Zl("Pick",[t,n],r):wt({...Bwt(t,o),...r})}a(T9,"Pick");function sco(t,e,r){return{[e]:T9(t,[e],Pu(r))}}a(sco,"FromPropertyKey");function aco(t,e,r){return e.reduce((n,o)=>({...n,...sco(t,o,r)}),{})}a(aco,"FromPropertyKeys");function cco(t,e,r){return aco(t,e.keys,r)}a(cco,"FromMappedKey");function sjr(t,e,r){let n=cco(t,e,r);return Ba(n)}a(sjr,"PickFromMappedKey");p();p();function lco(t,e){return Zl("Partial",[Zl(t,e)])}a(lco,"FromComputed");function uco(t){return Zl("Partial",[CI(t)])}a(uco,"FromRef");function dco(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=vy(t[r]);return e}a(dco,"FromProperties");function fco(t,e){let r=Jd(t,[vd,"$id","required","properties"]),n=dco(e);return Za(n,r)}a(fco,"FromObject");function ajr(t){return t.map(e=>cjr(e))}a(ajr,"FromRest");function cjr(t){return rP(t)?lco(t.target,t.parameters):Mf(t)?uco(t.$ref):Kd(t)?Cy(ajr(t.allOf)):_a(t)?Ja(ajr(t.anyOf)):xp(t)?fco(t,t.properties):wV(t)||yB(t)||oP(t)||A1(t)||$_e(t)||sP(t)||EB(t)||V_e(t)||_B(t)?t:Za({})}a(cjr,"PartialResolve");function Cie(t,e){return Du(t)?ljr(t,e):wt({...cjr(t),...e})}a(Cie,"Partial");function pco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Cie(t[n],Pu(e));return r}a(pco,"FromProperties");function hco(t,e){return pco(t.properties,e)}a(hco,"FromMappedResult");function ljr(t,e){let r=hco(t,e);return Ba(r)}a(ljr,"PartialFromMappedResult");p();p();function mco(t,e){return Zl("Required",[Zl(t,e)])}a(mco,"FromComputed");function gco(t){return Zl("Required",[CI(t)])}a(gco,"FromRef");function Aco(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Jd(t[r],[Kg]);return e}a(Aco,"FromProperties");function yco(t,e){let r=Jd(t,[vd,"$id","required","properties"]),n=Aco(e);return Za(n,r)}a(yco,"FromObject");function ujr(t){return t.map(e=>djr(e))}a(ujr,"FromRest");function djr(t){return rP(t)?mco(t.target,t.parameters):Mf(t)?gco(t.$ref):Kd(t)?Cy(ujr(t.allOf)):_a(t)?Ja(ujr(t.anyOf)):xp(t)?yco(t,t.properties):wV(t)||yB(t)||oP(t)||A1(t)||$_e(t)||sP(t)||EB(t)||V_e(t)||_B(t)?t:Za({})}a(djr,"RequiredResolve");function bie(t,e){return Du(t)?fjr(t,e):wt({...djr(t),...e})}a(bie,"Required");function Eco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=bie(t[n],e);return r}a(Eco,"FromProperties");function _co(t,e){return Eco(t.properties,e)}a(_co,"FromMappedResult");function fjr(t,e){let r=_co(t,e);return Ba(r)}a(fjr,"RequiredFromMappedResult");function vco(t,e){return e.map(r=>Mf(r)?Lwt(t,r.$ref):v1(t,r))}a(vco,"DereferenceParameters");function Lwt(t,e){return e in t?Mf(t[e])?Lwt(t,t[e].$ref):v1(t,t[e]):Vo()}a(Lwt,"Dereference");function Cco(t){return gie(t[0])}a(Cco,"FromAwaited");function bco(t){return C9(t[0],t[1])}a(bco,"FromIndex");function Sco(t){return Aie(t[0])}a(Sco,"FromKeyOf");function Tco(t){return Cie(t[0])}a(Tco,"FromPartial");function Ico(t){return S9(t[0],t[1])}a(Ico,"FromOmit");function xco(t){return T9(t[0],t[1])}a(xco,"FromPick");function wco(t){return bie(t[0])}a(wco,"FromRequired");function Rco(t,e,r){let n=vco(t,r);return e==="Awaited"?Cco(n):e==="Index"?bco(n):e==="KeyOf"?Sco(n):e==="Partial"?Tco(n):e==="Omit"?Ico(n):e==="Pick"?xco(n):e==="Required"?wco(n):Vo()}a(Rco,"FromComputed");function Pco(t,e){return cie(v1(t,e))}a(Pco,"FromArray");function kco(t,e){return lie(v1(t,e))}a(kco,"FromAsyncIterator");function Dco(t,e,r){return uie(nve(t,e),v1(t,r))}a(Dco,"FromConstructor");function Nco(t,e,r){return AN(nve(t,e),v1(t,r))}a(Nco,"FromFunction");function Mco(t,e){return Cy(nve(t,e))}a(Mco,"FromIntersect");function Oco(t,e){return mie(v1(t,e))}a(Oco,"FromIterator");function Bco(t,e){return Za(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:v1(t,e[n])}),{}))}a(Bco,"FromObject");function Lco(t,e){let[r,n]=[v1(t,a6e(e)),s6e(e)],o=nie(e);return o.patternProperties[n]=r,o}a(Lco,"FromRecord");function Fco(t,e){return Mf(e)?{...Lwt(t,e.$ref),[vd]:e[vd]}:e}a(Fco,"FromTransform");function Uco(t,e){return _I(nve(t,e))}a(Uco,"FromTuple");function Qco(t,e){return Ja(nve(t,e))}a(Qco,"FromUnion");function nve(t,e){return e.map(r=>v1(t,r))}a(nve,"FromTypes");function v1(t,e){return Qv(e)?wt(v1(t,Jd(e,[Kg])),e):oie(e)?wt(v1(t,Jd(e,[eP])),e):Ka(e)?wt(Fco(t,e),e):tP(e)?wt(Pco(t,e.items),e):xV(e)?wt(kco(t,e.items),e):rP(e)?wt(Rco(t,e.target,e.parameters)):nP(e)?wt(Dco(t,e.parameters,e.returns),e):iP(e)?wt(Nco(t,e.parameters,e.returns),e):Kd(e)?wt(Mco(t,e.allOf),e):RV(e)?wt(Oco(t,e.items),e):xp(e)?wt(Bco(t,e.properties),e):kV(e)?wt(Lco(t,e)):_1(e)?wt(Uco(t,e.items||[]),e):_a(e)?wt(Qco(t,e.anyOf),e):e}a(v1,"FromType");function qco(t,e){return e in t?v1(t,t[e]):Vo()}a(qco,"ComputeType");function pjr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:qco(t,r)}),{})}a(pjr,"ComputeModuleProperties");var Fwt=class{static{a(this,"TModule")}constructor(e){let r=pjr(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 hjr(t){return new Fwt(t)}a(hjr,"Module");p();function mjr(t,e){return wt({[Tt]:"Not",not:t},e)}a(mjr,"Not");p();function gjr(t,e){return iP(t)?_I(t.parameters,e):Vo()}a(gjr,"Parameters");p();var jco=0;function Ajr(t,e={}){Ip(e.$id)&&(e.$id=`T${jco++}`);let r=nie(t({[Tt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[yI]:"Recursive",...r},e)}a(Ajr,"Recursive");p();function yjr(t,e){let r=Nl(t)?new globalThis.RegExp(t):t;return wt({[Tt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(yjr,"RegExp");p();function Hco(t){return Kd(t)?t.allOf:_a(t)?t.anyOf:_1(t)?t.items??[]:[]}a(Hco,"RestResolve");function Ejr(t){return Hco(t)}a(Ejr,"Rest");p();function _jr(t,e){return iP(t)?wt(t.returns,e):Vo(e)}a(_jr,"ReturnType");p();var Uwt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new Qwt(this.schema,e)}},Qwt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[vd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[vd].Decode(c)),"Decode")};return{...r,[vd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[vd]:n}}Encode(e){return Ka(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function vjr(t){return new Uwt(t)}a(vjr,"Transform");p();function Cjr(t={}){return wt({[Tt]:t[Tt]??"Unsafe"},t)}a(Cjr,"Unsafe");p();function bjr(t){return wt({[Tt]:"Void",type:"void"},t)}a(bjr,"Void");p();var qwt={};xi(qwt,{Any:()=>v9,Argument:()=>sqr,Array:()=>cie,AsyncIterator:()=>lie,Awaited:()=>gie,BigInt:()=>hie,Boolean:()=>$8e,Capitalize:()=>Xqr,Composite:()=>Tqr,Const:()=>Iqr,Constructor:()=>uie,ConstructorParameters:()=>xqr,Date:()=>K8e,Enum:()=>wqr,Exclude:()=>_ie,Extends:()=>Eie,Extract:()=>vie,Function:()=>AN,Index:()=>C9,InstanceType:()=>Vqr,Instantiate:()=>zqr,Integer:()=>Yqr,Intersect:()=>Cy,Iterator:()=>mie,KeyOf:()=>Aie,Literal:()=>ta,Lowercase:()=>ejr,Mapped:()=>Eqr,Module:()=>hjr,Never:()=>Vo,Not:()=>mjr,Null:()=>J8e,Number:()=>EI,Object:()=>Za,Omit:()=>S9,Optional:()=>vy,Parameters:()=>gjr,Partial:()=>Cie,Pick:()=>T9,Promise:()=>z8e,Readonly:()=>jv,ReadonlyOptional:()=>i6e,Record:()=>o6e,Recursive:()=>Ajr,Ref:()=>CI,RegExp:()=>yjr,Required:()=>bie,Rest:()=>Ejr,ReturnType:()=>_jr,String:()=>r_,Symbol:()=>Z8e,TemplateLiteral:()=>V8e,Transform:()=>vjr,Tuple:()=>_I,Uint8Array:()=>e6e,Uncapitalize:()=>tjr,Undefined:()=>X8e,Union:()=>Ja,Unknown:()=>cP,Unsafe:()=>Cjr,Uppercase:()=>rjr,Void:()=>bjr});p();var S=qwt;p();p();function Gco(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(Gco,"DefaultErrorFunction");var $co=Gco;function Sjr(){return $co}a(Sjr,"GetErrorFunction");p();var jwt=class extends Qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function Vco(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new jwt(t);return va(r,e)}a(Vco,"Resolve");function Dm(t,e){return!Ea(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Dm,"Pushref");function va(t,e){return t[Tt]==="This"||t[Tt]==="Ref"?Vco(t,e):t}a(va,"Deref");p();var Hwt=class extends Qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},C1;(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"})(C1||(C1={}));var Sie=BigInt("14695981039346656037"),[Wco,zco]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Yco=Array.from({length:256}).map((t,e)=>BigInt(e)),Tjr=new Float64Array(1),Ijr=new DataView(Tjr.buffer),xjr=new Uint8Array(Tjr.buffer);function*Kco(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(Kco,"NumberToBytes");function Jco(t){Sy(C1.Array);for(let e of t)Tie(e)}a(Jco,"ArrayType");function Zco(t){Sy(C1.Boolean),Sy(t?1:0)}a(Zco,"BooleanType");function Xco(t){Sy(C1.BigInt),Ijr.setBigInt64(0,t);for(let e of xjr)Sy(e)}a(Xco,"BigIntType");function elo(t){Sy(C1.Date),Tie(t.getTime())}a(elo,"DateType");function tlo(t){Sy(C1.Null)}a(tlo,"NullType");function rlo(t){Sy(C1.Number),Ijr.setFloat64(0,t);for(let e of xjr)Sy(e)}a(rlo,"NumberType");function nlo(t){Sy(C1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Tie(e),Tie(t[e])}a(nlo,"ObjectType");function ilo(t){Sy(C1.String);for(let e=0;e=t.minItems)||qs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Nm(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=I9(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(qs(t.contains)||si(t.minContains)||si(t.maxContains)))return!0;let n=qs(t.contains)?t.contains:Vo(),o=r.reduce((s,c)=>Nm(n,e,c)?s+1:s,0);return!(o===0||si(t.minContains)&&ot.maxContains)}a(dlo,"FromArray");function flo(t,e,r){return L8e(r)}a(flo,"FromAsyncIterator");function plo(t,e,r){return!(!Yg(r)||qs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||qs(t.maximum)&&!(r<=t.maximum)||qs(t.minimum)&&!(r>=t.minimum)||qs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(plo,"FromBigInt");function hlo(t,e,r){return gN(r)}a(hlo,"FromBoolean");function mlo(t,e,r){return Nm(t.returns,e,r.prototype)}a(mlo,"FromConstructor");function glo(t,e,r){return!(!e_(r)||qs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||qs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||qs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||qs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(glo,"FromDate");function Alo(t,e,r){return g9(r)}a(Alo,"FromFunction");function ylo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Nm(o,[...e,...n],r)}a(ylo,"FromImport");function Elo(t,e,r){return!(!Q8e(r)||qs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||qs(t.maximum)&&!(r<=t.maximum)||qs(t.minimum)&&!(r>=t.minimum)||qs(t.multipleOf)&&r%t.multipleOf!==0)}a(Elo,"FromInteger");function _lo(t,e,r){let n=t.allOf.every(o=>Nm(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(bB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Cd(t.unevaluatedProperties)){let o=new RegExp(bB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Nm(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(_lo,"FromIntersect");function vlo(t,e,r){return F8e(r)}a(vlo,"FromIterator");function Clo(t,e,r){return r===t.const}a(Clo,"FromLiteral");function blo(t,e,r){return!1}a(blo,"FromNever");function Slo(t,e,r){return!Nm(t.not,e,r)}a(Slo,"FromNot");function Tlo(t,e,r){return gB(r)}a(Tlo,"FromNull");function Ilo(t,e,r){return!(!Jl.IsNumberLike(r)||qs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||qs(t.minimum)&&!(r>=t.minimum)||qs(t.maximum)&&!(r<=t.maximum)||qs(t.multipleOf)&&r%t.multipleOf!==0)}a(Ilo,"FromNumber");function xlo(t,e,r){if(!Jl.IsObjectLike(r)||qs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||qs(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(!Nm(s,e,r[o])||(SB(s)||clo(s))&&!(o in r))return!1}else if(Jl.IsExactOptionalProperty(r,o)&&!Nm(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)||Nm(t.additionalProperties,e,r[s])):!0}a(xlo,"FromObject");function wlo(t,e,r){return U8e(r)}a(wlo,"FromPromise");function Rlo(t,e,r){if(!Jl.IsRecordLike(r)||qs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||qs(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)?Nm(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Nm(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Rlo,"FromRecord");function Plo(t,e,r){return Nm(va(t,e),e,r)}a(Plo,"FromRef");function klo(t,e,r){let n=new RegExp(t.source,t.flags);return qs(t.minLength)&&!(r.length>=t.minLength)||qs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(klo,"FromRegExp");function Dlo(t,e,r){return!Ea(r)||qs(t.minLength)&&!(r.length>=t.minLength)||qs(t.maxLength)&&!(r.length<=t.maxLength)||qs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:qs(t.format)?aP.Has(t.format)?aP.Get(t.format)(r):!1:!0}a(Dlo,"FromString");function Nlo(t,e,r){return AB(r)}a(Nlo,"FromSymbol");function Mlo(t,e,r){return Ea(r)&&new RegExp(t.pattern).test(r)}a(Mlo,"FromTemplateLiteral");function Olo(t,e,r){return Nm(va(t,e),e,r)}a(Olo,"FromThis");function Blo(t,e,r){if(!wi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nNm(n,e,r))}a(Flo,"FromUnion");function Ulo(t,e,r){return!(!iie(r)||qs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||qs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Ulo,"FromUint8Array");function Qlo(t,e,r){return!0}a(Qlo,"FromUnknown");function qlo(t,e,r){return Jl.IsVoidLike(r)}a(qlo,"FromVoid");function jlo(t,e,r){return t_.Has(t[Tt])?t_.Get(t[Tt])(t,r):!1}a(jlo,"FromKind");function Nm(t,e,r){let n=qs(t.$id)?Dm(t,e):e,o=t;switch(o[Tt]){case"Any":return llo(o,n,r);case"Argument":return ulo(o,n,r);case"Array":return dlo(o,n,r);case"AsyncIterator":return flo(o,n,r);case"BigInt":return plo(o,n,r);case"Boolean":return hlo(o,n,r);case"Constructor":return mlo(o,n,r);case"Date":return glo(o,n,r);case"Function":return Alo(o,n,r);case"Import":return ylo(o,n,r);case"Integer":return Elo(o,n,r);case"Intersect":return _lo(o,n,r);case"Iterator":return vlo(o,n,r);case"Literal":return Clo(o,n,r);case"Never":return blo(o,n,r);case"Not":return Slo(o,n,r);case"Null":return Tlo(o,n,r);case"Number":return Ilo(o,n,r);case"Object":return xlo(o,n,r);case"Promise":return wlo(o,n,r);case"Record":return Rlo(o,n,r);case"Ref":return Plo(o,n,r);case"RegExp":return klo(o,n,r);case"String":return Dlo(o,n,r);case"Symbol":return Nlo(o,n,r);case"TemplateLiteral":return Mlo(o,n,r);case"This":return Olo(o,n,r);case"Tuple":return Blo(o,n,r);case"Undefined":return Llo(o,n,r);case"Union":return Flo(o,n,r);case"Uint8Array":return Ulo(o,n,r);case"Unknown":return Qlo(o,n,r);case"Void":return qlo(o,n,r);default:if(!t_.Has(o[Tt]))throw new Gwt(o);return jlo(o,n,r)}}a(Nm,"Visit");function Wo(...t){return t.length===3?Nm(t[0],t[1],t[2]):Nm(t[0],[],t[1])}a(Wo,"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 $wt=class extends Qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function TB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(TB,"EscapeKey");function js(t){return t!==void 0}a(js,"IsDefined");var x9=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 nn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:Sjr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(nn,"Create");function*Hlo(t,e,r,n){}a(Hlo,"FromAny");function*Glo(t,e,r,n){}a(Glo,"FromArgument");function*$lo(t,e,r,n){if(!wi(n))return yield nn(St.Array,t,r,n);js(t.minItems)&&!(n.length>=t.minItems)&&(yield nn(St.ArrayMinItems,t,r,n)),js(t.maxItems)&&!(n.length<=t.maxItems)&&(yield nn(St.ArrayMaxItems,t,r,n));for(let c=0;cMm(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield nn(St.ArrayContains,t,r,n)),si(t.minContains)&&st.maxContains&&(yield nn(St.ArrayMaxContains,t,r,n))}a($lo,"FromArray");function*Vlo(t,e,r,n){L8e(n)||(yield nn(St.AsyncIterator,t,r,n))}a(Vlo,"FromAsyncIterator");function*Wlo(t,e,r,n){if(!Yg(n))return yield nn(St.BigInt,t,r,n);js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield nn(St.BigIntExclusiveMinimum,t,r,n)),js(t.maximum)&&!(n<=t.maximum)&&(yield nn(St.BigIntMaximum,t,r,n)),js(t.minimum)&&!(n>=t.minimum)&&(yield nn(St.BigIntMinimum,t,r,n)),js(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield nn(St.BigIntMultipleOf,t,r,n))}a(Wlo,"FromBigInt");function*zlo(t,e,r,n){gN(n)||(yield nn(St.Boolean,t,r,n))}a(zlo,"FromBoolean");function*Ylo(t,e,r,n){yield*Mm(t.returns,e,r,n.prototype)}a(Ylo,"FromConstructor");function*Klo(t,e,r,n){if(!e_(n))return yield nn(St.Date,t,r,n);js(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield nn(St.DateExclusiveMinimumTimestamp,t,r,n)),js(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield nn(St.DateMaximumTimestamp,t,r,n)),js(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield nn(St.DateMinimumTimestamp,t,r,n)),js(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield nn(St.DateMultipleOfTimestamp,t,r,n))}a(Klo,"FromDate");function*Jlo(t,e,r,n){g9(n)||(yield nn(St.Function,t,r,n))}a(Jlo,"FromFunction");function*Zlo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Mm(s,[...e,...o],r,n)}a(Zlo,"FromImport");function*Xlo(t,e,r,n){if(!Q8e(n))return yield nn(St.Integer,t,r,n);js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield nn(St.IntegerExclusiveMinimum,t,r,n)),js(t.maximum)&&!(n<=t.maximum)&&(yield nn(St.IntegerMaximum,t,r,n)),js(t.minimum)&&!(n>=t.minimum)&&(yield nn(St.IntegerMinimum,t,r,n)),js(t.multipleOf)&&n%t.multipleOf!==0&&(yield nn(St.IntegerMultipleOf,t,r,n))}a(Xlo,"FromInteger");function*euo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Mm(s,e,r,n))o=!0,yield c;if(o)return yield nn(St.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(bB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield nn(St.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(bB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Mm(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(euo,"FromIntersect");function*tuo(t,e,r,n){F8e(n)||(yield nn(St.Iterator,t,r,n))}a(tuo,"FromIterator");function*ruo(t,e,r,n){n!==t.const&&(yield nn(St.Literal,t,r,n))}a(ruo,"FromLiteral");function*nuo(t,e,r,n){yield nn(St.Never,t,r,n)}a(nuo,"FromNever");function*iuo(t,e,r,n){Mm(t.not,e,r,n).next().done===!0&&(yield nn(St.Not,t,r,n))}a(iuo,"FromNot");function*ouo(t,e,r,n){gB(n)||(yield nn(St.Null,t,r,n))}a(ouo,"FromNull");function*suo(t,e,r,n){if(!Jl.IsNumberLike(n))return yield nn(St.Number,t,r,n);js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield nn(St.NumberExclusiveMinimum,t,r,n)),js(t.maximum)&&!(n<=t.maximum)&&(yield nn(St.NumberMaximum,t,r,n)),js(t.minimum)&&!(n>=t.minimum)&&(yield nn(St.NumberMinimum,t,r,n)),js(t.multipleOf)&&n%t.multipleOf!==0&&(yield nn(St.NumberMultipleOf,t,r,n))}a(suo,"FromNumber");function*auo(t,e,r,n){if(!Jl.IsObjectLike(n))return yield nn(St.Object,t,r,n);js(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield nn(St.ObjectMinProperties,t,r,n)),js(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield nn(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 nn(St.ObjectRequiredProperty,t.properties[l],`${r}/${TB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield nn(St.ObjectAdditionalProperties,t,`${r}/${TB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Mm(t.additionalProperties,e,`${r}/${TB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Mm(u,e,`${r}/${TB(l)}`,n[l]),SB(t)&&!(l in n)&&(yield nn(St.ObjectRequiredProperty,u,`${r}/${TB(l)}`,void 0))):Jl.IsExactOptionalProperty(n,l)&&(yield*Mm(u,e,`${r}/${TB(l)}`,n[l]))}}a(auo,"FromObject");function*cuo(t,e,r,n){U8e(n)||(yield nn(St.Promise,t,r,n))}a(cuo,"FromPromise");function*luo(t,e,r,n){if(!Jl.IsRecordLike(n))return yield nn(St.Object,t,r,n);js(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield nn(St.ObjectMinProperties,t,r,n)),js(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield nn(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*Mm(s,e,`${r}/${TB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Mm(t.additionalProperties,e,`${r}/${TB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield nn(St.ObjectAdditionalProperties,t,`${r}/${TB(l)}`,u)}}a(luo,"FromRecord");function*uuo(t,e,r,n){yield*Mm(va(t,e),e,r,n)}a(uuo,"FromRef");function*duo(t,e,r,n){if(!Ea(n))return yield nn(St.String,t,r,n);if(js(t.minLength)&&!(n.length>=t.minLength)&&(yield nn(St.StringMinLength,t,r,n)),js(t.maxLength)&&!(n.length<=t.maxLength)&&(yield nn(St.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield nn(St.RegExp,t,r,n)}a(duo,"FromRegExp");function*fuo(t,e,r,n){if(!Ea(n))return yield nn(St.String,t,r,n);js(t.minLength)&&!(n.length>=t.minLength)&&(yield nn(St.StringMinLength,t,r,n)),js(t.maxLength)&&!(n.length<=t.maxLength)&&(yield nn(St.StringMaxLength,t,r,n)),Ea(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield nn(St.StringPattern,t,r,n))),Ea(t.format)&&(aP.Has(t.format)?aP.Get(t.format)(n)||(yield nn(St.StringFormat,t,r,n)):yield nn(St.StringFormatUnknown,t,r,n))}a(fuo,"FromString");function*puo(t,e,r,n){AB(n)||(yield nn(St.Symbol,t,r,n))}a(puo,"FromSymbol");function*huo(t,e,r,n){if(!Ea(n))return yield nn(St.String,t,r,n);new RegExp(t.pattern).test(n)||(yield nn(St.StringPattern,t,r,n))}a(huo,"FromTemplateLiteral");function*muo(t,e,r,n){yield*Mm(va(t,e),e,r,n)}a(muo,"FromThis");function*guo(t,e,r,n){if(!wi(n))return yield nn(St.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield nn(St.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield nn(St.TupleLength,t,r,n);if(t.items)for(let o=0;onew x9(Mm(s,e,r,n)));yield nn(St.Union,t,r,n,o)}a(yuo,"FromUnion");function*Euo(t,e,r,n){if(!iie(n))return yield nn(St.Uint8Array,t,r,n);js(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield nn(St.Uint8ArrayMaxByteLength,t,r,n)),js(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield nn(St.Uint8ArrayMinByteLength,t,r,n))}a(Euo,"FromUint8Array");function*_uo(t,e,r,n){}a(_uo,"FromUnknown");function*vuo(t,e,r,n){Jl.IsVoidLike(n)||(yield nn(St.Void,t,r,n))}a(vuo,"FromVoid");function*Cuo(t,e,r,n){t_.Get(t[Tt])(t,n)||(yield nn(St.Kind,t,r,n))}a(Cuo,"FromKind");function*Mm(t,e,r,n){let o=js(t.$id)?[...e,t]:e,s=t;switch(s[Tt]){case"Any":return yield*Hlo(s,o,r,n);case"Argument":return yield*Glo(s,o,r,n);case"Array":return yield*$lo(s,o,r,n);case"AsyncIterator":return yield*Vlo(s,o,r,n);case"BigInt":return yield*Wlo(s,o,r,n);case"Boolean":return yield*zlo(s,o,r,n);case"Constructor":return yield*Ylo(s,o,r,n);case"Date":return yield*Klo(s,o,r,n);case"Function":return yield*Jlo(s,o,r,n);case"Import":return yield*Zlo(s,o,r,n);case"Integer":return yield*Xlo(s,o,r,n);case"Intersect":return yield*euo(s,o,r,n);case"Iterator":return yield*tuo(s,o,r,n);case"Literal":return yield*ruo(s,o,r,n);case"Never":return yield*nuo(s,o,r,n);case"Not":return yield*iuo(s,o,r,n);case"Null":return yield*ouo(s,o,r,n);case"Number":return yield*suo(s,o,r,n);case"Object":return yield*auo(s,o,r,n);case"Promise":return yield*cuo(s,o,r,n);case"Record":return yield*luo(s,o,r,n);case"Ref":return yield*uuo(s,o,r,n);case"RegExp":return yield*duo(s,o,r,n);case"String":return yield*fuo(s,o,r,n);case"Symbol":return yield*puo(s,o,r,n);case"TemplateLiteral":return yield*huo(s,o,r,n);case"This":return yield*muo(s,o,r,n);case"Tuple":return yield*guo(s,o,r,n);case"Undefined":return yield*Auo(s,o,r,n);case"Union":return yield*yuo(s,o,r,n);case"Uint8Array":return yield*Euo(s,o,r,n);case"Unknown":return yield*_uo(s,o,r,n);case"Void":return yield*vuo(s,o,r,n);default:if(!t_.Has(s[Tt]))throw new $wt(t);return yield*Cuo(s,o,r,n)}}a(Mm,"Visit");function EN(...t){let e=t.length===3?Mm(t[0],t[1],"",t[2]):Mm(t[0],[],"",t[1]);return new x9(e)}a(EN,"Errors");p();p();var Iie=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}},Vwt=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 bd(t,e,r){try{return Ka(t)?t[vd].Decode(r):r}catch(n){throw new Vwt(t,e,r,n)}}a(bd,"Default");function buo(t,e,r,n){return wi(n)?bd(t,r,n.map((o,s)=>dP(t.items,e,`${r}/${s}`,o))):bd(t,r,n)}a(buo,"FromArray");function Suo(t,e,r,n){if(!bo(n)||g1(n))return bd(t,r,n);let o=Y8e(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=dP(h,e,`${r}/${f}`,c[f]));if(!Ka(t.unevaluatedProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a(Suo,"FromIntersect");function Tuo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=dP(s,[...e,...o],r,n);return bd(t,r,c)}a(Tuo,"FromImport");function Iuo(t,e,r,n){return bd(t,r,dP(t.not,e,r,n))}a(Iuo,"FromNot");function xuo(t,e,r,n){if(!bo(n))return bd(t,r,n);let o=Hv(t),s={...n};for(let d of o)Ui(s,d)&&(ku(s[d])&&(!_B(t.properties[d])||Jl.IsExactOptionalProperty(s,d))||(s[d]=dP(t.properties[d],e,`${r}/${d}`,s[d])));if(!Cd(t.additionalProperties))return bd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=bd(l,`${r}/${d}`,u[d]));return bd(t,r,u)}a(xuo,"FromObject");function wuo(t,e,r,n){if(!bo(n))return bd(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]=dP(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Cd(t.additionalProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a(wuo,"FromRecord");function Ruo(t,e,r,n){let o=va(t,e);return bd(t,r,dP(o,e,r,n))}a(Ruo,"FromRef");function Puo(t,e,r,n){let o=va(t,e);return bd(t,r,dP(o,e,r,n))}a(Puo,"FromThis");function kuo(t,e,r,n){return wi(n)&&wi(t.items)?bd(t,r,t.items.map((o,s)=>dP(o,e,`${r}/${s}`,n[s]))):bd(t,r,n)}a(kuo,"FromTuple");function Duo(t,e,r,n){for(let o of t.anyOf){if(!Wo(o,e,n))continue;let s=dP(o,e,r,n);return bd(t,r,s)}return bd(t,r,n)}a(Duo,"FromUnion");function dP(t,e,r,n){let o=Dm(t,e),s=t;switch(t[Tt]){case"Array":return buo(s,o,r,n);case"Import":return Tuo(s,o,r,n);case"Intersect":return Suo(s,o,r,n);case"Not":return Iuo(s,o,r,n);case"Object":return xuo(s,o,r,n);case"Record":return wuo(s,o,r,n);case"Ref":return Ruo(s,o,r,n);case"Symbol":return bd(s,r,n);case"This":return Puo(s,o,r,n);case"Tuple":return kuo(s,o,r,n);case"Union":return Duo(s,o,r,n);default:return bd(s,r,n)}}a(dP,"Visit");function xie(t,e,r){return dP(t,e,"",r)}a(xie,"TransformDecode");p();var wie=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}},Wwt=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 Jg(t,e,r){try{return Ka(t)?t[vd].Encode(r):r}catch(n){throw new Wwt(t,e,r,n)}}a(Jg,"Default");function Nuo(t,e,r,n){let o=Jg(t,r,n);return wi(o)?o.map((s,c)=>fP(t.items,e,`${r}/${c}`,s)):o}a(Nuo,"FromArray");function Muo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Jg(t,r,n);return fP(s,[...e,...o],r,c)}a(Muo,"FromImport");function Ouo(t,e,r,n){let o=Jg(t,r,n);if(!bo(n)||g1(n))return o;let s=Y8e(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=fP(m,e,`${r}/${h}`,l[h]));if(!Ka(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=Jg(d,`${r}/${h}`,f[h]));return f}a(Ouo,"FromIntersect");function Buo(t,e,r,n){return Jg(t.not,r,Jg(t,r,n))}a(Buo,"FromNot");function Luo(t,e,r,n){let o=Jg(t,r,n);if(!bo(o))return o;let s=Hv(t),c={...o};for(let f of s)Ui(c,f)&&(ku(c[f])&&(!_B(t.properties[f])||Jl.IsExactOptionalProperty(c,f))||(c[f]=fP(t.properties[f],e,`${r}/${f}`,c[f])));if(!Cd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Jg(u,`${r}/${f}`,d[f]));return d}a(Luo,"FromObject");function Fuo(t,e,r,n){let o=Jg(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]=fP(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Cd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=Jg(d,`${r}/${h}`,f[h]));return f}a(Fuo,"FromRecord");function Uuo(t,e,r,n){let o=va(t,e),s=fP(o,e,r,n);return Jg(t,r,s)}a(Uuo,"FromRef");function Quo(t,e,r,n){let o=va(t,e),s=fP(o,e,r,n);return Jg(t,r,s)}a(Quo,"FromThis");function quo(t,e,r,n){let o=Jg(t,r,n);return wi(t.items)?t.items.map((s,c)=>fP(s,e,`${r}/${c}`,o[c])):[]}a(quo,"FromTuple");function juo(t,e,r,n){for(let o of t.anyOf){if(!Wo(o,e,n))continue;let s=fP(o,e,r,n);return Jg(t,r,s)}for(let o of t.anyOf){let s=fP(o,e,r,n);if(Wo(t,e,s))return Jg(t,r,s)}return Jg(t,r,n)}a(juo,"FromUnion");function fP(t,e,r,n){let o=Dm(t,e),s=t;switch(t[Tt]){case"Array":return Nuo(s,o,r,n);case"Import":return Muo(s,o,r,n);case"Intersect":return Ouo(s,o,r,n);case"Not":return Buo(s,o,r,n);case"Object":return Luo(s,o,r,n);case"Record":return Fuo(s,o,r,n);case"Ref":return Uuo(s,o,r,n);case"This":return Quo(s,o,r,n);case"Tuple":return quo(s,o,r,n);case"Union":return juo(s,o,r,n);default:return Jg(s,r,n)}}a(fP,"Visit");function Rie(t,e,r){return fP(t,e,"",r)}a(Rie,"TransformEncode");p();function Huo(t,e){return Ka(t)||R0(t.items,e)}a(Huo,"FromArray");function Guo(t,e){return Ka(t)||R0(t.items,e)}a(Guo,"FromAsyncIterator");function $uo(t,e){return Ka(t)||R0(t.returns,e)||t.parameters.some(r=>R0(r,e))}a($uo,"FromConstructor");function Vuo(t,e){return Ka(t)||R0(t.returns,e)||t.parameters.some(r=>R0(r,e))}a(Vuo,"FromFunction");function Wuo(t,e){return Ka(t)||Ka(t.unevaluatedProperties)||t.allOf.some(r=>R0(r,e))}a(Wuo,"FromIntersect");function zuo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return Ka(t)||R0(n,[...r,...e])}a(zuo,"FromImport");function Yuo(t,e){return Ka(t)||R0(t.items,e)}a(Yuo,"FromIterator");function Kuo(t,e){return Ka(t)||R0(t.not,e)}a(Kuo,"FromNot");function Juo(t,e){return Ka(t)||Object.values(t.properties).some(r=>R0(r,e))||Cd(t.additionalProperties)&&R0(t.additionalProperties,e)}a(Juo,"FromObject");function Zuo(t,e){return Ka(t)||R0(t.item,e)}a(Zuo,"FromPromise");function Xuo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return Ka(t)||R0(n,e)||Cd(t.additionalProperties)&&Ka(t.additionalProperties)}a(Xuo,"FromRecord");function edo(t,e){return Ka(t)?!0:R0(va(t,e),e)}a(edo,"FromRef");function tdo(t,e){return Ka(t)?!0:R0(va(t,e),e)}a(tdo,"FromThis");function rdo(t,e){return Ka(t)||!ku(t.items)&&t.items.some(r=>R0(r,e))}a(rdo,"FromTuple");function ndo(t,e){return Ka(t)||t.anyOf.some(r=>R0(r,e))}a(ndo,"FromUnion");function R0(t,e){let r=Dm(t,e),n=t;if(t.$id&&zwt.has(t.$id))return!1;switch(t.$id&&zwt.add(t.$id),t[Tt]){case"Array":return Huo(n,r);case"AsyncIterator":return Guo(n,r);case"Constructor":return $uo(n,r);case"Function":return Vuo(n,r);case"Import":return zuo(n,r);case"Intersect":return Wuo(n,r);case"Iterator":return Yuo(n,r);case"Not":return Kuo(n,r);case"Object":return Juo(n,r);case"Promise":return Zuo(n,r);case"Record":return Xuo(n,r);case"Ref":return edo(n,r);case"This":return tdo(n,r);case"Tuple":return rdo(n,r);case"Union":return ndo(n,r);default:return Ka(t)}}a(R0,"Visit");var zwt=new Set;function IB(t,e){return zwt.clear(),R0(t,e)}a(IB,"HasTransform");var Ywt=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=IB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return EN(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Iie(this.schema,e,this.Errors(e).First());return this.hasTransform?xie(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Rie(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new wie(this.schema,e,this.Errors(e).First());return r}},xB;(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})(xB||(xB={}));var c6e;(function(t){function e(s){return s.length===0?!1:xB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${Z.minItems}`);let ue=J(Z.items,ee,"value");if(yield`((array) => { for(const ${fe} of array) if(!(${ue})) { return false }; return true; })(${K})`,Nu(Z.contains)||si(Z.minContains)||si(Z.maxContains)){let qe=Nu(Z.contains)?Z.contains:Vo(),ie=J(qe,ee,"value"),le=si(Z.minContains)?[`(count >= ${Z.minContains})`]:[],Ne=si(Z.maxContains)?[`(count <= ${Z.maxContains})`]:[],we=`const count = value.reduce((${X}, ${fe}) => ${ie} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...le,...Ne].join(" && ");yield`((${fe}) => { ${we}; return ${Be}})(${K})`}Z.uniqueItems===!0&&(yield`((${fe}) => { 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(Z,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(Z,ee,K){yield`(typeof ${K} === 'bigint')`,Yg(Z.exclusiveMaximum)&&(yield`${K} < BigInt(${Z.exclusiveMaximum})`),Yg(Z.exclusiveMinimum)&&(yield`${K} > BigInt(${Z.exclusiveMinimum})`),Yg(Z.maximum)&&(yield`${K} <= BigInt(${Z.maximum})`),Yg(Z.minimum)&&(yield`${K} >= BigInt(${Z.minimum})`),Yg(Z.multipleOf)&&(yield`(${K} % BigInt(${Z.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(Z,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(Z,ee,K){yield*W(Z.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(Z,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,si(Z.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${Z.exclusiveMaximumTimestamp}`),si(Z.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${Z.exclusiveMinimumTimestamp}`),si(Z.maximumTimestamp)&&(yield`${K}.getTime() <= ${Z.maximumTimestamp}`),si(Z.minimumTimestamp)&&(yield`${K}.getTime() >= ${Z.minimumTimestamp}`),si(Z.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${Z.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(Z,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(Z,ee,K){let fe=globalThis.Object.getOwnPropertyNames(Z.$defs).reduce((X,ue)=>[...X,Z.$defs[ue]],[]);yield*W(CI(Z.$ref),[...ee,...fe],K)}a(h,"FromImport");function*m(Z,ee,K){yield`Number.isInteger(${K})`,si(Z.exclusiveMaximum)&&(yield`${K} < ${Z.exclusiveMaximum}`),si(Z.exclusiveMinimum)&&(yield`${K} > ${Z.exclusiveMinimum}`),si(Z.maximum)&&(yield`${K} <= ${Z.maximum}`),si(Z.minimum)&&(yield`${K} >= ${Z.minimum}`),si(Z.multipleOf)&&(yield`(${K} % ${Z.multipleOf}) === 0`)}a(m,"FromInteger");function*g(Z,ee,K){let fe=Z.allOf.map(X=>J(X,ee,K)).join(" && ");if(Z.unevaluatedProperties===!1){let X=H(`${new RegExp(bB(Z))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key))`;yield`(${fe} && ${ue})`}else if(Nu(Z.unevaluatedProperties)){let X=H(`${new RegExp(bB(Z))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key) || ${J(Z.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${fe} && ${ue})`}else yield`(${fe})`}a(g,"FromIntersect");function*A(Z,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(Z,ee,K){typeof Z.const=="number"||typeof Z.const=="boolean"?yield`(${K} === ${Z.const})`:yield`(${K} === '${Jwt.Escape(Z.const)}')`}a(y,"FromLiteral");function*E(Z,ee,K){yield"false"}a(E,"FromNever");function*_(Z,ee,K){yield`(!${J(Z.not,ee,K)})`}a(_,"FromNot");function*v(Z,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(Z,ee,K){yield OV.IsNumberLike(K),si(Z.exclusiveMaximum)&&(yield`${K} < ${Z.exclusiveMaximum}`),si(Z.exclusiveMinimum)&&(yield`${K} > ${Z.exclusiveMinimum}`),si(Z.maximum)&&(yield`${K} <= ${Z.maximum}`),si(Z.minimum)&&(yield`${K} >= ${Z.minimum}`),si(Z.multipleOf)&&(yield`(${K} % ${Z.multipleOf}) === 0`)}a(b,"FromNumber");function*T(Z,ee,K){yield OV.IsObjectLike(K),si(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${Z.minProperties}`),si(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${Z.maxProperties}`);let fe=Object.getOwnPropertyNames(Z.properties);for(let X of fe){let ue=c6e.Encode(K,X),qe=Z.properties[X];if(Z.required&&Z.required.includes(X))yield*W(qe,ee,ue),(SB(qe)||e(qe))&&(yield`('${X}' in ${K})`);else{let ie=J(qe,ee,ue);yield OV.IsExactOptionalProperty(K,X,ie)}}if(Z.additionalProperties===!1)if(Z.required&&Z.required.length===fe.length)yield`Object.getOwnPropertyNames(${K}).length === ${fe.length}`;else{let X=`[${fe.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${X}.includes(key))`}if(typeof Z.additionalProperties=="object"){let X=J(Z.additionalProperties,ee,`${K}[key]`),ue=`[${fe.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${X}))`}}a(T,"FromObject");function*w(Z,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(Z,ee,K){yield OV.IsRecordLike(K),si(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${Z.minProperties}`),si(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${Z.maxProperties}`);let[fe,X]=Object.entries(Z.patternProperties)[0],ue=H(`${new RegExp(fe)}`),qe=J(X,ee,"value"),ie=Nu(Z.additionalProperties)?J(Z.additionalProperties,ee,K):Z.additionalProperties===!1?"false":"true",le=`(${ue}.test(key) ? ${qe} : ${ie})`;yield`(Object.entries(${K}).every(([key, value]) => ${le}))`}a(R,"FromRecord");function*x(Z,ee,K){let fe=va(Z,ee);if($.functions.has(Z.$ref))return yield`${ne(Z.$ref)}(${K})`;yield*W(fe,ee,K)}a(x,"FromRef");function*P(Z,ee,K){let fe=H(`${new RegExp(Z.source,Z.flags)};`);yield`(typeof ${K} === 'string')`,si(Z.maxLength)&&(yield`${K}.length <= ${Z.maxLength}`),si(Z.minLength)&&(yield`${K}.length >= ${Z.minLength}`),yield`${fe}.test(${K})`}a(P,"FromRegExp");function*D(Z,ee,K){yield`(typeof ${K} === 'string')`,si(Z.maxLength)&&(yield`${K}.length <= ${Z.maxLength}`),si(Z.minLength)&&(yield`${K}.length >= ${Z.minLength}`),Z.pattern!==void 0&&(yield`${H(`${new RegExp(Z.pattern)};`)}.test(${K})`),Z.format!==void 0&&(yield`format('${Z.format}', ${K})`)}a(D,"FromString");function*N(Z,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*L(Z,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(Z.pattern)};`)}.test(${K})`}a(L,"FromTemplateLiteral");function*B(Z,ee,K){yield`${ne(Z.$ref)}(${K})`}a(B,"FromThis");function*j(Z,ee,K){if(yield`Array.isArray(${K})`,Z.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${Z.maxItems})`;for(let fe=0;feJ(X,ee,K)).join(" || ")})`}a(O,"FromUnion");function*q(Z,ee,K){yield`${K} instanceof Uint8Array`,si(Z.maxByteLength)&&(yield`(${K}.length <= ${Z.maxByteLength})`),si(Z.minByteLength)&&(yield`(${K}.length >= ${Z.minByteLength})`)}a(q,"FromUint8Array");function*Q(Z,ee,K){yield"true"}a(Q,"FromUnknown");function*U(Z,ee,K){yield OV.IsVoidLike(K)}a(U,"FromVoid");function*z(Z,ee,K){let fe=$.instances.size;$.instances.set(fe,Z),yield`kind('${Z[Tt]}', ${fe}, ${K})`}a(z,"FromKind");function*W(Z,ee,K,fe=!0){let X=Ea(Z.$id)?[...ee,Z]:ee,ue=Z;if(fe&&Ea(Z.$id)){let qe=ne(Z.$id);if($.functions.has(qe))return yield`${qe}(${K})`;{$.functions.set(qe,"");let ie=re(qe,Z,ee,"value",!1);return $.functions.set(qe,ie),yield`${qe}(${K})`}}switch(ue[Tt]){case"Any":return yield*r(ue,X,K);case"Argument":return yield*n(ue,X,K);case"Array":return yield*o(ue,X,K);case"AsyncIterator":return yield*s(ue,X,K);case"BigInt":return yield*c(ue,X,K);case"Boolean":return yield*l(ue,X,K);case"Constructor":return yield*u(ue,X,K);case"Date":return yield*d(ue,X,K);case"Function":return yield*f(ue,X,K);case"Import":return yield*h(ue,X,K);case"Integer":return yield*m(ue,X,K);case"Intersect":return yield*g(ue,X,K);case"Iterator":return yield*A(ue,X,K);case"Literal":return yield*y(ue,X,K);case"Never":return yield*E(ue,X,K);case"Not":return yield*_(ue,X,K);case"Null":return yield*v(ue,X,K);case"Number":return yield*b(ue,X,K);case"Object":return yield*T(ue,X,K);case"Promise":return yield*w(ue,X,K);case"Record":return yield*R(ue,X,K);case"Ref":return yield*x(ue,X,K);case"RegExp":return yield*P(ue,X,K);case"String":return yield*D(ue,X,K);case"Symbol":return yield*N(ue,X,K);case"TemplateLiteral":return yield*L(ue,X,K);case"This":return yield*B(ue,X,K);case"Tuple":return yield*j(ue,X,K);case"Undefined":return yield*M(ue,X,K);case"Union":return yield*O(ue,X,K);case"Uint8Array":return yield*q(ue,X,K);case"Unknown":return yield*Q(ue,X,K);case"Void":return yield*U(ue,X,K);default:if(!t_.Has(ue[Tt]))throw new Zwt(Z);return yield*z(ue,X,K)}}a(W,"Visit");let $={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function J(Z,ee,K,fe=!0){return`(${[...W(Z,ee,K,fe)].join(" && ")})`}a(J,"CreateExpression");function ne(Z){return`check_${Kwt.Encode(Z)}`}a(ne,"CreateFunctionName");function H(Z){let ee=`local_${$.variables.size}`;return $.variables.set(ee,`const ${ee} = ${Z}`),ee}a(H,"CreateVariable");function re(Z,ee,K,fe,X=!0){let[ue,qe]=[` +`,we=>"".padStart(we," ")],ie=ae("value","any"),le=Oe("boolean"),Ne=[...W(ee,K,fe,X)].map(we=>`${qe(4)}${we}`).join(` &&${ue}`);return`function ${Z}(${ie})${le} {${ue}${qe(2)}return (${ue}${Ne}${ue}${qe(2)}) +}`}a(re,"CreateFunction");function ae(Z,ee){let K=$.language==="typescript"?`: ${ee}`:"";return`${Z}${K}`}a(ae,"CreateParameter");function Oe(Z){return $.language==="typescript"?`: ${Z}`:""}a(Oe,"CreateReturns");function ve(Z,ee,K){let fe=re("check",Z,ee,"value"),X=ae("value","any"),ue=Oe("boolean"),qe=[...$.functions.values()],ie=[...$.variables.values()],le=Ea(Z.$id)?`return function check(${X})${ue} { + return ${ne(Z.$id)}(value) +}`:`return ${fe}`;return[...ie,...qe,le].join(` +`)}a(ve,"Build");function Fe(...Z){let ee={language:"javascript"},[K,fe,X]=Z.length===2&&wi(Z[1])?[Z[0],Z[1],ee]:Z.length===2&&!wi(Z[1])?[Z[0],[],Z[1]]:Z.length===3?[Z[0],Z[1],Z[2]]:Z.length===1?[Z[0],[],ee]:[null,[],ee];if($.language=X.language,$.variables.clear(),$.functions.clear(),$.instances.clear(),!Nu(K))throw new l6e(K);for(let ue of fe)if(!Nu(ue))throw new l6e(ue);return ve(K,fe,X)}a(Fe,"Code"),t.Code=Fe;function Pe(Z,ee=[]){let K=Fe(Z,ee,{language:"javascript"}),fe=globalThis.Function("kind","format","hash",K),X=new Map($.instances);function ue(Ne,we,Be){if(!t_.Has(Ne)||!X.has(we))return!1;let tt=t_.Get(Ne),st=X.get(we);return tt(st,Be)}a(ue,"typeRegistryFunction");function qe(Ne,we){return aP.Has(Ne)?aP.Get(Ne)(we):!1}a(qe,"formatRegistryFunction");function ie(Ne){return I9(Ne)}a(ie,"hashFunction");let le=fe(ue,qe,ie);return new Ywt(Z,ee,le,K)}a(Pe,"Compile"),t.Compile=Pe})(Mu||(Mu={}));var Y6e=he(h9()),Kie=he(require("os"));As();var K6e=he(ti());function Yie(t){return t===1}a(Yie,"isRestricted");var afo=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],hve=8192,cfo=21;var P0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return Yie(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(Zie(e))return this.reporterRestricted;if(rie(e))return new U_e}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}getFTReporter(e){if(nVr(e))return this.reporterFT;if(rie(e))return new U_e}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterFT,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterFT=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},lfo=S.Object({},{additionalProperties:S.String()}),ufo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),dfo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function ffo(t){return dfo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(ffo,"isOomError");function pfo(t){return RI(t)?"network":ffo(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(pfo,"getErrorType");var Vt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=Mu.Compile(lfo)}static{this.validateTelemetryMeasurements=Mu.Compile(ufo)}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||{},dl())}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=dl())}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=p1(e.get(Lr).getEditorInfo()),this.properties.editor_plugin_version=p1(e.get(Lr).getEditorPluginInfo());let r=e.get(Oa);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${T1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Lr);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=p1(r.getEditorInfo());let n=e.get(fr);this.properties.fetcher=n.name;let o=e.get(zo).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=lVr(e);r["copilot.build"]=uVr(e),r["copilot.buildType"]=L9(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(Yie(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>hve){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+hve;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(Jie,"telemetrizePromptLength");function dl(){return performance.now()}a(dl,"now");function yfo(t){return Math.floor(t/1e3)}a(yfo,"nowSeconds");function Zie(t){return t.get(Nf).optedIn}a(Zie,"shouldSendRestricted");function nVr(t){return t.get(Nf).ftFlag!==""}a(nVr,"shouldSendFinetuningTelemetry");function yt(t,e,r,n){return t.get(_d).register(Efo(t,e,dl(),r?.extendedBy(),n))}a(yt,"telemetry");function wI(t,e,r){return t.get(_d).register(Z6e(t,e,r?.extendedBy()))}a(wI,"telemetryMsft");function _t(t,e,r,n){let o=Vt.createAndMarkAsIssued(r,n);return t.get(_d).register(Z6e(t,e,o))}a(_t,"telemetryMs");function J6e(t,e,r,n){let o=(n||Vt.createAndMarkAsIssued()).extendedBy(iVr(r));return t.get(_d).register(Z6e(t,e,o))}a(J6e,"telemetryMsftWithError");function gi(t,e,r,n,o){let s=Vt.createAndMarkAsIssued({...n,...iVr(r)},o);return t.get(_d).register(Z6e(t,e,s))}a(gi,"telemetryMsWithError");function iVr(t){let e={};if(t){let r=Cfo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(iVr,"buildErrorProperties");async function Efo(t,e,r,n,o=0){let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Yie(o)||Zie(t))&&mve(t,o,e,s),Yie(o)&&afo.includes(e)&&nVr(t)&&Afo(t,o,e,s),hfo(t,e,s)}a(Efo,"_telemetry");async function Z6e(t,e,r){let n=r||Vt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),gfo(t,e,n)}a(Z6e,"_telemetryMsft");function X6e(t,e){return t.get(_d).register(_fo(t,e,dl()))}a(X6e,"telemetryExpProblem");async function _fo(t,e,r){let n="expProblem",o=Vt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),mve(t,0,n,o)}a(_fo,"_telemetryExpProblem");function Xie(t,e,r,n,o=0){let s={...r,...oVr(t)};mve(t,o,e,{properties:s,measurements:n})}a(Xie,"telemetryRaw");function oVr(t){let e=t.get(Lr),r={unique_id:ir(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:p1(e.getEditorInfo())};return{...t.get(Nf).getProperties(),...r}}a(oVr,"createRequiredProperties");var IPt=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,Y6e.SHA256)(Y6e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function La(t,e,r,n,o){return t.get(_d).register(sVr(t,e,dl(),r,{...n},o))}a(La,"telemetryException");async function sVr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||k0(c)||c instanceof K6e.ConnectionError||c instanceof K6e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new IPt(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(Lr).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=moe(t),f=hqr(c,u,d),h=Bpo(c),m=h==="exception",g=jt.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=Uwt(y.value):y.value="[redacted]");s??=ZQr(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(bN).isThrottled(A)){if(d){let y=pqr(c,u),E=jt.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,FCe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),FCe(t,0,`error.${h}`,g)}}a(uWr,"_telemetryException");function Pm(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await uWr(t,c,pl(),r,n)}},"wrapped");return(...s)=>t.get(_d).register(o(...s))}a(Pm,"telemetryCatch");function Bm(t,e,r,n){return t.get(_d).register(Gpo(t,e,pl(),r?.extendedBy(),n))}a(Bm,"telemetryError");async function Gpo(t,e,r,n,o=0){if(foe(o)&&!moe(t))return;let s=n||jt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),Fpo(t,o,e,s)}a(Gpo,"_telemetryError");function dWr(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=jt.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),ht(t,"engine.completion",u,1)}a(dWr,"logEngineCompletion");function fWr(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 ht(t,"engine.prompt",o,1)}a(fWr,"logEnginePrompt");function $po(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($po,"buildErrorFromUnknown");var XC=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return x9e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(ik).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 Vpo=new ge("expConfigManager"),Wpo=3600*1e3,PN=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){Vpo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function gWr(t){let e=qt(t,je.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(PN).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(gWr,"resolveTransparentTokenRefresh");p();p();var w9e=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 raw(){return this.userInfo}};p();function uPt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(uPt,"findKnownOrg");function AWr(t){let e=t.organization_list??[];return uPt(e)??""}a(AWr,"getUserKind");p();p();var oW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function P0(t){return!t||typeof t!="object"?!1:t instanceof oW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(P0,"isAbortError");var Aoe=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},DN=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}`}},zpo=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 OI(t,e=!0){return t instanceof Error?e&&"cause"in t&&OI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Aoe||t instanceof DN||t?.message?.startsWith("net::")||zpo.has(t.code??""):!1}a(OI,"isNetworkError");var BI=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 Aoe(`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 Aoe(`Response body truncated: actualLength=${s}`,"Truncated"):new Aoe(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function yoe(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(yoe,"parseRetryAfterSeconds");p();function R9e(){return typeof process>"u"}a(R9e,"isWeb");function NN(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(NN,"isMsBenchModeEnabled");var dPt=class extends DN{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 Td(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...R9e()?{}:by(t),...n.headers}};let o=await t.get(ar).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new DN(o);if(!o.headers.get("x-github-request-id"))throw new dPt(o);return o}a(Td,"apiFetch");p();p();var sa=class{constructor(){this.recentNotifications=new nn(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 aa=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 _Wr=require("os"),k9e=require("path");p();var yWr;(()=>{"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,q){for(var F,U="",W=0,V=-1,G=0,Y=0;Y<=O.length;++Y){if(Y2){var re=U.lastIndexOf("/");if(re!==U.length-1){re===-1?(U="",W=0):W=(U=U.slice(0,re)).length-1-U.lastIndexOf("/"),V=Y,G=0;continue}}else if(U.length===2||U.length===1){U="",W=0,V=Y,G=0;continue}}q&&(U.length>0?U+="/..":U="..",W=2)}else U.length>0?U+="/"+O.slice(V+1,Y):U=O.slice(V+1,Y),W=Y-V-1;V=Y,G=0}else F===46&&G!==-1?++G:G=-1}return U}a(Q,"r");var M={resolve:a(function(){for(var O,q="",F=!1,U=arguments.length-1;U>=-1&&!F;U--){var W;U>=0?W=arguments[U]:(O===void 0&&(O=process.cwd()),W=O),B(W),W.length!==0&&(q=W+"/"+q,F=W.charCodeAt(0)===47)}return q=Q(q,!F),F?q.length>0?"/"+q:"/":q.length>0?q:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var q=O.charCodeAt(0)===47,F=O.charCodeAt(O.length-1)===47;return(O=Q(O,!q)).length!==0||q||(O="."),O.length>0&&F&&(O+="/"),q?"/"+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,q=0;q0&&(O===void 0?O=F:O+="/"+F)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,q){if(B(O),B(q),O===q||(O=M.resolve(O))===(q=M.resolve(q)))return"";for(var F=1;FY){if(q.charCodeAt(V+j)===47)return q.slice(V+j+1);if(j===0)return q.slice(V+j)}else W>Y&&(O.charCodeAt(F+j)===47?re=j:j===0&&(re=0));break}var X=O.charCodeAt(F+j);if(X!==q.charCodeAt(V+j))break;X===47&&(re=j)}var ie="";for(j=F+re+1;j<=U;++j)j!==U&&O.charCodeAt(j)!==47||(ie.length===0?ie+="..":ie+="/..");return ie.length>0?ie+q.slice(V+re):(V+=re,q.charCodeAt(V)===47&&++V,q.slice(V))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var q=O.charCodeAt(0),F=q===47,U=-1,W=!0,V=O.length-1;V>=1;--V)if((q=O.charCodeAt(V))===47){if(!W){U=V;break}}else W=!1;return U===-1?F?"/":".":F&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,q){if(q!==void 0&&typeof q!="string")throw new TypeError('"ext" argument must be a string');B(O);var F,U=0,W=-1,V=!0;if(q!==void 0&&q.length>0&&q.length<=O.length){if(q.length===O.length&&q===O)return"";var G=q.length-1,Y=-1;for(F=O.length-1;F>=0;--F){var re=O.charCodeAt(F);if(re===47){if(!V){U=F+1;break}}else Y===-1&&(V=!1,Y=F+1),G>=0&&(re===q.charCodeAt(G)?--G==-1&&(W=F):(G=-1,W=Y))}return U===W?W=Y:W===-1&&(W=O.length),O.slice(U,W)}for(F=O.length-1;F>=0;--F)if(O.charCodeAt(F)===47){if(!V){U=F+1;break}}else W===-1&&(V=!1,W=F+1);return W===-1?"":O.slice(U,W)},"basename"),extname:a(function(O){B(O);for(var q=-1,F=0,U=-1,W=!0,V=0,G=O.length-1;G>=0;--G){var Y=O.charCodeAt(G);if(Y!==47)U===-1&&(W=!1,U=G+1),Y===46?q===-1?q=G:V!==1&&(V=1):q!==-1&&(V=-1);else if(!W){F=G+1;break}}return q===-1||U===-1||V===0||V===1&&q===U-1&&q===F+1?"":O.slice(q,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(q,F){var U=F.dir||F.root,W=F.base||(F.name||"")+(F.ext||"");return U?U===F.root?U+W:U+"/"+W:W})(0,O)},"format"),parse:a(function(O){B(O);var q={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return q;var F,U=O.charCodeAt(0),W=U===47;W?(q.root="/",F=1):F=0;for(var V=-1,G=0,Y=-1,re=!0,j=O.length-1,X=0;j>=F;--j)if((U=O.charCodeAt(j))!==47)Y===-1&&(re=!1,Y=j+1),U===46?V===-1?V=j:X!==1&&(X=1):V!==-1&&(X=-1);else if(!re){G=j+1;break}return V===-1||Y===-1||X===0||X===1&&V===Y-1&&V===G+1?Y!==-1&&(q.base=q.name=G===0&&W?O.slice(1,Y):O.slice(G,Y)):(G===0&&W?(q.name=O.slice(1,V),q.base=O.slice(1,Y)):(q.name=O.slice(G,V),q.base=O.slice(G,Y)),q.ext=O.slice(V,Y)),G>0?q.dir=O.slice(0,G-1):W&&(q.dir="/"),q},"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,q,F=!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,W){return U||W?U:"file"})(B,F),this.authority=Q||d,this.path=(function(U,W){switch(U){case"https":case"http":case"file":W?W[0]!==f&&(W=f+W):W=f}return W})(this.scheme,M||d),this.query=O||d,this.fragment=q||d,u(this,F))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:Q,authority:M,path:O,query:q,fragment:F}=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),q===void 0?q=this.query:q===null&&(q=d),F===void 0?F=this.fragment:F===null&&(F=d),Q===this.scheme&&M===this.authority&&O===this.path&&q===this.query&&F===this.fragment?this:new A(Q,M,O,q,F)}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 q=0;q=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||B&&F===47||Q&&F===91||Q&&F===93||Q&&F===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,q)),O=-1),M!==void 0&&(M+=L.charAt(q));else{M===void 0&&(M=L.substr(0,q));let U=y[F];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,q)),O=-1),M+=U):O===-1&&(O=q)}}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:q,path:F,query:U,fragment:W}=L;if(O&&(M+=O,M+=":"),(q||O==="file")&&(M+=f,M+=f),q){let V=q.indexOf("@");if(V!==-1){let G=q.substr(0,V);q=q.substr(V+1),V=G.lastIndexOf(":"),V===-1?M+=Q(G,!1,!1):(M+=Q(G.substr(0,V),!1,!1),M+=":",M+=Q(G.substr(V+1),!1,!0)),M+="@"}q=q.toLowerCase(),V=q.lastIndexOf(":"),V===-1?M+=Q(q,!1,!0):(M+=Q(q.substr(0,V),!1,!0),M+=q.substr(V))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){let V=F.charCodeAt(1);V>=65&&V<=90&&(F=`/${String.fromCharCode(V+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){let V=F.charCodeAt(0);V>=65&&V<=90&&(F=`${String.fromCharCode(V+32)}:${F.substr(2)}`)}M+=Q(F,!0,!1)}return U&&(M+="?",M+=Q(U,!1,!1)),W&&(M+="#",M+=B?W:E(W,!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 k=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...Q){return B.with({path:k.join(B.path,...Q)})},L.resolvePath=function(B,...Q){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let q=k.resolve(M,...Q);return O&&q[0]===D&&!B.authority&&(q=q.substring(1)),B.with({path:q})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let Q=k.dirname(B.path);return Q.length===1&&Q.charCodeAt(0)===46&&(Q=""),B.with({path:Q})},L.basename=function(B){return k.basename(B.path)},L.extname=function(B){return k.extname(B.path)}})(N||(N={})),yWr=n})();var{URI:Z9,Utils:UCe}=yWr;function CWr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+CWr(t.substring(3)):t}}a(CWr,"decodeURIComponentGraceful");var EWr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function fPt(t){return t.match(EWr)?t.replace(EWr,e=>CWr(e)):t}a(fPt,"percentDecode");function Ia(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 Z9.file(t).toString()}a(Ia,"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?Z9.parse(e[1]+e[2],!0):Z9.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(To,"parseUri");function P9e(t){return To(t),t}a(P9e,"validateUri");function ca(t){try{return To(t).toString()}catch{return t}}a(ca,"normalizeUri");var sW=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function Wn(t){let e=To(t);if(!sW.has(e.scheme)&&!aa.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,_Wr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,k9e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(Wn,"fsPath");function ho(t){try{return Wn(t)}catch{return}}a(ho,"getFsPath");function vWr(t){let e=ho(t);if(e)return Z9.file(e).toString()}a(vWr,"getFsUri");function aW(t,...e){let r,n=ho(t);return n?r=Ia((0,k9e.resolve)(n,...e)):r=UCe.resolvePath(To(t),...e.map(o=>bWr(o))).toString(),typeof t=="string"?r:{uri:r}}a(aW,"resolveFilePath");function xa(t,...e){let r=UCe.joinPath(To(t),...e.map(bWr)).toString();return typeof t=="string"?r:{uri:r}}a(xa,"joinPath");function bWr(t){return Ypo(t)?t.replaceAll("\\","/"):t}a(bWr,"pathToURIPath");function Ypo(t){return/^[^/\\]*\\/.test(t)}a(Ypo,"isWinPath");function ji(t){return fPt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(ji,"basename");function tf(t){let e=UCe.dirname(To(t)),r;return sW.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(tf,"dirname");function SWr(t){return UCe.extname(To(t))}a(SWr,"extname");var D0=class{static{a(this,"NetworkConfiguration")}};function D9e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!hPt(t)&&r.protocol==="http:")return r.href}catch{}}a(D9e,"ensurePermittedUrl");var cW={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 pPt(t,e,r){if(r&&v1(t)){for(let n of r){let o=qt(t,n);if(o)return o}return}for(let n of e){let o=qt(t,n);if(o)return o}}a(pPt,"urlConfigOverride");function Kpo(t,e){switch(e){case"api":return pPt(t,[je.DebugOverrideCapiUrl,je.DebugOverrideCapiUrlLegacy],[je.DebugTestOverrideCapiUrl,je.DebugTestOverrideCapiUrlLegacy]);case"proxy":return pPt(t,[je.DebugOverrideProxyUrl,je.DebugOverrideProxyUrlLegacy],[je.DebugTestOverrideProxyUrl,je.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!hPt(t))return pPt(t,[je.DebugSnippyOverrideUrl])}}a(Kpo,"getEndpointOverrideUrl");function LI(t,e,r,...n){let o=Kpo(t,r)??e.endpoints[r];return xa(o,...n)}a(LI,"getEndpointUrl");function HB(t){return FI(t)?.endpoints??cW}a(HB,"getLastKnownEndpoints");function N9e(t,e){if(e&&!D9e(t,e)){t.get(sa).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(D0).setConfiguredUrls(t,{serverUrl:e})}a(N9e,"updateServerUrl");p();var N0=class{static{a(this,"UrlOpener")}};var Jg=new ge("auth"),mPt=60,Jpo=300;var Zpo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Xpo="4535c7beffc844b46bb1ed4aa04d759a";function Sy(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(Sy,"fillGitHubUrls");function X9(){return Math.floor(Date.now()/1e3)}a(X9,"nowSeconds");async function gPt(t,e,r){let n=jt.createAndMarkAsIssued({},{});ht(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Td(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json(),l=c.user_notification;if(TWr(t,l,e),s.status===401){let m="Failed to get copilot token due to 401 status. Please sign out and try again.",g=s.headers.get("x-github-request-id")??"",A=c.error_details,y=[];g&&y.push(`request_id=${g}`),A?.url&&y.push(`url=${A.url}`),A?.notification_id&&y.push(`notification_id=${A.notification_id}`),A?.message&&y.push(`error=${A.message}`);let E=y.length>0?` (${y.join(", ")})`:"";return Jg.info(t,`${m}${E}`),Bm(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:m}}if(!s.ok||!c.token){Jg.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),Bm(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let m=c.error_details;return m?.notification_id!=="not_signed_up"&&TWr(t,m,e),{failureKind:"NotAuthorized",message:m?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let u=X9()+c.refresh_in+mPt,d=await QCe(t,e),f;d.ok&&(f=await d.json());let h=new lW(c,f,u);return ht(t,"auth.new_token",n.extendedBy({...Dwt(h)},{adjusted_expires_at:h.expiresAt,expires_at:c.expires_at,current_time:X9()})),{copilotToken:h}}a(gPt,"authFromGitHubSession");var gh=class{static{a(this,"CopilotTokenFetcher")}},M9e=class extends gh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await gPt(e,r,n)}};async function QCe(t,e){return await Td(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(QCe,"fetchCopilotUserInfo");function TWr(t,e,r){e&&t.get(sa).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(Lr).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(N0).open(l)}e.notification_id&&s&&await eho(t,e.notification_id,r)}).catch(n=>{Jg.exception(t,n,"copilotToken.notification")})}a(TWr,"notifyUser");async function eho(t,e,r){let n=await Td(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&Jg.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(eho,"sendNotificationResultToGitHub");var lW=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 w9e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...cW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-Jpo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Xpo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var Ai=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function O9e(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(O9e,"authEnvVarConflictMessage");var eU=class extends Ai{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function IWr(t){let e=t.trim();if(!e)throw new Ai("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new Ai("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new Ai("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new Ai("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(IWr,"validateGitHubServerUrl");p();p();var MN=class{static{a(this,"AuthRepository")}};p();function xWr(t){let e=t.trim();if(!e)throw new Ai("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=IWr(r),{apiUrl:o}=Sy({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(xWr,"buildAuthServerEndpoint");function tU(t,e){if(e!==void 0)return xWr(e);{let r=t.get(D0),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(tU,"resolveAuthServerEndpoint");function APt(t){if(!t)return!1;try{return xWr(t),!0}catch{return!1}}a(APt,"isValidAuthServer");p();p();p();p();p();p();p();p();function VB(t,e){return t||e}a(VB,"_pureAssign");function M0(t,e){return t[e]}a(M0,"_pureRef");var ev=void 0,Ah=null,DPt="",H9e="function",jCe="object",GB="prototype",kPt="__proto__",uW="undefined",U9e="constructor",NPt="Symbol",tho="_polyfill",dW="length",Q9e="name",Zg="call",G9e="toString",UI=VB(Object),MPt=M0(UI,GB),NWr=VB(String),fW=M0(NWr,GB),HCe=VB(Math),MWr=VB(Array),$9e=M0(MWr,GB),$B=M0($9e,"slice");function Bf(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(Bf,"safe");function rho(t,e){var r=Bf(t);return r.e?e:r.v}a(rho,"safeGet");var yPt;function V9e(t){return function(e){return typeof e===t}}a(V9e,"_createIs");function OWr(t){var e="[object "+t+"]";return function(r){return!!(r&&GCe(r)===e)}}a(OWr,"_createObjIs");function GCe(t){return MPt[G9e].call(t)}a(GCe,"objToString");function Pn(t){return typeof t===uW||t===uW}a(Pn,"isUndefined");function nho(t){return!Coe(t)}a(nho,"isStrictUndefined");function Zt(t){return t===Ah||Pn(t)}a(Zt,"isNullOrUndefined");function iho(t){return t===Ah||!Coe(t)}a(iho,"isStrictNullOrUndefined");function Coe(t){return!!t||t!==ev}a(Coe,"isDefined");function oho(t){return!yPt&&(yPt=["string","number","boolean",uW,"symbol","bigint"]),t!==jCe&&yPt.indexOf(t)!==-1}a(oho,"isPrimitiveType");var yi=V9e("string"),Mr=V9e(H9e);function Fu(t){return!t&&Zt(t)?!1:!!t&&typeof t===jCe}a(Fu,"isObject");var cr=M0(MWr,"isArray"),W9e=OWr("Date"),Eh=V9e("number"),vk=V9e("boolean");var WB=OWr("Error");function Lm(t){return!!(t&&t.then&&Mr(t.then))}a(Lm,"isPromiseLike");function M1(t){return!(!t||rho(function(){return!(t&&0+t)},!t))}a(M1,"isTruthy");var voe=M0(UI,"getOwnPropertyDescriptor");function Fm(t,e){return!!t&&MPt.hasOwnProperty[Zg](t,e)}a(Fm,"objHasOwnProperty");var Xg=VB(M0(UI,"hasOwn"),sho);function sho(t,e){return Fm(t,e)||!!voe(t,e)}a(sho,"polyObjHasOwn");function zr(t,e,r){if(t&&Fu(t)){for(var n in t)if(Xg(t,n)&&e[Zg](r||t,n,t[n])===-1)break}}a(zr,"objForEachKey");var B9e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function aho(t){var e={};if(e[B9e.c]=!0,e[B9e.e]=!0,t.l){e.get=function(){return t.l.v};var r=voe(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return zr(t,function(n,o){e[B9e[n]]=nho(o)?e[B9e[n]]:o}),e}a(aho,"_createProp");var s_=M0(UI,"defineProperty"),BWr=M0(UI,"defineProperties");function Hi(t,e,r){return s_(t,e,aho(r))}a(Hi,"objDefine");function LWr(t,e,r,n,o){var s={};return zr(t,function(c,l){q9e(s,c,e?l:c),q9e(s,l,r?l:c)}),n?n(s):s}a(LWr,"_createKeyValueMap");function q9e(t,e,r,n){s_(t,e,{value:r,enumerable:!0,writable:!1})}a(q9e,"_assignMapValue");var Lu=VB(NWr),cho="[object Error]";function lr(t,e){var r=DPt,n=MPt[G9e][Zg](t);n===cho&&(t={stack:Lu(t.stack),message:Lu(t.message),name:Lu(t.name)});try{r=JSON.stringify(t,Ah,e?typeof e=="number"?e:4:ev),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):Ah)||Lu(t)}catch(o){r=" - "+lr(o,e)}return n+": "+r}a(lr,"dumpObj");function Kc(t){throw new Error(t)}a(Kc,"throwError");function O0(t){throw new TypeError(t)}a(O0,"throwTypeError");var FWr=M0(UI,"freeze");function lho(t){return t}a(lho,"_doNothing");function uho(t){return t[kPt]||Ah}a(uho,"_getProto");var zB=M0(UI,"assign"),Uu=M0(UI,"keys");function a_(t){return FWr&&zr(t,function(e,r){(cr(r)||Fu(r))&&a_(r)}),_h(t)}a(a_,"objDeepFreeze");var _h=VB(FWr,lho);var PPt=VB(M0(UI,"getPrototypeOf"),uho);function z9e(t){return LWr(t,1,0,_h)}a(z9e,"createEnum");function dho(t){return LWr(t,0,0,_h)}a(dho,"createEnumKeyMap");function fho(t){var e={};return zr(t,function(r,n){q9e(e,r,n[1]),q9e(e,n[0],n[1])}),_h(e)}a(fho,"createSimpleMap");function OPt(t){return fho(t)}a(OPt,"createTypeMap");var UWr=dho({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}),wWr="__tsUtils$gblCfg",EPt;function QWr(){var t;return typeof globalThis!==uW&&(t=globalThis),!t&&typeof self!==uW&&(t=self),!t&&typeof window!==uW&&(t=window),!t&&typeof global!==uW&&(t=global),t}a(QWr,"_getGlobalValue");function qWr(){if(!EPt){var t=Bf(QWr).v||{};EPt=t[wWr]=t[wWr]||{}}return EPt}a(qWr,"_getGlobalConfig");var boe=$Ce;function $Ce(t,e,r){var n=e?e[t]:Ah;return function(o){var s=(o?o[t]:Ah)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?$B[Zg](c,1):c)}O0('"'+Lu(t)+'" not defined for '+lr(o))}}a($Ce,"_unwrapFunctionWithPoly");function pho(t){return function(e){return e[t]}}a(pho,"_unwrapProp");var rU=M0(HCe,"min"),bk=M0(HCe,"max"),RWr=boe("slice",fW),Lf=boe("substring",fW),Y9e=$Ce("substr",fW,hho);function hho(t,e,r){return Zt(t)&&O0("Invalid "+lr(t)),r<0?DPt:(e=e||0,e<0&&(e=bk(e+t[dW],0)),Pn(r)?RWr(t,e):RWr(t,e,e+r))}a(hho,"polyStrSubstr");function ON(t,e){return Lf(t,0,e)}a(ON,"strLeft");var kWr="_urid",_Pt;function mho(){if(!_Pt){var t=qWr();_Pt=t.gblSym=t.gblSym||{k:{},s:{}}}return _Pt}a(mho,"_globalSymbolRegistry");var L9e;function BPt(t){var e={description:Lu(t),toString:a(function(){return NPt+"("+t+")"},"toString")};return e[tho]=!0,e}a(BPt,"polyNewSymbol");function gho(t){var e=mho();if(!Xg(e.k,t)){var r=BPt(t),n=Uu(e.s).length;r[kWr]=function(){return n+"_"+r[G9e]()},e.k[t]=r,e.s[r[kWr]()]=Lu(t)}return e.k[t]}a(gho,"polySymbolFor");function Aho(t){!L9e&&(L9e={});var e,r=UWr[t];return r&&(e=L9e[r]=L9e[r]||BPt(NPt+"."+r)),e}a(Aho,"polyGetKnownSymbol");var yh;function nU(){yh=qWr()}a(nU,"_initTestHooks");function K9e(t){var e={};return!yh&&nU(),e.b=yh.lzy,s_(e,"v",{configurable:!0,get:a(function(){var r=t();return yh.lzy||s_(e,"v",{value:r}),e.b=yh.lzy,r},"get")}),e}a(K9e,"getLazy");function O1(t){return s_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(O1,"createCachedValue");var jWr="window",qCe;function J9e(t,e){var r;return function(){return!yh&&nU(),(!r||yh.lzy)&&(r=O1(Bf(t,e).v)),r.v}}a(J9e,"_getGlobalInstFn");function Ty(t){return!yh&&nU(),(!qCe||t===!1||yh.lzy)&&(qCe=O1(Bf(QWr).v||Ah)),qCe.v}a(Ty,"getGlobal");function ki(t,e){var r;if(!qCe||e===!1?r=Ty(e):r=qCe.v,r&&r[t])return r[t];if(t===jWr)try{return window}catch{}return Ah}a(ki,"getInst");function YB(){return!!rf()}a(YB,"hasDocument");var rf=J9e(ki,["document"]);function Soe(){return!!nf()}a(Soe,"hasWindow");var nf=J9e(ki,[jWr]);function pW(){return!!Qu()}a(pW,"hasNavigator");var Qu=J9e(ki,["navigator"]);var HWr=J9e(function(){return!!Bf(function(){return process&&(process.versions||{}).node}).v});var _oe,CPt;function Z9e(){return _oe=O1(Bf(ki,[NPt]).v),_oe}a(Z9e,"_initSymbol");function yho(t){var e=(yh.lzy?0:_oe)||Z9e();return e.v?e.v[t]:ev}a(yho,"_getSymbolKey");function GWr(){return!!Eho()}a(GWr,"hasSymbol");function Eho(){return!yh&&nU(),((yh.lzy?0:_oe)||Z9e()).v}a(Eho,"getSymbol");function VCe(t,e){var r=UWr[t];!yh&&nU();var n=(yh.lzy?0:_oe)||Z9e();return n.v?n.v[r||t]:e?ev:Aho(t)}a(VCe,"getKnownSymbol");function QI(t,e){!yh&&nU();var r=(yh.lzy?0:_oe)||Z9e();return r.v?r.v(t):e?Ah:BPt(t)}a(QI,"newSymbol");function iU(t){return!yh&&nU(),CPt=(yh.lzy?0:CPt)||O1(Bf(yho,["for"]).v),(CPt.v||gho)(t)}a(iU,"symbolFor");function j9e(t){return!!t&&Mr(t.next)}a(j9e,"isIterator");function LPt(t){return!iho(t)&&Mr(t[VCe(3)])}a(LPt,"isIterable");var F9e;function X9e(t,e,r){if(t&&(j9e(t)||(!F9e&&(F9e=O1(VCe(3))),t=t[F9e.v]?t[F9e.v]():Ah),j9e(t))){var n=ev,o=ev;try{for(var s=0;!(o=t.next()).done&&e[Zg](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=Ah,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(X9e,"iterForOf");function Eoe(t,e,r){return t.apply(e,r)}a(Eoe,"fnApply");function Ch(t,e){return!Pn(e)&&t&&(cr(e)?Eoe(t.push,t,e):j9e(e)||LPt(e)?X9e(e,function(r){t.push(r)}):t.push(e)),t}a(Ch,"arrAppend");function yt(t,e,r){if(t)for(var n=t[dW]>>>0,o=0;o0?r:0;return Lf(t,o,o+n[dW])===n}a(Mho,"polyStrStartsWith");var xPt="ref",wPt="unref",RPt="hasRef",Oho="enabled";function Bho(t,e,r){var n=!0,o=t?e(Ah):Ah,s;function c(){return n=!1,o&&o[wPt]&&o[wPt](),s}a(c,"_unref");function l(){o&&r(o),o=Ah}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[RPt]=function(){return o&&o[RPt]?o[RPt]():n},s[xPt]=function(){return n=!0,o&&o[xPt]&&o[xPt](),s},s[wPt]=c,s=s_(s,Oho,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=Ah},"dn")}}a(Bho,"_createTimerHandler");function UPt(t,e,r){var n=cr(e),o=n?e.length:0,s=(o>0?e[0]:n?ev:e)||setTimeout,c=(o>1?e[1]:ev)||clearTimeout,l=r[0];r[0]=function(){u.dn(),Eoe(l,ev,$B[Zg](arguments))};var u=Bho(t,function(d){if(d){if(d.refresh)return d.refresh(),d;Eoe(c,ev,[d])}return Eoe(s,ev,r)},function(d){Eoe(c,ev,[d])});return u.h}a(UPt,"_createTimeoutWith");function xp(t,e){return UPt(!0,ev,$B[Zg](arguments))}a(xp,"scheduleTimeout");function KWr(t,e,r){return UPt(!0,t,$B[Zg](arguments,1))}a(KWr,"scheduleTimeoutWith");function eUe(t,e){return UPt(!1,ev,$B[Zg](arguments))}a(eUe,"createTimeout");var JCe=z9e,QPt=OPt;p();var Sk=JCe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Tk="toLowerCase",un="length",xoe="warnToConsole",ZB="throwInternal",LN="watch",sU="apply",Li="push",qI="splice",qu="logger",FN="cancel",XB="initialize",UN="identifier",woe="removeNotificationListener",Roe="addNotificationListener",tv="isInitialized",ZCe="getNotifyMgr",aU="getPlugin",L1="name",B0="processNext",tUe="getProcessTelContext",eL="value",cU="enabled",qPt="stopPollingInternalLogs",jI="unload",XCe="onComplete",rUe="version",nUe="loggingLevelConsole",QN="createNew",F1="teardown",koe="messageId",qN="message",rv="diagLog",lU="_doTeardown",mW="update",U1="getNext",uU="setNextPlugin",eve="userAgent",HI="split",Ik="replace",tve="substring",rve="indexOf",tL="type",jPt="evtName",xk="status",HPt="getAllResponseHeaders",nve="isChildEvt",Q1="data",gW="getCtx",wk="setCtx",GPt="itemsReceived",ive="headers",Poe="urlString",AW="timeout";var iUe="traceFlags";var $Pt;function JWr(t,e){$Pt||($Pt=zCe("AggregationError",function(n,o){o[un]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw yt(e,function(n,o){r+=` -`.concat(o," > ").concat(lr(n))}),new $Pt(r,e||[])}a(JWr,"throwAggregationError");p();p();p();var Doe="function",GI="object",q1="undefined",j1="prototype";var dU=Object,ove=dU[j1];p();var Tbl=(Ty()||{}).Symbol,Ibl=(Ty()||{}).Reflect;var ZWr="hasOwnProperty",Fho=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(n2t,"_hasVisited");function qho(t,e,r,n){function o(u,d,f){var h=d[f];if(h[YPt]&&n){var m=u[dUe]||{};m[sve]!==!1&&(h=(m[d[Noe]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=BN(null);fUe(r,function(u){s[u]=o(e,r,u)});for(var c=EW(t),l=[];c&&!t2t(c)&&!n2t(l,c);)fUe(c,function(u){!s[u]&&r2t(c,u,!ave)&&(s[u]=o(e,c,u))}),l.push(c),c=EW(c);return s}a(qho,"_getBaseFuncs");function jho(t,e,r,n){var o=null;if(t&&Fm(r,Noe)){var s=t[dUe]||BN(null);if(o=(s[r[Noe]]||BN(null))[e],o||pUe("Missing ["+e+"] "+uUe),!o[KPt]&&s[sve]!==!1){for(var c=!Fm(t,e),l=EW(t),u=[];c&&l&&!t2t(l)&&!n2t(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=EW(l)}try{c&&(t[e]=o),o[KPt]=1}catch{s[sve]=!1}}}return o}a(jho,"_getInstFunc");function Hho(t,e,r){var n=e[t];return n===r&&(n=EW(e)[t]),typeof n!==uUe&&pUe("["+t+"] is not a "+uUe),n}a(Hho,"_getProtoFunc");function Gho(t,e,r,n,o){function s(u,d){var f=a(function(){var h=jho(this,d,u,f)||Hho(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[YPt]=1,f}if(a(s,"_createDynamicPrototype"),!cUe(t)){var c=r[dUe]=r[dUe]||BN(null);if(!cUe(c)){var l=c[e]=c[e]||BN(null);c[sve]!==!1&&(c[sve]=!!o),cUe(l)||fUe(r,function(u){r2t(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!Fm(t,u)||t[u]&&!t[u][YPt])&&(t[u]=s(t,u)))})}}}a(Gho,"_populatePrototype");function $ho(t,e){if(ave){for(var r=[],n=EW(e);n&&!t2t(n)&&!n2t(r,n);){if(n===t)return!0;r.push(n),n=EW(n)}return!1}return!0}a($ho,"_checkPrototype");function zPt(t,e){return Fm(t,rL)?t.name||e||XWr:((t||{})[lUe]||{}).name||e||XWr}a(zPt,"_getObjName");function bi(t,e,r,n){Fm(t,rL)||pUe("theClass is an invalid class definition.");var o=t[rL];$ho(o,e)||pUe("["+zPt(t)+"] not in hierarchy of ["+zPt(e)+"]");var s=null;Fm(o,Noe)?s=o[Noe]:(s=Uho+zPt(t,"_")+"$"+ZPt.n,ZPt.n++,o[Noe]=s);var c=bi[nzr],l=!!c[aUe];l&&n&&n[aUe]!==void 0&&(l=!!n[aUe]);var u=Qho(e),d=qho(o,e,u,l);r(e,d);var f=!!ave&&!!c[JPt];f&&n&&(f=!!n[JPt]),Gho(o,s,e,u,f!==!1)}a(bi,"dynamicProto");bi[nzr]=ZPt.o;p();var mUe="Promise";var d2t="rejected";function ml(t,e){return gUe(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:d2t,rejected:!0,reason:r}):r})}a(ml,"doAwaitResponse");function gUe(t,e,r,n){var o=t;try{if(Lm(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&&Vho(o,n)}return o}a(gUe,"doAwait");function Vho(t,e){var r=t;return e&&(Lm(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(Vho,"doFinally");var i2t,o2t,s2t,izr=!1;function Who(t,e,r,n){i2t=i2t||{toString:a(function(){return"[[PromiseState]]"},"toString")},o2t=o2t||{toString:a(function(){return"[[PromiseResult]]"},"toString")},s2t=s2t||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[i2t]={get:e},o[o2t]={get:r},o[s2t]={get:n},BWr(t,o)}a(Who,"_addDebugState$1");var azr=["pending","resolving","resolved",d2t],ozr="dispatchEvent",hUe;function zho(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(zho,"_hasInitEventFn");function Yho(t,e,r,n){var o=rf();!hUe&&(hUe=O1(!!Bf(zho,[o]).v));var s=hUe.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),hUe.v&&s.initEvent(e,!1,!0),s&&t[ozr])t[ozr](s);else{var c=t["on"+e];if(c)c(s);else{var l=ki("console");l&&(l.error||l.log)(e,lr(s))}}}a(Yho,"emitEvent");var czr="unhandledRejection",Kho=czr.toLowerCase(),cve=[],Jho=0,Zho=10;var a2t;function szr(t){return Mr(t)?t.toString():lr(t)}a(szr,"dumpFnObj");function lzr(t,e,r){var n=oU(arguments,3),o=0,s=!1,c,l=[],u=Jho++,d=cve.length>0?cve[cve.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{cve.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(k,D){l.push(function(){try{var N=o===2?w:R,L=Pn(N)?c:Mr(N)?N(c):N;Lm(L)?L.then(k,D):N?k(L):o===3?D(L):k(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{cve.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Mr(w)&&(R=a(function(k){return w&&w(),k},"thenFinally"),x=a(function(k){throw w&&w(),k},"catchFinally")),g(R,x)}a(y,"_finally");function E(){return azr[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&&Lm(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=xp(b,Zho))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,HWr())process.emit(czr,c,m);else{var w=nf()||Ty();!a2t&&(a2t=O1(Bf(ki,[mUe+"RejectionEvent"]).v)),Yho(w,Kho,function(R){return Hi(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!a2t.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},s_(m,"state",{get:E}),izr&&Who(m,E,function(){return GCe(c)},function(){return f}),GWr()&&(m[VCe(11)]="IPromise");function T(){return"IPromise"+(izr?"["+u+(Pn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+szr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Mr(r)||O0(mUe+": executor is not a function - "+szr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(lzr,"_createPromise");function Xho(t){return function(e){var r=oU(arguments,1);return t(function(n,o){try{var s=[],c=1;X9e(e,function(l,u){l&&(c++,gUe(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(Xho,"_createAllPromise");function e0o(t){return O1(function(e){var r=oU(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,ml(u,function(f){f.rejected?s[d]={status:d2t,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{cr(e)?yt(e,l):LPt(e)?X9e(e,l):O0("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(e0o,"_createAllSettledPromise");function uzr(t){yt(t,function(e){try{e()}catch{}})}a(uzr,"syncItemProcessor");function t0o(t){var e=Eh(t)?t:0;return function(r){xp(function(){uzr(r)},e)}}a(t0o,"timeoutItemProcessor");function dzr(t,e){return lzr(dzr,t0o(e),t,e)}a(dzr,"createAsyncPromise");var c2t;function r0o(t,e){!c2t&&(c2t=O1(Bf(ki,[mUe]).v||null));var r=c2t.v;if(!r)return dzr(t);Mr(t)||O0(mUe+": executor is not a function - "+lr(t));var n=0;function o(){return azr[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(r0o,"createNativePromise");var l2t;function lve(t){return lzr(lve,uzr,t)}a(lve,"createSyncPromise");function AUe(t,e){return!l2t&&(l2t=e0o(lve)),l2t.v(t,e)}a(AUe,"createSyncAllSettledPromise");var u2t;function Id(t,e){return!u2t&&(u2t=O1(r0o)),u2t.v.call(this,t,e)}a(Id,"createPromise");var yUe=Xho(Id);var o1l=VCe(11);p();p();p();p();var H1=void 0,Io="",_W="channels",Ff="core",EUe="createPerfMgr",uve="disabled",nL="extensionConfig",CW="extensions",nv="processTelemetry",vW="priority",Moe="eventsSent",fU="eventsDiscarded",Ooe="eventsSendRequest",jN="perfEvent",_Ue="offlineEventsStored",CUe="offlineBatchSent",vUe="offlineBatchDrop",Boe="getPerfMgr",bUe="domain",SUe="path",fzr="Not dynamic - ",pzr="REDACTED",f2t=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var n0o="getPrototypeOf",i0o=/-([a-z])/g,o0o=/([^\w\d_$])/g,s0o=/^(\d+[\w\d_$])/,m1l=Object[n0o];function pU(t){return!Zt(t)}a(pU,"isNotNullOrUndefined");function dve(t){var e=t;return e&&yi(e)&&(e=e[Ik](i0o,function(r,n){return n.toUpperCase()}),e=e[Ik](o0o,"_"),e=e[Ik](s0o,function(r,n){return"_"+n})),e}a(dve,"normalizeJsName");function L0(t,e){return t&&e?nu(t,e)!==-1:!1}a(L0,"strContains");function hU(t){return t&&t.toISOString()||""}a(hU,"toISOString");function wp(t){return WB(t)?t[L1]:Io}a(wp,"getExceptionName");function HN(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(HN,"setValue");function p2t(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Pn(r)?{}:r,t[e]=n)):n=Pn(r)?{}:r,n}a(p2t,"getSetValue");function a0o(t,e){var r=null,n=null;return Mr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][sU](n,o)}}a(a0o,"_createProxyFunction");function bW(t,e,r,n,o){t&&e&&r&&(o!==!1||Pn(t[e]))&&(t[e]=a0o(r,n))}a(bW,"proxyFunctionAs");function SW(t,e,r,n){return t&&e&&Fu(t)&&cr(r)&&yt(r,function(o){yi(o)&&bW(t,o,e,o,n)}),t}a(SW,"proxyFunctions");function h2t(t){return(function(){function e(){var r=this;t&&zr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(h2t,"createClassFromInterface");function IUe(t){return t&&zB&&(t=dU(zB({},t))),t}a(IUe,"optimizeObject");function xUe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[un],d=!1,f=1;for(u>0&&vk(l)&&(d=l,l=c[f]||{},f++),Fu(l)||(l={});f>>=0),gve=Czr+t&IW,Ave=vzr-t&IW,bzr=!0}a(C0o,"_mwcSeed");function v0o(){try{var t=hl()&2147483647;C0o((Math.random()*_zr^t)+t)}catch{}}a(v0o,"_autoSeedMwc");function Ezr(t){var e=0,r=b2t()||S2t();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&IW),e===0&&Uoe()&&(bzr||v0o(),e=b0o()&IW),e===0&&(e=B1(_zr*Math.random()|0)),t||(e>>>=0),e}a(Ezr,"random32");function b0o(t){Ave=36969*(Ave&65535)+(Ave>>16)&IW,gve=18e3*(gve&65535)+(gve>>16)&IW;var e=(Ave<<16)+(gve&65535)>>>0&IW|0;return t||(e>>>=0),e}a(b0o,"mwcRandom32");function Szr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=Ezr()>>>0,n=0,o=Io;o[un]>>=6,n===5&&(r=(Ezr()<<2&4294967295|r&3)>>>0,n=0);return o}a(Szr,"newId");var Tzr="3.3.11",S0o="."+Szr(6),T0o=0;function Izr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(Izr,"_canAcceptData");function I0o(t,e){var r=e[t.id];if(!r){r={};try{Izr(e)&&Hi(e,t.id,{e:!1,v:r})}catch{}}return r}a(I0o,"_getCache");function G1(t,e){return e===void 0&&(e=!1),dve(t+T0o+++(e?"."+Tzr:Io)+S0o)}a(G1,"createUniqueNamespace");function kUe(t){var e={id:G1("_aiData-"+(t||Io)+"."+Tzr),accept:a(function(r){return Izr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[dve(n)]:(s&&(c=I0o(e,r),c[dve(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(kUe,"createElmNodeData");p();function PUe(t){return t&&Fu(t)&&!cr(t)&&(t.isVal||t.fb||Xg(t,"v")||Xg(t,"mrg")||Xg(t,"ref")||t.set)}a(PUe,"_isConfigDefaults");function xzr(t,e,r){var n,o=r.dfVal||Coe;if(e&&r.fb){var s=r.fb;cr(s)||(s=[s]);for(var c=0;c0&&JWr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[un]>0){c||(c=[]),l||(l=xp(function(){l=null,f()},0));for(var A=0;A0?ml(iL(t[0],e),function(){BUe(oU(t,1),e,r)}):r(),n}a(BUe,"doUnloadAll");p();var Dzr=500,k2t="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function M0o(t,e,r){return!t&&Zt(t)?e:vk(t)?t:Lu(t)[Tk]()==="true"}a(M0o,"_stringToBoolOrDefault");function P2t(t){return{mrg:!0,v:t}}a(P2t,"cfgDfMerge");function qoe(t,e,r){return{fb:r,isVal:t,v:e}}a(qoe,"cfgDfValidate");function WI(t,e){return{fb:e,set:M0o,v:!!t}}a(WI,"cfgDfBoolean");p();p();var D2t=[Moe,fU,Ooe,jN],FUe=null,LUe;function O0o(t,e){return function(){var r=arguments,n=N2t(e);if(n){var o=n.listener;o&&o[t]&&o[t][sU](o,r)}}}a(O0o,"_listenerProxyFunc");function B0o(){var t=ki("Microsoft");return t&&(FUe=t.ApplicationInsights),FUe}a(B0o,"_getExtensionNamespace");function N2t(t){var e=FUe;return!e&&t.disableDbgExt!==!0&&(e=FUe||B0o()),e?e.ChromeDbgExt:null}a(N2t,"getDebugExt");function Nzr(t){if(!LUe){LUe={};for(var e=0;e=A&&(d[T](b[qN]),n[w]=!0)}else o>=A&&d[T](b[qN]);f(A,b)}},d.debugToConsole=function(A){M2t("debug",A),g("warning",A)},d[xoe]=function(A){M2t("warn",A),g("warning",A)},d.errorToConsole=function(A){M2t("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[jI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=U0o+y[koe];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Li](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new bve(23,v,!1);d.queue[Li](b),A===1?d.errorToConsole(v):d[xoe](v)}}}a(f,"_logInternalMessage");function h(A){return VI(vh(A,Q0o,d).cfg,function(y){var E=y.cfg;o=E[nUe],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=N2t(e||{});E&&E[rv]&&E[rv](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function Bzr(t){return t||new Hoe}a(Bzr,"_getLogger");function Vr(t,e,r,n,o,s){s===void 0&&(s=!1),Bzr(t)[ZB](e,r,n,o,s)}a(Vr,"_throwInternal");function oL(t,e){Bzr(t)[xoe](e)}a(oL,"_warnToConsole");var O2t,AU,Lzr="toGMTString",Fzr="toUTCString",U2t="cookie",B2t="expires",Uzr="isCookieUseDisabled",Sve="disableCookiesUsage",Qzr="_ckMgr",UUe=null,L2t=null,qzr=null,$N,jzr={},Hzr={},j0o=(O2t={cookieCfg:P2t((AU={},AU[bUe]={fb:"cookieDomain",dfVal:pU},AU.path={fb:"cookiePath",dfVal:pU},AU.enabled=H1,AU.ignoreCookies=H1,AU.blockedCookies=H1,AU.disableCookieDefer=!1,AU)),cookieDomain:H1,cookiePath:H1},O2t[Sve]=H1,O2t);function Q2t(){!$N&&($N=K9e(function(){return rf()}))}a(Q2t,"_getDoc");function QUe(t){return t?t.isEnabled():!0}a(QUe,"_isMgrEnabled");function Yzr(t,e){return e&&t&&cr(t.ignoreCookies)?Go(t.ignoreCookies,e)!==-1:!1}a(Yzr,"_isIgnoredCookie");function Gzr(t,e){return e&&t&&cr(t.blockedCookies)&&Go(t.blockedCookies,e)!==-1?!0:Yzr(t,e)}a(Gzr,"_isBlockedCookie");function $zr(t,e){var r=e[cU];if(Zt(r)){var n=void 0;Pn(t[Uzr])||(n=!t[Uzr]),Pn(t[Sve])||(n=!t[Sve]),r=n}return r}a($zr,"_isCfgEnabled");function Kzr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[SUe]=E||"/",_[B2t]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Uoe()||(v["max-age"]="0"),Wzr(Io,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||Io),R=nu(w,";");if(R!==-1&&(w=Pi(ON(E,R)),T=Jzr(Lf(E,R+1))),HN(T,bUe,v||o,M1,Pn),!Zt(_)){var x=Uoe();if(Pn(T[B2t])){var k=hl(),D=k+_*1e3;if(D>0){var N=new Date;N.setTime(D),HN(T,B2t,Vzr(N,x?Lzr:Fzr)||Vzr(N,x?Lzr:Fzr)||Io,M1)}}x||HN(T,"max-age",Io+_,null,Pn)}var L=hve();return L&&L.protocol==="https:"&&(HN(T,"secure",null,null,Pn),L2t===null&&(L2t=!G0o((Qu()||{})[eve])),L2t&&HN(T,"SameSite","None",null,Pn)),HN(T,SUe,b||n,null,Pn),Wzr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[un]-1;_>=0;_--)f[_].n===E&&f[qI](_,1)}a(g,"_removePendingCookie");function A(){F2t(e)&&f&&(yt(f,function(E){Gzr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=vh(t||Hzr,null,e).cfg,s=VI(t,function(E){E.setDf(E.cfg,j0o),r=E.ref(E.cfg,"cookieCfg"),n=r[SUe]||"/",o=r[bUe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=$zr(t,r)!==!1,l=r.getCookie||H0o,u=r.setCookie||zzr,d=r.delCookie||zzr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=$zr(t,r)!==!1&&c&&F2t(e),_=Hzr[Qzr];return E&&_&&y!==_&&(E=QUe(_)),E},"isEnabled"),setEnabled:a(function(E){r[cU]=E,Pn(t[Sve])||(t[Sve]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=Gzr(r,E);if(!R){var x=m(_,v,b,T);QUe(y)?(u(E,x),w=!0):f&&(g(E),f[Li]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=Io,v=Yzr(r,E);if(!v){if(QUe(y))_=l(E);else if(f)for(var b=f[un]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=nu(w,";");_=R!==-1?Pi(ON(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return QUe(y)?v=y.purge(E,_):f&&(g(E),f[Li]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return F2t(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[Qzr]=y,y}a(Kzr,"createCookieMgr");function F2t(t){if(UUe===null){UUe=!1,!$N&&Q2t();try{var e=$N.v||{};UUe=e[U2t]!==void 0}catch(r){Vr(t,2,68,"Cannot access document.cookie - "+wp(r),{exception:lr(r)})}}return UUe}a(F2t,"areCookiesSupported");function Jzr(t){var e={};if(t&&t[un]){var r=Pi(t)[HI](";");yt(r,function(n){if(n=Pi(n||Io),n){var o=nu(n,"=");o===-1?e[n]=null:e[Pi(ON(n,o))]=Pi(Lf(n,o+1))}})}return e}a(Jzr,"_extractParts");function Vzr(t,e){return Mr(t[e])?t[e]():null}a(Vzr,"_formatDate");function Wzr(t,e){var r=t||Io;return zr(e,function(n,o){r+="; "+n+(Zt(o)?Io:"="+o)}),r}a(Wzr,"_formatCookieValue");function H0o(t){var e=Io;if(!$N&&Q2t(),$N.v){var r=$N.v[U2t]||Io;qzr!==r&&(jzr=Jzr(r),qzr=r),e=Pi(jzr[t]||Io)}return e}a(H0o,"_getCookieValue");function zzr(t,e){!$N&&Q2t(),$N.v&&($N.v[U2t]=t+"="+e)}a(zzr,"_setCookieValue");function G0o(t){return yi(t)?!!(L0(t,"CPU iPhone OS 12")||L0(t,"iPad; CPU OS 12")||L0(t,"Macintosh; Intel Mac OS X 10_14")&&L0(t,"Version/")&&L0(t,"Safari")||L0(t,"Macintosh; Intel Mac OS X 10_14")&&JB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||L0(t,"Chrome/5")||L0(t,"Chrome/6")||L0(t,"UnrealEngine")&&!L0(t,"Chrome")||L0(t,"UCBrowser/12")||L0(t,"UCBrowser/11")):!1}a(G0o,"uaDisallowsSameSiteNone");p();var $0o={perfEvtsSendAll:!1};function V0o(t){t.h=null;var e=t.cb;t.cb=[],yt(e,function(r){Bf(r.fn,[r.arg])})}a(V0o,"_runScheduledListeners");function yU(t,e,r,n){yt(t,function(o){o&&o[e]&&(r?(r.cb[Li]({fn:n,arg:o}),r.h=r.h||xp(V0o,0,r)):Bf(n,[o]))})}a(yU,"_runListeners");var Zzr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=vh(e,$0o);n=c[LN](function(l){r=!!l.cfg.perfEvtsSendAll}),bi(t,this,function(l){Hi(l,"listeners",{g:a(function(){return o},"g")}),l[Roe]=function(u){o[Li](u)},l[woe]=function(u){for(var d=Go(o,u);d>-1;)o[qI](d,1),d=Go(o,u)},l[Moe]=function(u){yU(o,Moe,s,function(d){d[Moe](u)})},l[fU]=function(u,d,f){yU(o,fU,s,function(h){h[fU](u,d,f)})},l[Ooe]=function(u,d){yU(o,Ooe,d?s:null,function(f){f[Ooe](u,d)})},l[jN]=function(u){u&&(r||!u[nve]())&&yU(o,jN,null,function(d){u.isAsync?xp(function(){return d[jN](u)},0):d[jN](u)})},l[_Ue]=function(u){u&&u[un]&&yU(o,_Ue,s,function(d){d[_Ue](u)})},l[CUe]=function(u){u&&u[Q1]&&yU(o,CUe,s,function(d){d[CUe](u)})},l[vUe]=function(u,d){if(u>0){var f=d||0;yU(o,vUe,s,function(h){h[vUe](u,f)})}},l[jI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[FN](),s.h=null,s.cb=[]},"_finishUnload"),f;if(yU(o,"unload",null,function(h){var m=h[jI](u);m&&(f||(f=[]),f[Li](m))}),f)return Id(function(h){return ml(yUe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Goe="ctx",j2t="ParentContextKey",Tve="ChildrenContextKey",W0o=null,qUe=(function(){function t(e,r,n){var o=this;if(o.start=hl(),o[L1]=e,o.isAsync=n,o[nve]=function(){return!1},Mr(r)){var s;Hi(o,"payload",{g:a(function(){return!s&&Mr(r)&&(s=r(),r=null),s},"g")})}o[gW]=function(c){return c?c===t[j2t]||c===t[Tve]?o[c]:(o[Goe]||{})[c]:null},o[wk]=function(c,l){if(c)if(c===t[j2t])o[c]||(o[nve]=function(){return!0}),o[c]=l;else if(c===t[Tve])o[c]=l;else{var u=o[Goe]=o[Goe]||{};u[c]=l}},o.complete=function(){var c=0,l=o[gW](t[Tve]);if(cr(l))for(var u=0;u0&&(yt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Vr(r[qu],2,73,"Unexpected Exception during onComplete - "+lr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[nL];!_&&A&&(_={}),E[nL]=_,_=e.ref(E,nL),_&&(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&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}yve(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[aU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(V2t,"_createInternalContext");function Rk(t,e,r,n){var o=vh(e),s=V2t(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[nv](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),cr(d)&&(d=EU(d,o.cfg,r,f)),Rk(d||c[U1](),o.cfg,r,f)}return a(u,"_createNew"),c[B0]=l,c[QN]=u,c}a(Rk,"createProcessTelemetryContext");function $oe(t,e,r){var n=vh(e.config),o=V2t(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[jI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=EU(u,n.cfg,e,d)),$oe(u||s[U1](),e,d)}return a(l,"_createNew"),s[B0]=c,s[QN]=l,s}a($oe,"createProcessTelemetryUnloadContext");function Ive(t,e,r){var n=vh(e.config),o=V2t(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Mr(d[mW])&&d[mW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=EU(u,n.cfg,e,d)),Ive(u||s[U1](),e,d)}return a(l,"_createNew"),s[B0]=c,s[QN]=l,s}a(Ive,"createProcessTelemetryUpdateContext");function EU(t,e,r,n){var o=null,s=!n;if(cr(t)&&t[un]>0){var c=null;yt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Mr(l[nv])){var u=X0o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?EU([n],e,r):o}a(EU,"createTelemetryProxyChain");function X0o(t,e,r){var n=null,o=Mr(t[nv]),s=Mr(t[uU]),c;t?c=t[UN]+"-"+t[vW]+"-"+oYr++:c="Unknown-0-"+oYr++;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&&Mr(t[iYr])&&(g=t[iYr]()),g||(g=Rk(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[UN]:J0o,T=g[nYr];return T||(T=g[nYr]={}),g.setNext(n),t&&jUe(g[Ff](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Io;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Vr(g[rv](),1,73,"Plugin ["+b+"] failed during "+y+" - "+lr(x)+", run flags: "+lr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=sL(t);return _[F1]||_[uve]?!1:(s&&t[uU](n),t[nv](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[B0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=sL(t),v=t[Ff]||_[Ff];t&&(!v||v===g.core())&&!_[F1]&&(_[Ff]=null,_[F1]=!0,_[tv]=!1,t[F1]&&t[F1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[B0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=sL(t),v=t[Ff]||_[Ff];t&&(!v||v===g.core())&&!_[F1]&&t[mW]&&t[mW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[B0](A)}return a(m,"_updatePlugin"),_h(l)}a(X0o,"createTelemetryPluginProxy");var emo=(function(){function t(e,r,n,o){var s=this,c=Rk(e,r,n,o);SW(s,c,Uu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function GUe(){var t=[];function e(n){n&&t[Li](n)}a(e,"_addHandler");function r(n,o){yt(t,function(s){try{s(n,o)}catch(c){Vr(n[rv](),2,73,"Unexpected error calling unload handler - "+lr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(GUe,"createUnloadHandlerContainer");p();var $Ue,VUe;function WUe(){var t=[];function e(n){var o=t;t=[],yt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Vr(n,2,73,"Unloading:"+lr(c))}}),$Ue&&o[un]>$Ue&&(VUe?VUe("doUnload",o):Vr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Ch(t,n),$Ue&&t[un]>$Ue&&(VUe?VUe("Add",t):Vr(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(WUe,"createUnloadHookContainer");var W2t,_U="getPlugin",tmo=(W2t={},W2t[nL]={isVal:pU,v:{}},W2t),xve=(function(){function t(){var e=this,r,n,o,s,c;d(),bi(t,e,function(f){f[XB]=function(h,m,g,A){u(h,m,A),r=!0},f[F1]=function(h,m){var g=f[Ff];if(!g||h&&g!==h[Ff]())return;var A,y=!1,E=h||$oe(null,g,o&&o[_U]?o[_U]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[rv]()),A===!0&&E[B0](_),d())}return a(v,"_unloadCallback"),!f[lU]||f[lU](E,_,v)!==!0?v():A=!0,A},f[mW]=function(h,m){var g=f[Ff];if(!g||h&&g!==h[Ff]())return;var A,y=!1,E=h||Ive(null,g,o&&o[_U]?o[_U]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[U1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},bW(f,"_addUnloadCb",function(){return s},"add"),bW(f,"_addHook",function(){return c},"add"),Hi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[rv]=function(f){return l(f)[rv]()},e[tv]=function(){return r},e.setInitialized=function(f){r=f},e[uU]=function(f){o=f},e[B0]=function(f,h){h?h[B0](f):o&&Mr(o[nv])&&o[nv](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||Rk(null,{},e[Ff]);o&&o[_U]?h=m[QN](null,o[_U]):h=m[QN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){vh(f,tmo,xW(h)),!m&&h&&(m=h[tUe]()[U1]());var g=o;o&&o[_U]&&(g=o[_U]()),e[Ff]=h,n=Rk(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Ff]=null,n=null,o=null,c=WUe(),s=GUe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function rmo(t,e,r){var n={id:e,fn:r};Ch(t,n);var o={remove:a(function(){yt(t,function(s,c){if(s.id===n.id)return t[qI](c,1),-1})},"remove")};return o}a(rmo,"_addInitializer");function nmo(t,e,r){for(var n=!1,o=t[un],s=0;s"},"v")})}a(pmo,"_createUnloadHook");var K2t=(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,k,D,N,L,B,Q,M,O,q,F;bi(t,this,function(U){X(),U._getDbgPlgTargets=function(){return[x,o]},U[tv]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[XB]=function(ne,se,Ie,_e){g&&Kc(aYr),U[tv]()&&Kc("Core cannot be initialized more than once"),e=vh(ne,z2t,Ie||U[qu],!1),ne=e.cfg,Me(e[LN](function(Xe){var Ct=Xe.cfg;B=Ct.initInMemoMaxSize||smo,W(Ct);var Ot=Xe.ref(Xe.cfg,nL);zr(Ot,function($t){Xe.ref(Ot,$t)})})),s=_e,b=fmo(e,v,s&&U[ZCe](),b),z(),U[qu]=Ie;var Re=ne[CW];if(f=[],f[Li].apply(f,yW(yW([],se,!1),Re,!1)),h=ne[_W],we(null),(!m||m[un]===0)&&Kc("No "+_W+" available"),h&&h[un]>1){var Je=U[aU]("TeeChannelController");(!Je||!Je.plugin)&&Vr(n,1,28,"TeeChannel required")}dmo(ne,R,n),R=null,r=!0,N===Sk.ACTIVE&&Y()},U.getChannels=function(){var ne=[];return m&&yt(m,function(se){ne[Li](se)}),_h(ne)},U.track=function(ne){jUe(U[Boe](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ae(ne),Kc("Invalid telemetry item")),!ne[L1]&&Zt(ne[L1])&&(ae(ne),Kc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||hU(new Date),ne.ver=ne.ver||"4.0",!g&&U[tv]()&&N===Sk.ACTIVE?ie()[B0](ne):N!==Sk.INACTIVE&&o[un]<=B&&o[Li](ne)},function(){return{item:ne}},!ne.sync)},U[tUe]=ie,U[ZCe]=function(){return s||(s=new Zzr(e.cfg),U[imo]=s),s},U[Roe]=function(ne){U.getNotifyMgr()[Roe](ne)},U[woe]=function(ne){s&&s[woe](ne)},U.getCookieMgr=function(){return u||(u=Kzr(e.cfg,U[qu])),u},U.setCookieMgr=function(ne){u!==ne&&(iL(u,!1),u=ne)},U[Boe]=function(){return c||l||eYr()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[un]},U.releaseQueue=function(){if(r&&o[un]>0){var ne=o;o=[],N===2?yt(ne,function(se){se.iKey=se.iKey||w,ie()[B0](se)}):Vr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,F=!1,O&&O[FN](),re(!0)};function W(ne){var se=ne.instrumentationKey,Ie=ne.endpointUrl;if(N!==3){if(Zt(se)){w=null,N=Sk.INACTIVE;var _e="Please provide instrumentation key";r?(Vr(n,1,100,_e),Y()):Kc(_e);return}var Re=[];Lm(se)?(Re[Li](se),w=null):w=se,Lm(Ie)?(Re[Li](Ie),L=null):L=Ie,Re[un]?V(ne,Re):G()}}a(W,"_handleIKeyEndpointPromises");function V(ne,se){Q=!1,N=3;var Ie=pU(ne.initTimeOut)?ne.initTimeOut:amo,_e=AUe(se);M&&M[FN](),M=xp(function(){M=null,Q||G()},Ie),ml(_e,function(Re){try{if(Q)return;if(!Re.rejected){var Je=Re[eL];if(Je&&Je[un]){var Xe=Je[0];if(w=Xe&&Xe[eL],Je[un]>1){var Ct=Je[1];L=Ct&&Ct[eL]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}G()}catch{Q||G()}})}a(V,"_waitForInitPromises");function G(){Q=!0,Zt(w)?(N=Sk.INACTIVE,Vr(n,1,112,"ikey can't be resolved from promises")):N=Sk.ACTIVE,Y()}a(G,"_setStatus");function Y(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(Y,"_releaseQueues");function re(ne){if((!O||!O[cU])&&!F){var se=ne||n&&n.queue[un]>0;se&&(q||(q=!0,Me(e[LN](function(Ie){var _e=Ie.cfg.diagnosticLogInterval;(!_e||!(_e>0))&&(_e=1e4);var Re=!1;O&&(Re=O[cU],O[FN]()),O=eUe(Z,_e),O.unref(),O[cU]=Re}))),O[cU]=!0)}return O}a(re,"_startLogPoller"),U[qPt]=function(){F=!0,O&&O[FN](),Z()},SW(U,function(){return A},["addTelemetryInitializer"]),U[jI]=function(ne,se,Ie){ne===void 0&&(ne=!0),r||Kc(omo),g&&Kc(aYr);var _e={reason:50,isAsync:ne,flushComplete:!1},Re;ne&&!se&&(Re=Id(function(Ct){se=Ct}));var Je=$oe(De(),U);Je[XCe](function(){v.run(U[qu]),BUe([u,s,n],ne,function(){X(),se&&se(_e)})},U);function Xe(Ct){_e.flushComplete=Ct,g=!0,_.run(Je,_e),U[qPt](),Je[B0](_e)}return a(Xe,"_doUnload"),Z(),J(ne,Xe,6,Ie)||Xe(!1),Re},U[aU]=Ae,U.addPlugin=function(ne,se,Ie,_e){if(!ne){_e&&_e(!1),K(uYr);return}var Re=Ae(ne[UN]);if(Re&&!se){_e&&_e(!1),K("Plugin ["+ne[UN]+"] is already loaded!");return}var Je={reason:16};function Xe($t){f[Li](ne),Je.added=[ne],we(Je),_e&&_e(!0)}if(a(Xe,"_addPlugin"),Re){var Ct=[Re.plugin],Ot={reason:2,isAsync:!!Ie};Te(Ct,Ot,function($t){$t?(Je.removed=Ct,Je.reason|=32,Xe(!0)):_e&&_e(!1)})}else Xe(!1)},U.updateCfg=function(ne,se){se===void 0&&(se=!0);var Ie;if(U[tv]()){Ie={reason:1,cfg:e.cfg,oldCfg:Toe({},e.cfg),newConfig:Toe({},ne),merge:se},ne=Ie.newConfig;var _e=e.cfg;ne[CW]=_e[CW],ne[_W]=_e[_W]}e._block(function(Re){var Je=Re.cfg;Y2t(Re,Je,ne,se),se||zr(Je,function(Xe){Xg(ne,Xe)||Re.set(Je,Xe,H1)}),Re.setDf(Je,z2t)},!0),e.notify(),Ie&&le(Ie)},U.evtNamespace=function(){return E},U.flush=J,U.getTraceCtx=function(ne){return T||(T=rYr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=Me,bW(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var se;return r?se=VI(e.cfg,ne,U[qu]):se=umo(R,ne),pmo(se)},U.getWParam=function(){return YB()||e.cfg.enableWParam?0:-1};function j(){var ne={};k=[];var se=a(function(Ie){Ie&&yt(Ie,function(_e){if(_e[UN]&&_e[rUe]&&!ne[_e.identifier]){var Re=_e[UN]+"="+_e[rUe];k[Li](Re),ne[_e.identifier]=_e}})},"_addPluginVersions");se(m),h&&yt(h,function(Ie){se(Ie)}),se(f)}a(j,"_setPluginVersions");function X(){r=!1,e=vh({},z2t,U[qu]),e.cfg[nUe]=1,Hi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(se){U.updateCfg(se,!1)},"s")}),Hi(U,"pluginVersionStringArr",{g:a(function(){return k||j(),k},"g")}),Hi(U,"pluginVersionString",{g:a(function(){return D||(k||j(),D=k.join(";")),D||Io},"g")}),Hi(U,"logger",{g:a(function(){return n||(n=new Hoe(e.cfg),e[qu]=n),n},"g"),s:a(function(se){e[qu]=se,n!==se&&(iL(n,!1),n=se)},"s")}),U[qu]=new Hoe(e.cfg),x=[];var ne=U.config[CW]||[];ne.splice(0,ne[un]),Ch(ne,x),A=new sYr,o=[],iL(s,!1),s=null,c=null,l=null,iL(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=G1("AIBaseCore",!0),_=GUe(),T=null,w=null,v=WUe(),R=[],D=null,k=null,F=!1,O=null,q=!1,N=0,L=null,B=null,Q=!1,M=null}a(X,"_initDefaults");function ie(){var ne=Rk(De(),e.cfg,U);return ne[XCe](re),ne}a(ie,"_createTelCtx");function we(ne){var se=lmo(U[qu],Dzr,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=HUe(Ch(m,se[_W]));var Ie=Ch(HUe(se[Ff]),m);x=_h(Ie);var _e=U.config[CW]||[];_e.splice(0,_e[un]),Ch(_e,x);var Re=ie();m&&m[un]>0&&$2t(Re[QN](m),Ie),$2t(Re,Ie),ne&&le(ne)}a(we,"_initPluginChain");function Ae(ne){var se=null,Ie=null,_e=[];return yt(x,function(Re){if(Re[UN]===ne&&Re!==A)return Ie=Re,-1;Re.getChannel&&_e[Li](Re)}),!Ie&&_e[un]>0&&yt(_e,function(Re){if(Ie=Re.getChannel(ne),!Ie)return-1}),Ie&&(se={plugin:Ie,setEnabled:a(function(Re){sL(Ie)[uve]=!Re},"setEnabled"),isEnabled:a(function(){var Re=sL(Ie);return!Re[F1]&&!Re[uve]},"isEnabled"),remove:a(function(Re,Je){Re===void 0&&(Re=!0);var Xe=[Ie],Ct={reason:1,isAsync:Re};Te(Xe,Ct,function(Ot){Ot&&we({reason:32,removed:Xe}),Je&&Je(Ot)})},"remove")}),se}a(Ae,"_getPlugin");function De(){if(!d){var ne=(x||[]).slice();Go(ne,A)===-1&&ne[Li](A),d=EU(HUe(ne),e.cfg,U)}return d}a(De,"_getPluginChain");function Te(ne,se,Ie){if(ne&&ne[un]>0){var _e=EU(ne,e.cfg,U),Re=$oe(_e,U);Re[XCe](function(){var Je=!1,Xe=[];yt(f,function(Ot,$t){cYr(Ot,ne)?Je=!0:Xe[Li](Ot)}),f=Xe,D=null,k=null;var Ct=[];h&&(yt(h,function(Ot,$t){var Gt=[];yt(Ot,function(Ee){cYr(Ee,ne)?Je=!0:Gt[Li](Ee)}),Ct[Li](Gt)}),h=Ct),Ie&&Ie(Je),re()}),Re[B0](se)}else Ie(!1)}a(Te,"_removePlugins");function Z(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[un]=0,yt(ne,function(se){var Ie={name:y||"InternalMessageId: "+se[koe],iKey:w,time:hU(new Date),baseType:bve.dataType,baseData:{message:se[qN]}};U.track(Ie)})}}a(Z,"_flushInternalLogs");function J(ne,se,Ie,_e){var Re=1,Je=!1,Xe=null;_e=_e||5e3;function Ct(){Re--,Je&&Re===0&&(Xe&&Xe[FN](),Xe=null,se&&se(Je),se=null)}if(a(Ct,"doCallback"),m&&m[un]>0){var Ot=ie()[QN](m);Ot.iterate(function($t){if($t.flush){Re++;var Gt=!1;$t.flush(ne,function(){Gt=!0,Ct()},Ie)||Gt||(ne&&Xe==null?Xe=xp(function(){Xe=null,Ct()},_e):Ct())}})}return Je=!0,Ct(),!0}a(J,"_flushChannels");function z(){var ne;Me(e[LN](function(se){var Ie=se.cfg.enablePerfMgr;if(Ie){var _e=se.cfg[EUe];(ne!==_e||!ne)&&(_e||(_e=cmo),p2t(se.cfg,EUe,_e),ne=_e,l=null),!c&&!l&&Mr(_e)&&(l=_e(U,U[ZCe]()))}else l=null,ne=null}))}a(z,"_initPerfManager");function le(ne){var se=Ive(De(),U);se[XCe](re),(!U._updateHook||U._updateHook(se,ne)!==!0)&&se[B0](ne)}a(le,"_doUpdate");function K(ne){var se=U[qu];se?(Vr(se,2,73,ne),re()):Kc(ne)}a(K,"_logOrThrowError");function ae(ne){var se=U[ZCe]();se&&se[fU]([ne],2)}a(ae,"_notifyInvalidEvent");function Me(ne){v.add(ne)}a(Me,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function wve(t,e){try{if(t&&t!==""){var r=c_().parse(t);if(r&&r[GPt]&&r[GPt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[un])return r}}catch(n){Vr(e,1,43,"Cannot parse the response. "+(n[L1]||lr(n)),{response:t})}return null}a(wve,"parseResponse");p();var kk="",hmo="NoResponseBody",dYr="&"+hmo+"=true",J2t="POST",Z2t=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;bi(t,this,function(E,_){var v=!0;Q(),E[XB]=function(M,O){o=O,n&&Vr(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=hve();O&&O.protocol&&O.protocol[Tk]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[un]?R(M,O):null},E.getFallbackInst=function(){return d},E[lU]=function(M,O){Q()},E.preparePayload=function(M,O,q,F){if(!O||F||!q[Q1]){M(q);return}try{var U=ki("CompressionStream");if(!Mr(U)){M(q);return}var W=new ReadableStream({start:a(function(X){X.enqueue(yi(q[Q1])?new TextEncoder().encode(q[Q1]):q[Q1]),X.close()},"start")}),V=W.pipeThrough(new U("gzip")),G=V.getReader(),Y=[],re=0,j=!1;return ml(G.read(),a(function X(ie){if(!j&&!ie.rejected){var we=ie[eL];if(!we.done)return Y[Li](we[eL]),re+=we.value[un],ml(G.read(),X);for(var Ae=new Uint8Array(re),De=0,Te=0,Z=Y;Te0&&(yt(Uu(Ae),function(z){j.append(z,Ae[z])}),De[ive]=j),u?De.credentials=u:v&&s&&(De.credentials="include"),q&&(De.keepalive=!0,e+=X,s?M._sendReason===2&&(ie=!0,A&&(U+=dYr)):ie=!0);var Te=new Request(U,De);try{Te[k2t]=!0}catch{}if(!q&&r&&(G=Id(function(z,le){Y=z,re=le})),!U){w(O),Y&&Y(!1);return}function Z(z,le){le?x(O,s?0:le,{},s?kk:z):x(O,s?0:400,{},s?kk:z)}a(Z,"_handleError");function J(z,le,K){var ae=z[xk],Me=c.fetchOnComplete;Me&&Mr(Me)?Me(z,O,K||kk,le):x(O,ae,{},K||kk)}a(J,"_onFetchComplete");try{ml(fetch(s?U:Te,s?De:null),function(z){if(q&&(e-=X,X=0),!we)if(we=!0,z.rejected)Z(z.reason&&z.reason[qN],499),re&&re(z.reason);else{var le=z[eL];try{!s&&!le.ok?(le[xk]?Z(le.statusText,le[xk]):Z(le.statusText,499),Y&&Y(!1)):s&&!le.body?(J(le,null,kk),Y&&Y(!0)):ml(le.text(),function(K){J(le,M,K[eL]),Y&&Y(!0)})}catch(K){le&&le[xk]?Z(lr(K),le[xk]):Z(lr(K),499),re&&re(K)}}})}catch(z){we||(Z(lr(z),499),re&&re(z))}return ie&&!we&&(we=!0,x(O,200,{}),Y&&Y(!0)),s&&!we&&M[AW]>0&&y&&y.set(function(){we||(we=!0,x(O,500,{}),Y&&Y(!0))},M[AW]),G}a(L,"_doFetchSender");function B(M,O,q){var F=nf(),U=new XDomainRequest,W=M[Q1];U.onload=function(){var j=Loe(U),X=c&&c.xdrOnComplete;X&&Mr(X)?X(U,O,M):x(O,200,{},j)},U.onerror=function(){x(O,400,{},s?kk:fve(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var V=F&&F.location&&F.location.protocol||"",G=M[Poe];if(!G){w(O);return}if(!s&&G.lastIndexOf(V,0)!==0){var Y="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Vr(o,2,40,". "+Y),T(Y,O);return}var re=s?G:G[Ik](/^(https?:)/,"");U.open(J2t,re),M[AW]&&(U[AW]=M[AW]),U.send(W),s&&q?y&&y.set(function(){U.send(W)},0):U.send(W)}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 yYr="on",fYr="attachEvent",pYr="addEventListener",hYr="detachEvent",mYr="removeEventListener",X2t="events";var bxl=G1("aiEvtPageHide"),Sxl=G1("aiEvtPageShow"),mmo=/\.[\.]+/g,gmo=/[\.]+$/,Amo=1,zUe=kUe("events"),ymo=/^([^.]*)(?:\.(.+)|)/;function gYr(t){return t&&t[Ik]?t[Ik](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Io):t}a(gYr,"_normalizeNamespace");function eDt(t,e){if(e){var r=Io;cr(e)?(r=Io,yt(e,function(o){o=gYr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=gYr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Io)+r)}var n=ymo.exec(t||Io)||[];return{type:n[1],ns:(n[2]||Io).replace(mmo,".").replace(gmo,Io)[HI](".").sort().join(".")}}a(eDt,"_getEvtNamespace");function EYr(t,e,r){r===void 0&&(r=!0);var n=zUe.get(t,X2t,{},r),o=n[e];return o||(o=n[e]=[]),o}a(EYr,"_getRegisteredEvents");function _Yr(t,e,r,n){t&&e&&e[tL]&&(t[mYr]?t[mYr](e[tL],r,n):t[hYr]&&t[hYr](yYr+e[tL],r))}a(_Yr,"_doDetach");function Emo(t,e,r,n){var o=!1;return t&&e&&e[tL]&&r&&(t[pYr]?(t[pYr](e[tL],r,n),o=!0):t[fYr]&&(t[fYr](yYr+e[tL],r),o=!0)),o}a(Emo,"_doAttach");function AYr(t,e,r,n){for(var o=e[un];o--;){var s=e[o];s&&(!r.ns||r.ns===s[jPt].ns)&&(!n||n(s))&&(_Yr(t,s[jPt],s.handler,s.capture),e[qI](o,1))}}a(AYr,"_doUnregister");function _mo(t,e,r){if(e[tL])AYr(t,EYr(t,e[tL]),e,r);else{var n=zUe.get(t,X2t,{});zr(n,function(o,s){AYr(t,s,e,r)}),Uu(n)[un]===0&&zUe.kill(t,X2t)}}a(_mo,"_unregisterEvents");function Rve(t,e){var r;return e?(cr(e)?r=[t].concat(e):r=[t,e],r=eDt("xx",r).ns[HI](".")):r=t,r}a(Rve,"mergeEvtNamespace");function YUe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=eDt(e,n);if(s=Emo(t,c,r,o),s&&zUe.accept(t)){var l={guid:Amo++,evtName:c,handler:r,capture:o};EYr(t,c.type)[Li](l)}}catch{}return s}a(YUe,"eventOn");function tDt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=eDt(e,n),c=!1;_mo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||_Yr(t,s,r,o)}catch{}}a(tDt,"eventOff");p();var kve="sampleRate",Pve="ProcessLegacy",KUe="http.method",wW="https://dc.services.visualstudio.com",VN="/v2/track",xy="not_specified";p();var JUe=QPt({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 RW="split",mo="length",kW="toLowerCase",vU="ingestionendpoint",bU="toString",rDt="removeItem",Voe="message",xYr="count";var Dve="stringify",Nve="pathname",PW="match";var wy="name";var eA="properties",Ry="measurements",Mve="sizeInBytes",Ove="typeName",Woe="exceptions",DW="severityLevel",ZUe="problemGroup",NW="parsedStack",Bve="hasFullStack",Lve="assembly",WN="fileName",MW="line",zoe="aiDataContract",OW="duration";function nDt(t,e,r){var n=e[mo],o=wYr(t,e);if(o[mo]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Lf(o,0,147)+RYr(s);o=c}return o}a(nDt,"dataSanitizeKeyAndAddUniqueness");function wYr(t,e){var r;return e&&(e=Pi(Lu(e)),e[mo]>150&&(r=Lf(e,0,150),Vr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(wYr,"dataSanitizeKey");function iu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Pi(Lu(e)),e[mo]>r&&(n=Lf(e,0,r),Vr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(iu,"dataSanitizeString");function BW(t,e,r){return yi(e)&&(e=x2t(e,r)),sDt(t,e,2048,66)}a(BW,"dataSanitizeUrl");function Fve(t,e){var r;return e&&e[mo]>32768&&(r=Lf(e,0,32768),Vr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(Fve,"dataSanitizeMessage");function iDt(t,e){var r;if(e){var n=""+e;n[mo]>32768&&(r=Lf(n,0,32768),Vr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(iDt,"dataSanitizeException");function l_(t,e){if(e){var r={};zr(e,function(n,o){if(Fu(o)&&mU())try{o=c_()[Dve](o)}catch(s){Vr(t,2,49,"custom property is not valid",{exception:s},!0)}o=iu(t,o,8192),n=nDt(t,n,r),r[n]=o}),e=r}return e}a(l_,"dataSanitizeProperties");function u_(t,e){if(e){var r={};zr(e,function(n,o){n=nDt(t,n,r),r[n]=o}),e=r}return e}a(u_,"dataSanitizeMeasurements");function oDt(t,e){return e&&sDt(t,e,128,69)[bU]()}a(oDt,"dataSanitizeId");function sDt(t,e,r,n){var o;return e&&(e=Pi(Lu(e)),e[mo]>r&&(o=Lf(e,0,r),Vr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(sDt,"dataSanitizeInput");function RYr(t){var e="00"+t;return Y9e(e,e[mo]-3)}a(RYr,"dsPadNumber");p();var kYr=rf()||{},PYr=0,vmo=[null,null,null,null,null];function DYr(t){var e=PYr,r=vmo,n=r[e];return kYr.createElement?r[e]||(n=r[e]=kYr.createElement("a")):n={host:bmo(t,!0)},n.href=t,e++,e>=r[mo]&&(e=0),PYr=e,n}a(DYr,"urlParseUrl");function bmo(t,e){var r=NYr(t,e)||"";if(r){var n=r[PW](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>3&&yi(n[2])&&n[2][mo]>0)return n[2]+(n[3]||"")}return r}a(bmo,"urlParseHost");function NYr(t,e){var r=null;if(t){var n=t[PW](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>2&&yi(n[2])&&n[2][mo]>0&&(r=n[2]||"",e&&n[mo]>2)){var o=(n[1]||"")[kW](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(NYr,"urlParseFullHost");var Smo=[wW+VN,"https://breeze.aimon.applicationinsights.io"+VN,"https://dc-int.services.visualstudio.com"+VN];function XUe(t){return Go(Smo,t[kW]())!==-1}a(XUe,"isInternalApplicationInsightsEndpoint");function MYr(t,e,r,n){var o,s=n,c=n;if(e&&e[mo]>0){var l=DYr(e);if(o=l.host,!s)if(l[Nve]!=null){var u=l.pathname[mo]===0?"/":l[Nve];u.charAt(0)!=="/"&&(u="/"+u),c=l[Nve],s=iu(t,r?r+" "+u:u)}else s=iu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(MYr,"AjaxHelperParseDependencyPath");p();p();var e7e=JCe({LocalStorage:0,SessionStorage:1});var Yoe=void 0,OYr="";function BYr(t){try{if(Zt(Ty()))return null;var e=new Date()[bU](),r=ki(t===e7e.LocalStorage?"localStorage":"sessionStorage"),n=OYr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[rDt](n),!o)return r}catch{}return null}a(BYr,"_getVerifiedStorageObject");function aDt(){return t7e()?BYr(e7e.SessionStorage):null}a(aDt,"_getSessionStorageObject");function cDt(t){OYr=t||""}a(cDt,"utlSetStoragePrefix");function t7e(t){return(t||Yoe===void 0)&&(Yoe=!!BYr(e7e.SessionStorage)),Yoe}a(t7e,"utlCanUseSessionStorage");function lDt(t,e){var r=aDt();if(r!==null)try{return r.getItem(e)}catch(n){Yoe=!1,Vr(t,2,2,"Browser failed read of session storage. "+wp(n),{exception:lr(n)})}return null}a(lDt,"utlGetSessionStorage");function uDt(t,e,r){var n=aDt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Yoe=!1,Vr(t,2,4,"Browser failed write to session storage. "+wp(o),{exception:lr(o)})}return!1}a(uDt,"utlSetSessionStorage");function dDt(t,e){var r=aDt();if(r!==null)try{return r[rDt](e),!0}catch(n){Yoe=!1,Vr(t,2,6,"Browser failed removal of session storage item. "+wp(n),{exception:lr(n)})}return!1}a(dDt,"utlRemoveSessionStorage");p();var Tmo=";",Imo="=";function Uve(t){if(!t)return{};var e=t[RW](Tmo),r=WCe(e,function(o,s){var c=s[RW](Imo);if(c[mo]===2){var l=c[0][kW](),u=c[1];o[l]=u}return o},{});if(Uu(r)[mo]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[vU]=r[vU]||"https://"+n+"dc."+r.endpointsuffix}r[vU]=r[vU]||wW,JB(r[vU],"/")&&(r[vU]=r[vU].slice(0,-1))}return r}a(Uve,"parseConnectionString");p();var fDt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[wy]=iu(e,n)||xy,s.data=r,s.time=hU(new Date),s[zoe]={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 aL=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[wy]=iu(e,r)||xy,s[eA]=l_(e,n),s[Ry]=u_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var xmo=58,wmo=/^\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\?]+)?)/,Rmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,kmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,Pmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Dmo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,Nmo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,Mmo=/([^\(\s\n]+):([0-9]+)$/,LYr="",Koe="error",zI="stack",hDt="stackDetails",FYr="errorSrc",mDt="message",jYr="description",UYr=[{re:Rmo,len:5,m:1,fn:2,ln:3,col:4},{chk:Bmo,pre:Omo,re:kmo,len:4,m:1,fn:2,ln:3},{re:Pmo,len:3,m:1,fn:2,hdl:qYr},{re:Dmo,len:2,fn:1,hdl:qYr}];function Omo(t){return t.replace(/(\(anonymous\))/,"")}a(Omo,"_scrubAnonymous");function Bmo(t){return nu(t,"[native")<0}a(Bmo,"_ignoreNative");function gDt(t,e){var r=t;return r&&!yi(r)&&(JSON&&JSON[Dve]?(r=JSON[Dve](t),e&&(!r||r==="{}")&&(Mr(t[bU])?r=t[bU]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(gDt,"_stringify");function HYr(t,e){var r=t;return t&&(r&&!yi(r)&&(r=t[mDt]||t[jYr]||r),r&&!yi(r)&&(r=gDt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&nu(r||"",e)===-1&&(r=e+": "+r),r||""}a(HYr,"_formatMessage");function Lmo(t){try{if(Fu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Lmo,"_isExceptionDetailsInternal");function Fmo(t){try{if(Fu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(Fmo,"_isExceptionInternal");function QYr(t){return t&&t.src&&yi(t.src)&&t.obj&&cr(t.obj)}a(QYr,"_isStackDetails");function LW(t){var e=t||"";yi(e)||(yi(e[zI])?e=e[zI]:e=""+e);var r=e[RW](` -`);return{src:e,obj:r}}a(LW,"_convertStackObj");function Umo(t){for(var e=[],r=t[RW](` -`),n=0;n0){e=[];var n=0,o=!1,s=0;yt(r,function(y){if(o||$mo(y)){var E=Lu(y);o=!0;var _=Vmo(E,n);_&&(s+=_[Mve],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(qmo,"_parseStack");function r7e(t){var e="";if(t&&(e=t.typeName||t[wy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[bU]());e=n&&n[mo]>1?n[1]:""}catch{}return e}a(r7e,"_getErrorType");function pDt(t){if(t)try{if(!yi(t)){var e=r7e(t),r=gDt(t,!1);return(!r||r==="{}")&&(t[Koe]&&(t=t[Koe],e=r7e(t)),r=gDt(t,!0)),nu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(pDt,"_formatErrorCode");var FW=(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,Fmo(r)?(l[Woe]=r[Woe]||[],l[eA]=r[eA],l[Ry]=r[Ry],r[DW]&&(l[DW]=r[DW]),r.id&&(l.id=r.id,r[eA].id=r.id),r[ZUe]&&(l[ZUe]=r[ZUe]),Zt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Woe]=[$Yr(e,r,n)],l[eA]=l_(e,n),l[Ry]=u_(e,o),s&&(l[DW]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=r7e(s||c||e);return{message:HYr(e,d),url:r,lineNumber:n,columnNumber:o,error:pDt(s||c||e),evt:pDt(c||e),typeName:d,stackDetails:GYr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Woe]&&KB(r[Woe],function(l){return Gmo(e,l)}),c=new t(e,$I($I({},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[Bve]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=pDt,t})();var jmo=_h({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function Hmo(){var t=this,e=cr(t[NW])&&KB(t[NW],function(n){return zmo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[Ove],message:t[Voe],hasFullStack:t[Bve],stack:t[zI],parsedStack:e||void 0};return r}a(Hmo,"_toInterface");function $Yr(t,e,r){var n,o,s,c,l,u,d,f;if(Lmo(e))c=e[Ove],l=e[Voe],d=e[zI],f=e[NW]||[],u=e[Bve];else{var h=e,m=h&&h.evt;WB(h)||(h=h[Koe]||m||h),c=iu(t,r7e(h))||xy,l=Fve(t,HYr(e||h,c))||xy;var g=e[hDt]||GYr(e);f=qmo(g),cr(f)&&KB(f,function(A){A[Lve]=iu(t,A[Lve]),A[WN]=iu(t,A[WN])}),d=iDt(t,Qmo(g)),u=cr(f)&&f[mo]>0,r&&(r[Ove]=r[Ove]||c)}return n={},n[zoe]=jmo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[Bve]=u,n.stack=d,n.parsedStack=f,n.toInterface=Hmo,n}a($Yr,"_createExceptionDetails");function Gmo(t,e){var r=cr(e[NW])&&KB(e[NW],function(o){return Wmo(o)})||e[NW],n=$Yr(t,$I($I({},e),{parsedStack:r}));return n}a(Gmo,"_createExDetailsFromInterface");function VYr(t,e){var r=e[PW](Nmo);if(r&&r[mo]>=4)t[WN]=r[1],t[MW]=parseInt(r[2]);else{var n=e[PW](Mmo);n&&n[mo]>=3?(t[WN]=n[1],t[MW]=parseInt(n[2])):t[WN]=e}}a(VYr,"_parseFilename");function qYr(t,e,r){var n=t[WN];e.fn&&r&&r[mo]>e.fn&&(e.ln&&r[mo]>e.ln?(n=Pi(r[e.fn]||""),t[MW]=parseInt(Pi(r[e.ln]||""))||0):n=Pi(r[e.fn]||"")),n&&VYr(t,n)}a(qYr,"_handleFilename");function $mo(t){var e=!1;if(t&&yi(t)){var r=Pi(t);r&&(e=wmo.test(r))}return e}a($mo,"_isStackFrame");var WYr=_h({level:1,method:1,assembly:0,fileName:0,line:0});function Vmo(t,e){var r,n;if(t&&yi(t)&&Pi(t)){n=(r={},r[zoe]=WYr,r.level=e,r.assembly=Pi(t),r.method=LYr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Pi(c[s.m]||LYr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[WN]=Pi(c[s.fn]||""),n[MW]=parseInt(Pi(c[s.ln]||""))||0):VYr(n,c[s.fn]||""));break}o++}}return zYr(n)}a(Vmo,"_extractStackFrame");function Wmo(t){var e,r=(e={},e[zoe]=WYr,e.level=t.level,e.method=t.method,e.assembly=t[Lve],e.fileName=t[WN],e.line=t[MW],e.sizeInBytes=0,e);return zYr(r)}a(Wmo,"_stackFrameFromInterface");function zYr(t){var e=xmo;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[Mve]=e),t}a(zYr,"_populateFrameSizeInBytes");function zmo(t){return{level:t.level,method:t.method,assembly:t[Lve],fileName:t[WN],line:t[MW]}}a(zmo,"_parsedFrameToInterface");p();p();var YYr=(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 cL=(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 YYr;h[xYr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[wy]=iu(e,r)||xy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[eA]=l_(e,u),f[Ry]=u_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var Qve="";function n7e(t){(isNaN(t)||t<0)&&(t=0),t=YWr(t);var e=Qve+t%1e3,r=Qve+B1(t/1e3)%60,n=Qve+B1(t/(1e3*60))%60,o=Qve+B1(t/(1e3*60*60))%24,s=B1(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+".":Qve)+o+":"+n+":"+r+"."+e}a(n7e,"msToTimeSpan");var UW=(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=oDt(e,l),u.url=BW(e,n),u[wy]=iu(e,r)||xy,isNaN(o)||(u[OW]=n7e(o)),u[eA]=l_(e,s),u[Ry]=u_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var QW=(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[OW]=n7e(s),g.success=c,g.resultCode=l+"",g.type=iu(e,d);var A=MYr(e,n,u,o);g.data=BW(e,o)||A.data,g.target=iu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[wy]=iu(e,A[wy]),g[eA]=l_(e,h),g[Ry]=u_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var qW=(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||xy,c[Voe]=Fve(e,r),c[eA]=l_(e,o),c[Ry]=u_(e,s),n&&(c[DW]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var jW=(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=BW(e,n),u[wy]=iu(e,r)||xy,u[eA]=l_(e,s),u[Ry]=u_(e,c),l&&(u.domProcessing=l.domProcessing,u[OW]=l[OW],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 lL=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function TU(t){var e="ai."+t+".";return function(r){return e+r}}a(TU,"_aiNameFunc");var qve=TU("application"),F0=TU("device"),i7e=TU("location"),Joe=TU("operation"),ADt=TU("session"),SU=TU("user"),HW=TU("cloud"),jve=TU("internal"),Hve=(function(t){Iy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(h2t({applicationVersion:qve("ver"),applicationBuild:qve("build"),applicationTypeId:qve("typeId"),applicationId:qve("applicationId"),applicationLayer:qve("layer"),deviceId:F0("id"),deviceIp:F0("ip"),deviceLanguage:F0("language"),deviceLocale:F0("locale"),deviceModel:F0("model"),deviceFriendlyName:F0("friendlyName"),deviceNetwork:F0("network"),deviceNetworkName:F0("networkName"),deviceOEMName:F0("oemName"),deviceOS:F0("os"),deviceOSVersion:F0("osVersion"),deviceRoleInstance:F0("roleInstance"),deviceRoleName:F0("roleName"),deviceScreenResolution:F0("screenResolution"),deviceType:F0("type"),deviceMachineName:F0("machineName"),deviceVMName:F0("vmName"),deviceBrowser:F0("browser"),deviceBrowserVersion:F0("browserVersion"),locationIp:i7e("ip"),locationCountry:i7e("country"),locationProvince:i7e("province"),locationCity:i7e("city"),operationId:Joe("id"),operationName:Joe("name"),operationParentId:Joe("parentId"),operationRootId:Joe("rootId"),operationSyntheticSource:Joe("syntheticSource"),operationCorrelationVector:Joe("correlationVector"),sessionId:ADt("id"),sessionIsFirst:ADt("isFirst"),sessionIsNew:ADt("isNew"),userAccountAcquisitionDate:SU("accountAcquisitionDate"),userAccountId:SU("accountId"),userAgent:SU("userAgent"),userId:SU("id"),userStoreRegion:SU("storeRegion"),userAuthUserId:SU("authUserId"),userAnonymousUserAcquisitionDate:SU("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:SU("authUserAcquisitionDate"),cloudName:HW("name"),cloudRole:HW("role"),cloudRoleVer:HW("roleVer"),cloudRoleInstance:HW("roleInstance"),cloudEnvironment:HW("environment"),cloudLocation:HW("location"),cloudDeploymentUnit:HW("deploymentUnit"),internalNodeName:jve("nodeName"),internalSdkVersion:jve("sdkVersion"),internalAgentVersion:jve("agentVersion"),internalSnippet:jve("snippet"),internalSdkSrc:jve("sdkSrc")}));p();var bh=new Hve;p();function KYr(t,e){tDt(t,null,null,e)}a(KYr,"_disableEvents");function yDt(t){var e=rf(),r=Qu(),n=!1,o=[],s=1;r&&!Zt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=Rve(G1("OfflineListener"),t);try{if(f(nf())&&(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=YUe(b,"online",y,u),T&&YUe(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,yt(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=nf();if(b&&n){if(KYr(b,u),e){var T=e.body||e;Pn(T.ononline)||KYr(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(yDt,"createOfflineListener");var o7e="AppInsightsChannelPlugin";p();p();p();p();p();var IU="duration";p();var Sh="tags",s7e="deviceType",iv="data",zN="name",GW="traceID",Oo="length",xU="stringify",wU="measurements",YI="dataType",RU="envelopeType",uL="toString",dL="enqueue",fL="count",KI="push",Gve="emitLineDelimitedJson",kU="clear",Zoe="markAsSent",$W="clearSent",$ve="bufferOverride",Xoe="BUFFER_KEY",pL="SENT_BUFFER_KEY",PU="concat",ese="MAX_BUFFER_SIZE",tse="triggerSend",tA="diagLog",a7e="initialize",rse="_sender",nse="endpointUrl",ise="instrumentationKey",c7e="customHeaders",EDt="maxBatchSizeInBytes",l7e="onunloadDisableBeacon",u7e="isBeaconApiDisabled",_Dt="alwaysUseXhrOverride",CDt="enableSessionStorageBuffer",Pk="_buffer",vDt="onunloadDisableFetch",bDt="disableSendBeaconSplit",Vve="getSenderInst",DU="_onError",d7e="_onPartialSuccess",Wve="_onSuccess",f7e="itemsReceived",p7e="itemsAccepted",h7e="baseType",ose="sampleRate",JYr="getHashCodeScore";var SDt="baseType",xd="baseData",Um="properties",ZYr="true";function Rp(t,e,r){return HN(t,e,r,M1)}a(Rp,"_setValueIf");function Ymo(t,e,r){var n=r[Sh]=r[Sh]||{},o=e.ext=e.ext||{},s=e[Sh]=e[Sh]||[],c=o.user;c&&(Rp(n,bh.userAuthUserId,c.authId),Rp(n,bh.userId,c.id||c.localId));var l=o.app;l&&Rp(n,bh.sessionId,l.sesId);var u=o.device;u&&(Rp(n,bh.deviceId,u.id||u.localId),Rp(n,bh[s7e],u.deviceClass),Rp(n,bh.deviceIp,u.ip),Rp(n,bh.deviceModel,u.model),Rp(n,bh[s7e],u[s7e]));var d=e.ext.web;if(d){Rp(n,bh.deviceLanguage,d.browserLang),Rp(n,bh.deviceBrowserVersion,d.browserVer),Rp(n,bh.deviceBrowser,d.browser);var f=r[iv]=r[iv]||{},h=f[xd]=f[xd]||{},m=h[Um]=h[Um]||{};Rp(m,"domain",d.domain),Rp(m,"isManual",d.isManual?ZYr:null),Rp(m,"screenRes",d.screenRes),Rp(m,"userConsent",d.userConsent?ZYr:null)}var g=o.os;g&&(Rp(n,bh.deviceOS,g[zN]),Rp(n,bh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Rp(n,bh.operationParentId,A.parentID),Rp(n,bh.operationName,iu(t,A[zN])),Rp(n,bh.operationId,A[GW]));for(var y={},E=s[Oo]-1;E>=0;E--){var _=s[E];zr(_,function(b,T){y[b]=T}),s.splice(E,1)}zr(s,function(b,T){y[b]=T});var v=$I($I({},n),y);v[bh.internalSdkVersion]||(v[bh.internalSdkVersion]=iu(t,"javascript:".concat(Kmo.Version),64)),r[Sh]=IUe(v)}a(Ymo,"_extractPartAExtensions");function NU(t,e,r){Zt(t)||zr(t,function(n,o){Eh(o)?r[n]=o:yi(o)?e[n]=o:mU()&&(e[n]=c_()[xU](o))})}a(NU,"_extractPropsAndMeasurements");function VW(t,e){Zt(t)||zr(t,function(r,n){t[r]=n||e})}a(VW,"_convertPropsUndefinedToCustomDefinedValue");function WW(t,e,r,n){var o=new fDt(t,n,e);Rp(o,"sampleRate",r[kve]),(r[xd]||{}).startTime&&(o.time=hU(r[xd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[zN]=o[zN].replace("{0}",s),Ymo(t,r,o),r[Sh]=r[Sh]||[],IUe(o)}a(WW,"_createEnvelope");function zW(t,e){Zt(e[xd])&&Vr(t,1,46,"telemetryItem.baseData cannot be null.")}a(zW,"EnvelopeCreatorInit");var Kmo={Version:"3.3.11"};function XYr(t,e,r){zW(t,e);var n=e[xd][wU]||{},o=e[xd][Um]||{};NU(e[iv],o,n),Zt(r)||VW(o,r);var s=e[xd];if(Zt(s))return oL(t,"Invalid input for dependency data"),null;var c=s[Um]&&s[Um][KUe]?s[Um][KUe]:"GET",l=new QW(t,s.id,s.target,s[zN],s[IU],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new lL(QW[YI],l);return WW(t,QW[RU],e,u)}a(XYr,"DependencyEnvelopeCreator");function TDt(t,e,r){zW(t,e);var n={},o={};e[SDt]!==aL[YI]&&(n.baseTypeSource=e[SDt]),e[SDt]===aL[YI]?(n=e[xd][Um]||{},o=e[xd][wU]||{}):e[xd]&&NU(e[xd],n,o),NU(e[iv],n,o),Zt(r)||VW(n,r);var s=e[xd][zN],c=new aL(t,s,n,o),l=new lL(aL[YI],c);return WW(t,aL[RU],e,l)}a(TDt,"EventEnvelopeCreator");function eKr(t,e,r){zW(t,e);var n=e[xd][wU]||{},o=e[xd][Um]||{};NU(e[iv],o,n),Zt(r)||VW(o,r);var s=e[xd],c=FW.CreateFromInterface(t,s,o,n),l=new lL(FW[YI],c);return WW(t,FW[RU],e,l)}a(eKr,"ExceptionEnvelopeCreator");function tKr(t,e,r){zW(t,e);var n=e[xd],o=n[Um]||{},s=n[wU]||{};NU(e[iv],o,s),Zt(r)||VW(o,r);var c=new cL(t,n[zN],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new lL(cL[YI],c);return WW(t,cL[RU],e,l)}a(tKr,"MetricEnvelopeCreator");function rKr(t,e,r){zW(t,e);var n,o=e[xd];!Zt(o)&&!Zt(o[Um])&&!Zt(o[Um][IU])?(n=o[Um][IU],delete o[Um][IU]):!Zt(e[iv])&&!Zt(e[iv][IU])&&(n=e[iv][IU],delete e[iv][IU]);var s=e[xd],c;((e.ext||{}).trace||{})[GW]&&(c=e.ext.trace[GW]);var l=s.id||c,u=s[zN],d=s.uri,f=s[Um]||{},h=s[wU]||{};if(Zt(s.refUri)||(f.refUri=s.refUri),Zt(s.pageType)||(f.pageType=s.pageType),Zt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[uL]()),!Zt(s[Um])){var m=s[Um];zr(m,function(y,E){f[y]=E})}NU(e[iv],f,h),Zt(r)||VW(f,r);var g=new UW(t,u,d,n,f,h,l),A=new lL(UW[YI],g);return WW(t,UW[RU],e,A)}a(rKr,"PageViewEnvelopeCreator");function nKr(t,e,r){zW(t,e);var n=e[xd],o=n[zN],s=n.uri||n.url,c=n[Um]||{},l=n[wU]||{};NU(e[iv],c,l),Zt(r)||VW(c,r);var u=new jW(t,o,s,void 0,c,l,n),d=new lL(jW[YI],u);return WW(t,jW[RU],e,d)}a(nKr,"PageViewPerformanceEnvelopeCreator");function iKr(t,e,r){zW(t,e);var n=e[xd].message,o=e[xd].severityLevel,s=e[xd][Um]||{},c=e[xd][wU]||{};NU(e[iv],s,c),Zt(r)||VW(s,r);var l=new qW(t,n,o,s,c),u=new lL(qW[YI],l);return WW(t,qW[RU],e,u)}a(iKr,"TraceEnvelopeCreator");p();var oKr=(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},bi(t,this,function(c){c[dL]=function(l){if(c[fL]()>=r.eventsLimitInMem){o||(Vr(e,2,105,"Maximum in-memory buffer size reached: "+c[fL](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Zt(s)&&l.cnt>s)&&n[KI](l)},c[fL]=function(){return n[Oo]},c.size=function(){for(var l=n[Oo],u=0;u0){var u=[];yt(l,function(f){u[KI](f.item)});var d=r[Gve]?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 IDt(l,u):new m7e(l,u);return yt(f,function(m){h[dL](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),m7e=(function(t){Iy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return bi(e,o,function(s,c){s[Zoe]=function(l){c[kU]()},s[$W]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(oKr);var Jmo=["AI_buffer","AI_sentBuffer"],IDt=(function(t){Iy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[$ve]||{getItem:lDt,setItem:uDt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return bi(e,s,function(m,g){var A=T(e[Xoe]),y=T(e[pL]),E=x(),_=y[PU](E),v=m._set(A[PU](_));v[Oo]>e[ese]&&(v[Oo]=e[ese]),R(e[pL],[]),R(e[Xoe],v),m[dL]=function(D){if(m[fL]()>=e[ese]){c||(Vr(n,2,67,"Maximum buffer size reached: "+m[fL](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Zt(h)&&D.cnt>h)&&(g[dL](D),R(e[Xoe],m._get()))},m[kU]=function(){g[kU](),R(e[Xoe],m._get()),R(e[pL],[]),c=!1},m[Zoe]=function(D){R(e[Xoe],m._set(b(D,m._get())));var N=T(e[pL]);N instanceof Array&&D instanceof Array&&(N=N[PU](D),N[Oo]>e[ese]&&(Vr(n,1,67,"Sent buffer reached its maximum size: "+N[Oo],!0),N[Oo]=e[ese]),R(e[pL],N))},m[$W]=function(D){var N=T(e[pL]);N=b(D,N),R(e[pL],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),Q=T(e[pL]).slice(0);D=D||n,N=N||{},m[kU]();var M=L?new e(D,N):new m7e(D,N);return yt(B,function(O){M[dL](O)}),L&&M[Zoe](Q),M};function b(D,N){var L=[],B=[];return yt(D,function(Q){B[KI](Q.item)}),yt(N,function(Q){!Mr(Q)&&Go(B,Q.item)===-1&&L[KI](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=c_().parse(N);if(yi(L)&&(L=c_().parse(L)),L&&cr(L))return L}}catch(B){Vr(n,1,42," storage key: "+D+", "+wp(B),{exception:lr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[xU](N);f(n,L,B)}catch(Q){f(n,L,JSON[xU]([])),Vr(n,2,41," storage key: "+L+", "+wp(Q)+". Buffer cleared",{exception:lr(Q)})}}a(R,"_setBuffer");function x(){var D=[];try{return yt(Jmo,function(N){var L=k(N);if(D=D[PU](L),l){var B=l+"_"+N,Q=k(B);D=D[PU](Q)}}),D}catch(N){Vr(n,2,41,"Transfer events from previous buffers: "+wp(N)+". previous Buffer items can not be removed",{exception:lr(N)})}return[]}a(x,"_getPreviousEvents");function k(D){try{var N=w(D),L=[];return yt(N,function(B){var Q={item:B,cnt:0};L[KI](Q)}),dDt(n,D),L}catch{}return[]}a(k,"_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})(oKr);p();var sKr=(function(){function t(e){bi(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return c_()[xU](l)}catch(u){Vr(e,1,48,u&&Mr(u[uL])?u[uL]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Vr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Vr(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(cr(c))d=o(c,l);else{Vr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{c_()[xU](c),d=c}catch(f){Vr(e,1,48,f&&Mr(f[uL])?f[uL]():"Error serializing object",null,!0)}}return d}return c[u]=!0,zr(c.aiDataContract,function(f,h){var m=Mr(h)?h()&1:h&1,g=Mr(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=Fu(c[f])&&c[f]!==null;if(m&&!y&&!A)Vr(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(!cr(c))Vr(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[ose]=e,this.samplingScoreGenerator=new cKr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[ose],n=!1;return r==null||r>=100||e.baseType===cL[YI]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(tgo,"_chkSampling");var rgo=(hL={},hL[aL.dataType]=TDt,hL[qW.dataType]=iKr,hL[UW.dataType]=rKr,hL[jW.dataType]=nKr,hL[FW.dataType]=eKr,hL[cL.dataType]=tKr,hL[QW.dataType]=XYr,hL),xDt=(function(t){Iy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=o7e;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,k,D,N,L,B,Q,M,O,q,F,U,W,V,G,Y,re;return bi(e,r,function(j,X){ut(),j.pause=function(){xe(),c=!0},j.resume=function(){c&&(c=!1,o=null,Je(),mt())},j.flush=function(ee,pe,ke){if(ee===void 0&&(ee=!0),!c){xe();try{var Le=j[tse](ee,null,ke||1);return ml(Le,function(Ve){return pe?(pe(!Ve.rejected),!0):ee?Id(function(tt){tt(!Ve.rejected)}):Le})}catch(Ve){Vr(j[tA](),1,22,"flush failed, telemetry will not be collected: "+wp(Ve),{exception:lr(Ve)})}}},j.onunloadFlush=function(){if(!c)if(v||O)try{return j[tse](!0,Ot,2)}catch(ee){Vr(j[tA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+wp(ee),{exception:lr(ee)})}else j.flush(!1)},j.addHeader=function(ee,pe){f[ee]=pe},j[a7e]=function(ee,pe,ke,Le){j.isInitialized()&&Vr(j[tA](),1,28,"Sender is already initialized"),X[a7e](ee,pe,ke,Le);var Ve=j.identifier;u=new sKr(pe.logger),n=0,o=null,s=0,j[rse]=null,d=0;var tt=j[tA]();A=Rve(G1("Sender"),pe.evtNamespace&&pe.evtNamespace()),g=yDt(A),j._addHook(VI(ee,function(vt){var Nt=vt.cfg;Nt.storagePrefix&&cDt(Nt.storagePrefix);var Vt=Rk(null,Nt,pe),It=Vt.getExtCfg(Ve,fKr),Be=It[nse];if(y&&Be===y){var oe=Nt[nse];oe&&oe!==Be&&(It[nse]=oe)}var ve=ki("CompressionStream");re=m2t("zipPayload",Nt,!1),Mr(ve)||(re=!1);var Se=It.corsPolicy;Se?(Se==="same-origin"||Se==="same-site"||Se==="cross-origin")&&r.addHeader(pKr,Se):delete f[pKr],Lm(It[ise])&&(It[ise]=Nt[ise]),Hi(j,"_senderConfig",{g:a(function(){return It},"g")}),E!==It[nse]&&(y=E=It[nse]),pe.activeStatus()===Sk.PENDING?j.pause():pe.activeStatus()===Sk.ACTIVE&&j.resume(),w&&w!==It[c7e]&&yt(w,function(_r){delete f[_r.header]}),_=It[EDt],v=(It[l7e]===!1||It[u7e]===!1)&&gU(),b=It[l7e]===!1&&gU(),T=It[u7e]===!1&&gU(),O=It[_Dt],q=!!It.disableXhr,Y=It.retryCodes;var de=It[$ve],te=!!It[CDt]&&(!!de||t7e()),Fe=It.namePrefix,et=te!==L||te&&Q!==Fe||te&&B!==de;if(j[Pk]){if(et)try{j[Pk]=j[Pk].createNew(tt,It,te)}catch(_r){Vr(j[tA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+wp(_r),{exception:lr(_r)})}Je()}else j[Pk]=te?new IDt(tt,It):new m7e(tt,It);Q=Fe,L=te,B=de,F=!It[vDt]&&mve(!0),V=!!It[bDt],j._sample=new lKr(It.samplingPercentage,tt),x=It[ise],!Lm(x)&&!ct(x,Nt)&&Vr(tt,1,100,"Invalid Instrumentation key "+x),w=It[c7e],yi(y)&&!XUe(y)&&w&&w[Oo]>0?yt(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=It.enableSendPromise;var Ht=we();G?G.SetConfig(Ht):(G=new Z2t,G[a7e](Ht,tt));var mr=It.httpXHROverride,or=null,Nr=null,Hr=wUe([3,1,2],It.transports);or=G&&G[Vve](Hr,!1);var Gr=G&&G.getFallbackInst();U=a(function(_r,wm){return Ie(Gr,_r,wm)},"_xhrSend"),W=a(function(_r,wm){return Ie(Gr,_r,wm,!1)},"_fallbackSend"),or=O?mr:or||mr||Gr,j[rse]=function(_r,wm){return Ie(or,_r,wm)},F&&(m=Ee);var zt=wUe([3,1],It.unloadTransports);F||(zt=zt.filter(function(_r){return _r!==2})),Nr=G&&G[Vve](zt,!0),Nr=O?mr:Nr||mr,(O||It.unloadTransports||!m)&&Nr&&(m=a(function(_r,wm){return Ie(Nr,_r,wm)},"_syncUnloadSender")),m||(m=U),R=It.disableTelemetry,k=It.convertUndefined||Dk,D=It.isRetryDisabled,N=It.maxBatchInterval}))},j.processTelemetry=function(ee,pe){pe=j._getTelCtx(pe);var ke=pe[tA]();try{var Le=z(ee,ke);if(!Le)return;var Ve=le(ee,ke);if(!Ve)return;var tt=u.serialize(Ve),vt=j[Pk];Je(tt);var Nt={item:tt,cnt:0};vt[dL](Nt),mt()}catch(Vt){Vr(ke,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+wp(Vt),{exception:lr(Vt)})}j.processNext(ee,pe)},j.isCompletelyIdle=function(){return!c&&h===0&&j._buffer[fL]()===0},j.getOfflineListener=function(){return g},j._xhrReadyStateChange=function(ee,pe,ke){if(!Gt(pe))return Ae(ee,pe,ke)},j[tse]=function(ee,pe,ke){ee===void 0&&(ee=!0);var Le;if(!c)try{var Ve=j[Pk];if(R)Ve[kU]();else{if(Ve[fL]()>0){var tt=Ve.getItems();at(ke||0,ee),pe?Le=pe.call(j,tt,ee):Le=j[rse](tt,ee)}s=+new Date}xe()}catch(Nt){var vt=T2t();(!vt||vt>9)&&Vr(j[tA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+wp(Nt),{exception:lr(Nt)})}return Le},j.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:Me,serialize:K,batch:ae,shouldProcess:a(function(ee){return!!z(ee)},"shouldProcess")}},j._doTeardown=function(ee,pe){j.onunloadFlush(),iL(g,!1),ut()},j[DU]=function(ee,pe,ke){if(!Gt(ee))return De(ee,pe,ke)},j[d7e]=function(ee,pe){if(!Gt(ee))return Te(ee,pe)},j[Wve]=function(ee,pe){if(!Gt(ee))return Z(ee,pe)},j._xdrOnLoad=function(ee,pe){if(!Gt(pe))return ie(ee,pe)};function ie(ee,pe){var ke=dKr(ee);if(ee&&(ke+""=="200"||ke===""))n=0,j[Wve](pe,0);else{var Le=wve(ke);Le&&Le[f7e]&&Le[f7e]>Le[p7e]&&!D?j[d7e](pe,Le):j[DU](pe,fve(ee))}}a(ie,"_xdrOnLoad");function we(){try{var ee={xdrOnComplete:a(function(ke,Le,Ve){var tt=J(Ve);if(tt)return ie(ke,tt)},"xdrOnComplete"),fetchOnComplete:a(function(ke,Le,Ve,tt){var vt=J(tt);if(vt)return Xe(ke.status,vt,ke.url,vt[Oo],ke.statusText,Ve||"")},"fetchOnComplete"),xhrOnComplete:a(function(ke,Le,Ve){var tt=J(Ve);if(tt)return Ae(ke,tt,tt[Oo])},"xhrOnComplete"),beaconOnRetry:a(function(ke,Le,Ve){return $t(ke,Le,Ve)},"beaconOnRetry")},pe={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:q,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:ee};return pe}catch{}return null}a(we,"_getSendPostMgrConfig");function Ae(ee,pe,ke){ee.readyState===4&&Xe(ee.status,pe,ee.responseURL,ke,TW(ee),dKr(ee)||ee.response)}a(Ae,"_xhrReadyStateChange");function De(ee,pe,ke){Vr(j[tA](),2,26,"Failed to send telemetry.",{message:pe}),j._buffer&&j._buffer[$W](ee)}a(De,"_onError");function Te(ee,pe){for(var ke=[],Le=[],Ve=pe.errors.reverse(),tt=0,vt=Ve;tt0&&j[Wve](ee,pe[p7e]),ke[Oo]>0&&j[DU](ke,TW(null,["partial success",pe[p7e],"of",pe.itemsReceived].join(" "))),Le[Oo]>0&&(Qe(Le),Vr(j[tA](),2,40,"Partial success. Delivered: "+ee[Oo]+", Failed: "+ke[Oo]+". Will retry to send "+Le[Oo]+" our of "+pe[f7e]+" items"))}a(Te,"_onPartialSuccess");function Z(ee,pe){j._buffer&&j._buffer[$W](ee)}a(Z,"_onSuccess");function J(ee){try{if(ee){var pe=ee,ke=pe.oriPayload;return ke&&ke[Oo]?ke:null}}catch{}return null}a(J,"_getPayloadArr");function z(ee,pe){if(R)return!1;if(!ee)return pe&&Vr(pe,1,7,"Cannot send empty telemetry"),!1;if(ee.baseData&&!ee[h7e])return pe&&Vr(pe,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(ee[h7e]||(ee[h7e]="EventData"),!j[rse])return pe&&Vr(pe,1,28,"Sender was not initialized"),!1;if(ne(ee))ee[kve]=j._sample[ose];else return pe&&Vr(pe,2,33,"Telemetry item was sampled out and not sent",{SampleRate:j._sample[ose]}),!1;return!0}a(z,"_validate");function le(ee,pe){var ke=ee.iKey||x,Le=e.constructEnvelope(ee,ke,pe,k);if(!Le){Vr(pe,1,47,"Unable to create an AppInsights envelope");return}var Ve=!1;if(ee[Sh]&&ee[Sh][Pve]&&(yt(ee[Sh][Pve],function(tt){try{tt&&tt(Le)===!1&&(Ve=!0,oL(pe,"Telemetry processor check returns false"))}catch(vt){Vr(pe,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+wp(vt),{exception:lr(vt)},!0)}}),delete ee[Sh][Pve]),!Ve)return Le}a(le,"_getEnvelope");function K(ee){var pe=uKr,ke=j[tA]();try{var Le=z(ee,ke),Ve=null;Le&&(Ve=le(ee,ke)),Ve&&(pe=u.serialize(Ve))}catch{}return pe}a(K,"_serialize");function ae(ee){var pe=uKr;return ee&&ee[Oo]&&(pe="["+ee.join(",")+"]"),pe}a(ae,"_batch");function Me(ee){var pe=Re();return{urlString:y,data:ee,headers:pe}}a(Me,"_createPayload");function ne(ee){return j._sample.isSampledIn(ee)}a(ne,"_isSampledIn");function se(ee,pe,ke,Le){pe===200&&ee?j._onSuccess(ee,ee[Oo]):Le&&j[DU](ee,Le)}a(se,"_getOnComplete");function Ie(ee,pe,ke,Le){Le===void 0&&(Le=!0);var Ve=a(function(oe,ve,Se){return se(pe,oe,ve,Se)},"onComplete"),tt=_e(pe),vt=ee&&ee.sendPOST;if(vt&&tt){Le&&j._buffer[Zoe](pe);var Nt,Vt=!1,It,Be;return G.preparePayload(function(oe){Nt=vt(oe,Ve,!ke),Vt=!0,It&&gUe(Nt,It,Be)},re,tt,!ke),Vt?Nt:Id(function(oe,ve){It=oe,Be=ve})}return null}a(Ie,"_doSend");function _e(ee){if(cr(ee)&&ee[Oo]>0){var pe=j[Pk].batchPayloads(ee),ke=Re(),Le={data:pe,urlString:y,headers:ke,disableXhrSync:q,disableFetchKeepAlive:!F,oriPayload:ee};return Le}return null}a(_e,"_getPayload");function Re(){try{var ee=f||{};return XUe(y)&&(ee[JUe[6]]=JUe[7]),ee}catch{}return null}a(Re,"_getHeaders");function Je(ee){var pe=ee?ee[Oo]:0;return j[Pk].size()+pe>_?((!g||g.isOnline())&&j[tse](!0,null,10),!0):!1}a(Je,"_checkMaxSize");function Xe(ee,pe,ke,Le,Ve,tt){var vt=null;if(j._appId||(vt=wve(tt),vt&&vt.appId&&(j._appId=vt.appId)),(ee<200||ee>=300)&&ee!==0){if((ee===301||ee===307||ee===308)&&!Ct(ke)){j[DU](pe,Ve);return}if(g&&!g.isOnline()){if(!D){var Nt=10;Qe(pe,Nt),Vr(j[tA](),2,40,". Offline - Response Code: ".concat(ee,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(pe.length," items."))}return}!D&&He(ee)?(Qe(pe),Vr(j[tA](),2,40,". Response code "+ee+". Will retry to send "+pe[Oo]+" items.")):j[DU](pe,Ve)}else Ct(ke),ee===206?(vt||(vt=wve(tt)),vt&&!D?j[d7e](pe,vt):j[DU](pe,Ve)):(n=0,j[Wve](pe,Le))}a(Xe,"_checkResponsStatus");function Ct(ee){return d>=10?!1:!Zt(ee)&&ee!==""&&ee!==y?(y=ee,++d,!0):!1}a(Ct,"_checkAndUpdateEndPointUrl");function Ot(ee,pe){if(m)m(ee,!1);else{var ke=G&&G[Vve]([3],!0);return Ie(ke,ee,pe)}}a(Ot,"_doUnloadSend");function $t(ee,pe,ke){var Le=ee,Ve=Le&&Le.oriPayload;if(V)W&&W(Ve,!0),Vr(j[tA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var tt=[],vt=0;vt0&&(W&&W(tt,!0),Vr(j[tA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Gt(ee){try{if(ee&&ee[Oo])return yi(ee[0])}catch{}return null}a(Gt,"_isStringArr");function Ee(ee,pe){var ke=null;if(cr(ee)){for(var Le=ee[Oo],Ve=0;Ve-1}a(He,"_isRetriable");function Ze(){var ee="getNotifyMgr",pe,ke=j.core;return ke&&(ke[ee]?pe=ke[ee]():pe=ke._notificationManager),pe}a(Ze,"_getNotifyMgr");function at(ee,pe){var ke=Ze();if(ke&&ke.eventsSendRequest)try{ke.eventsSendRequest(ee,pe)}catch(Le){Vr(j[tA](),1,74,"send request notification failed: "+wp(Le),{exception:lr(Le)})}}a(at,"_notifySendRequest");function ct(ee,pe){var ke=pe.disableInstrumentationKeyValidation,Le=Zt(ke)?!1:ke;if(Le)return!0;var Ve="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",tt=new RegExp(Ve);return tt.test(ee)}a(ct,"_validateInstrumentationKey");function ut(){j[rse]=null,j[Pk]=null,j._appId=null,j._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,k=Dk,D=!1,L=null,Q=Dk,q=!1,F=!1,V=!1,U=null,W=null,G=null,Hi(j,"_senderConfig",{g:a(function(){return xUe({},fKr)},"g")})}a(ut,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Zt(n)?c=$I($I({},r),{iKey:n}):c=r;var l=rgo[c.baseType]||TDt;return l(o,c,s)},e})(xve);p();var YW="instrumentationKey",zve="connectionString",sse="endpointUrl",ase="userOverrideEndpointUrl";var KW,wDt,RDt=void 0,ngo=(KW={diagnosticLogInterval:qoe(igo,1e4)},KW[zve]=RDt,KW.endpointUrl=RDt,KW[YW]=RDt,KW.featureOptIn=(wDt={},wDt.zipPayload={mode:1},wDt),KW.extensionConfig={},KW);function igo(t){return t&&t>0}a(igo,"_chkDiagLevel");var hKr=(function(){function t(e){var r=new K2t,n;(Zt(e)||Zt(e[YW])&&Zt(e[zve]))&&Kc("Invalid input configuration"),bi(t,this,function(s){Hi(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,SW(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=vh(e||{},ngo);n=l.cfg,r.addUnloadHook(VI(l,function(){var u=n[zve];if(Lm(u)){var d=lve(function(g,A){ml(u,function(y){var E=y.value,_=n[YW];if(!y.rejected&&E){n[zve]=E;var v=Uve(E);_=v.instrumentationkey||_}g(_)})}),f=lve(function(g,A){ml(u,function(y){var E=y.value,_=n[sse];if(!y.rejected&&E){var v=Uve(E),b=v.ingestionendpoint;_=b?b+VN:_}g(_)})});n[YW]=d,n[sse]=n[ase]||f}if(yi(u)){var h=Uve(u),m=h.ingestionendpoint;n[sse]=n[ase]?n[ase]:m+VN,n[YW]=h.instrumentationkey||n[YW]}n[sse]=n[ase]?n[ase]:n[sse]})),r.initialize(n,[new xDt])}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 $1=ce(require("os"));var JW=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.options=n;this.onCopilotToken=a(e=>{this.token=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",this.options?.includeAuthorizationHeader&&this.token&&(n.Authorization=`Bearer ${this.token.token}`);let o={method:"POST",headers:n,body:e.data};this.ctx.get(ar).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new hKr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[o7e]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:ogo(e),this.commonProperties=n?.excludeCommonProperties?{}:sgo(e),this.#e=Es(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 ogo(t){let e={},r=t.get(Fa);e["ai.session.id"]=r.sessionId;let n=t.get(Nf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${$1.type()} ${$1.release()}`,e["ai.device.osArchitecture"]=$1.arch(),e["ai.device.osPlatform"]=$1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ss).getVersion(),e}a(ogo,"getTags");function sgo(t){let e={};e.common_os=$1.platform(),e.common_platformversion=$1.release(),e.common_arch=$1.arch(),e.common_cpu=Array.from(new Set($1.cpus().map(n=>n.model))).join();let r=t.get(Fa);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(sgo,"getCommonProperties");p();p();p();p();p();p();var Yve=z9e;var YN=Yve({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var MU=Yve({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var ZW="toLowerCase",vn="length",cse="warnToConsole",mL="throwInternal",KN="watch",OU="apply",ro="push",JI="splice",ju="logger",JN="cancel",gL="initialize",ZN="identifier",lse="removeNotificationListener",use="addNotificationListener",ov="isInitialized",Kve="getNotifyMgr",BU="getPlugin",Nk="name",U0="processNext",g7e="getProcessTelContext",AL="value",LU="enabled",kDt="stopPollingInternalLogs",ZI="unload",Jve="onComplete",A7e="version",y7e="loggingLevelConsole",XN="createNew",V1="teardown",dse="messageId",eM="message",sv="diagLog",FU="_doTeardown",XW="update",W1="getNext",UU="setNextPlugin",Zve="userAgent",yL="split",Mk="replace",PDt="substring",E7e="indexOf",EL="type",DDt="evtName",Ok="status",NDt="getAllResponseHeaders",Xve="isChildEvt",z1="data",ez="getCtx",Bk="setCtx";var ebe="headers",fse="urlString",tz="timeout";var _7e="traceFlags";var MDt;function mKr(t,e){MDt||(MDt=zCe("AggregationError",function(n,o){o[vn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw yt(e,function(n,o){r+=` -`.concat(o," > ").concat(lr(n))}),new MDt(r,e||[])}a(mKr,"throwAggregationError");p();p();p();p();p();var Y1=void 0,Cs="",rz="channels",Uf="core",C7e="createPerfMgr",tbe="disabled",_L="extensionConfig",nz="extensions",av="processTelemetry",iz="priority",pse="eventsSent",QU="eventsDiscarded",hse="eventsSendRequest",tM="perfEvent",v7e="offlineEventsStored",b7e="offlineBatchSent",S7e="offlineBatchDrop",mse="getPerfMgr",T7e="domain",I7e="path",gKr="Not dynamic - ";var ago="getPrototypeOf",cgo=/-([a-z])/g,lgo=/([^\w\d_$])/g,ugo=/^(\d+[\w\d_$])/,gDl=Object[ago];function qU(t){return!Zt(t)}a(qU,"isNotNullOrUndefined");function gse(t){var e=t;return e&&yi(e)&&(e=e[Mk](cgo,function(r,n){return n.toUpperCase()}),e=e[Mk](lgo,"_"),e=e[Mk](ugo,function(r,n){return"_"+n})),e}a(gse,"normalizeJsName");function Qm(t,e){return t&&e?nu(t,e)!==-1:!1}a(Qm,"strContains");function Ase(t){return t&&t.toISOString()||""}a(Ase,"toISOString");function yse(t){return WB(t)?t[Nk]:Cs}a(yse,"getExceptionName");function CL(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(CL,"setValue");function x7e(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Pn(r)?{}:r,t[e]=n)):n=Pn(r)?{}:r,n}a(x7e,"getSetValue");function dgo(t,e){var r=null,n=null;return Mr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][OU](n,o)}}a(dgo,"_createProxyFunction");function jU(t,e,r,n,o){t&&e&&r&&(o!==!1||Pn(t[e]))&&(t[e]=dgo(r,n))}a(jU,"proxyFunctionAs");function HU(t,e,r,n){return t&&e&&Fu(t)&&cr(r)&&yt(r,function(o){yi(o)&&jU(t,o,e,o,n)}),t}a(HU,"proxyFunctions");function rM(t){return t&&zB&&(t=dU(zB({},t))),t}a(rM,"optimizeObject");function w7e(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(w7e,"isFeatureEnabled");function nM(t){try{return t.responseText}catch{}return null}a(nM,"getResponseText");function R7e(t,e){return t?"XDomainRequest,Response:"+nM(t)||"":e}a(R7e,"formatErrorMessageXdr");function nbe(t,e){return t?"XMLHttpRequest,Status:"+t[Ok]+",Response:"+nM(t)||t.response||"":e}a(nbe,"formatErrorMessageXhr");function ibe(t,e){return e&&(Eh(e)?t=[e].concat(t):cr(e)&&(t=e.concat(t))),t}a(ibe,"prependTransports");var fgo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",AKr="withCredentials",pgo="timeout";function ODt(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,fgo,n),r&&c(l,AKr,r),l.open(t,e,!o),r&&c(l,AKr,r),!o&&s&&c(l,pgo,s),l}a(ODt,"openXhr");function BDt(t){var e={};if(yi(t)){var r=Pi(t)[yL](/[\r\n]+/);yt(r,function(n){if(n){var o=n[E7e](": ");if(o!==-1){var s=Pi(n.substring(0,o))[ZW](),c=Pi(n[PDt](o+1));e[s]=c}else e[Pi(n)]=1}})}return e}a(BDt,"convertAllHeadersToMap");function rbe(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Pi(n))}return t}a(rbe,"_appendHeader");var hgo="kill-duration",mgo="kill-duration-seconds",ggo="time-delta-millis";function GU(t,e){var r={};return t[NDt]?r=BDt(t[NDt]()):e&&(r=rbe(r,t,ggo),r=rbe(r,t,hgo),r=rbe(r,t,mgo)),r}a(GU,"_getAllResponseHeaders");p();p();var Ago="location",ygo="console",yKr="JSON",Ego="crypto",_go="msCrypto",Cgo="ReactNative",vgo="msie",bgo="trident/",EKr="XMLHttpRequest",LDt=null,FDt=null,Sgo=!1,Ese=null,UDt=null;function _Kr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[j1];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Pn(o[e])}catch{}}return r}a(_Kr,"_hasProperty");function _se(t){if(t&&Sgo){var e=ki("__mockLocation");if(e)return e}return typeof location===GI&&location?location:ki(Ago)}a(_se,"getLocation");function k7e(){return typeof console!==q1?console:ki(ygo)}a(k7e,"getConsole");function obe(){return!!(typeof JSON===GI&&JSON||ki(yKr)!==null)}a(obe,"hasJSON");function P7e(){return obe()?JSON||ki(yKr):null}a(P7e,"getJSON");function D7e(){return ki(Ego)}a(D7e,"getCrypto");function N7e(){return ki(_go)}a(N7e,"getMsCrypto");function Cse(){var t=Qu();return t&&t.product?t.product===Cgo:!1}a(Cse,"isReactNative");function oz(){var t=Qu();if(t&&(t[Zve]!==FDt||LDt===null)){FDt=t[Zve];var e=(FDt||Cs)[ZW]();LDt=Qm(e,vgo)||Qm(e,bgo)}return LDt}a(oz,"isIE");function vse(t){return(UDt===null||t===!1)&&(UDt=pW()&&!!Qu().sendBeacon),UDt}a(vse,"isBeaconsSupported");function bse(t){var e=!1;try{e=!!ki("fetch");var r=ki("Request");e&&t&&r&&(e=_Kr(r,"keepalive"))}catch{}return e}a(bse,"isFetchSupported");function M7e(){return Ese===null&&(Ese=typeof XDomainRequest!==q1,Ese&&sbe()&&(Ese=Ese&&!_Kr(ki(EKr),"withCredentials"))),Ese}a(M7e,"useXDomainRequest");function sbe(){var t=!1;try{var e=ki(EKr);t=!!e}catch{}return t}a(sbe,"isXhrSupported");var CKr=4294967296,sz=4294967295,vKr=123456789,bKr=987654321,SKr=!1,abe=vKr,cbe=bKr;function Tgo(t){t<0&&(t>>>=0),abe=vKr+t&sz,cbe=bKr-t&sz,SKr=!0}a(Tgo,"_mwcSeed");function Igo(){try{var t=hl()&2147483647;Tgo((Math.random()*CKr^t)+t)}catch{}}a(Igo,"_autoSeedMwc");function QDt(t){var e=0,r=D7e()||N7e();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&sz),e===0&&oz()&&(SKr||Igo(),e=xgo()&sz),e===0&&(e=B1(CKr*Math.random()|0)),t||(e>>>=0),e}a(QDt,"random32");function xgo(t){cbe=36969*(cbe&65535)+(cbe>>16)&sz,abe=18e3*(abe&65535)+(abe>>16)&sz;var e=(cbe<<16)+(abe&65535)>>>0&sz|0;return t||(e>>>=0),e}a(xgo,"mwcRandom32");function qDt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=QDt()>>>0,n=0,o=Cs;o[vn]>>=6,n===5&&(r=(QDt()<<2&4294967295|r&3)>>>0,n=0);return o}a(qDt,"newId");var TKr="3.3.10",wgo="."+qDt(6),Rgo=0;function IKr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(IKr,"_canAcceptData");function kgo(t,e){var r=e[t.id];if(!r){r={};try{IKr(e)&&Hi(e,t.id,{e:!1,v:r})}catch{}}return r}a(kgo,"_getCache");function XI(t,e){return e===void 0&&(e=!1),gse(t+Rgo+++(e?"."+TKr:Cs)+wgo)}a(XI,"createUniqueNamespace");function O7e(t){var e={id:XI("_aiData-"+(t||Cs)+"."+TKr),accept:a(function(r){return IKr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[gse(n)]:(s&&(c=kgo(e,r),c[gse(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(O7e,"createElmNodeData");p();function B7e(t){return t&&Fu(t)&&!cr(t)&&(t.isVal||t.fb||Xg(t,"v")||Xg(t,"mrg")||Xg(t,"ref")||t.set)}a(B7e,"_isConfigDefaults");function xKr(t,e,r){var n,o=r.dfVal||Coe;if(e&&r.fb){var s=r.fb;cr(s)||(s=[s]);for(var c=0;c0&&mKr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[vn]>0){c||(c=[]),l||(l=xp(function(){l=null,f()},0));for(var A=0;A0?ml(Tse(t[0],e),function(){VDt(oU(t,1),e,r)}):r(),n}a(VDt,"doUnloadAll");p();var kKr=500,WDt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function PKr(t){return{mrg:!0,v:t}}a(PKr,"cfgDfMerge");p();p();var zDt=[pse,QU,hse,tM],j7e=null,q7e;function Fgo(t,e){return function(){var r=arguments,n=YDt(e);if(n){var o=n.listener;o&&o[t]&&o[t][OU](o,r)}}}a(Fgo,"_listenerProxyFunc");function Ugo(){var t=ki("Microsoft");return t&&(j7e=t.ApplicationInsights),j7e}a(Ugo,"_getExtensionNamespace");function YDt(t){var e=j7e;return!e&&t.disableDbgExt!==!0&&(e=j7e||Ugo()),e?e.ChromeDbgExt:null}a(YDt,"getDebugExt");function DKr(t){if(!q7e){q7e={};for(var e=0;e=A&&(d[T](b[eM]),n[w]=!0)}else o>=A&&d[T](b[eM]);f(A,b)}},d.debugToConsole=function(A){KDt("debug",A),g("warning",A)},d[cse]=function(A){KDt("warn",A),g("warning",A)},d.errorToConsole=function(A){KDt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[ZI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=jgo+y[dse];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 xse(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[cse](v)}}}a(f,"_logInternalMessage");function h(A){return K1(kp(A,Hgo,d).cfg,function(y){var E=y.cfg;o=E[y7e],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=YDt(e||{});E&&E[sv]&&E[sv](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function OKr(t){return t||new az}a(OKr,"_getLogger");function wa(t,e,r,n,o,s){s===void 0&&(s=!1),OKr(t)[mL](e,r,n,o,s)}a(wa,"_throwInternal");function oM(t,e){OKr(t)[cse](e)}a(oM,"_warnToConsole");var JDt,$U,BKr="toGMTString",LKr="toUTCString",eNt="cookie",ZDt="expires",FKr="isCookieUseDisabled",mbe="disableCookiesUsage",UKr="_ckMgr",H7e=null,XDt=null,QKr=null,sM,qKr={},jKr={},$go=(JDt={cookieCfg:PKr(($U={},$U[T7e]={fb:"cookieDomain",dfVal:qU},$U.path={fb:"cookiePath",dfVal:qU},$U.enabled=Y1,$U.ignoreCookies=Y1,$U.blockedCookies=Y1,$U.disableCookieDefer=!1,$U)),cookieDomain:Y1,cookiePath:Y1},JDt[mbe]=Y1,JDt);function tNt(){!sM&&(sM=K9e(function(){return rf()}))}a(tNt,"_getDoc");function G7e(t){return t?t.isEnabled():!0}a(G7e,"_isMgrEnabled");function zKr(t,e){return e&&t&&cr(t.ignoreCookies)?Go(t.ignoreCookies,e)!==-1:!1}a(zKr,"_isIgnoredCookie");function HKr(t,e){return e&&t&&cr(t.blockedCookies)&&Go(t.blockedCookies,e)!==-1?!0:zKr(t,e)}a(HKr,"_isBlockedCookie");function GKr(t,e){var r=e[LU];if(Zt(r)){var n=void 0;Pn(t[FKr])||(n=!t[FKr]),Pn(t[mbe])||(n=!t[mbe]),r=n}return r}a(GKr,"_isCfgEnabled");function rNt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[I7e]=E||"/",_[ZDt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return oz()||(v["max-age"]="0"),VKr(Cs,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||Cs),R=nu(w,";");if(R!==-1&&(w=Pi(ON(E,R)),T=YKr(Lf(E,R+1))),CL(T,T7e,v||o,M1,Pn),!Zt(_)){var x=oz();if(Pn(T[ZDt])){var k=hl(),D=k+_*1e3;if(D>0){var N=new Date;N.setTime(D),CL(T,ZDt,$Kr(N,x?BKr:LKr)||$Kr(N,x?BKr:LKr)||Cs,M1)}}x||CL(T,"max-age",Cs+_,null,Pn)}var L=_se();return L&&L.protocol==="https:"&&(CL(T,"secure",null,null,Pn),XDt===null&&(XDt=!KKr((Qu()||{})[Zve])),XDt&&CL(T,"SameSite","None",null,Pn)),CL(T,I7e,b||n,null,Pn),VKr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[vn]-1;_>=0;_--)f[_].n===E&&f[JI](_,1)}a(g,"_removePendingCookie");function A(){hbe(e)&&f&&(yt(f,function(E){HKr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=kp(t||jKr,null,e).cfg,s=K1(t,function(E){E.setDf(E.cfg,$go),r=E.ref(E.cfg,"cookieCfg"),n=r[I7e]||"/",o=r[T7e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=GKr(t,r)!==!1,l=r.getCookie||Vgo,u=r.setCookie||WKr,d=r.delCookie||WKr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=GKr(t,r)!==!1&&c&&hbe(e),_=jKr[UKr];return E&&_&&y!==_&&(E=G7e(_)),E},"isEnabled"),setEnabled:a(function(E){r[LU]=E,Pn(t[mbe])||(t[mbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=HKr(r,E);if(!R){var x=m(_,v,b,T);G7e(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 _=Cs,v=zKr(r,E);if(!v){if(G7e(y))_=l(E);else if(f)for(var b=f[vn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=nu(w,";");_=R!==-1?Pi(ON(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return G7e(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 hbe(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[UKr]=y,y}a(rNt,"createCookieMgr");function hbe(t){if(H7e===null){H7e=!1,!sM&&tNt();try{var e=sM.v||{};H7e=e[eNt]!==void 0}catch(r){wa(t,2,68,"Cannot access document.cookie - "+yse(r),{exception:lr(r)})}}return H7e}a(hbe,"areCookiesSupported");function YKr(t){var e={};if(t&&t[vn]){var r=Pi(t)[yL](";");yt(r,function(n){if(n=Pi(n||Cs),n){var o=nu(n,"=");o===-1?e[n]=null:e[Pi(ON(n,o))]=Pi(Lf(n,o+1))}})}return e}a(YKr,"_extractParts");function $Kr(t,e){return Mr(t[e])?t[e]():null}a($Kr,"_formatDate");function VKr(t,e){var r=t||Cs;return zr(e,function(n,o){r+="; "+n+(Zt(o)?Cs:"="+o)}),r}a(VKr,"_formatCookieValue");function Vgo(t){var e=Cs;if(!sM&&tNt(),sM.v){var r=sM.v[eNt]||Cs;QKr!==r&&(qKr=YKr(r),QKr=r),e=Pi(qKr[t]||Cs)}return e}a(Vgo,"_getCookieValue");function WKr(t,e){!sM&&tNt(),sM.v&&(sM.v[eNt]=t+"="+e)}a(WKr,"_setCookieValue");function KKr(t){return yi(t)?!!(Qm(t,"CPU iPhone OS 12")||Qm(t,"iPad; CPU OS 12")||Qm(t,"Macintosh; Intel Mac OS X 10_14")&&Qm(t,"Version/")&&Qm(t,"Safari")||Qm(t,"Macintosh; Intel Mac OS X 10_14")&&JB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Qm(t,"Chrome/5")||Qm(t,"Chrome/6")||Qm(t,"UnrealEngine")&&!Qm(t,"Chrome")||Qm(t,"UCBrowser/12")||Qm(t,"UCBrowser/11")):!1}a(KKr,"uaDisallowsSameSiteNone");p();var Wgo={perfEvtsSendAll:!1};function zgo(t){t.h=null;var e=t.cb;t.cb=[],yt(e,function(r){Bf(r.fn,[r.arg])})}a(zgo,"_runScheduledListeners");function VU(t,e,r,n){yt(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||xp(zgo,0,r)):Bf(n,[o]))})}a(VU,"_runListeners");var nNt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=kp(e,Wgo);n=c[KN](function(l){r=!!l.cfg.perfEvtsSendAll}),bi(t,this,function(l){Hi(l,"listeners",{g:a(function(){return o},"g")}),l[use]=function(u){o[ro](u)},l[lse]=function(u){for(var d=Go(o,u);d>-1;)o[JI](d,1),d=Go(o,u)},l[pse]=function(u){VU(o,pse,s,function(d){d[pse](u)})},l[QU]=function(u,d){VU(o,QU,s,function(f){f[QU](u,d)})},l[hse]=function(u,d){VU(o,hse,d?s:null,function(f){f[hse](u,d)})},l[tM]=function(u){u&&(r||!u[Xve]())&&VU(o,tM,null,function(d){u.isAsync?xp(function(){return d[tM](u)},0):d[tM](u)})},l[v7e]=function(u){u&&u[vn]&&VU(o,v7e,s,function(d){d[v7e](u)})},l[b7e]=function(u){u&&u[z1]&&VU(o,b7e,s,function(d){d[b7e](u)})},l[S7e]=function(u,d){if(u>0){var f=d||0;VU(o,S7e,s,function(h){h[S7e](u,f)})}},l[ZI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[JN](),s.h=null,s.cb=[]},"_finishUnload"),f;if(VU(o,"unload",null,function(h){var m=h[ZI](u);m&&(f||(f=[]),f[ro](m))}),f)return Id(function(h){return ml(yUe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Rse="ctx",oNt="ParentContextKey",gbe="ChildrenContextKey",Ygo=null,kse=(function(){function t(e,r,n){var o=this;if(o.start=hl(),o[Nk]=e,o.isAsync=n,o[Xve]=function(){return!1},Mr(r)){var s;Hi(o,"payload",{g:a(function(){return!s&&Mr(r)&&(s=r(),r=null),s},"g")})}o[ez]=function(c){return c?c===t[oNt]||c===t[gbe]?o[c]:(o[Rse]||{})[c]:null},o[Bk]=function(c,l){if(c)if(c===t[oNt])o[c]||(o[Xve]=function(){return!0}),o[c]=l;else if(c===t[gbe])o[c]=l;else{var u=o[Rse]=o[Rse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[ez](t[gbe]);if(cr(l))for(var u=0;u0&&(yt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){wa(r[ju],2,73,"Unexpected Exception during onComplete - "+lr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[_L];!_&&A&&(_={}),E[_L]=_,_=e.ref(E,_L),_&&(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&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}lbe(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[BU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(uNt,"_createInternalContext");function ex(t,e,r,n){var o=kp(e),s=uNt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[av](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),cr(d)&&(d=WU(d,o.cfg,r,f)),ex(d||c[W1](),o.cfg,r,f)}return a(u,"_createNew"),c[U0]=l,c[XN]=u,c}a(ex,"createProcessTelemetryContext");function Pse(t,e,r){var n=kp(e.config),o=uNt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[ZI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=WU(u,n.cfg,e,d)),Pse(u||s[W1](),e,d)}return a(l,"_createNew"),s[U0]=c,s[XN]=l,s}a(Pse,"createProcessTelemetryUnloadContext");function Abe(t,e,r){var n=kp(e.config),o=uNt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Mr(d[XW])&&d[XW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=WU(u,n.cfg,e,d)),Abe(u||s[W1](),e,d)}return a(l,"_createNew"),s[U0]=c,s[XN]=l,s}a(Abe,"createProcessTelemetryUpdateContext");function WU(t,e,r,n){var o=null,s=!n;if(cr(t)&&t[vn]>0){var c=null;yt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Mr(l[av])){var u=tAo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?WU([n],e,r):o}a(WU,"createTelemetryProxyChain");function tAo(t,e,r){var n=null,o=Mr(t[av]),s=Mr(t[UU]),c;t?c=t[ZN]+"-"+t[iz]+"-"+tJr++:c="Unknown-0-"+tJr++;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&&Mr(t[eJr])&&(g=t[eJr]()),g||(g=ex(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[ZN]:Xgo,T=g[XKr];return T||(T=g[XKr]={}),g.setNext(n),t&&Pp(g[Uf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Cs;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&wa(g[sv](),1,73,"Plugin ["+b+"] failed during "+y+" - "+lr(x)+", run flags: "+lr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=vL(t);return _[V1]||_[tbe]?!1:(s&&t[UU](n),t[av](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[U0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=vL(t),v=t[Uf]||_[Uf];t&&(!v||v===g.core())&&!_[V1]&&(_[Uf]=null,_[V1]=!0,_[ov]=!1,t[V1]&&t[V1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[U0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=vL(t),v=t[Uf]||_[Uf];t&&(!v||v===g.core())&&!_[V1]&&t[XW]&&t[XW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[U0](A)}return a(m,"_updatePlugin"),_h(l)}a(tAo,"createTelemetryPluginProxy");var rJr=(function(){function t(e,r,n,o){var s=this,c=ex(e,r,n,o);HU(s,c,Uu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function ybe(){var t=[];function e(n){n&&t[ro](n)}a(e,"_addHandler");function r(n,o){yt(t,function(s){try{s(n,o)}catch(c){wa(n[sv](),2,73,"Unexpected error calling unload handler - "+lr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(ybe,"createUnloadHandlerContainer");p();var W7e,z7e;function Y7e(){var t=[];function e(n){var o=t;t=[],yt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){wa(n,2,73,"Unloading:"+lr(c))}}),W7e&&o[vn]>W7e&&(z7e?z7e("doUnload",o):wa(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Ch(t,n),W7e&&t[vn]>W7e&&(z7e?z7e("Add",t):wa(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(Y7e,"createUnloadHookContainer");var dNt,zU="getPlugin",rAo=(dNt={},dNt[_L]={isVal:qU,v:{}},dNt),Dse=(function(){function t(){var e=this,r,n,o,s,c;d(),bi(t,e,function(f){f[gL]=function(h,m,g,A){u(h,m,A),r=!0},f[V1]=function(h,m){var g=f[Uf];if(!g||h&&g!==h[Uf]())return;var A,y=!1,E=h||Pse(null,g,o&&o[zU]?o[zU]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[sv]()),A===!0&&E[U0](_),d())}return a(v,"_unloadCallback"),!f[FU]||f[FU](E,_,v)!==!0?v():A=!0,A},f[XW]=function(h,m){var g=f[Uf];if(!g||h&&g!==h[Uf]())return;var A,y=!1,E=h||Abe(null,g,o&&o[zU]?o[zU]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[W1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},jU(f,"_addUnloadCb",function(){return s},"add"),jU(f,"_addHook",function(){return c},"add"),Hi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[sv]=function(f){return l(f)[sv]()},e[ov]=function(){return r},e.setInitialized=function(f){r=f},e[UU]=function(f){o=f},e[U0]=function(f,h){h?h[U0](f):o&&Mr(o[av])&&o[av](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||ex(null,{},e[Uf]);o&&o[zU]?h=m[XN](null,o[zU]):h=m[XN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){kp(f,rAo,wse(h)),!m&&h&&(m=h[g7e]()[W1]());var g=o;o&&o[zU]&&(g=o[zU]()),e[Uf]=h,n=ex(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Uf]=null,n=null,o=null,c=Y7e(),s=ybe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function nAo(t,e,r){var n={id:e,fn:r};Ch(t,n);var o={remove:a(function(){yt(t,function(s,c){if(s.id===n.id)return t[JI](c,1),-1})},"remove")};return o}a(nAo,"_addInitializer");function iAo(t,e,r){for(var n=!1,o=t[vn],s=0;s"},"v")})}a(hAo,"_createUnloadHook");var K7e=(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,k,D,N,L,B,Q,M,O,q,F;bi(t,this,function(U){X(),U._getDbgPlgTargets=function(){return[x,o]},U[ov]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[gL]=function(ne,se,Ie,_e){g&&Kc(iJr),U[ov]()&&Kc("Core cannot be initialized more than once"),e=kp(ne,fNt,Ie||U[ju],!1),ne=e.cfg,Me(e[KN](function(Xe){var Ct=Xe.cfg;B=Ct.initInMemoMaxSize||aAo,W(Ct);var Ot=Xe.ref(Xe.cfg,_L);zr(Ot,function($t){Xe.ref(Ot,$t)})})),s=_e,b=pAo(e,v,s&&U[Kve](),b),z(),U[ju]=Ie;var Re=ne[nz];if(f=[],f[ro].apply(f,yW(yW([],se,!1),Re,!1)),h=ne[rz],we(null),(!m||m[vn]===0)&&Kc("No "+rz+" available"),h&&h[vn]>1){var Je=U[BU]("TeeChannelController");(!Je||!Je.plugin)&&wa(n,1,28,"TeeChannel required")}fAo(ne,R,n),R=null,r=!0,N===MU.ACTIVE&&Y()},U.getChannels=function(){var ne=[];return m&&yt(m,function(se){ne[ro](se)}),_h(ne)},U.track=function(ne){Pp(U[mse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ae(ne),Kc("Invalid telemetry item")),!ne[Nk]&&Zt(ne[Nk])&&(ae(ne),Kc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Ase(new Date),ne.ver=ne.ver||"4.0",!g&&U[ov]()&&N===MU.ACTIVE?ie()[U0](ne):N!==MU.INACTIVE&&o[vn]<=B&&o[ro](ne)},function(){return{item:ne}},!ne.sync)},U[g7e]=ie,U[Kve]=function(){return s||(s=new nNt(e.cfg),U[oAo]=s),s},U[use]=function(ne){U.getNotifyMgr()[use](ne)},U[lse]=function(ne){s&&s[lse](ne)},U.getCookieMgr=function(){return u||(u=rNt(e.cfg,U[ju])),u},U.setCookieMgr=function(ne){u!==ne&&(Tse(u,!1),u=ne)},U[mse]=function(){return c||l||sNt()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[vn]},U.releaseQueue=function(){if(r&&o[vn]>0){var ne=o;o=[],N===2?yt(ne,function(se){se.iKey=se.iKey||w,ie()[U0](se)}):wa(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,F=!1,O&&O[JN](),re(!0)};function W(ne){var se=ne.instrumentationKey,Ie=ne.endpointUrl;if(N!==3){if(Zt(se)){w=null,N=MU.INACTIVE;var _e="Please provide instrumentation key";r?(wa(n,1,100,_e),Y()):Kc(_e);return}var Re=[];Lm(se)?(Re[ro](se),w=null):w=se,Lm(Ie)?(Re[ro](Ie),L=null):L=Ie,Re[vn]?V(ne,Re):G()}}a(W,"_handleIKeyEndpointPromises");function V(ne,se){Q=!1,N=3;var Ie=qU(ne.initTimeOut)?ne.initTimeOut:cAo,_e=AUe(se);M&&M[JN](),M=xp(function(){M=null,Q||G()},Ie),ml(_e,function(Re){try{if(Q)return;if(!Re.rejected){var Je=Re[AL];if(Je&&Je[vn]){var Xe=Je[0];if(w=Xe&&Xe[AL],Je[vn]>1){var Ct=Je[1];L=Ct&&Ct[AL]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}G()}catch{Q||G()}})}a(V,"_waitForInitPromises");function G(){Q=!0,Zt(w)?(N=MU.INACTIVE,wa(n,1,112,"ikey can't be resolved from promises")):N=MU.ACTIVE,Y()}a(G,"_setStatus");function Y(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(Y,"_releaseQueues");function re(ne){if((!O||!O[LU])&&!F){var se=ne||n&&n.queue[vn]>0;se&&(q||(q=!0,Me(e[KN](function(Ie){var _e=Ie.cfg.diagnosticLogInterval;(!_e||!(_e>0))&&(_e=1e4);var Re=!1;O&&(Re=O[LU],O[JN]()),O=eUe(Z,_e),O.unref(),O[LU]=Re}))),O[LU]=!0)}return O}a(re,"_startLogPoller"),U[kDt]=function(){F=!0,O&&O[JN](),Z()},HU(U,function(){return A},["addTelemetryInitializer"]),U[ZI]=function(ne,se,Ie){ne===void 0&&(ne=!0),r||Kc(sAo),g&&Kc(iJr);var _e={reason:50,isAsync:ne,flushComplete:!1},Re;ne&&!se&&(Re=Id(function(Ct){se=Ct}));var Je=Pse(De(),U);Je[Jve](function(){v.run(U[ju]),VDt([u,s,n],ne,function(){X(),se&&se(_e)})},U);function Xe(Ct){_e.flushComplete=Ct,g=!0,_.run(Je,_e),U[kDt](),Je[U0](_e)}return a(Xe,"_doUnload"),Z(),J(ne,Xe,6,Ie)||Xe(!1),Re},U[BU]=Ae,U.addPlugin=function(ne,se,Ie,_e){if(!ne){_e&&_e(!1),K(aJr);return}var Re=Ae(ne[ZN]);if(Re&&!se){_e&&_e(!1),K("Plugin ["+ne[ZN]+"] is already loaded!");return}var Je={reason:16};function Xe($t){f[ro](ne),Je.added=[ne],we(Je),_e&&_e(!0)}if(a(Xe,"_addPlugin"),Re){var Ct=[Re.plugin],Ot={reason:2,isAsync:!!Ie};Te(Ct,Ot,function($t){$t?(Je.removed=Ct,Je.reason|=32,Xe(!0)):_e&&_e(!1)})}else Xe(!1)},U.updateCfg=function(ne,se){se===void 0&&(se=!0);var Ie;if(U[ov]()){Ie={reason:1,cfg:e.cfg,oldCfg:Toe({},e.cfg),newConfig:Toe({},ne),merge:se},ne=Ie.newConfig;var _e=e.cfg;ne[nz]=_e[nz],ne[rz]=_e[rz]}e._block(function(Re){var Je=Re.cfg;pNt(Re,Je,ne,se),se||zr(Je,function(Xe){Xg(ne,Xe)||Re.set(Je,Xe,Y1)}),Re.setDf(Je,fNt)},!0),e.notify(),Ie&&le(Ie)},U.evtNamespace=function(){return E},U.flush=J,U.getTraceCtx=function(ne){return T||(T=ZKr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=Me,jU(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var se;return r?se=K1(e.cfg,ne,U[ju]):se=dAo(R,ne),hAo(se)},U.getWParam=function(){return YB()||e.cfg.enableWParam?0:-1};function j(){var ne={};k=[];var se=a(function(Ie){Ie&&yt(Ie,function(_e){if(_e[ZN]&&_e[A7e]&&!ne[_e.identifier]){var Re=_e[ZN]+"="+_e[A7e];k[ro](Re),ne[_e.identifier]=_e}})},"_addPluginVersions");se(m),h&&yt(h,function(Ie){se(Ie)}),se(f)}a(j,"_setPluginVersions");function X(){r=!1,e=kp({},fNt,U[ju]),e.cfg[y7e]=1,Hi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(se){U.updateCfg(se,!1)},"s")}),Hi(U,"pluginVersionStringArr",{g:a(function(){return k||j(),k},"g")}),Hi(U,"pluginVersionString",{g:a(function(){return D||(k||j(),D=k.join(";")),D||Cs},"g")}),Hi(U,"logger",{g:a(function(){return n||(n=new az(e.cfg),e[ju]=n),n},"g"),s:a(function(se){e[ju]=se,n!==se&&(Tse(n,!1),n=se)},"s")}),U[ju]=new az(e.cfg),x=[];var ne=U.config[nz]||[];ne.splice(0,ne[vn]),Ch(ne,x),A=new nJr,o=[],Tse(s,!1),s=null,c=null,l=null,Tse(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=XI("AIBaseCore",!0),_=ybe(),T=null,w=null,v=Y7e(),R=[],D=null,k=null,F=!1,O=null,q=!1,N=0,L=null,B=null,Q=!1,M=null}a(X,"_initDefaults");function ie(){var ne=ex(De(),e.cfg,U);return ne[Jve](re),ne}a(ie,"_createTelCtx");function we(ne){var se=uAo(U[ju],kKr,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=V7e(Ch(m,se[rz]));var Ie=Ch(V7e(se[Uf]),m);x=_h(Ie);var _e=U.config[nz]||[];_e.splice(0,_e[vn]),Ch(_e,x);var Re=ie();m&&m[vn]>0&&lNt(Re[XN](m),Ie),lNt(Re,Ie),ne&&le(ne)}a(we,"_initPluginChain");function Ae(ne){var se=null,Ie=null,_e=[];return yt(x,function(Re){if(Re[ZN]===ne&&Re!==A)return Ie=Re,-1;Re.getChannel&&_e[ro](Re)}),!Ie&&_e[vn]>0&&yt(_e,function(Re){if(Ie=Re.getChannel(ne),!Ie)return-1}),Ie&&(se={plugin:Ie,setEnabled:a(function(Re){vL(Ie)[tbe]=!Re},"setEnabled"),isEnabled:a(function(){var Re=vL(Ie);return!Re[V1]&&!Re[tbe]},"isEnabled"),remove:a(function(Re,Je){Re===void 0&&(Re=!0);var Xe=[Ie],Ct={reason:1,isAsync:Re};Te(Xe,Ct,function(Ot){Ot&&we({reason:32,removed:Xe}),Je&&Je(Ot)})},"remove")}),se}a(Ae,"_getPlugin");function De(){if(!d){var ne=(x||[]).slice();Go(ne,A)===-1&&ne[ro](A),d=WU(V7e(ne),e.cfg,U)}return d}a(De,"_getPluginChain");function Te(ne,se,Ie){if(ne&&ne[vn]>0){var _e=WU(ne,e.cfg,U),Re=Pse(_e,U);Re[Jve](function(){var Je=!1,Xe=[];yt(f,function(Ot,$t){oJr(Ot,ne)?Je=!0:Xe[ro](Ot)}),f=Xe,D=null,k=null;var Ct=[];h&&(yt(h,function(Ot,$t){var Gt=[];yt(Ot,function(Ee){oJr(Ee,ne)?Je=!0:Gt[ro](Ee)}),Ct[ro](Gt)}),h=Ct),Ie&&Ie(Je),re()}),Re[U0](se)}else Ie(!1)}a(Te,"_removePlugins");function Z(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[vn]=0,yt(ne,function(se){var Ie={name:y||"InternalMessageId: "+se[dse],iKey:w,time:Ase(new Date),baseType:xse.dataType,baseData:{message:se[eM]}};U.track(Ie)})}}a(Z,"_flushInternalLogs");function J(ne,se,Ie,_e){var Re=1,Je=!1,Xe=null;_e=_e||5e3;function Ct(){Re--,Je&&Re===0&&(Xe&&Xe[JN](),Xe=null,se&&se(Je),se=null)}if(a(Ct,"doCallback"),m&&m[vn]>0){var Ot=ie()[XN](m);Ot.iterate(function($t){if($t.flush){Re++;var Gt=!1;$t.flush(ne,function(){Gt=!0,Ct()},Ie)||Gt||(ne&&Xe==null?Xe=xp(function(){Xe=null,Ct()},_e):Ct())}})}return Je=!0,Ct(),!0}a(J,"_flushChannels");function z(){var ne;Me(e[KN](function(se){var Ie=se.cfg.enablePerfMgr;if(Ie){var _e=se.cfg[C7e];(ne!==_e||!ne)&&(_e||(_e=lAo),x7e(se.cfg,C7e,_e),ne=_e,l=null),!c&&!l&&Mr(_e)&&(l=_e(U,U[Kve]()))}else l=null,ne=null}))}a(z,"_initPerfManager");function le(ne){var se=Abe(De(),U);se[Jve](re),(!U._updateHook||U._updateHook(se,ne)!==!0)&&se[U0](ne)}a(le,"_doUpdate");function K(ne){var se=U[ju];se?(wa(se,2,73,ne),re()):Kc(ne)}a(K,"_logOrThrowError");function ae(ne){var se=U[Kve]();se&&se[QU]([ne],2)}a(ae,"_notifyInvalidEvent");function Me(ne){v.add(ne)}a(Me,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var Lk="",mAo="NoResponseBody",cJr="&"+mAo+"=true",hNt="POST",J7e=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;bi(t,this,function(E,_){var v=!0;Q(),E[gL]=function(M,O){o=O,n&&wa(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=_se();O&&O.protocol&&O.protocol[ZW]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[vn]?R(M,O):null},E.getFallbackInst=function(){return d},E[FU]=function(M,O){Q()},E.preparePayload=function(M,O,q,F){if(!O||F||!q[z1]){M(q);return}try{var U=ki("CompressionStream");if(!Mr(U)){M(q);return}var W=new ReadableStream({start:a(function(X){X.enqueue(yi(q[z1])?new TextEncoder().encode(q[z1]):q[z1]),X.close()},"start")}),V=W.pipeThrough(new U("gzip")),G=V.getReader(),Y=[],re=0,j=!1;return ml(G.read(),a(function X(ie){if(!j&&!ie.rejected){var we=ie[AL];if(!we.done)return Y[ro](we[AL]),re+=we.value[vn],ml(G.read(),X);for(var Ae=new Uint8Array(re),De=0,Te=0,Z=Y;Te0&&(yt(Uu(Ae),function(z){j.append(z,Ae[z])}),De[ebe]=j),u?De.credentials=u:v&&s&&(De.credentials="include"),q&&(De.keepalive=!0,e+=X,s?M._sendReason===2&&(ie=!0,A&&(U+=cJr)):ie=!0);var Te=new Request(U,De);try{Te[WDt]=!0}catch{}if(!q&&r&&(G=Id(function(z,le){Y=z,re=le})),!U){w(O),Y&&Y(!1);return}function Z(z,le){le?x(O,s?0:le,{},s?Lk:z):x(O,s?0:400,{},s?Lk:z)}a(Z,"_handleError");function J(z,le,K){var ae=z[Ok],Me=c.fetchOnComplete;Me&&Mr(Me)?Me(z,O,K||Lk,le):x(O,ae,{},K||Lk)}a(J,"_onFetchComplete");try{ml(fetch(s?U:Te,s?De:null),function(z){if(q&&(e-=X,X=0),!we)if(we=!0,z.rejected)Z(z.reason&&z.reason[eM],499),re&&re(z.reason);else{var le=z[AL];try{!s&&!le.ok?(le[Ok]?Z(le.statusText,le[Ok]):Z(le.statusText,499),Y&&Y(!1)):s&&!le.body?(J(le,null,Lk),Y&&Y(!0)):ml(le.text(),function(K){J(le,M,K[AL]),Y&&Y(!0)})}catch(K){le&&le[Ok]?Z(lr(K),le[Ok]):Z(lr(K),499),re&&re(K)}}})}catch(z){we||(Z(lr(z),499),re&&re(z))}return ie&&!we&&(we=!0,x(O,200,{}),Y&&Y(!0)),s&&!we&&M[tz]>0&&y&&y.set(function(){we||(we=!0,x(O,500,{}),Y&&Y(!0))},M[tz]),G}a(L,"_doFetchSender");function B(M,O,q){var F=nf(),U=new XDomainRequest,W=M[z1];U.onload=function(){var j=nM(U),X=c&&c.xdrOnComplete;X&&Mr(X)?X(U,O,M):x(O,200,{},j)},U.onerror=function(){x(O,400,{},s?Lk:R7e(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var V=F&&F.location&&F.location.protocol||"",G=M[fse];if(!G){w(O);return}if(!s&&G.lastIndexOf(V,0)!==0){var Y="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";wa(o,2,40,". "+Y),T(Y,O);return}var re=s?G:G[Mk](/^(https?:)/,"");U.open(hNt,re),M[tz]&&(U[tz]=M[tz]),U.send(W),s&&q?y&&y.set(function(){U.send(W)},0):U.send(W)}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 mJr="on",lJr="attachEvent",uJr="addEventListener",dJr="detachEvent",fJr="removeEventListener",mNt="events",Cbe="visibilitychange",X7e="pagehide",gJr="pageshow",AJr="unload",yJr="beforeunload",EJr=XI("aiEvtPageHide"),_Jr=XI("aiEvtPageShow"),gAo=/\.[\.]+/g,AAo=/[\.]+$/,yAo=1,Z7e=O7e("events"),EAo=/^([^.]*)(?:\.(.+)|)/;function pJr(t){return t&&t[Mk]?t[Mk](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Cs):t}a(pJr,"_normalizeNamespace");function gNt(t,e){if(e){var r=Cs;cr(e)?(r=Cs,yt(e,function(o){o=pJr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=pJr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Cs)+r)}var n=EAo.exec(t||Cs)||[];return{type:n[1],ns:(n[2]||Cs).replace(gAo,".").replace(AAo,Cs)[yL](".").sort().join(".")}}a(gNt,"_getEvtNamespace");function CJr(t,e,r){r===void 0&&(r=!0);var n=Z7e.get(t,mNt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(CJr,"_getRegisteredEvents");function vJr(t,e,r,n){t&&e&&e[EL]&&(t[fJr]?t[fJr](e[EL],r,n):t[dJr]&&t[dJr](mJr+e[EL],r))}a(vJr,"_doDetach");function _Ao(t,e,r,n){var o=!1;return t&&e&&e[EL]&&r&&(t[uJr]?(t[uJr](e[EL],r,n),o=!0):t[lJr]&&(t[lJr](mJr+e[EL],r),o=!0)),o}a(_Ao,"_doAttach");function hJr(t,e,r,n){for(var o=e[vn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[DDt].ns)&&(!n||n(s))&&(vJr(t,s[DDt],s.handler,s.capture),e[JI](o,1))}}a(hJr,"_doUnregister");function CAo(t,e,r){if(e[EL])hJr(t,CJr(t,e[EL]),e,r);else{var n=Z7e.get(t,mNt,{});zr(n,function(o,s){hJr(t,s,e,r)}),Uu(n)[vn]===0&&Z7e.kill(t,mNt)}}a(CAo,"_unregisterEvents");function KU(t,e){var r;return e?(cr(e)?r=[t].concat(e):r=[t,e],r=gNt("xx",r).ns[yL](".")):r=t,r}a(KU,"mergeEvtNamespace");function Ebe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=gNt(e,n);if(s=_Ao(t,c,r,o),s&&Z7e.accept(t)){var l={guid:yAo++,evtName:c,handler:r,capture:o};CJr(t,c.type)[ro](l)}}catch{}return s}a(Ebe,"eventOn");function _be(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=gNt(e,n),c=!1;CAo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||vJr(t,s,r,o)}catch{}}a(_be,"eventOff");function ANt(t,e,r){var n=!1,o=nf();o&&(n=Ebe(o,t,e,r),n=Ebe(o.body,t,e,r)||n);var s=rf();return s&&(n=Ebe(s,t,e,r)||n),n}a(ANt,"addEventHandler");function yNt(t,e,r){var n=nf();n&&(_be(n,t,e,r),_be(n.body,t,e,r));var o=rf();o&&_be(o,t,e,r)}a(yNt,"removeEventHandler");function Nse(t,e,r,n){var o=!1;return e&&t&&t[vn]>0&&yt(t,function(s){s&&(!r||Go(r,s)===-1)&&(o=ANt(s,e,n)||o)}),o}a(Nse,"_addEventListeners");function ENt(t,e,r,n){var o=!1;return e&&t&&cr(t)&&(o=Nse(t,e,r,n),!o&&r&&r[vn]>0&&(o=Nse(t,e,null,n))),o}a(ENt,"addEventListeners");function cz(t,e,r){t&&cr(t)&&yt(t,function(n){n&&yNt(n,e,r)})}a(cz,"removeEventListeners");function eQe(t,e,r){return ENt([yJr,AJr,X7e],t,e,r)}a(eQe,"addPageUnloadEventListener");function tQe(t,e){cz([yJr,AJr,X7e],t,e)}a(tQe,"removePageUnloadEventListener");function vbe(t,e,r){function n(c){var l=rf();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=KU(EJr,r),s=Nse([X7e],t,e,o);return(!e||Go(e,Cbe)===-1)&&(s=Nse([Cbe],n,e,o)||s),!s&&e&&(s=vbe(t,null,r)),s}a(vbe,"addPageHideEventListener");function rQe(t,e){var r=KU(EJr,e);cz([X7e],t,r),cz([Cbe],null,r)}a(rQe,"removePageHideEventListener");function bbe(t,e,r){function n(c){var l=rf();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=KU(_Jr,r),s=Nse([gJr],t,e,o);return s=Nse([Cbe],n,e,o)||s,!s&&e&&(s=bbe(t,null,r)),s}a(bbe,"addPageShowEventListener");function nQe(t,e){var r=KU(_Jr,e);cz([gJr],t,r),cz([Cbe],null,r)}a(nQe,"removePageShowEventListener");p();var Mse="",bJr="https://browser.events.data.microsoft.com/OneCollector/1.0/",_Nt="version",iQe="properties";p();p();var CNt="initialize",vNt="indexOf",aM="timings",bNt="pollInternalLogs",J1="value",oQe="length",sQe="processTelemetryStart";var bL,SJr="4.3.10",Sbe="1DS-Web-JS-"+SJr,TJr=ove.hasOwnProperty;var PAo=(bL={},bL[0]=0,bL[2]=6,bL[1]=1,bL[3]=7,bL[4098]=6,bL[4097]=1,bL[4099]=7,bL);var DAo=YB(),NAo=Soe();function tx(t){return!(t===Mse||Zt(t))}a(tx,"isValueAssigned");function SNt(t){if(t){var e=nu(t,"-");if(e>-1)return ON(t,e)}return Mse}a(SNt,"getTenantId");function TNt(t){return!!(t&&Eh(t)&&t>=1&&t<=4)}a(TNt,"isLatency");function INt(t,e,r){if(!e&&!tx(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||cr(e))e={value:e};else if(n==="object"&&!TJr.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Zt(e[J1])||e[J1]===Mse||!yi(e[J1])&&!Eh(e[J1])&&!vk(e[J1])&&!cr(e[J1]))return null;if(cr(e[J1])&&!xJr(e[J1]))return null;if(!Zt(e.kind)){if(cr(e[J1])||!IJr(e.kind))return null;e[J1]=e[J1].toString()}return e}a(INt,"sanitizeProperty");function Tbe(t,e,r){var n=-1;if(!Pn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),MAo(r))n===-1&&(n=0),n|=r;else{var o=PAo[aQe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(Tbe,"getCommonSchemaMetaData");function Ose(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[oQe],d=arguments;for(vk(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(IJr,"isValueKind");function MAo(t){return t>=0&&t<=9}a(MAo,"isDataType");function xJr(t){return t[oQe]>0}a(xJr,"isArrayValid");function cQe(t,e){var r=t;r[aM]=r[aM]||{},r[aM][sQe]=r[aM][sQe]||{},r[aM][sQe][e]=Z1()}a(cQe,"setProcessTelemetryTimings");function aQe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===GI&&(e=4,cr(t)?(e=4096,t[oQe]>0&&(e|=aQe(t[0]))):TJr.call(t,"value")&&(e=8192|aQe(t[J1])))}return e}a(aQe,"getFieldValueType");function xNt(){return!!ki("chrome")}a(xNt,"isChromium");function lz(t){return t>0}a(lz,"isGreaterThanZero");var OAo=a_({endpointUrl:bJr,propertyStorageOverride:{isVal:BAo}});function BAo(t){return t&&(!t.getProperty||!t.setProperty)&&Kc("Invalid property storage override passed."),!0}a(BAo,"_chkPropOverride");var wNt=(function(t){Iy(e,t);function e(){var r=t.call(this)||this;return bi(e,r,function(n,o){n[CNt]=function(s,c,l,u){Pp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[CNt](kp(s,OAo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=lr(h);f[vNt]("channels")!==-1&&(f+=` - - Channels must be provided through config.channels only!`),wa(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){Pp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[aM]=c[aM]||{},c[aM].trackStart=Z1(),TNt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=Sbe;var u=c.baseData=c.baseData||{};u[iQe]=u[iQe]||{};var d=u[iQe];d[_Nt]=d[_Nt]||n.pluginVersionString||Mse}o.track(c)},function(){return{item:s}},!s.sync)},n[bNt]=function(s){return o[bNt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(K7e);p();p();var Ibe="REAL_TIME",wJr="NEAR_REAL_TIME",RJr="BEST_EFFORT";p();p();p();var Fk="";var lQe="drop",kJr="send",RNt="requeue",PJr="rspFail",DJr="oth",kNt="no-cache, no-store",uQe="application/x-json-stream",xbe="cache-control",Bse="content-type",NJr="kill-tokens",MJr="kill-duration";var OJr="time-delta-millis",dQe="client-version",PNt="client-id",fQe="time-delta-to-apply-millis",pQe="upload-time",hQe="apikey",wbe="AuthMsaDeviceTicket",DNt="WebAuthToken",NNt="AuthXToken";var BJr="NoResponseBody",Lse="msfpc",MNt="trace",mQe="user";p();var Rbe="allowRequestSending",gQe="shouldAddClockSkewHeaders",AQe="getClockSkewHeaderValue",kbe="setClockSkew",$o="length",cM="concat",X1="iKey",Qf="count",lM="events",Q0="push",uM="split",yQe="toLowerCase",uz="hdrs",EQe="useHdrs",dz="initialize",_Qe="setTimeoutOverride",CQe="clearTimeoutOverride",LJr="payloadPreprocessor",ONt="overrideEndpointUrl",BNt="avoidOptions",FJr="disableEventTimings",vQe="enableCompoundKey",LNt="disableXhrSync",FNt="disableFetchKeepAlive",UJr="addNoResponse",UNt="useSendBeacon",QNt="fetchCredentials",qNt="alwaysUseXhrOverride",bQe="serializeOfflineEvt",SQe="getOfflineRequestDetails",TQe="createPayload",Pbe="createOneDSPayload",jNt="payloadBlob",Uk="headers",Fse="_thePayload",ky="batches",cv="sendType",Dbe="canSendRequest",Use="sendQueuedRequests",Nbe="setUnloading",QJr="isTenantKilled",IQe="sendSynchronousBatch",xQe="_transport",Qse="getWParam",HNt="isBeacon",Mbe="timings",wQe="isTeardown",RQe="_sendReason",kQe="setKillSwitchTenants",PQe="_backOffTransmission",Obe="identifier",qJr="ignoreMc1Ms0CookieProcessing",GNt="autoFlushEventsLimit",jJr="disableAutoBatchFlushLimit",HJr="overrideInstrumentationKey",Bbe="sendAttempt",JU="latency",fz="sync";function $Jr(t){var e=(t.ext||{}).intweb;return e&&tx(e[Lse])?e[Lse]:null}a($Jr,"_getEventMsfpc");function GJr(t){for(var e=null,r=0;e===null&&rhl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var FAo=.8,UAo=1.2,zJr=3e3,QAo=6e5;function YJr(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(YJr,"retryPolicyShouldRetryForStatus");function DQe(t){var e=0,r=zJr*FAo,n=zJr*UAo,o=B1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,rU(e,QAo)}a(DQe,"retryPolicyGetMillisToBackoffForRetry");p();var qAo=20,jAo=3145728,JJr=65e3,ZJr=2e6,HAo=rU(ZJr,JJr),KJr="metadata",NQe="f",GAo=/\./,XJr=(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||Tbe,_=$Ao(l),v=MQe(_.requestLimit,jAo,0),b=MQe(_.requestLimit,JJr,1),T=MQe(_.recordLimit,ZJr,0),w=Math.min(MQe(_.recordLimit,HAo,1),b);bi(t,this,function(R){R.createPayload=function(D,N,L,B,Q,M){return{apiKeys:[],payloadBlob:Fk,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&&Pp(e,function(){return"Serializer:appendPayload"},function(){for(var Q=N.events(),M=D.payloadBlob,O=D.numEvents,q=!1,F=[],U=[],W=D.isBeacon,V=W?b:v,G=W?w:T,Y=0,re=0;Y=L){D.overflow=N.split(Y);break}var X=R.getEventBlob(j);if(X&&X.length<=G){var ie=X.length,we=M.length;if(we+ie>V){D.overflow=N.split(Y);break}M&&(M+=` -`),M+=X,re++,re>qAo&&(Y9e(M,0,1),re=0),q=!0,O++}else X?F.push(j):U.push(j),Q.splice(Y,1),Y--}Y++}if(F.length>0&&D.sizeExceed.push(ZU.create(N.iKey(),F)),U.length>0&&D.failedEvts.push(ZU.create(N.iKey(),U)),q){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var Ae=N.iKey();Go(D.apiKeys,Ae)===-1&&D.apiKeys.push(Ae)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Pp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+SNt(D.iKey);var L={},B;y||(B=a(function(q,F,U){VAo(E,L,q,F,U)},"_addMetadataCallback"));var Q=D[f];Q&&(N[f]=L,zr(Q,function(q,F){var U=L[q]={};k(F,U,"ext."+q,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return k(D.baseData,O,d,!1,[d],B,m),k(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=Ioe(D,"ext.metadata")||Ioe(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function k(D,N,L,B,Q,M,O){zr(D,function(q,F){var U=null;if(F||tx(F)){var W=L,V=q,G=Q,Y=N;if(h&&!B&&GAo.test(q)){var re=q.split("."),j=re.length;if(j>1){G&&(G=G.slice());for(var X=0;X0&&n<=e)return n}return e}a(MQe,"_validateSizeLimit");function $Ao(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a($Ao,"_getSizeLimtCfg");function VAo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[KJr];c||(c=e[KJr]={f:{}});var l=c[NQe];if(l||(l=c[NQe]={}),r)for(var u=0;u0)for(var o=e[yQe](),s=0;s0&&(n&&VNt[e]?(t[uz][VNt[e]]=r,t[EQe]=!0):t.url+="&"+e+"="+r)}a(jse,"_addRequestDetails");function KAo(t,e,r){for(var n=0;n=0&&F.splice(He,1)},"rm")}},j[bQe]=function(xe){try{if(b)return b.getEventBlob(xe)}catch{}return Fk},j[SQe]=function(){try{var xe=b&&b[TQe](0,!1,!1,!1,1,0);return _e(xe,x)}catch{}return null},j[Pbe]=function(xe,He){try{var Ze=[];yt(xe,function(pe){He&&(pe=rM(pe));var ke=ZU.create(pe[X1],[pe]);Ze[Q0](ke)});for(var at=null;Ze[$o]>0&&b;){var ct=Ze.shift();ct&&ct[Qf]()>0&&(at=at||b[TQe](0,!1,!1,!1,1,0),b.appendPayload(at,ct,re))}var ut=_e(at,x),ee={data:at[jNt],urlString:ut.url,headers:ut[uz],timeout:k,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(OQe(ee[Uk],xbe)||(ee[Uk][xbe]=kNt),OQe(ee[Uk],Bse)||(ee[Uk][Bse]=uQe)),ee}catch{}return null};function ie(xe,He){try{return G&&G.getSenderInst(xe,He)}catch{}return null}a(ie,"_getSenderInterface"),j._getDbgPlgTargets=function(){return[g[0],c,b,g,we(),s,re]};function we(){try{var xe={xdrOnComplete:Ae,fetchOnComplete:Te,xhrOnComplete:Z,beaconOnRetry:z},He={enableSendPromise:!1,isOneDs:!0,disableCredentials:!X,fetchCredentials:Y,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:W,addNoResponse:Q,senderOnCompleteCallBack:xe};return He}catch{}return null}a(we,"_getSendPostMgrConfig");function Ae(xe,He,Ze){var at=nM(xe);J(He,200,{},at),Qe(at)}a(Ae,"_xdrOncomplete");function De(){var xe;s=null,c=new WJr,l=!1,u=new VJr,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,k=xe,N=xe,L=xe,B=xe,Q=xe,M=[],O=xe,q=xe,F=[],U=!1,W=qse(),V=!1,G=null,re=null}a(De,"_initDefaults");function Te(xe,He,Ze,at){var ct=a(function(pe,ke,Le){J(He,pe,ke,Le),Qe(Le)},"handleResponse"),ut={},ee=xe[Uk];ee&&ee.forEach(function(pe,ke){ut[ke]=pe}),ct(xe.status,ut,Ze||Fk)}a(Te,"_fetchOnComplete");function Z(xe,He,Ze){var at=nM(xe);J(He,xe.status,GU(xe,!0),at),Qe(at)}a(Z,"_xhrOnComplete");function J(xe,He,Ze,at){try{xe(He,Ze,at)}catch(ct){wa(m,2,518,lr(ct))}}a(J,"_doOnComplete");function z(xe,He,Ze){var at=xe,ct=200,ut=at[Fse],ee=xe.urlString+(Q?WAo:Fk);try{var pe=Qu();if(ut){var ke=!!A.getPlugin("LocalStorage"),Le=[],Ve=[];yt(ut[ky],function(tt){if(Le&&tt&&tt[Qf]()>0)for(var vt=tt[lM](),Nt=0;Nt0&&(ut.sentEvts=Ve),ke||nt(Le,8003,ut[cv],!0)}else ct=0}catch(tt){oM(m,"Failed to send telemetry using sendBeacon API. Ex:"+lr(tt)),ct=0}finally{J(He,ct,{},Fk)}}a(z,"_onBeaconRetry");function le(xe){return xe===2||xe===3}a(le,"_isBeaconPayload");function K(xe){return R&&le(xe)&&(xe=2),xe}a(K,"_adjustSendType"),j.addHeader=function(xe,He){_[xe]=He},j.removeHeader=function(xe){delete _[xe]},j[Dbe]=function(){return ae()&&u[Rbe]()},j[Use]=function(xe,He){Pn(xe)&&(xe=0),R&&(xe=K(xe),He=2),ne(v,xe,0)&&Ie(Me(),0,!1,xe,He||0)},j.isCompletelyIdle=function(){return!l&&f===0&&v[$o]===0},j[Nbe]=function(xe){R=xe},j.addBatch=function(xe){if(xe&&xe[Qf]()>0){if(c.isTenantKilled(xe[X1]()))return!1;v[Q0](xe)}return!0},j.teardown=function(){v[$o]>0&&Ie(Me(),0,!0,2,2),yt(M,function(xe){xe&&xe.rm&&xe.rm()}),M=[]},j.pause=function(){l=!0},j.resume=function(){l=!1,j[Use](0,4)},j[IQe]=function(xe,He,Ze){xe&&xe[Qf]()>0&&(Zt(He)&&(He=1),R&&(He=K(He),Ze=2),Ie([xe],0,!1,He,Ze||0))};function ae(){return!l&&f0&&!l&&g[He]&&b&&(at=He!==0||ae()&&(Ze>0||u[Rbe]())),at}a(ne,"_canSendPayload");function se(xe){var He={};return xe&&yt(xe,function(Ze,at){He[at]={iKey:Ze[X1](),evts:Ze[lM]()}}),He}a(se,"_createDebugBatches");function Ie(xe,He,Ze,at,ct){if(!(!xe||xe[$o]===0)){if(l){nt(xe,1,at);return}at=K(at);try{var ut=xe,ee=at!==0;Pp(A,function(){return"HttpManager:_sendBatches"},function(pe){pe&&(xe=xe.slice(0));for(var ke=[],Le=null,Ve=Z1(),tt=g[at]||(ee?g[1]:g[0]),vt=tt&&tt[xQe],Nt=B&&(R||le(at)||vt===3||tt._isSync&&vt===2);ne(xe,at,He);){var Vt=xe.shift();Vt&&Vt[Qf]()>0&&(c.isTenantKilled(Vt[X1]())?ke[Q0](Vt):(Le=Le||b[TQe](He,Ze,ee,Nt,ct,at),b.appendPayload(Le,Vt,re)?Le.overflow!==null&&(xe=[Le.overflow][cM](xe),Le.overflow=null,Je(Le,Ve,Z1(),ct),Ve=Z1(),Le=null):(Je(Le,Ve,Z1(),ct),Ve=Z1(),xe=[Vt][cM](xe),Le=null)))}Le&&Je(Le,Ve,Z1(),ct),xe[$o]>0&&(v=xe[cM](v)),nt(ke,8004,at)},function(){return{batches:se(ut),retryCount:He,isTeardown:Ze,isSynchronous:ee,sendReason:ct,useSendBeacon:le(at),sendType:at}},!ee)}catch(pe){wa(m,2,48,"Unexpected Exception sending batch: "+lr(pe))}}}a(Ie,"_sendBatches");function _e(xe,He){var Ze={url:s,hdrs:{},useHdrs:!1};He?(Ze[uz]=Ose(Ze[uz],_),Ze.useHdrs=Uu(Ze.hdrs)[$o]>0):zr(_,function(pe,ke){WNt[pe]?jse(Ze,WNt[pe],ke,!1):(Ze[uz][pe]=ke,Ze[EQe]=!0)}),jse(Ze,PNt,"NO_AUTH",He),jse(Ze,dQe,Sbe,He);var at=Fk;yt(xe.apiKeys,function(pe){at[$o]>0&&(at+=","),at+=pe}),jse(Ze,hQe,at,He),jse(Ze,pQe,hl().toString(),He);var ct=Ee(xe);if(tx(ct)&&(Ze.url+="&ext.intweb.msfpc="+ct),u[gQe]()&&jse(Ze,fQe,u[AQe](),He),A[Qse]){var ut=A[Qse]();ut>=0&&(Ze.url+="&w="+ut)}for(var ee=0;ee0){var ct=!!O,ut=g[xe.sendType];!le(xe[cv])&&xe[HNt]&&xe.sendReason===2&&(ut=g[2]||g[3]||ut);var ee=x;(xe.isBeacon||ut[xQe]===3)&&(ee=!1);var pe=_e(xe,ee);ee=ee||pe[EQe];var ke=Z1();Pp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Le=0;Le0?Nt[$Nt]++:Nt[$Nt]=1}nt(xe[ky],1e3+(at||0),xe[cv],!0);var It={data:xe[jNt],urlString:pe.url,headers:pe[uz],_thePayload:xe,_sendReason:at,timeout:k,disableXhrSync:N,disableFetchKeepAlive:L};ee&&(OQe(It[Uk],xbe)||(It[Uk][xbe]=kNt),OQe(It[Uk],Bse)||(It[Uk][Bse]=uQe));var Be=null;ut&&(Be=a(function(oe){u.firstRequestSent();var ve=a(function(de,te){Ct(de,te,xe,at)},"onComplete"),Se=xe[wQe]||xe.isSync;G.preparePayload(function(de){try{ut.sendPOST(de,ve,Se),q&&q(It,de,Se,xe[HNt])}catch(te){J(ve,0,{}),oM(m,"Unexpected exception sending payload. Ex:"+lr(te))}},D,oe,Se)},"sender")),Pp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(Be)if(xe[cv]===0&&f++,ct&&!xe.isBeacon&&ut[xQe]!==3){var oe={data:It.data,urlString:It.urlString,headers:Ose({},It[Uk]),timeout:It.timeout,disableXhrSync:It[LNt],disableFetchKeepAlive:It[FNt]},ve=!1;Pp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(oe,function(Se){ve=!0,!y&&!Se[Fse]&&(Se[Fse]=Se[Fse]||It[Fse],Se[RQe]=Se[RQe]||It[RQe]),Be(Se)},xe.isSync||xe[wQe])}catch{ve||Be(It)}})}else Be(It)})},function(){return{thePayload:xe,serializationStart:He,serializationCompleted:Ze,sendReason:at}},xe.isSync)}xe.sizeExceed&&xe.sizeExceed[$o]>0&&nt(xe.sizeExceed,8003,xe[cv]),xe.failedEvts&&xe.failedEvts[$o]>0&&nt(xe.failedEvts,8002,xe[cv])}a(Je,"_doPayloadSend");function Xe(xe,He){T&&yt(xe,function(Ze){var at=Ze[Mbe]=Ze[Mbe]||{};Re(at,"sendEventCompleted",He)})}a(Xe,"_addEventCompletedTimings");function Ct(xe,He,Ze,at){var ct=9e3,ut=null,ee=!1,pe=!1;try{var ke=!0;if(typeof xe!==q1){if(He){u[kbe](He[OJr]);var Le=He[MJr]||He["kill-duration-seconds"];yt(c[kQe](He[NJr],Le),function(tt){yt(Ze[ky],function(vt){if(vt[X1]()===tt){ut=ut||[];var Nt=vt[uM](0);Ze.numEvents-=Nt[Qf](),ut[Q0](Nt)}})})}if(xe==200||xe==204){ct=200;return}(!YJr(xe)||Ze.numEvents<=0)&&(ke=!1),ct=9e3+xe%1e3}if(ke){ct=100;var Ve=Ze.retryCnt;Ze[cv]===0&&(Ve0&&Xe(Ze[lM](),He)})}}a($t,"_addCompleteTimings");function Gt(xe,He,Ze){He?xe():W.set(xe,Ze)}a(Gt,"_doAction");function Ee(xe){for(var He=0;He0&&o){var ct=o[mt(He)];if(ct){var ut=Ze!==0;Pp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Gt(function(){try{ct.call(o,xe,He,ut,Ze)}catch(ee){wa(m,1,74,"send request notification failed: "+ee)}},at||ut,0)},function(){return{batches:se(xe),reason:He,isSync:ut,sendSync:at,sendType:Ze}},!ut)}}}a(nt,"_sendBatchesNotification");function mt(xe){var He=YAo[xe];return tx(He)||(He=DJr,xe>=9e3&&xe<=9999?He=PJr:xe>=8e3&&xe<=8999?He=lQe:xe>=1e3&&xe<=1999&&(He=kJr)),He}a(mt,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var ZAo=.25,nZr=500,XAo=20,iZr=6,oZr=2,eyo=4,tZr=2,tyo=1,zNt=1e4,mz="eventsDiscarded",rZr="",Th=void 0,ryo=a_({eventsLimitInMem:{isVal:lz,v:zNt},immediateEventLimit:{isVal:lz,v:500},autoFlushEventsLimit:{isVal:lz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:nyo,v:Th},overrideInstrumentationKey:Th,overrideEndpointUrl:Th,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Th,clearTimeoutOverride:Th,payloadPreprocessor:Th,payloadListener:Th,disableEventTimings:Th,valueSanitizer:Th,stringifyObjects:Th,enableCompoundKey:Th,disableOptimizeObj:!1,fetchCredentials:Th,transports:Th,unloadTransports:Th,useSendBeacon:Th,disableFetchKeepAlive:Th,avoidOptions:!1,xhrTimeout:Th,disableXhrSync:Th,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Eh,v:iZr},maxUnloadEventRetryAttempts:{isVal:Eh,v:oZr},addNoResponse:Th,maxEvtPerBatch:{isVal:Eh,v:nZr},excludeCsMetaData:Th,requestLimit:{}});function nyo(t){return t&&t.sendPOST}a(nyo,"isOverrideFn");var YNt=(function(t){Iy(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=Ibe,A,y,E,_,v,b,T,w,R,x,k,D,N,L,B,Q,M,O,q,F,U,W,V;return bi(e,r,function(G,Y){le(),G._getDbgPlgTargets=function(){return[v,n]},G[dz]=function(ee,pe,ke){Pp(pe,function(){return"PostChannel:initialize"},function(){Y[dz](ee,pe,ke),q=pe.getNotifyMgr();try{B=KU(XI(G[Obe]),pe.evtNamespace&&pe.evtNamespace()),G._addHook(K1(ee,function(Le){var Ve=Le.cfg,tt=ex(null,Ve,pe);n=tt.getExtCfg(G[Obe],ryo),Q=qse(n[_Qe],n[CQe]),k=!n.disableOptimizeObj&&xNt(),M=n[qJr],j(pe),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[GNt],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[jJr],V=n.maxEvtPerBatch,Lm(Ve.endpointUrl)?G.pause():l&&G.resume(),ut(),U=n[HJr],W=!!n.disableTelemetry,F&&re();var vt=Ve.disablePageUnloadEvents||[];F=eQe(we,vt,B),F=vbe(we,vt,B)||F,F=bbe(Ae,Ve.disablePageShowEvents,B)||F})),v[dz](ee,G.core,G)}catch(Le){throw G.setInitialized(!1),Le}},function(){return{theConfig:ee,core:pe,extensions:ke}})},G.processTelemetry=function(ee,pe){cQe(ee,G[Obe]),pe=pe||G._getTelCtx(pe);var ke=ee;!W&&!o&&(U&&(ke[X1]=U),Te(ke,!0),D?Me(2,2):z()),G.processNext(ke,pe)},G.getOfflineSupport=function(){try{var ee=v&&v[SQe]();if(v)return{getUrl:a(function(){return ee?ee.url:null},"getUrl"),serialize:ie,batch:X,shouldProcess:a(function(pe){return!W},"shouldProcess"),createPayload:a(function(pe){return null},"createPayload"),createOneDSPayload:a(function(pe){if(v[Pbe])return v[Pbe](pe,k)},"createOneDSPayload")}}catch{}return null},G._doTeardown=function(ee,pe){Me(2,2),o=!0,v.teardown(),re(),le()};function re(){tQe(null,B),rQe(null,B),nQe(null,B)}a(re,"_removeUnloadHandlers");function j(ee){var pe=ee[Qse];ee[Qse]=function(){var ke=0;return M&&(ke=ke|2),ke|pe.call(ee)}}a(j,"_hookWParam");function X(ee){var pe=rZr;return ee&&ee[$o]&&yt(ee,function(ke){pe&&(pe+=` -`),pe+=ke}),pe}a(X,"_batch");function ie(ee){var pe=rZr;try{De(ee),pe=v[bQe](ee)}catch{}return pe}a(ie,"_serialize");function we(ee){var pe=ee||nf().event;pe.type!=="beforeunload"&&(D=!0,v[Nbe](D)),Me(2,2)}a(we,"_handleUnloadEvents");function Ae(ee){D=!1,v[Nbe](D)}a(Ae,"_handleShowEvents");function De(ee){ee.ext&&ee.ext[MNt]&&delete ee.ext[MNt],ee.ext&&ee.ext[mQe]&&ee.ext[mQe].id&&delete ee.ext[mQe].id,k&&(ee.ext=rM(ee.ext),ee.baseData&&(ee.baseData=rM(ee.baseData)),ee.data&&(ee.data=rM(ee.data)))}a(De,"_cleanEvent");function Te(ee,pe){if(ee[Bbe]||(ee[Bbe]=0),ee[JU]||(ee[JU]=1),De(ee),ee[fz]){if(E||l)ee[JU]=3,ee[fz]=!1;else if(v){k&&(ee=rM(ee)),v[IQe](ZU.create(ee[X1],[ee]),ee[fz]===!0?1:ee[fz],3);return}}var ke=ee[JU],Le=f,Ve=h;ke===4&&(Le=u,Ve=d);var tt=!1;if(Leee;if(!ke&&w>0)for(var Le=1;!ke&&Le<=3;Le++){var Ve=b[Le];Ve&&Ve[ky]&&yt(Ve[ky],function(tt){tt&&tt[Qf]()>=w&&(ke=!0)})}Ie(!0,ke)},G.pause=function(){ae(),l=!0,v&&v.pause()},G.resume=function(){l=!1,v&&v.resume(),z()},G._loadTransmitProfiles=function(ee){$t(),zr(ee,function(pe,ke){var Le=ke[$o];if(Le>=2){var Ve=Le>2?ke[2]:0;if(ke.splice(0,Le-2),ke[1]<0&&(ke[0]=-1),ke[1]>0&&ke[0]>0){var tt=ke[0]/ke[1];ke[0]=VWr(tt)*ke[1]}Ve>=0&&ke[1]>=0&&Ve>ke[1]&&(Ve=ke[1]),ke[Q0](Ve),m[pe]=ke}})},G.flush=function(ee,pe,ke){ee===void 0&&(ee=!0);var Le;if(!l)if(ke=ke||1,ee)pe||(Le=Id(function(tt){pe=tt})),c==null?(ae(),Xe(1,0,ke),c=K(function(){c=null,Ct(pe,ke)},0)):s[Q0](pe);else{var Ve=ae();Z(1,1,ke),pe&&pe(),Ve&&z()}return Le},G.setMsaAuthTicket=function(ee){v.addHeader(wbe,ee)},G.setAuthPluginHeader=function(ee){v.addHeader(DNt,ee)},G.removeAuthPluginHeader=function(){v.removeHeader(DNt)},G.hasEvents=J,G._setTransmitProfile=function(ee){g!==ee&&m[ee]!==void 0&&(ae(),g=ee,z())},HU(G,function(){return v},["addResponseHandler"]);function Z(ee,pe,ke){var Le=Xe(ee,pe,ke);return v[Use](pe,ke),Le}a(Z,"_sendEventsForLatencyAndAbove");function J(){return f>0}a(J,"_hasEvents");function z(){if(R>=0&&Xe(R,0,x)&&v[Use](0,x),u>0&&!y&&!l){var ee=m[g][2];ee>=0&&(y=K(function(){y=null,Z(4,0,1),z()},ee))}var pe=m[g][1];!A&&!c&&pe>=0&&!l&&(J()?A=K(function(){A=null,Z(_===0?3:1,0,1),_++,_%=2,z()},pe):_=0)}a(z,"_scheduleTimer"),G[PQe]=function(){E0&&f>T&&(pe=!0),pe&&c==null&&G.flush(ee,function(){},20))}a(Ie,"_performAutoFlush");function _e(ee,pe){k&&(ee=rM(ee));var ke=ee[JU],Le=se(ee[X1],ke,!0);return Le.addEvent(ee)?(ke!==4?(f++,pe&&ee[Bbe]===0&&Ie(!ee.sync,w>0&&Le[Qf]()>=w)):u++,!0):!1}a(_e,"_addEventToProperQueue");function Re(ee,pe,ke,Le){for(;ke<=pe;){var Ve=se(ee,pe,!0);if(Ve&&Ve[Qf]()>0){var tt=Ve[uM](0,Le),vt=tt[Qf]();if(vt>0)return ke===4?u-=vt:f-=vt,mt(mz,[tt],YN.QueueFull),!0}ke++}return Je(),!1}a(Re,"_dropEventWithLatencyOrLess");function Je(){for(var ee=0,pe=0,ke=a(function(Ve){var tt=b[Ve];tt&&tt[ky]&&yt(tt[ky],function(vt){Ve===4?ee+=vt[Qf]():pe+=vt[Qf]()})},"_loop_1"),Le=1;Le<=4;Le++)ke(Le);f=pe,u=ee}a(Je,"_resetQueueCounts");function Xe(ee,pe,ke){var Le=!1,Ve=pe===0;return!Ve||v[Dbe]()?Pp(G.core,function(){return"PostChannel._queueBatches"},function(){for(var tt=[],vt=4;vt>=ee;){var Nt=b[vt];Nt&&Nt.batches&&Nt.batches[$o]>0&&(yt(Nt[ky],function(Vt){v.addBatch(Vt)?Le=Le||Vt&&Vt[Qf]()>0:tt=tt[cM](Vt[lM]()),vt===4?u-=Vt[Qf]():f-=Vt[Qf]()}),Nt[ky]=[],Nt.iKeyMap={}),vt--}tt[$o]>0&&nt(mz,tt,YN.KillSwitch),Le&&R>=ee&&(R=-1,x=0)},function(){return{latency:ee,sendType:pe,sendReason:ke}},!Ve):(R=R>=0?rU(R,ee):ee,x=bk(x,ke)),Le}a(Xe,"_queueBatches");function Ct(ee,pe){Z(1,0,pe),Je(),Ot(function(){ee&&ee(),s[$o]>0?c=K(function(){c=null,Ct(s.shift(),pe)},0):(c=null,z())})}a(Ct,"_flushImpl");function Ot(ee){v.isCompletelyIdle()?ee():c=K(function(){c=null,Ot(ee)},ZAo)}a(Ot,"_waitForIdleManager");function $t(){ae(),Gt(),g=Ibe,z()}a($t,"_resetTransmitProfiles");function Gt(){m={},m[Ibe]=[2,1,0],m[wJr]=[6,3,0],m[RJr]=[18,9,0]}a(Gt,"_initializeProfiles");function Ee(ee,pe){var ke=[],Le=N;D&&(Le=L),yt(ee,function(Ve){Ve&&Ve[Qf]()>0&&yt(Ve[lM](),function(tt){tt&&(tt[fz]&&(tt[JU]=4,tt[fz]=!1),tt[Bbe]0&&nt(mz,ke,YN.NonRetryableStatus),D&&Me(2,2)}a(Ee,"_requeueEvents");function Qe(ee,pe){var ke=q||{},Le=ke[ee];if(Le)try{Le.apply(ke,pe)}catch(Ve){wa(G.diagLog(),1,74,ee+" notification failed: "+Ve)}}a(Qe,"_callNotification");function nt(ee,pe){for(var ke=[],Le=2;Le0&&Qe(ee,[pe][cM](ke))}a(nt,"_notifyEvents");function mt(ee,pe){for(var ke=[],Le=2;Le0&&yt(pe,function(Ve){Ve&&Ve[Qf]()>0&&Qe(ee,[Ve.events()][cM](ke))})}a(mt,"_notifyBatchEvents");function xe(ee,pe,ke){ee&&ee[$o]>0&&Qe("eventsSendRequest",[pe>=1e3&&pe<=1999?pe-1e3:0,ke!==!0])}a(xe,"_sendingEvent");function He(ee,pe){mt("eventsSent",ee,pe),z()}a(He,"_eventsSentEvent");function Ze(ee,pe){mt(mz,ee,pe>=8e3&&pe<=8999?pe-8e3:YN.Unknown)}a(Ze,"_eventsDropped");function at(ee){mt(mz,ee,YN.NonRetryableStatus),z()}a(at,"_eventsResponseFail");function ct(ee,pe){mt(mz,ee,YN.Unknown),z()}a(ct,"_otherEvent");function ut(){O?w=0:w=bk(V*(tZr+1),h/6)}a(ut,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Dse);var eS=ce(require("os"));var BQe=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=iyo(e),this.commonProperties=oyo(e),this.#e=Es(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new wNt,n=new YNt,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){Dr.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){Dr.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){Dr.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(ar).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function iyo(t){let e={},r=t.get(Fa);e["ai.session.id"]=r.sessionId;let n=t.get(Nf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${eS.type()} ${eS.release()}`,e["ai.device.osArchitecture"]=eS.arch(),e["ai.device.osPlatform"]=eS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ss).getVersion(),e}a(iyo,"getTags");function oyo(t){let e={};e.common_os=eS.platform(),e.common_platformversion=eS.release(),e.common_arch=eS.arch(),e.common_cpu=Array.from(new Set(eS.cpus().map(n=>n.model))).join();let r=t.get(Fa);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(oyo,"getCommonProperties");var syo="7d7048df-6dd0-4048-bb23-b716c1461f8f",ayo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",cyo="f0000000-0000-0000-0000-000000000000",lyo="b73649cf-ca8f-4768-9e0e-b789d8529db5",uyo="5fb6107a-6a29-423f-a824-22e3724fa2a6",dyo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function fyo(t){return J9(t)==="prod"?lyo:uyo}a(fyo,"getMsftInstrumentationKey");function sZr(t){return new URL(t).hostname==="github.com"?cW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(sZr,"getEndpointForServerUrl");var Ih=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=sZr(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];Es(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(k0);if(o.setReporter(new JW(r,this.namespace,{instrumentationKey:syo,endpointUrl:n})),o.setRestrictedReporter(new JW(r,this.namespace,{instrumentationKey:ayo,endpointUrl:n})),o.setFTReporter(new JW(r,this.namespace,{instrumentationKey:cyo,endpointUrl:n,includeAuthorizationHeader:!0})),o.setMsftReporter(new JW(r,`copilot/${this.namespace}`,{instrumentationKey:fyo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new BQe(r,"ThirdParty.copilot-chat",dyo,!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(k0);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(k0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=sZr(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function pyo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Td(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(Ih).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return Jg.exception(t,n,"signUpLimited failed"),!1}}a(pyo,"apiFetchSignUpLimited");async function JNt(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 pyo(t,e)?JNt(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(JNt,"getTokenWithSignUpLimited");p();p();var aZr=ce(ti());var no=class extends aZr.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var hyo={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},Mn=class{constructor(){this.capabilities={...hyo};this.emitter=new no;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 SL=require("fs"),Hse=require("os"),Gse=ce(require("path")),XU=require("process");var Si=class{static{a(this,"PersistenceManager")}},ZNt=class extends Si{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 SL.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Gse.dirname(s);c!==this.directory&&await SL.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await Lbe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await SL.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 Lbe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` +`)}`}}let l=t.get(Lr).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=Zie(t),f=uQr(c,u,d),h=pfo(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=nwt(y.value):y.value="[redacted]");s??=z7r(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(mN).isThrottled(A)){if(d){let y=lQr(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,mve(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),mve(t,0,`error.${h}`,g)}}a(sVr,"_telemetryException");function km(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await sVr(t,c,dl(),r,n)}},"wrapped");return(...s)=>t.get(_d).register(o(...s))}a(km,"telemetryCatch");function Bm(t,e,r,n){return t.get(_d).register(vfo(t,e,dl(),r?.extendedBy(),n))}a(Bm,"telemetryError");async function vfo(t,e,r,n,o=0){if(Yie(o)&&!Zie(t))return;let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),mfo(t,o,e,s)}a(vfo,"_telemetryError");function aVr(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),yt(t,"engine.completion",u,1)}a(aVr,"logEngineCompletion");function cVr(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 yt(t,"engine.prompt",o,1)}a(cVr,"logEnginePrompt");function Cfo(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(Cfo,"buildErrorFromUnknown");var Yv=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return X6e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(JR).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 bfo=new Ee("expConfigManager"),Sfo=3600*1e3,bN=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){bfo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function fVr(t){let e=Gt(t,Je.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(bN).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(fVr,"resolveTransparentTokenRefresh");p();p();var e9e=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 raw(){return this.userInfo}};p();function wPt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(wPt,"findKnownOrg");function pVr(t){let e=t.organization_list??[];return wPt(e)??""}a(pVr,"getUserKind");p();p();var qV=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function k0(t){return!t||typeof t!="object"?!1:t instanceof qV||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(k0,"isAbortError");var eoe=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},SN=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}`}},Tfo=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 RI(t,e=!0){return t instanceof Error?e&&"cause"in t&&RI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof eoe||t instanceof SN||t?.message?.startsWith("net::")||Tfo.has(t.code??""):!1}a(RI,"isNetworkError");var PI=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 eoe(`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 eoe(`Response body truncated: actualLength=${s}`,"Truncated"):new eoe(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function F9(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(F9,"parseRetryAfterSeconds");p();function t9e(){return typeof process>"u"}a(t9e,"isWeb");function PB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(PB,"isMsBenchModeEnabled");var RPt=class extends SN{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 Bf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...t9e()?{}:wy(t),...n.headers}};let o=await t.get(fr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new SN(o);if(!o.headers.get("x-github-request-id"))throw new RPt(o);return o}a(Bf,"apiFetch");p();p();var ra=class{constructor(){this.recentNotifications=new yn(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 na=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 gVr=require("os"),r9e=require("path");p();var hVr;(()=>{"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,q){for(var Q,U="",z=0,W=-1,$=0,J=0;J<=O.length;++J){if(J2){var ne=U.lastIndexOf("/");if(ne!==U.length-1){ne===-1?(U="",z=0):z=(U=U.slice(0,ne)).length-1-U.lastIndexOf("/"),W=J,$=0;continue}}else if(U.length===2||U.length===1){U="",z=0,W=J,$=0;continue}}q&&(U.length>0?U+="/..":U="..",z=2)}else U.length>0?U+="/"+O.slice(W+1,J):U=O.slice(W+1,J),z=J-W-1;W=J,$=0}else Q===46&&$!==-1?++$:$=-1}return U}a(j,"r");var M={resolve:a(function(){for(var O,q="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var z;U>=0?z=arguments[U]:(O===void 0&&(O=process.cwd()),z=O),B(z),z.length!==0&&(q=z+"/"+q,Q=z.charCodeAt(0)===47)}return q=j(q,!Q),Q?q.length>0?"/"+q:"/":q.length>0?q:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var q=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=j(O,!q)).length!==0||q||(O="."),O.length>0&&Q&&(O+="/"),q?"/"+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,q=0;q0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,q){if(B(O),B(q),O===q||(O=M.resolve(O))===(q=M.resolve(q)))return"";for(var Q=1;QJ){if(q.charCodeAt(W+H)===47)return q.slice(W+H+1);if(H===0)return q.slice(W+H)}else z>J&&(O.charCodeAt(Q+H)===47?ne=H:H===0&&(ne=0));break}var re=O.charCodeAt(Q+H);if(re!==q.charCodeAt(W+H))break;re===47&&(ne=H)}var ae="";for(H=Q+ne+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(ae.length===0?ae+="..":ae+="/..");return ae.length>0?ae+q.slice(W+ne):(W+=ne,q.charCodeAt(W)===47&&++W,q.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var q=O.charCodeAt(0),Q=q===47,U=-1,z=!0,W=O.length-1;W>=1;--W)if((q=O.charCodeAt(W))===47){if(!z){U=W;break}}else z=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,q){if(q!==void 0&&typeof q!="string")throw new TypeError('"ext" argument must be a string');B(O);var Q,U=0,z=-1,W=!0;if(q!==void 0&&q.length>0&&q.length<=O.length){if(q.length===O.length&&q===O)return"";var $=q.length-1,J=-1;for(Q=O.length-1;Q>=0;--Q){var ne=O.charCodeAt(Q);if(ne===47){if(!W){U=Q+1;break}}else J===-1&&(W=!1,J=Q+1),$>=0&&(ne===q.charCodeAt($)?--$==-1&&(z=Q):($=-1,z=J))}return U===z?z=J:z===-1&&(z=O.length),O.slice(U,z)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!W){U=Q+1;break}}else z===-1&&(W=!1,z=Q+1);return z===-1?"":O.slice(U,z)},"basename"),extname:a(function(O){B(O);for(var q=-1,Q=0,U=-1,z=!0,W=0,$=O.length-1;$>=0;--$){var J=O.charCodeAt($);if(J!==47)U===-1&&(z=!1,U=$+1),J===46?q===-1?q=$:W!==1&&(W=1):q!==-1&&(W=-1);else if(!z){Q=$+1;break}}return q===-1||U===-1||W===0||W===1&&q===U-1&&q===Q+1?"":O.slice(q,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(q,Q){var U=Q.dir||Q.root,z=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+z:U+"/"+z:z})(0,O)},"format"),parse:a(function(O){B(O);var q={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return q;var Q,U=O.charCodeAt(0),z=U===47;z?(q.root="/",Q=1):Q=0;for(var W=-1,$=0,J=-1,ne=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)J===-1&&(ne=!1,J=H+1),U===46?W===-1?W=H:re!==1&&(re=1):W!==-1&&(re=-1);else if(!ne){$=H+1;break}return W===-1||J===-1||re===0||re===1&&W===J-1&&W===$+1?J!==-1&&(q.base=q.name=$===0&&z?O.slice(1,J):O.slice($,J)):($===0&&z?(q.name=O.slice(1,W),q.base=O.slice(1,J)):(q.name=O.slice($,W),q.base=O.slice($,J)),q.ext=O.slice(W,J)),$>0?q.dir=O.slice(0,$-1):z&&(q.dir="/"),q},"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,q,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,z){return U||z?U:"file"})(B,Q),this.authority=j||d,this.path=(function(U,z){switch(U){case"https":case"http":case"file":z?z[0]!==f&&(z=f+z):z=f}return z})(this.scheme,M||d),this.query=O||d,this.fragment=q||d,u(this,Q))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:j,authority:M,path:O,query:q,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),q===void 0?q=this.query:q===null&&(q=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),j===this.scheme&&M===this.authority&&O===this.path&&q===this.query&&Q===this.fragment?this:new A(j,M,O,q,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 q=0;q=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,q)),O=-1),M!==void 0&&(M+=L.charAt(q));else{M===void 0&&(M=L.substr(0,q));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,q)),O=-1),M+=U):O===-1&&(O=q)}}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:q,path:Q,query:U,fragment:z}=L;if(O&&(M+=O,M+=":"),(q||O==="file")&&(M+=f,M+=f),q){let W=q.indexOf("@");if(W!==-1){let $=q.substr(0,W);q=q.substr(W+1),W=$.lastIndexOf(":"),W===-1?M+=j($,!1,!1):(M+=j($.substr(0,W),!1,!1),M+=":",M+=j($.substr(W+1),!1,!0)),M+="@"}q=q.toLowerCase(),W=q.lastIndexOf(":"),W===-1?M+=j(q,!1,!0):(M+=j(q.substr(0,W),!1,!0),M+=q.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 U&&(M+="?",M+=j(U,!1,!1)),z&&(M+="#",M+=B?z:E(z,!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 q=P.resolve(M,...j);return O&&q[0]===D&&!B.authority&&(q=q.substring(1)),B.with({path:q})},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={})),hVr=n})();var{URI:U9,Utils:gve}=hVr;function AVr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+AVr(t.substring(3)):t}}a(AVr,"decodeURIComponentGraceful");var mVr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function PPt(t){return t.match(mVr)?t.replace(mVr,e=>AVr(e)):t}a(PPt,"percentDecode");function ba(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 U9.file(t).toString()}a(ba,"makeFsUri");function po(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?U9.parse(e[1]+e[2],!0):U9.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(po,"parseUri");function n9e(t){return po(t),t}a(n9e,"validateUri");function ia(t){try{return po(t).toString()}catch{return t}}a(ia,"normalizeUri");var jV=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function Wn(t){let e=po(t);if(!jV.has(e.scheme)&&!na.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,gVr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,r9e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(Wn,"fsPath");function Yo(t){try{return Wn(t)}catch{return}}a(Yo,"getFsPath");function yVr(t){let e=Yo(t);if(e)return U9.file(e).toString()}a(yVr,"getFsUri");function HV(t,...e){let r,n=Yo(t);return n?r=ba((0,r9e.resolve)(n,...e)):r=gve.resolvePath(po(t),...e.map(o=>EVr(o))).toString(),typeof t=="string"?r:{uri:r}}a(HV,"resolveFilePath");function Sa(t,...e){let r=gve.joinPath(po(t),...e.map(EVr)).toString();return typeof t=="string"?r:{uri:r}}a(Sa,"joinPath");function EVr(t){return Ifo(t)?t.replaceAll("\\","/"):t}a(EVr,"pathToURIPath");function Ifo(t){return/^[^/\\]*\\/.test(t)}a(Ifo,"isWinPath");function Ki(t){return PPt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ki,"basename");function Xd(t){let e=gve.dirname(po(t)),r;return jV.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(Xd,"dirname");function _Vr(t){return gve.extname(po(t))}a(_Vr,"extname");var D0=class{static{a(this,"NetworkConfiguration")}};function i9e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!DPt(t)&&r.protocol==="http:")return r.href}catch{}}a(i9e,"ensurePermittedUrl");var GV={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 kPt(t,e,r){if(r&&h1(t)){for(let n of r){let o=Gt(t,n);if(o)return o}return}for(let n of e){let o=Gt(t,n);if(o)return o}}a(kPt,"urlConfigOverride");function xfo(t,e){switch(e){case"api":return kPt(t,[Je.DebugOverrideCapiUrl,Je.DebugOverrideCapiUrlLegacy],[Je.DebugTestOverrideCapiUrl,Je.DebugTestOverrideCapiUrlLegacy]);case"proxy":return kPt(t,[Je.DebugOverrideProxyUrl,Je.DebugOverrideProxyUrlLegacy],[Je.DebugTestOverrideProxyUrl,Je.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!DPt(t))return kPt(t,[Je.DebugSnippyOverrideUrl])}}a(xfo,"getEndpointOverrideUrl");function kI(t,e,r,...n){let o=xfo(t,r)??e.endpoints[r];return Sa(o,...n)}a(kI,"getEndpointUrl");function kB(t){return DI(t)?.endpoints??GV}a(kB,"getLastKnownEndpoints");function o9e(t,e){if(e&&!i9e(t,e)){t.get(ra).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(D0).setConfiguredUrls(t,{serverUrl:e})}a(o9e,"updateServerUrl");p();var N0=class{static{a(this,"UrlOpener")}};var Xg=new Ee("auth"),NPt=60,wfo=300;var Rfo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Pfo="4535c7beffc844b46bb1ed4aa04d759a";function Lm(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(Lm,"fillGitHubUrls");function Q9(){return Math.floor(Date.now()/1e3)}a(Q9,"nowSeconds");async function MPt(t,e,r){let n=Vt.createAndMarkAsIssued({},{});yt(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Bf(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json(),l=c.user_notification;if(vVr(t,l,e),s.status===401){let m="Failed to get copilot token due to 401 status. Please sign out and try again.",g=s.headers.get("x-github-request-id")??"",A=c.error_details,y=[];g&&y.push(`request_id=${g}`),A?.url&&y.push(`url=${A.url}`),A?.notification_id&&y.push(`notification_id=${A.notification_id}`),A?.message&&y.push(`error=${A.message}`);let E=y.length>0?` (${y.join(", ")})`:"";return Xg.info(t,`${m}${E}`),Bm(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:m}}if(!s.ok||!c.token){Xg.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),Bm(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let m=c.error_details;return m?.notification_id!=="not_signed_up"&&vVr(t,m,e),{failureKind:"NotAuthorized",message:m?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let u=Q9()+c.refresh_in+NPt,d=await Ave(t,e),f;d.ok&&(f=await d.json());let h=new $V(c,f,u);return yt(t,"auth.new_token",n.extendedBy({...Kxt(h)},{adjusted_expires_at:h.expiresAt,expires_at:c.expires_at,current_time:Q9()})),{copilotToken:h}}a(MPt,"authFromGitHubSession");var Ah=class{static{a(this,"CopilotTokenFetcher")}},s9e=class extends Ah{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await MPt(e,r,n)}};async function Ave(t,e){return await Bf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(Ave,"fetchCopilotUserInfo");function vVr(t,e,r){e&&t.get(ra).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(Lr).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(N0).open(l)}e.notification_id&&s&&await kfo(t,e.notification_id,r)}).catch(n=>{Xg.exception(t,n,"copilotToken.notification")})}a(vVr,"notifyUser");async function kfo(t,e,r){let n=await Bf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&Xg.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(kfo,"sendNotificationResultToGitHub");var $V=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 e9e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...GV,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-wfo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Pfo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var Jn=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function a9e(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(a9e,"authEnvVarConflictMessage");var q9=class extends Jn{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function CVr(t){let e=t.trim();if(!e)throw new Jn("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new Jn("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new Jn("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new Jn("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(CVr,"validateGitHubServerUrl");p();p();var TN=class{static{a(this,"AuthRepository")}};p();function bVr(t){let e=t.trim();if(!e)throw new Jn("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=CVr(r),{apiUrl:o}=Lm({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(bVr,"buildAuthServerEndpoint");function j9(t,e){if(e!==void 0)return bVr(e);{let r=t.get(D0),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(j9,"resolveAuthServerEndpoint");function OPt(t){if(!t)return!1;try{return bVr(t),!0}catch{return!1}}a(OPt,"isValidAuthServer");p();p();p();p();p();p();p();p();function MB(t,e){return t||e}a(MB,"_pureAssign");function M0(t,e){return t[e]}a(M0,"_pureRef");var Kv=void 0,yh=null,KPt="",m9e="function",Eve="object",DB="prototype",zPt="__proto__",VV="undefined",d9e="constructor",JPt="Symbol",Dfo="_polyfill",WV="length",f9e="name",eA="call",g9e="toString",NI=MB(Object),ZPt=M0(NI,DB),RVr=MB(String),zV=M0(RVr,DB),_ve=MB(Math),PVr=MB(Array),A9e=M0(PVr,DB),NB=M0(A9e,"slice");function Lf(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(Lf,"safe");function Nfo(t,e){var r=Lf(t);return r.e?e:r.v}a(Nfo,"safeGet");var BPt;function y9e(t){return function(e){return typeof e===t}}a(y9e,"_createIs");function kVr(t){var e="[object "+t+"]";return function(r){return!!(r&&vve(r)===e)}}a(kVr,"_createObjIs");function vve(t){return ZPt[g9e].call(t)}a(vve,"objToString");function kn(t){return typeof t===VV||t===VV}a(kn,"isUndefined");function Mfo(t){return!noe(t)}a(Mfo,"isStrictUndefined");function Zt(t){return t===yh||kn(t)}a(Zt,"isNullOrUndefined");function Ofo(t){return t===yh||!noe(t)}a(Ofo,"isStrictNullOrUndefined");function noe(t){return!!t||t!==Kv}a(noe,"isDefined");function Bfo(t){return!BPt&&(BPt=["string","number","boolean",VV,"symbol","bigint"]),t!==Eve&&BPt.indexOf(t)!==-1}a(Bfo,"isPrimitiveType");var Ai=y9e("string"),Mr=y9e(m9e);function Lu(t){return!t&&Zt(t)?!1:!!t&&typeof t===Eve}a(Lu,"isObject");var cr=M0(PVr,"isArray"),E9e=kVr("Date"),_h=y9e("number"),mP=y9e("boolean");var OB=kVr("Error");function Fm(t){return!!(t&&t.then&&Mr(t.then))}a(Fm,"isPromiseLike");function I1(t){return!(!t||Nfo(function(){return!(t&&0+t)},!t))}a(I1,"isTruthy");var ioe=M0(NI,"getOwnPropertyDescriptor");function Um(t,e){return!!t&&ZPt.hasOwnProperty[eA](t,e)}a(Um,"objHasOwnProperty");var tA=MB(M0(NI,"hasOwn"),Lfo);function Lfo(t,e){return Um(t,e)||!!ioe(t,e)}a(Lfo,"polyObjHasOwn");function zr(t,e,r){if(t&&Lu(t)){for(var n in t)if(tA(t,n)&&e[eA](r||t,n,t[n])===-1)break}}a(zr,"objForEachKey");var c9e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function Ffo(t){var e={};if(e[c9e.c]=!0,e[c9e.e]=!0,t.l){e.get=function(){return t.l.v};var r=ioe(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return zr(t,function(n,o){e[c9e[n]]=Mfo(o)?e[c9e[n]]:o}),e}a(Ffo,"_createProp");var n_=M0(NI,"defineProperty"),DVr=M0(NI,"defineProperties");function qi(t,e,r){return n_(t,e,Ffo(r))}a(qi,"objDefine");function NVr(t,e,r,n,o){var s={};return zr(t,function(c,l){p9e(s,c,e?l:c),p9e(s,l,r?l:c)}),n?n(s):s}a(NVr,"_createKeyValueMap");function p9e(t,e,r,n){n_(t,e,{value:r,enumerable:!0,writable:!1})}a(p9e,"_assignMapValue");var Bu=MB(RVr),Ufo="[object Error]";function lr(t,e){var r=KPt,n=ZPt[g9e][eA](t);n===Ufo&&(t={stack:Bu(t.stack),message:Bu(t.message),name:Bu(t.name)});try{r=JSON.stringify(t,yh,e?typeof e=="number"?e:4:Kv),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):yh)||Bu(t)}catch(o){r=" - "+lr(o,e)}return n+": "+r}a(lr,"dumpObj");function Wc(t){throw new Error(t)}a(Wc,"throwError");function O0(t){throw new TypeError(t)}a(O0,"throwTypeError");var MVr=M0(NI,"freeze");function Qfo(t){return t}a(Qfo,"_doNothing");function qfo(t){return t[zPt]||yh}a(qfo,"_getProto");var BB=M0(NI,"assign"),Fu=M0(NI,"keys");function i_(t){return MVr&&zr(t,function(e,r){(cr(r)||Lu(r))&&i_(r)}),vh(t)}a(i_,"objDeepFreeze");var vh=MB(MVr,Qfo);var YPt=MB(M0(NI,"getPrototypeOf"),qfo);function _9e(t){return NVr(t,1,0,vh)}a(_9e,"createEnum");function jfo(t){return NVr(t,0,0,vh)}a(jfo,"createEnumKeyMap");function Hfo(t){var e={};return zr(t,function(r,n){p9e(e,r,n[1]),p9e(e,n[0],n[1])}),vh(e)}a(Hfo,"createSimpleMap");function XPt(t){return Hfo(t)}a(XPt,"createTypeMap");var OVr=jfo({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}),SVr="__tsUtils$gblCfg",LPt;function BVr(){var t;return typeof globalThis!==VV&&(t=globalThis),!t&&typeof self!==VV&&(t=self),!t&&typeof window!==VV&&(t=window),!t&&typeof global!==VV&&(t=global),t}a(BVr,"_getGlobalValue");function LVr(){if(!LPt){var t=Lf(BVr).v||{};LPt=t[SVr]=t[SVr]||{}}return LPt}a(LVr,"_getGlobalConfig");var ooe=Cve;function Cve(t,e,r){var n=e?e[t]:yh;return function(o){var s=(o?o[t]:yh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?NB[eA](c,1):c)}O0('"'+Bu(t)+'" not defined for '+lr(o))}}a(Cve,"_unwrapFunctionWithPoly");function Gfo(t){return function(e){return e[t]}}a(Gfo,"_unwrapProp");var H9=M0(_ve,"min"),gP=M0(_ve,"max"),TVr=ooe("slice",zV),Ff=ooe("substring",zV),v9e=Cve("substr",zV,$fo);function $fo(t,e,r){return Zt(t)&&O0("Invalid "+lr(t)),r<0?KPt:(e=e||0,e<0&&(e=gP(e+t[WV],0)),kn(r)?TVr(t,e):TVr(t,e,e+r))}a($fo,"polyStrSubstr");function IN(t,e){return Ff(t,0,e)}a(IN,"strLeft");var IVr="_urid",FPt;function Vfo(){if(!FPt){var t=LVr();FPt=t.gblSym=t.gblSym||{k:{},s:{}}}return FPt}a(Vfo,"_globalSymbolRegistry");var l9e;function ekt(t){var e={description:Bu(t),toString:a(function(){return JPt+"("+t+")"},"toString")};return e[Dfo]=!0,e}a(ekt,"polyNewSymbol");function Wfo(t){var e=Vfo();if(!tA(e.k,t)){var r=ekt(t),n=Fu(e.s).length;r[IVr]=function(){return n+"_"+r[g9e]()},e.k[t]=r,e.s[r[IVr]()]=Bu(t)}return e.k[t]}a(Wfo,"polySymbolFor");function zfo(t){!l9e&&(l9e={});var e,r=OVr[t];return r&&(e=l9e[r]=l9e[r]||ekt(JPt+"."+r)),e}a(zfo,"polyGetKnownSymbol");var Eh;function G9(){Eh=LVr()}a(G9,"_initTestHooks");function C9e(t){var e={};return!Eh&&G9(),e.b=Eh.lzy,n_(e,"v",{configurable:!0,get:a(function(){var r=t();return Eh.lzy||n_(e,"v",{value:r}),e.b=Eh.lzy,r},"get")}),e}a(C9e,"getLazy");function x1(t){return n_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(x1,"createCachedValue");var FVr="window",yve;function b9e(t,e){var r;return function(){return!Eh&&G9(),(!r||Eh.lzy)&&(r=x1(Lf(t,e).v)),r.v}}a(b9e,"_getGlobalInstFn");function Ry(t){return!Eh&&G9(),(!yve||t===!1||Eh.lzy)&&(yve=x1(Lf(BVr).v||yh)),yve.v}a(Ry,"getGlobal");function Ri(t,e){var r;if(!yve||e===!1?r=Ry(e):r=yve.v,r&&r[t])return r[t];if(t===FVr)try{return window}catch{}return yh}a(Ri,"getInst");function LB(){return!!ef()}a(LB,"hasDocument");var ef=b9e(Ri,["document"]);function soe(){return!!tf()}a(soe,"hasWindow");var tf=b9e(Ri,[FVr]);function YV(){return!!Uu()}a(YV,"hasNavigator");var Uu=b9e(Ri,["navigator"]);var UVr=b9e(function(){return!!Lf(function(){return process&&(process.versions||{}).node}).v});var roe,UPt;function S9e(){return roe=x1(Lf(Ri,[JPt]).v),roe}a(S9e,"_initSymbol");function Yfo(t){var e=(Eh.lzy?0:roe)||S9e();return e.v?e.v[t]:Kv}a(Yfo,"_getSymbolKey");function QVr(){return!!Kfo()}a(QVr,"hasSymbol");function Kfo(){return!Eh&&G9(),((Eh.lzy?0:roe)||S9e()).v}a(Kfo,"getSymbol");function bve(t,e){var r=OVr[t];!Eh&&G9();var n=(Eh.lzy?0:roe)||S9e();return n.v?n.v[r||t]:e?Kv:zfo(t)}a(bve,"getKnownSymbol");function MI(t,e){!Eh&&G9();var r=(Eh.lzy?0:roe)||S9e();return r.v?r.v(t):e?yh:ekt(t)}a(MI,"newSymbol");function $9(t){return!Eh&&G9(),UPt=(Eh.lzy?0:UPt)||x1(Lf(Yfo,["for"]).v),(UPt.v||Wfo)(t)}a($9,"symbolFor");function h9e(t){return!!t&&Mr(t.next)}a(h9e,"isIterator");function tkt(t){return!Ofo(t)&&Mr(t[bve(3)])}a(tkt,"isIterable");var u9e;function T9e(t,e,r){if(t&&(h9e(t)||(!u9e&&(u9e=x1(bve(3))),t=t[u9e.v]?t[u9e.v]():yh),h9e(t))){var n=Kv,o=Kv;try{for(var s=0;!(o=t.next()).done&&e[eA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=yh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(T9e,"iterForOf");function toe(t,e,r){return t.apply(e,r)}a(toe,"fnApply");function Ch(t,e){return!kn(e)&&t&&(cr(e)?toe(t.push,t,e):h9e(e)||tkt(e)?T9e(e,function(r){t.push(r)}):t.push(e)),t}a(Ch,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[WV]>>>0,o=0;o0?r:0;return Ff(t,o,o+n[WV])===n}a(dpo,"polyStrStartsWith");var $Pt="ref",VPt="unref",WPt="hasRef",fpo="enabled";function ppo(t,e,r){var n=!0,o=t?e(yh):yh,s;function c(){return n=!1,o&&o[VPt]&&o[VPt](),s}a(c,"_unref");function l(){o&&r(o),o=yh}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[WPt]=function(){return o&&o[WPt]?o[WPt]():n},s[$Pt]=function(){return n=!0,o&&o[$Pt]&&o[$Pt](),s},s[VPt]=c,s=n_(s,fpo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=yh},"dn")}}a(ppo,"_createTimerHandler");function nkt(t,e,r){var n=cr(e),o=n?e.length:0,s=(o>0?e[0]:n?Kv:e)||setTimeout,c=(o>1?e[1]:Kv)||clearTimeout,l=r[0];r[0]=function(){u.dn(),toe(l,Kv,NB[eA](arguments))};var u=ppo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;toe(c,Kv,[d])}return toe(s,Kv,r)},function(d){toe(c,Kv,[d])});return u.h}a(nkt,"_createTimeoutWith");function wp(t,e){return nkt(!0,Kv,NB[eA](arguments))}a(wp,"scheduleTimeout");function VVr(t,e,r){return nkt(!0,t,NB[eA](arguments,1))}a(VVr,"scheduleTimeoutWith");function I9e(t,e){return nkt(!1,Kv,NB[eA](arguments))}a(I9e,"createTimeout");var wve=_9e,ikt=XPt;p();var AP=wve({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var yP="toLowerCase",ln="length",loe="warnToConsole",QB="throwInternal",wN="watch",W9="apply",Bi="push",OI="splice",Qu="logger",RN="cancel",qB="initialize",PN="identifier",uoe="removeNotificationListener",doe="addNotificationListener",Jv="isInitialized",Rve="getNotifyMgr",z9="getPlugin",R1="name",B0="processNext",x9e="getProcessTelContext",jB="value",Y9="enabled",okt="stopPollingInternalLogs",BI="unload",Pve="onComplete",w9e="version",R9e="loggingLevelConsole",kN="createNew",P1="teardown",foe="messageId",DN="message",Zv="diagLog",K9="_doTeardown",JV="update",k1="getNext",J9="setNextPlugin",kve="userAgent",LI="split",EP="replace",Dve="substring",Nve="indexOf",HB="type",skt="evtName",_P="status",akt="getAllResponseHeaders",Mve="isChildEvt",D1="data",ZV="getCtx",vP="setCtx",ckt="itemsReceived",Ove="headers",poe="urlString",XV="timeout";var P9e="traceFlags";var lkt;function WVr(t,e){lkt||(lkt=Tve("AggregationError",function(n,o){o[ln]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(lr(n))}),new lkt(r,e||[])}a(WVr,"throwAggregationError");p();p();p();var hoe="function",FI="object",N1="undefined",M1="prototype";var Z9=Object,Bve=Z9[M1];p();var CEl=(Ry()||{}).Symbol,bEl=(Ry()||{}).Reflect;var zVr="hasOwnProperty",mpo=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(vkt,"_hasVisited");function ypo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[pkt]&&n){var m=u[L9e]||{};m[Lve]!==!1&&(h=(m[d[moe]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=xN(null);F9e(r,function(u){s[u]=o(e,r,u)});for(var c=tW(t),l=[];c&&!Ekt(c)&&!vkt(l,c);)F9e(c,function(u){!s[u]&&_kt(c,u,!Fve)&&(s[u]=o(e,c,u))}),l.push(c),c=tW(c);return s}a(ypo,"_getBaseFuncs");function Epo(t,e,r,n){var o=null;if(t&&Um(r,moe)){var s=t[L9e]||xN(null);if(o=(s[r[moe]]||xN(null))[e],o||U9e("Missing ["+e+"] "+B9e),!o[hkt]&&s[Lve]!==!1){for(var c=!Um(t,e),l=tW(t),u=[];c&&l&&!Ekt(l)&&!vkt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=tW(l)}try{c&&(t[e]=o),o[hkt]=1}catch{s[Lve]=!1}}}return o}a(Epo,"_getInstFunc");function _po(t,e,r){var n=e[t];return n===r&&(n=tW(e)[t]),typeof n!==B9e&&U9e("["+t+"] is not a "+B9e),n}a(_po,"_getProtoFunc");function vpo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=Epo(this,d,u,f)||_po(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[pkt]=1,f}if(a(s,"_createDynamicPrototype"),!M9e(t)){var c=r[L9e]=r[L9e]||xN(null);if(!M9e(c)){var l=c[e]=c[e]||xN(null);c[Lve]!==!1&&(c[Lve]=!!o),M9e(l)||F9e(r,function(u){_kt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!Um(t,u)||t[u]&&!t[u][pkt])&&(t[u]=s(t,u)))})}}}a(vpo,"_populatePrototype");function Cpo(t,e){if(Fve){for(var r=[],n=tW(e);n&&!Ekt(n)&&!vkt(r,n);){if(n===t)return!0;r.push(n),n=tW(n)}return!1}return!0}a(Cpo,"_checkPrototype");function fkt(t,e){return Um(t,GB)?t.name||e||YVr:((t||{})[O9e]||{}).name||e||YVr}a(fkt,"_getObjName");function Ci(t,e,r,n){Um(t,GB)||U9e("theClass is an invalid class definition.");var o=t[GB];Cpo(o,e)||U9e("["+fkt(t)+"] not in hierarchy of ["+fkt(e)+"]");var s=null;Um(o,moe)?s=o[moe]:(s=gpo+fkt(t,"_")+"$"+gkt.n,gkt.n++,o[moe]=s);var c=Ci[XVr],l=!!c[N9e];l&&n&&n[N9e]!==void 0&&(l=!!n[N9e]);var u=Apo(e),d=ypo(o,e,u,l);r(e,d);var f=!!Fve&&!!c[mkt];f&&n&&(f=!!n[mkt]),vpo(o,s,e,u,f!==!1)}a(Ci,"dynamicProto");Ci[XVr]=gkt.o;p();var q9e="Promise";var Rkt="rejected";function pl(t,e){return j9e(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:Rkt,rejected:!0,reason:r}):r})}a(pl,"doAwaitResponse");function j9e(t,e,r,n){var o=t;try{if(Fm(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&&bpo(o,n)}return o}a(j9e,"doAwait");function bpo(t,e){var r=t;return e&&(Fm(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(bpo,"doFinally");var Ckt,bkt,Skt,eWr=!1;function Spo(t,e,r,n){Ckt=Ckt||{toString:a(function(){return"[[PromiseState]]"},"toString")},bkt=bkt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},Skt=Skt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[Ckt]={get:e},o[bkt]={get:r},o[Skt]={get:n},DVr(t,o)}a(Spo,"_addDebugState$1");var nWr=["pending","resolving","resolved",Rkt],tWr="dispatchEvent",Q9e;function Tpo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(Tpo,"_hasInitEventFn");function Ipo(t,e,r,n){var o=ef();!Q9e&&(Q9e=x1(!!Lf(Tpo,[o]).v));var s=Q9e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),Q9e.v&&s.initEvent(e,!1,!0),s&&t[tWr])t[tWr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Ri("console");l&&(l.error||l.log)(e,lr(s))}}}a(Ipo,"emitEvent");var iWr="unhandledRejection",xpo=iWr.toLowerCase(),Uve=[],wpo=0,Rpo=10;var Tkt;function rWr(t){return Mr(t)?t.toString():lr(t)}a(rWr,"dumpFnObj");function oWr(t,e,r){var n=V9(arguments,3),o=0,s=!1,c,l=[],u=wpo++,d=Uve.length>0?Uve[Uve.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{Uve.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=kn(N)?c:Mr(N)?N(c):N;Fm(L)?L.then(P,D):N?P(L):o===3?D(L):P(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{Uve.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Mr(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 nWr[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&&Fm(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=wp(b,Rpo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,UVr())process.emit(iWr,c,m);else{var w=tf()||Ry();!Tkt&&(Tkt=x1(Lf(Ri,[q9e+"RejectionEvent"]).v)),Ipo(w,xpo,function(R){return qi(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!Tkt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},n_(m,"state",{get:E}),eWr&&Spo(m,E,function(){return vve(c)},function(){return f}),QVr()&&(m[bve(11)]="IPromise");function T(){return"IPromise"+(eWr?"["+u+(kn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+rWr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Mr(r)||O0(q9e+": executor is not a function - "+rWr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(oWr,"_createPromise");function Ppo(t){return function(e){var r=V9(arguments,1);return t(function(n,o){try{var s=[],c=1;T9e(e,function(l,u){l&&(c++,j9e(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(Ppo,"_createAllPromise");function kpo(t){return x1(function(e){var r=V9(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,pl(u,function(f){f.rejected?s[d]={status:Rkt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{cr(e)?Ct(e,l):tkt(e)?T9e(e,l):O0("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(kpo,"_createAllSettledPromise");function sWr(t){Ct(t,function(e){try{e()}catch{}})}a(sWr,"syncItemProcessor");function Dpo(t){var e=_h(t)?t:0;return function(r){wp(function(){sWr(r)},e)}}a(Dpo,"timeoutItemProcessor");function aWr(t,e){return oWr(aWr,Dpo(e),t,e)}a(aWr,"createAsyncPromise");var Ikt;function Npo(t,e){!Ikt&&(Ikt=x1(Lf(Ri,[q9e]).v||null));var r=Ikt.v;if(!r)return aWr(t);Mr(t)||O0(q9e+": executor is not a function - "+lr(t));var n=0;function o(){return nWr[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 n_(s,"state",{get:o}),s}a(Npo,"createNativePromise");var xkt;function Qve(t){return oWr(Qve,sWr,t)}a(Qve,"createSyncPromise");function H9e(t,e){return!xkt&&(xkt=kpo(Qve)),xkt.v(t,e)}a(H9e,"createSyncAllSettledPromise");var wkt;function Td(t,e){return!wkt&&(wkt=x1(Npo)),wkt.v.call(this,t,e)}a(Td,"createPromise");var G9e=Ppo(Td);var r_l=bve(11);p();p();p();p();var O1=void 0,So="",rW="channels",Uf="core",$9e="createPerfMgr",qve="disabled",$B="extensionConfig",nW="extensions",Xv="processTelemetry",iW="priority",goe="eventsSent",X9="eventsDiscarded",Aoe="eventsSendRequest",NN="perfEvent",V9e="offlineEventsStored",W9e="offlineBatchSent",z9e="offlineBatchDrop",yoe="getPerfMgr",Y9e="domain",K9e="path",cWr="Not dynamic - ",lWr="REDACTED",Pkt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var Mpo="getPrototypeOf",Opo=/-([a-z])/g,Bpo=/([^\w\d_$])/g,Lpo=/^(\d+[\w\d_$])/,f_l=Object[Mpo];function eU(t){return!Zt(t)}a(eU,"isNotNullOrUndefined");function jve(t){var e=t;return e&&Ai(e)&&(e=e[EP](Opo,function(r,n){return n.toUpperCase()}),e=e[EP](Bpo,"_"),e=e[EP](Lpo,function(r,n){return"_"+n})),e}a(jve,"normalizeJsName");function L0(t,e){return t&&e?eu(t,e)!==-1:!1}a(L0,"strContains");function tU(t){return t&&t.toISOString()||""}a(tU,"toISOString");function Rp(t){return OB(t)?t[R1]:So}a(Rp,"getExceptionName");function MN(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(MN,"setValue");function kkt(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=kn(r)?{}:r,t[e]=n)):n=kn(r)?{}:r,n}a(kkt,"getSetValue");function Fpo(t,e){var r=null,n=null;return Mr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][W9](n,o)}}a(Fpo,"_createProxyFunction");function oW(t,e,r,n,o){t&&e&&r&&(o!==!1||kn(t[e]))&&(t[e]=Fpo(r,n))}a(oW,"proxyFunctionAs");function sW(t,e,r,n){return t&&e&&Lu(t)&&cr(r)&&Ct(r,function(o){Ai(o)&&oW(t,o,e,o,n)}),t}a(sW,"proxyFunctions");function Dkt(t){return(function(){function e(){var r=this;t&&zr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(Dkt,"createClassFromInterface");function Z9e(t){return t&&BB&&(t=Z9(BB({},t))),t}a(Z9e,"optimizeObject");function X9e(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[ln],d=!1,f=1;for(u>0&&mP(l)&&(d=l,l=c[f]||{},f++),Lu(l)||(l={});f>>=0),Wve=AWr+t&cW,zve=yWr-t&cW,EWr=!0}a(Zpo,"_mwcSeed");function Xpo(){try{var t=fl()&2147483647;Zpo((Math.random()*gWr^t)+t)}catch{}}a(Xpo,"_autoSeedMwc");function mWr(t){var e=0,r=qkt()||jkt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&cW),e===0&&voe()&&(EWr||Xpo(),e=eho()&cW),e===0&&(e=w1(gWr*Math.random()|0)),t||(e>>>=0),e}a(mWr,"random32");function eho(t){zve=36969*(zve&65535)+(zve>>16)&cW,Wve=18e3*(Wve&65535)+(Wve>>16)&cW;var e=(zve<<16)+(Wve&65535)>>>0&cW|0;return t||(e>>>=0),e}a(eho,"mwcRandom32");function _Wr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=mWr()>>>0,n=0,o=So;o[ln]>>=6,n===5&&(r=(mWr()<<2&4294967295|r&3)>>>0,n=0);return o}a(_Wr,"newId");var vWr="3.3.11",tho="."+_Wr(6),rho=0;function CWr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(CWr,"_canAcceptData");function nho(t,e){var r=e[t.id];if(!r){r={};try{CWr(e)&&qi(e,t.id,{e:!1,v:r})}catch{}}return r}a(nho,"_getCache");function B1(t,e){return e===void 0&&(e=!1),jve(t+rho+++(e?"."+vWr:So)+tho)}a(B1,"createUniqueNamespace");function rUe(t){var e={id:B1("_aiData-"+(t||So)+"."+vWr),accept:a(function(r){return CWr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[jve(n)]:(s&&(c=nho(e,r),c[jve(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(rUe,"createElmNodeData");p();function nUe(t){return t&&Lu(t)&&!cr(t)&&(t.isVal||t.fb||tA(t,"v")||tA(t,"mrg")||tA(t,"ref")||t.set)}a(nUe,"_isConfigDefaults");function bWr(t,e,r){var n,o=r.dfVal||noe;if(e&&r.fb){var s=r.fb;cr(s)||(s=[s]);for(var c=0;c0&&WVr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[ln]>0){c||(c=[]),l||(l=wp(function(){l=null,f()},0));for(var A=0;A0?pl(VB(t[0],e),function(){cUe(V9(t,1),e,r)}):r(),n}a(cUe,"doUnloadAll");p();var wWr=500,zkt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function dho(t,e,r){return!t&&Zt(t)?e:mP(t)?t:Bu(t)[yP]()==="true"}a(dho,"_stringToBoolOrDefault");function Ykt(t){return{mrg:!0,v:t}}a(Ykt,"cfgDfMerge");function boe(t,e,r){return{fb:r,isVal:t,v:e}}a(boe,"cfgDfValidate");function qI(t,e){return{fb:e,set:dho,v:!!t}}a(qI,"cfgDfBoolean");p();p();var Kkt=[goe,X9,Aoe,NN],uUe=null,lUe;function fho(t,e){return function(){var r=arguments,n=Jkt(e);if(n){var o=n.listener;o&&o[t]&&o[t][W9](o,r)}}}a(fho,"_listenerProxyFunc");function pho(){var t=Ri("Microsoft");return t&&(uUe=t.ApplicationInsights),uUe}a(pho,"_getExtensionNamespace");function Jkt(t){var e=uUe;return!e&&t.disableDbgExt!==!0&&(e=uUe||pho()),e?e.ChromeDbgExt:null}a(Jkt,"getDebugExt");function RWr(t){if(!lUe){lUe={};for(var e=0;e=A&&(d[T](b[DN]),n[w]=!0)}else o>=A&&d[T](b[DN]);f(A,b)}},d.debugToConsole=function(A){Zkt("debug",A),g("warning",A)},d[loe]=function(A){Zkt("warn",A),g("warning",A)},d.errorToConsole=function(A){Zkt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[BI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=gho+y[foe];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 eCe(23,v,!1);d.queue[Bi](b),A===1?d.errorToConsole(v):d[loe](v)}}}a(f,"_logInternalMessage");function h(A){return QI(bh(A,Aho,d).cfg,function(y){var E=y.cfg;o=E[R9e],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=Jkt(e||{});E&&E[Zv]&&E[Zv](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function DWr(t){return t||new Toe}a(DWr,"_getLogger");function Vr(t,e,r,n,o,s){s===void 0&&(s=!1),DWr(t)[QB](e,r,n,o,s)}a(Vr,"_throwInternal");function WB(t,e){DWr(t)[loe](e)}a(WB,"_warnToConsole");var Xkt,iU,NWr="toGMTString",MWr="toUTCString",n2t="cookie",e2t="expires",OWr="isCookieUseDisabled",tCe="disableCookiesUsage",BWr="_ckMgr",dUe=null,t2t=null,LWr=null,BN,FWr={},UWr={},Eho=(Xkt={cookieCfg:Ykt((iU={},iU[Y9e]={fb:"cookieDomain",dfVal:eU},iU.path={fb:"cookiePath",dfVal:eU},iU.enabled=O1,iU.ignoreCookies=O1,iU.blockedCookies=O1,iU.disableCookieDefer=!1,iU)),cookieDomain:O1,cookiePath:O1},Xkt[tCe]=O1,Xkt);function i2t(){!BN&&(BN=C9e(function(){return ef()}))}a(i2t,"_getDoc");function fUe(t){return t?t.isEnabled():!0}a(fUe,"_isMgrEnabled");function $Wr(t,e){return e&&t&&cr(t.ignoreCookies)?Qo(t.ignoreCookies,e)!==-1:!1}a($Wr,"_isIgnoredCookie");function QWr(t,e){return e&&t&&cr(t.blockedCookies)&&Qo(t.blockedCookies,e)!==-1?!0:$Wr(t,e)}a(QWr,"_isBlockedCookie");function qWr(t,e){var r=e[Y9];if(Zt(r)){var n=void 0;kn(t[OWr])||(n=!t[OWr]),kn(t[tCe])||(n=!t[tCe]),r=n}return r}a(qWr,"_isCfgEnabled");function VWr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[K9e]=E||"/",_[e2t]="Thu, 01 Jan 1970 00:00:01 GMT",_);return voe()||(v["max-age"]="0"),HWr(So,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||So),R=eu(w,";");if(R!==-1&&(w=Pi(IN(E,R)),T=WWr(Ff(E,R+1))),MN(T,Y9e,v||o,I1,kn),!Zt(_)){var x=voe();if(kn(T[e2t])){var P=fl(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),MN(T,e2t,jWr(N,x?NWr:MWr)||jWr(N,x?NWr:MWr)||So,I1)}}x||MN(T,"max-age",So+_,null,kn)}var L=$ve();return L&&L.protocol==="https:"&&(MN(T,"secure",null,null,kn),t2t===null&&(t2t=!vho((Uu()||{})[kve])),t2t&&MN(T,"SameSite","None",null,kn)),MN(T,K9e,b||n,null,kn),HWr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[ln]-1;_>=0;_--)f[_].n===E&&f[OI](_,1)}a(g,"_removePendingCookie");function A(){r2t(e)&&f&&(Ct(f,function(E){QWr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=bh(t||UWr,null,e).cfg,s=QI(t,function(E){E.setDf(E.cfg,Eho),r=E.ref(E.cfg,"cookieCfg"),n=r[K9e]||"/",o=r[Y9e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=qWr(t,r)!==!1,l=r.getCookie||_ho,u=r.setCookie||GWr,d=r.delCookie||GWr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=qWr(t,r)!==!1&&c&&r2t(e),_=UWr[BWr];return E&&_&&y!==_&&(E=fUe(_)),E},"isEnabled"),setEnabled:a(function(E){r[Y9]=E,kn(t[tCe])||(t[tCe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=QWr(r,E);if(!R){var x=m(_,v,b,T);fUe(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=$Wr(r,E);if(!v){if(fUe(y))_=l(E);else if(f)for(var b=f[ln]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=eu(w,";");_=R!==-1?Pi(IN(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return fUe(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 r2t(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[BWr]=y,y}a(VWr,"createCookieMgr");function r2t(t){if(dUe===null){dUe=!1,!BN&&i2t();try{var e=BN.v||{};dUe=e[n2t]!==void 0}catch(r){Vr(t,2,68,"Cannot access document.cookie - "+Rp(r),{exception:lr(r)})}}return dUe}a(r2t,"areCookiesSupported");function WWr(t){var e={};if(t&&t[ln]){var r=Pi(t)[LI](";");Ct(r,function(n){if(n=Pi(n||So),n){var o=eu(n,"=");o===-1?e[n]=null:e[Pi(IN(n,o))]=Pi(Ff(n,o+1))}})}return e}a(WWr,"_extractParts");function jWr(t,e){return Mr(t[e])?t[e]():null}a(jWr,"_formatDate");function HWr(t,e){var r=t||So;return zr(e,function(n,o){r+="; "+n+(Zt(o)?So:"="+o)}),r}a(HWr,"_formatCookieValue");function _ho(t){var e=So;if(!BN&&i2t(),BN.v){var r=BN.v[n2t]||So;LWr!==r&&(FWr=WWr(r),LWr=r),e=Pi(FWr[t]||So)}return e}a(_ho,"_getCookieValue");function GWr(t,e){!BN&&i2t(),BN.v&&(BN.v[n2t]=t+"="+e)}a(GWr,"_setCookieValue");function vho(t){return Ai(t)?!!(L0(t,"CPU iPhone OS 12")||L0(t,"iPad; CPU OS 12")||L0(t,"Macintosh; Intel Mac OS X 10_14")&&L0(t,"Version/")&&L0(t,"Safari")||L0(t,"Macintosh; Intel Mac OS X 10_14")&&UB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||L0(t,"Chrome/5")||L0(t,"Chrome/6")||L0(t,"UnrealEngine")&&!L0(t,"Chrome")||L0(t,"UCBrowser/12")||L0(t,"UCBrowser/11")):!1}a(vho,"uaDisallowsSameSiteNone");p();var Cho={perfEvtsSendAll:!1};function bho(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){Lf(r.fn,[r.arg])})}a(bho,"_runScheduledListeners");function oU(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[Bi]({fn:n,arg:o}),r.h=r.h||wp(bho,0,r)):Lf(n,[o]))})}a(oU,"_runListeners");var zWr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=bh(e,Cho);n=c[wN](function(l){r=!!l.cfg.perfEvtsSendAll}),Ci(t,this,function(l){qi(l,"listeners",{g:a(function(){return o},"g")}),l[doe]=function(u){o[Bi](u)},l[uoe]=function(u){for(var d=Qo(o,u);d>-1;)o[OI](d,1),d=Qo(o,u)},l[goe]=function(u){oU(o,goe,s,function(d){d[goe](u)})},l[X9]=function(u,d,f){oU(o,X9,s,function(h){h[X9](u,d,f)})},l[Aoe]=function(u,d){oU(o,Aoe,d?s:null,function(f){f[Aoe](u,d)})},l[NN]=function(u){u&&(r||!u[Mve]())&&oU(o,NN,null,function(d){u.isAsync?wp(function(){return d[NN](u)},0):d[NN](u)})},l[V9e]=function(u){u&&u[ln]&&oU(o,V9e,s,function(d){d[V9e](u)})},l[W9e]=function(u){u&&u[D1]&&oU(o,W9e,s,function(d){d[W9e](u)})},l[z9e]=function(u,d){if(u>0){var f=d||0;oU(o,z9e,s,function(h){h[z9e](u,f)})}},l[BI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[RN](),s.h=null,s.cb=[]},"_finishUnload"),f;if(oU(o,"unload",null,function(h){var m=h[BI](u);m&&(f||(f=[]),f[Bi](m))}),f)return Td(function(h){return pl(G9e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Ioe="ctx",s2t="ParentContextKey",rCe="ChildrenContextKey",Sho=null,pUe=(function(){function t(e,r,n){var o=this;if(o.start=fl(),o[R1]=e,o.isAsync=n,o[Mve]=function(){return!1},Mr(r)){var s;qi(o,"payload",{g:a(function(){return!s&&Mr(r)&&(s=r(),r=null),s},"g")})}o[ZV]=function(c){return c?c===t[s2t]||c===t[rCe]?o[c]:(o[Ioe]||{})[c]:null},o[vP]=function(c,l){if(c)if(c===t[s2t])o[c]||(o[Mve]=function(){return!0}),o[c]=l;else if(c===t[rCe])o[c]=l;else{var u=o[Ioe]=o[Ioe]||{};u[c]=l}},o.complete=function(){var c=0,l=o[ZV](t[rCe]);if(cr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Vr(r[Qu],2,73,"Unexpected Exception during onComplete - "+lr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[$B];!_&&A&&(_={}),E[$B]=_,_=e.ref(E,$B),_&&(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&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}Yve(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[z9]();y&&g(y)}}return a(m,"_iterateChain"),c}a(u2t,"_createInternalContext");function CP(t,e,r,n){var o=bh(e),s=u2t(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[Xv](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),cr(d)&&(d=sU(d,o.cfg,r,f)),CP(d||c[k1](),o.cfg,r,f)}return a(u,"_createNew"),c[B0]=l,c[kN]=u,c}a(CP,"createProcessTelemetryContext");function xoe(t,e,r){var n=bh(e.config),o=u2t(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[BI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=sU(u,n.cfg,e,d)),xoe(u||s[k1](),e,d)}return a(l,"_createNew"),s[B0]=c,s[kN]=l,s}a(xoe,"createProcessTelemetryUnloadContext");function nCe(t,e,r){var n=bh(e.config),o=u2t(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Mr(d[JV])&&d[JV](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=sU(u,n.cfg,e,d)),nCe(u||s[k1](),e,d)}return a(l,"_createNew"),s[B0]=c,s[kN]=l,s}a(nCe,"createProcessTelemetryUpdateContext");function sU(t,e,r,n){var o=null,s=!n;if(cr(t)&&t[ln]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Mr(l[Xv])){var u=Pho(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?sU([n],e,r):o}a(sU,"createTelemetryProxyChain");function Pho(t,e,r){var n=null,o=Mr(t[Xv]),s=Mr(t[J9]),c;t?c=t[PN]+"-"+t[iW]+"-"+tzr++:c="Unknown-0-"+tzr++;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&&Mr(t[ezr])&&(g=t[ezr]()),g||(g=CP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[PN]:who,T=g[XWr];return T||(T=g[XWr]={}),g.setNext(n),t&&hUe(g[Uf](),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)&&Vr(g[Zv](),1,73,"Plugin ["+b+"] failed during "+y+" - "+lr(x)+", run flags: "+lr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=zB(t);return _[P1]||_[qve]?!1:(s&&t[J9](n),t[Xv](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[B0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=zB(t),v=t[Uf]||_[Uf];t&&(!v||v===g.core())&&!_[P1]&&(_[Uf]=null,_[P1]=!0,_[Jv]=!1,t[P1]&&t[P1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[B0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=zB(t),v=t[Uf]||_[Uf];t&&(!v||v===g.core())&&!_[P1]&&t[JV]&&t[JV](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[B0](A)}return a(m,"_updatePlugin"),vh(l)}a(Pho,"createTelemetryPluginProxy");var kho=(function(){function t(e,r,n,o){var s=this,c=CP(e,r,n,o);sW(s,c,Fu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function gUe(){var t=[];function e(n){n&&t[Bi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Vr(n[Zv](),2,73,"Unexpected error calling unload handler - "+lr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(gUe,"createUnloadHandlerContainer");p();var AUe,yUe;function EUe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Vr(n,2,73,"Unloading:"+lr(c))}}),AUe&&o[ln]>AUe&&(yUe?yUe("doUnload",o):Vr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Ch(t,n),AUe&&t[ln]>AUe&&(yUe?yUe("Add",t):Vr(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(EUe,"createUnloadHookContainer");var d2t,aU="getPlugin",Dho=(d2t={},d2t[$B]={isVal:eU,v:{}},d2t),iCe=(function(){function t(){var e=this,r,n,o,s,c;d(),Ci(t,e,function(f){f[qB]=function(h,m,g,A){u(h,m,A),r=!0},f[P1]=function(h,m){var g=f[Uf];if(!g||h&&g!==h[Uf]())return;var A,y=!1,E=h||xoe(null,g,o&&o[aU]?o[aU]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[Zv]()),A===!0&&E[B0](_),d())}return a(v,"_unloadCallback"),!f[K9]||f[K9](E,_,v)!==!0?v():A=!0,A},f[JV]=function(h,m){var g=f[Uf];if(!g||h&&g!==h[Uf]())return;var A,y=!1,E=h||nCe(null,g,o&&o[aU]?o[aU]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[k1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},oW(f,"_addUnloadCb",function(){return s},"add"),oW(f,"_addHook",function(){return c},"add"),qi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[Zv]=function(f){return l(f)[Zv]()},e[Jv]=function(){return r},e.setInitialized=function(f){r=f},e[J9]=function(f){o=f},e[B0]=function(f,h){h?h[B0](f):o&&Mr(o[Xv])&&o[Xv](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||CP(null,{},e[Uf]);o&&o[aU]?h=m[kN](null,o[aU]):h=m[kN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){bh(f,Dho,lW(h)),!m&&h&&(m=h[x9e]()[k1]());var g=o;o&&o[aU]&&(g=o[aU]()),e[Uf]=h,n=CP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Uf]=null,n=null,o=null,c=EUe(),s=gUe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function Nho(t,e,r){var n={id:e,fn:r};Ch(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[OI](c,1),-1})},"remove")};return o}a(Nho,"_addInitializer");function Mho(t,e,r){for(var n=!1,o=t[ln],s=0;s"},"v")})}a(Gho,"_createUnloadHook");var h2t=(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,q,Q;Ci(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[Jv]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[qB]=function(ie,le,Ne,we){g&&Wc(nzr),U[Jv]()&&Wc("Core cannot be initialized more than once"),e=bh(ie,f2t,Ne||U[Qu],!1),ie=e.cfg,qe(e[wN](function(st){var Et=st.cfg;B=Et.initInMemoMaxSize||Lho,z(Et);var kt=st.ref(st.cfg,$B);zr(kt,function(Ht){st.ref(kt,Ht)})})),s=we,b=Hho(e,v,s&&U[Rve](),b),K(),U[Qu]=Ne;var Be=ie[nW];if(f=[],f[Bi].apply(f,eW(eW([],le,!1),Be,!1)),h=ie[rW],Oe(null),(!m||m[ln]===0)&&Wc("No "+rW+" available"),h&&h[ln]>1){var tt=U[z9]("TeeChannelController");(!tt||!tt.plugin)&&Vr(n,1,28,"TeeChannel required")}jho(ie,R,n),R=null,r=!0,N===AP.ACTIVE&&J()},U.getChannels=function(){var ie=[];return m&&Ct(m,function(le){ie[Bi](le)}),vh(ie)},U.track=function(ie){hUe(U[yoe](),function(){return"AppInsightsCore:track"},function(){ie===null&&(ue(ie),Wc("Invalid telemetry item")),!ie[R1]&&Zt(ie[R1])&&(ue(ie),Wc("telemetry name required")),ie.iKey=ie.iKey||w,ie.time=ie.time||tU(new Date),ie.ver=ie.ver||"4.0",!g&&U[Jv]()&&N===AP.ACTIVE?ae()[B0](ie):N!==AP.INACTIVE&&o[ln]<=B&&o[Bi](ie)},function(){return{item:ie}},!ie.sync)},U[x9e]=ae,U[Rve]=function(){return s||(s=new zWr(e.cfg),U[Oho]=s),s},U[doe]=function(ie){U.getNotifyMgr()[doe](ie)},U[uoe]=function(ie){s&&s[uoe](ie)},U.getCookieMgr=function(){return u||(u=VWr(e.cfg,U[Qu])),u},U.setCookieMgr=function(ie){u!==ie&&(VB(u,!1),u=ie)},U[yoe]=function(){return c||l||KWr()},U.setPerfMgr=function(ie){c=ie},U.eventCnt=function(){return o[ln]},U.releaseQueue=function(){if(r&&o[ln]>0){var ie=o;o=[],N===2?Ct(ie,function(le){le.iKey=le.iKey||w,ae()[B0](le)}):Vr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ie){return y=ie||null,Q=!1,O&&O[RN](),ne(!0)};function z(ie){var le=ie.instrumentationKey,Ne=ie.endpointUrl;if(N!==3){if(Zt(le)){w=null,N=AP.INACTIVE;var we="Please provide instrumentation key";r?(Vr(n,1,100,we),J()):Wc(we);return}var Be=[];Fm(le)?(Be[Bi](le),w=null):w=le,Fm(Ne)?(Be[Bi](Ne),L=null):L=Ne,Be[ln]?W(ie,Be):$()}}a(z,"_handleIKeyEndpointPromises");function W(ie,le){j=!1,N=3;var Ne=eU(ie.initTimeOut)?ie.initTimeOut:Fho,we=H9e(le);M&&M[RN](),M=wp(function(){M=null,j||$()},Ne),pl(we,function(Be){try{if(j)return;if(!Be.rejected){var tt=Be[jB];if(tt&&tt[ln]){var st=tt[0];if(w=st&&st[jB],tt[ln]>1){var Et=tt[1];L=Et&&Et[jB]}}w&&(ie.instrumentationKey=w,ie.endpointUrl=L)}$()}catch{j||$()}})}a(W,"_waitForInitPromises");function $(){j=!0,Zt(w)?(N=AP.INACTIVE,Vr(n,1,112,"ikey can't be resolved from promises")):N=AP.ACTIVE,J()}a($,"_setStatus");function J(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(J,"_releaseQueues");function ne(ie){if((!O||!O[Y9])&&!Q){var le=ie||n&&n.queue[ln]>0;le&&(q||(q=!0,qe(e[wN](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[Y9],O[RN]()),O=I9e(Z,we),O.unref(),O[Y9]=Be}))),O[Y9]=!0)}return O}a(ne,"_startLogPoller"),U[okt]=function(){Q=!0,O&&O[RN](),Z()},sW(U,function(){return A},["addTelemetryInitializer"]),U[BI]=function(ie,le,Ne){ie===void 0&&(ie=!0),r||Wc(Bho),g&&Wc(nzr);var we={reason:50,isAsync:ie,flushComplete:!1},Be;ie&&!le&&(Be=Td(function(Et){le=Et}));var tt=xoe(Fe(),U);tt[Pve](function(){v.run(U[Qu]),cUe([u,s,n],ie,function(){re(),le&&le(we)})},U);function st(Et){we.flushComplete=Et,g=!0,_.run(tt,we),U[okt](),tt[B0](we)}return a(st,"_doUnload"),Z(),ee(ie,st,6,Ne)||st(!1),Be},U[z9]=ve,U.addPlugin=function(ie,le,Ne,we){if(!ie){we&&we(!1),X(szr);return}var Be=ve(ie[PN]);if(Be&&!le){we&&we(!1),X("Plugin ["+ie[PN]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[Bi](ie),tt.added=[ie],Oe(tt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var Et=[Be.plugin],kt={reason:2,isAsync:!!Ne};Pe(Et,kt,function(Ht){Ht?(tt.removed=Et,tt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ie,le){le===void 0&&(le=!0);var Ne;if(U[Jv]()){Ne={reason:1,cfg:e.cfg,oldCfg:aoe({},e.cfg),newConfig:aoe({},ie),merge:le},ie=Ne.newConfig;var we=e.cfg;ie[nW]=we[nW],ie[rW]=we[rW]}e._block(function(Be){var tt=Be.cfg;p2t(Be,tt,ie,le),le||zr(tt,function(st){tA(ie,st)||Be.set(tt,st,O1)}),Be.setDf(tt,f2t)},!0),e.notify(),Ne&&fe(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ie){return T||(T=ZWr()),T},U.setTraceCtx=function(ie){T=ie||null},U.addUnloadHook=qe,oW(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ie){var le;return r?le=QI(e.cfg,ie,U[Qu]):le=qho(R,ie),Gho(le)},U.getWParam=function(){return LB()||e.cfg.enableWParam?0:-1};function H(){var ie={};P=[];var le=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[PN]&&we[w9e]&&!ie[we.identifier]){var Be=we[PN]+"="+we[w9e];P[Bi](Be),ie[we.identifier]=we}})},"_addPluginVersions");le(m),h&&Ct(h,function(Ne){le(Ne)}),le(f)}a(H,"_setPluginVersions");function re(){r=!1,e=bh({},f2t,U[Qu]),e.cfg[R9e]=1,qi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(le){U.updateCfg(le,!1)},"s")}),qi(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),qi(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||So},"g")}),qi(U,"logger",{g:a(function(){return n||(n=new Toe(e.cfg),e[Qu]=n),n},"g"),s:a(function(le){e[Qu]=le,n!==le&&(VB(n,!1),n=le)},"s")}),U[Qu]=new Toe(e.cfg),x=[];var ie=U.config[nW]||[];ie.splice(0,ie[ln]),Ch(ie,x),A=new rzr,o=[],VB(s,!1),s=null,c=null,l=null,VB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=B1("AIBaseCore",!0),_=gUe(),T=null,w=null,v=EUe(),R=[],D=null,P=null,Q=!1,O=null,q=!1,N=0,L=null,B=null,j=!1,M=null}a(re,"_initDefaults");function ae(){var ie=CP(Fe(),e.cfg,U);return ie[Pve](ne),ie}a(ae,"_createTelCtx");function Oe(ie){var le=Qho(U[Qu],wWr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=mUe(Ch(m,le[rW]));var Ne=Ch(mUe(le[Uf]),m);x=vh(Ne);var we=U.config[nW]||[];we.splice(0,we[ln]),Ch(we,x);var Be=ae();m&&m[ln]>0&&l2t(Be[kN](m),Ne),l2t(Be,Ne),ie&&fe(ie)}a(Oe,"_initPluginChain");function ve(ie){var le=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[PN]===ie&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[Bi](Be)}),!Ne&&we[ln]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ie),!Ne)return-1}),Ne&&(le={plugin:Ne,setEnabled:a(function(Be){zB(Ne)[qve]=!Be},"setEnabled"),isEnabled:a(function(){var Be=zB(Ne);return!Be[P1]&&!Be[qve]},"isEnabled"),remove:a(function(Be,tt){Be===void 0&&(Be=!0);var st=[Ne],Et={reason:1,isAsync:Be};Pe(st,Et,function(kt){kt&&Oe({reason:32,removed:st}),tt&&tt(kt)})},"remove")}),le}a(ve,"_getPlugin");function Fe(){if(!d){var ie=(x||[]).slice();Qo(ie,A)===-1&&ie[Bi](A),d=sU(mUe(ie),e.cfg,U)}return d}a(Fe,"_getPluginChain");function Pe(ie,le,Ne){if(ie&&ie[ln]>0){var we=sU(ie,e.cfg,U),Be=xoe(we,U);Be[Pve](function(){var tt=!1,st=[];Ct(f,function(kt,Ht){izr(kt,ie)?tt=!0:st[Bi](kt)}),f=st,D=null,P=null;var Et=[];h&&(Ct(h,function(kt,Ht){var jt=[];Ct(kt,function(Ie){izr(Ie,ie)?tt=!0:jt[Bi](Ie)}),Et[Bi](jt)}),h=Et),Ne&&Ne(tt),ne()}),Be[B0](le)}else Ne(!1)}a(Pe,"_removePlugins");function Z(){if(n&&n.queue){var ie=n.queue.slice(0);n.queue[ln]=0,Ct(ie,function(le){var Ne={name:y||"InternalMessageId: "+le[foe],iKey:w,time:tU(new Date),baseType:eCe.dataType,baseData:{message:le[DN]}};U.track(Ne)})}}a(Z,"_flushInternalLogs");function ee(ie,le,Ne,we){var Be=1,tt=!1,st=null;we=we||5e3;function Et(){Be--,tt&&Be===0&&(st&&st[RN](),st=null,le&&le(tt),le=null)}if(a(Et,"doCallback"),m&&m[ln]>0){var kt=ae()[kN](m);kt.iterate(function(Ht){if(Ht.flush){Be++;var jt=!1;Ht.flush(ie,function(){jt=!0,Et()},Ne)||jt||(ie&&st==null?st=wp(function(){st=null,Et()},we):Et())}})}return tt=!0,Et(),!0}a(ee,"_flushChannels");function K(){var ie;qe(e[wN](function(le){var Ne=le.cfg.enablePerfMgr;if(Ne){var we=le.cfg[$9e];(ie!==we||!ie)&&(we||(we=Uho),kkt(le.cfg,$9e,we),ie=we,l=null),!c&&!l&&Mr(we)&&(l=we(U,U[Rve]()))}else l=null,ie=null}))}a(K,"_initPerfManager");function fe(ie){var le=nCe(Fe(),U);le[Pve](ne),(!U._updateHook||U._updateHook(le,ie)!==!0)&&le[B0](ie)}a(fe,"_doUpdate");function X(ie){var le=U[Qu];le?(Vr(le,2,73,ie),ne()):Wc(ie)}a(X,"_logOrThrowError");function ue(ie){var le=U[Rve]();le&&le[X9]([ie],2)}a(ue,"_notifyInvalidEvent");function qe(ie){v.add(ie)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function oCe(t,e){try{if(t&&t!==""){var r=o_().parse(t);if(r&&r[ckt]&&r[ckt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[ln])return r}}catch(n){Vr(e,1,43,"Cannot parse the response. "+(n[R1]||lr(n)),{response:t})}return null}a(oCe,"parseResponse");p();var bP="",$ho="NoResponseBody",azr="&"+$ho+"=true",m2t="POST",g2t=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Ci(t,this,function(E,_){var v=!0;j(),E[qB]=function(M,O){o=O,n&&Vr(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=$ve();O&&O.protocol&&O.protocol[yP]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[ln]?R(M,O):null},E.getFallbackInst=function(){return d},E[K9]=function(M,O){j()},E.preparePayload=function(M,O,q,Q){if(!O||Q||!q[D1]){M(q);return}try{var U=Ri("CompressionStream");if(!Mr(U)){M(q);return}var z=new ReadableStream({start:a(function(re){re.enqueue(Ai(q[D1])?new TextEncoder().encode(q[D1]):q[D1]),re.close()},"start")}),W=z.pipeThrough(new U("gzip")),$=W.getReader(),J=[],ne=0,H=!1;return pl($.read(),a(function re(ae){if(!H&&!ae.rejected){var Oe=ae[jB];if(!Oe.done)return J[Bi](Oe[jB]),ne+=Oe.value[ln],pl($.read(),re);for(var ve=new Uint8Array(ne),Fe=0,Pe=0,Z=J;Pe0&&(Ct(Fu(ve),function(K){H.append(K,ve[K])}),Fe[Ove]=H),u?Fe.credentials=u:v&&s&&(Fe.credentials="include"),q&&(Fe.keepalive=!0,e+=re,s?M._sendReason===2&&(ae=!0,A&&(U+=azr)):ae=!0);var Pe=new Request(U,Fe);try{Pe[zkt]=!0}catch{}if(!q&&r&&($=Td(function(K,fe){J=K,ne=fe})),!U){w(O),J&&J(!1);return}function Z(K,fe){fe?x(O,s?0:fe,{},s?bP:K):x(O,s?0:400,{},s?bP:K)}a(Z,"_handleError");function ee(K,fe,X){var ue=K[_P],qe=c.fetchOnComplete;qe&&Mr(qe)?qe(K,O,X||bP,fe):x(O,ue,{},X||bP)}a(ee,"_onFetchComplete");try{pl(fetch(s?U:Pe,s?Fe:null),function(K){if(q&&(e-=re,re=0),!Oe)if(Oe=!0,K.rejected)Z(K.reason&&K.reason[DN],499),ne&&ne(K.reason);else{var fe=K[jB];try{!s&&!fe.ok?(fe[_P]?Z(fe.statusText,fe[_P]):Z(fe.statusText,499),J&&J(!1)):s&&!fe.body?(ee(fe,null,bP),J&&J(!0)):pl(fe.text(),function(X){ee(fe,M,X[jB]),J&&J(!0)})}catch(X){fe&&fe[_P]?Z(lr(X),fe[_P]):Z(lr(X),499),ne&&ne(X)}}})}catch(K){Oe||(Z(lr(K),499),ne&&ne(K))}return ae&&!Oe&&(Oe=!0,x(O,200,{}),J&&J(!0)),s&&!Oe&&M[XV]>0&&y&&y.set(function(){Oe||(Oe=!0,x(O,500,{}),J&&J(!0))},M[XV]),$}a(L,"_doFetchSender");function B(M,O,q){var Q=tf(),U=new XDomainRequest,z=M[D1];U.onload=function(){var H=Eoe(U),re=c&&c.xdrOnComplete;re&&Mr(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?bP:Hve(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",$=M[poe];if(!$){w(O);return}if(!s&&$.lastIndexOf(W,0)!==0){var J="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Vr(o,2,40,". "+J),T(J,O);return}var ne=s?$:$[EP](/^(https?:)/,"");U.open(m2t,ne),M[XV]&&(U[XV]=M[XV]),U.send(z),s&&q?y&&y.set(function(){U.send(z)},0):U.send(z)}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 hzr="on",czr="attachEvent",lzr="addEventListener",uzr="detachEvent",dzr="removeEventListener",A2t="events";var _1l=B1("aiEvtPageHide"),v1l=B1("aiEvtPageShow"),Vho=/\.[\.]+/g,Who=/[\.]+$/,zho=1,_Ue=rUe("events"),Yho=/^([^.]*)(?:\.(.+)|)/;function fzr(t){return t&&t[EP]?t[EP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,So):t}a(fzr,"_normalizeNamespace");function y2t(t,e){if(e){var r=So;cr(e)?(r=So,Ct(e,function(o){o=fzr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=fzr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||So)+r)}var n=Yho.exec(t||So)||[];return{type:n[1],ns:(n[2]||So).replace(Vho,".").replace(Who,So)[LI](".").sort().join(".")}}a(y2t,"_getEvtNamespace");function mzr(t,e,r){r===void 0&&(r=!0);var n=_Ue.get(t,A2t,{},r),o=n[e];return o||(o=n[e]=[]),o}a(mzr,"_getRegisteredEvents");function gzr(t,e,r,n){t&&e&&e[HB]&&(t[dzr]?t[dzr](e[HB],r,n):t[uzr]&&t[uzr](hzr+e[HB],r))}a(gzr,"_doDetach");function Kho(t,e,r,n){var o=!1;return t&&e&&e[HB]&&r&&(t[lzr]?(t[lzr](e[HB],r,n),o=!0):t[czr]&&(t[czr](hzr+e[HB],r),o=!0)),o}a(Kho,"_doAttach");function pzr(t,e,r,n){for(var o=e[ln];o--;){var s=e[o];s&&(!r.ns||r.ns===s[skt].ns)&&(!n||n(s))&&(gzr(t,s[skt],s.handler,s.capture),e[OI](o,1))}}a(pzr,"_doUnregister");function Jho(t,e,r){if(e[HB])pzr(t,mzr(t,e[HB]),e,r);else{var n=_Ue.get(t,A2t,{});zr(n,function(o,s){pzr(t,s,e,r)}),Fu(n)[ln]===0&&_Ue.kill(t,A2t)}}a(Jho,"_unregisterEvents");function sCe(t,e){var r;return e?(cr(e)?r=[t].concat(e):r=[t,e],r=y2t("xx",r).ns[LI](".")):r=t,r}a(sCe,"mergeEvtNamespace");function vUe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=y2t(e,n);if(s=Kho(t,c,r,o),s&&_Ue.accept(t)){var l={guid:zho++,evtName:c,handler:r,capture:o};mzr(t,c.type)[Bi](l)}}catch{}return s}a(vUe,"eventOn");function E2t(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=y2t(e,n),c=!1;Jho(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||gzr(t,s,r,o)}catch{}}a(E2t,"eventOff");p();var aCe="sampleRate",cCe="ProcessLegacy",CUe="http.method",uW="https://dc.services.visualstudio.com",LN="/v2/track",ky="not_specified";p();var bUe=ikt({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 dW="split",ho="length",fW="toLowerCase",lU="ingestionendpoint",uU="toString",_2t="removeItem",woe="message",bzr="count";var lCe="stringify",uCe="pathname",pW="match";var Dy="name";var rA="properties",Ny="measurements",dCe="sizeInBytes",fCe="typeName",Roe="exceptions",hW="severityLevel",SUe="problemGroup",mW="parsedStack",pCe="hasFullStack",hCe="assembly",FN="fileName",gW="line",Poe="aiDataContract",AW="duration";function v2t(t,e,r){var n=e[ho],o=Szr(t,e);if(o[ho]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Ff(o,0,147)+Tzr(s);o=c}return o}a(v2t,"dataSanitizeKeyAndAddUniqueness");function Szr(t,e){var r;return e&&(e=Pi(Bu(e)),e[ho]>150&&(r=Ff(e,0,150),Vr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(Szr,"dataSanitizeKey");function tu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Pi(Bu(e)),e[ho]>r&&(n=Ff(e,0,r),Vr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(tu,"dataSanitizeString");function yW(t,e,r){return Ai(e)&&(e=$kt(e,r)),S2t(t,e,2048,66)}a(yW,"dataSanitizeUrl");function mCe(t,e){var r;return e&&e[ho]>32768&&(r=Ff(e,0,32768),Vr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(mCe,"dataSanitizeMessage");function C2t(t,e){var r;if(e){var n=""+e;n[ho]>32768&&(r=Ff(n,0,32768),Vr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(C2t,"dataSanitizeException");function s_(t,e){if(e){var r={};zr(e,function(n,o){if(Lu(o)&&rU())try{o=o_()[lCe](o)}catch(s){Vr(t,2,49,"custom property is not valid",{exception:s},!0)}o=tu(t,o,8192),n=v2t(t,n,r),r[n]=o}),e=r}return e}a(s_,"dataSanitizeProperties");function a_(t,e){if(e){var r={};zr(e,function(n,o){n=v2t(t,n,r),r[n]=o}),e=r}return e}a(a_,"dataSanitizeMeasurements");function b2t(t,e){return e&&S2t(t,e,128,69)[uU]()}a(b2t,"dataSanitizeId");function S2t(t,e,r,n){var o;return e&&(e=Pi(Bu(e)),e[ho]>r&&(o=Ff(e,0,r),Vr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(S2t,"dataSanitizeInput");function Tzr(t){var e="00"+t;return v9e(e,e[ho]-3)}a(Tzr,"dsPadNumber");p();var Izr=ef()||{},xzr=0,Xho=[null,null,null,null,null];function wzr(t){var e=xzr,r=Xho,n=r[e];return Izr.createElement?r[e]||(n=r[e]=Izr.createElement("a")):n={host:e0o(t,!0)},n.href=t,e++,e>=r[ho]&&(e=0),xzr=e,n}a(wzr,"urlParseUrl");function e0o(t,e){var r=Rzr(t,e)||"";if(r){var n=r[pW](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[ho]>3&&Ai(n[2])&&n[2][ho]>0)return n[2]+(n[3]||"")}return r}a(e0o,"urlParseHost");function Rzr(t,e){var r=null;if(t){var n=t[pW](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[ho]>2&&Ai(n[2])&&n[2][ho]>0&&(r=n[2]||"",e&&n[ho]>2)){var o=(n[1]||"")[fW](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(Rzr,"urlParseFullHost");var t0o=[uW+LN,"https://breeze.aimon.applicationinsights.io"+LN,"https://dc-int.services.visualstudio.com"+LN];function TUe(t){return Qo(t0o,t[fW]())!==-1}a(TUe,"isInternalApplicationInsightsEndpoint");function Pzr(t,e,r,n){var o,s=n,c=n;if(e&&e[ho]>0){var l=wzr(e);if(o=l.host,!s)if(l[uCe]!=null){var u=l.pathname[ho]===0?"/":l[uCe];u.charAt(0)!=="/"&&(u="/"+u),c=l[uCe],s=tu(t,r?r+" "+u:u)}else s=tu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(Pzr,"AjaxHelperParseDependencyPath");p();p();var IUe=wve({LocalStorage:0,SessionStorage:1});var koe=void 0,kzr="";function Dzr(t){try{if(Zt(Ry()))return null;var e=new Date()[uU](),r=Ri(t===IUe.LocalStorage?"localStorage":"sessionStorage"),n=kzr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[_2t](n),!o)return r}catch{}return null}a(Dzr,"_getVerifiedStorageObject");function T2t(){return xUe()?Dzr(IUe.SessionStorage):null}a(T2t,"_getSessionStorageObject");function I2t(t){kzr=t||""}a(I2t,"utlSetStoragePrefix");function xUe(t){return(t||koe===void 0)&&(koe=!!Dzr(IUe.SessionStorage)),koe}a(xUe,"utlCanUseSessionStorage");function x2t(t,e){var r=T2t();if(r!==null)try{return r.getItem(e)}catch(n){koe=!1,Vr(t,2,2,"Browser failed read of session storage. "+Rp(n),{exception:lr(n)})}return null}a(x2t,"utlGetSessionStorage");function w2t(t,e,r){var n=T2t();if(n!==null)try{return n.setItem(e,r),!0}catch(o){koe=!1,Vr(t,2,4,"Browser failed write to session storage. "+Rp(o),{exception:lr(o)})}return!1}a(w2t,"utlSetSessionStorage");function R2t(t,e){var r=T2t();if(r!==null)try{return r[_2t](e),!0}catch(n){koe=!1,Vr(t,2,6,"Browser failed removal of session storage item. "+Rp(n),{exception:lr(n)})}return!1}a(R2t,"utlRemoveSessionStorage");p();var r0o=";",n0o="=";function gCe(t){if(!t)return{};var e=t[dW](r0o),r=Sve(e,function(o,s){var c=s[dW](n0o);if(c[ho]===2){var l=c[0][fW](),u=c[1];o[l]=u}return o},{});if(Fu(r)[ho]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[lU]=r[lU]||"https://"+n+"dc."+r.endpointsuffix}r[lU]=r[lU]||uW,UB(r[lU],"/")&&(r[lU]=r[lU].slice(0,-1))}return r}a(gCe,"parseConnectionString");p();var P2t=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Dy]=tu(e,n)||ky,s.data=r,s.time=tU(new Date),s[Poe]={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 YB=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Dy]=tu(e,r)||ky,s[rA]=s_(e,n),s[Ny]=a_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var i0o=58,o0o=/^\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\?]+)?)/,s0o=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,a0o=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,c0o=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,l0o=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,u0o=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,d0o=/([^\(\s\n]+):([0-9]+)$/,Nzr="",Doe="error",jI="stack",D2t="stackDetails",Mzr="errorSrc",N2t="message",Fzr="description",Ozr=[{re:s0o,len:5,m:1,fn:2,ln:3,col:4},{chk:p0o,pre:f0o,re:a0o,len:4,m:1,fn:2,ln:3},{re:c0o,len:3,m:1,fn:2,hdl:Lzr},{re:l0o,len:2,fn:1,hdl:Lzr}];function f0o(t){return t.replace(/(\(anonymous\))/,"")}a(f0o,"_scrubAnonymous");function p0o(t){return eu(t,"[native")<0}a(p0o,"_ignoreNative");function M2t(t,e){var r=t;return r&&!Ai(r)&&(JSON&&JSON[lCe]?(r=JSON[lCe](t),e&&(!r||r==="{}")&&(Mr(t[uU])?r=t[uU]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(M2t,"_stringify");function Uzr(t,e){var r=t;return t&&(r&&!Ai(r)&&(r=t[N2t]||t[Fzr]||r),r&&!Ai(r)&&(r=M2t(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&eu(r||"",e)===-1&&(r=e+": "+r),r||""}a(Uzr,"_formatMessage");function h0o(t){try{if(Lu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(h0o,"_isExceptionDetailsInternal");function m0o(t){try{if(Lu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(m0o,"_isExceptionInternal");function Bzr(t){return t&&t.src&&Ai(t.src)&&t.obj&&cr(t.obj)}a(Bzr,"_isStackDetails");function EW(t){var e=t||"";Ai(e)||(Ai(e[jI])?e=e[jI]:e=""+e);var r=e[dW](` +`);return{src:e,obj:r}}a(EW,"_convertStackObj");function g0o(t){for(var e=[],r=t[dW](` +`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||C0o(y)){var E=Bu(y);o=!0;var _=b0o(E,n);_&&(s+=_[dCe],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[ho]-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(y0o,"_parseStack");function wUe(t){var e="";if(t&&(e=t.typeName||t[Dy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[uU]());e=n&&n[ho]>1?n[1]:""}catch{}return e}a(wUe,"_getErrorType");function k2t(t){if(t)try{if(!Ai(t)){var e=wUe(t),r=M2t(t,!1);return(!r||r==="{}")&&(t[Doe]&&(t=t[Doe],e=wUe(t)),r=M2t(t,!0)),eu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(k2t,"_formatErrorCode");var _W=(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,m0o(r)?(l[Roe]=r[Roe]||[],l[rA]=r[rA],l[Ny]=r[Ny],r[hW]&&(l[hW]=r[hW]),r.id&&(l.id=r.id,r[rA].id=r.id),r[SUe]&&(l[SUe]=r[SUe]),Zt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Roe]=[qzr(e,r,n)],l[rA]=s_(e,n),l[Ny]=a_(e,o),s&&(l[hW]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=wUe(s||c||e);return{message:Uzr(e,d),url:r,lineNumber:n,columnNumber:o,error:k2t(s||c||e),evt:k2t(c||e),typeName:d,stackDetails:Qzr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Roe]&&FB(r[Roe],function(l){return v0o(e,l)}),c=new t(e,UI(UI({},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&&FB(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[pCe]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=k2t,t})();var E0o=vh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function _0o(){var t=this,e=cr(t[mW])&&FB(t[mW],function(n){return T0o(n)}),r={id:t.id,outerId:t.outerId,typeName:t[fCe],message:t[woe],hasFullStack:t[pCe],stack:t[jI],parsedStack:e||void 0};return r}a(_0o,"_toInterface");function qzr(t,e,r){var n,o,s,c,l,u,d,f;if(h0o(e))c=e[fCe],l=e[woe],d=e[jI],f=e[mW]||[],u=e[pCe];else{var h=e,m=h&&h.evt;OB(h)||(h=h[Doe]||m||h),c=tu(t,wUe(h))||ky,l=mCe(t,Uzr(e||h,c))||ky;var g=e[D2t]||Qzr(e);f=y0o(g),cr(f)&&FB(f,function(A){A[hCe]=tu(t,A[hCe]),A[FN]=tu(t,A[FN])}),d=C2t(t,A0o(g)),u=cr(f)&&f[ho]>0,r&&(r[fCe]=r[fCe]||c)}return n={},n[Poe]=E0o,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[pCe]=u,n.stack=d,n.parsedStack=f,n.toInterface=_0o,n}a(qzr,"_createExceptionDetails");function v0o(t,e){var r=cr(e[mW])&&FB(e[mW],function(o){return S0o(o)})||e[mW],n=qzr(t,UI(UI({},e),{parsedStack:r}));return n}a(v0o,"_createExDetailsFromInterface");function jzr(t,e){var r=e[pW](u0o);if(r&&r[ho]>=4)t[FN]=r[1],t[gW]=parseInt(r[2]);else{var n=e[pW](d0o);n&&n[ho]>=3?(t[FN]=n[1],t[gW]=parseInt(n[2])):t[FN]=e}}a(jzr,"_parseFilename");function Lzr(t,e,r){var n=t[FN];e.fn&&r&&r[ho]>e.fn&&(e.ln&&r[ho]>e.ln?(n=Pi(r[e.fn]||""),t[gW]=parseInt(Pi(r[e.ln]||""))||0):n=Pi(r[e.fn]||"")),n&&jzr(t,n)}a(Lzr,"_handleFilename");function C0o(t){var e=!1;if(t&&Ai(t)){var r=Pi(t);r&&(e=o0o.test(r))}return e}a(C0o,"_isStackFrame");var Hzr=vh({level:1,method:1,assembly:0,fileName:0,line:0});function b0o(t,e){var r,n;if(t&&Ai(t)&&Pi(t)){n=(r={},r[Poe]=Hzr,r.level=e,r.assembly=Pi(t),r.method=Nzr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Pi(c[s.m]||Nzr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[FN]=Pi(c[s.fn]||""),n[gW]=parseInt(Pi(c[s.ln]||""))||0):jzr(n,c[s.fn]||""));break}o++}}return Gzr(n)}a(b0o,"_extractStackFrame");function S0o(t){var e,r=(e={},e[Poe]=Hzr,e.level=t.level,e.method=t.method,e.assembly=t[hCe],e.fileName=t[FN],e.line=t[gW],e.sizeInBytes=0,e);return Gzr(r)}a(S0o,"_stackFrameFromInterface");function Gzr(t){var e=i0o;return t&&(e+=t.method[ho],e+=t.assembly[ho],e+=t.fileName[ho],e+=t.level.toString()[ho],e+=t.line.toString()[ho],t[dCe]=e),t}a(Gzr,"_populateFrameSizeInBytes");function T0o(t){return{level:t.level,method:t.method,assembly:t[hCe],fileName:t[FN],line:t[gW]}}a(T0o,"_parsedFrameToInterface");p();p();var $zr=(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 KB=(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 $zr;h[bzr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Dy]=tu(e,r)||ky,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[rA]=s_(e,u),f[Ny]=a_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var ACe="";function RUe(t){(isNaN(t)||t<0)&&(t=0),t=$Vr(t);var e=ACe+t%1e3,r=ACe+w1(t/1e3)%60,n=ACe+w1(t/(1e3*60))%60,o=ACe+w1(t/(1e3*60*60))%24,s=w1(t/(1e3*60*60*24));return e=e[ho]===1?"00"+e:e[ho]===2?"0"+e:e,r=r[ho]<2?"0"+r:r,n=n[ho]<2?"0"+n:n,o=o[ho]<2?"0"+o:o,(s>0?s+".":ACe)+o+":"+n+":"+r+"."+e}a(RUe,"msToTimeSpan");var vW=(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=b2t(e,l),u.url=yW(e,n),u[Dy]=tu(e,r)||ky,isNaN(o)||(u[AW]=RUe(o)),u[rA]=s_(e,s),u[Ny]=a_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var CW=(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[AW]=RUe(s),g.success=c,g.resultCode=l+"",g.type=tu(e,d);var A=Pzr(e,n,u,o);g.data=yW(e,o)||A.data,g.target=tu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Dy]=tu(e,A[Dy]),g[rA]=s_(e,h),g[Ny]=a_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var bW=(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||ky,c[woe]=mCe(e,r),c[rA]=s_(e,o),c[Ny]=a_(e,s),n&&(c[hW]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var SW=(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=yW(e,n),u[Dy]=tu(e,r)||ky,u[rA]=s_(e,s),u[Ny]=a_(e,c),l&&(u.domProcessing=l.domProcessing,u[AW]=l[AW],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 JB=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function fU(t){var e="ai."+t+".";return function(r){return e+r}}a(fU,"_aiNameFunc");var yCe=fU("application"),F0=fU("device"),PUe=fU("location"),Noe=fU("operation"),O2t=fU("session"),dU=fU("user"),TW=fU("cloud"),ECe=fU("internal"),_Ce=(function(t){Py(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(Dkt({applicationVersion:yCe("ver"),applicationBuild:yCe("build"),applicationTypeId:yCe("typeId"),applicationId:yCe("applicationId"),applicationLayer:yCe("layer"),deviceId:F0("id"),deviceIp:F0("ip"),deviceLanguage:F0("language"),deviceLocale:F0("locale"),deviceModel:F0("model"),deviceFriendlyName:F0("friendlyName"),deviceNetwork:F0("network"),deviceNetworkName:F0("networkName"),deviceOEMName:F0("oemName"),deviceOS:F0("os"),deviceOSVersion:F0("osVersion"),deviceRoleInstance:F0("roleInstance"),deviceRoleName:F0("roleName"),deviceScreenResolution:F0("screenResolution"),deviceType:F0("type"),deviceMachineName:F0("machineName"),deviceVMName:F0("vmName"),deviceBrowser:F0("browser"),deviceBrowserVersion:F0("browserVersion"),locationIp:PUe("ip"),locationCountry:PUe("country"),locationProvince:PUe("province"),locationCity:PUe("city"),operationId:Noe("id"),operationName:Noe("name"),operationParentId:Noe("parentId"),operationRootId:Noe("rootId"),operationSyntheticSource:Noe("syntheticSource"),operationCorrelationVector:Noe("correlationVector"),sessionId:O2t("id"),sessionIsFirst:O2t("isFirst"),sessionIsNew:O2t("isNew"),userAccountAcquisitionDate:dU("accountAcquisitionDate"),userAccountId:dU("accountId"),userAgent:dU("userAgent"),userId:dU("id"),userStoreRegion:dU("storeRegion"),userAuthUserId:dU("authUserId"),userAnonymousUserAcquisitionDate:dU("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:dU("authUserAcquisitionDate"),cloudName:TW("name"),cloudRole:TW("role"),cloudRoleVer:TW("roleVer"),cloudRoleInstance:TW("roleInstance"),cloudEnvironment:TW("environment"),cloudLocation:TW("location"),cloudDeploymentUnit:TW("deploymentUnit"),internalNodeName:ECe("nodeName"),internalSdkVersion:ECe("sdkVersion"),internalAgentVersion:ECe("agentVersion"),internalSnippet:ECe("snippet"),internalSdkSrc:ECe("sdkSrc")}));p();var Sh=new _Ce;p();function Vzr(t,e){E2t(t,null,null,e)}a(Vzr,"_disableEvents");function B2t(t){var e=ef(),r=Uu(),n=!1,o=[],s=1;r&&!Zt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=sCe(B1("OfflineListener"),t);try{if(f(tf())&&(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=vUe(b,"online",y,u),T&&vUe(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=tf();if(b&&n){if(Vzr(b,u),e){var T=e.body||e;kn(T.ononline)||Vzr(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(B2t,"createOfflineListener");var kUe="AppInsightsChannelPlugin";p();p();p();p();p();var pU="duration";p();var Th="tags",DUe="deviceType",eC="data",UN="name",IW="traceID",No="length",hU="stringify",mU="measurements",HI="dataType",gU="envelopeType",ZB="toString",XB="enqueue",eL="count",GI="push",vCe="emitLineDelimitedJson",AU="clear",Moe="markAsSent",xW="clearSent",CCe="bufferOverride",Ooe="BUFFER_KEY",tL="SENT_BUFFER_KEY",yU="concat",Boe="MAX_BUFFER_SIZE",Loe="triggerSend",nA="diagLog",NUe="initialize",Foe="_sender",Uoe="endpointUrl",Qoe="instrumentationKey",MUe="customHeaders",L2t="maxBatchSizeInBytes",OUe="onunloadDisableBeacon",BUe="isBeaconApiDisabled",F2t="alwaysUseXhrOverride",U2t="enableSessionStorageBuffer",SP="_buffer",Q2t="onunloadDisableFetch",q2t="disableSendBeaconSplit",bCe="getSenderInst",EU="_onError",LUe="_onPartialSuccess",SCe="_onSuccess",FUe="itemsReceived",UUe="itemsAccepted",QUe="baseType",qoe="sampleRate",Wzr="getHashCodeScore";var j2t="baseType",Id="baseData",Qm="properties",zzr="true";function Pp(t,e,r){return MN(t,e,r,I1)}a(Pp,"_setValueIf");function I0o(t,e,r){var n=r[Th]=r[Th]||{},o=e.ext=e.ext||{},s=e[Th]=e[Th]||[],c=o.user;c&&(Pp(n,Sh.userAuthUserId,c.authId),Pp(n,Sh.userId,c.id||c.localId));var l=o.app;l&&Pp(n,Sh.sessionId,l.sesId);var u=o.device;u&&(Pp(n,Sh.deviceId,u.id||u.localId),Pp(n,Sh[DUe],u.deviceClass),Pp(n,Sh.deviceIp,u.ip),Pp(n,Sh.deviceModel,u.model),Pp(n,Sh[DUe],u[DUe]));var d=e.ext.web;if(d){Pp(n,Sh.deviceLanguage,d.browserLang),Pp(n,Sh.deviceBrowserVersion,d.browserVer),Pp(n,Sh.deviceBrowser,d.browser);var f=r[eC]=r[eC]||{},h=f[Id]=f[Id]||{},m=h[Qm]=h[Qm]||{};Pp(m,"domain",d.domain),Pp(m,"isManual",d.isManual?zzr:null),Pp(m,"screenRes",d.screenRes),Pp(m,"userConsent",d.userConsent?zzr:null)}var g=o.os;g&&(Pp(n,Sh.deviceOS,g[UN]),Pp(n,Sh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Pp(n,Sh.operationParentId,A.parentID),Pp(n,Sh.operationName,tu(t,A[UN])),Pp(n,Sh.operationId,A[IW]));for(var y={},E=s[No]-1;E>=0;E--){var _=s[E];zr(_,function(b,T){y[b]=T}),s.splice(E,1)}zr(s,function(b,T){y[b]=T});var v=UI(UI({},n),y);v[Sh.internalSdkVersion]||(v[Sh.internalSdkVersion]=tu(t,"javascript:".concat(x0o.Version),64)),r[Th]=Z9e(v)}a(I0o,"_extractPartAExtensions");function _U(t,e,r){Zt(t)||zr(t,function(n,o){_h(o)?r[n]=o:Ai(o)?e[n]=o:rU()&&(e[n]=o_()[hU](o))})}a(_U,"_extractPropsAndMeasurements");function wW(t,e){Zt(t)||zr(t,function(r,n){t[r]=n||e})}a(wW,"_convertPropsUndefinedToCustomDefinedValue");function RW(t,e,r,n){var o=new P2t(t,n,e);Pp(o,"sampleRate",r[aCe]),(r[Id]||{}).startTime&&(o.time=tU(r[Id].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[UN]=o[UN].replace("{0}",s),I0o(t,r,o),r[Th]=r[Th]||[],Z9e(o)}a(RW,"_createEnvelope");function PW(t,e){Zt(e[Id])&&Vr(t,1,46,"telemetryItem.baseData cannot be null.")}a(PW,"EnvelopeCreatorInit");var x0o={Version:"3.3.11"};function Yzr(t,e,r){PW(t,e);var n=e[Id][mU]||{},o=e[Id][Qm]||{};_U(e[eC],o,n),Zt(r)||wW(o,r);var s=e[Id];if(Zt(s))return WB(t,"Invalid input for dependency data"),null;var c=s[Qm]&&s[Qm][CUe]?s[Qm][CUe]:"GET",l=new CW(t,s.id,s.target,s[UN],s[pU],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new JB(CW[HI],l);return RW(t,CW[gU],e,u)}a(Yzr,"DependencyEnvelopeCreator");function H2t(t,e,r){PW(t,e);var n={},o={};e[j2t]!==YB[HI]&&(n.baseTypeSource=e[j2t]),e[j2t]===YB[HI]?(n=e[Id][Qm]||{},o=e[Id][mU]||{}):e[Id]&&_U(e[Id],n,o),_U(e[eC],n,o),Zt(r)||wW(n,r);var s=e[Id][UN],c=new YB(t,s,n,o),l=new JB(YB[HI],c);return RW(t,YB[gU],e,l)}a(H2t,"EventEnvelopeCreator");function Kzr(t,e,r){PW(t,e);var n=e[Id][mU]||{},o=e[Id][Qm]||{};_U(e[eC],o,n),Zt(r)||wW(o,r);var s=e[Id],c=_W.CreateFromInterface(t,s,o,n),l=new JB(_W[HI],c);return RW(t,_W[gU],e,l)}a(Kzr,"ExceptionEnvelopeCreator");function Jzr(t,e,r){PW(t,e);var n=e[Id],o=n[Qm]||{},s=n[mU]||{};_U(e[eC],o,s),Zt(r)||wW(o,r);var c=new KB(t,n[UN],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new JB(KB[HI],c);return RW(t,KB[gU],e,l)}a(Jzr,"MetricEnvelopeCreator");function Zzr(t,e,r){PW(t,e);var n,o=e[Id];!Zt(o)&&!Zt(o[Qm])&&!Zt(o[Qm][pU])?(n=o[Qm][pU],delete o[Qm][pU]):!Zt(e[eC])&&!Zt(e[eC][pU])&&(n=e[eC][pU],delete e[eC][pU]);var s=e[Id],c;((e.ext||{}).trace||{})[IW]&&(c=e.ext.trace[IW]);var l=s.id||c,u=s[UN],d=s.uri,f=s[Qm]||{},h=s[mU]||{};if(Zt(s.refUri)||(f.refUri=s.refUri),Zt(s.pageType)||(f.pageType=s.pageType),Zt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[ZB]()),!Zt(s[Qm])){var m=s[Qm];zr(m,function(y,E){f[y]=E})}_U(e[eC],f,h),Zt(r)||wW(f,r);var g=new vW(t,u,d,n,f,h,l),A=new JB(vW[HI],g);return RW(t,vW[gU],e,A)}a(Zzr,"PageViewEnvelopeCreator");function Xzr(t,e,r){PW(t,e);var n=e[Id],o=n[UN],s=n.uri||n.url,c=n[Qm]||{},l=n[mU]||{};_U(e[eC],c,l),Zt(r)||wW(c,r);var u=new SW(t,o,s,void 0,c,l,n),d=new JB(SW[HI],u);return RW(t,SW[gU],e,d)}a(Xzr,"PageViewPerformanceEnvelopeCreator");function eYr(t,e,r){PW(t,e);var n=e[Id].message,o=e[Id].severityLevel,s=e[Id][Qm]||{},c=e[Id][mU]||{};_U(e[eC],s,c),Zt(r)||wW(s,r);var l=new bW(t,n,o,s,c),u=new JB(bW[HI],l);return RW(t,bW[gU],e,u)}a(eYr,"TraceEnvelopeCreator");p();var tYr=(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},Ci(t,this,function(c){c[XB]=function(l){if(c[eL]()>=r.eventsLimitInMem){o||(Vr(e,2,105,"Maximum in-memory buffer size reached: "+c[eL](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Zt(s)&&l.cnt>s)&&n[GI](l)},c[eL]=function(){return n[No]},c.size=function(){for(var l=n[No],u=0;u0){var u=[];Ct(l,function(f){u[GI](f.item)});var d=r[vCe]?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 G2t(l,u):new qUe(l,u);return Ct(f,function(m){h[XB](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),qUe=(function(t){Py(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Ci(e,o,function(s,c){s[Moe]=function(l){c[AU]()},s[xW]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(tYr);var w0o=["AI_buffer","AI_sentBuffer"],G2t=(function(t){Py(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[CCe]||{getItem:x2t,setItem:w2t},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Ci(e,s,function(m,g){var A=T(e[Ooe]),y=T(e[tL]),E=x(),_=y[yU](E),v=m._set(A[yU](_));v[No]>e[Boe]&&(v[No]=e[Boe]),R(e[tL],[]),R(e[Ooe],v),m[XB]=function(D){if(m[eL]()>=e[Boe]){c||(Vr(n,2,67,"Maximum buffer size reached: "+m[eL](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Zt(h)&&D.cnt>h)&&(g[XB](D),R(e[Ooe],m._get()))},m[AU]=function(){g[AU](),R(e[Ooe],m._get()),R(e[tL],[]),c=!1},m[Moe]=function(D){R(e[Ooe],m._set(b(D,m._get())));var N=T(e[tL]);N instanceof Array&&D instanceof Array&&(N=N[yU](D),N[No]>e[Boe]&&(Vr(n,1,67,"Sent buffer reached its maximum size: "+N[No],!0),N[No]=e[Boe]),R(e[tL],N))},m[xW]=function(D){var N=T(e[tL]);N=b(D,N),R(e[tL],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),j=T(e[tL]).slice(0);D=D||n,N=N||{},m[AU]();var M=L?new e(D,N):new qUe(D,N);return Ct(B,function(O){M[XB](O)}),L&&M[Moe](j),M};function b(D,N){var L=[],B=[];return Ct(D,function(j){B[GI](j.item)}),Ct(N,function(j){!Mr(j)&&Qo(B,j.item)===-1&&L[GI](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=o_().parse(N);if(Ai(L)&&(L=o_().parse(L)),L&&cr(L))return L}}catch(B){Vr(n,1,42," storage key: "+D+", "+Rp(B),{exception:lr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[hU](N);f(n,L,B)}catch(j){f(n,L,JSON[hU]([])),Vr(n,2,41," storage key: "+L+", "+Rp(j)+". Buffer cleared",{exception:lr(j)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(w0o,function(N){var L=P(N);if(D=D[yU](L),l){var B=l+"_"+N,j=P(B);D=D[yU](j)}}),D}catch(N){Vr(n,2,41,"Transfer events from previous buffers: "+Rp(N)+". previous Buffer items can not be removed",{exception:lr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),L=[];return Ct(N,function(B){var j={item:B,cnt:0};L[GI](j)}),R2t(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})(tYr);p();var rYr=(function(){function t(e){Ci(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return o_()[hU](l)}catch(u){Vr(e,1,48,u&&Mr(u[ZB])?u[ZB]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Vr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Vr(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(cr(c))d=o(c,l);else{Vr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{o_()[hU](c),d=c}catch(f){Vr(e,1,48,f&&Mr(f[ZB])?f[ZB]():"Error serializing object",null,!0)}}return d}return c[u]=!0,zr(c.aiDataContract,function(f,h){var m=Mr(h)?h()&1:h&1,g=Mr(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=Lu(c[f])&&c[f]!==null;if(m&&!y&&!A)Vr(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(!cr(c))Vr(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[qoe]=e,this.samplingScoreGenerator=new iYr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[qoe],n=!1;return r==null||r>=100||e.baseType===KB[HI]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(D0o,"_chkSampling");var N0o=(rL={},rL[YB.dataType]=H2t,rL[bW.dataType]=eYr,rL[vW.dataType]=Zzr,rL[SW.dataType]=Xzr,rL[_W.dataType]=Kzr,rL[KB.dataType]=Jzr,rL[CW.dataType]=Yzr,rL),$2t=(function(t){Py(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=kUe;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,q,Q,U,z,W,$,J,ne;return Ci(e,r,function(H,re){Ge(),H.pause=function(){de(),c=!0},H.resume=function(){c&&(c=!1,o=null,tt(),Ue())},H.flush=function(Y,se,pe){if(Y===void 0&&(Y=!0),!c){de();try{var Ce=H[Loe](Y,null,pe||1);return pl(Ce,function(He){return se?(se(!He.rejected),!0):Y?Td(function($e){$e(!He.rejected)}):Ce})}catch(He){Vr(H[nA](),1,22,"flush failed, telemetry will not be collected: "+Rp(He),{exception:lr(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[Loe](!0,kt,2)}catch(Y){Vr(H[nA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Rp(Y),{exception:lr(Y)})}else H.flush(!1)},H.addHeader=function(Y,se){f[Y]=se},H[NUe]=function(Y,se,pe,Ce){H.isInitialized()&&Vr(H[nA](),1,28,"Sender is already initialized"),re[NUe](Y,se,pe,Ce);var He=H.identifier;u=new rYr(se.logger),n=0,o=null,s=0,H[Foe]=null,d=0;var $e=H[nA]();A=sCe(B1("Sender"),se.evtNamespace&&se.evtNamespace()),g=B2t(A),H._addHook(QI(Y,function(Xe){var ct=Xe.cfg;ct.storagePrefix&&I2t(ct.storagePrefix);var bt=CP(null,ct,se),ht=bt.getExtCfg(He,cYr),We=ht[Uoe];if(y&&We===y){var ce=ct[Uoe];ce&&ce!==We&&(ht[Uoe]=ce)}var Re=Ri("CompressionStream");ne=Nkt("zipPayload",ct,!1),Mr(Re)||(ne=!1);var Me=ht.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(lYr,Me):delete f[lYr],Fm(ht[Qoe])&&(ht[Qoe]=ct[Qoe]),qi(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[Uoe]&&(y=E=ht[Uoe]),se.activeStatus()===AP.PENDING?H.pause():se.activeStatus()===AP.ACTIVE&&H.resume(),w&&w!==ht[MUe]&&Ct(w,function(_r){delete f[_r.header]}),_=ht[L2t],v=(ht[OUe]===!1||ht[BUe]===!1)&&nU(),b=ht[OUe]===!1&&nU(),T=ht[BUe]===!1&&nU(),O=ht[F2t],q=!!ht.disableXhr,J=ht.retryCodes;var ge=ht[CCe],oe=!!ht[U2t]&&(!!ge||xUe()),ze=ht.namePrefix,at=oe!==L||oe&&j!==ze||oe&&B!==ge;if(H[SP]){if(at)try{H[SP]=H[SP].createNew($e,ht,oe)}catch(_r){Vr(H[nA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Rp(_r),{exception:lr(_r)})}tt()}else H[SP]=oe?new G2t($e,ht):new qUe($e,ht);j=ze,L=oe,B=ge,Q=!ht[Q2t]&&Vve(!0),W=!!ht[q2t],H._sample=new oYr(ht.samplingPercentage,$e),x=ht[Qoe],!Fm(x)&&!Te(x,ct)&&Vr($e,1,100,"Invalid Instrumentation key "+x),w=ht[MUe],Ai(y)&&!TUe(y)&&w&&w[No]>0?Ct(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var $t=Oe();$?$.SetConfig($t):($=new g2t,$[NUe]($t,$e));var gr=ht.httpXHROverride,sr=null,Nr=null,Hr=eUe([3,1,2],ht.transports);sr=$&&$[bCe](Hr,!1);var Gr=$&&$.getFallbackInst();U=a(function(_r,wm){return Ne(Gr,_r,wm)},"_xhrSend"),z=a(function(_r,wm){return Ne(Gr,_r,wm,!1)},"_fallbackSend"),sr=O?gr:sr||gr||Gr,H[Foe]=function(_r,wm){return Ne(sr,_r,wm)},Q&&(m=Ie);var zt=eUe([3,1],ht.unloadTransports);Q||(zt=zt.filter(function(_r){return _r!==2})),Nr=$&&$[bCe](zt,!0),Nr=O?gr:Nr||gr,(O||ht.unloadTransports||!m)&&Nr&&(m=a(function(_r,wm){return Ne(Nr,_r,wm)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||TP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(Y,se){se=H._getTelCtx(se);var pe=se[nA]();try{var Ce=K(Y,pe);if(!Ce)return;var He=fe(Y,pe);if(!He)return;var $e=u.serialize(He),Xe=H[SP];tt($e);var ct={item:$e,cnt:0};Xe[XB](ct),Ue()}catch(bt){Vr(pe,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Rp(bt),{exception:lr(bt)})}H.processNext(Y,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[eL]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(Y,se,pe){if(!jt(se))return ve(Y,se,pe)},H[Loe]=function(Y,se,pe){Y===void 0&&(Y=!0);var Ce;if(!c)try{var He=H[SP];if(R)He[AU]();else{if(He[eL]()>0){var $e=He.getItems();te(pe||0,Y),se?Ce=se.call(H,$e,Y):Ce=H[Foe]($e,Y)}s=+new Date}de()}catch(ct){var Xe=Hkt();(!Xe||Xe>9)&&Vr(H[nA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Rp(ct),{exception:lr(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:X,batch:ue,shouldProcess:a(function(Y){return!!K(Y)},"shouldProcess")}},H._doTeardown=function(Y,se){H.onunloadFlush(),VB(g,!1),Ge()},H[EU]=function(Y,se,pe){if(!jt(Y))return Fe(Y,se,pe)},H[LUe]=function(Y,se){if(!jt(Y))return Pe(Y,se)},H[SCe]=function(Y,se){if(!jt(Y))return Z(Y,se)},H._xdrOnLoad=function(Y,se){if(!jt(se))return ae(Y,se)};function ae(Y,se){var pe=aYr(Y);if(Y&&(pe+""=="200"||pe===""))n=0,H[SCe](se,0);else{var Ce=oCe(pe);Ce&&Ce[FUe]&&Ce[FUe]>Ce[UUe]&&!D?H[LUe](se,Ce):H[EU](se,Hve(Y))}}a(ae,"_xdrOnLoad");function Oe(){try{var Y={xdrOnComplete:a(function(pe,Ce,He){var $e=ee(He);if($e)return ae(pe,$e)},"xdrOnComplete"),fetchOnComplete:a(function(pe,Ce,He,$e){var Xe=ee($e);if(Xe)return st(pe.status,Xe,pe.url,Xe[No],pe.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(pe,Ce,He){var $e=ee(He);if($e)return ve(pe,$e,$e[No])},"xhrOnComplete"),beaconOnRetry:a(function(pe,Ce,He){return Ht(pe,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:q,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:Y};return se}catch{}return null}a(Oe,"_getSendPostMgrConfig");function ve(Y,se,pe){Y.readyState===4&&st(Y.status,se,Y.responseURL,pe,aW(Y),aYr(Y)||Y.response)}a(ve,"_xhrReadyStateChange");function Fe(Y,se,pe){Vr(H[nA](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[xW](Y)}a(Fe,"_onError");function Pe(Y,se){for(var pe=[],Ce=[],He=se.errors.reverse(),$e=0,Xe=He;$e0&&H[SCe](Y,se[UUe]),pe[No]>0&&H[EU](pe,aW(null,["partial success",se[UUe],"of",se.itemsReceived].join(" "))),Ce[No]>0&&(F(Ce),Vr(H[nA](),2,40,"Partial success. Delivered: "+Y[No]+", Failed: "+pe[No]+". Will retry to send "+Ce[No]+" our of "+se[FUe]+" items"))}a(Pe,"_onPartialSuccess");function Z(Y,se){H._buffer&&H._buffer[xW](Y)}a(Z,"_onSuccess");function ee(Y){try{if(Y){var se=Y,pe=se.oriPayload;return pe&&pe[No]?pe:null}}catch{}return null}a(ee,"_getPayloadArr");function K(Y,se){if(R)return!1;if(!Y)return se&&Vr(se,1,7,"Cannot send empty telemetry"),!1;if(Y.baseData&&!Y[QUe])return se&&Vr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(Y[QUe]||(Y[QUe]="EventData"),!H[Foe])return se&&Vr(se,1,28,"Sender was not initialized"),!1;if(ie(Y))Y[aCe]=H._sample[qoe];else return se&&Vr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[qoe]}),!1;return!0}a(K,"_validate");function fe(Y,se){var pe=Y.iKey||x,Ce=e.constructEnvelope(Y,pe,se,P);if(!Ce){Vr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(Y[Th]&&Y[Th][cCe]&&(Ct(Y[Th][cCe],function($e){try{$e&&$e(Ce)===!1&&(He=!0,WB(se,"Telemetry processor check returns false"))}catch(Xe){Vr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Rp(Xe),{exception:lr(Xe)},!0)}}),delete Y[Th][cCe]),!He)return Ce}a(fe,"_getEnvelope");function X(Y){var se=sYr,pe=H[nA]();try{var Ce=K(Y,pe),He=null;Ce&&(He=fe(Y,pe)),He&&(se=u.serialize(He))}catch{}return se}a(X,"_serialize");function ue(Y){var se=sYr;return Y&&Y[No]&&(se="["+Y.join(",")+"]"),se}a(ue,"_batch");function qe(Y){var se=Be();return{urlString:y,data:Y,headers:se}}a(qe,"_createPayload");function ie(Y){return H._sample.isSampledIn(Y)}a(ie,"_isSampledIn");function le(Y,se,pe,Ce){se===200&&Y?H._onSuccess(Y,Y[No]):Ce&&H[EU](Y,Ce)}a(le,"_getOnComplete");function Ne(Y,se,pe,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ce,Re,Me){return le(se,ce,Re,Me)},"onComplete"),$e=we(se),Xe=Y&&Y.sendPOST;if(Xe&&$e){Ce&&H._buffer[Moe](se);var ct,bt=!1,ht,We;return $.preparePayload(function(ce){ct=Xe(ce,He,!pe),bt=!0,ht&&j9e(ct,ht,We)},ne,$e,!pe),bt?ct:Td(function(ce,Re){ht=ce,We=Re})}return null}a(Ne,"_doSend");function we(Y){if(cr(Y)&&Y[No]>0){var se=H[SP].batchPayloads(Y),pe=Be(),Ce={data:se,urlString:y,headers:pe,disableXhrSync:q,disableFetchKeepAlive:!Q,oriPayload:Y};return Ce}return null}a(we,"_getPayload");function Be(){try{var Y=f||{};return TUe(y)&&(Y[bUe[6]]=bUe[7]),Y}catch{}return null}a(Be,"_getHeaders");function tt(Y){var se=Y?Y[No]:0;return H[SP].size()+se>_?((!g||g.isOnline())&&H[Loe](!0,null,10),!0):!1}a(tt,"_checkMaxSize");function st(Y,se,pe,Ce,He,$e){var Xe=null;if(H._appId||(Xe=oCe($e),Xe&&Xe.appId&&(H._appId=Xe.appId)),(Y<200||Y>=300)&&Y!==0){if((Y===301||Y===307||Y===308)&&!Et(pe)){H[EU](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Vr(H[nA](),2,40,". Offline - Response Code: ".concat(Y,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(Y)?(F(se),Vr(H[nA](),2,40,". Response code "+Y+". Will retry to send "+se[No]+" items.")):H[EU](se,He)}else Et(pe),Y===206?(Xe||(Xe=oCe($e)),Xe&&!D?H[LUe](se,Xe):H[EU](se,He)):(n=0,H[SCe](se,Ce))}a(st,"_checkResponsStatus");function Et(Y){return d>=10?!1:!Zt(Y)&&Y!==""&&Y!==y?(y=Y,++d,!0):!1}a(Et,"_checkAndUpdateEndPointUrl");function kt(Y,se){if(m)m(Y,!1);else{var pe=$&&$[bCe]([3],!0);return Ne(pe,Y,se)}}a(kt,"_doUnloadSend");function Ht(Y,se,pe){var Ce=Y,He=Ce&&Ce.oriPayload;if(W)z&&z(He,!0),Vr(H[nA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],Xe=0;Xe0&&(z&&z($e,!0),Vr(H[nA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a(Ht,"_onBeaconRetry");function jt(Y){try{if(Y&&Y[No])return Ai(Y[0])}catch{}return null}a(jt,"_isStringArr");function Ie(Y,se){var pe=null;if(cr(Y)){for(var Ce=Y[No],He=0;He-1}a(Se,"_isRetriable");function Le(){var Y="getNotifyMgr",se,pe=H.core;return pe&&(pe[Y]?se=pe[Y]():se=pe._notificationManager),se}a(Le,"_getNotifyMgr");function te(Y,se){var pe=Le();if(pe&&pe.eventsSendRequest)try{pe.eventsSendRequest(Y,se)}catch(Ce){Vr(H[nA](),1,74,"send request notification failed: "+Rp(Ce),{exception:lr(Ce)})}}a(te,"_notifySendRequest");function Te(Y,se){var pe=se.disableInstrumentationKeyValidation,Ce=Zt(pe)?!1:pe;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(Y)}a(Te,"_validateInstrumentationKey");function Ge(){H[Foe]=null,H[SP]=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=TP,D=!1,L=null,j=TP,q=!1,Q=!1,W=!1,U=null,z=null,$=null,qi(H,"_senderConfig",{g:a(function(){return X9e({},cYr)},"g")})}a(Ge,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Zt(n)?c=UI(UI({},r),{iKey:n}):c=r;var l=N0o[c.baseType]||H2t;return l(o,c,s)},e})(iCe);p();var kW="instrumentationKey",TCe="connectionString",joe="endpointUrl",Hoe="userOverrideEndpointUrl";var DW,V2t,W2t=void 0,M0o=(DW={diagnosticLogInterval:boe(O0o,1e4)},DW[TCe]=W2t,DW.endpointUrl=W2t,DW[kW]=W2t,DW.featureOptIn=(V2t={},V2t.zipPayload={mode:1},V2t),DW.extensionConfig={},DW);function O0o(t){return t&&t>0}a(O0o,"_chkDiagLevel");var uYr=(function(){function t(e){var r=new h2t,n;(Zt(e)||Zt(e[kW])&&Zt(e[TCe]))&&Wc("Invalid input configuration"),Ci(t,this,function(s){qi(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,sW(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=bh(e||{},M0o);n=l.cfg,r.addUnloadHook(QI(l,function(){var u=n[TCe];if(Fm(u)){var d=Qve(function(g,A){pl(u,function(y){var E=y.value,_=n[kW];if(!y.rejected&&E){n[TCe]=E;var v=gCe(E);_=v.instrumentationkey||_}g(_)})}),f=Qve(function(g,A){pl(u,function(y){var E=y.value,_=n[joe];if(!y.rejected&&E){var v=gCe(E),b=v.ingestionendpoint;_=b?b+LN:_}g(_)})});n[kW]=d,n[joe]=n[Hoe]||f}if(Ai(u)){var h=gCe(u),m=h.ingestionendpoint;n[joe]=n[Hoe]?n[Hoe]:m+LN,n[kW]=h.instrumentationkey||n[kW]}n[joe]=n[Hoe]?n[Hoe]:n[joe]})),r.initialize(n,[new $2t])}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 L1=he(require("os"));var NW=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.options=n;this.onCopilotToken=a(e=>{this.token=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",this.options?.includeAuthorizationHeader&&this.token&&(n.Authorization=`Bearer ${this.token.token}`);let o={method:"POST",headers:n,body:e.data};this.ctx.get(fr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new uYr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[kUe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:B0o(e),this.commonProperties=n?.excludeCommonProperties?{}:L0o(e),this.#e=ys(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 B0o(t){let e={},r=t.get(Oa);e["ai.session.id"]=r.sessionId;let n=t.get(Nf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${L1.type()} ${L1.release()}`,e["ai.device.osArchitecture"]=L1.arch(),e["ai.device.osPlatform"]=L1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(is).getVersion(),e}a(B0o,"getTags");function L0o(t){let e={};e.common_os=L1.platform(),e.common_platformversion=L1.release(),e.common_arch=L1.arch(),e.common_cpu=Array.from(new Set(L1.cpus().map(n=>n.model))).join();let r=t.get(Oa);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(L0o,"getCommonProperties");p();p();p();p();p();p();var ICe=_9e;var QN=ICe({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var vU=ICe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var MW="toLowerCase",Cn="length",Goe="warnToConsole",nL="throwInternal",qN="watch",CU="apply",to="push",$I="splice",qu="logger",jN="cancel",iL="initialize",HN="identifier",$oe="removeNotificationListener",Voe="addNotificationListener",tC="isInitialized",xCe="getNotifyMgr",bU="getPlugin",IP="name",U0="processNext",jUe="getProcessTelContext",oL="value",SU="enabled",z2t="stopPollingInternalLogs",VI="unload",wCe="onComplete",HUe="version",GUe="loggingLevelConsole",GN="createNew",F1="teardown",Woe="messageId",$N="message",rC="diagLog",TU="_doTeardown",OW="update",U1="getNext",IU="setNextPlugin",RCe="userAgent",sL="split",xP="replace",Y2t="substring",$Ue="indexOf",aL="type",K2t="evtName",wP="status",J2t="getAllResponseHeaders",PCe="isChildEvt",Q1="data",BW="getCtx",RP="setCtx";var kCe="headers",zoe="urlString",LW="timeout";var VUe="traceFlags";var Z2t;function dYr(t,e){Z2t||(Z2t=Tve("AggregationError",function(n,o){o[Cn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(lr(n))}),new Z2t(r,e||[])}a(dYr,"throwAggregationError");p();p();p();p();p();var q1=void 0,Es="",FW="channels",Qf="core",WUe="createPerfMgr",DCe="disabled",cL="extensionConfig",UW="extensions",nC="processTelemetry",QW="priority",Yoe="eventsSent",xU="eventsDiscarded",Koe="eventsSendRequest",VN="perfEvent",zUe="offlineEventsStored",YUe="offlineBatchSent",KUe="offlineBatchDrop",Joe="getPerfMgr",JUe="domain",ZUe="path",fYr="Not dynamic - ";var F0o="getPrototypeOf",U0o=/-([a-z])/g,Q0o=/([^\w\d_$])/g,q0o=/^(\d+[\w\d_$])/,pRl=Object[F0o];function wU(t){return!Zt(t)}a(wU,"isNotNullOrUndefined");function Zoe(t){var e=t;return e&&Ai(e)&&(e=e[xP](U0o,function(r,n){return n.toUpperCase()}),e=e[xP](Q0o,"_"),e=e[xP](q0o,function(r,n){return"_"+n})),e}a(Zoe,"normalizeJsName");function qm(t,e){return t&&e?eu(t,e)!==-1:!1}a(qm,"strContains");function Xoe(t){return t&&t.toISOString()||""}a(Xoe,"toISOString");function ese(t){return OB(t)?t[IP]:Es}a(ese,"getExceptionName");function lL(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(lL,"setValue");function XUe(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=kn(r)?{}:r,t[e]=n)):n=kn(r)?{}:r,n}a(XUe,"getSetValue");function j0o(t,e){var r=null,n=null;return Mr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][CU](n,o)}}a(j0o,"_createProxyFunction");function RU(t,e,r,n,o){t&&e&&r&&(o!==!1||kn(t[e]))&&(t[e]=j0o(r,n))}a(RU,"proxyFunctionAs");function PU(t,e,r,n){return t&&e&&Lu(t)&&cr(r)&&Ct(r,function(o){Ai(o)&&RU(t,o,e,o,n)}),t}a(PU,"proxyFunctions");function WN(t){return t&&BB&&(t=Z9(BB({},t))),t}a(WN,"optimizeObject");function e7e(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(e7e,"isFeatureEnabled");function zN(t){try{return t.responseText}catch{}return null}a(zN,"getResponseText");function t7e(t,e){return t?"XDomainRequest,Response:"+zN(t)||"":e}a(t7e,"formatErrorMessageXdr");function MCe(t,e){return t?"XMLHttpRequest,Status:"+t[wP]+",Response:"+zN(t)||t.response||"":e}a(MCe,"formatErrorMessageXhr");function OCe(t,e){return e&&(_h(e)?t=[e].concat(t):cr(e)&&(t=e.concat(t))),t}a(OCe,"prependTransports");var H0o="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",pYr="withCredentials",G0o="timeout";function X2t(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,H0o,n),r&&c(l,pYr,r),l.open(t,e,!o),r&&c(l,pYr,r),!o&&s&&c(l,G0o,s),l}a(X2t,"openXhr");function eDt(t){var e={};if(Ai(t)){var r=Pi(t)[sL](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[$Ue](": ");if(o!==-1){var s=Pi(n.substring(0,o))[MW](),c=Pi(n[Y2t](o+1));e[s]=c}else e[Pi(n)]=1}})}return e}a(eDt,"convertAllHeadersToMap");function NCe(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Pi(n))}return t}a(NCe,"_appendHeader");var $0o="kill-duration",V0o="kill-duration-seconds",W0o="time-delta-millis";function kU(t,e){var r={};return t[J2t]?r=eDt(t[J2t]()):e&&(r=NCe(r,t,W0o),r=NCe(r,t,$0o),r=NCe(r,t,V0o)),r}a(kU,"_getAllResponseHeaders");p();p();var z0o="location",Y0o="console",hYr="JSON",K0o="crypto",J0o="msCrypto",Z0o="ReactNative",X0o="msie",emo="trident/",mYr="XMLHttpRequest",tDt=null,rDt=null,tmo=!1,tse=null,nDt=null;function gYr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[M1];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!kn(o[e])}catch{}}return r}a(gYr,"_hasProperty");function rse(t){if(t&&tmo){var e=Ri("__mockLocation");if(e)return e}return typeof location===FI&&location?location:Ri(z0o)}a(rse,"getLocation");function r7e(){return typeof console!==N1?console:Ri(Y0o)}a(r7e,"getConsole");function BCe(){return!!(typeof JSON===FI&&JSON||Ri(hYr)!==null)}a(BCe,"hasJSON");function n7e(){return BCe()?JSON||Ri(hYr):null}a(n7e,"getJSON");function i7e(){return Ri(K0o)}a(i7e,"getCrypto");function o7e(){return Ri(J0o)}a(o7e,"getMsCrypto");function nse(){var t=Uu();return t&&t.product?t.product===Z0o:!1}a(nse,"isReactNative");function qW(){var t=Uu();if(t&&(t[RCe]!==rDt||tDt===null)){rDt=t[RCe];var e=(rDt||Es)[MW]();tDt=qm(e,X0o)||qm(e,emo)}return tDt}a(qW,"isIE");function ise(t){return(nDt===null||t===!1)&&(nDt=YV()&&!!Uu().sendBeacon),nDt}a(ise,"isBeaconsSupported");function ose(t){var e=!1;try{e=!!Ri("fetch");var r=Ri("Request");e&&t&&r&&(e=gYr(r,"keepalive"))}catch{}return e}a(ose,"isFetchSupported");function s7e(){return tse===null&&(tse=typeof XDomainRequest!==N1,tse&&LCe()&&(tse=tse&&!gYr(Ri(mYr),"withCredentials"))),tse}a(s7e,"useXDomainRequest");function LCe(){var t=!1;try{var e=Ri(mYr);t=!!e}catch{}return t}a(LCe,"isXhrSupported");var AYr=4294967296,jW=4294967295,yYr=123456789,EYr=987654321,_Yr=!1,FCe=yYr,UCe=EYr;function rmo(t){t<0&&(t>>>=0),FCe=yYr+t&jW,UCe=EYr-t&jW,_Yr=!0}a(rmo,"_mwcSeed");function nmo(){try{var t=fl()&2147483647;rmo((Math.random()*AYr^t)+t)}catch{}}a(nmo,"_autoSeedMwc");function iDt(t){var e=0,r=i7e()||o7e();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&jW),e===0&&qW()&&(_Yr||nmo(),e=imo()&jW),e===0&&(e=w1(AYr*Math.random()|0)),t||(e>>>=0),e}a(iDt,"random32");function imo(t){UCe=36969*(UCe&65535)+(UCe>>16)&jW,FCe=18e3*(FCe&65535)+(FCe>>16)&jW;var e=(UCe<<16)+(FCe&65535)>>>0&jW|0;return t||(e>>>=0),e}a(imo,"mwcRandom32");function oDt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=iDt()>>>0,n=0,o=Es;o[Cn]>>=6,n===5&&(r=(iDt()<<2&4294967295|r&3)>>>0,n=0);return o}a(oDt,"newId");var vYr="3.3.10",omo="."+oDt(6),smo=0;function CYr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(CYr,"_canAcceptData");function amo(t,e){var r=e[t.id];if(!r){r={};try{CYr(e)&&qi(e,t.id,{e:!1,v:r})}catch{}}return r}a(amo,"_getCache");function WI(t,e){return e===void 0&&(e=!1),Zoe(t+smo+++(e?"."+vYr:Es)+omo)}a(WI,"createUniqueNamespace");function a7e(t){var e={id:WI("_aiData-"+(t||Es)+"."+vYr),accept:a(function(r){return CYr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Zoe(n)]:(s&&(c=amo(e,r),c[Zoe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(a7e,"createElmNodeData");p();function c7e(t){return t&&Lu(t)&&!cr(t)&&(t.isVal||t.fb||tA(t,"v")||tA(t,"mrg")||tA(t,"ref")||t.set)}a(c7e,"_isConfigDefaults");function bYr(t,e,r){var n,o=r.dfVal||noe;if(e&&r.fb){var s=r.fb;cr(s)||(s=[s]);for(var c=0;c0&&dYr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[Cn]>0){c||(c=[]),l||(l=wp(function(){l=null,f()},0));for(var A=0;A0?pl(ase(t[0],e),function(){uDt(V9(t,1),e,r)}):r(),n}a(uDt,"doUnloadAll");p();var IYr=500,dDt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function xYr(t){return{mrg:!0,v:t}}a(xYr,"cfgDfMerge");p();p();var fDt=[Yoe,xU,Koe,VN],h7e=null,p7e;function mmo(t,e){return function(){var r=arguments,n=pDt(e);if(n){var o=n.listener;o&&o[t]&&o[t][CU](o,r)}}}a(mmo,"_listenerProxyFunc");function gmo(){var t=Ri("Microsoft");return t&&(h7e=t.ApplicationInsights),h7e}a(gmo,"_getExtensionNamespace");function pDt(t){var e=h7e;return!e&&t.disableDbgExt!==!0&&(e=h7e||gmo()),e?e.ChromeDbgExt:null}a(pDt,"getDebugExt");function wYr(t){if(!p7e){p7e={};for(var e=0;e=A&&(d[T](b[$N]),n[w]=!0)}else o>=A&&d[T](b[$N]);f(A,b)}},d.debugToConsole=function(A){hDt("debug",A),g("warning",A)},d[Goe]=function(A){hDt("warn",A),g("warning",A)},d.errorToConsole=function(A){hDt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[VI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=Emo+y[Woe];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 lse(23,v,!1);d.queue[to](b),A===1?d.errorToConsole(v):d[Goe](v)}}}a(f,"_logInternalMessage");function h(A){return j1(kp(A,_mo,d).cfg,function(y){var E=y.cfg;o=E[GUe],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=pDt(e||{});E&&E[rC]&&E[rC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function kYr(t){return t||new HW}a(kYr,"_getLogger");function Ta(t,e,r,n,o,s){s===void 0&&(s=!1),kYr(t)[nL](e,r,n,o,s)}a(Ta,"_throwInternal");function KN(t,e){kYr(t)[Goe](e)}a(KN,"_warnToConsole");var mDt,DU,DYr="toGMTString",NYr="toUTCString",yDt="cookie",gDt="expires",MYr="isCookieUseDisabled",VCe="disableCookiesUsage",OYr="_ckMgr",m7e=null,ADt=null,BYr=null,JN,LYr={},FYr={},Cmo=(mDt={cookieCfg:xYr((DU={},DU[JUe]={fb:"cookieDomain",dfVal:wU},DU.path={fb:"cookiePath",dfVal:wU},DU.enabled=q1,DU.ignoreCookies=q1,DU.blockedCookies=q1,DU.disableCookieDefer=!1,DU)),cookieDomain:q1,cookiePath:q1},mDt[VCe]=q1,mDt);function EDt(){!JN&&(JN=C9e(function(){return ef()}))}a(EDt,"_getDoc");function g7e(t){return t?t.isEnabled():!0}a(g7e,"_isMgrEnabled");function GYr(t,e){return e&&t&&cr(t.ignoreCookies)?Qo(t.ignoreCookies,e)!==-1:!1}a(GYr,"_isIgnoredCookie");function UYr(t,e){return e&&t&&cr(t.blockedCookies)&&Qo(t.blockedCookies,e)!==-1?!0:GYr(t,e)}a(UYr,"_isBlockedCookie");function QYr(t,e){var r=e[SU];if(Zt(r)){var n=void 0;kn(t[MYr])||(n=!t[MYr]),kn(t[VCe])||(n=!t[VCe]),r=n}return r}a(QYr,"_isCfgEnabled");function _Dt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[ZUe]=E||"/",_[gDt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return qW()||(v["max-age"]="0"),jYr(Es,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||Es),R=eu(w,";");if(R!==-1&&(w=Pi(IN(E,R)),T=$Yr(Ff(E,R+1))),lL(T,JUe,v||o,I1,kn),!Zt(_)){var x=qW();if(kn(T[gDt])){var P=fl(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),lL(T,gDt,qYr(N,x?DYr:NYr)||qYr(N,x?DYr:NYr)||Es,I1)}}x||lL(T,"max-age",Es+_,null,kn)}var L=rse();return L&&L.protocol==="https:"&&(lL(T,"secure",null,null,kn),ADt===null&&(ADt=!VYr((Uu()||{})[RCe])),ADt&&lL(T,"SameSite","None",null,kn)),lL(T,ZUe,b||n,null,kn),jYr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[Cn]-1;_>=0;_--)f[_].n===E&&f[$I](_,1)}a(g,"_removePendingCookie");function A(){$Ce(e)&&f&&(Ct(f,function(E){UYr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=kp(t||FYr,null,e).cfg,s=j1(t,function(E){E.setDf(E.cfg,Cmo),r=E.ref(E.cfg,"cookieCfg"),n=r[ZUe]||"/",o=r[JUe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=QYr(t,r)!==!1,l=r.getCookie||bmo,u=r.setCookie||HYr,d=r.delCookie||HYr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=QYr(t,r)!==!1&&c&&$Ce(e),_=FYr[OYr];return E&&_&&y!==_&&(E=g7e(_)),E},"isEnabled"),setEnabled:a(function(E){r[SU]=E,kn(t[VCe])||(t[VCe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=UYr(r,E);if(!R){var x=m(_,v,b,T);g7e(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 _=Es,v=GYr(r,E);if(!v){if(g7e(y))_=l(E);else if(f)for(var b=f[Cn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=eu(w,";");_=R!==-1?Pi(IN(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return g7e(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 $Ce(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[OYr]=y,y}a(_Dt,"createCookieMgr");function $Ce(t){if(m7e===null){m7e=!1,!JN&&EDt();try{var e=JN.v||{};m7e=e[yDt]!==void 0}catch(r){Ta(t,2,68,"Cannot access document.cookie - "+ese(r),{exception:lr(r)})}}return m7e}a($Ce,"areCookiesSupported");function $Yr(t){var e={};if(t&&t[Cn]){var r=Pi(t)[sL](";");Ct(r,function(n){if(n=Pi(n||Es),n){var o=eu(n,"=");o===-1?e[n]=null:e[Pi(IN(n,o))]=Pi(Ff(n,o+1))}})}return e}a($Yr,"_extractParts");function qYr(t,e){return Mr(t[e])?t[e]():null}a(qYr,"_formatDate");function jYr(t,e){var r=t||Es;return zr(e,function(n,o){r+="; "+n+(Zt(o)?Es:"="+o)}),r}a(jYr,"_formatCookieValue");function bmo(t){var e=Es;if(!JN&&EDt(),JN.v){var r=JN.v[yDt]||Es;BYr!==r&&(LYr=$Yr(r),BYr=r),e=Pi(LYr[t]||Es)}return e}a(bmo,"_getCookieValue");function HYr(t,e){!JN&&EDt(),JN.v&&(JN.v[yDt]=t+"="+e)}a(HYr,"_setCookieValue");function VYr(t){return Ai(t)?!!(qm(t,"CPU iPhone OS 12")||qm(t,"iPad; CPU OS 12")||qm(t,"Macintosh; Intel Mac OS X 10_14")&&qm(t,"Version/")&&qm(t,"Safari")||qm(t,"Macintosh; Intel Mac OS X 10_14")&&UB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||qm(t,"Chrome/5")||qm(t,"Chrome/6")||qm(t,"UnrealEngine")&&!qm(t,"Chrome")||qm(t,"UCBrowser/12")||qm(t,"UCBrowser/11")):!1}a(VYr,"uaDisallowsSameSiteNone");p();var Smo={perfEvtsSendAll:!1};function Tmo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){Lf(r.fn,[r.arg])})}a(Tmo,"_runScheduledListeners");function NU(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[to]({fn:n,arg:o}),r.h=r.h||wp(Tmo,0,r)):Lf(n,[o]))})}a(NU,"_runListeners");var vDt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=kp(e,Smo);n=c[qN](function(l){r=!!l.cfg.perfEvtsSendAll}),Ci(t,this,function(l){qi(l,"listeners",{g:a(function(){return o},"g")}),l[Voe]=function(u){o[to](u)},l[$oe]=function(u){for(var d=Qo(o,u);d>-1;)o[$I](d,1),d=Qo(o,u)},l[Yoe]=function(u){NU(o,Yoe,s,function(d){d[Yoe](u)})},l[xU]=function(u,d){NU(o,xU,s,function(f){f[xU](u,d)})},l[Koe]=function(u,d){NU(o,Koe,d?s:null,function(f){f[Koe](u,d)})},l[VN]=function(u){u&&(r||!u[PCe]())&&NU(o,VN,null,function(d){u.isAsync?wp(function(){return d[VN](u)},0):d[VN](u)})},l[zUe]=function(u){u&&u[Cn]&&NU(o,zUe,s,function(d){d[zUe](u)})},l[YUe]=function(u){u&&u[Q1]&&NU(o,YUe,s,function(d){d[YUe](u)})},l[KUe]=function(u,d){if(u>0){var f=d||0;NU(o,KUe,s,function(h){h[KUe](u,f)})}},l[VI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[jN](),s.h=null,s.cb=[]},"_finishUnload"),f;if(NU(o,"unload",null,function(h){var m=h[VI](u);m&&(f||(f=[]),f[to](m))}),f)return Td(function(h){return pl(G9e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var dse="ctx",bDt="ParentContextKey",WCe="ChildrenContextKey",Imo=null,fse=(function(){function t(e,r,n){var o=this;if(o.start=fl(),o[IP]=e,o.isAsync=n,o[PCe]=function(){return!1},Mr(r)){var s;qi(o,"payload",{g:a(function(){return!s&&Mr(r)&&(s=r(),r=null),s},"g")})}o[BW]=function(c){return c?c===t[bDt]||c===t[WCe]?o[c]:(o[dse]||{})[c]:null},o[RP]=function(c,l){if(c)if(c===t[bDt])o[c]||(o[PCe]=function(){return!0}),o[c]=l;else if(c===t[WCe])o[c]=l;else{var u=o[dse]=o[dse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[BW](t[WCe]);if(cr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Ta(r[qu],2,73,"Unexpected Exception during onComplete - "+lr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[cL];!_&&A&&(_={}),E[cL]=_,_=e.ref(E,cL),_&&(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&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}QCe(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[bU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(wDt,"_createInternalContext");function zI(t,e,r,n){var o=kp(e),s=wDt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[nC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),cr(d)&&(d=MU(d,o.cfg,r,f)),zI(d||c[U1](),o.cfg,r,f)}return a(u,"_createNew"),c[U0]=l,c[GN]=u,c}a(zI,"createProcessTelemetryContext");function pse(t,e,r){var n=kp(e.config),o=wDt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[VI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=MU(u,n.cfg,e,d)),pse(u||s[U1](),e,d)}return a(l,"_createNew"),s[U0]=c,s[GN]=l,s}a(pse,"createProcessTelemetryUnloadContext");function zCe(t,e,r){var n=kp(e.config),o=wDt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Mr(d[OW])&&d[OW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=MU(u,n.cfg,e,d)),zCe(u||s[U1](),e,d)}return a(l,"_createNew"),s[U0]=c,s[GN]=l,s}a(zCe,"createProcessTelemetryUpdateContext");function MU(t,e,r,n){var o=null,s=!n;if(cr(t)&&t[Cn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Mr(l[nC])){var u=Dmo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?MU([n],e,r):o}a(MU,"createTelemetryProxyChain");function Dmo(t,e,r){var n=null,o=Mr(t[nC]),s=Mr(t[IU]),c;t?c=t[HN]+"-"+t[QW]+"-"+JYr++:c="Unknown-0-"+JYr++;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&&Mr(t[KYr])&&(g=t[KYr]()),g||(g=zI(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[HN]:Pmo,T=g[YYr];return T||(T=g[YYr]={}),g.setNext(n),t&&Dp(g[Qf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Es;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Ta(g[rC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+lr(x)+", run flags: "+lr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=uL(t);return _[F1]||_[DCe]?!1:(s&&t[IU](n),t[nC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[U0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=uL(t),v=t[Qf]||_[Qf];t&&(!v||v===g.core())&&!_[F1]&&(_[Qf]=null,_[F1]=!0,_[tC]=!1,t[F1]&&t[F1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[U0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=uL(t),v=t[Qf]||_[Qf];t&&(!v||v===g.core())&&!_[F1]&&t[OW]&&t[OW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[U0](A)}return a(m,"_updatePlugin"),vh(l)}a(Dmo,"createTelemetryPluginProxy");var ZYr=(function(){function t(e,r,n,o){var s=this,c=zI(e,r,n,o);PU(s,c,Fu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function YCe(){var t=[];function e(n){n&&t[to](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Ta(n[rC](),2,73,"Unexpected error calling unload handler - "+lr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(YCe,"createUnloadHandlerContainer");p();var E7e,_7e;function v7e(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Ta(n,2,73,"Unloading:"+lr(c))}}),E7e&&o[Cn]>E7e&&(_7e?_7e("doUnload",o):Ta(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Ch(t,n),E7e&&t[Cn]>E7e&&(_7e?_7e("Add",t):Ta(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(v7e,"createUnloadHookContainer");var RDt,OU="getPlugin",Nmo=(RDt={},RDt[cL]={isVal:wU,v:{}},RDt),hse=(function(){function t(){var e=this,r,n,o,s,c;d(),Ci(t,e,function(f){f[iL]=function(h,m,g,A){u(h,m,A),r=!0},f[F1]=function(h,m){var g=f[Qf];if(!g||h&&g!==h[Qf]())return;var A,y=!1,E=h||pse(null,g,o&&o[OU]?o[OU]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[rC]()),A===!0&&E[U0](_),d())}return a(v,"_unloadCallback"),!f[TU]||f[TU](E,_,v)!==!0?v():A=!0,A},f[OW]=function(h,m){var g=f[Qf];if(!g||h&&g!==h[Qf]())return;var A,y=!1,E=h||zCe(null,g,o&&o[OU]?o[OU]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[U1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},RU(f,"_addUnloadCb",function(){return s},"add"),RU(f,"_addHook",function(){return c},"add"),qi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[rC]=function(f){return l(f)[rC]()},e[tC]=function(){return r},e.setInitialized=function(f){r=f},e[IU]=function(f){o=f},e[U0]=function(f,h){h?h[U0](f):o&&Mr(o[nC])&&o[nC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||zI(null,{},e[Qf]);o&&o[OU]?h=m[GN](null,o[OU]):h=m[GN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){kp(f,Nmo,use(h)),!m&&h&&(m=h[jUe]()[U1]());var g=o;o&&o[OU]&&(g=o[OU]()),e[Qf]=h,n=zI(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Qf]=null,n=null,o=null,c=v7e(),s=YCe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function Mmo(t,e,r){var n={id:e,fn:r};Ch(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[$I](c,1),-1})},"remove")};return o}a(Mmo,"_addInitializer");function Omo(t,e,r){for(var n=!1,o=t[Cn],s=0;s"},"v")})}a($mo,"_createUnloadHook");var C7e=(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,q,Q;Ci(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[tC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[iL]=function(ie,le,Ne,we){g&&Wc(eKr),U[tC]()&&Wc("Core cannot be initialized more than once"),e=kp(ie,PDt,Ne||U[qu],!1),ie=e.cfg,qe(e[qN](function(st){var Et=st.cfg;B=Et.initInMemoMaxSize||Fmo,z(Et);var kt=st.ref(st.cfg,cL);zr(kt,function(Ht){st.ref(kt,Ht)})})),s=we,b=Gmo(e,v,s&&U[xCe](),b),K(),U[qu]=Ne;var Be=ie[UW];if(f=[],f[to].apply(f,eW(eW([],le,!1),Be,!1)),h=ie[FW],Oe(null),(!m||m[Cn]===0)&&Wc("No "+FW+" available"),h&&h[Cn]>1){var tt=U[bU]("TeeChannelController");(!tt||!tt.plugin)&&Ta(n,1,28,"TeeChannel required")}Hmo(ie,R,n),R=null,r=!0,N===vU.ACTIVE&&J()},U.getChannels=function(){var ie=[];return m&&Ct(m,function(le){ie[to](le)}),vh(ie)},U.track=function(ie){Dp(U[Joe](),function(){return"AppInsightsCore:track"},function(){ie===null&&(ue(ie),Wc("Invalid telemetry item")),!ie[IP]&&Zt(ie[IP])&&(ue(ie),Wc("telemetry name required")),ie.iKey=ie.iKey||w,ie.time=ie.time||Xoe(new Date),ie.ver=ie.ver||"4.0",!g&&U[tC]()&&N===vU.ACTIVE?ae()[U0](ie):N!==vU.INACTIVE&&o[Cn]<=B&&o[to](ie)},function(){return{item:ie}},!ie.sync)},U[jUe]=ae,U[xCe]=function(){return s||(s=new vDt(e.cfg),U[Bmo]=s),s},U[Voe]=function(ie){U.getNotifyMgr()[Voe](ie)},U[$oe]=function(ie){s&&s[$oe](ie)},U.getCookieMgr=function(){return u||(u=_Dt(e.cfg,U[qu])),u},U.setCookieMgr=function(ie){u!==ie&&(ase(u,!1),u=ie)},U[Joe]=function(){return c||l||SDt()},U.setPerfMgr=function(ie){c=ie},U.eventCnt=function(){return o[Cn]},U.releaseQueue=function(){if(r&&o[Cn]>0){var ie=o;o=[],N===2?Ct(ie,function(le){le.iKey=le.iKey||w,ae()[U0](le)}):Ta(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ie){return y=ie||null,Q=!1,O&&O[jN](),ne(!0)};function z(ie){var le=ie.instrumentationKey,Ne=ie.endpointUrl;if(N!==3){if(Zt(le)){w=null,N=vU.INACTIVE;var we="Please provide instrumentation key";r?(Ta(n,1,100,we),J()):Wc(we);return}var Be=[];Fm(le)?(Be[to](le),w=null):w=le,Fm(Ne)?(Be[to](Ne),L=null):L=Ne,Be[Cn]?W(ie,Be):$()}}a(z,"_handleIKeyEndpointPromises");function W(ie,le){j=!1,N=3;var Ne=wU(ie.initTimeOut)?ie.initTimeOut:Umo,we=H9e(le);M&&M[jN](),M=wp(function(){M=null,j||$()},Ne),pl(we,function(Be){try{if(j)return;if(!Be.rejected){var tt=Be[oL];if(tt&&tt[Cn]){var st=tt[0];if(w=st&&st[oL],tt[Cn]>1){var Et=tt[1];L=Et&&Et[oL]}}w&&(ie.instrumentationKey=w,ie.endpointUrl=L)}$()}catch{j||$()}})}a(W,"_waitForInitPromises");function $(){j=!0,Zt(w)?(N=vU.INACTIVE,Ta(n,1,112,"ikey can't be resolved from promises")):N=vU.ACTIVE,J()}a($,"_setStatus");function J(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(J,"_releaseQueues");function ne(ie){if((!O||!O[SU])&&!Q){var le=ie||n&&n.queue[Cn]>0;le&&(q||(q=!0,qe(e[qN](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[SU],O[jN]()),O=I9e(Z,we),O.unref(),O[SU]=Be}))),O[SU]=!0)}return O}a(ne,"_startLogPoller"),U[z2t]=function(){Q=!0,O&&O[jN](),Z()},PU(U,function(){return A},["addTelemetryInitializer"]),U[VI]=function(ie,le,Ne){ie===void 0&&(ie=!0),r||Wc(Lmo),g&&Wc(eKr);var we={reason:50,isAsync:ie,flushComplete:!1},Be;ie&&!le&&(Be=Td(function(Et){le=Et}));var tt=pse(Fe(),U);tt[wCe](function(){v.run(U[qu]),uDt([u,s,n],ie,function(){re(),le&&le(we)})},U);function st(Et){we.flushComplete=Et,g=!0,_.run(tt,we),U[z2t](),tt[U0](we)}return a(st,"_doUnload"),Z(),ee(ie,st,6,Ne)||st(!1),Be},U[bU]=ve,U.addPlugin=function(ie,le,Ne,we){if(!ie){we&&we(!1),X(nKr);return}var Be=ve(ie[HN]);if(Be&&!le){we&&we(!1),X("Plugin ["+ie[HN]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[to](ie),tt.added=[ie],Oe(tt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var Et=[Be.plugin],kt={reason:2,isAsync:!!Ne};Pe(Et,kt,function(Ht){Ht?(tt.removed=Et,tt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ie,le){le===void 0&&(le=!0);var Ne;if(U[tC]()){Ne={reason:1,cfg:e.cfg,oldCfg:aoe({},e.cfg),newConfig:aoe({},ie),merge:le},ie=Ne.newConfig;var we=e.cfg;ie[UW]=we[UW],ie[FW]=we[FW]}e._block(function(Be){var tt=Be.cfg;kDt(Be,tt,ie,le),le||zr(tt,function(st){tA(ie,st)||Be.set(tt,st,q1)}),Be.setDf(tt,PDt)},!0),e.notify(),Ne&&fe(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ie){return T||(T=zYr()),T},U.setTraceCtx=function(ie){T=ie||null},U.addUnloadHook=qe,RU(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ie){var le;return r?le=j1(e.cfg,ie,U[qu]):le=jmo(R,ie),$mo(le)},U.getWParam=function(){return LB()||e.cfg.enableWParam?0:-1};function H(){var ie={};P=[];var le=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[HN]&&we[HUe]&&!ie[we.identifier]){var Be=we[HN]+"="+we[HUe];P[to](Be),ie[we.identifier]=we}})},"_addPluginVersions");le(m),h&&Ct(h,function(Ne){le(Ne)}),le(f)}a(H,"_setPluginVersions");function re(){r=!1,e=kp({},PDt,U[qu]),e.cfg[GUe]=1,qi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(le){U.updateCfg(le,!1)},"s")}),qi(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),qi(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||Es},"g")}),qi(U,"logger",{g:a(function(){return n||(n=new HW(e.cfg),e[qu]=n),n},"g"),s:a(function(le){e[qu]=le,n!==le&&(ase(n,!1),n=le)},"s")}),U[qu]=new HW(e.cfg),x=[];var ie=U.config[UW]||[];ie.splice(0,ie[Cn]),Ch(ie,x),A=new XYr,o=[],ase(s,!1),s=null,c=null,l=null,ase(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=WI("AIBaseCore",!0),_=YCe(),T=null,w=null,v=v7e(),R=[],D=null,P=null,Q=!1,O=null,q=!1,N=0,L=null,B=null,j=!1,M=null}a(re,"_initDefaults");function ae(){var ie=zI(Fe(),e.cfg,U);return ie[wCe](ne),ie}a(ae,"_createTelCtx");function Oe(ie){var le=qmo(U[qu],IYr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=y7e(Ch(m,le[FW]));var Ne=Ch(y7e(le[Qf]),m);x=vh(Ne);var we=U.config[UW]||[];we.splice(0,we[Cn]),Ch(we,x);var Be=ae();m&&m[Cn]>0&&xDt(Be[GN](m),Ne),xDt(Be,Ne),ie&&fe(ie)}a(Oe,"_initPluginChain");function ve(ie){var le=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[HN]===ie&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[to](Be)}),!Ne&&we[Cn]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ie),!Ne)return-1}),Ne&&(le={plugin:Ne,setEnabled:a(function(Be){uL(Ne)[DCe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=uL(Ne);return!Be[F1]&&!Be[DCe]},"isEnabled"),remove:a(function(Be,tt){Be===void 0&&(Be=!0);var st=[Ne],Et={reason:1,isAsync:Be};Pe(st,Et,function(kt){kt&&Oe({reason:32,removed:st}),tt&&tt(kt)})},"remove")}),le}a(ve,"_getPlugin");function Fe(){if(!d){var ie=(x||[]).slice();Qo(ie,A)===-1&&ie[to](A),d=MU(y7e(ie),e.cfg,U)}return d}a(Fe,"_getPluginChain");function Pe(ie,le,Ne){if(ie&&ie[Cn]>0){var we=MU(ie,e.cfg,U),Be=pse(we,U);Be[wCe](function(){var tt=!1,st=[];Ct(f,function(kt,Ht){tKr(kt,ie)?tt=!0:st[to](kt)}),f=st,D=null,P=null;var Et=[];h&&(Ct(h,function(kt,Ht){var jt=[];Ct(kt,function(Ie){tKr(Ie,ie)?tt=!0:jt[to](Ie)}),Et[to](jt)}),h=Et),Ne&&Ne(tt),ne()}),Be[U0](le)}else Ne(!1)}a(Pe,"_removePlugins");function Z(){if(n&&n.queue){var ie=n.queue.slice(0);n.queue[Cn]=0,Ct(ie,function(le){var Ne={name:y||"InternalMessageId: "+le[Woe],iKey:w,time:Xoe(new Date),baseType:lse.dataType,baseData:{message:le[$N]}};U.track(Ne)})}}a(Z,"_flushInternalLogs");function ee(ie,le,Ne,we){var Be=1,tt=!1,st=null;we=we||5e3;function Et(){Be--,tt&&Be===0&&(st&&st[jN](),st=null,le&&le(tt),le=null)}if(a(Et,"doCallback"),m&&m[Cn]>0){var kt=ae()[GN](m);kt.iterate(function(Ht){if(Ht.flush){Be++;var jt=!1;Ht.flush(ie,function(){jt=!0,Et()},Ne)||jt||(ie&&st==null?st=wp(function(){st=null,Et()},we):Et())}})}return tt=!0,Et(),!0}a(ee,"_flushChannels");function K(){var ie;qe(e[qN](function(le){var Ne=le.cfg.enablePerfMgr;if(Ne){var we=le.cfg[WUe];(ie!==we||!ie)&&(we||(we=Qmo),XUe(le.cfg,WUe,we),ie=we,l=null),!c&&!l&&Mr(we)&&(l=we(U,U[xCe]()))}else l=null,ie=null}))}a(K,"_initPerfManager");function fe(ie){var le=zCe(Fe(),U);le[wCe](ne),(!U._updateHook||U._updateHook(le,ie)!==!0)&&le[U0](ie)}a(fe,"_doUpdate");function X(ie){var le=U[qu];le?(Ta(le,2,73,ie),ne()):Wc(ie)}a(X,"_logOrThrowError");function ue(ie){var le=U[xCe]();le&&le[xU]([ie],2)}a(ue,"_notifyInvalidEvent");function qe(ie){v.add(ie)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var PP="",Vmo="NoResponseBody",iKr="&"+Vmo+"=true",DDt="POST",b7e=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Ci(t,this,function(E,_){var v=!0;j(),E[iL]=function(M,O){o=O,n&&Ta(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=rse();O&&O.protocol&&O.protocol[MW]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[Cn]?R(M,O):null},E.getFallbackInst=function(){return d},E[TU]=function(M,O){j()},E.preparePayload=function(M,O,q,Q){if(!O||Q||!q[Q1]){M(q);return}try{var U=Ri("CompressionStream");if(!Mr(U)){M(q);return}var z=new ReadableStream({start:a(function(re){re.enqueue(Ai(q[Q1])?new TextEncoder().encode(q[Q1]):q[Q1]),re.close()},"start")}),W=z.pipeThrough(new U("gzip")),$=W.getReader(),J=[],ne=0,H=!1;return pl($.read(),a(function re(ae){if(!H&&!ae.rejected){var Oe=ae[oL];if(!Oe.done)return J[to](Oe[oL]),ne+=Oe.value[Cn],pl($.read(),re);for(var ve=new Uint8Array(ne),Fe=0,Pe=0,Z=J;Pe0&&(Ct(Fu(ve),function(K){H.append(K,ve[K])}),Fe[kCe]=H),u?Fe.credentials=u:v&&s&&(Fe.credentials="include"),q&&(Fe.keepalive=!0,e+=re,s?M._sendReason===2&&(ae=!0,A&&(U+=iKr)):ae=!0);var Pe=new Request(U,Fe);try{Pe[dDt]=!0}catch{}if(!q&&r&&($=Td(function(K,fe){J=K,ne=fe})),!U){w(O),J&&J(!1);return}function Z(K,fe){fe?x(O,s?0:fe,{},s?PP:K):x(O,s?0:400,{},s?PP:K)}a(Z,"_handleError");function ee(K,fe,X){var ue=K[wP],qe=c.fetchOnComplete;qe&&Mr(qe)?qe(K,O,X||PP,fe):x(O,ue,{},X||PP)}a(ee,"_onFetchComplete");try{pl(fetch(s?U:Pe,s?Fe:null),function(K){if(q&&(e-=re,re=0),!Oe)if(Oe=!0,K.rejected)Z(K.reason&&K.reason[$N],499),ne&&ne(K.reason);else{var fe=K[oL];try{!s&&!fe.ok?(fe[wP]?Z(fe.statusText,fe[wP]):Z(fe.statusText,499),J&&J(!1)):s&&!fe.body?(ee(fe,null,PP),J&&J(!0)):pl(fe.text(),function(X){ee(fe,M,X[oL]),J&&J(!0)})}catch(X){fe&&fe[wP]?Z(lr(X),fe[wP]):Z(lr(X),499),ne&&ne(X)}}})}catch(K){Oe||(Z(lr(K),499),ne&&ne(K))}return ae&&!Oe&&(Oe=!0,x(O,200,{}),J&&J(!0)),s&&!Oe&&M[LW]>0&&y&&y.set(function(){Oe||(Oe=!0,x(O,500,{}),J&&J(!0))},M[LW]),$}a(L,"_doFetchSender");function B(M,O,q){var Q=tf(),U=new XDomainRequest,z=M[Q1];U.onload=function(){var H=zN(U),re=c&&c.xdrOnComplete;re&&Mr(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?PP:t7e(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",$=M[zoe];if(!$){w(O);return}if(!s&&$.lastIndexOf(W,0)!==0){var J="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Ta(o,2,40,". "+J),T(J,O);return}var ne=s?$:$[xP](/^(https?:)/,"");U.open(DDt,ne),M[LW]&&(U[LW]=M[LW]),U.send(z),s&&q?y&&y.set(function(){U.send(z)},0):U.send(z)}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 dKr="on",oKr="attachEvent",sKr="addEventListener",aKr="detachEvent",cKr="removeEventListener",NDt="events",ZCe="visibilitychange",T7e="pagehide",fKr="pageshow",pKr="unload",hKr="beforeunload",mKr=WI("aiEvtPageHide"),gKr=WI("aiEvtPageShow"),Wmo=/\.[\.]+/g,zmo=/[\.]+$/,Ymo=1,S7e=a7e("events"),Kmo=/^([^.]*)(?:\.(.+)|)/;function lKr(t){return t&&t[xP]?t[xP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Es):t}a(lKr,"_normalizeNamespace");function MDt(t,e){if(e){var r=Es;cr(e)?(r=Es,Ct(e,function(o){o=lKr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=lKr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Es)+r)}var n=Kmo.exec(t||Es)||[];return{type:n[1],ns:(n[2]||Es).replace(Wmo,".").replace(zmo,Es)[sL](".").sort().join(".")}}a(MDt,"_getEvtNamespace");function AKr(t,e,r){r===void 0&&(r=!0);var n=S7e.get(t,NDt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(AKr,"_getRegisteredEvents");function yKr(t,e,r,n){t&&e&&e[aL]&&(t[cKr]?t[cKr](e[aL],r,n):t[aKr]&&t[aKr](dKr+e[aL],r))}a(yKr,"_doDetach");function Jmo(t,e,r,n){var o=!1;return t&&e&&e[aL]&&r&&(t[sKr]?(t[sKr](e[aL],r,n),o=!0):t[oKr]&&(t[oKr](dKr+e[aL],r),o=!0)),o}a(Jmo,"_doAttach");function uKr(t,e,r,n){for(var o=e[Cn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[K2t].ns)&&(!n||n(s))&&(yKr(t,s[K2t],s.handler,s.capture),e[$I](o,1))}}a(uKr,"_doUnregister");function Zmo(t,e,r){if(e[aL])uKr(t,AKr(t,e[aL]),e,r);else{var n=S7e.get(t,NDt,{});zr(n,function(o,s){uKr(t,s,e,r)}),Fu(n)[Cn]===0&&S7e.kill(t,NDt)}}a(Zmo,"_unregisterEvents");function LU(t,e){var r;return e?(cr(e)?r=[t].concat(e):r=[t,e],r=MDt("xx",r).ns[sL](".")):r=t,r}a(LU,"mergeEvtNamespace");function KCe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=MDt(e,n);if(s=Jmo(t,c,r,o),s&&S7e.accept(t)){var l={guid:Ymo++,evtName:c,handler:r,capture:o};AKr(t,c.type)[to](l)}}catch{}return s}a(KCe,"eventOn");function JCe(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=MDt(e,n),c=!1;Zmo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||yKr(t,s,r,o)}catch{}}a(JCe,"eventOff");function ODt(t,e,r){var n=!1,o=tf();o&&(n=KCe(o,t,e,r),n=KCe(o.body,t,e,r)||n);var s=ef();return s&&(n=KCe(s,t,e,r)||n),n}a(ODt,"addEventHandler");function BDt(t,e,r){var n=tf();n&&(JCe(n,t,e,r),JCe(n.body,t,e,r));var o=ef();o&&JCe(o,t,e,r)}a(BDt,"removeEventHandler");function mse(t,e,r,n){var o=!1;return e&&t&&t[Cn]>0&&Ct(t,function(s){s&&(!r||Qo(r,s)===-1)&&(o=ODt(s,e,n)||o)}),o}a(mse,"_addEventListeners");function LDt(t,e,r,n){var o=!1;return e&&t&&cr(t)&&(o=mse(t,e,r,n),!o&&r&&r[Cn]>0&&(o=mse(t,e,null,n))),o}a(LDt,"addEventListeners");function GW(t,e,r){t&&cr(t)&&Ct(t,function(n){n&&BDt(n,e,r)})}a(GW,"removeEventListeners");function I7e(t,e,r){return LDt([hKr,pKr,T7e],t,e,r)}a(I7e,"addPageUnloadEventListener");function x7e(t,e){GW([hKr,pKr,T7e],t,e)}a(x7e,"removePageUnloadEventListener");function XCe(t,e,r){function n(c){var l=ef();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=LU(mKr,r),s=mse([T7e],t,e,o);return(!e||Qo(e,ZCe)===-1)&&(s=mse([ZCe],n,e,o)||s),!s&&e&&(s=XCe(t,null,r)),s}a(XCe,"addPageHideEventListener");function w7e(t,e){var r=LU(mKr,e);GW([T7e],t,r),GW([ZCe],null,r)}a(w7e,"removePageHideEventListener");function ebe(t,e,r){function n(c){var l=ef();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=LU(gKr,r),s=mse([fKr],t,e,o);return s=mse([ZCe],n,e,o)||s,!s&&e&&(s=ebe(t,null,r)),s}a(ebe,"addPageShowEventListener");function R7e(t,e){var r=LU(gKr,e);GW([fKr],t,r),GW([ZCe],null,r)}a(R7e,"removePageShowEventListener");p();var gse="",EKr="https://browser.events.data.microsoft.com/OneCollector/1.0/",FDt="version",P7e="properties";p();p();var UDt="initialize",QDt="indexOf",ZN="timings",qDt="pollInternalLogs",H1="value",k7e="length",D7e="processTelemetryStart";var dL,_Kr="4.3.10",tbe="1DS-Web-JS-"+_Kr,vKr=Bve.hasOwnProperty;var cgo=(dL={},dL[0]=0,dL[2]=6,dL[1]=1,dL[3]=7,dL[4098]=6,dL[4097]=1,dL[4099]=7,dL);var lgo=LB(),ugo=soe();function YI(t){return!(t===gse||Zt(t))}a(YI,"isValueAssigned");function jDt(t){if(t){var e=eu(t,"-");if(e>-1)return IN(t,e)}return gse}a(jDt,"getTenantId");function HDt(t){return!!(t&&_h(t)&&t>=1&&t<=4)}a(HDt,"isLatency");function GDt(t,e,r){if(!e&&!YI(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||cr(e))e={value:e};else if(n==="object"&&!vKr.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Zt(e[H1])||e[H1]===gse||!Ai(e[H1])&&!_h(e[H1])&&!mP(e[H1])&&!cr(e[H1]))return null;if(cr(e[H1])&&!bKr(e[H1]))return null;if(!Zt(e.kind)){if(cr(e[H1])||!CKr(e.kind))return null;e[H1]=e[H1].toString()}return e}a(GDt,"sanitizeProperty");function rbe(t,e,r){var n=-1;if(!kn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),dgo(r))n===-1&&(n=0),n|=r;else{var o=cgo[N7e(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(rbe,"getCommonSchemaMetaData");function Ase(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[k7e],d=arguments;for(mP(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(CKr,"isValueKind");function dgo(t){return t>=0&&t<=9}a(dgo,"isDataType");function bKr(t){return t[k7e]>0}a(bKr,"isArrayValid");function M7e(t,e){var r=t;r[ZN]=r[ZN]||{},r[ZN][D7e]=r[ZN][D7e]||{},r[ZN][D7e][e]=G1()}a(M7e,"setProcessTelemetryTimings");function N7e(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===FI&&(e=4,cr(t)?(e=4096,t[k7e]>0&&(e|=N7e(t[0]))):vKr.call(t,"value")&&(e=8192|N7e(t[H1])))}return e}a(N7e,"getFieldValueType");function $Dt(){return!!Ri("chrome")}a($Dt,"isChromium");function $W(t){return t>0}a($W,"isGreaterThanZero");var fgo=i_({endpointUrl:EKr,propertyStorageOverride:{isVal:pgo}});function pgo(t){return t&&(!t.getProperty||!t.setProperty)&&Wc("Invalid property storage override passed."),!0}a(pgo,"_chkPropOverride");var VDt=(function(t){Py(e,t);function e(){var r=t.call(this)||this;return Ci(e,r,function(n,o){n[UDt]=function(s,c,l,u){Dp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[UDt](kp(s,fgo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=lr(h);f[QDt]("channels")!==-1&&(f+=` + - Channels must be provided through config.channels only!`),Ta(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){Dp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[ZN]=c[ZN]||{},c[ZN].trackStart=G1(),HDt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=tbe;var u=c.baseData=c.baseData||{};u[P7e]=u[P7e]||{};var d=u[P7e];d[FDt]=d[FDt]||n.pluginVersionString||gse}o.track(c)},function(){return{item:s}},!s.sync)},n[qDt]=function(s){return o[qDt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(C7e);p();p();var nbe="REAL_TIME",SKr="NEAR_REAL_TIME",TKr="BEST_EFFORT";p();p();p();var kP="";var O7e="drop",IKr="send",WDt="requeue",xKr="rspFail",wKr="oth",zDt="no-cache, no-store",B7e="application/x-json-stream",ibe="cache-control",yse="content-type",RKr="kill-tokens",PKr="kill-duration";var kKr="time-delta-millis",L7e="client-version",YDt="client-id",F7e="time-delta-to-apply-millis",U7e="upload-time",Q7e="apikey",obe="AuthMsaDeviceTicket",KDt="WebAuthToken",JDt="AuthXToken";var DKr="NoResponseBody",Ese="msfpc",ZDt="trace",q7e="user";p();var sbe="allowRequestSending",j7e="shouldAddClockSkewHeaders",H7e="getClockSkewHeaderValue",abe="setClockSkew",qo="length",XN="concat",$1="iKey",qf="count",eM="events",Q0="push",tM="split",G7e="toLowerCase",VW="hdrs",$7e="useHdrs",WW="initialize",V7e="setTimeoutOverride",W7e="clearTimeoutOverride",NKr="payloadPreprocessor",XDt="overrideEndpointUrl",eNt="avoidOptions",MKr="disableEventTimings",z7e="enableCompoundKey",tNt="disableXhrSync",rNt="disableFetchKeepAlive",OKr="addNoResponse",nNt="useSendBeacon",iNt="fetchCredentials",oNt="alwaysUseXhrOverride",Y7e="serializeOfflineEvt",K7e="getOfflineRequestDetails",J7e="createPayload",cbe="createOneDSPayload",sNt="payloadBlob",DP="headers",_se="_thePayload",My="batches",iC="sendType",lbe="canSendRequest",vse="sendQueuedRequests",ube="setUnloading",BKr="isTenantKilled",Z7e="sendSynchronousBatch",X7e="_transport",Cse="getWParam",aNt="isBeacon",dbe="timings",eQe="isTeardown",tQe="_sendReason",rQe="setKillSwitchTenants",nQe="_backOffTransmission",fbe="identifier",LKr="ignoreMc1Ms0CookieProcessing",cNt="autoFlushEventsLimit",FKr="disableAutoBatchFlushLimit",UKr="overrideInstrumentationKey",pbe="sendAttempt",FU="latency",zW="sync";function qKr(t){var e=(t.ext||{}).intweb;return e&&YI(e[Ese])?e[Ese]:null}a(qKr,"_getEventMsfpc");function QKr(t){for(var e=null,r=0;e===null&&rfl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var mgo=.8,ggo=1.2,GKr=3e3,Ago=6e5;function $Kr(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a($Kr,"retryPolicyShouldRetryForStatus");function iQe(t){var e=0,r=GKr*mgo,n=GKr*ggo,o=w1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,H9(e,Ago)}a(iQe,"retryPolicyGetMillisToBackoffForRetry");p();var ygo=20,Ego=3145728,WKr=65e3,zKr=2e6,_go=H9(zKr,WKr),VKr="metadata",oQe="f",vgo=/\./,YKr=(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||rbe,_=Cgo(l),v=sQe(_.requestLimit,Ego,0),b=sQe(_.requestLimit,WKr,1),T=sQe(_.recordLimit,zKr,0),w=Math.min(sQe(_.recordLimit,_go,1),b);Ci(t,this,function(R){R.createPayload=function(D,N,L,B,j,M){return{apiKeys:[],payloadBlob:kP,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&&Dp(e,function(){return"Serializer:appendPayload"},function(){for(var j=N.events(),M=D.payloadBlob,O=D.numEvents,q=!1,Q=[],U=[],z=D.isBeacon,W=z?b:v,$=z?w:T,J=0,ne=0;J=L){D.overflow=N.split(J);break}var re=R.getEventBlob(H);if(re&&re.length<=$){var ae=re.length,Oe=M.length;if(Oe+ae>W){D.overflow=N.split(J);break}M&&(M+=` +`),M+=re,ne++,ne>ygo&&(v9e(M,0,1),ne=0),q=!0,O++}else re?Q.push(H):U.push(H),j.splice(J,1),J--}J++}if(Q.length>0&&D.sizeExceed.push(UU.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(UU.create(N.iKey(),U)),q){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ve=N.iKey();Qo(D.apiKeys,ve)===-1&&D.apiKeys.push(ve)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Dp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+jDt(D.iKey);var L={},B;y||(B=a(function(q,Q,U){bgo(E,L,q,Q,U)},"_addMetadataCallback"));var j=D[f];j&&(N[f]=L,zr(j,function(q,Q){var U=L[q]={};P(Q,U,"ext."+q,!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=coe(D,"ext.metadata")||coe(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function P(D,N,L,B,j,M,O){zr(D,function(q,Q){var U=null;if(Q||YI(Q)){var z=L,W=q,$=j,J=N;if(h&&!B&&vgo.test(q)){var ne=q.split("."),H=ne.length;if(H>1){$&&($=$.slice());for(var re=0;re0&&n<=e)return n}return e}a(sQe,"_validateSizeLimit");function Cgo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(Cgo,"_getSizeLimtCfg");function bgo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[VKr];c||(c=e[VKr]={f:{}});var l=c[oQe];if(l||(l=c[oQe]={}),r)for(var u=0;u0)for(var o=e[G7e](),s=0;s0&&(n&&uNt[e]?(t[VW][uNt[e]]=r,t[$7e]=!0):t.url+="&"+e+"="+r)}a(Sse,"_addRequestDetails");function xgo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[Y7e]=function(de){try{if(b)return b.getEventBlob(de)}catch{}return kP},H[K7e]=function(){try{var de=b&&b[J7e](0,!1,!1,!1,1,0);return we(de,x)}catch{}return null},H[cbe]=function(de,Se){try{var Le=[];Ct(de,function(se){Se&&(se=WN(se));var pe=UU.create(se[$1],[se]);Le[Q0](pe)});for(var te=null;Le[qo]>0&&b;){var Te=Le.shift();Te&&Te[qf]()>0&&(te=te||b[J7e](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ne))}var Ge=we(te,x),Y={data:te[sNt],urlString:Ge.url,headers:Ge[VW],timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(aQe(Y[DP],ibe)||(Y[DP][ibe]=zDt),aQe(Y[DP],yse)||(Y[DP][yse]=B7e)),Y}catch{}return null};function ae(de,Se){try{return $&&$.getSenderInst(de,Se)}catch{}return null}a(ae,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Oe(),s,ne]};function Oe(){try{var de={xdrOnComplete:ve,fetchOnComplete:Pe,xhrOnComplete:Z,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:J,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:z,addNoResponse:j,senderOnCompleteCallBack:de};return Se}catch{}return null}a(Oe,"_getSendPostMgrConfig");function ve(de,Se,Le){var te=zN(de);ee(Se,200,{},te),F(te)}a(ve,"_xdrOncomplete");function Fe(){var de;s=null,c=new HKr,l=!1,u=new jKr,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=de,N=de,L=de,B=de,j=de,M=[],O=de,q=de,Q=[],U=!1,z=bse(),W=!1,$=null,ne=null}a(Fe,"_initDefaults");function Pe(de,Se,Le,te){var Te=a(function(se,pe,Ce){ee(Se,se,pe,Ce),F(Ce)},"handleResponse"),Ge={},Y=de[DP];Y&&Y.forEach(function(se,pe){Ge[pe]=se}),Te(de.status,Ge,Le||kP)}a(Pe,"_fetchOnComplete");function Z(de,Se,Le){var te=zN(de);ee(Se,de.status,kU(de,!0),te),F(te)}a(Z,"_xhrOnComplete");function ee(de,Se,Le,te){try{de(Se,Le,te)}catch(Te){Ta(m,2,518,lr(Te))}}a(ee,"_doOnComplete");function K(de,Se,Le){var te=de,Te=200,Ge=te[_se],Y=de.urlString+(j?Sgo:kP);try{var se=Uu();if(Ge){var pe=!!A.getPlugin("LocalStorage"),Ce=[],He=[];Ct(Ge[My],function($e){if(Ce&&$e&&$e[qf]()>0)for(var Xe=$e[eM](),ct=0;ct0&&(Ge.sentEvts=He),pe||be(Ce,8003,Ge[iC],!0)}else Te=0}catch($e){KN(m,"Failed to send telemetry using sendBeacon API. Ex:"+lr($e)),Te=0}finally{ee(Se,Te,{},kP)}}a(K,"_onBeaconRetry");function fe(de){return de===2||de===3}a(fe,"_isBeaconPayload");function X(de){return R&&fe(de)&&(de=2),de}a(X,"_adjustSendType"),H.addHeader=function(de,Se){_[de]=Se},H.removeHeader=function(de){delete _[de]},H[lbe]=function(){return ue()&&u[sbe]()},H[vse]=function(de,Se){kn(de)&&(de=0),R&&(de=X(de),Se=2),ie(v,de,0)&&Ne(qe(),0,!1,de,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[qo]===0},H[ube]=function(de){R=de},H.addBatch=function(de){if(de&&de[qf]()>0){if(c.isTenantKilled(de[$1]()))return!1;v[Q0](de)}return!0},H.teardown=function(){v[qo]>0&&Ne(qe(),0,!0,2,2),Ct(M,function(de){de&&de.rm&&de.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[vse](0,4)},H[Z7e]=function(de,Se,Le){de&&de[qf]()>0&&(Zt(Se)&&(Se=1),R&&(Se=X(Se),Le=2),Ne([de],0,!1,Se,Le||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Le>0||u[sbe]())),te}a(ie,"_canSendPayload");function le(de){var Se={};return de&&Ct(de,function(Le,te){Se[te]={iKey:Le[$1](),evts:Le[eM]()}}),Se}a(le,"_createDebugBatches");function Ne(de,Se,Le,te,Te){if(!(!de||de[qo]===0)){if(l){be(de,1,te);return}te=X(te);try{var Ge=de,Y=te!==0;Dp(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(de=de.slice(0));for(var pe=[],Ce=null,He=G1(),$e=g[te]||(Y?g[1]:g[0]),Xe=$e&&$e[X7e],ct=B&&(R||fe(te)||Xe===3||$e._isSync&&Xe===2);ie(de,te,Se);){var bt=de.shift();bt&&bt[qf]()>0&&(c.isTenantKilled(bt[$1]())?pe[Q0](bt):(Ce=Ce||b[J7e](Se,Le,Y,ct,Te,te),b.appendPayload(Ce,bt,ne)?Ce.overflow!==null&&(de=[Ce.overflow][XN](de),Ce.overflow=null,tt(Ce,He,G1(),Te),He=G1(),Ce=null):(tt(Ce,He,G1(),Te),He=G1(),de=[bt][XN](de),Ce=null)))}Ce&&tt(Ce,He,G1(),Te),de[qo]>0&&(v=de[XN](v)),be(pe,8004,te)},function(){return{batches:le(Ge),retryCount:Se,isTeardown:Le,isSynchronous:Y,sendReason:Te,useSendBeacon:fe(te),sendType:te}},!Y)}catch(se){Ta(m,2,48,"Unexpected Exception sending batch: "+lr(se))}}}a(Ne,"_sendBatches");function we(de,Se){var Le={url:s,hdrs:{},useHdrs:!1};Se?(Le[VW]=Ase(Le[VW],_),Le.useHdrs=Fu(Le.hdrs)[qo]>0):zr(_,function(se,pe){dNt[se]?Sse(Le,dNt[se],pe,!1):(Le[VW][se]=pe,Le[$7e]=!0)}),Sse(Le,YDt,"NO_AUTH",Se),Sse(Le,L7e,tbe,Se);var te=kP;Ct(de.apiKeys,function(se){te[qo]>0&&(te+=","),te+=se}),Sse(Le,Q7e,te,Se),Sse(Le,U7e,fl().toString(),Se);var Te=Ie(de);if(YI(Te)&&(Le.url+="&ext.intweb.msfpc="+Te),u[j7e]()&&Sse(Le,F7e,u[H7e](),Se),A[Cse]){var Ge=A[Cse]();Ge>=0&&(Le.url+="&w="+Ge)}for(var Y=0;Y0){var Te=!!O,Ge=g[de.sendType];!fe(de[iC])&&de[aNt]&&de.sendReason===2&&(Ge=g[2]||g[3]||Ge);var Y=x;(de.isBeacon||Ge[X7e]===3)&&(Y=!1);var se=we(de,Y);Y=Y||se[$7e];var pe=G1();Dp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[lNt]++:ct[lNt]=1}be(de[My],1e3+(te||0),de[iC],!0);var ht={data:de[sNt],urlString:se.url,headers:se[VW],_thePayload:de,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};Y&&(aQe(ht[DP],ibe)||(ht[DP][ibe]=zDt),aQe(ht[DP],yse)||(ht[DP][yse]=B7e));var We=null;Ge&&(We=a(function(ce){u.firstRequestSent();var Re=a(function(ge,oe){Et(ge,oe,de,te)},"onComplete"),Me=de[eQe]||de.isSync;$.preparePayload(function(ge){try{Ge.sendPOST(ge,Re,Me),q&&q(ht,ge,Me,de[aNt])}catch(oe){ee(Re,0,{}),KN(m,"Unexpected exception sending payload. Ex:"+lr(oe))}},D,ce,Me)},"sender")),Dp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(de[iC]===0&&f++,Te&&!de.isBeacon&&Ge[X7e]!==3){var ce={data:ht.data,urlString:ht.urlString,headers:Ase({},ht[DP]),timeout:ht.timeout,disableXhrSync:ht[tNt],disableFetchKeepAlive:ht[rNt]},Re=!1;Dp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ce,function(Me){Re=!0,!y&&!Me[_se]&&(Me[_se]=Me[_se]||ht[_se],Me[tQe]=Me[tQe]||ht[tQe]),We(Me)},de.isSync||de[eQe])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:de,serializationStart:Se,serializationCompleted:Le,sendReason:te}},de.isSync)}de.sizeExceed&&de.sizeExceed[qo]>0&&be(de.sizeExceed,8003,de[iC]),de.failedEvts&&de.failedEvts[qo]>0&&be(de.failedEvts,8002,de[iC])}a(tt,"_doPayloadSend");function st(de,Se){T&&Ct(de,function(Le){var te=Le[dbe]=Le[dbe]||{};Be(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function Et(de,Se,Le,te){var Te=9e3,Ge=null,Y=!1,se=!1;try{var pe=!0;if(typeof de!==N1){if(Se){u[abe](Se[kKr]);var Ce=Se[PKr]||Se["kill-duration-seconds"];Ct(c[rQe](Se[RKr],Ce),function($e){Ct(Le[My],function(Xe){if(Xe[$1]()===$e){Ge=Ge||[];var ct=Xe[tM](0);Le.numEvents-=ct[qf](),Ge[Q0](ct)}})})}if(de==200||de==204){Te=200;return}(!$Kr(de)||Le.numEvents<=0)&&(pe=!1),Te=9e3+de%1e3}if(pe){Te=100;var He=Le.retryCnt;Le[iC]===0&&(He0&&st(Le[eM](),Se)})}}a(Ht,"_addCompleteTimings");function jt(de,Se,Le){Se?de():z.set(de,Le)}a(jt,"_doAction");function Ie(de){for(var Se=0;Se0&&o){var Te=o[Ue(Se)];if(Te){var Ge=Le!==0;Dp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){jt(function(){try{Te.call(o,de,Se,Ge,Le)}catch(Y){Ta(m,1,74,"send request notification failed: "+Y)}},te||Ge,0)},function(){return{batches:le(de),reason:Se,isSync:Ge,sendSync:te,sendType:Le}},!Ge)}}}a(be,"_sendBatchesNotification");function Ue(de){var Se=Igo[de];return YI(Se)||(Se=wKr,de>=9e3&&de<=9999?Se=xKr:de>=8e3&&de<=8999?Se=O7e:de>=1e3&&de<=1999&&(Se=IKr)),Se}a(Ue,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var Rgo=.25,XKr=500,Pgo=20,eJr=6,tJr=2,kgo=4,JKr=2,Dgo=1,fNt=1e4,JW="eventsDiscarded",ZKr="",Ih=void 0,Ngo=i_({eventsLimitInMem:{isVal:$W,v:fNt},immediateEventLimit:{isVal:$W,v:500},autoFlushEventsLimit:{isVal:$W,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:Mgo,v:Ih},overrideInstrumentationKey:Ih,overrideEndpointUrl:Ih,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Ih,clearTimeoutOverride:Ih,payloadPreprocessor:Ih,payloadListener:Ih,disableEventTimings:Ih,valueSanitizer:Ih,stringifyObjects:Ih,enableCompoundKey:Ih,disableOptimizeObj:!1,fetchCredentials:Ih,transports:Ih,unloadTransports:Ih,useSendBeacon:Ih,disableFetchKeepAlive:Ih,avoidOptions:!1,xhrTimeout:Ih,disableXhrSync:Ih,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:_h,v:eJr},maxUnloadEventRetryAttempts:{isVal:_h,v:tJr},addNoResponse:Ih,maxEvtPerBatch:{isVal:_h,v:XKr},excludeCsMetaData:Ih,requestLimit:{}});function Mgo(t){return t&&t.sendPOST}a(Mgo,"isOverrideFn");var pNt=(function(t){Py(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=nbe,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,j,M,O,q,Q,U,z,W;return Ci(e,r,function($,J){fe(),$._getDbgPlgTargets=function(){return[v,n]},$[WW]=function(Y,se,pe){Dp(se,function(){return"PostChannel:initialize"},function(){J[WW](Y,se,pe),q=se.getNotifyMgr();try{B=LU(WI($[fbe]),se.evtNamespace&&se.evtNamespace()),$._addHook(j1(Y,function(Ce){var He=Ce.cfg,$e=zI(null,He,se);n=$e.getExtCfg($[fbe],Ngo),j=bse(n[V7e],n[W7e]),P=!n.disableOptimizeObj&&$Dt(),M=n[LKr],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[cNt],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[FKr],W=n.maxEvtPerBatch,Fm(He.endpointUrl)?$.pause():l&&$.resume(),Ge(),U=n[UKr],z=!!n.disableTelemetry,Q&&ne();var Xe=He.disablePageUnloadEvents||[];Q=I7e(Oe,Xe,B),Q=XCe(Oe,Xe,B)||Q,Q=ebe(ve,He.disablePageShowEvents,B)||Q})),v[WW](Y,$.core,$)}catch(Ce){throw $.setInitialized(!1),Ce}},function(){return{theConfig:Y,core:se,extensions:pe}})},$.processTelemetry=function(Y,se){M7e(Y,$[fbe]),se=se||$._getTelCtx(se);var pe=Y;!z&&!o&&(U&&(pe[$1]=U),Pe(pe,!0),D?qe(2,2):K()),$.processNext(pe,se)},$.getOfflineSupport=function(){try{var Y=v&&v[K7e]();if(v)return{getUrl:a(function(){return Y?Y.url:null},"getUrl"),serialize:ae,batch:re,shouldProcess:a(function(se){return!z},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[cbe])return v[cbe](se,P)},"createOneDSPayload")}}catch{}return null},$._doTeardown=function(Y,se){qe(2,2),o=!0,v.teardown(),ne(),fe()};function ne(){x7e(null,B),w7e(null,B),R7e(null,B)}a(ne,"_removeUnloadHandlers");function H(Y){var se=Y[Cse];Y[Cse]=function(){var pe=0;return M&&(pe=pe|2),pe|se.call(Y)}}a(H,"_hookWParam");function re(Y){var se=ZKr;return Y&&Y[qo]&&Ct(Y,function(pe){se&&(se+=` +`),se+=pe}),se}a(re,"_batch");function ae(Y){var se=ZKr;try{Fe(Y),se=v[Y7e](Y)}catch{}return se}a(ae,"_serialize");function Oe(Y){var se=Y||tf().event;se.type!=="beforeunload"&&(D=!0,v[ube](D)),qe(2,2)}a(Oe,"_handleUnloadEvents");function ve(Y){D=!1,v[ube](D)}a(ve,"_handleShowEvents");function Fe(Y){Y.ext&&Y.ext[ZDt]&&delete Y.ext[ZDt],Y.ext&&Y.ext[q7e]&&Y.ext[q7e].id&&delete Y.ext[q7e].id,P&&(Y.ext=WN(Y.ext),Y.baseData&&(Y.baseData=WN(Y.baseData)),Y.data&&(Y.data=WN(Y.data)))}a(Fe,"_cleanEvent");function Pe(Y,se){if(Y[pbe]||(Y[pbe]=0),Y[FU]||(Y[FU]=1),Fe(Y),Y[zW]){if(E||l)Y[FU]=3,Y[zW]=!1;else if(v){P&&(Y=WN(Y)),v[Z7e](UU.create(Y[$1],[Y]),Y[zW]===!0?1:Y[zW],3);return}}var pe=Y[FU],Ce=f,He=h;pe===4&&(Ce=u,He=d);var $e=!1;if(CeY;if(!pe&&w>0)for(var Ce=1;!pe&&Ce<=3;Ce++){var He=b[Ce];He&&He[My]&&Ct(He[My],function($e){$e&&$e[qf]()>=w&&(pe=!0)})}Ne(!0,pe)},$.pause=function(){ue(),l=!0,v&&v.pause()},$.resume=function(){l=!1,v&&v.resume(),K()},$._loadTransmitProfiles=function(Y){Ht(),zr(Y,function(se,pe){var Ce=pe[qo];if(Ce>=2){var He=Ce>2?pe[2]:0;if(pe.splice(0,Ce-2),pe[1]<0&&(pe[0]=-1),pe[1]>0&&pe[0]>0){var $e=pe[0]/pe[1];pe[0]=jVr($e)*pe[1]}He>=0&&pe[1]>=0&&He>pe[1]&&(He=pe[1]),pe[Q0](He),m[se]=pe}})},$.flush=function(Y,se,pe){Y===void 0&&(Y=!0);var Ce;if(!l)if(pe=pe||1,Y)se||(Ce=Td(function($e){se=$e})),c==null?(ue(),st(1,0,pe),c=X(function(){c=null,Et(se,pe)},0)):s[Q0](se);else{var He=ue();Z(1,1,pe),se&&se(),He&&K()}return Ce},$.setMsaAuthTicket=function(Y){v.addHeader(obe,Y)},$.setAuthPluginHeader=function(Y){v.addHeader(KDt,Y)},$.removeAuthPluginHeader=function(){v.removeHeader(KDt)},$.hasEvents=ee,$._setTransmitProfile=function(Y){g!==Y&&m[Y]!==void 0&&(ue(),g=Y,K())},PU($,function(){return v},["addResponseHandler"]);function Z(Y,se,pe){var Ce=st(Y,se,pe);return v[vse](se,pe),Ce}a(Z,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[vse](0,x),u>0&&!y&&!l){var Y=m[g][2];Y>=0&&(y=X(function(){y=null,Z(4,0,1),K()},Y))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=X(function(){A=null,Z(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),$[nQe]=function(){E0&&f>T&&(se=!0),se&&c==null&&$.flush(Y,function(){},20))}a(Ne,"_performAutoFlush");function we(Y,se){P&&(Y=WN(Y));var pe=Y[FU],Ce=le(Y[$1],pe,!0);return Ce.addEvent(Y)?(pe!==4?(f++,se&&Y[pbe]===0&&Ne(!Y.sync,w>0&&Ce[qf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Be(Y,se,pe,Ce){for(;pe<=se;){var He=le(Y,se,!0);if(He&&He[qf]()>0){var $e=He[tM](0,Ce),Xe=$e[qf]();if(Xe>0)return pe===4?u-=Xe:f-=Xe,Ue(JW,[$e],QN.QueueFull),!0}pe++}return tt(),!1}a(Be,"_dropEventWithLatencyOrLess");function tt(){for(var Y=0,se=0,pe=a(function(He){var $e=b[He];$e&&$e[My]&&Ct($e[My],function(Xe){He===4?Y+=Xe[qf]():se+=Xe[qf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)pe(Ce);f=se,u=Y}a(tt,"_resetQueueCounts");function st(Y,se,pe){var Ce=!1,He=se===0;return!He||v[lbe]()?Dp($.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],Xe=4;Xe>=Y;){var ct=b[Xe];ct&&ct.batches&&ct.batches[qo]>0&&(Ct(ct[My],function(bt){v.addBatch(bt)?Ce=Ce||bt&&bt[qf]()>0:$e=$e[XN](bt[eM]()),Xe===4?u-=bt[qf]():f-=bt[qf]()}),ct[My]=[],ct.iKeyMap={}),Xe--}$e[qo]>0&&be(JW,$e,QN.KillSwitch),Ce&&R>=Y&&(R=-1,x=0)},function(){return{latency:Y,sendType:se,sendReason:pe}},!He):(R=R>=0?H9(R,Y):Y,x=gP(x,pe)),Ce}a(st,"_queueBatches");function Et(Y,se){Z(1,0,se),tt(),kt(function(){Y&&Y(),s[qo]>0?c=X(function(){c=null,Et(s.shift(),se)},0):(c=null,K())})}a(Et,"_flushImpl");function kt(Y){v.isCompletelyIdle()?Y():c=X(function(){c=null,kt(Y)},Rgo)}a(kt,"_waitForIdleManager");function Ht(){ue(),jt(),g=nbe,K()}a(Ht,"_resetTransmitProfiles");function jt(){m={},m[nbe]=[2,1,0],m[SKr]=[6,3,0],m[TKr]=[18,9,0]}a(jt,"_initializeProfiles");function Ie(Y,se){var pe=[],Ce=N;D&&(Ce=L),Ct(Y,function(He){He&&He[qf]()>0&&Ct(He[eM](),function($e){$e&&($e[zW]&&($e[FU]=4,$e[zW]=!1),$e[pbe]0&&be(JW,pe,QN.NonRetryableStatus),D&&qe(2,2)}a(Ie,"_requeueEvents");function F(Y,se){var pe=q||{},Ce=pe[Y];if(Ce)try{Ce.apply(pe,se)}catch(He){Ta($.diagLog(),1,74,Y+" notification failed: "+He)}}a(F,"_callNotification");function be(Y,se){for(var pe=[],Ce=2;Ce0&&F(Y,[se][XN](pe))}a(be,"_notifyEvents");function Ue(Y,se){for(var pe=[],Ce=2;Ce0&&Ct(se,function(He){He&&He[qf]()>0&&F(Y,[He.events()][XN](pe))})}a(Ue,"_notifyBatchEvents");function de(Y,se,pe){Y&&Y[qo]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,pe!==!0])}a(de,"_sendingEvent");function Se(Y,se){Ue("eventsSent",Y,se),K()}a(Se,"_eventsSentEvent");function Le(Y,se){Ue(JW,Y,se>=8e3&&se<=8999?se-8e3:QN.Unknown)}a(Le,"_eventsDropped");function te(Y){Ue(JW,Y,QN.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(Y,se){Ue(JW,Y,QN.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=gP(W*(JKr+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(hse);var V1=he(require("os"));var cQe=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=Ogo(e),this.commonProperties=Bgo(e),this.#e=ys(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new VDt,n=new pNt,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){Dr.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){Dr.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(Fr).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Dr.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(fr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function Ogo(t){let e={},r=t.get(Oa);e["ai.session.id"]=r.sessionId;let n=t.get(Nf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${V1.type()} ${V1.release()}`,e["ai.device.osArchitecture"]=V1.arch(),e["ai.device.osPlatform"]=V1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(is).getVersion(),e}a(Ogo,"getTags");function Bgo(t){let e={};e.common_os=V1.platform(),e.common_platformversion=V1.release(),e.common_arch=V1.arch(),e.common_cpu=Array.from(new Set(V1.cpus().map(n=>n.model))).join();let r=t.get(Oa);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(Bgo,"getCommonProperties");var Lgo="7d7048df-6dd0-4048-bb23-b716c1461f8f",Fgo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",Ugo="f0000000-0000-0000-0000-000000000000",Qgo="b73649cf-ca8f-4768-9e0e-b789d8529db5",qgo="5fb6107a-6a29-423f-a824-22e3724fa2a6",jgo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function Hgo(t){return L9(t)==="prod"?Qgo:qgo}a(Hgo,"getMsftInstrumentationKey");function rJr(t){return new URL(t).hostname==="github.com"?GV.telemetry:t.replace("://","://copilot-telemetry-service.")}a(rJr,"getEndpointForServerUrl");var xh=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=rJr(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];ys(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(P0);if(o.setReporter(new NW(r,this.namespace,{instrumentationKey:Lgo,endpointUrl:n})),o.setRestrictedReporter(new NW(r,this.namespace,{instrumentationKey:Fgo,endpointUrl:n})),o.setFTReporter(new NW(r,this.namespace,{instrumentationKey:Ugo,endpointUrl:n,includeAuthorizationHeader:!0})),o.setMsftReporter(new NW(r,`copilot/${this.namespace}`,{instrumentationKey:Hgo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new cQe(r,"ThirdParty.copilot-chat",jgo,!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(P0);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(P0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=rJr(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function Ggo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Bf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(xh).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return Xg.exception(t,n,"signUpLimited failed"),!1}}a(Ggo,"apiFetchSignUpLimited");async function mNt(t,e,r){let n=await t.get(Ut).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await Ggo(t,e)?mNt(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(mNt,"getTokenWithSignUpLimited");p();p();var nJr=he(ti());var ro=class extends nJr.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var $go={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},Mn=class{constructor(){this.capabilities={...$go};this.emitter=new ro;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 fL=require("fs"),Tse=require("os"),Ise=he(require("path")),QU=require("process");var bi=class{static{a(this,"PersistenceManager")}},gNt=class extends bi{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 fL.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Ise.dirname(s);c!==this.directory&&await fL.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await hbe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await fL.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 hbe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` `;l===`{} -`?await SL.promises.rm(o):await SL.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 Lbe.acquire(n),await SL.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await SL.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 SL.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},Lbe=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 myo(){if(XU.env.XDG_CONFIG_HOME&&Gse.isAbsolute(XU.env.XDG_CONFIG_HOME))return XU.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Hse.platform)()==="win32"){let e=XU.env.USERPROFILE||XNt.homedir();return e?e+"\\AppData\\Local\\github-copilot":cZr()}let t=XU.env.HOME&&XU.env.HOME.length>0?XU.env.HOME:XNt.homedir();return t?t+"/.config/github-copilot":cZr()}a(myo,"getXdgConfigPath");var XNt={homedir:Hse.homedir,tmpdir:Hse.tmpdir};function cZr(){return Gse.join(XNt.tmpdir(),"github-copilot")}a(cZr,"tmpdirConfigPath");function lZr(){return new ZNt(myo())}a(lZr,"makeXdgPersistenceManager");p();var as=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}}},LQe=class extends as{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var uZr={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function dZr(t,e){gt(t,uZr.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(dZr,"telemetryAuthPickerListed");function eMt(t,e){gt(t,uZr.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(eMt,"telemetryAuthPickerUsed");p();var $se={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked"};function fZr(t,e){gi(t,$se.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(fZr,"telemetryAuthStoreInitialize");function pZr(t,e){gi(t,$se.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(pZr,"telemetryAuthStoreError");function hZr(t,e){gi(t,$se.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(hZr,"telemetryAuthStoreMigration");function tMt(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)),gt(t,$se.SessionActivated,r,{durationMs:e.durationMs})}a(tMt,"telemetryAuthSessionActivated");function mZr(t,e){gt(t,$se.SessionDeactivated,{editorId:e.editorId})}a(mZr,"telemetryAuthSessionDeactivated");function rMt(t,e){gt(t,$se.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(rMt,"telemetryAuthTokenRevoked");var gyo="apps",gZr="hosts",qm=new ge("AuthManager"),AZr="legacy_files_migration_done",Ayo=5,yyo=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(D0).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"),qm.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(as).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 JNt(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(Zo).requireReady();let{session:r,sourceEnvVar:n}=iMt(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),{session:{...r,...Sy(r)},sourceEnvVar:n};let o=await this.transientSession;return o?o.accessToken===void 0?{session:void 0}:{session:{...o,...Sy(o)}}:{session:await this.resolvePersistedSession({authAuthority:e})}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},FQe=class extends Ur{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(MN)}async tracked(r,n){try{return await n()}catch(o){throw qm.exception(this.ctx,o,`authStore.${r}`),pZr(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Lr).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=tU(this.ctx,r.authAuthority)}catch(o){qm.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:_yo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(AZr))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(Si),h=this.editorId(),[m,g]=await Promise.all([f.readAll(gyo).catch(()=>({})),f.readAll(gZr).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=yZr(y);if(!E){c++;continue}let[_,v]=Eyo(A)??["github.com",Vse],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!APt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:nMt(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=yZr(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(!APt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Vse,scopes:nMt(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(AZr,String(Date.now())))}catch{}this.ctx.get(Si).deleteSetting(gZr).catch(()=>{}),hZr(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),qm.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(),c=s.slice(0,Ayo);if(qm.debug(this.ctx,`tryAutoAdopt: editorId=${n} totalTokens=${s.length} candidates=${c.length}`),c.length===0)return;let l=this.ctx.get(gh);for(let u of c){let d=this.tokenRecordToSession(u.record);if(!d){qm.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${u.tokenId}; continuing walk`),await this.revokeTokenById(u.tokenId,"corrupt_authority");continue}let f;try{f=await l.fetchTokenResult(this.ctx,d)}catch{qm.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${u.tokenId}; aborting walk`);return}if(f.copilotToken||f.failureKind==="NotAuthorized"){qm.info(this.ctx,`tryAutoAdopt: adopting tokenId=${u.tokenId} crossEditor=${u.sourceEditorId!==n} noCopilotAccess=${f.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,u.tokenId))}catch(h){qm.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${u.tokenId} (${h?.message??h}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(u.tokenId),tMt(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:u.sourceEditorId!==n,durationMs:Date.now()-o}),d}if(f.failureKind==="HTTP401"){qm.info(this.ctx,`tryAutoAdopt: revoking invalid tokenId=${u.tokenId}; continuing walk`);let h=await this.tracked("revoke",()=>r.deleteTokenCascade(u.tokenId));rMt(this.ctx,{editorId:n,trigger:"bad_credentials",affectedEditors:h.affectedEditors});continue}qm.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${u.tokenId} kind=${f.failureKind}; aborting walk`);return}qm.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new Ai("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new Ai("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();qm.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:nMt(r.scopes)}));qm.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),tMt(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=tU(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 qm.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),mZr(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){qm.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return qm.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),rMt(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 eMt(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;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{d="NotSignedIn"}let f;switch(d){case"OK":f="ok";break;case"NotAuthorized":f="not_entitled";break;default:this._copilotTokenManager.getActiveTokenId()===void 0?(await this._copilotTokenManager.awaitPendingCascadeRevoke(),f="revoked"):f="transient";break}return eMt(this.ctx,{editorId:o,status:f,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:f}}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 dZr(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(Mn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o);if(!l&&!s&&!c&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){qm.debug(this.ctx,`resolvePersistedSession: no active session editorId=${o}`);return}let u=tU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==u.authAuthority||r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId)return;let d=this.tokenRecordToSession(l.record);if(!d){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let f=Date.now();return f-this.lastTouchAt>=yyo&&(this.lastTouchAt=f,n.touchActiveSession(o).catch(()=>{})),d}};function Eyo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(Eyo,"splitAppsKey");function _yo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(_yo,"normalizeScopes");function nMt(t){return t?typeof t=="string"?t:t.join(" "):""}a(nMt,"scopesToString");function yZr(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(yZr,"asLegacyAuthRecord");function iMt(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...Sy({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:{...Sy({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:{...Sy({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(iMt,"getSessionFromEnv");p();var Cyo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],EZr="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.",_Zr="https://gh.io/copilot-network-errors",lv=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&Cyo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new ge("certificates").error(e,`${EZr} Please visit ${_Zr} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(sa).showWarningMessage(EZr,n).then(o=>{if(o?.title===n.title)return e.get(N0).open(_Zr)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var rA=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 rx(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(rx,"delay");function Wse(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Wse,"fireAndForget");function zse(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(zse,"safeInit");var oMt=class extends Ai{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 no;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new no;this.onDidResetToken=this.didResetToken.event;this.pendingCascadeRevoke=Promise.resolve()}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(gh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),gWr(this.ctx).value){UQe(this.ctx,"skipped",-1);return}let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(UQe(this.ctx,"scheduled",r),this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(UQe(this.ctx,"started",r),this.startTokenRefresh(n=>{UQe(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 Jg.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(as).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(CZr(this.ctx))throw this.tokenPrimingError=r,r;Jg.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(as);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"});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"}),this.cascadeRevokeActiveToken();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(lv).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=X9(),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?gi(this.ctx,"auth.token_reset_complete",e.exception,s,l):gt(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=X9(),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 oMt(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}cascadeRevokeActiveToken(){let e=this.activeTokenId;e!==void 0&&(this.activeTokenId=void 0,this.pendingCascadeRevoke=this.ctx.get(Ur).revokeTokenById(e,"bad_credentials").then(r=>{Jg.debug(this.ctx,`cascadeRevoke: revoked tokenId ${e}, affectedEditors=${r.affectedEditors}`)}).catch(r=>{Jg.exception(this.ctx,r,"cascadeRevoke")}))}async awaitPendingCascadeRevoke(){await this.pendingCascadeRevoke}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){Jg.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}r!==void 0?(ht(this.ctx,"auth.reset_token_"+r),Jg.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):Jg.debug(this.ctx,`Resetting copilot token (caller: ${e})`);let o=X9(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;gt(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&&!this.tokenPromise)&&(this.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire())}getLastToken(){return this.lastToken}};function FI(t){return t.get(Qt).getLastToken()}a(FI,"getLastCopilotToken");function UQe(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?gi(t,"auth.proactive_copilot_token_refresh",o,s,c):gt(t,"auth.proactive_copilot_token_refresh",s,c)}a(UQe,"telemetryProactiveCopilotTokenRefresh");p();var dM=class{static{a(this,"Clock")}now(){return new Date}};p();var Qk=class{static{a(this,"ExpConfigMaker")}},Fbe=class extends Qk{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(ar),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 XC.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return XC.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return _s(r,m,"fetchExperiments"),XC.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 XC(f.Parameters,d.AssignmentContext,h.join(";"))}},QQe=class extends Qk{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(XC.createEmptyConfig())}};p();p();var qQe=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},sMt=class extends qQe{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},vZr=a(t=>new sMt(t),"DEFAULT_GRANULARITY"),jQe=class extends qQe{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 bZr="X-Copilot-ClientTimeBucket",HQe=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=vZr(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 jQe(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(bZr,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(bZr,s))}}};p();p();p();p();var aMt=new Map;async function byo(t){if(aMt.has(t))return aMt.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return aMt.set(t,e),e}a(byo,"getCachedHmacKey");async function Syo(t){if(t)try{let e=await byo(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(Syo,"createRequestHMAC");async function SZr(t,e){let r=await Syo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(SZr,"createMsBenchHmacHeaders");p();p();p();p();var $Qe="4.13.1",gz="04b07795-8ddb-461a-bbee-02f9e1bf7b46",TZr="common",GQe;(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"})(GQe||(GQe={}));var Ube=GQe.AzurePublicCloud,IZr="login.microsoftonline.com",xZr=["*"],wZr="cae",RZr="nocae",kZr="msal.cache";var cMt;var Tyo,VQe,DZr;function NZr(){return VQe!==void 0&&DZr!==void 0}a(NZr,"hasVSCodePlugin");function Iyo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(cMt===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||kZr;e.cache.cachePlugin=cMt({name:`${r}.${RZr}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=cMt({name:`${r}.${wZr}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=wyo(t.isVSCodeCredential||!1)),e}a(Iyo,"generatePluginConfiguration");var PZr={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")},xyo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return DZr}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return Tyo}}};function wyo(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=xyo[t?"vsCode":"native"];if(o===void 0)throw new Error(PZr.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(PZr.unavailable(e,r));return o.broker}a(wyo,"getBrokerPlugin");var MZr={generatePluginConfiguration:Iyo};p();p();p();function Ryo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(Ryo,"isErrorResponse");var BZr="CredentialUnavailableError",Dn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=BZr}},WQe="AuthenticationError",e7=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(Ryo(r))o=OZr(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=OZr(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. +`?await fL.promises.rm(o):await fL.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 hbe.acquire(n),await fL.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await fL.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 fL.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},hbe=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 Vgo(){if(QU.env.XDG_CONFIG_HOME&&Ise.isAbsolute(QU.env.XDG_CONFIG_HOME))return QU.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Tse.platform)()==="win32"){let e=QU.env.USERPROFILE||ANt.homedir();return e?e+"\\AppData\\Local\\github-copilot":iJr()}let t=QU.env.HOME&&QU.env.HOME.length>0?QU.env.HOME:ANt.homedir();return t?t+"/.config/github-copilot":iJr()}a(Vgo,"getXdgConfigPath");var ANt={homedir:Tse.homedir,tmpdir:Tse.tmpdir};function iJr(){return Ise.join(ANt.tmpdir(),"github-copilot")}a(iJr,"tmpdirConfigPath");function oJr(){return new gNt(Vgo())}a(oJr,"makeXdgPersistenceManager");p();var os=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}}},lQe=class extends os{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var sJr={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function aJr(t,e){_t(t,sJr.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(aJr,"telemetryAuthPickerListed");function yNt(t,e){_t(t,sJr.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(yNt,"telemetryAuthPickerUsed");p();var xse={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked"};function cJr(t,e){gi(t,xse.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(cJr,"telemetryAuthStoreInitialize");function lJr(t,e){gi(t,xse.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(lJr,"telemetryAuthStoreError");function uJr(t,e){gi(t,xse.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(uJr,"telemetryAuthStoreMigration");function ENt(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)),_t(t,xse.SessionActivated,r,{durationMs:e.durationMs})}a(ENt,"telemetryAuthSessionActivated");function dJr(t,e){_t(t,xse.SessionDeactivated,{editorId:e.editorId})}a(dJr,"telemetryAuthSessionDeactivated");function _Nt(t,e){_t(t,xse.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(_Nt,"telemetryAuthTokenRevoked");var Wgo="apps",fJr="hosts",jm=new Ee("AuthManager"),pJr="legacy_files_migration_done",zgo=5,Ygo=6e4,Fr=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(Ut)}getConfiguredUrls(){return this.ctx.get(D0).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"),jm.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(os).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 mNt(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(zo).requireReady();let{session:r,sourceEnvVar:n}=CNt(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),{session:{...r,...Lm(r)},sourceEnvVar:n};let o=await this.transientSession;return o?o.accessToken===void 0?{session:void 0}:{session:{...o,...Lm(o)}}:{session:await this.resolvePersistedSession({authAuthority:e})}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},uQe=class extends Fr{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(TN)}async tracked(r,n){try{return await n()}catch(o){throw jm.exception(this.ctx,o,`authStore.${r}`),lJr(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Lr).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=j9(this.ctx,r.authAuthority)}catch(o){jm.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:Jgo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(pJr))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(bi),h=this.editorId(),[m,g]=await Promise.all([f.readAll(Wgo).catch(()=>({})),f.readAll(fJr).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=hJr(y);if(!E){c++;continue}let[_,v]=Kgo(A)??["github.com",wse],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!OPt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:vNt(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=hJr(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(!OPt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??wse,scopes:vNt(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(pJr,String(Date.now())))}catch{}this.ctx.get(bi).deleteSetting(fJr).catch(()=>{}),uJr(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),jm.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(),c=s.slice(0,zgo);if(jm.debug(this.ctx,`tryAutoAdopt: editorId=${n} totalTokens=${s.length} candidates=${c.length}`),c.length===0)return;let l=this.ctx.get(Ah);for(let u of c){let d=this.tokenRecordToSession(u.record);if(!d){jm.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${u.tokenId}; continuing walk`),await this.revokeTokenById(u.tokenId,"corrupt_authority");continue}let f;try{f=await l.fetchTokenResult(this.ctx,d)}catch{jm.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${u.tokenId}; aborting walk`);return}if(f.copilotToken||f.failureKind==="NotAuthorized"){jm.info(this.ctx,`tryAutoAdopt: adopting tokenId=${u.tokenId} crossEditor=${u.sourceEditorId!==n} noCopilotAccess=${f.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,u.tokenId))}catch(h){jm.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${u.tokenId} (${h?.message??h}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(u.tokenId),ENt(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:u.sourceEditorId!==n,durationMs:Date.now()-o}),d}if(f.failureKind==="HTTP401"){jm.info(this.ctx,`tryAutoAdopt: revoking invalid tokenId=${u.tokenId}; continuing walk`);let h=await this.tracked("revoke",()=>r.deleteTokenCascade(u.tokenId));_Nt(this.ctx,{editorId:n,trigger:"bad_credentials",affectedEditors:h.affectedEditors});continue}jm.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${u.tokenId} kind=${f.failureKind}; aborting walk`);return}jm.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new Jn("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new Jn("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();jm.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:vNt(r.scopes)}));jm.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),ENt(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=j9(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 jm.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),dJr(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){jm.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return jm.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),_Nt(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 yNt(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;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{d="NotSignedIn"}let f;switch(d){case"OK":f="ok";break;case"NotAuthorized":f="not_entitled";break;default:this._copilotTokenManager.getActiveTokenId()===void 0?(await this._copilotTokenManager.awaitPendingCascadeRevoke(),f="revoked"):f="transient";break}return yNt(this.ctx,{editorId:o,status:f,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:f}}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 aJr(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(Mn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o);if(!l&&!s&&!c&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){jm.debug(this.ctx,`resolvePersistedSession: no active session editorId=${o}`);return}let u=j9(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==u.authAuthority||r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId)return;let d=this.tokenRecordToSession(l.record);if(!d){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let f=Date.now();return f-this.lastTouchAt>=Ygo&&(this.lastTouchAt=f,n.touchActiveSession(o).catch(()=>{})),d}};function Kgo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(Kgo,"splitAppsKey");function Jgo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(Jgo,"normalizeScopes");function vNt(t){return t?typeof t=="string"?t:t.join(" "):""}a(vNt,"scopesToString");function hJr(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(hJr,"asLegacyAuthRecord");function CNt(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...Lm({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:{...Lm({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:{...Lm({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(CNt,"getSessionFromEnv");p();var Zgo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],mJr="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.",gJr="https://gh.io/copilot-network-errors",oC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&Zgo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new Ee("certificates").error(e,`${mJr} Please visit ${gJr} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ra).showWarningMessage(mJr,n).then(o=>{if(o?.title===n.title)return e.get(N0).open(gJr)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var iA=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 KI(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(KI,"delay");function Rse(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Rse,"fireAndForget");function Pse(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Pse,"safeInit");var bNt=class extends Jn{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Ut=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 ro;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new ro;this.onDidResetToken=this.didResetToken.event;this.pendingCascadeRevoke=Promise.resolve()}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Fr).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(Ah).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),fVr(this.ctx).value){dQe(this.ctx,"skipped",-1);return}let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(dQe(this.ctx,"scheduled",r),this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(dQe(this.ctx,"started",r),this.startTokenRefresh(n=>{dQe(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 Xg.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(os).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(AJr(this.ctx))throw this.tokenPrimingError=r,r;Xg.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(os);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"});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"}),this.cascadeRevokeActiveToken();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(oC).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=Q9(),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?gi(this.ctx,"auth.token_reset_complete",e.exception,s,l):_t(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=Q9(),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 bNt(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}cascadeRevokeActiveToken(){let e=this.activeTokenId;e!==void 0&&(this.activeTokenId=void 0,this.pendingCascadeRevoke=this.ctx.get(Fr).revokeTokenById(e,"bad_credentials").then(r=>{Xg.debug(this.ctx,`cascadeRevoke: revoked tokenId ${e}, affectedEditors=${r.affectedEditors}`)}).catch(r=>{Xg.exception(this.ctx,r,"cascadeRevoke")}))}async awaitPendingCascadeRevoke(){await this.pendingCascadeRevoke}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){Xg.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}r!==void 0?(yt(this.ctx,"auth.reset_token_"+r),Xg.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):Xg.debug(this.ctx,`Resetting copilot token (caller: ${e})`);let o=Q9(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;_t(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&&!this.tokenPromise)&&(this.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire())}getLastToken(){return this.lastToken}};function DI(t){return t.get(Ut).getLastToken()}a(DI,"getLastCopilotToken");function dQe(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?gi(t,"auth.proactive_copilot_token_refresh",o,s,c):_t(t,"auth.proactive_copilot_token_refresh",s,c)}a(dQe,"telemetryProactiveCopilotTokenRefresh");p();var rM=class{static{a(this,"Clock")}now(){return new Date}};p();var NP=class{static{a(this,"ExpConfigMaker")}},mbe=class extends NP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(fr),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 Yv.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return Yv.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return La(r,m,"fetchExperiments"),Yv.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 Yv(f.Parameters,d.AssignmentContext,h.join(";"))}},fQe=class extends NP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(Yv.createEmptyConfig())}};p();p();var pQe=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},SNt=class extends pQe{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},yJr=a(t=>new SNt(t),"DEFAULT_GRANULARITY"),hQe=class extends pQe{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 EJr="X-Copilot-ClientTimeBucket",mQe=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=yJr(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 hQe(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(EJr,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(EJr,s))}}};p();p();p();p();var TNt=new Map;async function eAo(t){if(TNt.has(t))return TNt.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return TNt.set(t,e),e}a(eAo,"getCachedHmacKey");async function tAo(t){if(t)try{let e=await eAo(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(tAo,"createRequestHMAC");async function _Jr(t,e){let r=await tAo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(_Jr,"createMsBenchHmacHeaders");p();p();p();p();var AQe="4.13.1",ZW="04b07795-8ddb-461a-bbee-02f9e1bf7b46",vJr="common",gQe;(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"})(gQe||(gQe={}));var gbe=gQe.AzurePublicCloud,CJr="login.microsoftonline.com",bJr=["*"],SJr="cae",TJr="nocae",IJr="msal.cache";var INt;var rAo,yQe,wJr;function RJr(){return yQe!==void 0&&wJr!==void 0}a(RJr,"hasVSCodePlugin");function nAo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(INt===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||IJr;e.cache.cachePlugin=INt({name:`${r}.${TJr}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=INt({name:`${r}.${SJr}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=oAo(t.isVSCodeCredential||!1)),e}a(nAo,"generatePluginConfiguration");var xJr={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")},iAo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return wJr}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return rAo}}};function oAo(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=iAo[t?"vsCode":"native"];if(o===void 0)throw new Error(xJr.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(xJr.unavailable(e,r));return o.broker}a(oAo,"getBrokerPlugin");var PJr={generatePluginConfiguration:nAo};p();p();p();function sAo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(sAo,"isErrorResponse");var DJr="CredentialUnavailableError",Dn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=DJr}},EQe="AuthenticationError",qU=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(sAo(r))o=kJr(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=kJr(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=WQe}},LZr="AggregateAuthenticationError",Qbe=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=EQe}},NJr="AggregateAuthenticationError",Abe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` `);super(`${r} -${n}`),this.errors=e,this.name=LZr}};function OZr(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(OZr,"convertOAuthErrorResponseToErrorResponse");var nx=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 FZr=require("node:os"),UZr=ce(require("node:util"),1),QZr=ce(require("node:process"),1);function qZr(t,...e){QZr.stderr.write(`${UZr.default.format(t,...e)}${FZr.EOL}`)}a(qZr,"log");var jZr=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,HZr,lMt=[],uMt=[],zQe=[];jZr&&dMt(jZr);var GZr=Object.assign(t=>$Zr(t),{enable:dMt,enabled:fMt,disable:kyo,log:qZr});function dMt(t){HZr=t,lMt=[],uMt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?uMt.push(new RegExp(`^${n.substr(1)}$`)):lMt.push(new RegExp(`^${n}$`));for(let n of zQe)n.enabled=fMt(n.namespace)}a(dMt,"enable");function fMt(t){if(t.endsWith("*"))return!0;for(let e of uMt)if(e.test(t))return!1;for(let e of lMt)if(e.test(t))return!0;return!1}a(fMt,"enabled");function kyo(){let t=HZr||"";return dMt(""),t}a(kyo,"disable");function $Zr(t){let e=Object.assign(r,{enabled:fMt(t),destroy:Pyo,log:GZr.log,namespace:t,extend:Dyo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),zQe.push(e),e}a($Zr,"createDebugger");function Pyo(){let t=zQe.indexOf(this);return t>=0?(zQe.splice(t,1),!0):!1}a(Pyo,"destroy");function Dyo(t){let e=$Zr(`${this.namespace}:${t}`);return e.log=this.log,e}a(Dyo,"extend");var Yse=GZr;var WZr=new Set,YQe=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,JQe,pMt=Yse("azure");pMt.log=(...t)=>{Yse.log(...t)};var hMt=["verbose","info","warning","error"];YQe&&(KZr(YQe)?Nyo(YQe):console.error(`AZURE_LOG_LEVEL set to unknown log level '${YQe}'; logging is not enabled. Acceptable values: ${hMt.join(", ")}.`));function Nyo(t){if(t&&!KZr(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${hMt.join(",")}`);JQe=t;let e=[];for(let r of WZr)YZr(r)&&e.push(r.namespace);Yse.enable(e.join(","))}a(Nyo,"setLogLevel");function ZQe(){return JQe}a(ZQe,"getLogLevel");var VZr={verbose:400,info:300,warning:200,error:100};function t7(t){let e=pMt.extend(t);return zZr(pMt,e),{error:KQe(e,"error"),warning:KQe(e,"warning"),info:KQe(e,"info"),verbose:KQe(e,"verbose")}}a(t7,"createClientLogger");function zZr(t,e){e.log=(...r)=>{t.log(...r)}}a(zZr,"patchLogMethod");function KQe(t,e){let r=Object.assign(t.extend(e),{level:e});if(zZr(t,r),YZr(r)){let n=Yse.disable();Yse.enable(n+","+r.namespace)}return WZr.add(r),r}a(KQe,"createLogger");function YZr(t){return!!(JQe&&VZr[t.level]<=VZr[JQe])}a(YZr,"shouldEnable");function KZr(t){return hMt.includes(t)}a(KZr,"isAzureLogLevel");var tS=t7("identity");function XQe(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(XQe,"processEnvVars");function q0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(q0,"formatSuccess");function Os(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(Os,"formatError");function JZr(t,e,r=tS){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(JZr,"credentialLoggerInstance");function lo(t,e=tS){let r=JZr(t,void 0,e);return{...r,parent:e,getToken:JZr("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var Kse={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function ZZr(t={}){let e=new mMt(t.parentContext);return t.span&&(e=e.setValue(Kse.span,t.span)),t.namespace&&(e=e.setValue(Kse.namespace,t.namespace)),e}a(ZZr,"createTracingContext");var mMt=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 XZr=ce(gMt(),1),tqe=XZr.state;function Myo(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(Myo,"createDefaultTracingSpan");function Oyo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:Myo(),tracingContext:ZZr({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(Oyo,"createDefaultInstrumenter");function qbe(){return tqe.instrumenterImplementation||(tqe.instrumenterImplementation=Oyo()),tqe.instrumenterImplementation}a(qbe,"getInstrumenter");p();function jbe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=qbe().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(Kse.namespace)||(A=A.setValue(Kse.namespace,e)),y.setAttribute("az.namespace",A.getValue(Kse.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 qbe().withContext(d,f,...h)}a(c,"withContext");function l(d){return qbe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return qbe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(jbe,"createTracingClient");var Nc=jbe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:$Qe});var AMt=lo("ChainedTokenCredential"),Hbe=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 Nc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new Qbe(s,"ChainedTokenCredential authentication failed.");throw AMt.getToken.info(Os(e,l)),l}if(AMt.getToken.info(`Result for ${o.constructor.name}: ${q0(e)}`),n===null)throw new Dn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var aS={};wi(aS,{AuthError:()=>Bo,AuthErrorCodes:()=>Aae,AzureCloudInstance:()=>wL,ClientAssertion:()=>NL,ClientAuthError:()=>o7,ClientAuthErrorCodes:()=>Np,ClientConfigurationError:()=>iae,ClientConfigurationErrorCodes:()=>sae,ConfidentialClientApplication:()=>Mae,CryptoProvider:()=>gM,DistributedCachePlugin:()=>Uje,InteractionRequiredAuthError:()=>iS,InteractionRequiredAuthErrorCodes:()=>Bqe,LogLevel:()=>sf,Logger:()=>H0,ManagedIdentityApplication:()=>Oae,ManagedIdentitySourceNames:()=>io,PromptValue:()=>IIo,ProtocolMode:()=>Dy,PublicClientApplication:()=>Dae,ResponseMode:()=>xIo,ServerError:()=>f_,TokenCache:()=>_ae,TokenCacheContext:()=>rS,internals:()=>G5t,version:()=>sS});p();var G5t={};wi(G5t,{Deserializer:()=>PL,Serializer:()=>r7});p();p();var r7=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 sn={};wi(sn,{addApplicationTelemetry:()=>n1e,addAuthorizationCode:()=>y5t,addBrokerParameters:()=>xL,addCcsOid:()=>TL,addCcsUpn:()=>s7,addClaims:()=>xz,addCliData:()=>C5t,addClientAssertion:()=>s1e,addClientAssertionType:()=>a1e,addClientCapabilitiesToClaims:()=>iXr,addClientId:()=>Tz,addClientInfo:()=>Rz,addClientSecret:()=>o1e,addCodeChallengeParams:()=>qEo,addCodeVerifier:()=>_5t,addCorrelationId:()=>wz,addDeviceCode:()=>jEo,addDomainHint:()=>m5t,addEARParameters:()=>WEo,addExtraParameters:()=>IL,addGrantType:()=>c1e,addIdTokenHint:()=>h5t,addInstanceAware:()=>l1e,addLibraryInfo:()=>r1e,addLoginHint:()=>cae,addLogoutHint:()=>v5t,addNativeBroker:()=>QEo,addNonce:()=>A5t,addOboAssertion:()=>HEo,addPassword:()=>VEo,addPopToken:()=>u1e,addPostLogoutRedirectUri:()=>p5t,addPrompt:()=>g5t,addRedirectUri:()=>Iz,addRefreshToken:()=>E5t,addRequestTokenUse:()=>GEo,addResource:()=>h1e,addResponseMode:()=>f5t,addResponseType:()=>UEo,addScopes:()=>Sz,addServerTelemetry:()=>f1e,addSid:()=>Tqe,addSshJwk:()=>d1e,addState:()=>i1e,addThrottling:()=>p1e,addUsername:()=>$Eo,instrumentBrokerParams:()=>bz});p();var Xt={};wi(Xt,{AADAuthority:()=>qk,AAD_INSTANCE_DISCOVERY_ENDPT:()=>vMt,AAD_TENANT_DOMAIN_SUFFIX:()=>bMt,ADFS:()=>_Mt,APP_METADATA:()=>tae,AUTHORITY_METADATA_CACHE_KEY:()=>rae,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>UMt,AUTHORIZATION_PENDING:()=>Uyo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>xMt,AuthenticationScheme:()=>of,AuthorityMetadataSource:()=>Py,CACHE_ACCOUNT_TYPE_ADFS:()=>LMt,CACHE_ACCOUNT_TYPE_GENERIC:()=>lqe,CACHE_ACCOUNT_TYPE_MSAV1:()=>iEo,CACHE_ACCOUNT_TYPE_MSSTS:()=>BMt,CACHE_KEY_SEPARATOR:()=>yz,CIAM_AUTH_URL:()=>rqe,CLIENT_INFO:()=>FMt,CLIENT_INFO_SEPARATOR:()=>eae,CLIENT_MISMATCH_ERROR:()=>YMt,CODE_GRANT_TYPE:()=>Lyo,CONSUMER_UTID:()=>Byo,CacheOutcome:()=>jk,CacheType:()=>oEo,ClaimsRequestKeys:()=>Xse,CodeChallengeMethodValues:()=>rEo,CredentialType:()=>j0,DEFAULT_AUTHORITY:()=>eXr,DEFAULT_AUTHORITY_HOST:()=>EMt,DEFAULT_COMMON_TENANT:()=>Gbe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>VMt,DEFAULT_THROTTLE_TIME_SECONDS:()=>$Mt,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>KMt,DSTS:()=>CMt,EMAIL_SCOPE:()=>nXr,EncodingTypes:()=>lEo,FORWARD_SLASH:()=>Jse,GrantType:()=>Wbe,HTTP_BAD_REQUEST:()=>aqe,HTTP_CLIENT_ERROR:()=>Gyo,HTTP_CLIENT_ERROR_RANGE_END:()=>DMt,HTTP_CLIENT_ERROR_RANGE_START:()=>PMt,HTTP_GATEWAY_TIMEOUT:()=>Zyo,HTTP_GONE:()=>zyo,HTTP_MULTI_SIDED_ERROR:()=>Xyo,HTTP_NOT_FOUND:()=>Vyo,HTTP_REDIRECT:()=>Hyo,HTTP_REQUEST_TIMEOUT:()=>Wyo,HTTP_SERVER_ERROR:()=>Kyo,HTTP_SERVER_ERROR_RANGE_END:()=>MMt,HTTP_SERVER_ERROR_RANGE_START:()=>NMt,HTTP_SERVICE_UNAVAILABLE:()=>Jyo,HTTP_SUCCESS:()=>sqe,HTTP_SUCCESS_RANGE_END:()=>jyo,HTTP_SUCCESS_RANGE_START:()=>qyo,HTTP_TOO_MANY_REQUESTS:()=>Yyo,HTTP_UNAUTHORIZED:()=>$yo,HeaderNames:()=>Dp,HttpMethod:()=>eEo,IMDS_ENDPOINT:()=>oqe,IMDS_TIMEOUT:()=>IMt,IMDS_VERSION:()=>TMt,INVALID_GRANT_ERROR:()=>zMt,INVALID_INSTANCE:()=>kMt,JsonWebTokenTypes:()=>aEo,KNOWN_PUBLIC_CLOUDS:()=>RMt,NOT_APPLICABLE:()=>$be,NOT_AVAILABLE:()=>Az,OAuthResponseType:()=>nEo,OFFLINE_ACCESS_SCOPE:()=>iqe,OIDC_DEFAULT_SCOPES:()=>Zse,OIDC_SCOPES:()=>cqe,ONE_DAY_IN_MS:()=>cEo,OPENID_SCOPE:()=>tXr,PROFILE_SCOPE:()=>rXr,PasswordGrantConstants:()=>fqe,PersistentCacheKeys:()=>tEo,PromptValue:()=>Vbe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>wMt,RESOURCE_DELIM:()=>nqe,RegionDiscoveryOutcomes:()=>Kbe,RegionDiscoverySources:()=>i7,ResponseMode:()=>OMt,S256_CODE_CHALLENGE_METHOD:()=>Fyo,SERVER_TELEM_CACHE_KEY:()=>zbe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>dqe,SERVER_TELEM_MAX_CACHED_ERRORS:()=>qMt,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>sEo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>QMt,SERVER_TELEM_OVERFLOW_FALSE:()=>HMt,SERVER_TELEM_OVERFLOW_TRUE:()=>jMt,SERVER_TELEM_SCHEMA_VERSION:()=>uqe,SERVER_TELEM_UNKNOWN_ERROR:()=>GMt,SERVER_TELEM_VALUE_SEPARATOR:()=>n7,SHR_NONCE_VALIDITY:()=>Qyo,SKU:()=>yMt,THE_FAMILY_ID:()=>Ez,THROTTLING_PREFIX:()=>Ybe,URL_FORM_CONTENT_TYPE:()=>SMt,X_MS_LIB_CAPABILITY_VALUE:()=>WMt});p();var yMt="msal.js.common",eXr="https://login.microsoftonline.com/common/",EMt="login.microsoftonline.com",Gbe="common",_Mt="adfs",CMt="dstsv2",vMt=`${eXr}discovery/instance?api-version=1.1&authorization_endpoint=`,rqe=".ciamlogin.com",bMt=".onmicrosoft.com",nqe="|",Byo="9188040d-6c67-4c5b-b112-36a304b66dad",tXr="openid",rXr="profile",iqe="offline_access",nXr="email",Lyo="authorization_code",Fyo="S256",SMt="application/x-www-form-urlencoded;charset=utf-8",Uyo="authorization_pending",$be="N/A",Az="Not Available",Jse="/",oqe="http://169.254.169.254/metadata/instance/compute/location",TMt="2020-06-01",IMt=2e3,xMt="TryAutoDetect",wMt="login.microsoft.com",RMt=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],Qyo=240,kMt="invalid_instance",sqe=200,qyo=200,jyo=299,Hyo=302,Gyo=400,PMt=400,aqe=400,$yo=401,Vyo=404,Wyo=408,zyo=410,Yyo=429,DMt=499,Kyo=500,NMt=500,Jyo=503,Zyo=504,MMt=599,Xyo=600,eEo={GET:"GET",POST:"POST"},Zse=[tXr,rXr,iqe],cqe=[...Zse,nXr],Dp={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"},tEo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},qk={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Xse={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Vbe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},rEo={PLAIN:"plain",S256:"S256"},nEo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},OMt={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},Wbe={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"},BMt="MSSTS",LMt="ADFS",iEo="MSA",lqe="Generic",yz="-",eae=".",j0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},oEo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},tae="appmetadata",FMt="client_info",Ez="1",rae="authority-metadata",UMt=3600*24,Py={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},uqe=5,sEo=80,QMt=330,qMt=50,zbe="server-telemetry",dqe="|",n7=",",jMt="1",HMt="0",GMt="unknown_error",of={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},$Mt=60,VMt=3600,Ybe="throttling",WMt="retry-after, h429",zMt="invalid_grant",YMt="client_mismatch",fqe={username:"username",password:"password"},i7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Kbe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},jk={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},aEo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},cEo=864e5,KMt=300,lEo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var _z={};wi(_z,{ACCESS_TOKEN:()=>fEo,BROKER_CLIENT_ID:()=>Jbe,BROKER_REDIRECT_URI:()=>Aqe,CCS_HEADER:()=>_Eo,CLAIMS:()=>eOt,CLIENT_ASSERTION:()=>SOt,CLIENT_ASSERTION_TYPE:()=>TOt,CLIENT_ID:()=>fM,CLIENT_INFO:()=>AEo,CLIENT_REQUEST_ID:()=>uOt,CLIENT_SECRET:()=>bOt,CLI_DATA:()=>BOt,CODE:()=>sOt,CODE_CHALLENGE:()=>aOt,CODE_CHALLENGE_METHOD:()=>cOt,CODE_VERIFIER:()=>lOt,DEVICE_CODE:()=>vOt,DOMAIN_HINT:()=>DOt,EAR_JWE_CRYPTO:()=>MOt,EAR_JWK:()=>NOt,ERROR:()=>uEo,ERROR_DESCRIPTION:()=>dEo,EXPIRES_IN:()=>hEo,FOCI:()=>EEo,GRANT_TYPE:()=>XMt,ID_TOKEN:()=>pEo,ID_TOKEN_HINT:()=>COt,INSTANCE_AWARE:()=>nae,LOGIN_HINT:()=>POt,LOGOUT_HINT:()=>ROt,NATIVE_BROKER:()=>wOt,NONCE:()=>iOt,OBO_ASSERTION:()=>IOt,ON_BEHALF_OF:()=>yEo,POST_LOGOUT_URI:()=>_Ot,PROMPT:()=>oOt,REDIRECT_URI:()=>pqe,REFRESH_TOKEN:()=>rOt,REFRESH_TOKEN_EXPIRES_IN:()=>mEo,REQUESTED_TOKEN_USE:()=>xOt,REQ_CNF:()=>mqe,RESOURCE:()=>OOt,RESPONSE_MODE:()=>ZMt,RESPONSE_TYPE:()=>JMt,RETURN_SPA_CODE:()=>gqe,SCOPE:()=>tOt,SESSION_STATE:()=>gEo,SID:()=>kOt,STATE:()=>nOt,TOKEN_TYPE:()=>hqe,X_APP_NAME:()=>yOt,X_APP_VER:()=>EOt,X_CLIENT_CPU:()=>hOt,X_CLIENT_CURR_TELEM:()=>mOt,X_CLIENT_EXTRA_SKU:()=>CEo,X_CLIENT_LAST_TELEM:()=>gOt,X_CLIENT_OS:()=>pOt,X_CLIENT_SKU:()=>dOt,X_CLIENT_VER:()=>fOt,X_MS_LIB_CAPABILITY:()=>AOt});p();var fM="client_id",pqe="redirect_uri",JMt="response_type",ZMt="response_mode",XMt="grant_type",eOt="claims",tOt="scope",uEo="error",dEo="error_description",fEo="access_token",pEo="id_token",rOt="refresh_token",hEo="expires_in",mEo="refresh_token_expires_in",nOt="state",iOt="nonce",oOt="prompt",gEo="session_state",AEo="client_info",sOt="code",aOt="code_challenge",cOt="code_challenge_method",lOt="code_verifier",uOt="client-request-id",dOt="x-client-SKU",fOt="x-client-VER",pOt="x-client-OS",hOt="x-client-CPU",mOt="x-client-current-telemetry",gOt="x-client-last-telemetry",AOt="x-ms-lib-capability",yOt="x-app-name",EOt="x-app-ver",_Ot="post_logout_redirect_uri",COt="id_token_hint",vOt="device_code",bOt="client_secret",SOt="client_assertion",TOt="client_assertion_type",hqe="token_type",mqe="req_cnf",IOt="assertion",xOt="requested_token_use",yEo="on_behalf_of",EEo="foci",_Eo="X-AnchorMailbox",gqe="return_spa_code",wOt="nativebroker",ROt="logout_hint",kOt="sid",POt="login_hint",DOt="domain_hint",CEo="x-client-xtra-sku",Jbe="brk_client_id",Aqe="brk_redirect_uri",nae="instance_aware",NOt="ear_jwk",MOt="ear_jwe_crypto",OOt="resource",BOt="clidata";p();p();p();function yqe(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(yqe,"getDefaultErrorMessage");var Bo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?yqe(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 Cz(t,e){return new Bo(t,e||yqe(t))}a(Cz,"createAuthError");var iae=class t extends Bo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function gl(t){return new iae(t)}a(gl,"createClientConfigurationError");p();var su=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 o7=class t extends Bo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function wt(t,e){return new o7(t,e)}a(wt,"createClientAuthError");var sae={};wi(sae,{authorityMismatch:()=>REo,authorityUriInsecure:()=>FOt,cannotAllowPlatformBroker:()=>wEo,cannotSetOIDCOptions:()=>xEo,claimsRequestParsingError:()=>vEo,emptyInputScopesError:()=>QOt,invalidAuthenticationHeader:()=>IEo,invalidAuthorityMetadata:()=>GOt,invalidClaims:()=>Eqe,invalidCloudDiscoveryMetadata:()=>_qe,invalidCodeChallengeMethod:()=>bEo,invalidRequestMethodForEAR:()=>kEo,logoutRequestEmpty:()=>jOt,missingNonceAuthenticationHeader:()=>TEo,missingSshJwk:()=>Zbe,missingSshKid:()=>SEo,pkceParamsMissing:()=>HOt,redirectUriEmpty:()=>LOt,tokenRequestEmpty:()=>qOt,untrustedAuthority:()=>$Ot,urlEmptyError:()=>UOt,urlParseError:()=>oae});p();var LOt="redirect_uri_empty",vEo="claims_request_parsing_error",FOt="authority_uri_insecure",oae="url_parse_error",UOt="empty_url_error",QOt="empty_input_scopes_error",Eqe="invalid_claims",qOt="token_request_empty",jOt="logout_request_empty",bEo="invalid_code_challenge_method",HOt="pkce_params_missing",_qe="invalid_cloud_discovery_metadata",GOt="invalid_authority_metadata",$Ot="untrusted_authority",Zbe="missing_ssh_jwk",SEo="missing_ssh_kid",TEo="missing_nonce_authentication_header",IEo="invalid_authentication_header",xEo="cannot_set_OIDCOptions",wEo="cannot_allow_platform_broker",REo="authority_mismatch",kEo="invalid_request_method_for_EAR";var Np={};wi(Np,{authTimeNotFound:()=>Xbe,authorizationCodeMissingFromServerResponse:()=>a5t,bindingKeyNotRemoved:()=>MEo,cannotAppendScopeSet:()=>n5t,cannotRemoveEmptyScope:()=>r5t,clientInfoDecodingError:()=>Cqe,clientInfoEmptyError:()=>VOt,emptyInputScopeSet:()=>Sqe,endSessionEndpointNotSupported:()=>c5t,endpointResolutionError:()=>Hk,hashNotDeserialized:()=>KOt,invalidCacheEnvironment:()=>t1e,invalidCacheRecord:()=>i5t,invalidState:()=>vz,keyIdMissing:()=>l5t,maxAgeTranspired:()=>XOt,methodNotImplemented:()=>vs,misplacedResourceParam:()=>d5t,multipleMatchingAppMetadata:()=>e5t,multipleMatchingTokens:()=>PEo,nestedAppAuthBridgeDisabled:()=>LEo,networkError:()=>zOt,noAccountFound:()=>DEo,noAccountInSilentRequest:()=>e1e,noCryptoObject:()=>o5t,noNetworkConnectivity:()=>OEo,nonceMismatch:()=>ZOt,nullOrEmptyToken:()=>WOt,openIdConfigError:()=>YOt,platformBrokerError:()=>FEo,requestCannotBeMade:()=>t5t,resourceParameterRequired:()=>u5t,stateMismatch:()=>JOt,stateNotFound:()=>bqe,tokenClaimsCnfRequiredForSignedJwt:()=>s5t,tokenParsingError:()=>vqe,tokenRefreshRequired:()=>aae,unexpectedCredentialType:()=>NEo,userCanceled:()=>BEo});p();var Cqe="client_info_decoding_error",VOt="client_info_empty_error",vqe="token_parsing_error",WOt="null_or_empty_token",Hk="endpoints_resolution_error",zOt="network_error",YOt="openid_config_error",KOt="hash_not_deserialized",vz="invalid_state",JOt="state_mismatch",bqe="state_not_found",ZOt="nonce_mismatch",Xbe="auth_time_not_found",XOt="max_age_transpired",PEo="multiple_matching_tokens",e5t="multiple_matching_appMetadata",t5t="request_cannot_be_made",r5t="cannot_remove_empty_scope",n5t="cannot_append_scopeset",Sqe="empty_input_scopeset",e1e="no_account_in_silent_request",i5t="invalid_cache_record",t1e="invalid_cache_environment",DEo="no_account_found",o5t="no_crypto_object",NEo="unexpected_credential_type",aae="token_refresh_required",s5t="token_claims_cnf_required_for_signedjwt",a5t="authorization_code_missing_from_server_response",MEo="binding_key_not_removed",c5t="end_session_endpoint_not_supported",l5t="key_id_missing",OEo="no_network_connectivity",BEo="user_canceled",vs="method_not_implemented",LEo="nested_app_auth_bridge_disabled",FEo="platform_broker_error",u5t="resource_parameter_required",d5t="misplaced_resource_parameter";var xh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?su.trimArrayEntries([...e]):[],n=r?su.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw gl(QOt);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:[...Zse],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(iqe):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 cqe.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 wt(n5t)}}removeScope(e){if(!e)throw wt(r5t);this.scopes.delete(e.trim())}removeOIDCScopes(){cqe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw wt(Sqe);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 wt(Sqe);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 bz(t,e,r){if(!e)return;let n=t.get(fM);n&&t.has(Jbe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(pqe)},e)}a(bz,"instrumentBrokerParams");function UEo(t,e){t.set(JMt,e)}a(UEo,"addResponseType");function f5t(t,e){t.set(ZMt,e||OMt.QUERY)}a(f5t,"addResponseMode");function QEo(t){t.set(wOt,"1")}a(QEo,"addNativeBroker");function Sz(t,e,r=!0,n=Zse){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new xh(o);t.set(tOt,s.printScopes())}a(Sz,"addScopes");function Tz(t,e){t.set(fM,e)}a(Tz,"addClientId");function Iz(t,e){t.set(pqe,e)}a(Iz,"addRedirectUri");function p5t(t,e){t.set(_Ot,e)}a(p5t,"addPostLogoutRedirectUri");function h5t(t,e){t.set(COt,e)}a(h5t,"addIdTokenHint");function m5t(t,e){t.set(DOt,e)}a(m5t,"addDomainHint");function cae(t,e){t.set(POt,e)}a(cae,"addLoginHint");function s7(t,e){t.set(Dp.CCS_HEADER,`UPN:${e}`)}a(s7,"addCcsUpn");function TL(t,e){t.set(Dp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(TL,"addCcsOid");function Tqe(t,e){t.set("sid",e)}a(Tqe,"addSid");function xz(t,e,r){let n=iXr(e,r);try{JSON.parse(n)}catch{throw gl(Eqe)}t.set(eOt,n)}a(xz,"addClaims");function wz(t,e){t.set(uOt,e)}a(wz,"addCorrelationId");function r1e(t,e){t.set(dOt,e.sku),t.set(fOt,e.version),e.os&&t.set(pOt,e.os),e.cpu&&t.set(hOt,e.cpu)}a(r1e,"addLibraryInfo");function n1e(t,e){e?.appName&&t.set(yOt,e.appName),e?.appVersion&&t.set(EOt,e.appVersion)}a(n1e,"addApplicationTelemetry");function g5t(t,e){t.set(oOt,e)}a(g5t,"addPrompt");function i1e(t,e){e&&t.set(nOt,e)}a(i1e,"addState");function A5t(t,e){t.set(iOt,e)}a(A5t,"addNonce");function qEo(t,e,r){if(e&&r)t.set(aOt,e),t.set(cOt,r);else throw gl(HOt)}a(qEo,"addCodeChallengeParams");function y5t(t,e){t.set(sOt,e)}a(y5t,"addAuthorizationCode");function jEo(t,e){t.set(vOt,e)}a(jEo,"addDeviceCode");function E5t(t,e){t.set(rOt,e)}a(E5t,"addRefreshToken");function _5t(t,e){t.set(lOt,e)}a(_5t,"addCodeVerifier");function o1e(t,e){t.set(bOt,e)}a(o1e,"addClientSecret");function s1e(t,e){e&&t.set(SOt,e)}a(s1e,"addClientAssertion");function a1e(t,e){e&&t.set(TOt,e)}a(a1e,"addClientAssertionType");function HEo(t,e){t.set(IOt,e)}a(HEo,"addOboAssertion");function GEo(t,e){t.set(xOt,e)}a(GEo,"addRequestTokenUse");function c1e(t,e){t.set(XMt,e)}a(c1e,"addGrantType");function Rz(t){t.set(FMt,"1")}a(Rz,"addClientInfo");function C5t(t){t.set(BOt,"1")}a(C5t,"addCliData");function l1e(t){t.has(nae)||t.set(nae,"true")}a(l1e,"addInstanceAware");function IL(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(IL,"addExtraParameters");function iXr(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw gl(Eqe)}return e&&e.length>0&&(r.hasOwnProperty(Xse.ACCESS_TOKEN)||(r[Xse.ACCESS_TOKEN]={}),r[Xse.ACCESS_TOKEN][Xse.XMS_CC]={values:e}),JSON.stringify(r)}a(iXr,"addClientCapabilitiesToClaims");function $Eo(t,e){t.set(fqe.username,e)}a($Eo,"addUsername");function VEo(t,e){t.set(fqe.password,e)}a(VEo,"addPassword");function u1e(t,e){e&&(t.set(hqe,of.POP),t.set(mqe,e))}a(u1e,"addPopToken");function d1e(t,e){e&&(t.set(hqe,of.SSH),t.set(mqe,e))}a(d1e,"addSshJwk");function f1e(t,e){t.set(mOt,e.generateCurrentRequestHeaderValue()),t.set(gOt,e.generateLastRequestHeaderValue())}a(f1e,"addServerTelemetry");function p1e(t){t.set(AOt,WMt)}a(p1e,"addThrottling");function v5t(t,e){t.set(ROt,e)}a(v5t,"addLogoutHint");function xL(t,e,r){t.has(Jbe)||t.set(Jbe,e),t.has(Aqe)||t.set(Aqe,r)}a(xL,"addBrokerParameters");function WEo(t,e){t.set(NOt,encodeURIComponent(e)),t.set(MOt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(WEo,"addEARParameters");function h1e(t,e){e&&t.set(OOt,e)}a(h1e,"addResource");var nA={};wi(nA,{getDeserializedResponse:()=>zEo,mapToQueryString:()=>pM,normalizeUrlForComparison:()=>YEo,stripLeadingHashOrQuery:()=>sXr});p();function oXr(t){if(!t)return t;let e=t.toLowerCase();return su.endsWith(e,"?")?e=e.slice(0,-1):su.endsWith(e,"?/")&&(e=e.slice(0,-2)),su.endsWith(e,"/")||(e+="/"),e}a(oXr,"canonicalizeUrl");function sXr(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(sXr,"stripLeadingHashOrQuery");function zEo(t){if(!t||t.indexOf("=")<0)return null;try{let e=sXr(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw wt(KOt)}return null}a(zEo,"getDeserializedResponse");function pM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(pM,"mapToQueryString");function YEo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return oXr(n)}catch{return oXr(e)}}a(YEo,"normalizeUrlForComparison");p();p();var lae={createNewGuid:a(()=>{throw wt(vs)},"createNewGuid"),base64Decode:a(()=>{throw wt(vs)},"base64Decode"),base64Encode:a(()=>{throw wt(vs)},"base64Encode"),base64UrlEncode:a(()=>{throw wt(vs)},"base64UrlEncode"),encodeKid:a(()=>{throw wt(vs)},"encodeKid"),async getPublicKeyThumbprint(){throw wt(vs)},async removeTokenBindingKey(){throw wt(vs)},async clearKeystore(){throw wt(vs)},async signJwt(){throw wt(vs)},async hashString(){throw wt(vs)}};p();var sf;(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"})(sf||(sf={}));var KEo=50,JEo=500,kz=new Map;function ZEo(t,e){kz.delete(t),kz.set(t,e)}a(ZEo,"markAsRecentlyUsed");function XEo(t,e){let r=Date.now(),n=kz.get(t);if(n)ZEo(t,n);else if(n={logs:[],firstEventTime:r},kz.set(t,n),kz.size>KEo){let o=kz.keys().next().value;o&&kz.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>JEo&&n.logs.shift()}a(XEo,"addLogToCache");function e_o(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(e_o,"isHashedString");var H0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=sf.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:sf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:sf.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(e_o(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};XEo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${sf[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:sf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:sf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:sf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:sf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:sf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:sf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:sf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:sf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:sf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:sf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var a7="@azure/msal-common",hM="16.4.1";p();var wL={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 aXr(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(aXr,"tenantIdMatchesHomeTenant");function Pz(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:aXr(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:aXr(r,t)}}a(Pz,"buildTenantProfile");function Iqe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=Pz(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(Iqe,"updateAccountTenantProfileData");var xqe={};wi(xqe,{checkMaxAge:()=>m1e,extractTokenClaims:()=>RL,getJWSPayload:()=>cXr,isKmsi:()=>b5t});p();function RL(t,e){let r=cXr(t);try{let n=e(r);return JSON.parse(n)}catch{throw wt(vqe)}}a(RL,"extractTokenClaims");function b5t(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(b5t,"isKmsi");function cXr(t){if(!t)throw wt(WOt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw wt(vqe);return r[2]}a(cXr,"getJWSPayload");function m1e(t,e){if(e===0||Date.now()-3e5>t+e)throw wt(XOt)}a(m1e,"checkMaxAge");p();p();var bs=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw gl(UOt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return su.endsWith(r,"?")?r=r.slice(0,-1):su.endsWith(r,"?/")&&(r=r.slice(0,-2)),su.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw gl(oae)}if(!e.HostNameAndPort||!e.PathSegments)throw gl(oae);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw gl(FOt)}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]===qk.COMMON||n[0]===qk.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw gl(oae);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 gl(oae);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===Jse){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 t_o=[{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 r_o(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(r_o,"buildOpenIdConfig");var n_o=t_o.reduce((t,{host:e,issuerHost:r})=>(t[e]=r_o(e,r||e),t),{}),uXr={endpointMetadata:n_o,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"]}]}},S5t=uXr.endpointMetadata,T5t=uXr.instanceDiscoveryMetadata,I5t=new Set;T5t.metadata.forEach(t=>{t.aliases.forEach(e=>{I5t.add(e)})});function dXr(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new bs(o).getUrlComponents().HostNameAndPort;n=lXr(e,r,s,t.cloudDiscoveryMetadata?.metadata,Py.CONFIG)||lXr(e,r,s,T5t.metadata,Py.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(dXr,"getAliasesFromStaticSources");function lXr(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=g1e(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(lXr,"getAliasesFromMetadata");function fXr(t){return g1e(T5t.metadata,t)}a(fXr,"getCloudDiscoveryMetadataFromHardcodedValues");function g1e(t,e){for(let r=0;rx5t,createAccountEntityFromAccountInfo:()=>s_o,generateAccountId:()=>i_o,generateHomeAccountId:()=>w5t,getAccountInfo:()=>dae,isAccountEntity:()=>a_o,isSingleTenant:()=>o_o});p();p();function uae(t,e){if(!t)throw wt(VOt);try{let r=e(t);return JSON.parse(r)}catch{throw wt(Cqe)}}a(uae,"buildClientInfo");function mM(t){if(!t)throw wt(Cqe);let e=t.split(eae,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(mM,"buildClientInfoFromHomeAccountId");p();var ix={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function wqe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(wqe,"getTenantIdFromIdTokenClaims");p();var Dy={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function i_o(t){return[t.homeAccountId,t.environment].join(yz).toLowerCase()}a(i_o,"generateAccountId");function dae(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(Pz(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(dae,"getAccountInfo");function o_o(t){return!t.tenantProfiles}a(o_o,"isSingleTenant");function x5t(t,e,r){let n;e.authorityType===ix.Adfs?n=LMt:e.protocolMode===Dy.OIDC?n=lqe:n=BMt;let o,s;t.clientInfo&&r&&(o=uae(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw wt(t1e);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||wqe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[Pz(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(x5t,"createAccountEntity");function s_o(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(Pz(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||lqe,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(s_o,"createAccountEntityFromAccountInfo");function w5t(t,e,r,n,o,s){if(!(e===ix.Adfs||e===ix.Dsts)){if(t)try{let c=uae(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(w5t,"generateHomeAccountId");function a_o(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(a_o,"isAccountEntity");var c7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(a7,hM),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?dae(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=RL(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=Iqe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=dae(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 wt(i5t);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 Bo?c:mXr(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=xh.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)&&xh.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===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===of.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()===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===of.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:j0.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=xh.createSearchScopes(r.scopes),l=r.authenticationScheme||of.BEARER,u=l&&l.toLowerCase()!==of.BEARER.toLowerCase()?j0.ACCESS_TOKEN_WITH_AUTH_SCHEME:j0.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?Ez:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:j0.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 wt(e5t);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===Ez)}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=dXr(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!==j0.ACCESS_TOKEN&&e.credentialType!==j0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:xh.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(tae)!==-1}isAuthorityMetadata(e){return e.indexOf(rae)!==-1}generateAuthorityMetadataCacheKey(e){return`${rae}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},y1e=class extends c7{static{a(this,"DefaultStorageClass")}async setAccount(){throw wt(vs)}getAccount(){throw wt(vs)}async setIdTokenCredential(){throw wt(vs)}getIdTokenCredential(){throw wt(vs)}async setAccessTokenCredential(){throw wt(vs)}getAccessTokenCredential(){throw wt(vs)}async setRefreshTokenCredential(){throw wt(vs)}getRefreshTokenCredential(){throw wt(vs)}setAppMetadata(){throw wt(vs)}getAppMetadata(){throw wt(vs)}setServerTelemetry(){throw wt(vs)}getServerTelemetry(){throw wt(vs)}setAuthorityMetadata(){throw wt(vs)}getAuthorityMetadata(){throw wt(vs)}getAuthorityMetadataKeys(){throw wt(vs)}setThrottlingCache(){throw wt(vs)}getThrottlingCache(){throw wt(vs)}removeItem(){throw wt(vs)}getKeys(){throw wt(vs)}getAccountKeys(){throw wt(vs)}getTokenKeys(){throw wt(vs)}generateCredentialKey(){throw wt(vs)}generateAccountKey(){throw wt(vs)}};p();p();var gXr={NotStarted:0,InProgress:1,Completed:2};var wh=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:gXr.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 AXr={tokenRenewalOffsetSeconds:KMt,preventCorsPreflight:!1},c_o={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:sf.Info,correlationId:""},l_o={async sendGetRequestAsync(){throw wt(vs)},async sendPostRequestAsync(){throw wt(vs)}},u_o={sku:yMt,version:hM,cpu:"",os:""},d_o={clientSecret:"",clientAssertion:void 0},f_o={azureCloudInstance:wL.None,tenant:`${Gbe}`},p_o={application:{appName:"",appVersion:""}};function kL({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={...c_o,...r};return{authOptions:h_o(t),systemOptions:{...AXr,...e},loggerOptions:m,storageInterface:n||new y1e(t.clientId,lae,new H0(m),new wh),networkInterface:o||l_o,cryptoInterface:s||lae,clientCredentials:c||d_o,libraryInfo:{...u_o,...l},telemetry:{...p_o,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(kL,"buildClientConfiguration");function h_o(t){return{clientCapabilities:[],azureCloudOptions:f_o,instanceAware:!1,isMcp:!1,...t}}a(h_o,"buildAuthOptions");function Rqe(t){return t.authOptions.authority.options.protocolMode===Dy.OIDC}a(Rqe,"isOidcProtocolMode");p();p();var rS=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 d_={};wi(d_,{createAccessTokenEntity:()=>P5t,createIdTokenEntity:()=>k5t,createRefreshTokenEntity:()=>D5t,generateAppMetadataKey:()=>b_o,generateAuthorityMetadataExpiresAt:()=>Pqe,isAccessTokenEntity:()=>y_o,isAppMetadataEntity:()=>S_o,isAuthorityMetadataEntity:()=>T_o,isAuthorityMetadataExpired:()=>Dqe,isCredentialEntity:()=>kqe,isIdTokenEntity:()=>E_o,isRefreshTokenEntity:()=>__o,isServerTelemetryEntity:()=>C_o,isThrottlingEntity:()=>v_o,updateAuthorityEndpointMetadata:()=>pae,updateCloudDiscoveryMetadata:()=>_1e});p();var Hu={};wi(Hu,{delay:()=>A_o,isCacheExpired:()=>g_o,isTokenExpired:()=>fae,nowSeconds:()=>nS,toDateFromSeconds:()=>E1e,toSecondsFromDate:()=>m_o,wasClockTurnedBack:()=>R5t});p();function nS(){return Math.round(new Date().getTime()/1e3)}a(nS,"nowSeconds");function m_o(t){return t.getTime()/1e3}a(m_o,"toSecondsFromDate");function E1e(t){return t?new Date(Number(t)*1e3):new Date}a(E1e,"toDateFromSeconds");function fae(t,e){let r=Number(t)||0;return nS()+e>r}a(fae,"isTokenExpired");function g_o(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(g_o,"isCacheExpired");function R5t(t){return Number(t)>nS()}a(R5t,"wasClockTurnedBack");function A_o(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(A_o,"delay");function k5t(t,e,r,n,o){return{credentialType:j0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(k5t,"createIdTokenEntity");function P5t(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:j0.ACCESS_TOKEN,secret:r,cachedAt:nS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||of.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==of.BEARER.toLowerCase())switch(g.credentialType=j0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case of.POP:let A=RL(r,u);if(!A?.cnf?.kid)throw wt(s5t);g.keyId=A.cnf.kid;break;case of.SSH:g.keyId=m}return g}a(P5t,"createAccessTokenEntity");function D5t(t,e,r,n,o,s,c){let l={credentialType:j0.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(D5t,"createRefreshTokenEntity");function kqe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(kqe,"isCredentialEntity");function y_o(t){return t?kqe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===j0.ACCESS_TOKEN||t.credentialType===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(y_o,"isAccessTokenEntity");function E_o(t){return t?kqe(t)&&t.hasOwnProperty("realm")&&t.credentialType===j0.ID_TOKEN:!1}a(E_o,"isIdTokenEntity");function __o(t){return t?kqe(t)&&t.credentialType===j0.REFRESH_TOKEN:!1}a(__o,"isRefreshTokenEntity");function C_o(t,e){let r=t.indexOf(zbe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(C_o,"isServerTelemetryEntity");function v_o(t,e){let r=!1;t&&(r=t.indexOf(Ybe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(v_o,"isThrottlingEntity");function b_o({environment:t,clientId:e}){return[tae,t,e].join(yz).toLowerCase()}a(b_o,"generateAppMetadataKey");function S_o(t,e){return e?t.indexOf(tae)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(S_o,"isAppMetadataEntity");function T_o(t,e){return e?t.indexOf(rae)===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(T_o,"isAuthorityMetadataEntity");function Pqe(){return nS()+UMt}a(Pqe,"generateAuthorityMetadataExpiresAt");function pae(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(pae,"updateAuthorityEndpointMetadata");function _1e(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(_1e,"updateCloudDiscoveryMetadata");function Dqe(t){return t.expiresAt<=nS()}a(Dqe,"isAuthorityMetadataExpired");p();p();var yXr="networkClientSendPostRequestAsync",EXr="refreshTokenClientExecutePostToTokenEndpoint",_Xr="authorizationCodeClientExecutePostToTokenEndpoint",CXr="refreshTokenClientExecuteTokenRequest",vXr="refreshTokenClientAcquireToken",Nqe="refreshTokenClientAcquireTokenWithCachedRefreshToken",bXr="refreshTokenClientCreateTokenRequestBody",SXr="silentFlowClientGenerateResultFromCacheRecord";var TXr="authClientExecuteTokenRequest",IXr="authClientCreateTokenRequestBody",xXr="updateTokenEndpointAuthority",hae="popTokenGenerateCnf",Mqe="handleServerTokenResponse",wXr="authorityResolveEndpointsAsync",RXr="authorityGetCloudDiscoveryMetadataFromNetwork",kXr="authorityUpdateCloudDiscoveryMetadata",PXr="authorityGetEndpointMetadataFromNetwork",DXr="authorityUpdateEndpointMetadata",N5t="authorityUpdateMetadataWithRegionalInformation",NXr="regionDiscoveryDetectRegion",M5t="regionDiscoveryGetRegionFromIMDS",MXr="regionDiscoveryGetCurrentVersion",OXr="cacheManagerGetRefreshToken";p();var BXr=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"),Vs=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 I_o={SW:"sw"},l7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Vs(this.generateKid.bind(this),hae,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:I_o.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 bs(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:nS(),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 Bqe={};wi(Bqe,{badToken:()=>C1e,consentRequired:()=>F5t,interactionRequired:()=>L5t,interruptedUser:()=>Q5t,loginRequired:()=>U5t,nativeAccountUnavailable:()=>x_o,noTokensFound:()=>Oqe,refreshTokenExpired:()=>O5t,uxNotAllowed:()=>B5t});p();var Oqe="no_tokens_found",x_o="native_account_unavailable",O5t="refresh_token_expired",B5t="ux_not_allowed",L5t="interaction_required",F5t="consent_required",U5t="login_required",C1e="bad_token",Q5t="interrupted_user";var LXr=[L5t,F5t,U5t,C1e,B5t,Q5t],w_o=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],iS=class t extends Bo{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 Lqe(t,e,r){let n=!!t&&LXr.indexOf(t)>-1,o=!!r&&w_o.indexOf(r)>-1,s=!!e&&LXr.some(c=>e.indexOf(c)>-1);return n||s||o}a(Lqe,"isInteractionRequiredError");function Fqe(t,e){return new iS(t,e)}a(Fqe,"createInteractionRequiredAuthError");p();var f_=class t extends Bo{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 FXr(t,e){if(!t)throw wt(o5t);if(!e)throw wt(vz);try{let r=e.split(nqe),n=r[0],o=r.length>1?r.slice(1).join(nqe):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw wt(vz)}}a(FXr,"parseRequestState");var Mp=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||Az} - Timestamp: ${e.timestamp||Az} - Description: ${e.error_description||Az} - Correlation ID: ${e.correlation_id||Az} - Trace ID: ${e.trace_id||Az}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new f_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=NMt&&e.status<=MMt){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>=PMt&&e.status<=DMt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${c}`,r);return}throw Lqe(e.error,e.error_description,e.suberror)?new iS(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=RL(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw wt(ZOt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw wt(Xbe);m1e(y,o.maxAge)}}this.homeAccountIdentifier=w5t(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=FXr(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 rS(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,b5t(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 wt(t1e);let d=wqe(s),f,h;e.id_token&&s&&(f=k5t(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=UXr(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?xh.fromString(e.scope):new xh(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=P5t(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=D5t(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===of.POP&&!s.popKid){let T=new l7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw wt(l5t);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=xh.fromString(n.accessToken.target).asArray(),g=E1e(n.accessToken.expiresOn),A=E1e(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=E1e(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===Ez?Ez:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?Iqe(dae(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 UXr(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)||x5t({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=Pz(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(UXr,"buildAccountToCache");p();var p_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function h_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(h_,"getClientAssertion");p();function mae(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(mae,"getRequestThumbprint");var Nz={};wi(Nz,{createTokenQueryParameters:()=>S1e,createTokenRequestHeaders:()=>b1e,executePostToTokenEndpoint:()=>T1e,sendPostRequest:()=>QXr});p();p();var v1e=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${Ybe}.${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(Dp.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||$Mt),n+VMt)*1e3)}static removeThrottle(e,r,n,o){let s=mae(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var gae=class t extends Bo{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 q5t(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new gae(t,e,r)}a(q5t,"createNetworkError");function b1e(t,e,r){let n={};if(n[Dp.CONTENT_TYPE]=SMt,!e&&r)switch(r.type){case p_.HOME_ACCOUNT_ID:try{let o=mM(r.credential);n[Dp.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[Dp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(b1e,"createTokenRequestHeaders");function S1e(t,e,r,n){let o=new Map;return t.embeddedClientId&&xL(o,e,r),t.extraQueryParameters&&IL(o,t.extraQueryParameters),wz(o,t.correlationId),bz(o,t.correlationId,n),pM(o)}a(S1e,"createTokenQueryParameters");async function T1e(t,e,r,n,o,s,c,l,u,d){let f=await QXr(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(T1e,"executePostToTokenEndpoint");async function QXr(t,e,r,n,o,s,c,l){v1e.preProcess(o,t,n);let u;try{u=await Vs(s.sendPostRequestAsync.bind(s),yXr,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Dp.X_MS_HTTP_VERSION]||"",requestId:d[Dp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof gae){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Dp.X_MS_HTTP_VERSION]||"",requestId:f[Dp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Dp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Dp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Bo?d:wt(zOt)}return v1e.postProcess(o,t,u,n),u}a(QXr,"sendPostRequest");var Qqe={};wi(Qqe,{createDiscoveredInstance:()=>H5t});p();p();p();function qXr(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(qXr,"isOpenIdConfigResponse");p();function jXr(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(jXr,"isCloudInstanceDiscoveryResponse");p();function HXr(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(HXr,"isCloudInstanceDiscoveryErrorResponse");p();var I1e=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=i7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Vs(this.getRegionFromIMDS.bind(this),M5t,this.logger,this.performanceClient,this.correlationId)(TMt,o);if(s.status===sqe&&(n=s.body,r.region_source=i7.IMDS),s.status===aqe){let c=await Vs(this.getCurrentVersion.bind(this),MXr,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=i7.FAILED_AUTO_DETECTION,null;let l=await Vs(this.getRegionFromIMDS.bind(this),M5t,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===sqe&&(n=l.body,r.region_source=i7.IMDS)}}catch{return r.region_source=i7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=i7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${oqe}?api-version=${e}&format=text`,r,IMt)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${oqe}?format=json`,e);return r.status===aqe&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};I1e.IMDS_OPTIONS={headers:{Metadata:"true"}};var Gk=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 I1e(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(rqe))return ix.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case _Mt:return ix.Adfs;case CMt:return ix.Dsts}return ix.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 bs(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 wt(Hk)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw wt(Hk)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw wt(Hk)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw wt(c5t);return this.replacePath(this.metadata.end_session_endpoint)}else throw wt(Hk)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw wt(Hk)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw wt(Hk)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===ix.Default&&this.protocolMode!==Dy.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new bs(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 bs(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===ix.Adfs||this.protocolMode===Dy.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 Vs(this.updateCloudDiscoveryMetadata.bind(this),kXr,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Vs(this.updateEndpointMetadata.bind(this),DXr,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:Pqe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Py.CACHE&&n?.source!==Py.CACHE&&(e.expiresAt=Pqe(),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===Py.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Vs(this.updateMetadataWithRegionalInformation.bind(this),N5t,this.logger,this.performanceClient,this.correlationId)(r.metadata);pae(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Vs(this.getEndpointMetadataFromNetwork.bind(this),PXr,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Vs(this.updateMetadataWithRegionalInformation.bind(this),N5t,this.logger,this.performanceClient,this.correlationId)(n)),pae(e,n,!0),Py.NETWORK;throw wt(YOt,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),pae(e,r,!1),{source:Py.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 pae(e,n,!1),{source:Py.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=Dqe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Py.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new bs(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw gl(GOt)}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 qXr(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 S5t?S5t[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==xMt)return this.regionDiscoveryMetadata.region_outcome=Kbe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Vs(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),NXr,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=Kbe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=Kbe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Vs(this.getCloudDiscoveryMetadataFromNetwork.bind(this),RXr,this.logger,this.performanceClient,this.correlationId)();if(n)return _1e(e,n,!0),Py.NETWORK;throw gl($Ot)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||$be}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||$be}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||$be}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),_1e(e,r,!1),Py.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=fXr(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),_1e(e,n,!1),Py.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=Dqe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Py.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===ix.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=g1e(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),gl(_qe)}}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=`${vMt}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(jXr(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(HXr(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===kMt)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=g1e(c,this.hostnameAndPort)}catch(o){if(o instanceof Bo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +${n}`),this.errors=e,this.name=NJr}};function kJr(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(kJr,"convertOAuthErrorResponseToErrorResponse");var JI=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 MJr=require("node:os"),OJr=he(require("node:util"),1),BJr=he(require("node:process"),1);function LJr(t,...e){BJr.stderr.write(`${OJr.default.format(t,...e)}${MJr.EOL}`)}a(LJr,"log");var FJr=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,UJr,xNt=[],wNt=[],_Qe=[];FJr&&RNt(FJr);var QJr=Object.assign(t=>qJr(t),{enable:RNt,enabled:PNt,disable:aAo,log:LJr});function RNt(t){UJr=t,xNt=[],wNt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?wNt.push(new RegExp(`^${n.substr(1)}$`)):xNt.push(new RegExp(`^${n}$`));for(let n of _Qe)n.enabled=PNt(n.namespace)}a(RNt,"enable");function PNt(t){if(t.endsWith("*"))return!0;for(let e of wNt)if(e.test(t))return!1;for(let e of xNt)if(e.test(t))return!0;return!1}a(PNt,"enabled");function aAo(){let t=UJr||"";return RNt(""),t}a(aAo,"disable");function qJr(t){let e=Object.assign(r,{enabled:PNt(t),destroy:cAo,log:QJr.log,namespace:t,extend:lAo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),_Qe.push(e),e}a(qJr,"createDebugger");function cAo(){let t=_Qe.indexOf(this);return t>=0?(_Qe.splice(t,1),!0):!1}a(cAo,"destroy");function lAo(t){let e=qJr(`${this.namespace}:${t}`);return e.log=this.log,e}a(lAo,"extend");var kse=QJr;var HJr=new Set,vQe=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,bQe,kNt=kse("azure");kNt.log=(...t)=>{kse.log(...t)};var DNt=["verbose","info","warning","error"];vQe&&(VJr(vQe)?uAo(vQe):console.error(`AZURE_LOG_LEVEL set to unknown log level '${vQe}'; logging is not enabled. Acceptable values: ${DNt.join(", ")}.`));function uAo(t){if(t&&!VJr(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${DNt.join(",")}`);bQe=t;let e=[];for(let r of HJr)$Jr(r)&&e.push(r.namespace);kse.enable(e.join(","))}a(uAo,"setLogLevel");function SQe(){return bQe}a(SQe,"getLogLevel");var jJr={verbose:400,info:300,warning:200,error:100};function jU(t){let e=kNt.extend(t);return GJr(kNt,e),{error:CQe(e,"error"),warning:CQe(e,"warning"),info:CQe(e,"info"),verbose:CQe(e,"verbose")}}a(jU,"createClientLogger");function GJr(t,e){e.log=(...r)=>{t.log(...r)}}a(GJr,"patchLogMethod");function CQe(t,e){let r=Object.assign(t.extend(e),{level:e});if(GJr(t,r),$Jr(r)){let n=kse.disable();kse.enable(n+","+r.namespace)}return HJr.add(r),r}a(CQe,"createLogger");function $Jr(t){return!!(bQe&&jJr[t.level]<=jJr[bQe])}a($Jr,"shouldEnable");function VJr(t){return DNt.includes(t)}a(VJr,"isAzureLogLevel");var W1=jU("identity");function TQe(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(TQe,"processEnvVars");function q0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(q0,"formatSuccess");function ks(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(ks,"formatError");function WJr(t,e,r=W1){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(WJr,"credentialLoggerInstance");function co(t,e=W1){let r=WJr(t,void 0,e);return{...r,parent:e,getToken:WJr("=> getToken()",r,e)}}a(co,"credentialLogger");p();p();p();p();var Dse={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function zJr(t={}){let e=new NNt(t.parentContext);return t.span&&(e=e.setValue(Dse.span,t.span)),t.namespace&&(e=e.setValue(Dse.namespace,t.namespace)),e}a(zJr,"createTracingContext");var NNt=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 YJr=he(MNt(),1),xQe=YJr.state;function dAo(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(dAo,"createDefaultTracingSpan");function fAo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:dAo(),tracingContext:zJr({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(fAo,"createDefaultInstrumenter");function ybe(){return xQe.instrumenterImplementation||(xQe.instrumenterImplementation=fAo()),xQe.instrumenterImplementation}a(ybe,"getInstrumenter");p();function Ebe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=ybe().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(Dse.namespace)||(A=A.setValue(Dse.namespace,e)),y.setAttribute("az.namespace",A.getValue(Dse.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 ybe().withContext(d,f,...h)}a(c,"withContext");function l(d){return ybe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return ybe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(Ebe,"createTracingClient");var kc=Ebe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:AQe});var ONt=co("ChainedTokenCredential"),_be=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 kc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new Abe(s,"ChainedTokenCredential authentication failed.");throw ONt.getToken.info(ks(e,l)),l}if(ONt.getToken.info(`Result for ${o.constructor.name}: ${q0(e)}`),n===null)throw new Dn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var X1={};xi(X1,{AuthError:()=>Mo,AuthErrorCodes:()=>Xse,AzureCloudInstance:()=>gL,ClientAssertion:()=>vL,ClientAuthError:()=>VU,ClientAuthErrorCodes:()=>Mp,ClientConfigurationError:()=>Qse,ClientConfigurationErrorCodes:()=>jse,ConfidentialClientApplication:()=>gae,CryptoProvider:()=>aM,DistributedCachePlugin:()=>dje,InteractionRequiredAuthError:()=>K1,InteractionRequiredAuthErrorCodes:()=>cqe,LogLevel:()=>nf,Logger:()=>H0,ManagedIdentityApplication:()=>Aae,ManagedIdentitySourceNames:()=>no,PromptValue:()=>nTo,ProtocolMode:()=>By,PublicClientApplication:()=>hae,ResponseMode:()=>iTo,ServerError:()=>l_,TokenCache:()=>rae,TokenCacheContext:()=>z1,internals:()=>c5t,version:()=>Z1});p();var c5t={};xi(c5t,{Deserializer:()=>EL,Serializer:()=>HU});p();p();var HU=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 on={};xi(on,{addApplicationTelemetry:()=>Mbe,addAuthorizationCode:()=>BOt,addBrokerParameters:()=>mL,addCcsOid:()=>pL,addCcsUpn:()=>WU,addClaims:()=>lz,addCliData:()=>UOt,addClientAssertion:()=>Lbe,addClientAssertionType:()=>Fbe,addClientCapabilitiesToClaims:()=>eZr,addClientId:()=>az,addClientInfo:()=>dz,addClientSecret:()=>Bbe,addCodeChallengeParams:()=>yyo,addCodeVerifier:()=>FOt,addCorrelationId:()=>uz,addDeviceCode:()=>Eyo,addDomainHint:()=>NOt,addEARParameters:()=>Syo,addExtraParameters:()=>hL,addGrantType:()=>Ube,addIdTokenHint:()=>DOt,addInstanceAware:()=>Qbe,addLibraryInfo:()=>Nbe,addLoginHint:()=>Gse,addLogoutHint:()=>QOt,addNativeBroker:()=>Ayo,addNonce:()=>OOt,addOboAssertion:()=>_yo,addPassword:()=>byo,addPopToken:()=>qbe,addPostLogoutRedirectUri:()=>kOt,addPrompt:()=>MOt,addRedirectUri:()=>cz,addRefreshToken:()=>LOt,addRequestTokenUse:()=>vyo,addResource:()=>$be,addResponseMode:()=>POt,addResponseType:()=>gyo,addScopes:()=>sz,addServerTelemetry:()=>Hbe,addSid:()=>JQe,addSshJwk:()=>jbe,addState:()=>Obe,addThrottling:()=>Gbe,addUsername:()=>Cyo,instrumentBrokerParams:()=>oz});p();var Xt={};xi(Xt,{AADAuthority:()=>MP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>QNt,AAD_TENANT_DOMAIN_SUFFIX:()=>qNt,ADFS:()=>FNt,APP_METADATA:()=>Lse,AUTHORITY_METADATA_CACHE_KEY:()=>Fse,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>nMt,AUTHORIZATION_PENDING:()=>gAo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>$Nt,AuthenticationScheme:()=>rf,AuthorityMetadataSource:()=>Oy,CACHE_ACCOUNT_TYPE_ADFS:()=>tMt,CACHE_ACCOUNT_TYPE_GENERIC:()=>OQe,CACHE_ACCOUNT_TYPE_MSAV1:()=>OAo,CACHE_ACCOUNT_TYPE_MSSTS:()=>eMt,CACHE_KEY_SEPARATOR:()=>ez,CIAM_AUTH_URL:()=>wQe,CLIENT_INFO:()=>rMt,CLIENT_INFO_SEPARATOR:()=>Bse,CLIENT_MISMATCH_ERROR:()=>pMt,CODE_GRANT_TYPE:()=>hAo,CONSUMER_UTID:()=>pAo,CacheOutcome:()=>OP,CacheType:()=>BAo,ClaimsRequestKeys:()=>Ose,CodeChallengeMethodValues:()=>NAo,CredentialType:()=>j0,DEFAULT_AUTHORITY:()=>KJr,DEFAULT_AUTHORITY_HOST:()=>LNt,DEFAULT_COMMON_TENANT:()=>vbe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>uMt,DEFAULT_THROTTLE_TIME_SECONDS:()=>lMt,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>hMt,DSTS:()=>UNt,EMAIL_SCOPE:()=>XJr,EncodingTypes:()=>QAo,FORWARD_SLASH:()=>Nse,GrantType:()=>Sbe,HTTP_BAD_REQUEST:()=>NQe,HTTP_CLIENT_ERROR:()=>vAo,HTTP_CLIENT_ERROR_RANGE_END:()=>KNt,HTTP_CLIENT_ERROR_RANGE_START:()=>YNt,HTTP_GATEWAY_TIMEOUT:()=>RAo,HTTP_GONE:()=>TAo,HTTP_MULTI_SIDED_ERROR:()=>PAo,HTTP_NOT_FOUND:()=>bAo,HTTP_REDIRECT:()=>_Ao,HTTP_REQUEST_TIMEOUT:()=>SAo,HTTP_SERVER_ERROR:()=>xAo,HTTP_SERVER_ERROR_RANGE_END:()=>ZNt,HTTP_SERVER_ERROR_RANGE_START:()=>JNt,HTTP_SERVICE_UNAVAILABLE:()=>wAo,HTTP_SUCCESS:()=>DQe,HTTP_SUCCESS_RANGE_END:()=>EAo,HTTP_SUCCESS_RANGE_START:()=>yAo,HTTP_TOO_MANY_REQUESTS:()=>IAo,HTTP_UNAUTHORIZED:()=>CAo,HeaderNames:()=>Np,HttpMethod:()=>kAo,IMDS_ENDPOINT:()=>kQe,IMDS_TIMEOUT:()=>GNt,IMDS_VERSION:()=>HNt,INVALID_GRANT_ERROR:()=>fMt,INVALID_INSTANCE:()=>zNt,JsonWebTokenTypes:()=>FAo,KNOWN_PUBLIC_CLOUDS:()=>WNt,NOT_APPLICABLE:()=>Cbe,NOT_AVAILABLE:()=>XW,OAuthResponseType:()=>MAo,OFFLINE_ACCESS_SCOPE:()=>PQe,OIDC_DEFAULT_SCOPES:()=>Mse,OIDC_SCOPES:()=>MQe,ONE_DAY_IN_MS:()=>UAo,OPENID_SCOPE:()=>JJr,PROFILE_SCOPE:()=>ZJr,PasswordGrantConstants:()=>FQe,PersistentCacheKeys:()=>DAo,PromptValue:()=>bbe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>VNt,RESOURCE_DELIM:()=>RQe,RegionDiscoveryOutcomes:()=>xbe,RegionDiscoverySources:()=>$U,ResponseMode:()=>XNt,S256_CODE_CHALLENGE_METHOD:()=>mAo,SERVER_TELEM_CACHE_KEY:()=>Tbe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>LQe,SERVER_TELEM_MAX_CACHED_ERRORS:()=>oMt,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>LAo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>iMt,SERVER_TELEM_OVERFLOW_FALSE:()=>aMt,SERVER_TELEM_OVERFLOW_TRUE:()=>sMt,SERVER_TELEM_SCHEMA_VERSION:()=>BQe,SERVER_TELEM_UNKNOWN_ERROR:()=>cMt,SERVER_TELEM_VALUE_SEPARATOR:()=>GU,SHR_NONCE_VALIDITY:()=>AAo,SKU:()=>BNt,THE_FAMILY_ID:()=>tz,THROTTLING_PREFIX:()=>Ibe,URL_FORM_CONTENT_TYPE:()=>jNt,X_MS_LIB_CAPABILITY_VALUE:()=>dMt});p();var BNt="msal.js.common",KJr="https://login.microsoftonline.com/common/",LNt="login.microsoftonline.com",vbe="common",FNt="adfs",UNt="dstsv2",QNt=`${KJr}discovery/instance?api-version=1.1&authorization_endpoint=`,wQe=".ciamlogin.com",qNt=".onmicrosoft.com",RQe="|",pAo="9188040d-6c67-4c5b-b112-36a304b66dad",JJr="openid",ZJr="profile",PQe="offline_access",XJr="email",hAo="authorization_code",mAo="S256",jNt="application/x-www-form-urlencoded;charset=utf-8",gAo="authorization_pending",Cbe="N/A",XW="Not Available",Nse="/",kQe="http://169.254.169.254/metadata/instance/compute/location",HNt="2020-06-01",GNt=2e3,$Nt="TryAutoDetect",VNt="login.microsoft.com",WNt=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],AAo=240,zNt="invalid_instance",DQe=200,yAo=200,EAo=299,_Ao=302,vAo=400,YNt=400,NQe=400,CAo=401,bAo=404,SAo=408,TAo=410,IAo=429,KNt=499,xAo=500,JNt=500,wAo=503,RAo=504,ZNt=599,PAo=600,kAo={GET:"GET",POST:"POST"},Mse=[JJr,ZJr,PQe],MQe=[...Mse,XJr],Np={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"},DAo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},MP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Ose={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},bbe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},NAo={PLAIN:"plain",S256:"S256"},MAo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},XNt={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},Sbe={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"},eMt="MSSTS",tMt="ADFS",OAo="MSA",OQe="Generic",ez="-",Bse=".",j0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},BAo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},Lse="appmetadata",rMt="client_info",tz="1",Fse="authority-metadata",nMt=3600*24,Oy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},BQe=5,LAo=80,iMt=330,oMt=50,Tbe="server-telemetry",LQe="|",GU=",",sMt="1",aMt="0",cMt="unknown_error",rf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},lMt=60,uMt=3600,Ibe="throttling",dMt="retry-after, h429",fMt="invalid_grant",pMt="client_mismatch",FQe={username:"username",password:"password"},$U={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},xbe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},OP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},FAo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},UAo=864e5,hMt=300,QAo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var rz={};xi(rz,{ACCESS_TOKEN:()=>HAo,BROKER_CLIENT_ID:()=>wbe,BROKER_REDIRECT_URI:()=>HQe,CCS_HEADER:()=>JAo,CLAIMS:()=>yMt,CLIENT_ASSERTION:()=>jMt,CLIENT_ASSERTION_TYPE:()=>HMt,CLIENT_ID:()=>nM,CLIENT_INFO:()=>zAo,CLIENT_REQUEST_ID:()=>wMt,CLIENT_SECRET:()=>qMt,CLI_DATA:()=>eOt,CODE:()=>SMt,CODE_CHALLENGE:()=>TMt,CODE_CHALLENGE_METHOD:()=>IMt,CODE_VERIFIER:()=>xMt,DEVICE_CODE:()=>QMt,DOMAIN_HINT:()=>KMt,EAR_JWE_CRYPTO:()=>ZMt,EAR_JWK:()=>JMt,ERROR:()=>qAo,ERROR_DESCRIPTION:()=>jAo,EXPIRES_IN:()=>$Ao,FOCI:()=>KAo,GRANT_TYPE:()=>AMt,ID_TOKEN:()=>GAo,ID_TOKEN_HINT:()=>UMt,INSTANCE_AWARE:()=>Use,LOGIN_HINT:()=>YMt,LOGOUT_HINT:()=>WMt,NATIVE_BROKER:()=>VMt,NONCE:()=>CMt,OBO_ASSERTION:()=>GMt,ON_BEHALF_OF:()=>YAo,POST_LOGOUT_URI:()=>FMt,PROMPT:()=>bMt,REDIRECT_URI:()=>UQe,REFRESH_TOKEN:()=>_Mt,REFRESH_TOKEN_EXPIRES_IN:()=>VAo,REQUESTED_TOKEN_USE:()=>$Mt,REQ_CNF:()=>qQe,RESOURCE:()=>XMt,RESPONSE_MODE:()=>gMt,RESPONSE_TYPE:()=>mMt,RETURN_SPA_CODE:()=>jQe,SCOPE:()=>EMt,SESSION_STATE:()=>WAo,SID:()=>zMt,STATE:()=>vMt,TOKEN_TYPE:()=>QQe,X_APP_NAME:()=>BMt,X_APP_VER:()=>LMt,X_CLIENT_CPU:()=>DMt,X_CLIENT_CURR_TELEM:()=>NMt,X_CLIENT_EXTRA_SKU:()=>ZAo,X_CLIENT_LAST_TELEM:()=>MMt,X_CLIENT_OS:()=>kMt,X_CLIENT_SKU:()=>RMt,X_CLIENT_VER:()=>PMt,X_MS_LIB_CAPABILITY:()=>OMt});p();var nM="client_id",UQe="redirect_uri",mMt="response_type",gMt="response_mode",AMt="grant_type",yMt="claims",EMt="scope",qAo="error",jAo="error_description",HAo="access_token",GAo="id_token",_Mt="refresh_token",$Ao="expires_in",VAo="refresh_token_expires_in",vMt="state",CMt="nonce",bMt="prompt",WAo="session_state",zAo="client_info",SMt="code",TMt="code_challenge",IMt="code_challenge_method",xMt="code_verifier",wMt="client-request-id",RMt="x-client-SKU",PMt="x-client-VER",kMt="x-client-OS",DMt="x-client-CPU",NMt="x-client-current-telemetry",MMt="x-client-last-telemetry",OMt="x-ms-lib-capability",BMt="x-app-name",LMt="x-app-ver",FMt="post_logout_redirect_uri",UMt="id_token_hint",QMt="device_code",qMt="client_secret",jMt="client_assertion",HMt="client_assertion_type",QQe="token_type",qQe="req_cnf",GMt="assertion",$Mt="requested_token_use",YAo="on_behalf_of",KAo="foci",JAo="X-AnchorMailbox",jQe="return_spa_code",VMt="nativebroker",WMt="logout_hint",zMt="sid",YMt="login_hint",KMt="domain_hint",ZAo="x-client-xtra-sku",wbe="brk_client_id",HQe="brk_redirect_uri",Use="instance_aware",JMt="ear_jwk",ZMt="ear_jwe_crypto",XMt="resource",eOt="clidata";p();p();p();function GQe(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(GQe,"getDefaultErrorMessage");var Mo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?GQe(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 nz(t,e){return new Mo(t,e||GQe(t))}a(nz,"createAuthError");var Qse=class t extends Mo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function hl(t){return new Qse(t)}a(hl,"createClientConfigurationError");p();var nu=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 VU=class t extends Mo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function Pt(t,e){return new VU(t,e)}a(Pt,"createClientAuthError");var jse={};xi(jse,{authorityMismatch:()=>syo,authorityUriInsecure:()=>rOt,cannotAllowPlatformBroker:()=>oyo,cannotSetOIDCOptions:()=>iyo,claimsRequestParsingError:()=>XAo,emptyInputScopesError:()=>iOt,invalidAuthenticationHeader:()=>nyo,invalidAuthorityMetadata:()=>cOt,invalidClaims:()=>$Qe,invalidCloudDiscoveryMetadata:()=>VQe,invalidCodeChallengeMethod:()=>eyo,invalidRequestMethodForEAR:()=>ayo,logoutRequestEmpty:()=>sOt,missingNonceAuthenticationHeader:()=>ryo,missingSshJwk:()=>Rbe,missingSshKid:()=>tyo,pkceParamsMissing:()=>aOt,redirectUriEmpty:()=>tOt,tokenRequestEmpty:()=>oOt,untrustedAuthority:()=>lOt,urlEmptyError:()=>nOt,urlParseError:()=>qse});p();var tOt="redirect_uri_empty",XAo="claims_request_parsing_error",rOt="authority_uri_insecure",qse="url_parse_error",nOt="empty_url_error",iOt="empty_input_scopes_error",$Qe="invalid_claims",oOt="token_request_empty",sOt="logout_request_empty",eyo="invalid_code_challenge_method",aOt="pkce_params_missing",VQe="invalid_cloud_discovery_metadata",cOt="invalid_authority_metadata",lOt="untrusted_authority",Rbe="missing_ssh_jwk",tyo="missing_ssh_kid",ryo="missing_nonce_authentication_header",nyo="invalid_authentication_header",iyo="cannot_set_OIDCOptions",oyo="cannot_allow_platform_broker",syo="authority_mismatch",ayo="invalid_request_method_for_EAR";var Mp={};xi(Mp,{authTimeNotFound:()=>Pbe,authorizationCodeMissingFromServerResponse:()=>TOt,bindingKeyNotRemoved:()=>dyo,cannotAppendScopeSet:()=>vOt,cannotRemoveEmptyScope:()=>_Ot,clientInfoDecodingError:()=>WQe,clientInfoEmptyError:()=>uOt,emptyInputScopeSet:()=>KQe,endSessionEndpointNotSupported:()=>IOt,endpointResolutionError:()=>BP,hashNotDeserialized:()=>hOt,invalidCacheEnvironment:()=>Dbe,invalidCacheRecord:()=>COt,invalidState:()=>iz,keyIdMissing:()=>xOt,maxAgeTranspired:()=>AOt,methodNotImplemented:()=>_s,misplacedResourceParam:()=>ROt,multipleMatchingAppMetadata:()=>yOt,multipleMatchingTokens:()=>cyo,nestedAppAuthBridgeDisabled:()=>hyo,networkError:()=>fOt,noAccountFound:()=>lyo,noAccountInSilentRequest:()=>kbe,noCryptoObject:()=>bOt,noNetworkConnectivity:()=>fyo,nonceMismatch:()=>gOt,nullOrEmptyToken:()=>dOt,openIdConfigError:()=>pOt,platformBrokerError:()=>myo,requestCannotBeMade:()=>EOt,resourceParameterRequired:()=>wOt,stateMismatch:()=>mOt,stateNotFound:()=>YQe,tokenClaimsCnfRequiredForSignedJwt:()=>SOt,tokenParsingError:()=>zQe,tokenRefreshRequired:()=>Hse,unexpectedCredentialType:()=>uyo,userCanceled:()=>pyo});p();var WQe="client_info_decoding_error",uOt="client_info_empty_error",zQe="token_parsing_error",dOt="null_or_empty_token",BP="endpoints_resolution_error",fOt="network_error",pOt="openid_config_error",hOt="hash_not_deserialized",iz="invalid_state",mOt="state_mismatch",YQe="state_not_found",gOt="nonce_mismatch",Pbe="auth_time_not_found",AOt="max_age_transpired",cyo="multiple_matching_tokens",yOt="multiple_matching_appMetadata",EOt="request_cannot_be_made",_Ot="cannot_remove_empty_scope",vOt="cannot_append_scopeset",KQe="empty_input_scopeset",kbe="no_account_in_silent_request",COt="invalid_cache_record",Dbe="invalid_cache_environment",lyo="no_account_found",bOt="no_crypto_object",uyo="unexpected_credential_type",Hse="token_refresh_required",SOt="token_claims_cnf_required_for_signedjwt",TOt="authorization_code_missing_from_server_response",dyo="binding_key_not_removed",IOt="end_session_endpoint_not_supported",xOt="key_id_missing",fyo="no_network_connectivity",pyo="user_canceled",_s="method_not_implemented",hyo="nested_app_auth_bridge_disabled",myo="platform_broker_error",wOt="resource_parameter_required",ROt="misplaced_resource_parameter";var wh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?nu.trimArrayEntries([...e]):[],n=r?nu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw hl(iOt);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:[...Mse],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(PQe):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 MQe.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(vOt)}}removeScope(e){if(!e)throw Pt(_Ot);this.scopes.delete(e.trim())}removeOIDCScopes(){MQe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Pt(KQe);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(KQe);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 oz(t,e,r){if(!e)return;let n=t.get(nM);n&&t.has(wbe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(UQe)},e)}a(oz,"instrumentBrokerParams");function gyo(t,e){t.set(mMt,e)}a(gyo,"addResponseType");function POt(t,e){t.set(gMt,e||XNt.QUERY)}a(POt,"addResponseMode");function Ayo(t){t.set(VMt,"1")}a(Ayo,"addNativeBroker");function sz(t,e,r=!0,n=Mse){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new wh(o);t.set(EMt,s.printScopes())}a(sz,"addScopes");function az(t,e){t.set(nM,e)}a(az,"addClientId");function cz(t,e){t.set(UQe,e)}a(cz,"addRedirectUri");function kOt(t,e){t.set(FMt,e)}a(kOt,"addPostLogoutRedirectUri");function DOt(t,e){t.set(UMt,e)}a(DOt,"addIdTokenHint");function NOt(t,e){t.set(KMt,e)}a(NOt,"addDomainHint");function Gse(t,e){t.set(YMt,e)}a(Gse,"addLoginHint");function WU(t,e){t.set(Np.CCS_HEADER,`UPN:${e}`)}a(WU,"addCcsUpn");function pL(t,e){t.set(Np.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(pL,"addCcsOid");function JQe(t,e){t.set("sid",e)}a(JQe,"addSid");function lz(t,e,r){let n=eZr(e,r);try{JSON.parse(n)}catch{throw hl($Qe)}t.set(yMt,n)}a(lz,"addClaims");function uz(t,e){t.set(wMt,e)}a(uz,"addCorrelationId");function Nbe(t,e){t.set(RMt,e.sku),t.set(PMt,e.version),e.os&&t.set(kMt,e.os),e.cpu&&t.set(DMt,e.cpu)}a(Nbe,"addLibraryInfo");function Mbe(t,e){e?.appName&&t.set(BMt,e.appName),e?.appVersion&&t.set(LMt,e.appVersion)}a(Mbe,"addApplicationTelemetry");function MOt(t,e){t.set(bMt,e)}a(MOt,"addPrompt");function Obe(t,e){e&&t.set(vMt,e)}a(Obe,"addState");function OOt(t,e){t.set(CMt,e)}a(OOt,"addNonce");function yyo(t,e,r){if(e&&r)t.set(TMt,e),t.set(IMt,r);else throw hl(aOt)}a(yyo,"addCodeChallengeParams");function BOt(t,e){t.set(SMt,e)}a(BOt,"addAuthorizationCode");function Eyo(t,e){t.set(QMt,e)}a(Eyo,"addDeviceCode");function LOt(t,e){t.set(_Mt,e)}a(LOt,"addRefreshToken");function FOt(t,e){t.set(xMt,e)}a(FOt,"addCodeVerifier");function Bbe(t,e){t.set(qMt,e)}a(Bbe,"addClientSecret");function Lbe(t,e){e&&t.set(jMt,e)}a(Lbe,"addClientAssertion");function Fbe(t,e){e&&t.set(HMt,e)}a(Fbe,"addClientAssertionType");function _yo(t,e){t.set(GMt,e)}a(_yo,"addOboAssertion");function vyo(t,e){t.set($Mt,e)}a(vyo,"addRequestTokenUse");function Ube(t,e){t.set(AMt,e)}a(Ube,"addGrantType");function dz(t){t.set(rMt,"1")}a(dz,"addClientInfo");function UOt(t){t.set(eOt,"1")}a(UOt,"addCliData");function Qbe(t){t.has(Use)||t.set(Use,"true")}a(Qbe,"addInstanceAware");function hL(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(hL,"addExtraParameters");function eZr(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw hl($Qe)}return e&&e.length>0&&(r.hasOwnProperty(Ose.ACCESS_TOKEN)||(r[Ose.ACCESS_TOKEN]={}),r[Ose.ACCESS_TOKEN][Ose.XMS_CC]={values:e}),JSON.stringify(r)}a(eZr,"addClientCapabilitiesToClaims");function Cyo(t,e){t.set(FQe.username,e)}a(Cyo,"addUsername");function byo(t,e){t.set(FQe.password,e)}a(byo,"addPassword");function qbe(t,e){e&&(t.set(QQe,rf.POP),t.set(qQe,e))}a(qbe,"addPopToken");function jbe(t,e){e&&(t.set(QQe,rf.SSH),t.set(qQe,e))}a(jbe,"addSshJwk");function Hbe(t,e){t.set(NMt,e.generateCurrentRequestHeaderValue()),t.set(MMt,e.generateLastRequestHeaderValue())}a(Hbe,"addServerTelemetry");function Gbe(t){t.set(OMt,dMt)}a(Gbe,"addThrottling");function QOt(t,e){t.set(WMt,e)}a(QOt,"addLogoutHint");function mL(t,e,r){t.has(wbe)||t.set(wbe,e),t.has(HQe)||t.set(HQe,r)}a(mL,"addBrokerParameters");function Syo(t,e){t.set(JMt,encodeURIComponent(e)),t.set(ZMt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(Syo,"addEARParameters");function $be(t,e){e&&t.set(XMt,e)}a($be,"addResource");var oA={};xi(oA,{getDeserializedResponse:()=>Tyo,mapToQueryString:()=>iM,normalizeUrlForComparison:()=>Iyo,stripLeadingHashOrQuery:()=>rZr});p();function tZr(t){if(!t)return t;let e=t.toLowerCase();return nu.endsWith(e,"?")?e=e.slice(0,-1):nu.endsWith(e,"?/")&&(e=e.slice(0,-2)),nu.endsWith(e,"/")||(e+="/"),e}a(tZr,"canonicalizeUrl");function rZr(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(rZr,"stripLeadingHashOrQuery");function Tyo(t){if(!t||t.indexOf("=")<0)return null;try{let e=rZr(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(hOt)}return null}a(Tyo,"getDeserializedResponse");function iM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(iM,"mapToQueryString");function Iyo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return tZr(n)}catch{return tZr(e)}}a(Iyo,"normalizeUrlForComparison");p();p();var $se={createNewGuid:a(()=>{throw Pt(_s)},"createNewGuid"),base64Decode:a(()=>{throw Pt(_s)},"base64Decode"),base64Encode:a(()=>{throw Pt(_s)},"base64Encode"),base64UrlEncode:a(()=>{throw Pt(_s)},"base64UrlEncode"),encodeKid:a(()=>{throw Pt(_s)},"encodeKid"),async getPublicKeyThumbprint(){throw Pt(_s)},async removeTokenBindingKey(){throw Pt(_s)},async clearKeystore(){throw Pt(_s)},async signJwt(){throw Pt(_s)},async hashString(){throw Pt(_s)}};p();var nf;(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"})(nf||(nf={}));var xyo=50,wyo=500,fz=new Map;function Ryo(t,e){fz.delete(t),fz.set(t,e)}a(Ryo,"markAsRecentlyUsed");function Pyo(t,e){let r=Date.now(),n=fz.get(t);if(n)Ryo(t,n);else if(n={logs:[],firstEventTime:r},fz.set(t,n),fz.size>xyo){let o=fz.keys().next().value;o&&fz.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>wyo&&n.logs.shift()}a(Pyo,"addLogToCache");function kyo(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(kyo,"isHashedString");var H0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=nf.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:nf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:nf.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(kyo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};Pyo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${nf[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:nf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:nf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:nf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:nf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:nf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:nf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:nf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:nf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:nf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:nf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var zU="@azure/msal-common",oM="16.4.1";p();var gL={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 nZr(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(nZr,"tenantIdMatchesHomeTenant");function pz(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:nZr(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:nZr(r,t)}}a(pz,"buildTenantProfile");function ZQe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=pz(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(ZQe,"updateAccountTenantProfileData");var XQe={};xi(XQe,{checkMaxAge:()=>Vbe,extractTokenClaims:()=>AL,getJWSPayload:()=>iZr,isKmsi:()=>qOt});p();function AL(t,e){let r=iZr(t);try{let n=e(r);return JSON.parse(n)}catch{throw Pt(zQe)}}a(AL,"extractTokenClaims");function qOt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(qOt,"isKmsi");function iZr(t){if(!t)throw Pt(dOt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw Pt(zQe);return r[2]}a(iZr,"getJWSPayload");function Vbe(t,e){if(e===0||Date.now()-3e5>t+e)throw Pt(AOt)}a(Vbe,"checkMaxAge");p();p();var vs=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw hl(nOt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return nu.endsWith(r,"?")?r=r.slice(0,-1):nu.endsWith(r,"?/")&&(r=r.slice(0,-2)),nu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw hl(qse)}if(!e.HostNameAndPort||!e.PathSegments)throw hl(qse);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw hl(rOt)}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]===MP.COMMON||n[0]===MP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw hl(qse);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 hl(qse);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===Nse){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 Dyo=[{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 Nyo(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(Nyo,"buildOpenIdConfig");var Myo=Dyo.reduce((t,{host:e,issuerHost:r})=>(t[e]=Nyo(e,r||e),t),{}),sZr={endpointMetadata:Myo,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"]}]}},jOt=sZr.endpointMetadata,HOt=sZr.instanceDiscoveryMetadata,GOt=new Set;HOt.metadata.forEach(t=>{t.aliases.forEach(e=>{GOt.add(e)})});function aZr(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new vs(o).getUrlComponents().HostNameAndPort;n=oZr(e,r,s,t.cloudDiscoveryMetadata?.metadata,Oy.CONFIG)||oZr(e,r,s,HOt.metadata,Oy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(aZr,"getAliasesFromStaticSources");function oZr(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=Wbe(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(oZr,"getAliasesFromMetadata");function cZr(t){return Wbe(HOt.metadata,t)}a(cZr,"getCloudDiscoveryMetadataFromHardcodedValues");function Wbe(t,e){for(let r=0;r$Ot,createAccountEntityFromAccountInfo:()=>Lyo,generateAccountId:()=>Oyo,generateHomeAccountId:()=>VOt,getAccountInfo:()=>Wse,isAccountEntity:()=>Fyo,isSingleTenant:()=>Byo});p();p();function Vse(t,e){if(!t)throw Pt(uOt);try{let r=e(t);return JSON.parse(r)}catch{throw Pt(WQe)}}a(Vse,"buildClientInfo");function sM(t){if(!t)throw Pt(WQe);let e=t.split(Bse,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(sM,"buildClientInfoFromHomeAccountId");p();var ZI={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function eqe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(eqe,"getTenantIdFromIdTokenClaims");p();var By={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function Oyo(t){return[t.homeAccountId,t.environment].join(ez).toLowerCase()}a(Oyo,"generateAccountId");function Wse(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(pz(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(Wse,"getAccountInfo");function Byo(t){return!t.tenantProfiles}a(Byo,"isSingleTenant");function $Ot(t,e,r){let n;e.authorityType===ZI.Adfs?n=tMt:e.protocolMode===By.OIDC?n=OQe:n=eMt;let o,s;t.clientInfo&&r&&(o=Vse(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw Pt(Dbe);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||eqe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[pz(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($Ot,"createAccountEntity");function Lyo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(pz(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||OQe,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(Lyo,"createAccountEntityFromAccountInfo");function VOt(t,e,r,n,o,s){if(!(e===ZI.Adfs||e===ZI.Dsts)){if(t)try{let c=Vse(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(VOt,"generateHomeAccountId");function Fyo(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(Fyo,"isAccountEntity");var YU=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(zU,oM),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?Wse(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=AL(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=ZQe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=Wse(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(COt);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 Mo?c:dZr(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=wh.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)&&wh.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===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===rf.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()===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===rf.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:j0.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=wh.createSearchScopes(r.scopes),l=r.authenticationScheme||rf.BEARER,u=l&&l.toLowerCase()!==rf.BEARER.toLowerCase()?j0.ACCESS_TOKEN_WITH_AUTH_SCHEME:j0.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?tz:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:j0.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(yOt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===tz)}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=aZr(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!==j0.ACCESS_TOKEN&&e.credentialType!==j0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:wh.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(Lse)!==-1}isAuthorityMetadata(e){return e.indexOf(Fse)!==-1}generateAuthorityMetadataCacheKey(e){return`${Fse}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},Ybe=class extends YU{static{a(this,"DefaultStorageClass")}async setAccount(){throw Pt(_s)}getAccount(){throw Pt(_s)}async setIdTokenCredential(){throw Pt(_s)}getIdTokenCredential(){throw Pt(_s)}async setAccessTokenCredential(){throw Pt(_s)}getAccessTokenCredential(){throw Pt(_s)}async setRefreshTokenCredential(){throw Pt(_s)}getRefreshTokenCredential(){throw Pt(_s)}setAppMetadata(){throw Pt(_s)}getAppMetadata(){throw Pt(_s)}setServerTelemetry(){throw Pt(_s)}getServerTelemetry(){throw Pt(_s)}setAuthorityMetadata(){throw Pt(_s)}getAuthorityMetadata(){throw Pt(_s)}getAuthorityMetadataKeys(){throw Pt(_s)}setThrottlingCache(){throw Pt(_s)}getThrottlingCache(){throw Pt(_s)}removeItem(){throw Pt(_s)}getKeys(){throw Pt(_s)}getAccountKeys(){throw Pt(_s)}getTokenKeys(){throw Pt(_s)}generateCredentialKey(){throw Pt(_s)}generateAccountKey(){throw Pt(_s)}};p();p();var fZr={NotStarted:0,InProgress:1,Completed:2};var Rh=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:fZr.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 pZr={tokenRenewalOffsetSeconds:hMt,preventCorsPreflight:!1},Uyo={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:nf.Info,correlationId:""},Qyo={async sendGetRequestAsync(){throw Pt(_s)},async sendPostRequestAsync(){throw Pt(_s)}},qyo={sku:BNt,version:oM,cpu:"",os:""},jyo={clientSecret:"",clientAssertion:void 0},Hyo={azureCloudInstance:gL.None,tenant:`${vbe}`},Gyo={application:{appName:"",appVersion:""}};function yL({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={...Uyo,...r};return{authOptions:$yo(t),systemOptions:{...pZr,...e},loggerOptions:m,storageInterface:n||new Ybe(t.clientId,$se,new H0(m),new Rh),networkInterface:o||Qyo,cryptoInterface:s||$se,clientCredentials:c||jyo,libraryInfo:{...qyo,...l},telemetry:{...Gyo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(yL,"buildClientConfiguration");function $yo(t){return{clientCapabilities:[],azureCloudOptions:Hyo,instanceAware:!1,isMcp:!1,...t}}a($yo,"buildAuthOptions");function tqe(t){return t.authOptions.authority.options.protocolMode===By.OIDC}a(tqe,"isOidcProtocolMode");p();p();var z1=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 c_={};xi(c_,{createAccessTokenEntity:()=>YOt,createIdTokenEntity:()=>zOt,createRefreshTokenEntity:()=>KOt,generateAppMetadataKey:()=>eEo,generateAuthorityMetadataExpiresAt:()=>nqe,isAccessTokenEntity:()=>Yyo,isAppMetadataEntity:()=>tEo,isAuthorityMetadataEntity:()=>rEo,isAuthorityMetadataExpired:()=>iqe,isCredentialEntity:()=>rqe,isIdTokenEntity:()=>Kyo,isRefreshTokenEntity:()=>Jyo,isServerTelemetryEntity:()=>Zyo,isThrottlingEntity:()=>Xyo,updateAuthorityEndpointMetadata:()=>Yse,updateCloudDiscoveryMetadata:()=>Jbe});p();var ju={};xi(ju,{delay:()=>zyo,isCacheExpired:()=>Wyo,isTokenExpired:()=>zse,nowSeconds:()=>Y1,toDateFromSeconds:()=>Kbe,toSecondsFromDate:()=>Vyo,wasClockTurnedBack:()=>WOt});p();function Y1(){return Math.round(new Date().getTime()/1e3)}a(Y1,"nowSeconds");function Vyo(t){return t.getTime()/1e3}a(Vyo,"toSecondsFromDate");function Kbe(t){return t?new Date(Number(t)*1e3):new Date}a(Kbe,"toDateFromSeconds");function zse(t,e){let r=Number(t)||0;return Y1()+e>r}a(zse,"isTokenExpired");function Wyo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(Wyo,"isCacheExpired");function WOt(t){return Number(t)>Y1()}a(WOt,"wasClockTurnedBack");function zyo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(zyo,"delay");function zOt(t,e,r,n,o){return{credentialType:j0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(zOt,"createIdTokenEntity");function YOt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:j0.ACCESS_TOKEN,secret:r,cachedAt:Y1().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||rf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==rf.BEARER.toLowerCase())switch(g.credentialType=j0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case rf.POP:let A=AL(r,u);if(!A?.cnf?.kid)throw Pt(SOt);g.keyId=A.cnf.kid;break;case rf.SSH:g.keyId=m}return g}a(YOt,"createAccessTokenEntity");function KOt(t,e,r,n,o,s,c){let l={credentialType:j0.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(KOt,"createRefreshTokenEntity");function rqe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(rqe,"isCredentialEntity");function Yyo(t){return t?rqe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===j0.ACCESS_TOKEN||t.credentialType===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(Yyo,"isAccessTokenEntity");function Kyo(t){return t?rqe(t)&&t.hasOwnProperty("realm")&&t.credentialType===j0.ID_TOKEN:!1}a(Kyo,"isIdTokenEntity");function Jyo(t){return t?rqe(t)&&t.credentialType===j0.REFRESH_TOKEN:!1}a(Jyo,"isRefreshTokenEntity");function Zyo(t,e){let r=t.indexOf(Tbe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(Zyo,"isServerTelemetryEntity");function Xyo(t,e){let r=!1;t&&(r=t.indexOf(Ibe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(Xyo,"isThrottlingEntity");function eEo({environment:t,clientId:e}){return[Lse,t,e].join(ez).toLowerCase()}a(eEo,"generateAppMetadataKey");function tEo(t,e){return e?t.indexOf(Lse)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(tEo,"isAppMetadataEntity");function rEo(t,e){return e?t.indexOf(Fse)===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(rEo,"isAuthorityMetadataEntity");function nqe(){return Y1()+nMt}a(nqe,"generateAuthorityMetadataExpiresAt");function Yse(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(Yse,"updateAuthorityEndpointMetadata");function Jbe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(Jbe,"updateCloudDiscoveryMetadata");function iqe(t){return t.expiresAt<=Y1()}a(iqe,"isAuthorityMetadataExpired");p();p();var hZr="networkClientSendPostRequestAsync",mZr="refreshTokenClientExecutePostToTokenEndpoint",gZr="authorizationCodeClientExecutePostToTokenEndpoint",AZr="refreshTokenClientExecuteTokenRequest",yZr="refreshTokenClientAcquireToken",oqe="refreshTokenClientAcquireTokenWithCachedRefreshToken",EZr="refreshTokenClientCreateTokenRequestBody",_Zr="silentFlowClientGenerateResultFromCacheRecord";var vZr="authClientExecuteTokenRequest",CZr="authClientCreateTokenRequestBody",bZr="updateTokenEndpointAuthority",Kse="popTokenGenerateCnf",sqe="handleServerTokenResponse",SZr="authorityResolveEndpointsAsync",TZr="authorityGetCloudDiscoveryMetadataFromNetwork",IZr="authorityUpdateCloudDiscoveryMetadata",xZr="authorityGetEndpointMetadataFromNetwork",wZr="authorityUpdateEndpointMetadata",JOt="authorityUpdateMetadataWithRegionalInformation",RZr="regionDiscoveryDetectRegion",ZOt="regionDiscoveryGetRegionFromIMDS",PZr="regionDiscoveryGetCurrentVersion",kZr="cacheManagerGetRefreshToken";p();var DZr=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"),Hs=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 nEo={SW:"sw"},KU=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Hs(this.generateKid.bind(this),Kse,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:nEo.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 vs(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Y1(),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 cqe={};xi(cqe,{badToken:()=>Zbe,consentRequired:()=>r5t,interactionRequired:()=>t5t,interruptedUser:()=>i5t,loginRequired:()=>n5t,nativeAccountUnavailable:()=>iEo,noTokensFound:()=>aqe,refreshTokenExpired:()=>XOt,uxNotAllowed:()=>e5t});p();var aqe="no_tokens_found",iEo="native_account_unavailable",XOt="refresh_token_expired",e5t="ux_not_allowed",t5t="interaction_required",r5t="consent_required",n5t="login_required",Zbe="bad_token",i5t="interrupted_user";var NZr=[t5t,r5t,n5t,Zbe,e5t,i5t],oEo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],K1=class t extends Mo{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 lqe(t,e,r){let n=!!t&&NZr.indexOf(t)>-1,o=!!r&&oEo.indexOf(r)>-1,s=!!e&&NZr.some(c=>e.indexOf(c)>-1);return n||s||o}a(lqe,"isInteractionRequiredError");function uqe(t,e){return new K1(t,e)}a(uqe,"createInteractionRequiredAuthError");p();var l_=class t extends Mo{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 MZr(t,e){if(!t)throw Pt(bOt);if(!e)throw Pt(iz);try{let r=e.split(RQe),n=r[0],o=r.length>1?r.slice(1).join(RQe):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw Pt(iz)}}a(MZr,"parseRequestState");var Op=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||XW} - Timestamp: ${e.timestamp||XW} - Description: ${e.error_description||XW} - Correlation ID: ${e.correlation_id||XW} - Trace ID: ${e.trace_id||XW}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new l_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=JNt&&e.status<=ZNt){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>=YNt&&e.status<=KNt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. +${c}`,r);return}throw lqe(e.error,e.error_description,e.suberror)?new K1(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=AL(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw Pt(gOt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw Pt(Pbe);Vbe(y,o.maxAge)}}this.homeAccountIdentifier=VOt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=MZr(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 z1(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,qOt(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(Dbe);let d=eqe(s),f,h;e.id_token&&s&&(f=zOt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=OZr(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?wh.fromString(e.scope):new wh(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=YOt(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=KOt(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===rf.POP&&!s.popKid){let T=new KU(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw Pt(xOt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=wh.fromString(n.accessToken.target).asArray(),g=Kbe(n.accessToken.expiresOn),A=Kbe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=Kbe(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===tz?tz:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?ZQe(Wse(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 OZr(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)||$Ot({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=pz(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(OZr,"buildAccountToCache");p();var u_={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 Jse(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(Jse,"getRequestThumbprint");var mz={};xi(mz,{createTokenQueryParameters:()=>t1e,createTokenRequestHeaders:()=>e1e,executePostToTokenEndpoint:()=>r1e,sendPostRequest:()=>BZr});p();p();var Xbe=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${Ibe}.${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(Np.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||lMt),n+uMt)*1e3)}static removeThrottle(e,r,n,o){let s=Jse(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var Zse=class t extends Mo{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 o5t(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new Zse(t,e,r)}a(o5t,"createNetworkError");function e1e(t,e,r){let n={};if(n[Np.CONTENT_TYPE]=jNt,!e&&r)switch(r.type){case u_.HOME_ACCOUNT_ID:try{let o=sM(r.credential);n[Np.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case u_.UPN:n[Np.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(e1e,"createTokenRequestHeaders");function t1e(t,e,r,n){let o=new Map;return t.embeddedClientId&&mL(o,e,r),t.extraQueryParameters&&hL(o,t.extraQueryParameters),uz(o,t.correlationId),oz(o,t.correlationId,n),iM(o)}a(t1e,"createTokenQueryParameters");async function r1e(t,e,r,n,o,s,c,l,u,d){let f=await BZr(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(r1e,"executePostToTokenEndpoint");async function BZr(t,e,r,n,o,s,c,l){Xbe.preProcess(o,t,n);let u;try{u=await Hs(s.sendPostRequestAsync.bind(s),hZr,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Np.X_MS_HTTP_VERSION]||"",requestId:d[Np.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof Zse){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Np.X_MS_HTTP_VERSION]||"",requestId:f[Np.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Np.CONTENT_TYPE]||void 0,contentLengthHeader:f[Np.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Mo?d:Pt(fOt)}return Xbe.postProcess(o,t,u,n),u}a(BZr,"sendPostRequest");var fqe={};xi(fqe,{createDiscoveredInstance:()=>a5t});p();p();p();function LZr(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(LZr,"isOpenIdConfigResponse");p();function FZr(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(FZr,"isCloudInstanceDiscoveryResponse");p();function UZr(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(UZr,"isCloudInstanceDiscoveryErrorResponse");p();var n1e=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=$U.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Hs(this.getRegionFromIMDS.bind(this),ZOt,this.logger,this.performanceClient,this.correlationId)(HNt,o);if(s.status===DQe&&(n=s.body,r.region_source=$U.IMDS),s.status===NQe){let c=await Hs(this.getCurrentVersion.bind(this),PZr,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=$U.FAILED_AUTO_DETECTION,null;let l=await Hs(this.getRegionFromIMDS.bind(this),ZOt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===DQe&&(n=l.body,r.region_source=$U.IMDS)}}catch{return r.region_source=$U.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=$U.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${kQe}?api-version=${e}&format=text`,r,GNt)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${kQe}?format=json`,e);return r.status===NQe&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};n1e.IMDS_OPTIONS={headers:{Metadata:"true"}};var LP=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 n1e(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(wQe))return ZI.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case FNt:return ZI.Adfs;case UNt:return ZI.Dsts}return ZI.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 vs(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(IOt);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)===ZI.Default&&this.protocolMode!==By.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new vs(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 vs(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===ZI.Adfs||this.protocolMode===By.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 Hs(this.updateCloudDiscoveryMetadata.bind(this),IZr,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Hs(this.updateEndpointMetadata.bind(this),wZr,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:nqe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Oy.CACHE&&n?.source!==Oy.CACHE&&(e.expiresAt=nqe(),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===Oy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Hs(this.updateMetadataWithRegionalInformation.bind(this),JOt,this.logger,this.performanceClient,this.correlationId)(r.metadata);Yse(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Hs(this.getEndpointMetadataFromNetwork.bind(this),xZr,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Hs(this.updateMetadataWithRegionalInformation.bind(this),JOt,this.logger,this.performanceClient,this.correlationId)(n)),Yse(e,n,!0),Oy.NETWORK;throw Pt(pOt,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),Yse(e,r,!1),{source:Oy.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 Yse(e,n,!1),{source:Oy.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=iqe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Oy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new vs(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw hl(cOt)}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 LZr(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 jOt?jOt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==$Nt)return this.regionDiscoveryMetadata.region_outcome=xbe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Hs(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),RZr,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=xbe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=xbe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Hs(this.getCloudDiscoveryMetadataFromNetwork.bind(this),TZr,this.logger,this.performanceClient,this.correlationId)();if(n)return Jbe(e,n,!0),Oy.NETWORK;throw hl(lOt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||Cbe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||Cbe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||Cbe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),Jbe(e,r,!1),Oy.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=cZr(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),Jbe(e,n,!1),Oy.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=iqe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Oy.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===ZI.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=Wbe(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),hl(VQe)}}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=`${QNt}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(FZr(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(UZr(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===zNt)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=Wbe(c,this.hostnameAndPort)}catch(o){if(o instanceof Mo)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&&bs.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==wL.None){let o=r.tenant?r.tenant:Gbe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return EMt;if(this.discoveryComplete())return this.metadata.preferred_cache;throw wt(Hk)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return I5t.has(e)}static isPublicCloudAuthority(e){return RMt.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new bs(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${wMt}`);let l=bs.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 bs(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(rqe)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${bMt}`}return r}};Gk.reservedTenantDomains=new Set(["{tenant}","{tenantid}",qk.COMMON,qk.CONSUMERS,qk.ORGANIZATIONS]);function GXr(t){let n=new bs(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case qk.COMMON:case qk.ORGANIZATIONS:case qk.CONSUMERS:return;default:return n}}a(GXr,"getTenantFromAuthorityString");function Uqe(t){return t.endsWith(Jse)?t:`${t}${Jse}`}a(Uqe,"formatAuthorityUri");function j5t(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw gl(_qe)}return{canonicalAuthority:t.authority?Uqe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(j5t,"buildStaticAuthorityOptions");async function H5t(t,e,r,n,o,s,c){let l=Gk.transformCIAMAuthority(Uqe(t)),u=new Gk(l,e,r,n,o,s,c);try{return await Vs(u.resolveEndpointsAsync.bind(u),wXr,o,c,s)(),u}catch{throw wt(Hk)}}a(H5t,"createDiscoveredInstance");var x1e=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=kL(e),this.logger=new H0(this.config.loggerOptions,a7,hM),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 wt(t5t);n&&n.cloud_instance_host_name&&await Vs(this.updateTokenEndpointAuthority.bind(this),xXr,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=nS(),s=await Vs(this.executeTokenRequest.bind(this),TXr,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Dp.X_MS_REQUEST_ID],l=new Mp(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),Vs(l.handleServerTokenResponse.bind(l),Mqe,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 gl(jOt);let r=this.createLogoutUrlQueryString(e);return bs.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=S1e(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=bs.appendQueryString(e.tokenEndpoint,o),c=await Vs(this.createTokenRequestBody.bind(this),IXr,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=uae(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${eae}${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=b1e(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=mae(this.config.authOptions.clientId,r);return Vs(T1e,_Xr,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(Tz(r,e.embeddedClientId||e.extraParameters?.[fM]||this.config.authOptions.clientId),this.includeRedirectUri)Iz(r,e.redirectUri);else if(!e.redirectUri)throw gl(LOt);if(Sz(r,e.scopes,!0,this.oidcDefaultScopes),h1e(r,e.resource),y5t(r,e.code),r1e(r,this.config.libraryInfo),n1e(r,this.config.telemetry.application),p1e(r),this.serverTelemetryManager&&!Rqe(this.config)&&f1e(r,this.serverTelemetryManager),e.codeVerifier&&_5t(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&o1e(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;s1e(r,await h_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),a1e(r,o.assertionType)}if(c1e(r,Wbe.AUTHORIZATION_CODE_GRANT),Rz(r),e.authenticationScheme===of.POP){let o=new l7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Vs(o.generateCnf.bind(o),hae,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,u1e(r,s)}else if(e.authenticationScheme===of.SSH)if(e.sshJwk)d1e(r,e.sshJwk);else throw gl(Zbe);(!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&xz(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=uae(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${eae}${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=mM(n.credential);TL(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case p_.UPN:s7(r,n.credential);break}return e.embeddedClientId&&xL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&IL(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[gqe])&&IL(r,{[gqe]:"1"}),bz(r,e.correlationId,this.performanceClient),pM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&p5t(r,e.postLogoutRedirectUri),e.correlationId&&wz(r,e.correlationId),e.idTokenHint&&h5t(r,e.idTokenHint),e.state&&i1e(r,e.state),e.logoutHint&&v5t(r,e.logoutHint),e.extraQueryParameters&&IL(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&l1e(r),pM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await H5t(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var R_o=300,Mz=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=kL(e),this.logger=new H0(this.config.loggerOptions,a7,hM),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=nS(),o=await Vs(this.executeTokenRequest.bind(this),CXr,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Dp.X_MS_REQUEST_ID],c=new Mp(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),Vs(c.handleServerTokenResponse.bind(c),Mqe,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 gl(qOt);if(!e.account)throw wt(e1e);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Vs(this.acquireTokenWithCachedRefreshToken.bind(this),Nqe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof iS&&o.errorCode===Oqe,c=o instanceof f_&&o.errorCode===zMt&&o.subError===YMt;if(s||c)return Vs(this.acquireTokenWithCachedRefreshToken.bind(this),Nqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Vs(this.acquireTokenWithCachedRefreshToken.bind(this),Nqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=BXr(this.cacheManager.getRefreshToken.bind(this.cacheManager),OXr,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw Fqe(Oqe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||R_o;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),fae(o.expiresOn,c))throw Fqe(O5t)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||of.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:p_.HOME_ACCOUNT_ID}};try{return await Vs(this.acquireToken.bind(this),vXr,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof iS&&c.subError===C1e){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=S1e(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=bs.appendQueryString(r.tokenEndpoint,n),s=await Vs(this.createTokenRequestBody.bind(this),bXr,this.logger,this.performanceClient,e.correlationId)(e),c=b1e(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=mae(this.config.authOptions.clientId,e);return Vs(T1e,EXr,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(Tz(r,e.embeddedClientId||e.extraParameters?.[fM]||this.config.authOptions.clientId),e.redirectUri&&Iz(r,e.redirectUri),Sz(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),c1e(r,Wbe.REFRESH_TOKEN_GRANT),Rz(r),r1e(r,this.config.libraryInfo),n1e(r,this.config.telemetry.application),p1e(r),this.serverTelemetryManager&&!Rqe(this.config)&&f1e(r,this.serverTelemetryManager),E5t(r,e.refreshToken),this.config.clientCredentials.clientSecret&&o1e(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;s1e(r,await h_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),a1e(r,n.assertionType)}if(e.authenticationScheme===of.POP){let n=new l7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Vs(n.generateCnf.bind(n),hae,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,u1e(r,o)}else if(e.authenticationScheme===of.SSH)if(e.sshJwk)d1e(r,e.sshJwk);else throw gl(Zbe);if((!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&xz(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=mM(e.ccsCredential.credential);TL(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case p_.UPN:s7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&xL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&IL(r,{...e.extraParameters}),bz(r,e.correlationId,this.performanceClient),pM(r)}};p();var w1e=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=kL(e),this.logger=new H0(this.config.loggerOptions,a7,hM),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=jk.NOT_APPLICABLE;if(e.forceRefresh||!su.isEmptyObj(e.claims))throw this.setCacheOutcome(jk.FORCE_REFRESH_OR_CLAIMS,e.correlationId),wt(aae);if(!e.account)throw wt(e1e);let n=e.account.tenantId||GXr(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(R5t(s.cachedAt)||fae(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(jk.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),wt(aae);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(jk.NO_CACHED_ACCESS_TOKEN,e.correlationId),wt(aae)}else s.refreshOn&&fae(s.refreshOn,0)&&(r=jk.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(jk.NO_CACHED_ACCESS_TOKEN,e.correlationId),wt(aae);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 Vs(this.generateResultFromCacheRecord.bind(this),SXr,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==jk.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=RL(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw wt(Xbe);m1e(o,r.maxAge)}return Mp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var R1e={};wi(R1e,{getAuthorizationCodePayload:()=>D_o,getAuthorizeUrl:()=>P_o,getStandardAuthorizeRequestParameters:()=>k_o,validateAuthorizationResponse:()=>$Xr});p();function k_o(t,e,r,n){let o=e.correlationId,s=new Map;Tz(s,e.embeddedClientId||e.extraQueryParameters?.[fM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(Sz(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),h1e(s,e.resource),Iz(s,e.redirectUri),wz(s,o),f5t(s,e.responseMode),Rz(s),C5t(s),e.prompt&&(g5t(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(m5t(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==Vbe.SELECT_ACCOUNT)if(e.sid&&e.prompt===Vbe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),Tqe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=M_o(e.account),u=O_o(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),cae(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=mM(e.account.homeAccountId);TL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===Vbe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),Tqe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=mM(e.account.homeAccountId);TL(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),cae(s,e.loginHint),s7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),cae(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=mM(e.account.homeAccountId);TL(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),cae(s,e.loginHint),s7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&A5t(s,e.nonce),e.state&&i1e(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&xz(s,e.claims,t.clientCapabilities),e.embeddedClientId&&xL(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(nae))&&l1e(s),s}a(k_o,"getStandardAuthorizeRequestParameters");function P_o(t,e){let r=pM(e);return bs.appendQueryString(t.authorizationEndpoint,r)}a(P_o,"getAuthorizeUrl");function D_o(t,e){if($Xr(t,e),!t.code)throw wt(a5t);return t}a(D_o,"getAuthorizationCodePayload");function $Xr(t,e){if(!t.state||!e)throw t.state?wt(bqe,"Cached State"):wt(bqe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw wt(vz,t.state)}try{n=decodeURIComponent(e)}catch{throw wt(vz,t.state)}if(r!==n)throw wt(JOt);if(t.error||t.error_description||t.suberror){let o=N_o(t);throw Lqe(t.error,t.error_description,t.suberror)?new iS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new f_(t.error||"",t.error_description,t.suberror,o)}}a($Xr,"validateAuthorizationResponse");function N_o(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(N_o,"parseServerErrorNo");function M_o(t){return t.idTokenClaims?.sid||null}a(M_o,"extractAccountSid");function O_o(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(O_o,"extractLoginHint");p();function Oz(t,e){if(t){if(e.resource&&(VXr(e.extraParameters)||VXr(e.extraQueryParameters)))throw wt(d5t);if(!e.resource)throw wt(u5t)}}a(Oz,"enforceResourceParameter");function VXr(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(VXr,"containsResourceParam");var Aae={};wi(Aae,{postRequestFailed:()=>L_o,unexpectedError:()=>B_o});p();var B_o="unexpected_error",L_o="post_request_failed";p();var WXr=",",zXr="|";function F_o(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(WXr),l.length<4)return e}else l=Array.from({length:4},()=>zXr);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&U_o({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(WXr)}a(F_o,"makeExtraSkuString");function U_o(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(zXr))}a(U_o,"setSku");var Bz=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=jk.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=zbe+yz+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${n7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(n7),s=this.getRegionDiscoveryFields(),c=[e,s].join(n7);return[uqe,c,o].join(dqe)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(n7),o=e.errors.slice(0,r).join(n7),s=e.errors.length,c=r=qMt&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Bo?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(GMt),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={};c7.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 YXr="system_assigned_managed_identity",Q_o="managed_identity",$5t=`https://login.microsoftonline.com/${Q_o}/`,uv={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},Rh={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"},io={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},af={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"},qf={GET:"GET",POST:"POST"},KXr="REGION_NAME",JXr="MSAL_FORCE_REGION",ZXr=32,XXr={SHA256:"sha256"},qqe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},V5t={KEY_SEPARATOR:"-"},ox={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},sx={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"},jqe={INTERVAL_MS:100,TIMEOUT_MS:5e3},een=4096;p();p();p();var yae=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,qf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,qf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:j_o(n),signal:s.signal};r===qf.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 Cz(Np.networkError,"Request timeout");let f=Cz(Np.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw q5t(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:q_o(u.headers),body:await u.json(),status:u.status}}catch(d){throw Cz(Np.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function q_o(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(q_o,"getHeaderDict");function j_o(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(j_o,"getFetchHeaders");p();p();p();var Hqe="invalid_file_extension",Gqe="invalid_file_path",u7="invalid_managed_identity_id_type",$qe="invalid_secret",ten="missing_client_id",ren="network_unavailable",Vqe="platform_not_supported",Wqe="unable_to_create_azure_arc",zqe="unable_to_create_cloud_shell",Yqe="unable_to_create_source",k1e="unable_to_read_secret_file",nen="user_assigned_not_available_at_runtime",Kqe="www_authenticate_header_missing",Jqe="www_authenticate_header_unsupported_format",Lz={[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 H_o={[Hqe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[Gqe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[u7]:"More than one ManagedIdentityIdType was provided.",[$qe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[Vqe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[ten]:"A ManagedIdentityId id was not provided.",[Lz.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[Lz.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[Lz.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[Lz.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[ren]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[Wqe]:"Azure Arc Managed Identities can only be system assigned.",[zqe]:"Cloud Shell Managed Identities can only be system assigned.",[Yqe]:"Unable to create a Managed Identity source based on environment variables.",[k1e]:"Unable to read the secret file.",[nen]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[Kqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[Jqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},W5t=class t extends Bo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,H_o[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Op(t){return new W5t(t)}a(Op,"createManagedIdentityError");var Zqe=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 Op(u7);this.id=r,this.idType=af.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Op(u7);this.id=n,this.idType=af.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Op(u7);this.id=o,this.idType=af.USER_ASSIGNED_OBJECT_ID}else this.id=YXr,this.idType=af.SYSTEM_ASSIGNED}};p();var kh={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."}},Ny=class t extends Bo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(kh.invalidLoopbackAddressType.code,`${kh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(kh.unableToLoadRedirectUri.code,`${kh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(kh.noAuthCodeInResponse.code,`${kh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(kh.noLoopbackServerExists.code,`${kh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(kh.loopbackServerAlreadyExists.code,`${kh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(kh.loopbackServerTimeout.code,`${kh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(kh.stateNotFoundError.code,kh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(kh.thumbprintMissing.code,kh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(kh.redirectUriNotSupported.code,kh.redirectUriNotSupported.desc)}};var G_o={clientId:"",authority:Xt.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:wL.None,tenant:""},isMcp:!1},z5t={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:sf.Info},$_o={loggerOptions:z5t,networkClient:new yae,disableInternalRetries:!1,protocolMode:Dy.AAD},V_o={application:{appName:"",appVersion:""}};function ien({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...$_o,networkClient:new yae,loggerOptions:n?.loggerOptions||z5t,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw Ny.createStateNotFoundError();return{auth:{...G_o,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...V_o,...o}}}a(ien,"buildAppConfiguration");function oen({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new Zqe(e),o=r?.loggerOptions||z5t,s;return r?.networkClient?s=r.networkClient:s=new yae,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(oen,"buildManagedIdentityConfiguration");p();p();Ns();var Eae=class{static{a(this,"GuidGenerator")}generateGuid(){return gr()}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 oS=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(Xt.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,Xt.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 sen=ce(require("crypto"),1);var d7=class{static{a(this,"HashUtils")}sha256(e){return sen.default.createHash(XXr.SHA256).update(e).digest()}};var aen=ce(require("crypto"),1);var Xqe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new d7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%qqe.CV_CHARSET.length;for(;e.length<=ZXr;){let o=aen.default.randomBytes(1)[0];if(o>=r)continue;let s=o%qqe.CV_CHARSET.length;e.push(qqe.CV_CHARSET[s])}let n=e.join("");return oS.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return oS.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};var gM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new Xqe,this.guidGenerator=new Eae,this.hashUtils=new d7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return oS.base64Encode(e)}base64Decode(e){return oS.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 oS.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};p();p();function cen(t){let e=t.credentialType===Xt.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(V5t.KEY_SEPARATOR).toLowerCase()}a(cen,"generateCredentialKey");function len(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(V5t.KEY_SEPARATOR).toLowerCase()}a(len,"generateAccountKey");var f7=class extends c7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new wh,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(Dz.isAccountEntity(o))r.accounts[n]=o;else if(d_.isIdTokenEntity(o))r.idTokens[n]=o;else if(d_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(d_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(d_.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 cen(e)}generateAccountKey(e){return len(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(Dz.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return d_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return d_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return d_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return d_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=d_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&d_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&d_.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&&d_.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 PL.deserializeAllCache(PL.deserializeJSONBlob(e))}static generateJsonCache(e){return r7.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 P1e={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},_ae=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=r7.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=PL.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=f7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new gM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new rS(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 rS(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new Eae().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 rS(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:{...P1e.Account,...e.Account},IdToken:{...P1e.IdToken,...e.IdToken},AccessToken:{...P1e.AccessToken,...e.AccessToken},RefreshToken:{...P1e.RefreshToken,...e.RefreshToken},AppMetadata:{...P1e.AppMetadata,...e.AppMetadata}}}};p();var Wnn=ce(Qnn(),1);p();var qnn="missing_tenant_id_error",jnn="user_timeout_reached",Hnn="invalid_assertion",U4t="invalid_client_credential",Gnn="device_code_polling_cancelled",$nn="device_code_expired",Vnn="device_code_unknown_error";var NL=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 wt(Hnn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Hu.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?sx.PSS_256:sx.RSA_256},l=this.useSha256?sx.X5T_256:sx.X5T;Object.assign(c,{[l]:oS.base64EncodeUrl(this.thumbprint,Xt.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[sx.X5C]:this.publicCertificate});let u={[sx.AUDIENCE]:this.jwtAudience,[sx.EXPIRATION_TIME]:this.expirationTime,[sx.ISSUER]:this.issuer,[sx.SUBJECT]:this.issuer,[sx.NOT_BEFORE]:o,[sx.JWT_ID]:e.createNewGuid()};return this.jwt=Wnn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&sn.addCcsUpn(r,e.username),nA.mapToQueryString(r)}};p();function znn(t,e,r,n){let o=R1e.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return sn.addLibraryInfo(o,{sku:ox.MSAL_SKU,version:sS,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==Dy.OIDC&&sn.addApplicationTelemetry(o,t.telemetry.application),sn.addResponseType(o,Xt.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&sn.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),sn.addExtraParameters(o,r.extraQueryParameters||{}),R1e.getAuthorizeUrl(e,o)}a(znn,"getAuthCodeRequestUrl");var Pae=class{static{a(this,"ClientApplication")}constructor(e){this.config=ien(e),this.cryptoProvider=new gM,this.logger=new H0(this.config.system.loggerOptions,kae,sS),this.storage=new f7(this.logger,this.config.auth.clientId,this.cryptoProvider,j5t(this.config.auth)),this.tokenCache=new _ae(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||Xt.ResponseMode.QUERY,authenticationScheme:Xt.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return znn(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:Xt.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 x1e(c,new wh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,cf.acquireTokenByCode,r)}catch(s){throw s instanceof Bo&&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:Xt.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 Mz(s,new wh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,cf.acquireTokenByRefreshToken)}catch(o){throw o instanceof Bo&&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 w1e(s,new wh);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 o7&&l.errorCode===Np.tokenRefreshRequired)return new Mz(s,new wh).acquireTokenByRefreshToken(r,cf.acquireTokenSilent);throw l}}catch(o){throw o instanceof Bo&&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:[...Xt.OIDC_DEFAULT_SCOPES]});if(s===Xt.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 Mz(n,new wh);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 Rje(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw Ny.createStateNotFoundError();if(e!==r)throw wt(Np.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:ox.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=NL.fromAssertion(await h_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:ox.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===Xt.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=Xt.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...Xt.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 Bz(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=Gk.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 Qqe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new wh)}clearCache(){this.storage.clear()}};p();var Ynn=ce(require("http"),1);var kje=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw Ny.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=Ynn.default.createServer((s,c)=>{let l=s.url;if(l){if(l===Xt.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(Ny.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=nA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(Xt.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 Ny.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),Ny.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${ox.HTTP_PROTOCOL}${ox.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 Pje=class extends EM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Hu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Mp(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=bs.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&&sn.addExtraParameters(r,e.extraQueryParameters),nA.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 sn.addScopes(r,e.scopes),sn.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&sn.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),wt(Gnn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),wt(jnn);if(Hu.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}`,""),wt($nn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=bs.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Hu.nowSeconds()+e.timeout:void 0,u=Hu.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===Xt.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Hu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),Cz(Aae.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),wt(Vnn)}createTokenRequestBody(e,r){let n=new Map;sn.addScopes(n,e.scopes),sn.addClientId(n,this.config.authOptions.clientId),sn.addGrantType(n,Xt.GrantType.DEVICE_CODE_GRANT),sn.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return sn.addCorrelationId(n,o),sn.addClientInfo(n),sn.addLibraryInfo(n,this.config.libraryInfo),sn.addApplicationTelemetry(n,this.config.telemetry.application),sn.addThrottling(n),this.serverTelemetryManager&&sn.addServerTelemetry(n,this.serverTelemetryManager),(!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(n)}};var Dae=class extends Pae{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=Bz.makeExtraSkuString({libraryName:ox.MSAL_SKU,libraryVersion:sS})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),Oz(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 Pje(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),Oz(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||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[_z.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 Ny.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new kje,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||Xt.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:Xt.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:Xt.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new f_(m.error,m.error_description,m.suberror);if(!m.code)throw Ny.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),Oz(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[_z.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 Ny.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return Oz(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return Oz(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(jqe.TIMEOUT_MS/jqe.INTERVAL_MS1)throw wt(Np.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=Hu.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:Xt.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=bs.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=Hu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Mp(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;sn.addClientId(r,this.config.authOptions.clientId),sn.addScopes(r,e.scopes,!1),sn.addGrantType(r,Xt.GrantType.CLIENT_CREDENTIALS_GRANT),sn.addLibraryInfo(r,this.config.libraryInfo),sn.addApplicationTelemetry(r,this.config.telemetry.application),sn.addThrottling(r),this.serverTelemetryManager&&sn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();sn.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&sn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(sn.addClientAssertion(r,await h_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sn.addClientAssertionType(r,o.assertionType)),(!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(r)}};p();var Dje=class extends EM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new xh(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(Hu.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(Xt.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),wt(Np.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(Xt.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),wt(Np.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=xqe.extractTokenClaims(n.secret,oS.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(),Mp.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:Xt.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||Xt.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?Xt.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:Xt.CredentialType.ACCESS_TOKEN,clientId:e,target:xh.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 wt(Np.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=bs.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=Hu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Mp(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;sn.addClientId(r,this.config.authOptions.clientId),sn.addScopes(r,e.scopes),sn.addGrantType(r,Xt.GrantType.JWT_BEARER),sn.addClientInfo(r),sn.addLibraryInfo(r,this.config.libraryInfo),sn.addApplicationTelemetry(r,this.config.telemetry.application),sn.addThrottling(r),this.serverTelemetryManager&&sn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();sn.addCorrelationId(r,n),sn.addRequestTokenUse(r,_z.ON_BEHALF_OF),sn.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&sn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(sn.addClientAssertion(r,await h_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sn.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(r)}};var Mae=class extends Pae{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 wt(U4t);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?NL.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):NL.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw wt(U4t);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 h_(e.clientAssertion,this.config.auth.clientId),assertionType:ox.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!Xt.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new bs(s.authority).getUrlComponents().PathSegments[0];if(Object.values(Xt.AADAuthority).includes(l))throw wt(qnn);let u=process.env[JXr],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[KXr]},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 Nae(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Bo&&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 Dje(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Bo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function Knn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(Knn,"isIso8601");p();var Nje=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===qf.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[Xt.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(qf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(qf.POST,e,r)}};var Qz={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"},A_=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&&(Knn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Hu.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[Rh.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[Rh.XMS_CC]=g}let c=s.headers;c[Xt.HeaderNames.CONTENT_TYPE]=Xt.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new Nje(this.networkClient,s.retryPolicy,this.logger),d=Hu.nowSeconds(),f;try{s.httpMethod===qf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Bo?g:wt(Np.networkError)}let h=new Mp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new wh,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 af.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?Qz.MANAGED_IDENTITY_CLIENT_ID_2017:Qz.MANAGED_IDENTITY_CLIENT_ID;case af.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?Qz.MANAGED_IDENTITY_RESOURCE_ID_IMDS:Qz.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case af.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),Qz.MANAGED_IDENTITY_OBJECT_ID;default:throw Op(u7)}}};A_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new bs(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Op(Lz[t])}};p();p();p();var Mje=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 aIo=3,cIo=1e3,lIo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_TOO_MANY_REQUESTS,Xt.HTTP_SERVER_ERROR,Xt.HTTP_SERVICE_UNAVAILABLE,Xt.HTTP_GATEWAY_TIMEOUT],Oje=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new Mje}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return cIo}async pauseForRetry(e,r,n,o){if(lIo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var dv=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 Oje}computeUri(){let e=new Map;this.queryParameters&&sn.addExtraParameters(e,this.queryParameters);let r=nA.mapToQueryString(e);return bs.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&sn.addExtraParameters(e,this.bodyParameters),nA.mapToQueryString(e)}};var uIo="2019-08-01",q1e=class t extends A_{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] ${io.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,io.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${io.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new dv(qf.GET,this.identityEndpoint);return n.headers[uv.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Rh.API_VERSION]=uIo,n.queryParameters[Rh.RESOURCE]=e,r.idType!==af.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var ML=require("fs"),ein=ce(require("path"),1);var dIo="2019-11-01",Jnn="http://127.0.0.1:40342/metadata/identity/oauth2/token",Znn="N/A: himds executable exists",Xnn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},fIo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},j1e=class t extends A_{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=fIo[process.platform];try{(0,ML.accessSync)(n,ML.constants.F_OK|ML.constants.R_OK),e=Jnn,r=Znn}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] ${io.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${io.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===Znn)e.info(`[Managed Identity] ${io.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${io.AZURE_ARC} endpoint: ${Jnn}. Creating ${io.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,io.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,io.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${io.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${io.AZURE_ARC} managed identity.`,"")}if(c.idType!==af.SYSTEM_ASSIGNED)throw Op(Wqe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new dv(qf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[uv.METADATA_HEADER_NAME]="true",r.queryParameters[Rh.API_VERSION]=dIo,r.queryParameters[Rh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===Xt.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Op(Kqe);if(!c.includes("Basic realm="))throw Op(Jqe);let l=c.split("Basic realm=")[1];if(!Xnn.hasOwnProperty(process.platform))throw Op(Vqe);let u=Xnn[process.platform],d=ein.default.basename(l);if(!d.endsWith(".key"))throw Op(Hqe);if(u+d!==l)throw Op(Gqe);let f;try{f=await(0,ML.statSync)(l).size}catch{throw Op(k1e)}if(f>een)throw Op($qe);let h;try{h=(0,ML.readFileSync)(l,Xt.EncodingTypes.UTF8)}catch{throw Op(k1e)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[uv.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Bo?g:wt(Np.networkError)}}return this.getServerTokenResponse(s||e)}};p();var H1e=class t extends A_{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] ${io.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,io.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${io.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${io.CLOUD_SHELL} managed identity.`,""),c.idType!==af.SYSTEM_ASSIGNED)throw Op(zqe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new dv(qf.POST,this.msiEndpoint);return r.headers[uv.METADATA_HEADER_NAME]="true",r.bodyParameters[Rh.RESOURCE]=e,r}};p();p();p();var Bje=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 pIo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_GONE,Xt.HTTP_TOO_MANY_REQUESTS],hIo=3,mIo=7,gIo=1e3,AIo=4e3,yIo=2e3,EIo=10*1e3,Lje=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new Bje(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return gIo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return AIo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return yIo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return EIo}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===Xt.HTTP_GONE?mIo:hIo),(pIo.includes(e)||e>=Xt.HTTP_SERVER_ERROR_RANGE_START&&e<=Xt.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var tin="/metadata/identity/oauth2/token",_Io=`http://169.254.169.254${tin}`,CIo="2018-02-01",Fje=class t extends A_{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 ${io.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]}${tin}`,io.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${io.IMDS}, using the default endpoint.`,""),c=_Io),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new dv(qf.GET,this.identityEndpoint);return n.headers[uv.METADATA_HEADER_NAME]="true",n.queryParameters[Rh.API_VERSION]=CIo,n.queryParameters[Rh.RESOURCE]=e,r.idType!==af.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new Lje,n}};p();var vIo="2019-07-01-preview",G1e=class t extends A_{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] ${io.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,io.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${io.SERVICE_FABRIC} managed identity.`,""),c.idType!==af.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${io.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 dv(qf.GET,this.identityEndpoint);return n.headers[uv.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Rh.API_VERSION]=vIo,n.queryParameters[Rh.RESOURCE]=e,r.idType!==af.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var bIo="2017-09-01",SIo=`Only client id is supported for user-assigned managed identity in ${io.MACHINE_LEARNING}.`,$1e=class t extends A_{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] ${io.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,io.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${io.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new dv(qf.GET,this.msiEndpoint);if(n.headers[uv.METADATA_HEADER_NAME]="true",n.headers[uv.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[Rh.API_VERSION]=bIo,n.queryParameters[Rh.RESOURCE]=e,r.idType===af.SYSTEM_ASSIGNED)n.queryParameters[Qz.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===af.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(SIo);return n}};var V1e=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(G1e.getEnvironmentVariables())?io.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(q1e.getEnvironmentVariables())?io.APP_SERVICE:this.allEnvironmentVariablesAreDefined($1e.getEnvironmentVariables())?io.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(H1e.getEnvironmentVariables())?io.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(j1e.getEnvironmentVariables())?io.AZURE_ARC:io.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=G1e.tryCreate(e,r,n,o,s,c)||q1e.tryCreate(e,r,n,o,s)||$1e.tryCreate(e,r,n,o,s)||H1e.tryCreate(e,r,n,o,s,c)||j1e.tryCreate(e,r,n,o,s,c)||Fje.tryCreate(e,r,n,o,s);if(!l)throw Op(Yqe);return l}};var TIo=[io.SERVICE_FABRIC],Oae=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=oen(e||{}),this.logger=new H0(this.config.system.loggerOptions,kae,sS);let r={canonicalAuthority:Xt.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new f7(this.logger,this.config.managedIdentityId.id,lae,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new gM;let n={protocolMode:Dy.AAD,knownAuthorities:[$5t],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new Gk($5t,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new wh,!0),this.fakeClientCredentialClient=new Nae({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new V1e(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new d7}async acquireToken(e){if(!e.resource)throw gl(sae.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&&TIo.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(Xt.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===Xt.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 V1e.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var Uje=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=>Dz.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 IIo=Xt.PromptValue,xIo=Xt.ResponseMode;p();p();p();p();p();function W1e(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(W1e,"getRandomIntegerInclusive");function z1e(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+W1e(0,n/2)}}a(z1e,"calculateRetryDelay");p();function Bae(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Bae,"isObject");p();function qz(t){if(Bae(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(qz,"isError");p();p();var rin=require("node:crypto");var Q4t,wIo=typeof((Q4t=globalThis?.crypto)===null||Q4t===void 0?void 0:Q4t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):rin.randomUUID;function Lae(){return wIo()}a(Lae,"randomUUID");p();var q4t,j4t,H4t,G4t,nin=typeof window<"u"&&typeof window.document<"u",iin=typeof self=="object"&&typeof self?.importScripts=="function"&&(((q4t=self.constructor)===null||q4t===void 0?void 0:q4t.name)==="DedicatedWorkerGlobalScope"||((j4t=self.constructor)===null||j4t===void 0?void 0:j4t.name)==="ServiceWorkerGlobalScope"||((H4t=self.constructor)===null||H4t===void 0?void 0:H4t.name)==="SharedWorkerGlobalScope"),oin=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",sin=typeof Bun<"u"&&typeof Bun.version<"u",g7=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((G4t=globalThis.process.versions)===null||G4t===void 0)&&G4t.node);var ain=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function fv(t,e){return Buffer.from(t,e)}a(fv,"stringToUint8Array");p();var $4t="REDACTED",RIo=["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"],kIo=["api-version"],Vk=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=RIo.concat(e),r=kIo.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)||Bae(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,$4t);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]=$4t;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]=$4t;return r}};p();p();p();p();var jz=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function W4t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new jz(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(W4t,"createAbortablePromise");p();var OIo="The delay was aborted.";function z4t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return W4t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??OIo})}a(z4t,"delay");p();function Fae(t){if(qz(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(Fae,"getErrorMessage");p();function cin(t,e){return z1e(t,e)}a(cin,"calculateRetryDelay");function Qje(t){return qz(t)}a(Qje,"isError");var qje=g7,Uae=g7;p();var Y1e=lo("IdentityUtils"),lin="1.0";function Hz(t,e,r){let n=a(o=>(Y1e.getToken.info(o),new nx({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(Hz,"ensureValidMsalToken");function Y4t(t){let e=t?.authorityHost;return!e&&Uae&&(e=process.env.AZURE_AUTHORITY_HOST),e??Ube}a(Y4t,"getAuthorityHost");function K4t(t,e){return e||(e=Ube),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(K4t,"getAuthority");function uin(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(uin,"getKnownAuthorities");var jje=a((t,e=qje?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case aS.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case aS.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case aS.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case aS.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function Hje(t){switch(t){case"error":return aS.LogLevel.Error;case"info":return aS.LogLevel.Info;case"verbose":return aS.LogLevel.Verbose;case"warning":return aS.LogLevel.Warning;default:return aS.LogLevel.Info}}a(Hje,"getMSALLogLevel");function Gz(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return Y1e.info(Os(t,e.message)),new Dn(e.message);case"device_code_polling_cancelled":return new jz("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":Y1e.info(Os(t,`Authentication returned errorCode ${n.errorCode}`));break;default:Y1e.info(Os(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"?(Y1e.info(Os(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new nx({scopes:t,getTokenOptions:r,message:e.message})}a(Gz,"handleMsalError");function din(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(din,"publicToMsal");function fin(t,e){return{authority:e.environment??IZr,homeAccountId:e.homeAccountId,tenantId:e.tenantId||TZr,username:e.username,clientId:t,version:lin}}a(fin,"msalToPublic");function J4t(t){let e=JSON.parse(t);if(e.version&&e.version!==lin)throw Error("Unsupported AuthenticationRecord version");return e}a(J4t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function LIo(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(LIo,"isPrimitiveBody");function FIo(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(FIo,"handleNullableResponseAndWrappableBody");function Z4t(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 FIo({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:LIo(t.parsedBody,l)})}a(Z4t,"flattenResponse");var _M={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 CM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var pin=require("node:os"),hin=ce(require("node:util"),1),min=ce(require("node:process"),1);function gin(t,...e){min.stderr.write(`${hin.default.format(t,...e)}${pin.EOL}`)}a(gin,"log");var Ain=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,yin,X4t=[],eBt=[],$je=[];Ain&&tBt(Ain);var Ein=Object.assign(t=>_in(t),{enable:tBt,enabled:rBt,disable:UIo,log:gin});function tBt(t){yin=t,X4t=[],eBt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?eBt.push(new RegExp(`^${n.substr(1)}$`)):X4t.push(new RegExp(`^${n}$`));for(let n of $je)n.enabled=rBt(n.namespace)}a(tBt,"enable");function rBt(t){if(t.endsWith("*"))return!0;for(let e of eBt)if(e.test(t))return!1;for(let e of X4t)if(e.test(t))return!0;return!1}a(rBt,"enabled");function UIo(){let t=yin||"";return tBt(""),t}a(UIo,"disable");function _in(t){let e=Object.assign(r,{enabled:rBt(t),destroy:QIo,log:Ein.log,namespace:t,extend:qIo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),$je.push(e),e}a(_in,"createDebugger");function QIo(){let t=$je.indexOf(this);return t>=0?($je.splice(t,1),!0):!1}a(QIo,"destroy");function qIo(t){let e=_in(`${this.namespace}:${t}`);return e.log=this.log,e}a(qIo,"extend");var Qae=Ein;var nBt=["verbose","info","warning","error"],Cin={verbose:400,info:300,warning:200,error:100};function vin(t,e){e.log=(...r)=>{t.log(...r)}}a(vin,"patchLogMethod");function bin(t){return nBt.includes(t)}a(bin,"isTypeSpecRuntimeLogLevel");function jIo(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Qae(t.namespace);o.log=(...f)=>{Qae.log(...f)};function s(f){if(f&&!bin(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${nBt.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Qae.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(bin(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${nBt.join(", ")}.`));function c(f){return!!(n&&Cin[f.level]<=Cin[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(vin(f,m),c(m)){let g=Qae.disable();Qae.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 vin(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(jIo,"createLoggerContext");var Sin=jIo({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),HIo=Sin.logger;function J1e(t){return Sin.createClientLogger(t)}a(J1e,"createClientLogger");p();function Vje(t){return t.toLowerCase()}a(Vje,"normalizeName");function*GIo(t){for(let e of t.values())yield[e.name,e.value]}a(GIo,"headerIterator");var iBt=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(Vje(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(Vje(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(Vje(e))}delete(e){this._headersMap.delete(Vje(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 GIo(this._headersMap)}};function cS(t){return new iBt(t)}a(cS,"createHttpHeaders");p();p();p();var oBt=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:cS(),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||Lae(),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 Wje(t){return new oBt(t)}a(Wje,"createPipelineRequest");p();var Tin=new Set(["Deserialize","Serialize","Retry","Sign"]),sBt=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&&!Tin.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Tin.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 zje(){return sBt.create()}a(zje,"createEmptyPipeline");p();p();var Iin=require("node:util"),xin=Iin.inspect.custom;var $Io=new Vk,sA=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,xin,{value:a(()=>`RestError: ${this.message} - ${$Io.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};sA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";sA.PARSE_ERROR="PARSE_ERROR";function Yje(t){return t instanceof sA?!0:qz(t)&&t.name==="RestError"}a(Yje,"isRestError");p();p();var qae=ce(require("node:http"),1),jae=ce(require("node:https"),1),Jje=ce(require("node:zlib"),1),Rin=require("node:stream");p();var ux=J1e("ts-http-runtime");var VIo={};function Z1e(t){return t&&typeof t.pipe=="function"}a(Z1e,"isReadableStream");function win(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(win,"isStreamComplete");function kin(t){return t&&typeof t.byteLength=="number"}a(kin,"isArrayBuffer");var Kje=class extends Rin.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}},aBt=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 CM("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 Vk;ux.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=KIo(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new Kje(_);v.on("error",b=>{ux.error("Error in upload progress",b)}),Z1e(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=WIo(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?zIo(m,g):m;let E=e.onDownloadProgress;if(E){let _=new Kje(E);_.on("error",v=>{ux.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 YIo(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();Z1e(f)&&(m=win(f));let g=Promise.resolve();Z1e(h)&&(g=win(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{ux.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?qae.request(u,d):jae.request(u,d);h.once("error",m=>{var g;f(new sA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:sA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new CM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&Z1e(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):kin(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(ux.error("Unrecognized body type",n),f(new sA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?qae.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new qae.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return jae.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:VIo,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(ux.info("No cached TLS Agent exist, creating a new Agent"),c=new jae.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function WIo(t){let e=cS();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(WIo,"getResponseHeaders");function zIo(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=Jje.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=Jje.createInflate();return t.pipe(n),n}return t}a(zIo,"getDecodedResponseStream");function YIo(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 sA(`Error reading response as text: ${o.message}`,{code:sA.PARSE_ERROR}))})})}a(YIo,"streamToText");function KIo(t){return t?Buffer.isBuffer(t)?t.length:Z1e(t)?null:kin(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(KIo,"getBodyLength");function Pin(){return new aBt}a(Pin,"createNodeHttpClient");function Zje(){return Pin()}a(Zje,"createDefaultHttpClient");p();p();p();p();var cBt="logPolicy";function Xje(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:ux.info,n=new Vk({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:cBt,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(Xje,"logPolicy");p();var lBt="redirectPolicy",Din=["GET","HEAD"];function eHe(t={}){let{maxRetries:e=20}=t;return{name:lBt,async sendRequest(r,n){let o=await n(r);return Nin(n,o,e)}}}a(eHe,"redirectPolicy");async function Nin(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&Din.includes(o.method)||s===302&&Din.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new CM(r?.abortErrorMsg?r?.abortErrorMsg:JIo)),"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(Bin,"delay");function Lin(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Lin,"parseHeaderValueAsNumber");var dBt="Retry-After",ZIo=["retry-after-ms","x-ms-retry-after-ms",dBt];function Fin(t){if(t&&[429,503].includes(t.status))try{for(let o of ZIo){let s=Lin(t,o);if(s===0||s)return s*(o===dBt?1e3:1)}let e=t.headers.get(dBt);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Fin,"getRetryAfterInMs");function Uin(t){return Number.isFinite(Fin(t))}a(Uin,"isThrottlingRetryResponse");function fBt(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Fin(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(fBt,"throttlingRetryStrategy");var XIo=1e3,exo=1e3*64;function rHe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:XIo,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:exo;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=rxo(l),d=u&&t.ignoreSystemErrors,f=txo(c),h=f&&t.ignoreHttpStatusCodes;return c&&(Uin(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:z1e(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(rHe,"exponentialRetryStrategy");function txo(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(txo,"isExponentialRetryResponse");function rxo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(rxo,"isSystemError");p();var nxo=J1e("ts-http-runtime retryPolicy"),ixo="retryPolicy";function A7(t,e={maxRetries:3}){let r=e.logger||nxo;return{name:ixo,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 CM;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 Bin(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(A7,"retryPolicy");var pBt="defaultRetryPolicy";function nHe(t={}){var e;return{name:pBt,sendRequest:A7([fBt(),rHe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(nHe,"defaultRetryPolicy");p();var hBt="formDataPolicy";function oxo(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(oxo,"formDataToFormDataMap");function iHe(){return{name:hBt,async sendRequest(t,e){if(g7&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=oxo(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=sxo(t.formData):await axo(t.formData,t),t.formData=void 0}return e(t)}}}a(iHe,"formDataPolicy");function sxo(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(sxo,"wwwFormUrlEncode");async function axo(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:cS({"Content-Disposition":`form-data; name="${o}"`}),body:fv(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=cS();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(axo,"prepareFormData");p();var uon=ce(vBt(),1),don=ce(bBt(),1);var two="HTTPS_PROXY",rwo="HTTP_PROXY",nwo="ALL_PROXY",iwo="NO_PROXY",SBt="proxyPolicy",aon=[],fon=!1,owo=new Map;function fHe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(fHe,"getEnvironmentValue");function swo(){if(!process)return;let t=fHe(two),e=fHe(nwo),r=fHe(rwo);return t||e||r}a(swo,"loadEnvironmentProxyValue");function awo(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(awo,"isBypassed");function cwo(){let t=fHe(iwo);return fon=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(cwo,"loadNoProxy");function lwo(){let t=swo();return t?new URL(t):void 0}a(lwo,"getDefaultProxySettingsInternal");function con(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(con,"getUrlFromProxySettings");function lon(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&ux.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 don.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new uon.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(lon,"setProxyAgentOnRequest");function pHe(t,e){fon||aon.push(...cwo());let r=t?con(t):lwo(),n={};return{name:SBt,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!awo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:aon,e?.customNoProxyList?void 0:owo)?lon(o,n,r):o.proxySettings&&lon(o,n,con(o.proxySettings)),s(o)}}}a(pHe,"proxyPolicy");p();var TBt="agentPolicy";function hHe(t){return{name:TBt,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(hHe,"agentPolicy");p();var IBt="tlsPolicy";function mHe(t){return{name:IBt,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(mHe,"tlsPolicy");p();p();function gHe(t){return typeof t.stream=="function"}a(gHe,"isBlob");p();OL();var CHe=require("stream");function Fon(){return eSe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield dS(e.read());if(r)return yield dS(void 0);yield yield dS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Fon,"streamAsyncIterator");function pwo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Fon.bind(t)),t.values||(t.values=Fon.bind(t))}a(pwo,"makeAsyncIterable");function Uon(t){return t instanceof ReadableStream?(pwo(t),CHe.Readable.fromWeb(t)):t}a(Uon,"ensureNodeStream");function hwo(t){return t instanceof Uint8Array?CHe.Readable.from(Buffer.from(t)):gHe(t)?Uon(t.stream()):Uon(t)}a(hwo,"toStream");async function Qon(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(hwo);return CHe.Readable.from((function(){return eSe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,_He(d)),u;u=yield dS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield dS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield dS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Qon,"concat");function mwo(){return`----AzSDKFormBoundary${Lae()}`}a(mwo,"generateBoundary");function gwo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(gwo,"encodeHeaders");function Awo(t){return t instanceof Uint8Array?t.byteLength:gHe(t)?t.size===-1?void 0:t.size:void 0}a(Awo,"getLength");function ywo(t){let e=0;for(let r of t){let n=Awo(r);if(n===void 0)return;e+=n}return e}a(ywo,"getTotalLength");async function Ewo(t,e,r){let n=[fv(`--${r}`,"utf-8"),...e.flatMap(s=>[fv(`\r -`,"utf-8"),fv(gwo(s.headers),"utf-8"),fv(`\r -`,"utf-8"),s.body,fv(`\r ---${r}`,"utf-8")]),fv(`--\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&&vs.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==gL.None){let o=r.tenant?r.tenant:vbe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return LNt;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Pt(BP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return GOt.has(e)}static isPublicCloudAuthority(e){return WNt.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new vs(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${VNt}`);let l=vs.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 vs(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(wQe)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${qNt}`}return r}};LP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",MP.COMMON,MP.CONSUMERS,MP.ORGANIZATIONS]);function QZr(t){let n=new vs(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case MP.COMMON:case MP.ORGANIZATIONS:case MP.CONSUMERS:return;default:return n}}a(QZr,"getTenantFromAuthorityString");function dqe(t){return t.endsWith(Nse)?t:`${t}${Nse}`}a(dqe,"formatAuthorityUri");function s5t(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw hl(VQe)}return{canonicalAuthority:t.authority?dqe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(s5t,"buildStaticAuthorityOptions");async function a5t(t,e,r,n,o,s,c){let l=LP.transformCIAMAuthority(dqe(t)),u=new LP(l,e,r,n,o,s,c);try{return await Hs(u.resolveEndpointsAsync.bind(u),SZr,o,c,s)(),u}catch{throw Pt(BP)}}a(a5t,"createDiscoveredInstance");var i1e=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=yL(e),this.logger=new H0(this.config.loggerOptions,zU,oM),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(EOt);n&&n.cloud_instance_host_name&&await Hs(this.updateTokenEndpointAuthority.bind(this),bZr,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=Y1(),s=await Hs(this.executeTokenRequest.bind(this),vZr,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Np.X_MS_REQUEST_ID],l=new Op(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),Hs(l.handleServerTokenResponse.bind(l),sqe,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 hl(sOt);let r=this.createLogoutUrlQueryString(e);return vs.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=t1e(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=vs.appendQueryString(e.tokenEndpoint,o),c=await Hs(this.createTokenRequestBody.bind(this),CZr,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=Vse(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${Bse}${f.utid}`,type:u_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=e1e(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=Jse(this.config.authOptions.clientId,r);return Hs(r1e,gZr,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(az(r,e.embeddedClientId||e.extraParameters?.[nM]||this.config.authOptions.clientId),this.includeRedirectUri)cz(r,e.redirectUri);else if(!e.redirectUri)throw hl(tOt);if(sz(r,e.scopes,!0,this.oidcDefaultScopes),$be(r,e.resource),BOt(r,e.code),Nbe(r,this.config.libraryInfo),Mbe(r,this.config.telemetry.application),Gbe(r),this.serverTelemetryManager&&!tqe(this.config)&&Hbe(r,this.serverTelemetryManager),e.codeVerifier&&FOt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&Bbe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;Lbe(r,await d_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),Fbe(r,o.assertionType)}if(Ube(r,Sbe.AUTHORIZATION_CODE_GRANT),dz(r),e.authenticationScheme===rf.POP){let o=new KU(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Hs(o.generateCnf.bind(o),Kse,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,qbe(r,s)}else if(e.authenticationScheme===rf.SSH)if(e.sshJwk)jbe(r,e.sshJwk);else throw hl(Rbe);(!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&lz(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=Vse(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${Bse}${o.utid}`,type:u_.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 u_.HOME_ACCOUNT_ID:try{let o=sM(n.credential);pL(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case u_.UPN:WU(r,n.credential);break}return e.embeddedClientId&&mL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&hL(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[jQe])&&hL(r,{[jQe]:"1"}),oz(r,e.correlationId,this.performanceClient),iM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&kOt(r,e.postLogoutRedirectUri),e.correlationId&&uz(r,e.correlationId),e.idTokenHint&&DOt(r,e.idTokenHint),e.state&&Obe(r,e.state),e.logoutHint&&QOt(r,e.logoutHint),e.extraQueryParameters&&hL(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&Qbe(r),iM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await a5t(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var sEo=300,gz=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=yL(e),this.logger=new H0(this.config.loggerOptions,zU,oM),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=Y1(),o=await Hs(this.executeTokenRequest.bind(this),AZr,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Np.X_MS_REQUEST_ID],c=new Op(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),Hs(c.handleServerTokenResponse.bind(c),sqe,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 hl(oOt);if(!e.account)throw Pt(kbe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Hs(this.acquireTokenWithCachedRefreshToken.bind(this),oqe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof K1&&o.errorCode===aqe,c=o instanceof l_&&o.errorCode===fMt&&o.subError===pMt;if(s||c)return Hs(this.acquireTokenWithCachedRefreshToken.bind(this),oqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Hs(this.acquireTokenWithCachedRefreshToken.bind(this),oqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=DZr(this.cacheManager.getRefreshToken.bind(this.cacheManager),kZr,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw uqe(aqe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||sEo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),zse(o.expiresOn,c))throw uqe(XOt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||rf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:u_.HOME_ACCOUNT_ID}};try{return await Hs(this.acquireToken.bind(this),yZr,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof K1&&c.subError===Zbe){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=t1e(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=vs.appendQueryString(r.tokenEndpoint,n),s=await Hs(this.createTokenRequestBody.bind(this),EZr,this.logger,this.performanceClient,e.correlationId)(e),c=e1e(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=Jse(this.config.authOptions.clientId,e);return Hs(r1e,mZr,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(az(r,e.embeddedClientId||e.extraParameters?.[nM]||this.config.authOptions.clientId),e.redirectUri&&cz(r,e.redirectUri),sz(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),Ube(r,Sbe.REFRESH_TOKEN_GRANT),dz(r),Nbe(r,this.config.libraryInfo),Mbe(r,this.config.telemetry.application),Gbe(r),this.serverTelemetryManager&&!tqe(this.config)&&Hbe(r,this.serverTelemetryManager),LOt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&Bbe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;Lbe(r,await d_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),Fbe(r,n.assertionType)}if(e.authenticationScheme===rf.POP){let n=new KU(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Hs(n.generateCnf.bind(n),Kse,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,qbe(r,o)}else if(e.authenticationScheme===rf.SSH)if(e.sshJwk)jbe(r,e.sshJwk);else throw hl(Rbe);if((!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&lz(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case u_.HOME_ACCOUNT_ID:try{let n=sM(e.ccsCredential.credential);pL(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case u_.UPN:WU(r,e.ccsCredential.credential);break}return e.embeddedClientId&&mL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&hL(r,{...e.extraParameters}),oz(r,e.correlationId,this.performanceClient),iM(r)}};p();var o1e=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=yL(e),this.logger=new H0(this.config.loggerOptions,zU,oM),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=OP.NOT_APPLICABLE;if(e.forceRefresh||!nu.isEmptyObj(e.claims))throw this.setCacheOutcome(OP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Pt(Hse);if(!e.account)throw Pt(kbe);let n=e.account.tenantId||QZr(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(WOt(s.cachedAt)||zse(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(OP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Pt(Hse);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(OP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(Hse)}else s.refreshOn&&zse(s.refreshOn,0)&&(r=OP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(OP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(Hse);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 Hs(this.generateResultFromCacheRecord.bind(this),_Zr,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==OP.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=AL(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw Pt(Pbe);Vbe(o,r.maxAge)}return Op.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var s1e={};xi(s1e,{getAuthorizationCodePayload:()=>lEo,getAuthorizeUrl:()=>cEo,getStandardAuthorizeRequestParameters:()=>aEo,validateAuthorizationResponse:()=>qZr});p();function aEo(t,e,r,n){let o=e.correlationId,s=new Map;az(s,e.embeddedClientId||e.extraQueryParameters?.[nM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(sz(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),$be(s,e.resource),cz(s,e.redirectUri),uz(s,o),POt(s,e.responseMode),dz(s),UOt(s),e.prompt&&(MOt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(NOt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==bbe.SELECT_ACCOUNT)if(e.sid&&e.prompt===bbe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),JQe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=dEo(e.account),u=fEo(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),Gse(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=sM(e.account.homeAccountId);pL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===bbe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),JQe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=sM(e.account.homeAccountId);pL(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),Gse(s,e.loginHint),WU(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),Gse(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=sM(e.account.homeAccountId);pL(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),Gse(s,e.loginHint),WU(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&OOt(s,e.nonce),e.state&&Obe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&lz(s,e.claims,t.clientCapabilities),e.embeddedClientId&&mL(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(Use))&&Qbe(s),s}a(aEo,"getStandardAuthorizeRequestParameters");function cEo(t,e){let r=iM(e);return vs.appendQueryString(t.authorizationEndpoint,r)}a(cEo,"getAuthorizeUrl");function lEo(t,e){if(qZr(t,e),!t.code)throw Pt(TOt);return t}a(lEo,"getAuthorizationCodePayload");function qZr(t,e){if(!t.state||!e)throw t.state?Pt(YQe,"Cached State"):Pt(YQe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw Pt(iz,t.state)}try{n=decodeURIComponent(e)}catch{throw Pt(iz,t.state)}if(r!==n)throw Pt(mOt);if(t.error||t.error_description||t.suberror){let o=uEo(t);throw lqe(t.error,t.error_description,t.suberror)?new K1(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new l_(t.error||"",t.error_description,t.suberror,o)}}a(qZr,"validateAuthorizationResponse");function uEo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(uEo,"parseServerErrorNo");function dEo(t){return t.idTokenClaims?.sid||null}a(dEo,"extractAccountSid");function fEo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(fEo,"extractLoginHint");p();function Az(t,e){if(t){if(e.resource&&(jZr(e.extraParameters)||jZr(e.extraQueryParameters)))throw Pt(ROt);if(!e.resource)throw Pt(wOt)}}a(Az,"enforceResourceParameter");function jZr(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(jZr,"containsResourceParam");var Xse={};xi(Xse,{postRequestFailed:()=>hEo,unexpectedError:()=>pEo});p();var pEo="unexpected_error",hEo="post_request_failed";p();var HZr=",",GZr="|";function mEo(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(HZr),l.length<4)return e}else l=Array.from({length:4},()=>GZr);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&gEo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(HZr)}a(mEo,"makeExtraSkuString");function gEo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(GZr))}a(gEo,"setSku");var yz=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=OP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=Tbe+ez+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${GU}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(GU),s=this.getRegionDiscoveryFields(),c=[e,s].join(GU);return[BQe,c,o].join(LQe)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(GU),o=e.errors.slice(0,r).join(GU),s=e.errors.length,c=r=oMt&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Mo?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(cMt),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={};YU.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 $Zr="system_assigned_managed_identity",AEo="managed_identity",l5t=`https://login.microsoftonline.com/${AEo}/`,sC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},Ph={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},Vi={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"},of={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"},jf={GET:"GET",POST:"POST"},VZr="REGION_NAME",WZr="MSAL_FORCE_REGION",zZr=32,YZr={SHA256:"sha256"},pqe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},u5t={KEY_SEPARATOR:"-"},XI={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},sf={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},ex={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"},hqe={INTERVAL_MS:100,TIMEOUT_MS:5e3},KZr=4096;p();p();p();var eae=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,jf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,jf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:EEo(n),signal:s.signal};r===jf.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 nz(Mp.networkError,"Request timeout");let f=nz(Mp.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw o5t(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:yEo(u.headers),body:await u.json(),status:u.status}}catch(d){throw nz(Mp.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function yEo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(yEo,"getHeaderDict");function EEo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(EEo,"getFetchHeaders");p();p();p();var mqe="invalid_file_extension",gqe="invalid_file_path",JU="invalid_managed_identity_id_type",Aqe="invalid_secret",JZr="missing_client_id",ZZr="network_unavailable",yqe="platform_not_supported",Eqe="unable_to_create_azure_arc",_qe="unable_to_create_cloud_shell",vqe="unable_to_create_source",a1e="unable_to_read_secret_file",XZr="user_assigned_not_available_at_runtime",Cqe="www_authenticate_header_missing",bqe="www_authenticate_header_unsupported_format",Ez={[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[Vi.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[Vi.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[Vi.MSI_ENDPOINT]:"msi_endpoint_url_malformed"};var _Eo={[mqe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[gqe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[JU]:"More than one ManagedIdentityIdType was provided.",[Aqe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[yqe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[JZr]:"A ManagedIdentityId id was not provided.",[Ez.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[Ez.IDENTITY_ENDPOINT]:`The Managed Identity's '${Vi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[Ez.IMDS_ENDPOINT]:`The Managed Identity's '${Vi.IMDS_ENDPOINT}' environment variable is malformed.`,[Ez.MSI_ENDPOINT]:`The Managed Identity's '${Vi.MSI_ENDPOINT}' environment variable is malformed.`,[ZZr]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[Eqe]:"Azure Arc Managed Identities can only be system assigned.",[_qe]:"Cloud Shell Managed Identities can only be system assigned.",[vqe]:"Unable to create a Managed Identity source based on environment variables.",[a1e]:"Unable to read the secret file.",[XZr]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[Cqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[bqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},d5t=class t extends Mo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,_Eo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Bp(t){return new d5t(t)}a(Bp,"createManagedIdentityError");var Sqe=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 Bp(JU);this.id=r,this.idType=of.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Bp(JU);this.id=n,this.idType=of.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Bp(JU);this.id=o,this.idType=of.USER_ASSIGNED_OBJECT_ID}else this.id=$Zr,this.idType=of.SYSTEM_ASSIGNED}};p();var kh={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."}},Ly=class t extends Mo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(kh.invalidLoopbackAddressType.code,`${kh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(kh.unableToLoadRedirectUri.code,`${kh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(kh.noAuthCodeInResponse.code,`${kh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(kh.noLoopbackServerExists.code,`${kh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(kh.loopbackServerAlreadyExists.code,`${kh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(kh.loopbackServerTimeout.code,`${kh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(kh.stateNotFoundError.code,kh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(kh.thumbprintMissing.code,kh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(kh.redirectUriNotSupported.code,kh.redirectUriNotSupported.desc)}};var vEo={clientId:"",authority:Xt.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:gL.None,tenant:""},isMcp:!1},f5t={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:nf.Info},CEo={loggerOptions:f5t,networkClient:new eae,disableInternalRetries:!1,protocolMode:By.AAD},bEo={application:{appName:"",appVersion:""}};function eXr({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...CEo,networkClient:new eae,loggerOptions:n?.loggerOptions||f5t,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw Ly.createStateNotFoundError();return{auth:{...vEo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...bEo,...o}}}a(eXr,"buildAppConfiguration");function tXr({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new Sqe(e),o=r?.loggerOptions||f5t,s;return r?.networkClient?s=r.networkClient:s=new eae,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(tXr,"buildManagedIdentityConfiguration");p();p();As();var tae=class{static{a(this,"GuidGenerator")}generateGuid(){return ir()}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 J1=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(Xt.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,Xt.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 rXr=he(require("crypto"),1);var ZU=class{static{a(this,"HashUtils")}sha256(e){return rXr.default.createHash(YZr.SHA256).update(e).digest()}};var nXr=he(require("crypto"),1);var Tqe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new ZU}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%pqe.CV_CHARSET.length;for(;e.length<=zZr;){let o=nXr.default.randomBytes(1)[0];if(o>=r)continue;let s=o%pqe.CV_CHARSET.length;e.push(pqe.CV_CHARSET[s])}let n=e.join("");return J1.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return J1.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};var aM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new Tqe,this.guidGenerator=new tae,this.hashUtils=new ZU}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return J1.base64Encode(e)}base64Decode(e){return J1.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 J1.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};p();p();function iXr(t){let e=t.credentialType===Xt.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(u5t.KEY_SEPARATOR).toLowerCase()}a(iXr,"generateCredentialKey");function oXr(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(u5t.KEY_SEPARATOR).toLowerCase()}a(oXr,"generateAccountKey");var XU=class extends YU{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Rh,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(hz.isAccountEntity(o))r.accounts[n]=o;else if(c_.isIdTokenEntity(o))r.idTokens[n]=o;else if(c_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(c_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(c_.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 iXr(e)}generateAccountKey(e){return oXr(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(hz.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return c_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return c_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return c_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return c_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=c_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&c_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&c_.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&&c_.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 EL.deserializeAllCache(EL.deserializeJSONBlob(e))}static generateJsonCache(e){return HU.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 c1e={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},rae=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=HU.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=EL.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=XU.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new aM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new z1(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 z1(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new tae().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 z1(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:{...c1e.Account,...e.Account},IdToken:{...c1e.IdToken,...e.IdToken},AccessToken:{...c1e.AccessToken,...e.AccessToken},RefreshToken:{...c1e.RefreshToken,...e.RefreshToken},AppMetadata:{...c1e.AppMetadata,...e.AppMetadata}}}};p();var Hrn=he(Brn(),1);p();var Lrn="missing_tenant_id_error",Frn="user_timeout_reached",Urn="invalid_assertion",n4t="invalid_client_credential",Qrn="device_code_polling_cancelled",qrn="device_code_expired",jrn="device_code_unknown_error";var vL=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(Urn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=ju.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?ex.PSS_256:ex.RSA_256},l=this.useSha256?ex.X5T_256:ex.X5T;Object.assign(c,{[l]:J1.base64EncodeUrl(this.thumbprint,Xt.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[ex.X5C]:this.publicCertificate});let u={[ex.AUDIENCE]:this.jwtAudience,[ex.EXPIRATION_TIME]:this.expirationTime,[ex.ISSUER]:this.issuer,[ex.SUBJECT]:this.issuer,[ex.NOT_BEFORE]:o,[ex.JWT_ID]:e.createNewGuid()};return this.jwt=Hrn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&on.addCcsUpn(r,e.username),oA.mapToQueryString(r)}};p();function Grn(t,e,r,n){let o=s1e.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return on.addLibraryInfo(o,{sku:XI.MSAL_SKU,version:Z1,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==By.OIDC&&on.addApplicationTelemetry(o,t.telemetry.application),on.addResponseType(o,Xt.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&on.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),on.addExtraParameters(o,r.extraQueryParameters||{}),s1e.getAuthorizeUrl(e,o)}a(Grn,"getAuthCodeRequestUrl");var pae=class{static{a(this,"ClientApplication")}constructor(e){this.config=eXr(e),this.cryptoProvider=new aM,this.logger=new H0(this.config.system.loggerOptions,fae,Z1),this.storage=new XU(this.logger,this.config.auth.clientId,this.cryptoProvider,s5t(this.config.auth)),this.tokenCache=new rae(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||Xt.ResponseMode.QUERY,authenticationScheme:Xt.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return Grn(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:Xt.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(sf.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 i1e(c,new Rh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,sf.acquireTokenByCode,r)}catch(s){throw s instanceof Mo&&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:Xt.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(sf.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 gz(s,new Rh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,sf.acquireTokenByRefreshToken)}catch(o){throw o instanceof Mo&&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(sf.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 o1e(s,new Rh);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 VU&&l.errorCode===Mp.tokenRefreshRequired)return new gz(s,new Rh).acquireTokenByRefreshToken(r,sf.acquireTokenSilent);throw l}}catch(o){throw o instanceof Mo&&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:[...Xt.OIDC_DEFAULT_SCOPES]});if(s===Xt.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 gz(n,new Rh);try{await c.acquireTokenByRefreshToken(e,sf.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(sf.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 tje(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Mo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw Ly.createStateNotFoundError();if(e!==r)throw Pt(Mp.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:XI.MSAL_SKU,version:Z1,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=vL.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:XI.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===Xt.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=Xt.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...Xt.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 yz(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=LP.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 fqe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Rh)}clearCache(){this.storage.clear()}};p();var $rn=he(require("http"),1);var rje=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw Ly.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=$rn.default.createServer((s,c)=>{let l=s.url;if(l){if(l===Xt.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(Ly.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=oA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(Xt.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 Ly.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),Ly.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${XI.HTTP_PROTOCOL}${XI.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 nje=class extends uM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=ju.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Op(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,sf.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=vs.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&&on.addExtraParameters(r,e.extraQueryParameters),oA.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 on.addScopes(r,e.scopes),on.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&on.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),oA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),Pt(Qrn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),Pt(Frn);if(ju.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(qrn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=vs.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?ju.nowSeconds()+e.timeout:void 0,u=ju.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===Xt.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await ju.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),nz(Xse.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(jrn)}createTokenRequestBody(e,r){let n=new Map;on.addScopes(n,e.scopes),on.addClientId(n,this.config.authOptions.clientId),on.addGrantType(n,Xt.GrantType.DEVICE_CODE_GRANT),on.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return on.addCorrelationId(n,o),on.addClientInfo(n),on.addLibraryInfo(n,this.config.libraryInfo),on.addApplicationTelemetry(n,this.config.telemetry.application),on.addThrottling(n),this.serverTelemetryManager&&on.addServerTelemetry(n,this.serverTelemetryManager),(!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),oA.mapToQueryString(n)}};var hae=class extends pae{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=yz.makeExtraSkuString({libraryName:XI.MSAL_SKU,libraryVersion:Z1})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),Az(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(sf.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 nje(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Mo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),Az(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||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[rz.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 Ly.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new rje,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||Xt.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:Xt.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:Xt.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new l_(m.error,m.error_description,m.suberror);if(!m.code)throw Ly.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),Az(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[rz.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 Ly.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return Az(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return Az(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(hqe.TIMEOUT_MS/hqe.INTERVAL_MS1)throw Pt(Mp.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=ju.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:Xt.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=vs.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=ju.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Op(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,sf.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;on.addClientId(r,this.config.authOptions.clientId),on.addScopes(r,e.scopes,!1),on.addGrantType(r,Xt.GrantType.CLIENT_CREDENTIALS_GRANT),on.addLibraryInfo(r,this.config.libraryInfo),on.addApplicationTelemetry(r,this.config.telemetry.application),on.addThrottling(r),this.serverTelemetryManager&&on.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();on.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&on.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(on.addClientAssertion(r,await d_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),on.addClientAssertionType(r,o.assertionType)),(!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),oA.mapToQueryString(r)}};p();var ije=class extends uM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new wh(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(ju.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(Xt.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(Mp.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(Xt.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),Pt(Mp.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=XQe.extractTokenClaims(n.secret,J1.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(),Op.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:Xt.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||Xt.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?Xt.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:Xt.CredentialType.ACCESS_TOKEN,clientId:e,target:wh.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(Mp.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=vs.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=ju.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Op(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,sf.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;on.addClientId(r,this.config.authOptions.clientId),on.addScopes(r,e.scopes),on.addGrantType(r,Xt.GrantType.JWT_BEARER),on.addClientInfo(r),on.addLibraryInfo(r,this.config.libraryInfo),on.addApplicationTelemetry(r,this.config.telemetry.application),on.addThrottling(r),this.serverTelemetryManager&&on.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();on.addCorrelationId(r,n),on.addRequestTokenUse(r,rz.ON_BEHALF_OF),on.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&on.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(on.addClientAssertion(r,await d_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),on.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),oA.mapToQueryString(r)}};var gae=class extends pae{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(n4t);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?vL.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):vL.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw Pt(n4t);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:XI.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!Xt.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new vs(s.authority).getUrlComponents().PathSegments[0];if(Object.values(Xt.AADAuthority).includes(l))throw Pt(Lrn);let u=process.env[WZr],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[VZr]},h=this.initializeServerTelemetryManager(sf.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 mae(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Mo&&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 ije(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Mo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function Vrn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(Vrn,"isIso8601");p();var oje=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===jf.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[Xt.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(jf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(jf.POST,e,r)}};var Cz={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"},h_=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&&(Vrn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-ju.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[Ph.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[Ph.XMS_CC]=g}let c=s.headers;c[Xt.HeaderNames.CONTENT_TYPE]=Xt.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new oje(this.networkClient,s.retryPolicy,this.logger),d=ju.nowSeconds(),f;try{s.httpMethod===jf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Mo?g:Pt(Mp.networkError)}let h=new Op(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Rh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,sf.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case of.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?Cz.MANAGED_IDENTITY_CLIENT_ID_2017:Cz.MANAGED_IDENTITY_CLIENT_ID;case of.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?Cz.MANAGED_IDENTITY_RESOURCE_ID_IMDS:Cz.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case of.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),Cz.MANAGED_IDENTITY_OBJECT_ID;default:throw Bp(JU)}}};h_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new vs(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Bp(Ez[t])}};p();p();p();var sje=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 FSo=3,USo=1e3,QSo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_TOO_MANY_REQUESTS,Xt.HTTP_SERVER_ERROR,Xt.HTTP_SERVICE_UNAVAILABLE,Xt.HTTP_GATEWAY_TIMEOUT],aje=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new sje}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return USo}async pauseForRetry(e,r,n,o){if(QSo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var aC=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 aje}computeUri(){let e=new Map;this.queryParameters&&on.addExtraParameters(e,this.queryParameters);let r=oA.mapToQueryString(e);return vs.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&on.addExtraParameters(e,this.bodyParameters),oA.mapToQueryString(e)}};var qSo="2019-08-01",y1e=class t extends h_{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[Vi.IDENTITY_ENDPOINT],r=process.env[Vi.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 '${Vi.IDENTITY_HEADER}' and '${Vi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Vi.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 aC(jf.GET,this.identityEndpoint);return n.headers[sC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Ph.API_VERSION]=qSo,n.queryParameters[Ph.RESOURCE]=e,r.idType!==of.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var CL=require("fs"),Krn=he(require("path"),1);var jSo="2019-11-01",Wrn="http://127.0.0.1:40342/metadata/identity/oauth2/token",zrn="N/A: himds executable exists",Yrn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},HSo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},E1e=class t extends h_{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[Vi.IDENTITY_ENDPOINT],r=process.env[Vi.IMDS_ENDPOINT];if(!e||!r){let n=HSo[process.platform];try{(0,CL.accessSync)(n,CL.constants.F_OK|CL.constants.R_OK),e=Wrn,r=zrn}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 '${Vi.IDENTITY_ENDPOINT}' and '${Vi.IMDS_ENDPOINT}' are not defined. ${no.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===zrn)e.info(`[Managed Identity] ${no.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${no.AZURE_ARC} endpoint: ${Wrn}. Creating ${no.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(Vi.IDENTITY_ENDPOINT,l,no.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(Vi.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!==of.SYSTEM_ASSIGNED)throw Bp(Eqe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new aC(jf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[sC.METADATA_HEADER_NAME]="true",r.queryParameters[Ph.API_VERSION]=jSo,r.queryParameters[Ph.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===Xt.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Bp(Cqe);if(!c.includes("Basic realm="))throw Bp(bqe);let l=c.split("Basic realm=")[1];if(!Yrn.hasOwnProperty(process.platform))throw Bp(yqe);let u=Yrn[process.platform],d=Krn.default.basename(l);if(!d.endsWith(".key"))throw Bp(mqe);if(u+d!==l)throw Bp(gqe);let f;try{f=await(0,CL.statSync)(l).size}catch{throw Bp(a1e)}if(f>KZr)throw Bp(Aqe);let h;try{h=(0,CL.readFileSync)(l,Xt.EncodingTypes.UTF8)}catch{throw Bp(a1e)}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 Mo?g:Pt(Mp.networkError)}}return this.getServerTokenResponse(s||e)}};p();var _1e=class t extends h_{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[Vi.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 '${Vi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Vi.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!==of.SYSTEM_ASSIGNED)throw Bp(_qe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new aC(jf.POST,this.msiEndpoint);return r.headers[sC.METADATA_HEADER_NAME]="true",r.bodyParameters[Ph.RESOURCE]=e,r}};p();p();p();var cje=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 GSo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_GONE,Xt.HTTP_TOO_MANY_REQUESTS],$So=3,VSo=7,WSo=1e3,zSo=4e3,YSo=2e3,KSo=10*1e3,lje=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new cje(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return WSo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return zSo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return YSo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return KSo}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===Xt.HTTP_GONE?VSo:$So),(GSo.includes(e)||e>=Xt.HTTP_SERVER_ERROR_RANGE_START&&e<=Xt.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var Jrn="/metadata/identity/oauth2/token",JSo=`http://169.254.169.254${Jrn}`,ZSo="2018-02-01",uje=class t extends h_{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[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${no.IMDS} returned endpoint: ${process.env[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${Jrn}`,no.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${no.IMDS}, using the default endpoint.`,""),c=JSo),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new aC(jf.GET,this.identityEndpoint);return n.headers[sC.METADATA_HEADER_NAME]="true",n.queryParameters[Ph.API_VERSION]=ZSo,n.queryParameters[Ph.RESOURCE]=e,r.idType!==of.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new lje,n}};p();var XSo="2019-07-01-preview",v1e=class t extends h_{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[Vi.IDENTITY_ENDPOINT],r=process.env[Vi.IDENTITY_HEADER],n=process.env[Vi.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 '${Vi.IDENTITY_HEADER}', '${Vi.IDENTITY_ENDPOINT}' or '${Vi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(Vi.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!==of.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 aC(jf.GET,this.identityEndpoint);return n.headers[sC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Ph.API_VERSION]=XSo,n.queryParameters[Ph.RESOURCE]=e,r.idType!==of.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var eTo="2017-09-01",tTo=`Only client id is supported for user-assigned managed identity in ${no.MACHINE_LEARNING}.`,C1e=class t extends h_{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[Vi.MSI_ENDPOINT],r=process.env[Vi.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 '${Vi.MSI_ENDPOINT}' and '${Vi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Vi.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 aC(jf.GET,this.msiEndpoint);if(n.headers[sC.METADATA_HEADER_NAME]="true",n.headers[sC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[Ph.API_VERSION]=eTo,n.queryParameters[Ph.RESOURCE]=e,r.idType===of.SYSTEM_ASSIGNED)n.queryParameters[Cz.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[Vi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===of.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(tTo);return n}};var b1e=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(v1e.getEnvironmentVariables())?no.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(y1e.getEnvironmentVariables())?no.APP_SERVICE:this.allEnvironmentVariablesAreDefined(C1e.getEnvironmentVariables())?no.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(_1e.getEnvironmentVariables())?no.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(E1e.getEnvironmentVariables())?no.AZURE_ARC:no.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=v1e.tryCreate(e,r,n,o,s,c)||y1e.tryCreate(e,r,n,o,s)||C1e.tryCreate(e,r,n,o,s)||_1e.tryCreate(e,r,n,o,s,c)||E1e.tryCreate(e,r,n,o,s,c)||uje.tryCreate(e,r,n,o,s);if(!l)throw Bp(vqe);return l}};var rTo=[no.SERVICE_FABRIC],Aae=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=tXr(e||{}),this.logger=new H0(this.config.system.loggerOptions,fae,Z1);let r={canonicalAuthority:Xt.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new XU(this.logger,this.config.managedIdentityId.id,$se,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new aM;let n={protocolMode:By.AAD,knownAuthorities:[l5t],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new LP(l5t,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Rh,!0),this.fakeClientCredentialClient=new mae({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new b1e(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new ZU}async acquireToken(e){if(!e.resource)throw hl(jse.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&&rTo.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(Xt.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===Xt.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 b1e.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var dje=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=>hz.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 nTo=Xt.PromptValue,iTo=Xt.ResponseMode;p();p();p();p();p();function S1e(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(S1e,"getRandomIntegerInclusive");function T1e(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+S1e(0,n/2)}}a(T1e,"calculateRetryDelay");p();function yae(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(yae,"isObject");p();function bz(t){if(yae(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(bz,"isError");p();p();var Zrn=require("node:crypto");var i4t,oTo=typeof((i4t=globalThis?.crypto)===null||i4t===void 0?void 0:i4t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):Zrn.randomUUID;function Eae(){return oTo()}a(Eae,"randomUUID");p();var o4t,s4t,a4t,c4t,Xrn=typeof window<"u"&&typeof window.document<"u",enn=typeof self=="object"&&typeof self?.importScripts=="function"&&(((o4t=self.constructor)===null||o4t===void 0?void 0:o4t.name)==="DedicatedWorkerGlobalScope"||((s4t=self.constructor)===null||s4t===void 0?void 0:s4t.name)==="ServiceWorkerGlobalScope"||((a4t=self.constructor)===null||a4t===void 0?void 0:a4t.name)==="SharedWorkerGlobalScope"),tnn=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",rnn=typeof Bun<"u"&&typeof Bun.version<"u",n7=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((c4t=globalThis.process.versions)===null||c4t===void 0)&&c4t.node);var nnn=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function cC(t,e){return Buffer.from(t,e)}a(cC,"stringToUint8Array");p();var l4t="REDACTED",sTo=["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"],aTo=["api-version"],UP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=sTo.concat(e),r=aTo.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)||yae(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,l4t);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]=l4t;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]=l4t;return r}};p();p();p();p();var Sz=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function d4t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new Sz(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(d4t,"createAbortablePromise");p();var fTo="The delay was aborted.";function f4t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return d4t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??fTo})}a(f4t,"delay");p();function _ae(t){if(bz(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(_ae,"getErrorMessage");p();function inn(t,e){return T1e(t,e)}a(inn,"calculateRetryDelay");function fje(t){return bz(t)}a(fje,"isError");var pje=n7,vae=n7;p();var I1e=co("IdentityUtils"),onn="1.0";function Tz(t,e,r){let n=a(o=>(I1e.getToken.info(o),new JI({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(Tz,"ensureValidMsalToken");function p4t(t){let e=t?.authorityHost;return!e&&vae&&(e=process.env.AZURE_AUTHORITY_HOST),e??gbe}a(p4t,"getAuthorityHost");function h4t(t,e){return e||(e=gbe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(h4t,"getAuthority");function snn(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(snn,"getKnownAuthorities");var hje=a((t,e=pje?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case X1.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case X1.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case X1.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case X1.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function mje(t){switch(t){case"error":return X1.LogLevel.Error;case"info":return X1.LogLevel.Info;case"verbose":return X1.LogLevel.Verbose;case"warning":return X1.LogLevel.Warning;default:return X1.LogLevel.Info}}a(mje,"getMSALLogLevel");function Iz(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return I1e.info(ks(t,e.message)),new Dn(e.message);case"device_code_polling_cancelled":return new Sz("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":I1e.info(ks(t,`Authentication returned errorCode ${n.errorCode}`));break;default:I1e.info(ks(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"?(I1e.info(ks(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new JI({scopes:t,getTokenOptions:r,message:e.message})}a(Iz,"handleMsalError");function ann(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(ann,"publicToMsal");function cnn(t,e){return{authority:e.environment??CJr,homeAccountId:e.homeAccountId,tenantId:e.tenantId||vJr,username:e.username,clientId:t,version:onn}}a(cnn,"msalToPublic");function m4t(t){let e=JSON.parse(t);if(e.version&&e.version!==onn)throw Error("Unsupported AuthenticationRecord version");return e}a(m4t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function hTo(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(hTo,"isPrimitiveBody");function mTo(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(mTo,"handleNullableResponseAndWrappableBody");function g4t(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 mTo({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:hTo(t.parsedBody,l)})}a(g4t,"flattenResponse");var dM={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 fM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var lnn=require("node:os"),unn=he(require("node:util"),1),dnn=he(require("node:process"),1);function fnn(t,...e){dnn.stderr.write(`${unn.default.format(t,...e)}${lnn.EOL}`)}a(fnn,"log");var pnn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,hnn,A4t=[],y4t=[],Aje=[];pnn&&E4t(pnn);var mnn=Object.assign(t=>gnn(t),{enable:E4t,enabled:_4t,disable:gTo,log:fnn});function E4t(t){hnn=t,A4t=[],y4t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?y4t.push(new RegExp(`^${n.substr(1)}$`)):A4t.push(new RegExp(`^${n}$`));for(let n of Aje)n.enabled=_4t(n.namespace)}a(E4t,"enable");function _4t(t){if(t.endsWith("*"))return!0;for(let e of y4t)if(e.test(t))return!1;for(let e of A4t)if(e.test(t))return!0;return!1}a(_4t,"enabled");function gTo(){let t=hnn||"";return E4t(""),t}a(gTo,"disable");function gnn(t){let e=Object.assign(r,{enabled:_4t(t),destroy:ATo,log:mnn.log,namespace:t,extend:yTo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Aje.push(e),e}a(gnn,"createDebugger");function ATo(){let t=Aje.indexOf(this);return t>=0?(Aje.splice(t,1),!0):!1}a(ATo,"destroy");function yTo(t){let e=gnn(`${this.namespace}:${t}`);return e.log=this.log,e}a(yTo,"extend");var Cae=mnn;var v4t=["verbose","info","warning","error"],Ann={verbose:400,info:300,warning:200,error:100};function ynn(t,e){e.log=(...r)=>{t.log(...r)}}a(ynn,"patchLogMethod");function Enn(t){return v4t.includes(t)}a(Enn,"isTypeSpecRuntimeLogLevel");function ETo(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Cae(t.namespace);o.log=(...f)=>{Cae.log(...f)};function s(f){if(f&&!Enn(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${v4t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Cae.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Enn(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${v4t.join(", ")}.`));function c(f){return!!(n&&Ann[f.level]<=Ann[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(ynn(f,m),c(m)){let g=Cae.disable();Cae.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 ynn(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(ETo,"createLoggerContext");var _nn=ETo({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),_To=_nn.logger;function w1e(t){return _nn.createClientLogger(t)}a(w1e,"createClientLogger");p();function yje(t){return t.toLowerCase()}a(yje,"normalizeName");function*vTo(t){for(let e of t.values())yield[e.name,e.value]}a(vTo,"headerIterator");var C4t=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(yje(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(yje(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(yje(e))}delete(e){this._headersMap.delete(yje(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 vTo(this._headersMap)}};function eS(t){return new C4t(t)}a(eS,"createHttpHeaders");p();p();p();var b4t=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:eS(),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||Eae(),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 Eje(t){return new b4t(t)}a(Eje,"createPipelineRequest");p();var vnn=new Set(["Deserialize","Serialize","Retry","Sign"]),S4t=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&&!vnn.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!vnn.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 _je(){return S4t.create()}a(_je,"createEmptyPipeline");p();p();var Cnn=require("node:util"),bnn=Cnn.inspect.custom;var CTo=new UP,cA=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,bnn,{value:a(()=>`RestError: ${this.message} + ${CTo.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};cA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";cA.PARSE_ERROR="PARSE_ERROR";function vje(t){return t instanceof cA?!0:bz(t)&&t.name==="RestError"}a(vje,"isRestError");p();p();var bae=he(require("node:http"),1),Sae=he(require("node:https"),1),bje=he(require("node:zlib"),1),Tnn=require("node:stream");p();var ix=w1e("ts-http-runtime");var bTo={};function R1e(t){return t&&typeof t.pipe=="function"}a(R1e,"isReadableStream");function Snn(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(Snn,"isStreamComplete");function Inn(t){return t&&typeof t.byteLength=="number"}a(Inn,"isArrayBuffer");var Cje=class extends Tnn.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}},T4t=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 fM("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 UP;ix.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=xTo(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new Cje(_);v.on("error",b=>{ix.error("Error in upload progress",b)}),R1e(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=STo(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?TTo(m,g):m;let E=e.onDownloadProgress;if(E){let _=new Cje(E);_.on("error",v=>{ix.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 ITo(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();R1e(f)&&(m=Snn(f));let g=Promise.resolve();R1e(h)&&(g=Snn(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{ix.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?bae.request(u,d):Sae.request(u,d);h.once("error",m=>{var g;f(new cA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:cA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new fM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&R1e(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Inn(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(ix.error("Unrecognized body type",n),f(new cA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?bae.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new bae.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Sae.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:bTo,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(ix.info("No cached TLS Agent exist, creating a new Agent"),c=new Sae.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function STo(t){let e=eS();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(STo,"getResponseHeaders");function TTo(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=bje.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=bje.createInflate();return t.pipe(n),n}return t}a(TTo,"getDecodedResponseStream");function ITo(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 cA(`Error reading response as text: ${o.message}`,{code:cA.PARSE_ERROR}))})})}a(ITo,"streamToText");function xTo(t){return t?Buffer.isBuffer(t)?t.length:R1e(t)?null:Inn(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(xTo,"getBodyLength");function xnn(){return new T4t}a(xnn,"createNodeHttpClient");function Sje(){return xnn()}a(Sje,"createDefaultHttpClient");p();p();p();p();var I4t="logPolicy";function Tje(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:ix.info,n=new UP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:I4t,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(Tje,"logPolicy");p();var x4t="redirectPolicy",wnn=["GET","HEAD"];function Ije(t={}){let{maxRetries:e=20}=t;return{name:x4t,async sendRequest(r,n){let o=await n(r);return Rnn(n,o,e)}}}a(Ije,"redirectPolicy");async function Rnn(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&wnn.includes(o.method)||s===302&&wnn.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new fM(r?.abortErrorMsg?r?.abortErrorMsg:wTo)),"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(Dnn,"delay");function Nnn(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Nnn,"parseHeaderValueAsNumber");var R4t="Retry-After",RTo=["retry-after-ms","x-ms-retry-after-ms",R4t];function Mnn(t){if(t&&[429,503].includes(t.status))try{for(let o of RTo){let s=Nnn(t,o);if(s===0||s)return s*(o===R4t?1e3:1)}let e=t.headers.get(R4t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Mnn,"getRetryAfterInMs");function Onn(t){return Number.isFinite(Mnn(t))}a(Onn,"isThrottlingRetryResponse");function P4t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Mnn(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(P4t,"throttlingRetryStrategy");var PTo=1e3,kTo=1e3*64;function wje(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:PTo,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:kTo;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=NTo(l),d=u&&t.ignoreSystemErrors,f=DTo(c),h=f&&t.ignoreHttpStatusCodes;return c&&(Onn(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:T1e(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(wje,"exponentialRetryStrategy");function DTo(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(DTo,"isExponentialRetryResponse");function NTo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(NTo,"isSystemError");p();var MTo=w1e("ts-http-runtime retryPolicy"),OTo="retryPolicy";function i7(t,e={maxRetries:3}){let r=e.logger||MTo;return{name:OTo,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 fM;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 Dnn(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(i7,"retryPolicy");var k4t="defaultRetryPolicy";function Rje(t={}){var e;return{name:k4t,sendRequest:i7([P4t(),wje(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(Rje,"defaultRetryPolicy");p();var D4t="formDataPolicy";function BTo(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(BTo,"formDataToFormDataMap");function Pje(){return{name:D4t,async sendRequest(t,e){if(n7&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=BTo(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=LTo(t.formData):await FTo(t.formData,t),t.formData=void 0}return e(t)}}}a(Pje,"formDataPolicy");function LTo(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(LTo,"wwwFormUrlEncode");async function FTo(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:eS({"Content-Disposition":`form-data; name="${o}"`}),body:cC(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=eS();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(FTo,"prepareFormData");p();var sin=he(Q4t(),1),ain=he(q4t(),1);var DIo="HTTPS_PROXY",NIo="HTTP_PROXY",MIo="ALL_PROXY",OIo="NO_PROXY",j4t="proxyPolicy",nin=[],cin=!1,BIo=new Map;function Fje(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(Fje,"getEnvironmentValue");function LIo(){if(!process)return;let t=Fje(DIo),e=Fje(MIo),r=Fje(NIo);return t||e||r}a(LIo,"loadEnvironmentProxyValue");function FIo(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(FIo,"isBypassed");function UIo(){let t=Fje(OIo);return cin=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(UIo,"loadNoProxy");function QIo(){let t=LIo();return t?new URL(t):void 0}a(QIo,"getDefaultProxySettingsInternal");function iin(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(iin,"getUrlFromProxySettings");function oin(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&ix.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 ain.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new sin.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(oin,"setProxyAgentOnRequest");function Uje(t,e){cin||nin.push(...UIo());let r=t?iin(t):QIo(),n={};return{name:j4t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!FIo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:nin,e?.customNoProxyList?void 0:BIo)?oin(o,n,r):o.proxySettings&&oin(o,n,iin(o.proxySettings)),s(o)}}}a(Uje,"proxyPolicy");p();var H4t="agentPolicy";function Qje(t){return{name:H4t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(Qje,"agentPolicy");p();var G4t="tlsPolicy";function qje(t){return{name:G4t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(qje,"tlsPolicy");p();p();function jje(t){return typeof t.stream=="function"}a(jje,"isBlob");p();bL();var Wje=require("stream");function Min(){return k1e(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield nS(e.read());if(r)return yield nS(void 0);yield yield nS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Min,"streamAsyncIterator");function GIo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Min.bind(t)),t.values||(t.values=Min.bind(t))}a(GIo,"makeAsyncIterable");function Oin(t){return t instanceof ReadableStream?(GIo(t),Wje.Readable.fromWeb(t)):t}a(Oin,"ensureNodeStream");function $Io(t){return t instanceof Uint8Array?Wje.Readable.from(Buffer.from(t)):jje(t)?Oin(t.stream()):Oin(t)}a($Io,"toStream");async function Bin(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map($Io);return Wje.Readable.from((function(){return k1e(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,Vje(d)),u;u=yield nS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield nS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield nS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Bin,"concat");function VIo(){return`----AzSDKFormBoundary${Eae()}`}a(VIo,"generateBoundary");function WIo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(WIo,"encodeHeaders");function zIo(t){return t instanceof Uint8Array?t.byteLength:jje(t)?t.size===-1?void 0:t.size:void 0}a(zIo,"getLength");function YIo(t){let e=0;for(let r of t){let n=zIo(r);if(n===void 0)return;e+=n}return e}a(YIo,"getTotalLength");async function KIo(t,e,r){let n=[cC(`--${r}`,"utf-8"),...e.flatMap(s=>[cC(`\r +`,"utf-8"),cC(WIo(s.headers),"utf-8"),cC(`\r +`,"utf-8"),s.body,cC(`\r +--${r}`,"utf-8")]),cC(`--\r \r -`,"utf-8")],o=ywo(n);o&&t.headers.set("Content-Length",o),t.body=await Qon(n)}a(Ewo,"buildRequestBody");var tSe="multipartPolicy",_wo=70,Cwo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function vwo(t){if(t.length>_wo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!Cwo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(vwo,"assertValidBoundary");function vHe(){return{name:tSe,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?vwo(n):n=mwo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await Ewo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(vHe,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function bHe(){return zje()}a(bHe,"createEmptyPipeline");p();p();p();var bM=t7("core-rest-pipeline");p();p();p();p();function PBt(t={}){return Xje(Object.assign({logger:bM.info},t))}a(PBt,"logPolicy");p();function DBt(t={}){return eHe(t)}a(DBt,"redirectPolicy");p();p();p();var $ae=ce(require("node:os"),1),SHe=ce(require("node:process"),1);function qon(){return"User-Agent"}a(qon,"getHeaderName");async function jon(t){if(SHe&&SHe.versions){let e=SHe.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",`(${$ae.arch()}-${$ae.type()}-${$ae.release()})`)}a(jon,"setPlatformSpecificData");p();var THe="1.22.0";function Pwo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(Pwo,"getUserAgentString");function Hon(){return qon()}a(Hon,"getUserAgentHeaderName");async function IHe(t){let e=new Map;e.set("core-rest-pipeline",THe),await jon(e);let r=Pwo(e);return t?`${t} ${r}`:r}a(IHe,"getUserAgentValue");var Gon=Hon(),$on="userAgentPolicy";function NBt(t={}){let e=IHe(t.userAgentPrefix);return{name:$on,async sendRequest(r,n){return r.headers.has(Gon)||r.headers.set(Gon,await e),n(r)}}}a(NBt,"userAgentPolicy");p();p();var Von=Symbol("rawContent");function MBt(t){return typeof t[Von]=="function"}a(MBt,"hasRawContent");function Won(t){return MBt(t)?t[Von]():t}a(Won,"getRawContent");var xHe=tSe;function OBt(){let t=vHe();return{name:xHe,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)MBt(n.body)&&(n.body=Won(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(OBt,"multipartPolicy");p();function BBt(){return tHe()}a(BBt,"decompressResponsePolicy");p();function LBt(t={}){return nHe(t)}a(LBt,"defaultRetryPolicy");p();function FBt(){return iHe()}a(FBt,"formDataPolicy");p();function UBt(t,e){return pHe(t,e)}a(UBt,"proxyPolicy");p();var zon="setClientRequestIdPolicy";function QBt(t="x-ms-client-request-id"){return{name:zon,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(QBt,"setClientRequestIdPolicy");p();function qBt(t){return hHe(t)}a(qBt,"agentPolicy");p();function jBt(t){return mHe(t)}a(jBt,"tlsPolicy");p();p();var Vae=sA;function rSe(t){return Yje(t)}a(rSe,"isRestError");var Yon="tracingPolicy";function HBt(t={}){let e=IHe(t.userAgentPrefix),r=new Vk({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=Dwo();return{name:Yon,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=Nwo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return Owo(d,h),h}catch(h){throw Mwo(d,h),h}}}}a(HBt,"tracingPolicy");function Dwo(){try{return jbe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:THe})}catch(t){bM.warning(`Error when creating the TracingClient: ${Fae(t)}`);return}}a(Dwo,"tryCreateTracingClient");function Nwo(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){bM.warning(`Skipping creating a tracing span due to an error: ${Fae(n)}`);return}}a(Nwo,"tryCreateSpan");function Mwo(t,e){try{t.setStatus({status:"error",error:Qje(e)?e:void 0}),rSe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){bM.warning(`Skipping tracing span processing due to an error: ${Fae(r)}`)}}a(Mwo,"tryProcessError");function Owo(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){bM.warning(`Skipping tracing span processing due to an error: ${Fae(r)}`)}}a(Owo,"tryProcessResponse");p();p();function wHe(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(wHe,"wrapAbortSignalLike");var Bwo="wrapAbortSignalLikePolicy";function Kon(){return{name:Bwo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=wHe(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(Kon,"wrapAbortSignalLikePolicy");function GBt(t){var e;let r=bHe();return Uae&&(t.agent&&r.addPolicy(qBt(t.agent)),t.tlsOptions&&r.addPolicy(jBt(t.tlsOptions)),r.addPolicy(UBt(t.proxyOptions)),r.addPolicy(BBt())),r.addPolicy(Kon()),r.addPolicy(FBt(),{beforePolicies:[xHe]}),r.addPolicy(NBt(t.userAgentOptions)),r.addPolicy(QBt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(OBt(),{afterPhase:"Deserialize"}),r.addPolicy(LBt(t.retryOptions),{phase:"Retry"}),r.addPolicy(HBt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Uae&&r.addPolicy(DBt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(PBt(t.loggingOptions),{afterPhase:"Sign"}),r}a(GBt,"createPipelineFromOptions");p();function $Bt(){let t=Zje();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?wHe(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a($Bt,"createDefaultHttpClient");p();function _7(t){return cS(t)}a(_7,"createHttpHeaders");p();function zk(t){return Wje(t)}a(zk,"createPipelineRequest");p();p();p();p();var Fwo=t7("core-rest-pipeline retryPolicy");function VBt(t,e={maxRetries:3}){return A7(t,Object.assign({logger:Fwo},e))}a(VBt,"retryPolicy");p();p();var Uwo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Qwo(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(WBt,"createTokenCycler");var esn="bearerTokenAuthenticationPolicy";async function RHe(t,e){try{return[await e(t),void 0]}catch(r){if(rSe(r)&&r.response)return[r.response,r];throw r}}a(RHe,"trySendRequest");async function qwo(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(qwo,"defaultAuthorizeRequest");function Jon(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(Jon,"isChallengeResponse");async function Zon(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(Zon,"authorizeRequestOnCaeChallenge");function kHe(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||bM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:qwo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?WBt(o):()=>Promise.resolve(null);return{name:esn,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 RHe(f,h),Jon(m)){let y=Xon(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 Zon({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await RHe(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 RHe(f,h)),Jon(m)&&(y=Xon(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 Zon({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await RHe(f,h))}}if(g)throw g;return m}}}a(kHe,"bearerTokenAuthenticationPolicy");function jwo(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(jwo,"parseChallenges");function Xon(t){var e;return t?(e=jwo(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(Xon,"getCaeChallengeClaims");p();p();p();p();p();p();var rsn=ce(tsn(),1),zBt=rsn.state;function C7(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=nsn(t,n);!c.propertyFound&&r&&(c=nsn(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=C7(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(C7,"getOperationArgumentValueFromParameter");function nsn(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(zwo,"deserializeResponseBody");function Ywo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(Ywo,"isOperationSpecEmpty");function Kwo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(Ywo(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 Vae(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===_M.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(Kwo,"handleErrorResponse");async function Jwo(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||Vae.PARSE_ERROR;throw new Vae(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(Jwo,"parse");p();p();function ssn(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===_M.Stream&&e.add(Number(r))}return e}a(ssn,"getStreamingResponseStatusCodes");function SM(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(SM,"getPathStringFromParameter");var asn="serializationPolicy";function KBt(t={}){let e=t.stringifyXML;return{name:asn,async sendRequest(r,n){let o=BL(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(Zwo(r,c,s),Xwo(r,c,s,e)),n(r)}}}a(KBt,"serializationPolicy");function Zwo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=C7(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,SM(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||SM(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(Zwo,"serializeHeaders");function Xwo(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=C7(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=SM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===_M.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",k=eRo(_,x,T,t.body,f);T===_M.Sequence?t.body=n(tRo(k,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(k,{rootName:y||A,xmlCharKey:h}))}else{if(T===_M.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=C7(e,m);if(g!=null){let A=m.mapper.serializedName||SM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,SM(m),f)}}}}a(Xwo,"serializeRequestBody");function eRo(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(eRo,"getXmlValueWithNamespace");function tRo(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(tRo,"prepareXMLRootList");function JBt(t={}){let e=GBt(t??{});return t.credentialOptions&&e.addPolicy(kHe({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(KBt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(YBt(t.deserializationOptions),{phase:"Deserialize"}),e}a(JBt,"createClientPipeline");p();var ZBt;function csn(){return ZBt||(ZBt=$Bt()),ZBt}a(csn,"getCachedDefaultHttpClient");p();var rRo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function usn(t,e,r,n){let o=nRo(e,r,n),s=!1,c=lsn(t,o);if(e.path){let d=lsn(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),iRo(d)?(c=d,s=!0):c=oRo(c,d)}let{queryParams:l,sequenceParams:u}=sRo(e,r,n);return c=cRo(c,l,u,s),c}a(usn,"getRequestUrl");function lsn(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(lsn,"replaceAll");function nRo(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=C7(e,s,r),l=SM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(nRo,"calculateUrlReplacements");function iRo(t){return t.includes("://")}a(iRo,"isAbsoluteUrl");function oRo(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(oRo,"appendPath");function sRo(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=C7(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,SM(c));let u=c.collectionFormat?rRo[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||SM(c),l)}}return{queryParams:o,sequenceParams:s}}a(sRo,"calculateQueryParameters");function aRo(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(aRo,"simpleParseQueryParams");function cRo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=aRo(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(cRo,"appendQueryParams");p();var XBt=t7("core-client");var nSe=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&&XBt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||csn(),this.pipeline=e.pipeline||lRo(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=usn(n,r,e,this),s=zk({url:o});s.method=r.httpMethod;let c=BL(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=ssn(r));try{let d=await this.sendRequest(s),f=Z4t(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=Z4t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function lRo(t){let e=uRo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return JBt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(lRo,"createDefaultPipeline");function uRo(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(uRo,"getCredentialScopes");p();p();p();function dsn(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(dsn,"getIdentityTokenEndpointSuffix");p();var fsn="/.default",psn="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 iSe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(fsn)?e.substr(0,e.lastIndexOf(fsn)):e}a(iSe,"mapScopesToResource");function hsn(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(hsn,"parseExpirationTimestamp");function msn(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(msn,"parseRefreshTimestamp");var oSe="noCorrelationId";function dRo(t){let e=t?.authorityHost;return qje&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??Ube}a(dRo,"getIdentityClientAuthorityHost");var v7=class extends nSe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${$Qe}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=dRo(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){tS.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:hsn(n),refreshAfterTimestamp:msn(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return tS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new e7(r.status,r.bodyAsText);throw tS.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;tS.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 Nc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=dsn(e),h=zk({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:_7({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return tS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===WQe&&f.errorResponse.error==="interaction_required")return tS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw tS.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||oSe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(oSe)||[]];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]||oSe}async sendGetRequestAsync(e,r){let n=zk({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:_7(r?.headers),abortSignal:this.generateAbortSignal(oSe)}),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=zk({url:e,method:"POST",body:r?.body,headers:_7(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"));tS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){tS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var eLt;(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"})(eLt||(eLt={}));function DHe(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===eLt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(DHe,"calculateRegionalAuthority");p();p();function fRo(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(fRo,"createConfigurationErrorMessage");function lf(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=fRo(o);throw n?.info(s),new Dn(s)}return o}a(lf,"processMultiTenantRequest");function Hm(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(Os("",r)),r}}a(Hm,"checkTenantId");function Wae(t,e,r){return e?(Hm(t,e),e):(r||(r=gz),r!==gz?"common":"organizations")}a(Wae,"resolveTenantId");function jf(t){return!t||t.length===0?[]:t.includes("*")?xZr:t}a(jf,"resolveAdditionallyAllowedTenantIds");var y_=lo("MsalClient");function wRo(t,e,r={}){let n=Wae(r.logger??y_,e,t),o=K4t(n,Y4t(r)),s=new v7({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:uin(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:jje(r.logger??y_),logLevel:Hje(ZQe()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(wRo,"generateMsalConfiguration");function My(t,e,r={}){let n={msalConfig:wRo(t,e,r),cachedAccount:r.authenticationRecord?din(r.authenticationRecord):null,pluginConfiguration:MZr.generatePluginConfiguration(r),logger:r.logger??y_},o=new Map;async function s(x={}){let k=x.enableCae?"CAE":"default",D=o.get(k);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 Dae({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(k,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let k=x.enableCae?"CAE":"default",D=c.get(k);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 Mae({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(k,D),D}a(l,"getConfidentialApp");async function u(x,k,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new nx({scopes:k});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:k,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 Gz(k,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?K4t(x.tenantId,Y4t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,k,D,N){let L=null;try{L=await u(x,k,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new nx({scopes:k,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw Gz(k,B,D)}return Hz(k,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(q0(k)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}a(f,"withSilentAuthentication");async function h(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=k;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:DHe(),claims:D?.claims});return Hz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Gz(x,L,D)}}a(h,"getTokenByClientSecret");async function m(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=k;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:DHe(),claims:D?.claims,clientAssertion:k});return Hz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Gz(x,L,D)}}a(m,"getTokenByClientAssertion");async function g(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=k;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:DHe(),claims:D?.claims});return Hz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Gz(x,L,D)}}a(g,"getTokenByClientCertificate");async function A(x,k,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:k,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,k,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:k,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return fin(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,k,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:k,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,k,D,N={}){y_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(y_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(y_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(y_.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:k});return Hz(x,B,N),y_.getToken.info(q0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw Gz(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,k){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(LHe(),Gsn))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(k),claims:k?.claims,loginHint:k?.loginHint,errorTemplate:k?.browserCustomizationOptions?.errorMessage,successTemplate:k?.browserCustomizationOptions?.successMessage,prompt:k?.loginHint?"login":"select_account"}}a(b,"createBaseInteractiveRequest");async function T(x,k,D={}){y_.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):y_.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"),k?(L.prompt="none",y_.verbose("Attempting broker authentication using the default broker account")):y_.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(y_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new nx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(k)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,k,D={}){y_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${k}`);let N=await T(x,k,D);return Hz(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(q0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,k={}){y_.getToken.info("Attempting to acquire token interactively");let D=await s(k);return f(D,x,k,async()=>{let N=b(x,k);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,k):(k.proofOfPossessionOptions&&(N.shrNonce=k.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=k.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=k.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(My,"createMsalClient");var uSe=require("node:crypto");var Vsn=require("node:fs/promises");var lSe="ClientCertificateCredential",$sn=lo(lSe),dSe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${lSe}: 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(`${lSe}: 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(`${lSe}: 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=My(r,e,{...o,logger:$sn,tokenCredentialOptions:o})}async getToken(e,r={}){return Nc.withSpan(`${lSe}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,$sn);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await RRo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,uSe.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 RRo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,Vsn.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,uSe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,uSe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(RRo,"parseCertificate");p();p();function hx(t){return Array.isArray(t)?t:[t]}a(hx,"ensureScopes");function Kae(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(Os(t,r)),r}}a(Kae,"ensureValidScopeForDevTimeCreds");function FHe(t){return t.replace(/\/.default$/,"")}a(FHe,"getScopeResource");var Wsn=lo("ClientSecretCredential"),fSe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Dn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Dn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Dn("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=My(r,e,{...o,logger:Wsn,tokenCredentialOptions:o})}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,Wsn);let o=hx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var kRo=lo("UsernamePasswordCredential"),pSe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Dn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Dn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Dn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Dn("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=My(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,kRo);let o=hx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var PRo=["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 DRo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(DRo,"getAdditionallyAllowedTenants");var UHe="EnvironmentCredential",LL=lo(UHe);function NRo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return LL.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(NRo,"getSendCertificateChain");var hSe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=XQe(PRo).assigned.join(", ");LL.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=DRo(),l=NRo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&Hm(LL,n),n&&o&&s){LL.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new fSe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){LL.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new dSe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(LL.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),LL.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 pSe(n,o,h,m,u))}async getToken(e,r={}){return Nc.withSpan(`${UHe}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return LL.getToken.info(q0(e)),o}catch(o){let s=new e7(400,{error:`${UHe} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw LL.getToken.info(Os(e,s)),s}throw new Dn(`${UHe} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var MRo=1e3*64,ORo=3e3;function zsn(t){return VBt([{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(ORo,t.startDelayInMs):t.startDelayInMs;return cin(e,{retryDelayInMs:n,maxRetryDelayInMs:MRo})},"retry")}],{maxRetries:t.maxRetries})}a(zsn,"imdsRetryPolicy");p();var FL="ManagedIdentityCredential - IMDS",Vz=lo(FL),BRo="http://169.254.169.254",LRo="/metadata/identity/oauth2/token";function FRo(t){if(!iSe(t))throw new Error(`${FL}: Multiple scopes are not supported.`);let r=new URL(LRo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??BRo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:_7(n)}}a(FRo,"prepareInvalidRequestOptions");var Ysn={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=iSe(e);if(!o)return Vz.info(`${FL}: 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=FRo(o);return Nc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=zk(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{Vz.info(`${FL}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return Qje(d)&&Vz.verbose(`${FL}: Caught error ${d.name}: ${d.message}`),Vz.info(`${FL}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(Vz.info(`${FL}: The Azure IMDS endpoint is unavailable`),Vz.info(`${FL}: ${u.bodyAsText}`),!1):(Vz.info(`${FL}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var Ksn=lo("ClientAssertionCredential"),Jae=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Dn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Dn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Dn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=jf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=My(r,e,{...o,logger:Ksn,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,Ksn);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var Jsn=require("node:fs/promises");var Wz="WorkloadIdentityCredential",URo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],mSe=lo(Wz),UL=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=XQe(URo).assigned.join(", ");mSe.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&&Hm(mSe,o),!s)throw new Dn(`${Wz}: 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 Dn(`${Wz}: 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 Dn(`${Wz}: 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`);mSe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new Jae(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${Wz}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. +`,"utf-8")],o=YIo(n);o&&t.headers.set("Content-Length",o),t.body=await Bin(n)}a(KIo,"buildRequestBody");var D1e="multipartPolicy",JIo=70,ZIo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function XIo(t){if(t.length>JIo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!ZIo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(XIo,"assertValidBoundary");function zje(){return{name:D1e,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?XIo(n):n=VIo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await KIo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(zje,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function Yje(){return _je()}a(Yje,"createEmptyPipeline");p();p();p();var hM=jU("core-rest-pipeline");p();p();p();p();function Y4t(t={}){return Tje(Object.assign({logger:hM.info},t))}a(Y4t,"logPolicy");p();function K4t(t={}){return Ije(t)}a(K4t,"redirectPolicy");p();p();p();var xae=he(require("node:os"),1),Kje=he(require("node:process"),1);function Lin(){return"User-Agent"}a(Lin,"getHeaderName");async function Fin(t){if(Kje&&Kje.versions){let e=Kje.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",`(${xae.arch()}-${xae.type()}-${xae.release()})`)}a(Fin,"setPlatformSpecificData");p();var Jje="1.22.0";function cxo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(cxo,"getUserAgentString");function Uin(){return Lin()}a(Uin,"getUserAgentHeaderName");async function Zje(t){let e=new Map;e.set("core-rest-pipeline",Jje),await Fin(e);let r=cxo(e);return t?`${t} ${r}`:r}a(Zje,"getUserAgentValue");var Qin=Uin(),qin="userAgentPolicy";function J4t(t={}){let e=Zje(t.userAgentPrefix);return{name:qin,async sendRequest(r,n){return r.headers.has(Qin)||r.headers.set(Qin,await e),n(r)}}}a(J4t,"userAgentPolicy");p();p();var jin=Symbol("rawContent");function Z4t(t){return typeof t[jin]=="function"}a(Z4t,"hasRawContent");function Hin(t){return Z4t(t)?t[jin]():t}a(Hin,"getRawContent");var Xje=D1e;function X4t(){let t=zje();return{name:Xje,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)Z4t(n.body)&&(n.body=Hin(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(X4t,"multipartPolicy");p();function eBt(){return xje()}a(eBt,"decompressResponsePolicy");p();function tBt(t={}){return Rje(t)}a(tBt,"defaultRetryPolicy");p();function rBt(){return Pje()}a(rBt,"formDataPolicy");p();function nBt(t,e){return Uje(t,e)}a(nBt,"proxyPolicy");p();var Gin="setClientRequestIdPolicy";function iBt(t="x-ms-client-request-id"){return{name:Gin,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(iBt,"setClientRequestIdPolicy");p();function oBt(t){return Qje(t)}a(oBt,"agentPolicy");p();function sBt(t){return qje(t)}a(sBt,"tlsPolicy");p();p();var wae=cA;function N1e(t){return vje(t)}a(N1e,"isRestError");var $in="tracingPolicy";function aBt(t={}){let e=Zje(t.userAgentPrefix),r=new UP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=lxo();return{name:$in,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=uxo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return fxo(d,h),h}catch(h){throw dxo(d,h),h}}}}a(aBt,"tracingPolicy");function lxo(){try{return Ebe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:Jje})}catch(t){hM.warning(`Error when creating the TracingClient: ${_ae(t)}`);return}}a(lxo,"tryCreateTracingClient");function uxo(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){hM.warning(`Skipping creating a tracing span due to an error: ${_ae(n)}`);return}}a(uxo,"tryCreateSpan");function dxo(t,e){try{t.setStatus({status:"error",error:fje(e)?e:void 0}),N1e(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){hM.warning(`Skipping tracing span processing due to an error: ${_ae(r)}`)}}a(dxo,"tryProcessError");function fxo(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){hM.warning(`Skipping tracing span processing due to an error: ${_ae(r)}`)}}a(fxo,"tryProcessResponse");p();p();function eHe(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(eHe,"wrapAbortSignalLike");var pxo="wrapAbortSignalLikePolicy";function Vin(){return{name:pxo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=eHe(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(Vin,"wrapAbortSignalLikePolicy");function cBt(t){var e;let r=Yje();return vae&&(t.agent&&r.addPolicy(oBt(t.agent)),t.tlsOptions&&r.addPolicy(sBt(t.tlsOptions)),r.addPolicy(nBt(t.proxyOptions)),r.addPolicy(eBt())),r.addPolicy(Vin()),r.addPolicy(rBt(),{beforePolicies:[Xje]}),r.addPolicy(J4t(t.userAgentOptions)),r.addPolicy(iBt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(X4t(),{afterPhase:"Deserialize"}),r.addPolicy(tBt(t.retryOptions),{phase:"Retry"}),r.addPolicy(aBt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),vae&&r.addPolicy(K4t(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(Y4t(t.loggingOptions),{afterPhase:"Sign"}),r}a(cBt,"createPipelineFromOptions");p();function lBt(){let t=Sje();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?eHe(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(lBt,"createDefaultHttpClient");p();function a7(t){return eS(t)}a(a7,"createHttpHeaders");p();function qP(t){return Eje(t)}a(qP,"createPipelineRequest");p();p();p();p();var mxo=jU("core-rest-pipeline retryPolicy");function uBt(t,e={maxRetries:3}){return i7(t,Object.assign({logger:mxo},e))}a(uBt,"retryPolicy");p();p();var gxo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Axo(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(dBt,"createTokenCycler");var Kin="bearerTokenAuthenticationPolicy";async function tHe(t,e){try{return[await e(t),void 0]}catch(r){if(N1e(r)&&r.response)return[r.response,r];throw r}}a(tHe,"trySendRequest");async function yxo(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(yxo,"defaultAuthorizeRequest");function Win(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(Win,"isChallengeResponse");async function zin(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(zin,"authorizeRequestOnCaeChallenge");function rHe(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||hM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:yxo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?dBt(o):()=>Promise.resolve(null);return{name:Kin,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 tHe(f,h),Win(m)){let y=Yin(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 zin({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await tHe(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 tHe(f,h)),Win(m)&&(y=Yin(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 zin({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await tHe(f,h))}}if(g)throw g;return m}}}a(rHe,"bearerTokenAuthenticationPolicy");function Exo(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(Exo,"parseChallenges");function Yin(t){var e;return t?(e=Exo(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(Yin,"getCaeChallengeClaims");p();p();p();p();p();p();var Zin=he(Jin(),1),fBt=Zin.state;function c7(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=Xin(t,n);!c.propertyFound&&r&&(c=Xin(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=c7(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(c7,"getOperationArgumentValueFromParameter");function Xin(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(Txo,"deserializeResponseBody");function Ixo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(Ixo,"isOperationSpecEmpty");function xxo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(Ixo(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 wae(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===dM.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(xxo,"handleErrorResponse");async function wxo(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||wae.PARSE_ERROR;throw new wae(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(wxo,"parse");p();p();function ron(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===dM.Stream&&e.add(Number(r))}return e}a(ron,"getStreamingResponseStatusCodes");function mM(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(mM,"getPathStringFromParameter");var non="serializationPolicy";function hBt(t={}){let e=t.stringifyXML;return{name:non,async sendRequest(r,n){let o=SL(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(Rxo(r,c,s),Pxo(r,c,s,e)),n(r)}}}a(hBt,"serializationPolicy");function Rxo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=c7(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,mM(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||mM(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(Rxo,"serializeHeaders");function Pxo(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=c7(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=mM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===dM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=kxo(_,x,T,t.body,f);T===dM.Sequence?t.body=n(Dxo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===dM.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=c7(e,m);if(g!=null){let A=m.mapper.serializedName||mM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,mM(m),f)}}}}a(Pxo,"serializeRequestBody");function kxo(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(kxo,"getXmlValueWithNamespace");function Dxo(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(Dxo,"prepareXMLRootList");function mBt(t={}){let e=cBt(t??{});return t.credentialOptions&&e.addPolicy(rHe({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(hBt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(pBt(t.deserializationOptions),{phase:"Deserialize"}),e}a(mBt,"createClientPipeline");p();var gBt;function ion(){return gBt||(gBt=lBt()),gBt}a(ion,"getCachedDefaultHttpClient");p();var Nxo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function son(t,e,r,n){let o=Mxo(e,r,n),s=!1,c=oon(t,o);if(e.path){let d=oon(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),Oxo(d)?(c=d,s=!0):c=Bxo(c,d)}let{queryParams:l,sequenceParams:u}=Lxo(e,r,n);return c=Uxo(c,l,u,s),c}a(son,"getRequestUrl");function oon(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(oon,"replaceAll");function Mxo(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=c7(e,s,r),l=mM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(Mxo,"calculateUrlReplacements");function Oxo(t){return t.includes("://")}a(Oxo,"isAbsoluteUrl");function Bxo(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(Bxo,"appendPath");function Lxo(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=c7(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,mM(c));let u=c.collectionFormat?Nxo[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||mM(c),l)}}return{queryParams:o,sequenceParams:s}}a(Lxo,"calculateQueryParameters");function Fxo(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(Fxo,"simpleParseQueryParams");function Uxo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=Fxo(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(Uxo,"appendQueryParams");p();var ABt=jU("core-client");var M1e=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&&ABt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||ion(),this.pipeline=e.pipeline||Qxo(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=son(n,r,e,this),s=qP({url:o});s.method=r.httpMethod;let c=SL(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=ron(r));try{let d=await this.sendRequest(s),f=g4t(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=g4t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function Qxo(t){let e=qxo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return mBt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(Qxo,"createDefaultPipeline");function qxo(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(qxo,"getCredentialScopes");p();p();p();function aon(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(aon,"getIdentityTokenEndpointSuffix");p();var con="/.default",lon="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 O1e(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(con)?e.substr(0,e.lastIndexOf(con)):e}a(O1e,"mapScopesToResource");function uon(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(uon,"parseExpirationTimestamp");function don(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(don,"parseRefreshTimestamp");var B1e="noCorrelationId";function jxo(t){let e=t?.authorityHost;return pje&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??gbe}a(jxo,"getIdentityClientAuthorityHost");var l7=class extends M1e{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${AQe}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=jxo(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){W1.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:uon(n),refreshAfterTimestamp:don(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return W1.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new qU(r.status,r.bodyAsText);throw W1.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;W1.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 kc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=aon(e),h=qP({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:a7({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return W1.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===EQe&&f.errorResponse.error==="interaction_required")return W1.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw W1.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||B1e,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(B1e)||[]];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]||B1e}async sendGetRequestAsync(e,r){let n=qP({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:a7(r?.headers),abortSignal:this.generateAbortSignal(B1e)}),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=qP({url:e,method:"POST",body:r?.body,headers:a7(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"));W1.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){W1.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var yBt;(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"})(yBt||(yBt={}));function iHe(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===yBt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(iHe,"calculateRegionalAuthority");p();p();function Hxo(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(Hxo,"createConfigurationErrorMessage");function af(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=Hxo(o);throw n?.info(s),new Dn(s)}return o}a(af,"processMultiTenantRequest");function Gm(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(ks("",r)),r}}a(Gm,"checkTenantId");function Rae(t,e,r){return e?(Gm(t,e),e):(r||(r=ZW),r!==ZW?"common":"organizations")}a(Rae,"resolveTenantId");function Hf(t){return!t||t.length===0?[]:t.includes("*")?bJr:t}a(Hf,"resolveAdditionallyAllowedTenantIds");var m_=co("MsalClient");function owo(t,e,r={}){let n=Rae(r.logger??m_,e,t),o=h4t(n,p4t(r)),s=new l7({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:snn(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:hje(r.logger??m_),logLevel:mje(SQe()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(owo,"generateMsalConfiguration");function Fy(t,e,r={}){let n={msalConfig:owo(t,e,r),cachedAccount:r.authenticationRecord?ann(r.authenticationRecord):null,pluginConfiguration:PJr.generatePluginConfiguration(r),logger:r.logger??m_},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 hae({...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 gae({...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 JI({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 Iz(P,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?h4t(x.tenantId,p4t(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 JI({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 Iz(P,B,D)}return Tz(P,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(q0(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:iHe(),claims:D?.claims});return Tz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Iz(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:iHe(),claims:D?.claims,clientAssertion:P});return Tz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Iz(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:iHe(),claims:D?.claims});return Tz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Iz(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 cnn(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={}){m_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(m_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(m_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(m_.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 Tz(x,B,N),m_.getToken.info(q0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw Iz(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(lHe(),Qon))).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={}){m_.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):m_.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",m_.verbose("Attempting broker authentication using the default broker account")):m_.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(m_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new JI({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={}){m_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return Tz(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(q0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){m_.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(Fy,"createMsalClient");var q1e=require("node:crypto");var jon=require("node:fs/promises");var Q1e="ClientCertificateCredential",qon=co(Q1e),j1e=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${Q1e}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=Hf(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(`${Q1e}: 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(`${Q1e}: 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=Fy(r,e,{...o,logger:qon,tokenCredentialOptions:o})}async getToken(e,r={}){return kc.withSpan(`${Q1e}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,qon);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await swo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,q1e.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 swo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,jon.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,q1e.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,q1e.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(swo,"parseCertificate");p();p();function cx(t){return Array.isArray(t)?t:[t]}a(cx,"ensureScopes");function Dae(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(ks(t,r)),r}}a(Dae,"ensureValidScopeForDevTimeCreds");function uHe(t){return t.replace(/\/.default$/,"")}a(uHe,"getScopeResource");var Hon=co("ClientSecretCredential"),H1e=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Dn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Dn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Dn("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=Hf(o?.additionallyAllowedTenants),this.msalClient=Fy(r,e,{...o,logger:Hon,tokenCredentialOptions:o})}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,Hon);let o=cx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var awo=co("UsernamePasswordCredential"),G1e=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Dn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Dn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Dn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Dn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=Hf(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=Fy(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,awo);let o=cx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var cwo=["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 lwo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(lwo,"getAdditionallyAllowedTenants");var dHe="EnvironmentCredential",TL=co(dHe);function uwo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return TL.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(uwo,"getSendCertificateChain");var $1e=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=TQe(cwo).assigned.join(", ");TL.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=lwo(),l=uwo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&Gm(TL,n),n&&o&&s){TL.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new H1e(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){TL.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new j1e(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(TL.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),TL.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 G1e(n,o,h,m,u))}async getToken(e,r={}){return kc.withSpan(`${dHe}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return TL.getToken.info(q0(e)),o}catch(o){let s=new qU(400,{error:`${dHe} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw TL.getToken.info(ks(e,s)),s}throw new Dn(`${dHe} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var dwo=1e3*64,fwo=3e3;function Gon(t){return uBt([{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(fwo,t.startDelayInMs):t.startDelayInMs;return inn(e,{retryDelayInMs:n,maxRetryDelayInMs:dwo})},"retry")}],{maxRetries:t.maxRetries})}a(Gon,"imdsRetryPolicy");p();var IL="ManagedIdentityCredential - IMDS",wz=co(IL),pwo="http://169.254.169.254",hwo="/metadata/identity/oauth2/token";function mwo(t){if(!O1e(t))throw new Error(`${IL}: Multiple scopes are not supported.`);let r=new URL(hwo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??pwo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:a7(n)}}a(mwo,"prepareInvalidRequestOptions");var $on={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=O1e(e);if(!o)return wz.info(`${IL}: 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=mwo(o);return kc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=qP(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{wz.info(`${IL}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return fje(d)&&wz.verbose(`${IL}: Caught error ${d.name}: ${d.message}`),wz.info(`${IL}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(wz.info(`${IL}: The Azure IMDS endpoint is unavailable`),wz.info(`${IL}: ${u.bodyAsText}`),!1):(wz.info(`${IL}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var Von=co("ClientAssertionCredential"),Nae=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Dn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Dn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Dn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=Hf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=Fy(r,e,{...o,logger:Von,tokenCredentialOptions:this.options})}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,Von);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var Won=require("node:fs/promises");var Rz="WorkloadIdentityCredential",gwo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],V1e=co(Rz),xL=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=TQe(gwo).assigned.join(", ");V1e.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&&Gm(V1e,o),!s)throw new Dn(`${Rz}: 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 Dn(`${Rz}: 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 Dn(`${Rz}: 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`);V1e.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new Nae(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${Rz}: 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 mSe.info(n),new Dn(n)}return mSe.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 Dn(`${Wz}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,Jsn.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Dn(`${Wz}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var Zsn="ManagedIdentityCredential - Token Exchange",QRo=lo(Zsn),_Lt={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||QRo.info(`${Zsn}: 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 UL({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var fS=lo("ManagedIdentityCredential"),I7=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 v7({...n,additionalPolicies:[{policy:zsn(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Oae({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:Hje(ZQe()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:jje(fS)}}}),this.isAvailableIdentityClient=new v7({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw fS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Dn("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 fS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Dn(`ManagedIdentityCredential: ${psn}`);if(fS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];fS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){fS.getToken.info("Using the MSAL provider for Managed Identity.");let n=iSe(e);if(!n)throw new Dn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Nc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await _Lt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(fS.getToken.info(`MSAL Identity source: ${s}`),o){fS.getToken.info("Using the token exchange managed identity.");let u=await _Lt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Dn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(fS.getToken.info("Using the IMDS endpoint to probe for availability."),!await Ysn.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Dn("Attempted to use the IMDS endpoint, but it is not available.");fS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),fS.getToken.info(q0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw fS.getToken.error(Os(e,o)),o.name==="AuthenticationRequiredError"?o:qRo(o)?new Dn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Dn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(fS.getToken.info(s),new nx({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 qRo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(qRo,"isNetworkError");p();var Xsn=ce(require("child_process"),1);var TM=lo("AzureDeveloperCliCredential"),QHe={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:"},ean={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(TM.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(" ");Xsn.default.exec(d,{cwd:ean.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},gSe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(Hm(TM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=lf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&Hm(TM,n);let o;return typeof e=="string"?o=[e]:o=e,TM.getToken.info(`Using the scopes ${e}`),Nc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{Kae(d,TM)});let s=await ean.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 Dn(QHe.notInstalled);throw TM.getToken.info(Os(e,d)),d}if(l){let d=new Dn(QHe.login);throw TM.getToken.info(Os(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Dn(`${QHe.claim} ${f}`);throw TM.getToken.info(Os(e,h)),h}try{let d=JSON.parse(s.stdout);return TM.getToken.info(q0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Dn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Dn(s.message||QHe.unknown);throw TM.getToken.info(Os(e,c)),c}})}};p();var tan=ce(require("child_process"),1);p();function CLt(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(Os("",r)),r}}a(CLt,"checkSubscription");var pS=lo("AzureCliCredential"),ASe={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:'},ran={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(" ");tan.default.exec(d,{cwd:ran.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},ySe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(Hm(pS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(CLt(pS,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 Dn(`${ASe.claim} ${l}`);throw pS.getToken.info(Os(n,d)),d}let s=lf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&Hm(pS,s),this.subscription&&CLt(pS,this.subscription),pS.getToken.info(`Using the scope ${n}`),Nc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{Kae(n,pS);let c=FHe(n),l=await ran.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 Dn(ASe.notInstalled);throw pS.getToken.info(Os(e,h)),h}if(d){let h=new Dn(ASe.login);throw pS.getToken.info(Os(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return pS.getToken.info(q0(e)),m}catch(h){throw l.stderr?new Dn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Dn(c.message||ASe.unknown);throw pS.getToken.info(Os(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 Dn(`${ASe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var nan=ce(require("node:child_process"),1),ian={execFile(t,e,r){return new Promise((n,o)=>{nan.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 IM=lo("AzurePowerShellCredential"),san=process.platform==="win32";function aan(t){return san?`${t}.exe`:t}a(aan,"formatCommand");async function oan(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await ian.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(oan,"runCommands");var can={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"},qHe={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."},jRo=a(t=>t.message.match(`(.*)${can.login}(.*)`),"isLoginError"),HRo=a(t=>t.message.match(can.installed),"isNotInstalledError"),vLt=[aan("pwsh")];san&&vLt.push(aan("powershell"));var ESe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(Hm(IM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...vLt]){try{await oan([[o,"/?"]],n)}catch{vLt.shift();continue}let c=(await oan([[o,"-NoProfile","-NonInteractive","-Command",` + "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw V1e.info(n),new Dn(n)}return V1e.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 Dn(`${Rz}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,Won.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Dn(`${Rz}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var zon="ManagedIdentityCredential - Token Exchange",Awo=co(zon),FBt={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||Awo.info(`${zon}: 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 xL({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var iS=co("ManagedIdentityCredential"),p7=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 l7({...n,additionalPolicies:[{policy:Gon(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Aae({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:mje(SQe()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:hje(iS)}}}),this.isAvailableIdentityClient=new l7({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw iS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Dn("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 iS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Dn(`ManagedIdentityCredential: ${lon}`);if(iS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];iS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){iS.getToken.info("Using the MSAL provider for Managed Identity.");let n=O1e(e);if(!n)throw new Dn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return kc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await FBt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(iS.getToken.info(`MSAL Identity source: ${s}`),o){iS.getToken.info("Using the token exchange managed identity.");let u=await FBt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Dn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(iS.getToken.info("Using the IMDS endpoint to probe for availability."),!await $on.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Dn("Attempted to use the IMDS endpoint, but it is not available.");iS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),iS.getToken.info(q0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw iS.getToken.error(ks(e,o)),o.name==="AuthenticationRequiredError"?o:ywo(o)?new Dn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Dn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(iS.getToken.info(s),new JI({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 ywo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(ywo,"isNetworkError");p();var Yon=he(require("child_process"),1);var gM=co("AzureDeveloperCliCredential"),fHe={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:"},Kon={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(gM.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(" ");Yon.default.exec(d,{cwd:Kon.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},W1e=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(Gm(gM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Hf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=af(this.tenantId,r,this.additionallyAllowedTenantIds);n&&Gm(gM,n);let o;return typeof e=="string"?o=[e]:o=e,gM.getToken.info(`Using the scopes ${e}`),kc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{Dae(d,gM)});let s=await Kon.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 Dn(fHe.notInstalled);throw gM.getToken.info(ks(e,d)),d}if(l){let d=new Dn(fHe.login);throw gM.getToken.info(ks(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Dn(`${fHe.claim} ${f}`);throw gM.getToken.info(ks(e,h)),h}try{let d=JSON.parse(s.stdout);return gM.getToken.info(q0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Dn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Dn(s.message||fHe.unknown);throw gM.getToken.info(ks(e,c)),c}})}};p();var Jon=he(require("child_process"),1);p();function UBt(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(ks("",r)),r}}a(UBt,"checkSubscription");var oS=co("AzureCliCredential"),z1e={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:'},Zon={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(oS.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(" ");Jon.default.exec(d,{cwd:Zon.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},Y1e=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(Gm(oS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(UBt(oS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=Hf(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 Dn(`${z1e.claim} ${l}`);throw oS.getToken.info(ks(n,d)),d}let s=af(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&Gm(oS,s),this.subscription&&UBt(oS,this.subscription),oS.getToken.info(`Using the scope ${n}`),kc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{Dae(n,oS);let c=uHe(n),l=await Zon.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 Dn(z1e.notInstalled);throw oS.getToken.info(ks(e,h)),h}if(d){let h=new Dn(z1e.login);throw oS.getToken.info(ks(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return oS.getToken.info(q0(e)),m}catch(h){throw l.stderr?new Dn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Dn(c.message||z1e.unknown);throw oS.getToken.info(ks(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 oS.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 Dn(`${z1e.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var Xon=he(require("node:child_process"),1),esn={execFile(t,e,r){return new Promise((n,o)=>{Xon.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 AM=co("AzurePowerShellCredential"),rsn=process.platform==="win32";function nsn(t){return rsn?`${t}.exe`:t}a(nsn,"formatCommand");async function tsn(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await esn.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(tsn,"runCommands");var isn={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"},pHe={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."},Ewo=a(t=>t.message.match(`(.*)${isn.login}(.*)`),"isLoginError"),_wo=a(t=>t.message.match(isn.installed),"isNotInstalledError"),QBt=[nsn("pwsh")];rsn&&QBt.push(nsn("powershell"));var K1e=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(Gm(AM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Hf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...QBt]){try{await tsn([[o,"/?"]],n)}catch{QBt.shift();continue}let c=(await tsn([[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' @@ -1765,24 +1721,24 @@ Error Description: '${s.message}'`,this.correlationId)}return null}return n||(th } Write-Output (ConvertTo-Json $result) - `]]))[0];return GRo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Nc.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 Dn(`${qHe.claim} ${l}`);throw IM.getToken.info(Os(n,d)),d}let s=lf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&Hm(IM,s);try{Kae(n,IM),IM.getToken.info(`Using the scope ${n}`);let c=FHe(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return IM.getToken.info(q0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(HRo(c)){let u=new Dn(qHe.installed);throw IM.getToken.info(Os(n,u)),u}else if(jRo(c)){let u=new Dn(qHe.login);throw IM.getToken.info(Os(n,u)),u}let l=new Dn(`${c}. ${qHe.troubleshoot}`);throw IM.getToken.info(Os(n,l)),l}})}};async function GRo(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&&IM.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(GRo,"parseJsonToken");p();var lan=require("node:fs/promises");var $Ro="common",VRo="aebc6443-996d-45c2-90f0-388ff96faa56",bLt=lo("VisualStudioCodeCredential"),WRo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function zRo(t){let e=WRo[t];if(e)throw new Dn(e)}a(zRo,"checkUnsupportedTenant");var _Se=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(Hm(bLt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=$Ro,this.additionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants),zRo(this.tenantId)}async prepare(e){let r=lf(this.tenantId,this.options,this.additionallyAllowedTenantIds,bLt)||this.tenantId;if(!NZr()||!VQe)throw new Dn("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(VQe,e);this.msalClient=My(VRo,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=hx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Dn("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,lan.readFile)(e,{encoding:"utf8"});return J4t(n)}catch(n){throw bLt.getToken.info(Os(r,n)),new Dn("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 jHe=lo("BrokerCredential"),HHe=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Wae(jHe,e.tenantId),this.brokerAdditionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:jHe,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=My(gz,this.brokerTenantId,r)}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,jHe);let o=hx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw jHe.getToken.info(Os(o,s)),new Dn("Failed to acquire token using broker authentication",{cause:s})}})}};function uan(t={}){return new HHe(t)}a(uan,"createDefaultBrokerCredential");function SLt(t={}){return new _Se(t)}a(SLt,"createDefaultVisualStudioCodeCredential");function TLt(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 I7(c)}if(o&&r){let c={...t,tenantId:s};return new I7(r,c)}if(e){let c={...t,clientId:e};return new I7(c)}return new I7(t)}a(TLt,"createDefaultManagedIdentityCredential");function ILt(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 UL(s)}if(o){let s={...t,tenantId:o};return new UL(s)}return new UL(t)}a(ILt,"createDefaultWorkloadIdentityCredential");function xLt(t={}){return new gSe(t)}a(xLt,"createDefaultAzureDeveloperCliCredential");function wLt(t={}){return new ySe(t)}a(wLt,"createDefaultAzureCliCredential");function RLt(t={}){return new ESe(t)}a(RLt,"createDefaultAzurePowershellCredential");function kLt(t={}){return new hSe(t)}a(kLt,"createDefaultEnvironmentCredential");var GHe=lo("DefaultAzureCredential"),PLt=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return GHe.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},Zae=class extends Hbe{static{a(this,"DefaultAzureCredential")}constructor(e){YRo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[SLt,wLt,RLt,xLt,uan],o=[kLt,ILt,TLt],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=[kLt];break;case"workloadidentitycredential":s=[ILt];break;case"managedidentitycredential":s=[()=>TLt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[SLt];break;case"azureclicredential":s=[wLt];break;case"azurepowershellcredential":s=[RLt];break;case"azuredeveloperclicredential":s=[xLt];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 GHe.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return GHe.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new PLt(u.name,d.message)}});super(...l)}};function YRo(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 GHe.warning(n),new Error(n)}}}a(YRo,"validateRequiredEnvVars");p();var Z0u=lo("InteractiveBrowserCredential");p();var cmu=lo("DeviceCodeCredential");p();var KRo="AzurePipelinesCredential",ymu=lo(KRo);p();var wmu=lo("AuthorizationCodeCredential");p();var JRo="OnBehalfOfCredential",Fmu=lo(JRo);p();var $He=new ge("capiFetchUtilities");function ZRo(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(ZRo,"getIntegrationId");function Gm(t){let e={...by(t),"X-GitHub-Api-Version":"2026-06-01"},r=ZRo(t.get(Lr));return r&&(e["Copilot-Integration-Id"]=r),e}a(Gm,"getCapiHeaders");function dan(t,e){return $He.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":cW.api,"Copilot-Integration-Id":"autodev-test"}}a(dan,"addMsBenchCesProxyHeaders");async function fan(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;$He.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await SZr(process.env.HMAC_SECRET,r);return{...e,...n}}a(fan,"addMsBenchHmacHeaders");function XRo(){return NN()&&!!process.env.HMAC_SECRET}a(XRo,"isMsBenchHmacModeEnabled");function DLt(){return NN()&&!process.env.HMAC_SECRET}a(DLt,"isMsBenchCesProxyModeEnabled");async function CSe(t,e){return process.env.HMAC_SECRET?await fan(t,e):dan(t,e)}a(CSe,"addMsBenchHeaders");async function VHe(t,e,r){let n=r;DLt()&&(n=await eko());let o={...e,Authorization:`Bearer ${n}`};return{headers:XRo()?await fan(t,o):DLt()?dan(t,o):o,token:n}}a(VHe,"applyMsBenchAuth");function vSe(t,e,...r){if(DLt()){$He.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 LI(t,e,"api",...r)}a(vSe,"getCapiUrl");function WHe(t,e,r){(e.status===401||e.status===403)&&($He.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(WHe,"handleCapiAuthError");async function zz(t,e,r){r??=await t.get(Qt).getToken();let n=vSe(t,r,e),{headers:o}=await VHe(t,Gm(t),r.token),s=await t.get(ar).fetch(new URL(n).href,{method:"GET",headers:o});return WHe(t,s,e),s}a(zz,"fetchCapiUrl");async function zHe(t,e,r){let n=await t.get(Qt).getToken(),o=vSe(t,n,e),{headers:s}=await VHe(t,Gm(t),n.token),c=await t.get(ar).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return WHe(t,c,e),c}a(zHe,"postCapiUrl");async function eko(){let e=await new Zae().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(eko,"getMsBenchToken");p();var han=600*1e3,Tn={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"},NLt={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},Xae=new Set([Tn.O1Ga,Tn.O3Mini,Tn.O1Mini,Tn.Gemini20Pro,Tn.Gemini20Flash]);function JHe(t){return t.startsWith("claude")}a(JHe,"isClaudeFamily");function hS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Tn.Gpt4o]:r=[Tn.Gpt4o,Tn.Gpt4turbo,Tn.Gpt4,Tn.O1Mini,Tn.O1Ga,Tn.Claude35Sonnet,Tn.O3Mini,Tn.Gemini20Flash,Tn.Claude37Sonnet,Tn.Claude37SonnetThought,Tn.Gpt45,Tn.Gpt41,Tn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt35turbo,Tn.Gpt41,Tn.CopilotBase];break;case"gitCommit":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt4,Tn.Gpt41,Tn.CopilotBase];break;case"nesStubs":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt41,Tn.CopilotBase];break}return r}a(hS,"getSupportedModelFamiliesForPrompt");var ZHe={textEmbedding3Small:"text-embedding-3-small"},tko=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())}))}),pan=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())}),rko=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:tko,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(pan),long_context:S.Optional(pan)}))})),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()})))}),man=S.Object({data:S.Array(rko)});function gan(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(gan,"getDegradationReason");var dc=class{static{a(this,"ModelMetadataProvider")}},YHe=class extends dc{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(){return 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 zz(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){Dr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Dr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new DN(r)}await this.processModels(r)}async fetchModel(r){let n=await zz(this.ctx,`/models/${r}`);if(!n.ok){Dr.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 zHe(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){Dr.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>han}},KHe=class extends dc{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(){let r=this.ctx.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatExpModelIds(n),s=[];if(o){let c=o?.split(",");for(let l of c){let u=await this.fetchModel(l.trim());u!==void 0&&(u.isExperimental=!0,s.push(u))}}return s.concat(await this.delegate.getMetadata())}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(Aan,"getUserSelectedModelConfiguration");p();p();p();var ece=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();var yan=ce(require("node:fs/promises")),XHe=ce(require("node:path"));async function tce(t){return await yan.readFile(MLt(t))}a(tce,"readFile");function MLt(t){return XHe.default.resolve(XHe.default.extname(__filename)!==".ts"?__dirname:XHe.default.resolve(__dirname,"../../dist"),t)}a(MLt,"locateFile");var nce=ce(oGe());var sGe=new Map;function Ss(t="o200k_base"){let e=sGe.get(t);return e!==void 0||(e=sGe.get("o200k_base"),e!==void 0)?e:new rce}a(Ss,"getTokenizer");async function aGe(t="o200k_base"){return await SSe,Ss(t)}a(aGe,"getTokenizerAsync");async function yko(t){if(!t.endsWith(".tiktoken.noindex"))throw new Error("File does not end with .tiktoken.noindex");let e=await tce(t),r=new Map,n=[];for(let o=0;othis.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 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 Dn(`${pHe.claim} ${l}`);throw AM.getToken.info(ks(n,d)),d}let s=af(this.tenantId,r,this.additionallyAllowedTenantIds);s&&Gm(AM,s);try{Dae(n,AM),AM.getToken.info(`Using the scope ${n}`);let c=uHe(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return AM.getToken.info(q0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(_wo(c)){let u=new Dn(pHe.installed);throw AM.getToken.info(ks(n,u)),u}else if(Ewo(c)){let u=new Dn(pHe.login);throw AM.getToken.info(ks(n,u)),u}let l=new Dn(`${c}. ${pHe.troubleshoot}`);throw AM.getToken.info(ks(n,l)),l}})}};async function vwo(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&&AM.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(vwo,"parseJsonToken");p();var osn=require("node:fs/promises");var Cwo="common",bwo="aebc6443-996d-45c2-90f0-388ff96faa56",qBt=co("VisualStudioCodeCredential"),Swo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function Two(t){let e=Swo[t];if(e)throw new Dn(e)}a(Two,"checkUnsupportedTenant");var J1e=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(Gm(qBt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=Cwo,this.additionallyAllowedTenantIds=Hf(e?.additionallyAllowedTenants),Two(this.tenantId)}async prepare(e){let r=af(this.tenantId,this.options,this.additionallyAllowedTenantIds,qBt)||this.tenantId;if(!RJr()||!yQe)throw new Dn("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(yQe,e);this.msalClient=Fy(bwo,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=cx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Dn("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,osn.readFile)(e,{encoding:"utf8"});return m4t(n)}catch(n){throw qBt.getToken.info(ks(r,n)),new Dn("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 hHe=co("BrokerCredential"),mHe=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Rae(hHe,e.tenantId),this.brokerAdditionallyAllowedTenantIds=Hf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:hHe,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=Fy(ZW,this.brokerTenantId,r)}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,hHe);let o=cx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw hHe.getToken.info(ks(o,s)),new Dn("Failed to acquire token using broker authentication",{cause:s})}})}};function ssn(t={}){return new mHe(t)}a(ssn,"createDefaultBrokerCredential");function jBt(t={}){return new J1e(t)}a(jBt,"createDefaultVisualStudioCodeCredential");function HBt(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 p7(c)}if(o&&r){let c={...t,tenantId:s};return new p7(r,c)}if(e){let c={...t,clientId:e};return new p7(c)}return new p7(t)}a(HBt,"createDefaultManagedIdentityCredential");function GBt(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 xL(s)}if(o){let s={...t,tenantId:o};return new xL(s)}return new xL(t)}a(GBt,"createDefaultWorkloadIdentityCredential");function $Bt(t={}){return new W1e(t)}a($Bt,"createDefaultAzureDeveloperCliCredential");function VBt(t={}){return new Y1e(t)}a(VBt,"createDefaultAzureCliCredential");function WBt(t={}){return new K1e(t)}a(WBt,"createDefaultAzurePowershellCredential");function zBt(t={}){return new $1e(t)}a(zBt,"createDefaultEnvironmentCredential");var gHe=co("DefaultAzureCredential"),YBt=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return gHe.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},Mae=class extends _be{static{a(this,"DefaultAzureCredential")}constructor(e){Iwo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[jBt,VBt,WBt,$Bt,ssn],o=[zBt,GBt,HBt],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=[zBt];break;case"workloadidentitycredential":s=[GBt];break;case"managedidentitycredential":s=[()=>HBt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[jBt];break;case"azureclicredential":s=[VBt];break;case"azurepowershellcredential":s=[WBt];break;case"azuredeveloperclicredential":s=[$Bt];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 gHe.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return gHe.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new YBt(u.name,d.message)}});super(...l)}};function Iwo(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 gHe.warning(n),new Error(n)}}}a(Iwo,"validateRequiredEnvVars");p();var Ydu=co("InteractiveBrowserCredential");p();var ofu=co("DeviceCodeCredential");p();var xwo="AzurePipelinesCredential",mfu=co(xwo);p();var Tfu=co("AuthorizationCodeCredential");p();var wwo="OnBehalfOfCredential",Ofu=co(wwo);p();var AHe=new Ee("capiFetchUtilities");function Rwo(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(Rwo,"getIntegrationId");function uA(t){let e={...wy(t),"X-GitHub-Api-Version":"2026-06-01"},r=Rwo(t.get(Lr));return r&&(e["Copilot-Integration-Id"]=r),e}a(uA,"getCapiHeaders");function asn(t,e){return AHe.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":GV.api,"Copilot-Integration-Id":"autodev-test"}}a(asn,"addMsBenchCesProxyHeaders");async function csn(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;AHe.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await _Jr(process.env.HMAC_SECRET,r);return{...e,...n}}a(csn,"addMsBenchHmacHeaders");function Pwo(){return PB()&&!!process.env.HMAC_SECRET}a(Pwo,"isMsBenchHmacModeEnabled");function KBt(){return PB()&&!process.env.HMAC_SECRET}a(KBt,"isMsBenchCesProxyModeEnabled");async function yHe(t,e){return process.env.HMAC_SECRET?await csn(t,e):asn(t,e)}a(yHe,"addMsBenchHeaders");async function EHe(t,e,r){let n=r;KBt()&&(n=await kwo());let o={...e,Authorization:`Bearer ${n}`};return{headers:Pwo()?await csn(t,o):KBt()?asn(t,o):o,token:n}}a(EHe,"applyMsBenchAuth");function _He(t,e,...r){if(KBt()){AHe.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 kI(t,e,"api",...r)}a(_He,"getCapiUrl");function vHe(t,e,r){(e.status===401||e.status===403)&&(AHe.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Ut).resetToken("capi_fetch",e.status))}a(vHe,"handleCapiAuthError");async function Pz(t,e,r){r??=await t.get(Ut).getToken();let n=_He(t,r,e),{headers:o}=await EHe(t,uA(t),r.token),s=await t.get(fr).fetch(new URL(n).href,{method:"GET",headers:o});return vHe(t,s,e),s}a(Pz,"fetchCapiUrl");async function CHe(t,e,r){let n=await t.get(Ut).getToken(),o=_He(t,n,e),{headers:s}=await EHe(t,uA(t),n.token),c=await t.get(fr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return vHe(t,c,e),c}a(CHe,"postCapiUrl");async function kwo(){let e=await new Mae().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(kwo,"getMsBenchToken");p();var usn=600*1e3,Tn={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"},JBt={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},Oae=new Set([Tn.O1Ga,Tn.O3Mini,Tn.O1Mini,Tn.Gemini20Pro,Tn.Gemini20Flash]);function THe(t){return t.startsWith("claude")}a(THe,"isClaudeFamily");function sS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Tn.Gpt4o]:r=[Tn.Gpt4o,Tn.Gpt4turbo,Tn.Gpt4,Tn.O1Mini,Tn.O1Ga,Tn.Claude35Sonnet,Tn.O3Mini,Tn.Gemini20Flash,Tn.Claude37Sonnet,Tn.Claude37SonnetThought,Tn.Gpt45,Tn.Gpt41,Tn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt35turbo,Tn.Gpt41,Tn.CopilotBase];break;case"gitCommit":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt4,Tn.Gpt41,Tn.CopilotBase];break;case"nesStubs":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt41,Tn.CopilotBase];break}return r}a(sS,"getSupportedModelFamiliesForPrompt");var dsn={textEmbedding3Small:"text-embedding-3-small"},Dwo=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())}))}),lsn=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())}),Nwo=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:Dwo,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(lsn),long_context:S.Optional(lsn)}))})),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()})))}),fsn=S.Object({data:S.Array(Nwo)});function psn(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(psn,"getDegradationReason");var lc=class{static{a(this,"ModelMetadataProvider")}},bHe=class extends lc{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Ut).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(){return 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 Pz(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){Dr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Dr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new SN(r)}await this.processModels(r)}async fetchModel(r){let n=await Pz(this.ctx,`/models/${r}`);if(!n.ok){Dr.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 CHe(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){Dr.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>usn}},SHe=class extends lc{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(){let r=this.ctx.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatExpModelIds(n),s=[];if(o){let c=o?.split(",");for(let l of c){let u=await this.fetchModel(l.trim());u!==void 0&&(u.isExperimental=!0,s.push(u))}}return s.concat(await this.delegate.getMetadata())}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(hsn,"getUserSelectedModelConfiguration");p();p();p();var Bae=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();var msn=he(require("node:fs/promises")),IHe=he(require("node:path"));async function Lae(t){return await msn.readFile(ZBt(t))}a(Lae,"readFile");function ZBt(t){return IHe.default.resolve(IHe.default.extname(__filename)!==".ts"?__dirname:IHe.default.resolve(__dirname,"../../dist"),t)}a(ZBt,"locateFile");var Uae=he(DHe());var NHe=new Map;function Ds(t="o200k_base"){let e=NHe.get(t);return e!==void 0||(e=NHe.get("o200k_base"),e!==void 0)?e:new Fae}a(Ds,"getTokenizer");async function MHe(t="o200k_base"){return await X1e,Ds(t)}a(MHe,"getTokenizerAsync");async function Ywo(t){if(!t.endsWith(".tiktoken.noindex"))throw new Error("File does not end with .tiktoken.noindex");let e=await Lae(t),r=new Map,n=[];for(let o=0;othis.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)}},uLt=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)}},Eko={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}},GLt=4,rce=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(-GLt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-GLt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?Eko[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)}},Kwo={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}},cLt=4,Fae=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(-cLt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-cLt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?Kwo[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 Dan(t){try{let e=await $Lt.create(t);sGe.set(t,e)}catch{}}a(Dan,"setTokenizer");var SSe=(async()=>{sGe.set("mock",new VLt),await Promise.all([Dan("cl100k_base"),Dan("o200k_base")])})();p();p();var _ko=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},Man=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)},WLt,cGe,Oan,zLt=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),WLt.add(this),cGe.set(this,void 0),_ko(this,cGe,e,"f"),this.error=r}Errors(){return new q9(Man(this,WLt,"m",Oan).call(this))}};cGe=new WeakMap,WLt=new WeakSet,Oan=a(function*(){this.error&&(yield this.error),yield*Man(this,cGe,"f")},"_AssertError_Iterator");function Nan(t,e,r){if(!Jo(t,e,r))throw new zLt(xN(t,e,r))}a(Nan,"AssertValue");function lGe(...t){return t.length===3?Nan(t[0],t[1],t[2]):Nan(t[0],[],t[1])}a(lGe,"Assert");p();p();p();function Cko(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Qa(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Qa(t[r]);return e}a(Cko,"FromObject");function vko(t){return t.map(e=>Qa(e))}a(vko,"FromArray");function bko(t){return t.slice()}a(bko,"FromTypedArray");function Sko(t){return new Map(Qa([...t.entries()]))}a(Sko,"FromMap");function Tko(t){return new Set(Qa([...t.entries()]))}a(Tko,"FromSet");function Iko(t){return new Date(t.toISOString())}a(Iko,"FromDate");function Qa(t){if(Ri(t))return vko(t);if(n_(t))return Iko(t);if(bI(t))return bko(t);if(mqr(t))return Sko(t);if(gqr(t))return Tko(t);if(So(t))return Cko(t);if(S1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Qa,"Clone");var mS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function qa(t){return k9(t)?t():Qa(t)}a(qa,"FromDefault");function xko(t,e){return Qi(t,"default")?qa(t.default):{}}a(xko,"FromAny");function wko(t,e){return{}}a(wko,"FromArgument");function Rko(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new mS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new mS(t,"Array with the contains constraint requires a default value");return"default"in t?qa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>gS(t.items,e)):[]}a(Rko,"FromArray");function kko(t,e){return Qi(t,"default")?qa(t.default):(async function*(){})()}a(kko,"FromAsyncIterator");function Pko(t,e){return Qi(t,"default")?qa(t.default):BigInt(0)}a(Pko,"FromBigInt");function Dko(t,e){return Qi(t,"default")?qa(t.default):!1}a(Dko,"FromBoolean");function Nko(t,e){if(Qi(t,"default"))return qa(t.default);{let r=gS(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(Nko,"FromConstructor");function Mko(t,e){return Qi(t,"default")?qa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Mko,"FromDate");function Oko(t,e){return Qi(t,"default")?qa(t.default):()=>gS(t.returns,e)}a(Oko,"FromFunction");function Bko(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return gS(n,[...e,...r])}a(Bko,"FromImport");function Lko(t,e){return Qi(t,"default")?qa(t.default):t.minimum!==void 0?t.minimum:0}a(Lko,"FromInteger");function Fko(t,e){if(Qi(t,"default"))return qa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=gS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!Jo(t,e,r))throw new mS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(Fko,"FromIntersect");function Uko(t,e){return Qi(t,"default")?qa(t.default):(function*(){})()}a(Uko,"FromIterator");function Qko(t,e){return Qi(t,"default")?qa(t.default):t.const}a(Qko,"FromLiteral");function qko(t,e){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"Never types cannot be created. Consider using a default value.")}a(qko,"FromNever");function jko(t,e){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"Not types must have a default value")}a(jko,"FromNot");function Hko(t,e){return Qi(t,"default")?qa(t.default):null}a(Hko,"FromNull");function Gko(t,e){return Qi(t,"default")?qa(t.default):t.minimum!==void 0?t.minimum:0}a(Gko,"FromNumber");function $ko(t,e){if(Qi(t,"default"))return qa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=gS(s,e));return n}}a($ko,"FromObject");function Vko(t,e){return Qi(t,"default")?qa(t.default):Promise.resolve(gS(t.item,e))}a(Vko,"FromPromise");function Wko(t,e){return Qi(t,"default")?qa(t.default):{}}a(Wko,"FromRecord");function zko(t,e){return Qi(t,"default")?qa(t.default):gS(Sa(t,e),e)}a(zko,"FromRef");function Yko(t,e){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"RegExp types cannot be created. Consider using a default value.")}a(Yko,"FromRegExp");function Kko(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?qa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(Kko,"FromString");function Jko(t,e){return Qi(t,"default")?qa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Jko,"FromSymbol");function Zko(t,e){if(Qi(t,"default"))return qa(t.default);if(!y6e(t))throw new mS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return kie(t)[0]}a(Zko,"FromTemplateLiteral");function Xko(t,e){if(Ban++>aPo)throw new mS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?qa(t.default):gS(Sa(t,e),e)}a(Xko,"FromThis");function ePo(t,e){return Qi(t,"default")?qa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>gS(t.items[n],e))}a(ePo,"FromTuple");function tPo(t,e){if(Qi(t,"default"))return qa(t.default)}a(tPo,"FromUndefined");function rPo(t,e){if(Qi(t,"default"))return qa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return gS(t.anyOf[0],e)}a(rPo,"FromUnion");function nPo(t,e){return Qi(t,"default")?qa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(nPo,"FromUint8Array");function iPo(t,e){return Qi(t,"default")?qa(t.default):{}}a(iPo,"FromUnknown");function oPo(t,e){if(Qi(t,"default"))return qa(t.default)}a(oPo,"FromVoid");function sPo(t,e){if(Qi(t,"default"))return qa(t.default);throw new Error("User defined types must specify a default value")}a(sPo,"FromKind");function gS(t,e){let r=Dm(t,e),n=t;switch(n[_t]){case"Any":return xko(n,r);case"Argument":return wko(n,r);case"Array":return Rko(n,r);case"AsyncIterator":return kko(n,r);case"BigInt":return Pko(n,r);case"Boolean":return Dko(n,r);case"Constructor":return Nko(n,r);case"Date":return Mko(n,r);case"Function":return Oko(n,r);case"Import":return Bko(n,r);case"Integer":return Lko(n,r);case"Intersect":return Fko(n,r);case"Iterator":return Uko(n,r);case"Literal":return Qko(n,r);case"Never":return qko(n,r);case"Not":return jko(n,r);case"Null":return Hko(n,r);case"Number":return Gko(n,r);case"Object":return $ko(n,r);case"Promise":return Vko(n,r);case"Record":return Wko(n,r);case"Ref":return zko(n,r);case"RegExp":return Yko(n,r);case"String":return Kko(n,r);case"Symbol":return Jko(n,r);case"TemplateLiteral":return Zko(n,r);case"This":return Xko(n,r);case"Tuple":return ePo(n,r);case"Undefined":return tPo(n,r);case"Union":return rPo(n,r);case"Uint8Array":return nPo(n,r);case"Unknown":return iPo(n,r);case"Void":return oPo(n,r);default:if(!i_.Has(n[_t]))throw new mS(n,"Unknown type");return sPo(n,r)}}a(gS,"Visit");var aPo=512,Ban=0;function Yk(...t){return Ban=0,t.length===2?gS(t[0],t[1]):gS(t[0],[])}a(Yk,"Create");var uGe=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Lan(t,e,r){if(t[_t]==="Object"&&typeof r=="object"&&!RB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[_t]==="Literal"&&u.const===r[l]?100:0,f=Jo(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[_t]==="Union"){let o=t.anyOf.map(s=>Sa(s,e)).map(s=>Lan(s,e,r));return Math.max(...o)}else return Jo(t,e,r)?1:0}a(Lan,"ScoreUnion");function cPo(t,e,r){let n=t.anyOf.map(c=>Sa(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Lan(c,e,r);l>s&&(o=c,s=l)}return o}a(cPo,"SelectUnion");function lPo(t,e,r){if("default"in t)return typeof r=="function"?t.default:Qa(t.default);{let n=cPo(t,e,r);return TSe(n,e,r)}}a(lPo,"CastUnion");function uPo(t,e,r){return Jo(t,e,r)?Qa(r):Yk(t,e)}a(uPo,"DefaultClone");function dPo(t,e,r){return Jo(t,e,r)?r:Yk(t,e)}a(dPo,"Default");function fPo(t,e,r){if(Jo(t,e,r))return Qa(r);let n=Ri(r)?Qa(r):Yk(t,e),o=oi(t.minItems)&&n.lengthnull)]:n,c=(oi(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>Kk(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!Jo(t,e,l))throw new uGe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(fPo,"FromArray");function pPo(t,e,r){if(Jo(t,e,r))return Yk(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]=Kk(c,e,r.prototype[s]));return o}a(pPo,"FromConstructor");function hPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Kk(o,[...e,...n],r)}a(hPo,"FromImport");function Fan(t,e){return So(t)&&!So(e)||!So(t)&&So(e)?t:!So(t)||!So(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Fan(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Fan,"IntersectAssign");function mPo(t,e,r){if(Jo(t,e,r))return r;let n=Yk(t,e),o=Fan(n,r);return Jo(t,e,o)?o:n}a(mPo,"FromIntersect");function gPo(t,e,r){throw new uGe(t,"Never types cannot be cast")}a(gPo,"FromNever");function APo(t,e,r){if(Jo(t,e,r))return r;if(r===null||typeof r!="object")return Yk(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]=Kk(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]=Kk(t.additionalProperties,e,r[c]))}return o}a(APo,"FromObject");function yPo(t,e,r){if(Jo(t,e,r))return Qa(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Yk(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=Kk(o,e,l);return s}a(yPo,"FromRecord");function EPo(t,e,r){return Kk(Sa(t,e),e,r)}a(EPo,"FromRef");function _Po(t,e,r){return Kk(Sa(t,e),e,r)}a(_Po,"FromThis");function CPo(t,e,r){return Jo(t,e,r)?Qa(r):Ri(r)?t.items===void 0?[]:t.items.map((n,o)=>Kk(n,e,r[o])):Yk(t,e)}a(CPo,"FromTuple");function vPo(t,e,r){return Jo(t,e,r)?Qa(r):lPo(t,e,r)}a(vPo,"FromUnion");function Kk(t,e,r){let n=va(t.$id)?Dm(t,e):e,o=t;switch(t[_t]){case"Array":return fPo(o,n,r);case"Constructor":return pPo(o,n,r);case"Import":return hPo(o,n,r);case"Intersect":return mPo(o,n,r);case"Never":return gPo(o,n,r);case"Object":return APo(o,n,r);case"Record":return yPo(o,n,r);case"Ref":return EPo(o,n,r);case"This":return _Po(o,n,r);case"Tuple":return CPo(o,n,r);case"Union":return vPo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return uPo(t,e,r);default:return dPo(o,n,r)}}a(Kk,"Visit");function TSe(...t){return t.length===3?Kk(t[0],t[1],t[2]):Kk(t[0],[],t[1])}a(TSe,"Cast");p();function bPo(t){return D9(t)&&t[_t]!=="Unsafe"}a(bPo,"IsCheckable");function SPo(t,e,r){return Ri(r)?r.map(n=>hv(t.items,e,n)):r}a(SPo,"FromArray");function TPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return hv(o,[...e,...n],r)}a(TPo,"FromImport");function IPo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>hv(l,e,Qa(r))).reduce((l,u)=>So(u)?{...l,...u}:u,{});if(!So(r)||!So(s)||!D9(n))return s;let c=WC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||Jo(n,e,r[l])&&(s[l]=hv(n,e,r[l]));return s}a(IPo,"FromIntersect");function xPo(t,e,r){if(!So(r)||Ri(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Qi(t.properties,o)){r[o]=hv(t.properties[o],e,r[o]);continue}if(D9(n)&&Jo(n,e,r[o])){r[o]=hv(n,e,r[o]);continue}delete r[o]}return r}a(xPo,"FromObject");function wPo(t,e,r){if(!So(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]=hv(c,e,r[u]);continue}if(D9(n)&&Jo(n,e,r[u])){r[u]=hv(n,e,r[u]);continue}delete r[u]}return r}a(wPo,"FromRecord");function RPo(t,e,r){return hv(Sa(t,e),e,r)}a(RPo,"FromRef");function kPo(t,e,r){return hv(Sa(t,e),e,r)}a(kPo,"FromThis");function PPo(t,e,r){if(!Ri(r))return r;if(Du(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(PPo,"FromTuple");function DPo(t,e,r){for(let n of t.anyOf)if(bPo(n)&&Jo(n,e,r))return hv(n,e,r);return r}a(DPo,"FromUnion");function hv(t,e,r){let n=va(t.$id)?Dm(t,e):e,o=t;switch(o[_t]){case"Array":return SPo(o,n,r);case"Import":return TPo(o,n,r);case"Intersect":return IPo(o,n,r);case"Object":return xPo(o,n,r);case"Record":return wPo(o,n,r);case"Ref":return RPo(o,n,r);case"This":return kPo(o,n,r);case"Tuple":return PPo(o,n,r);case"Union":return DPo(o,n,r);default:return r}}a(hv,"Visit");function dGe(...t){return t.length===3?hv(t[0],t[1],t[2]):hv(t[0],[],t[1])}a(dGe,"Clean");p();function fGe(t){return va(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(fGe,"IsStringNumeric");function NPo(t){return Wg(t)||SN(t)||oi(t)}a(NPo,"IsValueToString");function ISe(t){return t===!0||oi(t)&&t===1||Wg(t)&&t===BigInt("1")||va(t)&&(t.toLowerCase()==="true"||t==="1")}a(ISe,"IsValueTrue");function xSe(t){return t===!1||oi(t)&&(t===0||Object.is(t,-0))||Wg(t)&&t===BigInt("0")||va(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(xSe,"IsValueFalse");function MPo(t){return va(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(MPo,"IsTimeStringWithTimeZone");function OPo(t){return va(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(OPo,"IsTimeStringWithoutTimeZone");function BPo(t){return va(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(BPo,"IsDateTimeStringWithTimeZone");function LPo(t){return va(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(LPo,"IsDateTimeStringWithoutTimeZone");function FPo(t){return va(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(FPo,"IsDateString");function UPo(t,e){let r=Qan(t);return r===e?r:t}a(UPo,"TryConvertLiteralString");function QPo(t,e){let r=qan(t);return r===e?r:t}a(QPo,"TryConvertLiteralNumber");function qPo(t,e){let r=Uan(t);return r===e?r:t}a(qPo,"TryConvertLiteralBoolean");function jPo(t,e){return va(t.const)?UPo(e,t.const):oi(t.const)?QPo(e,t.const):SN(t.const)?qPo(e,t.const):e}a(jPo,"TryConvertLiteral");function Uan(t){return ISe(t)?!0:xSe(t)?!1:t}a(Uan,"TryConvertBoolean");function HPo(t){let e=a(r=>r.split(".")[0],"truncateInteger");return fGe(t)?BigInt(e(t)):oi(t)?BigInt(Math.trunc(t)):xSe(t)?BigInt(0):ISe(t)?BigInt(1):t}a(HPo,"TryConvertBigInt");function Qan(t){return kB(t)&&t.description!==void 0?t.description.toString():NPo(t)?t.toString():t}a(Qan,"TryConvertString");function qan(t){return fGe(t)?parseFloat(t):ISe(t)?1:xSe(t)?0:t}a(qan,"TryConvertNumber");function GPo(t){return fGe(t)?parseInt(t):oi(t)?Math.trunc(t):ISe(t)?1:xSe(t)?0:t}a(GPo,"TryConvertInteger");function $Po(t){return va(t)&&t.toLowerCase()==="null"?null:t}a($Po,"TryConvertNull");function VPo(t){return va(t)&&t==="undefined"?void 0:t}a(VPo,"TryConvertUndefined");function WPo(t){return n_(t)?t:oi(t)?new Date(t):ISe(t)?new Date(1):xSe(t)?new Date(0):fGe(t)?new Date(parseInt(t)):OPo(t)?new Date(`1970-01-01T${t}.000Z`):MPo(t)?new Date(`1970-01-01T${t}`):LPo(t)?new Date(`${t}.000Z`):BPo(t)?new Date(t):FPo(t)?new Date(`${t}T00:00:00.000Z`):t}a(WPo,"TryConvertDate");function zPo(t,e,r){return(Ri(r)?r:[r]).map(o=>Jk(t.items,e,o))}a(zPo,"FromArray");function YPo(t,e,r){return HPo(r)}a(YPo,"FromBigInt");function KPo(t,e,r){return Uan(r)}a(KPo,"FromBoolean");function JPo(t,e,r){return WPo(r)}a(JPo,"FromDate");function ZPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Jk(o,[...e,...n],r)}a(ZPo,"FromImport");function XPo(t,e,r){return GPo(r)}a(XPo,"FromInteger");function e2o(t,e,r){return t.allOf.reduce((n,o)=>Jk(o,e,n),r)}a(e2o,"FromIntersect");function t2o(t,e,r){return jPo(t,r)}a(t2o,"FromLiteral");function r2o(t,e,r){return $Po(r)}a(r2o,"FromNull");function n2o(t,e,r){return qan(r)}a(n2o,"FromNumber");function i2o(t,e,r){if(!So(r)||Ri(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=Jk(t.properties[n],e,r[n]));return r}a(i2o,"FromObject");function o2o(t,e,r){if(!(So(r)&&!Ri(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=Jk(s,e,l);return r}a(o2o,"FromRecord");function s2o(t,e,r){return Jk(Sa(t,e),e,r)}a(s2o,"FromRef");function a2o(t,e,r){return Qan(r)}a(a2o,"FromString");function c2o(t,e,r){return va(r)||oi(r)?Symbol(r):r}a(c2o,"FromSymbol");function l2o(t,e,r){return Jk(Sa(t,e),e,r)}a(l2o,"FromThis");function u2o(t,e,r){return Ri(r)&&!Du(t.items)?r.map((o,s)=>s{let c=__(s,e,n);return So(c)?{...o,...c}:c},{})}a(g2o,"FromIntersect");function A2o(t,e,r){let n=QL(t,r);if(!So(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=__(t.properties[s],e,n[s]);Du(c)||(n[s]=__(t.properties[s],e,n[s]))}if(!YLt(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=__(t.additionalProperties,e,n[s]));return n}a(A2o,"FromObject");function y2o(t,e,r){let n=QL(t,r);if(!So(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)&&YLt(c)&&(n[u]=__(c,e,n[u]));if(!YLt(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=__(o,e,n[u]));return n}a(y2o,"FromRecord");function E2o(t,e,r){return __(Sa(t,e),e,QL(t,r))}a(E2o,"FromRef");function _2o(t,e,r){return __(Sa(t,e),e,r)}a(_2o,"FromThis");function C2o(t,e,r){let n=QL(t,r);if(!Ri(n)||Du(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cS2o,Format:()=>wSe,Get:()=>I2o,Has:()=>T2o,Set:()=>b2o,ValuePointerRootDeleteError:()=>gGe,ValuePointerRootSetError:()=>mGe});p();var mGe=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}},gGe=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Han(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Han,"Escape");function*wSe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nYz(t[o],e[o]))}a(x2o,"ObjectType");function w2o(t,e){return n_(e)&&t.getTime()===e.getTime()}a(w2o,"DateType");function R2o(t,e){return!Ri(e)||t.length!==e.length?!1:t.every((r,n)=>Yz(r,e[n]))}a(R2o,"ArrayType");function k2o(t,e){return!bI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>Yz(r,e[n]))}a(k2o,"TypedArrayType");function P2o(t,e){return t===e}a(P2o,"ValueType");function Yz(t,e){if(n_(t))return w2o(t,e);if(bI(t))return k2o(t,e);if(Ri(t))return R2o(t,e);if(So(t))return x2o(t,e);if(S1(t))return P2o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(Yz,"Equal");var D2o=ec({type:oa("insert"),path:o_(),value:mk()}),N2o=ec({type:oa("update"),path:o_(),value:mk()}),M2o=ec({type:oa("delete"),path:o_()}),$an=Xa([D2o,N2o,M2o]),AGe=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function yGe(t,e){return{type:"update",path:t,value:e}}a(yGe,"CreateUpdate");function Van(t,e){return{type:"insert",path:t,value:e}}a(Van,"CreateInsert");function Wan(t){return{type:"delete",path:t}}a(Wan,"CreateDelete");function Gan(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new AGe(t,"Cannot diff objects with symbols")}a(Gan,"AssertDiffable");function*O2o(t,e,r){if(Gan(e),Gan(r),!Vwt(r))return yield yGe(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield Van(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(Yz(e,r)||(yield*EGe(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield Wan(`${t}/${s}`))}a(O2o,"ObjectType");function*B2o(t,e,r){if(!Ri(r))return yield yGe(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(U2o,"IsRootUpdate");function Q2o(t){return t.length===0}a(Q2o,"IsIdentity");function Yan(t,e){if(U2o(e))return Qa(e[0].value);if(Q2o(e))return Qa(t);let r=Qa(t);for(let n of e)switch(n.type){case"insert":{Zk.Set(r,n.path,n.value);break}case"update":{Zk.Set(r,n.path,n.value);break}case"delete":{Zk.Delete(r,n.path);break}}return r}a(Yan,"Patch");p();function Kan(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=UB(e,r)?Vie(e,r,n):n;if(!Jo(e,r,o))throw new $ie(e,o,xN(e,r,o).First());return o}a(Kan,"Encode");p();function _Ge(t){return So(t)&&!Ri(t)}a(_Ge,"IsStandardObject");var CGe=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function q2o(t,e,r,n){if(!_Ge(r))Zk.Set(t,e,Qa(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)KLt(t,`${e}/${c}`,r[c],n[c])}}a(q2o,"ObjectType");function j2o(t,e,r,n){if(!Ri(r))Zk.Set(t,e,Qa(n));else{for(let o=0;o(lGe(s,c,l),l)],["Cast",(s,c,l)=>TSe(s,c,l)],["Clean",(s,c,l)=>dGe(s,c,l)],["Clone",(s,c,l)=>Qa(l)],["Convert",(s,c,l)=>pGe(s,c,l)],["Decode",(s,c,l)=>UB(s,c)?Gie(s,c,l):l],["Default",(s,c,l)=>hGe(s,c,l)],["Encode",(s,c,l)=>UB(s,c)?Vie(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})(JLt||(JLt={}));var Xan=["Clone","Clean","Default","Convert","Assert","Decode"];function V2o(t,e,r,n){return t.reduce((o,s)=>{let c=JLt.Get(s);if(Du(c))throw new vGe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(V2o,"ParseValue");function ecn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Ri(t[0])?[t[0],t[1],[],t[2]]:[Xan,t[0],t[1],t[2]]:t.length===2?[Xan,t[0],[],t[1]]:(()=>{throw new vGe("Invalid Arguments")})();return V2o(e,r,n,o)}a(ecn,"Parse");p();var RM={};wi(RM,{Assert:()=>lGe,Cast:()=>TSe,Check:()=>Jo,Clean:()=>dGe,Clone:()=>Qa,Convert:()=>pGe,Create:()=>Yk,Decode:()=>jan,Default:()=>hGe,Diff:()=>zan,Edit:()=>$an,Encode:()=>Kan,Equal:()=>Yz,Errors:()=>xN,Hash:()=>Q9,Mutate:()=>Zan,Parse:()=>ecn,Patch:()=>Yan,ValueErrorIterator:()=>q9});p();var W2o="gpt-41-copilot",mx=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&Es(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 W2o}parseModelsResponse(e){try{return RM.Parse(man,e)}catch(r){Dr.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 zz(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Dr.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=Aan(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Dr.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=qt(this._ctx,je.DebugOverrideEngine)||qt(this._ctx,je.DebugOverrideEngineLegacy);if(o)return new Kz(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 Kz(s,"exp"):new Kz(n,"modelpicker"):s?new Kz(s,"exp"):new Kz(r,"default")}},Kz=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function w7(t,e=void 0){let r=t.get(mx),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(w7,"getEngineRequestInfo");p();p();var Fo=class{static{a(this,"FileSystem")}};var ycn=ce(Acn());function Ecn(t){return t!==void 0&&t!==0}a(Ecn,"isRepoInfo");function _cn(t){if(t===void 0||t===0)return"";let e=qL(t);if(e==="github/github")return e;let r=EDo(t)?.toLowerCase();return r!==void 0?r:""}a(_cn,"getDogFood");function qL(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(qL,"tryGetGitHubNWO");function EDo(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(EDo,"tryGetADONWO");function R7(t,e){let r=tf(e);return _Do(t,r)}a(R7,"extractRepoInfoInBackground");var _Do=SDo(CDo,1e4);async function CDo(t,e){let r=vWr(e);if(!r)return;let n=await vDo(t,r);if(!n)return;let o=t.get(Fo),s=xa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=bDo(c)??"",u=t3t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(CDo,"extractRepoInfo");function t3t(t){let e;try{if(e=(0,ycn.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(t3t,"parseRepoUrl");async function vDo(t,e){let r=e+"_add_to_make_longer",n=t.get(Fo);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 e3t(d)),n.delete(c)}),0}}a(SDo,"computeInBackgroundAndMemoize");p();var RSe=500,Ccn=8192-RSe,vcn=4,bGe=10,bcn=1e3*5,SGe={prefix:35,suffix:15,stableContext:35,volatileContext:15},TDo={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function kSe(t){return t=t.toLowerCase(),TDo[t]??t}a(kSe,"normalizeLanguageId");var r3t=class{constructor(e){this.ctx=e;this.cache=new nn(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 n3t(()=>this.ctx.get(Qk).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()}},n3t=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 IDo(t){return"uri"in t}a(IDo,"isCompletionsFiltersInfo");var Jt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new r3t(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=jt.createAndMarkAsIssued()){if(n instanceof NI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&IDo(r)?R7(this.ctx,r.uri):void 0,s=qL(o)??"",c=_cn(o)??"",l=r?.languageId??"",u=w7(this.ctx).modelId,d=AWr(e),f=e.getTokenValue("ft")??"",h=e.getTokenValue("ol")??"",m=e.getTokenValue("tid")??"",A=this.ctx.get(Nf).getProperties(),y=e.endpoints,E={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-CustomModel":f,"X-Copilot-Orgs":h,"X-Copilot-CopilotTrackingId":m,"X-GitHub-Copilot-SKU":A.sku||""},_=this.getGranularityDirectory(),v=this.makeFilterSettings(E),b=_.extendFilters(v),T=await this.getExpConfig(b.newFilterSettings,y);_.update(v,+(T.variables.copilotbycallbuckets??NaN),+(T.variables.copilottimeperiodsizeinh??NaN));let w=_.extendFilters(v),R=w.newFilterSettings,x=await this.getExpConfig(R,y),k=new Promise(D=>setTimeout(D,t.upcomingDynamicFilterCheckDelayMs));for(let D of w.otherFilterSettingsToPrefetch)k=k.then(async()=>{await new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(D,y)});return this.prepareForUpcomingFilters(R,y),new NI(n.properties,n.measurements,n.issuedTime,{filters:R,exp:x})}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(Fa).machineId;this.granularityDirectory=new HQe(e,this.ctx.get(dM))}return this.granularityDirectory}makeFilterSettings(e){return new SB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return XC.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 SB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=HB(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??SGe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??bGe}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??Ccn+RSe}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??bcn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??SGe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??SGe.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}ideEnableCopilotSemanticSearch(e){return e.filtersAndExp.exp.variables.ideenablecopilotsemanticsearch??!1}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}searchAgentEnabled(e){return e.filtersAndExp.exp.variables.copilotsearchagentenabled??!1}cliAsDefaultAgentProviderEnabled(e){return e.filtersAndExp.exp.variables.copilotcliasdefaultagentprovider??!1}ideEnableCopilotNesNonFreeEnabled(e){return e.filtersAndExp.exp.variables.ideenablecopilotnes??!1}};async function TGe(t){let e=qt(t,je.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(TGe,"isSearchAgentEnabled");function Scn(t,e){let r=qt(t,je.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Jt).ideEnableCopilotNesNonFreeEnabled(e)}a(Scn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var IGe=ce(ice());var o3t={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 AS(t){return t in o3t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(AS,"isSupportedLanguageId");function xGe(t){if(!(t in o3t))throw new Error(`Unrecognized language: ${t}`);return o3t[t]}a(xGe,"languageIdToWasmLanguage");var i3t=new Map;async function xDo(t){let e;try{e=await tce(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new ece(`Could not load tree-sitter-${t}.wasm`,r):r}return IGe.default.Language.load(e)}a(xDo,"loadWasmLanguage");function a3t(t){let e=xGe(t);if(!i3t.has(e)){let r=xDo(e);i3t.set(e,r)}return i3t.get(e)}a(a3t,"getLanguage");var s3t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function k7(t,e){return(await c3t(t,e))[0]}a(k7,"parseTreeSitter");async function c3t(t,e){await IGe.default.init({locateFile:a(s=>MLt(s),"locateFile")});let r;try{r=new IGe.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 s3t(`Could not init Parse for language <${t}>`,s):s}let n=await a3t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(c3t,"parseTreeSitterIncludingVersion");function Tcn(t){switch(xGe(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(Tcn,"getBlockCloseToken");function wDo(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(wDo,"innerQuery");var RDo=[`[ +`);return n.substring(o+1)}};async function Rsn(t){try{let e=await lLt.create(t);NHe.set(t,e)}catch{}}a(Rsn,"setTokenizer");var X1e=(async()=>{NHe.set("mock",new uLt),await Promise.all([Rsn("cl100k_base"),Rsn("o200k_base")])})();p();p();var Jwo=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},ksn=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)},dLt,OHe,Dsn,fLt=class extends Qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),dLt.add(this),OHe.set(this,void 0),Jwo(this,OHe,e,"f"),this.error=r}Errors(){return new x9(ksn(this,dLt,"m",Dsn).call(this))}};OHe=new WeakMap,dLt=new WeakSet,Dsn=a(function*(){this.error&&(yield this.error),yield*ksn(this,OHe,"f")},"_AssertError_Iterator");function Psn(t,e,r){if(!Wo(t,e,r))throw new fLt(EN(t,e,r))}a(Psn,"AssertValue");function BHe(...t){return t.length===3?Psn(t[0],t[1],t[2]):Psn(t[0],[],t[1])}a(BHe,"Assert");p();p();p();function Zwo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Fa(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Fa(t[r]);return e}a(Zwo,"FromObject");function Xwo(t){return t.map(e=>Fa(e))}a(Xwo,"FromArray");function eRo(t){return t.slice()}a(eRo,"FromTypedArray");function tRo(t){return new Map(Fa([...t.entries()]))}a(tRo,"FromMap");function rRo(t){return new Set(Fa([...t.entries()]))}a(rRo,"FromSet");function nRo(t){return new Date(t.toISOString())}a(nRo,"FromDate");function Fa(t){if(wi(t))return Xwo(t);if(e_(t))return nRo(t);if(AI(t))return eRo(t);if(dQr(t))return tRo(t);if(fQr(t))return rRo(t);if(bo(t))return Zwo(t);if(g1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Fa,"Clone");var aS=class extends Qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ua(t){return g9(t)?t():Fa(t)}a(Ua,"FromDefault");function iRo(t,e){return Ui(t,"default")?Ua(t.default):{}}a(iRo,"FromAny");function oRo(t,e){return{}}a(oRo,"FromArgument");function sRo(t,e){if(t.uniqueItems===!0&&!Ui(t,"default"))throw new aS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Ui(t,"default"))throw new aS(t,"Array with the contains constraint requires a default value");return"default"in t?Ua(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>cS(t.items,e)):[]}a(sRo,"FromArray");function aRo(t,e){return Ui(t,"default")?Ua(t.default):(async function*(){})()}a(aRo,"FromAsyncIterator");function cRo(t,e){return Ui(t,"default")?Ua(t.default):BigInt(0)}a(cRo,"FromBigInt");function lRo(t,e){return Ui(t,"default")?Ua(t.default):!1}a(lRo,"FromBoolean");function uRo(t,e){if(Ui(t,"default"))return Ua(t.default);{let r=cS(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(uRo,"FromConstructor");function dRo(t,e){return Ui(t,"default")?Ua(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(dRo,"FromDate");function fRo(t,e){return Ui(t,"default")?Ua(t.default):()=>cS(t.returns,e)}a(fRo,"FromFunction");function pRo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return cS(n,[...e,...r])}a(pRo,"FromImport");function hRo(t,e){return Ui(t,"default")?Ua(t.default):t.minimum!==void 0?t.minimum:0}a(hRo,"FromInteger");function mRo(t,e){if(Ui(t,"default"))return Ua(t.default);{let r=t.allOf.reduce((n,o)=>{let s=cS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!Wo(t,e,r))throw new aS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(mRo,"FromIntersect");function gRo(t,e){return Ui(t,"default")?Ua(t.default):(function*(){})()}a(gRo,"FromIterator");function ARo(t,e){return Ui(t,"default")?Ua(t.default):t.const}a(ARo,"FromLiteral");function yRo(t,e){if(Ui(t,"default"))return Ua(t.default);throw new aS(t,"Never types cannot be created. Consider using a default value.")}a(yRo,"FromNever");function ERo(t,e){if(Ui(t,"default"))return Ua(t.default);throw new aS(t,"Not types must have a default value")}a(ERo,"FromNot");function _Ro(t,e){return Ui(t,"default")?Ua(t.default):null}a(_Ro,"FromNull");function vRo(t,e){return Ui(t,"default")?Ua(t.default):t.minimum!==void 0?t.minimum:0}a(vRo,"FromNumber");function CRo(t,e){if(Ui(t,"default"))return Ua(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=cS(s,e));return n}}a(CRo,"FromObject");function bRo(t,e){return Ui(t,"default")?Ua(t.default):Promise.resolve(cS(t.item,e))}a(bRo,"FromPromise");function SRo(t,e){return Ui(t,"default")?Ua(t.default):{}}a(SRo,"FromRecord");function TRo(t,e){return Ui(t,"default")?Ua(t.default):cS(va(t,e),e)}a(TRo,"FromRef");function IRo(t,e){if(Ui(t,"default"))return Ua(t.default);throw new aS(t,"RegExp types cannot be created. Consider using a default value.")}a(IRo,"FromRegExp");function xRo(t,e){if(t.pattern!==void 0){if(Ui(t,"default"))return Ua(t.default);throw new aS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Ui(t,"default"))return Ua(t.default);throw new aS(t,"String types with formats must specify a default value")}else return Ui(t,"default")?Ua(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(xRo,"FromString");function wRo(t,e){return Ui(t,"default")?Ua(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(wRo,"FromSymbol");function RRo(t,e){if(Ui(t,"default"))return Ua(t.default);if(!G8e(t))throw new aS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return pie(t)[0]}a(RRo,"FromTemplateLiteral");function PRo(t,e){if(Nsn++>FRo)throw new aS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Ui(t,"default")?Ua(t.default):cS(va(t,e),e)}a(PRo,"FromThis");function kRo(t,e){return Ui(t,"default")?Ua(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>cS(t.items[n],e))}a(kRo,"FromTuple");function DRo(t,e){if(Ui(t,"default"))return Ua(t.default)}a(DRo,"FromUndefined");function NRo(t,e){if(Ui(t,"default"))return Ua(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return cS(t.anyOf[0],e)}a(NRo,"FromUnion");function MRo(t,e){return Ui(t,"default")?Ua(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(MRo,"FromUint8Array");function ORo(t,e){return Ui(t,"default")?Ua(t.default):{}}a(ORo,"FromUnknown");function BRo(t,e){if(Ui(t,"default"))return Ua(t.default)}a(BRo,"FromVoid");function LRo(t,e){if(Ui(t,"default"))return Ua(t.default);throw new Error("User defined types must specify a default value")}a(LRo,"FromKind");function cS(t,e){let r=Dm(t,e),n=t;switch(n[Tt]){case"Any":return iRo(n,r);case"Argument":return oRo(n,r);case"Array":return sRo(n,r);case"AsyncIterator":return aRo(n,r);case"BigInt":return cRo(n,r);case"Boolean":return lRo(n,r);case"Constructor":return uRo(n,r);case"Date":return dRo(n,r);case"Function":return fRo(n,r);case"Import":return pRo(n,r);case"Integer":return hRo(n,r);case"Intersect":return mRo(n,r);case"Iterator":return gRo(n,r);case"Literal":return ARo(n,r);case"Never":return yRo(n,r);case"Not":return ERo(n,r);case"Null":return _Ro(n,r);case"Number":return vRo(n,r);case"Object":return CRo(n,r);case"Promise":return bRo(n,r);case"Record":return SRo(n,r);case"Ref":return TRo(n,r);case"RegExp":return IRo(n,r);case"String":return xRo(n,r);case"Symbol":return wRo(n,r);case"TemplateLiteral":return RRo(n,r);case"This":return PRo(n,r);case"Tuple":return kRo(n,r);case"Undefined":return DRo(n,r);case"Union":return NRo(n,r);case"Uint8Array":return MRo(n,r);case"Unknown":return ORo(n,r);case"Void":return BRo(n,r);default:if(!t_.Has(n[Tt]))throw new aS(n,"Unknown type");return LRo(n,r)}}a(cS,"Visit");var FRo=512,Nsn=0;function jP(...t){return Nsn=0,t.length===2?cS(t[0],t[1]):cS(t[0],[])}a(jP,"Create");var LHe=class extends Qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Msn(t,e,r){if(t[Tt]==="Object"&&typeof r=="object"&&!gB(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=Wo(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=>va(s,e)).map(s=>Msn(s,e,r));return Math.max(...o)}else return Wo(t,e,r)?1:0}a(Msn,"ScoreUnion");function URo(t,e,r){let n=t.anyOf.map(c=>va(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Msn(c,e,r);l>s&&(o=c,s=l)}return o}a(URo,"SelectUnion");function QRo(t,e,r){if("default"in t)return typeof r=="function"?t.default:Fa(t.default);{let n=URo(t,e,r);return eSe(n,e,r)}}a(QRo,"CastUnion");function qRo(t,e,r){return Wo(t,e,r)?Fa(r):jP(t,e)}a(qRo,"DefaultClone");function jRo(t,e,r){return Wo(t,e,r)?r:jP(t,e)}a(jRo,"Default");function HRo(t,e,r){if(Wo(t,e,r))return Fa(r);let n=wi(r)?Fa(r):jP(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=>HP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!Wo(t,e,l))throw new LHe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(HRo,"FromArray");function GRo(t,e,r){if(Wo(t,e,r))return jP(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]=HP(c,e,r.prototype[s]));return o}a(GRo,"FromConstructor");function $Ro(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return HP(o,[...e,...n],r)}a($Ro,"FromImport");function Osn(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?Osn(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Osn,"IntersectAssign");function VRo(t,e,r){if(Wo(t,e,r))return r;let n=jP(t,e),o=Osn(n,r);return Wo(t,e,o)?o:n}a(VRo,"FromIntersect");function WRo(t,e,r){throw new LHe(t,"Never types cannot be cast")}a(WRo,"FromNever");function zRo(t,e,r){if(Wo(t,e,r))return r;if(r===null||typeof r!="object")return jP(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]=HP(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]=HP(t.additionalProperties,e,r[c]))}return o}a(zRo,"FromObject");function YRo(t,e,r){if(Wo(t,e,r))return Fa(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return jP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=HP(o,e,l);return s}a(YRo,"FromRecord");function KRo(t,e,r){return HP(va(t,e),e,r)}a(KRo,"FromRef");function JRo(t,e,r){return HP(va(t,e),e,r)}a(JRo,"FromThis");function ZRo(t,e,r){return Wo(t,e,r)?Fa(r):wi(r)?t.items===void 0?[]:t.items.map((n,o)=>HP(n,e,r[o])):jP(t,e)}a(ZRo,"FromTuple");function XRo(t,e,r){return Wo(t,e,r)?Fa(r):QRo(t,e,r)}a(XRo,"FromUnion");function HP(t,e,r){let n=Ea(t.$id)?Dm(t,e):e,o=t;switch(t[Tt]){case"Array":return HRo(o,n,r);case"Constructor":return GRo(o,n,r);case"Import":return $Ro(o,n,r);case"Intersect":return VRo(o,n,r);case"Never":return WRo(o,n,r);case"Object":return zRo(o,n,r);case"Record":return YRo(o,n,r);case"Ref":return KRo(o,n,r);case"This":return JRo(o,n,r);case"Tuple":return ZRo(o,n,r);case"Union":return XRo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return qRo(t,e,r);default:return jRo(o,n,r)}}a(HP,"Visit");function eSe(...t){return t.length===3?HP(t[0],t[1],t[2]):HP(t[0],[],t[1])}a(eSe,"Cast");p();function ePo(t){return y9(t)&&t[Tt]!=="Unsafe"}a(ePo,"IsCheckable");function tPo(t,e,r){return wi(r)?r.map(n=>uC(t.items,e,n)):r}a(tPo,"FromArray");function rPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return uC(o,[...e,...n],r)}a(rPo,"FromImport");function nPo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>uC(l,e,Fa(r))).reduce((l,u)=>bo(u)?{...l,...u}:u,{});if(!bo(r)||!bo(s)||!y9(n))return s;let c=Hv(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||Wo(n,e,r[l])&&(s[l]=uC(n,e,r[l]));return s}a(nPo,"FromIntersect");function iPo(t,e,r){if(!bo(r)||wi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Ui(t.properties,o)){r[o]=uC(t.properties[o],e,r[o]);continue}if(y9(n)&&Wo(n,e,r[o])){r[o]=uC(n,e,r[o]);continue}delete r[o]}return r}a(iPo,"FromObject");function oPo(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]=uC(c,e,r[u]);continue}if(y9(n)&&Wo(n,e,r[u])){r[u]=uC(n,e,r[u]);continue}delete r[u]}return r}a(oPo,"FromRecord");function sPo(t,e,r){return uC(va(t,e),e,r)}a(sPo,"FromRef");function aPo(t,e,r){return uC(va(t,e),e,r)}a(aPo,"FromThis");function cPo(t,e,r){if(!wi(r))return r;if(ku(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(cPo,"FromTuple");function lPo(t,e,r){for(let n of t.anyOf)if(ePo(n)&&Wo(n,e,r))return uC(n,e,r);return r}a(lPo,"FromUnion");function uC(t,e,r){let n=Ea(t.$id)?Dm(t,e):e,o=t;switch(o[Tt]){case"Array":return tPo(o,n,r);case"Import":return rPo(o,n,r);case"Intersect":return nPo(o,n,r);case"Object":return iPo(o,n,r);case"Record":return oPo(o,n,r);case"Ref":return sPo(o,n,r);case"This":return aPo(o,n,r);case"Tuple":return cPo(o,n,r);case"Union":return lPo(o,n,r);default:return r}}a(uC,"Visit");function FHe(...t){return t.length===3?uC(t[0],t[1],t[2]):uC(t[0],[],t[1])}a(FHe,"Clean");p();function UHe(t){return Ea(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(UHe,"IsStringNumeric");function uPo(t){return Yg(t)||gN(t)||si(t)}a(uPo,"IsValueToString");function tSe(t){return t===!0||si(t)&&t===1||Yg(t)&&t===BigInt("1")||Ea(t)&&(t.toLowerCase()==="true"||t==="1")}a(tSe,"IsValueTrue");function rSe(t){return t===!1||si(t)&&(t===0||Object.is(t,-0))||Yg(t)&&t===BigInt("0")||Ea(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(rSe,"IsValueFalse");function dPo(t){return Ea(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(dPo,"IsTimeStringWithTimeZone");function fPo(t){return Ea(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(fPo,"IsTimeStringWithoutTimeZone");function pPo(t){return Ea(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(pPo,"IsDateTimeStringWithTimeZone");function hPo(t){return Ea(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(hPo,"IsDateTimeStringWithoutTimeZone");function mPo(t){return Ea(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(mPo,"IsDateString");function gPo(t,e){let r=Lsn(t);return r===e?r:t}a(gPo,"TryConvertLiteralString");function APo(t,e){let r=Fsn(t);return r===e?r:t}a(APo,"TryConvertLiteralNumber");function yPo(t,e){let r=Bsn(t);return r===e?r:t}a(yPo,"TryConvertLiteralBoolean");function EPo(t,e){return Ea(t.const)?gPo(e,t.const):si(t.const)?APo(e,t.const):gN(t.const)?yPo(e,t.const):e}a(EPo,"TryConvertLiteral");function Bsn(t){return tSe(t)?!0:rSe(t)?!1:t}a(Bsn,"TryConvertBoolean");function _Po(t){let e=a(r=>r.split(".")[0],"truncateInteger");return UHe(t)?BigInt(e(t)):si(t)?BigInt(Math.trunc(t)):rSe(t)?BigInt(0):tSe(t)?BigInt(1):t}a(_Po,"TryConvertBigInt");function Lsn(t){return AB(t)&&t.description!==void 0?t.description.toString():uPo(t)?t.toString():t}a(Lsn,"TryConvertString");function Fsn(t){return UHe(t)?parseFloat(t):tSe(t)?1:rSe(t)?0:t}a(Fsn,"TryConvertNumber");function vPo(t){return UHe(t)?parseInt(t):si(t)?Math.trunc(t):tSe(t)?1:rSe(t)?0:t}a(vPo,"TryConvertInteger");function CPo(t){return Ea(t)&&t.toLowerCase()==="null"?null:t}a(CPo,"TryConvertNull");function bPo(t){return Ea(t)&&t==="undefined"?void 0:t}a(bPo,"TryConvertUndefined");function SPo(t){return e_(t)?t:si(t)?new Date(t):tSe(t)?new Date(1):rSe(t)?new Date(0):UHe(t)?new Date(parseInt(t)):fPo(t)?new Date(`1970-01-01T${t}.000Z`):dPo(t)?new Date(`1970-01-01T${t}`):hPo(t)?new Date(`${t}.000Z`):pPo(t)?new Date(t):mPo(t)?new Date(`${t}T00:00:00.000Z`):t}a(SPo,"TryConvertDate");function TPo(t,e,r){return(wi(r)?r:[r]).map(o=>GP(t.items,e,o))}a(TPo,"FromArray");function IPo(t,e,r){return _Po(r)}a(IPo,"FromBigInt");function xPo(t,e,r){return Bsn(r)}a(xPo,"FromBoolean");function wPo(t,e,r){return SPo(r)}a(wPo,"FromDate");function RPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return GP(o,[...e,...n],r)}a(RPo,"FromImport");function PPo(t,e,r){return vPo(r)}a(PPo,"FromInteger");function kPo(t,e,r){return t.allOf.reduce((n,o)=>GP(o,e,n),r)}a(kPo,"FromIntersect");function DPo(t,e,r){return EPo(t,r)}a(DPo,"FromLiteral");function NPo(t,e,r){return CPo(r)}a(NPo,"FromNull");function MPo(t,e,r){return Fsn(r)}a(MPo,"FromNumber");function OPo(t,e,r){if(!bo(r)||wi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Ui(r,n)&&(r[n]=GP(t.properties[n],e,r[n]));return r}a(OPo,"FromObject");function BPo(t,e,r){if(!(bo(r)&&!wi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=GP(s,e,l);return r}a(BPo,"FromRecord");function LPo(t,e,r){return GP(va(t,e),e,r)}a(LPo,"FromRef");function FPo(t,e,r){return Lsn(r)}a(FPo,"FromString");function UPo(t,e,r){return Ea(r)||si(r)?Symbol(r):r}a(UPo,"FromSymbol");function QPo(t,e,r){return GP(va(t,e),e,r)}a(QPo,"FromThis");function qPo(t,e,r){return wi(r)&&!ku(t.items)?r.map((o,s)=>s{let c=A_(s,e,n);return bo(c)?{...o,...c}:c},{})}a(WPo,"FromIntersect");function zPo(t,e,r){let n=wL(t,r);if(!bo(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=A_(t.properties[s],e,n[s]);ku(c)||(n[s]=A_(t.properties[s],e,n[s]))}if(!pLt(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=A_(t.additionalProperties,e,n[s]));return n}a(zPo,"FromObject");function YPo(t,e,r){let n=wL(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)&&pLt(c)&&(n[u]=A_(c,e,n[u]));if(!pLt(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=A_(o,e,n[u]));return n}a(YPo,"FromRecord");function KPo(t,e,r){return A_(va(t,e),e,wL(t,r))}a(KPo,"FromRef");function JPo(t,e,r){return A_(va(t,e),e,r)}a(JPo,"FromThis");function ZPo(t,e,r){let n=wL(t,r);if(!wi(n)||ku(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;ctko,Format:()=>nSe,Get:()=>nko,Has:()=>rko,Set:()=>eko,ValuePointerRootDeleteError:()=>HHe,ValuePointerRootSetError:()=>jHe});p();var jHe=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}},HHe=class extends Qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Qsn(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Qsn,"Escape");function*nSe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nkz(t[o],e[o]))}a(iko,"ObjectType");function oko(t,e){return e_(e)&&t.getTime()===e.getTime()}a(oko,"DateType");function sko(t,e){return!wi(e)||t.length!==e.length?!1:t.every((r,n)=>kz(r,e[n]))}a(sko,"ArrayType");function ako(t,e){return!AI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>kz(r,e[n]))}a(ako,"TypedArrayType");function cko(t,e){return t===e}a(cko,"ValueType");function kz(t,e){if(e_(t))return oko(t,e);if(AI(t))return ako(t,e);if(wi(t))return sko(t,e);if(bo(t))return iko(t,e);if(g1(t))return cko(t,e);throw new Error("ValueEquals: Unable to compare value")}a(kz,"Equal");var lko=Za({type:ta("insert"),path:r_(),value:cP()}),uko=Za({type:ta("update"),path:r_(),value:cP()}),dko=Za({type:ta("delete"),path:r_()}),jsn=Ja([lko,uko,dko]),GHe=class extends Qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function $He(t,e){return{type:"update",path:t,value:e}}a($He,"CreateUpdate");function Hsn(t,e){return{type:"insert",path:t,value:e}}a(Hsn,"CreateInsert");function Gsn(t){return{type:"delete",path:t}}a(Gsn,"CreateDelete");function qsn(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new GHe(t,"Cannot diff objects with symbols")}a(qsn,"AssertDiffable");function*fko(t,e,r){if(qsn(e),qsn(r),!uwt(r))return yield $He(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Ui(e,s)||(yield Hsn(`${t}/${s}`,r[s]));for(let s of n)Ui(r,s)&&(kz(e,r)||(yield*VHe(`${t}/${s}`,e[s],r[s])));for(let s of n)Ui(r,s)||(yield Gsn(`${t}/${s}`))}a(fko,"ObjectType");function*pko(t,e,r){if(!wi(r))return yield $He(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(gko,"IsRootUpdate");function Ako(t){return t.length===0}a(Ako,"IsIdentity");function Vsn(t,e){if(gko(e))return Fa(e[0].value);if(Ako(e))return Fa(t);let r=Fa(t);for(let n of e)switch(n.type){case"insert":{$P.Set(r,n.path,n.value);break}case"update":{$P.Set(r,n.path,n.value);break}case"delete":{$P.Delete(r,n.path);break}}return r}a(Vsn,"Patch");p();function Wsn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=IB(e,r)?Rie(e,r,n):n;if(!Wo(e,r,o))throw new wie(e,o,EN(e,r,o).First());return o}a(Wsn,"Encode");p();function WHe(t){return bo(t)&&!wi(t)}a(WHe,"IsStandardObject");var zHe=class extends Qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function yko(t,e,r,n){if(!WHe(r))$P.Set(t,e,Fa(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)hLt(t,`${e}/${c}`,r[c],n[c])}}a(yko,"ObjectType");function Eko(t,e,r,n){if(!wi(r))$P.Set(t,e,Fa(n));else{for(let o=0;o(BHe(s,c,l),l)],["Cast",(s,c,l)=>eSe(s,c,l)],["Clean",(s,c,l)=>FHe(s,c,l)],["Clone",(s,c,l)=>Fa(l)],["Convert",(s,c,l)=>QHe(s,c,l)],["Decode",(s,c,l)=>IB(s,c)?xie(s,c,l):l],["Default",(s,c,l)=>qHe(s,c,l)],["Encode",(s,c,l)=>IB(s,c)?Rie(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})(mLt||(mLt={}));var Ksn=["Clone","Clean","Default","Convert","Assert","Decode"];function bko(t,e,r,n){return t.reduce((o,s)=>{let c=mLt.Get(s);if(ku(c))throw new YHe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(bko,"ParseValue");function Jsn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?wi(t[0])?[t[0],t[1],[],t[2]]:[Ksn,t[0],t[1],t[2]]:t.length===2?[Ksn,t[0],[],t[1]]:(()=>{throw new YHe("Invalid Arguments")})();return bko(e,r,n,o)}a(Jsn,"Parse");p();var _M={};xi(_M,{Assert:()=>BHe,Cast:()=>eSe,Check:()=>Wo,Clean:()=>FHe,Clone:()=>Fa,Convert:()=>QHe,Create:()=>jP,Decode:()=>Usn,Default:()=>qHe,Diff:()=>$sn,Edit:()=>jsn,Encode:()=>Wsn,Equal:()=>kz,Errors:()=>EN,Hash:()=>I9,Mutate:()=>Ysn,Parse:()=>Jsn,Patch:()=>Vsn,ValueErrorIterator:()=>x9});p();var Sko="gpt-41-copilot",lx=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&ys(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 Sko}parseModelsResponse(e){try{return _M.Parse(fsn,e)}catch(r){Dr.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 Pz(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Dr.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=hsn(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Dr.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=Gt(this._ctx,Je.DebugOverrideEngine)||Gt(this._ctx,Je.DebugOverrideEngineLegacy);if(o)return new Dz(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 Dz(s,"exp"):new Dz(n,"modelpicker"):s?new Dz(s,"exp"):new Dz(r,"default")}},Dz=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function m7(t,e=void 0){let r=t.get(lx),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(m7,"getEngineRequestInfo");p();p();var Bo=class{static{a(this,"FileSystem")}};var man=he(han());function gan(t){return t!==void 0&&t!==0}a(gan,"isRepoInfo");function Aan(t){if(t===void 0||t===0)return"";let e=Nz(t);if(e==="github/github")return e;let r=Kko(t)?.toLowerCase();return r!==void 0?r:""}a(Aan,"getDogFood");function Nz(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(Nz,"tryGetGitHubNWO");function Kko(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(Kko,"tryGetADONWO");function g7(t,e){let r=Xd(e);return Jko(t,r)}a(g7,"extractRepoInfoInBackground");var Jko=t2o(Zko,1e4);async function Zko(t,e){let r=yVr(e);if(!r)return;let n=await Xko(t,r);if(!n)return;let o=t.get(Bo),s=Sa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=e2o(c)??"",u=ELt(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(Zko,"extractRepoInfo");function ELt(t){let e;try{if(e=(0,man.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(ELt,"parseRepoUrl");async function Xko(t,e){let r=e+"_add_to_make_longer",n=t.get(Bo);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 yLt(d)),n.delete(c)}),0}}a(t2o,"computeInBackgroundAndMemoize");p();var iSe=500,yan=8192-iSe,Ean=4,KHe=10,_an=1e3*5,JHe={prefix:35,suffix:15,stableContext:35,volatileContext:15},r2o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function oSe(t){return t=t.toLowerCase(),r2o[t]??t}a(oSe,"normalizeLanguageId");var _Lt=class{constructor(e){this.ctx=e;this.cache=new yn(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 vLt(()=>this.ctx.get(NP).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()}},vLt=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 n2o(t){return"uri"in t}a(n2o,"isCompletionsFiltersInfo");var Jt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new _Lt(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 xI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&n2o(r)?g7(this.ctx,r.uri):void 0,s=Nz(o)??"",c=Aan(o)??"",l=r?.languageId??"",u=m7(this.ctx).modelId,d=pVr(e),f=e.getTokenValue("ft")??"",h=e.getTokenValue("ol")??"",m=e.getTokenValue("tid")??"",A=this.ctx.get(Nf).getProperties(),y=e.endpoints,E={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-CustomModel":f,"X-Copilot-Orgs":h,"X-Copilot-CopilotTrackingId":m,"X-GitHub-Copilot-SKU":A.sku||""},_=this.getGranularityDirectory(),v=this.makeFilterSettings(E),b=_.extendFilters(v),T=await this.getExpConfig(b.newFilterSettings,y);_.update(v,+(T.variables.copilotbycallbuckets??NaN),+(T.variables.copilottimeperiodsizeinh??NaN));let w=_.extendFilters(v),R=w.newFilterSettings,x=await this.getExpConfig(R,y),P=new Promise(D=>setTimeout(D,t.upcomingDynamicFilterCheckDelayMs));for(let D of w.otherFilterSettingsToPrefetch)P=P.then(async()=>{await new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(D,y)});return this.prepareForUpcomingFilters(R,y),new xI(n.properties,n.measurements,n.issuedTime,{filters:R,exp:x})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Ut).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(Oa).machineId;this.granularityDirectory=new mQe(e,this.ctx.get(rM))}return this.granularityDirectory}makeFilterSettings(e){return new fB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return Yv.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 fB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=kB(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??JHe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??KHe}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??yan+iSe}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??_an}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??JHe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??JHe.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}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 ZHe(t){let e=Gt(t,Je.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(ZHe,"isSearchAgentEnabled");function van(t,e){let r=Gt(t,Je.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Jt).ideEnableCopilotNesNonFreeEnabled(e)}a(van,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var XHe=he(Qae());var bLt={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 lS(t){return t in bLt&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(lS,"isSupportedLanguageId");function eGe(t){if(!(t in bLt))throw new Error(`Unrecognized language: ${t}`);return bLt[t]}a(eGe,"languageIdToWasmLanguage");var CLt=new Map;async function i2o(t){let e;try{e=await Lae(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new Bae(`Could not load tree-sitter-${t}.wasm`,r):r}return XHe.default.Language.load(e)}a(i2o,"loadWasmLanguage");function TLt(t){let e=eGe(t);if(!CLt.has(e)){let r=i2o(e);CLt.set(e,r)}return CLt.get(e)}a(TLt,"getLanguage");var SLt=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function A7(t,e){return(await ILt(t,e))[0]}a(A7,"parseTreeSitter");async function ILt(t,e){await XHe.default.init({locateFile:a(s=>ZBt(s),"locateFile")});let r;try{r=new XHe.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 SLt(`Could not init Parse for language <${t}>`,s):s}let n=await TLt(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(ILt,"parseTreeSitterIncludingVersion");function Can(t){switch(eGe(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(Can,"getBlockCloseToken");function o2o(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(o2o,"innerQuery");var s2o=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function Icn(t){return wDo([RDo],t).length==1}a(Icn,"queryPythonIsDocstring");var kM=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 ban(t){return o2o([s2o],t).length==1}a(ban,"queryPythonIsDocstring");var vM=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}}},$m=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 oce.languageIds.has(e)||sce.languageIds.has(e)||PSe.languageIds.has(e)||ace.languageIds.has(e)||DSe.languageIds.has(e)||NSe.languageIds.has(e)||MSe.languageIds.has(e)||OSe.languageIds.has(e)||BSe.languageIds.has(e)}static isTrimmedByDefault(e){return oce.languageIds.has(e)||sce.languageIds.has(e)||ace.languageIds.has(e)}static create(e,r,n,o){if(oce.languageIds.has(e))return new oce(e,r,n,o);if(sce.languageIds.has(e))return new sce(e,r,n,o);if(PSe.languageIds.has(e))return new PSe(e,r,n,o);if(ace.languageIds.has(e))return new ace(e,r,n,o);if(MSe.languageIds.has(e))return new MSe(e,r,n,o);if(DSe.languageIds.has(e))return new DSe(e,r,n,o);if(NSe.languageIds.has(e))return new NSe(e,r,n,o);if(OSe.languageIds.has(e))return new OSe(e,r,n,o);if(BSe.languageIds.has(e))return new BSe(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 k7(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}}},$m=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 qae.languageIds.has(e)||jae.languageIds.has(e)||sSe.languageIds.has(e)||Hae.languageIds.has(e)||aSe.languageIds.has(e)||cSe.languageIds.has(e)||lSe.languageIds.has(e)||uSe.languageIds.has(e)||dSe.languageIds.has(e)}static isTrimmedByDefault(e){return qae.languageIds.has(e)||jae.languageIds.has(e)||Hae.languageIds.has(e)}static create(e,r,n,o){if(qae.languageIds.has(e))return new qae(e,r,n,o);if(jae.languageIds.has(e))return new jae(e,r,n,o);if(sSe.languageIds.has(e))return new sSe(e,r,n,o);if(Hae.languageIds.has(e))return new Hae(e,r,n,o);if(lSe.languageIds.has(e))return new lSe(e,r,n,o);if(aSe.languageIds.has(e))return new aSe(e,r,n,o);if(cSe.languageIds.has(e))return new cSe(e,r,n,o);if(uSe.languageIds.has(e))return new uSe(e,r,n,o);if(dSe.languageIds.has(e))return new dSe(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 A7(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(` -`)}},wGe=class t extends kM{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"}},oce=class extends $m{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new wGe(e)}getStatementQueryText(){return`[ +`)}},tGe=class t extends vM{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"}},qae=class extends $m{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new tGe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1805,7 +1761,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (field_definition) - ] @statement`}},sce=class extends $m{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new wGe(e)}getStatementQueryText(){return`[ + ] @statement`}},jae=class extends $m{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new tGe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1828,7 +1784,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},l3t=class t extends kM{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}},PSe=class extends $m{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new l3t(e)}getStatementQueryText(){return`[ + ] @statement`}},xLt=class t extends vM{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}},sSe=class extends $m{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new xLt(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -1854,24 +1810,24 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (decorated_definition) (match_statement) (block) - ] @statement`}},u3t=class t extends kM{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)}},ace=class extends $m{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new u3t(e)}getStatementQueryText(){return`[ + ] @statement`}},wLt=class t extends vM{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)}},Hae=class extends $m{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new wLt(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},d3t=class t extends kM{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)}},DSe=class extends $m{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new d3t(e)}getStatementQueryText(){return`[ + ] @statement`}},RLt=class t extends vM{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)}},aSe=class extends $m{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new RLt(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},f3t=class t extends kM{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)}},NSe=class extends $m{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new f3t(e)}getStatementQueryText(){return`[ + ] @statement`}},PLt=class t extends vM{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)}},cSe=class extends $m{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new PLt(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},p3t=class t extends kM{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"}},MSe=class extends $m{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new p3t(e)}getStatementQueryText(){return`[ + ] @statement`}},kLt=class t extends vM{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"}},lSe=class extends $m{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new kLt(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -1884,7 +1840,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (block) (static_initializer) (constructor_declaration) - ] @statement`}},h3t=class t extends kM{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"}},OSe=class extends $m{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new h3t(e)}getStatementQueryText(){return`[ + ] @statement`}},DLt=class t extends vM{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"}},uSe=class extends $m{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new DLt(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -1896,7 +1852,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (declaration) (accessor_declaration) (block) - ] @statement`}},m3t=class t extends kM{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)}},BSe=class extends $m{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new m3t(e)}getStatementQueryText(){return`[ + ] @statement`}},NLt=class t extends vM{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)}},dSe=class extends $m{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new NLt(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -1933,11 +1889,11 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}};var PM=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return $m.isSupported(e)}static isTrimmedByDefault(e){return $m.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=swt(n,$m.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{awt(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 RGe=class extends PM{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.endIndexQDo,build:()=>LDo,buildType:()=>FDo,default:()=>VDo,dependencies:()=>HDo,description:()=>ODo,devDependencies:()=>jDo,displayName:()=>MDo,engines:()=>UDo,name:()=>NDo,overrides:()=>GDo,overridesComments:()=>$Do,scripts:()=>qDo,version:()=>BDo});var NDo="copilot",MDo="GitHub Copilot",ODo="Your AI pair programmer",BDo="1.503.0",LDo="28",FDo="prod",UDo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},QDo={cliPackageVersion:"2.1.159"},qDo={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}" --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"},jDo={"@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.120.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.2",esbuild:"^0.28.0","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.6.0","js-yaml":"^4.1.0",mocha:"^11.2.2","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.39.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.2.0",tsx:"^4.22.3",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},HDo={"@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.56","@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","@microsoft/tiktokenizer":"^1.0.10","@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.51.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.3.7","@vscode/prompt-tsx":"^0.4.0-alpha.8","@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",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.2.0",microjob:"^0.7.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.1",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.26.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"},GDo={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"},$Do={"//":"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'."},VDo={name:NDo,displayName:MDo,description:ODo,version:BDo,build:LDo,buildType:FDo,engines:UDo,anthropicClaude:QDo,scripts:qDo,devDependencies:jDo,dependencies:HDo,overrides:GDo,overridesComments:$Do};var je={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",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",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",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function kcn(t){return["server","parsingandserver"].includes(t)}a(kcn,"shouldDoServerTrimming");var eP=class{static{a(this,"BlockModeConfig")}},cce=class extends eP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Jt).overrideBlockMode(n);if(o)return g3t(o,r);let s=e.get(Jt).enableProgressiveReveal(n);return(qt(e,je.AlwaysRequestMultiline)??s)||PM.isTrimmedByDefault(r)?g3t("moremultiline",r):r=="ruby"?"parsing":AS(r)?"parsingandserver":"server"}};function WDo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(WDo,"blockModeRequiresTreeSitter");function g3t(t,e){return t==="moremultiline"&&$m.isSupported(e)?t:WDo(t)&&!AS(e)?"server":t}a(g3t,"toApplicableBlockMode");var Zo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},lce=class extends Zo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return zDo(r)}getOptionalConfig(r){return YDo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},Jz=class extends Zo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new no;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new no;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=LSe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[je.ShowEditorCompletions,je.EnableAutoCompletions,je.DelayCompletions,je.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Pcn(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(Pcn,"getConfigKeyRecursively");function zDo(t){if(kGe.has(t))return kGe.get(t);throw new Error(`Missing config default value: ${cwt}.${t}`)}a(zDo,"getConfigDefaultForKey");function YDo(t){return kGe.get(t)}a(YDo,"getOptionalConfigDefaultForKey");function uce(t){return t.get(Zo).getExplicitlySetConfigs()}a(uce,"getExplicitlySetConfigs");var KDo={[je.DebugOverrideCppHeadersEnableSwitch]:!1,[je.RelatedFilesVSCodeCSharp]:!1,[je.RelatedFilesVSCodeTypeScript]:!1,[je.RelatedFilesVSCode]:!1,[je.IncludeNeighboringFiles]:!1,[je.ExcludeRelatedFiles]:!1,[je.ContextProviders]:[],[je.DebugUseEditorFetcher]:null,[je.DebugUseElectronFetcher]:null,[je.DebugOverrideLogLevels]:{},[je.DebugSnippyOverrideUrl]:"",[je.AgentDebugLogsDirectory]:void 0,[je.ClaudeCliPath]:void 0,[je.FetchStrategy]:"auto",[je.ToolConfirmAutoApprove]:!1,[je.AutoApproveUnmatchedTerminal]:void 0,[je.AutoApproveUnmatchedFileOp]:void 0,[je.TrustToolAnnotations]:!1,[je.AutoApproveYoloMode]:!1,[je.EditorHandlesAllConfirmation]:!1,[je.MaxToolCallingLoop]:25,[je.AutoCompress]:!1,[je.AnthropicThinkingBudgetToken]:1024,[je.EnableSkills]:!1,[je.EnableHooks]:!1,[je.EnableCustomAgents]:!0,[je.EnableOrgCustomAgents]:!0,[je.UseAgentsMd]:!1,[je.UseNestedAgentsMd]:!1,[je.UseClaudeMd]:!1,[je.UseNestedClaudeMd]:!1,[je.UseSubsetMatching]:null,[je.ContextProviderTimeBudget]:void 0,[je.DebugOverrideCapiUrl]:"",[je.DebugTestOverrideCapiUrl]:"",[je.DebugOverrideProxyUrl]:"",[je.DebugTestOverrideProxyUrl]:"",[je.DebugOverrideEngine]:"",[je.AlwaysRequestMultiline]:void 0,[je.ModelAlwaysTerminatesSingleline]:void 0,[je.TrimCompletionsAggressively]:void 0,[je.CompletionsDebounce]:void 0,[je.NESXTab]:void 0,[je.UseWorkspaceContextCoordinator]:void 0,[je.ShowWorkspaceContextDebugger]:!1,[je.CompletionsDelay]:void 0,[je.UseSplitContextPrompt]:void 0,[je.UseCompletionsComparisonPanel]:void 0,[je.ComparisonPanelModelIds]:void 0,[je.ComparisonPanelRandomizedMode]:void 0,[je.UseFetchFetcher]:void 0,[je.UseChatLibCompletions]:void 0,[je.TranscriptDirectory]:void 0,[je.EnableThinking]:!0,[je.ShowEditorCompletions]:void 0,[je.EnableAutoCompletions]:void 0,[je.DelayCompletions]:void 0,[je.FilterCompletions]:void 0,[je.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[je.UserSelectedCompletionModel]:"",[je.DebugFilterLogCategories]:[],[je.DebugOverrideEngineLegacy]:"",[je.DebugTestOverrideProxyUrlLegacy]:"",[je.DebugOverrideProxyUrlLegacy]:"",[je.DebugTestOverrideCapiUrlLegacy]:"",[je.DebugOverrideCapiUrlLegacy]:"",[je.HookErrorOccurredStackTrace]:!1,[je.NESUseExplicitRejection]:!1,[je.AppendPromptTokenCache]:"",[je.PromptPersistBasePath]:void 0,[je.AnthropicMessagesEndpoint]:"",[je.EnableCopilotNesNonFree]:"",[je.UseHelixFetcher]:"",[je.EnableMapCodeFallback]:"enabled",[je.SearchAgent]:"",[je.PerfEnabled]:"",[je.NESExtendedRange]:!1,[je.TransparentTokenRefresh]:"",[je.DisableWorkspaceIndex]:""},kGe=new Map(Object.entries(KDo));for(let t of Object.values(je))if(!kGe.has(t))throw new Error(`Missing config default value ${cwt}.${t}`);function qt(t,e){return t.get(Zo).getConfig(e)}a(qt,"getConfig");function jL(t){return qt(t,je.DisableWorkspaceIndex)==="true"}a(jL,"isWorkspaceIndexDisabled");function pWr(t){return t.get(Zo).dumpForTelemetry()}a(pWr,"dumpForTelemetry");var ss=class{constructor(){this.packageJson=FSe}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 hPt(t){return t.get(ss).isProduction()}a(hPt,"isProduction");function CZr(t){return t.get(ss).getBuildType()==="dev"}a(CZr,"isDevBuild");function J9(t){return t.get(ss).getBuildType()}a(J9,"getBuildType");function hWr(t){return t.get(ss).getBuild()}a(hWr,"getBuild");function N1(t){return t.get(ss).getVersion()}a(N1,"getVersion");var Fa=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 C1({name:t,version:e}){return`${t}/${e}`}a(C1,"formatNameAndVersion");var Lr=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return f9r({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}};function by(t){let e=t.get(Lr);return{"Editor-Version":C1(e.getEditorInfo()),"Editor-Plugin-Version":C1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":N1(t)}}a(by,"editorVersionHeaders");var Dcn="Iv1.b507a08c87ecfe98",JDo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Vse="Ov23liV9UpD7Rnfnskm3",ZDo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",XDo={[Dcn]:JDo,[Vse]:ZDo},Bp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Dcn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=XDo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};var ar=class{static{a(this,"Fetcher")}getImplementation(){return this}};function P7(t,e,r,n,o,s,c,l,u,d,f,h){let m={...l,Authorization:`Bearer ${r}`,...by(t)};d===void 0&&(m["Openai-Organization"]="github-copilot",m["X-Request-Id"]=o,m["VScode-SessionId"]=t.get(Fa).sessionId,m["VScode-MachineId"]=t.get(Fa).machineId,m["X-GitHub-Api-Version"]="2026-01-09"),n&&(m["OpenAI-Intent"]=n);let g={method:"POST",headers:m,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:m,messages:h,body:s});let A=t.get(ar);if(c){let E=new AbortController;c.onCancellationRequested(()=>{ht(t,"networking.cancelRequest",jt.createAndMarkAsIssued({headerRequestId:o})),E.abort()}),g.signal=E.signal}return A.fetch(e,g).catch(E=>{if(eNo(E))return ht(t,"networking.disconnectAll"),A.disconnectAll().then(()=>A.fetch(e,g));throw E})}a(P7,"postRequest");function eNo(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(eNo,"isInterruptedNetworkError");var tNo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function rNo(t){return tNo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(rNo,"isOomError");function D7(t,e,r,n=Dr){if(!P0(e)){if(e instanceof Error){let o=e;rNo(o)?t.get(as).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(as).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(as).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(as).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(as).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(D7,"handleException");function Ncn(t){process.addListener("uncaughtException",r=>{D7(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,D7(t,r,"unhandledRejection")}finally{e=!1}})}a(Ncn,"registerDefaultHandlers");async function Mcn(t){try{await SSe}catch(e){D7(t,e,"initializeTokenizers")}}a(Mcn,"waitForTokenizers");p();p();p();var HL={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 Ocn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],Bcn={".php":[".blade"]},N7=Object.keys(HL).flatMap(t=>HL[t].extensions);var A3t=ce(require("node:path"));var fce=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},USe=class{static{a(this,"LanguageDetection")}},y3t=new Map,dce=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(HL)){for(let n of e)y3t.set(n,[...y3t.get(n)??[],t]);for(let n of r??[])dce.set(n,[...dce.get(n)??[],t])}var E3t=class extends USe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=ji(e.uri),n=A3t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new fce(s.languageId,s.isGuess,c):new fce(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(Ocn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=A3t.extname(n).toLowerCase();if(o.length>0&&N7.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=Bcn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(dce.has(e))return{languageId:dce.get(e)[0],isGuess:!1};let n=y3t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),dce.has(e))return{languageId:dce.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},_3t=class extends USe{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 fce("cpp",n.isGuess,n.fileExtension):n}},C3t=class extends USe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new fce(r.languageId,!0,""):this.delegate.detectLanguage(r)}},nNo=new _3t(new C3t(new E3t));function DM({uri:t,languageId:e}){let r=nNo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(DM,"detectLanguage");p();p();p();p();function Nh(t){if(t.isCancellationRequested)throw new PGe}a(Nh,"throwIfCancellationRequested");function tP(t){return t instanceof PGe?!0:t instanceof Error&&t.name===v3t&&t.message===v3t}a(tP,"isCancellationError");var PGe=class extends Error{static{a(this,"CancellationError")}constructor(){super(v3t),this.name=this.message}},v3t="Canceled",DGe=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 Zz(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(Zz,"isTypeDefinition");var cu=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=Fcn(e,e.length,o),Lcn(n,r);o0}};var rGe=class extends CM{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.endIndexA2o,build:()=>h2o,buildType:()=>m2o,default:()=>b2o,dependencies:()=>_2o,description:()=>f2o,devDependencies:()=>E2o,displayName:()=>d2o,engines:()=>g2o,name:()=>u2o,overrides:()=>v2o,overridesComments:()=>C2o,scripts:()=>y2o,version:()=>p2o});var u2o="copilot",d2o="GitHub Copilot",f2o="Your AI pair programmer",p2o="1.504.0",h2o="31",m2o="prod",g2o={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},A2o={cliPackageVersion:"2.1.159"},y2o={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}" --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"},E2o={"@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.120.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.2",esbuild:"^0.28.0","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.6.0","js-yaml":"^4.2.0",mocha:"^11.2.2","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.39.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.2.0",tsx:"^4.22.3",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},_2o={"@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.56","@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","@microsoft/tiktokenizer":"^1.0.10","@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.51.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.3.7","@vscode/prompt-tsx":"^0.4.0-alpha.8","@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",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.2.0",microjob:"^0.7.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.1",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.26.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"},v2o={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"},C2o={"//":"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'."},b2o={name:u2o,displayName:d2o,description:f2o,version:p2o,build:h2o,buildType:m2o,engines:g2o,anthropicClaude:A2o,scripts:y2o,devDependencies:E2o,dependencies:_2o,overrides:v2o,overridesComments:C2o};var Je={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",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",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",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function xan(t){return["server","parsingandserver"].includes(t)}a(xan,"shouldDoServerTrimming");var WP=class{static{a(this,"BlockModeConfig")}},Gae=class extends WP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Jt).overrideBlockMode(n);if(o)return MLt(o,r);let s=e.get(Jt).enableProgressiveReveal(n);return(Gt(e,Je.AlwaysRequestMultiline)??s)||CM.isTrimmedByDefault(r)?MLt("moremultiline",r):r=="ruby"?"parsing":lS(r)?"parsingandserver":"server"}};function S2o(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(S2o,"blockModeRequiresTreeSitter");function MLt(t,e){return t==="moremultiline"&&$m.isSupported(e)?t:S2o(t)&&!lS(e)?"server":t}a(MLt,"toApplicableBlockMode");var zo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},$ae=class extends zo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return T2o(r)}getOptionalConfig(r){return I2o(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},Mz=class extends zo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new ro;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new ro;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=fSe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Je.ShowEditorCompletions,Je.EnableAutoCompletions,Je.DelayCompletions,Je.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function wan(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(wan,"getConfigKeyRecursively");function T2o(t){if(nGe.has(t))return nGe.get(t);throw new Error(`Missing config default value: ${Ixt}.${t}`)}a(T2o,"getConfigDefaultForKey");function I2o(t){return nGe.get(t)}a(I2o,"getOptionalConfigDefaultForKey");function Vae(t){return t.get(zo).getExplicitlySetConfigs()}a(Vae,"getExplicitlySetConfigs");var x2o={[Je.DebugOverrideCppHeadersEnableSwitch]:!1,[Je.RelatedFilesVSCodeCSharp]:!1,[Je.RelatedFilesVSCodeTypeScript]:!1,[Je.RelatedFilesVSCode]:!1,[Je.IncludeNeighboringFiles]:!1,[Je.ExcludeRelatedFiles]:!1,[Je.ContextProviders]:[],[Je.DebugUseEditorFetcher]:null,[Je.DebugUseElectronFetcher]:null,[Je.DebugOverrideLogLevels]:{},[Je.DebugSnippyOverrideUrl]:"",[Je.AgentDebugLogsDirectory]:void 0,[Je.ClaudeCliPath]:void 0,[Je.FetchStrategy]:"auto",[Je.ToolConfirmAutoApprove]:!1,[Je.AutoApproveUnmatchedTerminal]:void 0,[Je.AutoApproveUnmatchedFileOp]:void 0,[Je.TrustToolAnnotations]:!1,[Je.AutoApproveYoloMode]:!1,[Je.EditorHandlesAllConfirmation]:!1,[Je.MaxToolCallingLoop]:25,[Je.AutoCompress]:!1,[Je.AnthropicThinkingBudgetToken]:1024,[Je.EnableSkills]:!1,[Je.EnableHooks]:!1,[Je.EnableCustomAgents]:!0,[Je.EnableOrgCustomAgents]:!0,[Je.UseAgentsMd]:!1,[Je.UseNestedAgentsMd]:!1,[Je.UseClaudeMd]:!1,[Je.UseNestedClaudeMd]:!1,[Je.UseSubsetMatching]:null,[Je.ContextProviderTimeBudget]:void 0,[Je.DebugOverrideCapiUrl]:"",[Je.DebugTestOverrideCapiUrl]:"",[Je.DebugOverrideProxyUrl]:"",[Je.DebugTestOverrideProxyUrl]:"",[Je.DebugOverrideEngine]:"",[Je.AlwaysRequestMultiline]:void 0,[Je.ModelAlwaysTerminatesSingleline]:void 0,[Je.TrimCompletionsAggressively]:void 0,[Je.CompletionsDebounce]:void 0,[Je.NESXTab]:void 0,[Je.UseWorkspaceContextCoordinator]:void 0,[Je.ShowWorkspaceContextDebugger]:!1,[Je.CompletionsDelay]:void 0,[Je.UseSplitContextPrompt]:void 0,[Je.UseCompletionsComparisonPanel]:void 0,[Je.ComparisonPanelModelIds]:void 0,[Je.ComparisonPanelRandomizedMode]:void 0,[Je.UseFetchFetcher]:void 0,[Je.UseChatLibCompletions]:void 0,[Je.TranscriptDirectory]:void 0,[Je.EnableThinking]:!0,[Je.ShowEditorCompletions]:void 0,[Je.EnableAutoCompletions]:void 0,[Je.DelayCompletions]:void 0,[Je.FilterCompletions]:void 0,[Je.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Je.UserSelectedCompletionModel]:"",[Je.DebugFilterLogCategories]:[],[Je.DebugOverrideEngineLegacy]:"",[Je.DebugTestOverrideProxyUrlLegacy]:"",[Je.DebugOverrideProxyUrlLegacy]:"",[Je.DebugTestOverrideCapiUrlLegacy]:"",[Je.DebugOverrideCapiUrlLegacy]:"",[Je.HookErrorOccurredStackTrace]:!1,[Je.NESUseExplicitRejection]:!1,[Je.AppendPromptTokenCache]:"",[Je.PromptPersistBasePath]:void 0,[Je.AnthropicMessagesEndpoint]:"",[Je.EnableCopilotNesNonFree]:"",[Je.UseHelixFetcher]:"",[Je.EnableMapCodeFallback]:"enabled",[Je.SearchAgent]:"",[Je.PerfEnabled]:"",[Je.NESExtendedRange]:!1,[Je.TransparentTokenRefresh]:"",[Je.DisableWorkspaceIndex]:""},nGe=new Map(Object.entries(x2o));for(let t of Object.values(Je))if(!nGe.has(t))throw new Error(`Missing config default value ${Ixt}.${t}`);function Gt(t,e){return t.get(zo).getConfig(e)}a(Gt,"getConfig");function RL(t){return Gt(t,Je.DisableWorkspaceIndex)==="true"}a(RL,"isWorkspaceIndexDisabled");function lVr(t){return t.get(zo).dumpForTelemetry()}a(lVr,"dumpForTelemetry");var is=class{constructor(){this.packageJson=pSe}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 DPt(t){return t.get(is).isProduction()}a(DPt,"isProduction");function AJr(t){return t.get(is).getBuildType()==="dev"}a(AJr,"isDevBuild");function L9(t){return t.get(is).getBuildType()}a(L9,"getBuildType");function uVr(t){return t.get(is).getBuild()}a(uVr,"getBuild");function T1(t){return t.get(is).getVersion()}a(T1,"getVersion");var Oa=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 p1({name:t,version:e}){return`${t}/${e}`}a(p1,"formatNameAndVersion");var Lr=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return c6r({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}};function wy(t){let e=t.get(Lr);return{"Editor-Version":p1(e.getEditorInfo()),"Editor-Plugin-Version":p1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":T1(t)}}a(wy,"editorVersionHeaders");var Ran="Iv1.b507a08c87ecfe98",w2o="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",wse="Ov23liV9UpD7Rnfnskm3",R2o="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",P2o={[Ran]:w2o,[wse]:R2o},Lp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Ran}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=P2o[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};var fr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function Oz(t,e,r,n,o,s,c,l,u,d,f,h){let m={...l,Authorization:`Bearer ${r}`,...wy(t)};d===void 0&&(m["Openai-Organization"]="github-copilot",m["X-Request-Id"]=o,m["VScode-SessionId"]=t.get(Oa).sessionId,m["VScode-MachineId"]=t.get(Oa).machineId,m["X-GitHub-Api-Version"]="2026-01-09"),n&&(m["OpenAI-Intent"]=n);let g={method:"POST",headers:m,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:m,messages:h,body:s});let A=t.get(fr);if(c){let E=new AbortController;c.onCancellationRequested(()=>{yt(t,"networking.cancelRequest",Vt.createAndMarkAsIssued({headerRequestId:o})),E.abort()}),g.signal=E.signal}return A.fetch(e,g).catch(E=>{if(k2o(E))return yt(t,"networking.disconnectAll"),A.disconnectAll().then(()=>A.fetch(e,g));throw E})}a(Oz,"postRequest");function k2o(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(k2o,"isInterruptedNetworkError");var D2o=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function N2o(t){return D2o.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(N2o,"isOomError");function y7(t,e,r,n=Dr){if(!k0(e)){if(e instanceof Error){let o=e;N2o(o)?t.get(os).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(os).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(os).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(os).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(os).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(y7,"handleException");function Pan(t){process.addListener("uncaughtException",r=>{y7(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,y7(t,r,"unhandledRejection")}finally{e=!1}})}a(Pan,"registerDefaultHandlers");async function kan(t){try{await X1e}catch(e){y7(t,e,"initializeTokenizers")}}a(kan,"waitForTokenizers");p();p();p();var PL={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 Dan=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],Nan={".php":[".blade"]},E7=Object.keys(PL).flatMap(t=>PL[t].extensions);var OLt=he(require("node:path"));var zae=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},hSe=class{static{a(this,"LanguageDetection")}},BLt=new Map,Wae=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(PL)){for(let n of e)BLt.set(n,[...BLt.get(n)??[],t]);for(let n of r??[])Wae.set(n,[...Wae.get(n)??[],t])}var LLt=class extends hSe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ki(e.uri),n=OLt.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new zae(s.languageId,s.isGuess,c):new zae(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(Dan.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=OLt.extname(n).toLowerCase();if(o.length>0&&E7.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=Nan[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Wae.has(e))return{languageId:Wae.get(e)[0],isGuess:!1};let n=BLt.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}},FLt=class extends hSe{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 zae("cpp",n.isGuess,n.fileExtension):n}},ULt=class extends hSe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new zae(r.languageId,!0,""):this.delegate.detectLanguage(r)}},M2o=new FLt(new ULt(new LLt));function bM({uri:t,languageId:e}){let r=M2o.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(bM,"detectLanguage");p();p();p();p();function Mh(t){if(t.isCancellationRequested)throw new iGe}a(Mh,"throwIfCancellationRequested");function zP(t){return t instanceof iGe?!0:t instanceof Error&&t.name===QLt&&t.message===QLt}a(zP,"isCancellationError");var iGe=class extends Error{static{a(this,"CancellationError")}constructor(){super(QLt),this.name=this.message}},QLt="Canceled",oGe=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 Bz(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(Bz,"isTypeDefinition");var ou=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=Oan(e,e.length,o),Man(n,r);o0||u>0||d>0||f>0?new gx(r,"","",cu.fromBounds(s,c),cu.fromBounds(d,f),cu.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 NGe=class extends Mh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,iNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},MGe=class extends Mh{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,sNo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,aNo),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}},OGe=class extends Mh{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,oNo),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 cu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new cu(f,h-f),g=new cu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=cu.empty,y=cu.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]:[]}},iNo=` +`),o=Oan(e,e.length,++o),Man(n,r)):o++;return n.join("")}};function Man(t,e){for(let r=0;r0||u>0||d>0||f>0?new ux(r,"","",ou.fromBounds(s,c),ou.fromBounds(d,f),ou.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 ux(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 sGe=class extends Oh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,O2o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},aGe=class extends Oh{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,L2o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,F2o),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}},cGe=class extends Oh{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,B2o),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 ou(l.node.startIndex,l.node.endIndex-l.node.startIndex):new ou(f,h-f),g=new ou(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=ou.empty,y=ou.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new ux(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},O2o=` ( ((comment)* @comment) . @@ -1973,7 +1929,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la . (field_declaration name: (_) @name) @definition.field ) -`,oNo=` +`,B2o=` (import_declaration (import_spec name: (package_identifier)? @alias @@ -1984,15 +1940,15 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (import_spec name: (package_identifier)? @alias path: (interpreted_string_literal) @import.name))+) @import -`,sNo=` +`,L2o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`,aNo=` +`,F2o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`;p();var LGe=class extends Mh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,cNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},FGe=class extends Mh{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,uNo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,dNo),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}},UGe=class extends Mh{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,lNo)).filter(o=>o.kind===0)}},cNo=` +`;p();var uGe=class extends Oh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,U2o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},dGe=class extends Oh{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,q2o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,j2o),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}},fGe=class extends Oh{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,Q2o)).filter(o=>o.kind===0)}},U2o=` ( [ (block_comment) @comment @@ -2055,7 +2011,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la . (enum_constant name: (identifier) @name) @definition.enum_variant ) -`,lNo=` +`,Q2o=` ( [ ((line_comment)* @comment) @@ -2067,19 +2023,19 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (asterisk)? @wildcard ) @definition.class ) -`,uNo=` +`,q2o=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`,dNo=` +`,j2o=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`;p();var fNo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),QGe=class extends Mh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,pNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},qGe=class extends Mh{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,hNo)).filter(o=>!fNo.has(o.unqualifiedName))}};var pNo=` +`;p();var H2o=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),pGe=class extends Oh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,G2o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hGe=class extends Oh{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,$2o)).filter(o=>!H2o.has(o.unqualifiedName))}};var G2o=` ( ((comment)* @comment) . @@ -2089,9 +2045,9 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name value: (_) @body))) @definition.function ] ) -`,hNo=` +`,$2o=` (call_expression function: (_) @name) @reference -`;p();var mNo=new Set(["int","str","float","bool","list","dict","tuple","set"]),jGe=class extends Mh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,gNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},HGe=class extends Mh{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,ANo)).filter(o=>!mNo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,ENo),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}},GGe=class extends Mh{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,yNo),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 cu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new cu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new cu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=cu.empty,A=cu.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]:[]}},gNo=` +`;p();var V2o=new Set(["int","str","float","bool","list","dict","tuple","set"]),mGe=class extends Oh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,W2o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},gGe=class extends Oh{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,z2o)).filter(o=>!V2o.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,K2o),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}},AGe=class extends Oh{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,Y2o),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 ou(l.node.startIndex,l.node.endIndex-l.node.startIndex):new ou(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new ou(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=ou.empty,A=ou.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new ux(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},W2o=` ( ((comment)* @comment) . @@ -2103,7 +2059,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la . (function_definition name: (_) @name body: (_) @body) @definition.method ) -`,ANo=` +`,z2o=` (call function: (_) @name) @reference (type [ @@ -2112,7 +2068,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`,yNo=` +`,Y2o=` (import_statement name: (dotted_name) @import.module) @import (import_from_statement @@ -2127,7 +2083,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (aliased_import name: ((dotted_name) @import.name) alias: (identifier) @alias)) @import -`,ENo=` +`,K2o=` (call function: (_) @name) @reference (type [ @@ -2136,7 +2092,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`;p();var _No=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),pce=class extends Mh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,CNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hce=class extends Mh{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,vNo)).filter(o=>!_No.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var CNo=` +`;p();var J2o=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),Yae=class extends Oh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,Z2o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},Kae=class extends Oh{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,X2o)).filter(o=>!J2o.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var Z2o=` ( ((comment)* @comment) . @@ -2161,13 +2117,13 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (variable_declarator name: (identifier) @name type: (type_annotation (type_identifier))) ] ) -`,vNo=` +`,X2o=` (call_expression function: (_) @name) @reference (type_identifier) @name @reference (new_expression constructor: (identifier) @name) @reference -`;p();var bNo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),$Ge=class extends pce{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,SNo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},VGe=class extends hce{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,TNo),super.extractReferences(e,r)]);return[...n.filter(s=>!bNo.has(s.unqualifiedName)),...o]}},SNo=` +`;p();var eDo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),yGe=class extends Yae{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,tDo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},EGe=class extends Kae{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,rDo),super.extractReferences(e,r)]);return[...n.filter(s=>!eDo.has(s.unqualifiedName)),...o]}},tDo=` ( ((comment)* @comment) . @@ -2180,58 +2136,58 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la body: (_) @body))) @definition.function ] ) -`,TNo=` +`,rDo=` (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 QSe=[{symbolExtractor:new LGe,referenceExtractor:new FGe,importExtractor:new UGe,languageId:"java"},{symbolExtractor:new NGe,referenceExtractor:new MGe,importExtractor:new OGe,languageId:"go"},{symbolExtractor:new jGe,referenceExtractor:new HGe,importExtractor:new GGe,languageId:"python"},{symbolExtractor:new pce,referenceExtractor:new hce,languageId:"typescript"},{symbolExtractor:new $Ge,referenceExtractor:new VGe,languageId:"typescriptreact"},{symbolExtractor:new QGe,referenceExtractor:new qGe,languageId:"javascript"}];function Ucn(t){let e=DM({uri:t});if(e&&QSe.some(r=>e===r.languageId))return e}a(Ucn,"getSupportedLanguageIdForMultiLanguageProvider");var Qcn=new Map(QSe.map(t=>[t.languageId,t.referenceExtractor])),qcn=new Map(QSe.map(t=>[t.languageId,t.symbolExtractor])),jcn=new Map(QSe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),b3t=QSe.map(t=>HL[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function S3t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(S3t,"virtualNode");function Hcn(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(Hcn,"lineNode");function T3t(t){return{type:"blank",lineNumber:t,subs:[]}}a(T3t,"blankNode");function WGe(t){return{type:"top",indentation:-1,subs:t??[]}}a(WGe,"topNode");function cA(t){return t.type==="blank"}a(cA,"isBlank");function Xz(t){return t.type==="line"}a(Xz,"isLine");function eY(t){return t.type==="virtual"}a(eY,"isVirtual");p();function Gcn(t,e){return Oy(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(Gcn,"clearLabelsIf");function tY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>tY(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=>tY(r,e)),label:t.label?e(t.label):void 0}}}a(tY,"mapLabels");function Oy(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(Oy,"visitTree");function I3t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),Oy(t,s,n),o}a(I3t,"foldTree");function zGe(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:WGe()}a(zGe,"rebuildTree");p();function xNo(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[Hcn(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"),Oy(t,r,"bottomUp")}a(qSe,"labelLines");function YGe(t){function e(r){if(eY(r)&&r.label===void 0){let n=r.subs.filter(o=>!cA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),Oy(t,e,"bottomUp")}a(YGe,"labelVirtualInherited");function jSe(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(jSe,"buildLabelRules");function x3t(t){let r=zGe(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&&(Xz(l)||eY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&cA(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?[S3t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),cA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return Gcn(t,n=>n==="newVirtual"),r}a(x3t,"combineClosersAndOpeners");function $cn(t,e=cA,r){return zGe(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=S3t(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)!cA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(Wcn,"processJava");p();var DNo={heading:/^# /,subheading:/^## /,subsubheading:/### /},NNo=jSe(DNo);function zcn(t){let e=t;if(qSe(e,NNo),cA(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||cA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=$cn(e),e=rY(e),YGe(e),e}a(zcn,"processMarkdown");p();function Ycn(t){return" ".repeat(t.indentation)+t.sourceLine+` -`}a(Ycn,"deparseLine");w3t("markdown",zcn);w3t("java",Wcn);var MNo={worthUp:.9,worthSibling:.88,worthDown:.8};function R3t(t,e,r=Ss(),n=MNo){let o=tY(t,s=>s?1:void 0);return Oy(o,s=>{if(cA(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"),Oy(o,s=>{if(cA(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"),ONo(o,e,r)}a(R3t,"fromTreeWithFocussedLines");function ONo(t,e,r=Ss()){let n=I3t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[Ycn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(ONo,"fromTreeWithValuedLines");function yS(t,e=!0,r=!0,n,o=Ss()){let s=typeof t=="string"?nY(t):nY(t.source,t.languageId);rY(s);let c=tY(s,l=>e&&l!=="closer");return Oy(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&Oy(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&&Oy(c,l=>{l.label||=(Xz(l)||cA(l))&&l.lineNumber==0},"topDown"),R3t(c,n,o)}a(yS,"elidableTextForSourceCode");p();var HSe=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=>Ss().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=Ss()){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 HSe(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&&yS(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=>Ss().tokenLength(r+` +`;var mSe=[{symbolExtractor:new uGe,referenceExtractor:new dGe,importExtractor:new fGe,languageId:"java"},{symbolExtractor:new sGe,referenceExtractor:new aGe,importExtractor:new cGe,languageId:"go"},{symbolExtractor:new mGe,referenceExtractor:new gGe,importExtractor:new AGe,languageId:"python"},{symbolExtractor:new Yae,referenceExtractor:new Kae,languageId:"typescript"},{symbolExtractor:new yGe,referenceExtractor:new EGe,languageId:"typescriptreact"},{symbolExtractor:new pGe,referenceExtractor:new hGe,languageId:"javascript"}];function Ban(t){let e=bM({uri:t});if(e&&mSe.some(r=>e===r.languageId))return e}a(Ban,"getSupportedLanguageIdForMultiLanguageProvider");var Lan=new Map(mSe.map(t=>[t.languageId,t.referenceExtractor])),Fan=new Map(mSe.map(t=>[t.languageId,t.symbolExtractor])),Uan=new Map(mSe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),qLt=mSe.map(t=>PL[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function jLt(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(jLt,"virtualNode");function Qan(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(Qan,"lineNode");function HLt(t){return{type:"blank",lineNumber:t,subs:[]}}a(HLt,"blankNode");function _Ge(t){return{type:"top",indentation:-1,subs:t??[]}}a(_Ge,"topNode");function dA(t){return t.type==="blank"}a(dA,"isBlank");function Lz(t){return t.type==="line"}a(Lz,"isLine");function Fz(t){return t.type==="virtual"}a(Fz,"isVirtual");p();function qan(t,e){return Uy(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(qan,"clearLabelsIf");function Uz(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>Uz(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=>Uz(r,e)),label:t.label?e(t.label):void 0}}}a(Uz,"mapLabels");function Uy(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(Uy,"visitTree");function GLt(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),Uy(t,s,n),o}a(GLt,"foldTree");function vGe(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:_Ge()}a(vGe,"rebuildTree");p();function iDo(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[Qan(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"),Uy(t,r,"bottomUp")}a(gSe,"labelLines");function CGe(t){function e(r){if(Fz(r)&&r.label===void 0){let n=r.subs.filter(o=>!dA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),Uy(t,e,"bottomUp")}a(CGe,"labelVirtualInherited");function ASe(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(ASe,"buildLabelRules");function $Lt(t){let r=vGe(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&&(Lz(l)||Fz(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&dA(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?[jLt(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),dA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return qan(t,n=>n==="newVirtual"),r}a($Lt,"combineClosersAndOpeners");function jan(t,e=dA,r){return vGe(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=jLt(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)!dA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(Gan,"processJava");p();var lDo={heading:/^# /,subheading:/^## /,subsubheading:/### /},uDo=ASe(lDo);function $an(t){let e=t;if(gSe(e,uDo),dA(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||dA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=jan(e),e=Qz(e),CGe(e),e}a($an,"processMarkdown");p();function Van(t){return" ".repeat(t.indentation)+t.sourceLine+` +`}a(Van,"deparseLine");VLt("markdown",$an);VLt("java",Gan);var dDo={worthUp:.9,worthSibling:.88,worthDown:.8};function WLt(t,e,r=Ds(),n=dDo){let o=Uz(t,s=>s?1:void 0);return Uy(o,s=>{if(dA(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"),Uy(o,s=>{if(dA(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"),fDo(o,e,r)}a(WLt,"fromTreeWithFocussedLines");function fDo(t,e,r=Ds()){let n=GLt(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[Van(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(fDo,"fromTreeWithValuedLines");function uS(t,e=!0,r=!0,n,o=Ds()){let s=typeof t=="string"?qz(t):qz(t.source,t.languageId);Qz(s);let c=Uz(s,l=>e&&l!=="closer");return Uy(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&Uy(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&&Uy(c,l=>{l.label||=(Lz(l)||dA(l))&&l.lineNumber==0},"topDown"),WLt(c,n,o)}a(uS,"elidableTextForSourceCode");p();var ySe=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=>Ds().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=Ds()){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 ySe(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&&uS(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=>Ds().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}=LNo(this.lines,o);if(u<=e)return k3t(l);FNo(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?UNo(l,m):"",y=Kcn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];KGe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return k3t([Kcn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)KGe(h[m],r)&&KGe(h[m-1],r)&&h.splice(m,1);return k3t(h)}};function BNo(t){return t?.text.match(/^\s*/)?.[0]??""}a(BNo,"getIndentation");function KGe(t,e){return t?.text.trim()===e.trim()}a(KGe,"isEllipsis");function k3t(t){return{getText:a(()=>t.map(e=>e.text).join(` -`),"getText"),getLines:a(()=>t,"getLines")}}a(k3t,"produceElidedText");function LNo(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(LNo,"initializeElisionContext");function FNo(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(FNo,"sortPriorityQueue");function UNo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=BNo(o);break}}return r}a(UNo,"getClosestIndentation");function Kcn(t,e,r,n){let o=t+e;return new HSe(o,1/0,r.tokenLength(o+` -`),"loose",n?.metadata)}a(Kcn,"getNewEllipsis");p();var Jcn=require("fs");async function Zcn(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;Nh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await QNo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(Zcn,"symbolRangesToCodeSnippets");async function QNo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=ho(e);o&&(n=(await Jcn.promises.readFile(o)).toString())}catch{}for(let o of t)Xcn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(QNo,"sameFileSymbolRangeToElidableText");function Xcn(t,e){let n=[],o=t.node,s=e.substring(P3t(e,o.commentRange.start),o.commentRange.end);n.push([D3t(s),1-3e-4]);let c=P3t(e,o.bodyRange.start),l=P3t(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(Zz(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([D3t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Xcn(d,e));else{let d=1-(Zz(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([D3t(f),d])}return Zz(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Xcn,"prepareForElidableText");function P3t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(P3t,"shiftLeftToNearestLineEndingOrAlphanumeric");function D3t(t){let e=0;for(;ee)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=hDo(this.lines,o);if(u<=e)return zLt(l);mDo(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?gDo(l,m):"",y=Wan(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];bGe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return zLt([Wan("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)bGe(h[m],r)&&bGe(h[m-1],r)&&h.splice(m,1);return zLt(h)}};function pDo(t){return t?.text.match(/^\s*/)?.[0]??""}a(pDo,"getIndentation");function bGe(t,e){return t?.text.trim()===e.trim()}a(bGe,"isEllipsis");function zLt(t){return{getText:a(()=>t.map(e=>e.text).join(` +`),"getText"),getLines:a(()=>t,"getLines")}}a(zLt,"produceElidedText");function hDo(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(hDo,"initializeElisionContext");function mDo(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(mDo,"sortPriorityQueue");function gDo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=pDo(o);break}}return r}a(gDo,"getClosestIndentation");function Wan(t,e,r,n){let o=t+e;return new ySe(o,1/0,r.tokenLength(o+` +`),"loose",n?.metadata)}a(Wan,"getNewEllipsis");p();var zan=require("fs");async function Yan(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;Mh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await ADo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(Yan,"symbolRangesToCodeSnippets");async function ADo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=Yo(e);o&&(n=(await zan.promises.readFile(o)).toString())}catch{}for(let o of t)Kan(o,n).forEach(s=>r.push(s));return new Ar(r)}a(ADo,"sameFileSymbolRangeToElidableText");function Kan(t,e){let n=[],o=t.node,s=e.substring(YLt(e,o.commentRange.start),o.commentRange.end);n.push([KLt(s),1-3e-4]);let c=YLt(e,o.bodyRange.start),l=YLt(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(Bz(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([KLt(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Kan(d,e));else{let d=1-(Bz(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([KLt(f),d])}return Bz(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Kan,"prepareForElidableText");function YLt(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(YLt,"shiftLeftToNearestLineEndingOrAlphanumeric");function KLt(t){let e=0;for(;e=0&&(t[r]==="\r"||t[r]===` -`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(D3t,"trimLineEndingsAndTrailingWhitespace");var N3t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},M7=class extends N3t{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[];Nh(c);let u=await l.extractReferences(e,r);Nh(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=>Zz(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(Nh(r),Zz(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}},JGe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new M7(e,r,!0,!0)),this.strategies.set("java",new M7(e,r,!0,!0)),this.strategies.set("python",new M7(e,r,!0,!1)),this.strategies.set("typescript",new M7(e,r,!0,!0)),this.strategies.set("typescriptreact",new M7(e,r,!0,!0)),this.strategies.set("javascript",new M7(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);Nh(l);let d=Ss();return Zcn(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 iY={Id:"id"},ES={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},la={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 ZGe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new M3t(iY.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(KLt,"trimLineEndingsAndTrailingWhitespace");var JLt=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},_7=class extends JLt{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[];Mh(c);let u=await l.extractReferences(e,r);Mh(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=>Bz(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(Mh(r),Bz(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}},SGe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new _7(e,r,!0,!0)),this.strategies.set("java",new _7(e,r,!0,!0)),this.strategies.set("python",new _7(e,r,!0,!1)),this.strategies.set("typescript",new _7(e,r,!0,!0)),this.strategies.set("typescriptreact",new _7(e,r,!0,!0)),this.strategies.set("javascript",new _7(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);Mh(l);let d=Ds();return Yan(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 jz={Id:"id"},dS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},oa={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 TGe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new ZLt(jz.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(", ")})`}}},GSe=class t extends ZGe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${ES.FilePath}');`]);this.fields=[new WSe(ES.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new gv(ES.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},$Se=class t extends ZGe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${la.DocumentId}', '${la.ExtentStart}', '${la.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${la.UnqualifiedName}');`],`FOREIGN KEY(${la.DocumentId}) REFERENCES Document(${iY.Id}) ON DELETE CASCADE`);this.fields=[new gv(la.DocumentId),new WSe(la.FullyQualifiedName,{notNull:!0}),new WSe(la.UnqualifiedName,{notNull:!0}),new gv(la.CommentStart,{notNull:!0}),new gv(la.CommentLength,{notNull:!0}),new gv(la.NameStart,{notNull:!0}),new gv(la.NameLength,{notNull:!0}),new gv(la.BodyStart,{notNull:!0}),new gv(la.BodyLength,{notNull:!0}),new gv(la.ExtentStart,{notNull:!0}),new gv(la.ExtentLength,{notNull:!0}),new gv(la.SymbolKind,{notNull:!0}),new gv(la.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},VSe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},WSe=class extends VSe{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}`}},gv=class extends VSe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},M3t=class extends VSe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var XGe=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?t$e(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&e$e(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${iY.Id} = ?`,[e])}},GL=class t extends XGe{static{a(this,"DocumentTable")}static{this.tableName=GSe.tableName}createQueryGenerator(){return new GSe}async updateTimestamp(e,r){let n=await this.init;n&&e$e(n,`UPDATE ${t.tableName} SET ${ES.LastWriteTimeUtc} = ? WHERE ${ES.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&e$e(r,`DELETE FROM ${t.tableName} WHERE ${ES.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?t$e(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${ES.FilePath} = ?`,[e]):[]}},Oh=class t extends XGe{static{a(this,"SymbolTable")}static{this.tableName=$Se.tableName}createQueryGenerator(){return new $Se}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&e$e(r,`DELETE FROM ${t.tableName} WHERE ${la.DocumentId} = ?`,[e])}};function t$e(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(t$e,"runDBQuery");function e$e(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(e$e,"runDBCommand");var eln=ce(require("node:sqlite"));var r$e=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${GL.tableName} ON ${Oh.tableName}.${la.DocumentId} = ${GL.tableName}.${iY.Id}`;this.db=this.initDb(e),this.documentTable=new GL(this.db),this.symbolTable=new Oh(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new eln.default.DatabaseSync(e,{open:!0});return r.exec(` +VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},ESe=class t extends TGe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${dS.FilePath}');`]);this.fields=[new CSe(dS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new fC(dS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},_Se=class t extends TGe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${oa.DocumentId}', '${oa.ExtentStart}', '${oa.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${oa.UnqualifiedName}');`],`FOREIGN KEY(${oa.DocumentId}) REFERENCES Document(${jz.Id}) ON DELETE CASCADE`);this.fields=[new fC(oa.DocumentId),new CSe(oa.FullyQualifiedName,{notNull:!0}),new CSe(oa.UnqualifiedName,{notNull:!0}),new fC(oa.CommentStart,{notNull:!0}),new fC(oa.CommentLength,{notNull:!0}),new fC(oa.NameStart,{notNull:!0}),new fC(oa.NameLength,{notNull:!0}),new fC(oa.BodyStart,{notNull:!0}),new fC(oa.BodyLength,{notNull:!0}),new fC(oa.ExtentStart,{notNull:!0}),new fC(oa.ExtentLength,{notNull:!0}),new fC(oa.SymbolKind,{notNull:!0}),new fC(oa.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},vSe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},CSe=class extends vSe{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}`}},fC=class extends vSe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},ZLt=class extends vSe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var IGe=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?wGe(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&xGe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${jz.Id} = ?`,[e])}},kL=class t extends IGe{static{a(this,"DocumentTable")}static{this.tableName=ESe.tableName}createQueryGenerator(){return new ESe}async updateTimestamp(e,r){let n=await this.init;n&&xGe(n,`UPDATE ${t.tableName} SET ${dS.LastWriteTimeUtc} = ? WHERE ${dS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&xGe(r,`DELETE FROM ${t.tableName} WHERE ${dS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?wGe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${dS.FilePath} = ?`,[e]):[]}},Bh=class t extends IGe{static{a(this,"SymbolTable")}static{this.tableName=_Se.tableName}createQueryGenerator(){return new _Se}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&xGe(r,`DELETE FROM ${t.tableName} WHERE ${oa.DocumentId} = ?`,[e])}};function wGe(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(wGe,"runDBQuery");function xGe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(xGe,"runDBCommand");var Jan=he(require("node:sqlite"));var RGe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${kL.tableName} ON ${Bh.tableName}.${oa.DocumentId} = ${kL.tableName}.${jz.Id}`;this.db=this.initDb(e),this.documentTable=new kL(this.db),this.symbolTable=new Bh(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new Jan.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 ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${la.UnqualifiedName} BETWEEN ? AND (? || '~')`,`ORDER BY ${la.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 ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${la.UnqualifiedName} ${o}IN (${n})`].join(` -`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${la.FullyQualifiedName} = ?`].join(` -`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${GL.tableName}.${ES.FilePath} = ? AND ${Oh.tableName}.${la.ExtentStart} <= ? AND (${Oh.tableName}.${la.ExtentStart} + ${Oh.tableName}.${la.ExtentLength}) >= ?`].join(` -`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${GL.tableName}.${ES.FilePath} = ? AND ${Oh.tableName}.${la.ExtentStart} >= ? AND (${Oh.tableName}.${la.ExtentStart} + ${Oh.tableName}.${la.ExtentLength}) <= ?`,`ORDER BY ${Oh.tableName}.${la.ExtentStart}`].join(` -`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${GL.tableName}.${ES.FilePath} = ? AND ${Oh.tableName}.${la.FullyQualifiedName} LIKE ?`,`ORDER BY ${Oh.tableName}.${la.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,t$e(n,e,r)):[]}};var n$e=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new r$e(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 mce(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 cu(e.commentStart,e.commentLength),new cu(e.nameStart,e.nameLength),new cu(e.bodyStart,e.bodyLength),new cu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(mce,"symbolsToSymbolRanges");var o$e=ce(require("fs/promises"));var i$e=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new n$e(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=ho(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await o$e.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 o$e.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 O3t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>qNo(r))}a(O3t,"isIndexWorkerData");var zSe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},O7=class extends zSe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},s$e=class extends zSe{constructor(r){super(By.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},By={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},a$e=class extends O7{constructor(r,n,o){super(r,By.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},c$e=class extends O7{constructor(r,n){super(r,By.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},l$e=class extends O7{constructor(r,n,o){super(r,By.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},u$e=class extends O7{constructor(r,n){super(r,By.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},d$e=class extends O7{constructor(r,n,o,s,c,l){super(r,By.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},f$e=class extends O7{static{a(this,"ExitRequest")}constructor(e){super(e,By.Exit)}},rP=class extends zSe{constructor(r,n,o){super(By.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 qNo(t){return"databaseFilePath"in t&&"rootPath"in t}a(qNo,"isIndexableWorkspaceFolder");var tln=ce(ti()),B7=require("worker_threads");var p$e=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new i$e(e,qcn,jcn,r),this.contextRetreival=new JGe(this.index.reader,Qcn)}},B3t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=Wn(o.rootPath);this.indices.set(s,new p$e(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 tln.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case By.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case By.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case By.Cancel:n.get(e.id)?.cancel(),s=new rP(e.id,void 0,void 0);break;case By.Exit:s=await this.dispatchExit(e,r,o.token);break;case By.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case By.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case By.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 rP(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=Wn(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 rP(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=Wn(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 rP(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=Wn(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 rP(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 rP(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=Wn(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new p$e(e.databaseFilePath)),new rP(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=Wn(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new rP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function rln(){return O3t(B7.workerData)}a(rln,"isIndexWorker");function nln(){let t=B7.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!O3t(B7.workerData))throw new Error("Worker data must provide a valid database path.");let e=B7.workerData.cwd;process.cwd=()=>e,new B3t(t,B7.workerData.indexWorkspaceRoots,B7.workerData.params)}a(nln,"runIndexWorker");p();p();var YSe=require("fs"),iln=require("path");var L7=class extends Fo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await YSe.promises.readFile(Wn(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(Wn(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=Wn(e),n=await YSe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,iln.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await YSe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await YSe.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 jNo(t){if(t.isCancellationRequested)return;let e=new rA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(jNo,"cancellationTokenToPromise");async function oln(t,e){if(e){let r=jNo(e);await Promise.race([t,r])}else await t}a(oln,"raceCancellation");function L3t(t){return Array.isArray(t)}a(L3t,"isArrayOfT");async function sln(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await F3t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(sln,"resolveAll");async function F3t(t,e){let r;return t instanceof Promise?r=await HNo(t,e):r=await GNo(t,e),r}a(F3t,"resolve");async function HNo(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:L3t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await oln(o,e),n.resolutionTime=performance.now()-r,n}a(HNo,"resolvePromise");async function GNo(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 oln(o,e),n.resolutionTime=performance.now()-r,n}a(GNo,"resolveIterable");p();p();var h$e="[...]",$No=0,Av=-1;function uf(){return $No++}a(uf,"getAvailableNodeId");function VNo(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(VNo,"elideChildren");function aln(t,e=h$e){return r=>t.tokenLength(VNo(r,e))}a(aln,"getTokenizerCostFunction");p();var U7=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 WNo(t){let e={id:t.id??uf(),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??h$e,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(WNo,"createRenderNode");function zNo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(zNo,"isRenderedChildRequired");function cln(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(cln,"rectifiedValue");function KSe(t,e){let r=lln(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(KSe,"rectifyWeights");function lln(t,e){let r=t.children.map(s=>lln(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 U7([]);let n=new U7(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(lln,"recursivelyRectifyWeights");function uln(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(Q3t(t,m,h,g),m.length===0)return U3t(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 U7([{item:t,priority:cln(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,cln(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(Q3t(t,h,m,g),h.length===0)return U3t(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 U3t(t,o)}a(uln,"render");function U3t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(U3t,"renderEmpty");function Q3t(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=zNo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=Q3t(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(Q3t,"recursivelyRender");function JSe(t,e,r=h$e){let n=t.children.map(c=>JSe(c,e,r));r=t.elisionMarker??r;let o=e(t);return WNo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(JSe,"snapshot");var Q7={id:uf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var nP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var g$e={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function YNo(t,e,r=g$e,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=xa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(YNo,"getDirectoryChildren");function KNo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=tf(e);for(;o.startsWith(r);){n.push(o);let s=tf(o);if(s.length>=o.length)break;o=s}return n}a(KNo,"getAncestors");function JNo(t,e,r=g$e.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=KNo(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(JNo,"getAncestorWeights");async function*q3t(t,e,r,n,o,s){let c={...g$e,...r},l=c.MaxResults,u=c.Decay,d=JNo(t,e,u),f=new U7([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await YNo(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(q3t,"getNearbyDocuments");var m$e=class extends nP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=g$e;this.cache=new sk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of q3t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function G0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(G0,"setDefault");var ZNo={MaxActiveSymbols:500,SymbolCacheSize:1e6},A$e=class extends nP{constructor(){super(...arguments);this.config=ZNo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new nn(this.config.SymbolCacheSize);this.textSymbols=new nn(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=G0(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 j3t(l)){let d=G0(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())G0(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&&dln(o))}},XNo=/^[a-zA-Z_]{2,}\w+$/;function dln(t){return XNo.test(t)}a(dln,"isSymbol");function eMo(t){return t.toLowerCase()}a(eMo,"normalizeWord");function*j3t(t){for(let e of t.split(/\W/))dln(e)&&(yield eMo(e))}a(j3t,"getTextSymbols");var tMo={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},y$e=class extends A$e{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=tMo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new sk(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 j3t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=G0(this.textSymbols,l,()=>this.createSymbol(!1));G0(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 q3t(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 fln(t){return t.nodeId!==void 0}a(fln,"isNodeLocation");var pln={"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}},E$e=class extends nP{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=pln[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)fln(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(fln(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:Av});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=pln[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};G0(this.eventsByType,r,()=>new nn(s.maxEventCount)).set(++this.nextId,c)}};p();var _$e=class extends nP{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)??Av,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 rMo(t){return t.id!==void 0}a(rMo,"isNodeItem");function nMo(t){return!("uri"in t)&&!("id"in t)}a(nMo,"isNullItem");var hln={"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 mln(t){return t in hln}a(mln,"isSourceId");var q7="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",gce=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!==Av),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}},C$e=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=hln;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new gce([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new gce(r.items):new gce([])}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(Av);if(l!==void 0&&l>0){s.delete(Av);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 gce(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(nMo(r))return{weight:r.weight,uri:q7,id:Av};let n=rMo(r)?r.id:Av,o=r.uri??this.activeContext.getUri(n)??q7;return o===q7&&(n=Av),{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=G0(r,s,()=>new Map),d=Av;(!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!==q7?this.activeContext.normalizeUri(u)??q7:q7;for(let[h,m]of d.entries())u===q7||h===Av?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(q7),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:Av,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 H3t=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*gln(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=oMo(e,this.document),o=new H3t(uf(),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;miMo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function oMo(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(oMo,"buildText");function*gln(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*gln(r,e))}a(gln,"walk");p();p();p();var b$e=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 G3t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:G3t(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=G3t(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 b$e(uf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(G3t,"recursivelyBuildNode");function Aln(t){let e=nY(t.getText(),t.detectedLanguageId);return G3t(e,t.lineCount,t)??new b$e(uf(),e,[],0,t.lineCount-1,t)}a(Aln,"parse");var S$e={source:"indentation",parse:Aln,update(t,e){return{root:Aln(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var Eln=ce(ice());function yln(t){return{line:t.row,character:t.column}}a(yln,"asPosition");var NM=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)}},j7=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 Eln.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return S$e.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:yln(e.startPosition),end:yln(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var sMo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),aMo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),cMo=new Set(["identifier"]),lMo=new Set(["string","comment"]),_ln=new NM(sMo,aMo,cMo,lMo);p();var uMo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),dMo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),fMo=new Set(["identifier"]),pMo=new Set(["string_literal","line_comment","block_comment"]),Cln=new NM(uMo,dMo,fMo,pMo);p();var hMo=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),mMo=new Set(["module","block","parameters","dictionary","list"]),gMo=new Set(["identifier"]),AMo=new Set(["string","comment"]),vln=new NM(hMo,mMo,gMo,AMo);p();var yMo=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),EMo=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),_Mo=new Set(["identifier"]),CMo=new Set(["string","comment"]),bln=new NM(yMo,EMo,_Mo,CMo);var Sln=ce(ice());async function Tln(t){await Sln.default.init();try{let e=await a3t(t);switch(t){case"python":return new j7(e,"tree-sitter-python",vln);case"typescript":return new j7(e,"tree-sitter-typescript",bln);case"java":return new j7(e,"tree-sitter-java",Cln);case"cpp":return new j7(e,"tree-sitter-cpp",_ln);default:return new j7(e,"tree-sitter-generic")}}catch{return S$e}}a(Tln,"getParser");var $3t=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}))}},T$e=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},Iln=500,I$e=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 nn(Iln);this.allowedExtensions=new Set(N7);this.invalidDocumentCache=new sk(Iln,this.config.InvalidCacheTime),this.cachedDocuments=new o6e(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=>HL[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(P9e(e),r=ca(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(SWr(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 $3t(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 T$e(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new rA;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 T$e(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 v$e(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=G0(this.createdNodes,e,()=>new Set),o=G0(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 Tln(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 vMo="WorkspaceContextWorker";function V3t(t){let e=t;return e?.workerId===vMo&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(V3t,"isContextWorkerData");var bMo=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function xln(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return bMo.includes(e)?e:void 0}a(xln,"getContextMessageType");var H7=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();z3t();p();var Dln;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(Dln||(Dln={}));var Y3t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(Y3t||(Y3t={}));var Nln;(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})(Nln||(Nln={}));var w$e;(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})(w$e||(w$e={}));var Ly;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=w$e.MAX_VALUE),o===Number.MAX_VALUE&&(o=w$e.MAX_VALUE),{line:n,character:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&dt.uinteger(o.line)&&dt.uinteger(o.character)}a(r,"is"),t.is=r})(Ly||(Ly={}));var lu;(function(t){function e(n,o,s,c){if(dt.uinteger(n)&&dt.uinteger(o)&&dt.uinteger(s)&&dt.uinteger(c))return{start:Ly.create(n,o),end:Ly.create(s,c)};if(Ly.is(n)&&Ly.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 dt.objectLiteral(o)&&Ly.is(o.start)&&Ly.is(o.end)}a(r,"is"),t.is=r})(lu||(lu={}));var R$e;(function(t){function e(n,o){return{uri:n,range:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&lu.is(o.range)&&(dt.string(o.uri)||dt.undefined(o.uri))}a(r,"is"),t.is=r})(R$e||(R$e={}));var Mln;(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 dt.objectLiteral(o)&&lu.is(o.targetRange)&&dt.string(o.targetUri)&&lu.is(o.targetSelectionRange)&&(lu.is(o.originSelectionRange)||dt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(Mln||(Mln={}));var K3t;(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 dt.objectLiteral(o)&&dt.numberRange(o.red,0,1)&&dt.numberRange(o.green,0,1)&&dt.numberRange(o.blue,0,1)&&dt.numberRange(o.alpha,0,1)}a(r,"is"),t.is=r})(K3t||(K3t={}));var Oln;(function(t){function e(n,o){return{range:n,color:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&lu.is(o.range)&&K3t.is(o.color)}a(r,"is"),t.is=r})(Oln||(Oln={}));var Bln;(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 dt.objectLiteral(o)&&dt.string(o.label)&&(dt.undefined(o.textEdit)||yce.is(o))&&(dt.undefined(o.additionalTextEdits)||dt.typedArray(o.additionalTextEdits,yce.is))}a(r,"is"),t.is=r})(Bln||(Bln={}));var Lln;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Lln||(Lln={}));var Fln;(function(t){function e(n,o,s,c,l,u){let d={startLine:n,endLine:o};return dt.defined(s)&&(d.startCharacter=s),dt.defined(c)&&(d.endCharacter=c),dt.defined(l)&&(d.kind=l),dt.defined(u)&&(d.collapsedText=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&dt.uinteger(o.startLine)&&dt.uinteger(o.startLine)&&(dt.undefined(o.startCharacter)||dt.uinteger(o.startCharacter))&&(dt.undefined(o.endCharacter)||dt.uinteger(o.endCharacter))&&(dt.undefined(o.kind)||dt.string(o.kind))}a(r,"is"),t.is=r})(Fln||(Fln={}));var J3t;(function(t){function e(n,o){return{location:n,message:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&R$e.is(o.location)&&dt.string(o.message)}a(r,"is"),t.is=r})(J3t||(J3t={}));var Uln;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Uln||(Uln={}));var Qln;(function(t){t.Unnecessary=1,t.Deprecated=2})(Qln||(Qln={}));var qln;(function(t){function e(r){let n=r;return dt.objectLiteral(n)&&dt.string(n.href)}a(e,"is"),t.is=e})(qln||(qln={}));var k$e;(function(t){function e(n,o,s,c,l,u){let d={range:n,message:o};return dt.defined(s)&&(d.severity=s),dt.defined(c)&&(d.code=c),dt.defined(l)&&(d.source=l),dt.defined(u)&&(d.relatedInformation=u),d}a(e,"create"),t.create=e;function r(n){var o;let s=n;return dt.defined(s)&&lu.is(s.range)&&dt.string(s.message)&&(dt.number(s.severity)||dt.undefined(s.severity))&&(dt.integer(s.code)||dt.string(s.code)||dt.undefined(s.code))&&(dt.undefined(s.codeDescription)||dt.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(dt.string(s.source)||dt.undefined(s.source))&&(dt.undefined(s.relatedInformation)||dt.typedArray(s.relatedInformation,J3t.is))}a(r,"is"),t.is=r})(k$e||(k$e={}));var Ace;(function(t){function e(n,o,...s){let c={title:n,command:o};return dt.defined(s)&&s.length>0&&(c.arguments=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.title)&&dt.string(o.command)}a(r,"is"),t.is=r})(Ace||(Ace={}));var yce;(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 dt.objectLiteral(c)&&dt.string(c.newText)&&lu.is(c.range)}a(o,"is"),t.is=o})(yce||(yce={}));var Z3t;(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 dt.objectLiteral(o)&&dt.string(o.label)&&(dt.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(dt.string(o.description)||o.description===void 0)}a(r,"is"),t.is=r})(Z3t||(Z3t={}));var Ece;(function(t){function e(r){let n=r;return dt.string(n)}a(e,"is"),t.is=e})(Ece||(Ece={}));var jln;(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 yce.is(c)&&(Z3t.is(c.annotationId)||Ece.is(c.annotationId))}a(o,"is"),t.is=o})(jln||(jln={}));var X3t;(function(t){function e(n,o){return{textDocument:n,edits:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&iFt.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(X3t||(X3t={}));var eFt;(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"&&dt.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||dt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||dt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Ece.is(o.annotationId))}a(r,"is"),t.is=r})(eFt||(eFt={}));var tFt;(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"&&dt.string(o.oldUri)&&dt.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||dt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||dt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Ece.is(o.annotationId))}a(r,"is"),t.is=r})(tFt||(tFt={}));var rFt;(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"&&dt.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||dt.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||dt.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||Ece.is(o.annotationId))}a(r,"is"),t.is=r})(rFt||(rFt={}));var nFt;(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=>dt.string(o.kind)?eFt.is(o)||tFt.is(o)||rFt.is(o):X3t.is(o)))}a(e,"is"),t.is=e})(nFt||(nFt={}));var Hln;(function(t){function e(n){return{uri:n}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.uri)}a(r,"is"),t.is=r})(Hln||(Hln={}));var Gln;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.uri)&&dt.integer(o.version)}a(r,"is"),t.is=r})(Gln||(Gln={}));var iFt;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.uri)&&(o.version===null||dt.integer(o.version))}a(r,"is"),t.is=r})(iFt||(iFt={}));var $ln;(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 dt.defined(o)&&dt.string(o.uri)&&dt.string(o.languageId)&&dt.integer(o.version)&&dt.string(o.text)}a(r,"is"),t.is=r})($ln||($ln={}));var oFt;(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})(oFt||(oFt={}));var ZSe;(function(t){function e(r){let n=r;return dt.objectLiteral(r)&&oFt.is(n.kind)&&dt.string(n.value)}a(e,"is"),t.is=e})(ZSe||(ZSe={}));var Vln;(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})(Vln||(Vln={}));var Wln;(function(t){t.PlainText=1,t.Snippet=2})(Wln||(Wln={}));var zln;(function(t){t.Deprecated=1})(zln||(zln={}));var Yln;(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&&dt.string(o.newText)&&lu.is(o.insert)&&lu.is(o.replace)}a(r,"is"),t.is=r})(Yln||(Yln={}));var Kln;(function(t){t.asIs=1,t.adjustIndentation=2})(Kln||(Kln={}));var Jln;(function(t){function e(r){let n=r;return n&&(dt.string(n.detail)||n.detail===void 0)&&(dt.string(n.description)||n.description===void 0)}a(e,"is"),t.is=e})(Jln||(Jln={}));var Zln;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(Zln||(Zln={}));var Xln;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(Xln||(Xln={}));var P$e;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(e,"fromPlainText"),t.fromPlainText=e;function r(n){let o=n;return dt.string(o)||dt.objectLiteral(o)&&dt.string(o.language)&&dt.string(o.value)}a(r,"is"),t.is=r})(P$e||(P$e={}));var eun;(function(t){function e(r){let n=r;return!!n&&dt.objectLiteral(n)&&(ZSe.is(n.contents)||P$e.is(n.contents)||dt.typedArray(n.contents,P$e.is))&&(r.range===void 0||lu.is(r.range))}a(e,"is"),t.is=e})(eun||(eun={}));var tun;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(tun||(tun={}));var nun;(function(t){function e(r,n,...o){let s={label:r};return dt.defined(n)&&(s.documentation=n),dt.defined(o)?s.parameters=o:s.parameters=[],s}a(e,"create"),t.create=e})(nun||(nun={}));var iun;(function(t){t.Text=1,t.Read=2,t.Write=3})(iun||(iun={}));var oun;(function(t){function e(r,n){let o={range:r};return dt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(oun||(oun={}));var sun;(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})(sun||(sun={}));var aun;(function(t){t.Deprecated=1})(aun||(aun={}));var cun;(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})(cun||(cun={}));var lun;(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})(lun||(lun={}));var uun;(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&&dt.string(o.name)&&dt.number(o.kind)&&lu.is(o.range)&&lu.is(o.selectionRange)&&(o.detail===void 0||dt.string(o.detail))&&(o.deprecated===void 0||dt.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})(uun||(uun={}));var dun;(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"})(dun||(dun={}));var D$e;(function(t){t.Invoked=1,t.Automatic=2})(D$e||(D$e={}));var fun;(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 dt.defined(o)&&dt.typedArray(o.diagnostics,k$e.is)&&(o.only===void 0||dt.typedArray(o.only,dt.string))&&(o.triggerKind===void 0||o.triggerKind===D$e.Invoked||o.triggerKind===D$e.Automatic)}a(r,"is"),t.is=r})(fun||(fun={}));var pun;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Ace.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&&dt.string(o.title)&&(o.diagnostics===void 0||dt.typedArray(o.diagnostics,k$e.is))&&(o.kind===void 0||dt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Ace.is(o.command))&&(o.isPreferred===void 0||dt.boolean(o.isPreferred))&&(o.edit===void 0||nFt.is(o.edit))}a(r,"is"),t.is=r})(pun||(pun={}));var hun;(function(t){function e(n,o){let s={range:n};return dt.defined(o)&&(s.data=o),s}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&lu.is(o.range)&&(dt.undefined(o.command)||Ace.is(o.command))}a(r,"is"),t.is=r})(hun||(hun={}));var mun;(function(t){function e(n,o){return{tabSize:n,insertSpaces:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.uinteger(o.tabSize)&&dt.boolean(o.insertSpaces)}a(r,"is"),t.is=r})(mun||(mun={}));var gun;(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 dt.defined(o)&&lu.is(o.range)&&(dt.undefined(o.target)||dt.string(o.target))}a(r,"is"),t.is=r})(gun||(gun={}));var Aun;(function(t){function e(n,o){return{range:n,parent:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&lu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(Aun||(Aun={}));var yun;(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"})(yun||(yun={}));var Eun;(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"})(Eun||(Eun={}));var _un;(function(t){function e(r){let n=r;return dt.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})(_un||(_un={}));var Cun;(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&&lu.is(o.range)&&dt.string(o.text)}a(r,"is"),t.is=r})(Cun||(Cun={}));var vun;(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&&lu.is(o.range)&&dt.boolean(o.caseSensitiveLookup)&&(dt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(vun||(vun={}));var bun;(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&&lu.is(o.range)&&(dt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(bun||(bun={}));var Sun;(function(t){function e(n,o){return{frameId:n,stoppedLocation:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&lu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Sun||(Sun={}));var sFt;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(sFt||(sFt={}));var aFt;(function(t){function e(n){return{value:n}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&(o.tooltip===void 0||dt.string(o.tooltip)||ZSe.is(o.tooltip))&&(o.location===void 0||R$e.is(o.location))&&(o.command===void 0||Ace.is(o.command))}a(r,"is"),t.is=r})(aFt||(aFt={}));var Tun;(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 dt.objectLiteral(o)&&Ly.is(o.position)&&(dt.string(o.label)||dt.typedArray(o.label,aFt.is))&&(o.kind===void 0||sFt.is(o.kind))&&o.textEdits===void 0||dt.typedArray(o.textEdits,yce.is)&&(o.tooltip===void 0||dt.string(o.tooltip)||ZSe.is(o.tooltip))&&(o.paddingLeft===void 0||dt.boolean(o.paddingLeft))&&(o.paddingRight===void 0||dt.boolean(o.paddingRight))}a(r,"is"),t.is=r})(Tun||(Tun={}));var Iun;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(Iun||(Iun={}));var xun;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(xun||(xun={}));var wun;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(wun||(wun={}));var Run;(function(t){t.Invoked=0,t.Automatic=1})(Run||(Run={}));var kun;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(kun||(kun={}));var Pun;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(Pun||(Pun={}));var Dun;(function(t){function e(r){let n=r;return dt.objectLiteral(n)&&Y3t.is(n.uri)&&dt.string(n.name)}a(e,"is"),t.is=e})(Dun||(Dun={}));var Nun;(function(t){function e(s,c,l,u){return new cFt(s,c,l,u)}a(e,"create"),t.create=e;function r(s){let c=s;return!!(dt.defined(c)&&dt.string(c.uri)&&(dt.undefined(c.languageId)||dt.string(c.languageId))&&dt.uinteger(c.lineCount)&&dt.func(c.getText)&&dt.func(c.positionAt)&&dt.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 ${Bh.tableName}`,this.innerJoinStatement,`WHERE ${oa.UnqualifiedName} ${o}IN (${n})`].join(` +`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${Bh.tableName}`,this.innerJoinStatement,`WHERE ${oa.FullyQualifiedName} = ?`].join(` +`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${Bh.tableName}`,this.innerJoinStatement,`WHERE ${kL.tableName}.${dS.FilePath} = ? AND ${Bh.tableName}.${oa.ExtentStart} <= ? AND (${Bh.tableName}.${oa.ExtentStart} + ${Bh.tableName}.${oa.ExtentLength}) >= ?`].join(` +`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${Bh.tableName}`,this.innerJoinStatement,`WHERE ${kL.tableName}.${dS.FilePath} = ? AND ${Bh.tableName}.${oa.ExtentStart} >= ? AND (${Bh.tableName}.${oa.ExtentStart} + ${Bh.tableName}.${oa.ExtentLength}) <= ?`,`ORDER BY ${Bh.tableName}.${oa.ExtentStart}`].join(` +`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${Bh.tableName}`,this.innerJoinStatement,`WHERE ${kL.tableName}.${dS.FilePath} = ? AND ${Bh.tableName}.${oa.FullyQualifiedName} LIKE ?`,`ORDER BY ${Bh.tableName}.${oa.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,wGe(n,e,r)):[]}};var PGe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new RGe(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 Jae(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew ux(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new ou(e.commentStart,e.commentLength),new ou(e.nameStart,e.nameLength),new ou(e.bodyStart,e.bodyLength),new ou(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(Jae,"symbolsToSymbolRanges");var DGe=he(require("fs/promises"));var kGe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new PGe(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=Yo(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await DGe.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 DGe.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 XLt(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>yDo(r))}a(XLt,"isIndexWorkerData");var bSe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},v7=class extends bSe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},NGe=class extends bSe{constructor(r){super(Qy.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},Qy={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},MGe=class extends v7{constructor(r,n,o){super(r,Qy.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},OGe=class extends v7{constructor(r,n){super(r,Qy.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},BGe=class extends v7{constructor(r,n,o){super(r,Qy.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},LGe=class extends v7{constructor(r,n){super(r,Qy.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},FGe=class extends v7{constructor(r,n,o,s,c,l){super(r,Qy.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},UGe=class extends v7{static{a(this,"ExitRequest")}constructor(e){super(e,Qy.Exit)}},YP=class extends bSe{constructor(r,n,o){super(Qy.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 yDo(t){return"databaseFilePath"in t&&"rootPath"in t}a(yDo,"isIndexableWorkspaceFolder");var Zan=he(ti()),C7=require("worker_threads");var QGe=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new kGe(e,Fan,Uan,r),this.contextRetreival=new SGe(this.index.reader,Lan)}},e3t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=Wn(o.rootPath);this.indices.set(s,new QGe(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 Zan.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case Qy.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case Qy.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case Qy.Cancel:n.get(e.id)?.cancel(),s=new YP(e.id,void 0,void 0);break;case Qy.Exit:s=await this.dispatchExit(e,r,o.token);break;case Qy.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case Qy.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case Qy.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 YP(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=Wn(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 YP(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=Wn(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 YP(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=Wn(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 YP(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 YP(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=Wn(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new QGe(e.databaseFilePath)),new YP(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=Wn(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new YP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function Xan(){return XLt(C7.workerData)}a(Xan,"isIndexWorker");function ecn(){let t=C7.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!XLt(C7.workerData))throw new Error("Worker data must provide a valid database path.");let e=C7.workerData.cwd;process.cwd=()=>e,new e3t(t,C7.workerData.indexWorkspaceRoots,C7.workerData.params)}a(ecn,"runIndexWorker");p();p();var SSe=require("fs"),tcn=require("path");var b7=class extends Bo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await SSe.promises.readFile(Wn(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(Wn(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=Wn(e),n=await SSe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,tcn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await SSe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await SSe.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 EDo(t){if(t.isCancellationRequested)return;let e=new iA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(EDo,"cancellationTokenToPromise");async function rcn(t,e){if(e){let r=EDo(e);await Promise.race([t,r])}else await t}a(rcn,"raceCancellation");function t3t(t){return Array.isArray(t)}a(t3t,"isArrayOfT");async function ncn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await r3t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(ncn,"resolveAll");async function r3t(t,e){let r;return t instanceof Promise?r=await _Do(t,e):r=await vDo(t,e),r}a(r3t,"resolve");async function _Do(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:t3t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await rcn(o,e),n.resolutionTime=performance.now()-r,n}a(_Do,"resolvePromise");async function vDo(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 rcn(o,e),n.resolutionTime=performance.now()-r,n}a(vDo,"resolveIterable");p();p();var qGe="[...]",CDo=0,pC=-1;function cf(){return CDo++}a(cf,"getAvailableNodeId");function bDo(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(bDo,"elideChildren");function icn(t,e=qGe){return r=>t.tokenLength(bDo(r,e))}a(icn,"getTokenizerCostFunction");p();var T7=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 SDo(t){let e={id:t.id??cf(),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??qGe,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(SDo,"createRenderNode");function TDo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(TDo,"isRenderedChildRequired");function ocn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(ocn,"rectifiedValue");function TSe(t,e){let r=scn(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(TSe,"rectifyWeights");function scn(t,e){let r=t.children.map(s=>scn(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 T7([]);let n=new T7(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(scn,"recursivelyRectifyWeights");function acn(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(i3t(t,m,h,g),m.length===0)return n3t(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 T7([{item:t,priority:ocn(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,ocn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(i3t(t,h,m,g),h.length===0)return n3t(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 n3t(t,o)}a(acn,"render");function n3t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(n3t,"renderEmpty");function i3t(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=TDo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=i3t(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(i3t,"recursivelyRender");function ISe(t,e,r=qGe){let n=t.children.map(c=>ISe(c,e,r));r=t.elisionMarker??r;let o=e(t);return SDo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(ISe,"snapshot");var I7={id:cf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var KP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var HGe={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function IDo(t,e,r=HGe,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=Sa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(IDo,"getDirectoryChildren");function xDo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=Xd(e);for(;o.startsWith(r);){n.push(o);let s=Xd(o);if(s.length>=o.length)break;o=s}return n}a(xDo,"getAncestors");function wDo(t,e,r=HGe.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=xDo(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(wDo,"getAncestorWeights");async function*o3t(t,e,r,n,o,s){let c={...HGe,...r},l=c.MaxResults,u=c.Decay,d=wDo(t,e,u),f=new T7([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await IDo(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(o3t,"getNearbyDocuments");var jGe=class extends KP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=HGe;this.cache=new XR(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of o3t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function G0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(G0,"setDefault");var RDo={MaxActiveSymbols:500,SymbolCacheSize:1e6},GGe=class extends KP{constructor(){super(...arguments);this.config=RDo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new yn(this.config.SymbolCacheSize);this.textSymbols=new yn(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=G0(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 s3t(l)){let d=G0(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())G0(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&&ccn(o))}},PDo=/^[a-zA-Z_]{2,}\w+$/;function ccn(t){return PDo.test(t)}a(ccn,"isSymbol");function kDo(t){return t.toLowerCase()}a(kDo,"normalizeWord");function*s3t(t){for(let e of t.split(/\W/))ccn(e)&&(yield kDo(e))}a(s3t,"getTextSymbols");var DDo={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},$Ge=class extends GGe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=DDo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new XR(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 s3t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=G0(this.textSymbols,l,()=>this.createSymbol(!1));G0(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 o3t(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 lcn(t){return t.nodeId!==void 0}a(lcn,"isNodeLocation");var ucn={"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}},VGe=class extends KP{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=ucn[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)lcn(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(lcn(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=ucn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};G0(this.eventsByType,r,()=>new yn(s.maxEventCount)).set(++this.nextId,c)}};p();var WGe=class extends KP{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 NDo(t){return t.id!==void 0}a(NDo,"isNodeItem");function MDo(t){return!("uri"in t)&&!("id"in t)}a(MDo,"isNullItem");var dcn={"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 fcn(t){return t in dcn}a(fcn,"isSourceId");var x7="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",Zae=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}},zGe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=dcn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new Zae([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new Zae(r.items):new Zae([])}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 Zae(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(MDo(r))return{weight:r.weight,uri:x7,id:pC};let n=NDo(r)?r.id:pC,o=r.uri??this.activeContext.getUri(n)??x7;return o===x7&&(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=G0(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!==x7?this.activeContext.normalizeUri(u)??x7:x7;for(let[h,m]of d.entries())u===x7||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(x7),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 a3t=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*pcn(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=BDo(e,this.document),o=new a3t(cf(),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;mODo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function BDo(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(BDo,"buildText");function*pcn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*pcn(r,e))}a(pcn,"walk");p();p();p();var KGe=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 c3t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:c3t(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=c3t(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 KGe(cf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(c3t,"recursivelyBuildNode");function hcn(t){let e=qz(t.getText(),t.detectedLanguageId);return c3t(e,t.lineCount,t)??new KGe(cf(),e,[],0,t.lineCount-1,t)}a(hcn,"parse");var JGe={source:"indentation",parse:hcn,update(t,e){return{root:hcn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var gcn=he(Qae());function mcn(t){return{line:t.row,character:t.column}}a(mcn,"asPosition");var SM=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)}},w7=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 gcn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return JGe.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:mcn(e.startPosition),end:mcn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var LDo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),FDo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),UDo=new Set(["identifier"]),QDo=new Set(["string","comment"]),Acn=new SM(LDo,FDo,UDo,QDo);p();var qDo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),jDo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),HDo=new Set(["identifier"]),GDo=new Set(["string_literal","line_comment","block_comment"]),ycn=new SM(qDo,jDo,HDo,GDo);p();var $Do=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),VDo=new Set(["module","block","parameters","dictionary","list"]),WDo=new Set(["identifier"]),zDo=new Set(["string","comment"]),Ecn=new SM($Do,VDo,WDo,zDo);p();var YDo=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),KDo=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),JDo=new Set(["identifier"]),ZDo=new Set(["string","comment"]),_cn=new SM(YDo,KDo,JDo,ZDo);var vcn=he(Qae());async function Ccn(t){await vcn.default.init();try{let e=await TLt(t);switch(t){case"python":return new w7(e,"tree-sitter-python",Ecn);case"typescript":return new w7(e,"tree-sitter-typescript",_cn);case"java":return new w7(e,"tree-sitter-java",ycn);case"cpp":return new w7(e,"tree-sitter-cpp",Acn);default:return new w7(e,"tree-sitter-generic")}}catch{return JGe}}a(Ccn,"getParser");var l3t=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}))}},ZGe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},bcn=500,XGe=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 yn(bcn);this.allowedExtensions=new Set(E7);this.invalidDocumentCache=new XR(bcn,this.config.InvalidCacheTime),this.cachedDocuments=new k8e(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=>PL[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(n9e(e),r=ia(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(_Vr(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 l3t(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 ZGe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new iA;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 ZGe(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 YGe(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=G0(this.createdNodes,e,()=>new Set),o=G0(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 Ccn(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 XDo="WorkspaceContextWorker";function u3t(t){let e=t;return e?.workerId===XDo&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(u3t,"isContextWorkerData");var eNo=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function Scn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return eNo.includes(e)?e:void 0}a(Scn,"getContextMessageType");var R7=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();f3t();p();var Rcn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(Rcn||(Rcn={}));var p3t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(p3t||(p3t={}));var Pcn;(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})(Pcn||(Pcn={}));var t$e;(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})(t$e||(t$e={}));var qy;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=t$e.MAX_VALUE),o===Number.MAX_VALUE&&(o=t$e.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})(qy||(qy={}));var su;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:qy.create(n,o),end:qy.create(s,c)};if(qy.is(n)&&qy.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)&&qy.is(o.start)&&qy.is(o.end)}a(r,"is"),t.is=r})(su||(su={}));var r$e;(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)&&su.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(r$e||(r$e={}));var kcn;(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)&&su.is(o.targetRange)&&mt.string(o.targetUri)&&su.is(o.targetSelectionRange)&&(su.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(kcn||(kcn={}));var h3t;(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})(h3t||(h3t={}));var Dcn;(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)&&su.is(o.range)&&h3t.is(o.color)}a(r,"is"),t.is=r})(Dcn||(Dcn={}));var Ncn;(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)||ece.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,ece.is))}a(r,"is"),t.is=r})(Ncn||(Ncn={}));var Mcn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Mcn||(Mcn={}));var Ocn;(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})(Ocn||(Ocn={}));var m3t;(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)&&r$e.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(m3t||(m3t={}));var Bcn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Bcn||(Bcn={}));var Lcn;(function(t){t.Unnecessary=1,t.Deprecated=2})(Lcn||(Lcn={}));var Fcn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(Fcn||(Fcn={}));var n$e;(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)&&su.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,m3t.is))}a(r,"is"),t.is=r})(n$e||(n$e={}));var Xae;(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})(Xae||(Xae={}));var ece;(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)&&su.is(c.range)}a(o,"is"),t.is=o})(ece||(ece={}));var g3t;(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})(g3t||(g3t={}));var tce;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(tce||(tce={}));var Ucn;(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 ece.is(c)&&(g3t.is(c.annotationId)||tce.is(c.annotationId))}a(o,"is"),t.is=o})(Ucn||(Ucn={}));var A3t;(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)&&C3t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(A3t||(A3t={}));var y3t;(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||tce.is(o.annotationId))}a(r,"is"),t.is=r})(y3t||(y3t={}));var E3t;(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||tce.is(o.annotationId))}a(r,"is"),t.is=r})(E3t||(E3t={}));var _3t;(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||tce.is(o.annotationId))}a(r,"is"),t.is=r})(_3t||(_3t={}));var v3t;(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)?y3t.is(o)||E3t.is(o)||_3t.is(o):A3t.is(o)))}a(e,"is"),t.is=e})(v3t||(v3t={}));var Qcn;(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})(Qcn||(Qcn={}));var qcn;(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})(qcn||(qcn={}));var C3t;(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})(C3t||(C3t={}));var jcn;(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})(jcn||(jcn={}));var b3t;(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})(b3t||(b3t={}));var xSe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&b3t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(xSe||(xSe={}));var Hcn;(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})(Hcn||(Hcn={}));var Gcn;(function(t){t.PlainText=1,t.Snippet=2})(Gcn||(Gcn={}));var $cn;(function(t){t.Deprecated=1})($cn||($cn={}));var Vcn;(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)&&su.is(o.insert)&&su.is(o.replace)}a(r,"is"),t.is=r})(Vcn||(Vcn={}));var Wcn;(function(t){t.asIs=1,t.adjustIndentation=2})(Wcn||(Wcn={}));var zcn;(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})(zcn||(zcn={}));var Ycn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(Ycn||(Ycn={}));var Kcn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(Kcn||(Kcn={}));var i$e;(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})(i$e||(i$e={}));var Jcn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(xSe.is(n.contents)||i$e.is(n.contents)||mt.typedArray(n.contents,i$e.is))&&(r.range===void 0||su.is(r.range))}a(e,"is"),t.is=e})(Jcn||(Jcn={}));var Zcn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(Zcn||(Zcn={}));var Xcn;(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})(Xcn||(Xcn={}));var eln;(function(t){t.Text=1,t.Read=2,t.Write=3})(eln||(eln={}));var tln;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(tln||(tln={}));var rln;(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})(rln||(rln={}));var nln;(function(t){t.Deprecated=1})(nln||(nln={}));var iln;(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})(iln||(iln={}));var oln;(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})(oln||(oln={}));var sln;(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)&&su.is(o.range)&&su.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})(sln||(sln={}));var aln;(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"})(aln||(aln={}));var o$e;(function(t){t.Invoked=1,t.Automatic=2})(o$e||(o$e={}));var cln;(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,n$e.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===o$e.Invoked||o.triggerKind===o$e.Automatic)}a(r,"is"),t.is=r})(cln||(cln={}));var lln;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Xae.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,n$e.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Xae.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||v3t.is(o.edit))}a(r,"is"),t.is=r})(lln||(lln={}));var uln;(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)&&su.is(o.range)&&(mt.undefined(o.command)||Xae.is(o.command))}a(r,"is"),t.is=r})(uln||(uln={}));var dln;(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})(dln||(dln={}));var fln;(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)&&su.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(fln||(fln={}));var pln;(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)&&su.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(pln||(pln={}));var hln;(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"})(hln||(hln={}));var mln;(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"})(mln||(mln={}));var gln;(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})(gln||(gln={}));var Aln;(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&&su.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(Aln||(Aln={}));var yln;(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&&su.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(yln||(yln={}));var Eln;(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&&su.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(Eln||(Eln={}));var _ln;(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)&&su.is(n.stoppedLocation)}a(r,"is"),t.is=r})(_ln||(_ln={}));var S3t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(S3t||(S3t={}));var T3t;(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)||xSe.is(o.tooltip))&&(o.location===void 0||r$e.is(o.location))&&(o.command===void 0||Xae.is(o.command))}a(r,"is"),t.is=r})(T3t||(T3t={}));var vln;(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)&&qy.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,T3t.is))&&(o.kind===void 0||S3t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,ece.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||xSe.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})(vln||(vln={}));var Cln;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(Cln||(Cln={}));var bln;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(bln||(bln={}));var Sln;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(Sln||(Sln={}));var Tln;(function(t){t.Invoked=0,t.Automatic=1})(Tln||(Tln={}));var Iln;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(Iln||(Iln={}));var xln;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(xln||(xln={}));var wln;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&p3t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(wln||(wln={}));var Rln;(function(t){function e(s,c,l,u){return new I3t(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 Ly.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return Ly.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})(dt||(dt={}));var Ll=class{static{a(this,"LocationFactory")}static{this.range=lu.create.bind(lu)}static{this.position=Ly.create.bind(Ly)}},iP=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=$L.create(e.clientUri,e.clientLanguageId,n,e.getText());return $L.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=$L.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return $L.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=DM({uri:e,languageId:r})){return new t(ca(e),$L.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=lu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=lu.create(Ly.create(r,0),Ly.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var MM=require("worker_threads");var TMo=5,Mun=3e4,lFt=class extends L7{constructor(r){super();this.worker=r;this.didChangeEmitter=new no;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>ca(n))}getWorkspaceFolder(r){let n=ca(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:iP.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},uFt=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new lFt(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 I$e(this.fileSystem,n),this.coordinator=new C$e(this.documentManager,n),this.recentActivityProvider=new E$e,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(!xln(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 H7(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new H7(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 ${Mun}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},Mun);r=new rA,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 H7(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(F3t(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 H7(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 dFt(){return MM.parentPort!==null&&V3t(MM.workerData)}a(dFt,"isContextWorker");function Oun(){if(!dFt())throw new Error("This must be run in a worker thread.");if(!V3t(MM.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(MM.workerData)}`);let t=MM.workerData.cwd;process.cwd=()=>t;let e=new uFt(MM.parentPort,MM.workerData.workspaceRoots,MM.workerData.config);e.addLocalProvider(new m$e(e.fileSystem,e.documentManager)),e.addLocalProvider(new y$e(e.fileSystem,e.documentManager)),e.addLocalProvider(new _$e)}a(Oun,"runContextWorker");p();var XSe=ce(require("util"));function Lun(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(J9(t)==="dev")return t.get(Df).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:",XSe.format(...o)))},e.dir=(n,o)=>r(4,XSe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(XSe.format(...n));o.name="Trace",e.log(o)},e}a(Lun,"createConsole");p();p();var M$e=ce(require("path")),Fun=require("worker_threads");var O$e=new Map,IMo=0;function eTe(t,e){let r=IMo++;O$e.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,O$e.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(eTe,"registerWorker");function Uun(t,e){let r=new Fun.Worker(M$e.default.resolve(M$e.default.extname(__filename)!==".ts"?__dirname:M$e.default.resolve(__dirname,"../../dist"),t),{workerData:e});return eTe(r,t),r}a(Uun,"createWorker");function Qun(){return O$e.size}a(Qun,"getActiveWorkerCount");async function qun(){let t=[],e=[];for(let[r,{worker:n,name:o}]of O$e)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(qun,"collectWorkerPerfStats");var B$e=ce(require("os")),jun=ce(require("v8"));function xMo(t){let e=qt(t,je.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(xMo,"getPerfState");var oY=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=xMo(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=jun.getHeapStatistics(),o=this.cpuDelta(),s=Qun(),c=0,l="";try{let u=await qun();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(gt(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:B$e.freemem(),systemTotalMemBytes:B$e.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:jL(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 nk=ce(sP()),yro=require("worker_threads");p();p();var bVe=require("assert");p();p();var QOo={right:$Oo,center:VOo},qOo=0,pVe=1,jOo=2,hVe=3,LFt=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&&_S.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),_S.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=_S.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>_S.stringWidth(c)&&(f+=" ".repeat(d-_S.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=QOo[e[l].align];f=m(f,d),_S.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=_S.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=_S.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 qy.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return qy.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=su.create.bind(su)}static{this.position=qy.create.bind(qy)}},JP=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=DL.create(e.clientUri,e.clientLanguageId,n,e.getText());return DL.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=DL.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return DL.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=bM({uri:e,languageId:r})){return new t(ia(e),DL.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=su.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=su.create(qy.create(r,0),qy.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var TM=require("worker_threads");var rNo=5,Pln=3e4,x3t=class extends b7{constructor(r){super();this.worker=r;this.didChangeEmitter=new ro;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>ia(n))}getWorkspaceFolder(r){let n=ia(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:JP.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},w3t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new x3t(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 XGe(this.fileSystem,n),this.coordinator=new zGe(this.documentManager,n),this.recentActivityProvider=new VGe,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(!Scn(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 R7(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new R7(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 ${Pln}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},Pln);r=new iA,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 R7(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(r3t(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 R7(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 R3t(){return TM.parentPort!==null&&u3t(TM.workerData)}a(R3t,"isContextWorker");function kln(){if(!R3t())throw new Error("This must be run in a worker thread.");if(!u3t(TM.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(TM.workerData)}`);let t=TM.workerData.cwd;process.cwd=()=>t;let e=new w3t(TM.parentPort,TM.workerData.workspaceRoots,TM.workerData.config);e.addLocalProvider(new jGe(e.fileSystem,e.documentManager)),e.addLocalProvider(new $Ge(e.fileSystem,e.documentManager)),e.addLocalProvider(new WGe)}a(kln,"runContextWorker");p();var wSe=he(require("util"));function Dln(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(L9(t)==="dev")return t.get(Df).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:",wSe.format(...o)))},e.dir=(n,o)=>r(4,wSe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(wSe.format(...n));o.name="Trace",e.log(o)},e}a(Dln,"createConsole");p();p();var a$e=he(require("path")),Nln=require("worker_threads");var c$e=new Map,nNo=0;function RSe(t,e){let r=nNo++;c$e.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,c$e.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(RSe,"registerWorker");function Mln(t,e){let r=new Nln.Worker(a$e.default.resolve(a$e.default.extname(__filename)!==".ts"?__dirname:a$e.default.resolve(__dirname,"../../dist"),t),{workerData:e});return RSe(r,t),r}a(Mln,"createWorker");function Oln(){return c$e.size}a(Oln,"getActiveWorkerCount");async function Bln(){let t=[],e=[];for(let[r,{worker:n,name:o}]of c$e)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(Bln,"collectWorkerPerfStats");var l$e=he(require("os")),Lln=he(require("v8"));function iNo(t){let e=Gt(t,Je.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(iNo,"getPerfState");var Hz=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=iNo(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=Lln.getHeapStatistics(),o=this.cpuDelta(),s=Oln(),c=0,l="";try{let u=await Bln();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(_t(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:l$e.freemem(),systemTotalMemBytes:l$e.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:RL(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 KR=he(XP()),Yeo=require("worker_threads");p();p();var K$e=require("assert");p();p();var AMo={right:CMo,center:bMo},yMo=0,Q$e=1,EMo=2,q$e=3,tFt=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&&fS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),fS.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=fS.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>fS.stringWidth(c)&&(f+=" ".repeat(d-fS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=AMo[e[l].align];f=m(f,d),fS.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=fS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=fS.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[qOo]||0).fill("")),o.push(...new Array(s.padding[jOo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||_S.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,HOo(e[l])):c)}};function Bdn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(Bdn,"addBorder");function HOo(t){let e=t.padding||[],r=1+(e[hVe]||0)+(e[pVe]||0);return t.border?r+4:r}a(HOo,"_minWidth");function GOo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(GOo,"getWindowWidth");function $Oo(t,e){t=t.trim();let r=_S.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(VOo,"alignCenter");var _S;function Ldn(t,e){return _S=e,new LFt({width:t?.width||GOo(),wrap:t?.wrap})}a(Ldn,"cliui");p();p();p();function FFt({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(FFt,"ansiRegex");var WOo=FFt();function lY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(WOo,"")}a(lY,"stripAnsi");p();p();function Fdn(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(Fdn,"isAmbiguous");function Udn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(Udn,"isFullWidth");function Qdn(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(Qdn,"isWide");function zOo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(zOo,"validate");function mVe(t,{ambiguousAsWide:e=!1}={}){return zOo(t),Udn(t)||Qdn(t)||e&&Fdn(t)?2:1}a(mVe,"eastAsianWidth");p();var qdn=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 YOo=new Intl.Segmenter,KOo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function VL(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=lY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of YOo.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)&&!KOo.test(c)){if(qdn().test(c)){o+=2;continue}o+=mVe(l,s)}}return o}a(VL,"stringWidth");p();p();var jdn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),Hdn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),Gdn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),wd={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]}},PPu=Object.keys(wd.modifier),JOo=Object.keys(wd.color),ZOo=Object.keys(wd.bgColor),DPu=[...JOo,...ZOo];function XOo(){let t=new Map;for(let[e,r]of Object.entries(wd)){for(let[n,o]of Object.entries(r))wd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=wd[n],t.set(o[0],o[1]);Object.defineProperty(wd,e,{value:r,enumerable:!1})}return Object.defineProperty(wd,"codes",{value:t,enumerable:!1}),wd.color.close="\x1B[39m",wd.bgColor.close="\x1B[49m",wd.color.ansi=jdn(),wd.color.ansi256=Hdn(),wd.color.ansi16m=Gdn(),wd.bgColor.ansi=jdn(10),wd.bgColor.ansi256=Hdn(10),wd.bgColor.ansi16m=Gdn(10),Object.defineProperties(wd,{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=>wd.rgbToAnsi256(...wd.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)=>wd.ansi256ToAnsi(wd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>wd.ansi256ToAnsi(wd.hexToAnsi256(e)),"value"),enumerable:!1}}),wd}a(XOo,"assembleStyles");var e5o=XOo(),$dn=e5o;var AVe=new Set(["\x1B","\x9B"]),t5o=39,QFt="\x07",zdn="[",r5o="]",Ydn="m",gVe=`${r5o}8;;`,Vdn=a(t=>`${AVe.values().next().value}${zdn}${t}${Ydn}`,"wrapAnsiCode"),Wdn=a(t=>`${AVe.values().next().value}${gVe}${t}${QFt}`,"wrapAnsiHyperlink"),n5o=a(t=>t.split(" ").map(e=>VL(e)),"wordLengths"),UFt=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=VL(lY(t.at(-1)));for(let[l,u]of n.entries()){let d=VL(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),AVe.has(u)&&(o=!0,s=n.slice(l+1,l+1+gVe.length).join("")===gVe),o){s?u===QFt&&(o=!1,s=!1):u===Ydn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),i5o=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(VL(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),o5o=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=n5o(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=VL(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){UFt(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>i5o(h)));let u=l.join(` -`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,AVe.has(m)){let{groups:A}=new RegExp(`(?:\\${zdn}(?\\d+)m|\\${gVe}(?.*)${QFt})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===t5o?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=$dn.codes.get(Number(o));d[h+1]===` -`?(s&&(n+=Wdn("")),o&&g&&(n+=Vdn(g))):m===` -`&&(o&&g&&(n+=Vdn(o)),s&&(n+=Wdn(s))),f+=m.length}return n},"exec");function qFt(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[yMo]||0).fill("")),o.push(...new Array(s.padding[EMo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||fS.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,_Mo(e[l])):c)}};function Dun(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(Dun,"addBorder");function _Mo(t){let e=t.padding||[],r=1+(e[q$e]||0)+(e[Q$e]||0);return t.border?r+4:r}a(_Mo,"_minWidth");function vMo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(vMo,"getWindowWidth");function CMo(t,e){t=t.trim();let r=fS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(bMo,"alignCenter");var fS;function Nun(t,e){return fS=e,new tFt({width:t?.width||vMo(),wrap:t?.wrap})}a(Nun,"cliui");p();p();p();function rFt({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(rFt,"ansiRegex");var SMo=rFt();function Wz(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(SMo,"")}a(Wz,"stripAnsi");p();p();function Mun(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(Mun,"isAmbiguous");function Oun(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(Oun,"isFullWidth");function Lun(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(Lun,"isWide");function TMo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(TMo,"validate");function j$e(t,{ambiguousAsWide:e=!1}={}){return TMo(t),Oun(t)||Lun(t)||e&&Mun(t)?2:1}a(j$e,"eastAsianWidth");p();var Fun=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 IMo=new Intl.Segmenter,xMo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function NL(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=Wz(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of IMo.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)&&!xMo.test(c)){if(Fun().test(c)){o+=2;continue}o+=j$e(l,s)}}return o}a(NL,"stringWidth");p();p();var Uun=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),Qun=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),qun=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),xd={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]}},wxu=Object.keys(xd.modifier),wMo=Object.keys(xd.color),RMo=Object.keys(xd.bgColor),Rxu=[...wMo,...RMo];function PMo(){let t=new Map;for(let[e,r]of Object.entries(xd)){for(let[n,o]of Object.entries(r))xd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=xd[n],t.set(o[0],o[1]);Object.defineProperty(xd,e,{value:r,enumerable:!1})}return Object.defineProperty(xd,"codes",{value:t,enumerable:!1}),xd.color.close="\x1B[39m",xd.bgColor.close="\x1B[49m",xd.color.ansi=Uun(),xd.color.ansi256=Qun(),xd.color.ansi16m=qun(),xd.bgColor.ansi=Uun(10),xd.bgColor.ansi256=Qun(10),xd.bgColor.ansi16m=qun(10),Object.defineProperties(xd,{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=>xd.rgbToAnsi256(...xd.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)=>xd.ansi256ToAnsi(xd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>xd.ansi256ToAnsi(xd.hexToAnsi256(e)),"value"),enumerable:!1}}),xd}a(PMo,"assembleStyles");var kMo=PMo(),jun=kMo;var G$e=new Set(["\x1B","\x9B"]),DMo=39,iFt="\x07",$un="[",NMo="]",Vun="m",H$e=`${NMo}8;;`,Hun=a(t=>`${G$e.values().next().value}${$un}${t}${Vun}`,"wrapAnsiCode"),Gun=a(t=>`${G$e.values().next().value}${H$e}${t}${iFt}`,"wrapAnsiHyperlink"),MMo=a(t=>t.split(" ").map(e=>NL(e)),"wordLengths"),nFt=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=NL(Wz(t.at(-1)));for(let[l,u]of n.entries()){let d=NL(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),G$e.has(u)&&(o=!0,s=n.slice(l+1,l+1+H$e.length).join("")===H$e),o){s?u===iFt&&(o=!1,s=!1):u===Vun&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),OMo=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(NL(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),BMo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=MMo(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=NL(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){nFt(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>OMo(h)));let u=l.join(` +`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,G$e.has(m)){let{groups:A}=new RegExp(`(?:\\${$un}(?\\d+)m|\\${H$e}(?.*)${iFt})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===DMo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=jun.codes.get(Number(o));d[h+1]===` +`?(s&&(n+=Gun("")),o&&g&&(n+=Hun(g))):m===` +`&&(o&&g&&(n+=Hun(o)),s&&(n+=Gun(s))),f+=m.length}return n},"exec");function oFt(t,e,r){return String(t).normalize().replaceAll(`\r `,` `).split(` -`).map(n=>o5o(n,e,r)).join(` -`)}a(qFt,"wrapAnsi");function jFt(t){return Ldn(t,{stringWidth:VL,stripAnsi:lY,wrap:qFt})}a(jFt,"ui");p();var bce=require("path"),yVe=require("fs");function HFt(t,e){let r=(0,bce.resolve)(".",t),n;for((0,yVe.statSync)(r).isDirectory()||(r=(0,bce.dirname)(r));;){if(n=e(r,(0,yVe.readdirSync)(r)),n)return(0,bce.resolve)(r,n);if(r=(0,bce.dirname)(n=r),n===r)break}}a(HFt,"default");var hfn=require("util"),e8t=require("url");p();var tfn=require("util"),vVe=require("path");p();function uY(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(EVe,"decamelize");function _Ve(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(_Ve,"looksLikeNumber");p();p();function Kdn(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 ae=="number"&&(E.nargs[K]=ae,E.keys.push(K))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([K,ae])=>{typeof ae=="function"&&(E.coercions[K]=ae,E.keys.push(K))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(K){E.configs[K]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([K,ae])=>{(typeof ae=="boolean"||typeof ae=="function")&&(E.configs[K]=ae)})),re(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(K){(E.aliases[K]||[]).forEach(function(ae){u[ae]=u[K]})});let b=null;le();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let K=0;K=3&&(j(_e[1],E.arrays)?K=D(K,_e[1],o,_e[2]):j(_e[1],E.nargs)!==!1?K=k(K,_e[1],o,_e[2]):N(_e[1],_e[2],!0));else if(ae.match(v)&&l["boolean-negation"])_e=ae.match(v),_e!==null&&Array.isArray(_e)&&_e.length>=2&&(se=_e[1],N(se,j(se,E.arrays)?[!1]:!1));else if(ae.match(/^--.+/)||!l["short-option-groups"]&&ae.match(/^-[^-]+/))_e=ae.match(/^--?(.+)/),_e!==null&&Array.isArray(_e)&&_e.length>=2&&(se=_e[1],j(se,E.arrays)?K=D(K,se,o):j(se,E.nargs)!==!1?K=k(K,se,o):(Re=o[K+1],Re!==void 0&&(!Re.match(/^-/)||Re.match(_))&&!j(se,E.bools)&&!j(se,E.counts)||/^(true|false)$/.test(Re)?(N(se,Re),K++):N(se,Te(se))));else if(ae.match(/^-.\..+=/))_e=ae.match(/^-([^=]+)=([\s\S]*)$/),_e!==null&&Array.isArray(_e)&&_e.length>=3&&N(_e[1],_e[2]);else if(ae.match(/^-.\..+/)&&!ae.match(_))Re=o[K+1],_e=ae.match(/^-(.\..+)/),_e!==null&&Array.isArray(_e)&&_e.length>=2&&(se=_e[1],Re!==void 0&&!Re.match(/^-/)&&!j(se,E.bools)&&!j(se,E.counts)?(N(se,Re),K++):N(se,Te(se)));else if(ae.match(/^-[^-]+/)&&!ae.match(_)){Ie=ae.slice(1,-1).split(""),ne=!1;for(let Xe=0;XeK!=="--"&&K.includes("-")).forEach(K=>{delete w[K]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(K=>c[K])).forEach(K=>{l["camel-case-expansion"]&&K.includes("-")&&delete w[K.split(".").map(ae=>uY(ae)).join(".")],delete w[K]});function x(K){let ae=Q("_",K);(typeof ae=="string"||typeof ae=="number")&&w._.push(ae)}a(x,"pushPositional");function k(K,ae,Me,ne){let se,Ie=j(ae,E.nargs);if(Ie=typeof Ie!="number"||isNaN(Ie)?1:Ie,Ie===0)return z(ne)||(b=Error(y("Argument unexpected for: %s",ae))),N(ae,Te(ae)),K;let _e=z(ne)?0:1;if(l["nargs-eats-options"])Me.length-(K+1)+_e0&&(N(ae,ne),Re--),se=K+1;se0||_e&&typeof _e=="number"&&se.length>=_e||(Ie=Me[Re],/^-/.test(Ie)&&!_.test(Ie)&&!Ae(Ie)));Re++)K=Re,se.push(B(ae,Ie,s))}return typeof _e=="number"&&(_e&&se.length<_e||isNaN(_e)&&se.length===0)&&(b=Error(y("Not enough arguments following: %s",ae))),N(ae,se),K}a(D,"eatArray");function N(K,ae,Me=s){if(/-/.test(K)&&l["camel-case-expansion"]){let Ie=K.split(".").map(function(_e){return uY(_e)}).join(".");L(K,Ie)}let ne=B(K,ae,Me),se=K.split(".");Y(w,se,ne),E.aliases[K]&&E.aliases[K].forEach(function(Ie){let _e=Ie.split(".");Y(w,_e,ne)}),se.length>1&&l["dot-notation"]&&(E.aliases[se[0]]||[]).forEach(function(Ie){let _e=Ie.split("."),Re=[].concat(se);Re.shift(),_e=_e.concat(Re),(E.aliases[K]||[]).includes(_e.join("."))||Y(w,_e,ne)}),j(K,E.normalize)&&!j(K,E.arrays)&&[K].concat(E.aliases[K]||[]).forEach(function(_e){Object.defineProperty(R,_e,{enumerable:!0,get(){return ae},set(Re){ae=typeof Re=="string"?WL.normalize(Re):Re}})})}a(N,"setArg");function L(K,ae){E.aliases[K]&&E.aliases[K].length||(E.aliases[K]=[ae],g[ae]=!0),E.aliases[ae]&&E.aliases[ae].length||L(ae,K)}a(L,"addNewAlias");function B(K,ae,Me){Me&&(ae=a5o(ae)),(j(K,E.bools)||j(K,E.counts))&&typeof ae=="string"&&(ae=ae==="true");let ne=Array.isArray(ae)?ae.map(function(se){return Q(K,se)}):Q(K,ae);return j(K,E.counts)&&(z(ne)||typeof ne=="boolean")&&(ne=GFt()),j(K,E.normalize)&&j(K,E.arrays)&&(Array.isArray(ae)?ne=ae.map(se=>WL.normalize(se)):ne=WL.normalize(ae)),ne}a(B,"processValue");function Q(K,ae){return!l["parse-positional-numbers"]&&K==="_"||!j(K,E.strings)&&!j(K,E.bools)&&!Array.isArray(ae)&&(_Ve(ae)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ae}`)))||!z(ae)&&j(K,E.numbers))&&(ae=Number(ae)),ae}a(Q,"maybeCoerceNumber");function M(K){let ae=Object.create(null);V(ae,E.aliases,u),Object.keys(E.configs).forEach(function(Me){let ne=K[Me]||ae[Me];if(ne)try{let se=null,Ie=WL.resolve(WL.cwd(),ne),_e=E.configs[Me];if(typeof _e=="function"){try{se=_e(Ie)}catch(Re){se=Re}if(se instanceof Error){b=se;return}}else se=WL.require(Ie);O(se)}catch(se){se.name==="PermissionDenied"?b=se:K[Me]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(K,ae){Object.keys(K).forEach(function(Me){let ne=K[Me],se=ae?ae+"."+Me:Me;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,se):(!G(w,se.split("."))||j(se,E.arrays)&&l["combine-arrays"])&&N(se,ne)})}a(O,"setConfigObject");function q(){typeof d<"u"&&d.forEach(function(K){O(K)})}a(q,"setConfigObjects");function F(K,ae){if(typeof f>"u")return;let Me=typeof f=="string"?f:"",ne=WL.env();Object.keys(ne).forEach(function(se){if(Me===""||se.lastIndexOf(Me,0)===0){let Ie=se.split("__").map(function(_e,Re){return Re===0&&(_e=_e.substring(Me.length)),uY(_e)});(ae&&E.configs[Ie.join(".")]||!ae)&&!G(K,Ie)&&N(Ie.join("."),ne[se])}})}a(F,"applyEnvVars");function U(K){let ae,Me=new Set;Object.keys(K).forEach(function(ne){if(!Me.has(ne)&&(ae=j(ne,E.coercions),typeof ae=="function"))try{let se=Q(ne,ae(K[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Ie=>{Me.add(Ie),K[Ie]=se})}catch(se){b=se}})}a(U,"applyCoercions");function W(K){return E.keys.forEach(ae=>{~ae.indexOf(".")||typeof K[ae]>"u"&&(K[ae]=void 0)}),K}a(W,"setPlaceholderKeys");function V(K,ae,Me,ne=!1){Object.keys(Me).forEach(function(se){G(K,se.split("."))||(Y(K,se.split("."),Me[se]),ne&&(A[se]=!0),(ae[se]||[]).forEach(function(Ie){G(K,Ie.split("."))||Y(K,Ie.split("."),Me[se])}))})}a(V,"applyDefaultsAndAliases");function G(K,ae){let Me=K;l["dot-notation"]||(ae=[ae.join(".")]),ae.slice(0,-1).forEach(function(se){Me=Me[se]||{}});let ne=ae[ae.length-1];return typeof Me!="object"?!1:ne in Me}a(G,"hasKey");function Y(K,ae,Me){let ne=K;l["dot-notation"]||(ae=[ae.join(".")]),ae.slice(0,-1).forEach(function(Je){Je=Jdn(Je),typeof ne=="object"&&ne[Je]===void 0&&(ne[Je]={}),typeof ne[Je]!="object"||Array.isArray(ne[Je])?(Array.isArray(ne[Je])?ne[Je].push({}):ne[Je]=[ne[Je],{}],ne=ne[Je][ne[Je].length-1]):ne=ne[Je]});let se=Jdn(ae[ae.length-1]),Ie=j(ae.join("."),E.arrays),_e=Array.isArray(Me),Re=l["duplicate-arguments-array"];!Re&&j(se,E.nargs)&&(Re=!0,(!z(ne[se])&&E.nargs[se]===1||Array.isArray(ne[se])&&ne[se].length===E.nargs[se])&&(ne[se]=void 0)),Me===GFt()?ne[se]=GFt(ne[se]):Array.isArray(ne[se])?Re&&Ie&&_e?ne[se]=l["flatten-duplicate-arrays"]?ne[se].concat(Me):(Array.isArray(ne[se][0])?ne[se]:[ne[se]]).concat([Me]):!Re&&!!Ie==!!_e?ne[se]=Me:ne[se]=ne[se].concat([Me]):ne[se]===void 0&&Ie?ne[se]=_e?Me:[Me]:Re&&!(ne[se]===void 0||j(se,E.counts)||j(se,E.bools))?ne[se]=[ne[se],Me]:ne[se]=Me}a(Y,"setKey");function re(...K){K.forEach(function(ae){Object.keys(ae||{}).forEach(function(Me){E.aliases[Me]||(E.aliases[Me]=[].concat(c[Me]||[]),E.aliases[Me].concat(Me).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let se=uY(ne);se!==Me&&E.aliases[Me].indexOf(se)===-1&&(E.aliases[Me].push(se),g[se]=!0)}}),E.aliases[Me].concat(Me).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let se=EVe(ne,"-");se!==Me&&E.aliases[Me].indexOf(se)===-1&&(E.aliases[Me].push(se),g[se]=!0)}}),E.aliases[Me].forEach(function(ne){E.aliases[ne]=[Me].concat(E.aliases[Me].filter(function(se){return ne!==se}))}))})})}a(re,"extendAliases");function j(K,ae){let Me=[].concat(E.aliases[K]||[],K),ne=Object.keys(ae),se=Me.find(Ie=>ne.includes(Ie));return se?ae[se]:!1}a(j,"checkAllAliases");function X(K){let ae=Object.keys(E);return[].concat(ae.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(K):ne[K]})}a(X,"hasAnyFlag");function ie(K,...ae){return[].concat(...ae).some(function(ne){let se=K.match(ne);return se&&X(se[1])})}a(ie,"hasFlagsMatching");function we(K){if(K.match(_)||!K.match(/^-[^-]+/))return!1;let ae=!0,Me,ne=K.slice(1).split("");for(let se=0;sej(K,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",K)),!0):j(K,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",K)),!0):!1)}return a(le,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function s5o(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;oc5o,"env"),format:tfn.format,normalize:vVe.normalize,resolve:vVe.resolve,require:a(t=>{if(typeof efn<"u")return efn(t);if(t.match(/\.json$/))return JSON.parse((0,rfn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),aTe=a(function(e,r){return nfn.parse(e.slice(),r).argv},"Parser");aTe.detailed=function(t,e){return nfn.parse(t.slice(),e)};aTe.camelCase=uY;aTe.decamelize=EVe;aTe.looksLikeNumber=_Ve;var ifn=aTe;var CS=require("path");p();function l5o(){return u5o()?0:1}a(l5o,"getProcessArgvBinIndex");function u5o(){return d5o()&&!process.defaultApp}a(u5o,"isBundledElectronApp");function d5o(){return!!process.versions.electron}a(d5o,"isElectronApp");function ofn(){return process.argv[l5o()]}a(ofn,"getProcessArgvBin");p();p();p();function YFt({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(YFt,"ansiRegex");var f5o=YFt();function KFt(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(f5o,"")}a(KFt,"stripAnsi");p();var sfn=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 p5o=new Intl.Segmenter,h5o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function JFt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=KFt(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of p5o.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)&&!h5o.test(c)){if(sfn().test(c)){o+=2;continue}o+=mVe(l,s)}}return o}a(JFt,"stringWidth");p();p();var Sce=require("fs"),afn=require("util"),cfn=require("path");var lfn={fs:{readFileSync:Sce.readFileSync,writeFile:Sce.writeFile},format:afn.format,resolve:cfn.resolve,exists:a(t=>{try{return(0,Sce.statSync)(t).isFile()}catch{return!1}},"exists")};p();var aP,ZFt=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(),aP.format.apply(aP.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),aP.format.apply(aP.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);aP.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{aP.fs.readFileSync&&(e=JSON.parse(aP.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=aP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=aP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return aP.exists(e)}};function ufn(t,e){aP=e;let r=new ZFt(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(ufn,"y18n");var m5o=a(t=>ufn(t,lfn),"y18n"),dfn=m5o;var mfn=require("node:module"),gfn=ce(pfn(),1),SVe=require("node:fs");var XFt=(0,e8t.fileURLToPath)(importMetaUrlShim),g5o=XFt.substring(0,XFt.lastIndexOf("node_modules")),A5o=(0,mfn.createRequire)(importMetaUrlShim),Afn={assert:{notStrictEqual:bVe.notStrictEqual,strictEqual:bVe.strictEqual},cliui:jFt,findUp:HFt,getEnv:a(t=>process.env[t],"getEnv"),inspect:hfn.inspect,getProcessArgvBin:ofn,mainFilename:g5o||process.cwd(),Parser:ifn,path:{basename:CS.basename,dirname:CS.dirname,extname:CS.extname,relative:CS.relative,resolve:CS.resolve,join:CS.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:SVe.readFileSync,readdirSync:SVe.readdirSync,require:A5o,getCallerFile:a(()=>{let t=(0,gfn.default)(3);return t.match(/^file:\/\//)?(0,e8t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:JFt,y18n:dfn({directory:(0,CS.resolve)(XFt,"../../../locales"),updateFiles:!1})};p();p();p();function C_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(C_,"assertNotStrictEqual");function t8t(t,e){e.assert.strictEqual(typeof t,"string")}a(t8t,"assertSingleKey");function Tce(t){return Object.keys(t)}a(Tce,"objectKeys");p();function $u(t){return!!t&&!!t.then&&typeof t.then=="function"}a($u,"isPromise");p();p();p();var Lp=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 W7(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(W7,"parseCommand");var y5o=["first","second","third","fourth","fifth","sixth"];function On(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[W7(`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 Lp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=yfn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Efn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=yfn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Efn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(On,"argsert");function yfn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(yfn,"guessType");function Efn(t,e,r){throw new Lp(`Invalid ${y5o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(Efn,"argumentTypeError");var TVe=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(On(" [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 _fn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(_fn,"commandMiddlewareFactory");function dY(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($u(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return $u(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(dY,"applyMiddleware");p();function fY(t,e,r=n=>{throw n}){try{let n=E5o(t)?t():t;return $u(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(fY,"maybeAsyncResult");function E5o(t){return typeof t=="function"}a(E5o,"isFunction");var Ice=/(^\*)|(^\$0)/,r8t=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=_fn(s);if(o=o||(()=>{}),Array.isArray(e))if(_5o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(v5o(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(Cfn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=W7(e);l=l.map(m=>W7(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Ice.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(Ice,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 $u(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(IVe(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if($u(h))return h.then(m=>(f=bfn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else C5o(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 $u(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=Ice.test(r.original)?r.original.replace(Ice,"").trim():r.original,o=e.filter(s=>!Ice.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=fY(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=dY(n,c,l,!1),n=fY(n,f=>{let h=r.handler(f);return $u(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),$u(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=dY(n,l,d,!0);return $u(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=W7(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=Ice.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(IVe(r))return r(e,!0);Cfn(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;C_(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();C_(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 vfn(t,e,r,n){return new r8t(t,e,r,n)}a(vfn,"command");function Cfn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(Cfn,"isCommandBuilderDefinition");function _5o(t){return t.every(e=>typeof e=="string")}a(_5o,"isCommandAndAliases");function IVe(t){return typeof t=="function"}a(IVe,"isCommandBuilderCallback");function C5o(t){return typeof t=="object"}a(C5o,"isCommandBuilderOptionDefinitions");function v5o(t){return typeof t=="object"&&!Array.isArray(t)}a(v5o,"isCommandHandlerDefinition");p();p();function z7(t={},e=()=>!0){let r={};return Tce(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(z7,"objFilter");p();function Y7(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(Y7,"setBlocking");function b5o(t){return typeof t=="boolean"}a(b5o,"isBoolean");function Tfn(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 q=o[O];if(b5o(q)){if(Q)throw Q;if(B)throw Error(B)}else q(B,Q,n)}else{if(t.getExitProcess()&&Y7(!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 Lp(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,q=!1){M&&(m=m.map(F=>(F[2]=!1,F))),m.push([B,Q||"",M,O,q])},"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=k(),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(),q=t.getGroups(),F=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(F.default)),U=U.filter(R),U=Object.keys(U.reduce((ie,we)=>(we!=="_"&&(ie[we]=!0),ie),{}));let W=n.getWrap(),V=e.cliui({width:W,wrap:!!W});if(!f){if(d.length)d.forEach(ie=>{V.div({text:`${ie[0].replace(/\$0/g,B)}`}),ie[1]&&V.div({text:`${ie[1]}`,padding:[1,0,0,0]})}),V.div();else if(m.length){let ie=null;M._?ie=`${B} <${r("command")}> -`:ie=`${B} [${r("command")}] -`,V.div(`${ie}`)}}if(m.length>1||m.length===1&&!m[0][2]){V.div(r("Commands:"));let ie=t.getInternalMethods().getContext(),we=ie.commands.length?`${ie.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((De,Te)=>De[0].localeCompare(Te[0])));let Ae=B?`${B} `:"";m.forEach(De=>{let Te=`${Ae}${we}${De[0].replace(/^\$0 ?/,"")}`;V.span({text:Te,padding:[0,2,0,2],width:v(m,W,`${B}${we}`)+4},{text:De[1]});let Z=[];De[2]&&Z.push(`[${r("default")}]`),De[3]&&De[3].length&&Z.push(`[${r("aliases:")} ${De[3].join(", ")}]`),De[4]&&(typeof De[4]=="string"?Z.push(`[${r("deprecated: %s",De[4])}]`):Z.push(`[${r("deprecated")}]`)),Z.length?V.div({text:Z.join(" "),padding:[0,0,0,2],align:"right"}):V.div()}),V.div()}let G=(Object.keys(F.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(ie=>!t.parsed.newAliases[ie]&&G.every(we=>(F.alias[we]||[]).indexOf(ie)===-1));let Y=r("Options:");q[Y]||(q[Y]=[]),w(U,F.alias,q,Y);let re=a(ie=>/^--/.test(xVe(ie)),"isLongSwitch"),j=Object.keys(q).filter(ie=>q[ie].length>0).map(ie=>{let we=q[ie].filter(R).map(Ae=>{if(G.includes(Ae))return Ae;for(let De=0,Te;(Te=G[De])!==void 0;De++)if((F.alias[Te]||[]).includes(Ae))return Te;return Ae});return{groupName:ie,normalizedKeys:we}}).filter(({normalizedKeys:ie})=>ie.length>0).map(({groupName:ie,normalizedKeys:we})=>{let Ae=we.reduce((De,Te)=>(De[Te]=[Te].concat(F.alias[Te]||[]).map(Z=>ie===n.getPositionalGroupName()?Z:(/^[0-9]$/.test(Z)?F.boolean.includes(Te)?"-":"--":Z.length>1?"--":"-")+Z).sort((Z,J)=>re(Z)===re(J)?0:re(Z)?1:-1).join(", "),De),{});return{groupName:ie,normalizedKeys:we,switches:Ae}});if(j.filter(({groupName:ie})=>ie!==n.getPositionalGroupName()).some(({normalizedKeys:ie,switches:we})=>!ie.every(Ae=>re(we[Ae])))&&j.filter(({groupName:ie})=>ie!==n.getPositionalGroupName()).forEach(({normalizedKeys:ie,switches:we})=>{ie.forEach(Ae=>{re(we[Ae])&&(we[Ae]=S5o(we[Ae],4))})}),j.forEach(({groupName:ie,normalizedKeys:we,switches:Ae})=>{V.div(ie),we.forEach(De=>{let Te=Ae[De],Z=g[De]||"",J=null;Z.includes(_)&&(Z=r(Z.substring(_.length))),F.boolean.includes(De)&&(J=`[${r("boolean")}]`),F.count.includes(De)&&(J=`[${r("count")}]`),F.string.includes(De)&&(J=`[${r("string")}]`),F.normalize.includes(De)&&(J=`[${r("string")}]`),F.array.includes(De)&&(J=`[${r("array")}]`),F.number.includes(De)&&(J=`[${r("number")}]`);let z=a(ae=>typeof ae=="string"?`[${r("deprecated: %s",ae)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),le=[De in O?z(O[De]):null,J,De in Q?`[${r("required")}]`:null,F.choices&&F.choices[De]?`[${r("choices:")} ${n.stringifiedValues(F.choices[De])}]`:null,x(F.default[De],F.defaultDescription[De])].filter(Boolean).join(" ");V.span({text:xVe(Te),padding:[0,2,0,2+Sfn(Te)],width:v(Ae,W)+4},Z);let K=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;le&&!K?V.div({text:le,padding:[0,0,0,2],align:"right"}):V.div()}),V.div()}),h.length&&(V.div(r("Examples:")),h.forEach(ie=>{ie[0]=ie[0].replace(/\$0/g,B)}),h.forEach(ie=>{ie[1]===""?V.div({text:ie[0],padding:[0,2,0,2]}):V.div({text:ie[0],padding:[0,2,0,2],width:v(h,W)+4},{text:ie[1]})}),V.div()),A.length>0){let ie=A.map(we=>we.replace(/\$0/g,B)).join(` -`);V.div(`${ie} -`)}return V.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} ${xVe(O[0])}`:xVe(O[0]))+Sfn(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=[],q=null;return Object.keys(Q).forEach(F=>{O=O.concat(Q[F])}),L.forEach(F=>{q=[F].concat(B[F]),q.some(U=>O.indexOf(U)!==-1)||Q[M].push(F)}),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||", ",q=[].concat(B);return!B||!q.length||q.forEach(F=>{M.length&&(M+=O),M+=JSON.stringify(F)}),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 k(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(k,"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=z7(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(Tfn,"usage");function n8t(t){return typeof t=="object"}a(n8t,"isIndentedText");function S5o(t,e){return n8t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(S5o,"addIndentation");function Sfn(t){return n8t(t)?t.indentation:0}a(Sfn,"getIndentation");function xVe(t){return n8t(t)?t.text:t}a(xVe,"getText");p();p();var Ifn=`###-begin-{{app_name}}-completions-### +`).map(n=>BMo(n,e,r)).join(` +`)}a(oFt,"wrapAnsi");function sFt(t){return Nun(t,{stringWidth:NL,stripAnsi:Wz,wrap:oFt})}a(sFt,"ui");p();var oce=require("path"),$$e=require("fs");function aFt(t,e){let r=(0,oce.resolve)(".",t),n;for((0,$$e.statSync)(r).isDirectory()||(r=(0,oce.dirname)(r));;){if(n=e(r,(0,$$e.readdirSync)(r)),n)return(0,oce.resolve)(r,n);if(r=(0,oce.dirname)(n=r),n===r)break}}a(aFt,"default");var ddn=require("util"),yFt=require("url");p();var Zun=require("util"),Y$e=require("path");p();function zz(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(V$e,"decamelize");function W$e(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(W$e,"looksLikeNumber");p();p();function Wun(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[X]=ue,E.keys.push(X))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([X,ue])=>{typeof ue=="function"&&(E.coercions[X]=ue,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,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[X]=ue)})),ne(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(X){(E.aliases[X]||[]).forEach(function(ue){u[ue]=u[X]})});let b=null;fe();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let X=0;X=3&&(H(we[1],E.arrays)?X=D(X,we[1],o,we[2]):H(we[1],E.nargs)!==!1?X=P(X,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&&(le=we[1],N(le,H(le,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&&(le=we[1],H(le,E.arrays)?X=D(X,le,o):H(le,E.nargs)!==!1?X=P(X,le,o):(Be=o[X+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(le,E.bools)&&!H(le,E.counts)||/^(true|false)$/.test(Be)?(N(le,Be),X++):N(le,Pe(le))));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[X+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(le=we[1],Be!==void 0&&!Be.match(/^-/)&&!H(le,E.bools)&&!H(le,E.counts)?(N(le,Be),X++):N(le,Pe(le)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Ne=ue.slice(1,-1).split(""),ie=!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(ue=>zz(ue)).join(".")],delete w[X]});function x(X){let ue=j("_",X);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(X,ue,qe,ie){let le,Ne=H(ue,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ie)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,Pe(ue)),X;let we=K(ie)?0:1;if(l["nargs-eats-options"])qe.length-(X+1)+we0&&(N(ue,ie),Be--),le=X+1;le0||we&&typeof we=="number"&&le.length>=we||(Ne=qe[Be],/^-/.test(Ne)&&!_.test(Ne)&&!ve(Ne)));Be++)X=Be,le.push(B(ue,Ne,s))}return typeof we=="number"&&(we&&le.length1&&l["dot-notation"]&&(E.aliases[le[0]]||[]).forEach(function(Ne){let we=Ne.split("."),Be=[].concat(le);Be.shift(),we=we.concat(Be),(E.aliases[X]||[]).includes(we.join("."))||J(w,we,ie)}),H(X,E.normalize)&&!H(X,E.arrays)&&[X].concat(E.aliases[X]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Be){ue=typeof Be=="string"?ML.normalize(Be):Be}})})}a(N,"setArg");function L(X,ue){E.aliases[X]&&E.aliases[X].length||(E.aliases[X]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||L(ue,X)}a(L,"addNewAlias");function B(X,ue,qe){qe&&(ue=FMo(ue)),(H(X,E.bools)||H(X,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ie=Array.isArray(ue)?ue.map(function(le){return j(X,le)}):j(X,ue);return H(X,E.counts)&&(K(ie)||typeof ie=="boolean")&&(ie=cFt()),H(X,E.normalize)&&H(X,E.arrays)&&(Array.isArray(ue)?ie=ue.map(le=>ML.normalize(le)):ie=ML.normalize(ue)),ie}a(B,"processValue");function j(X,ue){return!l["parse-positional-numbers"]&&X==="_"||!H(X,E.strings)&&!H(X,E.bools)&&!Array.isArray(ue)&&(W$e(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(X,E.numbers))&&(ue=Number(ue)),ue}a(j,"maybeCoerceNumber");function M(X){let ue=Object.create(null);W(ue,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ie=X[qe]||ue[qe];if(ie)try{let le=null,Ne=ML.resolve(ML.cwd(),ie),we=E.configs[qe];if(typeof we=="function"){try{le=we(Ne)}catch(Be){le=Be}if(le instanceof Error){b=le;return}}else le=ML.require(Ne);O(le)}catch(le){le.name==="PermissionDenied"?b=le:X[qe]&&(b=Error(y("Invalid JSON config file: %s",ie)))}})}a(M,"setConfig");function O(X,ue){Object.keys(X).forEach(function(qe){let ie=X[qe],le=ue?ue+"."+qe:qe;typeof ie=="object"&&ie!==null&&!Array.isArray(ie)&&l["dot-notation"]?O(ie,le):(!$(w,le.split("."))||H(le,E.arrays)&&l["combine-arrays"])&&N(le,ie)})}a(O,"setConfigObject");function q(){typeof d<"u"&&d.forEach(function(X){O(X)})}a(q,"setConfigObjects");function Q(X,ue){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ie=ML.env();Object.keys(ie).forEach(function(le){if(qe===""||le.lastIndexOf(qe,0)===0){let Ne=le.split("__").map(function(we,Be){return Be===0&&(we=we.substring(qe.length)),zz(we)});(ue&&E.configs[Ne.join(".")]||!ue)&&!$(X,Ne)&&N(Ne.join("."),ie[le])}})}a(Q,"applyEnvVars");function U(X){let ue,qe=new Set;Object.keys(X).forEach(function(ie){if(!qe.has(ie)&&(ue=H(ie,E.coercions),typeof ue=="function"))try{let le=j(ie,ue(X[ie]));[].concat(E.aliases[ie]||[],ie).forEach(Ne=>{qe.add(Ne),X[Ne]=le})}catch(le){b=le}})}a(U,"applyCoercions");function z(X){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof X[ue]>"u"&&(X[ue]=void 0)}),X}a(z,"setPlaceholderKeys");function W(X,ue,qe,ie=!1){Object.keys(qe).forEach(function(le){$(X,le.split("."))||(J(X,le.split("."),qe[le]),ie&&(A[le]=!0),(ue[le]||[]).forEach(function(Ne){$(X,Ne.split("."))||J(X,Ne.split("."),qe[le])}))})}a(W,"applyDefaultsAndAliases");function $(X,ue){let qe=X;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(le){qe=qe[le]||{}});let ie=ue[ue.length-1];return typeof qe!="object"?!1:ie in qe}a($,"hasKey");function J(X,ue,qe){let ie=X;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(tt){tt=zun(tt),typeof ie=="object"&&ie[tt]===void 0&&(ie[tt]={}),typeof ie[tt]!="object"||Array.isArray(ie[tt])?(Array.isArray(ie[tt])?ie[tt].push({}):ie[tt]=[ie[tt],{}],ie=ie[tt][ie[tt].length-1]):ie=ie[tt]});let le=zun(ue[ue.length-1]),Ne=H(ue.join("."),E.arrays),we=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(le,E.nargs)&&(Be=!0,(!K(ie[le])&&E.nargs[le]===1||Array.isArray(ie[le])&&ie[le].length===E.nargs[le])&&(ie[le]=void 0)),qe===cFt()?ie[le]=cFt(ie[le]):Array.isArray(ie[le])?Be&&Ne&&we?ie[le]=l["flatten-duplicate-arrays"]?ie[le].concat(qe):(Array.isArray(ie[le][0])?ie[le]:[ie[le]]).concat([qe]):!Be&&!!Ne==!!we?ie[le]=qe:ie[le]=ie[le].concat([qe]):ie[le]===void 0&&Ne?ie[le]=we?qe:[qe]:Be&&!(ie[le]===void 0||H(le,E.counts)||H(le,E.bools))?ie[le]=[ie[le],qe]:ie[le]=qe}a(J,"setKey");function ne(...X){X.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(ie){if(/-/.test(ie)&&l["camel-case-expansion"]){let le=zz(ie);le!==qe&&E.aliases[qe].indexOf(le)===-1&&(E.aliases[qe].push(le),g[le]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ie){if(ie.length>1&&/[A-Z]/.test(ie)&&l["camel-case-expansion"]){let le=V$e(ie,"-");le!==qe&&E.aliases[qe].indexOf(le)===-1&&(E.aliases[qe].push(le),g[le]=!0)}}),E.aliases[qe].forEach(function(ie){E.aliases[ie]=[qe].concat(E.aliases[qe].filter(function(le){return ie!==le}))}))})})}a(ne,"extendAliases");function H(X,ue){let qe=[].concat(E.aliases[X]||[],X),ie=Object.keys(ue),le=qe.find(Ne=>ie.includes(Ne));return le?ue[le]:!1}a(H,"checkAllAliases");function re(X){let ue=Object.keys(E);return[].concat(ue.map(ie=>E[ie])).some(function(ie){return Array.isArray(ie)?ie.includes(X):ie[X]})}a(re,"hasAnyFlag");function ae(X,...ue){return[].concat(...ue).some(function(ie){let le=X.match(ie);return le&&re(le[1])})}a(ae,"hasFlagsMatching");function Oe(X){if(X.match(_)||!X.match(/^-[^-]+/))return!1;let ue=!0,qe,ie=X.slice(1).split("");for(let le=0;leH(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(fe,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function LMo(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;oUMo,"env"),format:Zun.format,normalize:Y$e.normalize,resolve:Y$e.resolve,require:a(t=>{if(typeof Jun<"u")return Jun(t);if(t.match(/\.json$/))return JSON.parse((0,Xun.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),BSe=a(function(e,r){return edn.parse(e.slice(),r).argv},"Parser");BSe.detailed=function(t,e){return edn.parse(t.slice(),e)};BSe.camelCase=zz;BSe.decamelize=V$e;BSe.looksLikeNumber=W$e;var tdn=BSe;var pS=require("path");p();function QMo(){return qMo()?0:1}a(QMo,"getProcessArgvBinIndex");function qMo(){return jMo()&&!process.defaultApp}a(qMo,"isBundledElectronApp");function jMo(){return!!process.versions.electron}a(jMo,"isElectronApp");function rdn(){return process.argv[QMo()]}a(rdn,"getProcessArgvBin");p();p();p();function pFt({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(pFt,"ansiRegex");var HMo=pFt();function hFt(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(HMo,"")}a(hFt,"stripAnsi");p();var ndn=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 GMo=new Intl.Segmenter,$Mo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function mFt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=hFt(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of GMo.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)&&!$Mo.test(c)){if(ndn().test(c)){o+=2;continue}o+=j$e(l,s)}}return o}a(mFt,"stringWidth");p();p();var sce=require("fs"),idn=require("util"),odn=require("path");var sdn={fs:{readFileSync:sce.readFileSync,writeFile:sce.writeFile},format:idn.format,resolve:odn.resolve,exists:a(t=>{try{return(0,sce.statSync)(t).isFile()}catch{return!1}},"exists")};p();var ek,gFt=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(),ek.format.apply(ek.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),ek.format.apply(ek.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);ek.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{ek.fs.readFileSync&&(e=JSON.parse(ek.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=ek.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=ek.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return ek.exists(e)}};function adn(t,e){ek=e;let r=new gFt(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(adn,"y18n");var VMo=a(t=>adn(t,sdn),"y18n"),cdn=VMo;var fdn=require("node:module"),pdn=he(udn(),1),J$e=require("node:fs");var AFt=(0,yFt.fileURLToPath)(importMetaUrlShim),WMo=AFt.substring(0,AFt.lastIndexOf("node_modules")),zMo=(0,fdn.createRequire)(importMetaUrlShim),hdn={assert:{notStrictEqual:K$e.notStrictEqual,strictEqual:K$e.strictEqual},cliui:sFt,findUp:aFt,getEnv:a(t=>process.env[t],"getEnv"),inspect:ddn.inspect,getProcessArgvBin:rdn,mainFilename:WMo||process.cwd(),Parser:tdn,path:{basename:pS.basename,dirname:pS.dirname,extname:pS.extname,relative:pS.relative,resolve:pS.resolve,join:pS.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:J$e.readFileSync,readdirSync:J$e.readdirSync,require:zMo,getCallerFile:a(()=>{let t=(0,pdn.default)(3);return t.match(/^file:\/\//)?(0,yFt.fileURLToPath)(t):t},"getCallerFile"),stringWidth:mFt,y18n:cdn({directory:(0,pS.resolve)(AFt,"../../../locales"),updateFiles:!1})};p();p();p();function y_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(y_,"assertNotStrictEqual");function EFt(t,e){e.assert.strictEqual(typeof t,"string")}a(EFt,"assertSingleKey");function ace(t){return Object.keys(t)}a(ace,"objectKeys");p();function Gu(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Gu,"isPromise");p();p();p();var Fp=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 N7(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(N7,"parseCommand");var YMo=["first","second","third","fourth","fifth","sixth"];function On(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[N7(`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 Fp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=mdn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&gdn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=mdn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&gdn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(On,"argsert");function mdn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(mdn,"guessType");function gdn(t,e,r){throw new Fp(`Invalid ${YMo[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(gdn,"argumentTypeError");var Z$e=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(On(" [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 Adn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(Adn,"commandMiddlewareFactory");function Yz(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(Gu(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return Gu(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(Yz,"applyMiddleware");p();function Kz(t,e,r=n=>{throw n}){try{let n=KMo(t)?t():t;return Gu(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(Kz,"maybeAsyncResult");function KMo(t){return typeof t=="function"}a(KMo,"isFunction");var cce=/(^\*)|(^\$0)/,_Ft=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=Adn(s);if(o=o||(()=>{}),Array.isArray(e))if(JMo(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(XMo(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(ydn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=N7(e);l=l.map(m=>N7(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>cce.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(cce,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 Gu(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(X$e(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Gu(h))return h.then(m=>(f=_dn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else ZMo(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 Gu(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=cce.test(r.original)?r.original.replace(cce,"").trim():r.original,o=e.filter(s=>!cce.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=Kz(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=Yz(n,c,l,!1),n=Kz(n,f=>{let h=r.handler(f);return Gu(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Gu(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=Yz(n,l,d,!0);return Gu(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=N7(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=cce.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(X$e(r))return r(e,!0);ydn(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;y_(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();y_(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 Edn(t,e,r,n){return new _Ft(t,e,r,n)}a(Edn,"command");function ydn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(ydn,"isCommandBuilderDefinition");function JMo(t){return t.every(e=>typeof e=="string")}a(JMo,"isCommandAndAliases");function X$e(t){return typeof t=="function"}a(X$e,"isCommandBuilderCallback");function ZMo(t){return typeof t=="object"}a(ZMo,"isCommandBuilderOptionDefinitions");function XMo(t){return typeof t=="object"&&!Array.isArray(t)}a(XMo,"isCommandHandlerDefinition");p();p();function M7(t={},e=()=>!0){let r={};return ace(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(M7,"objFilter");p();function O7(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(O7,"setBlocking");function eOo(t){return typeof t=="boolean"}a(eOo,"isBoolean");function Cdn(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 q=o[O];if(eOo(q)){if(j)throw j;if(B)throw Error(B)}else q(B,j,n)}else{if(t.getExitProcess()&&O7(!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 Fp(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,q=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([B,j||"",M,O,q])},"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(),q=t.getGroups(),Q=t.getOptions(),U=[];U=U.concat(Object.keys(g)),U=U.concat(Object.keys(j)),U=U.concat(Object.keys(M)),U=U.concat(Object.keys(Q.default)),U=U.filter(R),U=Object.keys(U.reduce((ae,Oe)=>(Oe!=="_"&&(ae[Oe]=!0),ae),{}));let z=n.getWrap(),W=e.cliui({width:z,wrap:!!z});if(!f){if(d.length)d.forEach(ae=>{W.div({text:`${ae[0].replace(/\$0/g,B)}`}),ae[1]&&W.div({text:`${ae[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let ae=null;M._?ae=`${B} <${r("command")}> +`:ae=`${B} [${r("command")}] +`,W.div(`${ae}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let ae=t.getInternalMethods().getContext(),Oe=ae.commands.length?`${ae.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Fe,Pe)=>Fe[0].localeCompare(Pe[0])));let ve=B?`${B} `:"";m.forEach(Fe=>{let Pe=`${ve}${Oe}${Fe[0].replace(/^\$0 ?/,"")}`;W.span({text:Pe,padding:[0,2,0,2],width:v(m,z,`${B}${Oe}`)+4},{text:Fe[1]});let Z=[];Fe[2]&&Z.push(`[${r("default")}]`),Fe[3]&&Fe[3].length&&Z.push(`[${r("aliases:")} ${Fe[3].join(", ")}]`),Fe[4]&&(typeof Fe[4]=="string"?Z.push(`[${r("deprecated: %s",Fe[4])}]`):Z.push(`[${r("deprecated")}]`)),Z.length?W.div({text:Z.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let $=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(ae=>!t.parsed.newAliases[ae]&&$.every(Oe=>(Q.alias[Oe]||[]).indexOf(ae)===-1));let J=r("Options:");q[J]||(q[J]=[]),w(U,Q.alias,q,J);let ne=a(ae=>/^--/.test(eVe(ae)),"isLongSwitch"),H=Object.keys(q).filter(ae=>q[ae].length>0).map(ae=>{let Oe=q[ae].filter(R).map(ve=>{if($.includes(ve))return ve;for(let Fe=0,Pe;(Pe=$[Fe])!==void 0;Fe++)if((Q.alias[Pe]||[]).includes(ve))return Pe;return ve});return{groupName:ae,normalizedKeys:Oe}}).filter(({normalizedKeys:ae})=>ae.length>0).map(({groupName:ae,normalizedKeys:Oe})=>{let ve=Oe.reduce((Fe,Pe)=>(Fe[Pe]=[Pe].concat(Q.alias[Pe]||[]).map(Z=>ae===n.getPositionalGroupName()?Z:(/^[0-9]$/.test(Z)?Q.boolean.includes(Pe)?"-":"--":Z.length>1?"--":"-")+Z).sort((Z,ee)=>ne(Z)===ne(ee)?0:ne(Z)?1:-1).join(", "),Fe),{});return{groupName:ae,normalizedKeys:Oe,switches:ve}});if(H.filter(({groupName:ae})=>ae!==n.getPositionalGroupName()).some(({normalizedKeys:ae,switches:Oe})=>!ae.every(ve=>ne(Oe[ve])))&&H.filter(({groupName:ae})=>ae!==n.getPositionalGroupName()).forEach(({normalizedKeys:ae,switches:Oe})=>{ae.forEach(ve=>{ne(Oe[ve])&&(Oe[ve]=tOo(Oe[ve],4))})}),H.forEach(({groupName:ae,normalizedKeys:Oe,switches:ve})=>{W.div(ae),Oe.forEach(Fe=>{let Pe=ve[Fe],Z=g[Fe]||"",ee=null;Z.includes(_)&&(Z=r(Z.substring(_.length))),Q.boolean.includes(Fe)&&(ee=`[${r("boolean")}]`),Q.count.includes(Fe)&&(ee=`[${r("count")}]`),Q.string.includes(Fe)&&(ee=`[${r("string")}]`),Q.normalize.includes(Fe)&&(ee=`[${r("string")}]`),Q.array.includes(Fe)&&(ee=`[${r("array")}]`),Q.number.includes(Fe)&&(ee=`[${r("number")}]`);let K=a(ue=>typeof ue=="string"?`[${r("deprecated: %s",ue)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),fe=[Fe in O?K(O[Fe]):null,ee,Fe in j?`[${r("required")}]`:null,Q.choices&&Q.choices[Fe]?`[${r("choices:")} ${n.stringifiedValues(Q.choices[Fe])}]`:null,x(Q.default[Fe],Q.defaultDescription[Fe])].filter(Boolean).join(" ");W.span({text:eVe(Pe),padding:[0,2,0,2+vdn(Pe)],width:v(ve,z)+4},Z);let X=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;fe&&!X?W.div({text:fe,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(ae=>{ae[0]=ae[0].replace(/\$0/g,B)}),h.forEach(ae=>{ae[1]===""?W.div({text:ae[0],padding:[0,2,0,2]}):W.div({text:ae[0],padding:[0,2,0,2],width:v(h,z)+4},{text:ae[1]})}),W.div()),A.length>0){let ae=A.map(Oe=>Oe.replace(/\$0/g,B)).join(` +`);W.div(`${ae} +`)}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} ${eVe(O[0])}`:eVe(O[0]))+vdn(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=[],q=null;return Object.keys(j).forEach(Q=>{O=O.concat(j[Q])}),L.forEach(Q=>{q=[Q].concat(B[Q]),q.some(U=>O.indexOf(U)!==-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||", ",q=[].concat(B);return!B||!q.length||q.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=M7(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(Cdn,"usage");function vFt(t){return typeof t=="object"}a(vFt,"isIndentedText");function tOo(t,e){return vFt(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(tOo,"addIndentation");function vdn(t){return vFt(t)?t.indentation:0}a(vdn,"getIndentation");function eVe(t){return vFt(t)?t.text:t}a(eVe,"getText");p();p();var bdn=`###-begin-{{app_name}}-completions-### # # yargs command completion script # @@ -2260,7 +2216,7 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,xfn=`#compdef {{app_name}} +`,Sdn=`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -2287,64 +2243,64 @@ else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### -`;var i8t=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=W7(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(C_(this.customCompletionFunction,null,this.shim),I5o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return $u(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 x5o(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 $u(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?xfn:Ifn,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 wfn(t,e,r,n){return new i8t(t,e,r,n)}a(wfn,"completion");function I5o(t){return t.length<3}a(I5o,"isSyncCompletionFunction");function x5o(t){return t.length>3}a(x5o,"isFallbackCompletionFunction");p();p();function Rfn(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(Rfn,"levenshtein");var kfn=["$0","--","_"];function Pfn(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 CFt=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=N7(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(y_(this.customCompletionFunction,null,this.shim),nOo(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return Gu(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 iOo(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 Gu(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?Sdn:bdn,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 Tdn(t,e,r,n){return new CFt(t,e,r,n)}a(Tdn,"completion");function nOo(t){return t.length<3}a(nOo,"isSyncCompletionFunction");function iOo(t){return t.length>3}a(iOo,"isFallbackCompletionFunction");p();p();function Idn(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(Idn,"levenshtein");var xdn=["$0","--","_"];function wdn(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=>{!kfn.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=>{kfn.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){On(" [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)):(C_(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){On(" [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=Rfn(h,_);v<=3&&v!h[m]),u=z7(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();C_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(Pfn,"validation");p();var k5o={};var o8t=[],cTe;function wVe(t,e,r,n){cTe=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=R5o(e,t.extends);else try{c=k5o.resolve(t.extends)}catch{return t}w5o(c),o8t.push(c),o=s?JSON.parse(cTe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=wVe(o,cTe.path.dirname(c),r,cTe)}return o8t=[],r?Dfn(o,t):Object.assign({},o,t)}a(wVe,"applyExtends");function w5o(t){if(o8t.indexOf(t)>-1)throw new Lp(`Circular extended configurations: '${t}'.`)}a(w5o,"checkForCircularExtends");function R5o(t,e){return cTe.path.resolve(t,e)}a(R5o,"getPathToDefaultConfig");function Dfn(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]=Dfn(t[o],e[o]):r[o]=e[o];return r}a(Dfn,"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},Ce=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)},Fp,pY,lTe,Ev,vS,RVe,K7,hY,kVe,vx,PVe,bx,OM,bS,Sx,DVe,mY,Vm,ri,NVe,MVe,SS,gY,xce,AY,J7,OVe,Yi,yY,EY,_Y,go,BVe,BM,Hf;function Zfn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new g8t(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(Zfn,"YargsFactory");var Nfn=Symbol("copyDoubleDash"),Mfn=Symbol("copyDoubleDash"),s8t=Symbol("deleteFromParserHintObject"),Ofn=Symbol("emitWarning"),Bfn=Symbol("freeze"),Lfn=Symbol("getDollarZero"),CY=Symbol("getParserConfiguration"),Ffn=Symbol("getUsageConfiguration"),a8t=Symbol("guessLocale"),Ufn=Symbol("guessVersion"),Qfn=Symbol("parsePositionalNumbers"),c8t=Symbol("pkgUp"),Z7=Symbol("populateParserHintArray"),wce=Symbol("populateParserHintSingleValueDictionary"),l8t=Symbol("populateParserHintArrayDictionary"),u8t=Symbol("populateParserHintDictionary"),d8t=Symbol("sanitizeKey"),f8t=Symbol("setKey"),p8t=Symbol("unfreeze"),qfn=Symbol("validateAsync"),jfn=Symbol("getCommandInstance"),Hfn=Symbol("getContext"),Gfn=Symbol("getHasOutput"),$fn=Symbol("getLoggerInstance"),Vfn=Symbol("getParseContext"),Wfn=Symbol("getUsageInstance"),zfn=Symbol("getValidationInstance"),LVe=Symbol("hasParseCallback"),Yfn=Symbol("isGlobalContext"),vY=Symbol("postProcess"),Kfn=Symbol("rebase"),h8t=Symbol("reset"),uTe=Symbol("runYargsParserAndExecuteCommands"),m8t=Symbol("runValidation"),Jfn=Symbol("setHasOutput"),bY=Symbol("kTrackManuallySetKeys"),P5o="en_US",g8t=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Fp.set(this,void 0),pY.set(this,void 0),lTe.set(this,{commands:[],fullCommands:[]}),Ev.set(this,null),vS.set(this,null),RVe.set(this,"show-hidden"),K7.set(this,null),hY.set(this,!0),kVe.set(this,{}),vx.set(this,!0),PVe.set(this,[]),bx.set(this,void 0),OM.set(this,{}),bS.set(this,!1),Sx.set(this,null),DVe.set(this,!0),mY.set(this,void 0),Vm.set(this,""),ri.set(this,void 0),NVe.set(this,void 0),MVe.set(this,{}),SS.set(this,null),gY.set(this,null),xce.set(this,{}),AY.set(this,{}),J7.set(this,void 0),OVe.set(this,!1),Yi.set(this,void 0),yY.set(this,!1),EY.set(this,!1),_Y.set(this,!1),go.set(this,void 0),BVe.set(this,{}),BM.set(this,null),Hf.set(this,void 0),Bn(this,Yi,o,"f"),Bn(this,J7,e,"f"),Bn(this,pY,r,"f"),Bn(this,NVe,n,"f"),Bn(this,bx,new TVe(this),"f"),this.$0=this[Lfn](),this[h8t](),Bn(this,Fp,Ce(this,Fp,"f"),"f"),Bn(this,go,Ce(this,go,"f"),"f"),Bn(this,Hf,Ce(this,Hf,"f"),"f"),Bn(this,ri,Ce(this,ri,"f"),"f"),Ce(this,ri,"f").showHiddenOpt=Ce(this,RVe,"f"),Bn(this,mY,this[Mfn](),"f"),Ce(this,Yi,"f").y18n.setLocale(P5o)}addHelpOpt(e,r){let n="help";return On("[string|boolean] [string]",[e,r],arguments.length),Ce(this,Sx,"f")&&(this[s8t](Ce(this,Sx,"f")),Bn(this,Sx,null,"f")),e===!1&&r===void 0?this:(Bn(this,Sx,typeof e=="string"?e:n,"f"),this.boolean(Ce(this,Sx,"f")),this.describe(Ce(this,Sx,"f"),r||Ce(this,go,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(On("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:Ce(this,RVe,"f");return this.boolean(n),this.describe(n,r||Ce(this,go,"f").deferY18nLookup("Show hidden options")),Ce(this,ri,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return On(" [string|array]",[e,r],arguments.length),this[l8t](this.alias.bind(this),"alias",e,r),this}array(e){return On("",[e],arguments.length),this[Z7]("array",e),this[bY](e),this}boolean(e){return On("",[e],arguments.length),this[Z7]("boolean",e),this[bY](e),this}check(e,r){return On(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>fY(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Ce(this,go,"f").fail(s.toString(),s):Ce(this,go,"f").fail(Ce(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(Ce(this,go,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return On(" [string|array]",[e,r],arguments.length),this[l8t](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(On(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Lp("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 Lp("coerce callback must be provided");let n=e;return Ce(this,ri,"f").key[n]=!0,Ce(this,bx,"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:fY(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Lp(d.message)})},n),this}conflicts(e,r){return On(" [string|array]",[e,r],arguments.length),Ce(this,Hf,"f").conflicts(e,r),this}config(e="config",r,n){return On("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=wVe(e,Ce(this,pY,"f"),this[CY]()["deep-merge-config"]||!1,Ce(this,Yi,"f")),Ce(this,ri,"f").configObjects=(Ce(this,ri,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||Ce(this,go,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{Ce(this,ri,"f").config[o]=n||!0}),this)}completion(e,r,n){return On("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,vS,e||Ce(this,vS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Ce(this,vS,"f"),r),n&&Ce(this,Ev,"f").registerFunction(n),this}command(e,r,n,o,s,c){return On(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),Ce(this,Fp,"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){On(" [object]",[e,r],arguments.length);let n=Ce(this,NVe,"f")||Ce(this,Yi,"f").require;return Ce(this,Fp,"f").addDirectory(e,n,Ce(this,Yi,"f").getCallerFile(),r),this}count(e){return On("",[e],arguments.length),this[Z7]("count",e),this[bY](e),this}default(e,r,n){return On(" [*] [string]",[e,r,n],arguments.length),n&&(t8t(e,Ce(this,Yi,"f")),Ce(this,ri,"f").defaultDescription[e]=n),typeof r=="function"&&(t8t(e,Ce(this,Yi,"f")),Ce(this,ri,"f").defaultDescription[e]||(Ce(this,ri,"f").defaultDescription[e]=Ce(this,go,"f").functionDescription(r)),r=r.call()),this[wce](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 On("[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),Ce(this,ri,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{C_(n,!0,Ce(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(C_(n,!0,Ce(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{C_(n,!0,Ce(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 On(" [string]",[e,r],arguments.length),this[wce](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return On(" [string|boolean]",[e,r],arguments.length),Ce(this,ri,"f").deprecatedOptions[e]=r,this}describe(e,r){return On(" [string]",[e,r],arguments.length),this[f8t](e,!0),Ce(this,go,"f").describe(e,r),this}detectLocale(e){return On("",[e],arguments.length),Bn(this,hY,e,"f"),this}env(e){return On("[string|boolean]",[e],arguments.length),e===!1?delete Ce(this,ri,"f").envPrefix:Ce(this,ri,"f").envPrefix=e||"",this}epilogue(e){return On("",[e],arguments.length),Ce(this,go,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return On(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):Ce(this,go,"f").example(e,r),this}exit(e,r){Bn(this,bS,!0,"f"),Bn(this,K7,r,"f"),Ce(this,vx,"f")&&Ce(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return On("[boolean]",[e],arguments.length),Bn(this,vx,e,"f"),this}fail(e){if(On("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Lp("Invalid first argument. Expected function or boolean 'false'");return Ce(this,go,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return On(" [function]",[e,r],arguments.length),r?Ce(this,Ev,"f").getCompletion(e,r):new Promise((n,o)=>{Ce(this,Ev,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return On([],0),Ce(this,ri,"f").demandedOptions}getDemandedCommands(){return On([],0),Ce(this,ri,"f").demandedCommands}getDeprecatedOptions(){return On([],0),Ce(this,ri,"f").deprecatedOptions}getDetectLocale(){return Ce(this,hY,"f")}getExitProcess(){return Ce(this,vx,"f")}getGroups(){return Object.assign({},Ce(this,OM,"f"),Ce(this,AY,"f"))}getHelp(){if(Bn(this,bS,!0,"f"),!Ce(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[uTe](Ce(this,J7,"f"),void 0,void 0,0,!0);if($u(r))return r.then(()=>Ce(this,go,"f").help())}let e=Ce(this,Fp,"f").runDefaultBuilderOn(this);if($u(e))return e.then(()=>Ce(this,go,"f").help())}return Promise.resolve(Ce(this,go,"f").help())}getOptions(){return Ce(this,ri,"f")}getStrict(){return Ce(this,yY,"f")}getStrictCommands(){return Ce(this,EY,"f")}getStrictOptions(){return Ce(this,_Y,"f")}global(e,r){return On(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?Ce(this,ri,"f").local=Ce(this,ri,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{Ce(this,ri,"f").local.includes(n)||Ce(this,ri,"f").local.push(n)}),this}group(e,r){On(" ",[e,r],arguments.length);let n=Ce(this,AY,"f")[r]||Ce(this,OM,"f")[r];Ce(this,AY,"f")[r]&&delete Ce(this,AY,"f")[r];let o={};return Ce(this,OM,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return On("",[e],arguments.length),Ce(this,ri,"f").hiddenOptions.push(e),this}implies(e,r){return On(" [number|string|array]",[e,r],arguments.length),Ce(this,Hf,"f").implies(e,r),this}locale(e){return On("[string]",[e],arguments.length),e===void 0?(this[a8t](),Ce(this,Yi,"f").y18n.getLocale()):(Bn(this,hY,!1,"f"),Ce(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return Ce(this,bx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return On(" [number]",[e,r],arguments.length),this[wce](this.nargs.bind(this),"narg",e,r),this}normalize(e){return On("",[e],arguments.length),this[Z7]("normalize",e),this}number(e){return On("",[e],arguments.length),this[Z7]("number",e),this[bY](e),this}option(e,r){if(On(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[bY](e),Ce(this,BM,"f")&&(e==="version"||r?.alias==="version")&&this[Ofn](['"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"),Ce(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&&(Ce(this,ri,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=Ce(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){On("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Bfn](),typeof e>"u"&&(e=Ce(this,J7,"f")),typeof r=="object"&&(Bn(this,gY,r,"f"),r=n),typeof r=="function"&&(Bn(this,SS,r,"f"),r=!1),r||Bn(this,J7,e,"f"),Ce(this,SS,"f")&&Bn(this,vx,!1,"f");let o=this[uTe](e,!!r),s=this.parsed;return Ce(this,Ev,"f").setParsed(this.parsed),$u(o)?o.then(c=>(Ce(this,SS,"f")&&Ce(this,SS,"f").call(this,Ce(this,K7,"f"),c,Ce(this,Vm,"f")),c)).catch(c=>{throw Ce(this,SS,"f")&&Ce(this,SS,"f")(c,this.parsed.argv,Ce(this,Vm,"f")),c}).finally(()=>{this[p8t](),this.parsed=s}):(Ce(this,SS,"f")&&Ce(this,SS,"f").call(this,Ce(this,K7,"f"),o,Ce(this,Vm,"f")),this[p8t](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return $u(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if($u(o))throw new Lp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return On("",[e],arguments.length),Bn(this,MVe,e,"f"),this}pkgConf(e,r){On(" [string]",[e,r],arguments.length);let n=null,o=this[c8t](r||Ce(this,pY,"f"));return o[e]&&typeof o[e]=="object"&&(n=wVe(o[e],r||Ce(this,pY,"f"),this[CY]()["deep-merge-config"]||!1,Ce(this,Yi,"f")),Ce(this,ri,"f").configObjects=(Ce(this,ri,"f").configObjects||[]).concat(n)),this}positional(e,r){On(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=z7(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=Ce(this,lTe,"f").fullCommands[Ce(this,lTe,"f").fullCommands.length-1],s=o?Ce(this,Fp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return Tce(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,Ce(this,go,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return On("[boolean]",[e],arguments.length),Bn(this,OVe,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 On(" [number]",[e],arguments.length),typeof e=="string"&&Ce(this,ri,"f").narg[e]?this:(this[wce](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return On("[string] [string]",[e,r],arguments.length),e=e||this.$0,Ce(this,mY,"f").log(Ce(this,Ev,"f").generateCompletionScript(e,r||Ce(this,vS,"f")||"completion")),this}showHelp(e){if(On("[string|function]",[e],arguments.length),Bn(this,bS,!0,"f"),!Ce(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[uTe](Ce(this,J7,"f"),void 0,void 0,0,!0);if($u(n))return n.then(()=>{Ce(this,go,"f").showHelp(e)}),this}let r=Ce(this,Fp,"f").runDefaultBuilderOn(this);if($u(r))return r.then(()=>{Ce(this,go,"f").showHelp(e)}),this}return Ce(this,go,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return On("[boolean|string] [string]",[e,r],arguments.length),Ce(this,go,"f").showHelpOnFail(e,r),this}showVersion(e){return On("[string|function]",[e],arguments.length),Ce(this,go,"f").showVersion(e),this}skipValidation(e){return On("",[e],arguments.length),this[Z7]("skipValidation",e),this}strict(e){return On("[boolean]",[e],arguments.length),Bn(this,yY,e!==!1,"f"),this}strictCommands(e){return On("[boolean]",[e],arguments.length),Bn(this,EY,e!==!1,"f"),this}strictOptions(e){return On("[boolean]",[e],arguments.length),Bn(this,_Y,e!==!1,"f"),this}string(e){return On("",[e],arguments.length),this[Z7]("string",e),this[bY](e),this}terminalWidth(){return On([],0),Ce(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return On("",[e],arguments.length),Bn(this,hY,!1,"f"),Ce(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(On(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(C_(e,null,Ce(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Lp(".usage() description must start with $0 if being used as alias for .command()")}else return Ce(this,go,"f").usage(e),this}usageConfiguration(e){return On("",[e],arguments.length),Bn(this,BVe,e,"f"),this}version(e,r,n){let o="version";if(On("[boolean|string] [string] [string]",[e,r,n],arguments.length),Ce(this,BM,"f")&&(this[s8t](Ce(this,BM,"f")),Ce(this,go,"f").version(void 0),Bn(this,BM,null,"f")),arguments.length===0)n=this[Ufn](),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,BM,typeof e=="string"?e:o,"f"),r=r||Ce(this,go,"f").deferY18nLookup("Show version number"),Ce(this,go,"f").version(n||void 0),this.boolean(Ce(this,BM,"f")),this.describe(Ce(this,BM,"f"),r),this}wrap(e){return On("",[e],arguments.length),Ce(this,go,"f").wrap(e),this}[(Fp=new WeakMap,pY=new WeakMap,lTe=new WeakMap,Ev=new WeakMap,vS=new WeakMap,RVe=new WeakMap,K7=new WeakMap,hY=new WeakMap,kVe=new WeakMap,vx=new WeakMap,PVe=new WeakMap,bx=new WeakMap,OM=new WeakMap,bS=new WeakMap,Sx=new WeakMap,DVe=new WeakMap,mY=new WeakMap,Vm=new WeakMap,ri=new WeakMap,NVe=new WeakMap,MVe=new WeakMap,SS=new WeakMap,gY=new WeakMap,xce=new WeakMap,AY=new WeakMap,J7=new WeakMap,OVe=new WeakMap,Yi=new WeakMap,yY=new WeakMap,EY=new WeakMap,_Y=new WeakMap,go=new WeakMap,BVe=new WeakMap,BM=new WeakMap,Hf=new WeakMap,Nfn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Mfn](){return{log:a((...e)=>{this[LVe]()||console.log(...e),Bn(this,bS,!0,"f"),Ce(this,Vm,"f").length&&Bn(this,Vm,Ce(this,Vm,"f")+` -`,"f"),Bn(this,Vm,Ce(this,Vm,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[LVe]()||console.error(...e),Bn(this,bS,!0,"f"),Ce(this,Vm,"f").length&&Bn(this,Vm,Ce(this,Vm,"f")+` -`,"f"),Bn(this,Vm,Ce(this,Vm,"f")+e.join(" "),"f")},"error")}}[s8t](e){Tce(Ce(this,ri,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Ce(this,ri,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete Ce(this,go,"f").getDescriptions()[e]}[Ofn](e,r,n){Ce(this,kVe,"f")[n]||(Ce(this,Yi,"f").process.emitWarning(e,r),Ce(this,kVe,"f")[n]=!0)}[Bfn](){Ce(this,PVe,"f").push({options:Ce(this,ri,"f"),configObjects:Ce(this,ri,"f").configObjects.slice(0),exitProcess:Ce(this,vx,"f"),groups:Ce(this,OM,"f"),strict:Ce(this,yY,"f"),strictCommands:Ce(this,EY,"f"),strictOptions:Ce(this,_Y,"f"),completionCommand:Ce(this,vS,"f"),output:Ce(this,Vm,"f"),exitError:Ce(this,K7,"f"),hasOutput:Ce(this,bS,"f"),parsed:this.parsed,parseFn:Ce(this,SS,"f"),parseContext:Ce(this,gY,"f")}),Ce(this,go,"f").freeze(),Ce(this,Hf,"f").freeze(),Ce(this,Fp,"f").freeze(),Ce(this,bx,"f").freeze()}[Lfn](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Ce(this,Yi,"f").process.argv()[0])?r=Ce(this,Yi,"f").process.argv().slice(1,2):r=Ce(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[Kfn](Ce(this,pY,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});C_(s,void 0,Ce(this,Yi,"f")),n=JSON.parse(Ce(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return Ce(this,xce,"f")[r]=n||{},Ce(this,xce,"f")[r]}[Z7](e,r){r=[].concat(r),r.forEach(n=>{n=this[d8t](n),Ce(this,ri,"f")[e].push(n)})}[wce](e,r,n,o){this[u8t](e,r,n,o,(s,c,l)=>{Ce(this,ri,"f")[s][c]=l})}[l8t](e,r,n,o){this[u8t](e,r,n,o,(s,c,l)=>{Ce(this,ri,"f")[s][c]=(Ce(this,ri,"f")[s][c]||[]).concat(l)})}[u8t](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 Tce(n))e(c,n[c]);else s(r,this[d8t](n),o)}[d8t](e){return e==="__proto__"?"___proto___":e}[f8t](e,r){return this[wce](this[f8t].bind(this),"key",e,r),this}[p8t](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=Ce(this,PVe,"f").pop();C_(g,void 0,Ce(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,ri,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Bn(r,vx,y,"f")}}.value,groups:{set value(y){Bn(n,OM,y,"f")}}.value,output:{set value(y){Bn(o,Vm,y,"f")}}.value,exitError:{set value(y){Bn(s,K7,y,"f")}}.value,hasOutput:{set value(y){Bn(c,bS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,yY,y,"f")}}.value,strictCommands:{set value(y){Bn(u,EY,y,"f")}}.value,strictOptions:{set value(y){Bn(d,_Y,y,"f")}}.value,completionCommand:{set value(y){Bn(f,vS,y,"f")}}.value,parseFn:{set value(y){Bn(h,SS,y,"f")}}.value,parseContext:{set value(y){Bn(m,gY,y,"f")}}.value}=g,Ce(this,ri,"f").configObjects=A,Ce(this,go,"f").unfreeze(),Ce(this,Hf,"f").unfreeze(),Ce(this,Fp,"f").unfreeze(),Ce(this,bx,"f").unfreeze()}[qfn](e,r){return fY(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[jfn].bind(this),getContext:this[Hfn].bind(this),getHasOutput:this[Gfn].bind(this),getLoggerInstance:this[$fn].bind(this),getParseContext:this[Vfn].bind(this),getParserConfiguration:this[CY].bind(this),getUsageConfiguration:this[Ffn].bind(this),getUsageInstance:this[Wfn].bind(this),getValidationInstance:this[zfn].bind(this),hasParseCallback:this[LVe].bind(this),isGlobalContext:this[Yfn].bind(this),postProcess:this[vY].bind(this),reset:this[h8t].bind(this),runValidation:this[m8t].bind(this),runYargsParserAndExecuteCommands:this[uTe].bind(this),setHasOutput:this[Jfn].bind(this)}}[jfn](){return Ce(this,Fp,"f")}[Hfn](){return Ce(this,lTe,"f")}[Gfn](){return Ce(this,bS,"f")}[$fn](){return Ce(this,mY,"f")}[Vfn](){return Ce(this,gY,"f")||{}}[Wfn](){return Ce(this,go,"f")}[zfn](){return Ce(this,Hf,"f")}[LVe](){return!!Ce(this,SS,"f")}[Yfn](){return Ce(this,DVe,"f")}[vY](e,r,n,o){return n||$u(e)||(r||(e=this[Nfn](e)),(this[CY]()["parse-positional-numbers"]||this[CY]()["parse-positional-numbers"]===void 0)&&(e=this[Qfn](e)),o&&(e=dY(e,this,Ce(this,bx,"f").getMiddleware(),!1))),e}[h8t](e={}){Bn(this,ri,Ce(this,ri,"f")||{},"f");let r={};r.local=Ce(this,ri,"f").local||[],r.configObjects=Ce(this,ri,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(Ce(this,AY,"f"),Object.keys(Ce(this,OM,"f")).reduce((c,l)=>{let u=Ce(this,OM,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,OM,{},"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]=(Ce(this,ri,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=z7(Ce(this,ri,"f")[c],l=>!n[l])}),r.envPrefix=Ce(this,ri,"f").envPrefix,Bn(this,ri,r,"f"),Bn(this,go,Ce(this,go,"f")?Ce(this,go,"f").reset(n):Tfn(this,Ce(this,Yi,"f")),"f"),Bn(this,Hf,Ce(this,Hf,"f")?Ce(this,Hf,"f").reset(n):Pfn(this,Ce(this,go,"f"),Ce(this,Yi,"f")),"f"),Bn(this,Fp,Ce(this,Fp,"f")?Ce(this,Fp,"f").reset():vfn(Ce(this,go,"f"),Ce(this,Hf,"f"),Ce(this,bx,"f"),Ce(this,Yi,"f")),"f"),Ce(this,Ev,"f")||Bn(this,Ev,wfn(this,Ce(this,go,"f"),Ce(this,Fp,"f"),Ce(this,Yi,"f")),"f"),Ce(this,bx,"f").reset(),Bn(this,vS,null,"f"),Bn(this,Vm,"","f"),Bn(this,K7,null,"f"),Bn(this,bS,!1,"f"),this.parsed=!1,this}[Kfn](e,r){return Ce(this,Yi,"f").path.relative(e,r)}[uTe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||Ce(this,J7,"f"),Ce(this,ri,"f").__=Ce(this,Yi,"f").y18n.__,Ce(this,ri,"f").configuration=this[CY]();let h=!!Ce(this,ri,"f").configuration["populate--"],m=Object.assign({},Ce(this,ri,"f").configuration,{"populate--":!0}),g=Ce(this,Yi,"f").Parser.detailed(e,Object.assign({},Ce(this,ri,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,Ce(this,gY,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===Ce(this,Sx,"f")&&A[b]?_=!0:b===Ce(this,BM,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&Ce(this,go,"f").clearCachedHelpMessage();try{if(this[a8t](),r)return this[vY](A,h,!!n,!1);Ce(this,Sx,"f")&&[Ce(this,Sx,"f")].concat(E[Ce(this,Sx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,DVe,!1,"f");let b=Ce(this,Fp,"f").getCommands(),T=!((c=Ce(this,Ev,"f"))===null||c===void 0)&&c.completionKey?[(l=Ce(this,Ev,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=Ce(this,Ev,"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,k;A._[x]!==void 0;x++)if(k=String(A._[x]),b.includes(k)&&k!==Ce(this,vS,"f")){let D=Ce(this,Fp,"f").runCommand(k,this,g,x+1,s,_||v||s);return this[vY](D,h,!!n,!1)}else if(!R&&k!==Ce(this,vS,"f")){R=k;break}!Ce(this,Fp,"f").hasDefaultCommand()&&Ce(this,OVe,"f")&&R&&!w&&Ce(this,Hf,"f").recommendCommands(R,b)}Ce(this,vS,"f")&&A._.includes(Ce(this,vS,"f"))&&!T&&(Ce(this,vx,"f")&&Y7(!0),this.showCompletionScript(),this.exit(0))}if(Ce(this,Fp,"f").hasDefaultCommand()&&!w){let R=Ce(this,Fp,"f").runCommand(null,this,g,0,s,_||v||s);return this[vY](R,h,!!n,!1)}if(T){Ce(this,vx,"f")&&Y7(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${Ce(this,Ev,"f").completionKey}`)+1);return Ce(this,Ev,"f").getCompletion(R,(x,k)=>{if(x)throw new Lp(x.message);(k||[]).forEach(D=>{Ce(this,mY,"f").log(D)}),this.exit(0)}),this[vY](A,!h,!!n,!1)}if(Ce(this,bS,"f")||(_?(Ce(this,vx,"f")&&Y7(!0),f=!0,this.showHelp(R=>{Ce(this,mY,"f").log(R),this.exit(0)})):v&&(Ce(this,vx,"f")&&Y7(!0),f=!0,Ce(this,go,"f").showVersion("log"),this.exit(0))),!f&&Ce(this,ri,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>Ce(this,ri,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Lp(g.error.message);if(!T){let R=this[m8t](E,{},g.error);n||(y=dY(A,this,Ce(this,bx,"f").getMiddleware(),!0)),y=this[qfn](R,y??A),$u(y)&&!n&&(y=y.then(()=>dY(A,this,Ce(this,bx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Lp)Ce(this,go,"f").fail(b.message,b);else throw b}return this[vY](y??A,h,!!n,!0)}[m8t](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Lp(n.message);Ce(this,Hf,"f").nonOptionCount(c),Ce(this,Hf,"f").requiredArguments(c,s);let l=!1;Ce(this,EY,"f")&&(l=Ce(this,Hf,"f").unknownCommands(c)),Ce(this,yY,"f")&&!l?Ce(this,Hf,"f").unknownArguments(c,e,r,!!o):Ce(this,_Y,"f")&&Ce(this,Hf,"f").unknownArguments(c,e,{},!1,!1),Ce(this,Hf,"f").limitedChoices(c),Ce(this,Hf,"f").implications(c),Ce(this,Hf,"f").conflicting(c)}}[Jfn](){Bn(this,bS,!0,"f")}[bY](e){if(typeof e=="string")Ce(this,ri,"f").key[e]=!0;else for(let r of e)Ce(this,ri,"f").key[r]=!0}};function bfn(t){return!!t&&typeof t.getInternalMethods=="function"}a(bfn,"isYargsInstance");var D5o=Zfn(Afn),Xfn=D5o;p();p();var rpn=require("node:child_process"),npn=require("node:util");var N5o=(0,npn.promisify)(rpn.execFile),X7="1.0.49",epn="COPILOT_CLI_PATH",M5o="GITHUB_COPILOT_ACP_USE_CLI",Rce="@github/copilot",O5o=3e4,B5o=1e4,tpn=6e4,kce=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function ipn(){return process.env[M5o]!=="0"}a(ipn,"isCLIIntegrationEnabled");var A8t=process.platform==="win32";async function opn(){if(process.env[epn]){let l=process.env[epn],u=await dTe(l,["--version"]);if(u)return F5o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new kce("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await dTe("copilot",["--version"]);if(t&&fTe(t,X7))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await dTe(e,["--offline",Rce,"--version"],!1,B5o);if(r&&fTe(r,X7))return{path:e,args:[Rce],version:r,source:"npx"};let n=`${Rce}@${X7}`,o=await dTe(e,[n,"--version"],!1,tpn);if(o&&fTe(o,X7))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Rce}@latest`,c=await dTe(e,[s,"--version"],!0,tpn);if(c){if(fTe(c,X7))return{path:e,args:[s],version:c,source:"npx-latest"};throw new kce(`Latest published Copilot CLI version ${c} is below the minimum required ${X7}.`)}throw new kce(`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 ${Rce}`)}a(opn,"discoverCLI");function L5o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(L5o,"parseVersion");async function dTe(t,e,r=!1,n=O5o){try{let{stdout:o}=await N5o(t,e,{timeout:n,shell:A8t});return L5o(o)}catch(o){if(r)throw o;return null}}a(dTe,"tryGetVersion");function F5o(t,e){if(!fTe(t,X7))throw new kce(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${X7}. Update with: npm install -g ${Rce}@latest`)}a(F5o,"validateVersion");function fTe(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!==""}},SY=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=gr();this._timestamp=Date.now();this.uriSchemeCache=new FVe;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 tQ=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();p();p();var TY=ce(require("child_process")),E8t=ce(require("path")),vpn=ce(Cpn());function bpn(t){return t.replace(/^git version /,"")}a(bpn,"parseVersion");function _8t(t){return new Promise((e,r)=>{let n=[],o=TY.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:bpn(Buffer.concat(n).toString("utf8").trim())}))})}a(_8t,"findSpecificGit");function J5o(){return new Promise((t,e)=>{TY.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){TY.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:bpn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);TY.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(J5o,"findGitDarwin");function UVe(t){return t?_8t(E8t.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(UVe,"findSystemGitWin32");async function Z5o(){let t=await(0,vpn.default)("git.exe");return _8t(t)}a(Z5o,"findGitWin32InPath");function X5o(){return UVe(process.env.ProgramW6432).then(void 0,()=>UVe(process.env["ProgramFiles(x86)"])).then(void 0,()=>UVe(process.env.ProgramFiles)).then(void 0,()=>UVe(E8t.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>Z5o())}a(X5o,"findGitWin32");async function rQ(){try{switch(process.platform){case"darwin":return await J5o();case"win32":return await X5o();default:return await _8t("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(rQ,"findGit");var Spn=require("node:child_process"),Tpn=require("node:util");var e4o=(0,Tpn.promisify)(Spn.execFile);async function Ipn(t){return C8t(t,["github.com"])}a(Ipn,"resolveGitHubNwo");async function C8t(t,e){let r;try{r=(await rQ()).path}catch{return}let n;try{n=(await e4o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return t4o(n,e)}a(C8t,"resolveGitHubNwoForHosts");function t4o(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(t4o,"parseGitRemoteUrl");async function xpn(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(xpn,"resolveRepoIds");p();var r4o=3e4,QVe=class{constructor(e,r=r4o){this.ctx=e;this.timeoutMs=r;this.logger=new ge("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=HB(n).api,c=`${wpn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(ar).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...Gm(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=HB(s).api,u=new URL(`${wpn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(ar).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...Gm(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 wpn(t){return t.endsWith("/")?t.slice(0,-1):t}a(wpn,"trimTrailingSlash");p();p();function Gpn(t){return typeof t>"u"||t===null}a(Gpn,"isNothing");function n4o(t){return typeof t=="object"&&t!==null}a(n4o,"isObject");function i4o(t){return Array.isArray(t)?t:Gpn(t)?[]:[t]}a(i4o,"toArray");function o4o(t,e){var r,n,o,s;if(e)for(s=Object.keys(e),r=0,n=s.length;rl&&(s=" ... ",e=n-l+s.length),r-n>l&&(c=" ...",r=n+l-c.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+c,pos:n-e+s.length}}a(v8t,"getLine");function b8t(t,e){return V0.repeat(" ",e-t.length)+t}a(b8t,"padStart");function h4o(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],s,c=-1;s=r.exec(t.buffer);)o.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&c<0&&(c=n.length-2);c<0&&(c=n.length-1);var l="",u,d,f=Math.min(t.line+e.linesAfter,o.length).toString().length,h=e.maxLength-(e.indent+f+3);for(u=1;u<=e.linesBefore&&!(c-u<0);u++)d=v8t(t.buffer,n[c-u],o[c-u],t.position-(n[c]-n[c-u]),h),l=V0.repeat(" ",e.indent)+b8t((t.line-u+1).toString(),f)+" | "+d.str+` -`+l;for(d=v8t(t.buffer,n[c],o[c],t.position,h),l+=V0.repeat(" ",e.indent)+b8t((t.line+1).toString(),f)+" | "+d.str+` -`,l+=V0.repeat("-",e.indent+f+3+d.pos)+`^ -`,u=1;u<=e.linesAfter&&!(c+u>=o.length);u++)d=v8t(t.buffer,n[c+u],o[c+u],t.position-(n[c]-n[c+u]),h),l+=V0.repeat(" ",e.indent)+b8t((t.line+u+1).toString(),f)+" | "+d.str+` -`;return l.replace(/\n$/,"")}a(h4o,"makeSnippet");var m4o=h4o,g4o=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],A4o=["scalar","sequence","mapping"];function y4o(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}a(y4o,"compileStyleAliases");function E4o(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(g4o.indexOf(r)===-1)throw new _v('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=y4o(e.styleAliases||null),A4o.indexOf(this.kind)===-1)throw new _v('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}a(E4o,"Type$1");var Uy=E4o;function Rpn(t,e){var r=[];return t[e].forEach(function(n){var o=r.length;r.forEach(function(s,c){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(o=c)}),r[o]=n}),r}a(Rpn,"compileList");function _4o(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(o){o.multi?(t.multi[o.kind].push(o),t.multi.fallback.push(o)):t[o.kind][o.tag]=t.fallback[o.tag]=o}for(a(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:a(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:a(function(t){return t.toString(10)},"decimal"),hexadecimal:a(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),q4o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function j4o(t){return!(t===null||!q4o.test(t)||t[t.length-1]==="_")}a(j4o,"resolveYamlFloat");function H4o(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}a(H4o,"constructYamlFloat");var G4o=/^[-+]?[0-9]+e/;function $4o(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(V0.isNegativeZero(t))return"-0.0";return r=t.toString(10),G4o.test(r)?r.replace("e",".e"):r}a($4o,"representYamlFloat");function V4o(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||V0.isNegativeZero(t))}a(V4o,"isFloat");var W4o=new Uy("tag:yaml.org,2002:float",{kind:"scalar",resolve:j4o,construct:H4o,predicate:V4o,represent:$4o,defaultStyle:"lowercase"}),z4o=T4o.extend({implicit:[R4o,N4o,Q4o,W4o]}),Y4o=z4o,Vpn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Wpn=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 K4o(t){return t===null?!1:Vpn.exec(t)!==null||Wpn.exec(t)!==null}a(K4o,"resolveYamlTimestamp");function J4o(t){var e,r,n,o,s,c,l,u=0,d=null,f,h,m;if(e=Vpn.exec(t),e===null&&(e=Wpn.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,o=+e[3],!e[4])return new Date(Date.UTC(r,n,o));if(s=+e[4],c=+e[5],l=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(f=+e[10],h=+(e[11]||0),d=(f*60+h)*6e4,e[9]==="-"&&(d=-d)),m=new Date(Date.UTC(r,n,o,s,c,l,u)),d&&m.setTime(m.getTime()-d),m}a(J4o,"constructYamlTimestamp");function Z4o(t){return t.toISOString()}a(Z4o,"representYamlTimestamp");var X4o=new Uy("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:K4o,construct:J4o,instanceOf:Date,represent:Z4o});function eBo(t){return t==="<<"||t===null}a(eBo,"resolveYamlMerge");var tBo=new Uy("tag:yaml.org,2002:merge",{kind:"scalar",resolve:eBo}),k8t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function rBo(t){if(t===null)return!1;var e,r,n=0,o=t.length,s=k8t;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}a(rBo,"resolveYamlBinary");function nBo(t){var e,r,n=t.replace(/[\r\n=]/g,""),o=n.length,s=k8t,c=0,l=[];for(e=0;e>16&255),l.push(c>>8&255),l.push(c&255)),c=c<<6|s.indexOf(n.charAt(e));return r=o%4*6,r===0?(l.push(c>>16&255),l.push(c>>8&255),l.push(c&255)):r===18?(l.push(c>>10&255),l.push(c>>2&255)):r===12&&l.push(c>>4&255),new Uint8Array(l)}a(nBo,"constructYamlBinary");function iBo(t){var e="",r=0,n,o,s=t.length,c=k8t;for(n=0;n>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]),r=(r<<8)+t[n];return o=s%3,o===0?(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]):o===2?(e+=c[r>>10&63],e+=c[r>>4&63],e+=c[r<<2&63],e+=c[64]):o===1&&(e+=c[r>>2&63],e+=c[r<<4&63],e+=c[64],e+=c[64]),e}a(iBo,"representYamlBinary");function oBo(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}a(oBo,"isBinary");var sBo=new Uy("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rBo,construct:nBo,predicate:oBo,represent:iBo}),aBo=Object.prototype.hasOwnProperty,cBo=Object.prototype.toString;function lBo(t){if(t===null)return!0;var e=[],r,n,o,s,c,l=t;for(r=0,n=l.length;r>10)+55296,(t-65536&1023)+56320)}a(xBo,"charFromCodepoint");function Xpn(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}a(Xpn,"setProperty");var ehn=new Array(256),thn=new Array(256);for(IY=0;IY<256;IY++)ehn[IY]=Dpn(IY)?1:0,thn[IY]=Dpn(IY);var IY;function wBo(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||zpn,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}a(wBo,"State$1");function rhn(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=m4o(r),new _v(e,r)}a(rhn,"generateError");function di(t,e){throw rhn(t,e)}a(di,"throwError");function HVe(t,e){t.onWarning&&t.onWarning.call(null,rhn(t,e))}a(HVe,"throwWarning");var Npn={YAML:a(function(e,r,n){var o,s,c;e.version!==null&&di(e,"duplication of %YAML directive"),n.length!==1&&di(e,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&di(e,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),c=parseInt(o[2],10),s!==1&&di(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=c<2,c!==1&&c!==2&&HVe(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(e,r,n){var o,s;n.length!==2&&di(e,"TAG directive accepts exactly two arguments"),o=n[0],s=n[1],Jpn.test(o)||di(e,"ill-formed tag handle (first argument) of the TAG directive"),iQ.call(e.tagMap,o)&&di(e,'there is a previously declared suffix for "'+o+'" tag handle'),Zpn.test(s)||di(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{di(e,"tag prefix is malformed: "+s)}e.tagMap[o]=s},"handleTagDirective")};function nQ(t,e,r,n){var o,s,c,l;if(e1&&(t.result+=V0.repeat(` -`,e-1))}a(D8t,"writeFoldedLines");function RBo(t,e,r){var n,o,s,c,l,u,d,f,h=t.kind,m=t.result,g;if(g=t.input.charCodeAt(t.position),Cv(g)||Dce(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96||(g===63||g===45)&&(o=t.input.charCodeAt(t.position+1),Cv(o)||r&&Dce(o)))return!1;for(t.kind="scalar",t.result="",s=c=t.position,l=!1;g!==0;){if(g===58){if(o=t.input.charCodeAt(t.position+1),Cv(o)||r&&Dce(o))break}else if(g===35){if(n=t.input.charCodeAt(t.position-1),Cv(n))break}else{if(t.position===t.lineStart&&VVe(t)||r&&Dce(g))break;if(LM(g))if(u=t.line,d=t.lineStart,f=t.lineIndent,Lh(t,!1,-1),t.lineIndent>=e){l=!0,g=t.input.charCodeAt(t.position);continue}else{t.position=c,t.line=u,t.lineStart=d,t.lineIndent=f;break}}l&&(nQ(t,s,c,!1),D8t(t,t.line-u),s=c=t.position,l=!1),xY(g)||(c=t.position+1),g=t.input.charCodeAt(++t.position)}return nQ(t,s,c,!1),t.result?!0:(t.kind=h,t.result=m,!1)}a(RBo,"readPlainScalar");function kBo(t,e){var r,n,o;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=o=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(nQ(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,o=t.position;else return!0;else LM(r)?(nQ(t,n,o,!0),D8t(t,Lh(t,!1,e)),n=o=t.position):t.position===t.lineStart&&VVe(t)?di(t,"unexpected end of the document within a single quoted scalar"):(t.position++,o=t.position);di(t,"unexpected end of the stream within a single quoted scalar")}a(kBo,"readSingleQuotedScalar");function PBo(t,e){var r,n,o,s,c,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return nQ(t,r,t.position,!0),t.position++,!0;if(l===92){if(nQ(t,r,t.position,!0),l=t.input.charCodeAt(++t.position),LM(l))Lh(t,!1,e);else if(l<256&&ehn[l])t.result+=thn[l],t.position++;else if((c=TBo(l))>0){for(o=c,s=0;o>0;o--)l=t.input.charCodeAt(++t.position),(c=SBo(l))>=0?s=(s<<4)+c:di(t,"expected hexadecimal character");t.result+=xBo(s),t.position++}else di(t,"unknown escape sequence");r=n=t.position}else LM(l)?(nQ(t,r,n,!0),D8t(t,Lh(t,!1,e)),r=n=t.position):t.position===t.lineStart&&VVe(t)?di(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}di(t,"unexpected end of the stream within a double quoted scalar")}a(PBo,"readDoubleQuotedScalar");function DBo(t,e){var r=!0,n,o,s,c=t.tag,l,u=t.anchor,d,f,h,m,g,A=Object.create(null),y,E,_,v;if(v=t.input.charCodeAt(t.position),v===91)f=93,g=!1,l=[];else if(v===123)f=125,g=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),v=t.input.charCodeAt(++t.position);v!==0;){if(Lh(t,!0,e),v=t.input.charCodeAt(t.position),v===f)return t.position++,t.tag=c,t.anchor=u,t.kind=g?"mapping":"sequence",t.result=l,!0;r?v===44&&di(t,"expected the node content, but found ','"):di(t,"missed comma between flow collection entries"),E=y=_=null,h=m=!1,v===63&&(d=t.input.charCodeAt(t.position+1),Cv(d)&&(h=m=!0,t.position++,Lh(t,!0,e))),n=t.line,o=t.lineStart,s=t.position,Mce(t,e,qVe,!1,!0),E=t.tag,y=t.result,Lh(t,!0,e),v=t.input.charCodeAt(t.position),(m||t.line===n)&&v===58&&(h=!0,v=t.input.charCodeAt(++t.position),Lh(t,!0,e),Mce(t,e,qVe,!1,!0),_=t.result),g?Nce(t,l,A,E,y,_,n,o,s):h?l.push(Nce(t,null,A,E,y,_,n,o,s)):l.push(y),Lh(t,!0,e),v=t.input.charCodeAt(t.position),v===44?(r=!0,v=t.input.charCodeAt(++t.position)):r=!1}di(t,"unexpected end of the stream within a flow collection")}a(DBo,"readFlowCollection");function NBo(t,e){var r,n,o=S8t,s=!1,c=!1,l=e,u=0,d=!1,f,h;if(h=t.input.charCodeAt(t.position),h===124)n=!1;else if(h===62)n=!0;else return!1;for(t.kind="scalar",t.result="";h!==0;)if(h=t.input.charCodeAt(++t.position),h===43||h===45)S8t===o?o=h===43?kpn:_Bo:di(t,"repeat of a chomping mode identifier");else if((f=IBo(h))>=0)f===0?di(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?di(t,"repeat of an indentation width identifier"):(l=e+f-1,c=!0);else break;if(xY(h)){do h=t.input.charCodeAt(++t.position);while(xY(h));if(h===35)do h=t.input.charCodeAt(++t.position);while(!LM(h)&&h!==0)}for(;h!==0;){for(P8t(t),t.lineIndent=0,h=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),LM(h)){u++;continue}if(t.lineIndente)&&u!==0)di(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(E&&(c=t.line,l=t.lineStart,u=t.position),Mce(t,e,jVe,!0,o)&&(E?A=t.result:y=t.result),E||(Nce(t,h,m,g,A,y,c,l,u),g=A=y=null),Lh(t,!0,-1),v=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&v!==0)di(t,"bad indentation of a mapping entry");else if(t.lineIndente?u=1:t.lineIndent===e?u=0:t.lineIndente?u=1:t.lineIndent===e?u=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),h=0,m=t.implicitTypes.length;h"),t.result!==null&&A.kind!==t.kind&&di(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+A.kind+'", not "'+t.kind+'"'),A.resolve(t.result,t.tag)?(t.result=A.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):di(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||f}a(Mce,"composeNode");function FBo(t){var e=t.position,r,n,o,s=!1,c;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(c=t.input.charCodeAt(t.position))!==0&&(Lh(t,!0,-1),c=t.input.charCodeAt(t.position),!(t.lineIndent>0||c!==37));){for(s=!0,c=t.input.charCodeAt(++t.position),r=t.position;c!==0&&!Cv(c);)c=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),o=[],n.length<1&&di(t,"directive name must not be less than one character in length");c!==0;){for(;xY(c);)c=t.input.charCodeAt(++t.position);if(c===35){do c=t.input.charCodeAt(++t.position);while(c!==0&&!LM(c));break}if(LM(c))break;for(r=t.position;c!==0&&!Cv(c);)c=t.input.charCodeAt(++t.position);o.push(t.input.slice(r,t.position))}c!==0&&P8t(t),iQ.call(Npn,n)?Npn[n](t,n,o):HVe(t,'unknown document directive "'+n+'"')}if(Lh(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Lh(t,!0,-1)):s&&di(t,"directives end mark is expected"),Mce(t,t.lineIndent-1,jVe,!1,!0),Lh(t,!0,-1),t.checkLineBreaks&&vBo.test(t.input.slice(e,t.position))&&HVe(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&VVe(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Lh(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=nhn(t,r);if(typeof e!="function")return n;for(var o=0,s=n.length;o=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}a(pTe,"codePointAt");function fhn(t){var e=/^\n* /;return e.test(t)}a(fhn,"needIndentIndicator");var phn=1,w8t=2,hhn=3,mhn=4,Pce=5;function hLo(t,e,r,n,o,s,c,l){var u,d=0,f=null,h=!1,m=!1,g=n!==-1,A=-1,y=fLo(pTe(t,0))&&pLo(pTe(t,t.length-1));if(e||c)for(u=0;u=65536?u+=2:u++){if(d=pTe(t,u),!ATe(d))return Pce;y=y&&Fpn(d,f,l),f=d}else{for(u=0;u=65536?u+=2:u++){if(d=pTe(t,u),d===mTe)h=!0,g&&(m=m||u-A-1>n&&t[A+1]!==" ",A=u);else if(!ATe(d))return Pce;y=y&&Fpn(d,f,l),f=d}m=m||g&&u-A-1>n&&t[A+1]!==" "}return!h&&!m?y&&!c&&!o(t)?phn:s===gTe?Pce:w8t:r>9&&fhn(t)?Pce:c?s===gTe?Pce:w8t:m?mhn:hhn}a(hLo,"chooseScalarStyle");function mLo(t,e,r,n,o){t.dump=(function(){if(e.length===0)return t.quotingType===gTe?'""':"''";if(!t.noCompatMode&&(oLo.indexOf(e)!==-1||sLo.test(e)))return t.quotingType===gTe?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),c=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function u(d){return dLo(t,d)}switch(a(u,"testAmbiguity"),hLo(e,l,t.indent,c,u,t.quotingType,t.forceQuotes&&!n,o)){case phn:return e;case w8t:return"'"+e.replace(/'/g,"''")+"'";case hhn:return"|"+Upn(e,t.indent)+Qpn(Bpn(e,s));case mhn:return">"+Upn(e,t.indent)+Qpn(Bpn(gLo(e,c),s));case Pce:return'"'+ALo(e)+'"';default:throw new _v("impossible error: invalid scalar style")}})()}a(mLo,"writeScalar");function Upn(t,e){var r=fhn(t)?String(e):"",n=t[t.length-1]===` -`,o=n&&(t[t.length-2]===` -`||t===` -`),s=o?"+":n?"":"-";return r+s+` -`}a(Upn,"blockHeader");function Qpn(t){return t[t.length-1]===` -`?t.slice(0,-1):t}a(Qpn,"dropEndingNewline");function gLo(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var d=t.indexOf(` -`);return d=d!==-1?d:t.length,r.lastIndex=d,qpn(t.slice(0,d),e)})(),o=t[0]===` -`||t[0]===" ",s,c;c=r.exec(t);){var l=c[1],u=c[2];s=u[0]===" ",n+=l+(!o&&!s&&u!==""?` -`:"")+qpn(u,e),o=s}return n}a(gLo,"foldString");function qpn(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,o=0,s,c=0,l=0,u="";n=r.exec(t);)l=n.index,l-o>e&&(s=c>o?c:l,u+=` -`+t.slice(o,s),o=s+1),c=l;return u+=` -`,t.length-o>e&&c>o?u+=t.slice(o,c)+` -`+t.slice(c+1):u+=t.slice(o),u.slice(1)}a(qpn,"foldLine");function ALo(t){for(var e="",r=0,n,o=0;o=65536?o+=2:o++)r=pTe(t,o),n=Qy[r],!n&&ATe(r)?(e+=t[o],r>=65536&&(e+=t[o+1])):e+=n||cLo(r);return e}a(ALo,"escapeString");function yLo(t,e,r){var n="",o=t.tag,s,c,l;for(s=0,c=r.length;s"u"&&zL(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=o,t.dump="["+n+"]"}a(yLo,"writeFlowSequence");function jpn(t,e,r,n){var o="",s=t.tag,c,l,u;for(c=0,l=r.length;c"u"&&zL(t,e+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=x8t(t,e)),t.dump&&mTe===t.dump.charCodeAt(0)?o+="-":o+="- ",o+=t.dump);t.tag=s,t.dump=o||"[]"}a(jpn,"writeBlockSequence");function ELo(t,e,r){var n="",o=t.tag,s=Object.keys(r),c,l,u,d,f;for(c=0,l=s.length;c1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),zL(t,e,d,!1,!1)&&(f+=t.dump,n+=f));t.tag=o,t.dump="{"+n+"}"}a(ELo,"writeFlowMapping");function _Lo(t,e,r,n){var o="",s=t.tag,c=Object.keys(r),l,u,d,f,h,m;if(t.sortKeys===!0)c.sort();else if(typeof t.sortKeys=="function")c.sort(t.sortKeys);else if(t.sortKeys)throw new _v("sortKeys must be a boolean or a function");for(l=0,u=c.length;l1024,h&&(t.dump&&mTe===t.dump.charCodeAt(0)?m+="?":m+="? "),m+=t.dump,h&&(m+=x8t(t,e)),zL(t,e+1,f,!0,h)&&(t.dump&&mTe===t.dump.charCodeAt(0)?m+=":":m+=": ",m+=t.dump,o+=m));t.tag=s,t.dump=o||"{}"}a(_Lo,"writeBlockMapping");function Hpn(t,e,r){var n,o,s,c,l,u;for(o=r?t.explicitTypes:t.implicitTypes,s=0,c=o.length;s tag resolver accepts not "'+u+'" style');t.dump=n}return!0}return!1}a(Hpn,"detectType");function zL(t,e,r,n,o,s,c){t.tag=null,t.dump=r,Hpn(t,r,!1)||Hpn(t,r,!0);var l=ohn.call(t.dump),u=n,d;n&&(n=t.flowLevel<0||t.flowLevel>e);var f=l==="[object Object]"||l==="[object Array]",h,m;if(f&&(h=t.duplicates.indexOf(r),m=h!==-1),(t.tag!==null&&t.tag!=="?"||m||t.indent!==2&&e>0)&&(o=!1),m&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(f&&m&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(_Lo(t,e,t.dump,o),m&&(t.dump="&ref_"+h+t.dump)):(ELo(t,e,t.dump),m&&(t.dump="&ref_"+h+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!c&&e>0?jpn(t,e-1,t.dump,o):jpn(t,e,t.dump,o),m&&(t.dump="&ref_"+h+t.dump)):(yLo(t,e,t.dump),m&&(t.dump="&ref_"+h+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&mLo(t,t.dump,e,s,u);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new _v("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(d=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",t.dump=d+" "+t.dump)}return!0}a(zL,"writeNode");function CLo(t,e){var r=[],n=[],o,s;for(R8t(t,r,n),o=0,s=n.length;o0&&!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=wY(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=>{!xdn.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=>{xdn.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){On(" [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)):(y_(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){On(" [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=Idn(h,_);v<=3&&v!h[m]),u=M7(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();y_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(wdn,"validation");p();var aOo={};var bFt=[],LSe;function tVe(t,e,r,n){LSe=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=sOo(e,t.extends);else try{c=aOo.resolve(t.extends)}catch{return t}oOo(c),bFt.push(c),o=s?JSON.parse(LSe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=tVe(o,LSe.path.dirname(c),r,LSe)}return bFt=[],r?Rdn(o,t):Object.assign({},o,t)}a(tVe,"applyExtends");function oOo(t){if(bFt.indexOf(t)>-1)throw new Fp(`Circular extended configurations: '${t}'.`)}a(oOo,"checkForCircularExtends");function sOo(t,e){return LSe.path.resolve(t,e)}a(sOo,"getPathToDefaultConfig");function Rdn(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]=Rdn(t[o],e[o]):r[o]=e[o];return r}a(Rdn,"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)},Up,Jz,FSe,mC,hS,rVe,B7,Zz,nVe,gx,iVe,Ax,IM,mS,yx,oVe,Xz,Vm,ri,sVe,aVe,gS,eY,lce,tY,L7,cVe,Wi,rY,nY,iY,mo,lVe,xM,Gf;function Ydn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new MFt(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(Ydn,"YargsFactory");var Pdn=Symbol("copyDoubleDash"),kdn=Symbol("copyDoubleDash"),SFt=Symbol("deleteFromParserHintObject"),Ddn=Symbol("emitWarning"),Ndn=Symbol("freeze"),Mdn=Symbol("getDollarZero"),oY=Symbol("getParserConfiguration"),Odn=Symbol("getUsageConfiguration"),TFt=Symbol("guessLocale"),Bdn=Symbol("guessVersion"),Ldn=Symbol("parsePositionalNumbers"),IFt=Symbol("pkgUp"),F7=Symbol("populateParserHintArray"),uce=Symbol("populateParserHintSingleValueDictionary"),xFt=Symbol("populateParserHintArrayDictionary"),wFt=Symbol("populateParserHintDictionary"),RFt=Symbol("sanitizeKey"),PFt=Symbol("setKey"),kFt=Symbol("unfreeze"),Fdn=Symbol("validateAsync"),Udn=Symbol("getCommandInstance"),Qdn=Symbol("getContext"),qdn=Symbol("getHasOutput"),jdn=Symbol("getLoggerInstance"),Hdn=Symbol("getParseContext"),Gdn=Symbol("getUsageInstance"),$dn=Symbol("getValidationInstance"),uVe=Symbol("hasParseCallback"),Vdn=Symbol("isGlobalContext"),sY=Symbol("postProcess"),Wdn=Symbol("rebase"),DFt=Symbol("reset"),USe=Symbol("runYargsParserAndExecuteCommands"),NFt=Symbol("runValidation"),zdn=Symbol("setHasOutput"),aY=Symbol("kTrackManuallySetKeys"),cOo="en_US",MFt=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Up.set(this,void 0),Jz.set(this,void 0),FSe.set(this,{commands:[],fullCommands:[]}),mC.set(this,null),hS.set(this,null),rVe.set(this,"show-hidden"),B7.set(this,null),Zz.set(this,!0),nVe.set(this,{}),gx.set(this,!0),iVe.set(this,[]),Ax.set(this,void 0),IM.set(this,{}),mS.set(this,!1),yx.set(this,null),oVe.set(this,!0),Xz.set(this,void 0),Vm.set(this,""),ri.set(this,void 0),sVe.set(this,void 0),aVe.set(this,{}),gS.set(this,null),eY.set(this,null),lce.set(this,{}),tY.set(this,{}),L7.set(this,void 0),cVe.set(this,!1),Wi.set(this,void 0),rY.set(this,!1),nY.set(this,!1),iY.set(this,!1),mo.set(this,void 0),lVe.set(this,{}),xM.set(this,null),Gf.set(this,void 0),Bn(this,Wi,o,"f"),Bn(this,L7,e,"f"),Bn(this,Jz,r,"f"),Bn(this,sVe,n,"f"),Bn(this,Ax,new Z$e(this),"f"),this.$0=this[Mdn](),this[DFt](),Bn(this,Up,ke(this,Up,"f"),"f"),Bn(this,mo,ke(this,mo,"f"),"f"),Bn(this,Gf,ke(this,Gf,"f"),"f"),Bn(this,ri,ke(this,ri,"f"),"f"),ke(this,ri,"f").showHiddenOpt=ke(this,rVe,"f"),Bn(this,Xz,this[kdn](),"f"),ke(this,Wi,"f").y18n.setLocale(cOo)}addHelpOpt(e,r){let n="help";return On("[string|boolean] [string]",[e,r],arguments.length),ke(this,yx,"f")&&(this[SFt](ke(this,yx,"f")),Bn(this,yx,null,"f")),e===!1&&r===void 0?this:(Bn(this,yx,typeof e=="string"?e:n,"f"),this.boolean(ke(this,yx,"f")),this.describe(ke(this,yx,"f"),r||ke(this,mo,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(On("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:ke(this,rVe,"f");return this.boolean(n),this.describe(n,r||ke(this,mo,"f").deferY18nLookup("Show hidden options")),ke(this,ri,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return On(" [string|array]",[e,r],arguments.length),this[xFt](this.alias.bind(this),"alias",e,r),this}array(e){return On("",[e],arguments.length),this[F7]("array",e),this[aY](e),this}boolean(e){return On("",[e],arguments.length),this[F7]("boolean",e),this[aY](e),this}check(e,r){return On(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>Kz(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&ke(this,mo,"f").fail(s.toString(),s):ke(this,mo,"f").fail(ke(this,Wi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(ke(this,mo,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return On(" [string|array]",[e,r],arguments.length),this[xFt](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(On(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Fp("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 Fp("coerce callback must be provided");let n=e;return ke(this,ri,"f").key[n]=!0,ke(this,Ax,"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:Kz(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Fp(d.message)})},n),this}conflicts(e,r){return On(" [string|array]",[e,r],arguments.length),ke(this,Gf,"f").conflicts(e,r),this}config(e="config",r,n){return On("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=tVe(e,ke(this,Jz,"f"),this[oY]()["deep-merge-config"]||!1,ke(this,Wi,"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,mo,"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 On("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,hS,e||ke(this,hS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(ke(this,hS,"f"),r),n&&ke(this,mC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return On(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),ke(this,Up,"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){On(" [object]",[e,r],arguments.length);let n=ke(this,sVe,"f")||ke(this,Wi,"f").require;return ke(this,Up,"f").addDirectory(e,n,ke(this,Wi,"f").getCallerFile(),r),this}count(e){return On("",[e],arguments.length),this[F7]("count",e),this[aY](e),this}default(e,r,n){return On(" [*] [string]",[e,r,n],arguments.length),n&&(EFt(e,ke(this,Wi,"f")),ke(this,ri,"f").defaultDescription[e]=n),typeof r=="function"&&(EFt(e,ke(this,Wi,"f")),ke(this,ri,"f").defaultDescription[e]||(ke(this,ri,"f").defaultDescription[e]=ke(this,mo,"f").functionDescription(r)),r=r.call()),this[uce](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 On("[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=>{y_(n,!0,ke(this,Wi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(y_(n,!0,ke(this,Wi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{y_(n,!0,ke(this,Wi,"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 On(" [string]",[e,r],arguments.length),this[uce](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return On(" [string|boolean]",[e,r],arguments.length),ke(this,ri,"f").deprecatedOptions[e]=r,this}describe(e,r){return On(" [string]",[e,r],arguments.length),this[PFt](e,!0),ke(this,mo,"f").describe(e,r),this}detectLocale(e){return On("",[e],arguments.length),Bn(this,Zz,e,"f"),this}env(e){return On("[string|boolean]",[e],arguments.length),e===!1?delete ke(this,ri,"f").envPrefix:ke(this,ri,"f").envPrefix=e||"",this}epilogue(e){return On("",[e],arguments.length),ke(this,mo,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return On(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):ke(this,mo,"f").example(e,r),this}exit(e,r){Bn(this,mS,!0,"f"),Bn(this,B7,r,"f"),ke(this,gx,"f")&&ke(this,Wi,"f").process.exit(e)}exitProcess(e=!0){return On("[boolean]",[e],arguments.length),Bn(this,gx,e,"f"),this}fail(e){if(On("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Fp("Invalid first argument. Expected function or boolean 'false'");return ke(this,mo,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return On(" [function]",[e,r],arguments.length),r?ke(this,mC,"f").getCompletion(e,r):new Promise((n,o)=>{ke(this,mC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return On([],0),ke(this,ri,"f").demandedOptions}getDemandedCommands(){return On([],0),ke(this,ri,"f").demandedCommands}getDeprecatedOptions(){return On([],0),ke(this,ri,"f").deprecatedOptions}getDetectLocale(){return ke(this,Zz,"f")}getExitProcess(){return ke(this,gx,"f")}getGroups(){return Object.assign({},ke(this,IM,"f"),ke(this,tY,"f"))}getHelp(){if(Bn(this,mS,!0,"f"),!ke(this,mo,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[USe](ke(this,L7,"f"),void 0,void 0,0,!0);if(Gu(r))return r.then(()=>ke(this,mo,"f").help())}let e=ke(this,Up,"f").runDefaultBuilderOn(this);if(Gu(e))return e.then(()=>ke(this,mo,"f").help())}return Promise.resolve(ke(this,mo,"f").help())}getOptions(){return ke(this,ri,"f")}getStrict(){return ke(this,rY,"f")}getStrictCommands(){return ke(this,nY,"f")}getStrictOptions(){return ke(this,iY,"f")}global(e,r){return On(" [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){On(" ",[e,r],arguments.length);let n=ke(this,tY,"f")[r]||ke(this,IM,"f")[r];ke(this,tY,"f")[r]&&delete ke(this,tY,"f")[r];let o={};return ke(this,IM,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return On("",[e],arguments.length),ke(this,ri,"f").hiddenOptions.push(e),this}implies(e,r){return On(" [number|string|array]",[e,r],arguments.length),ke(this,Gf,"f").implies(e,r),this}locale(e){return On("[string]",[e],arguments.length),e===void 0?(this[TFt](),ke(this,Wi,"f").y18n.getLocale()):(Bn(this,Zz,!1,"f"),ke(this,Wi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return ke(this,Ax,"f").addMiddleware(e,!!r,n)}nargs(e,r){return On(" [number]",[e,r],arguments.length),this[uce](this.nargs.bind(this),"narg",e,r),this}normalize(e){return On("",[e],arguments.length),this[F7]("normalize",e),this}number(e){return On("",[e],arguments.length),this[F7]("number",e),this[aY](e),this}option(e,r){if(On(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[aY](e),ke(this,xM,"f")&&(e==="version"||r?.alias==="version")&&this[Ddn](['"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,mo,"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){On("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Ndn](),typeof e>"u"&&(e=ke(this,L7,"f")),typeof r=="object"&&(Bn(this,eY,r,"f"),r=n),typeof r=="function"&&(Bn(this,gS,r,"f"),r=!1),r||Bn(this,L7,e,"f"),ke(this,gS,"f")&&Bn(this,gx,!1,"f");let o=this[USe](e,!!r),s=this.parsed;return ke(this,mC,"f").setParsed(this.parsed),Gu(o)?o.then(c=>(ke(this,gS,"f")&&ke(this,gS,"f").call(this,ke(this,B7,"f"),c,ke(this,Vm,"f")),c)).catch(c=>{throw ke(this,gS,"f")&&ke(this,gS,"f")(c,this.parsed.argv,ke(this,Vm,"f")),c}).finally(()=>{this[kFt](),this.parsed=s}):(ke(this,gS,"f")&&ke(this,gS,"f").call(this,ke(this,B7,"f"),o,ke(this,Vm,"f")),this[kFt](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return Gu(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(Gu(o))throw new Fp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return On("",[e],arguments.length),Bn(this,aVe,e,"f"),this}pkgConf(e,r){On(" [string]",[e,r],arguments.length);let n=null,o=this[IFt](r||ke(this,Jz,"f"));return o[e]&&typeof o[e]=="object"&&(n=tVe(o[e],r||ke(this,Jz,"f"),this[oY]()["deep-merge-config"]||!1,ke(this,Wi,"f")),ke(this,ri,"f").configObjects=(ke(this,ri,"f").configObjects||[]).concat(n)),this}positional(e,r){On(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=M7(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=ke(this,FSe,"f").fullCommands[ke(this,FSe,"f").fullCommands.length-1],s=o?ke(this,Up,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return ace(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,mo,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return On("[boolean]",[e],arguments.length),Bn(this,cVe,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 On(" [number]",[e],arguments.length),typeof e=="string"&&ke(this,ri,"f").narg[e]?this:(this[uce](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return On("[string] [string]",[e,r],arguments.length),e=e||this.$0,ke(this,Xz,"f").log(ke(this,mC,"f").generateCompletionScript(e,r||ke(this,hS,"f")||"completion")),this}showHelp(e){if(On("[string|function]",[e],arguments.length),Bn(this,mS,!0,"f"),!ke(this,mo,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[USe](ke(this,L7,"f"),void 0,void 0,0,!0);if(Gu(n))return n.then(()=>{ke(this,mo,"f").showHelp(e)}),this}let r=ke(this,Up,"f").runDefaultBuilderOn(this);if(Gu(r))return r.then(()=>{ke(this,mo,"f").showHelp(e)}),this}return ke(this,mo,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return On("[boolean|string] [string]",[e,r],arguments.length),ke(this,mo,"f").showHelpOnFail(e,r),this}showVersion(e){return On("[string|function]",[e],arguments.length),ke(this,mo,"f").showVersion(e),this}skipValidation(e){return On("",[e],arguments.length),this[F7]("skipValidation",e),this}strict(e){return On("[boolean]",[e],arguments.length),Bn(this,rY,e!==!1,"f"),this}strictCommands(e){return On("[boolean]",[e],arguments.length),Bn(this,nY,e!==!1,"f"),this}strictOptions(e){return On("[boolean]",[e],arguments.length),Bn(this,iY,e!==!1,"f"),this}string(e){return On("",[e],arguments.length),this[F7]("string",e),this[aY](e),this}terminalWidth(){return On([],0),ke(this,Wi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return On("",[e],arguments.length),Bn(this,Zz,!1,"f"),ke(this,Wi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(On(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(y_(e,null,ke(this,Wi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Fp(".usage() description must start with $0 if being used as alias for .command()")}else return ke(this,mo,"f").usage(e),this}usageConfiguration(e){return On("",[e],arguments.length),Bn(this,lVe,e,"f"),this}version(e,r,n){let o="version";if(On("[boolean|string] [string] [string]",[e,r,n],arguments.length),ke(this,xM,"f")&&(this[SFt](ke(this,xM,"f")),ke(this,mo,"f").version(void 0),Bn(this,xM,null,"f")),arguments.length===0)n=this[Bdn](),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,xM,typeof e=="string"?e:o,"f"),r=r||ke(this,mo,"f").deferY18nLookup("Show version number"),ke(this,mo,"f").version(n||void 0),this.boolean(ke(this,xM,"f")),this.describe(ke(this,xM,"f"),r),this}wrap(e){return On("",[e],arguments.length),ke(this,mo,"f").wrap(e),this}[(Up=new WeakMap,Jz=new WeakMap,FSe=new WeakMap,mC=new WeakMap,hS=new WeakMap,rVe=new WeakMap,B7=new WeakMap,Zz=new WeakMap,nVe=new WeakMap,gx=new WeakMap,iVe=new WeakMap,Ax=new WeakMap,IM=new WeakMap,mS=new WeakMap,yx=new WeakMap,oVe=new WeakMap,Xz=new WeakMap,Vm=new WeakMap,ri=new WeakMap,sVe=new WeakMap,aVe=new WeakMap,gS=new WeakMap,eY=new WeakMap,lce=new WeakMap,tY=new WeakMap,L7=new WeakMap,cVe=new WeakMap,Wi=new WeakMap,rY=new WeakMap,nY=new WeakMap,iY=new WeakMap,mo=new WeakMap,lVe=new WeakMap,xM=new WeakMap,Gf=new WeakMap,Pdn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[kdn](){return{log:a((...e)=>{this[uVe]()||console.log(...e),Bn(this,mS,!0,"f"),ke(this,Vm,"f").length&&Bn(this,Vm,ke(this,Vm,"f")+` +`,"f"),Bn(this,Vm,ke(this,Vm,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[uVe]()||console.error(...e),Bn(this,mS,!0,"f"),ke(this,Vm,"f").length&&Bn(this,Vm,ke(this,Vm,"f")+` +`,"f"),Bn(this,Vm,ke(this,Vm,"f")+e.join(" "),"f")},"error")}}[SFt](e){ace(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,mo,"f").getDescriptions()[e]}[Ddn](e,r,n){ke(this,nVe,"f")[n]||(ke(this,Wi,"f").process.emitWarning(e,r),ke(this,nVe,"f")[n]=!0)}[Ndn](){ke(this,iVe,"f").push({options:ke(this,ri,"f"),configObjects:ke(this,ri,"f").configObjects.slice(0),exitProcess:ke(this,gx,"f"),groups:ke(this,IM,"f"),strict:ke(this,rY,"f"),strictCommands:ke(this,nY,"f"),strictOptions:ke(this,iY,"f"),completionCommand:ke(this,hS,"f"),output:ke(this,Vm,"f"),exitError:ke(this,B7,"f"),hasOutput:ke(this,mS,"f"),parsed:this.parsed,parseFn:ke(this,gS,"f"),parseContext:ke(this,eY,"f")}),ke(this,mo,"f").freeze(),ke(this,Gf,"f").freeze(),ke(this,Up,"f").freeze(),ke(this,Ax,"f").freeze()}[Mdn](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(ke(this,Wi,"f").process.argv()[0])?r=ke(this,Wi,"f").process.argv().slice(1,2):r=ke(this,Wi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[Wdn](ke(this,Jz,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});y_(s,void 0,ke(this,Wi,"f")),n=JSON.parse(ke(this,Wi,"f").readFileSync(s,"utf8"))}catch{}return ke(this,lce,"f")[r]=n||{},ke(this,lce,"f")[r]}[F7](e,r){r=[].concat(r),r.forEach(n=>{n=this[RFt](n),ke(this,ri,"f")[e].push(n)})}[uce](e,r,n,o){this[wFt](e,r,n,o,(s,c,l)=>{ke(this,ri,"f")[s][c]=l})}[xFt](e,r,n,o){this[wFt](e,r,n,o,(s,c,l)=>{ke(this,ri,"f")[s][c]=(ke(this,ri,"f")[s][c]||[]).concat(l)})}[wFt](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 ace(n))e(c,n[c]);else s(r,this[RFt](n),o)}[RFt](e){return e==="__proto__"?"___proto___":e}[PFt](e,r){return this[uce](this[PFt].bind(this),"key",e,r),this}[kFt](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=ke(this,iVe,"f").pop();y_(g,void 0,ke(this,Wi,"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,gx,y,"f")}}.value,groups:{set value(y){Bn(n,IM,y,"f")}}.value,output:{set value(y){Bn(o,Vm,y,"f")}}.value,exitError:{set value(y){Bn(s,B7,y,"f")}}.value,hasOutput:{set value(y){Bn(c,mS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,rY,y,"f")}}.value,strictCommands:{set value(y){Bn(u,nY,y,"f")}}.value,strictOptions:{set value(y){Bn(d,iY,y,"f")}}.value,completionCommand:{set value(y){Bn(f,hS,y,"f")}}.value,parseFn:{set value(y){Bn(h,gS,y,"f")}}.value,parseContext:{set value(y){Bn(m,eY,y,"f")}}.value}=g,ke(this,ri,"f").configObjects=A,ke(this,mo,"f").unfreeze(),ke(this,Gf,"f").unfreeze(),ke(this,Up,"f").unfreeze(),ke(this,Ax,"f").unfreeze()}[Fdn](e,r){return Kz(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Udn].bind(this),getContext:this[Qdn].bind(this),getHasOutput:this[qdn].bind(this),getLoggerInstance:this[jdn].bind(this),getParseContext:this[Hdn].bind(this),getParserConfiguration:this[oY].bind(this),getUsageConfiguration:this[Odn].bind(this),getUsageInstance:this[Gdn].bind(this),getValidationInstance:this[$dn].bind(this),hasParseCallback:this[uVe].bind(this),isGlobalContext:this[Vdn].bind(this),postProcess:this[sY].bind(this),reset:this[DFt].bind(this),runValidation:this[NFt].bind(this),runYargsParserAndExecuteCommands:this[USe].bind(this),setHasOutput:this[zdn].bind(this)}}[Udn](){return ke(this,Up,"f")}[Qdn](){return ke(this,FSe,"f")}[qdn](){return ke(this,mS,"f")}[jdn](){return ke(this,Xz,"f")}[Hdn](){return ke(this,eY,"f")||{}}[Gdn](){return ke(this,mo,"f")}[$dn](){return ke(this,Gf,"f")}[uVe](){return!!ke(this,gS,"f")}[Vdn](){return ke(this,oVe,"f")}[sY](e,r,n,o){return n||Gu(e)||(r||(e=this[Pdn](e)),(this[oY]()["parse-positional-numbers"]||this[oY]()["parse-positional-numbers"]===void 0)&&(e=this[Ldn](e)),o&&(e=Yz(e,this,ke(this,Ax,"f").getMiddleware(),!1))),e}[DFt](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,tY,"f"),Object.keys(ke(this,IM,"f")).reduce((c,l)=>{let u=ke(this,IM,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,IM,{},"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]=M7(ke(this,ri,"f")[c],l=>!n[l])}),r.envPrefix=ke(this,ri,"f").envPrefix,Bn(this,ri,r,"f"),Bn(this,mo,ke(this,mo,"f")?ke(this,mo,"f").reset(n):Cdn(this,ke(this,Wi,"f")),"f"),Bn(this,Gf,ke(this,Gf,"f")?ke(this,Gf,"f").reset(n):wdn(this,ke(this,mo,"f"),ke(this,Wi,"f")),"f"),Bn(this,Up,ke(this,Up,"f")?ke(this,Up,"f").reset():Edn(ke(this,mo,"f"),ke(this,Gf,"f"),ke(this,Ax,"f"),ke(this,Wi,"f")),"f"),ke(this,mC,"f")||Bn(this,mC,Tdn(this,ke(this,mo,"f"),ke(this,Up,"f"),ke(this,Wi,"f")),"f"),ke(this,Ax,"f").reset(),Bn(this,hS,null,"f"),Bn(this,Vm,"","f"),Bn(this,B7,null,"f"),Bn(this,mS,!1,"f"),this.parsed=!1,this}[Wdn](e,r){return ke(this,Wi,"f").path.relative(e,r)}[USe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||ke(this,L7,"f"),ke(this,ri,"f").__=ke(this,Wi,"f").y18n.__,ke(this,ri,"f").configuration=this[oY]();let h=!!ke(this,ri,"f").configuration["populate--"],m=Object.assign({},ke(this,ri,"f").configuration,{"populate--":!0}),g=ke(this,Wi,"f").Parser.detailed(e,Object.assign({},ke(this,ri,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,ke(this,eY,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===ke(this,yx,"f")&&A[b]?_=!0:b===ke(this,xM,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&ke(this,mo,"f").clearCachedHelpMessage();try{if(this[TFt](),r)return this[sY](A,h,!!n,!1);ke(this,yx,"f")&&[ke(this,yx,"f")].concat(E[ke(this,yx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,oVe,!1,"f");let b=ke(this,Up,"f").getCommands(),T=!((c=ke(this,mC,"f"))===null||c===void 0)&&c.completionKey?[(l=ke(this,mC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=ke(this,mC,"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,hS,"f")){let D=ke(this,Up,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[sY](D,h,!!n,!1)}else if(!R&&P!==ke(this,hS,"f")){R=P;break}!ke(this,Up,"f").hasDefaultCommand()&&ke(this,cVe,"f")&&R&&!w&&ke(this,Gf,"f").recommendCommands(R,b)}ke(this,hS,"f")&&A._.includes(ke(this,hS,"f"))&&!T&&(ke(this,gx,"f")&&O7(!0),this.showCompletionScript(),this.exit(0))}if(ke(this,Up,"f").hasDefaultCommand()&&!w){let R=ke(this,Up,"f").runCommand(null,this,g,0,s,_||v||s);return this[sY](R,h,!!n,!1)}if(T){ke(this,gx,"f")&&O7(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${ke(this,mC,"f").completionKey}`)+1);return ke(this,mC,"f").getCompletion(R,(x,P)=>{if(x)throw new Fp(x.message);(P||[]).forEach(D=>{ke(this,Xz,"f").log(D)}),this.exit(0)}),this[sY](A,!h,!!n,!1)}if(ke(this,mS,"f")||(_?(ke(this,gx,"f")&&O7(!0),f=!0,this.showHelp(R=>{ke(this,Xz,"f").log(R),this.exit(0)})):v&&(ke(this,gx,"f")&&O7(!0),f=!0,ke(this,mo,"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 Fp(g.error.message);if(!T){let R=this[NFt](E,{},g.error);n||(y=Yz(A,this,ke(this,Ax,"f").getMiddleware(),!0)),y=this[Fdn](R,y??A),Gu(y)&&!n&&(y=y.then(()=>Yz(A,this,ke(this,Ax,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Fp)ke(this,mo,"f").fail(b.message,b);else throw b}return this[sY](y??A,h,!!n,!0)}[NFt](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Fp(n.message);ke(this,Gf,"f").nonOptionCount(c),ke(this,Gf,"f").requiredArguments(c,s);let l=!1;ke(this,nY,"f")&&(l=ke(this,Gf,"f").unknownCommands(c)),ke(this,rY,"f")&&!l?ke(this,Gf,"f").unknownArguments(c,e,r,!!o):ke(this,iY,"f")&&ke(this,Gf,"f").unknownArguments(c,e,{},!1,!1),ke(this,Gf,"f").limitedChoices(c),ke(this,Gf,"f").implications(c),ke(this,Gf,"f").conflicting(c)}}[zdn](){Bn(this,mS,!0,"f")}[aY](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 _dn(t){return!!t&&typeof t.getInternalMethods=="function"}a(_dn,"isYargsInstance");var lOo=Ydn(hdn),Kdn=lOo;p();p();var Xdn=require("node:child_process"),efn=require("node:util");var uOo=(0,efn.promisify)(Xdn.execFile),U7="1.0.60",Jdn="COPILOT_CLI_PATH",dOo="GITHUB_COPILOT_ACP_USE_CLI",dce="@github/copilot",fOo=3e4,pOo=1e4,Zdn=6e4,fce=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function tfn(){return process.env[dOo]!=="0"}a(tfn,"isCLIIntegrationEnabled");var OFt=process.platform==="win32";async function rfn(){if(process.env[Jdn]){let l=process.env[Jdn],u=await QSe(l,["--version"]);if(u)return mOo(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new fce("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await QSe("copilot",["--version"]);if(t&&qSe(t,U7))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await QSe(e,["--offline",dce,"--version"],!1,pOo);if(r&&qSe(r,U7))return{path:e,args:[dce],version:r,source:"npx"};let n=`${dce}@${U7}`,o=await QSe(e,[n,"--version"],!1,Zdn);if(o&&qSe(o,U7))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${dce}@latest`,c=await QSe(e,[s,"--version"],!0,Zdn);if(c){if(qSe(c,U7))return{path:e,args:[s],version:c,source:"npx-latest"};throw new fce(`Latest published Copilot CLI version ${c} is below the minimum required ${U7}.`)}throw new fce(`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 ${dce}`)}a(rfn,"discoverCLI");function hOo(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(hOo,"parseVersion");async function QSe(t,e,r=!1,n=fOo){try{let{stdout:o}=await uOo(t,e,{timeout:n,shell:OFt});return hOo(o)}catch(o){if(r)throw o;return null}}a(QSe,"tryGetVersion");function mOo(t,e){if(!qSe(t,U7))throw new fce(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${U7}. Update with: npm install -g ${dce}@latest`)}a(mOo,"validateVersion");function qSe(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!==""}},cY=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=ir();this._timestamp=Date.now();this.uriSchemeCache=new dVe;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 q7=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();p();p();var lY=he(require("child_process")),LFt=he(require("path")),Efn=he(yfn());function _fn(t){return t.replace(/^git version /,"")}a(_fn,"parseVersion");function FFt(t){return new Promise((e,r)=>{let n=[],o=lY.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:_fn(Buffer.concat(n).toString("utf8").trim())}))})}a(FFt,"findSpecificGit");function wOo(){return new Promise((t,e)=>{lY.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){lY.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:_fn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);lY.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(wOo,"findGitDarwin");function fVe(t){return t?FFt(LFt.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(fVe,"findSystemGitWin32");async function ROo(){let t=await(0,Efn.default)("git.exe");return FFt(t)}a(ROo,"findGitWin32InPath");function POo(){return fVe(process.env.ProgramW6432).then(void 0,()=>fVe(process.env["ProgramFiles(x86)"])).then(void 0,()=>fVe(process.env.ProgramFiles)).then(void 0,()=>fVe(LFt.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>ROo())}a(POo,"findGitWin32");async function j7(){try{switch(process.platform){case"darwin":return await wOo();case"win32":return await POo();default:return await FFt("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(j7,"findGit");var vfn=require("node:child_process"),Cfn=require("node:util");var kOo=(0,Cfn.promisify)(vfn.execFile);async function bfn(t){return UFt(t,["github.com"])}a(bfn,"resolveGitHubNwo");async function UFt(t,e){let r;try{r=(await j7()).path}catch{return}let n;try{n=(await kOo(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return DOo(n,e)}a(UFt,"resolveGitHubNwoForHosts");function DOo(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(DOo,"parseGitRemoteUrl");async function Sfn(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(Sfn,"resolveRepoIds");p();var NOo=3e4,pVe=class{constructor(e,r=NOo){this.ctx=e;this.timeoutMs=r;this.logger=new Ee("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=kB(n).api,c=`${Tfn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(fr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...uA(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=kB(s).api,u=new URL(`${Tfn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(fr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...uA(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(Fr).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function Tfn(t){return t.endsWith("/")?t.slice(0,-1):t}a(Tfn,"trimTrailingSlash");p();p();var MOo=Object.create,Ifn=Object.defineProperty,OOo=Object.getOwnPropertyDescriptor,BOo=Object.getOwnPropertyNames,LOo=Object.getPrototypeOf,FOo=Object.prototype.hasOwnProperty,$u=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),UOo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=BOo(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=OOo(e,l))||n.enumerable});return t},"__copyProps"),QOo=a((t,e,r)=>(r=t!=null?MOo(LOo(t)):{},UOo(e||!t||!t.__esModule?Ifn(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),jSe=$u(((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})),qOo=$u(((t,e)=>{var r=jSe();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(((t,e)=>{var r=HSe(),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})),xfn=$u(((t,e)=>{var r=HSe(),n=__();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(__())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),Rfn=$u(((t,e)=>{e.exports=new(__())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),Pfn=$u(((t,e)=>{e.exports=new(__())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),kfn=$u(((t,e)=>{e.exports=new(xfn())({explicit:[wfn(),Rfn(),Pfn()]})})),Dfn=$u(((t,e)=>{var r=__();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"})})),Nfn=$u(((t,e)=>{var r=__();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"})})),Mfn=$u(((t,e)=>{var r=jSe(),n=__();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"]}})})),Ofn=$u(((t,e)=>{var r=jSe(),n=__(),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"})})),Bfn=$u(((t,e)=>{e.exports=kfn().extend({implicit:[Dfn(),Nfn(),Mfn(),Ofn()]})})),Lfn=$u(((t,e)=>{e.exports=Bfn()})),Ffn=$u(((t,e)=>{var r=__(),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})})),Ufn=$u(((t,e)=>{var r=__();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),Qfn=$u(((t,e)=>{var r=__(),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})})),qfn=$u(((t,e)=>{var r=__(),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=__(),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=__(),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})})),QFt=$u(((t,e)=>{e.exports=Lfn().extend({implicit:[Ffn(),Ufn()],explicit:[Qfn(),qfn(),jfn(),Hfn()]})})),jOo=$u(((t,e)=>{var r=jSe(),n=HSe(),o=qOo(),s=QFt(),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 j(F,be,Ue){be==="__proto__"?Object.defineProperty(F,be,{configurable:!0,enumerable:!0,writable:!0,value:Ue}):F[be]=Ue}a(j,"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 q(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(q,"State");function Q(F,be){let Ue={name:F.filename,buffer:F.input.slice(0,-1),position:F.position,line:F.line,column:F.position-F.lineStart};return Ue.snippet=o(Ue),new n(be,Ue)}a(Q,"generateError");function U(F,be){throw Q(F,be)}a(U,"throwError");function z(F,be){F.onWarning&&F.onWarning.call(null,Q(F,be))}a(z,"throwWarning");function W(F,be,Ue){let de=F.anchorMapTransactions;if(de.length!==0){let Se=de[de.length-1];c.call(Se,be)||(Se[be]={existed:c.call(F.anchorMap,be),value:F.anchorMap[be]})}F.anchorMap[be]=Ue}a(W,"storeAnchor");function $(F){F.anchorMapTransactions.push(Object.create(null))}a($,"beginAnchorTransaction");function J(F){let be=F.anchorMapTransactions.pop(),Ue=F.anchorMapTransactions;if(Ue.length===0)return;let de=Ue[Ue.length-1],Se=Object.keys(be);for(let Le=0,te=Se.length;Le=0;de-=1){let Se=be[Ue[de]];Se.existed?F.anchorMap[Ue[de]]=Se.value:delete F.anchorMap[Ue[de]]}}a(ne,"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 ae={YAML:a(function(be,Ue,de){be.version!==null&&U(be,"duplication of %YAML directive"),de.length!==1&&U(be,"YAML directive accepts exactly one argument");let Se=/^([0-9]+)\.([0-9]+)$/.exec(de[0]);Se===null&&U(be,"ill-formed argument of the YAML directive");let Le=parseInt(Se[1],10),te=parseInt(Se[2],10);Le!==1&&U(be,"unacceptable YAML version of the document"),be.version=de[0],be.checkLineBreaks=te<2,te!==1&&te!==2&&z(be,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(be,Ue,de){let Se;de.length!==2&&U(be,"TAG directive accepts exactly two arguments");let Le=de[0];Se=de[1],_.test(Le)||U(be,"ill-formed tag handle (first argument) of the TAG directive"),c.call(be.tagMap,Le)&&U(be,'there is a previously declared suffix for "'+Le+'" 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[Le]=Se},"handleTagDirective")};function Oe(F,be,Ue,de){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(Oe,"captureSegment");function ve(F,be,Ue,de){r.isObject(Ue)||U(F,"cannot merge mappings; the provided source object is unacceptable");let Se=Object.keys(Ue);for(let Le=0,te=Se.length;LeF.maxMergeSeqLength&&U(F,"merge sequence length exceeded maxMergeSeqLength ("+F.maxMergeSeqLength+")");let Y=new Set;for(let se=0,pe=Le.length;se1&&(F.result+=r.repeat(` +`,be-1))}a(K,"writeFoldedLines");function fe(F,be,Ue){let de,Se,Le,te,Te,Ge,Y=F.kind,se=F.result,pe=F.input.charCodeAt(F.position);if(R(pe)||x(pe)||pe===35||pe===38||pe===42||pe===33||pe===124||pe===62||pe===39||pe===34||pe===37||pe===64||pe===96)return!1;if(pe===63||pe===45){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Ue&&x(Ce))return!1}for(F.kind="scalar",F.result="",de=Se=F.position,Le=!1;pe!==0;){if(pe===58){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Ue&&x(Ce))break}else if(pe===35){if(R(F.input.charCodeAt(F.position-1)))break}else{if(F.position===F.lineStart&&ee(F)||Ue&&x(pe))break;if(T(pe))if(te=F.line,Te=F.lineStart,Ge=F.lineIndent,Z(F,!1,-1),F.lineIndent>=be){Le=!0,pe=F.input.charCodeAt(F.position);continue}else{F.position=Se,F.line=te,F.lineStart=Te,F.lineIndent=Ge;break}}Le&&(Oe(F,de,Se,!1),K(F,F.line-te),de=Se=F.position,Le=!1),w(pe)||(Se=F.position+1),pe=F.input.charCodeAt(++F.position)}return Oe(F,de,Se,!1),F.result?!0:(F.kind=Y,F.result=se,!1)}a(fe,"readPlainScalar");function X(F,be){let Ue,de,Se=F.input.charCodeAt(F.position);if(Se!==39)return!1;for(F.kind="scalar",F.result="",F.position++,Ue=de=F.position;(Se=F.input.charCodeAt(F.position))!==0;)if(Se===39)if(Oe(F,Ue,F.position,!0),Se=F.input.charCodeAt(++F.position),Se===39)Ue=F.position,F.position++,de=F.position;else return!0;else T(Se)?(Oe(F,Ue,de,!0),K(F,Z(F,!1,be)),Ue=de=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,w(Se)||(de=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(X,"readSingleQuotedScalar");function ue(F,be){let Ue,de,Se,Le=F.input.charCodeAt(F.position);if(Le!==34)return!1;for(F.kind="scalar",F.result="",F.position++,Ue=de=F.position;(Le=F.input.charCodeAt(F.position))!==0;){if(Le===34)return Oe(F,Ue,F.position,!0),F.position++,!0;if(Le===92){if(Oe(F,Ue,F.position,!0),Le=F.input.charCodeAt(++F.position),T(Le))Z(F,!1,be);else if(Le<256&&M[Le])F.result+=O[Le],F.position++;else if((Se=D(Le))>0){let te=Se,Te=0;for(;te>0;te--)Le=F.input.charCodeAt(++F.position),(Se=P(Le))>=0?Te=(Te<<4)+Se:U(F,"expected hexadecimal character");F.result+=B(Te),F.position++}else U(F,"unknown escape sequence");Ue=de=F.position}else T(Le)?(Oe(F,Ue,de,!0),K(F,Z(F,!1,be)),Ue=de=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,w(Le)||(de=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(ue,"readDoubleQuotedScalar");function qe(F,be){let Ue=!0,de,Se,Le,te=F.tag,Te,Ge=F.anchor,Y,se,pe,Ce,He=Object.create(null),$e,Xe,ct,bt=F.input.charCodeAt(F.position);if(bt===91)Y=93,Ce=!1,Te=[];else if(bt===123)Y=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(Z(F,!0,be),bt=F.input.charCodeAt(F.position),bt===Y)return F.position++,F.tag=te,F.anchor=Ge,F.kind=Ce?"mapping":"sequence",F.result=Te,!0;Ue?bt===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),Xe=$e=ct=null,se=pe=!1,bt===63&&R(F.input.charCodeAt(F.position+1))&&(se=pe=!0,F.position++,Z(F,!0,be)),de=F.line,Se=F.lineStart,Le=F.position,Et(F,be,l,!1,!0),Xe=F.tag,$e=F.result,Z(F,!0,be),bt=F.input.charCodeAt(F.position),(pe||F.line===de)&&bt===58&&(se=!0,bt=F.input.charCodeAt(++F.position),Z(F,!0,be),Et(F,be,l,!1,!0),ct=F.result),Ce?Fe(F,Te,He,Xe,$e,ct,de,Se,Le):se?Te.push(Fe(F,null,He,Xe,$e,ct,de,Se,Le)):Te.push($e),Z(F,!0,be),bt=F.input.charCodeAt(F.position),bt===44?(Ue=!0,bt=F.input.charCodeAt(++F.position)):Ue=!1}U(F,"unexpected end of the stream within a flow collection")}a(qe,"readFlowCollection");function ie(F,be){let Ue,de=h,Se=!1,Le=!1,te=be,Te=0,Ge=!1,Y,se=F.input.charCodeAt(F.position);if(se===124)Ue=!1;else if(se===62)Ue=!0;else return!1;for(F.kind="scalar",F.result="";se!==0;)if(se=F.input.charCodeAt(++F.position),se===43||se===45)h===de?de=se===43?g:m:U(F,"repeat of a chomping mode identifier");else if((Y=N(se))>=0)Y===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):Le?U(F,"repeat of an indentation width identifier"):(te=be+Y-1,Le=!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(Pe(F),F.lineIndent=0,se=F.input.charCodeAt(F.position);(!Le||F.lineIndentte&&(te=F.lineIndent),T(se)){Te++;continue}if(!Le&&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,Le=F.lineStart,te=F.position),Et(F,be,f,!0,de)&&($e?Ce=F.result:He=F.result),$e||(Fe(F,Y,se,pe,Ce,He,Se,Le,te),pe=Ce=He=null),Z(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=Le=te=f===Ue||d===Ue;if(de&&Z(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 Xe=0,ct=F.implicitTypes.length;Xe"),F.result!==null&&pe.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+pe.kind+'", not "'+F.kind+'"'),pe.resolve(F.result,F.tag)?(F.result=pe.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||Y}a(Et,"composeNode");function kt(F){let be=F.position,Ue=!1,de;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(de=F.input.charCodeAt(F.position))!==0&&(Z(F,!0,-1),de=F.input.charCodeAt(F.position),!(F.lineIndent>0||de!==37));){Ue=!0,de=F.input.charCodeAt(++F.position);let Se=F.position;for(;de!==0&&!R(de);)de=F.input.charCodeAt(++F.position);let Le=F.input.slice(Se,F.position),te=[];for(Le.length<1&&U(F,"directive name must not be less than one character in length");de!==0;){for(;w(de);)de=F.input.charCodeAt(++F.position);if(de===35){do de=F.input.charCodeAt(++F.position);while(de!==0&&!T(de));break}if(T(de))break;for(Se=F.position;de!==0&&!R(de);)de=F.input.charCodeAt(++F.position);te.push(F.input.slice(Se,F.position))}de!==0&&Pe(F),c.call(ae,Le)?ae[Le](F,Le,te):z(F,'unknown document directive "'+Le+'"')}if(Z(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,Z(F,!0,-1)):Ue&&U(F,"directives end mark is expected"),Et(F,F.lineIndent-1,f,!1,!0),Z(F,!0,-1),F.checkLineBreaks&&y.test(F.input.slice(be,F.position))&&z(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,Z(F,!0,-1));return}F.position"u"&&(Ue=be,be=null);let de=Ht(F,Ue);if(typeof be!="function")return de;for(let Se=0,Le=de.length;Se{var r=jSe(),n=HSe(),o=QFt(),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,j=123,M=124,O=125,q={};q[0]="\\0",q[7]="\\a",q[8]="\\b",q[9]="\\t",q[10]="\\n",q[11]="\\v",q[12]="\\f",q[13]="\\r",q[27]="\\e",q[34]='\\"',q[92]="\\\\",q[133]="\\N",q[160]="\\_",q[8232]="\\L",q[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 z(te,Te){if(Te===null)return{};let Ge={},Y=Object.keys(Te);for(let se=0,pe=Y.length;se=32&&te<=126||te>=161&&te<=55295&&te!==8232&&te!==8233||te>=57344&&te<=65533&&te!==l||te>=65536&&te<=1114111}a(ve,"isPrintable");function Fe(te){return ve(te)&&te!==l&&te!==f&&te!==d}a(Fe,"isNsCharOrWhitespace");function Pe(te,Te,Ge){let Y=Fe(te),se=Y&&!Oe(te);return(Ge?Y:Y&&te!==b&&te!==N&&te!==L&&te!==j&&te!==O)&&te!==A&&!(Te===w&&!se)||Fe(Te)&&!Oe(Te)&&te===A||Te===w&&se}a(Pe,"isPlainSafe");function Z(te){return ve(te)&&te!==l&&!Oe(te)&&te!==T&&te!==P&&te!==w&&te!==b&&te!==N&&te!==L&&te!==j&&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(Z,"isPlainSafeFirst");function ee(te){return!Oe(te)&&te!==w}a(ee,"isPlainSafeLast");function K(te,Te){let Ge=te.charCodeAt(Te),Y;return Ge>=55296&&Ge<=56319&&Te+1=56320&&Y<=57343)?(Ge-55296)*1024+Y-56320+65536:Ge}a(K,"codePointAt");function fe(te){return/^\n* /.test(te)}a(fe,"needIndentIndicator");var X=1,ue=2,qe=3,ie=4,le=5;function Ne(te,Te,Ge,Y,se,pe,Ce,He){let $e,Xe=0,ct=null,bt=!1,ht=!1,We=Y!==-1,ce=-1,Re=Z(K(te,0))&&ee(K(te,te.length-1));if(Te||Ce)for($e=0;$e=65536?$e+=2:$e++){if(Xe=K(te,$e),!ve(Xe))return le;Re=Re&&Pe(Xe,ct,He),ct=Xe}else{for($e=0;$e=65536?$e+=2:$e++){if(Xe=K(te,$e),Xe===d)bt=!0,We&&(ht=ht||$e-ce-1>Y&&te[ce+1]!==" ",ce=$e);else if(!ve(Xe))return le;Re=Re&&Pe(Xe,ct,He),ct=Xe}ht=ht||We&&$e-ce-1>Y&&te[ce+1]!==" "}return!bt&&!ht?Re&&!Ce&&!se(te)?X:pe===J?le:ue:Ge>9&&fe(te)?le:Ce?pe===J?le:ue:ht?ie:qe}a(Ne,"chooseScalarStyle");function we(te,Te,Ge,Y,se){te.dump=(function(){if(Te.length===0)return te.quotingType===J?'""':"''";if(!te.noCompatMode&&(Q.indexOf(Te)!==-1||U.test(Te)))return te.quotingType===J?'"'+Te+'"':"'"+Te+"'";let pe=te.indent*Math.max(1,Ge),Ce=te.lineWidth===-1?-1:Math.max(Math.min(te.lineWidth,40),te.lineWidth-pe),He=Y||te.flowLevel>-1&&Ge>=te.flowLevel;function $e(Xe){return ae(te,Xe)}switch(a($e,"testAmbiguity"),Ne(Te,He,te.indent,Ce,$e,te.quotingType,te.forceQuotes&&!Y,se)){case X:return Te;case ue:return"'"+Te.replace(/'/g,"''")+"'";case qe:return"|"+Be(Te,te.indent)+tt(H(Te,pe));case ie:return">"+Be(Te,te.indent)+tt(H(st(Te,Ce),pe));case le:return'"'+kt(Te,Ce)+'"';default:throw new n("impossible error: invalid scalar style")}})()}a(we,"writeScalar");function Be(te,Te){let Ge=fe(te)?String(Te):"",Y=te[te.length-1]===` +`;return Ge+(Y&&(te[te.length-2]===` +`||te===` +`)?"+":Y?"":"-")+` +`}a(Be,"blockHeader");function tt(te){return te[te.length-1]===` +`?te.slice(0,-1):te}a(tt,"dropEndingNewline");function st(te,Te){let Ge=/(\n+)([^\n]*)/g,Y=(function(){let He=te.indexOf(` +`);return He=He!==-1?He:te.length,Ge.lastIndex=He,Et(te.slice(0,He),Te)})(),se=te[0]===` +`||te[0]===" ",pe,Ce;for(;Ce=Ge.exec(te);){let He=Ce[1],$e=Ce[2];pe=$e[0]===" ",Y+=He+(!se&&!pe&&$e!==""?` +`:"")+Et($e,Te),se=pe}return Y}a(st,"foldString");function Et(te,Te){if(te===""||te[0]===" ")return te;let Ge=/ [^ ]/g,Y,se=0,pe,Ce=0,He=0,$e="";for(;Y=Ge.exec(te);)He=Y.index,He-se>Te&&(pe=Ce>se?Ce:He,$e+=` +`+te.slice(se,pe),se=pe+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(Et,"foldLine");function kt(te){let Te="",Ge=0;for(let Y=0;Y=65536?Y+=2:Y++){Ge=K(te,Y);let se=q[Ge];!se&&ve(Ge)?(Te+=te[Y],Ge>=65536&&(Te+=te[Y+1])):Te+=se||W(Ge)}return Te}a(kt,"escapeString");function Ht(te,Te,Ge){let Y="",se=te.tag;for(let pe=0,Ce=Ge.length;pe"u"&&Ue(te,Te,null,!1,!1))&&(Y!==""&&(Y+=","+(te.condenseFlow?"":" ")),Y+=te.dump)}te.tag=se,te.dump="["+Y+"]"}a(Ht,"writeFlowSequence");function jt(te,Te,Ge,Y){let se="",pe=te.tag;for(let Ce=0,He=Ge.length;Ce"u"&&Ue(te,Te+1,null,!0,!0,!1,!0))&&((!Y||se!=="")&&(se+=re(te,Te)),te.dump&&d===te.dump.charCodeAt(0)?se+="-":se+="- ",se+=te.dump)}te.tag=pe,te.dump=se||"[]"}a(jt,"writeBlockSequence");function Ie(te,Te,Ge){let Y="",se=te.tag,pe=Object.keys(Ge);for(let Ce=0,He=pe.length;Ce1024&&($e+="? "),$e+=te.dump+(te.condenseFlow?'"':"")+":"+(te.condenseFlow?"":" "),Ue(te,Te,ct,!1,!1)&&($e+=te.dump,Y+=$e))}te.tag=se,te.dump="{"+Y+"}"}a(Ie,"writeFlowMapping");function F(te,Te,Ge,Y){let se="",pe=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 Xe="";(!Y||se!=="")&&(Xe+=re(te,Te));let ct=Ce[He],bt=Ge[ct];if(te.replacer&&(bt=te.replacer.call(Ge,ct,bt)),!Ue(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)?Xe+="?":Xe+="? "),Xe+=te.dump,ht&&(Xe+=re(te,Te)),Ue(te,Te+1,bt,!0,ht)&&(te.dump&&d===te.dump.charCodeAt(0)?Xe+=":":Xe+=": ",Xe+=te.dump,se+=Xe)}te.tag=pe,te.dump=se||"{}"}a(F,"writeBlockMapping");function be(te,Te,Ge){let Y=Ge?te.explicitTypes:te.implicitTypes;for(let se=0,pe=Y.length;se tag resolver accepts not "'+He+'" style');te.dump=$e}return!0}}return!1}a(be,"detectType");function Ue(te,Te,Ge,Y,se,pe,Ce){te.tag=null,te.dump=Ge,be(te,Ge,!1)||be(te,Ge,!0);let He=s.call(te.dump),$e=Y;Y&&(Y=te.flowLevel<0||te.flowLevel>Te);let Xe=He==="[object Object]"||He==="[object Array]",ct,bt;if(Xe&&(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(Xe&&bt&&!te.usedDuplicates[ct]&&(te.usedDuplicates[ct]=!0),He==="[object Object]")Y&&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]")Y&&te.dump.length!==0?(te.noArrayIndent&&!Ce&&Te>0?jt(te,Te-1,te.dump,se):jt(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):(Ht(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object String]")te.tag!=="?"&&we(te,te.dump,Te,pe,$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(Ue,"writeNode");function de(te,Te){let Ge=[],Y=[];Se(te,Ge,Y);let se=Y.length;for(let pe=0;pe{var r=jOo(),n=HOo();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=__(),e.exports.Schema=xfn(),e.exports.FAILSAFE_SCHEMA=kfn(),e.exports.JSON_SCHEMA=Bfn(),e.exports.CORE_SCHEMA=Lfn(),e.exports.DEFAULT_SCHEMA=QFt(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=HSe(),e.exports.types={binary:Qfn(),float:Ofn(),map:Pfn(),null:Dfn(),pairs:jfn(),set:Hfn(),timestamp:Ffn(),bool:Nfn(),int:Mfn(),merge:Ufn(),omap:qfn(),seq:Rfn(),str:wfn()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:bku,Schema:Sku,FAILSAFE_SCHEMA:Tku,JSON_SCHEMA:Iku,CORE_SCHEMA:xku,DEFAULT_SCHEMA:wku,load:Rku,loadAll:Pku,dump:uY,YAMLException:kku,types:Dku,safeLoad:Nku,safeLoadAll:Mku,safeDump:Oku}=Gfn.default,Bku=Gfn.default;function Vfn(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=uY(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- ${n} --- ${o} -`}a(Ahn,"generateAgentMarkdown");p();p();p();p();p();p();var yTe={isBlocked:!1,reason:"VALID_FILE"},WVe={isBlocked:!1,reason:"NO_MATCHING_POLICY"},yhn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},RY={all:"all",repo:"repo"},oQ=new ge("contentExclusion");p();p();var zVe=class{static{a(this,"PolicyEvaluator")}};p();p();p();var O8t=new ge("repository"),kY=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(".")}},cP=class{static{a(this,"GitConfigLoader")}},YVe=class extends cP{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 Ehn=require("os");var KVe=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 Z9.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=Z9.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,Ehn.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 JVe=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(cP).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 KVe(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 TLo=100,B8t=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])}}},W0=class t{constructor(e){this.ctx=e;this.remoteResolver=new JVe;this.cache=new nn(TLo)}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=tf(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 B8t(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(Fo),o=xa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=xa(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=aW(r,s[1]),l=xa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=xa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=xa(c,"commondir");c=aW(c,(await e.readFileString(d)).trimEnd());let f=xa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var PY=a((t,e)=>{if(RM.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...RM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");p();p();p();var ZVe=new WeakMap;function XVe(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]"&&ZVe.has(t))return ZVe.get(t);switch(ZVe.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(ILo,"n");function vhn(t,e){return function(r,n){return ILo(t,e,r,n)}}a(vhn,"o");p();p();p();var F8t=a((t,e,r)=>{let n=t instanceof RegExp?bhn(t,r):t,o=e instanceof RegExp?bhn(e,r):e,s=n!==null&&o!=null&&xLo(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"),bhn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),xLo=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 Shn="\0SLASH"+Math.random()+"\0",Thn="\0OPEN"+Math.random()+"\0",Q8t="\0CLOSE"+Math.random()+"\0",Ihn="\0COMMA"+Math.random()+"\0",xhn="\0PERIOD"+Math.random()+"\0",wLo=new RegExp(Shn,"g"),RLo=new RegExp(Thn,"g"),kLo=new RegExp(Q8t,"g"),PLo=new RegExp(Ihn,"g"),DLo=new RegExp(xhn,"g"),NLo=/\\\\/g,MLo=/\\{/g,OLo=/\\}/g,BLo=/\\,/g,LLo=/\\\./g,FLo=1e5;function U8t(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(U8t,"numeric");function ULo(t){return t.replace(NLo,Shn).replace(MLo,Thn).replace(OLo,Q8t).replace(BLo,Ihn).replace(LLo,xhn)}a(ULo,"escapeBraces");function QLo(t){return t.replace(wLo,"\\").replace(RLo,"{").replace(kLo,"}").replace(PLo,",").replace(DLo,".")}a(QLo,"unescapeBraces");function whn(t){if(!t)return[""];let e=[],r=F8t("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=whn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(whn,"parseCommaParts");function Rhn(t,e={}){if(!t)return[];let{max:r=FLo}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),ETe(ULo(t),r,!0).map(QLo)}a(Rhn,"expand");function qLo(t){return"{"+t+"}"}a(qLo,"embrace");function jLo(t){return/^-?0\d/.test(t)}a(jLo,"isPadded");function HLo(t,e){return t<=e}a(HLo,"lte");function GLo(t,e){return t>=e}a(GLo,"gte");function ETe(t,e,r){let n=[],o=F8t("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?ETe(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+Q8t+o.post,ETe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=whn(o.body),h.length===1&&h[0]!==void 0&&(h=ETe(h[0],e,!1).map(qLo),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=U8t(h[0]),A=U8t(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(U8t(h[2])),1):1,_=HLo;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 $Lo={"[: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]},CTe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),VLo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),khn=a(t=>t.join(""),"rangesToString"),Phn=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(CTe(h)+"-"+CTe(y)):y===h&&n.push(CTe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(CTe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(CTe(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 vv,WLo=new Set(["!","?","+","*","@"]),q8t=a(t=>WLo.has(t),"isExtglobType"),Dhn=a(t=>q8t(t.type),"isExtglobAST"),zLo=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),YLo=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),KLo=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Nhn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),JLo="(?!(?:^|/)\\.\\.?(?:$|/))",tWe="(?!\\.)",ZLo=new Set(["[","."]),XLo=new Set(["..","."]),e3o=new Set("().*{}+?[]^$\\!"),t3o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),j8t="[^/]",Mhn=j8t+"*?",Ohn=j8t+"+?",r3o=0,DY=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++r3o;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"?vv.#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&&XLo.has(this.#n[0]))){let A=ZLo,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?JLo:E?tWe:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,lP(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,lP(this.toString()),!1,!1]}let c=!n||e||r||!tWe?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?tWe:"")+Ohn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?tWe:"")+Mhn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,lP(s),this.#t=!!this.#t,this.#r]}#S(){if(Dhn(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 df=a((t,e,r={})=>(_Te(e),!r.nocomment&&e.charAt(0)==="#"?!1:new b_(e,r).match(t)),"minimatch"),n3o=/^\*+([^+@!?*[(]*)$/,i3o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),o3o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),s3o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),a3o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),c3o=/^\*+\.\*+$/,l3o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),u3o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),d3o=/^\.\*+$/,f3o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),p3o=/^\*+$/,h3o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),m3o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),g3o=/^\?+([^+@!?*[(]*)?$/,A3o=a(([t,e=""])=>{let r=Fhn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),y3o=a(([t,e=""])=>{let r=Uhn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),E3o=a(([t,e=""])=>{let r=Uhn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),_3o=a(([t,e=""])=>{let r=Fhn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),Fhn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),Uhn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),Qhn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Bhn={win32:{sep:"\\"},posix:{sep:"/"}},C3o=Qhn==="win32"?Bhn.win32.sep:Bhn.posix.sep;df.sep=C3o;var Up=Symbol("globstar **");df.GLOBSTAR=Up;var v3o="[^/]",b3o=v3o+"*?",S3o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",T3o="(?:(?!(?:\\/|^)\\.).)*?",I3o=a((t,e={})=>r=>df(r,t,e),"filter");df.filter=I3o;var Tx=a((t,e={})=>Object.assign({},t,e),"ext"),x3o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return df;let e=df;return Object.assign(a((n,o,s={})=>e(n,o,Tx(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Tx(t,s))}static defaults(o){return e.defaults(Tx(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Tx(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Tx(t,s))}},unescape:a((n,o={})=>e.unescape(n,Tx(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Tx(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Tx(t,o)),"filter"),defaults:a(n=>e.defaults(Tx(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Tx(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Tx(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Tx(t,s)),"match"),sep:e.sep,GLOBSTAR:Up})},"defaults");df.defaults=x3o;var qhn=a((t,e={})=>(_Te(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Rhn(t,{max:e.braceExpandMax})),"braceExpand");df.braceExpand=qhn;var w3o=a((t,e={})=>new b_(t,e).makeRe(),"makeRe");df.makeRe=w3o;var R3o=a((t,e,r={})=>{let n=new b_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");df.match=R3o;var Lhn=/[?*]|[+@!]\(.*?\)|\[|\]/,k3o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),b_=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={}){_Te(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||Qhn,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]==="?"||!Lhn.test(s[2]))&&!Lhn.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(Up)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Up,s),l=r.lastIndexOf(Up),[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"?k3o(h):h===Up?Up:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Up||A===Up||(A===void 0?g!==void 0&&g!==Up?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Up&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Up))});let f=d.filter(h=>h!==Up);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 df.defaults(e).Minimatch}};df.AST=DY;df.Minimatch=b_;df.escape=Oce;df.unescape=lP;var H8t="contentExclusion",rWe=class extends zVe{static{a(this,"CopilotContentExclusion")}#e;#t=new nn(1e4);#r=new nn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=aW(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??RY.all);if(!o)return WVe;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 oQ.exception(this.#e,n,`${H8t}.evaluate`),yhn}return yTe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=yTe,c,l=fPt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(df(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=G8t(u,"FILE_BLOCKED_PATH"),c=d;break e}return oQ.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 yTe;let c=this.evaluateFileContent(o,s,n);return oQ.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=>jhn(c)).some(c=>c.test(n)))return G8t(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>jhn(c)).some(c=>c.test(n)))return G8t(o,"FILE_BLOCKED_TEXT_BASED");return yTe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){_s(this.#e,e,`${H8t}.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=vhn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new Ai("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(RY.all);e.filter(u=>u!==RY.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==RY.all).join(",")),n.searchParams.set("scope",o?RY.all:RY.repo);let c=await Td(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 DN(c)}return this.#s("fetch.success"),PY(M3o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(W0).getRepo(tf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){ht(this.#e,`${H8t}.${e}`,jt.createAndMarkAsIssued(r,n))}};function jhn(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(jhn,"stringToRegex");function G8t(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(G8t,"fileBlockedEvaluationResult");var P3o=S.Object({name:S.String(),type:S.String()}),D3o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:P3o}),$8t=S.Array(D3o),N3o=S.Object({rules:$8t,last_updated_at:S.String(),scope:S.String()}),M3o=S.Array(N3o);var Cc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new rWe(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(cn).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=Pm(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get(cn).onDidFocusTextDocument(r),Es(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){oQ.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(as).setClsInactive(r??"Copilot is disabled"):this.ctx.get(as).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===WVe.reason)return oQ.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 ht(this.ctx,e,jt.createAndMarkAsIssued(l,u)),ht(this.ctx,e,jt.createAndMarkAsIssued({...l,path:r},u),1),oQ.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 Bce(t,e,r){let n=await t.get(Cc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Bce,"isDocumentValid");var cn=class{constructor(e,r=Bce){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=ca(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(Fo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Fo).readFileString(e)}getWorkspaceFolder(e){let r=ca(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(ca(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=ca(e.uri);for(let n of this.getWorkspaceFolders()){let o=ca(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return ji(r)}};p();p();var Ye=new ge("chat");p();var nWe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new no;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 qy=class{constructor(e){this.ctx=e;this.watchers=new nn(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(Ye.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(Pm(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 FM=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},O3o="workspaceLifecycleManager",jy=new ge(O3o),S_=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=Es(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?jy.debug(this.ctx,`listener ${e.constructor.name} is already started`):(jy.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):jy.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);jy.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get(cn).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get(cn).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){jy.debug(r,"No workspaces to add.");return}jy.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];jy.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)));jy.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));jy.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));jy.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){jy.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(qy).terminateWatching(l);for(let d of this.activeListeners)jy.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;jy.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(qy);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){jy.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)jy.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)jy.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(qy).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 iWe(t){t.set(S_,new S_(t))}a(iWe,"setupWorkspaceLifecycleListener");var sQ=ce(require("fs")),Ix=ce(require("path"));var V8t=".agent.md",B3o=300*1e3,L3o="github",Ghn="agents";function vTe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(vTe,"sanitizeSegment");function F3o(t){return t.replace(/\\/g,"/")}a(F3o,"toPosix");var YL=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new ge("OrgCustomAgentService");this.fetchSequencer=new tQ;this.activated=!1;this.orgs=new Map;this.client=o.client??new QVe(e),this.resolveNwo=o.resolveNwo??(s=>C8t(s,[e.get(D0).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??B3o,this.cacheRoot=Ix.join(this.persistenceManager.directory,L3o),this.lifecycleListener=new W8t(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=F3o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${Ghn}/*${V8t}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:$hn.githubOrg}),this.tokenSubscription=Es(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=>ca(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(vTe(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=Ix.relative(this.cacheRoot,e);if(r.startsWith("..")||Ix.isAbsolute(r))return;let n=r.indexOf(Ix.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=Wn(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=ca(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=ca(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(qt(this.ctx,je.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await sQ.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${V8t}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Ix.join(o,l),Ahn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Ix.join(this.cacheRoot,vTe(e.owner),vTe(e.repo),Ghn)}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 sQ.promises.stat(e)).size===n.length&&(await sQ.promises.readFile(e)).equals(n))return}catch{}await sQ.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await sQ.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(V8t)&&!r.has(o.name))try{await sQ.promises.unlink(Ix.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=Ix.join(this.cacheRoot,vTe(e.owner),vTe(e.repo));try{await sQ.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)}`)}}},W8t=class extends FM{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 lA=class{static{a(this,"PromptChangeNotifier")}},oWe=class extends lA{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function Vhn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(Vhn,"createPromptFilesChangedEvent");function Whn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Whn,"createBatchPromptFilesChangedEvent");p();var Wm=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 Lce(...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(Lce,"anyEvent");var Jhn=require("os"),bTe=ce(require("path"));function Fce(t){return t.replace(/\\/g,"/")}a(Fce,"toForwardSlash");function zhn(...t){return bTe.default.posix.join(...t.map(Fce))}a(zhn,"globJoin");function Q3o(t){let e=Fce(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(Q3o,"containsTraversal");function Yhn(t,e){let r=Fce(bTe.default.posix.normalize(Fce(t))),n=Fce(bTe.default.posix.normalize(Fce(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(Yhn,"isContained");var Khn=["*","?","{","["],T_=class{constructor(e,r){this.ctx=e;this.logger=new ge("PromptFileLocationRegistry");this._onLocationsChanged=new Wm;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Jhn.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(Q3o(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=Khn.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=zhn(f,d.pattern.slice(2));if(!Yhn(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=zhn(f,d.pattern);Yhn(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 Khn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(Vhn(e,"ConfigChanged"))}};p();p();p();var z8t=ce(require("path"));function xx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=z8t.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!z8t.posix.isAbsolute(s)}a(xx,"isEqualOrParent");var bv=process.platform==="linux";function aQ(t){return t.replace(/\\/g,"/")}a(aQ,"normalizeSlashes");function cQ(t){let e=aQ(t);return bv?e:e.toLowerCase()}a(cQ,"canonicalKey");function Zhn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>bv?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&&xx(h,d,bv))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(Zhn,"coalesceEvents");var aWe=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Lce(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Lce(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 KL=ce(require("fs"));var MY=new ge("NodeJSWatcherService"),q3o=1e3,cWe=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new Wm;this.onDidChange=this._onDidChange.event;this._onDidError=new Wm;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??KL.watch,this._fsWatchFile=o??{watchFile:KL.watchFile,unwatchFile:KL.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=aQ(e.path),n=cQ(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){MY.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){MY.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return KL.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?G3o(e,aQ(o)):e,c=j3o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),MY.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}),MY.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){MY.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=H3o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:q3o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),MY.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){MY.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function j3o(t,e){if(t==="change")return"update";try{return KL.statSync(e),"create"}catch{return"delete"}}a(j3o,"classify");function H3o(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(H3o,"classifyStat");function G3o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(G3o,"joinPosix");p();var D0n=ce(P0n()),N0n=require("os"),M0n=ce(require("path"));var fWe=new ge("ParcelWatcherService"),MFo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",OFo=process.platform==="darwin"?[M0n.join((0,N0n.homedir)(),"Library","Containers")]:[],pWe=class{constructor(e,r){this.ctx=e;this._onDidChange=new Wm;this.onDidChange=this._onDidChange.event;this._onDidError=new Wm;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??D0n.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=aQ(e.path),n=cQ(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=aQ(e),o=this._findCoveringRoot(n);if(!o)return;let s=cQ(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(xx(r.path,e,bv))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&xx(e.path,o.path,bv)){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=cQ(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=>{fWe.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:MFo,ignore:OFo}).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=cQ(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=aQ(s.path);n.push({path:c,type:s.type})}let o=Zhn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=cQ(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){fWe.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(fWe.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(sa).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),fWe.warn(this.ctx,"Failed to watch for file changes at",r,e))}};var O0n=ce(require("fs"));var lQ=ce(require("path"));var BFo=100,hWe=/[*?{[]/,o6t=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"||!xx(e.path,this.request.path,bv)&&!xx(this.request.path,e.path,bv))return;this._tryActivate();return}e.type==="delete"&&xx(e.path,this.request.path,bv)&&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=lQ.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=LFo(this.request.path,this.statSync);if(n===void 0||FFo(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 LFo(t,e){let r=lQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=lQ.dirname(r)}}a(LFo,"findExistingAncestor");function FFo(t,e){return lQ.dirname(e)===t?!1:t===lQ.parse(t).root}a(FFo,"isAncestorTooBroad");var mWe=class{constructor(e,r,n=O0n.statSync){this._onPromptFileChanged=new Wm;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;if(r===void 0){let o=new pWe(e),s=new cWe(e,o);this._watcher=new aWe(e,o,s),this._ownsWatcher=!0}else this._watcher=r,this._ownsWatcher=!1;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=hWe.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new b_(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=Whn([...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 o6t(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!hWe.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 hWe.test(n)}_extractBaseDir(e){let r=hWe.exec(e);if(!r)return lQ.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=xx(r.path,l,bv),d=xx(l,r.path,bv);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()},BFo)}_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 U0n(t,e=[],r={}){let n=t.length===0?[]:t.split(/\r\n|\n/);return new a6t(n,e,r).parse()}a(U0n,"parse");function RTe(t,e){return{line:t,character:e}}a(RTe,"createPosition");function wx(t,e,r){return{type:"string",value:t,start:e,end:r}}a(wx,"createStringNode");function UFo(t,e,r){return{type:"number",value:t,start:e,end:r}}a(UFo,"createNumberNode");function B0n(t,e,r){return{type:"boolean",value:t,start:e,end:r}}a(B0n,"createBooleanNode");function QFo(t,e){return{type:"null",value:null,start:t,end:e}}a(QFo,"createNullNode");function L0n(t,e,r){return{type:"object",start:e,end:r,properties:t}}a(L0n,"createObjectNode");function F0n(t,e,r){return{type:"array",start:e,end:r,items:t}}a(F0n,"createArrayNode");function Q0n(t){return t===" "||t===" "}a(Q0n,"isWhitespace");function qFo(t){return/^-?\d*\.?\d+$/.test(t)}a(qFo,"isValidNumber");var s6t=class{constructor(e){this.currentLine=0;this.currentChar=0;this.lines=e}static{a(this,"YamlLexer")}getCurrentPosition(){return RTe(this.currentLine,this.currentChar)}getCurrentLineNumber(){return this.currentLine}getCurrentCharNumber(){return this.currentChar}getCurrentLineText(){return this.currentLine=this.lines.length}getCurrentChar(){return this.isAtEnd()||this.currentChar>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][this.currentChar]}peek(e=1){let r=this.currentChar+e;return this.currentLine>=this.lines.length||r>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][r]}advance(){let e=this.getCurrentChar();return this.currentChar>=this.lines[this.currentLine].length&&this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}if(this.currentLine++,this.currentChar=0,this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}}}},a6t=class{constructor(e,r,n){this.flowLevel=0;this.lexer=new s6t(e),this.errors=r,this.options=n}static{a(this,"YamlParser")}addError(e,r,n,o){this.errors.push({message:e,code:r,start:n,end:o})}parseValue(e){if(this.lexer.skipWhitespace(),this.lexer.isAtEnd()){let n=this.lexer.getCurrentPosition();return wx("",n,n)}let r=this.lexer.getCurrentChar();return r==='"'||r==="'"?this.parseQuotedString(r):r==="["?this.parseInlineArray():r==="{"?this.parseInlineObject():this.parseUnquotedValue()}parseQuotedString(e){let r=this.lexer.getCurrentPosition();this.lexer.advance();let n="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==e;)n+=this.lexer.advance();this.lexer.getCurrentChar()===e&&this.lexer.advance();let o=this.lexer.getCurrentPosition();return wx(n,r,o)}parseUnquotedValue(){let e=this.lexer.getCurrentPosition(),r="",n=e,o=a(d=>d==="#"||this.flowLevel>0&&(d===","||d==="]"||d==="}"),"isTerminator"),s=this.lexer.getCurrentChar();if(s==='"'||s==="'")for(r+=this.lexer.advance(),n=this.lexer.getCurrentPosition();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(d===s||o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}let c=r.trimEnd(),l=r.length-c.length;l&&(n=RTe(e.line,n.character-l));let u=s==='"'||s==="'"?c.substring(1):c;return this.createValueNode(u,e,n)}createValueNode(e,r,n){if(e==="")return wx("",r,r);if(e==="true")return B0n(!0,r,n);if(e==="false")return B0n(!1,r,n);if(e==="null"||e==="~")return QFo(r,n);let o=Number(e);return!isNaN(o)&&isFinite(o)&&qFo(e)?UFo(o,r,n):wx(e,r,n)}parseInlineArray(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="]"){this.lexer.advance();break}if(this.lexer.getCurrentChar()===""){this.lexer.advanceLine();continue}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.parseValue();s.type==="string"&&s.value===""&&s.start.line===s.end.line&&s.start.character===s.end.character||r.push(s);let c=this.lexer.savePosition();if(o.line===c.line&&o.char===c.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,F0n(r,e,n)}parseInlineObject(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="}"){this.lexer.advance();break}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.lexer.getCurrentPosition(),c="";if(this.lexer.getCurrentChar()==='"'||this.lexer.getCurrentChar()==="'"){let h=this.lexer.getCurrentChar();for(this.lexer.advance();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==h;)c+=this.lexer.advance();this.lexer.getCurrentChar()===h&&this.lexer.advance()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)c+=this.lexer.advance();c=c.trim();let l=this.lexer.getCurrentPosition(),u=wx(c,s,l);this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let d=this.parseValue();r.push({key:u,value:d});let f=this.lexer.savePosition();if(o.line===f.line&&o.char===f.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,L0n(r,e,n)}parseBlockArray(e){let r=this.lexer.getCurrentPosition(),n=[];for(;!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd());){let s=this.lexer.getIndentation();if(ss)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let u=this.parseBlockArray(l);n.push(u)}else{let u=this.lexer.getCurrentLineText(),d=this.lexer.getCurrentCharNumber(),f=u.substring(d);if(f.includes(":")&&!f.trim().startsWith("#")){let h=this.parseBlockObject(l,this.lexer.getCurrentCharNumber());n.push(h)}else n.push(wx("",c,c))}else n.push(wx("",c,c))}else{let l=this.lexer.getCurrentLineText(),u=this.lexer.getCurrentCharNumber();if(l.substring(u).includes(":")){let h=this.parseBlockObject(c.character,c.character);n.push(h)}else{let h=this.parseValue();for(n.push(h);!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#";)this.lexer.advance();this.lexer.advanceLine()}}}else break}let o=r;return n.length>0?o=n[n.length-1].end:o=RTe(r.line,r.character+1),F0n(n,r,o)}parseBlockObject(e,r){let n=this.lexer.getCurrentPosition(),o=[],s=new Set,c=r!==void 0,l=!0;for(;!this.lexer.isAtEnd()&&((!l||!c)&&this.lexer.moveToNextNonEmptyLine(),l=!1,!this.lexer.isAtEnd());){let d=this.lexer.getIndentation();if(c){if(this.lexer.skipWhitespace(),this.lexer.getCurrentCharNumber()e){let E=RTe(this.lexer.getCurrentLineNumber(),0),_=RTe(this.lexer.getCurrentLineNumber(),this.lexer.getCurrentLineText().length);this.addError("Unexpected indentation","indentation",E,_),this.lexer.skipWhitespace()}else this.lexer.skipWhitespace()}let f=this.lexer.getCurrentPosition(),h="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)h+=this.lexer.advance();h=h.trim();let m=this.lexer.getCurrentPosition(),g=wx(h,f,m);!this.options.allowDuplicateKeys&&s.has(h)&&this.addError(`Duplicate key '${h}'`,"duplicateKey",f,m),s.add(h),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let A,y=this.lexer.getCurrentPosition();if(this.lexer.getCurrentChar()===""||this.lexer.getCurrentChar()==="#")if(this.lexer.advanceLine(),this.lexer.isAtEnd())A=wx("",y,y);else{let E=this.lexer.getIndentation();if(E>d)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-")A=this.parseBlockArray(E);else{let _=this.lexer.getCurrentLineText(),v=this.lexer.getCurrentCharNumber(),b=_.substring(v);b.includes(":")&&!b.trim().startsWith("#")?A=this.parseBlockObject(E):A=this.parseValue()}else!c&&E===d?(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"?A=this.parseBlockArray(d):A=wx("",y,y)):A=wx("",y,y)}else{for(A=this.parseValue();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#"&&Q0n(this.lexer.getCurrentChar());)this.lexer.advance();this.lexer.getCurrentChar()==="#"&&this.lexer.skipToEndOfLine(),!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()===""&&this.lexer.advanceLine()}o.push({key:g,value:A})}let u=n;return o.length>0&&(u=o[o.length-1].value.end),L0n(o,n,u)}parse(){if(!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd()))if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let e=this.lexer.peek();return e===" "||e===" "||e===""||e==="#"?this.parseBlockArray(0):this.parseValue()}else{if(this.lexer.getCurrentChar()==="[")return this.parseInlineArray();if(this.lexer.getCurrentChar()==="{")return this.parseInlineObject();{let e=this.lexer.getCurrentLineText(),r=this.lexer.getCurrentCharNumber(),n=e.substring(r),o=!1,s=!1,c="";for(let l=0;lf>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new dP.Range(2,1,l+1,1);o=new u6t(u,n)}if(c({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 dP.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}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===HFo);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}}},d6t=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;sdP.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 dP.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 dP.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)=>dP.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 GFo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),$Fo="agentHook.event.load",EWe=class{constructor(){this.logger=new ge("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 gt(e,$Fo,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 GFo.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")}};var dQ="globalPromptFiles://";var j0n=["agent","skill","prompt","instructions","hook"];function H0n(t,e){return`${t}::${e}`}a(H0n,"entryKey");function VFo(t){return`${t}::`}a(VFo,"typePrefix");var zm=class{constructor(e,r,n){this.ctx=e;this.fileLocator=r;this.logger=new ge("PromptService");this.watchHandles=new Map;this.entryCache=new Map;this.parseInflight=new Map;this.parsers=new Map;this.disposed=!1;n===void 0?(this.watcher=new mWe(e),this.ownsWatcher=!0):(this.watcher=n,this.ownsWatcher=!1);let o=e.get(T_),s=new class{constructor(){this.inner=new uQ}parse(u,d,f){return this.inner.parse(d,f)}};this.parsers.set("prompt",s),this.parsers.set("instructions",s),this.parsers.set("skill",s),this.parsers.set("agent",s),this.parsers.set("hook",new EWe),this.onPromptFilesChanged=Lce(o.onLocationsChanged,this.watcher.onPromptFileChanged),this.mergedChangeSubscription=this.onPromptFilesChanged(u=>this.handleChange(u));for(let u of j0n)this.rewatch(u);this.registrySubscription=o.onLocationsChanged(u=>{for(let d of u.affectedTypes)this.rewatch(d)});let c=a(u=>{this.evictFolder(u),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends FM{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(u){c(u)}},e.get(S_).addListener(this.workspaceListener)}static{a(this,"PromptService")}async collect(e,r,n){let o=await this.fileLocator.listFiles(e,n,r);return(await Promise.all(o.map(c=>this.resolveEntry(e,r,c)))).filter(c=>c!==void 0)}async resolveEntry(e,r,n){let o=H0n(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(Fo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return 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();try{this.ctx.get(S_).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(Fo).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(H0n(o,Ia(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(lA).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=VFo(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(T_),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 j0n)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{e=this.ctx.get(cn).getWorkspaceFolders().map(o=>Wn(o.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=>xx(s.normalized,o.normalized,bv))||n.push(o);return n.map(o=>o.raw)}};p();var uu=class{constructor(){this.policyChangeEmitter=new Wm;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},_We=class extends uu{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var f6t=64;var JL=(r=>(r.enabled="enabled",r.disabled="disabled",r))(JL||{}),Ym={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},$f={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},BY=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,f6t),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},fQ=class extends BY{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},wr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},pQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},LY=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Or=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},hQ=class extends Or{static{a(this,"ExtendedLanguageModelToolResult")}},G0n=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")]))}),ZL=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(ZL||{}),$0n=S.Object({result:S.Enum(ZL)});var p6t=ce(require("fs"));var kTe=ce(require("path"));var WFo=["user","model"],m6t="source",g6t={githubOrg:"github-org"},$hn={githubOrg:{[m6t]:g6t.githubOrg}},h6t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri,this._name=r.name??ji(n.uri).replace(".agent.md","")}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||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??WFo}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(g6t));for(let n of e){let o=n[m6t];if(typeof o=="string"&&r.has(o))return o}}},V0n="./assets/prompts.contributions.json",zFo="CVE Remediator",YFo="Debugger",W0n=new Map([[zFo,"cveRemediatorAgent"],[YFo,"debuggerAgent"]]),jp=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new ge("CustomAgentService");this.agentUpdateSequencer=new tQ;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),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"}subscribeToGateChanges(){try{let e=this.ctx.get(Zo);this.lastEnableCustomAgents=qt(this.ctx,je.EnableCustomAgents),this.lastEnableOrgCustomAgents=qt(this.ctx,je.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=qt(this.ctx,je.EnableCustomAgents),n=qt(this.ctx,je.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(uu);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(Mn),r=Array.from(new Set(W0n.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(lA).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))}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(Wn(n.uri)):n.type==="location"&&r.add(kTe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e){if(this.ctx.get(uu).getPolicyValue("customAgent.enabled")===!1)return[];if(qt(this.ctx,je.EnableCustomAgents)===!1)return[];await this.ready;let o=(await this.ctx.get(zm).collect(this.ctx,"agent",e)).map(u=>new h6t(u)),s=this.ctx.get(YL),c=qt(this.ctx,je.EnableOrgCustomAgents)!==!1,l=this.ctx.get(Mn).getCapabilities();return o.filter(u=>{if(this.isOrgScopedAgent(u)){if(!c)return!1;let h=u.promptFileEntry?.parsedPromptFile.uri,m=h?ho(h):void 0;if(!m||!s.isCachedAgentVisibleFor(m,e))return!1}let d=W0n.get(u.name);if(d===void 0)return!0;let f=l[d]??!1;return f||this.logger.debug(this.ctx,`Filtering out agent '${u.name}' (capability '${d}' is disabled)`),f})}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[m6t]===g6t.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",[Wn(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=kTe.default.extname(__filename)===".ts"?kTe.default.resolve(__dirname,"../../../..",e):kTe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(V0n),n=await p6t.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);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${V0n}:`,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=wY({[A]:y}).trim();m.push(E)}}u=m.join(` +`}a(Vfn,"generateAgentMarkdown");p();p();p();p();p();p();var GSe={isBlocked:!1,reason:"VALID_FILE"},hVe={isBlocked:!1,reason:"NO_MATCHING_POLICY"},Wfn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},dY={all:"all",repo:"repo"},H7=new Ee("contentExclusion");p();p();var mVe=class{static{a(this,"PolicyEvaluator")}};p();p();p();var qFt=new Ee("repository"),fY=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(".")}},tk=class{static{a(this,"GitConfigLoader")}},gVe=class extends tk{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 zfn=require("os");var AVe=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 U9.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=U9.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,zfn.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 yVe=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(tk).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 AVe(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 GOo=100,jFt=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])}}},V0=class t{constructor(e){this.ctx=e;this.remoteResolver=new yVe;this.cache=new yn(GOo)}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=Xd(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 jFt(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(Bo),o=Sa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=Sa(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=HV(r,s[1]),l=Sa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=Sa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=Sa(c,"commondir");c=HV(c,(await e.readFileString(d)).trimEnd());let f=Sa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var pY=a((t,e)=>{if(_M.Check(t,e))return e;let r=`Typebox schema validation failed: +${[..._M.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");p();p();p();var EVe=new WeakMap;function _Ve(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]"&&EVe.has(t))return EVe.get(t);switch(EVe.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($Oo,"n");function Jfn(t,e){return function(r,n){return $Oo(t,e,r,n)}}a(Jfn,"o");p();p();p();var GFt=a((t,e,r)=>{let n=t instanceof RegExp?Zfn(t,r):t,o=e instanceof RegExp?Zfn(e,r):e,s=n!==null&&o!=null&&VOo(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"),Zfn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),VOo=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 Xfn="\0SLASH"+Math.random()+"\0",epn="\0OPEN"+Math.random()+"\0",VFt="\0CLOSE"+Math.random()+"\0",tpn="\0COMMA"+Math.random()+"\0",rpn="\0PERIOD"+Math.random()+"\0",WOo=new RegExp(Xfn,"g"),zOo=new RegExp(epn,"g"),YOo=new RegExp(VFt,"g"),KOo=new RegExp(tpn,"g"),JOo=new RegExp(rpn,"g"),ZOo=/\\\\/g,XOo=/\\{/g,e5o=/\\}/g,t5o=/\\,/g,r5o=/\\\./g,n5o=1e5;function $Ft(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a($Ft,"numeric");function i5o(t){return t.replace(ZOo,Xfn).replace(XOo,epn).replace(e5o,VFt).replace(t5o,tpn).replace(r5o,rpn)}a(i5o,"escapeBraces");function o5o(t){return t.replace(WOo,"\\").replace(zOo,"{").replace(YOo,"}").replace(KOo,",").replace(JOo,".")}a(o5o,"unescapeBraces");function npn(t){if(!t)return[""];let e=[],r=GFt("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=npn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(npn,"parseCommaParts");function ipn(t,e={}){if(!t)return[];let{max:r=n5o}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),$Se(i5o(t),r,!0).map(o5o)}a(ipn,"expand");function s5o(t){return"{"+t+"}"}a(s5o,"embrace");function a5o(t){return/^-?0\d/.test(t)}a(a5o,"isPadded");function c5o(t,e){return t<=e}a(c5o,"lte");function l5o(t,e){return t>=e}a(l5o,"gte");function $Se(t,e,r){let n=[],o=GFt("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?$Se(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+VFt+o.post,$Se(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=npn(o.body),h.length===1&&h[0]!==void 0&&(h=$Se(h[0],e,!1).map(s5o),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=$Ft(h[0]),A=$Ft(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs($Ft(h[2])),1):1,_=c5o;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 u5o={"[: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]},WSe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),d5o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),opn=a(t=>t.join(""),"rangesToString"),spn=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(WSe(h)+"-"+WSe(y)):y===h&&n.push(WSe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(WSe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(WSe(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 gC,f5o=new Set(["!","?","+","*","@"]),WFt=a(t=>f5o.has(t),"isExtglobType"),apn=a(t=>WFt(t.type),"isExtglobAST"),p5o=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),h5o=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),m5o=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),cpn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),g5o="(?!(?:^|/)\\.\\.?(?:$|/))",CVe="(?!\\.)",A5o=new Set(["[","."]),y5o=new Set(["..","."]),E5o=new Set("().*{}+?[]^$\\!"),_5o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),zFt="[^/]",lpn=zFt+"*?",upn=zFt+"+?",v5o=0,hY=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++v5o;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"?gC.#P(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&&y5o.has(this.#n[0]))){let A=A5o,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?g5o:E?CVe:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,rk(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,rk(this.toString()),!1,!1]}let c=!n||e||r||!CVe?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?CVe:"")+upn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?CVe:"")+lpn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,rk(s),this.#t=!!this.#t,this.#r]}#S(){if(apn(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#P(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 lf=a((t,e,r={})=>(VSe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new v_(e,r).match(t)),"minimatch"),C5o=/^\*+([^+@!?*[(]*)$/,b5o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),S5o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),T5o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),I5o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),x5o=/^\*+\.\*+$/,w5o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),R5o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),P5o=/^\.\*+$/,k5o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),D5o=/^\*+$/,N5o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),M5o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),O5o=/^\?+([^+@!?*[(]*)?$/,B5o=a(([t,e=""])=>{let r=ppn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),L5o=a(([t,e=""])=>{let r=hpn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),F5o=a(([t,e=""])=>{let r=hpn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),U5o=a(([t,e=""])=>{let r=ppn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),ppn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),hpn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),mpn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",dpn={win32:{sep:"\\"},posix:{sep:"/"}},Q5o=mpn==="win32"?dpn.win32.sep:dpn.posix.sep;lf.sep=Q5o;var Qp=Symbol("globstar **");lf.GLOBSTAR=Qp;var q5o="[^/]",j5o=q5o+"*?",H5o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",G5o="(?:(?!(?:\\/|^)\\.).)*?",$5o=a((t,e={})=>r=>lf(r,t,e),"filter");lf.filter=$5o;var Ex=a((t,e={})=>Object.assign({},t,e),"ext"),V5o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return lf;let e=lf;return Object.assign(a((n,o,s={})=>e(n,o,Ex(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Ex(t,s))}static defaults(o){return e.defaults(Ex(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Ex(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Ex(t,s))}},unescape:a((n,o={})=>e.unescape(n,Ex(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Ex(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Ex(t,o)),"filter"),defaults:a(n=>e.defaults(Ex(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Ex(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Ex(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Ex(t,s)),"match"),sep:e.sep,GLOBSTAR:Qp})},"defaults");lf.defaults=V5o;var gpn=a((t,e={})=>(VSe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:ipn(t,{max:e.braceExpandMax})),"braceExpand");lf.braceExpand=gpn;var W5o=a((t,e={})=>new v_(t,e).makeRe(),"makeRe");lf.makeRe=W5o;var z5o=a((t,e,r={})=>{let n=new v_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");lf.match=z5o;var fpn=/[?*]|[+@!]\(.*?\)|\[|\]/,Y5o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),v_=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={}){VSe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||mpn,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]==="?"||!fpn.test(s[2]))&&!fpn.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(Qp)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Qp,s),l=r.lastIndexOf(Qp),[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"?Y5o(h):h===Qp?Qp:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Qp||A===Qp||(A===void 0?g!==void 0&&g!==Qp?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Qp&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Qp))});let f=d.filter(h=>h!==Qp);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 lf.defaults(e).Minimatch}};lf.AST=hY;lf.Minimatch=v_;lf.escape=pce;lf.unescape=rk;var YFt="contentExclusion",bVe=class extends mVe{static{a(this,"CopilotContentExclusion")}#e;#t=new yn(1e4);#r=new yn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=HV(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??dY.all);if(!o)return hVe;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 H7.exception(this.#e,n,`${YFt}.evaluate`),Wfn}return GSe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=GSe,c,l=PPt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(lf(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=KFt(u,"FILE_BLOCKED_PATH"),c=d;break e}return H7.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 GSe;let c=this.evaluateFileContent(o,s,n);return H7.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=>Apn(c)).some(c=>c.test(n)))return KFt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>Apn(c)).some(c=>c.test(n)))return KFt(o,"FILE_BLOCKED_TEXT_BASED");return GSe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){La(this.#e,e,`${YFt}.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=Jfn(async e=>{let r=await this.#e.get(Ut).getGitHubSession();if(!r)throw new Jn("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(dY.all);e.filter(u=>u!==dY.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==dY.all).join(",")),n.searchParams.set("scope",o?dY.all:dY.repo);let c=await Bf(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 SN(c)}return this.#s("fetch.success"),pY(X5o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(V0).getRepo(Xd(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){yt(this.#e,`${YFt}.${e}`,Vt.createAndMarkAsIssued(r,n))}};function Apn(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(Apn,"stringToRegex");function KFt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(KFt,"fileBlockedEvaluationResult");var K5o=S.Object({name:S.String(),type:S.String()}),J5o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:K5o}),JFt=S.Array(J5o),Z5o=S.Object({rules:JFt,last_updated_at:S.String(),scope:S.String()}),X5o=S.Array(Z5o);var Ec=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new bVe(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(an).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=km(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get(an).onDidFocusTextDocument(r),ys(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){H7.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(os).setClsInactive(r??"Copilot is disabled"):this.ctx.get(os).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===hVe.reason)return H7.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 yt(this.ctx,e,Vt.createAndMarkAsIssued(l,u)),yt(this.ctx,e,Vt.createAndMarkAsIssued({...l,path:r},u),1),H7.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 hce(t,e,r){let n=await t.get(Ec).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(hce,"isDocumentValid");var an=class{constructor(e,r=hce){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=ia(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(Bo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Bo).readFileString(e)}getWorkspaceFolder(e){let r=ia(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(ia(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=ia(e.uri);for(let n of this.getWorkspaceFolders()){let o=ia(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ki(r)}};p();p();var ot=new Ee("chat");p();var SVe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new ro;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 _x=class{constructor(e){this.ctx=e;this.watchers=new yn(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(km(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 G7=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},e4o="workspaceLifecycleManager",Hy=new Ee(e4o),AS=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=ys(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?Hy.debug(this.ctx,`listener ${e.constructor.name} is already started`):(Hy.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):Hy.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);Hy.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get(an).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get(an).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){Hy.debug(r,"No workspaces to add.");return}Hy.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];Hy.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)));Hy.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));Hy.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));Hy.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){Hy.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(_x).terminateWatching(l);for(let d of this.activeListeners)Hy.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;Hy.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(_x);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){Hy.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)Hy.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)Hy.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(_x).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 TVe(t){t.set(AS,new AS(t))}a(TVe,"setupWorkspaceLifecycleListener");var $7=he(require("fs")),vx=he(require("path"));var ZFt=".agent.md",t4o=300*1e3,r4o="github",Epn="agents";function zSe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(zSe,"sanitizeSegment");function n4o(t){return t.replace(/\\/g,"/")}a(n4o,"toPosix");var OL=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new Ee("OrgCustomAgentService");this.fetchSequencer=new q7;this.activated=!1;this.orgs=new Map;this.client=o.client??new pVe(e),this.resolveNwo=o.resolveNwo??(s=>UFt(s,[e.get(D0).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??t4o,this.cacheRoot=vx.join(this.persistenceManager.directory,r4o),this.lifecycleListener=new XFt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=n4o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${Epn}/*${ZFt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:_pn.githubOrg}),this.tokenSubscription=ys(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=>ia(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(zSe(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=vx.relative(this.cacheRoot,e);if(r.startsWith("..")||vx.isAbsolute(r))return;let n=r.indexOf(vx.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=Wn(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=ia(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=ia(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(Gt(this.ctx,Je.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await $7.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${ZFt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(vx.join(o,l),Vfn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return vx.join(this.cacheRoot,zSe(e.owner),zSe(e.repo),Epn)}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 $7.promises.stat(e)).size===n.length&&(await $7.promises.readFile(e)).equals(n))return}catch{}await $7.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await $7.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(ZFt)&&!r.has(o.name))try{await $7.promises.unlink(vx.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=vx.join(this.cacheRoot,zSe(e.owner),zSe(e.repo));try{await $7.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)}`)}}},XFt=class extends G7{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 fA=class{static{a(this,"PromptChangeNotifier")}},IVe=class extends fA{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function vpn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(vpn,"createPromptFilesChangedEvent");function Cpn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Cpn,"createBatchPromptFilesChangedEvent");p();var Wm=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 mce(...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(mce,"anyEvent");var Ipn=require("os"),YSe=he(require("path"));function gce(t){return t.replace(/\\/g,"/")}a(gce,"toForwardSlash");function bpn(...t){return YSe.default.posix.join(...t.map(gce))}a(bpn,"globJoin");function o4o(t){let e=gce(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(o4o,"containsTraversal");function Spn(t,e){let r=gce(YSe.default.posix.normalize(gce(t))),n=gce(YSe.default.posix.normalize(gce(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(Spn,"isContained");var Tpn=["*","?","{","["],C_=class{constructor(e,r){this.ctx=e;this.logger=new Ee("PromptFileLocationRegistry");this._onLocationsChanged=new Wm;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Ipn.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(o4o(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=Tpn.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=bpn(f,d.pattern.slice(2));if(!Spn(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=bpn(f,d.pattern);Spn(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 Tpn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(vpn(e,"ConfigChanged"))}};p();p();p();var e8t=he(require("path"));function Cx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=e8t.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!e8t.posix.isAbsolute(s)}a(Cx,"isEqualOrParent");var AC=process.platform==="linux";function V7(t){return t.replace(/\\/g,"/")}a(V7,"normalizeSlashes");function W7(t){let e=V7(t);return AC?e:e.toLowerCase()}a(W7,"canonicalKey");function xpn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>AC?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&&Cx(h,d,AC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(xpn,"coalesceEvents");var wVe=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=mce(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=mce(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 BL=he(require("fs"));var gY=new Ee("NodeJSWatcherService"),s4o=1e3,RVe=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new Wm;this.onDidChange=this._onDidChange.event;this._onDidError=new Wm;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??BL.watch,this._fsWatchFile=o??{watchFile:BL.watchFile,unwatchFile:BL.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=V7(e.path),n=W7(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){gY.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){gY.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return BL.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?l4o(e,V7(o)):e,c=a4o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),gY.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}),gY.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){gY.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=c4o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:s4o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),gY.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){gY.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function a4o(t,e){if(t==="change")return"update";try{return BL.statSync(e),"create"}catch{return"delete"}}a(a4o,"classify");function c4o(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(c4o,"classifyStat");function l4o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(l4o,"joinPosix");p();var ahn=he(shn()),chn=require("os"),lhn=he(require("path"));var NVe=new Ee("ParcelWatcherService"),X4o=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",eBo=process.platform==="darwin"?[lhn.join((0,chn.homedir)(),"Library","Containers")]:[],MVe=class{constructor(e,r){this.ctx=e;this._onDidChange=new Wm;this.onDidChange=this._onDidChange.event;this._onDidError=new Wm;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??ahn.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=V7(e.path),n=W7(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=V7(e),o=this._findCoveringRoot(n);if(!o)return;let s=W7(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(Cx(r.path,e,AC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&Cx(e.path,o.path,AC)){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=W7(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=>{NVe.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:X4o,ignore:eBo}).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=W7(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=V7(s.path);n.push({path:c,type:s.type})}let o=xpn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=W7(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){NVe.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(NVe.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(ra).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),NVe.warn(this.ctx,"Failed to watch for file changes at",r,e))}};var uhn=he(require("fs"));var z7=he(require("path"));var tBo=100,OVe=/[*?{[]/,d8t=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"||!Cx(e.path,this.request.path,AC)&&!Cx(this.request.path,e.path,AC))return;this._tryActivate();return}e.type==="delete"&&Cx(e.path,this.request.path,AC)&&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=z7.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=rBo(this.request.path,this.statSync);if(n===void 0||nBo(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 rBo(t,e){let r=z7.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=z7.dirname(r)}}a(rBo,"findExistingAncestor");function nBo(t,e){return z7.dirname(e)===t?!1:t===z7.parse(t).root}a(nBo,"isAncestorTooBroad");var BVe=class{constructor(e,r,n=uhn.statSync){this._onPromptFileChanged=new Wm;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;if(r===void 0){let o=new MVe(e),s=new RVe(e,o);this._watcher=new wVe(e,o,s),this._ownsWatcher=!0}else this._watcher=r,this._ownsWatcher=!1;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=OVe.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new v_(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=Cpn([...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 d8t(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!OVe.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 OVe.test(n)}_extractBaseDir(e){let r=OVe.exec(e);if(!r)return z7.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=Cx(r.path,l,AC),d=Cx(l,r.path,AC);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()},tBo)}_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 hhn(t,e=[],r={}){let n=t.length===0?[]:t.split(/\r\n|\n/);return new p8t(n,e,r).parse()}a(hhn,"parse");function tTe(t,e){return{line:t,character:e}}a(tTe,"createPosition");function bx(t,e,r){return{type:"string",value:t,start:e,end:r}}a(bx,"createStringNode");function iBo(t,e,r){return{type:"number",value:t,start:e,end:r}}a(iBo,"createNumberNode");function dhn(t,e,r){return{type:"boolean",value:t,start:e,end:r}}a(dhn,"createBooleanNode");function oBo(t,e){return{type:"null",value:null,start:t,end:e}}a(oBo,"createNullNode");function fhn(t,e,r){return{type:"object",start:e,end:r,properties:t}}a(fhn,"createObjectNode");function phn(t,e,r){return{type:"array",start:e,end:r,items:t}}a(phn,"createArrayNode");function mhn(t){return t===" "||t===" "}a(mhn,"isWhitespace");function sBo(t){return/^-?\d*\.?\d+$/.test(t)}a(sBo,"isValidNumber");var f8t=class{constructor(e){this.currentLine=0;this.currentChar=0;this.lines=e}static{a(this,"YamlLexer")}getCurrentPosition(){return tTe(this.currentLine,this.currentChar)}getCurrentLineNumber(){return this.currentLine}getCurrentCharNumber(){return this.currentChar}getCurrentLineText(){return this.currentLine=this.lines.length}getCurrentChar(){return this.isAtEnd()||this.currentChar>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][this.currentChar]}peek(e=1){let r=this.currentChar+e;return this.currentLine>=this.lines.length||r>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][r]}advance(){let e=this.getCurrentChar();return this.currentChar>=this.lines[this.currentLine].length&&this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}if(this.currentLine++,this.currentChar=0,this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}}}},p8t=class{constructor(e,r,n){this.flowLevel=0;this.lexer=new f8t(e),this.errors=r,this.options=n}static{a(this,"YamlParser")}addError(e,r,n,o){this.errors.push({message:e,code:r,start:n,end:o})}parseValue(e){if(this.lexer.skipWhitespace(),this.lexer.isAtEnd()){let n=this.lexer.getCurrentPosition();return bx("",n,n)}let r=this.lexer.getCurrentChar();return r==='"'||r==="'"?this.parseQuotedString(r):r==="["?this.parseInlineArray():r==="{"?this.parseInlineObject():this.parseUnquotedValue()}parseQuotedString(e){let r=this.lexer.getCurrentPosition();this.lexer.advance();let n="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==e;)n+=this.lexer.advance();this.lexer.getCurrentChar()===e&&this.lexer.advance();let o=this.lexer.getCurrentPosition();return bx(n,r,o)}parseUnquotedValue(){let e=this.lexer.getCurrentPosition(),r="",n=e,o=a(d=>d==="#"||this.flowLevel>0&&(d===","||d==="]"||d==="}"),"isTerminator"),s=this.lexer.getCurrentChar();if(s==='"'||s==="'")for(r+=this.lexer.advance(),n=this.lexer.getCurrentPosition();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(d===s||o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}let c=r.trimEnd(),l=r.length-c.length;l&&(n=tTe(e.line,n.character-l));let u=s==='"'||s==="'"?c.substring(1):c;return this.createValueNode(u,e,n)}createValueNode(e,r,n){if(e==="")return bx("",r,r);if(e==="true")return dhn(!0,r,n);if(e==="false")return dhn(!1,r,n);if(e==="null"||e==="~")return oBo(r,n);let o=Number(e);return!isNaN(o)&&isFinite(o)&&sBo(e)?iBo(o,r,n):bx(e,r,n)}parseInlineArray(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="]"){this.lexer.advance();break}if(this.lexer.getCurrentChar()===""){this.lexer.advanceLine();continue}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.parseValue();s.type==="string"&&s.value===""&&s.start.line===s.end.line&&s.start.character===s.end.character||r.push(s);let c=this.lexer.savePosition();if(o.line===c.line&&o.char===c.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,phn(r,e,n)}parseInlineObject(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="}"){this.lexer.advance();break}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.lexer.getCurrentPosition(),c="";if(this.lexer.getCurrentChar()==='"'||this.lexer.getCurrentChar()==="'"){let h=this.lexer.getCurrentChar();for(this.lexer.advance();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==h;)c+=this.lexer.advance();this.lexer.getCurrentChar()===h&&this.lexer.advance()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)c+=this.lexer.advance();c=c.trim();let l=this.lexer.getCurrentPosition(),u=bx(c,s,l);this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let d=this.parseValue();r.push({key:u,value:d});let f=this.lexer.savePosition();if(o.line===f.line&&o.char===f.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,fhn(r,e,n)}parseBlockArray(e){let r=this.lexer.getCurrentPosition(),n=[];for(;!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd());){let s=this.lexer.getIndentation();if(ss)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let u=this.parseBlockArray(l);n.push(u)}else{let u=this.lexer.getCurrentLineText(),d=this.lexer.getCurrentCharNumber(),f=u.substring(d);if(f.includes(":")&&!f.trim().startsWith("#")){let h=this.parseBlockObject(l,this.lexer.getCurrentCharNumber());n.push(h)}else n.push(bx("",c,c))}else n.push(bx("",c,c))}else{let l=this.lexer.getCurrentLineText(),u=this.lexer.getCurrentCharNumber();if(l.substring(u).includes(":")){let h=this.parseBlockObject(c.character,c.character);n.push(h)}else{let h=this.parseValue();for(n.push(h);!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#";)this.lexer.advance();this.lexer.advanceLine()}}}else break}let o=r;return n.length>0?o=n[n.length-1].end:o=tTe(r.line,r.character+1),phn(n,r,o)}parseBlockObject(e,r){let n=this.lexer.getCurrentPosition(),o=[],s=new Set,c=r!==void 0,l=!0;for(;!this.lexer.isAtEnd()&&((!l||!c)&&this.lexer.moveToNextNonEmptyLine(),l=!1,!this.lexer.isAtEnd());){let d=this.lexer.getIndentation();if(c){if(this.lexer.skipWhitespace(),this.lexer.getCurrentCharNumber()e){let E=tTe(this.lexer.getCurrentLineNumber(),0),_=tTe(this.lexer.getCurrentLineNumber(),this.lexer.getCurrentLineText().length);this.addError("Unexpected indentation","indentation",E,_),this.lexer.skipWhitespace()}else this.lexer.skipWhitespace()}let f=this.lexer.getCurrentPosition(),h="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)h+=this.lexer.advance();h=h.trim();let m=this.lexer.getCurrentPosition(),g=bx(h,f,m);!this.options.allowDuplicateKeys&&s.has(h)&&this.addError(`Duplicate key '${h}'`,"duplicateKey",f,m),s.add(h),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let A,y=this.lexer.getCurrentPosition();if(this.lexer.getCurrentChar()===""||this.lexer.getCurrentChar()==="#")if(this.lexer.advanceLine(),this.lexer.isAtEnd())A=bx("",y,y);else{let E=this.lexer.getIndentation();if(E>d)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-")A=this.parseBlockArray(E);else{let _=this.lexer.getCurrentLineText(),v=this.lexer.getCurrentCharNumber(),b=_.substring(v);b.includes(":")&&!b.trim().startsWith("#")?A=this.parseBlockObject(E):A=this.parseValue()}else!c&&E===d?(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"?A=this.parseBlockArray(d):A=bx("",y,y)):A=bx("",y,y)}else{for(A=this.parseValue();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#"&&mhn(this.lexer.getCurrentChar());)this.lexer.advance();this.lexer.getCurrentChar()==="#"&&this.lexer.skipToEndOfLine(),!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()===""&&this.lexer.advanceLine()}o.push({key:g,value:A})}let u=n;return o.length>0&&(u=o[o.length-1].value.end),fhn(o,n,u)}parse(){if(!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd()))if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let e=this.lexer.peek();return e===" "||e===" "||e===""||e==="#"?this.parseBlockArray(0):this.parseValue()}else{if(this.lexer.getCurrentChar()==="[")return this.parseInlineArray();if(this.lexer.getCurrentChar()==="{")return this.parseInlineObject();{let e=this.lexer.getCurrentLineText(),r=this.lexer.getCurrentCharNumber(),n=e.substring(r),o=!1,s=!1,c="";for(let l=0;lf>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new ik.Range(2,1,l+1,1);o=new g8t(u,n)}if(c({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 ik.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}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===cBo);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}}},A8t=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;sik.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 ik.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 ik.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)=>ik.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 lBo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),uBo="agentHook.event.load",QVe=class{constructor(){this.logger=new Ee("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 _t(e,uBo,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 lBo.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")}};var K7="globalPromptFiles://";var Ahn=["agent","skill","prompt","instructions","hook"];function yhn(t,e){return`${t}::${e}`}a(yhn,"entryKey");function dBo(t){return`${t}::`}a(dBo,"typePrefix");var zm=class{constructor(e,r,n){this.ctx=e;this.fileLocator=r;this.logger=new Ee("PromptService");this.watchHandles=new Map;this.entryCache=new Map;this.parseInflight=new Map;this.parsers=new Map;this.disposed=!1;n===void 0?(this.watcher=new BVe(e),this.ownsWatcher=!0):(this.watcher=n,this.ownsWatcher=!1);let o=e.get(C_),s=new class{constructor(){this.inner=new Y7}parse(u,d,f){return this.inner.parse(d,f)}};this.parsers.set("prompt",s),this.parsers.set("instructions",s),this.parsers.set("skill",s),this.parsers.set("agent",s),this.parsers.set("hook",new QVe),this.onPromptFilesChanged=mce(o.onLocationsChanged,this.watcher.onPromptFileChanged),this.mergedChangeSubscription=this.onPromptFilesChanged(u=>this.handleChange(u));for(let u of Ahn)this.rewatch(u);this.registrySubscription=o.onLocationsChanged(u=>{for(let d of u.affectedTypes)this.rewatch(d)});let c=a(u=>{this.evictFolder(u),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends G7{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(u){c(u)}},e.get(AS).addListener(this.workspaceListener)}static{a(this,"PromptService")}async collect(e,r,n){let o=await this.fileLocator.listFiles(e,n,r);return(await Promise.all(o.map(c=>this.resolveEntry(e,r,c)))).filter(c=>c!==void 0)}async resolveEntry(e,r,n){let o=yhn(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(Bo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return 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();try{this.ctx.get(AS).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(Bo).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(yhn(o,ba(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(fA).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=dBo(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(C_),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 Ahn)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{e=this.ctx.get(an).getWorkspaceFolders().map(o=>Wn(o.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=>Cx(s.normalized,o.normalized,AC))||n.push(o);return n.map(o=>o.raw)}};p();var cu=class{constructor(){this.policyChangeEmitter=new Wm;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},qVe=class extends cu{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var y8t=64;var LL=(r=>(r.enabled="enabled",r.disabled="disabled",r))(LL||{}),Ym={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},Vf={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},yY=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,y8t),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},J7=class extends yY{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},wr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},Z7=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},EY=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Or=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},X7=class extends Or{static{a(this,"ExtendedLanguageModelToolResult")}},Ehn=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")]))}),FL=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(FL||{}),_hn=S.Object({result:S.Enum(FL)});var E8t=he(require("fs"));var rTe=he(require("path"));var fBo=["user","model"],v8t="source",C8t={githubOrg:"github-org"},_pn={githubOrg:{[v8t]:C8t.githubOrg}},_8t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri,this._name=r.name??Ki(n.uri).replace(".agent.md","")}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||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??fBo}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(C8t));for(let n of e){let o=n[v8t];if(typeof o=="string"&&r.has(o))return o}}},vhn="./assets/prompts.contributions.json",pBo="CVE Remediator",hBo="Debugger",Chn=new Map([[pBo,"cveRemediatorAgent"],[hBo,"debuggerAgent"]]),Hp=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new Ee("CustomAgentService");this.agentUpdateSequencer=new q7;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),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"}subscribeToGateChanges(){try{let e=this.ctx.get(zo);this.lastEnableCustomAgents=Gt(this.ctx,Je.EnableCustomAgents),this.lastEnableOrgCustomAgents=Gt(this.ctx,Je.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Gt(this.ctx,Je.EnableCustomAgents),n=Gt(this.ctx,Je.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(cu);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(Mn),r=Array.from(new Set(Chn.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(fA).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))}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(Wn(n.uri)):n.type==="location"&&r.add(rTe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e){if(this.ctx.get(cu).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let o=(await this.ctx.get(zm).collect(this.ctx,"agent",e)).map(u=>new _8t(u)),s=this.ctx.get(OL),c=Gt(this.ctx,Je.EnableOrgCustomAgents)!==!1,l=this.ctx.get(Mn).getCapabilities();return o.filter(u=>{if(this.isOrgScopedAgent(u)){if(!c)return!1;let h=u.promptFileEntry?.parsedPromptFile.uri,m=h?Yo(h):void 0;if(!m||!s.isCachedAgentVisibleFor(m,e))return!1}let d=Chn.get(u.name);if(d===void 0)return!0;let f=l[d]??!1;return f||this.logger.debug(this.ctx,`Filtering out agent '${u.name}' (capability '${d}' is disabled)`),f})}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[v8t]===C8t.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",[Wn(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=rTe.default.extname(__filename)===".ts"?rTe.default.resolve(__dirname,"../../../..",e):rTe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(vhn),n=await E8t.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);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${vhn}:`,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=uY({[A]:y}).trim();m.push(E)}}u=m.join(` `)+` `}let d=c.body?.content,f=u?`--- ${u}--- -${d}`:d||"",h=ho(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await p6t.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 DTe=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}},PTe=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")}},yl={Ask:new PTe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new PTe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new PTe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function Y0n(t){return t===yl.Agent||t.id===yl.Agent.id}a(Y0n,"isBuiltInAgentMode");function KFo(t){return t===yl.InlineAgent||t.id===yl.InlineAgent.id}a(KFo,"isBuiltInInlineAgentMode");function K0n(t){return t===yl.Ask||t.id===yl.Ask.id||Y0n(t)||KFo(t)}a(K0n,"isBuiltInChatMode");function NTe(t){return Y0n(t)||!t.isBuiltIn&&t.customTools===void 0}a(NTe,"shouldApplyGlobalToolsSetting");var x_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[yl.Ask,yl.Agent,yl.InlineAgent],o=await this.ctx.get(jp).listCustomAgents(e||[]);return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new DTe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return yl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??yl.Agent:yl.Agent;case"InlineAgent":return yl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Mc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var CWe=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 JFo=new ge("conversationProgress"),mQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var vc=class{constructor(e){this.ctx=e;this.progressEntries=new nn(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);JFo.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"&&Ye.error(this.ctx,`Work done token for conversation ${e.id} is already ${r.status}, last updated at ${r.updatedAt}`),r}};p();p();p();var Ao={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"};function gQ(t){return t===Ao.Azure?1:0}a(gQ,"getAuthTypeForProvider");function Qce(t){return t===Ao.OpenAI||t===Ao.Gemini||t===Ao.Groq||t===Ao.OpenRouter||t===Ao.Anthropic}a(Qce,"isOpenAICompatible");async function QM(t,e,r){let o=await new bc(t.get(Si)).getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=c?.maxInputTokens||1e5,d=c?.maxOutputTokens||8192;return{modelId:r,uiName:l,modelFamily:Tn.BYOK,providerName:e,deploymentUrl:s?.deploymentUrl,maxRequestTokens:u,maxResponseTokens:d,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,originalBillingMultiplier:0}}a(QM,"resolveModelConfiguration");async function vWe(t,e,r){return await new bc(t.get(Si)).getAPIKey(e,r)}a(vWe,"resolveModelKey");function J0n(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(J0n,"resolveAzureUrl");function AQ(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(AQ,"isBYOKEnabled");var qM="byok",bc=class{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(qM,`${e}-${r}-api-key`);if(o)return o}return await this.persistenceManager.read(qM,`${e}-api-key`)}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(qM,`${e}-api-key`,r):n===1&&o&&await this.persistenceManager.update(qM,`${e}-${o}-api-key`,r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(qM,`${e}-api-key`):r===1&&n&&await this.persistenceManager.delete(qM,`${e}-${n}-api-key`))}async getStoredModelConfigs(e){return await this.persistenceManager.read(qM,`${e}-models-config`)||{}}async getAllModels(e){let r=[];if(!AQ(await e.get(Qt).getToken()))return r;for(let n of Object.values(Ao)){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(qM,`${e}-models-config`,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(qM,`${e}-models-config`,n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(qM,`${e}-models-config`)}};p();p();p();p();function A6t(t,e){let r=FY(t,e);return r===-1?void 0:t[r]}a(A6t,"findLastMonotonous");function FY(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?TWe.isErrorNoTelemetry(e)?new TWe(e.message+` +${d}`:d||"",h=Yo(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await E8t.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 iTe=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}},nTe=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")}},gl={Ask:new nTe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new nTe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new nTe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function Shn(t){return t===gl.Agent||t.id===gl.Agent.id}a(Shn,"isBuiltInAgentMode");function mBo(t){return t===gl.InlineAgent||t.id===gl.InlineAgent.id}a(mBo,"isBuiltInInlineAgentMode");function Thn(t){return t===gl.Ask||t.id===gl.Ask.id||Shn(t)||mBo(t)}a(Thn,"isBuiltInChatMode");function oTe(t){return Shn(t)||!t.isBuiltIn&&t.customTools===void 0}a(oTe,"shouldApplyGlobalToolsSetting");var S_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[gl.Ask,gl.Agent,gl.InlineAgent],o=await this.ctx.get(Hp).listCustomAgents(e||[]);return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new iTe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return gl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??gl.Agent:gl.Agent;case"InlineAgent":return gl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Dc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var jVe=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 gBo=new Ee("conversationProgress"),eQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var _c=class{constructor(e){this.ctx=e;this.progressEntries=new yn(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);gBo.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 go={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"};function tQ(t){return t===go.Azure?1:0}a(tQ,"getAuthTypeForProvider");function yce(t){return t===go.OpenAI||t===go.Gemini||t===go.Groq||t===go.OpenRouter||t===go.Anthropic}a(yce,"isOpenAICompatible");async function RM(t,e,r){let o=await new vc(t.get(bi)).getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=c?.maxInputTokens||1e5,d=c?.maxOutputTokens||8192;return{modelId:r,uiName:l,modelFamily:Tn.BYOK,providerName:e,deploymentUrl:s?.deploymentUrl,maxRequestTokens:u,maxResponseTokens:d,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,originalBillingMultiplier:0}}a(RM,"resolveModelConfiguration");async function HVe(t,e,r){return await new vc(t.get(bi)).getAPIKey(e,r)}a(HVe,"resolveModelKey");function Ihn(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(Ihn,"resolveAzureUrl");function rQ(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(rQ,"isBYOKEnabled");var PM="byok",vc=class{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(PM,`${e}-${r}-api-key`);if(o)return o}return await this.persistenceManager.read(PM,`${e}-api-key`)}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(PM,`${e}-api-key`,r):n===1&&o&&await this.persistenceManager.update(PM,`${e}-${o}-api-key`,r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(PM,`${e}-api-key`):r===1&&n&&await this.persistenceManager.delete(PM,`${e}-${n}-api-key`))}async getStoredModelConfigs(e){return await this.persistenceManager.read(PM,`${e}-models-config`)||{}}async getAllModels(e){let r=[];if(!rQ(await e.get(Ut).getToken()))return r;for(let n of Object.values(go)){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(PM,`${e}-models-config`,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(PM,`${e}-models-config`,n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(PM,`${e}-models-config`)}};p();p();p();p();function b8t(t,e){let r=_Y(t,e);return r===-1?void 0:t[r]}a(b8t,"findLastMonotonous");function _Y(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?VVe.isErrorNoTelemetry(e)?new VVe(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)}},ZFo=new y6t;function qce(t){_6t(t)||ZFo.onUnexpectedError(t)}a(qce,"onUnexpectedError");var E6t="Canceled";function _6t(t){return t instanceof w_?!0:t instanceof Error&&t.name===E6t&&t.message===E6t}a(_6t,"isCancellationError");var w_=class extends Error{static{a(this,"CancellationError")}constructor(){super(E6t),this.name=this.message}};var TWe=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"}},Oc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function C6t(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(b6t,"shuffle");var emn;(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})(emn||={});function jce(t,e){return(r,n)=>e(t(r),t(n))}a(jce,"compareBy");var Hce=a((t,e)=>t-e,"numberComparator");var X0n=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||emn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function MTe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(MTe,"sumBy");p();function imn(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(imn,"groupBy");var rmn,nmn,tmn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[rmn]="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))}[(nmn=Symbol.iterator,rmn=Symbol.toStringTag,nmn)](){return this.values()}};p();function S6t(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(S6t,"createSingleCallFunction");p();var T6t;(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 k of T)x=w(x,k);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 I6t(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]}*[(smn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},amn,omn=class{constructor(e,r){this[amn]="ResourceSet";!e||typeof e=="function"?this._map=new IWe(e):(this._map=new IWe(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()}[(amn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var cmn,x6t=class{constructor(){this[cmn]="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}[(cmn=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)}},w6t=class extends x6t{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))}},xWe=class extends w6t{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 wWe=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 e8o=!1,Gce=null;var lmn=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 wWe;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(jce(u=>u.idx,Hce));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)}},ABo=new S8t;function Ece(t){I8t(t)||ABo.onUnexpectedError(t)}a(Ece,"onUnexpectedError");var T8t="Canceled";function I8t(t){return t instanceof T_?!0:t instanceof Error&&t.name===T8t&&t.message===T8t}a(I8t,"isCancellationError");var T_=class extends Error{static{a(this,"CancellationError")}constructor(){super(T8t),this.name=this.message}};var VVe=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"}},Nc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function x8t(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(R8t,"shuffle");var Rhn;(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})(Rhn||={});function _ce(t,e){return(r,n)=>e(t(r),t(n))}a(_ce,"compareBy");var vce=a((t,e)=>t-e,"numberComparator");var whn=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||Rhn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function sTe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(sTe,"sumBy");p();function Nhn(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(Nhn,"groupBy");var khn,Dhn,Phn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[khn]="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))}[(Dhn=Symbol.iterator,khn=Symbol.toStringTag,Dhn)](){return this.values()}};p();function P8t(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(P8t,"createSingleCallFunction");p();var k8t;(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 D8t(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]}*[(Ohn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},Bhn,Mhn=class{constructor(e,r){this[Bhn]="ResourceSet";!e||typeof e=="function"?this._map=new WVe(e):(this._map=new WVe(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()}[(Bhn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var Lhn,N8t=class{constructor(){this[Lhn]="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}[(Lhn=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)}},M8t=class extends N8t{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))}},zVe=class extends M8t{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 YVe=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 EBo=!1,Cce=null;var Fhn=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 YVe;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(_ce(u=>u.idx,vce));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=Nhn([...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} ==================== @@ -2357,7 +2313,7 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};function t8o(t){Gce=t}a(t8o,"setDisposableTracker");if(e8o){let t="__is_disposable_tracked__";t8o(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!==R_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==R_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function k6t(t){return Gce?.trackDisposable(t),t}a(k6t,"trackDisposable");function P6t(t){Gce?.markAsDisposed(t)}a(P6t,"markAsDisposed");function R6t(t,e){Gce?.setParent(t,e)}a(R6t,"setParentOfDisposable");function r8o(t,e){if(Gce)for(let r of t)Gce.setParent(r,e)}a(r8o,"setParentOfDisposables");function umn(t){if(T6t.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(umn,"dispose");function dmn(...t){let e=RWe(()=>umn(t));return r8o(t,e),e}a(dmn,"combinedDisposable");function RWe(t){let e=k6t({dispose:S6t(()=>{P6t(e),t()})});return e}a(RWe,"toDisposable");var yQ=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;k6t(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(P6t(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{umn(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 R6t(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),R6t(e,null))}},R_=class{constructor(){this._store=new yQ;k6t(this),R6t(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){P6t(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 $ce(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($ce,"formatResetDate");var EQ=class{static{a(this,"QuotaWarningNotifier")}};var UY=class{static{a(this,"QuotaChangeNotifier")}};var D6t=[50,75,90,95],Rd=class extends R_{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(Es(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(UY).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=D6t[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(D6t[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(EQ).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(EQ).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 ${$ce(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function kWe(t){let e=await t.get(Ur).resolveSession();if(e){let r=await QCe(t,e);if(r.ok){let n=await r.json();t.get(Rd).processUserInfoQuotaSnapshot(n)}}}a(kWe,"refreshUserQuota");p();p();var OTe=new ge("openAICompatibleLMProvider"),Vce={[Ao.OpenAI]:"https://api.openai.com/v1",[Ao.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[Ao.Groq]:"https://api.groq.com/openai/v1",[Ao.OpenRouter]:"https://openrouter.ai/api/v1",[Ao.Anthropic]:"https://api.anthropic.com/v1"},Rx=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 bc(this.ctx.get(Si)).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 OTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=Vce[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(ar).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*_Q(t,e){for await(let r of t)yield e(r)}a(_Q,"asyncIterableMap");async function*fmn(t,e){for await(let r of t)await e(r)&&(yield r)}a(fmn,"asyncIterableFilter");async function*BTe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(BTe,"asyncIterableMapFilter");async function*pmn(...t){for(let e of t)yield*e}a(pmn,"asyncIterableConcat");p();var PWe="interleaved-thinking-2025-05-14";p();var fP=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 Bc=class{static{a(this,"ModelConfigurationProvider")}},DWe=class extends Bc{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 Ye.error(this.ctx,`No model configuration found for families: ${r.join(", ")}. Available models: ${JSON.stringify(await this.ctx.get(dc).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(dc).getMetadata(),o=s8o(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===Tn.Gpt35turbo||r===Tn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:M6t(6144,s),maxLongContextTokens:void 0,maxResponseTokens:N6t(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===Tn.Gpt4||r===Tn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:M6t(10240,s),maxLongContextTokens:void 0,maxResponseTokens:N6t(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===Tn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await n8o(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:N6t(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:i8o(s),maxLongContextTokens:o8o(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 getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===ZHe.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function n8o(t,e){let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),M6t(o,e)}a(n8o,"getExpRequestTokens");function M6t(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(M6t,"getRequestTokens");function i8o(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(i8o,"getMaxRequestTokens");function o8o(t){return t.billing?.token_prices?.long_context?.context_max}a(o8o,"getMaxLongContextTokens");function N6t(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(N6t,"getResponseTokens");function s8o(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(s8o,"filterModelsByCapabilities");function CQ(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(CQ,"pickReasoningEffort");function a8o(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(a8o,"shouldUseResponsesApi");function c8o(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(c8o,"shouldUseMessagesApi");var hmn=["completions","responses","v1/messages"];function NWe(t,e){return e?"v1/messages":t&&a8o(t)?"responses":"completions"}a(NWe,"resolveEndpointRoute");function MWe(t,e){if(!c8o(e))return!1;let r=qt(t,je.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(MWe,"willUseMessagesEndpoint");p();function OWe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(OWe,"isCodexStyleGptModel");function mmn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(mmn,"isGpt5PlusFamily");function gmn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(gmn,"isAnthropicModel");p();p();function Amn(t,e){!e||!e.providerName||(e.providerName===Ao.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&delete t.max_tokens)}a(Amn,"adaptRequestForBYOKProvider");p();p();var IS=class{static{a(this,"RateLimitNotifier")}},BWe=class extends IS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var O6t=[50,75,90,95],jM=class extends R_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(Es(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(IS).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=O6t[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(O6t[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=$ce(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();p();p();var vQ="copilot-edits-session";p();p();p();p();Ns();function LWe(t,e,r,n,o,s,c){return dWr(t,e,r,o,n,c),{completionText:e,meanLogProb:l8o(t,r),meanAlternativeLogProb:u8o(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:gr(),finishReason:r.finish_reason}}a(LWe,"convertToAPIChoice");function l8o(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){Dr.exception(t,r,"Error calculating mean prob")}}a(l8o,"calculateMeanLogProb");function u8o(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){Dr.exception(t,r,"Error calculating mean prob")}}a(u8o,"calculateMeanAlternativeLogProb");function Wce(t,e){return v1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Wce,"getTemperatureForSamples");var d8o={markdown:[` +`),{leaks:n,details:c}}};function _Bo(t){Cce=t}a(_Bo,"setDisposableTracker");if(EBo){let t="__is_disposable_tracked__";_Bo(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!==I_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==I_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function B8t(t){return Cce?.trackDisposable(t),t}a(B8t,"trackDisposable");function L8t(t){Cce?.markAsDisposed(t)}a(L8t,"markAsDisposed");function O8t(t,e){Cce?.setParent(t,e)}a(O8t,"setParentOfDisposable");function vBo(t,e){if(Cce)for(let r of t)Cce.setParent(r,e)}a(vBo,"setParentOfDisposables");function Uhn(t){if(k8t.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(Uhn,"dispose");function Qhn(...t){let e=KVe(()=>Uhn(t));return vBo(t,e),e}a(Qhn,"combinedDisposable");function KVe(t){let e=B8t({dispose:P8t(()=>{L8t(e),t()})});return e}a(KVe,"toDisposable");var nQ=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;B8t(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(L8t(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Uhn(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 O8t(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),O8t(e,null))}},I_=class{constructor(){this._store=new nQ;B8t(this),O8t(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){L8t(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 bce(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(bce,"formatResetDate");var iQ=class{static{a(this,"QuotaWarningNotifier")}};var vY=class{static{a(this,"QuotaChangeNotifier")}};var F8t=[50,75,90,95],lu=class extends I_{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(ys(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(vY).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=F8t[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(F8t[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(iQ).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(iQ).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 ${bce(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function JVe(t){let e=await t.get(Fr).resolveSession();if(e){let r=await Ave(t,e);if(r.ok){let n=await r.json();t.get(lu).processUserInfoQuotaSnapshot(n)}}}a(JVe,"refreshUserQuota");p();p();var aTe=new Ee("openAICompatibleLMProvider"),Sce={[go.OpenAI]:"https://api.openai.com/v1",[go.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[go.Groq]:"https://api.groq.com/openai/v1",[go.OpenRouter]:"https://openrouter.ai/api/v1",[go.Anthropic]:"https://api.anthropic.com/v1"},Sx=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 vc(this.ctx.get(bi)).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 aTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=Sce[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(fr).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*cTe(t,e){for await(let r of t)yield e(r)}a(cTe,"asyncIterableMap");async function*qhn(t,e){for await(let r of t)await e(r)&&(yield r)}a(qhn,"asyncIterableFilter");async function*lTe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(lTe,"asyncIterableMapFilter");p();var ZVe="interleaved-thinking-2025-05-14";p();var ok=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 zc=class{static{a(this,"ModelConfigurationProvider")}},XVe=class extends zc{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(lc).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(lc).getMetadata(),o=TBo(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===Tn.Gpt35turbo||r===Tn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:Q8t(6144,s),maxLongContextTokens:void 0,maxResponseTokens:U8t(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===Tn.Gpt4||r===Tn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:Q8t(10240,s),maxLongContextTokens:void 0,maxResponseTokens:U8t(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===Tn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await CBo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:U8t(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:bBo(s),maxLongContextTokens:SBo(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 getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===dsn.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function CBo(t,e){let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),Q8t(o,e)}a(CBo,"getExpRequestTokens");function Q8t(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(Q8t,"getRequestTokens");function bBo(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(bBo,"getMaxRequestTokens");function SBo(t){return t.billing?.token_prices?.long_context?.context_max}a(SBo,"getMaxLongContextTokens");function U8t(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(U8t,"getResponseTokens");function TBo(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(TBo,"filterModelsByCapabilities");function oQ(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(oQ,"pickReasoningEffort");function IBo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(IBo,"shouldUseResponsesApi");function xBo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(xBo,"shouldUseMessagesApi");var jhn=["completions","responses","v1/messages"];function eWe(t,e){return e?"v1/messages":t&&IBo(t)?"responses":"completions"}a(eWe,"resolveEndpointRoute");function tWe(t,e){if(!xBo(e))return!1;let r=Gt(t,Je.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(tWe,"willUseMessagesEndpoint");p();function rWe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(rWe,"isCodexStyleGptModel");function Hhn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(Hhn,"isGpt5PlusFamily");function Ghn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(Ghn,"isAnthropicModel");p();p();function $hn(t,e){!e||!e.providerName||(e.providerName===go.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&delete t.max_tokens)}a($hn,"adaptRequestForBYOKProvider");p();p();var ES=class{static{a(this,"RateLimitNotifier")}},nWe=class extends ES{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var q8t=[50,75,90,95],kM=class extends I_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(ys(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(ES).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=q8t[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(q8t[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=bce(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 Km="https://aka.ms/github-copilot-rate-limit-error";function wBo(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(wBo,"secondsToHumanReadableTime");var x_=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":wBo(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](${Km})`;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](${Km})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${Km})`;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](${Km})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${Km})`;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](${Km})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${Km})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${Km})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${Km})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${Km})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${Km})`}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](${Km})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${Km})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${Km})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${Km})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${Km})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${Km})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${Km})`}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("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.":"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 sQ="copilot-edits-session";p();p();p();p();As();function iWe(t,e,r,n,o,s,c){return aVr(t,e,r,o,n,c),{completionText:e,meanLogProb:RBo(t,r),meanAlternativeLogProb:PBo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:ir(),finishReason:r.finish_reason}}a(iWe,"convertToAPIChoice");function RBo(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){Dr.exception(t,r,"Error calculating mean prob")}}a(RBo,"calculateMeanLogProb");function PBo(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){Dr.exception(t,r,"Error calculating mean prob")}}a(PBo,"calculateMeanAlternativeLogProb");function Tce(t,e){return h1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Tce,"getTemperatureForSamples");var kBo={markdown:[` `],python:[` @@ -2365,23 +2321,23 @@ def `,` class `,` if `,` -#`]};function ymn(t,e){return d8o[e??""]??[` +#`]};function Vhn(t,e){return kBo[e??""]??[` -`,"\n```"]}a(ymn,"getStops");function zce(t){return 1}a(zce,"getTopP");function FWe(t){return RSe}a(FWe,"getMaxSolutionTokens");p();p();var f8o=1.15,p8o=1.17,h8o=2;function m8o(t){if(!t)return!1;let e=t.toLowerCase();return e.includes("opus")||e.includes("sonnet-4.6")}a(m8o,"isHighMultiplierModel");function g8o(t){return t.text?Array.isArray(t.text)?t.text.join(""):t.text:""}a(g8o,"getThinkingText");function Yce(t,e){let r=g8o(t);if(r.length>0){let n=Ss(),o=m8o(e)?p8o:f8o;return Math.ceil(n.tokenLength(r)*h8o*o)}return 0}a(Yce,"estimateThinkingTokens");function B6t(t){let e=t.delta;if(!e)return;let r=y8o(e),n=A8o(e);if(r||n)return{id:r,text:n}}a(B6t,"extractThinkingDeltaFromChoice");function A8o(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(A8o,"getThinkingDeltaText");function y8o(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(y8o,"getThinkingDeltaId");p();function Vu(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(Vu,"toString");var xS=new ge("streamChoices"),L6t=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new q6t;this.tool_calls=new U6t;this.function_call=new Q6t;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=B6t(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 E8o(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!=""),r]}a(E8o,"splitChunk");var F6t=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)}},U6t=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 F6t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},Q6t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},q6t=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]??[]}},QY=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=XL(this.response);this.stats=new j6t;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(),xS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),xS.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();xS.debug(this.ctx,"chunk",u);let[d,f]=E8o(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{xS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&_8o(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?xS.error(this.ctx,"Error in response:",g.error.message):xS.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=Ds(),o=OBo(e)?NBo:DBo;return Math.ceil(n.tokenLength(r)*MBo*o)}return 0}a(xce,"estimateThinkingTokens");function j8t(t){let e=t.delta;if(!e)return;let r=FBo(e),n=LBo(e);if(r||n)return{id:r,text:n}}a(j8t,"extractThinkingDeltaFromChoice");function LBo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(LBo,"getThinkingDeltaText");function FBo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(FBo,"getThinkingDeltaId");p();function Vu(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(Vu,"toString");var _S=new Ee("streamChoices"),H8t=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new W8t;this.tool_calls=new $8t;this.function_call=new V8t;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=j8t(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 UBo(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!=""),r]}a(UBo,"splitChunk");var G8t=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)}},$8t=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 G8t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},V8t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},W8t=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]??[]}},CY=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=QL(this.response);this.stats=new z8t;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(),_S.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),_S.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();_S.debug(this.ctx,"chunk",u);let[d,f]=UBo(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{_S.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&QBo(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?_S.error(this.ctx,"Error in response:",g.error.message):_S.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?B6t(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(()=>FTe(_,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(ht(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:w7(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&&(ht(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&&xS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{xS.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(()=>FTe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),ht(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?(xS.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 G6t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(xS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),xS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),xS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=FTe(e.solution,t);return LWe(t,n,s,e.index,e.requestId,o,r)}a(G6t,"prepareSolutionForReturn");function FTe(t,e){let r=t.text.join(""),n=C8o(t,e),o=v8o(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(FTe,"convertToAPIJsonData");function _8o(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(_8o,"isCopilotConfirmation");function Emn(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}': ${Vu(s)}. Input: '${t}'.${c}`);throw o&>(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(Emn,"parseCallArguments");function C8o(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=Emn(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(C8o,"extractToolCalls");function v8o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=Emn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(v8o,"extractFunctionCall");var j6t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new H6t,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(", ")}},H6t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function UWe(t,e){return t!==null&&typeof t=="object"&&e in t}a(UWe,"hasKey");function Fh(t,e){return UWe(t,e)?t[e]:void 0}a(Fh,"getKey");var Cmn=ce(ti());var Vf=new ge("fetchCompletions");function XL(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(XL,"getRequestId");function e3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(e3,"getProcessingTime");function vmn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(vmn,"uiKindToIntent");var HM=class{static{a(this,"OpenAIFetcher")}};function b8o(t,e,r,n){return LI(t,e,"proxy","v1/engines",r,n)}a(b8o,"getProxyEngineUrl");function QWe(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(QWe,"sanitizeRequestOptionTelemetry");async function S8o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(as),m=b8o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},hoe(e));QWe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,ht(t,"request.sent",g);let A=pl(),y=vmn(l);return P7(t,m,c.token,y,o,s,d,f).then(E=>{let _=XL(E);g.extendWithRequestId(_);let v=pl()-A;return g.measurements.totalTimeMs=v,Vf.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),Vf.debug(t,"request.response properties",g.properties),Vf.debug(t,"request.response measurements",g.measurements),Vf.debug(t,"prompt:",e),ht(t,"request.response",g),E}).catch(E=>{if(P0(E))throw ht(t,"request.cancel",g),E;h.setWarning("cls",{message:Fh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});ht(t,"request.shownWarning",_),g.properties.message=String(Fh(E,"name")??""),g.properties.code=String(Fh(E,"code")??""),g.properties.errno=String(Fh(E,"errno")??""),g.properties.type=String(Fh(E,"type")??"");let v=pl()-A;throw g.measurements.totalTimeMs=v,Vf.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),Vf.debug(t,"request.error properties",g.properties),Vf.debug(t,"request.error measurements",g.measurements),ht(t,"request.error",g),E}).finally(()=>{fWr(t,e,g)})}a(S8o,"fetchWithInstrumentation");async function T8o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});QWe(s,f,["messages"]),f.properties.headerRequestId=o,ht(t,"request.sent",f);let h=pl(),m=vmn(l),g=Gm(t);NN()&&(g=await CSe(t,g));try{let A=await P7(t,n,c.token,m,o,s,d,g),y=XL(A);f.extendWithRequestId(y);let E=pl()-h;return f.measurements.totalTimeMs=E,Vf.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),Vf.debug(t,"request.response properties",f.properties),Vf.debug(t,"request.response measurements",f.measurements),Vf.debug(t,"messages:",JSON.stringify(e)),ht(t,"request.response",f),A}catch(A){if(P0(A))throw ht(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});ht(t,"request.shownWarning",y),f.properties.message=String(Fh(A,"name")??""),f.properties.code=String(Fh(A,"code")??""),f.properties.errno=String(Fh(A,"errno")??""),f.properties.type=String(Fh(A,"type")??"");let E=pl()-h;throw f.measurements.totalTimeMs=E,Vf.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),Vf.debug(t,"request.error properties",f.properties),Vf.debug(t,"request.error measurements",f.measurements),ht(t,"request.error",f),A}finally{Kce(t,e,f)}}a(T8o,"fetchChatWithInstrumentation");function _mn(t){return fmn(t,e=>e.completionText.trim().length>0)}a(_mn,"postProcessChoices");var I8o="github.copilot.completions.quotaExceeded",LTe=class extends HM{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(as),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){Vf.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=QY.create(e,r.count,d,n,[],s).processSSE(o),m=_Q(h,g=>G6t(e,g,n));return{type:"success",choices:_mn(m),getProcessingTime:a(()=>e3(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(as),A=await e.get(Qt).getToken(),y=await T8o(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){Vf.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=jt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=QY.create(e,1,y,m,[],Cmn.CancellationToken.None).processSSE(),v=_Q(_,b=>G6t(e,b,n));return{type:"success",choices:_mn(v),getProcessingTime:a(()=>e3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return jt.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:FWe(e),temperature:Wce(e,n.count),top_p:zce(e),n:n.count,stop:ymn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=qL(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 rx(0),c?.isCancellationRequested?"not-sent":await S8o(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:I8o,title:"Learn More"});let l=Es(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}),Vf.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`;Vf.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?(Vf.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),ht(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=yoe(o);gt(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.`,Vf.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(Vf.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Vf.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Ns();async function UTe(t,e,r,n){let o=jt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(UTe,"createTelemetryWithExpWithId");function Jc(t,{turn:e,conversation:r}={},n){return UTe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(Jc,"createTelemetryWithExpWithTurn");function QTe(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(x8o(l))),c=c.extendedBy(d,f),c}a(QTe,"extendUserMessageTelemetryData");function x8o(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(x8o,"mapSkillResolutionsForTelemetry");function bmn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),qWe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(bmn,"createUserMessageTelemetryData");function Smn(t,e,r,n,o,s,c){let l=R8o(r);return qWe(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(Smn,"createModelMessageTelemetryData");function Tmn(t,e,r,n,o,s,c){qWe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Tmn,"createOffTopicMessageTelemetryData");function Imn(t,e,r,n,o,s,c,l,u){let d=qWe(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 w8o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Imn,"createSuggestionMessageTelemetryData");async function xmn(t,e,r){let n=await Jc(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";wS(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(xmn,"telemetryIndexCodesearch");function qWe(t,e,r,n,o,s,c){let l=c??jt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=gr();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=Hy(r);return ht(t,`${h}.message`,d),ht(t,`${h}.messageText`,f,1),d}a(qWe,"telemetryMessage");function wmn(t,e,r,n){wS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(wmn,"createSuggestionShownTelemetryData");function w8o(t,e,r,n,o,s,c,l){wS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(w8o,"createSuggestionSelectedTelemetryData");function wS(t,e,r,n,o,s){let c=s??jt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return ht(t,o,l),l}a(wS,"telemetryUserAction");function Kce(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return ht(t,"engine.messages",n,1)}a(Kce,"logEngineMessages");function Hy(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(Hy,"telemetryPrefixForUiKind");function R8o(t){let e=t.split(` -`),r=[],n;for(let o=0;o-1,T=E?j8t(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(()=>dTe(_,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(yt(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:m7(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&&(yt(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&&_S.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{_S.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(()=>dTe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),yt(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?(_S.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 K8t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(_S.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),_S.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),_S.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=dTe(e.solution,t);return iWe(t,n,s,e.index,e.requestId,o,r)}a(K8t,"prepareSolutionForReturn");function dTe(t,e){let r=t.text.join(""),n=qBo(t,e),o=jBo(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(dTe,"convertToAPIJsonData");function QBo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(QBo,"isCopilotConfirmation");function Whn(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}': ${Vu(s)}. Input: '${t}'.${c}`);throw o&&_t(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(Whn,"parseCallArguments");function qBo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=Whn(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(qBo,"extractToolCalls");function jBo(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=Whn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(jBo,"extractFunctionCall");var z8t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new Y8t,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(", ")}},Y8t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function sWe(t,e){return t!==null&&typeof t=="object"&&e in t}a(sWe,"hasKey");function Fh(t,e){return sWe(t,e)?t[e]:void 0}a(Fh,"getKey");var Yhn=he(ti());var Wf=new Ee("fetchCompletions");function QL(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(QL,"getRequestId");function qL(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(qL,"getProcessingTime");function Khn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(Khn,"uiKindToIntent");var DM=class{static{a(this,"OpenAIFetcher")}};function HBo(t,e,r,n){return kI(t,e,"proxy","v1/engines",r,n)}a(HBo,"getProxyEngineUrl");function aWe(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(aWe,"sanitizeRequestOptionTelemetry");async function GBo(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(os),m=HBo(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},Jie(e));aWe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,yt(t,"request.sent",g);let A=dl(),y=Khn(l);return Oz(t,m,c.token,y,o,s,d,f).then(E=>{let _=QL(E);g.extendWithRequestId(_);let v=dl()-A;return g.measurements.totalTimeMs=v,Wf.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),Wf.debug(t,"request.response properties",g.properties),Wf.debug(t,"request.response measurements",g.measurements),Wf.debug(t,"prompt:",e),yt(t,"request.response",g),E}).catch(E=>{if(k0(E))throw yt(t,"request.cancel",g),E;h.setWarning("cls",{message:Fh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});yt(t,"request.shownWarning",_),g.properties.message=String(Fh(E,"name")??""),g.properties.code=String(Fh(E,"code")??""),g.properties.errno=String(Fh(E,"errno")??""),g.properties.type=String(Fh(E,"type")??"");let v=dl()-A;throw g.measurements.totalTimeMs=v,Wf.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),Wf.debug(t,"request.error properties",g.properties),Wf.debug(t,"request.error measurements",g.measurements),yt(t,"request.error",g),E}).finally(()=>{cVr(t,e,g)})}a(GBo,"fetchWithInstrumentation");async function $Bo(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});aWe(s,f,["messages"]),f.properties.headerRequestId=o,yt(t,"request.sent",f);let h=dl(),m=Khn(l),g=uA(t);PB()&&(g=await yHe(t,g));try{let A=await Oz(t,n,c.token,m,o,s,d,g),y=QL(A);f.extendWithRequestId(y);let E=dl()-h;return f.measurements.totalTimeMs=E,Wf.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),Wf.debug(t,"request.response properties",f.properties),Wf.debug(t,"request.response measurements",f.measurements),Wf.debug(t,"messages:",JSON.stringify(e)),yt(t,"request.response",f),A}catch(A){if(k0(A))throw yt(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});yt(t,"request.shownWarning",y),f.properties.message=String(Fh(A,"name")??""),f.properties.code=String(Fh(A,"code")??""),f.properties.errno=String(Fh(A,"errno")??""),f.properties.type=String(Fh(A,"type")??"");let E=dl()-h;throw f.measurements.totalTimeMs=E,Wf.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),Wf.debug(t,"request.error properties",f.properties),Wf.debug(t,"request.error measurements",f.measurements),yt(t,"request.error",f),A}finally{wce(t,e,f)}}a($Bo,"fetchChatWithInstrumentation");function zhn(t){return qhn(t,e=>e.completionText.trim().length>0)}a(zhn,"postProcessChoices");var VBo="github.copilot.completions.quotaExceeded",uTe=class extends DM{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(os),l="completions",u=await e.get(Ut).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){Wf.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=CY.create(e,r.count,d,n,[],s).processSSE(o),m=cTe(h,g=>K8t(e,g,n));return{type:"success",choices:zhn(m),getProcessingTime:a(()=>qL(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(os),A=await e.get(Ut).getToken(),y=await $Bo(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){Wf.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 _=CY.create(e,1,y,m,[],Yhn.CancellationToken.None).processSSE(),v=cTe(_,b=>K8t(e,b,n));return{type:"success",choices:zhn(v),getProcessingTime:a(()=>qL(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:oWe(e),temperature:Tce(e,n.count),top_p:Ice(e),n:n.count,stop:Vhn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=Nz(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 KI(0),c?.isCancellationRequested?"not-sent":await GBo(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:VBo,title:"Learn More"});let l=ys(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}),Wf.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`;Wf.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?(Wf.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),yt(e,"request.shownWarning",n),o.status===401||o.status===403)return e.get(Ut).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=F9(o);_t(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.`,Wf.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(Wf.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Wf.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};As();async function fTe(t,e,r,n){let o=Vt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(fTe,"createTelemetryWithExpWithId");function Yc(t,{turn:e,conversation:r}={},n){return fTe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(Yc,"createTelemetryWithExpWithTurn");function pTe(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(WBo(l))),c=c.extendedBy(d,f),c}a(pTe,"extendUserMessageTelemetryData");function WBo(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(WBo,"mapSkillResolutionsForTelemetry");function Jhn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),cWe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(Jhn,"createUserMessageTelemetryData");function Zhn(t,e,r,n,o,s,c){let l=YBo(r);return cWe(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(Zhn,"createModelMessageTelemetryData");function Xhn(t,e,r,n,o,s,c){cWe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Xhn,"createOffTopicMessageTelemetryData");function e0n(t,e,r,n,o,s,c,l,u){let d=cWe(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 zBo(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(e0n,"createSuggestionMessageTelemetryData");async function t0n(t,e,r){let n=await Yc(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";vS(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(t0n,"telemetryIndexCodesearch");function cWe(t,e,r,n,o,s,c){let l=c??Vt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=ir();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=Gy(r);return yt(t,`${h}.message`,d),yt(t,`${h}.messageText`,f,1),d}a(cWe,"telemetryMessage");function r0n(t,e,r,n){vS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(r0n,"createSuggestionShownTelemetryData");function zBo(t,e,r,n,o,s,c,l){vS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(zBo,"createSuggestionSelectedTelemetryData");function vS(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 yt(t,o,l),l}a(vS,"telemetryUserAction");function wce(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return yt(t,"engine.messages",n,1)}a(wce,"logEngineMessages");function Gy(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(Gy,"telemetryPrefixForUiKind");function YBo(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))(tc||{});function In(t){return t?(t=RS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(In,"getTextPart");function Nmn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Nmn,"hasImageContent");function SQ(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Jce(n))return n.some(o=>o.type==="image_url");if(qY(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(SQ,"hasImageContentInTurns");var Mmn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Omn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function r3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(r3,"parseToolCallArguments");function Bmn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Bmn,"toOpenAIToolCall");function Lmn(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),Kce(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Yce(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(Lmn,"convertToChatCompletion");function Jce(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Jce,"isChatCompletionContentPartArray");function qY(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(qY,"isChatMessageArray");function RS(t){if(typeof t=="string")return t;if(Jce(t))return t;if(qY(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(RS,"resolveAsChatMessageContent");function TQ(t,e){return(typeof t=="string"||Jce(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(TQ,"appendChatMessageContent");function GM(t,e){if(t){if(typeof t=="string"||Jce(t))return[{role:"assistant",content:t}];if(qY(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(GM,"resolveResponseAsChatMessages");p();var V6t=new ge("streamMessages");function Fmn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(V6t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),V6t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),V6t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=FTe(e.solution,t),u={role:"assistant",content:s};return Lmn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(Fmn,"prepareChatCompletionForReturn");Ns();var jWe=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:Wce(e,r.count),top_p:zce(e),n:r.count,stop:[` +`);return r+n}a(ZBo,"truncateContentIfNeeded");var XBo=["requestSource","chatRequestModel","mapper","headerRequestId","mode","modelId","languageId","messageId","conversationId","uiKind"];function s0n(t,e,r,n,o,s,c){let l=`${Gy(e)}.${c}`,u=s.extendedBy(r,n);yt(t,l,u);let d={...r,uiKind:e||""};_t(t,c,m9(d,XBo),n);let f={...r};o.currentFileContent!==void 0&&(f.completionTextJson=ZBo(o.currentFileContent));let h=s.extendedBy(f,n);yt(t,`${l}.restricted`,h,1)}a(s0n,"telemetryEditSurvivalTracking");var Xa=(s=>(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(Xa||{});function Rn(t){return t?(t=CS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Rn,"getTextPart");function a0n(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(a0n,"hasImageContent");function cQ(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Rce(n))return n.some(o=>o.type==="image_url");if(bY(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(cQ,"hasImageContentInTurns");var c0n=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),l0n=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function HL(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(HL,"parseToolCallArguments");function u0n(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(u0n,"toOpenAIToolCall");function d0n(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),wce(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=xce(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(d0n,"convertToChatCompletion");function Rce(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Rce,"isChatCompletionContentPartArray");function bY(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(bY,"isChatMessageArray");function CS(t){if(typeof t=="string")return t;if(Rce(t))return t;if(bY(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(CS,"resolveAsChatMessageContent");function lQ(t,e){return(typeof t=="string"||Rce(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(lQ,"appendChatMessageContent");function NM(t,e){if(t){if(typeof t=="string"||Rce(t))return[{role:"assistant",content:t}];if(bY(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(NM,"resolveResponseAsChatMessages");p();var Z8t=new Ee("streamMessages");function f0n(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(Z8t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),Z8t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),Z8t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=dTe(e.solution,t),u={role:"assistant",content:s};return d0n(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(f0n,"prepareChatCompletionForReturn");As();var lWe=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:Tce(e,r.count),top_p:Ice(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=qL(r.repoInfo);return s!==void 0&&(o.nwo=s),r.postOptions&&Object.assign(o,r.postOptions),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(vQ)||void 0;return s.postOptions?.stream===!1?{type:"success",chatCompletions:this.processNonStreamingResponse(r,n,o,c),getProcessingTime:a(()=>e3(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")??gr(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:In(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=In(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=QY.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:_Q(u,f=>Fmn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>e3(r),"getProcessingTime")}}};p();p();p();var Gy=ce(wo());var tAn="ephemeral",F9t=4,O6o=2;function rAn(t){let e=F9t-O6o-B6o(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===Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===Gy.Raw.ChatRole.Tool&&c?.role!==Gy.Raw.ChatRole.Tool,d=s.role===Gy.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===Gy.Raw.ChatRole.User)||d)&&(s.content.push({type:Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:tAn}),e--,e<=0))break;s.role===Gy.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===Gy.Raw.ChatRole.User||o.role===Gy.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:tAn})),o.role!==Gy.Raw.ChatRole.User&&o.role!==Gy.Raw.ChatRole.System)break}}a(rAn,"addCacheBreakpoints");function B6o(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(B6o,"countCacheBreakpoints");function nAn(t){for(let e of t)e.content=e.content.filter(r=>r.type!==Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(nAn,"removeCacheBreakpoints");var oAn=new ge("messagesApi"),L6o="Please continue.";function sAn(t){let e=Q6o(t.tools),r=F6o(t.messages,t.ctx);q6o(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:L6o}]});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(sAn,"buildMessagesApiRequest");function F6o(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=Eze(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=Eze(s.content);s.copilot_cache_control&&iAn(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=Eze(s.content);if(s.thinking&&U6o(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{oAn.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&&iAn(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=Eze(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(F6o,"convertToAnthropicMessages");function Eze(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(Eze,"convertContentToAnthropicBlocks");function U6o(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&&oAn.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(U6o,"addThinkingBlocks");function iAn(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(iAn,"applyCacheControlToLastBlock");function Q6o(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(Q6o,"convertToAnthropicTools");function q6o(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=F9t-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(q6o,"addToolsAndSystemCacheControl");p();p();var rle=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;rqL(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")??ir(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Rn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Rn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=CY.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:cTe(u,f=>f0n(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>qL(r),"getProcessingTime")}}};p();p();p();var $y=he(Io());var Rmn="ephemeral",G6t=4,t3o=2;function Pmn(t){let e=G6t-t3o-r3o(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===$y.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===$y.Raw.ChatRole.Tool&&c?.role!==$y.Raw.ChatRole.Tool,d=s.role===$y.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===$y.Raw.ChatRole.User)||d)&&(s.content.push({type:$y.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:Rmn}),e--,e<=0))break;s.role===$y.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===$y.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===$y.Raw.ChatRole.User||o.role===$y.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:$y.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:Rmn})),o.role!==$y.Raw.ChatRole.User&&o.role!==$y.Raw.ChatRole.System)break}}a(Pmn,"addCacheBreakpoints");function r3o(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===$y.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(r3o,"countCacheBreakpoints");function kmn(t){for(let e of t)e.content=e.content.filter(r=>r.type!==$y.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(kmn,"removeCacheBreakpoints");var Nmn=new Ee("messagesApi"),n3o="Please continue.";function Mmn(t){let e=s3o(t.tools),r=i3o(t.messages,t.ctx);a3o(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:n3o}]});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(Mmn,"buildMessagesApiRequest");function i3o(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=QWe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=QWe(s.content);s.copilot_cache_control&&Dmn(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=QWe(s.content);if(s.thinking&&o3o(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{Nmn.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&&Dmn(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=QWe(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(i3o,"convertToAnthropicMessages");function QWe(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(QWe,"convertContentToAnthropicBlocks");function o3o(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&&Nmn.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(o3o,"addThinkingBlocks");function Dmn(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(Dmn,"applyCacheControlToLastBlock");function s3o(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(s3o,"convertToAnthropicTools");function a3o(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=G6t-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(a3o,"addToolsAndSystemCacheControl");p();p();var Mce=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(_){eIe.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){eIe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(aAn,"processMessagesApiStream");var U9t=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}}):eIe.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 eIe.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&&eIe.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=Yce(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 _ze=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 sAn({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(vQ)||void 0;return{type:"success",chatCompletions:aAn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>e3(r),"getProcessingTime")}}};p();p();p();p();var uAn=ce(wo());var sr=class extends uAn.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?cAn(r):void 0,s=n?lAn(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?cAn(n):void 0,c=o?lAn(o):void 0;return this.renderCopilot(e,r,s,c)}};function cAn(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(cAn,"adaptProgressCallbackFromVSCode");function lAn(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(lAn,"adaptCancellationTokenFromVSCode");var dAn="phase_data",Cze=class extends sr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:dAn,phase:e}})}};function vze(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===dAn&&typeof r.phase=="string")return r.phase}a(vze,"rawPartAsPhaseData");p();var fAn="thinking",nle=class extends sr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:fAn,thinking:e},tokenUsage:e.tokens??0})}};function bze(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===fAn&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(bze,"rawPartAsThinkingData");var DS=ce(wo());function j6o(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=pAn(r);e.push({role:"system",content:n});break}case"user":{let n=pAn(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=G6o(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(j6o,"convertToResponsesApiInput");function H6o(t){let e=[];for(let r of t)switch(r.role){case DS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=$6o(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===DS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=V6o(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 DS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===DS.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===DS.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 DS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===DS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===DS.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 DS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===DS.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(H6o,"convertRawMessagesToResponsesApiInput");function pAn(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(pAn,"convertMessageContentToInputParts");function G6o(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(G6o,"convertMessageContentToOutputParts");function $6o(t){let e=[];for(let r of t)if(r.type===DS.Raw.ChatCompletionContentPartKind.Opaque){let n=bze(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a($6o,"extractReasoningFromRawMessage");function V6o(t){for(let e of t)if(e.type===DS.Raw.ChatCompletionContentPartKind.Opaque){let r=vze(e);if(r)return r}}a(V6o,"extractPhaseFromRawMessage");function hAn(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=H6o(r).input:u=j6o(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(hAn,"buildResponsesApiRequest");p();var Q9t=new ge("responsesApiStream"),W6o=10,Sze=500,JY=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function mAn(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Vu(n)}. Input: '${t}'`)}}a(mAn,"parseCallArguments");async function*gAn(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 q9t(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new rle(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=W6o)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>Sze?T.substring(0,Sze):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>Sze&&(_=_.substring(0,Sze)+"\u2026"),Q9t.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new JY(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new JY(`The server returned an error: ${_}`)}else if(E)throw Q9t.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new JY("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){Q9t.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(gAn,"processResponsesApiStream");var q9t=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 xTe=new Ee("messagesApiStream");async function*Omn(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 $6t(t,n,u,d,o,c),h=[],m;try{let g=new Mce(A=>{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){xTe.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){xTe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(Omn,"processMessagesApiStream");var $6t=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}}):xTe.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 xTe.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&&xTe.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=xce(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 qWe=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 Mmn({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(sQ)||void 0;return{type:"success",chatCompletions:Omn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>qL(r),"getProcessingTime")}}};p();p();p();p();var Fmn=he(Io());var ar=class extends Fmn.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?Bmn(r):void 0,s=n?Lmn(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?Bmn(n):void 0,c=o?Lmn(o):void 0;return this.renderCopilot(e,r,s,c)}};function Bmn(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(Bmn,"adaptProgressCallbackFromVSCode");function Lmn(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(Lmn,"adaptCancellationTokenFromVSCode");var Umn="phase_data",jWe=class extends ar{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:Umn,phase:e}})}};function HWe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Umn&&typeof r.phase=="string")return r.phase}a(HWe,"rawPartAsPhaseData");p();var Qmn="thinking",Oce=class extends ar{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:Qmn,thinking:e},tokenUsage:e.tokens??0})}};function GWe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Qmn&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(GWe,"rawPartAsThinkingData");var TS=he(Io());function c3o(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=qmn(r);e.push({role:"system",content:n});break}case"user":{let n=qmn(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=u3o(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(c3o,"convertToResponsesApiInput");function l3o(t){let e=[];for(let r of t)switch(r.role){case TS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=d3o(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===TS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=f3o(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 TS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===TS.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===TS.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 TS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===TS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===TS.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 TS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===TS.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(l3o,"convertRawMessagesToResponsesApiInput");function qmn(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(qmn,"convertMessageContentToInputParts");function u3o(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(u3o,"convertMessageContentToOutputParts");function d3o(t){let e=[];for(let r of t)if(r.type===TS.Raw.ChatCompletionContentPartKind.Opaque){let n=GWe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(d3o,"extractReasoningFromRawMessage");function f3o(t){for(let e of t)if(e.type===TS.Raw.ChatCompletionContentPartKind.Opaque){let r=HWe(e);if(r)return r}}a(f3o,"extractPhaseFromRawMessage");function jmn(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=l3o(r).input:u=c3o(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(jmn,"buildResponsesApiRequest");p();var V6t=new Ee("responsesApiStream"),p3o=10,$We=500,NY=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function Hmn(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Vu(n)}. Input: '${t}'`)}}a(Hmn,"parseCallArguments");async function*Gmn(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 W6t(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new Mce(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=p3o)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>$We?T.substring(0,$We):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>$We&&(_=_.substring(0,$We)+"\u2026"),V6t.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new NY(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new NY(`The server returned an error: ${_}`)}else if(E)throw V6t.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new NY("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){V6t.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(Gmn,"processResponsesApiStream");var W6t=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=mAn(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=mAn(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=Yce(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 Tze=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return hAn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??zce(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:CQ(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(vQ)||void 0;return{type:"success",chatCompletions:gAn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>e3(r),"getProcessingTime")}}};fP.register(new Tze);fP.register(new jWe);fP.register(new _ze);p();var Ize=require("fs"),NS=ce(require("path"));function Rze(t){return zse(()=>!!qt(t,je.PromptPersistBasePath)?.trim(),!1)}a(Rze,"isPromptPersistEnabled");var z6o={mkdir:a((t,e)=>Ize.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>Ize.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>Ize.promises.appendFile(t,e,r),"appendFile")},AP,xze,G9t,j9t=new Map,AAn=0,H9t=new Map,$9t=new Map;function V9t(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(V9t,"formatHumanTimestamp");function W9t(t,e){return xze||(xze=Y6o(t,e)),xze}a(W9t,"getSharedProcessRoot");async function Y6o(t,e){let r=V9t(new Date);AP=NS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(AP,{recursive:!0});let n=new Date().toISOString();G9t=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:AP};return await e.writeFile(NS.join(AP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await J6o(AP,e).catch(()=>{}),await Z6o(AP,e).catch(()=>{}),AP}a(Y6o,"initProcessRoot");async function K6o(t){if(AP)try{let e=NS.join(AP,"session.json"),r=new Date().toISOString(),n={createdAt:G9t??r,updatedAt:r,pid:process.pid,processRoot:AP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(K6o,"touchProcessRootSessionJson");function z9t(t){return $9t.get(t)}a(z9t,"getTurnDir");function yAn(){AP=void 0,xze=void 0,G9t=void 0,j9t.clear(),AAn=0,H9t.clear(),$9t.clear()}a(yAn,"resetSharedProcessRoot");async function J6o(t,e){await e.writeFile(NS.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=Hmn(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=Hmn(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=xce(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 VWe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return jmn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??Ice(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:oQ(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(sQ)||void 0;return{type:"success",chatCompletions:Gmn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>qL(r),"getProcessingTime")}}};ok.register(new VWe);ok.register(new lWe);ok.register(new qWe);p();var WWe=require("fs"),IS=he(require("path"));function KWe(t){return Pse(()=>!!Gt(t,Je.PromptPersistBasePath)?.trim(),!1)}a(KWe,"isPromptPersistEnabled");var h3o={mkdir:a((t,e)=>WWe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>WWe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>WWe.promises.appendFile(t,e,r),"appendFile")},uk,zWe,K6t,z6t=new Map,$mn=0,Y6t=new Map,J6t=new Map;function Z6t(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(Z6t,"formatHumanTimestamp");function X6t(t,e){return zWe||(zWe=m3o(t,e)),zWe}a(X6t,"getSharedProcessRoot");async function m3o(t,e){let r=Z6t(new Date);uk=IS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(uk,{recursive:!0});let n=new Date().toISOString();K6t=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:uk};return await e.writeFile(IS.join(uk,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await A3o(uk,e).catch(()=>{}),await y3o(uk,e).catch(()=>{}),uk}a(m3o,"initProcessRoot");async function g3o(t){if(uk)try{let e=IS.join(uk,"session.json"),r=new Date().toISOString(),n={createdAt:K6t??r,updatedAt:r,pid:process.pid,processRoot:uk};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(g3o,"touchProcessRootSessionJson");function e9t(t){return J6t.get(t)}a(e9t,"getTurnDir");function Vmn(){uk=void 0,zWe=void 0,K6t=void 0,z6t.clear(),$mn=0,Y6t.clear(),J6t.clear()}a(Vmn,"resetSharedProcessRoot");async function A3o(t,e){await e.writeFile(IS.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. @@ -2430,7 +2386,7 @@ node generateHar.js http-log my-session.har \`\`\` Run from this directory, or pass absolute paths. -`,"utf8")}a(J6o,"writeReadme");async function Z6o(t,e){await e.writeFile(NS.join(t,"generateHar.js"),`#!/usr/bin/env node +`,"utf8")}a(A3o,"writeReadme");async function y3o(t,e){await e.writeFile(IS.join(t,"generateHar.js"),`#!/usr/bin/env node "use strict"; /** * Converts per-request JSON files from an http-log directory into a single HAR @@ -2499,51 +2455,51 @@ async function main() { } main().catch(e => { console.error(e); process.exit(1); }); -`,"utf8")}a(Z6o,"writeGenerateHarScript");var wze=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??z6o}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return qt(this.ctx,je.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await W9t(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=(j9t.get(this.conversationId)??0)+1;j9t.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?z9t(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=NS.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=H9t.get(this.conversationId);f||(f=String(++AAn).padStart(6,"0"),H9t.set(this.conversationId,f)),this.sessionDir=NS.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),$9t.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),K6o(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=NS.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=NS.join(r,"fetchLog.jsonl"),l=JSON.stringify(s)+` -`;await this.serializedAppend(c,l)}catch(r){Ye.debug(this.ctx,"Failed to persist LLM request",r)}}async appendTrajectoryStep(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=NS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){Ye.debug(this.ctx,"Failed to append trajectory step",r)}}async appendSubagentLink(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=NS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){Ye.debug(this.ctx,"Failed to append subagent link",r)}}async appendToolInOut(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=NS.join(r,"tool-in-out.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){Ye.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 Pze=require("fs"),YM=ce(require("path"));var EAn=require("stream");var X6o={mkdir:a((t,e)=>Pze.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>Pze.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>Pze.promises.appendFile(t,e,r),"appendFile")},kze,Dze=class t{constructor(e,r){this.ctx=e;this.fileOps=r??X6o,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(){kze=void 0,yAn(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return qt(this.ctx,je.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return kze||(kze=this.initHttpLogDir()),kze}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 W9t(this.basePath,this.toPersistenceFileOps()),r=YM.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=>{Ye.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{Ye.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=z9t(e);if(!r)return;let n=YM.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(YM.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=>{Ye.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(YM.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(YM.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(YM.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(YM.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(YM.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(YM.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},Nze=class extends BI{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 EAn.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 ZY=class t extends R_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new ge("AutoModelService"),this._register(Es(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(dc).getMetadata(),c=await this._ctx.get(Bc).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 zHe(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 Mze="Auto",MS="auto",_An="custom",Uo=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 bc(e.get(Si)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(dc).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n,o,s,c){if(n===MS)return await e.get(ZY).resolveModelConfiguration(s??"unknown",c);if(n)return e.get(Bc).getBestChatModelConfig([n],void 0,!0);{let l=await e.get(Qt).getToken(),u=!!l.userInfo?.isTBBEnabled,d=!!l.userInfo?.isFreeUser,f=e.get(Rd);if(!u&&f.quotaExhausted&&!d){let h=await e.get(dc).getFallbackModel();if(h?.id)return e.get(Bc).getBestChatModelConfig([h.id])}if(r)return e.get(Bc).getBestChatModelConfig(hS(r,u),o);throw new Error("Model is not specified")}}static setUserSelectedReasoningEffort(e,r,n){if(!n)return r;let o=r.reasoningEfforts;return o&&o.length>0&&!o.includes(n)?(Ye.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 transformMessages(e,r){return r===Tn.O1Ga||r===Tn.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}=Y9t(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var Hp=new ge("fetchChat"),e9o=new Set([500,502,504]),t9o=[1e3,1e4,1e4],Oze=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(P0(f)||!OI(f))throw f;Hp.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(i9o(l.status)){Hp.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 Uo.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(Rd).processQuotaHeaders(l.headers),e.get(jM).processRateLimitHeaders(l.headers);let u=fP.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){Hp.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 o9o(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){Hp.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}Hp.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 jt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=fP.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},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 Amn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await r9o(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)}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`;Hp.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),ht(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 Hp.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=yoe(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return gt(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 Hp.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400&&c.includes("off_topic"))return{type:"failed",reason:"filtered as off_topic by intent classifier: message was not programming related",code:n.status};if(n.status===400&&c.includes("model_not_supported"))return{type:"failed",reason:o?`model is not supported: ${o}`:"model is not supported.",code:n.status};if(n.status==400&&c.includes("model_max_prompt_tokens_exceeded"))return{type:"failed",reason:"model max prompt tokens exceeded.",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();if(n.status===402){if(c.includes("free_quota_exceeded"))return{type:"failed",reason:u?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(u).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.",code:n.status};if(c.includes("overage_limit_reached"))return{type:"failed",reason:d.userInfo?.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.",code:n.status};if(c.includes("quota_exceeded"))if(d.userInfo?.isTBBEnabled){let h=yoe(n),m="";h!==void 0&&(m=` Quota resets on ${new Date(Date.now()+h*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`);let g=e.get(Rd).overageEnabled?"increase budget":"enable additional overages",A=d.userInfo?.canUpgradePlan?", upgrade your plan":"";switch(d.userInfo?.copilotPlan){case"free":return{type:"failed",reason:`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${m}`,code:n.status};case"individual":case"individual_pro":return{type:"failed",reason:`You've used your monthly AI Credits. Please ${g}${A} or wait for your allowance to renew.${m}`,code:n.status};case"individual_max":return{type:"failed",reason:`You've used your monthly AI Credits. Please ${g} or wait for your allowance to renew.${m}`,code:n.status};case"business":case"enterprise":return{type:"failed",reason:`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to ${g} or wait for your allowance to renew.${m}`,code:n.status};default:return{type:"failed",reason:`You've used your monthly AI Credits.${m}`,code:n.status}}}else switch(d.userInfo?.copilotPlan){case"free":return{type:"failed",reason:"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.",code:n.status};case"individual":return{type:"failed",reason:"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.",code:n.status};case"individual_pro":return{type:"failed",reason:"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.",code:n.status};case"business":case"enterprise":return{type:"failed",reason:"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.",code:n.status};default:return{type:"failed",reason:"You've reached your monthly chat messages quota.",code:n.status}}else if(c.includes("session_quota_exceeded")){let h=yoe(n);return{type:"failed",reason:h!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+h*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.",code:n.status}}else if(c.includes("billing_not_configured"))return{type:"failed",reason:"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.",code:n.status};return{type:"failed",reason:"Quota Exceeded.",code:n.status}}return n.status===503?{type:"failed",reason:c,code:n.status}:(Hp.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function r9o(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=n===""&&o===""?r:xa(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});QWe(c,v,["messages"]),v.properties.headerRequestId=s,ht(t,"request.sent",v);let b=pl(),T=Rmn(u),w={...Gm(t),...f.toCapiHeaders()};NN()&&(w=await CSe(t,w)),c.messages?.some(x=>Array.isArray(x.content)?x.content.some(k=>"image_url"in k):!1)&&(w["Copilot-Vision-Request"]="true"),h&&(w["api-key"]=h),g&&(w[vQ]=g),A&&(w["copilot-session-token"]=A),o==="v1/messages"&&!E&&(w["anthropic-beta"]=PWe),c.messages&&c.messages.forEach(x=>{n9o(x)&&x.tool_calls&&(x.tool_calls=x.tool_calls.map(k=>Bmn(k)))});let R=zse(()=>Rze(t)?new Dze(t):void 0,void 0);return P7(t,_,l,T,s,c,y,w,void 0,m,R,e).then(x=>{let k=XL(x);v.extendWithRequestId(k);let D=pl()-b;return v.measurements.totalTimeMs=D,Hp.info(t,`Request ${s} at <${_}> finished with ${x.status} status after ${D}ms`),Hp.debug(t,"request.response properties",v.properties),Hp.debug(t,"request.response measurements",v.measurements),Hp.debug(t,"messages:",JSON.stringify(e)),ht(t,"request.response",v),R?new Nze(x,R,s,b):x}).catch(x=>{if(P0(x))throw x;let k=v.extendedBy({error:"Network exception"});ht(t,"request.shownWarning",k),v.properties.message=String(Fh(x,"name")??""),v.properties.code=String(Fh(x,"code")??""),v.properties.errno=String(Fh(x,"errno")??""),v.properties.type=String(Fh(x,"type")??"");let D=pl()-b;throw v.measurements.totalTimeMs=D,Hp.info(t,`Request ${s} at <${_}> rejected with ${String(x)} after ${D}ms`),Hp.debug(t,"request.error properties",v.properties),Hp.debug(t,"request.error measurements",v.measurements),ht(t,"request.error",v),x}).finally(()=>{Kce(t,e,v)})}a(r9o,"fetchWithInstrumentation");function n9o(t){return"tool_calls"in t}a(n9o,"isChatMessageWithToolCalls");function i9o(t){return e9o.has(t)}a(i9o,"shouldRetryStatusCode");async function o9o(t,e,r,n,o=t9o){let s=t.get(ar),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(Hp.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([rx(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await rx(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 Hp.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,Hp.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,Hp.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return Hp.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(o9o,"checkNetworkConnectivity");p();var s9o=[{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 Bze(t){let e=t.slice();return e.reverse(),CAn(e)||CAn(e.filter(r=>r.trim().length>0))}a(Bze,"isRepetitive");function CAn(t){let e=a9o(t);for(let r of s9o){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(a9o,"kmp_prefix_function");Ns();var rc=class{constructor(e){this.ctx=e;this.fetcher=new Oze}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=gr(),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&&qt(this.ctx,je.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&gmn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=CQ(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=qt(this.ctx,je.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(!AQ(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await vWe(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===Ao.Azure)if(e.modelConfiguration.deploymentUrl)A=J0n(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(Qce(e.modelConfiguration?.providerName))A=Vce[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else throw new Error(`Unsupported BYOK provider: ${e.modelConfiguration?.providerName}`)}else{if(A=LI(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?MWe(this.ctx,f):!1;y=NWe(f,D)}Ye.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=fP.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:_,...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),gt(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 k=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,k,y),this.trackTurnCredits(e,x),Wse(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:k})},D=>Ye.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=BTe(r.chatCompletions,u=>this.postProcess(u,o));Ye.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)Ye.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:In(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:In(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=>In(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 Bze(e.tokens)?(r.extendWithRequestId(e.requestId),ht(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return Ye.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(P0(e))return{type:"canceled",reason:"network request aborted",requestId:r};{Ye.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 JY?!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(Rd).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),gt(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var Uh=class{static{a(this,"ConversationInspector")}};p();p();var Qh=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]}},K9t=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}}},J9t=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}}},Xm=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 K9t(this._resolver(e),this.id,this.stepTitle)}processor(e){return new J9t(this._processor(e),this.id)}};p();p();var $y=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")}},ile=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new $y(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 vAn=new ge("EncodingConfigurationService"),KM=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),vAn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),vAn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var bAn=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 c9o=globalThis.performance&&typeof globalThis.performance.now=="function",Lze=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=c9o&&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 SAn=!1,l9o=!1,rIe;(M=>{M.None=a(()=>R_.None,"None");function e(O){if(l9o){let{onDidAddListener:q}=O,F=tIe.create(),U=0;O.onDidAddListener=()=>{++U===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),F.print()),q?.()}}}a(e,"_addLeakageTraceLogic");function r(O,q){return g(O,()=>{},0,void 0,!0,void 0,q)}M.defer=r,a(r,"defer");function n(O){return(q,F=null,U)=>{let W=!1,V;return V=O(G=>{if(!W)return V?V.dispose():W=!0,q.call(F,G)},null,U),W&&V.dispose(),V}}M.once=n,a(n,"once");function o(O,q){return M.once(M.filter(O,q))}M.onceIf=o,a(o,"onceIf");function s(O,q,F){return h((U,W=null,V)=>O(G=>U.call(W,q(G)),null,V),F)}M.map=s,a(s,"map");function c(O,q,F){return h((U,W=null,V)=>O(G=>{q(G),U.call(W,G)},null,V),F)}M.forEach=c,a(c,"forEach");function l(O,q,F){return h((U,W=null,V)=>O(G=>q(G)&&U.call(W,G),null,V),F)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(q,F=null,U)=>{let W=dmn(...O.map(V=>V(G=>q.call(F,G))));return m(W,U)}}M.any=d,a(d,"any");function f(O,q,F,U){let W=F;return s(O,V=>(W=q(W,V),W),U)}M.reduce=f,a(f,"reduce");function h(O,q){let F,U={onWillAddFirstListener(){F=O(W.fire,W)},onDidRemoveLastListener(){F?.dispose()}};q||e(U);let W=new OS(U);return q?.add(W),W.event}a(h,"snapshot");function m(O,q){return q instanceof Array?q.push(O):q&&q.add(O),O}a(m,"addAndReturnDisposable");function g(O,q,F=100,U=!1,W=!1,V,G){let Y,re,j,X=0,ie,we={leakWarningThreshold:V,onWillAddFirstListener(){Y=O(De=>{X++,re=q(re,De),U&&!j&&(Ae.fire(re),re=void 0),ie=a(()=>{let Te=re;re=void 0,j=void 0,(!U||X>1)&&Ae.fire(Te),X=0},"doFire"),typeof F=="number"?(clearTimeout(j),j=setTimeout(ie,F)):j===void 0&&(j=0,queueMicrotask(ie))})},onWillRemoveListener(){W&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,Y.dispose()}};G||e(we);let Ae=new OS(we);return G?.add(Ae),Ae.event}M.debounce=g,a(g,"debounce");function A(O,q=0,F){return M.debounce(O,(U,W)=>U?(U.push(W),U):[W],q,void 0,!0,void 0,F)}M.accumulate=A,a(A,"accumulate");function y(O,q=(U,W)=>U===W,F){let U=!0,W;return l(O,V=>{let G=U||!q(V,W);return U=!1,W=V,G},F)}M.latch=y,a(y,"latch");function E(O,q,F){return[M.filter(O,q,F),M.filter(O,U=>!q(U),F)]}M.split=E,a(E,"split");function _(O,q=!1,F=[],U){let W=F.slice(),V=O(re=>{W?W.push(re):Y.fire(re)});U&&U.add(V);let G=a(()=>{W?.forEach(re=>Y.fire(re)),W=null},"flush"),Y=new OS({onWillAddFirstListener(){V||(V=O(re=>Y.fire(re)),U&&U.add(V))},onDidAddFirstListener(){W&&(q?setTimeout(G):G())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return U&&U.add(Y),Y.event}M.buffer=_,a(_,"buffer");function v(O,q){return a((U,W,V)=>{let G=q(new T);return O(function(Y){let re=G.evaluate(Y);re!==b&&U.call(W,re)},void 0,V)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(q){return this.steps.push(q),this}forEach(q){return this.steps.push(F=>(q(F),F)),this}filter(q){return this.steps.push(F=>q(F)?F:b),this}reduce(q,F){let U=F;return this.steps.push(W=>(U=q(U,W),U)),this}latch(q=(F,U)=>F===U){let F=!0,U;return this.steps.push(W=>{let V=F||!q(W,U);return F=!1,U=W,V?W:b}),this}evaluate(q){for(let F of this.steps)if(q=F(q),q===b)break;return q}}function w(O,q,F=U=>U){let U=a((...Y)=>G.fire(F(...Y)),"fn"),W=a(()=>O.on(q,U),"onFirstListenerAdd"),V=a(()=>O.removeListener(q,U),"onLastListenerRemove"),G=new OS({onWillAddFirstListener:W,onDidRemoveLastListener:V});return G.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,q,F=U=>U){let U=a((...Y)=>G.fire(F(...Y)),"fn"),W=a(()=>O.addEventListener(q,U),"onFirstListenerAdd"),V=a(()=>O.removeEventListener(q,U),"onLastListenerRemove"),G=new OS({onWillAddFirstListener:W,onDidRemoveLastListener:V});return G.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,q){return new Promise(F=>n(O)(F,null,q))}M.toPromise=x,a(x,"toPromise");function k(O){let q=new OS;return O.then(F=>{q.fire(F)},()=>{q.fire(void 0)}).finally(()=>{q.dispose()}),q.event}M.fromPromise=k,a(k,"fromPromise");function D(O,q){return O(F=>q.fire(F))}M.forward=D,a(D,"forward");function N(O,q,F){return q(F),O(U=>q(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(q,F){this._observable=q;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{q.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{q.removeObserver(this)},"onDidRemoveLastListener")};F||e(U),this.emitter=new OS(U),F&&F.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(q){this._counter++}handlePossibleChange(q){}handleChange(q,F){this._hasChanged=!0}endUpdate(q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,q){return new L(O,q).emitter.event}M.fromObservable=B,a(B,"fromObservable");function Q(O){return(q,F,U)=>{let W=0,V=!1,G={beginUpdate(){W++},endUpdate(){W--,W===0&&(O.reportChanges(),V&&(V=!1,q.call(F)))},handlePossibleChange(){},handleChange(){V=!0}};O.addObserver(G),O.reportChanges();let Y={dispose(){O.removeObserver(G)}};return U instanceof yQ?U.add(Y):Array.isArray(U)&&U.push(Y),Y}}M.fromObservableLight=Q,a(Q,"fromObservableLight")})(rIe||={});var Z9t=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 Lze,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}}},TAn=-1;var X9t=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 ZWe=require("fs"),FM=he(require("path"));var Wmn=require("stream");var E3o={mkdir:a((t,e)=>ZWe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>ZWe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>ZWe.promises.appendFile(t,e,r),"appendFile")},JWe,XWe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??E3o,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(){JWe=void 0,Vmn(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Gt(this.ctx,Je.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return JWe||(JWe=this.initHttpLogDir()),JWe}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 X6t(this.basePath,this.toPersistenceFileOps()),r=FM.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=e9t(e);if(!r)return;let n=FM.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(FM.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(FM.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(FM.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(FM.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(FM.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(FM.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(FM.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},eze=class extends PI{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 Wmn.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 MY=class t extends I_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new Ee("AutoModelService"),this._register(ys(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(lc).getMetadata(),c=await this._ctx.get(zc).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 CHe(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 tze="Auto",xS="auto",zmn="custom",Jo=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 vc(e.get(bi)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(lc).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n,o,s,c){if(n===xS)return await e.get(MY).resolveModelConfiguration(s??"unknown",c);if(n)return e.get(zc).getBestChatModelConfig([n],void 0,!0);{let l=await e.get(Ut).getToken(),u=!!l.userInfo?.isTBBEnabled,d=!!l.userInfo?.isFreeUser,f=e.get(lu);if(!u&&f.quotaExhausted&&!d){let h=await e.get(lc).getFallbackModel();if(h?.id)return e.get(zc).getBestChatModelConfig([h.id])}if(r)return e.get(zc).getBestChatModelConfig(sS(r,u),o);throw new Error("Model is not specified")}}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 transformMessages(e,r){return r===Tn.O1Ga||r===Tn.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}=t9t(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var Gp=new Ee("fetchChat"),_3o=new Set([500,502,504]),v3o=[1e3,1e4,1e4],rze=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(k0(f)||!RI(f))throw f;Gp.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(S3o(l.status)){Gp.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 Jo.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(lu).processQuotaHeaders(l.headers),e.get(kM).processRateLimitHeaders(l.headers);let u=ok.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){Gp.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 T3o(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){Gp.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}Gp.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=ok.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},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 $hn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await C3o(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)}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`;Gp.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),yt(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(Ut).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return Gp.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=F9(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return _t(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 Gp.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=x_.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(Ut).getToken();return n.status===402?{type:"failed",reason:x_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:F9(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(lu).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(Gp.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function C3o(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=n===""&&o===""?r:Sa(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});aWe(c,v,["messages"]),v.properties.headerRequestId=s,yt(t,"request.sent",v);let b=dl(),T=n0n(u),w={...uA(t),...f.toCapiHeaders()};PB()&&(w=await yHe(t,w)),c.messages?.some(x=>Array.isArray(x.content)?x.content.some(P=>"image_url"in P):!1)&&(w["Copilot-Vision-Request"]="true"),h&&(w["api-key"]=h),g&&(w[sQ]=g),A&&(w["copilot-session-token"]=A),o==="v1/messages"&&!E&&(w["anthropic-beta"]=ZVe),c.messages&&c.messages.forEach(x=>{b3o(x)&&x.tool_calls&&(x.tool_calls=x.tool_calls.map(P=>u0n(P)))});let R=Pse(()=>KWe(t)?new XWe(t):void 0,void 0);return Oz(t,_,l,T,s,c,y,w,void 0,m,R,e).then(x=>{let P=QL(x);v.extendWithRequestId(P);let D=dl()-b;return v.measurements.totalTimeMs=D,Gp.info(t,`Request ${s} at <${_}> finished with ${x.status} status after ${D}ms`),Gp.debug(t,"request.response properties",v.properties),Gp.debug(t,"request.response measurements",v.measurements),Gp.debug(t,"messages:",JSON.stringify(e)),yt(t,"request.response",v),R?new eze(x,R,s,b):x}).catch(x=>{if(k0(x))throw x;let P=v.extendedBy({error:"Network exception"});yt(t,"request.shownWarning",P),v.properties.message=String(Fh(x,"name")??""),v.properties.code=String(Fh(x,"code")??""),v.properties.errno=String(Fh(x,"errno")??""),v.properties.type=String(Fh(x,"type")??"");let D=dl()-b;throw v.measurements.totalTimeMs=D,Gp.info(t,`Request ${s} at <${_}> rejected with ${String(x)} after ${D}ms`),Gp.debug(t,"request.error properties",v.properties),Gp.debug(t,"request.error measurements",v.measurements),yt(t,"request.error",v),x}).finally(()=>{wce(t,e,v)})}a(C3o,"fetchWithInstrumentation");function b3o(t){return"tool_calls"in t}a(b3o,"isChatMessageWithToolCalls");function S3o(t){return _3o.has(t)}a(S3o,"shouldRetryStatusCode");async function T3o(t,e,r,n,o=v3o){let s=t.get(fr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(Gp.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([KI(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await KI(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 Gp.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,Gp.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,Gp.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return Gp.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(T3o,"checkNetworkConnectivity");p();var I3o=[{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 nze(t){let e=t.slice();return e.reverse(),Ymn(e)||Ymn(e.filter(r=>r.trim().length>0))}a(nze,"isRepetitive");function Ymn(t){let e=x3o(t);for(let r of I3o){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(x3o,"kmp_prefix_function");As();var ec=class{constructor(e){this.ctx=e;this.fetcher=new rze}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=ir(),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(Ut).getToken(),g=!h&&Gt(this.ctx,Je.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&Ghn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=oQ(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Gt(this.ctx,Je.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(!rQ(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await HVe(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===go.Azure)if(e.modelConfiguration.deploymentUrl)A=Ihn(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(yce(e.modelConfiguration?.providerName))A=Sce[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else throw new Error(`Unsupported BYOK provider: ${e.modelConfiguration?.providerName}`)}else{if(A=kI(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?tWe(this.ctx,f):!1;y=eWe(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=ok.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:_,...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),_t(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),Rse(()=>{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=lTe(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:Rn(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:Rn(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=>Rn(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 nze(e.tokens)?(r.extendWithRequestId(e.requestId),yt(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(k0(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 NY?!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(lu).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),_t(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var Uh=class{static{a(this,"ConversationInspector")}};p();p();var Qh=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]}},r9t=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}}},n9t=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}}},eg=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 r9t(this._resolver(e),this.id,this.stepTitle)}processor(e){return new n9t(this._processor(e),this.id)}};p();p();var W0=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")}},Bce=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new W0(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 Kmn=new Ee("EncodingConfigurationService"),UM=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),Kmn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),Kmn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var Jmn=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 w3o=globalThis.performance&&typeof globalThis.performance.now=="function",ize=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=w3o&&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 Zmn=!1,R3o=!1,RTe;(M=>{M.None=a(()=>I_.None,"None");function e(O){if(R3o){let{onDidAddListener:q}=O,Q=wTe.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()),q?.()}}}a(e,"_addLeakageTraceLogic");function r(O,q){return g(O,()=>{},0,void 0,!0,void 0,q)}M.defer=r,a(r,"defer");function n(O){return(q,Q=null,U)=>{let z=!1,W;return W=O($=>{if(!z)return W?W.dispose():z=!0,q.call(Q,$)},null,U),z&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,q){return M.once(M.filter(O,q))}M.onceIf=o,a(o,"onceIf");function s(O,q,Q){return h((U,z=null,W)=>O($=>U.call(z,q($)),null,W),Q)}M.map=s,a(s,"map");function c(O,q,Q){return h((U,z=null,W)=>O($=>{q($),U.call(z,$)},null,W),Q)}M.forEach=c,a(c,"forEach");function l(O,q,Q){return h((U,z=null,W)=>O($=>q($)&&U.call(z,$),null,W),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(q,Q=null,U)=>{let z=Qhn(...O.map(W=>W($=>q.call(Q,$))));return m(z,U)}}M.any=d,a(d,"any");function f(O,q,Q,U){let z=Q;return s(O,W=>(z=q(z,W),z),U)}M.reduce=f,a(f,"reduce");function h(O,q){let Q,U={onWillAddFirstListener(){Q=O(z.fire,z)},onDidRemoveLastListener(){Q?.dispose()}};q||e(U);let z=new wS(U);return q?.add(z),z.event}a(h,"snapshot");function m(O,q){return q instanceof Array?q.push(O):q&&q.add(O),O}a(m,"addAndReturnDisposable");function g(O,q,Q=100,U=!1,z=!1,W,$){let J,ne,H,re=0,ae,Oe={leakWarningThreshold:W,onWillAddFirstListener(){J=O(Fe=>{re++,ne=q(ne,Fe),U&&!H&&(ve.fire(ne),ne=void 0),ae=a(()=>{let Pe=ne;ne=void 0,H=void 0,(!U||re>1)&&ve.fire(Pe),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(ae,Q)):H===void 0&&(H=0,queueMicrotask(ae))})},onWillRemoveListener(){z&&re>0&&ae?.()},onDidRemoveLastListener(){ae=void 0,J.dispose()}};$||e(Oe);let ve=new wS(Oe);return $?.add(ve),ve.event}M.debounce=g,a(g,"debounce");function A(O,q=0,Q){return M.debounce(O,(U,z)=>U?(U.push(z),U):[z],q,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,q=(U,z)=>U===z,Q){let U=!0,z;return l(O,W=>{let $=U||!q(W,z);return U=!1,z=W,$},Q)}M.latch=y,a(y,"latch");function E(O,q,Q){return[M.filter(O,q,Q),M.filter(O,U=>!q(U),Q)]}M.split=E,a(E,"split");function _(O,q=!1,Q=[],U){let z=Q.slice(),W=O(ne=>{z?z.push(ne):J.fire(ne)});U&&U.add(W);let $=a(()=>{z?.forEach(ne=>J.fire(ne)),z=null},"flush"),J=new wS({onWillAddFirstListener(){W||(W=O(ne=>J.fire(ne)),U&&U.add(W))},onDidAddFirstListener(){z&&(q?setTimeout($):$())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return U&&U.add(J),J.event}M.buffer=_,a(_,"buffer");function v(O,q){return a((U,z,W)=>{let $=q(new T);return O(function(J){let ne=$.evaluate(J);ne!==b&&U.call(z,ne)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(q){return this.steps.push(q),this}forEach(q){return this.steps.push(Q=>(q(Q),Q)),this}filter(q){return this.steps.push(Q=>q(Q)?Q:b),this}reduce(q,Q){let U=Q;return this.steps.push(z=>(U=q(U,z),U)),this}latch(q=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(z=>{let W=Q||!q(z,U);return Q=!1,U=z,W?z:b}),this}evaluate(q){for(let Q of this.steps)if(q=Q(q),q===b)break;return q}}function w(O,q,Q=U=>U){let U=a((...J)=>$.fire(Q(...J)),"fn"),z=a(()=>O.on(q,U),"onFirstListenerAdd"),W=a(()=>O.removeListener(q,U),"onLastListenerRemove"),$=new wS({onWillAddFirstListener:z,onDidRemoveLastListener:W});return $.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,q,Q=U=>U){let U=a((...J)=>$.fire(Q(...J)),"fn"),z=a(()=>O.addEventListener(q,U),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(q,U),"onLastListenerRemove"),$=new wS({onWillAddFirstListener:z,onDidRemoveLastListener:W});return $.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,q){return new Promise(Q=>n(O)(Q,null,q))}M.toPromise=x,a(x,"toPromise");function P(O){let q=new wS;return O.then(Q=>{q.fire(Q)},()=>{q.fire(void 0)}).finally(()=>{q.dispose()}),q.event}M.fromPromise=P,a(P,"fromPromise");function D(O,q){return O(Q=>q.fire(Q))}M.forward=D,a(D,"forward");function N(O,q,Q){return q(Q),O(U=>q(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(q,Q){this._observable=q;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{q.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{q.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new wS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(q){this._counter++}handlePossibleChange(q){}handleChange(q,Q){this._hasChanged=!0}endUpdate(q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,q){return new L(O,q).emitter.event}M.fromObservable=B,a(B,"fromObservable");function j(O){return(q,Q,U)=>{let z=0,W=!1,$={beginUpdate(){z++},endUpdate(){z--,z===0&&(O.reportChanges(),W&&(W=!1,q.call(Q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver($),O.reportChanges();let J={dispose(){O.removeObserver($)}};return U instanceof nQ?U.add(J):Array.isArray(U)&&U.push(J),J}}M.fromObservableLight=j,a(j,"fromObservableLight")})(RTe||={});var i9t=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 ize,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}}},Xmn=-1;var o9t=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 ole)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new X9t(e?.onListenerError??qce,this._options?.leakWarningThreshold??TAn):void 0,this._perfMon=this._options?._profName?new Z9t(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(SAn){let e=this._listeners;queueMicrotask(()=>{f9o(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 tUt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||qce)(f),R_.None}if(this._disposed)return R_.None;r&&(e=e.bind(r));let o=new ole(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=tIe.create(),s=this._leakageMon.check(o.stack,this._size+1)),SAn&&(o.stack=c??tIe.create()),this._listeners?this._listeners instanceof ole?(this._deliveryQueue??=new rUt,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=RWe(()=>{s?.(),this._removeListener(o)});return n instanceof yQ?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*d9o<=r.length){let s=0;for(let c=0;c0}};var rUt=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 IAn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),p9o;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof nUt?!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:rIe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:IAn})})(p9o||={});var nUt=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?IAn:(this._emitter||(this._emitter=new OS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function m9o(t){return t}a(m9o,"identity");var Fze=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=m9o):(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 LQ=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 iUt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(iUt,"escapeRegExpCharacters");function PAn(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(PAn,"ltrim");function Uze(t){return t.split(/\r\n|\r|\n/)}a(Uze,"splitLines");function oUt(t,e){return te?1:0}a(oUt,"compare");function Qze(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(Qze,"compareSubstring");function sUt(t,e){return iIe(t,e,0,t.length,0,e.length)}a(sUt,"compareIgnoreCase");function iIe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return Qze(t.toLowerCase(),e.toLowerCase(),r,n,o,s);xAn(u)&&(u-=32),xAn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(iIe,"compareSubstringIgnoreCase");function xAn(t){return t>=97&&t<=122}a(xAn,"isLowerAsciiLetter");function DAn(t,e){let r=e.length;return e.length>t.length?!1:iIe(t,e,0,r)===0}a(DAn,"startsWithIgnoreCase");function sle(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(g9o,"startsWithUTF8BOM");function NAn(t){return g9o(t)?t.substr(1):t}a(NAn,"stripUTF8BOM");var wAn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=A9o()}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 A9o(){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(A9o,"getGraphemeBreakRawData");var RAn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new LQ(()=>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 Fze({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 LQ(()=>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;rMAn)return{status:"notfound",message:"File too large"};let c=await Bce(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:iP.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=To(e);if(aa.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(aa),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof $y))throw c}let o=(await this.ctx.get(Fo).stat(e)).size/1024/1024;return o>MAn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(KM).getEncodingForFile(e)}catch(o){if(!(o instanceof $y))throw o}let n=await this.ctx.get(Fo).readFileString(e,r);return NAn(n)}};p();function sIe(t){for(var e=[],r=1;r{if(t instanceof Lce)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new o9t(e?.onListenerError??Ece,this._options?.leakWarningThreshold??Xmn):void 0,this._perfMon=this._options?._profName?new i9t(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(Zmn){let e=this._listeners;queueMicrotask(()=>{D3o(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 a9t(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Ece)(f),I_.None}if(this._disposed)return I_.None;r&&(e=e.bind(r));let o=new Lce(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=wTe.create(),s=this._leakageMon.check(o.stack,this._size+1)),Zmn&&(o.stack=c??wTe.create()),this._listeners?this._listeners instanceof Lce?(this._deliveryQueue??=new c9t,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=KVe(()=>{s?.(),this._removeListener(o)});return n instanceof nQ?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*k3o<=r.length){let s=0;for(let c=0;c0}};var c9t=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 egn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),N3o;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof l9t?!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:RTe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:egn})})(N3o||={});var l9t=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?egn:(this._emitter||(this._emitter=new wS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function O3o(t){return t}a(O3o,"identity");var oze=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=O3o):(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 vQ=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 u9t(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(u9t,"escapeRegExpCharacters");function ogn(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(ogn,"ltrim");function sze(t){return t.split(/\r\n|\r|\n/)}a(sze,"splitLines");function d9t(t,e){return te?1:0}a(d9t,"compare");function aze(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(aze,"compareSubstring");function f9t(t,e){return kTe(t,e,0,t.length,0,e.length)}a(f9t,"compareIgnoreCase");function kTe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return aze(t.toLowerCase(),e.toLowerCase(),r,n,o,s);tgn(u)&&(u-=32),tgn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(kTe,"compareSubstringIgnoreCase");function tgn(t){return t>=97&&t<=122}a(tgn,"isLowerAsciiLetter");function sgn(t,e){let r=e.length;return e.length>t.length?!1:kTe(t,e,0,r)===0}a(sgn,"startsWithIgnoreCase");function Fce(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(B3o,"startsWithUTF8BOM");function agn(t){return B3o(t)?t.substr(1):t}a(agn,"stripUTF8BOM");var rgn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=L3o()}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 L3o(){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(L3o,"getGraphemeBreakRawData");var ngn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new vQ(()=>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 oze({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 vQ(()=>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;rcgn)return{status:"notfound",message:"File too large"};let c=await hce(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:JP.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=po(e);if(na.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(na),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof W0))throw c}let o=(await this.ctx.get(Bo).stat(e)).size/1024/1024;return o>cgn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(UM).getEncodingForFile(e)}catch(o){if(!(o instanceof W0))throw o}let n=await this.ctx.get(Bo).readFileString(e,r);return agn(n)}};p();function NTe(t){for(var e=[],r=1;rr.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(OAn,"filterConversationTurns");function cUt(t){return OAn(t).getLastTurn()?.id}a(cUt,"getLastTurnId");async function BAn(t){let e=OAn(t.conversation),r=cUt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(eg).getDump(r),s=_9o(o,e.turns);Dr.debug(t.ctx,`conversation.dump +`)),c+=h+n[u+1]}),c}a(NTe,"dedent");var sa=NTe;var p9t=class{constructor(){this.resolvedSkills={};this.resolutions=[]}static{a(this,"SkillDump")}},tg=class{constructor(){this.dump=new yn(25);this.promptsDump=new yn(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 p9t,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 lgn(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(lgn,"filterConversationTurns");function h9t(t){return lgn(t).getLastTurn()?.id}a(h9t,"getLastTurnId");async function ugn(t){let e=lgn(t.conversation),r=h9t(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(tg).getDump(r),s=Q3o(o,e.turns);Dr.debug(t.ctx,`conversation.dump `,` -`+s);let c=await C9o(o,t.ctx);return Ws` - ${E9o(t.conversation,r)} - ${y9o(t.ctx)} +`+s);let c=await q3o(o,t.ctx);return sa` + ${U3o(t.conversation,r)} + ${F3o(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(BAn,"getConversationDump");function y9o(t){let e=t.get(Lr);return Ws` + `}a(ugn,"getConversationDump");function F3o(t){let e=t.get(Lr);return sa` - IDE: \`${e.getEditorInfo().name} (${e.getEditorInfo().version})\` - Plugin: \`${e.getEditorPluginInfo().version}\` - `}a(y9o,"getEditorInfoDumpMessage");function E9o(t,e){return Ws` + `}a(F3o,"getEditorInfoDumpMessage");function U3o(t,e){return sa` Debug information for the last turn of the conversation. - ConversationId: \`${t.id}\` - MessageId: \`${e}\` - `}a(E9o,"getInfoDumpMessage");async function LAn(t,e,r){let n=t.ctx.get(Qh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Vo).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&&In(t.turn.request.message).trim().length>0&&(o+=` + `}a(U3o,"getInfoDumpMessage");async function dgn(t,e,r){let n=t.ctx.get(Qh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(jo).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&&Rn(t.turn.request.message).trim().length>0&&(o+=` -**User message**: ${In(t.turn.request.message)}`);for(let c of s){o+=` -## ${c.id}`,o+=Ws` +**User message**: ${Rn(t.turn.request.message)}`);for(let c of s){o+=` +## ${c.id}`,o+=sa` \n\n **Description** - ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=Ws` + ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=sa` \n\n **Resolution** \`\`\`yaml - ${wY(u)} - \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=Ws` + ${uY(u)} + \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=sa` \n\n **Processed value** @@ -2551,17 +2507,17 @@ ${c}`:""} **Unprocessable**`}else o+=` -**Unresolvable**`}return o}a(LAn,"getSkillsDump");function _9o(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:In(n.request.message)};return n.response&&(s.response=In(n.response.message)),s})};return wY(r)}a(_9o,"toSimulationFormat");async function C9o(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(Jn).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Dr.debug(e,`conversation.dump.file +**Unresolvable**`}return o}a(dgn,"getSkillsDump");function Q3o(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Rn(n.request.message)};return n.response&&(s.response=Rn(n.response.message)),s})};return uY(r)}a(Q3o,"toSimulationFormat");async function q3o(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();Dr.debug(e,`conversation.dump.file `,u),o+=` **${s.uri}** \`\`\`${l?.detectedLanguageId} ${u} -\`\`\``}return o}a(C9o,"fileDump");p();function lUt(t,e){let r=Ss(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(In(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(lUt,"countMessagesTokens");p();function FAn(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(q3o,"fileDump");p();function m9t(t,e){let r=Ds(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(Rn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(m9t,"countMessagesTokens");p();function fgn(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(FAn,"chatBasePrompt");p();p();async function FQ(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(FQ,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function jze(t){return!!t&&typeof t.then=="function"}a(jze,"isThenable");var qze=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 Oc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Oc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var v9o;(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")})(v9o||={});var UAn=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 OS,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 Hze=!1,Gze=!1,aIe=!1,b9o=!1,S9o=!1,QAn=!1,T9o=!1,I9o=!1,x9o=!1,w9o=!1;var c3,l3=globalThis,kx;typeof l3.vscode<"u"&&typeof l3.vscode.process<"u"?kx=l3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(kx=process);var qAn=typeof kx?.versions?.electron=="string",R9o=qAn&&kx?.type==="renderer";typeof kx=="object"?(Hze=kx.platform==="win32",Gze=kx.platform==="darwin",aIe=kx.platform==="linux",b9o=aIe&&!!kx.env.SNAP&&!!kx.env.SNAP_REVISION,T9o=qAn,x9o=!!kx.env.CI||!!kx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,S9o=!0):typeof navigator=="object"&&!R9o?(c3=navigator.userAgent,Hze=c3.indexOf("Windows")>=0,Gze=c3.indexOf("Macintosh")>=0,I9o=(c3.indexOf("Macintosh")>=0||c3.indexOf("iPad")>=0||c3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,aIe=c3.indexOf("Linux")>=0,w9o=c3?.indexOf("Mobi")>=0,QAn=!0):console.error("Unable to resolve platform.");var uUt=0;Gze?uUt=1:Hze?uUt=3:aIe&&(uUt=2);var dUt=Hze,jAn=Gze,HAn=aIe;var k9o=QAn&&typeof l3.importScripts=="function",a$u=k9o?l3.origin:void 0;var JM=c3;var P9o=typeof l3.postMessage=="function"&&!l3.importScripts,c$u=(()=>{if(P9o){let t=[];l3.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}),l3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var D9o=!!(JM&&JM.indexOf("Chrome")>=0),l$u=!!(JM&&JM.indexOf("Firefox")>=0),u$u=!!(!D9o&&JM&&JM.indexOf("Safari")>=0),d$u=!!(JM&&JM.indexOf("Edg/")>=0),f$u=!!(JM&&JM.indexOf("Android")>=0);var XY,fUt=globalThis.vscode;if(typeof fUt<"u"&&typeof fUt.process<"u"){let t=fUt.process;XY={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"?XY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:XY={get platform(){return dUt?"win32":jAn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var cIe=XY.cwd,GAn=XY.env,$An=XY.platform,y$u=XY.arch;var M9o=65,O9o=97,B9o=90,L9o=122,qQ=46,tg=47,xv=92,UQ=58,F9o=63,$ze=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 U9o(t,e){if(t===null||typeof t!="object")throw new $ze(e,"Object",t)}a(U9o,"validateObject");function zf(t,e){if(typeof t!="string")throw new $ze(e,"string",t)}a(zf,"validateString");var wv=$An==="win32";function es(t){return t===tg||t===xv}a(es,"isPathSeparator");function pUt(t){return t===tg}a(pUt,"isPosixPathSeparator");function QQ(t){return t>=M9o&&t<=B9o||t>=O9o&&t<=L9o}a(QQ,"isWindowsDeviceRoot");function Vze(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===qQ&&l!==-1?++l:l=-1}return o}a(Vze,"normalizeString");function Q9o(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(Q9o,"formatExt");function VAn(t,e){U9o(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${Q9o(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(VAn,"_format");var qh={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],zf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=cIe():(s=GAn[`=${e}`]||cIe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===xv)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)es(f)&&(l=1,d=!0);else if(es(f))if(d=!0,es(s.charCodeAt(1))){let h=2,m=h;for(;h2&&es(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=Vze(r,!n,"\\",es),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){zf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return pUt(s)?"\\":t;if(es(s))if(o=!0,es(t.charCodeAt(1))){let l=2,u=l;for(;l2&&es(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&es(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){zf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return es(r)||e>2&&QQ(r)&&t.charCodeAt(1)===UQ&&es(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"&&es(r.charCodeAt(0))){++o;let s=r.length;s>1&&es(r.charCodeAt(1))&&(++o,s>2&&(es(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return qh.normalize(e)},relative(t,e){if(zf(t,"from"),zf(e,"to"),t===e)return"";let r=qh.resolve(t),n=qh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===xv;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===xv;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===xv)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===xv?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)===xv)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===xv&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=qh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===xv){if(e.charCodeAt(1)===xv){let r=e.charCodeAt(2);if(r!==F9o&&r!==qQ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(QQ(e.charCodeAt(0))&&e.charCodeAt(1)===UQ&&e.charCodeAt(2)===xv)return`\\\\?\\${e}`;return t},dirname(t){zf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return es(o)?t:".";if(es(o)){if(r=n=1,es(t.charCodeAt(1))){let l=2,u=l;for(;l2&&es(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(es(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&&zf(e,"suffix"),zf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&QQ(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(es(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(es(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){zf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===UQ&&QQ(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(es(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===qQ?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:VAn.bind(null,"\\"),parse(t){zf(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 es(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(es(o)){if(n=1,es(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),es(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===qQ?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},q9o=(()=>{if(wv){let t=/\\/g;return()=>{let e=cIe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>cIe()})(),ff={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:q9o();zf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===tg)}return e=Vze(e,!r,"/",pUt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===tg,r=t.charCodeAt(t.length-1)===tg;return t=Vze(t,!e,"/",pUt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return zf(t,"path"),t.length>0&&t.charCodeAt(0)===tg},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?".":ff.normalize(e)},relative(t,e){if(zf(t,"from"),zf(e,"to"),t===e||(t=ff.resolve(t),e=ff.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)===tg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===tg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===tg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===tg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===tg){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&&zf(e,"ext"),zf(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===tg){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)===tg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){zf(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===tg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===qQ?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:VAn.bind(null,"/"),parse(t){zf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===tg,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===tg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===qQ?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};ff.win32=qh.win32=qh;ff.posix=qh.posix=ff;var j9o=wv?qh.normalize:ff.normalize,H9o=wv?qh.isAbsolute:ff.isAbsolute,Wze=wv?qh.join:ff.join,_$u=wv?qh.resolve:ff.resolve,C$u=wv?qh.relative:ff.relative,v$u=wv?qh.dirname:ff.dirname,WAn=wv?qh.basename:ff.basename,zAn=wv?qh.extname:ff.extname,b$u=wv?qh.format:ff.format,S$u=wv?qh.parse:ff.parse,T$u=wv?qh.toNamespacedPath:ff.toNamespacedPath,eK=wv?qh.sep:ff.sep,I$u=wv?qh.delimiter:ff.delimiter;p();p();function tK(t,e="unexpected state"){if(!t)throw new Oc(`Assertion Failed: ${e}`)}a(tK,"assert");function hUt(t){if(!t()){debugger;t(),qce(new Oc("Assertion Failed"))}}a(hUt,"assertFn");function lIe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!DAn(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(YAn,"isEqualOrParent");var zze="**",KAn="/",Yze="[/\\\\]",Kze="[^/\\\\]",$9o=/\//g;function JAn(t,e){switch(t){case 0:return"";case 1:return`${Kze}*?`;default:return`(?:${Yze}|${Kze}+${Yze}${e?`|${Yze}${Kze}+`:""})*?`}}a(JAn,"starsToRegExp");function uIe(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(uIe,"splitGlobAware");function tyn(t){if(!t)return"";let e="",r=uIe(t,KAn);if(r.every(n=>n===zze))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===zze){if(n)return;e+=JAn(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===KAn?h="":h=iUt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${uIe(l,",").map(g=>tyn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Kze;continue;case"*":e+=JAn(1);continue;default:e+=iUt(f)}}sAUt(l,e)).filter(l=>l!==yP),t),n=r.length;if(!n)return yP;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(eUo,"trivia3");function eyn(t,e,r){let n=eK===ff.sep,o=n?t:t.replace($9o,eK),s=eK+o,c=ff.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(eyn,"trivia4and5");function tUo(t){try{let e=new RegExp(`^${tyn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return yP}}a(tUo,"toRegExp");function nyn(t,e,r){return!t||typeof e!="string"?!1:yUt(t)(e,void 0,r)}a(nyn,"match");function yUt(t,e={}){if(!t)return gUt;if(typeof t=="string"||rUo(t)){let r=AUt(t,e);if(r===yP)return gUt;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 nUo(t,e)}a(yUt,"parse");function rUo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(rUo,"isRelativePattern");function nUo(t,e){let r=iyn(Object.getOwnPropertyNames(t).map(l=>iUo(l,t[l],e)).filter(l=>l!==yP)),n=r.length;if(!n)return yP;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(nUo,"parsedExpression");function iUo(t,e,r){if(e===!1)return yP;let n=AUt(t,r);if(n===yP)return yP;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 jze(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(iUo,"parseExpressionPattern");function iyn(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(iyn,"aggregateBasenameMatches");function oyn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return oUo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(oyn,"validate");function syn(t,e){let r=uIe(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(nyn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(syn,"matches");function oUo(t){try{let e=uIe(t,",");if(e.length===0)return!1;for(let r of e){let n=yUt(r);if(ryn(n))return!1}return!0}catch{return!1}}a(oUo,"isValidGlob");var cyn=ce(require("path"));var jh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var _Ut=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 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(){return this.isBuiltIn||this.promptFileEntry.promptPath.storage==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},lyn={name:"copilot-instructions",source:jh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},uyn={name:"git-commit-instructions",source:jh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},dyn={name:"agents-md-instructions",source:jh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},sUo={name:"nested-agents-md-instructions",source:jh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},fyn={name:"claude-md-instructions",source:jh.claudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},aUo={name:"nested-claude-md-instructions",source:jh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},cUo=[lyn,uyn,dyn,sUo,fyn,aUo],lUo={name:"instruction-file",source:jh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},EUt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},uUo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function ayn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(ayn,"optionKey");function CUt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=ayn(n);if(!(o in EUt)||(r=!0,!(e[o]??EUt[o])))continue;let c=uUo[n];if(c){let l=ayn(c);if(!(e[l]??EUt[l]))continue}return!0}return r?!1:void 0}a(CUt,"shouldIncludeSource");var vUt=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)CUt([n],e)!==!1&&r.push(...o);return r}},dUo=new uQ;function fUo(t,e,r,n){if(!t)return;let o=`${dQ}${e}`,s=dUo.parse(o,t),c=s.body?.content??t;if(c.trim())return{matchKind:r,uri:o,name:s.header?.name??e,applyTo:s.header?.applyTo||void 0,description:s.header?.description,content:c,isReadonly:!0,isBuiltIn:!1,source:[n]}}a(fUo,"resolveContent");var rK=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 m of this.configsByKey.values())o.push(...m);let{name:s,matchKind:c,source:l}=this.descriptor,u=o.filter(m=>m.type==="content").map(m=>{let g=m.content?.trim();return g?fUo(g,`global-${s}`,c,l):void 0}).filter(m=>m!==void 0);this.manager.set(l,u);let d={source:l,matchKind:c},f=this.descriptor.globSuffix??"",h=new Set;for(let m of this.descriptor.defaultRegistration??[])h.add(m);for(let m of o)m.type==="location"?h.add(cyn.default.posix.join(m.path,f)):m.type==="file"&&h.add(Wn(m.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(h),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:d})}};function pUo(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(pUo,"stripSource");var hUo="workspace",pf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new vUt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[jh.copilotInstructions,new rK(lyn,this.inMemoryManager,n)],[jh.gitCommitInstructions,new rK(uyn,this.inMemoryManager,n)],[jh.agentsMdInstructions,new rK(dyn,this.inMemoryManager,n)],[jh.claudeMdInstructions,new rK(fyn,this.inMemoryManager,n)],[jh.customInstructionFiles,new rK(lUo,this.inMemoryManager,n)]]);for(let o of cUo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind}});this.slotsBySource.get(jh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e){return(await this.ctx.get(zm).collect(this.ctx,"instructions",e)).map(n=>new _Ut(n))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=hUo){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{Dr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(pUo(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(fgn,"chatBasePrompt");p();p();async function CQ(t){return!!(await t.get(Ut).getToken()).userInfo?.isTBBEnabled}a(CQ,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function lze(t){return!!t&&typeof t.then=="function"}a(lze,"isThenable");var cze=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 Nc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Nc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var j3o;(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")})(j3o||={});var pgn=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 wS,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 uze=!1,dze=!1,MTe=!1,H3o=!1,G3o=!1,hgn=!1,$3o=!1,V3o=!1,W3o=!1,z3o=!1;var zL,YL=globalThis,Tx;typeof YL.vscode<"u"&&typeof YL.vscode.process<"u"?Tx=YL.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Tx=process);var mgn=typeof Tx?.versions?.electron=="string",Y3o=mgn&&Tx?.type==="renderer";typeof Tx=="object"?(uze=Tx.platform==="win32",dze=Tx.platform==="darwin",MTe=Tx.platform==="linux",H3o=MTe&&!!Tx.env.SNAP&&!!Tx.env.SNAP_REVISION,$3o=mgn,W3o=!!Tx.env.CI||!!Tx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,G3o=!0):typeof navigator=="object"&&!Y3o?(zL=navigator.userAgent,uze=zL.indexOf("Windows")>=0,dze=zL.indexOf("Macintosh")>=0,V3o=(zL.indexOf("Macintosh")>=0||zL.indexOf("iPad")>=0||zL.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,MTe=zL.indexOf("Linux")>=0,z3o=zL?.indexOf("Mobi")>=0,hgn=!0):console.error("Unable to resolve platform.");var g9t=0;dze?g9t=1:uze?g9t=3:MTe&&(g9t=2);var A9t=uze,ggn=dze,Agn=MTe;var K3o=hgn&&typeof YL.importScripts=="function",yqu=K3o?YL.origin:void 0;var QM=zL;var J3o=typeof YL.postMessage=="function"&&!YL.importScripts,Equ=(()=>{if(J3o){let t=[];YL.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}),YL.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var Z3o=!!(QM&&QM.indexOf("Chrome")>=0),_qu=!!(QM&&QM.indexOf("Firefox")>=0),vqu=!!(!Z3o&&QM&&QM.indexOf("Safari")>=0),Cqu=!!(QM&&QM.indexOf("Edg/")>=0),bqu=!!(QM&&QM.indexOf("Android")>=0);var OY,y9t=globalThis.vscode;if(typeof y9t<"u"&&typeof y9t.process<"u"){let t=y9t.process;OY={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"?OY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:OY={get platform(){return A9t?"win32":ggn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var OTe=OY.cwd,ygn=OY.env,Egn=OY.platform,Rqu=OY.arch;var eFo=65,tFo=97,rFo=90,nFo=122,TQ=46,rg=47,vC=92,bQ=58,iFo=63,fze=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 oFo(t,e){if(t===null||typeof t!="object")throw new fze(e,"Object",t)}a(oFo,"validateObject");function Yf(t,e){if(typeof t!="string")throw new fze(e,"string",t)}a(Yf,"validateString");var CC=Egn==="win32";function Zo(t){return t===rg||t===vC}a(Zo,"isPathSeparator");function E9t(t){return t===rg}a(E9t,"isPosixPathSeparator");function SQ(t){return t>=eFo&&t<=rFo||t>=tFo&&t<=nFo}a(SQ,"isWindowsDeviceRoot");function pze(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(pze,"normalizeString");function sFo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(sFo,"formatExt");function _gn(t,e){oFo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${sFo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(_gn,"_format");var qh={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],Yf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=OTe():(s=ygn[`=${e}`]||OTe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===vC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Zo(f)&&(l=1,d=!0);else if(Zo(f))if(d=!0,Zo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Zo(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=pze(r,!n,"\\",Zo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Yf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return E9t(s)?"\\":t;if(Zo(s))if(o=!0,Zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Zo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Zo(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Yf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Zo(r)||e>2&&SQ(r)&&t.charCodeAt(1)===bQ&&Zo(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"&&Zo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Zo(r.charCodeAt(1))&&(++o,s>2&&(Zo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return qh.normalize(e)},relative(t,e){if(Yf(t,"from"),Yf(e,"to"),t===e)return"";let r=qh.resolve(t),n=qh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===vC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===vC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===vC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===vC?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)===vC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===vC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=qh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===vC){if(e.charCodeAt(1)===vC){let r=e.charCodeAt(2);if(r!==iFo&&r!==TQ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(SQ(e.charCodeAt(0))&&e.charCodeAt(1)===bQ&&e.charCodeAt(2)===vC)return`\\\\?\\${e}`;return t},dirname(t){Yf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Zo(o)?t:".";if(Zo(o)){if(r=n=1,Zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Zo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Zo(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&&Yf(e,"suffix"),Yf(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(Zo(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(Zo(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){Yf(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(Zo(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:_gn.bind(null,"\\"),parse(t){Yf(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 Zo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Zo(o)){if(n=1,Zo(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),Zo(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},aFo=(()=>{if(CC){let t=/\\/g;return()=>{let e=OTe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>OTe()})(),uf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:aFo();Yf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===rg)}return e=pze(e,!r,"/",E9t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Yf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===rg,r=t.charCodeAt(t.length-1)===rg;return t=pze(t,!e,"/",E9t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Yf(t,"path"),t.length>0&&t.charCodeAt(0)===rg},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?".":uf.normalize(e)},relative(t,e){if(Yf(t,"from"),Yf(e,"to"),t===e||(t=uf.resolve(t),e=uf.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)===rg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===rg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===rg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Yf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===rg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===rg){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&&Yf(e,"ext"),Yf(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===rg){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)===rg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Yf(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===rg){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:_gn.bind(null,"/"),parse(t){Yf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===rg,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===rg){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};uf.win32=qh.win32=qh;uf.posix=qh.posix=uf;var cFo=CC?qh.normalize:uf.normalize,lFo=CC?qh.isAbsolute:uf.isAbsolute,hze=CC?qh.join:uf.join,kqu=CC?qh.resolve:uf.resolve,Dqu=CC?qh.relative:uf.relative,Nqu=CC?qh.dirname:uf.dirname,vgn=CC?qh.basename:uf.basename,Cgn=CC?qh.extname:uf.extname,Mqu=CC?qh.format:uf.format,Oqu=CC?qh.parse:uf.parse,Bqu=CC?qh.toNamespacedPath:uf.toNamespacedPath,BY=CC?qh.sep:uf.sep,Lqu=CC?qh.delimiter:uf.delimiter;p();p();function LY(t,e="unexpected state"){if(!t)throw new Nc(`Assertion Failed: ${e}`)}a(LY,"assert");function _9t(t){if(!t()){debugger;t(),Ece(new Nc("Assertion Failed"))}}a(_9t,"assertFn");function BTe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!sgn(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(bgn,"isEqualOrParent");var mze="**",Sgn="/",gze="[/\\\\]",Aze="[^/\\\\]",dFo=/\//g;function Tgn(t,e){switch(t){case 0:return"";case 1:return`${Aze}*?`;default:return`(?:${gze}|${Aze}+${gze}${e?`|${gze}${Aze}+`:""})*?`}}a(Tgn,"starsToRegExp");function LTe(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(LTe,"splitGlobAware");function Rgn(t){if(!t)return"";let e="",r=LTe(t,Sgn);if(r.every(n=>n===mze))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===mze){if(n)return;e+=Tgn(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===Sgn?h="":h=u9t(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${LTe(l,",").map(g=>Rgn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Aze;continue;case"*":e+=Tgn(1);continue;default:e+=u9t(f)}}sb9t(l,e)).filter(l=>l!==dk),t),n=r.length;if(!n)return dk;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(_Fo,"trivia3");function wgn(t,e,r){let n=BY===uf.sep,o=n?t:t.replace(dFo,BY),s=BY+o,c=uf.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(wgn,"trivia4and5");function vFo(t){try{let e=new RegExp(`^${Rgn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return dk}}a(vFo,"toRegExp");function kgn(t,e,r){return!t||typeof e!="string"?!1:S9t(t)(e,void 0,r)}a(kgn,"match");function S9t(t,e={}){if(!t)return C9t;if(typeof t=="string"||CFo(t)){let r=b9t(t,e);if(r===dk)return C9t;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 bFo(t,e)}a(S9t,"parse");function CFo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(CFo,"isRelativePattern");function bFo(t,e){let r=Dgn(Object.getOwnPropertyNames(t).map(l=>SFo(l,t[l],e)).filter(l=>l!==dk)),n=r.length;if(!n)return dk;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(bFo,"parsedExpression");function SFo(t,e,r){if(e===!1)return dk;let n=b9t(t,r);if(n===dk)return dk;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 lze(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(SFo,"parseExpressionPattern");function Dgn(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(Dgn,"aggregateBasenameMatches");function Ngn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return TFo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(Ngn,"validate");function Mgn(t,e){let r=LTe(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(kgn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(Mgn,"matches");function TFo(t){try{let e=LTe(t,",");if(e.length===0)return!1;for(let r of e){let n=S9t(r);if(Pgn(n))return!1}return!0}catch{return!1}}a(TFo,"isValidGlob");var Bgn=he(require("path"));var jh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var I9t=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 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(){return this.isBuiltIn||this.promptFileEntry.promptPath.storage==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},Lgn={name:"copilot-instructions",source:jh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},Fgn={name:"git-commit-instructions",source:jh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},Ugn={name:"agents-md-instructions",source:jh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},IFo={name:"nested-agents-md-instructions",source:jh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},Qgn={name:"claude-md-instructions",source:jh.claudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},xFo={name:"nested-claude-md-instructions",source:jh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},wFo=[Lgn,Fgn,Ugn,IFo,Qgn,xFo],RFo={name:"instruction-file",source:jh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},T9t={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},PFo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function Ogn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(Ogn,"optionKey");function x9t(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=Ogn(n);if(!(o in T9t)||(r=!0,!(e[o]??T9t[o])))continue;let c=PFo[n];if(c){let l=Ogn(c);if(!(e[l]??T9t[l]))continue}return!0}return r?!1:void 0}a(x9t,"shouldIncludeSource");var w9t=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)x9t([n],e)!==!1&&r.push(...o);return r}},kFo=new Y7;function DFo(t,e,r,n){if(!t)return;let o=`${K7}${e}`,s=kFo.parse(o,t),c=s.body?.content??t;if(c.trim())return{matchKind:r,uri:o,name:s.header?.name??e,applyTo:s.header?.applyTo||void 0,description:s.header?.description,content:c,isReadonly:!0,isBuiltIn:!1,source:[n]}}a(DFo,"resolveContent");var FY=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 m of this.configsByKey.values())o.push(...m);let{name:s,matchKind:c,source:l}=this.descriptor,u=o.filter(m=>m.type==="content").map(m=>{let g=m.content?.trim();return g?DFo(g,`global-${s}`,c,l):void 0}).filter(m=>m!==void 0);this.manager.set(l,u);let d={source:l,matchKind:c},f=this.descriptor.globSuffix??"",h=new Set;for(let m of this.descriptor.defaultRegistration??[])h.add(m);for(let m of o)m.type==="location"?h.add(Bgn.default.posix.join(m.path,f)):m.type==="file"&&h.add(Wn(m.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(h),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:d})}};function NFo(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(NFo,"stripSource");var MFo="workspace",df=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new w9t;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[jh.copilotInstructions,new FY(Lgn,this.inMemoryManager,n)],[jh.gitCommitInstructions,new FY(Fgn,this.inMemoryManager,n)],[jh.agentsMdInstructions,new FY(Ugn,this.inMemoryManager,n)],[jh.claudeMdInstructions,new FY(Qgn,this.inMemoryManager,n)],[jh.customInstructionFiles,new FY(RFo,this.inMemoryManager,n)]]);for(let o of wFo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind}});this.slotsBySource.get(jh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e){return(await this.ctx.get(zm).collect(this.ctx,"instructions",e)).map(n=>new I9t(n))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=MFo){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{Dr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(NFo(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(` ${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."} @@ -2569,21 +2525,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=oyn(n);return o.isValid&&!!syn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=CUt(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&&CUt(o.source,r)!==void 0).length;gt(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function jQ(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(jQ,"weighElidableList");p();function pyn(t){let e=t.split(` -`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([yS(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([yS(o.join(` -`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(pyn,"fromMessage");function ale(t){let e=SUt(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=Ngn(n);return o.isValid&&!!Mgn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=x9t(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&&x9t(o.source,r)!==void 0).length;_t(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function IQ(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(IQ,"weighElidableList");p();function qgn(t){let e=t.split(` +`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([uS(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([uS(o.join(` +`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(qgn,"fromMessage");function Uce(t){let e=P9t(t),r=[];for(let n=0;n1&&n!==e.length-1?` -`:"")),r.push(pyn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[jQ(r,"inverseLinear"),1]]):null}a(ale,"fromHistory");var mUo=5;function SUt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&In(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,mUo).reverse()}a(SUt,"filterTurns");function hyn(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=In(t.message).startsWith("```")?` -`:" ";return`${e>0?`${e}) `:""}${r}:${n}${In(t.message)}`}a(hyn,"formatTurnMessage");p();p();p();var gUo=4,TUt={skillIds:[]},Jze=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 Uo.getModelConfiguration(e.ctx,"meta",void 0,{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(dA).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"&&(Ye.error(this.ctx,"Failed to fetch prompt context, trying again..."),m=await this.chatFetcher.fetchResponse(h,n,f)),await e.ctx.get(Uh).inspectFetchResult(m),this.handleResult(m,f,In(c),s,d.toolConfig)}else return TUt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),TUt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,gUo);else return Ye.error(this.ctx,"Missing tool call in meta prompt response"),TUt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return ht(this.ctx,`${Hy(o)}.metaPrompt`,u,0),ht(this.ctx,`${Hy(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});ht(this.ctx,"conversation.promptContextError",n,1)}};p();p();var ZM=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([Ws(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!cle(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:yS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||cle(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(qgn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[IQ(r,"inverseLinear"),1]]):null}a(Uce,"fromHistory");var OFo=5;function P9t(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Rn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,OFo).reverse()}a(P9t,"filterTurns");function jgn(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=Rn(t.message).startsWith("```")?` +`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Rn(t.message)}`}a(jgn,"formatTurnMessage");p();p();p();var BFo=4,k9t={skillIds:[]},yze=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 Jo.getModelConfiguration(e.ctx,"meta",void 0,{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(hA).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(Uh).inspectFetchResult(m),this.handleResult(m,f,Rn(c),s,d.toolConfig)}else return k9t}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),k9t;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,BFo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),k9t;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return yt(this.ctx,`${Gy(o)}.metaPrompt`,u,0),yt(this.ctx,`${Gy(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});yt(this.ctx,"conversation.promptContextError",n,1)}};p();p();var qM=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([sa(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!Qce(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:uS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||Qce(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 cle(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(cle,"isEmptyRange");p();p();var myn=ce(ti()),gyn=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({}))}),IUt;(r=>(r.method="github/didChangeAuth",r.type=new myn.ProtocolNotificationType(r.method)))(IUt||={});p();var Ayn=ce(ti()),xUt;(r=>(r.method="copilot/ipCodeCitation",r.type=new Ayn.NotificationType(r.method)))(xUt||={});p();var yyn=ce(ti()),Zze;(r=>(r.method="context/update",r.type=new yyn.ProtocolRequestType(r.method)))(Zze||={});p();p();p();var qn=ce(ti()),dIe=S.String(),Rv=S.Object({uri:dIe}),nK=S.Intersect([Rv,S.Object({version:S.Optional(S.Integer())})]),gWu=S.Required(nK),rg=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),hf=S.Object({start:rg,end:rg}),wUt=S.Union([S.Integer(),S.String()]),AWu=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Eyn=ce(ti()),RUt;(r=>(r.method="textDocument/didFocus",r.type=new Eyn.ProtocolNotificationType(r.method)))(RUt||={});p();var AUo=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()}),yUo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),_yn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),Cyn=S.Object({editorInfo:S.Optional(_yn),editorPluginInfo:S.Optional(_yn),relatedPluginInfo:S.Optional(S.Array(yUo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(AUo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var fIe=ce(ti());var kUt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(kUt||{}),EUo=S.Enum(kUt),_Uo=S.Object({triggerKind:EUo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:hf,tooltipSignature:S.Optional(S.String())}))}),vyn=S.Object({textDocument:nK,position:rg,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:_Uo,data:S.Optional(S.Unknown())}),PUt;(r=>(r.method="textDocument/inlineCompletion",r.type=new fIe.ProtocolRequestType(r.method)))(PUt||={});var byn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Syn=S.Object({item:byn}),DUt;(r=>(r.method="textDocument/didShowCompletion",r.type=new fIe.ProtocolNotificationType(r.method)))(DUt||={});var Tyn=S.Object({item:byn,acceptedLength:S.Integer({minimum:1})}),NUt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new fIe.ProtocolNotificationType(r.method)))(NUt||={});p();var Iyn=ce(ti()),CUo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Iyn.ProtocolRequestType(r.method)))(CUo||={});p();var xyn=ce(ti()),vUo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:hf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),wyn=S.Object({textDocument:nK,position:rg,diagnostics:S.Optional(S.Array(vUo))}),bUo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Ryn=S.Object({item:bUo}),MUt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new xyn.ProtocolNotificationType(r.method)))(MUt||={});p();var Xze=ce(ti());var kyn=S.Object({textDocument:nK,position:rg,partialResultToken:S.Optional(wUt),workDoneToken:S.Optional(wUt)}),eYe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new Xze.ProtocolRequestType(n.method),n.partialResult=new Xze.ProgressType))(eYe||={});p();var Pyn=ce(ti()),OUt;(r=>(r.method="copilot/related",r.type=new Pyn.ProtocolRequestType(r.method)))(OUt||={});p();var BUt=ce(ti()),LUt;(r=>(r.method="statusNotification",r.type=new BUt.ProtocolNotificationType(r.method)))(LUt||={});var FUt;(r=>(r.method="didChangeStatus/v2",r.type=new BUt.ProtocolNotificationType(r.method)))(FUt||={});var Dyn=ce(require("path"));var Nyn=S.Object({uri:S.String(),visibleRange:S.Optional(hf),selection:S.Optional(hf)}),UUt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(Jn),n=await r.getOrReadTextDocument(e),o=zu(n);if(await this.turnContext.collectFile(Vy,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new ZM(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(cle(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 \`${Dyn.basename(e.uri)}\` is content excluded.`])}},Vy="current-editor",tYe=class{constructor(e){this._resolver=e;this.id=Vy;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 UUt(e)}};p();var Myn=S.Object({labels:S.Array(S.String())}),QUt=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(EP,n)}),new Ar(r)}},EP="project-labels",rYe=class{constructor(e){this._resolver=e;this.id=EP;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 QUt(e)}};p();p();p();var nYe=class{constructor(){this.languageId=["java","kotlin","scala","groovy"]}static{a(this,"JavaProjectMetadataLookup")}determineBuildTools(e){return[...e.buildTools]}determineApplicationFrameworks(e){let r=[];return be(e,r,"org.springframework.boot","Spring Boot"),be(e,r,"jakarta.jakartaee-api","Jakarta EE"),be(e,r,"javax:javaee-api","Java EE"),be(e,r,"org.apache.struts:struts2-core","Apache Struts"),be(e,r,"org.hibernate:hibernate-core","Hibernate"),be(e,r,"org.apache.wicket:wicket-core","Apache Wicket"),be(e,r,"javax.faces:jsf-api","JSF"),be(e,r,"org.grails:grails-core","Grails"),r}determineCoreLibraries(e){let r=[];return be(e,r,"com.google.guava","Google Guava"),be(e,r,"org.apache.commons:commons-lang3","Apache Commons Lang"),be(e,r,"org.apache.commons:commons-io","Apache Commons IO"),be(e,r,"joda-time:joda-time","Joda-Time"),be(e,r,"com.google.code.gson:gson","Google Gson"),be(e,r,"org.apache.commons:commons-math3","Apache Commons Math"),be(e,r,"org.apache.commons:commons-collections4","Apache Commons Collections"),be(e,r,"org.apache.commons:commons-net","Apache Commons Net"),be(e,r,"org.apache.poi:poi","Apache POI"),be(e,r,"com.fasterxml.jackson.core:jackson-databind","Jackson"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"org.junit.jupiter:junit-jupiter","JUnit"),be(e,r,"junit:junit","JUnit"),be(e,r,"org.testng:testng","TestNG"),be(e,r,"org.spockframework:spock-core","Spock"),be(e,r,"io.cucumber:cucumber-java","Cucumber"),be(e,r,"org.jboss.arquillian.junit:arquillian-junit-container","Arquillian"),r}determineTestingLibraries(e){let r=[];return be(e,r,"org.mockito","Mockito"),be(e,r,"org.assertj","AssertJ"),be(e,r,"org.hamcrest","Hamcrest"),be(e,r,"org.powermock","PowerMock"),be(e,r,"org.jmock","JMock"),be(e,r,"org.easymock","EasyMock"),be(e,r,"org.jmockit:jmockit","JMockit"),be(e,r,"com.github.tomakehurst:wiremock","WireMock"),be(e,r,"org.dbunit:dbunit","DBUnit"),be(e,r,"com.icegreen:greenmail","GreenMail"),be(e,r,"net.sourceforge.htmlunit:htmlunit","HtmlUnit"),be(e,r,"org.seleniumhq.selenium:selenium-java","Selenium"),be(e,r,"io.rest-assured:rest-assured","Rest-Assured"),be(e,r,"io.gatling.highcharts:gatling-charts-highcharts","Gatling"),be(e,r,"org.apache.jmeter:ApacheJMeter","JMeter"),r}},iYe=class{constructor(){this.languageId=["javascript","javascriptreact","typescript","typescriptreact","vue"]}static{a(this,"JavaScriptProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"@types/node","Node.js"),be(e,r,"react-native","React Native"),r.find(n=>n.name==="React Native")||be(e,r,"react","React"),be(e,r,"angular","Angular"),be(e,r,"vue","Vue.js"),be(e,r,"ember","Ember.js"),be(e,r,"backbone","Backbone.js"),be(e,r,"meteor","Meteor"),be(e,r,"polymer","Polymer"),be(e,r,"aurelia","Aurelia"),be(e,r,"knockout","Knockout.js"),be(e,r,"dojo","Dojo Toolkit"),be(e,r,"mithril","Mithril.js"),be(e,r,"marionette","Marionette.js"),be(e,r,"marko","Marko.js"),be(e,r,"svelte","Svelte"),be(e,r,"hyperapp","Hyperapp"),be(e,r,"inferno","Inferno.js"),be(e,r,"preact","Preact"),be(e,r,"riot","Riot.js"),be(e,r,"moon","Moon.js"),be(e,r,"stencil","Stencil.js"),r}determineCoreLibraries(e){let r=[];return be(e,r,"lodash","Lodash"),be(e,r,"moment","Moment.js"),be(e,r,"axios","Axios"),be(e,r,"redux","Redux"),be(e,r,"recoil","Recoil"),be(e,r,"jquery","jQuery"),be(e,r,"d3","D3.js"),be(e,r,"underscore","Underscore.js"),be(e,r,"ramda","Ramda"),be(e,r,"immutable","Immutable.js"),be(e,r,"rxjs","RxJS"),be(e,r,"three","Three.js"),be(e,r,"socket.io","Socket.IO"),be(e,r,"express","Express.js"),be(e,r,"next","Next.js"),be(e,r,"puppeteer","Puppeteer"),be(e,r,"cheerio","Cheerio"),be(e,r,"nodemailer","Nodemailer"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"jest","Jest"),be(e,r,"mocha","Mocha"),be(e,r,"jasmine","Jasmine"),be(e,r,"ava","AVA"),be(e,r,"qunit","QUnit"),be(e,r,"tape","Tape"),r}determineTestingLibraries(e){let r=[];return be(e,r,"chai","Chai"),be(e,r,"sinon","Sinon"),be(e,r,"enzyme","Enzyme"),be(e,r,"protractor","Protractor"),be(e,r,"supertest","Supertest"),be(e,r,"nock","Nock"),be(e,r,"cypress","Cypress"),be(e,r,"@testing-library/react","React Testing Library"),r}},oYe=class{constructor(){this.languageId="go"}static{a(this,"GoProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"github.com/gorilla/mux","Gorilla Mux"),be(e,r,"github.com/go-chi/chi","Chi"),be(e,r,"github.com/gin-gonic/gin","Gin"),be(e,r,"github.com/labstack/echo","Echo"),be(e,r,"github.com/revel/revel","Revel"),be(e,r,"github.com/astaxie/beego","Beego"),be(e,r,"github.com/go-martini/martini","Martini"),be(e,r,"github.com/gobuffalo/buffalo","Buffalo"),be(e,r,"github.com/goji/goji","Goji"),be(e,r,"github.com/hoisie/web","Web.go"),r}determineCoreLibraries(e){let r=[];return be(e,r,"net/http","net/http"),be(e,r,"fmt","fmt"),be(e,r,"io","io"),be(e,r,"time","time"),be(e,r,"math","math"),be(e,r,"strconv","strconv"),be(e,r,"strings","strings"),be(e,r,"sort","sort"),be(e,r,"encoding/json","encoding/json"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"github.com/onsi/ginkgo","ginkgo"),be(e,r,"github.com/onsi/gomega","gomega"),be(e,r,"github.com/stretchr/testify","testify"),be(e,r,"gopkg.in/check.v1","gocheck"),be(e,r,"github.com/franela/goblin","goblin"),be(e,r,"github.com/DATA-DOG/godog","godog"),be(e,r,"github.com/stesla/gospec","gospec"),be(e,r,"github.com/rjeczalik/gotest","gotest"),be(e,r,"github.com/smartystreets/goconvey","goconvey"),r}determineTestingLibraries(e){let r=[];return be(e,r,"github.com/stretchr/testify","Testify"),be(e,r,"github.com/smartystreets/goconvey","GoConvey"),be(e,r,"github.com/onsi/ginkgo","Ginkgo"),be(e,r,"github.com/golang/mock","GoMock"),be(e,r,"gopkg.in/check.v1","GoCheck"),be(e,r,"github.com/franela/goblin","Goblin"),be(e,r,"github.com/DATA-DOG/godog","GoDog"),be(e,r,"github.com/onsi/gomega","Gomega"),be(e,r,"github.com/stesla/gospec","GoSpec"),be(e,r,"github.com/rjeczalik/gotest","GoTest"),r}},sYe=class{constructor(){this.languageId=["python","jupyter"]}static{a(this,"PythonProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"flask","Flask"),be(e,r,"django","Django"),be(e,r,"pyramid","Pyramid"),be(e,r,"tornado","Tornado"),be(e,r,"fastapi","FastAPI"),r}determineCoreLibraries(e){let r=[];return be(e,r,"requests","requests"),be(e,r,"numpy","numpy"),be(e,r,"pandas","pandas"),be(e,r,"scipy","scipy"),be(e,r,"matplotlib","matplotlib"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"pytest","Pytest"),be(e,r,"unittest","Unittest"),be(e,r,"doctest","Doctest"),be(e,r,"nose","Nose"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mock","Mock"),be(e,r,"hypothesis","Hypothesis"),be(e,r,"behave","Behave"),be(e,r,"lettuce","Lettuce"),be(e,r,"testify","Testify"),be(e,r,"pyhamcrest","PyHamcrest"),r}},aYe=class{constructor(){this.languageId=["php","blade"]}static{a(this,"PhpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"laravel/framework","Laravel"),be(e,r,"symfony/symfony","Symfony"),be(e,r,"slim/slim","Slim"),be(e,r,"cakephp/cakephp","CakePHP"),be(e,r,"yiisoft/yii2","Yii"),be(e,r,"zendframework/zendframework","Zend Framework"),be(e,r,"phalcon/cphalcon","Phalcon"),be(e,r,"bcosca/fatfree","Fat-Free"),be(e,r,"fuel/fuel","FuelPHP"),be(e,r,"phpixie/framework","PHPixie"),r}determineCoreLibraries(e){let r=[];return be(e,r,"monolog/monolog","Monolog"),be(e,r,"vlucas/phpdotenv","PHP dotenv"),be(e,r,"symfony/console","Symfony Console"),be(e,r,"guzzlehttp/guzzle","GuzzleHttp"),be(e,r,"ramsey/uuid","Ramsey UUID"),be(e,r,"doctrine/orm","Doctrine ORM"),be(e,r,"php-di/php-di","PHP-DI"),be(e,r,"phpunit/php-timer","PHPUnit Timer"),be(e,r,"symfony/finder","Symfony Finder"),be(e,r,"symfony/yaml","Symfony Yaml"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"phpunit/phpunit","PHPUnit"),be(e,r,"behat/behat","Behat"),be(e,r,"phpspec/phpspec","PHPSpec"),be(e,r,"codeception/codeception","Codeception"),be(e,r,"atoum/atoum","Atoum"),be(e,r,"pestphp/pest","PestPHP"),be(e,r,"kahlan/kahlan","Kahlan"),be(e,r,"peridot-php/peridot","Peridot"),be(e,r,"phake/phake","Phake"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mockery/mockery","Mockery"),be(e,r,"php-mock/php-mock","PHP-Mock"),be(e,r,"php-mock/php-mock-phpunit","PHP-Mock PHPUnit"),be(e,r,"padraic/mockery","Padraic Mockery"),be(e,r,"phpspec/prophecy","PHPSpec Prophecy"),be(e,r,"phpunit/php-invoker","PHPUnit Invoker"),be(e,r,"phpunit/php-token-stream","PHPUnit Token Stream"),be(e,r,"phpunit/php-code-coverage","PHPUnit Code Coverage"),be(e,r,"phpunit/php-timer","PHPUnit Timer"),be(e,r,"phpunit/php-text-template","PHPUnit Text Template"),r}},cYe=class{constructor(){this.languageId="csharp"}static{a(this,"CSharpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"Microsoft.NETCore.App",".NET Core"),be(e,r,"Microsoft.AspNetCore.App","ASP.NET Core"),r}determineCoreLibraries(e){let r=[];return be(e,r,"EntityFramework","Entity Framework"),be(e,r,"Newtonsoft.Json","Newtonsoft.Json"),be(e,r,"AutoMapper","AutoMapper"),be(e,r,"Serilog","Serilog"),be(e,r,"Dapper","Dapper"),be(e,r,"Polly","Polly"),be(e,r,"FluentValidation","FluentValidation"),be(e,r,"MediatR","MediatR"),be(e,r,"Hangfire","Hangfire"),be(e,r,"RabbitMQ.Client","RabbitMQ.Client"),be(e,r,"MassTransit","MassTransit"),be(e,r,"Microsoft.Extensions.Logging","Microsoft.Extensions.Logging"),be(e,r,"Microsoft.Extensions.DependencyInjection","Microsoft.Extensions.DependencyInjection"),be(e,r,"Microsoft.Extensions.Configuration","Microsoft.Extensions.Configuration"),be(e,r,"Microsoft.Extensions.Http","Microsoft.Extensions.Http"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"xunit","xUnit"),be(e,r,"NUnit","NUnit"),be(e,r,"SpecFlow","SpecFlow"),r}determineTestingLibraries(e){let r=[];return be(e,r,"Moq","Moq"),be(e,r,"FluentAssertions","FluentAssertions"),be(e,r,"Bogus","Bogus"),be(e,r,"RestSharp","RestSharp"),be(e,r,"Swashbuckle.AspNetCore","Swashbuckle.AspNetCore"),r}},lYe=class{constructor(){this.languageId="dart"}static{a(this,"DartProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"flutter","Flutter"),be(e,r,"angular","AngularDart"),r}determineCoreLibraries(e){let r=[];return be(e,r,"dartx","dartx"),be(e,r,"provider","Provider"),be(e,r,"rxdart","RxDart"),be(e,r,"dio","Dio"),be(e,r,"json_serializable","json_serializable"),be(e,r,"freezed","Freezed"),be(e,r,"moor","Moor"),be(e,r,"hive","Hive"),be(e,r,"http","http"),be(e,r,"path","path"),be(e,r,"intl","intl"),be(e,r,"equatable","equatable"),be(e,r,"get_it","get_it"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"test","test"),be(e,r,"flutter_test","flutter_test"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mockito","mockito"),be(e,r,"bloc_test","bloc_test"),r}},uYe=class{constructor(){this.languageId="ruby"}static{a(this,"RubyProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"rails","Rails"),be(e,r,"sinatra","Sinatra"),be(e,r,"hanami","Hanami"),be(e,r,"grape","Grape"),be(e,r,"roda","Roda"),be(e,r,"padrino","Padrino"),be(e,r,"cuba","Cuba"),be(e,r,"ramaze","Ramaze"),be(e,r,"nyara","Nyara"),be(e,r,"rack","Rack"),r}determineCoreLibraries(e){let r=[];return be(e,r,"active_record","ActiveRecord"),be(e,r,"sequel","Sequel"),be(e,r,"rom","ROM"),be(e,r,"datamapper","DataMapper"),be(e,r,"mongoid","Mongoid"),be(e,r,"neo4j","Neo4j"),be(e,r,"redis","Redis"),be(e,r,"cassandra","Cassandra"),be(e,r,"couchrest","CouchRest"),be(e,r,"riak","Riak"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"rspec","RSpec"),be(e,r,"minitest","Minitest"),be(e,r,"cucumber","Cucumber"),be(e,r,"spinach","Spinach"),be(e,r,"turnip","Turnip"),be(e,r,"bacon","Bacon"),be(e,r,"shoulda","Shoulda"),be(e,r,"test-unit","Test::Unit"),be(e,r,"wrong","Wrong"),be(e,r,"contest","Contest"),r}determineTestingLibraries(e){let r=[];return be(e,r,"factory_bot","FactoryBot"),be(e,r,"faker","Faker"),be(e,r,"ffaker","FFaker"),be(e,r,"fabrication","Fabrication"),be(e,r,"machinist","Machinist"),be(e,r,"mocha","Mocha"),be(e,r,"flexmock","FlexMock"),be(e,r,"rr","RR"),be(e,r,"bourne","Bourne"),be(e,r,"not_a_mock","NotAMock"),r}},dYe=class{constructor(){this.languageId="rust"}static{a(this,"RustProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"tokio","tokio"),be(e,r,"async-std","async-std"),be(e,r,"hyper","hyper"),be(e,r,"actix-web","actix-web"),be(e,r,"rocket","rocket"),r}determineCoreLibraries(e){let r=[];return be(e,r,"serde","serde"),be(e,r,"regex","regex"),be(e,r,"rand","rand"),be(e,r,"log","log"),be(e,r,"lazy_static","lazy_static"),be(e,r,"libc","libc"),be(e,r,"futures","futures"),be(e,r,"rayon","rayon"),be(e,r,"reqwest","reqwest"),be(e,r,"warp","warp"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"test-case","test-case"),be(e,r,"proptest","proptest"),be(e,r,"quickcheck","quickcheck"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mockall","mockall"),be(e,r,"double","double"),be(e,r,"rstest","rstest"),be(e,r,"mockiato","mockiato"),be(e,r,"mock_derive","mock_derive"),be(e,r,"mocktopus","mocktopus"),be(e,r,"mockers","mockers"),be(e,r,"mock_it","mock_it"),r}},fYe=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 be(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(be,"addFromLibraries");var pYe=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 Byn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Byn,"determineProgrammingLanguage");var Oyn=[new nYe,new iYe,new oYe,new sYe,new aYe,new cYe,new lYe,new uYe,new dYe,new fYe];function Lyn(t){let e=Oyn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new pYe(t,Oyn);return new qUt(e)}a(Lyn,"getMetadataLookup");var qUt=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 Fyn=S.Object({name:S.String(),version:S.Optional(S.String())}),Uyn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(Fyn),buildTools:S.Array(Fyn)}),jUt=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=Lyn(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=Byn(e);this.turnContext.collectLabel(XM,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(XM,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` +`)}};function Qce(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(Qce,"isEmptyRange");p();p();var Hgn=he(ti()),Ggn=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({}))}),D9t;(r=>(r.method="github/didChangeAuth",r.type=new Hgn.ProtocolNotificationType(r.method)))(D9t||={});p();var $gn=he(ti()),N9t;(r=>(r.method="copilot/ipCodeCitation",r.type=new $gn.NotificationType(r.method)))(N9t||={});p();var Vgn=he(ti()),Eze;(r=>(r.method="context/update",r.type=new Vgn.ProtocolRequestType(r.method)))(Eze||={});p();p();p();var qn=he(ti()),FTe=S.String(),bC=S.Object({uri:FTe}),UY=S.Intersect([bC,S.Object({version:S.Optional(S.Integer())})]),xHu=S.Required(UY),ng=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),ff=S.Object({start:ng,end:ng}),M9t=S.Union([S.Integer(),S.String()]),wHu=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Wgn=he(ti()),O9t;(r=>(r.method="textDocument/didFocus",r.type=new Wgn.ProtocolNotificationType(r.method)))(O9t||={});p();var LFo=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()}),FFo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),zgn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),Ygn=S.Object({editorInfo:S.Optional(zgn),editorPluginInfo:S.Optional(zgn),relatedPluginInfo:S.Optional(S.Array(FFo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(LFo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var UTe=he(ti());var B9t=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(B9t||{}),UFo=S.Enum(B9t),QFo=S.Object({triggerKind:UFo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:ff,tooltipSignature:S.Optional(S.String())}))}),Kgn=S.Object({textDocument:UY,position:ng,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:QFo,data:S.Optional(S.Unknown())}),L9t;(r=>(r.method="textDocument/inlineCompletion",r.type=new UTe.ProtocolRequestType(r.method)))(L9t||={});var Jgn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Zgn=S.Object({item:Jgn}),F9t;(r=>(r.method="textDocument/didShowCompletion",r.type=new UTe.ProtocolNotificationType(r.method)))(F9t||={});var Xgn=S.Object({item:Jgn,acceptedLength:S.Integer({minimum:1})}),U9t;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new UTe.ProtocolNotificationType(r.method)))(U9t||={});p();var eAn=he(ti()),qFo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new eAn.ProtocolRequestType(r.method)))(qFo||={});p();var tAn=he(ti()),jFo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:ff,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),rAn=S.Object({textDocument:UY,position:ng,diagnostics:S.Optional(S.Array(jFo))}),HFo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),nAn=S.Object({item:HFo}),Q9t;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new tAn.ProtocolNotificationType(r.method)))(Q9t||={});p();var _ze=he(ti());var iAn=S.Object({textDocument:UY,position:ng,partialResultToken:S.Optional(M9t),workDoneToken:S.Optional(M9t)}),vze;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new _ze.ProtocolRequestType(n.method),n.partialResult=new _ze.ProgressType))(vze||={});p();var oAn=he(ti()),q9t;(r=>(r.method="copilot/related",r.type=new oAn.ProtocolRequestType(r.method)))(q9t||={});p();var j9t=he(ti()),H9t;(r=>(r.method="statusNotification",r.type=new j9t.ProtocolNotificationType(r.method)))(H9t||={});var G9t;(r=>(r.method="didChangeStatus/v2",r.type=new j9t.ProtocolNotificationType(r.method)))(G9t||={});var sAn=he(require("path"));var aAn=S.Object({uri:S.String(),visibleRange:S.Optional(ff),selection:S.Optional(ff)}),$9t=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=zu(n);if(await this.turnContext.collectFile(Vy,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new qM(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(Qce(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 \`${sAn.basename(e.uri)}\` is content excluded.`])}},Vy="current-editor",Cze=class{constructor(e){this._resolver=e;this.id=Vy;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 $9t(e)}};p();var cAn=S.Object({labels:S.Array(S.String())}),V9t=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(fk,n)}),new Ar(r)}},fk="project-labels",bze=class{constructor(e){this._resolver=e;this.id=fk;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 V9t(e)}};p();p();p();var Sze=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}},Tze=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}},Ize=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}},xze=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}},wze=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}},Rze=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}},Pze=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}},kze=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}},Dze=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}},Nze=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 Mze=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 uAn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(uAn,"determineProgrammingLanguage");var lAn=[new Sze,new Tze,new Ize,new xze,new wze,new Rze,new Pze,new kze,new Dze,new Nze];function dAn(t){let e=lAn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new Mze(t,lAn);return new W9t(e)}a(dAn,"getMetadataLookup");var W9t=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 fAn=S.Object({name:S.String(),version:S.Optional(S.String())}),pAn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(fAn),buildTools:S.Array(fAn)}),z9t=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=dAn(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=uAn(e);this.turnContext.collectLabel(jM,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(jM,`${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])}}},XM="project-metadata",hYe=class{constructor(e){this._resolver=e;this.id=XM;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 jUt(e)}};p();var Qyn=ce(require("path"));var HUt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(Jn),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=zu(n);if(await this.turnContext.collectFile(gYe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new ZM(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 \`${Qyn.basename(r.uri)}\` is content excluded.`]),1]]}},GUt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},gYe="references",mYe=class{constructor(){this.id=gYe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new GUt}processor(e){return new HUt(e)}};var iK=a(()=>[XM,EP,gYe,Vy],"mandatorySkills"),lle=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new Jze(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=>!iK().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)&&!iK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!iK().includes(d)))}return l.push(...iK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Vo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Vo).getSupportedSkills(r.id),c=e.get(Qh).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 Px(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...iK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function yYe(t,e){let[r,n,o]=await SUo(t,e);return o.push(...xUo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[jQ(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(yYe,"fromSkills");async function SUo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await wUo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await TUo(t,c.skillId);l&&(iK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(SUo,"handleSkillsInReverse");async function TUo(t,e){let n=t.ctx.get(Qh).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 IUo(t,n,l,d,c,f):[void 0,await AYe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await AYe(t,n,"unresolvable",void 0,c)]}catch(o){if(Ye.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof pIe)throw o;return[void 0,await AYe(t,n,"failed")]}}a(TUo,"safelyProcessSkill");async function IUo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await AYe(t,e,"resolved",c,o,s)]}a(IUo,"handleProcessedSkill");async function AYe(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 FQ(t.ctx),f=await t.ctx.get(Bc).getBestChatModelConfig(hS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=Ss(f.tokenizer).tokenLength(h)}return t.ctx.get(eg).addResolution(t.turn.id,u),u}a(AYe,"determineResolution");function xUo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(xUo,"handleIgnoredSkills");async function wUo(t,e,r){if(e!==XM&&e!==EP)return!0;let n=t.ctx.get(Jt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===XM:e===EP}a(wUo,"includeSkill");var oK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=ale(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 yYe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:qt(e.ctx,je.UseAgentsMd),includeNestedAgentsMdInstructions:qt(e.ctx,je.UseNestedAgentsMd),includeClaudeMdInstructions:qt(e.ctx,je.UseClaudeMd),includeNestedClaudeMdInstructions:qt(e.ctx,je.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(pf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(pf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=RS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` +${o}`]),1])}}},jM="project-metadata",Oze=class{constructor(e){this._resolver=e;this.id=jM;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 z9t(e)}};p();var hAn=he(require("path"));var Y9t=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=zu(n);if(await this.turnContext.collectFile(Lze,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new qM(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 \`${hAn.basename(r.uri)}\` is content excluded.`]),1]]}},K9t=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},Lze="references",Bze=class{constructor(){this.id=Lze;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new K9t}processor(e){return new Y9t(e)}};var QY=a(()=>[jM,fk,Lze,Vy],"mandatorySkills"),qce=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new yze(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=>!QY().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)&&!QY().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!QY().includes(d)))}return l.push(...QY()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(jo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(jo).getSupportedSkills(r.id),c=e.get(Qh).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 Ix(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...QY(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function Uze(t,e){let[r,n,o]=await GFo(t,e);return o.push(...WFo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[IQ(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(Uze,"fromSkills");async function GFo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await zFo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await $Fo(t,c.skillId);l&&(QY().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(GFo,"handleSkillsInReverse");async function $Fo(t,e){let n=t.ctx.get(Qh).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 VFo(t,n,l,d,c,f):[void 0,await Fze(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await Fze(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof QTe)throw o;return[void 0,await Fze(t,n,"failed")]}}a($Fo,"safelyProcessSkill");async function VFo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await Fze(t,e,"resolved",c,o,s)]}a(VFo,"handleProcessedSkill");async function Fze(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 CQ(t.ctx),f=await t.ctx.get(zc).getBestChatModelConfig(sS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=Ds(f.tokenizer).tokenLength(h)}return t.ctx.get(tg).addResolution(t.turn.id,u),u}a(Fze,"determineResolution");function WFo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(WFo,"handleIgnoredSkills");async function zFo(t,e,r){if(e!==jM&&e!==fk)return!0;let n=t.ctx.get(Jt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===jM:e===fk}a(zFo,"includeSkill");var qY=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=Uce(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 Uze(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Gt(e.ctx,Je.UseAgentsMd),includeNestedAgentsMdInstructions:Gt(e.ctx,Je.UseNestedAgentsMd),includeClaudeMdInstructions:Gt(e.ctx,Je.UseClaudeMd),includeNestedClaudeMdInstructions:Gt(e.ctx,Je.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(df).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(df).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=CS(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]}},EYe=class extends oK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return Ws` +`+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]}},Qze=class extends qY{static{a(this,"PanelUserPromptStrategy")}suffix(e){return sa` 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. @@ -2601,7 +2557,7 @@ ${o}`]),1])}}},XM="project-metadata",hYe=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 _Ye=class extends oK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return Ws` + `.trim()}};var qze=class extends qY{static{a(this,"InlineUserPromptStrategy")}suffix(e){return sa` 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. @@ -2656,7 +2612,7 @@ ${o}`]),1])}}},XM="project-metadata",hYe=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 CYe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=ale(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 Ws` + `.trim()}};p();var jze=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=Uce(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 sa` 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. @@ -2665,14 +2621,14 @@ ${o}`]),1])}}},XM="project-metadata",hYe=class{constructor(e){this._resolver=e;t ${e.map(r=>`${this.skillToPrompt(r)} `).join(` `)} - `.trim()}createFunctionArgumentSchema(e){let r=Mmn(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:r3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} + `.trim()}createFunctionArgumentSchema(e){let r=c0n(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:HL(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:Ws` +`)}`),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:sa` This is the user's question: - ${In(o).trim()} - `.trim()}],[]]}};p();var vYe=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=r3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return Ws` + ${Rn(o).trim()} + `.trim()}],[]]}};p();var Hze=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=HL(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return sa` 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. @@ -2688,7 +2644,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=ale(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 RUo=[{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."})}))})}}],bYe=class extends oK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` + `.trim()}elidableContent(e){let r=Uce(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 YFo=[{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."})}))})}}],Gze=class extends qY{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. @@ -2711,39 +2667,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=RS(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:RUo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=r3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!UWe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!UWe(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 $Ut=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function hIe(t,e,r){return new $Ut(t,e,r)}a(hIe,"descriptor");var qyn=[hIe("user",hS("user"),()=>new EYe),hIe("inline",hS("inline"),()=>new _Ye),hIe("meta",hS("meta"),()=>new CYe),hIe("suggestions",hS("suggestions"),()=>new vYe),hIe("synonyms",hS("synonyms"),()=>new bYe)],SYe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await FQ(e),s=hS(r,o),c=qyn.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 qyn}};var Hyn=require("console");var dA=class{constructor(e,r=new SYe){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(Uh).inspectPrompt({type:r.promptType,prompt:jyn(l),tokens:u}),this.ctx.get(eg).addPrompt(e.turn.id,jyn(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,Hyn.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:kUo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,lUt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),lUt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Lr).getEditorInfo().readableName??this.ctx.get(Lr).getEditorInfo().name,o=PUo(process.platform);return FAn(this.ctx,n,r?.login,o,e)}};function kUo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(kUo,"processResultOfElidableText");function jyn(t){return t.map(e=>In(e.content)).join(` +`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=CS(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:YFo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=HL(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!sWe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!sWe(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 J9t=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function qTe(t,e,r){return new J9t(t,e,r)}a(qTe,"descriptor");var mAn=[qTe("user",sS("user"),()=>new Qze),qTe("inline",sS("inline"),()=>new qze),qTe("meta",sS("meta"),()=>new jze),qTe("suggestions",sS("suggestions"),()=>new Hze),qTe("synonyms",sS("synonyms"),()=>new Gze)],$ze=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await CQ(e),s=sS(r,o),c=mAn.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 mAn}};var AAn=require("console");var hA=class{constructor(e,r=new $ze){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(Fr).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(Uh).inspectPrompt({type:r.promptType,prompt:gAn(l),tokens:u}),this.ctx.get(tg).addPrompt(e.turn.id,gAn(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,AAn.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:KFo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,m9t(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),m9t(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Lr).getEditorInfo().readableName??this.ctx.get(Lr).getEditorInfo().name,o=JFo(process.platform);return fgn(this.ctx,n,r?.login,o,e)}};function KFo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(KFo,"processResultOfElidableText");function gAn(t){return t.map(e=>Rn(e.content)).join(` -`)}a(jyn,"debugChatMessages");function PUo(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(PUo,"mapPlatformToOs");var HQ=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await Uo.getModelConfiguration(e.ctx,"suggestions",void 0,{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(dA).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"&&(Ye.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){Ye.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){Ye.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"){Ye.error(this.ctx,"successMultiple response is unexpected for suggestions");return}else if(f.type==="tool_calls"){Ye.error(this.ctx,"tool_calls response is unexpected for suggestions");return}else{Ye.error(this.ctx,`Failed to fetch suggestions due to reason: ${f.reason}`);return}}};p();p();var VUt="v1",_P=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},Dx=class extends _P{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},z0=class extends _P{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},Yf=class extends _P{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},mIe=class extends _P{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var dle=new ge("codingAgentUtils"),ule=29950;function Gyn(t,e,r){if(e.length>=ule)return dle.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${ule}`),e=e.slice(-ule),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=ule){let o=ule-e.length-2;dle.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${ule}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` +`)}a(gAn,"debugChatMessages");function JFo(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(JFo,"mapPlatformToOs");var xQ=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await Jo.getModelConfiguration(e.ctx,"suggestions",void 0,{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(hA).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 Z9t="v1",pk=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},xx=class extends pk{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},z0=class extends pk{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},Kf=class extends pk{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},jTe=class extends pk{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var Hce=new Ee("codingAgentUtils"),jce=29950;function yAn(t,e,r){if(e.length>=jce)return Hce.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${jce}`),e=e.slice(-jce),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=jce){let o=jce-e.length-2;Hce.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${jce}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` -${r}`:""),isTruncated:n}}a(Gyn,"truncatePrompt");function TYe(t){return t.length<=20?t:t.substring(0,20)+"..."}a(TYe,"generateTitleFromUserPrompt");function $yn(t){return`Coding agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a($yn,"formatBodyPlaceholder");function Vyn(t,e,r){let n=t.get(Jn),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),dle.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`;dle.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),dle.debug(t,`Added active editor: ${c}`))}catch(c){dle.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(Vyn,"extractContextPaths");function Wyn(t){return t.length===0?"":`The user has attached the following files from their workspace: +${r}`:""),isTruncated:n}}a(yAn,"truncatePrompt");function Vze(t){return t.length<=20?t:t.substring(0,20)+"..."}a(Vze,"generateTitleFromUserPrompt");function EAn(t){return`Coding agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(EAn,"formatBodyPlaceholder");function _An(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),Hce.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`;Hce.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),Hce.debug(t,`Added active editor: ${c}`))}catch(c){Hce.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(_An,"extractContextPaths");function vAn(t){return t.length===0?"":`The user has attached the following files from their workspace: ${t.map(r=>`- ${r}`).join(` -`)}`}a(Wyn,"formatContextFiles");p();p();var IYe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},Wy=class extends IYe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Pd=class extends IYe{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 WUt=(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))(WUt||{});p();p();p();function GQ(){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(GQ,"getUserAgent");p();p();function xYe(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)=>xYe.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(xYe,"register");p();function zyn(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(zyn,"addHook");p();function Yyn(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(Yyn,"removeHook");var Kyn=Function.bind,Jyn=Kyn.bind(Kyn);function Zyn(t,e,r){let n=Jyn(Yyn,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]=Jyn(zyn,null).apply(null,s)})}a(Zyn,"bindApi");function DUo(){let t=Symbol("Singular"),e={registry:{}},r=xYe.bind(null,e,t);return Zyn(r,e,t),r}a(DUo,"Singular");function NUo(){let t={registry:{}},e=xYe.bind(null,t);return Zyn(e,t),e}a(NUo,"Collection");var Xyn={Singular:DUo,Collection:NUo};p();p();var MUo="0.0.0-development",OUo=`octokit-endpoint.js/${MUo} ${GQ()}`,BUo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":OUo},mediaType:{format:""}};function LUo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(LUo,"lowercaseKeys");function FUo(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(FUo,"isPlainObject");function rEn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{FUo(e[n])?n in t?r[n]=rEn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(rEn,"mergeDeep");function eEn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(eEn,"removeUndefinedProperties");function YUt(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=LUo(r.headers),eEn(r),eEn(r.headers);let n=rEn(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(YUt,"merge");function UUo(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(UUo,"addQueryParameters");var QUo=/\{[^{}}]+\}/g;function qUo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(jUo,"extractUrlVariableNames");function tEn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(tEn,"omit");function nEn(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(nEn,"encodeReserved");function ple(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(ple,"encodeUnreserved");function gIe(t,e,r){return e=t==="+"||t==="#"?nEn(e):ple(e),r?ple(r)+"="+e:e}a(gIe,"encodeValue");function fle(t){return t!=null}a(fle,"isDefined");function zUt(t){return t===";"||t==="&"||t==="?"}a(zUt,"isKeyOperator");function HUo(t,e,r,n){var o=t[r],s=[];if(fle(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(gIe(e,o,zUt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(fle).forEach(function(c){s.push(gIe(e,c,zUt(e)?r:""))}):Object.keys(o).forEach(function(c){fle(o[c])&&s.push(gIe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(fle).forEach(function(l){c.push(gIe(e,l))}):Object.keys(o).forEach(function(l){fle(o[l])&&(c.push(ple(l)),c.push(gIe(e,o[l].toString())))}),zUt(e)?s.push(ple(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?fle(o)&&s.push(ple(r)):o===""&&(e==="&"||e==="?")?s.push(ple(r)+"="):o===""&&s.push("");return s}a(HUo,"getValues");function GUo(t){return{expand:$Uo.bind(null,t)}}a(GUo,"parseUrl");function $Uo(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(HUo(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 nEn(s)}),t==="/"?t:t.replace(/\/$/,"")}a($Uo,"expand");function iEn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=tEn(t,["method","baseUrl","url","headers","request","mediaType"]),c=jUo(r);r=GUo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=tEn(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=UUo(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(iEn,"parse");function VUo(t,e,r){return iEn(YUt(t,e,r))}a(VUo,"endpointWithDefaults");function oEn(t,e){let r=YUt(t,e),n=VUo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:oEn.bind(null,r),merge:YUt.bind(null,r),parse:iEn})}a(oEn,"withDefaults");var sEn=oEn(null,BUo);var EEn=ce(uEn(),1);p();var WUo=/^-?\d+$/,pEn=/^-?\d+n+$/,KUt=JSON.stringify,dEn=JSON.parse,zUo=/^-?\d+n$/,YUo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,KUo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,hEn=a((t,e,r)=>"rawJSON"in JSON?KUt(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?KUt(t,(c,l)=>typeof l=="string"&&pEn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(YUo,"$1$2$3").replace(KUo,"$1$2$3"):KUt(t,e,r),"JSONStringify"),PYe=new Map,JUo=a(()=>{let t=JSON.parse.toString();if(PYe.has(t))return PYe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return PYe.set(t,e),e}catch{return PYe.set(t,!1),!1}},"isContextSourceSupported"),ZUo=a((t,e,r,n)=>typeof e=="string"&&zUo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&pEn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),XUo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return dEn(t,e);if(JUo())return XUo(t,e);let r=t.replace(e7o,(n,o,s,c)=>{let l=n[0]==='"';if(l&&t7o.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthZUo(n,o,s,e))},"JSONParse");p();var aK=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 yEn(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=i7o(t.body)||Array.isArray(t.body)?hEn(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 aK(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 aK(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await JUt(c),new aK("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await JUt(c),new aK(s7o(f.data),l,{response:f,request:t});return f.data=n?await JUt(c):c.body,f}a(yEn,"fetchWrapper");async function JUt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(AEn);let r=(0,EEn.safeParse)(e);if(o7o(r)){let n="";try{return n=await t.text(),gEn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(AEn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(JUt,"getResponseData");function o7o(t){return t.type==="application/json"||t.type==="application/scim+json"}a(o7o,"isJSONResponse");function s7o(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(s7o,"toErrorMessage");function ZUt(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 yEn(r.parse(c));let l=a((u,d)=>yEn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:ZUt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:ZUt.bind(null,r)})}a(ZUt,"withDefaults");var yIe=ZUt(sEn,n7o);p();var a7o="0.0.0-development";function c7o(t){return`Request failed due to following response errors: +`)}`}a(vAn,"formatContextFiles");p();p();var Wze=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},Wy=class extends Wze{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Rd=class extends Wze{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 X9t=(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))(X9t||{});p();p();p();function wQ(){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(wQ,"getUserAgent");p();p();function zze(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)=>zze.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(zze,"register");p();function CAn(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(CAn,"addHook");p();function bAn(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(bAn,"removeHook");var SAn=Function.bind,TAn=SAn.bind(SAn);function IAn(t,e,r){let n=TAn(bAn,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]=TAn(CAn,null).apply(null,s)})}a(IAn,"bindApi");function ZFo(){let t=Symbol("Singular"),e={registry:{}},r=zze.bind(null,e,t);return IAn(r,e,t),r}a(ZFo,"Singular");function XFo(){let t={registry:{}},e=zze.bind(null,t);return IAn(e,t),e}a(XFo,"Collection");var xAn={Singular:ZFo,Collection:XFo};p();p();var e8o="0.0.0-development",t8o=`octokit-endpoint.js/${e8o} ${wQ()}`,r8o={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":t8o},mediaType:{format:""}};function n8o(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(n8o,"lowercaseKeys");function i8o(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(i8o,"isPlainObject");function PAn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{i8o(e[n])?n in t?r[n]=PAn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(PAn,"mergeDeep");function wAn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(wAn,"removeUndefinedProperties");function tUt(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=n8o(r.headers),wAn(r),wAn(r.headers);let n=PAn(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(tUt,"merge");function o8o(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(o8o,"addQueryParameters");var s8o=/\{[^{}}]+\}/g;function a8o(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(c8o,"extractUrlVariableNames");function RAn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(RAn,"omit");function kAn(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(kAn,"encodeReserved");function $ce(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a($ce,"encodeUnreserved");function HTe(t,e,r){return e=t==="+"||t==="#"?kAn(e):$ce(e),r?$ce(r)+"="+e:e}a(HTe,"encodeValue");function Gce(t){return t!=null}a(Gce,"isDefined");function eUt(t){return t===";"||t==="&"||t==="?"}a(eUt,"isKeyOperator");function l8o(t,e,r,n){var o=t[r],s=[];if(Gce(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(HTe(e,o,eUt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(Gce).forEach(function(c){s.push(HTe(e,c,eUt(e)?r:""))}):Object.keys(o).forEach(function(c){Gce(o[c])&&s.push(HTe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(Gce).forEach(function(l){c.push(HTe(e,l))}):Object.keys(o).forEach(function(l){Gce(o[l])&&(c.push($ce(l)),c.push(HTe(e,o[l].toString())))}),eUt(e)?s.push($ce(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?Gce(o)&&s.push($ce(r)):o===""&&(e==="&"||e==="?")?s.push($ce(r)+"="):o===""&&s.push("");return s}a(l8o,"getValues");function u8o(t){return{expand:d8o.bind(null,t)}}a(u8o,"parseUrl");function d8o(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(l8o(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 kAn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(d8o,"expand");function DAn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=RAn(t,["method","baseUrl","url","headers","request","mediaType"]),c=c8o(r);r=u8o(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=RAn(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=o8o(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(DAn,"parse");function f8o(t,e,r){return DAn(tUt(t,e,r))}a(f8o,"endpointWithDefaults");function NAn(t,e){let r=tUt(t,e),n=f8o.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:NAn.bind(null,r),merge:tUt.bind(null,r),parse:DAn})}a(NAn,"withDefaults");var MAn=NAn(null,r8o);var WAn=he(FAn(),1);p();var p8o=/^-?\d+$/,qAn=/^-?\d+n+$/,rUt=JSON.stringify,UAn=JSON.parse,h8o=/^-?\d+n$/,m8o=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,g8o=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,jAn=a((t,e,r)=>"rawJSON"in JSON?rUt(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?rUt(t,(c,l)=>typeof l=="string"&&qAn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(m8o,"$1$2$3").replace(g8o,"$1$2$3"):rUt(t,e,r),"JSONStringify"),Zze=new Map,A8o=a(()=>{let t=JSON.parse.toString();if(Zze.has(t))return Zze.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return Zze.set(t,e),e}catch{return Zze.set(t,!1),!1}},"isContextSourceSupported"),y8o=a((t,e,r,n)=>typeof e=="string"&&h8o.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&qAn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),E8o=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return UAn(t,e);if(A8o())return E8o(t,e);let r=t.replace(_8o,(n,o,s,c)=>{let l=n[0]==='"';if(l&&v8o.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthy8o(n,o,s,e))},"JSONParse");p();var HY=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 VAn(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=S8o(t.body)||Array.isArray(t.body)?jAn(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 HY(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 HY(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await nUt(c),new HY("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await nUt(c),new HY(I8o(f.data),l,{response:f,request:t});return f.data=n?await nUt(c):c.body,f}a(VAn,"fetchWrapper");async function nUt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch($An);let r=(0,WAn.safeParse)(e);if(T8o(r)){let n="";try{return n=await t.text(),GAn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch($An):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(nUt,"getResponseData");function T8o(t){return t.type==="application/json"||t.type==="application/scim+json"}a(T8o,"isJSONResponse");function I8o(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(I8o,"toErrorMessage");function iUt(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 VAn(r.parse(c));let l=a((u,d)=>VAn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:iUt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:iUt.bind(null,r)})}a(iUt,"withDefaults");var $Te=iUt(MAn,b8o);p();var x8o="0.0.0-development";function w8o(t){return`Request failed due to following response errors: `+t.errors.map(e=>` - ${e.message}`).join(` -`)}a(c7o,"_buildMessageForResponseErrors");var l7o=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(c7o(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},u7o=["method","baseUrl","url","headers","request","query","mediaType","operationName"],d7o=["query","method","url"],_En=/\/api\/v3\/?$/;function f7o(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(d7o.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)=>u7o.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 _En.test(s)&&(o.url=s.replace(_En,"/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 l7o(o,l,c.data)}return c.data.data})}a(f7o,"graphql");function XUt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>f7o(r,o,s),"newApi"),{defaults:XUt.bind(null,r),endpoint:r.endpoint})}a(XUt,"withDefaults");var CEn=XUt(yIe,{headers:{"user-agent":`octokit-graphql.js/${a7o} ${GQ()}`},method:"POST",url:"/graphql"});function vEn(t){return XUt(t,{method:"POST",url:"/graphql"})}a(vEn,"withCustomRequest");p();var e7t="(?:[a-zA-Z0-9_-]+)",bEn="\\.",SEn=new RegExp(`^${e7t}${bEn}${e7t}${bEn}${e7t}$`),p7o=SEn.test.bind(SEn);async function h7o(t){let e=p7o(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(h7o,"auth");function m7o(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(m7o,"withAuthorizationPrefix");async function g7o(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=m7o(t),e(o)}a(g7o,"hook");var TEn=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(h7o.bind(null,e),{hook:g7o.bind(null,e)})},"createTokenAuth2");p();var t7t="7.0.6";var IEn=a(()=>{},"noop"),A7o=console.warn.bind(console),y7o=console.error.bind(console);function E7o(t={}){return typeof t.debug!="function"&&(t.debug=IEn),typeof t.info!="function"&&(t.info=IEn),typeof t.warn!="function"&&(t.warn=A7o),typeof t.error!="function"&&(t.error=y7o),t}a(E7o,"createLogger");var xEn=`octokit-core.js/${t7t} ${GQ()}`,DYe=class{static{a(this,"Octokit")}static VERSION=t7t;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 Xyn.Collection,n={baseUrl:yIe.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} ${xEn}`:xEn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=yIe.defaults(n),this.graphql=vEn(this.request).defaults(n),this.log=E7o(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=TEn(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(r7t,"requestLog");r7t.VERSION=wEn;p();var _7o="0.0.0-development";function C7o(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(C7o,"normalizePaginatedListResponse");function n7t(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=C7o(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:kEn(t,e,r,n)})}a(kEn,"gather");var yZu=Object.assign(REn,{iterator:n7t});function i7t(t){return{paginate:Object.assign(REn.bind(null,t),{iterator:n7t.bind(null,t)})}}a(i7t,"paginateRest");i7t.VERSION=_7o;p();p();var o7t="17.0.0";p();p();var v7o={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"]}},PEn=v7o;var cK=new Map;for(let[t,e]of Object.entries(PEn))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);cK.has(t)||cK.set(t,new Map),cK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var b7o={has({scope:t},e){return cK.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[...cK.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=cK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=S7o(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function s7t(t){let e={};for(let r of cK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},b7o);return e}a(s7t,"endpointsToMethods");function S7o(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(S7o,"decorate");function T7o(t){return{rest:s7t(t)}}a(T7o,"restEndpointMethods");T7o.VERSION=o7t;function a7t(t){let e=s7t(t);return{...e,rest:e}}a(a7t,"legacyRestEndpointMethods");a7t.VERSION=o7t;p();var DEn="22.0.1";var NEn=DYe.plugin(r7t,a7t,i7t).defaults({userAgent:`octokit-rest.js/${DEn}`});var x7o=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),pc=new ge("GitHubClient"),zy=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(ar);return this.octokit=new NEn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!x7o.has(o))return pc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];pc.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;){pc.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 pc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(pc.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 Pd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){pc.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 pc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return pc.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){pc.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}),pc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(pc.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 Pd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){pc.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;){pc.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 pc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(pc.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 Pd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){pc.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 pc.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 pc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){pc.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 pc.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 pc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){pc.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 pc.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 pc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Pd(l.status,l.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){pc.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;){pc.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 pc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(pc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw pc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new Wy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Zc=new ge("CodingAgentClient"),Nx=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){Zc.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/${VUt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:$yn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...Gm(this.ctx)};if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new w_;let g=await this.ctx.get(ar).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new w_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new w_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new w_;let E=y.pull_request?.number;if(typeof E!="number")throw new z0("No valid pull request number returned from job");let v=await new zy(this.ctx).getPullRequest(n,o,E);return Zc.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 Zc.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new Yf("Title is required and cannot be empty");if(!r?.trim())throw Zc.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new Yf("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Zc.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new Yf("Owner is required and cannot be empty");if(!o?.trim())throw Zc.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new Yf("Repository name is required and cannot be empty");Zc.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Ur).resolveSession();if(!r?.accessToken)throw Zc.debug(this.ctx,"Failed to get access token"),new Dx("Failed to call coding 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(ar).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){Zc.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 Zc.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new w_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...Gm(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Zc.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new w_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get coding agent sessions: HTTP ${l.status} - ${d}`;throw Zc.error(this.ctx,f),new z0(f)}let u=await l.json();return Zc.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 coding agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Zc.error(this.ctx,c),new mIe(c)}}async getSessionLogs(e,r){if(Zc.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new Yf("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Zc.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new w_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...Gm(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Zc.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new w_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get coding agent session logs: HTTP ${l.status} - ${u}`;throw Zc.error(this.ctx,d),new z0(d)}return await l.text()}catch(s){if(s instanceof _P)throw s;let c=`Failed to get coding agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Zc.error(this.ctx,c),new mIe(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 Zc.error(this.ctx,`Coding agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new z0("Coding agent is not enabled or you do not have access. Learn more about coding agent at https://docs.github.com/copilot/concepts/agents/coding-agent/about-coding-agent"):new z0(`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 Zc.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new z0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Zc.error(this.ctx,"API response missing job_id or session_id",r),new z0("Invalid response from coding agent");return r}};p();p();var eO=class{static{a(this,"LSPRequestSender")}};var MEn=ce(ti());var NYe=class{constructor(){this.codingAgentMessageRequestType=new MEn.ProtocolRequestType("copilot/codingAgentMessage")}static{a(this,"CodingAgentMessageHandler")}async sendCodingAgentMessage(e,r,n,o){try{Ye.debug(e.ctx,`Sending coding agent message to client: ${r} - ${o}`);let c=await e.ctx.get(eO).sendRequest(this.codingAgentMessageRequestType,{title:r,description:n,prLink:o,conversationId:e.conversation.id.toString(),turnId:e.turn.id.toString()});return Ye.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 Ye.error(e.ctx,c,s),{success:!1,error:c}}}};p();p();p();p();var kv=ce(wo());function c7t(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(c7t,"adaptCancellationToken");function OEn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(OEn,"adaptProgressCallback");function BEn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(BEn,"createEndpointInfo");function LEn(t){let e={role:w7o(t.role),content:R7o(t.content)};if(t.role===kv.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===kv.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===kv.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=bze(n);o&&(e.thinking=o);let s=vze(n);s&&(e.phase=s)}n.type===kv.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(LEn,"convertToCopilotChatMessage");function w7o(t){switch(t){case kv.Raw.ChatRole.System:return"system";case kv.Raw.ChatRole.User:return"user";case kv.Raw.ChatRole.Assistant:return"assistant";case kv.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(w7o,"convertRole");function R7o(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===kv.Raw.ChatCompletionContentPartKind.Text||r.type===kv.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===kv.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===kv.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===kv.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(R7o,"convertContent");p();var u3=ce(wo());var MYe=class extends u3.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===u3.Raw.ChatRole.System&&o?.role===u3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===u3.Raw.ChatCompletionContentPartKind.Text&&l.type===u3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` -`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:u3.Raw.ChatCompletionContentPartKind.Text,text:` -`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===u3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function FEn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(M7o(e)){case"image/png":return k7o(e);case"image/gif":return P7o(e);case"image/jpeg":case"image/jpg":return D7o(e);case"image/webp":return N7o(e);default:throw new Error("Unsupported image format")}}a(FEn,"getImageDimensions");function k7o(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(k7o,"getPngDimensions");function P7o(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(P7o,"getGifDimensions");function D7o(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(D7o,"getJpegDimensions");function N7o(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 OYe(t){let e=Ss(t.tokenizer);return new l7t(e,t)}a(OYe,"createPromptTsxTokenizer");function L7o(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(L7o,"estimateDocumentTokenCost");var Kf=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=BEn(n),c=OYe(n);this._internalRenderer=new MYe(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?OEn(e):void 0,s=r?c7t(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?rAn(c.messages):nAn(c.messages),{messages:c.messages.map(LEn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?c7t(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function u7t(t,e,r,n,o,s){return await Kf.create(t,e,r,s).renderPrompt(n,o,s)}a(u7t,"renderTsxPrompt");p();p();p();var UEn=new ge("toolCallRoundsBuilder");function tO(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(tO,"buildAssistantRounds");p();var k_=ce(wo());var EIe=new ge("toolCalling"),Mx=class extends sr{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,k_.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 EIe.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(nle,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(Cze,{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(k_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(k_.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"}`;EIe.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(k_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(k_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(k_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(k_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,k_.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(k_.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"}`;EIe.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(k_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(k_.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.lengthP8o.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 zAn.test(s)&&(o.url=s.replace(zAn,"/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 R8o(o,l,c.data)}return c.data.data})}a(D8o,"graphql");function oUt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>D8o(r,o,s),"newApi"),{defaults:oUt.bind(null,r),endpoint:r.endpoint})}a(oUt,"withDefaults");var YAn=oUt($Te,{headers:{"user-agent":`octokit-graphql.js/${x8o} ${wQ()}`},method:"POST",url:"/graphql"});function KAn(t){return oUt(t,{method:"POST",url:"/graphql"})}a(KAn,"withCustomRequest");p();var sUt="(?:[a-zA-Z0-9_-]+)",JAn="\\.",ZAn=new RegExp(`^${sUt}${JAn}${sUt}${JAn}${sUt}$`),N8o=ZAn.test.bind(ZAn);async function M8o(t){let e=N8o(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(M8o,"auth");function O8o(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(O8o,"withAuthorizationPrefix");async function B8o(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=O8o(t),e(o)}a(B8o,"hook");var XAn=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(M8o.bind(null,e),{hook:B8o.bind(null,e)})},"createTokenAuth2");p();var aUt="7.0.6";var eyn=a(()=>{},"noop"),L8o=console.warn.bind(console),F8o=console.error.bind(console);function U8o(t={}){return typeof t.debug!="function"&&(t.debug=eyn),typeof t.info!="function"&&(t.info=eyn),typeof t.warn!="function"&&(t.warn=L8o),typeof t.error!="function"&&(t.error=F8o),t}a(U8o,"createLogger");var tyn=`octokit-core.js/${aUt} ${wQ()}`,Xze=class{static{a(this,"Octokit")}static VERSION=aUt;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 xAn.Collection,n={baseUrl:$Te.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} ${tyn}`:tyn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=$Te.defaults(n),this.graphql=KAn(this.request).defaults(n),this.log=U8o(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=XAn(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(cUt,"requestLog");cUt.VERSION=ryn;p();var Q8o="0.0.0-development";function q8o(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(q8o,"normalizePaginatedListResponse");function lUt(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=q8o(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:iyn(t,e,r,n)})}a(iyn,"gather");var Rzu=Object.assign(nyn,{iterator:lUt});function uUt(t){return{paginate:Object.assign(nyn.bind(null,t),{iterator:lUt.bind(null,t)})}}a(uUt,"paginateRest");uUt.VERSION=Q8o;p();p();var dUt="17.0.0";p();p();var j8o={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"]}},oyn=j8o;var GY=new Map;for(let[t,e]of Object.entries(oyn))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);GY.has(t)||GY.set(t,new Map),GY.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var H8o={has({scope:t},e){return GY.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[...GY.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=GY.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=G8o(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function fUt(t){let e={};for(let r of GY.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},H8o);return e}a(fUt,"endpointsToMethods");function G8o(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(G8o,"decorate");function $8o(t){return{rest:fUt(t)}}a($8o,"restEndpointMethods");$8o.VERSION=dUt;function pUt(t){let e=fUt(t);return{...e,rest:e}}a(pUt,"legacyRestEndpointMethods");pUt.VERSION=dUt;p();var syn="22.0.1";var ayn=Xze.plugin(cUt,pUt,uUt).defaults({userAgent:`octokit-rest.js/${syn}`});var W8o=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),dc=new Ee("GitHubClient"),zy=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(fr);return this.octokit=new ayn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!W8o.has(o))return dc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];dc.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;){dc.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 dc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(dc.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 Rd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){dc.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 dc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return dc.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){dc.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}),dc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(dc.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 Rd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){dc.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;){dc.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 dc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(dc.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 Rd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){dc.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 dc.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 dc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Rd(c.status,c.message||"GitHub API error")}throw dc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){dc.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 dc.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 dc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Rd(c.status,c.message||"GitHub API error")}throw dc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){dc.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 dc.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 dc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Rd(l.status,l.message||"GitHub API error")}throw dc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){dc.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;){dc.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 dc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(dc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw dc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Rd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Fr).resolveSession();if(!e)throw new Wy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Kc=new Ee("CodingAgentClient"),wx=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){Kc.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/${Z9t}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:EAn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...uA(this.ctx)};if(c?.isCancellationRequested)throw Kc.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new T_;let g=await this.ctx.get(fr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Kc.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new T_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Kc.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new T_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Kc.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new T_;let E=y.pull_request?.number;if(typeof E!="number")throw new z0("No valid pull request number returned from job");let v=await new zy(this.ctx).getPullRequest(n,o,E);return Kc.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 Kc.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new Kf("Title is required and cannot be empty");if(!r?.trim())throw Kc.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new Kf("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Kc.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new Kf("Owner is required and cannot be empty");if(!o?.trim())throw Kc.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new Kf("Repository name is required and cannot be empty");Kc.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Fr).resolveSession();if(!r?.accessToken)throw Kc.debug(this.ctx,"Failed to get access token"),new xx("Failed to call coding 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(fr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){Kc.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 Kc.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new T_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...uA(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Kc.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new T_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get coding agent sessions: HTTP ${l.status} - ${d}`;throw Kc.error(this.ctx,f),new z0(f)}let u=await l.json();return Kc.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof pk)throw s;let c=`Failed to get coding agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Kc.error(this.ctx,c),new jTe(c)}}async getSessionLogs(e,r){if(Kc.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new Kf("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Kc.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new T_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...uA(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Kc.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new T_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get coding agent session logs: HTTP ${l.status} - ${u}`;throw Kc.error(this.ctx,d),new z0(d)}return await l.text()}catch(s){if(s instanceof pk)throw s;let c=`Failed to get coding agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Kc.error(this.ctx,c),new jTe(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 Kc.error(this.ctx,`Coding agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new z0("Coding agent is not enabled or you do not have access. Learn more about coding agent at https://docs.github.com/copilot/concepts/agents/coding-agent/about-coding-agent"):new z0(`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 Kc.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new z0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Kc.error(this.ctx,"API response missing job_id or session_id",r),new z0("Invalid response from coding agent");return r}};p();p();var HM=class{static{a(this,"LSPRequestSender")}};var cyn=he(ti());var eYe=class{constructor(){this.codingAgentMessageRequestType=new cyn.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(HM).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 SC=he(Io());function hUt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(hUt,"adaptCancellationToken");function lyn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(lyn,"adaptProgressCallback");function uyn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(uyn,"createEndpointInfo");function dyn(t){let e={role:z8o(t.role),content:Y8o(t.content)};if(t.role===SC.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===SC.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===SC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=GWe(n);o&&(e.thinking=o);let s=HWe(n);s&&(e.phase=s)}n.type===SC.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(dyn,"convertToCopilotChatMessage");function z8o(t){switch(t){case SC.Raw.ChatRole.System:return"system";case SC.Raw.ChatRole.User:return"user";case SC.Raw.ChatRole.Assistant:return"assistant";case SC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(z8o,"convertRole");function Y8o(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===SC.Raw.ChatCompletionContentPartKind.Text||r.type===SC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===SC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===SC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===SC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(Y8o,"convertContent");p();var KL=he(Io());var tYe=class extends KL.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===KL.Raw.ChatRole.System&&o?.role===KL.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===KL.Raw.ChatCompletionContentPartKind.Text&&l.type===KL.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` +`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:KL.Raw.ChatCompletionContentPartKind.Text,text:` +`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===KL.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function fyn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(e6o(e)){case"image/png":return K8o(e);case"image/gif":return J8o(e);case"image/jpeg":case"image/jpg":return Z8o(e);case"image/webp":return X8o(e);default:throw new Error("Unsupported image format")}}a(fyn,"getImageDimensions");function K8o(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(K8o,"getPngDimensions");function J8o(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(J8o,"getGifDimensions");function Z8o(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(Z8o,"getJpegDimensions");function X8o(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 rYe(t){let e=Ds(t.tokenizer);return new mUt(e,t)}a(rYe,"createPromptTsxTokenizer");function n6o(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(n6o,"estimateDocumentTokenCost");var Jf=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=uyn(n),c=rYe(n);this._internalRenderer=new tYe(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?lyn(e):void 0,s=r?hUt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?Pmn(c.messages):kmn(c.messages),{messages:c.messages.map(dyn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?hUt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function gUt(t,e,r,n,o,s){return await Jf.create(t,e,r,s).renderPrompt(n,o,s)}a(gUt,"renderTsxPrompt");p();p();p();var pyn=new Ee("toolCallRoundsBuilder");function GM(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(GM,"buildAssistantRounds");p();var w_=he(Io());var VTe=new Ee("toolCalling"),Rx=class extends ar{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 VTe.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(Oce,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(jWe,{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"}`;VTe.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"}`;VTe.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.lengthn.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(F7o,"separateTextAndImages");function U7o(t){return t.map(e=>vscpp(Hh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(U7o,"createImageElements");function BYe(t){let{imageUrls:e,textContent:r}=F7o(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Hh.TextChunk,null,vscpp(vscppf,null,r)),...U7o(e)]}a(BYe,"renderMixedContent");function d7t(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(d7t,"convertToPromptTsxToolCall");function LYe(t){switch(t.role){case"assistant":return Q7o(t);case"tool":return q7o(t);case"user":return j7o(t);case"system":return H7o(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(LYe,"convertChatMessageToPromptTsx");function Q7o(t){let e=t.thinking?vscpp(nle,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Hh.AssistantMessage,{toolCalls:d7t(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Hh.AssistantMessage,{toolCalls:d7t(t.tool_calls)},vscpp(vscppf,null,BYe(t.content)),e):vscpp(Hh.AssistantMessage,{toolCalls:d7t(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(Q7o,"renderAssistantMessage");function q7o(t){return typeof t.content=="string"?vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},BYe(t.content)):vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(q7o,"renderToolMessage");function j7o(t){return typeof t.content=="string"?vscpp(Hh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.UserMessage,null,BYe(t.content)):vscpp(Hh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(j7o,"renderUserMessage");function H7o(t){return typeof t.content=="string"?vscpp(Hh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.SystemMessage,null,BYe(t.content)):vscpp(Hh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(H7o,"renderSystemMessage");var G7o=new ge("conversationHistoryPrompt"),hle=class extends sr{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):G7o.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=tO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(Mx,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var UYe=ce(wo());var FYe=class extends sr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(UYe.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(hle,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(UYe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function QEn(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(QEn,"parseStructuredSummary");var QYe=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 Ye.debug(this.ctx,"No turns to summarize"),"";let l=n.modelProviderName&&n.userRequestedModel?await QM(this.ctx,n.modelProviderName,n.userRequestedModel):await Uo.getModelConfiguration(this.ctx,void 0,n.userRequestedModel,void 0,e.id.toString(),SQ(c));Uo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await Kf.create(FYe,{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 Ye.debug(this.ctx,"Summarization cancelled"),"";if(h.type==="success"){let m=h.value.trim();return m.match(/^".*"$/)&&(m=m.slice(1,-1)),Ye.debug(this.ctx,`Successfully generated conversation summary of length ${m.length}`),m}else{let m="reason"in h?h.reason:"unknown";return Ye.error(this.ctx,`Failed to fetch conversation summary because of response type (${h.type}) and reason (${m})`),""}}catch(o){return Ye.exception(this.ctx,o,"Error generating conversation summary"),""}}};p();var _Ie=new ge("repository"),d3=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)}},Ox=class{static{a(this,"GitBranchLoader")}},$Q=class extends Ox{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 qEn=require("child_process");var VQ=class extends Ox{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,qEn.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){_Ie.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=ho(r);if(n===void 0)return;let o;try{o=(await rQ()).path}catch(c){_Ie.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?d3.branch(c):d3.detachedHead()}}extraArgs(){return[]}};p();var WQ=class extends Ox{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Fo),o=xa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;_Ie.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 d3.branch(r)}else return this.isCommitSha(e)?d3.detachedHead():d3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var zQ=new ge("codingAgentTurnProcessor"),qYe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.turnSuggestions=new HQ(e.ctx,this.chatFetcher),this.codingAgentClient=new Nx(e.ctx),this.gitHubClient=new zy(e.ctx),this.codingAgentMessageHandler=new NYe,this.conversationSummarizer=new QYe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s,c,l){try{let u=await Jc(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,u,n,o,s,c,l)}catch(u){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u),_s(this.turnContext.ctx,u,"codingAgent");let d=u instanceof Error?u.message:JSON.stringify(u);this.turn.status="error",this.updateTurnResponseWithError(d),await this.endProgress({error:{message:d,code:mQ.Unknown,responseIsIncomplete:!0}})}finally{kWe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l,u,d){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{zQ.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let f;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?f=this.turnContext.turn.workspaceFolders[0]:f=this.turnContext.turn.workspaceFolder,!f)throw new Yf("No workspace folder available for git repository detection");let m=await new W0(this.turnContext.ctx).getRepo(f);if(!m||!m.isGitHub())throw new Yf("No GitHub repository found in the workspace folder");if(!m.owner||!m.name)throw new Yf("Could not determine repository owner and name");let g={owner:m.owner,name:m.name},y=await new $Q([new VQ,new WQ]).getBranchInfo(this.turnContext.ctx,f),E;if(y?.currentBranch&&!y.isDetachedHead){E=y.currentBranch,zQ.debug(this.turnContext.ctx,`Found current branch: ${E}`);try{await this.gitHubClient.getBranch(g.owner,g.name,E),zQ.debug(this.turnContext.ctx,`Branch ${E} exists remotely`)}catch(B){if(B instanceof Pd&&B.status===404){let Q=`Base branch "${E}" does not exist remotely in ${g.owner}/${g.name}. Please push the branch to the remote repository before creating a coding agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${Q} +`,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 Hh=he(Io());function i6o(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(i6o,"separateTextAndImages");function o6o(t){return t.map(e=>vscpp(Hh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(o6o,"createImageElements");function nYe(t){let{imageUrls:e,textContent:r}=i6o(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Hh.TextChunk,null,vscpp(vscppf,null,r)),...o6o(e)]}a(nYe,"renderMixedContent");function AUt(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(AUt,"convertToPromptTsxToolCall");function iYe(t){switch(t.role){case"assistant":return s6o(t);case"tool":return a6o(t);case"user":return c6o(t);case"system":return l6o(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(iYe,"convertChatMessageToPromptTsx");function s6o(t){let e=t.thinking?vscpp(Oce,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Hh.AssistantMessage,{toolCalls:AUt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Hh.AssistantMessage,{toolCalls:AUt(t.tool_calls)},vscpp(vscppf,null,nYe(t.content)),e):vscpp(Hh.AssistantMessage,{toolCalls:AUt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(s6o,"renderAssistantMessage");function a6o(t){return typeof t.content=="string"?vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},nYe(t.content)):vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(a6o,"renderToolMessage");function c6o(t){return typeof t.content=="string"?vscpp(Hh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.UserMessage,null,nYe(t.content)):vscpp(Hh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(c6o,"renderUserMessage");function l6o(t){return typeof t.content=="string"?vscpp(Hh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.SystemMessage,null,nYe(t.content)):vscpp(Hh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(l6o,"renderSystemMessage");var u6o=new Ee("conversationHistoryPrompt"),Vce=class extends ar{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):u6o.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=GM(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(Rx,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var sYe=he(Io());var oYe=class extends ar{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(sYe.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(Vce,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(sYe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function hyn(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(hyn,"parseStructuredSummary");var aYe=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.userRequestedModel?await RM(this.ctx,n.modelProviderName,n.userRequestedModel):await Jo.getModelConfiguration(this.ctx,void 0,n.userRequestedModel,void 0,e.id.toString(),cQ(c));Jo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await Jf.create(oYe,{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 WTe=new Ee("repository"),JL=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)}},Px=class{static{a(this,"GitBranchLoader")}},RQ=class extends Px{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 myn=require("child_process");var PQ=class extends Px{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,myn.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){WTe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=Yo(r);if(n===void 0)return;let o;try{o=(await j7()).path}catch(c){WTe.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?JL.branch(c):JL.detachedHead()}}extraArgs(){return[]}};p();var kQ=class extends Px{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Bo),o=Sa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;WTe.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 JL.branch(r)}else return this.isCommitSha(e)?JL.detachedHead():JL.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var DQ=new Ee("codingAgentTurnProcessor"),cYe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(_c),this.chatFetcher=this.chatFetcher??new ec(e.ctx),this.turnSuggestions=new xQ(e.ctx,this.chatFetcher),this.codingAgentClient=new wx(e.ctx),this.gitHubClient=new zy(e.ctx),this.codingAgentMessageHandler=new eYe,this.conversationSummarizer=new aYe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s,c,l){try{let u=await Yc(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,u,n,o,s,c,l)}catch(u){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u),La(this.turnContext.ctx,u,"codingAgent");let d=u instanceof Error?u.message:JSON.stringify(u);this.turn.status="error",this.updateTurnResponseWithError(d),await this.endProgress({error:{message:d,code:eQ.Unknown,responseIsIncomplete:!0}})}finally{JVe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l,u,d){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{DQ.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let f;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?f=this.turnContext.turn.workspaceFolders[0]:f=this.turnContext.turn.workspaceFolder,!f)throw new Kf("No workspace folder available for git repository detection");let m=await new V0(this.turnContext.ctx).getRepo(f);if(!m||!m.isGitHub())throw new Kf("No GitHub repository found in the workspace folder");if(!m.owner||!m.name)throw new Kf("Could not determine repository owner and name");let g={owner:m.owner,name:m.name},y=await new RQ([new PQ,new kQ]).getBranchInfo(this.turnContext.ctx,f),E;if(y?.currentBranch&&!y.isDetachedHead){E=y.currentBranch,DQ.debug(this.turnContext.ctx,`Found current branch: ${E}`);try{await this.gitHubClient.getBranch(g.owner,g.name,E),DQ.debug(this.turnContext.ctx,`Branch ${E} exists remotely`)}catch(B){if(B instanceof Rd&&B.status===404){let j=`Base branch "${E}" does not exist remotely in ${g.owner}/${g.name}. Please push the branch to the remote repository before creating a coding agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${j} -`}),zQ.error(this.turnContext.ctx,Q),new Yf(Q)}throw B}}else throw new Yf("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let _=In(this.turn.request.message),v=Vyn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),b=Wyn(v);zQ.debug(this.turnContext.ctx,`Extracted ${v.length} context file paths (${b.length} characters formatted)`);let T="",w=TYe(_);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... +`}),DQ.error(this.turnContext.ctx,j),new Kf(j)}throw B}}else throw new Kf("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let _=Rn(this.turn.request.message),v=_An(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),b=vAn(v);DQ.debug(this.turnContext.ctx,`Extracted ${v.length} context file paths (${b.length} characters formatted)`);let T="",w=Vze(_);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... -`});let{structuredSummary:B,rawSummary:Q}=await this.summarizeConversation(r,o,l,u);if(r.isCancellationRequested)return;B&&B.title&&(w=B.title),T=Q||""}let R=b;T&&(R=b+(b?` +`});let{structuredSummary:B,rawSummary:j}=await this.summarizeConversation(r,o,l,u);if(r.isCancellationRequested)return;B&&B.title&&(w=B.title),T=j||""}let R=b;T&&(R=b+(b?` -`:"")+T);let{problemStatement:x}=Gyn(this.turnContext.ctx,_,R||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to coding agent... +`:"")+T);let{problemStatement:x}=yAn(this.turnContext.ctx,_,R||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to coding agent... -`});let k=await this.codingAgentClient.createCodingTask(w,x,g.owner,g.name,E,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,k.pullRequest.title,k.pullRequest.body||"",k.pullRequest.html_url)}catch(B){zQ.warn(this.turnContext.ctx,"Failed to send coding agent message to client",B)}let D="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:D}),this.turn.response={message:D,type:"model"},this.turn.status="success";let N={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let B=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof B=="string"&&B!==""&&(N.suggestedTitle=B)}let L=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ht(this.turnContext.ctx,"codingAgent",L),MI(this.turnContext.ctx,"codingAgent",L),await this.endProgress(N)}catch(f){if(T9e(this.turnContext.ctx,"codingAgent",f,o),f instanceof Mc)zQ.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,f),_s(this.turnContext.ctx,f,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(f instanceof _P)_s(this.turnContext.ctx,f,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(f.message),await this.endProgress({error:{message:f.message,code:mQ.Default,responseIsIncomplete:!0}});else throw zQ.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,f),f}}async summarizeConversation(e,r,n,o,s){let c=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModel:n||"",modelProviderName:o||"",modelInfo:s||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!c)return{structuredSummary:null,rawSummary:null};let l=QEn(c);return Ye.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${l.title}, Intent: ${l.userIntent}`),{structuredSummary:l,rawSummary:c}}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return Ye.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=TQ(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 jEn="```",CIe=String.raw``,$7o=String.raw`${jEn}[\w]*?\n(?[\s\S]*?)\n${jEn}`,V7o=new RegExp(CIe+` -`+$7o,"gs"),f7t=["replace","delete"];function p7t(t,e){let r=t.matchAll(V7o),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!f7t.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 P=await this.codingAgentClient.createCodingTask(w,x,g.owner,g.name,E,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,P.pullRequest.title,P.pullRequest.body||"",P.pullRequest.html_url)}catch(B){DQ.warn(this.turnContext.ctx,"Failed to send coding agent message to client",B)}let D="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:D}),this.turn.response={message:D,type:"model"},this.turn.status="success";let N={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let B=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof B=="string"&&B!==""&&(N.suggestedTitle=B)}let L=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});yt(this.turnContext.ctx,"codingAgent",L),wI(this.turnContext.ctx,"codingAgent",L),await this.endProgress(N)}catch(f){if(J6e(this.turnContext.ctx,"codingAgent",f,o),f instanceof Dc)DQ.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,f),La(this.turnContext.ctx,f,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(f instanceof pk)La(this.turnContext.ctx,f,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(f.message),await this.endProgress({error:{message:f.message,code:eQ.Default,responseIsIncomplete:!0}});else throw DQ.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,f),f}}async summarizeConversation(e,r,n,o,s){let c=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModel:n||"",modelProviderName:o||"",modelInfo:s||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!c)return{structuredSummary:null,rawSummary:null};let l=hyn(c);return ot.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${l.title}, Intent: ${l.userIntent}`),{structuredSummary:l,rawSummary:c}}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=lQ(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 gyn="```",zTe=String.raw``,d6o=String.raw`${gyn}[\w]*?\n(?[\s\S]*?)\n${gyn}`,f6o=new RegExp(zTe+` +`+d6o,"gs"),yUt=["replace","delete"];function EUt(t,e){let r=t.matchAll(f6o),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!yUt.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=h7t([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(p7t,"extractEditsFromTaggedCodeblocks");function h7t(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=_Ut([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(EUt,"extractEditsFromTaggedCodeblocks");function _Ut(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(h7t,"applyEditsToDocument");var mle=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 Uo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(dA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},jYe=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 FQ(e.ctx),u=await e.ctx.get(Bc).getBestChatModelConfig(hS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(dA).toPrompt(e,d)}async processResponse(e){let r=[],n=In(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(Vy);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(Jn).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=p7t(e,r).filter(c=>f7t.includes(c.mode)),s=h7t(o,r);if(s)return await this.ctx.get(Uh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return p7t(e,r)}};var HYe=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 mle(e.ctx);return new qYe(e,r)}};p();p();p();p();function HEn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(HEn,"filterUnsupportedReferences");function GEn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(GEn,"convertToCopilotReferences");var $En=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 YQ=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,HEn(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 rO=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(MN).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(ar).fetch(l,{method:"GET",headers:c})}};p();p();var VEn=S.Object({name:S.String(),url:S.String()}),WEn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(VEn)})),remotes:S.Optional(S.Array(VEn))}),m7t=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(nO,"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)}},nO="git-metadata",GYe=class extends Xm{static{a(this,"GitMetadataSkill")}constructor(e){super(nO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new m7t(r))}};async function zEn(t){let e=await t.skillResolver.resolve(Vy);if(e){let c=e.uri,l=R7(t.ctx,c);if(Ecn(l))return{repoInfo:l,skillUsed:Vy}}let r=await t.skillResolver.resolve(nO);if(!r||!r.remotes||r.remotes.length===0){Ye.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=t3t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:nO}}a(zEn,"extractRepoInfo");async function YEn(t){let e=[];return await W7o(t,e),await z7o(t,e),await Y7o(t,e),e}a(YEn,"skillsToReference");async function W7o(t,e){let r=await K7o(t);r&&e.push(r)}a(W7o,"addRepositoryReference");async function z7o(t,e){let r=await J7o(t);r&&e.push(r)}a(z7o,"addSelectionReference");async function Y7o(t,e){let r=[],n=await X7o(t);n&&r.push(n),r.push(...await eQo(t)),r.length>0&&e.push(...r)}a(Y7o,"addFileReferences");async function K7o(t){let e=await zEn(t);if(e){let r=t.ctx.get(rO),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(K7o,"gitMetadataToReference");async function J7o(t){let e=await t.skillResolver.resolve(Vy);if(e&&e.selection){let n=await t.ctx.get(Jn).getOrReadTextDocument(e),o=zu(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return Z7o(e,n.document)}}a(J7o,"currentEditorToSelectionReference");function Z7o(t,e){if(t.selection&&!cle(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(Z7o,"extractSelection");async function X7o(t){let e=await t.skillResolver.resolve(Vy);if(e){let n=await t.ctx.get(Jn).getOrReadTextDocument(e),o=zu(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(X7o,"currentEditorToFileReference");async function eQo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(Jn);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=zu(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(eQo,"fileReferenceToPlatformFileReference");p();p();var ng="https://aka.ms/github-copilot-rate-limit-error";function tQo(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(tQo,"secondsToHumanReadableTime");var KQ=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":tQo(e),o=r?.capiErrorCode,s=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](${ng})`;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}. [Learn More](${ng})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n} or consider switching to Auto. [Learn More](${ng})`;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](${ng})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${ng})`;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}. [Learn More](${ng})`:`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](${ng})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${ng})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${ng})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${ng})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${ng})`}return o?.startsWith("user_model_rate_limited")?s?`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${ng})`:`You've hit the rate limit for this model. Please try switching to Auto or try again in ${n}. [Learn More](${ng})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${ng})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${ng})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${ng})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${ng})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${ng})`}};p();p();p();var n_n=ce(WYe()),E7t=ce(require("path"));var i_n=500,dQo=Math.floor(.25*i_n),zYe=class{static{a(this,"FixedSizeChunking")}async chunk(e,r){let n=[],o=E7t.default.extname(__filename)===".ts"?E7t.default.resolve(__dirname,"../../../../../../dist/main.js"):__filename;return n=await n_n.job(async({text:s,uri:c,tokenizerName:l,directory:u,chunkSize:d,overlap:f})=>{let m=await require(u).getTokenizerAsync(l),g=m.tokenize(s),A=g.length,y=[],E=0;for(;E=A,v=_?A:E+d,b=g.slice(E,v),T=m.detokenize(b),w=s.indexOf(T);y.push({id:`${c.toString()}#${E}`,chunk:T,tokenCount:b.length,range:{start:w,end:w+T.length}}),E=_?v:v-f}return y},{data:{text:e.getText(),uri:e.uri.toString(),tokenizerName:r.tokenizer,directory:o,chunkSize:i_n,overlap:dQo}}),n}};var fQo="fixedSize",pQo=new Map([["fixedSize",zYe]]);function o_n(t){let e=t==="default"?fQo:t,r=pQo.get(e);if(!r)throw new Error(`Chunking constructor for type ${t} not found`);return r}a(o_n,"getChunkingAlgorithm");p();p();var YYe=ce(IB()),iO=ce(require("fs")),s_n=require("os"),Bx=ce(require("path")),gle=require("process");var _7t=5e4,hQo=new ge("workspaceChunks"),KYe=class t{constructor(e,r){this.ctx=e;this.pathHashLength=8;this.chunksCountCache=new Map;let n=ji(r.uri),o=(0,YYe.SHA256)(r.uri).toString().substring(0,this.pathHashLength);this.cacheRootPath=Bx.join(C7t(),"project-context",`${n}.${o}`)}static{a(this,"WorkspaceChunks")}static{this.CACHE_VERSION="1.0.0"}getChunksCacheFile(e){let r=(0,YYe.SHA256)(e).toString().substring(0,this.pathHashLength),n=Bx.basename(e);return Bx.join(this.cacheRootPath,`${n}.${r}.json`)}async getChunksCacheFromCacheFile(e){let r=await iO.promises.readFile(e,{encoding:"utf8"}).catch(()=>{});if(r)try{return JSON.parse(r)}catch{}}async getChunksCache(e){let r=this.getChunksCacheFile(e);return await this.getChunksCacheFromCacheFile(r)}async setChunksCache(e,r){let n=this.getChunksCacheFile(e);try{await iO.promises.mkdir(Bx.dirname(n),{recursive:!0}),await iO.promises.writeFile(n,JSON.stringify(r),{encoding:"utf8"})}catch(o){hQo.debug(this.ctx,"Failed to set chunks cache:",o)}}async removeChunksCache(e){let r=this.getChunksCacheFile(e);await iO.promises.rm(r).catch(()=>{})}async enumerateChunksCacheFileNames(){return await iO.promises.readdir(this.cacheRootPath).catch(()=>[])}async getFilesCount(){return(await this.enumerateChunksCacheFileNames()).length}async getChunksCount(){let e=0;for(let r of await this.enumerateChunksCacheFileNames()){let n=Bx.join(this.cacheRootPath,r);if(!this.chunksCountCache.has(n)){let o=await this.getChunksCacheFromCacheFile(n);this.chunksCountCache.set(n,o?.documentChunks?.length??0)}e+=this.chunksCountCache.get(n)||0}return e}async*getChunksForFile({uri:e}){let r=await this.getChunksCache(e);r!==void 0&&(yield*r.documentChunks)}async*getChunksFromCacheFile(e){let r=await this.getChunksCacheFromCacheFile(e);yield*r?r.documentChunks:[]}async*getChunks(e){if(e!==void 0)yield*this.getChunksForFile(e);else{let r=await this.enumerateChunksCacheFileNames();for(let n of r)yield*this.getChunksFromCacheFile(Bx.join(this.cacheRootPath,n))}}async getFileHash(e){let r=ho(e),n="";return r&&(n=await iO.promises.readFile(r,{encoding:"utf8"}).catch(()=>"")),(0,YYe.SHA256)(n).toString()}async addChunks({uri:e},r){let n=Array.isArray(r)?()=>Promise.resolve(r):r,o=ho(e);if(!o)return;async function s(h){try{return(await iO.promises.stat(h)).mtimeMs}catch{return}}a(s,"getLastModified");let c=await s(o),l=await this.getChunksCache(e);if(l!==void 0&&l.version===t.CACHE_VERSION&&c!==void 0&&l.lastModified===c){this.chunksCountCache.set(o,l.documentChunks.length);return}let u=await this.getFileHash(e),d=await n();this.chunksCountCache.set(o,d.length);let f={version:t.CACHE_VERSION,filePath:e,hash:u,lastModified:c,documentChunks:d};await this.setChunksCache(e,f)}async deleteChunksForSource(e){let r=Ia(e),n=await this.getChunksCache(r);return n===void 0?[]:(await this.removeChunksCache(r),n.documentChunks)}async deleteChunks({uri:e}){let r=ho(e);if(!r)return[];let n;try{n=await iO.promises.readdir(r)}catch{return await this.deleteChunksForSource(r)}let o=[];for(let s of n){let c=Ia(Bx.join(r,s));o.push(...await this.deleteChunks({uri:c}))}return o}async clear(){await iO.promises.rm(this.cacheRootPath,{recursive:!0}).catch(()=>{})}};function C7t(){return gle.env.XDG_CACHE_HOME&&Bx.isAbsolute(gle.env.XDG_CACHE_HOME)?gle.env.XDG_CACHE_HOME+"/github-copilot":(0,s_n.platform)()==="win32"?gle.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":gle.env.HOME+"/.cache/github-copilot"}a(C7t,"getXdgCachePath");var v7t=1e4;var JYe=class{constructor(e,r,n){this.workspaceFolder=r;this.implementation=n;this._chunkLimiter=new S7t;this.status="notStarted",this.workspaceChunks=new KYe(e,r),this.cancellationToken=new b7t,this._chunkingTimeMs=0,this._fileCountExceeded=!1,this._chunkCountExceeded=!1,this._totalFileCount=0,this._filesUpdated=new Set}static{a(this,"ChunkingHandler")}async chunk(e,r){return r?await this.chunkFiles(e,r):await this.chunkWorkspace(e)}async chunkWorkspace(e){let r=performance.now();if(this.status="started",this.cancellationToken.isCancelled())return this.status="cancelled",this.updateChunkingTime(r,performance.now()),this.workspaceChunks.getChunks();await this.updateModelConfig(e);let n=await e.get(qy).getWatchedFiles(this.workspaceFolder);this._totalFileCount=n.length,n.length>v7t&&(this._fileCountExceeded=!0,n=n.slice(0,v7t));let o=n.map(async s=>{this.cancellationToken.isCancelled()||await this._chunkLimiter.queue(()=>this._chunk(e,s))});try{await Promise.all(o)}catch(s){_s(e,s,"ChunkingProvider.chunk"),this.terminateChunking()}return this.status=this.cancellationToken.isCancelled()?"cancelled":"completed",this.updateChunkingTime(r,performance.now()),await this.workspaceChunks.getChunksCount()>_7t&&(this._chunkCountExceeded=!0),this.workspaceChunks.getChunks()}async chunkFiles(e,r){await this.updateModelConfig(e);let n=r.map(async o=>{this.cancellationToken.isCancelled()||(this._filesUpdated.add(o.uri),await this._chunkLimiter.queue(()=>this._chunk(e,o)))});try{await Promise.all(n)}catch(o){_s(e,o,"ChunkingProvider.chunkFiles"),this.terminateChunking()}return await this.workspaceChunks.getChunksCount()>_7t&&(this._chunkCountExceeded=!0),await this.workspaceChunks.getFilesCount()>v7t&&(this._fileCountExceeded=!0),pmn(...r.map(o=>this.workspaceChunks.getChunks(o)))}async _chunk(e,r){this.cancellationToken.isCancelled()||await this.workspaceChunks.addChunks(r,()=>this.implementation.chunk(r,this.modelConfig))}async updateModelConfig(e){this.modelConfig||(this.modelConfig=await Uo.getModelConfiguration(e,"user"))}terminateChunking(){this.cancellationToken.cancel()}async clearChunks(){await this.workspaceChunks.clear()}updateChunkingTime(e,r){this._chunkingTimeMs=r-e}get chunkingTimeMs(){return Math.floor(this._chunkingTimeMs)}get fileCountExceeded(){return this._fileCountExceeded}get totalFileCount(){return this._totalFileCount}get chunkCountExceeded(){return this._chunkCountExceeded}get filesUpdatedCount(){return this._filesUpdated.size}async getFilesCount(){return this.workspaceChunks.getFilesCount()}getChunks(){return this.workspaceChunks.getChunks()}async getChunksCount(){return this.workspaceChunks.getChunksCount()}deleteSubfolderChunks(e){return this.workspaceChunks.deleteChunks({uri:e})}deleteFileChunks(e){return this._filesUpdated.add(e),this.workspaceChunks.deleteChunks({uri:e})}},b7t=class{constructor(){this.cancelled=!1}static{a(this,"ChunkingCancellationToken")}cancel(){this.cancelled=!0}isCancelled(){return this.cancelled}},S7t=class{constructor(e=20){this.maxCount=e;this.tasks=[];this.runningTasks=0}static{a(this,"Limiter")}async queue(e){return new Promise((r,n)=>{this.tasks.push({factory:e,resolve:r,reject:n}),this.consume()})}consume(){for(;this.tasks.length>0&&this.runningTasksthis.consumed(),()=>this.consumed())}}consumed(){this.runningTasks--,this.consume()}};var Y0=class{constructor(e){this.ctx=e;this.workspaceChunkingProviders=new Map}static{a(this,"ChunkingProvider")}get workspaceCount(){return this.workspaceChunkingProviders.size}createImplementation(e,r){let n=o_n(r),o=new n;return new JYe(this.ctx,e,o)}getImplementation(e,r="default"){let n=this.getParentFolder(e);if(n)return this.workspaceChunkingProviders.get(n.uri);let o=this.workspaceChunkingProviders.get(e.uri);return o||(o=this.createImplementation(e,r),this.workspaceChunkingProviders.set(e.uri,o)),o}getParentFolder(e){let r=[];for(let n of this.workspaceChunkingProviders.values())r.push(n.workspaceFolder);return r.find(n=>{let o=n.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return e.uri!==n.uri&&e.uri.startsWith(o)})}status(e){return this.getImplementation(e).status}checkLimits(e){let r=this.getImplementation(e);return{fileCountExceeded:r.fileCountExceeded,chunkCountExceeded:r.chunkCountExceeded}}fileCount(e){return this.getImplementation(e).getFilesCount()}chunkCount(e){return this.getImplementation(e).getChunksCount()}chunkingTimeMs(e){return this.getImplementation(e).chunkingTimeMs}getChunks(e){return this.getImplementation(e).getChunks()}terminateChunking(e,r){let n=this.getImplementation(r);n.terminateChunking();let s=jt.createAndMarkAsIssued().extendedBy(void 0,{fileCount:n.filesUpdatedCount});ht(e,"index.terminate",s),this.workspaceChunkingProviders.delete(r.uri)}async clearChunks(e,r){this.terminateChunking(e,r),await this.getImplementation(r).clearChunks()}async deleteSubfolderChunks(e,r){return await this.getImplementation(e).deleteSubfolderChunks(r.uri)}async deleteFileChunks(e,r){let n=this.getImplementation(e),o=[];Array.isArray(r)||(r=[r]);for(let s of r)o.push(...await n.deleteFileChunks(s));return o}async chunk(e,r,n,o){let s;return n&&(Array.isArray(n)?s=n:o=n),o||(o="default"),s?await this.chunkFiles(e,r,s,o):await this.chunkFolder(e,r,o)}async chunkFolder(e,r,n="default"){let o=this.getImplementation(r,n),s=await o.chunk(e),l=jt.createAndMarkAsIssued().extendedBy(void 0,{fileCount:o.totalFileCount,chunkCount:await o.getChunksCount(),timeTakenMs:o.chunkingTimeMs,workspaceCount:this.workspaceCount});return ht(e,"index.chunk",l),s}async chunkFiles(e,r,n,o="default"){return await this.getImplementation(r,o).chunk(e,n)}};Ns();var mQo=new ge("ChatFetchResultPostProcessor"),Ale=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(bmn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s.extendedBy({},{fileCount:this.turnContext.ctx.get(Y0).workspaceCount})),await this.turnContext.ctx.get(Uh).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:In(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"},mQo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:KQ.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===MS,copilotPlan:FI(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}=Uo.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},Smn(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:In(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new HQ(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 Ye.debug(this.turnContext.ctx,"Computed followup",l),Ye.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:gr(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return wmn(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",Tmn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var ZYe=S.Union([S.String(),S.Number()]),uK=S.Union([S.String(),S.Number()]),gQo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),XYe=S.Object({uri:S.String(),position:S.Optional(rg)}),AQo=S.Object({type:S.Literal("file"),uri:S.String(),visibleRange:S.Optional(hf),selection:S.Optional(hf),status:S.Optional(gQo),range:S.Optional(hf)}),yQo=S.Object({type:S.Literal("directory"),uri:S.String()}),EQo=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([AQo,yQo,$En,EQo]),sO=S.Union([S.Literal("panel"),S.Literal("inline")]),_Qo=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")]))})})]),T7t=S.Union([S.String(),S.Array(_Qo)]),a_n=S.Object({request:T7t,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(uK),model:S.Optional(S.String())});function eKe(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(eKe,"convertToMessageContent");function tKe(t,e){if(t=RS(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(tKe,"appendToMessage");var rKe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),CQo=S.Object({type:S.String(),description:S.String()}),c_n=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),CQo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Lc=S.Object({uri:S.String(),name:S.String()}),vQo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),nKe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:vQo});Ns();var I7t="generate-response",iKe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},bIe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(r.ctx),this.postProcessor=new Ale(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){Ye.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 iKe?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 Jc(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(Uh).inspectPrompt(l),await n.steps.start(I7t,"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:RS(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 gr()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return SUt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:RS(r.request.message)}),r.response&&r.response.type==="model"){let o=GEn(r.response.references);n.push({role:"assistant",content:RS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await YEn(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 YQ((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=tKe(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:In(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()),In(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 iKe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return QTe(this.conversation,"conversationPanel",In(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(I7t,e.error.message):await r.steps.finish(I7t)}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 SIe=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 bIe(this,e)}},oKe=class extends SIe{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 bIe(this,e)}};p();var bQo="github",vP=class{static{a(this,"RemoteAgentRegistry")}},sKe=class extends vP{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 zz(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Dr.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)||Dr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Dr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==bQo).map(o=>new SIe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var l_n=ce(require("fs")),P_=ce(require("path"));var x7t=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],w7t="test_",TIe={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"}},IIe=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=P_.extname(r).replace(".",""),o=TIe[n]??{location:"sameFolder",prefix:w7t,suffix:x7t},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=ho(tf(e)),l===void 0)return}else{let d=ho(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=P_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ia(l);if(await this.fileExists(u))return xa(u,s[0])}parseTestFilePath(e){try{return Ia(e)}catch(r){Dr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=ji(e),n=P_.extname(r).replace(".",""),o=TIe[n]??{location:"sameFolder",prefix:w7t,suffix:x7t},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=tf(e):l=this.determineImplFolder(e);for(let u of s){let d=xa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=ho(e);if(r===void 0)return;let n=P_.extname(ji(e)).replace(".",""),o,s=TIe[n]?.location??"sameFolder";s==="sameFolder"?o=P_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,TIe[n]);if(c.length>0)return Ia(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${P_.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 l_n.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&ho(this.baseUri))??"",o=P_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(P_.sep)}getRelativeTestFolder(e,r,n,o){let s=P_.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=P_.extname(ji(e)).replace(".",""),n=tf(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 xIe(t){let e=ji(t),r=P_.extname(e),n=TIe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(x7t.some(s=>e.endsWith(s+r))||e.startsWith(w7t))}a(xIe,"isTestFile");p();var JQ=class{constructor(){this._cache=new nn(100)}static{a(this,"BlackbirdIndexingStatus")}async queryIndexingStatus(e,r,n){let o=e.ctx;if(!n)return!1;let s=`repos/${r}/copilot_internal/embeddings_index`,c=await Td(o,n,s);return c.ok?(await c.json()).semantic_code_search_ok:!1}isValid(e){return e!==void 0&&Date.now()-e.timestamp<1800*1e3}async isRepoIndexed(e,r,n,o=!1){let s=qL(r);if(!s)return!1;let c=this._cache.get(s);if(!o&&this.isValid(c))return c.status;let l=await this.queryIndexingStatus(e,s,n);return this._cache.set(s,{status:l,timestamp:Date.now()}),l}get cache(){return this._cache}};p();p();p();p();p();var aKe=class{static{a(this,"CosineSimilarityScoring")}score(e,r){let n=Math.sqrt(e.reduce((c,l)=>c+l*l,0)),o=Math.sqrt(r.reduce((c,l)=>c+l*l,0));return e.reduce((c,l,u)=>c+l*r[u],0)/(n*o)}terminateScoring(){}};var SQo="cosine",TQo=new Map([["cosine",aKe]]);function u_n(t){let e=t==="default"?SQo:t,r=TQo.get(e);if(!r)throw new Error(`Scoring constructor for type ${t} not found`);return r}a(u_n,"getScoringAlgorithm");p();var Lx=class{constructor(){this.workspaceScoringProviders=new nn(25)}static{a(this,"ScoringProvider")}createImplementation(e,r){let n=u_n(r);return new n}getImplementation(e,r,n="default"){let o=this.workspaceScoringProviders.get(r.uri);return o||(o=this.createImplementation(e,n),this.workspaceScoringProviders.set(r.uri,o)),o}score(e,r,n,o,s){return this.getImplementation(e,r,s).score(n,o)}terminateScoring(e,r,n){this.getImplementation(e,r,n).terminateScoring(),this.workspaceScoringProviders.delete(r.uri)}};var usd={modelFamily:ZHe.textEmbedding3Small,scoringType:"default",dimensions:null};p();p();p();var k7t=ce(WYe());var xQo=.75,wQo=1.2,cKe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.chunksCount=0;this.sumTokenCount=0;this.status="notStarted"}static{a(this,"BM25Ranking")}get avgTokenCount(){return this.sumTokenCount/this.chunksCount}async initialize(e){this.sumTokenCount=0,this.chunksCount=0;for await(let r of e)this.sumTokenCount+=r.tokenCount,this.chunksCount++;this.status="completed"}async addChunks(e){for await(let r of e)this.sumTokenCount+=r.tokenCount,this.chunksCount++}async query(e){let r=await RIe();try{return await this.doQuery(e)}finally{await r.stopWorkerPool()}}async doQuery(e){let r=e.map(l=>l.toLowerCase()),n=await this.calculateIDFValues(r),o=Math.min(10*e.length,P7t),s=Math.min(o,this.chunksCount);return await this.calculateBM25Scores(r,this.avgTokenCount,n,s)}async calculateIDFValues(e){let r=this.ctx.get(Y0).getChunks(this.workspaceFolder),n=_Q(r,s=>({...s,chunk:s.chunk.toLowerCase()})),o=_Q(n,s=>s.chunk);return await RQo(e,o)}async calculateBM25Scores(e,r,n,o){let s=this.ctx.get(Y0).getChunks(this.workspaceFolder),c=new R7t(o);for await(let l of s){let u=await kQo({...l,chunk:l.chunk.toLowerCase()},e,r,n);c.add({...u,chunk:l.chunk})}return c.toArray(.75)}deleteEmbeddings(e){this.chunksCount-=e.length,this.sumTokenCount-=e.reduce((r,n)=>r+n.tokenCount,0)}terminateRanking(){}};async function RQo(t,e){let r=new SharedArrayBuffer(t.length*Int32Array.BYTES_PER_ELEMENT),n=new Int32Array(r),o=[],s=0;for await(let u of e){s++;let d=k7t.job(({snippet:f,keywords:h})=>h.map(g=>f.includes(g)?1:0),{data:{snippet:u,keywords:t}}).then(f=>{for(let h=0;h{let m=0;for(let g of s){let A=d[g],y=(c.match(new RegExp(g,"g"))||[]).length,E=A*(y*(f+1)),_=y+f*(1-h+h*l/u);m+=E/_}return m},{data:{document:t.chunk,docLength:t.tokenCount,keywords:e,avgTokenCount:r,idfValues:n,k1:wQo,b:xQo}}),...t}}a(kQo,"calculateBM25Score");var R7t=class{constructor(e,r=-1/0){this.maxSize=e;this.minScore=r;this.store=[]}static{a(this,"SimpleHeap")}toArray(e){if(this.store.length&&typeof e=="number"){let r=this.store.at(0).score*(1-e);return this.store.filter(n=>n.score>=r)}return this.store}add(e){if(e.score<=this.minScore)return;let r=this.store.findIndex(n=>n.score=0?r:this.store.length,0,e);this.store.length>this.maxSize;)this.store.pop();this.store.length===this.maxSize&&(this.minScore=this.store.at(-1)?.score??this.minScore)}};var DQo="bm25",NQo=new Map([["bm25",cKe]]);function d_n(t){let e=t==="default"?DQo:t,r=NQo.get(e);if(!r)throw new Error(`Ranking constructor for type ${t} not found`);return r}a(d_n,"getRankingAlgorithm");var D_=class{constructor(){this.workspaceRankingProviders=new nn(25)}static{a(this,"RankingProvider")}createImplementation(e,r,n){let o=d_n(n);return new o(e,r)}getImplementation(e,r,n="default"){let o=this.workspaceRankingProviders.get(r.uri);return o||(o=this.createImplementation(e,r,n),this.workspaceRankingProviders.set(r.uri,o)),o}status(e,r,n){return this.getImplementation(e,r,n).status}async initialize(e,r,n,o="default"){await this.getImplementation(e,r,o).initialize(n)}async addChunks(e,r,n,o="default"){await this.getImplementation(e,r,o).addChunks(n)}async query(e,r,n,o){return this.getImplementation(e,r,o).query(n)}async terminateRanking(e,r,n){await this.getImplementation(e,r,n).terminateRanking(),this.workspaceRankingProviders.delete(r.uri)}deleteEmbeddings(e,r,n,o){return this.getImplementation(e,r,o).deleteEmbeddings(n)}};p();async function D7t(t,e){let r=t.ctx,n=await Uo.getModelConfiguration(r,"synonyms",void 0,{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(dA).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 rc(r),u=await Jc(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:(Ye.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:"";_s(r,new wIe(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"LocalSnippetProvider.parseUserQuery")}}a(D7t,"parseUserQuery");var wIe=class extends Error{static{a(this,"LocalSnippetProviderError")}constructor(e){super(String(e),{cause:e}),this.name="LocalSnippetProviderError"}};p();p();p();p();var Wo=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 Wo(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Wo(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 f_n=250;function fA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/f_n)),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(fA,"getMaxChunks");var p_n=32e3,h_n=2e4,kIe=.75;p();p();function pA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(pA,"getFenceForCodeBlock");p();var JCn=ce(El()),ZCn=ce(qp());p();var Pv=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 $qo=Object.freeze({[Pv.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[Pv.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function W7t(t){return $qo[t.id]}a(W7t,"getWellKnownEmbeddingTypeInfo");function Vqo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:PIe(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(I_n,"rankEmbeddings");p();p();var b3=ce(Xc()),KCn=ce(qp());var dO=new ge("GitHubCodeSearch"),L$o=300*1e3,ZKe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new b3.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()},L$o)}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),dO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){dO.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(dO.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),dO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){dO.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,b3.raceTimeout)((async()=>{if(!await(0,b3.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,b3.raceCancellationError)((0,b3.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 dO.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 Td(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return dO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return dO.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=Rle(this._ctx),c=n.owner+"/"+n.name,l=await Td(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(dO.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=Rle(this._ctx),u=await Td(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:U$o(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 F$o(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Rle(t){let e=t.get(Lr);return{"X-Client-Application":`${C1(e.getEditorInfo())}`,"X-Client-Source":C1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Rle,"editorVersionHeaders");async function F$o(t,e,r){let o=[],s=new Pv(e.embedding_model),c=ca(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=xa(c,l.location.path)}catch(d){dO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:XKe(l.chunk.text),rawText:void 0,range:new KCn.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(F$o,"parseGithubCodeSearchResponse");function U$o(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(U$o,"truncateToMaxUtf8Length");function XKe(t){let e=Q$o(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` -`):t}a(XKe,"stripChunkTextMetadata");function Q$o(t){return t.split(/\r\n|\r|\n/)}a(Q$o,"splitLines");var wP=ce(Xc()),XCn=ce(Ele()),evn=ce(Gh());var KIe=new ge("ChunkingEndpointClient"),Sqt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new XCn.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 wP.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,wP.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,wP.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,wP.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){KIe.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{KIe.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{KIe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},eJe=class{constructor(e){this.ctx=e;this._requestLimiter=new Sqt(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,wP.raceCancellationError)(n.getText(),l);if((0,evn.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Rle(this.ctx);return await Td(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:ho(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,wP.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){KIe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,JCn.coalesce)(h.chunks.map(m=>{let g=new ZCn.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:XKe(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 Pv(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:XKe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){KIe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var Ky={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},J0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=jt.createAndMarkAsIssued(s,o);ht(e,r,c),gt(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};_s(e,n,r,o),gi(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,Ky.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,Ky.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Ky.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,Ky.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,Ky.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,Ky.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,Ky.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,Ky.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=jt.createAndMarkAsIssued(o,{});ht(e,r,s),gt(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Ky.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,Ky.Aggregate,r)}};var tvn=ce(El()),rvn=ce(Xc()),Tqt=ce(cO());var S3=new ge("Remote Search"),tJe=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(W0),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 Tqt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(S3.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(k=>`${k.owner}/${k.name}`),maxResults:fA(r)}),s.length===0)throw S3.error(this.ctx,"No GitHub repositories found"),J0.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 S3.error(this.ctx,"No GitHub session found"),J0.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 S3.error(this.ctx,"Remote index not ready for any repositories"),J0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=fA(r),d=Promise.all(l.map(async k=>{Nh(n);let D=await e.resolveQuery(n),N=new Tqt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,k,D,u,n);return S3.info(this.ctx,`Search completed for ${k.owner}/${k.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);S3.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,rvn.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{S3.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(k=>{S3.error(this.ctx,"Local diff search failed",k)})??Promise.resolve(void 0)]),E=(0,tvn.coalesce)(A).flatMap(k=>k.chunks),_=y?.isOk()?y.val.result.chunks:[],v=_.length>0?[...E.filter(k=>!h.has(k.chunk.file)),..._]:E,b=v.length,w=new Set(v.map(k=>k.chunk.file)).size,R=o.elapsed();S3.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 J0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var Z1n=require("node:url"),X1n=require("path");p();var AJe=ce(ivn(),1);p();var Iqt=new WeakMap;function Ple(...t){let e=new String(t);return Iqt.set(e,t),e}a(Ple,"c");function Ux(t){return t instanceof String&&Iqt.has(t)}a(Ux,"r");function Dle(t){return Iqt.get(t)??[]}a(Dle,"o");var mJe=ce(dvn(),1),qbn=require("child_process");var T1n=ce(kqt(),1),B1n=require("node:path");p();function*fvn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(fvn,"U");var pVo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),hVo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),mVo=new Set(["edit","remove-section","rename-section","set","unset"]),gVo=new Set(["get","get-color","get-colorbool","list"]);function AVo(t,e){for(let{name:n}of fvn(t,"task")){if(pVo.has(n))return Ble(!0,e);if(hVo.has(n))return Ble(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:mVo.has(r)?Ble(!0,e.slice(1)):gVo.has(r)?Ble(!1,e.slice(1)):e.length===1?Ble(!1,e):Ble(!0,e)}a(AVo,"F");function Ble(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(Ble,"p");function yVo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(yVo,"A");function EVo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(EVo,"M");function _Vo(t){for(let{name:e}of fvn(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(_Vo,"N");function CVo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(CVo,"G");function*vVo(t){for(let e of t){let r=CVo(e),n=r&&EVo(e.value);n&&(yield{...n,scope:r})}}a(vVo,"O");function bVo(t,e,r){let n={read:[],write:[...vVo(e)]};return t==="config"&&SVo(n,_Vo(e),AVo(e,r)),n}a(bVo,"L");function SVo(t,e,r){if(r===null)return;let n=yVo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(SVo,"$");var pvn={short:new Map([["c",!0]])},TVo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...pvn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},IVo={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"])}},xVo={short:new Map,long:new Set};function wVo(t){let e=IVo[t??""]??xVo;return{short:new Map([...pvn.short.entries(),...e.short.entries()]),long:e.long}}a(wVo,"I");function hvn(t,e=TVo){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 RVo(t,e.short)}a(hvn,"b");function RVo(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(RVo,"W");function kVo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[Xqt(t)[0]])(t=0)),e},"__init"),"__esm"),$Vo=a((t,e)=>a(function(){return e||(0,t[Xqt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),$h=a((t,e)=>{for(var r in e)Zqt(t,r,{get:e[r],enumerable:!0})},"__export"),VVo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Xqt(e))!GVo.call(t,o)&&o!==r&&Zqt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=HVo(e,o))||n.enumerable});return t},"__copyProps"),Gp=a(t=>VVo(Zqt({},"__esModule",{value:!0}),t),"__toCommonJS"),T3,aq=Jr({"src/lib/errors/git-error.ts"(){"use strict";T3=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),txe,Qle=Jr({"src/lib/errors/git-response-error.ts"(){"use strict";aq(),txe=class extends T3{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),Kvn,Jvn=Jr({"src/lib/errors/task-configuration-error.ts"(){"use strict";aq(),Kvn=class extends T3{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function Zvn(t){return typeof t!="function"?bK:t}a(Zvn,"asFunction");function Xvn(t){return typeof t=="function"&&t!==bK}a(Xvn,"isUserFunction");function ebn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(ebn,"splitOn");function tbn(t,e=0){return rbn(t)&&t.length>e?t[e]:void 0}a(tbn,"first");function vK(t,e=0){if(rbn(t)&&t.length>e)return t[t.length-1-e]}a(vK,"last");function rbn(t){return CJe(t)}a(rbn,"isArrayLike");function rxe(t="",e=!0,r=` -`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(rxe,"toLinesWithContent");function ejt(t,e){return rxe(t,!0).map(r=>e(r))}a(ejt,"forEachLineWithContent");function tjt(t){return(0,AJe.exists)(t,AJe.FOLDER)}a(tjt,"folderExists");function jx(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(jx,"append");function nbn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(nbn,"including");function yJe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(yJe,"remove");function fO(t){return Array.isArray(t)?t:[t]}a(fO,"asArray");function ibn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(ibn,"asCamelCase");function qle(t){return fO(t).map(e=>e instanceof String?e:String(e))}a(qle,"asStringArray");function fu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(fu,"asNumber");function XIe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(obn,"pick");function Lqt(t=0){return new Promise(e=>setTimeout(e,t))}a(Lqt,"delay");function Fqt(t){if(t!==!1)return t}a(Fqt,"orVoid");var Fle,bK,nxe,EJe=Jr({"src/lib/utils/util.ts"(){"use strict";rjt(),Fle="\0",bK=a(()=>{},"NOOP"),nxe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Jy(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(Jy,"filterType");function Uqt(t,e){let r=Ux(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(Uqt,"filterPrimitives");function _Je(t){return!!t&&nxe(t)==="[object Object]"}a(_Je,"filterPlainObject");function sbn(t){return typeof t=="function"}a(sbn,"filterFunction");var ixe,abn,Zf,pJe,CJe,rjt=Jr({"src/lib/utils/argument-filters.ts"(){"use strict";EJe(),ixe=a(t=>Array.isArray(t),"filterArray"),abn=a(t=>typeof t=="number","filterNumber"),Zf=a(t=>typeof t=="string"||Ux(t),"filterString"),pJe=a(t=>Zf(t)||Array.isArray(t)&&t.every(Zf),"filterStringOrStringArray"),CJe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),Qqt,WVo=Jr({"src/lib/utils/exit-codes.ts"(){"use strict";Qqt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(Qqt||{})}}),hJe,zVo=Jr({"src/lib/utils/git-output-streams.ts"(){"use strict";hJe=class cbn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new cbn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function YVo(){throw new Error("LineParser:useMatches not implemented")}a(YVo,"useMatchesDefault");var Po,sq,KVo=Jr({"src/lib/utils/line-parser.ts"(){"use strict";Po=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=YVo,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))}},sq=class extends Po{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 lbn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...ubn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(lbn,"createInstanceConfig");var ubn,JVo=Jr({"src/lib/utils/simple-git-options.ts"(){"use strict";ubn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function njt(t,e=[]){return _Je(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(Ux(o))r.push(o);else if(Uqt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)Uqt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(njt,"appendTaskOptions");function O_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=rxe(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(Fv,"parseStringResponse");var eWo=Jr({"src/lib/utils/task-parser.ts"(){"use strict";EJe()}}),dbn={};$h(dbn,{ExitCodes:a(()=>Qqt,"ExitCodes"),GitOutputStreams:a(()=>hJe,"GitOutputStreams"),LineParser:a(()=>Po,"LineParser"),NOOP:a(()=>bK,"NOOP"),NULL:a(()=>Fle,"NULL"),RemoteLineParser:a(()=>sq,"RemoteLineParser"),append:a(()=>jx,"append"),appendTaskOptions:a(()=>njt,"appendTaskOptions"),asArray:a(()=>fO,"asArray"),asCamelCase:a(()=>ibn,"asCamelCase"),asFunction:a(()=>Zvn,"asFunction"),asNumber:a(()=>fu,"asNumber"),asStringArray:a(()=>qle,"asStringArray"),bufferToString:a(()=>exe,"bufferToString"),callTaskParser:a(()=>qqt,"callTaskParser"),createInstanceConfig:a(()=>lbn,"createInstanceConfig"),delay:a(()=>Lqt,"delay"),filterArray:a(()=>ixe,"filterArray"),filterFunction:a(()=>sbn,"filterFunction"),filterHasLength:a(()=>CJe,"filterHasLength"),filterNumber:a(()=>abn,"filterNumber"),filterPlainObject:a(()=>_Je,"filterPlainObject"),filterPrimitives:a(()=>Uqt,"filterPrimitives"),filterString:a(()=>Zf,"filterString"),filterStringOrStringArray:a(()=>pJe,"filterStringOrStringArray"),filterType:a(()=>Jy,"filterType"),first:a(()=>tbn,"first"),folderExists:a(()=>tjt,"folderExists"),forEachLineWithContent:a(()=>ejt,"forEachLineWithContent"),getTrailingOptions:a(()=>O_,"getTrailingOptions"),including:a(()=>nbn,"including"),isUserFunction:a(()=>Xvn,"isUserFunction"),last:a(()=>vK,"last"),objectToString:a(()=>nxe,"objectToString"),orVoid:a(()=>Fqt,"orVoid"),parseStringResponse:a(()=>Fv,"parseStringResponse"),pick:a(()=>obn,"pick"),prefixedArray:a(()=>XIe,"prefixedArray"),remove:a(()=>yJe,"remove"),splitOn:a(()=>ebn,"splitOn"),toLinesWithContent:a(()=>rxe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Nd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>ijt,"trailingOptionsArgument")});var oo=Jr({"src/lib/utils/index.ts"(){"use strict";rjt(),WVo(),zVo(),KVo(),JVo(),XVo(),eWo(),EJe()}}),fbn={};$h(fbn,{CheckRepoActions:a(()=>jqt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>hbn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>pbn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>tWo,"checkIsRepoTask")});function tWo(t){switch(t){case"bare":return hbn();case"root":return pbn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:vJe,parser:ojt}}a(tWo,"checkIsRepoTask");function pbn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:vJe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(pbn,"checkIsRepoRootTask");function hbn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:vJe,parser:ojt}}a(hbn,"checkIsBareRepoTask");function rWo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(rWo,"isNotRepoMessage");var jqt,vJe,ojt,mbn=Jr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),jqt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(jqt||{}),vJe=a(({exitCode:t},e,r,n)=>{if(t===128&&rWo(e))return r(Buffer.from("false"));n(e)},"onError"),ojt=a(t=>t.trim()==="true","parser")}});function nWo(t,e){let r=new gbn(t),n=t?ybn:Abn;return rxe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(Ebn.test(s)?r.folders:r.files).push(s)}),r}a(nWo,"cleanSummaryParser");var gbn,Abn,ybn,Ebn,iWo=Jr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),gbn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Abn=/^[a-z]+\s*/i,ybn=/^[a-z]+\s+[a-z]+\s*/i,Ebn=/\/$/}}),Hqt={};$h(Hqt,{EMPTY_COMMANDS:a(()=>bJe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>_bn,"adhocExecTask"),configurationErrorTask:a(()=>Lv,"configurationErrorTask"),isBufferTask:a(()=>vbn,"isBufferTask"),isEmptyTask:a(()=>bbn,"isEmptyTask"),straightThroughBufferTask:a(()=>Cbn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>B_,"straightThroughStringTask")});function _bn(t){return{commands:bJe,format:"empty",parser:t}}a(_bn,"adhocExecTask");function Lv(t){return{commands:bJe,format:"empty",parser(){throw typeof t=="string"?new Kvn(t):t}}}a(Lv,"configurationErrorTask");function B_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(B_,"straightThroughStringTask");function Cbn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(Cbn,"straightThroughBufferTask");function vbn(t){return t.format==="buffer"}a(vbn,"isBufferTask");function bbn(t){return t.format==="empty"||!t.commands.length}a(bbn,"isEmptyTask");var bJe,$p=Jr({"src/lib/tasks/task.ts"(){"use strict";Jvn(),bJe=[]}}),Sbn={};$h(Sbn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>sjt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>ajt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>cjt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>lJe,"CleanOptions"),cleanTask:a(()=>Tbn,"cleanTask"),cleanWithOptionsTask:a(()=>oWo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>sWo,"isCleanOptionsArray")});function oWo(t,e){let{cleanMode:r,options:n,valid:o}=aWo(t);return r?o.options?(n.push(...e),n.some(uWo)?Lv(sjt):Tbn(r,n)):Lv(cjt+JSON.stringify(t)):Lv(ajt)}a(oWo,"cleanWithOptionsTask");function Tbn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return nWo(t==="n",n)}}}a(Tbn,"cleanTask");function sWo(t){return Array.isArray(t)&&t.every(e=>ljt.has(e))}a(sWo,"isCleanOptionsArray");function aWo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{cWo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&lWo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(aWo,"getCleanOptions");function cWo(t){return t==="f"||t==="n"}a(cWo,"isCleanMode");function lWo(t){return/^-[a-z]$/i.test(t)&&ljt.has(t.charAt(1))}a(lWo,"isKnownOption");function uWo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(uWo,"isInteractiveMode");var sjt,ajt,cjt,lJe,ljt,Ibn=Jr({"src/lib/tasks/clean.ts"(){"use strict";iWo(),oo(),$p(),sjt="Git clean interactive mode is not supported",ajt='Git clean mode parameter ("n" or "f") is required',cjt="Git clean unknown option found in: ",lJe=(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))(lJe||{}),ljt=new Set(["i",...qle(Object.values(lJe))])}});function dWo(t){let e=new wbn;for(let r of xbn(t))e.addValue(r.file,String(r.key),r.value);return e}a(dWo,"configListParser");function fWo(t,e){let r=null,n=[],o=new Map;for(let s of xbn(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(fWo,"configGetParser");function pWo(t){return t.replace(/^(file):/,"")}a(pWo,"configFilePath");function*xbn(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=vK(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 Pqt(t,e){return typeof t=="string"&&Object.hasOwn(Gqt,t)?t:e}a(Pqt,"asConfigScope");function mWo(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(mWo,"addConfigTask");function gWo(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 fWo(n,t)}}}a(gWo,"getConfigTask");function AWo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return dWo(r)}}}a(AWo,"listConfigTask");function yWo(){return{addConfig(t,e,...r){return this._runTask(mWo(t,e,r[0]===!0,Pqt(r[1],"local")),Nd(arguments))},getConfig(t,e){return this._runTask(gWo(t,Pqt(e,void 0)),Nd(arguments))},listConfig(...t){return this._runTask(AWo(Pqt(t[0],void 0)),Nd(arguments))}}}a(yWo,"config_default");var Gqt,Rbn=Jr({"src/lib/tasks/config.ts"(){"use strict";hWo(),oo(),Gqt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Gqt||{})}});function EWo(t){return kbn.has(t)}a(EWo,"isDiffNameStatus");var Dqt,kbn,Pbn=Jr({"src/lib/tasks/diff-name-status.ts"(){"use strict";Dqt=(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))(Dqt||{}),kbn=new Set(Object.values(Dqt))}});function _Wo(...t){return new Nbn().param(...t)}a(_Wo,"grepQueryBuilder");function CWo(t){let e=new Set,r={};return ejt(t,n=>{let[o,s,c]=n.split(Fle);e.add(o),(r[o]=r[o]||[]).push({line:fu(s),path:o,preview:c})}),{paths:e,results:r}}a(CWo,"parseGrep");function vWo(){return{grep(t){let e=Nd(arguments),r=O_(arguments);for(let o of Dbn)if(r.includes(o))return this._runTask(Lv(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=_Wo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return CWo(o)}},e)}}}a(vWo,"grep_default");var Dbn,ZIe,Evn,Nbn,Mbn=Jr({"src/lib/tasks/grep.ts"(){"use strict";oo(),$p(),Dbn=["-h"],ZIe=Symbol("grepQuery"),Nbn=class{static{a(this,"GrepQuery")}constructor(){this[Evn]=[]}*[(Evn=ZIe,Symbol.iterator)](){for(let t of this[ZIe])yield t}and(...t){return t.length&&this[ZIe].push("--and","(",...XIe(t,"-e"),")"),this}param(...t){return this[ZIe].push(...XIe(t,"-e")),this}}}}),Obn={};$h(Obn,{ResetMode:a(()=>uJe,"ResetMode"),getResetMode:a(()=>SWo,"getResetMode"),resetTask:a(()=>bWo,"resetTask")});function bWo(t,e){let r=["reset"];return Bbn(t)&&r.push(`--${t}`),r.push(...e),B_(r)}a(bWo,"resetTask");function SWo(t){if(Bbn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(SWo,"getResetMode");function Bbn(t){return typeof t=="string"&&Lbn.includes(t)}a(Bbn,"isValidResetMode");var uJe,Lbn,Fbn=Jr({"src/lib/tasks/reset.ts"(){"use strict";oo(),$p(),uJe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(uJe||{}),Lbn=qle(Object.values(uJe))}});function TWo(){return(0,mJe.default)("simple-git")}a(TWo,"createLog");function _vn(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(_vn,"prefixedLogger");function IWo(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(IWo,"childLoggerName");function ujt(t,e,r,n=TWo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=IWo(Jy(e,Zf),c,n);return d(r);function u(f,h){return jx(s,ujt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&_vn(c,h)||bK,g=_vn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(ujt,"createLogger");var Ubn=Jr({"src/lib/git-logger.ts"(){"use strict";oo(),mJe.default.formatters.L=t=>String(CJe(t)?t.length:"-"),mJe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):nxe(t)}}),Qbn,xWo=Jr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";aq(),Ubn(),Qbn=class $qt{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=$qt.getName(e.commands[0]),n=ujt(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 T3(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++$qt.counter}`}static{this.counter=0}}}});function CK(t,e){return{method:tbn(t.commands)||"",commands:e}}a(CK,"pluginContext");function wWo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(wWo,"onErrorReceived");function Cvn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(Cvn,"onDataReceived");var Vqt,RWo=Jr({"src/lib/runners/git-executor-chain.ts"(){"use strict";aq(),$p(),oo(),xWo(),Vqt=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 Qbn}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(bbn(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 T3?Object.assign(e,{task:t}):new T3(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","",CK(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...CK(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),vbn(t)?qqt(t.parser,s):qqt(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},{...CK(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",nxe(h)),u(new hJe(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 hJe(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},CK(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,{...CK(t,r),kill(m){f=m||f}});let h=(0,qbn.spawn)(e,r,c);h.stdout.on("data",Cvn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",Cvn(d,"stdErr",o,s.step("stdErr"))),h.on("error",wWo(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,{...CK(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,{...CK(t,e),kill(n){r=n||r}}),r}}}}),jbn={};$h(jbn,{GitExecutor:a(()=>Hbn,"GitExecutor")});var Hbn,kWo=Jr({"src/lib/runners/git-executor.ts"(){"use strict";RWo(),Hbn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new Vqt(this,this._scheduler,this._plugins)}chain(){return new Vqt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function PWo(t,e,r=bK){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof txe?DWo(s):s,void 0)},"onError2");e.then(n,o)}a(PWo,"taskCallback");function DWo(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=bK},"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(DWo,"addDeprecationNoticeToError");var NWo=Jr({"src/lib/task-callback.ts"(){"use strict";Qle(),oo()}});function vvn(t,e){return _bn(r=>{if(!tjt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(vvn,"changeWorkingDirectoryTask");var MWo=Jr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),$p()}});function Nqt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=yJe(e,"-B")),B_(e)}a(Nqt,"checkoutTask");function OWo(){return{checkout(){return this._runTask(Nqt(O_(arguments,1)),Nd(arguments))},checkoutBranch(t,e){return this._runTask(Nqt(["-b",t,e,...O_(arguments)]),Nd(arguments))},checkoutLocalBranch(t){return this._runTask(Nqt(["-b",t,...O_(arguments)]),Nd(arguments))}}}a(OWo,"checkout_default");var BWo=Jr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),$p()}});function LWo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(LWo,"countObjectsResponse");function FWo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Fv(LWo(),[Gbn],t)}})}}}a(FWo,"count_objects_default");var Gbn,UWo=Jr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),Gbn=new Po(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=ibn(e);Object.hasOwn(t,n)&&(t[n]=fu(r))})}});function QWo(t){return Fv({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},$bn,t)}a(QWo,"parseCommitResult");var $bn,qWo=Jr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),$bn=[new Po(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new Po(/\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 Po(/(\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 Po(/^(\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 jWo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...XIe(t,"-m"),...e,...r],format:"utf-8",parser:QWo}}a(jWo,"commitTask");function HWo(){return{commit(e,...r){let n=Nd(arguments),o=t(e)||jWo(fO(e),fO(Jy(r[0],pJe,[])),[...qle(Jy(r[1],ixe,[])),...O_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!pJe(e)&&Lv("git.commit: requires the commit message to be supplied as a string/string[]")}}a(HWo,"commit_default");var GWo=Jr({"src/lib/tasks/commit.ts"(){"use strict";qWo(),oo(),$p()}});function $Wo(){return{firstCommit(){return this._runTask(B_(["rev-list","--max-parents=0","HEAD"],!0),Nd(arguments))}}}a($Wo,"first_commit_default");var VWo=Jr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),$p()}});function WWo(t,e){let r=["hash-object",t];return e&&r.push("-w"),B_(r,!0)}a(WWo,"hashObjectTask");var zWo=Jr({"src/lib/tasks/hash-object.ts"(){"use strict";$p()}});function YWo(t,e,r){let n=String(r).trim(),o;if(o=Vbn.exec(n))return new dJe(t,e,!1,o[1]);if(o=Wbn.exec(n))return new dJe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new dJe(t,e,/^re/i.test(n),s)}a(YWo,"parseInit");var dJe,Vbn,Wbn,KWo=Jr({"src/lib/responses/InitSummary.ts"(){"use strict";dJe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},Vbn=/^Init.+ repository in (.+)$/,Wbn=/^Rein.+ in (.+)$/}});function JWo(t){return t.includes(djt)}a(JWo,"hasBareCommand");function ZWo(t=!1,e,r){let n=["init",...r];return t&&!JWo(n)&&n.splice(1,0,djt),{commands:n,format:"utf-8",parser(o){return YWo(n.includes("--bare"),e,o)}}}a(ZWo,"initTask");var djt,XWo=Jr({"src/lib/tasks/init.ts"(){"use strict";KWo(),djt="--bare"}});function fjt(t){for(let e=0;eFv(new zbn,e,r,!1)}a(Ybn,"getDiffParser");var Mqt,bvn,Svn,Tvn,Kbn,Jbn=Jr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";oxe(),tzo(),Pbn(),oo(),Mqt=[new Po(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:fu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new Po(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:fu(r),after:fu(n),binary:!0})}),new Po(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=fu(e),t.insertions=fu(n?.[1]),t.deletions=fu(o?.[1])})],bvn=[new Po(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=fu(e),s=fu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new Po(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],Svn=[new Po(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],Tvn=[new Po(/([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:Fqt(EWo(e)&&e),from:Fqt(!!s&&n!==s&&n),similarity:fu(r)})})],Kbn={"":Mqt,"--stat":Mqt,"--numstat":bvn,"--name-status":Tvn,"--name-only":Svn}}});function rzo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(rzo,"lineBuilder");function Zbn(t=gjt,e=Xbn,r=""){let n=Ybn(r);return function(o){let s=rxe(o.trim(),!1,hjt).map(function(c){let l=c.split(mjt),u=rzo(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(Zbn,"createListLogSummaryParser");var hjt,mjt,gjt,Xbn,e1n=Jr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),Jbn(),oxe(),hjt="\xF2\xF2\xF2\xF2\xF2\xF2 ",mjt=" \xF2\xF2",gjt=" \xF2 ",Xbn=["hash","date","message","refs","author_name","author_email"]}}),t1n={};$h(t1n,{diffSummaryTask:a(()=>nzo,"diffSummaryTask"),validateLogFormatConfig:a(()=>SJe,"validateLogFormatConfig")});function nzo(t){let e=fjt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),SJe(r)||{commands:r,format:"utf-8",parser:Ybn(e)}}a(nzo,"diffSummaryTask");function SJe(t){let e=t.filter(ezo);if(e.length>1)return Lv(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return Lv(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(SJe,"validateLogFormatConfig");var Ajt=Jr({"src/lib/tasks/diff.ts"(){"use strict";oxe(),Jbn(),$p()}});function izo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(izo,"prettyFormat");function ozo(t){return Object.keys(t).reduce((e,r)=>(r in Wqt||(e[r]=t[r]),e),{})}a(ozo,"userOptions");function r1n(t={},e=[]){let r=Jy(t.splitter,Zf,gjt),n=_Je(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]=izo(n,r),c=[],l=[`--pretty=format:${hjt}${s}${mjt}`,...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 Zf(t.file)&&l.push("--follow",Ple(t.file)),njt(ozo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(r1n,"parseLogOptions");function szo(t,e,r){let n=Zbn(t,e,fjt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(szo,"logTask");function azo(){return{log(...r){let n=Nd(arguments),o=r1n(ijt(arguments),qle(Jy(arguments[0],ixe,[]))),s=e(...r)||SJe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return szo(r.splitter,r.fields,r.commands)}function e(r,n){return Zf(r)&&Zf(n)&&Lv("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(azo,"log_default");var Wqt,n1n=Jr({"src/lib/tasks/log.ts"(){"use strict";oxe(),e1n(),oo(),$p(),Ajt(),Wqt=(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))(Wqt||{})}}),fJe,i1n,czo=Jr({"src/lib/responses/MergeSummary.ts"(){"use strict";fJe=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}`}},i1n=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"}}}}),zqt,o1n,lzo=Jr({"src/lib/responses/PullSummary.ts"(){"use strict";zqt=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}}},o1n=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Oqt(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(Oqt,"objectEnumerationResult");function Ivn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:fu(e&&e[1]||"0"),delta:fu(r&&r[1]||"0")}}a(Ivn,"asObjectCount");var s1n,uzo=Jr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),s1n=[new sq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=Oqt(t.remoteMessages);Object.assign(o,{[n]:fu(r)})}),new sq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=Oqt(t.remoteMessages);Object.assign(o,{[n]:fu(r)})}),new sq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=Oqt(t.remoteMessages);o.total=Ivn(e),o.reused=Ivn(r),o.packReused=fu(n)})]}});function a1n(t,e){return Fv({remoteMessages:new l1n},c1n,e)}a(a1n,"parseRemoteMessages");var c1n,l1n,u1n=Jr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),uzo(),c1n=[new sq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...s1n,new sq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new sq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:fu(e),summary:r,url:n}})],l1n=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function dzo(t,e){let r=Fv(new o1n,d1n,[t,e]);return r.message&&r}a(dzo,"parsePullErrorResult");var xvn,wvn,Rvn,kvn,d1n,Pvn,yjt,f1n=Jr({"src/lib/parsers/parse-pull.ts"(){"use strict";lzo(),oo(),u1n(),xvn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,wvn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Rvn=/^(create|delete) mode \d+ (.+)/,kvn=[new Po(xvn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Po(wvn,(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 Po(Rvn,(t,[e,r])=>{jx(t.files,r),jx(e==="create"?t.created:t.deleted,r)})],d1n=[new Po(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new Po(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new Po(/([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})],Pvn=a((t,e)=>Fv(new zqt,kvn,[t,e]),"parsePullDetail"),yjt=a((t,e)=>Object.assign(new zqt,Pvn(t,e),a1n(t,e)),"parsePullResult")}}),Dvn,p1n,Nvn,fzo=Jr({"src/lib/parsers/parse-merge.ts"(){"use strict";czo(),oo(),f1n(),Dvn=[new Po(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new Po(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new fJe(e,r))}),new Po(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new fJe(e,r,{deleteRef:n}))}),new Po(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new fJe(e,null))}),new Po(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],p1n=a((t,e)=>Object.assign(Nvn(t,e),yjt(t,e)),"parseMergeResult"),Nvn=a(t=>Fv(new i1n,Dvn,t),"parseMergeDetail")}});function Mvn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=p1n(e,r);if(n.failed)throw new txe(n);return n}}:Lv("Git.merge requires at least one option")}a(Mvn,"mergeTask");var pzo=Jr({"src/lib/tasks/merge.ts"(){"use strict";Qle(),fzo(),$p()}});function hzo(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(hzo,"pushResultPushedItem");var Ovn,h1n,Bvn,mzo=Jr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),u1n(),Ovn=[new Po(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new Po(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new Po(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(hzo(e,r,n))}),new Po(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new Po(/^([^:]+):(\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}}})],h1n=a((t,e)=>{let r=Bvn(t,e),n=a1n(t,e);return{...r,...n}},"parsePushResult"),Bvn=a((t,e)=>Fv({pushed:[]},Ovn,[t,e]),"parsePushDetail")}}),m1n={};$h(m1n,{pushTagsTask:a(()=>gzo,"pushTagsTask"),pushTask:a(()=>Ejt,"pushTask")});function gzo(t={},e){return jx(e,"--tags"),Ejt(t,e)}a(gzo,"pushTagsTask");function Ejt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),yJe(r,"-v"),jx(r,"--verbose"),jx(r,"--porcelain"),{commands:r,format:"utf-8",parser:h1n}}a(Ejt,"pushTask");var g1n=Jr({"src/lib/tasks/push.ts"(){"use strict";mzo(),oo()}});function Azo(){return{showBuffer(){let t=["show",...O_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(Cbn(t),Nd(arguments))},show(){let t=["show",...O_(arguments,1)];return this._runTask(B_(t),Nd(arguments))}}}a(Azo,"show_default");var yzo=Jr({"src/lib/tasks/show.ts"(){"use strict";oo(),$p()}}),Lvn,A1n,Ezo=Jr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Lvn=/^(.+)\0(.+)$/,A1n=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=Lvn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function Fvn(t){let[e,r]=t.split(Fle);return{from:r||e,to:e}}a(Fvn,"renamedFile");function US(t,e,r){return[`${t}${e}`,r]}a(US,"parser3");function Bqt(t,...e){return e.map(r=>US(t,r,(n,o)=>n.conflicted.push(o)))}a(Bqt,"conflicts");function _zo(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=y1n.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new A1n(c,o,s))}a(n,"data")}a(_zo,"splitLine");var Uvn,y1n,E1n,Czo=Jr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),Ezo(),Uvn=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}},y1n=new Map([US(" ","A",(t,e)=>t.created.push(e)),US(" ","D",(t,e)=>t.deleted.push(e)),US(" ","M",(t,e)=>t.modified.push(e)),US("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),US("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),US("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),US("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),US("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),US("R"," ",(t,e)=>{t.renamed.push(Fvn(e))}),US("R","M",(t,e)=>{let r=Fvn(e);t.renamed.push(r),t.modified.push(r.to)}),US("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),US("?","?",(t,e)=>t.not_added.push(e)),...Bqt("A","A","U"),...Bqt("D","D","U"),...Bqt("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=Jy(l?.[1],Zf,null),l=s.exec(e),t.tracking=Jy(l?.[1],Zf,null),l=c.exec(e),l&&(t.current=Jy(l?.[1],Zf,t.current)),t.detached=/\(no branch\)/.test(e)}]]),E1n=a(function(t){let e=t.split(Fle),r=new Uvn;for(let n=0,o=e.length;n!_1n.includes(r))],parser(r){return E1n(r)}}}a(vzo,"statusTask");var _1n,bzo=Jr({"src/lib/tasks/status.ts"(){"use strict";Czo(),_1n=["--null","-z"]}});function gJe(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(gJe,"versionResponse");function Szo(){return gJe(0,0,0,"",!1)}a(Szo,"notInstalledResponse");function Tzo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Izo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(_jt));n(e)}})}}}a(Tzo,"version_default");function Izo(t){return t===_jt?Szo():Fv(gJe(0,0,0,t),C1n,t)}a(Izo,"versionParser");var _jt,C1n,xzo=Jr({"src/lib/tasks/version.ts"(){"use strict";oo(),_jt="installed=false",C1n=[new Po(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,gJe(fu(e),fu(r),fu(n),o))}),new Po(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,gJe(fu(e),fu(r),n,o))})]}});function Qvn(t,e,r,...n){return Zf(r)?e(r,Jy(n[0],Zf),O_(arguments)):Lv(`git.${t}() requires a string 'repoPath'`)}a(Qvn,"createCloneTask");function wzo(){return{clone(t,...e){return this._runTask(Qvn("clone",Yqt,Jy(t,Zf),...e),Nd(arguments))},mirror(t,...e){return this._runTask(Qvn("mirror",v1n,Jy(t,Zf),...e),Nd(arguments))}}}a(wzo,"clone_default");var Yqt,v1n,Rzo=Jr({"src/lib/tasks/clone.ts"(){"use strict";$p(),oo(),Yqt=a((t,e,r)=>{let n=["clone",...r];return Zf(t)&&n.push(Ple(t)),Zf(e)&&n.push(Ple(e)),B_(n)},"cloneTask"),v1n=a((t,e,r)=>(jx(r,"--mirror"),Yqt(t,e,r)),"cloneMirrorTask")}}),b1n={};$h(b1n,{SimpleGitApi:a(()=>Kqt,"SimpleGitApi")});var Kqt,kzo=Jr({"src/lib/simple-git-api.ts"(){"use strict";NWo(),MWo(),BWo(),UWo(),GWo(),Rbn(),VWo(),Mbn(),zWo(),XWo(),n1n(),pzo(),g1n(),yzo(),bzo(),$p(),xzo(),oo(),Rzo(),Kqt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&PWo(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(B_(["add",...fO(t)]),Nd(arguments))}cwd(t){let e=Nd(arguments);return typeof t=="string"?this._runTask(vvn(t,this._executor),e):typeof t?.path=="string"?this._runTask(vvn(t.path,t.root&&this._executor||void 0),e):this._runTask(Lv("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(WWo(t,e===!0),Nd(arguments))}init(t){return this._runTask(ZWo(t===!0,this._executor.cwd,O_(arguments)),Nd(arguments))}merge(){return this._runTask(Mvn(O_(arguments)),Nd(arguments))}mergeFromTo(t,e){return Zf(t)&&Zf(e)?this._runTask(Mvn([t,e,...O_(arguments)]),Nd(arguments,!1)):this._runTask(Lv("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Ejt({remote:Jy(arguments[0],Zf),branch:Jy(arguments[1],Zf)},O_(arguments));return this._runTask(t,Nd(arguments))}stash(){return this._runTask(B_(["stash",...O_(arguments)]),Nd(arguments))}status(){return this._runTask(vzo(O_(arguments)),Nd(arguments))}},Object.assign(Kqt.prototype,OWo(),wzo(),HWo(),yWo(),FWo(),$Wo(),vWo(),azo(),Azo(),Tzo())}}),S1n={};$h(S1n,{Scheduler:a(()=>I1n,"Scheduler")});var qvn,I1n,Pzo=Jr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),Ubn(),qvn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,T1n.createDeferred)();return{promise:e,done:r,id:t}}})(),I1n=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=ujt("","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=jx(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),yJe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=jx(this.pending,qvn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),x1n={};$h(x1n,{applyPatchTask:a(()=>Dzo,"applyPatchTask")});function Dzo(t,e){return B_(["apply",...e,...t])}a(Dzo,"applyPatchTask");var Nzo=Jr({"src/lib/tasks/apply-patch.ts"(){"use strict";$p()}});function Mzo(t,e){return{branch:t,hash:e,success:!0}}a(Mzo,"branchDeletionSuccess");function Ozo(t){return{branch:t,hash:null,success:!1}}a(Ozo,"branchDeletionFailure");var w1n,Bzo=Jr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";w1n=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function R1n(t,e){return e===1&&Jqt.test(t)}a(R1n,"hasBranchDeletionError");var jvn,Jqt,Hvn,TJe,Lzo=Jr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";Bzo(),oo(),jvn=/(\S+)\s+\(\S+\s([^)]+)\)/,Jqt=/^error[^']+'([^']+)'/m,Hvn=[new Po(jvn,(t,[e,r])=>{let n=Mzo(e,r);t.all.push(n),t.branches[e]=n}),new Po(Jqt,(t,[e])=>{let r=Ozo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],TJe=a((t,e)=>Fv(new w1n,Hvn,[t,e]),"parseBranchDeletions")}}),k1n,Fzo=Jr({"src/lib/responses/BranchSummary.ts"(){"use strict";k1n=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 Gvn(t){return t?t.charAt(0):""}a(Gvn,"branchStatus");function P1n(t,e=!1){return Fv(new k1n,e?[N1n]:D1n,t)}a(P1n,"parseBranchSummary");var D1n,N1n,Uzo=Jr({"src/lib/parsers/parse-branch.ts"(){"use strict";Fzo(),oo(),D1n=[new Po(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(Gvn(e),!0,r,n,o)}),new Po(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(Gvn(e),!1,r,n,o)})],N1n=new Po(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),M1n={};$h(M1n,{branchLocalTask:a(()=>qzo,"branchLocalTask"),branchTask:a(()=>Qzo,"branchTask"),containsDeleteBranchCommand:a(()=>O1n,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>Hzo,"deleteBranchTask"),deleteBranchesTask:a(()=>jzo,"deleteBranchesTask")});function O1n(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(O1n,"containsDeleteBranchCommand");function Qzo(t){let e=O1n(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?TJe(o,s).all[0]:P1n(o,r)}}}a(Qzo,"branchTask");function qzo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return P1n(t)}}}a(qzo,"branchLocalTask");function jzo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return TJe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!R1n(String(o),r))return c(o);s(n)}}}a(jzo,"deleteBranchesTask");function Hzo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return TJe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!R1n(String(c),n))return u(c);throw new txe(r.parser(exe(s),exe(o)),String(c))}};return r}a(Hzo,"deleteBranchTask");var Gzo=Jr({"src/lib/tasks/branch.ts"(){"use strict";Qle(),Lzo(),Uzo(),oo()}});function $zo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,B1n.normalize)(e)}a($zo,"toPath");var L1n,Vzo=Jr({"src/lib/responses/CheckIgnore.ts"(){"use strict";L1n=a(t=>t.split(/\n/g).map($zo).filter(Boolean),"parseCheckIgnore")}}),F1n={};$h(F1n,{checkIgnoreTask:a(()=>Wzo,"checkIgnoreTask")});function Wzo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:L1n}}a(Wzo,"checkIgnoreTask");var zzo=Jr({"src/lib/tasks/check-ignore.ts"(){"use strict";Vzo()}});function Yzo(t,e){return Fv({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},U1n,[t,e])}a(Yzo,"parseFetchResult");var U1n,Kzo=Jr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),U1n=[new Po(/From (.+)$/,(t,[e])=>{t.remote=e}),new Po(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new Po(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new Po(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new Po(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),Q1n={};$h(Q1n,{fetchTask:a(()=>Zzo,"fetchTask")});function Jzo(t){return/^--upload-pack(=|$)/.test(t)}a(Jzo,"disallowedCommand");function Zzo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(Jzo)?Lv("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Yzo}}a(Zzo,"fetchTask");var Xzo=Jr({"src/lib/tasks/fetch.ts"(){"use strict";Kzo(),$p()}});function eYo(t){return Fv({moves:[]},q1n,t)}a(eYo,"parseMoveResult");var q1n,tYo=Jr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),q1n=[new Po(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),j1n={};$h(j1n,{moveTask:a(()=>rYo,"moveTask")});function rYo(t,e){return{commands:["mv","-v",...fO(t),e],format:"utf-8",parser:eYo}}a(rYo,"moveTask");var nYo=Jr({"src/lib/tasks/move.ts"(){"use strict";tYo(),oo()}}),H1n={};$h(H1n,{pullTask:a(()=>iYo,"pullTask")});function iYo(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 yjt(o,s)},onError(o,s,c,l){let u=dzo(exe(o.stdOut),exe(o.stdErr));if(u)return l(new txe(u));l(s)}}}a(iYo,"pullTask");var oYo=Jr({"src/lib/tasks/pull.ts"(){"use strict";Qle(),f1n(),oo()}});function sYo(t){let e={};return G1n(t,([r])=>e[r]={name:r}),Object.values(e)}a(sYo,"parseGetRemotes");function aYo(t){let e={};return G1n(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(aYo,"parseGetRemotesVerbose");function G1n(t,e){ejt(t,r=>e(r.split(/\s+/)))}a(G1n,"forEach");var cYo=Jr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),$1n={};$h($1n,{addRemoteTask:a(()=>lYo,"addRemoteTask"),getRemotesTask:a(()=>uYo,"getRemotesTask"),listRemotesTask:a(()=>dYo,"listRemotesTask"),remoteTask:a(()=>fYo,"remoteTask"),removeRemoteTask:a(()=>pYo,"removeRemoteTask")});function lYo(t,e,r){return B_(["remote","add",...r,t,e])}a(lYo,"addRemoteTask");function uYo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?aYo:sYo}}a(uYo,"getRemotesTask");function dYo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),B_(e)}a(dYo,"listRemotesTask");function fYo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),B_(e)}a(fYo,"remoteTask");function pYo(t){return B_(["remote","remove",t])}a(pYo,"removeRemoteTask");var hYo=Jr({"src/lib/tasks/remote.ts"(){"use strict";cYo(),$p()}}),V1n={};$h(V1n,{stashListTask:a(()=>mYo,"stashListTask")});function mYo(t={},e){let r=r1n(t),n=["stash","list",...r.commands,...e],o=Zbn(r.splitter,r.fields,fjt(n));return SJe(n)||{commands:n,format:"utf-8",parser:o}}a(mYo,"stashListTask");var gYo=Jr({"src/lib/tasks/stash-list.ts"(){"use strict";oxe(),e1n(),Ajt(),n1n()}}),W1n={};$h(W1n,{addSubModuleTask:a(()=>AYo,"addSubModuleTask"),initSubModuleTask:a(()=>yYo,"initSubModuleTask"),subModuleTask:a(()=>IJe,"subModuleTask"),updateSubModuleTask:a(()=>EYo,"updateSubModuleTask")});function AYo(t,e){return IJe(["add",t,e])}a(AYo,"addSubModuleTask");function yYo(t){return IJe(["init",...t])}a(yYo,"initSubModuleTask");function IJe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),B_(e)}a(IJe,"subModuleTask");function EYo(t){return IJe(["update",...t])}a(EYo,"updateSubModuleTask");var _Yo=Jr({"src/lib/tasks/sub-module.ts"(){"use strict";$p()}});function CYo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?z1n(t,e):0}a(CYo,"singleSorted");function z1n(t,e){return t===e?0:t>e?1:-1}a(z1n,"sorted");function vYo(t){return t.trim()}a(vYo,"trimmed");function cJe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(cJe,"toNumber");var $vn,Y1n,bYo=Jr({"src/lib/responses/TagList.ts"(){"use strict";$vn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},Y1n=a(function(t,e=!1){let r=t.split(` -`).map(vYo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return CYo(cJe(c[0]),cJe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new $vn(r,n)},"parseTagList")}}),K1n={};$h(K1n,{addAnnotatedTagTask:a(()=>IYo,"addAnnotatedTagTask"),addTagTask:a(()=>TYo,"addTagTask"),tagListTask:a(()=>SYo,"tagListTask")});function SYo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return Y1n(r,e)}}}a(SYo,"tagListTask");function TYo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(TYo,"addTagTask");function IYo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(IYo,"addAnnotatedTagTask");var xYo=Jr({"src/lib/tasks/tag.ts"(){"use strict";bYo()}}),wYo=$Vo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(kWo(),Gp(jbn)),{SimpleGitApi:n}=(kzo(),Gp(b1n)),{Scheduler:o}=(Pzo(),Gp(S1n)),{adhocExecTask:s,configurationErrorTask:c}=($p(),Gp(Hqt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),Gp(dbn)),{applyPatchTask:E}=(Nzo(),Gp(x1n)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(Gzo(),Gp(M1n)),{checkIgnoreTask:w}=(zzo(),Gp(F1n)),{checkIsRepoTask:R}=(mbn(),Gp(fbn)),{cleanWithOptionsTask:x,isCleanOptionsArray:k}=(Ibn(),Gp(Sbn)),{diffSummaryTask:D}=(Ajt(),Gp(t1n)),{fetchTask:N}=(Xzo(),Gp(Q1n)),{moveTask:L}=(nYo(),Gp(j1n)),{pullTask:B}=(oYo(),Gp(H1n)),{pushTagsTask:Q}=(g1n(),Gp(m1n)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:q,remoteTask:F,removeRemoteTask:U}=(hYo(),Gp($1n)),{getResetMode:W,resetTask:V}=(Fbn(),Gp(Obn)),{stashListTask:G}=(gYo(),Gp(V1n)),{addSubModuleTask:Y,initSubModuleTask:re,subModuleTask:j,updateSubModuleTask:X}=(_Yo(),Gp(W1n)),{addAnnotatedTagTask:ie,addTagTask:we,tagListTask:Ae}=(xYo(),Gp(K1n)),{straightThroughBufferTask:De,straightThroughStringTask:Te}=($p(),Gp(Hqt));function Z(J,z){this._plugins=z,this._executor=new r(J.baseDir,new o(J.maxConcurrentProcesses),z),this._trimmed=J.trimmed}a(Z,"Git2"),(Z.prototype=Object.create(n.prototype)).constructor=Z,Z.prototype.customBinary=function(J){return this._plugins.reconfigure("binary",J),this},Z.prototype.env=function(J,z){return arguments.length===1&&typeof J=="object"?this._executor.env=J:(this._executor.env=this._executor.env||{})[J]=z,this},Z.prototype.stashList=function(J){return this._runTask(G(y(arguments)||{},u(J)&&J||[]),A(arguments))},Z.prototype.mv=function(J,z){return this._runTask(L(J,z),A(arguments))},Z.prototype.checkoutLatestTag=function(J){var z=this;return this.pull(function(){z.tags(function(le,K){z.checkout(K.latest,J)})})},Z.prototype.pull=function(J,z,le,K){return this._runTask(B(m(J,f),m(z,f),g(arguments)),A(arguments))},Z.prototype.fetch=function(J,z){return this._runTask(N(m(J,f),m(z,f),g(arguments)),A(arguments))},Z.prototype.silent=function(J){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.")))},Z.prototype.tags=function(J,z){return this._runTask(Ae(g(arguments)),A(arguments))},Z.prototype.rebase=function(){return this._runTask(Te(["rebase",...g(arguments)]),A(arguments))},Z.prototype.reset=function(J){return this._runTask(V(W(J),g(arguments)),A(arguments))},Z.prototype.revert=function(J){let z=A(arguments);return typeof J!="string"?this._runTask(c("Commit must be a string"),z):this._runTask(Te(["revert",...g(arguments,0,!0),J]),z)},Z.prototype.addTag=function(J){let z=typeof J=="string"?we(J):c("Git.addTag requires a tag name");return this._runTask(z,A(arguments))},Z.prototype.addAnnotatedTag=function(J,z){return this._runTask(ie(J,z),A(arguments))},Z.prototype.deleteLocalBranch=function(J,z,le){return this._runTask(T(J,typeof z=="boolean"?z:!1),A(arguments))},Z.prototype.deleteLocalBranches=function(J,z,le){return this._runTask(b(J,typeof z=="boolean"?z:!1),A(arguments))},Z.prototype.branch=function(J,z){return this._runTask(_(g(arguments)),A(arguments))},Z.prototype.branchLocal=function(J){return this._runTask(v(),A(arguments))},Z.prototype.raw=function(J){let z=!Array.isArray(J),le=[].slice.call(z?arguments:J,0);for(let ae=0;aeconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},Z.prototype.checkIgnore=function(J,z){return this._runTask(w(l(m(J,h,[]))),A(arguments))},Z.prototype.checkIsRepo=function(J,z){return this._runTask(R(m(J,f)),A(arguments))},e.exports=Z}});aq();var RYo=class extends T3{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};aq();aq();var Ule=class extends T3{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Qle();Jvn();mbn();Ibn();Rbn();Pbn();Mbn();Fbn();function kYo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new Ule(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Ule(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(kYo,"abortPlugin");function PYo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of yvn(e,r))if(t[n.category]!==!0)throw new Ule(void 0,"unsafe",n.message);return e}}}a(PYo,"blockUnsafeOperationsPlugin");oo();function DYo(t){let e=XIe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(DYo,"commandConfigPrefixingPlugin");oo();var Vvn=(0,Lle.deferred)().promise;function NYo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Lle.deferred)(),closeTimeout:(0,Lle.deferred)(),exit:(0,Lle.deferred)(),exitTimeout:(0,Lle.deferred)()},c=Promise.race([t===!1?Vvn:s.closeTimeout.promise,e===!1?Vvn: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(()=>Lqt(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 Lqt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(NYo,"completionDetectionPlugin");oo();var MYo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Wvn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function OYo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(OYo,"isBadArgument");function zvn(t,e){if(t.length<1||t.length>2)throw new Ule(void 0,"binary",MYo);if(t.some(OYo))if(e)console.warn(Wvn);else throw new Ule(void 0,"binary",Wvn);let[n,o]=t;return{binary:n,prefix:o}}a(zvn,"toBinaryConfig");function BYo(t,e=["git"],r=!1){let n=zvn(fO(e),r);t.on("binary",o=>{n=zvn(fO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(BYo,"customBinaryPlugin");aq();function LYo(t){return!!(t.exitCode&&t.stdErr.length)}a(LYo,"isTaskError");function FYo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(FYo,"getErrorMessage");function UYo(t=!1,e=LYo,r=FYo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(UYo,"errorDetectionHandler");function Yvn(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 T3(void 0,n.toString("utf-8"))}:{error:n}}}}a(Yvn,"errorDetectionPlugin");oo();var QYo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new J1n.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=jx(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return fO(t).forEach(r=>r&&this.plugins.add(jx(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 qYo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?nbn(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:jYo(u[1]),progress:fu(u[2]),processed:fu(u[3]),total:fu(u[4])})})}}]}a(qYo,"progressMonitorPlugin");function jYo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(jYo,"progressEventStage");oo();function HYo(t){let e=obn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(HYo,"spawnOptionsPlugin");function GYo({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 Ule(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(GYo,"timeoutPlugin");function $Yo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oUx(c)&&Dle(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a($Yo,"suffixPathsPlugin");oo();var VYo=wYo();function WYo(t,e){let r=new QYo,n=lbn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!tjt(n.baseDir))throw new RYo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(DYo(n.config)),r.add(PYo(n.unsafe)),r.add(NYo(n.completion)),n.abort&&r.add(kYo(n.abort)),n.progress&&r.add(qYo(n.progress)),n.timeout&&r.add(GYo(n.timeout)),n.spawnOptions&&r.add(HYo(n.spawnOptions)),r.add($Yo()),r.add(Yvn(UYo(!0))),n.errors&&r.add(Yvn(n.errors)),BYo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new VYo(n,r)}a(WYo,"gitInstanceFactory");Qle();var xJe=WYo;var Hx=new ge("Git Service");var wJe=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 rQ()).path;n=xJe({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,X1n.join)(n,r);return Ia(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){Hx.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){Hx.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){Hx.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){Hx.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){Hx.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 Hx.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};Hx.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){Hx.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){Hx.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,Z1n.fileURLToPath)(e)}catch(r){Hx.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 Hx.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var eSn=ce(Xc());var RP=new ge("Local Diff Tracker");var RJe=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 wJe(e),this._repositoryManager=e.get(W0),this._diffRefreshTimer=new eSn.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{RP.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):RP.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){RP.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){RP.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)&&RP.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?RP.warn(this.ctx,n,o):RP.warn(this.ctx,n):o!==void 0?RP.debug(this.ctx,n,o):RP.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var cq;(n=>{function t(o){return new Cjt(o)}n.ok=t,a(t,"ok");function e(o){return new vjt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(cq||={});var Cjt=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}},vjt=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 bjt=new ge("GithubAvailableEmbeddingTypes"),kJe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):cq.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):cq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Rle(this._ctx);r=await Td(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return bjt.error(this._ctx,"Error fetching available embedding types",c),cq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?cq.error({type:"unauthorized",status:r.status}):cq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new Pv(c.id);c.active===!1?s.push(l):o.push(l)}return cq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){bjt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return bjt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var zYo=new ge("GithubEmbeddingComputer"),jle=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){zYo.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 Td(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 Pv(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 sxe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var tSn=ce(hA()),rSn=ce(IB()),nSn=ce(require("path"));function PJe(t){let e=Wn(t.workspaceFolder.uri),r=(0,tSn.basename)(e),o=(0,rSn.SHA256)(e).toString().substring(0,8);return nSn.default.join(C7t(),"project-index",`${r}.${o}`)}a(PJe,"getWorkspaceCachePath");p();p();function iSn(t){if(W7t(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(Sjt,"unpackEmbedding");var oSn=ce(Xc()),sSn=ce(bP()),Ijt=ce(qp()),aSn=ce(require("fs")),xjt=ce(require("node:sqlite")),wjt=ce(require("path"));var Tjt=new ge("WorkspaceChunkAndEmbeddingCache");async function cSn(t,e,r,n){return await Rjt.create(t,e,r??":memory:",n)}a(cSn,"createWorkspaceChunkAndEmbeddingCache");var Rjt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new sSn.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=wjt.default.join(n,"workspace-chunks.db");try{await aSn.default.promises.mkdir(wjt.default.dirname(d),{recursive:!0}),c=new xjt.default.DatabaseSync(d,s),Tjt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){Tjt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new xjt.default.DatabaseSync(":memory:",s),Tjt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` +`)}a(_Ut,"applyEditsToDocument");var Wce=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 Jo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(hA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},lYe=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 CQ(e.ctx),u=await e.ctx.get(zc).getBestChatModelConfig(sS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(hA).toPrompt(e,d)}async processResponse(e){let r=[],n=Rn(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(Vy);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=EUt(e,r).filter(c=>yUt.includes(c.mode)),s=_Ut(o,r);if(s)return await this.ctx.get(Uh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return EUt(e,r)}};var uYe=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 Wce(e.ctx);return new cYe(e,r)}};p();p();p();p();function Ayn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(Ayn,"filterUnsupportedReferences");function yyn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(yyn,"convertToCopilotReferences");var Eyn=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 NQ=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,Ayn(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 $M=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(Fr).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(TN).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(fr).fetch(l,{method:"GET",headers:c})}};p();p();var _yn=S.Object({name:S.String(),url:S.String()}),vyn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(_yn)})),remotes:S.Optional(S.Array(_yn))}),vUt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(VM,"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)}},VM="git-metadata",dYe=class extends eg{static{a(this,"GitMetadataSkill")}constructor(e){super(VM,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new vUt(r))}};async function Cyn(t){let e=await t.skillResolver.resolve(Vy);if(e){let c=e.uri,l=g7(t.ctx,c);if(gan(l))return{repoInfo:l,skillUsed:Vy}}let r=await t.skillResolver.resolve(VM);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=ELt(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:VM}}a(Cyn,"extractRepoInfo");async function byn(t){let e=[];return await p6o(t,e),await h6o(t,e),await m6o(t,e),e}a(byn,"skillsToReference");async function p6o(t,e){let r=await g6o(t);r&&e.push(r)}a(p6o,"addRepositoryReference");async function h6o(t,e){let r=await A6o(t);r&&e.push(r)}a(h6o,"addSelectionReference");async function m6o(t,e){let r=[],n=await E6o(t);n&&r.push(n),r.push(...await _6o(t)),r.length>0&&e.push(...r)}a(m6o,"addFileReferences");async function g6o(t){let e=await Cyn(t);if(e){let r=t.ctx.get($M),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(g6o,"gitMetadataToReference");async function A6o(t){let e=await t.skillResolver.resolve(Vy);if(e&&e.selection){let n=await t.ctx.get(ni).getOrReadTextDocument(e),o=zu(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return y6o(e,n.document)}}a(A6o,"currentEditorToSelectionReference");function y6o(t,e){if(t.selection&&!Qce(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(y6o,"extractSelection");async function E6o(t){let e=await t.skillResolver.resolve(Vy);if(e){let n=await t.ctx.get(ni).getOrReadTextDocument(e),o=zu(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(E6o,"currentEditorToFileReference");async function _6o(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=zu(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(_6o,"fileReferenceToPlatformFileReference");p();As();var v6o=new Ee("ChatFetchResultPostProcessor"),zce=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(Jhn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(Uh).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:Rn(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"},v6o.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:x_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===xS,copilotPlan:DI(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}=Jo.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},Zhn(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:Rn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new xQ(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:ir(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return r0n(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",Xhn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var fYe=S.Union([S.String(),S.Number()]),$Y=S.Union([S.String(),S.Number()]),C6o=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),pYe=S.Object({uri:S.String(),position:S.Optional(ng)}),b6o=S.Object({type:S.Literal("file"),uri:S.String(),visibleRange:S.Optional(ff),selection:S.Optional(ff),status:S.Optional(C6o),range:S.Optional(ff)}),S6o=S.Object({type:S.Literal("directory"),uri:S.String()}),T6o=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),WM=S.Union([b6o,S6o,Eyn,T6o]),zM=S.Union([S.Literal("panel"),S.Literal("inline")]),I6o=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")]))})})]),CUt=S.Union([S.String(),S.Array(I6o)]),Syn=S.Object({request:CUt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional($Y),model:S.Optional(S.String())});function hYe(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(hYe,"convertToMessageContent");function mYe(t,e){if(t=CS(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(mYe,"appendToMessage");var gYe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),x6o=S.Object({type:S.String(),description:S.String()}),Tyn=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),x6o),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Mc=S.Object({uri:S.String(),name:S.String()}),w6o=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),AYe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:w6o});As();var bUt="generate-response",yYe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},YTe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(_c),this.chatFetcher=this.chatFetcher??new ec(r.ctx),this.postProcessor=new zce(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 yYe?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 Yc(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(Uh).inspectPrompt(l),await n.steps.start(bUt,"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:CS(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 ir()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return P9t(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:CS(r.request.message)}),r.response&&r.response.type==="model"){let o=yyn(r.response.references);n.push({role:"assistant",content:CS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await byn(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 NQ((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=mYe(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(Ut).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:Rn(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()),Rn(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 yYe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return pTe(this.conversation,"conversationPanel",Rn(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(bUt,e.error.message):await r.steps.finish(bUt)}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 KTe=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 YTe(this,e)}},EYe=class extends KTe{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 YTe(this,e)}};p();var R6o="github",mk=class{static{a(this,"RemoteAgentRegistry")}},_Ye=class extends mk{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 Pz(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Dr.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)||Dr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Dr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==R6o).map(o=>new KTe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var Iyn=he(require("fs")),R_=he(require("path"));var SUt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],TUt="test_",JTe={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"}},ZTe=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=R_.extname(r).replace(".",""),o=JTe[n]??{location:"sameFolder",prefix:TUt,suffix:SUt},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=Yo(Xd(e)),l===void 0)return}else{let d=Yo(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=R_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=ba(l);if(await this.fileExists(u))return Sa(u,s[0])}parseTestFilePath(e){try{return ba(e)}catch(r){Dr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ki(e),n=R_.extname(r).replace(".",""),o=JTe[n]??{location:"sameFolder",prefix:TUt,suffix:SUt},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=Xd(e):l=this.determineImplFolder(e);for(let u of s){let d=Sa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=Yo(e);if(r===void 0)return;let n=R_.extname(Ki(e)).replace(".",""),o,s=JTe[n]?.location??"sameFolder";s==="sameFolder"?o=R_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,JTe[n]);if(c.length>0)return ba(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${R_.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 Iyn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&Yo(this.baseUri))??"",o=R_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(R_.sep)}getRelativeTestFolder(e,r,n,o){let s=R_.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=R_.extname(Ki(e)).replace(".",""),n=Xd(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 XTe(t){let e=Ki(t),r=R_.extname(e),n=JTe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(SUt.some(s=>e.endsWith(s+r))||e.startsWith(TUt))}a(XTe,"isTestFile");p();var IUt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function xyn(t,e){let r=t.ctx,n=await Jo.getModelConfiguration(r,"synonyms",void 0,{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(hA).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 ec(r),u=await Yc(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:"";La(r,new IUt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(xyn,"parseUserQuery");p();p();p();p();var Ho=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 Ho(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Ho(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 wyn=250;function mA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/wyn)),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 Ryn=32e3,Pyn=2e4,eIe=.75;p();p();function gA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(gA,"getFenceForCodeBlock");p();var p_n=he(Al()),h_n=he(jp());p();var TC=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 U9o=Object.freeze({[TC.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[TC.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function qUt(t){return U9o[t.id]}a(qUt,"getWellKnownEmbeddingTypeInfo");function Q9o(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:tIe(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(jyn,"rankEmbeddings");p();p();var l3=he(Jc()),f_n=he(jp());var XM=new Ee("GitHubCodeSearch"),kqo=300*1e3,uKe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new l3.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()},kqo)}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(Ut).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),XM.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){XM.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(XM.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),XM.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){XM.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,l3.raceTimeout)((async()=>{if(!await(0,l3.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,l3.raceCancellationError)((0,l3.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 XM.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 Bf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return XM.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return XM.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=sle(this._ctx),c=n.owner+"/"+n.name,l=await Bf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(XM.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=sle(this._ctx),u=await Bf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:Nqo(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 Dqo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function sle(t){let e=t.get(Lr);return{"X-Client-Application":`${p1(e.getEditorInfo())}`,"X-Client-Source":p1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(sle,"editorVersionHeaders");async function Dqo(t,e,r){let o=[],s=new TC(e.embedding_model),c=ia(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=Sa(c,l.location.path)}catch(d){XM.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:dKe(l.chunk.text),rawText:void 0,range:new f_n.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(Dqo,"parseGithubCodeSearchResponse");function Nqo(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(Nqo,"truncateToMaxUtf8Length");function dKe(t){let e=Mqo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` +`):t}a(dKe,"stripChunkTextMetadata");function Mqo(t){return t.split(/\r\n|\r|\n/)}a(Mqo,"splitLines");var vk=he(Jc()),m_n=he(Kce()),g_n=he(Gh());var _Ie=new Ee("ChunkingEndpointClient"),yQt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new m_n.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 vk.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,vk.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,vk.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,vk.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){_Ie.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{_Ie.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{_Ie.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},fKe=class{constructor(e){this.ctx=e;this._requestLimiter=new yQt(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,vk.raceCancellationError)(n.getText(),l);if((0,g_n.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=sle(this.ctx);return await Bf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:Yo(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,vk.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){_Ie.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,p_n.coalesce)(h.chunks.map(m=>{let g=new h_n.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:dKe(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 TC(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:dKe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){_Ie.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var Ky={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},K0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Vt.createAndMarkAsIssued(s,o);yt(e,r,c),_t(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};La(e,n,r,o),gi(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,Ky.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,Ky.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Ky.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,Ky.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,Ky.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,Ky.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,Ky.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,Ky.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,{});yt(e,r,s),_t(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Ky.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,Ky.Aggregate,r)}};var A_n=he(Al()),y_n=he(Jc()),EQt=he(KM());var u3=new Ee("Remote Search"),pKe=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(V0),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 EQt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(u3.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 u3.error(this.ctx,"No GitHub repositories found"),K0.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Ut).getGitHubSession();if(!c)throw u3.error(this.ctx,"No GitHub session found"),K0.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 u3.error(this.ctx,"Remote index not ready for any repositories"),K0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=mA(r),d=Promise.all(l.map(async P=>{Mh(n);let D=await e.resolveQuery(n),N=new EQt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return u3.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);u3.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,y_n.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{u3.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{u3.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,A_n.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();u3.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 K0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var hbn=require("node:url"),mbn=require("path");p();var RKe=he(__n(),1);p();var _Qt=new WeakMap;function cle(...t){let e=new String(t);return _Qt.set(e,t),e}a(cle,"c");function Dx(t){return t instanceof String&&_Qt.has(t)}a(Dx,"r");function lle(t){return _Qt.get(t)??[]}a(lle,"o");var xKe=he(x_n(),1),nCn=require("child_process");var qCn=he(SQt(),1),ZCn=require("node:path");p();function*w_n(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(w_n,"U");var ajo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),cjo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),ljo=new Set(["edit","remove-section","rename-section","set","unset"]),ujo=new Set(["get","get-color","get-colorbool","list"]);function djo(t,e){for(let{name:n}of w_n(t,"task")){if(ajo.has(n))return ple(!0,e);if(cjo.has(n))return ple(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:ljo.has(r)?ple(!0,e.slice(1)):ujo.has(r)?ple(!1,e.slice(1)):e.length===1?ple(!1,e):ple(!0,e)}a(djo,"F");function ple(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(ple,"p");function fjo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(fjo,"A");function pjo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(pjo,"M");function hjo(t){for(let{name:e}of w_n(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(hjo,"N");function mjo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(mjo,"G");function*gjo(t){for(let e of t){let r=mjo(e),n=r&&pjo(e.value);n&&(yield{...n,scope:r})}}a(gjo,"O");function Ajo(t,e,r){let n={read:[],write:[...gjo(e)]};return t==="config"&&yjo(n,hjo(e),djo(e,r)),n}a(Ajo,"L");function yjo(t,e,r){if(r===null)return;let n=fjo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(yjo,"$");var R_n={short:new Map([["c",!0]])},Ejo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...R_n.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},_jo={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"])}},vjo={short:new Map,long:new Set};function Cjo(t){let e=_jo[t??""]??vjo;return{short:new Map([...R_n.short.entries(),...e.short.entries()]),long:e.long}}a(Cjo,"I");function P_n(t,e=Ejo){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 bjo(t,e.short)}a(P_n,"b");function bjo(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(bjo,"W");function Sjo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[WQt(t)[0]])(t=0)),e},"__init"),"__esm"),Ujo=a((t,e)=>a(function(){return e||(0,t[WQt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),$h=a((t,e)=>{for(var r in e)VQt(t,r,{get:e[r],enumerable:!0})},"__export"),Qjo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of WQt(e))!Fjo.call(t,o)&&o!==r&&VQt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Ljo(e,o))||n.enumerable});return t},"__copyProps"),$p=a(t=>Qjo(VQt({},"__esModule",{value:!0}),t),"__toCommonJS"),d3,HQ=Jr({"src/lib/errors/git-error.ts"(){"use strict";d3=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),TIe,Ale=Jr({"src/lib/errors/git-response-error.ts"(){"use strict";HQ(),TIe=class extends d3{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),fvn,pvn=Jr({"src/lib/errors/task-configuration-error.ts"(){"use strict";HQ(),fvn=class extends d3{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function hvn(t){return typeof t!="function"?iK:t}a(hvn,"asFunction");function mvn(t){return typeof t=="function"&&t!==iK}a(mvn,"isUserFunction");function gvn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(gvn,"splitOn");function Avn(t,e=0){return yvn(t)&&t.length>e?t[e]:void 0}a(Avn,"first");function nK(t,e=0){if(yvn(t)&&t.length>e)return t[t.length-1-e]}a(nK,"last");function yvn(t){return NKe(t)}a(yvn,"isArrayLike");function IIe(t="",e=!0,r=` +`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(IIe,"toLinesWithContent");function zQt(t,e){return IIe(t,!0).map(r=>e(r))}a(zQt,"forEachLineWithContent");function YQt(t){return(0,RKe.exists)(t,RKe.FOLDER)}a(YQt,"folderExists");function Ox(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(Ox,"append");function Evn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(Evn,"including");function PKe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(PKe,"remove");function eO(t){return Array.isArray(t)?t:[t]}a(eO,"asArray");function _vn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(_vn,"asCamelCase");function yle(t){return eO(t).map(e=>e instanceof String?e:String(e))}a(yle,"asStringArray");function du(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(du,"asNumber");function bIe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(vvn,"pick");function kQt(t=0){return new Promise(e=>setTimeout(e,t))}a(kQt,"delay");function DQt(t){if(t!==!1)return t}a(DQt,"orVoid");var mle,iK,xIe,kKe=Jr({"src/lib/utils/util.ts"(){"use strict";KQt(),mle="\0",iK=a(()=>{},"NOOP"),xIe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Jy(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(Jy,"filterType");function NQt(t,e){let r=Dx(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(NQt,"filterPrimitives");function DKe(t){return!!t&&xIe(t)==="[object Object]"}a(DKe,"filterPlainObject");function Cvn(t){return typeof t=="function"}a(Cvn,"filterFunction");var wIe,bvn,Xf,TKe,NKe,KQt=Jr({"src/lib/utils/argument-filters.ts"(){"use strict";kKe(),wIe=a(t=>Array.isArray(t),"filterArray"),bvn=a(t=>typeof t=="number","filterNumber"),Xf=a(t=>typeof t=="string"||Dx(t),"filterString"),TKe=a(t=>Xf(t)||Array.isArray(t)&&t.every(Xf),"filterStringOrStringArray"),NKe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),MQt,qjo=Jr({"src/lib/utils/exit-codes.ts"(){"use strict";MQt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(MQt||{})}}),IKe,jjo=Jr({"src/lib/utils/git-output-streams.ts"(){"use strict";IKe=class Svn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new Svn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function Hjo(){throw new Error("LineParser:useMatches not implemented")}a(Hjo,"useMatchesDefault");var Ro,jQ,Gjo=Jr({"src/lib/utils/line-parser.ts"(){"use strict";Ro=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=Hjo,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))}},jQ=class extends Ro{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 Tvn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...Ivn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(Tvn,"createInstanceConfig");var Ivn,$jo=Jr({"src/lib/utils/simple-git-options.ts"(){"use strict";Ivn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function JQt(t,e=[]){return DKe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(Dx(o))r.push(o);else if(NQt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)NQt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(JQt,"appendTaskOptions");function D_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=IIe(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(DC,"parseStringResponse");var zjo=Jr({"src/lib/utils/task-parser.ts"(){"use strict";kKe()}}),xvn={};$h(xvn,{ExitCodes:a(()=>MQt,"ExitCodes"),GitOutputStreams:a(()=>IKe,"GitOutputStreams"),LineParser:a(()=>Ro,"LineParser"),NOOP:a(()=>iK,"NOOP"),NULL:a(()=>mle,"NULL"),RemoteLineParser:a(()=>jQ,"RemoteLineParser"),append:a(()=>Ox,"append"),appendTaskOptions:a(()=>JQt,"appendTaskOptions"),asArray:a(()=>eO,"asArray"),asCamelCase:a(()=>_vn,"asCamelCase"),asFunction:a(()=>hvn,"asFunction"),asNumber:a(()=>du,"asNumber"),asStringArray:a(()=>yle,"asStringArray"),bufferToString:a(()=>SIe,"bufferToString"),callTaskParser:a(()=>OQt,"callTaskParser"),createInstanceConfig:a(()=>Tvn,"createInstanceConfig"),delay:a(()=>kQt,"delay"),filterArray:a(()=>wIe,"filterArray"),filterFunction:a(()=>Cvn,"filterFunction"),filterHasLength:a(()=>NKe,"filterHasLength"),filterNumber:a(()=>bvn,"filterNumber"),filterPlainObject:a(()=>DKe,"filterPlainObject"),filterPrimitives:a(()=>NQt,"filterPrimitives"),filterString:a(()=>Xf,"filterString"),filterStringOrStringArray:a(()=>TKe,"filterStringOrStringArray"),filterType:a(()=>Jy,"filterType"),first:a(()=>Avn,"first"),folderExists:a(()=>YQt,"folderExists"),forEachLineWithContent:a(()=>zQt,"forEachLineWithContent"),getTrailingOptions:a(()=>D_,"getTrailingOptions"),including:a(()=>Evn,"including"),isUserFunction:a(()=>mvn,"isUserFunction"),last:a(()=>nK,"last"),objectToString:a(()=>xIe,"objectToString"),orVoid:a(()=>DQt,"orVoid"),parseStringResponse:a(()=>DC,"parseStringResponse"),pick:a(()=>vvn,"pick"),prefixedArray:a(()=>bIe,"prefixedArray"),remove:a(()=>PKe,"remove"),splitOn:a(()=>gvn,"splitOn"),toLinesWithContent:a(()=>IIe,"toLinesWithContent"),trailingFunctionArgument:a(()=>kd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>ZQt,"trailingOptionsArgument")});var io=Jr({"src/lib/utils/index.ts"(){"use strict";KQt(),qjo(),jjo(),Gjo(),$jo(),Wjo(),zjo(),kKe()}}),wvn={};$h(wvn,{CheckRepoActions:a(()=>BQt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>Pvn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>Rvn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>Yjo,"checkIsRepoTask")});function Yjo(t){switch(t){case"bare":return Pvn();case"root":return Rvn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:MKe,parser:XQt}}a(Yjo,"checkIsRepoTask");function Rvn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:MKe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(Rvn,"checkIsRepoRootTask");function Pvn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:MKe,parser:XQt}}a(Pvn,"checkIsBareRepoTask");function Kjo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(Kjo,"isNotRepoMessage");var BQt,MKe,XQt,kvn=Jr({"src/lib/tasks/check-is-repo.ts"(){"use strict";io(),BQt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(BQt||{}),MKe=a(({exitCode:t},e,r,n)=>{if(t===128&&Kjo(e))return r(Buffer.from("false"));n(e)},"onError"),XQt=a(t=>t.trim()==="true","parser")}});function Jjo(t,e){let r=new Dvn(t),n=t?Mvn:Nvn;return IIe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(Ovn.test(s)?r.folders:r.files).push(s)}),r}a(Jjo,"cleanSummaryParser");var Dvn,Nvn,Mvn,Ovn,Zjo=Jr({"src/lib/responses/CleanSummary.ts"(){"use strict";io(),Dvn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Nvn=/^[a-z]+\s*/i,Mvn=/^[a-z]+\s+[a-z]+\s*/i,Ovn=/\/$/}}),LQt={};$h(LQt,{EMPTY_COMMANDS:a(()=>OKe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>Bvn,"adhocExecTask"),configurationErrorTask:a(()=>kC,"configurationErrorTask"),isBufferTask:a(()=>Fvn,"isBufferTask"),isEmptyTask:a(()=>Uvn,"isEmptyTask"),straightThroughBufferTask:a(()=>Lvn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>N_,"straightThroughStringTask")});function Bvn(t){return{commands:OKe,format:"empty",parser:t}}a(Bvn,"adhocExecTask");function kC(t){return{commands:OKe,format:"empty",parser(){throw typeof t=="string"?new fvn(t):t}}}a(kC,"configurationErrorTask");function N_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(N_,"straightThroughStringTask");function Lvn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(Lvn,"straightThroughBufferTask");function Fvn(t){return t.format==="buffer"}a(Fvn,"isBufferTask");function Uvn(t){return t.format==="empty"||!t.commands.length}a(Uvn,"isEmptyTask");var OKe,Vp=Jr({"src/lib/tasks/task.ts"(){"use strict";pvn(),OKe=[]}}),Qvn={};$h(Qvn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>eqt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>tqt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>rqt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>vKe,"CleanOptions"),cleanTask:a(()=>qvn,"cleanTask"),cleanWithOptionsTask:a(()=>Xjo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>eHo,"isCleanOptionsArray")});function Xjo(t,e){let{cleanMode:r,options:n,valid:o}=tHo(t);return r?o.options?(n.push(...e),n.some(iHo)?kC(eqt):qvn(r,n)):kC(rqt+JSON.stringify(t)):kC(tqt)}a(Xjo,"cleanWithOptionsTask");function qvn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return Jjo(t==="n",n)}}}a(qvn,"cleanTask");function eHo(t){return Array.isArray(t)&&t.every(e=>nqt.has(e))}a(eHo,"isCleanOptionsArray");function tHo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{rHo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&nHo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(tHo,"getCleanOptions");function rHo(t){return t==="f"||t==="n"}a(rHo,"isCleanMode");function nHo(t){return/^-[a-z]$/i.test(t)&&nqt.has(t.charAt(1))}a(nHo,"isKnownOption");function iHo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(iHo,"isInteractiveMode");var eqt,tqt,rqt,vKe,nqt,jvn=Jr({"src/lib/tasks/clean.ts"(){"use strict";Zjo(),io(),Vp(),eqt="Git clean interactive mode is not supported",tqt='Git clean mode parameter ("n" or "f") is required',rqt="Git clean unknown option found in: ",vKe=(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))(vKe||{}),nqt=new Set(["i",...yle(Object.values(vKe))])}});function oHo(t){let e=new Gvn;for(let r of Hvn(t))e.addValue(r.file,String(r.key),r.value);return e}a(oHo,"configListParser");function sHo(t,e){let r=null,n=[],o=new Map;for(let s of Hvn(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(sHo,"configGetParser");function aHo(t){return t.replace(/^(file):/,"")}a(aHo,"configFilePath");function*Hvn(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=nK(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 TQt(t,e){return typeof t=="string"&&Object.hasOwn(FQt,t)?t:e}a(TQt,"asConfigScope");function lHo(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(lHo,"addConfigTask");function uHo(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 sHo(n,t)}}}a(uHo,"getConfigTask");function dHo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return oHo(r)}}}a(dHo,"listConfigTask");function fHo(){return{addConfig(t,e,...r){return this._runTask(lHo(t,e,r[0]===!0,TQt(r[1],"local")),kd(arguments))},getConfig(t,e){return this._runTask(uHo(t,TQt(e,void 0)),kd(arguments))},listConfig(...t){return this._runTask(dHo(TQt(t[0],void 0)),kd(arguments))}}}a(fHo,"config_default");var FQt,$vn=Jr({"src/lib/tasks/config.ts"(){"use strict";cHo(),io(),FQt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(FQt||{})}});function pHo(t){return Vvn.has(t)}a(pHo,"isDiffNameStatus");var IQt,Vvn,Wvn=Jr({"src/lib/tasks/diff-name-status.ts"(){"use strict";IQt=(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))(IQt||{}),Vvn=new Set(Object.values(IQt))}});function hHo(...t){return new Yvn().param(...t)}a(hHo,"grepQueryBuilder");function mHo(t){let e=new Set,r={};return zQt(t,n=>{let[o,s,c]=n.split(mle);e.add(o),(r[o]=r[o]||[]).push({line:du(s),path:o,preview:c})}),{paths:e,results:r}}a(mHo,"parseGrep");function gHo(){return{grep(t){let e=kd(arguments),r=D_(arguments);for(let o of zvn)if(r.includes(o))return this._runTask(kC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=hHo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return mHo(o)}},e)}}}a(gHo,"grep_default");var zvn,CIe,O_n,Yvn,Kvn=Jr({"src/lib/tasks/grep.ts"(){"use strict";io(),Vp(),zvn=["-h"],CIe=Symbol("grepQuery"),Yvn=class{static{a(this,"GrepQuery")}constructor(){this[O_n]=[]}*[(O_n=CIe,Symbol.iterator)](){for(let t of this[CIe])yield t}and(...t){return t.length&&this[CIe].push("--and","(",...bIe(t,"-e"),")"),this}param(...t){return this[CIe].push(...bIe(t,"-e")),this}}}}),Jvn={};$h(Jvn,{ResetMode:a(()=>CKe,"ResetMode"),getResetMode:a(()=>yHo,"getResetMode"),resetTask:a(()=>AHo,"resetTask")});function AHo(t,e){let r=["reset"];return Zvn(t)&&r.push(`--${t}`),r.push(...e),N_(r)}a(AHo,"resetTask");function yHo(t){if(Zvn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(yHo,"getResetMode");function Zvn(t){return typeof t=="string"&&Xvn.includes(t)}a(Zvn,"isValidResetMode");var CKe,Xvn,eCn=Jr({"src/lib/tasks/reset.ts"(){"use strict";io(),Vp(),CKe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(CKe||{}),Xvn=yle(Object.values(CKe))}});function EHo(){return(0,xKe.default)("simple-git")}a(EHo,"createLog");function B_n(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(B_n,"prefixedLogger");function _Ho(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(_Ho,"childLoggerName");function iqt(t,e,r,n=EHo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=_Ho(Jy(e,Xf),c,n);return d(r);function u(f,h){return Ox(s,iqt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&B_n(c,h)||iK,g=B_n(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(iqt,"createLogger");var tCn=Jr({"src/lib/git-logger.ts"(){"use strict";io(),xKe.default.formatters.L=t=>String(NKe(t)?t.length:"-"),xKe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):xIe(t)}}),rCn,vHo=Jr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";HQ(),tCn(),rCn=class UQt{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=UQt.getName(e.commands[0]),n=iqt(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 d3(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++UQt.counter}`}static{this.counter=0}}}});function rK(t,e){return{method:Avn(t.commands)||"",commands:e}}a(rK,"pluginContext");function CHo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(CHo,"onErrorReceived");function L_n(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(L_n,"onDataReceived");var QQt,bHo=Jr({"src/lib/runners/git-executor-chain.ts"(){"use strict";HQ(),Vp(),io(),vHo(),QQt=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 rCn}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(Uvn(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 d3?Object.assign(e,{task:t}):new d3(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","",rK(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...rK(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),Fvn(t)?OQt(t.parser,s):OQt(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},{...rK(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",xIe(h)),u(new IKe(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 IKe(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},rK(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,{...rK(t,r),kill(m){f=m||f}});let h=(0,nCn.spawn)(e,r,c);h.stdout.on("data",L_n(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",L_n(d,"stdErr",o,s.step("stdErr"))),h.on("error",CHo(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,{...rK(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,{...rK(t,e),kill(n){r=n||r}}),r}}}}),iCn={};$h(iCn,{GitExecutor:a(()=>oCn,"GitExecutor")});var oCn,SHo=Jr({"src/lib/runners/git-executor.ts"(){"use strict";bHo(),oCn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new QQt(this,this._scheduler,this._plugins)}chain(){return new QQt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function THo(t,e,r=iK){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof TIe?IHo(s):s,void 0)},"onError2");e.then(n,o)}a(THo,"taskCallback");function IHo(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=iK},"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(IHo,"addDeprecationNoticeToError");var xHo=Jr({"src/lib/task-callback.ts"(){"use strict";Ale(),io()}});function F_n(t,e){return Bvn(r=>{if(!YQt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(F_n,"changeWorkingDirectoryTask");var wHo=Jr({"src/lib/tasks/change-working-directory.ts"(){"use strict";io(),Vp()}});function xQt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=PKe(e,"-B")),N_(e)}a(xQt,"checkoutTask");function RHo(){return{checkout(){return this._runTask(xQt(D_(arguments,1)),kd(arguments))},checkoutBranch(t,e){return this._runTask(xQt(["-b",t,e,...D_(arguments)]),kd(arguments))},checkoutLocalBranch(t){return this._runTask(xQt(["-b",t,...D_(arguments)]),kd(arguments))}}}a(RHo,"checkout_default");var PHo=Jr({"src/lib/tasks/checkout.ts"(){"use strict";io(),Vp()}});function kHo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(kHo,"countObjectsResponse");function DHo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return DC(kHo(),[sCn],t)}})}}}a(DHo,"count_objects_default");var sCn,NHo=Jr({"src/lib/tasks/count-objects.ts"(){"use strict";io(),sCn=new Ro(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=_vn(e);Object.hasOwn(t,n)&&(t[n]=du(r))})}});function MHo(t){return DC({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},aCn,t)}a(MHo,"parseCommitResult");var aCn,OHo=Jr({"src/lib/parsers/parse-commit.ts"(){"use strict";io(),aCn=[new Ro(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new Ro(/\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 Ro(/(\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 Ro(/^(\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 BHo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...bIe(t,"-m"),...e,...r],format:"utf-8",parser:MHo}}a(BHo,"commitTask");function LHo(){return{commit(e,...r){let n=kd(arguments),o=t(e)||BHo(eO(e),eO(Jy(r[0],TKe,[])),[...yle(Jy(r[1],wIe,[])),...D_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!TKe(e)&&kC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(LHo,"commit_default");var FHo=Jr({"src/lib/tasks/commit.ts"(){"use strict";OHo(),io(),Vp()}});function UHo(){return{firstCommit(){return this._runTask(N_(["rev-list","--max-parents=0","HEAD"],!0),kd(arguments))}}}a(UHo,"first_commit_default");var QHo=Jr({"src/lib/tasks/first-commit.ts"(){"use strict";io(),Vp()}});function qHo(t,e){let r=["hash-object",t];return e&&r.push("-w"),N_(r,!0)}a(qHo,"hashObjectTask");var jHo=Jr({"src/lib/tasks/hash-object.ts"(){"use strict";Vp()}});function HHo(t,e,r){let n=String(r).trim(),o;if(o=cCn.exec(n))return new bKe(t,e,!1,o[1]);if(o=lCn.exec(n))return new bKe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new bKe(t,e,/^re/i.test(n),s)}a(HHo,"parseInit");var bKe,cCn,lCn,GHo=Jr({"src/lib/responses/InitSummary.ts"(){"use strict";bKe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},cCn=/^Init.+ repository in (.+)$/,lCn=/^Rein.+ in (.+)$/}});function $Ho(t){return t.includes(oqt)}a($Ho,"hasBareCommand");function VHo(t=!1,e,r){let n=["init",...r];return t&&!$Ho(n)&&n.splice(1,0,oqt),{commands:n,format:"utf-8",parser(o){return HHo(n.includes("--bare"),e,o)}}}a(VHo,"initTask");var oqt,WHo=Jr({"src/lib/tasks/init.ts"(){"use strict";GHo(),oqt="--bare"}});function sqt(t){for(let e=0;eDC(new uCn,e,r,!1)}a(dCn,"getDiffParser");var wQt,U_n,Q_n,q_n,fCn,pCn=Jr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";RIe(),YHo(),Wvn(),io(),wQt=[new Ro(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:du(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new Ro(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:du(r),after:du(n),binary:!0})}),new Ro(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=du(e),t.insertions=du(n?.[1]),t.deletions=du(o?.[1])})],U_n=[new Ro(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=du(e),s=du(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new Ro(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],Q_n=[new Ro(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],q_n=[new Ro(/([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:DQt(pHo(e)&&e),from:DQt(!!s&&n!==s&&n),similarity:du(r)})})],fCn={"":wQt,"--stat":wQt,"--numstat":U_n,"--name-status":q_n,"--name-only":Q_n}}});function KHo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(KHo,"lineBuilder");function hCn(t=uqt,e=mCn,r=""){let n=dCn(r);return function(o){let s=IIe(o.trim(),!1,cqt).map(function(c){let l=c.split(lqt),u=KHo(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(hCn,"createListLogSummaryParser");var cqt,lqt,uqt,mCn,gCn=Jr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";io(),pCn(),RIe(),cqt="\xF2\xF2\xF2\xF2\xF2\xF2 ",lqt=" \xF2\xF2",uqt=" \xF2 ",mCn=["hash","date","message","refs","author_name","author_email"]}}),ACn={};$h(ACn,{diffSummaryTask:a(()=>JHo,"diffSummaryTask"),validateLogFormatConfig:a(()=>BKe,"validateLogFormatConfig")});function JHo(t){let e=sqt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),BKe(r)||{commands:r,format:"utf-8",parser:dCn(e)}}a(JHo,"diffSummaryTask");function BKe(t){let e=t.filter(zHo);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(BKe,"validateLogFormatConfig");var dqt=Jr({"src/lib/tasks/diff.ts"(){"use strict";RIe(),pCn(),Vp()}});function ZHo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(ZHo,"prettyFormat");function XHo(t){return Object.keys(t).reduce((e,r)=>(r in qQt||(e[r]=t[r]),e),{})}a(XHo,"userOptions");function yCn(t={},e=[]){let r=Jy(t.splitter,Xf,uqt),n=DKe(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]=ZHo(n,r),c=[],l=[`--pretty=format:${cqt}${s}${lqt}`,...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 Xf(t.file)&&l.push("--follow",cle(t.file)),JQt(XHo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(yCn,"parseLogOptions");function eGo(t,e,r){let n=hCn(t,e,sqt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(eGo,"logTask");function tGo(){return{log(...r){let n=kd(arguments),o=yCn(ZQt(arguments),yle(Jy(arguments[0],wIe,[]))),s=e(...r)||BKe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return eGo(r.splitter,r.fields,r.commands)}function e(r,n){return Xf(r)&&Xf(n)&&kC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(tGo,"log_default");var qQt,ECn=Jr({"src/lib/tasks/log.ts"(){"use strict";RIe(),gCn(),io(),Vp(),dqt(),qQt=(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))(qQt||{})}}),SKe,_Cn,rGo=Jr({"src/lib/responses/MergeSummary.ts"(){"use strict";SKe=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}`}},_Cn=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"}}}}),jQt,vCn,nGo=Jr({"src/lib/responses/PullSummary.ts"(){"use strict";jQt=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}}},vCn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function RQt(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(RQt,"objectEnumerationResult");function j_n(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:du(e&&e[1]||"0"),delta:du(r&&r[1]||"0")}}a(j_n,"asObjectCount");var CCn,iGo=Jr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";io(),CCn=[new jQ(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=RQt(t.remoteMessages);Object.assign(o,{[n]:du(r)})}),new jQ(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=RQt(t.remoteMessages);Object.assign(o,{[n]:du(r)})}),new jQ(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=RQt(t.remoteMessages);o.total=j_n(e),o.reused=j_n(r),o.packReused=du(n)})]}});function bCn(t,e){return DC({remoteMessages:new TCn},SCn,e)}a(bCn,"parseRemoteMessages");var SCn,TCn,ICn=Jr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";io(),iGo(),SCn=[new jQ(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...CCn,new jQ([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new jQ([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:du(e),summary:r,url:n}})],TCn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function oGo(t,e){let r=DC(new vCn,xCn,[t,e]);return r.message&&r}a(oGo,"parsePullErrorResult");var H_n,G_n,$_n,V_n,xCn,W_n,fqt,wCn=Jr({"src/lib/parsers/parse-pull.ts"(){"use strict";nGo(),io(),ICn(),H_n=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,G_n=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,$_n=/^(create|delete) mode \d+ (.+)/,V_n=[new Ro(H_n,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Ro(G_n,(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 Ro($_n,(t,[e,r])=>{Ox(t.files,r),Ox(e==="create"?t.created:t.deleted,r)})],xCn=[new Ro(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new Ro(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new Ro(/([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})],W_n=a((t,e)=>DC(new jQt,V_n,[t,e]),"parsePullDetail"),fqt=a((t,e)=>Object.assign(new jQt,W_n(t,e),bCn(t,e)),"parsePullResult")}}),z_n,RCn,Y_n,sGo=Jr({"src/lib/parsers/parse-merge.ts"(){"use strict";rGo(),io(),wCn(),z_n=[new Ro(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new Ro(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new SKe(e,r))}),new Ro(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new SKe(e,r,{deleteRef:n}))}),new Ro(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new SKe(e,null))}),new Ro(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],RCn=a((t,e)=>Object.assign(Y_n(t,e),fqt(t,e)),"parseMergeResult"),Y_n=a(t=>DC(new _Cn,z_n,t),"parseMergeDetail")}});function K_n(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=RCn(e,r);if(n.failed)throw new TIe(n);return n}}:kC("Git.merge requires at least one option")}a(K_n,"mergeTask");var aGo=Jr({"src/lib/tasks/merge.ts"(){"use strict";Ale(),sGo(),Vp()}});function cGo(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(cGo,"pushResultPushedItem");var J_n,PCn,Z_n,lGo=Jr({"src/lib/parsers/parse-push.ts"(){"use strict";io(),ICn(),J_n=[new Ro(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new Ro(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new Ro(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(cGo(e,r,n))}),new Ro(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new Ro(/^([^:]+):(\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}}})],PCn=a((t,e)=>{let r=Z_n(t,e),n=bCn(t,e);return{...r,...n}},"parsePushResult"),Z_n=a((t,e)=>DC({pushed:[]},J_n,[t,e]),"parsePushDetail")}}),kCn={};$h(kCn,{pushTagsTask:a(()=>uGo,"pushTagsTask"),pushTask:a(()=>pqt,"pushTask")});function uGo(t={},e){return Ox(e,"--tags"),pqt(t,e)}a(uGo,"pushTagsTask");function pqt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),PKe(r,"-v"),Ox(r,"--verbose"),Ox(r,"--porcelain"),{commands:r,format:"utf-8",parser:PCn}}a(pqt,"pushTask");var DCn=Jr({"src/lib/tasks/push.ts"(){"use strict";lGo(),io()}});function dGo(){return{showBuffer(){let t=["show",...D_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(Lvn(t),kd(arguments))},show(){let t=["show",...D_(arguments,1)];return this._runTask(N_(t),kd(arguments))}}}a(dGo,"show_default");var fGo=Jr({"src/lib/tasks/show.ts"(){"use strict";io(),Vp()}}),X_n,NCn,pGo=Jr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";X_n=/^(.+)\0(.+)$/,NCn=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=X_n.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function evn(t){let[e,r]=t.split(mle);return{from:r||e,to:e}}a(evn,"renamedFile");function DS(t,e,r){return[`${t}${e}`,r]}a(DS,"parser3");function PQt(t,...e){return e.map(r=>DS(t,r,(n,o)=>n.conflicted.push(o)))}a(PQt,"conflicts");function hGo(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=MCn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new NCn(c,o,s))}a(n,"data")}a(hGo,"splitLine");var tvn,MCn,OCn,mGo=Jr({"src/lib/responses/StatusSummary.ts"(){"use strict";io(),pGo(),tvn=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}},MCn=new Map([DS(" ","A",(t,e)=>t.created.push(e)),DS(" ","D",(t,e)=>t.deleted.push(e)),DS(" ","M",(t,e)=>t.modified.push(e)),DS("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),DS("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),DS("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),DS("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),DS("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),DS("R"," ",(t,e)=>{t.renamed.push(evn(e))}),DS("R","M",(t,e)=>{let r=evn(e);t.renamed.push(r),t.modified.push(r.to)}),DS("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),DS("?","?",(t,e)=>t.not_added.push(e)),...PQt("A","A","U"),...PQt("D","D","U"),...PQt("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=Jy(l?.[1],Xf,null),l=s.exec(e),t.tracking=Jy(l?.[1],Xf,null),l=c.exec(e),l&&(t.current=Jy(l?.[1],Xf,t.current)),t.detached=/\(no branch\)/.test(e)}]]),OCn=a(function(t){let e=t.split(mle),r=new tvn;for(let n=0,o=e.length;n!BCn.includes(r))],parser(r){return OCn(r)}}}a(gGo,"statusTask");var BCn,AGo=Jr({"src/lib/tasks/status.ts"(){"use strict";mGo(),BCn=["--null","-z"]}});function wKe(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(wKe,"versionResponse");function yGo(){return wKe(0,0,0,"",!1)}a(yGo,"notInstalledResponse");function EGo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:_Go,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(hqt));n(e)}})}}}a(EGo,"version_default");function _Go(t){return t===hqt?yGo():DC(wKe(0,0,0,t),LCn,t)}a(_Go,"versionParser");var hqt,LCn,vGo=Jr({"src/lib/tasks/version.ts"(){"use strict";io(),hqt="installed=false",LCn=[new Ro(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,wKe(du(e),du(r),du(n),o))}),new Ro(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,wKe(du(e),du(r),n,o))})]}});function rvn(t,e,r,...n){return Xf(r)?e(r,Jy(n[0],Xf),D_(arguments)):kC(`git.${t}() requires a string 'repoPath'`)}a(rvn,"createCloneTask");function CGo(){return{clone(t,...e){return this._runTask(rvn("clone",HQt,Jy(t,Xf),...e),kd(arguments))},mirror(t,...e){return this._runTask(rvn("mirror",FCn,Jy(t,Xf),...e),kd(arguments))}}}a(CGo,"clone_default");var HQt,FCn,bGo=Jr({"src/lib/tasks/clone.ts"(){"use strict";Vp(),io(),HQt=a((t,e,r)=>{let n=["clone",...r];return Xf(t)&&n.push(cle(t)),Xf(e)&&n.push(cle(e)),N_(n)},"cloneTask"),FCn=a((t,e,r)=>(Ox(r,"--mirror"),HQt(t,e,r)),"cloneMirrorTask")}}),UCn={};$h(UCn,{SimpleGitApi:a(()=>GQt,"SimpleGitApi")});var GQt,SGo=Jr({"src/lib/simple-git-api.ts"(){"use strict";xHo(),wHo(),PHo(),NHo(),FHo(),$vn(),QHo(),Kvn(),jHo(),WHo(),ECn(),aGo(),DCn(),fGo(),AGo(),Vp(),vGo(),io(),bGo(),GQt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&THo(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(N_(["add",...eO(t)]),kd(arguments))}cwd(t){let e=kd(arguments);return typeof t=="string"?this._runTask(F_n(t,this._executor),e):typeof t?.path=="string"?this._runTask(F_n(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(qHo(t,e===!0),kd(arguments))}init(t){return this._runTask(VHo(t===!0,this._executor.cwd,D_(arguments)),kd(arguments))}merge(){return this._runTask(K_n(D_(arguments)),kd(arguments))}mergeFromTo(t,e){return Xf(t)&&Xf(e)?this._runTask(K_n([t,e,...D_(arguments)]),kd(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=pqt({remote:Jy(arguments[0],Xf),branch:Jy(arguments[1],Xf)},D_(arguments));return this._runTask(t,kd(arguments))}stash(){return this._runTask(N_(["stash",...D_(arguments)]),kd(arguments))}status(){return this._runTask(gGo(D_(arguments)),kd(arguments))}},Object.assign(GQt.prototype,RHo(),CGo(),LHo(),fHo(),DHo(),UHo(),gHo(),tGo(),dGo(),EGo())}}),QCn={};$h(QCn,{Scheduler:a(()=>jCn,"Scheduler")});var nvn,jCn,TGo=Jr({"src/lib/runners/scheduler.ts"(){"use strict";io(),tCn(),nvn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,qCn.createDeferred)();return{promise:e,done:r,id:t}}})(),jCn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=iqt("","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=Ox(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),PKe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Ox(this.pending,nvn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),HCn={};$h(HCn,{applyPatchTask:a(()=>IGo,"applyPatchTask")});function IGo(t,e){return N_(["apply",...e,...t])}a(IGo,"applyPatchTask");var xGo=Jr({"src/lib/tasks/apply-patch.ts"(){"use strict";Vp()}});function wGo(t,e){return{branch:t,hash:e,success:!0}}a(wGo,"branchDeletionSuccess");function RGo(t){return{branch:t,hash:null,success:!1}}a(RGo,"branchDeletionFailure");var GCn,PGo=Jr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";GCn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function $Cn(t,e){return e===1&&$Qt.test(t)}a($Cn,"hasBranchDeletionError");var ivn,$Qt,ovn,LKe,kGo=Jr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";PGo(),io(),ivn=/(\S+)\s+\(\S+\s([^)]+)\)/,$Qt=/^error[^']+'([^']+)'/m,ovn=[new Ro(ivn,(t,[e,r])=>{let n=wGo(e,r);t.all.push(n),t.branches[e]=n}),new Ro($Qt,(t,[e])=>{let r=RGo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],LKe=a((t,e)=>DC(new GCn,ovn,[t,e]),"parseBranchDeletions")}}),VCn,DGo=Jr({"src/lib/responses/BranchSummary.ts"(){"use strict";VCn=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 svn(t){return t?t.charAt(0):""}a(svn,"branchStatus");function WCn(t,e=!1){return DC(new VCn,e?[YCn]:zCn,t)}a(WCn,"parseBranchSummary");var zCn,YCn,NGo=Jr({"src/lib/parsers/parse-branch.ts"(){"use strict";DGo(),io(),zCn=[new Ro(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(svn(e),!0,r,n,o)}),new Ro(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(svn(e),!1,r,n,o)})],YCn=new Ro(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),KCn={};$h(KCn,{branchLocalTask:a(()=>OGo,"branchLocalTask"),branchTask:a(()=>MGo,"branchTask"),containsDeleteBranchCommand:a(()=>JCn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>LGo,"deleteBranchTask"),deleteBranchesTask:a(()=>BGo,"deleteBranchesTask")});function JCn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(JCn,"containsDeleteBranchCommand");function MGo(t){let e=JCn(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?LKe(o,s).all[0]:WCn(o,r)}}}a(MGo,"branchTask");function OGo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return WCn(t)}}}a(OGo,"branchLocalTask");function BGo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return LKe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!$Cn(String(o),r))return c(o);s(n)}}}a(BGo,"deleteBranchesTask");function LGo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return LKe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!$Cn(String(c),n))return u(c);throw new TIe(r.parser(SIe(s),SIe(o)),String(c))}};return r}a(LGo,"deleteBranchTask");var FGo=Jr({"src/lib/tasks/branch.ts"(){"use strict";Ale(),kGo(),NGo(),io()}});function UGo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,ZCn.normalize)(e)}a(UGo,"toPath");var XCn,QGo=Jr({"src/lib/responses/CheckIgnore.ts"(){"use strict";XCn=a(t=>t.split(/\n/g).map(UGo).filter(Boolean),"parseCheckIgnore")}}),ebn={};$h(ebn,{checkIgnoreTask:a(()=>qGo,"checkIgnoreTask")});function qGo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:XCn}}a(qGo,"checkIgnoreTask");var jGo=Jr({"src/lib/tasks/check-ignore.ts"(){"use strict";QGo()}});function HGo(t,e){return DC({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},tbn,[t,e])}a(HGo,"parseFetchResult");var tbn,GGo=Jr({"src/lib/parsers/parse-fetch.ts"(){"use strict";io(),tbn=[new Ro(/From (.+)$/,(t,[e])=>{t.remote=e}),new Ro(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new Ro(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new Ro(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new Ro(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),rbn={};$h(rbn,{fetchTask:a(()=>VGo,"fetchTask")});function $Go(t){return/^--upload-pack(=|$)/.test(t)}a($Go,"disallowedCommand");function VGo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find($Go)?kC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:HGo}}a(VGo,"fetchTask");var WGo=Jr({"src/lib/tasks/fetch.ts"(){"use strict";GGo(),Vp()}});function zGo(t){return DC({moves:[]},nbn,t)}a(zGo,"parseMoveResult");var nbn,YGo=Jr({"src/lib/parsers/parse-move.ts"(){"use strict";io(),nbn=[new Ro(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),ibn={};$h(ibn,{moveTask:a(()=>KGo,"moveTask")});function KGo(t,e){return{commands:["mv","-v",...eO(t),e],format:"utf-8",parser:zGo}}a(KGo,"moveTask");var JGo=Jr({"src/lib/tasks/move.ts"(){"use strict";YGo(),io()}}),obn={};$h(obn,{pullTask:a(()=>ZGo,"pullTask")});function ZGo(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 fqt(o,s)},onError(o,s,c,l){let u=oGo(SIe(o.stdOut),SIe(o.stdErr));if(u)return l(new TIe(u));l(s)}}}a(ZGo,"pullTask");var XGo=Jr({"src/lib/tasks/pull.ts"(){"use strict";Ale(),wCn(),io()}});function e$o(t){let e={};return sbn(t,([r])=>e[r]={name:r}),Object.values(e)}a(e$o,"parseGetRemotes");function t$o(t){let e={};return sbn(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(t$o,"parseGetRemotesVerbose");function sbn(t,e){zQt(t,r=>e(r.split(/\s+/)))}a(sbn,"forEach");var r$o=Jr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";io()}}),abn={};$h(abn,{addRemoteTask:a(()=>n$o,"addRemoteTask"),getRemotesTask:a(()=>i$o,"getRemotesTask"),listRemotesTask:a(()=>o$o,"listRemotesTask"),remoteTask:a(()=>s$o,"remoteTask"),removeRemoteTask:a(()=>a$o,"removeRemoteTask")});function n$o(t,e,r){return N_(["remote","add",...r,t,e])}a(n$o,"addRemoteTask");function i$o(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?t$o:e$o}}a(i$o,"getRemotesTask");function o$o(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),N_(e)}a(o$o,"listRemotesTask");function s$o(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),N_(e)}a(s$o,"remoteTask");function a$o(t){return N_(["remote","remove",t])}a(a$o,"removeRemoteTask");var c$o=Jr({"src/lib/tasks/remote.ts"(){"use strict";r$o(),Vp()}}),cbn={};$h(cbn,{stashListTask:a(()=>l$o,"stashListTask")});function l$o(t={},e){let r=yCn(t),n=["stash","list",...r.commands,...e],o=hCn(r.splitter,r.fields,sqt(n));return BKe(n)||{commands:n,format:"utf-8",parser:o}}a(l$o,"stashListTask");var u$o=Jr({"src/lib/tasks/stash-list.ts"(){"use strict";RIe(),gCn(),dqt(),ECn()}}),lbn={};$h(lbn,{addSubModuleTask:a(()=>d$o,"addSubModuleTask"),initSubModuleTask:a(()=>f$o,"initSubModuleTask"),subModuleTask:a(()=>FKe,"subModuleTask"),updateSubModuleTask:a(()=>p$o,"updateSubModuleTask")});function d$o(t,e){return FKe(["add",t,e])}a(d$o,"addSubModuleTask");function f$o(t){return FKe(["init",...t])}a(f$o,"initSubModuleTask");function FKe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),N_(e)}a(FKe,"subModuleTask");function p$o(t){return FKe(["update",...t])}a(p$o,"updateSubModuleTask");var h$o=Jr({"src/lib/tasks/sub-module.ts"(){"use strict";Vp()}});function m$o(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?ubn(t,e):0}a(m$o,"singleSorted");function ubn(t,e){return t===e?0:t>e?1:-1}a(ubn,"sorted");function g$o(t){return t.trim()}a(g$o,"trimmed");function _Ke(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(_Ke,"toNumber");var avn,dbn,A$o=Jr({"src/lib/responses/TagList.ts"(){"use strict";avn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},dbn=a(function(t,e=!1){let r=t.split(` +`).map(g$o).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return m$o(_Ke(c[0]),_Ke(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new avn(r,n)},"parseTagList")}}),fbn={};$h(fbn,{addAnnotatedTagTask:a(()=>_$o,"addAnnotatedTagTask"),addTagTask:a(()=>E$o,"addTagTask"),tagListTask:a(()=>y$o,"tagListTask")});function y$o(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return dbn(r,e)}}}a(y$o,"tagListTask");function E$o(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(E$o,"addTagTask");function _$o(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(_$o,"addAnnotatedTagTask");var v$o=Jr({"src/lib/tasks/tag.ts"(){"use strict";A$o()}}),C$o=Ujo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(SHo(),$p(iCn)),{SimpleGitApi:n}=(SGo(),$p(UCn)),{Scheduler:o}=(TGo(),$p(QCn)),{adhocExecTask:s,configurationErrorTask:c}=(Vp(),$p(LQt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(io(),$p(xvn)),{applyPatchTask:E}=(xGo(),$p(HCn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(FGo(),$p(KCn)),{checkIgnoreTask:w}=(jGo(),$p(ebn)),{checkIsRepoTask:R}=(kvn(),$p(wvn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(jvn(),$p(Qvn)),{diffSummaryTask:D}=(dqt(),$p(ACn)),{fetchTask:N}=(WGo(),$p(rbn)),{moveTask:L}=(JGo(),$p(ibn)),{pullTask:B}=(XGo(),$p(obn)),{pushTagsTask:j}=(DCn(),$p(kCn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:q,remoteTask:Q,removeRemoteTask:U}=(c$o(),$p(abn)),{getResetMode:z,resetTask:W}=(eCn(),$p(Jvn)),{stashListTask:$}=(u$o(),$p(cbn)),{addSubModuleTask:J,initSubModuleTask:ne,subModuleTask:H,updateSubModuleTask:re}=(h$o(),$p(lbn)),{addAnnotatedTagTask:ae,addTagTask:Oe,tagListTask:ve}=(v$o(),$p(fbn)),{straightThroughBufferTask:Fe,straightThroughStringTask:Pe}=(Vp(),$p(LQt));function Z(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(Z,"Git2"),(Z.prototype=Object.create(n.prototype)).constructor=Z,Z.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},Z.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},Z.prototype.stashList=function(ee){return this._runTask($(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},Z.prototype.mv=function(ee,K){return this._runTask(L(ee,K),A(arguments))},Z.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(fe,X){K.checkout(X.latest,ee)})})},Z.prototype.pull=function(ee,K,fe,X){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},Z.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},Z.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.")))},Z.prototype.tags=function(ee,K){return this._runTask(ve(g(arguments)),A(arguments))},Z.prototype.rebase=function(){return this._runTask(Pe(["rebase",...g(arguments)]),A(arguments))},Z.prototype.reset=function(ee){return this._runTask(W(z(ee),g(arguments)),A(arguments))},Z.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(Pe(["revert",...g(arguments,0,!0),ee]),K)},Z.prototype.addTag=function(ee){let K=typeof ee=="string"?Oe(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},Z.prototype.addAnnotatedTag=function(ee,K){return this._runTask(ae(ee,K),A(arguments))},Z.prototype.deleteLocalBranch=function(ee,K,fe){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},Z.prototype.deleteLocalBranches=function(ee,K,fe){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},Z.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},Z.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},Z.prototype.raw=function(ee){let K=!Array.isArray(ee),fe=[].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.")))},Z.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},Z.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=Z}});HQ();var b$o=class extends d3{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};HQ();HQ();var gle=class extends d3{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Ale();pvn();kvn();jvn();$vn();Wvn();Kvn();eCn();function S$o(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new gle(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new gle(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(S$o,"abortPlugin");function T$o(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of M_n(e,r))if(t[n.category]!==!0)throw new gle(void 0,"unsafe",n.message);return e}}}a(T$o,"blockUnsafeOperationsPlugin");io();function I$o(t){let e=bIe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(I$o,"commandConfigPrefixingPlugin");io();var cvn=(0,hle.deferred)().promise;function x$o({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,hle.deferred)(),closeTimeout:(0,hle.deferred)(),exit:(0,hle.deferred)(),exitTimeout:(0,hle.deferred)()},c=Promise.race([t===!1?cvn:s.closeTimeout.promise,e===!1?cvn: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(()=>kQt(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 kQt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(x$o,"completionDetectionPlugin");io();var w$o="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",lvn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function R$o(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(R$o,"isBadArgument");function uvn(t,e){if(t.length<1||t.length>2)throw new gle(void 0,"binary",w$o);if(t.some(R$o))if(e)console.warn(lvn);else throw new gle(void 0,"binary",lvn);let[n,o]=t;return{binary:n,prefix:o}}a(uvn,"toBinaryConfig");function P$o(t,e=["git"],r=!1){let n=uvn(eO(e),r);t.on("binary",o=>{n=uvn(eO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(P$o,"customBinaryPlugin");HQ();function k$o(t){return!!(t.exitCode&&t.stdErr.length)}a(k$o,"isTaskError");function D$o(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(D$o,"getErrorMessage");function N$o(t=!1,e=k$o,r=D$o){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(N$o,"errorDetectionHandler");function dvn(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 d3(void 0,n.toString("utf-8"))}:{error:n}}}}a(dvn,"errorDetectionPlugin");io();var M$o=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new pbn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Ox(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return eO(t).forEach(r=>r&&this.plugins.add(Ox(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 O$o(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?Evn(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:B$o(u[1]),progress:du(u[2]),processed:du(u[3]),total:du(u[4])})})}}]}a(O$o,"progressMonitorPlugin");function B$o(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(B$o,"progressEventStage");io();function L$o(t){let e=vvn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(L$o,"spawnOptionsPlugin");function F$o({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 gle(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(F$o,"timeoutPlugin");function U$o(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oDx(c)&&lle(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(U$o,"suffixPathsPlugin");io();var Q$o=C$o();function q$o(t,e){let r=new M$o,n=Tvn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!YQt(n.baseDir))throw new b$o(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(I$o(n.config)),r.add(T$o(n.unsafe)),r.add(x$o(n.completion)),n.abort&&r.add(S$o(n.abort)),n.progress&&r.add(O$o(n.progress)),n.timeout&&r.add(F$o(n.timeout)),n.spawnOptions&&r.add(L$o(n.spawnOptions)),r.add(U$o()),r.add(dvn(N$o(!0))),n.errors&&r.add(dvn(n.errors)),P$o(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Q$o(n,r)}a(q$o,"gitInstanceFactory");Ale();var UKe=q$o;var Bx=new Ee("Git Service");var QKe=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 j7()).path;n=UKe({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,mbn.join)(n,r);return ba(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){Bx.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){Bx.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){Bx.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){Bx.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){Bx.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 Bx.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};Bx.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){Bx.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){Bx.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,hbn.fileURLToPath)(e)}catch(r){Bx.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 Bx.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var gbn=he(Jc());var Ck=new Ee("Local Diff Tracker");var qKe=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 QKe(e),this._repositoryManager=e.get(V0),this._diffRefreshTimer=new gbn.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{Ck.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):Ck.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){Ck.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){Ck.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)&&Ck.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?Ck.warn(this.ctx,n,o):Ck.warn(this.ctx,n):o!==void 0?Ck.debug(this.ctx,n,o):Ck.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var GQ;(n=>{function t(o){return new mqt(o)}n.ok=t,a(t,"ok");function e(o){return new gqt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(GQ||={});var mqt=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}},gqt=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 Aqt=new Ee("GithubAvailableEmbeddingTypes"),jKe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Ut).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):GQ.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(Ut).getGitHubSession();return e?await this.doGetAvailableTypes(e):GQ.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=sle(this._ctx);r=await Bf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return Aqt.error(this._ctx,"Error fetching available embedding types",c),GQ.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?GQ.error({type:"unauthorized",status:r.status}):GQ.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new TC(c.id);c.active===!1?s.push(l):o.push(l)}return GQ.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){Aqt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return Aqt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var j$o=new Ee("GithubEmbeddingComputer"),Ele=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(Ut).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){j$o.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 Bf(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 TC(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 PIe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var Abn=he(AA()),ybn=he(h9()),Ebn=require("os"),yqt=he(require("path")),_le=require("process");function HKe(t){let e=Wn(t.workspaceFolder.uri),r=(0,Abn.basename)(e),o=(0,ybn.SHA256)(e).toString().substring(0,8);return yqt.default.join(H$o(),"project-index",`${r}.${o}`)}a(HKe,"getWorkspaceCachePath");function H$o(){return _le.env.XDG_CACHE_HOME&&yqt.default.isAbsolute(_le.env.XDG_CACHE_HOME)?_le.env.XDG_CACHE_HOME+"/github-copilot":(0,Ebn.platform)()==="win32"?_le.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":_le.env.HOME+"/.cache/github-copilot"}a(H$o,"getXdgCachePath");p();p();function _bn(t){if(qUt(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(Eqt,"unpackEmbedding");var vbn=he(Jc()),Cbn=he(gk()),vqt=he(jp()),bbn=he(require("fs")),Cqt=he(require("node:sqlite")),bqt=he(require("path"));var _qt=new Ee("WorkspaceChunkAndEmbeddingCache");async function Sbn(t,e,r,n){return await Sqt.create(t,e,r??":memory:",n)}a(Sbn,"createWorkspaceChunkAndEmbeddingCache");var Sqt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new Cbn.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=bqt.default.join(n,"workspace-chunks.db");try{await bbn.default.promises.mkdir(bqt.default.dirname(d),{recursive:!0}),c=new Cqt.default.DatabaseSync(d,s),_qt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){_qt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new Cqt.default.DatabaseSync(":memory:",s),_qt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; PRAGMA cache_size = ${-128*1024}; @@ -2776,22 +2732,22 @@ ${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=Sjt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new Ijt.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 Ijt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:Sjt(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,oSn.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,iSn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var lSn=ce(El()),axe=ce(Xc()),uSn=ce(_3());var DJe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new uSn.Lazy(async()=>(this._cacheRoot=PJe(this._workspaceFileIndex),await cSn(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 sxe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,axe.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,axe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return I_n(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 sxe,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,lSn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,axe.raceCancellationError)(this._cache.value,s),l=await(0,axe.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 dSn=ce(Xc()),fSn=ce(bP()),Hle=ce(cO());var mA=new ge("Embeddings Search"),NJe=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 qn.CancellationTokenSource;this._reindexRequests=new fSn.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 Hle.StopWatch;mA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:fA(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(),Nh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Hle.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,fA(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}),J0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,Ky.Aggregate),{chunks:d}}else{mA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),J0.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 Hle.StopWatch;mA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:fA(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}Nh(o);let d=new Hle.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,fA(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}),J0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,Ky.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 DJe(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 Hle.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 qn.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 dSn.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 lxe=ce(Gx());async function LJe(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 lxe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&tP(r.reason)))return lxe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!tP(r.reason))return lxe.Result.error({errorDiagMessage:r.reason+""});return lxe.Result.error({errorDiagMessage:"unknown error"})}a(LJe,"raceSearchOperations");var uxe=ce(Gx()),dxe=ce(Xc());var iKo=2e3,oKo=.7,ySn=8e3,sKo=300,FJe=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>iKo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>oKo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return uxe.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 uxe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,dxe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return uxe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>sKo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return uxe.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,dxe.raceTimeout)(u,ySn),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 LJe([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,dxe.raceTimeout)(u,ySn);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:PIe(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 ESn=ce(require("path")),_Sn=require("worker_threads");var Ojt=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 aKo(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(aKo,"createRpcProxy");var QJe=class{constructor(e,r,n){this.responseHandler=new Ojt;this.worker=new _Sn.Worker(e,r),eTe(this.worker,ESn.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=aKo((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 HJe=ce(Xc()),CSn=ce(_3()),vSn=ce(ko()),Gle=ce(cO()),bSn=require("fs"),qJe=ce(require("path"));var Vh=new ge("Tfidf Search"),cKo=100,jJe=class extends vSn.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 UJe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new CSn.Lazy(()=>{let s=this.firstExistingPath([qJe.join(__dirname,"tfidfWorker.js"),qJe.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(Jn).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)=>(Vh.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(Vh.error(r,u,...d),Promise.resolve()),"logError")};return new QJe(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(){Vh.info(this.ctx,"Starting initialization...");let r=new Gle.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return Vh.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 Gle.StopWatch;Vh.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:fA(n)});try{if(await this.initialize(),this._isDisposed)throw J0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:fA(n),maxSpread:kIe},l=await r.resolveQuery(o),u=new Gle.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();Vh.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Nh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,fA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return Vh.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),J0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,Ky.Aggregate),{chunks:h.chunks}}catch(c){throw Vh.error(this.ctx,"TF-IDF search failed",c),J0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new Gle.StopWatch;if(Vh.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return Vh.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:fA(n),maxSpread:kIe},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));Vh.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,fA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return Vh.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),J0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,Ky.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new Gle.StopWatch,l=[];if(Vh.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new qn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,HJe.raceTimeout)(h,f,()=>{Vh.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,Vh.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(Vh.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){Vh.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 Vh.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),Vh.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),Vh.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new HJe.Limiter(cKo),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(Fo).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=PJe(this._workspaceFileIndex);return qJe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,bSn.existsSync)(n))return n}};p();p();p();var Bjt=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 Fjt(e,r))}static forPaths(e=!1){return new t(new GJe(void 0,!e))}static forStrings(){return new t(new Bjt)}static forConfigKeys(){return new t(new Ljt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);b6t(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);b6t(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 $le,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 $le,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new $le,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new $le,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=I3.unwrap(o.value);o.value=I3.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 I3.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:tK(!1);case 1:tK(!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=I3.unwrap(n.value)||o,n=n.mid;else break}return n&&I3.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?I3.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,I3.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 SSn=ce(Xc()),TSn=ce(require("fs")),ISn=ce(ti());var uKo=1.5*1024*1024,Ujt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new ISn.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}`}},VJe=class extends Ujt{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(Fo).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(Cc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=Wn(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,SSn.raceCancellationError)(dKo(r,uKo),this._disposedCts.token)}))}catch{return}}};async function dKo(t,e){return new Promise((r,n)=>{let o=TSn.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(dKo,"readLocalTextFileUsingReadStream");var WJe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new Qjt;this._onDidCreateFiles=new no;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new no;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new no;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=ho(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 VJe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(qy).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(Cc);(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=ho(o.uri);s&&this._fsFileTree.addFile(s,new VJe(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.ctx.get(Fo).stat(n.uri)).type!==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.ctx.get(Fo).stat(n.uri)).type!==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)}}},Qjt=class{constructor(){this._tree=$Je.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 xSn=ce(Xc());var zJe=class extends FM{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new no;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new no;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(S_).addListener(this),this._fileReadLimiter=new xSn.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 WJe(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 fxe=ce(Gx()),wSn=ce(El()),$x=ce(Xc()),uq=ce(cO());var el=new ge("Semantic Search"),kP=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new kJe(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 qjt(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)}},qjt=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 zJe(this._ctx),o=new eJe(this._ctx);this._localDiffSearch=new FJe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new ZKe(this._ctx),this._codeSearchChunkSearch=new tJe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new NJe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new jJe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new RJe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!jL(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);el.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:fA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw el.error(this._ctx,"Semantic search failed",l.err),J0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);el.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,$x.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);el.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,fA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return el.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),J0.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){Nh(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(tP(n))throw n;return el.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new jle(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){el.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,$x.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new uq.StopWatch;el.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,$x.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,$x.raceCancellationError)((0,$x.raceTimeout)(u,n),c);if(d?.isOk())return el.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;el.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 LJe([u,f]);return el.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){el.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){el.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,$x.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),el.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){el.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),el.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){el.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),el.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 el.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return el.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),fxe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new uq.StopWatch;el.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,$x.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(el.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),fxe.Result.ok({strategy:e.id,result:c})):(el.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),fxe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(tP(c))throw el.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return el.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),fxe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,wSn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(Cc).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){el.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,$x.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*kIe,d=s.filter(f=>f.distance.value>=u);return el.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return tP(s)||el.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,$x.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:PIe(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,ho(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=pA(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=po(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=Eqt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new vqt.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=po(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 vqt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:Eqt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=po(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,vbn.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,_bn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var Tbn=he(Al()),kIe=he(Jc()),Ibn=he(s3());var GKe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new Ibn.Lazy(async()=>(this._cacheRoot=HKe(this._workspaceFileIndex),await Sbn(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 PIe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,kIe.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,kIe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return jyn(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 PIe,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,Tbn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,kIe.raceCancellationError)(this._cache.value,s),l=await(0,kIe.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 xbn=he(Jc()),wbn=he(gk()),vle=he(KM());var yA=new Ee("Embeddings Search"),$Ke=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 qn.CancellationTokenSource;this._reindexRequests=new wbn.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(yA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){yA.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 vle.StopWatch;yA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:mA(r),indexStatus:this._state});let s=await this._ctx.get(Ut).getGitHubSession();if(!s)throw yA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),Mh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new vle.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 yA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),K0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,Ky.Aggregate),{chunks:d}}else{yA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),K0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return yA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new vle.StopWatch;yA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:mA(r),fileCount:n.length});let c=await this._ctx.get(Ut).getGitHubSession();if(!c)throw yA.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){yA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}Mh(o);let d=new vle.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 yA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),K0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,Ky.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){yA.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?(yA.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 GKe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),yA.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 vle.StopWatch;yA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Ut).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new qn.CancellationTokenSource().token),this.setState("ready"),yA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){yA.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=po(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=po(o),c=this._reindexRequests.get(s);c||(c=new xbn.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(Ut).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var NIe=he(Lx());async function YKe(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 NIe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&zP(r.reason)))return NIe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!zP(r.reason))return NIe.Result.error({errorDiagMessage:r.reason+""});return NIe.Result.error({errorDiagMessage:"unknown error"})}a(YKe,"raceSearchOperations");var MIe=he(Lx()),OIe=he(Jc());var X$o=2e3,eVo=.7,Mbn=8e3,tVo=300,KKe=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>X$o)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>eVo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return MIe.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 MIe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,OIe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return MIe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>tVo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return MIe.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,OIe.raceTimeout)(u,Mbn),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 YKe([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,OIe.raceTimeout)(u,Mbn);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:tIe(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 Obn=he(require("path")),Bbn=require("worker_threads");var Pqt=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 rVo(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(rVo,"createRpcProxy");var ZKe=class{constructor(e,r,n){this.responseHandler=new Pqt;this.worker=new Bbn.Worker(e,r),RSe(this.worker,Obn.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=rVo((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 tJe=he(Jc()),Lbn=he(s3()),Fbn=he(wo()),Cle=he(KM()),Ubn=require("fs"),XKe=he(require("path"));var Vh=new Ee("Tfidf Search"),nVo=100,eJe=class extends Fbn.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 JKe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new Lbn.Lazy(()=>{let s=this.firstExistingPath([XKe.join(__dirname,"tfidfWorker.js"),XKe.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)=>(Vh.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(Vh.error(r,u,...d),Promise.resolve()),"logError")};return new ZKe(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(){Vh.info(this.ctx,"Starting initialization...");let r=new Cle.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return Vh.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 Cle.StopWatch;Vh.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:mA(n)});try{if(await this.initialize(),this._isDisposed)throw K0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:mA(n),maxSpread:eIe},l=await r.resolveQuery(o),u=new Cle.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();Vh.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Mh(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 Vh.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),K0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,Ky.Aggregate),{chunks:h.chunks}}catch(c){throw Vh.error(this.ctx,"TF-IDF search failed",c),K0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new Cle.StopWatch;if(Vh.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return Vh.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:eIe},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));Vh.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 Vh.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),K0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,Ky.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new Cle.StopWatch,l=[];if(Vh.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new qn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,tJe.raceTimeout)(h,f,()=>{Vh.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,Vh.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(Vh.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){Vh.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 Vh.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),Vh.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),Vh.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new tJe.Limiter(nVo),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(Bo).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=HKe(this._workspaceFileIndex);return XKe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,Ubn.existsSync)(n))return n}};p();p();p();var kqt=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 Nqt(e,r))}static forPaths(e=!1){return new t(new rJe(void 0,!e))}static forStrings(){return new t(new kqt)}static forConfigKeys(){return new t(new Dqt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);R8t(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);R8t(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 ble,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 ble,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new ble,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new ble,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=f3.unwrap(o.value);o.value=f3.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 f3.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:LY(!1);case 1:LY(!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=f3.unwrap(n.value)||o,n=n.mid;else break}return n&&f3.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?f3.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,f3.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 Qbn=he(Jc()),qbn=he(require("fs")),jbn=he(ti());var iVo=1.5*1024*1024,Mqt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new jbn.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}`}},iJe=class extends Mqt{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(Bo).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(Ec).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=Wn(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,Qbn.raceCancellationError)(oVo(r,iVo),this._disposedCts.token)}))}catch{return}}};async function oVo(t,e){return new Promise((r,n)=>{let o=qbn.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(oVo,"readLocalTextFileUsingReadStream");var oJe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new Oqt;this._onDidCreateFiles=new ro;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new ro;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new ro;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=Yo(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 iJe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(_x).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(Ec);(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=Yo(o.uri);s&&this._fsFileTree.addFile(s,new iJe(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.ctx.get(Bo).stat(n.uri)).type!==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.ctx.get(Bo).stat(n.uri)).type!==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)}}},Oqt=class{constructor(){this._tree=nJe.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 Hbn=he(Jc());var sJe=class extends G7{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new ro;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new ro;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(AS).addListener(this),this._fileReadLimiter=new Hbn.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 oJe(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 BIe=he(Lx()),Gbn=he(Al()),Fx=he(Jc()),VQ=he(KM());var Zc=new Ee("Semantic Search"),bk=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new jKe(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 Bqt(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)}},Bqt=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 sJe(this._ctx),o=new fKe(this._ctx);this._localDiffSearch=new KKe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new uKe(this._ctx),this._codeSearchChunkSearch=new pKe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new $Ke(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new eJe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new qKe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!RL(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 VQ.StopWatch,s=await this.resolveQueryText(e,n);Zc.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 Zc.error(this._ctx,"Semantic search failed",l.err),K0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);Zc.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,Fx.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);Zc.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 Zc.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),K0.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){Mh(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(zP(n))throw n;return Zc.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new Ele(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){Zc.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,Fx.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new VQ.StopWatch;Zc.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,Fx.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,Fx.raceCancellationError)((0,Fx.raceTimeout)(u,n),c);if(d?.isOk())return Zc.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;Zc.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 VQ.StopWatch,m=await YKe([u,f]);return Zc.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){Zc.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){Zc.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new VQ.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,Fx.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),Zc.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){Zc.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new VQ.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),Zc.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){Zc.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new VQ.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),Zc.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 Zc.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return Zc.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),BIe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new VQ.StopWatch;Zc.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,Fx.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(Zc.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),BIe.Result.ok({strategy:e.id,result:c})):(Zc.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),BIe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(zP(c))throw Zc.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return Zc.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),BIe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,Gbn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(Ec).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){Zc.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,Fx.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*eIe,d=s.filter(f=>f.distance.value>=u);return Zc.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return zP(s)||Zc.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,Fx.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:tIe(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,Yo(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=gA(e.text);return`File: \`${r}\` ${n} ${e.text} -${n}`}};var JJe=ce(WYe()),kSn=ce(require("os"));var fKo=Math.min(Math.max(Math.ceil(kSn.cpus().length/2),1),10),jjt=class{constructor(){this._acquired=!1;this._waiters=[]}static{a(this,"AsyncLock")}async acquireAsync(){if(!this._acquired){this._acquired=!0;return}await new Promise(e=>this._waiters.push(e))}release(){let e=this._waiters.shift();e?e():this._acquired=!1}},RSn=new ge("ProjectContextSkill"),Vle=class t{constructor(){this.isActive=!0}static{a(this,"WorkerPoolToken")}static{this.workerPoolStarted=!1}static{this.activeProcessCount=0}static{this.allTokens=[]}static{this.lock=new jjt}static async startWorkerPool(){await t.lock.acquireAsync();try{t.workerPoolStarted||(t.workerPoolStarted=!0,await JJe.start({maxWorkers:fKo})),t.activeProcessCount++;let e=new t;return t.allTokens.push(e),e}finally{t.lock.release()}}async stopWorkerPool(){if(this.isActive){await t.lock.acquireAsync();try{this.isActive&&(this.isActive=!1,t.activeProcessCount--,t.activeProcessCount==0&&(await JJe.stop(),t.workerPoolStarted=!1),t.allTokens.includes(this)&&t.allTokens.splice(t.allTokens.indexOf(this),1))}finally{t.lock.release()}}}static async forceStopWorkerPool(){let e=t.allTokens[Symbol.iterator]();for(let r of e)await r.stopWorkerPool();t.workerPoolStarted=!1,t.activeProcessCount=0}},RIe=Vle.startWorkerPool.bind(Vle);var m0d=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()})})}),P7t=47,Hjt=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(x3);return}let r=[],n=this.turnContext.ctx.get(Jn),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 ZM(d.document,u,u),h=new Ar([l]),g=xIe(c)?.5:.8;r.push([`Code excerpt from file \`${ho(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Wle,c,zu(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)}},x3="collect-project-context",YJe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(RSn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(x3,"Collecting relevant project context"),jL(e.ctx)){await e.steps.error(x3,"Workspace indexing is disabled by configuration");return}await e.info(Ws`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(kP);if(!r){await e.steps.error(x3,"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(x3,"No workspace folders available for search");return}let o=In(e.turn.request.message),c=await(this.dependencies.parseUserQuery??D7t)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(x3,"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:p_n,maxResults:Math.min(10*c.length,P7t),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??xmn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(x3,"No project context found");return}return await e.steps.finish(x3),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(x3,"Project context search failed"),RSn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}};var Wle="project-context",KJe=class extends Xm{static{a(this,"ProjectContextSkill")}constructor(e){super(Wle,"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 Hjt(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=>!jL(r))}};var Gjt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Wle]}};async function Px(t){let e=[];return e.push(new oKe),e.push(...await t.get(vP).agents()),e.push(new Gjt),e.push(new HYe),e}a(Px,"getAgents");p();p();var Vx=require("fs"),SK=ce(require("path"));Ns();var Z0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return qt(this.ctx,je.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=SK.dirname(o);await Vx.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` -`;await Vx.promises.appendFile(o,c,{encoding:"utf8",mode:384})}catch(o){Ye.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:gr(),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 SK.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return SK.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await Vx.promises.readFile(n,"utf8")).trim().split(` -`).filter(c=>c.length>0).map(c=>JSON.parse(c))}catch(n){return n.code==="ENOENT"?[]:(Ye.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 Vx.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"?[]:(Ye.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 Vx.promises.unlink(n),Ye.debug(this.ctx,`Deleted transcript: ${n}`)}catch(n){n.code!=="ENOENT"&&Ye.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=SK.dirname(o);await Vx.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` +${n}`}};var $bn=new Ee("ProjectContextSkill"),cld=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()})})}),sVo=47,Lqt=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(p3);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 qM(d.document,u,u),h=new Ar([l]),g=XTe(c)?.5:.8;r.push([`Code excerpt from file \`${Yo(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Sle,c,zu(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)}},p3="collect-project-context",aJe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if($bn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(p3,"Collecting relevant project context"),RL(e.ctx)){await e.steps.error(p3,"Workspace indexing is disabled by configuration");return}await e.info(sa`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(bk);if(!r){await e.steps.error(p3,"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(p3,"No workspace folders available for search");return}let o=Rn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??xyn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(p3,"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:Ryn,maxResults:Math.min(10*c.length,sVo),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??t0n)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(p3,"No project context found");return}return await e.steps.finish(p3),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(p3,"Project context search failed"),$bn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Sle="project-context",cJe=class extends eg{static{a(this,"ProjectContextSkill")}constructor(e){super(Sle,"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 Lqt(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=>!RL(r))}};var Fqt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Sle]}};async function Ix(t){let e=[];return e.push(new EYe),e.push(...await t.get(mk).agents()),e.push(new Fqt),e.push(new uYe),e}a(Ix,"getAgents");p();p();var Ux=require("fs"),oK=he(require("path"));As();var J0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Gt(this.ctx,Je.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=oK.dirname(o);await Ux.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` +`;await Ux.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:ir(),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 oK.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return oK.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await Ux.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 Ux.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 Ux.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=oK.dirname(o);await Ux.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` `)+` -`;await Vx.promises.writeFile(o,c,{encoding:"utf8",mode:384}),Ye.debug(this.ctx,`Wrote ${n.length} events to transcript: ${o}`)}catch(o){Ye.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 SK.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 Vx.promises.readFile(o,"utf8")).trim().split(` -`).filter(l=>l.length>0).map(l=>JSON.parse(l))}catch(o){return o.code==="ENOENT"?[]:(Ye.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 Gf({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=PSn(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 Gf({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 Vx.promises.access(s)}catch{continue}await Vx.promises.copyFile(s,c),Ye.debug(this.ctx,`Archived transcript: ${s} -> ${c}`)}catch(s){Ye.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 Gf({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=PSn(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 Gf({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),Ye.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){Ye.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){Ye.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 Ye.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 Vx.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"?[]:(Ye.error(this.ctx,`Failed to list archived versions: ${r instanceof Error?r.message:String(r)}`),[])}}};function DSn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(DSn,"createUserMessageEvent");function NSn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(NSn,"createUserMessageRenderedEvent");function ZJe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(ZJe,"createAssistantMessageEvent");function MSn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:gr(),timestamp:new Date().toISOString(),parentId:n}}a(MSn,"createToolExecutionStartEvent");function OSn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:gr(),timestamp:new Date().toISOString(),parentId:n}}a(OSn,"createToolExecutionCompleteEvent");function XJe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:gr(),timestamp:new Date().toISOString(),parentId:e}}a(XJe,"createAssistantTurnStartEvent");function zle(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(zle,"createAssistantTurnEndEvent");function PSn(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(PSn,"parseAssistantMessageContent");var w3=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},pO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new Z0(e)}static{a(this,"ConversationRestoration")}async findTurnInPartitions(e,r){Ye.debug(this.ctx,`Finding turn in partitions: conversationId=${e}, turnId=${r}`);let n=await this.transcriptPersistence.findTurnInTranscripts(e,r);if(n)return Ye.debug(this.ctx,`Turn found in transcript: conversationId=${e}, turnId=${r}, partitionId=${n.partitionId}, turnIndex=${n.turnIndex}`),n;Ye.debug(this.ctx,`Turn not found: conversationId=${e}, turnId=${r}`)}async loadPartitionForRestoration(e,r){Ye.debug(this.ctx,`Loading partition for restoration: conversationId=${e}, partitionId=${r}`);let n=await this.transcriptPersistence.buildPartitionFromTranscript(e,r);if(!n){let o=new w3(`Partition not found: conversationId=${e}, partitionId=${r}`,"PARTITION_NOT_FOUND");throw Ye.error(this.ctx,o.message),o}if(!Array.isArray(n.turns)){let o=new w3(`Invalid partition data: turns is not an array: conversationId=${e}, partitionId=${r}`,"INVALID_PARTITION_DATA");throw Ye.error(this.ctx,o.message),o}return Ye.debug(this.ctx,`Partition built from transcript: conversationId=${e}, partitionId=${r}, turnCount=${n.turns.length}`),n}async loadVersionedPartition(e,r,n){Ye.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 w3(`Versioned partition not found: conversationId=${e}, partitionId=${r}, version=${n}`,"PARTITION_NOT_FOUND");throw Ye.error(this.ctx,s.message),s}if(!Array.isArray(o.turns)){let s=new w3("Invalid versioned partition data: turns is not an array","INVALID_PARTITION_DATA");throw Ye.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 w3(`Turn not found in partition: turnId=${r}, partitionId=${e.partitionId}`,"TURN_NOT_FOUND");let o=e.turns.slice(0,n+1);return Ye.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 Ye.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 Ye.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;Ye.info(this.ctx,`Creating version archive: conversationId=${e}, versionTimestamp=${n}, partitions=${o.join(",")}`),await this.archiveTranscriptsAsVersion(e,o,n),Ye.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){Ye.error(this.ctx,`Failed to archive transcripts: ${o instanceof Error?o.message:String(o)}`)}}async restoreConversation(e,r){let n=Date.now(),o=r;Ye.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 w3(`No transcripts found for conversation: conversationId=${e}`,"CONVERSATION_NOT_FOUND");throw Ye.error(this.ctx,m.message),this.sendFailedTelemetry(e,o,m.code,Date.now()-n),m}let c=await this.findTurnInPartitions(e,o);if(!c){Ye.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&&(Ye.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,Ye.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 Ye.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 w3||(Ye.exception(this.ctx,s,`Restoration failed: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"UNKNOWN",Date.now()-n)),s}}ensureTurnInstance(e){if(e instanceof Gf)return e;let r=e,n=new Gf(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){Ye.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){Ye.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){Ye.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=jt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});ht(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});ht(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=jt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});ht(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();var BSn=ce(require("path"));var $jt=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||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},ag=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 uQ}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(Wn(o.uri));else if(o.type==="location")r.add(BSn.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(`${dQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${dQ}${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()}getPromptTemplate(e){let r=this.promptTemplatesCache?.get(e);return r?Promise.resolve(r):Promise.resolve(this.collectBufferedPrompts().find(n=>n.name===e))}async listCustomPrompts(e){let o=(await this.ctx.get(zm).collect(this.ctx,"prompt",e)).map(l=>new $jt(l));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let s=[...o],c=new Set(o.map(l=>l.name));for(let l of this.collectBufferedPrompts())c.has(l.name)||(c.add(l.name),s.push(l));for(let l of s)this.promptTemplatesCache.set(l.name,l);return s}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r){return(await this.listCustomPrompts(e)).find(o=>o.name===r)}async applyPromptTemplateToRequest(e,r){let n=e.message.trim();if(!n.startsWith("/"))return!1;let[o,...s]=n.split(" "),c=o.replace("/",""),l=s.join(" ");if(!c)return!1;let u=r?.length?await this.getCustomPromptByName(r,c):await this.getPromptTemplate(c);if(!u)return!1;if(u.uri.startsWith(dQ))return e.message=`Follow instructions: ${u.content} +`;await Ux.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 oK.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 Ux.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 $f({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=Vbn(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 $f({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 Ux.promises.access(s)}catch{continue}await Ux.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 $f({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=Vbn(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 $f({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 Ux.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 Wbn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a(Wbn,"createUserMessageEvent");function zbn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a(zbn,"createUserMessageRenderedEvent");function lJe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a(lJe,"createAssistantMessageEvent");function Ybn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:ir(),timestamp:new Date().toISOString(),parentId:n}}a(Ybn,"createToolExecutionStartEvent");function Kbn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:ir(),timestamp:new Date().toISOString(),parentId:n}}a(Kbn,"createToolExecutionCompleteEvent");function uJe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:ir(),timestamp:new Date().toISOString(),parentId:e}}a(uJe,"createAssistantTurnStartEvent");function Tle(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a(Tle,"createAssistantTurnEndEvent");function Vbn(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(Vbn,"parseAssistantMessageContent");var h3=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},tO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new J0(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 h3(`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 h3(`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 h3(`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 h3("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 h3(`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 h3(`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 h3||(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 $f)return e;let r=e,n=new $f(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)},{});yt(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});yt(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});yt(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();var Jbn=he(require("path"));var Uqt=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||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},ag=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 Y7}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(Wn(o.uri));else if(o.type==="location")r.add(Jbn.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(`${K7}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${K7}${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()}getPromptTemplate(e){let r=this.promptTemplatesCache?.get(e);return r?Promise.resolve(r):Promise.resolve(this.collectBufferedPrompts().find(n=>n.name===e))}async listCustomPrompts(e){let o=(await this.ctx.get(zm).collect(this.ctx,"prompt",e)).map(l=>new Uqt(l));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let s=[...o],c=new Set(o.map(l=>l.name));for(let l of this.collectBufferedPrompts())c.has(l.name)||(c.add(l.name),s.push(l));for(let l of s)this.promptTemplatesCache.set(l.name,l);return s}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r){return(await this.listCustomPrompts(e)).find(o=>o.name===r)}async applyPromptTemplateToRequest(e,r){let n=e.message.trim();if(!n.startsWith("/"))return!1;let[o,...s]=n.split(" "),c=o.replace("/",""),l=s.join(" ");if(!c)return!1;let u=r?.length?await this.getCustomPromptByName(r,c):await this.getPromptTemplate(c);if(!u)return!1;if(u.uri.startsWith(K7))return e.message=`Follow instructions: ${u.content} -${l}`,!0;e.message=`Follow instructions in [${u.name}](${u.uri}). ${l}`;let d=e.references??[];return d.some(f=>f.type==="file"&&f.uri===u.uri)||d.push({type:"file",uri:u.uri}),e.references=d,!0}};p();p();p();var LSn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> +${l}`,!0;e.message=`Follow instructions in [${u.name}](${u.uri}). ${l}`;let d=e.references??[];return d.some(f=>f.type==="file"&&f.uri===u.uri)||d.push({type:"file",uri:u.uri}),e.references=d,!0}};p();p();p();var Zbn={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"}},FSn="Alright, This response contains a code citation.";p();var USn=` +<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},Xbn="Alright, This response contains a code citation.";p();var e1n=` # Should render ## Links @@ -3001,16 +2957,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 QSn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",pKo=95,hKo={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 qSn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(qSn,"parseFirstNumber");function mKo(t){return Math.min(100,Math.max(0,t))}a(mKo,"clampPercentage");function gKo(t){return t.includes("session")?"session":"weekly"}a(gKo,"getRateLimitNotificationKind");function AKo(t,e,r){let n=$ce(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(AKo,"getRateLimitNotificationMessage");function yKo(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(yKo,"getRateLimitErrorVariant");var Vjt=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 Vp(QSn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},Yjt=new Vjt,Wjt=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=gKo(n),s=mKo(qSn(n)??pKo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=AKo(o,s,c);return await e.ctx.get(IS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new Vp("Alright, I'm producing a rate limit notification")}},Kjt=new Wjt,zjt=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=yKo(n),s=qSn(n),c=KQ.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:hKo[o],isAuto:n.includes("auto")});return new Vp(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},Jjt=new zjt;p();function EKo(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(EKo,"createVulnerability");var HSn=sIe` +`;p();var t1n="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",aVo=95,cVo={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 r1n(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(r1n,"parseFirstNumber");function lVo(t){return Math.min(100,Math.max(0,t))}a(lVo,"clampPercentage");function uVo(t){return t.includes("session")?"session":"weekly"}a(uVo,"getRateLimitNotificationKind");function dVo(t,e,r){let n=bce(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(dVo,"getRateLimitNotificationMessage");function fVo(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(fVo,"getRateLimitErrorVariant");var Qqt=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 Wp(t1n,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},Hqt=new Qqt,qqt=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=uVo(n),s=lVo(r1n(n)??aVo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=dVo(o,s,c);return await e.ctx.get(ES).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new Wp("Alright, I'm producing a rate limit notification")}},Gqt=new qqt,jqt=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=fVo(n),s=r1n(n),c=x_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:cVo[o],isAuto:n.includes("auto")});return new Wp(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},$qt=new jqt;p();function pVo(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(pVo,"createVulnerability");var i1n=NTe` 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. -`,eZe=sIe` +`,dJe=NTe` \`\`\`kotlin fun main() { println("Hello, World!") } \`\`\` -`,_Ko=sIe` +`,hVo=NTe` ### Inputs \`p\` - paragraph message @@ -3026,20 +2982,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 -`,Zjt=` +`,Vqt=` -`,jSn=HSn+Zjt+eZe;function GSn(t){let e=1,r="",n=[];if(t.length===0)r=jSn;else if(t==="0")r=jSn,e=0;else{if(t==="help")return{reply:_Ko,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+=HSn+Zjt:s==="c"&&(r+=eZe+Zjt);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(eZe,o);if(c===-1)break;let l=c+eZe.length;for(let u=0;u0?r:"Debug Fail")}},vKo=new Xjt,eHt=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 Vp("Alright, I'm producing a notification",void 0,[],s)}},bKo=new eHt,tHt=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 Vp(CKo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},SKo=new tHt,rHt=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 Vp(await BAn(e))}},TKo=new rHt,nHt=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[EP,Vy]}instructions(e,r){return"Create a function that prints a christmas tree"}},IKo=new nHt,iHt=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 Vp(In(e.turn.request.message))}},xKo=new iHt,oHt=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(eg).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+=Ws` +`,n1n=i1n+Vqt+dJe;function o1n(t){let e=1,r="",n=[];if(t.length===0)r=n1n;else if(t==="0")r=n1n,e=0;else{if(t==="help")return{reply:hVo,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+=i1n+Vqt:s==="c"&&(r+=dJe+Vqt);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(dJe,o);if(c===-1)break;let l=c+dJe.length;for(let u=0;u0?r:"Debug Fail")}},gVo=new Wqt,zqt=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 Wp("Alright, I'm producing a notification",void 0,[],s)}},AVo=new zqt,Yqt=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 Wp(mVo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},yVo=new Yqt,Kqt=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 Wp(await ugn(e))}},EVo=new Kqt,Jqt=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[fk,Vy]}instructions(e,r){return"Create a function that prints a christmas tree"}},_Vo=new Jqt,Zqt=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 Wp(Rn(e.turn.request.message))}},vVo=new Zqt,Xqt=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(tg).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+=sa` ### ${c} prompt \`\`\`\` ${s} \`\`\`\` - `}),new Vp(o)}return new Vp("No prompt available")}},wKo=new oHt,sHt=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 Vp(await LAn(e,n,o))}},RKo=new sHt,aHt=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}=GSn(r);return e.turn.annotations.push(...o),new Vp(n,void 0,e.turn.annotations)}},kKo=new aHt,cHt=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(LSn),new Vp(FSn,void 0,e.turn.annotations)}},PKo=new cHt,lHt=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 Vp(USn)}},DKo=new lHt,uHt=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"}},NKo=new uHt,dHt=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[Wle]}},MKo=new dHt,fHt=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 Vp("Alright, I'm producing a notification",void 0,[],[],[],e)}},OKo=new fHt;function $Sn(){return[vKo,Yjt,Kjt,Jjt,bKo,SKo,IKo,TKo,xKo,wKo,RKo,kKo,PKo,OKo,DKo,NKo,MKo]}a($Sn,"getDebugTemplates");p();var VSn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:hf}))}),pHt=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(Jn),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(dq,e.uri,zu(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(dq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(dq,"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)),jQ(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],[yS(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 Uo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},dq="problems-in-active-document",tZe=class extends Xm{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(dq,"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 pHt(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 rZe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get(cn).getWorkspaceFolder(e),n=this.fileExistFn(),o=new IIe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=xIe(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(!xIe(e))return;let n=this.turnContext.ctx.get(cn).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new IIe(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([[`${BKo} \`${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([[`${LKo} \`${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([[`${FKo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(Jn),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(PP,e,zu(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[yS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Fo).stat(e),!0}catch{return!1}}}},BKo="Code excerpt from the implementation source file",LKo="Code excerpt from the test file",FKo="Code excerpt from an example test file";var WSn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),hHt=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(Jn),n=new rZe(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(PP,e.testFileUri,zu(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(PP,e.sourceFileUri,zu(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(PP,e.sourceFileUri,zu(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(PP,e.testFileUri,zu(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},PP="test-context",nZe=class extends Xm{static{a(this,"TestContextSkill")}constructor(e){super(PP,"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 hHt(r))}};p();var zSn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:hf}))}),mHt=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(TK,"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(Jn),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(TK,s,zu(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([Ws`\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 Wp(o)}return new Wp("No prompt available")}},CVo=new Xqt,ejt=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 Wp(await dgn(e,n,o))}},bVo=new ejt,tjt=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}=o1n(r);return e.turn.annotations.push(...o),new Wp(n,void 0,e.turn.annotations)}},SVo=new tjt,rjt=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(Zbn),new Wp(Xbn,void 0,e.turn.annotations)}},TVo=new rjt,njt=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 Wp(e1n)}},IVo=new njt,ijt=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"}},xVo=new ijt,ojt=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[Sle]}},wVo=new ojt,sjt=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 Wp("Alright, I'm producing a notification",void 0,[],[],[],e)}},RVo=new sjt;function s1n(){return[gVo,Hqt,Gqt,$qt,AVo,yVo,_Vo,EVo,vVo,CVo,bVo,SVo,TVo,RVo,IVo,xVo,wVo]}a(s1n,"getDebugTemplates");p();var a1n=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:ff}))}),ajt=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(WQ,e.uri,zu(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(WQ,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(WQ,"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)),IQ(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],[uS(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 Jo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},WQ="problems-in-active-document",fJe=class extends eg{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(WQ,"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 ajt(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 pJe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get(an).getWorkspaceFolder(e),n=this.fileExistFn(),o=new ZTe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=XTe(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(!XTe(e))return;let n=this.turnContext.ctx.get(an).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new ZTe(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([[`${PVo} \`${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([[`${kVo} \`${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([[`${DVo} \`${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(Sk,e,zu(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[uS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Bo).stat(e),!0}catch{return!1}}}},PVo="Code excerpt from the implementation source file",kVo="Code excerpt from the test file",DVo="Code excerpt from an example test file";var c1n=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),cjt=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 pJe(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(Sk,e.testFileUri,zu(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(Sk,e.sourceFileUri,zu(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(Sk,e.sourceFileUri,zu(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(Sk,e.testFileUri,zu(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},Sk="test-context",hJe=class extends eg{static{a(this,"TestContextSkill")}constructor(e){super(Sk,"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 cjt(r))}};p();var l1n=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:ff}))}),ljt=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(sK,"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(sK,s,zu(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([sa`\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],[yS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},TK="test-failures",iZe=class extends Xm{static{a(this,"TestFailuresSkill")}constructor(e){super(TK,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new mHt(r))}};var Vp=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")}},IK=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}},UKo=new IK("tests","Generate unit tests","Generate Tests",Ws` +`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[uS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},sK="test-failures",mJe=class extends eg{static{a(this,"TestFailuresSkill")}constructor(e){super(sK,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new ljt(r))}};var Wp=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")}},aK=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}},NVo=new aK("tests","Generate unit tests","Generate Tests",sa` 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. @@ -3050,18 +3006,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. - `,[PP,TK],["chat-panel","agent-panel","editor"]),QKo=new IK("simplify","Simplify the code","Simplify This",Ws` + `,[Sk,sK],["chat-panel","agent-panel","editor"]),MVo=new aK("simplify","Simplify the code","Simplify This",sa` 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"],Ws` + 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"],sa` 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),qKo=new IK("fix","Fix problems and compile errors","Fix This",Ws` + Do not reply with the original code but only a simplified version.`,!0),OVo=new aK("fix","Fix problems and compile errors","Fix This",sa` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. @@ -3072,36 +3028,36 @@ 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.`,[dq],["editor","chat-panel","agent-panel","inline","inline-agent"],Ws` + At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[WQ],["editor","chat-panel","agent-panel","inline","inline-agent"],sa` 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),jKo=new IK("explain","Explain how the code works","Explain This",Ws` + Briefly explain the problems without repeating the detailed error message.`,!0),BVo=new aK("explain","Explain how the code works","Explain This",sa` 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"],Ws` + 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"],sa` 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),HKo=new IK("doc","Document the current selection or file","Generate Docs",Ws` + 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),LVo=new aK("doc","Document the current selection or file","Generate Docs",sa` 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"],Ws` + 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"],sa` 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),gHt=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=cUt(e.conversation),n=Ws` + Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),ujt=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=h9t(e.conversation),n=sa` 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 Vp(n+` + `;return r?new Wp(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 Vp(n)}},GKo=new gHt,AHt=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=yHt(e.ctx).filter(o=>o!=this),n=Ws` +\`\`\``):new Wp(n)}},FVo=new ujt,djt=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=fjt(e.ctx).filter(o=>o!=this),n=sa` 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(` @@ -3113,37 +3069,37 @@ ${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 Vp(n)}},$Ko=new AHt;function xK(){return[UKo,QKo,qKo,jKo,HKo,GKo,$Ko,...$Sn()]}a(xK,"getPromptTemplates");function yHt(t){let e=xK();return!lCe(t)&&!v1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(yHt,"getUserFacingPromptTemplates");var oZe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Vo=class{constructor(e){this.ctx=e;this.conversations=new nn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new SY([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Qh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new oZe(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;Ye.debug(this.ctx,`Restoring conversation: conversationId=${r}, targetTurnId=${n}`);let u=await this.ctx.get(pO).restoreConversation(r,n);if(!u){Ye.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new SY(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Qh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new oZe(d,{skills:f})),this.initializeRestoredPartitionTranscript(d),Ye.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){Ye.warn(this.ctx,`Failed to restore conversation: conversationId=${n}, turnId=${r}, error=${s instanceof Error?s.message:String(s)}`)}return Ye.info(this.ctx,`Creating new conversation after failed restoration: originalConversationId=${n}`),gt(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new Z0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:"restoration"}).catch(n=>{Ye.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){Ye.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"&&!sW.has(To(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!sW.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){Ye.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){Ye.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 Z0(this.ctx);if(!n.isEnabled())return;let o=DSn(In(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new Z0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=In(r.response.message),s=String(r.id),c=ZJe(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=zle(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&In(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(In(r.request.message),"@");(await Px(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(In(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(In(r.request.message),"/"),s=xK().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(In(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(In(n.request.message),"/"),l=await e.get(ag).getPromptTemplate(o);l&&(l.uri.startsWith(dQ)?n.request.message=`Follow instructions: ${l.content} + `;return new Wp(n)}},UVo=new djt;function cK(){return[NVo,MVo,OVo,BVo,LVo,FVo,UVo,...s1n()]}a(cK,"getPromptTemplates");function fjt(t){let e=cK();return!Q_e(t)&&!h1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(fjt,"getUserFacingPromptTemplates");var gJe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},jo=class{constructor(e){this.ctx=e;this.conversations=new yn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new cY([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Qh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new gJe(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(tO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new cY(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Qh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new gJe(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}`),_t(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new J0(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"&&!jV.has(po(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!jV.has(po(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 J0(this.ctx);if(!n.isEnabled())return;let o=Wbn(Rn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new J0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Rn(r.response.message),s=String(r.id),c=lJe(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=Tle(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Rn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Rn(r.request.message),"@");(await Ix(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Rn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Rn(r.request.message),"/"),s=cK().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(Rn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Rn(n.request.message),"/"),l=await e.get(ag).getPromptTemplate(o);l&&(l.uri.startsWith(K7)?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(Qh).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 Z0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:e.source,createdAt:e.timestamp}).catch(n=>{Ye.error(this.ctx,`Failed to initialize partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){Ye.error(this.ctx,`Failed to create transcript persistence: ${r instanceof Error?r.message:String(r)}`)}}};p();var sZe=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))Ye.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]})):Ye.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 aZe=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]})):Ye.error(this.ctx,`Step ${e} not found for conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var VKo="X-Initiator",WKo="X-Interaction-ID",zKo="X-Interaction-Type";var cZe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},EHt=class extends cZe{static{a(this,"User")}static id(){return"user"}},_Ht=class extends cZe{static{a(this,"Agent")}static id(){return"agent"}},CHt=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[VKo]:this.initiator,[WKo]:this.interactionId,[zKo]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return gA.agent(e??this.interactionType,this.interactionId)}},gA=class t extends CHt{static{a(this,"LlmInteraction")}static user(e,r){return new t(EHt,e,r)}static agent(e,r){return new t(_Ht,e,r)}};function YSn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(YSn,"interactionTypeForChatMode");var Wx=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new vHt(this),this.steps=new aZe(e,r,n,e.get(vc)),this.collector=new bHt(r,n,e.get(vc)),this.agentToolCalls=new sZe(e,r,n,e.get(vc))}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 gA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?gA.agent(e,this.turn.telemetryId):gA.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(vc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},lZe=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")}},pIe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},vHt=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Vo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(eg).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 lZe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Qh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(eg).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof lZe||o instanceof pIe)throw o;Ye.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},bHt=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 YKo={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function KSn(t){let e=qt(t,je.AutoCompress);return{...YKo,enabled:e}}a(KSn,"getAutomaticCompressionConfig");p();var fq=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(us).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=In(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=In(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),qY(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 Uv=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new fq}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=KSn(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)?(Ye.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){Ye.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 Ye.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 Ye.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=jt.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});ht(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=jt.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});ht(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=jt.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});ht(this.ctx,"automaticCompression.triggered",l,0)}};p();var AA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Md=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var uZe=ce(ice());var JSn=new Map;function Zy(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(Zy,"createNumberRange");function SHt(t){return[...t].sort((e,r)=>r.length-e.length)}a(SHt,"sortByStringLengthDesc");async function KKo(t){let e=JSn.get(t);if(e)return e;let r=(async()=>{try{let n=await tce(`tree-sitter-${t}.wasm`);return await uZe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return JSn.set(t,r),r}a(KKo,"loadShellLanguage");function ZSn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(ZSn,"isPowerShell");var JKo=new Map([["sh",SHt([...Zy(1,9).concat("").map(t=>`${t}<<<`),...Zy(1,9).concat("").flatMap(t=>Zy(1,9).map(e=>`${t}>&${e}`)),...Zy(1,9).concat("").map(t=>`${t}<>`),...Zy(1,9).concat("&","").map(t=>`${t}>>`),...Zy(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",SHt([...Zy(1,9).concat("").map(t=>`${t}<<<`),...Zy(1,9).concat("").flatMap(t=>Zy(1,9).map(e=>`${t}>&${e}`)),...Zy(1,9).concat("").map(t=>`${t}<>`),...Zy(1,9).concat("&","").map(t=>`${t}>>`),...Zy(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",SHt([...Zy(1,6).concat("*","").flatMap(t=>Zy(1,6).map(e=>`${t}>&${e}`)),...Zy(1,6).concat("*","").map(t=>`${t}>>`),...Zy(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function ZKo(t,e){let r,n=e.replace(/\.exe$/,"");ZSn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=JKo.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(ZKo,"splitCommandLineIntoSubCommands");async function dZe(t,e){try{let r;ZSn(e)?r="powershell":r="bash",await uZe.default.init();let n,o;try{n=new uZe.default;let s=await KKo(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 ZKo(t,e)}}a(dZe,"extractSubCommandsWithTreeSitter");var XKo=new Set(["sudo","env"]),eJo=/^[A-Za-z_][A-Za-z0-9_]*=/;function THt(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(eJo.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||XKo.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(THt,"extractCommandNameFromSubCommand");var Yle=new ge("CommandLineAutoApprover"),XSn=/(?!.*)/,tJo=/^[A-Z_][A-Z0-9_]*=/i,qS=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(tJo.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 dZe(e,r);Yle.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 Yle.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 Yle.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Yle.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await dZe(e,r),o=[...new Set(n.map(THt).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await dZe(e,r),o=n.map(s=>THt(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})}}}),Yle.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Yle.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)?XSn:c}catch{return XSn}}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 fZe=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 pZe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(Jn).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var hZe=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=rJo(this.stdout)}static{a(this,"CommandHookResult")}};function rJo(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(rJo,"parseOutput");var RHt=require("child_process");var IHt=new ge("HookExecutor"),mZe=class{constructor(){this.handlers=[new xHt,new wHt]}static{a(this,"HookExecutor")}async execute(e,r,n,o){for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){IHt.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}IHt.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},gZe=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"&&IHt.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 hZe(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"]}}},xHt=class extends gZe{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,RHt.spawn)(e.bash,[],n)}},wHt=class extends gZe{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,RHt.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var nJo=new mZe,Qv=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 nJo.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var wK=class extends Qv{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var R3=class extends Qv{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var AZe={allow:"allow",deny:"deny",ask:"ask"},k3=class extends Qv{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var hxe=class extends Qv{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var mxe=class extends Qv{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var P3=class extends Qv{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var RK=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();var iJo=".github/hooks/**/*.json",oJo="agentHook.execution",sJo={sessionStart:mxe,sessionEnd:hxe,userPromptSubmitted:P3,preToolUse:k3,postToolUse:R3,errorOccurred:wK},Xy=class{constructor(e){this.logger=new ge("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(T_).register("hook",[iJo]),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&>(e,oJo,{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(zm).collect(this.ctx,"hook",e):[]}areHooksEnabled(){return qt(this.ctx,je.EnableHooks)?this.ctx.get(uu).getPolicyValue("customHook.enabled")===!1?(this.logger.debug(this.ctx,"Hooks are disabled due to customHook.enabled policy."),!1):!0:(this.logger.debug(this.ctx,"Hooks are disabled by configuration."),!1)}subscribeToGateChanges(){try{let e=this.ctx.get(Zo);this.lastEnableHooks=qt(this.ctx,je.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=qt(this.ctx,je.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(uu);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(lA).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(sJo).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(zm).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 yA(t){return`[${ji(t)}](${t})`}a(yA,"formatUriForFileWidget");function Ju(t,e){let r=aJo(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(Ju,"resolvePathInput");function aJo(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 sW.has(s)||aa.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(aa.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||eTn()&&lJo(t)||eTn()&&t.startsWith("\\\\"))return Ia(t)}a(aJo,"resolveFsUri");function eTn(){return process.platform==="win32"}a(eTn,"isWindows");function cJo(t){return t>=65&&t<=90||t>=97&&t<=122}a(cJo,"isWindowsDriveLetter");function lJo(t){return cJo(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(lJo,"hasDriveLetter");function hO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof wr?r.value:r instanceof LY?"":r instanceof pQ?JSON.stringify(r.value):"").join(` -`)),e===""?"(empty)":e}a(hO,"parseToolResultToString");function yZe(t){let{content:e}=t;return{message:hO(e)}}a(yZe,"formatToolErrorResult");function tTn(t){let{content:e}=t,r={data:e.map(n=>n instanceof wr?{type:"text",value:n.value}:n instanceof LY?{type:"text",value:""}:n instanceof pQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof hQ&&(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(tTn,"formatToolSuccessResult");function kK(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(kK,"extractShellFromToolDescription");var EZe=new ge("HookTrigger"),Kle=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(Xy),c=o?new RK(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,k3,{timestamp:Date.now(),cwd:Wn(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 EZe.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(Xy),l=s?new RK(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,R3,{timestamp:Date.now(),cwd:Wn(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:hO(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){EZe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(Xy),o=this.extractPromptFromMessage(e),s=r?new RK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,P3,{timestamp:Date.now(),cwd:Wn(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){EZe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(Xy),o=qt(this.ctx,je.HookErrorOccurredStackTrace),s=r?new RK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,wK,{timestamp:Date.now(),cwd:Wn(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){EZe.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===AZe.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 kHt=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},gxe=class extends kHt{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var PK=ce(wo());var jn=class t extends PK.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(PK.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,PK.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> -`)),vscpp(PHt,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},PHt=class extends PK.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function rTn(){return vscpp(jn,{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(jn,{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(jn,{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(jn,{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(rTn,"renderAskModeInstructionBody");p();p();var pq=class extends sr{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 _Ze=class extends sr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var nTn=require("path");var CZe=class extends sr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,nTn.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(us).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=kK(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 sr{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` - ${aa.isRegisteredScheme(l.scheme)?c.uri:ho(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 iTn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(iTn,"partsLength");async function sTn(t,e=1/0,r){let n=oTn(0,t,e),o=e-iTn(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 uJo();let d=oTn(l.level+1,u,o-1);d.length&&(s=!0,o-=iTn(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(sTn,"visualFileTree");function oTn(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(oTn,"toParts");var uJo=a(()=>({tree:"",files:[]}),"emptyTree");p();async function vZe(t,e){let r=To(e);return aa.isRegisteredScheme(r.scheme)?(await t.get(aa).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Fo).readDirectory(e)}a(vZe,"readDirectory");var dJo=new ge("fileReferencesPrompt");async function aTn(t,e,r,n){let o=await cTn(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=aa.isRegisteredScheme(f.scheme)?u:Wn(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(Qh).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 J0(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 AJe=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 yJe=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 QVo="X-Initiator",qVo="X-Interaction-ID",jVo="X-Interaction-Type";var EJe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},pjt=class extends EJe{static{a(this,"User")}static id(){return"user"}},hjt=class extends EJe{static{a(this,"Agent")}static id(){return"agent"}},mjt=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[QVo]:this.initiator,[qVo]:this.interactionId,[jVo]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return EA.agent(e??this.interactionType,this.interactionId)}},EA=class t extends mjt{static{a(this,"LlmInteraction")}static user(e,r){return new t(pjt,e,r)}static agent(e,r){return new t(hjt,e,r)}};function u1n(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(u1n,"interactionTypeForChatMode");var Qx=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new gjt(this),this.steps=new yJe(e,r,n,e.get(_c)),this.collector=new Ajt(r,n,e.get(_c)),this.agentToolCalls=new AJe(e,r,n,e.get(_c))}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 EA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?EA.agent(e,this.turn.telemetryId):EA.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(_c).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},_Je=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")}},QTe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},gjt=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(jo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(tg).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 _Je(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Qh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(tg).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof _Je||o instanceof QTe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},Ajt=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 HVo={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function d1n(t){let e=Gt(t,Je.AutoCompress);return{...HVo,enabled:e}}a(d1n,"getAutomaticCompressionConfig");p();var zQ=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(cs).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=Rn(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=Rn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),bY(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 NC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new zQ}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=d1n(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});yt(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});yt(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});yt(this.ctx,"automaticCompression.triggered",l,0)}};p();var _A=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Dd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var vJe=he(Qae());var f1n=new Map;function Zy(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(Zy,"createNumberRange");function yjt(t){return[...t].sort((e,r)=>r.length-e.length)}a(yjt,"sortByStringLengthDesc");async function GVo(t){let e=f1n.get(t);if(e)return e;let r=(async()=>{try{let n=await Lae(`tree-sitter-${t}.wasm`);return await vJe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return f1n.set(t,r),r}a(GVo,"loadShellLanguage");function p1n(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(p1n,"isPowerShell");var $Vo=new Map([["sh",yjt([...Zy(1,9).concat("").map(t=>`${t}<<<`),...Zy(1,9).concat("").flatMap(t=>Zy(1,9).map(e=>`${t}>&${e}`)),...Zy(1,9).concat("").map(t=>`${t}<>`),...Zy(1,9).concat("&","").map(t=>`${t}>>`),...Zy(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",yjt([...Zy(1,9).concat("").map(t=>`${t}<<<`),...Zy(1,9).concat("").flatMap(t=>Zy(1,9).map(e=>`${t}>&${e}`)),...Zy(1,9).concat("").map(t=>`${t}<>`),...Zy(1,9).concat("&","").map(t=>`${t}>>`),...Zy(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",yjt([...Zy(1,6).concat("*","").flatMap(t=>Zy(1,6).map(e=>`${t}>&${e}`)),...Zy(1,6).concat("*","").map(t=>`${t}>>`),...Zy(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function VVo(t,e){let r,n=e.replace(/\.exe$/,"");p1n(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=$Vo.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(VVo,"splitCommandLineIntoSubCommands");async function CJe(t,e){try{let r;p1n(e)?r="powershell":r="bash",await vJe.default.init();let n,o;try{n=new vJe.default;let s=await GVo(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 VVo(t,e)}}a(CJe,"extractSubCommandsWithTreeSitter");var WVo=new Set(["sudo","env"]),zVo=/^[A-Za-z_][A-Za-z0-9_]*=/;function Ejt(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(zVo.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||WVo.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(Ejt,"extractCommandNameFromSubCommand");var Ile=new Ee("CommandLineAutoApprover"),h1n=/(?!.*)/,YVo=/^[A-Z_][A-Z0-9_]*=/i,MS=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(YVo.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 CJe(e,r);Ile.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 Ile.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 Ile.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Ile.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await CJe(e,r),o=[...new Set(n.map(Ejt).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await CJe(e,r),o=n.map(s=>Ejt(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})}}}),Ile.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Ile.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)?h1n:c}catch{return h1n}}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 bJe=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 SJe=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 TJe=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=KVo(this.stdout)}static{a(this,"CommandHookResult")}};function KVo(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(KVo,"parseOutput");var bjt=require("child_process");var _jt=new Ee("HookExecutor"),IJe=class{constructor(){this.handlers=[new vjt,new Cjt]}static{a(this,"HookExecutor")}async execute(e,r,n,o){for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){_jt.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}_jt.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},xJe=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"&&_jt.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 TJe(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"]}}},vjt=class extends xJe{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,bjt.spawn)(e.bash,[],n)}},Cjt=class extends xJe{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,bjt.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var JVo=new IJe,MC=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 JVo.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var lK=class extends MC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var m3=class extends MC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var wJe={allow:"allow",deny:"deny",ask:"ask"},g3=class extends MC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var FIe=class extends MC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var UIe=class extends MC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var A3=class extends MC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var uK=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();var ZVo=".github/hooks/**/*.json",XVo="agentHook.execution",eWo={sessionStart:UIe,sessionEnd:FIe,userPromptSubmitted:A3,preToolUse:g3,postToolUse:m3,errorOccurred:lK},Xy=class{constructor(e){this.logger=new Ee("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(C_).register("hook",[ZVo]),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&&_t(e,XVo,{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(zm).collect(this.ctx,"hook",e):[]}areHooksEnabled(){return Gt(this.ctx,Je.EnableHooks)?this.ctx.get(cu).getPolicyValue("customHook.enabled")===!1?(this.logger.debug(this.ctx,"Hooks are disabled due to customHook.enabled policy."),!1):!0:(this.logger.debug(this.ctx,"Hooks are disabled by configuration."),!1)}subscribeToGateChanges(){try{let e=this.ctx.get(zo);this.lastEnableHooks=Gt(this.ctx,Je.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Gt(this.ctx,Je.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(cu);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(fA).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(eWo).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(zm).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 vA(t){return`[${Ki(t)}](${t})`}a(vA,"formatUriForFileWidget");function Ju(t,e){let r=tWo(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(Ju,"resolvePathInput");function tWo(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 jV.has(s)||na.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(na.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||m1n()&&nWo(t)||m1n()&&t.startsWith("\\\\"))return ba(t)}a(tWo,"resolveFsUri");function m1n(){return process.platform==="win32"}a(m1n,"isWindows");function rWo(t){return t>=65&&t<=90||t>=97&&t<=122}a(rWo,"isWindowsDriveLetter");function nWo(t){return rWo(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(nWo,"hasDriveLetter");function rO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof wr?r.value:r instanceof EY?"":r instanceof Z7?JSON.stringify(r.value):"").join(` +`)),e===""?"(empty)":e}a(rO,"parseToolResultToString");function RJe(t){let{content:e}=t;return{message:rO(e)}}a(RJe,"formatToolErrorResult");function g1n(t){let{content:e}=t,r={data:e.map(n=>n instanceof wr?{type:"text",value:n.value}:n instanceof EY?{type:"text",value:""}:n instanceof Z7?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof X7&&(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(g1n,"formatToolSuccessResult");function dK(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(dK,"extractShellFromToolDescription");var PJe=new Ee("HookTrigger"),xle=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(Xy),c=o?new uK(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,g3,{timestamp:Date.now(),cwd:Wn(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 PJe.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(Xy),l=s?new uK(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,m3,{timestamp:Date.now(),cwd:Wn(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:rO(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){PJe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(Xy),o=this.extractPromptFromMessage(e),s=r?new uK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,A3,{timestamp:Date.now(),cwd:Wn(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){PJe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(Xy),o=Gt(this.ctx,Je.HookErrorOccurredStackTrace),s=r?new uK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,lK,{timestamp:Date.now(),cwd:Wn(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){PJe.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===wJe.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 Sjt=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},QIe=class extends Sjt{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var fK=he(Io());var jn=class t extends fK.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(fK.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,fK.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> +`)),vscpp(Tjt,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},Tjt=class extends fK.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function A1n(){return vscpp(jn,{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(jn,{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(jn,{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(jn,{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(A1n,"renderAskModeInstructionBody");p();p();var YQ=class extends ar{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 kJe=class extends ar{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var y1n=require("path");var DJe=class extends ar{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,y1n.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(cs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=dK(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 KQ=class extends ar{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=po(c.uri);return` - ${na.isRegisteredScheme(l.scheme)?c.uri:Yo(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 E1n(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(E1n,"partsLength");async function v1n(t,e=1/0,r){let n=_1n(0,t,e),o=e-E1n(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 iWo();let d=_1n(l.level+1,u,o-1);d.length&&(s=!0,o-=E1n(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(v1n,"visualFileTree");function _1n(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(_1n,"toParts");var iWo=a(()=>({tree:"",files:[]}),"emptyTree");p();async function NJe(t,e){let r=po(e);return na.isRegisteredScheme(r.scheme)?(await t.get(na).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Bo).readDirectory(e)}a(NJe,"readDirectory");var oWo=new Ee("fileReferencesPrompt");async function C1n(t,e,r,n){let o=await b1n(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=po(u),h=na.isRegisteredScheme(f.scheme)?u:Wn(u);s+=`${l} (Absolute Path: ${h})/ `;for(let m of d.tree.split(` `))s+=` ${m} -`}let c=pA(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(aTn,"generateWorkspaceStructurePrompt");async function cTn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await sTn(await lTn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(cTn,"generateWorkspaceStructure");async function lTn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await vZe(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=xa(e,s);return!aa.isRegisteredScheme(To(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||hJo(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>lTn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(lTn,"buildFileList");var fJo=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],pJo=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function hJo(t){return!!(pJo.includes(ji(t).toLowerCase())||ho(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>fJo.includes(r)))}a(hJo,"shouldAlwaysIgnoreFile");async function bZe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:ji(c.uri)})),o=await cTn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${Wn(l)})`),s.push(u.tree),s.push("");return s}catch(n){return dJo.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(bZe,"processDirectoryReferences");var Jle=class extends sr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await aTn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||qn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var uTn=ce(wo());var Axe=class extends sr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(uTn.UserMessage,null,vscpp(jn,{name:"environment_info"},vscpp(pq,{ctx:this.props.ctx}),vscpp(CZe,{ctx:this.props.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(hq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(Jle,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(_Ze,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var SZe=ce(require("path"));var DHt=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(tf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}},EA=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.skillFileLocationsPatterns=[];this.logger=new ge("CustomSkillService");this._onDidChangeSkillsEnabled=new Wm;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.DEFAULT_SKILL_REGISTRATIONS=[".agents/skills/**/SKILL.md",".github/skills/**/SKILL.md",".claude/skills/**/SKILL.md","~/.agents/skills/**/SKILL.md","~/.copilot/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}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(uu);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(lA).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._onDidChangeSkillsEnabled.dispose()}skipIfSkillsEnabledUnchanged(e){let r=qt(this.ctx,je.EnableSkills);return()=>{let n=qt(this.ctx,je.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){let e=qt(this.ctx,je.EnableSkills),r=this.ctx.get(uu).getPolicyValue("customSkill.enabled")!==!1;return e&&r}syncRegistry(){let e=qt(this.ctx,je.EnableSkills),r=new Set;if(e){for(let n of t.DEFAULT_SKILL_REGISTRATIONS)r.add(n);for(let n of this.skillFileLocationsPatterns)r.add(n)}this.registrySkillPatterns=this.promptFileLocationRegistry.replace(this.registrySkillPatterns,"skill",Array.from(r))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(Wn(n.uri)):n.type==="location"&&r.add(SZe.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e){return this.isSkillsEnabled()?(await this.ctx.get(zm).collect(this.ctx,"skill",e)).map(o=>new DHt(o)):[]}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=SZe.default.dirname(r)),!!r)return SZe.default.normalize(r)}};var TZe=class extends sr{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(EA).listSkills(e);if(gt(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=gA(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(C1n,"generateWorkspaceStructurePrompt");async function b1n(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await v1n(await S1n(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(b1n,"generateWorkspaceStructure");async function S1n(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await NJe(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=Sa(e,s);return!na.isRegisteredScheme(po(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||cWo(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>S1n(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(S1n,"buildFileList");var sWo=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],aWo=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function cWo(t){return!!(aWo.includes(Ki(t).toLowerCase())||Yo(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>sWo.includes(r)))}a(cWo,"shouldAlwaysIgnoreFile");async function MJe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ki(c.uri)})),o=await b1n(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${Wn(l)})`),s.push(u.tree),s.push("");return s}catch(n){return oWo.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(MJe,"processDirectoryReferences");var wle=class extends ar{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await C1n(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||qn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var T1n=he(Io());var qIe=class extends ar{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(T1n.UserMessage,null,vscpp(jn,{name:"environment_info"},vscpp(YQ,{ctx:this.props.ctx}),vscpp(DJe,{ctx:this.props.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(KQ,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(wle,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(kJe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var OJe=he(require("path"));var Ijt=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(Xd(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}},Z0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.skillFileLocationsPatterns=[];this.logger=new Ee("CustomSkillService");this._onDidChangeSkillsEnabled=new Wm;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.DEFAULT_SKILL_REGISTRATIONS=[".agents/skills/**/SKILL.md",".github/skills/**/SKILL.md",".claude/skills/**/SKILL.md","~/.agents/skills/**/SKILL.md","~/.copilot/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}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(cu);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(fA).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._onDidChangeSkillsEnabled.dispose()}skipIfSkillsEnabledUnchanged(e){let r=Gt(this.ctx,Je.EnableSkills);return()=>{let n=Gt(this.ctx,Je.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){let e=Gt(this.ctx,Je.EnableSkills),r=this.ctx.get(cu).getPolicyValue("customSkill.enabled")!==!1;return e&&r}syncRegistry(){let e=Gt(this.ctx,Je.EnableSkills),r=new Set;if(e){for(let n of t.DEFAULT_SKILL_REGISTRATIONS)r.add(n);for(let n of this.skillFileLocationsPatterns)r.add(n)}this.registrySkillPatterns=this.promptFileLocationRegistry.replace(this.registrySkillPatterns,"skill",Array.from(r))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(Wn(n.uri)):n.type==="location"&&r.add(OJe.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e){return this.isSkillsEnabled()?(await this.ctx.get(zm).collect(this.ctx,"skill",e)).map(o=>new Ijt(o)):[]}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=OJe.default.dirname(r)),!!r)return OJe.default.normalize(r)}};var BJe=class extends ar{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(Z0).listSkills(e);if(_t(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(jn,{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 dTn={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},Zle=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await TGe(e.ctx)&&r.set(dTn.name,dTn);let o=await e.ctx.get(jp).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&>(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 mJo=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 fTn(t){return mJo.get(t)??"unknown"}a(fTn,"getToolFunctionalType");var gJo=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"]]),AJo=new Map;for(let[t,e]of gJo)AJo.set(e,t);var pTn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),hTn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var IZe=class extends sr{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 Zle().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(jn,{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 Xle=class extends sr{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 yJo=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],mO=class extends sr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&yJo.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var mTn=ce(wo());var xZe=class extends sr{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(mTn.SystemMessage,null,vscpp(jn,{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(Xle,null)),vscpp(jn,{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(jn,{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(jn,{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(jn,{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(jn,{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(mO,{languageOverride:this.props.languageOverride}))}};p();var gTn=ce(wo());var wZe=class extends sr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(gTn.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(mO,{languageOverride:this.props.languageOverride}))}};p();p();var ATn="filepath:",_A="...existing code...";p();var RZe=class extends sr{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 mq=class extends sr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!OWe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Tn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Tn.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 yTn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(yTn,"modelSupportsReplaceString");function ETn(t){return t?t.startsWith("gpt-5"):!1}a(ETn,"isGpt5PlusFamily");function EJo(t){return t?t==="gpt-5.2-codex":!1}a(EJo,"isGpt52CodexFamily");function _Jo(t){return t?t==="gpt-5.2":!1}a(_Jo,"isGpt52Family");function _Tn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||EJo(e)||_Jo(e))}a(_Tn,"modelSupportsApplyPatch");var CTn=ce(wo());var kZe=class extends sr{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=ETn(this.props.modelConfiguration.modelFamily);return vscpp(CTn.SystemMessage,null,vscpp(jn,{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(mq,{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(jn,{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(jn,{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(jn,{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(RZe,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),"// ",_A,vscpp("br",null),"changed code",vscpp("br",null),"// ",_A,vscpp("br",null),"changed code",vscpp("br",null),"// ",_A,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 {",` // ${_A}`," age: number;",` // ${_A}`," getAge() {"," return this.age;"," }","}"].join(` -`))),vscpp(jn,{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(jn,{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(mO,{languageOverride:this.props.languageOverride}))}};p();var PZe=class extends sr{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.")}},DZe=class extends sr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var eue=class extends sr{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))}},NZe=class extends sr{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))}},MZe=class extends sr{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 vTn=ce(wo());var OZe=class extends sr{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(vTn.SystemMessage,{priority:1e3},vscpp(jn,{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(mq,{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(jn,{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 `",_A,"` 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(mO,{languageOverride:this.props.languageOverride}))}},BZe=class extends sr{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 LZe=ce(wo());var FZe=class extends sr{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=qt(this.props.turnContext.ctx,je.UseAgentsMd);return OWe(n.modelFamily)?vscpp(wZe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(xZe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(OZe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(kZe,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Lr).getEditorInfo().name,n=e.get(Mn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(LZe.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(Tn.Gpt5)?vscpp(vscppf,null,vscpp(DZe,null),vscpp(NZe,null)):vscpp(vscppf,null,vscpp(PZe,null),vscpp(eue,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(LZe.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(LZe.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 bTn=ce(wo());var UZe=class extends sr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=GM(this.props.currentTurn.response?.message,!0),r=tO(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,bTn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(Mx,{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 QZe=class extends sr{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 qZe=class extends sr{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(jn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&CJo(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 ",Wn(e.uri),". ",n)}};function CJo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(CJo,"notEmptySelection");p();var jZe=class extends sr{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 `",_A,"` to represent regions of unchanged code.")}};p();var HZe=class extends sr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Tn.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(jn,{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 gO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=pA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${ATn} ${Wn(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(jn,{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 I1n={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},Rle=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await ZHe(e.ctx)&&r.set(I1n.name,I1n);let o=await e.ctx.get(Hp).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&_t(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 lWo=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 x1n(t){return lWo.get(t)??"unknown"}a(x1n,"getToolFunctionalType");var uWo=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"]]),dWo=new Map;for(let[t,e]of uWo)dWo.set(e,t);var w1n=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),R1n=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var LJe=class extends ar{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 Rle().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(jn,{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 Ple=class extends ar{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 fWo=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],nO=class extends ar{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&fWo.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var P1n=he(Io());var FJe=class extends ar{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(P1n.SystemMessage,null,vscpp(jn,{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(Ple,null)),vscpp(jn,{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(jn,{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(jn,{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(jn,{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(jn,{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(nO,{languageOverride:this.props.languageOverride}))}};p();var k1n=he(Io());var UJe=class extends ar{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(k1n.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(nO,{languageOverride:this.props.languageOverride}))}};p();p();var D1n="filepath:",CA="...existing code...";p();var QJe=class extends ar{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 JQ=class extends ar{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!rWe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Tn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Tn.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 N1n(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(N1n,"modelSupportsReplaceString");function M1n(t){return t?t.startsWith("gpt-5"):!1}a(M1n,"isGpt5PlusFamily");function pWo(t){return t?t==="gpt-5.2-codex":!1}a(pWo,"isGpt52CodexFamily");function hWo(t){return t?t==="gpt-5.2":!1}a(hWo,"isGpt52Family");function O1n(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||pWo(e)||hWo(e))}a(O1n,"modelSupportsApplyPatch");var B1n=he(Io());var qJe=class extends ar{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=M1n(this.props.modelConfiguration.modelFamily);return vscpp(B1n.SystemMessage,null,vscpp(jn,{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(JQ,{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(jn,{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(jn,{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(jn,{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(QJe,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),"// ",CA,vscpp("br",null),"changed code",vscpp("br",null),"// ",CA,vscpp("br",null),"changed code",vscpp("br",null),"// ",CA,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 {",` // ${CA}`," age: number;",` // ${CA}`," getAge() {"," return this.age;"," }","}"].join(` +`))),vscpp(jn,{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(jn,{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(nO,{languageOverride:this.props.languageOverride}))}};p();var jJe=class extends ar{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.")}},HJe=class extends ar{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var kle=class extends ar{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))}},GJe=class extends ar{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))}},$Je=class extends ar{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 L1n=he(Io());var VJe=class extends ar{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(L1n.SystemMessage,{priority:1e3},vscpp(jn,{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(JQ,{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(jn,{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 `",CA,"` 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(nO,{languageOverride:this.props.languageOverride}))}},WJe=class extends ar{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 zJe=he(Io());var YJe=class extends ar{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=Gt(this.props.turnContext.ctx,Je.UseAgentsMd);return rWe(n.modelFamily)?vscpp(UJe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(FJe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(VJe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(qJe,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Lr).getEditorInfo().name,n=e.get(Mn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(zJe.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(Tn.Gpt5)?vscpp(vscppf,null,vscpp(HJe,null),vscpp(GJe,null)):vscpp(vscppf,null,vscpp(jJe,null),vscpp(kle,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(zJe.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(zJe.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 F1n=he(Io());var KJe=class extends ar{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=NM(this.props.currentTurn.response?.message,!0),r=GM(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,F1n.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(Rx,{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 JJe=class extends ar{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 ZJe=class extends ar{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(jn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&mWo(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 ",Wn(e.uri),". ",n)}};function mWo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(mWo,"notEmptySelection");p();var XJe=class extends ar{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 `",CA,"` to represent regions of unchanged code.")}};p();var eZe=class extends ar{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Tn.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(jn,{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 iO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=gA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${D1n} ${Wn(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 DP=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 gO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=ho(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 vJo=new ge("activeEditorPrompt");async function STn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Mc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&bJo(n.selection)){let s=new DP(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 DP(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new DP(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 DP(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else vJo.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(STn,"processActiveEditor");function bJo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(bJo,"notEmptySelection");p();var SJo=["png","jpg","jpeg","bmp","gif","webp"];function TJo(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!SJo.some(n=>r.endsWith(`.${n}`))})}a(TJo,"filterOutImageFiles");function GZe(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:TJo(e)}}a(GZe,"getFileAndDirectoryReferences");var IJo=new ge("fileReferencesPrompt");async function TTn(t,e){let{validFileReferences:r,directoryReferences:n}=GZe(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([xJo({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),STn(t,e),bZe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(TTn,"processFileReferences");async function xJo(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 Mc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new DP(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 DP(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new DP(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else IJo.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(xJo,"processValidFileReferences");var ITn=ce(wo());var wJo=new ge("fileReferences"),$Ze=class extends sr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new qn.CancellationTokenSource().token,c=[];try{c=await TTn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){wJo.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(NHt,{fileReferencesParts:c})}},NHt=class extends sr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(ITn.TextChunk,null,[this.props.fileReferencesParts.join(` -`)])}};p();var xTn=ce(wo());var VZe=class extends sr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=GZe(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(Jn);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(xTn.TextChunk,null,[n.join(` -`)])}};p();var wTn=new ge("SkillContextPrompt"),RJo=5e4,WZe=class extends sr{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 yYe(s);if(!c)return;wTn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(RJo).getText();return!d||d.trim().length===0?void 0:vscpp(jn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");wTn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var hu=class extends fQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:Ym,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Mc;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(Md).invokeClientToolConfirmation(e,o)}};p();var X0=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 kJo(){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(kJo,"createManageTodoListInputSchema");var AO=class t extends hu{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:kJo()}),this.ctx=e}get service(){return this.ctx.get(X0)}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 Or([new wr("Error: Unknown operation")],"error")):Promise.resolve(new Or([new wr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Or([new wr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Or([new wr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Or([new wr(`# Todo List +`){return this.renderAsArray().join(e)}};var Tk=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 iO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=Yo(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 gWo=new Ee("activeEditorPrompt");async function U1n(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Dc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&AWo(n.selection)){let s=new Tk(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 Tk(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new Tk(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 Tk(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else gWo.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(U1n,"processActiveEditor");function AWo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(AWo,"notEmptySelection");p();var yWo=["png","jpg","jpeg","bmp","gif","webp"];function EWo(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!yWo.some(n=>r.endsWith(`.${n}`))})}a(EWo,"filterOutImageFiles");function tZe(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:EWo(e)}}a(tZe,"getFileAndDirectoryReferences");var _Wo=new Ee("fileReferencesPrompt");async function Q1n(t,e){let{validFileReferences:r,directoryReferences:n}=tZe(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([vWo({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),U1n(t,e),MJe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(Q1n,"processFileReferences");async function vWo(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 Dc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new Tk(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 Tk(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new Tk(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else _Wo.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(vWo,"processValidFileReferences");var q1n=he(Io());var CWo=new Ee("fileReferences"),rZe=class extends ar{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new qn.CancellationTokenSource().token,c=[];try{c=await Q1n({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){CWo.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(xjt,{fileReferencesParts:c})}},xjt=class extends ar{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(q1n.TextChunk,null,[this.props.fileReferencesParts.join(` +`)])}};p();var j1n=he(Io());var nZe=class extends ar{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=tZe(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(j1n.TextChunk,null,[n.join(` +`)])}};p();var H1n=new Ee("SkillContextPrompt"),bWo=5e4,iZe=class extends ar{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 Uze(s);if(!c)return;H1n.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(bWo).getText();return!d||d.trim().length===0?void 0:vscpp(jn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");H1n.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var pu=class extends J7{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:Ym,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Dc;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(Dd).invokeClientToolConfirmation(e,o)}};p();var X0=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 SWo(){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(SWo,"createManageTodoListInputSchema");var oO=class t extends pu{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:SWo()}),this.ctx=e}get service(){return this.ctx.get(X0)}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 Or([new wr("Error: Unknown operation")],"error")):Promise.resolve(new Or([new wr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Or([new wr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Or([new wr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Or([new wr(`# Todo List ${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Or([new wr("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 hQ([new wr(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 X7([new wr(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(X0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return mmn(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(X0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return Hhn(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. @@ -3173,73 +3129,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 zZe=class extends sr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(Mn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??AO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=AO.formatTodoListAsMarkdown(r);return vscpp(jn,{name:"todoList"},[n])}};p();p();var PJo=new ge("fileReferencesPrompt");function RTn(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 PJo.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(RTn,"processMcpToolsReferences");var DJo=new ge("ToolContext"),YZe=class extends sr{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 Mc;let n=RTn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(jn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` -`)))}catch(r){DJo.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var tue=ce(wo());var KZe=class extends sr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=In(this.props.userRawMessage),c=Jce(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(tue.UserMessage,null,vscpp(tue.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp($Ze,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(tue.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(VZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(YZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(WZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(jn,{name:"context"},vscpp(QZe,null),vscpp(zZe,{turnContext:this.props.turnContext})),vscpp(qZe,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(jn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(Xle,null):vscpp(mq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(jZe,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(BZe,null),vscpp(HZe,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(jn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var DK=ce(wo());var MHt=new ge("agentPrompt"),JZe=class extends sr{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(Mn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(FZe,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(DK.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(DK.UserMessage,null,vscpp(IZe,{turnContext:this.turnContext})),vscpp(DK.UserMessage,null,vscpp(TZe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(hle,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(KZe,{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(UZe,{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?NJo(e):[vscpp(Axe,{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(gxe);if(s?.renderedGlobalContext)return MHt.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}MHt.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await u7t(Axe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new gxe(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(pf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:qt(this.ctx,je.UseAgentsMd),includeNestedAgentsMdInstructions:qt(this.ctx,je.UseNestedAgentsMd),includeClaudeMdInstructions:qt(this.ctx,je.UseClaudeMd),includeNestedClaudeMdInstructions:qt(this.ctx,je.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(rTn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(jn,{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(DK.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){MHt.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function NJo(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(DK.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(NJo,"renderedMessageToTsxChildren");p();var ZZe="uncategorized_tools",kTn="Tools that could not be automatically categorized into existing groups.";p();var gq=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var D3=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 rue=new ge("roundMetricsTracker"),XZe=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=MJo(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:OHt(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:OHt(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:OHt(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;rue.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){rue.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 rue.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;rue.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(rue.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}}),qt(this.ctx,je.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else rue.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 oZe=class extends ar{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(Mn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??oO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=oO.formatTodoListAsMarkdown(r);return vscpp(jn,{name:"todoList"},[n])}};p();p();var TWo=new Ee("fileReferencesPrompt");function G1n(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 TWo.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(G1n,"processMcpToolsReferences");var IWo=new Ee("ToolContext"),sZe=class extends ar{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 Dc;let n=G1n(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(jn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` +`)))}catch(r){IWo.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var Dle=he(Io());var aZe=class extends ar{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Rn(this.props.userRawMessage),c=Rce(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(Dle.UserMessage,null,vscpp(Dle.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(rZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(Dle.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(nZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(sZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(iZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(jn,{name:"context"},vscpp(JJe,null),vscpp(oZe,{turnContext:this.props.turnContext})),vscpp(ZJe,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(jn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(Ple,null):vscpp(JQ,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(XJe,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(WJe,null),vscpp(eZe,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(jn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var pK=he(Io());var wjt=new Ee("agentPrompt"),cZe=class extends ar{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(Mn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(YJe,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(pK.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(pK.UserMessage,null,vscpp(LJe,{turnContext:this.turnContext})),vscpp(pK.UserMessage,null,vscpp(BJe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(Vce,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(aZe,{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(KJe,{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?xWo(e):[vscpp(qIe,{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(QIe);if(s?.renderedGlobalContext)return wjt.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}wjt.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await gUt(qIe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new QIe(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(df).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Gt(this.ctx,Je.UseAgentsMd),includeNestedAgentsMdInstructions:Gt(this.ctx,Je.UseNestedAgentsMd),includeClaudeMdInstructions:Gt(this.ctx,Je.UseClaudeMd),includeNestedClaudeMdInstructions:Gt(this.ctx,Je.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(A1n());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(jn,{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(pK.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){wjt.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function xWo(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(pK.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(xWo,"renderedMessageToTsxChildren");p();var lZe="uncategorized_tools",$1n="Tools that could not be automatically categorized into existing groups.";p();var ZQ=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var y3=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 Nle=new Ee("roundMetricsTracker"),uZe=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=wWo(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:Rjt(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:Rjt(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:Rjt(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;Nle.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){Nle.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 Nle.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;Nle.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(Nle.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}}),Gt(this.ctx,Je.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else Nle.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 OHt(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(MJo,"stripDriftingFields");p();p();var eXe=new ge("agentModePolicy");function PTn(t){try{let e=FI(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(eXe.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(uu).getPolicyValue("agentMode.autoApproval.enabled")===!1?(eXe.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(eXe.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return eXe.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(PTn,"isAutoApprovalEnabled");p();var tXe=new ge("McpAutoApproveService"),N3=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){tXe.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return tXe.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||tXe.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})),tXe.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 NK=ce(require("path"));var zx=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 ge("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&&aa.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ia(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=Wn(e);return r.some(o=>{try{let s=Wn(o),c=NK.normalize(s),l=NK.normalize(n),u=NK.relative(c,l);return!u.startsWith("..")&&!NK.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return df(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 MTn=`*** Begin Patch -`,nue=` -*** End Patch`,iue="*** Add File: ",Aq="*** Delete File: ",oue="*** Update File: ",OJo="*** Move to: ",BHt="*** End of File";var BJo=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var Wh=class extends Error{static{a(this,"DiffError")}},sue=class extends Wh{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},yO=class extends Wh{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function DTn(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(DTn,"guessIndentation");function NTn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(NTn,"computeIndentLevel");function LJo(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(LJo,"getIndentationChar");function FJo(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(FJo,"transformIndentation");function UJo(t){return!t||!t.trim()}a(UJo,"isFalsyOrWhitespace");function QJo(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(QJo,"countOccurrences");function qJo(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(qJo,"computeLevenshteinDistance");function yxe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(yxe,"replaceExplicitTabs");function rXe(t){return yxe(t.replaceAll("\\n",` -`))}a(rXe,"replaceExplicitNl");var LHt=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]=DTn(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 Wh(`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([nue]);){let e=this.readStr(oue);if(e){if(this.patch.actions[e])throw new Wh(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(OJo);if(!(e in this.currentFiles))throw new Wh(`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(Aq),e){if(this.patch.actions[e])throw new Wh(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new Wh(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(iue),e){if(this.patch.actions[e])throw new Wh(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new Wh(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new Wh(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(nue.trim()))throw new yO("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=!BJo.test(e.trimEnd()),l=0;for(;!this.isDone([nue,oue,Aq,iue,BHt]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new Wh(`Invalid line. Consider splitting each change into individual apply_patch tool calls: +`}}return s+="```\n",s}};function Rjt(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(wWo,"stripDriftingFields");p();p();var dZe=new Ee("agentModePolicy");function V1n(t){try{let e=DI(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(dZe.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(cu).getPolicyValue("agentMode.autoApproval.enabled")===!1?(dZe.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(dZe.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return dZe.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(V1n,"isAutoApprovalEnabled");p();var fZe=new Ee("McpAutoApproveService"),E3=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){fZe.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return fZe.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||fZe.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})),fZe.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 hK=he(require("path"));var qx=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 Ee("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&&na.isRegisteredScheme(s[1].toLowerCase()))return;let c=ba(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=Wn(e);return r.some(o=>{try{let s=Wn(o),c=hK.normalize(s),l=hK.normalize(n),u=hK.relative(c,l);return!u.startsWith("..")&&!hK.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return lf(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 Y1n=`*** Begin Patch +`,Mle=` +*** End Patch`,Ole="*** Add File: ",XQ="*** Delete File: ",Ble="*** Update File: ",RWo="*** Move to: ",Pjt="*** End of File";var PWo=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var Wh=class extends Error{static{a(this,"DiffError")}},Lle=class extends Wh{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},sO=class extends Wh{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function W1n(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(W1n,"guessIndentation");function z1n(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(z1n,"computeIndentLevel");function kWo(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(kWo,"getIndentationChar");function DWo(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(DWo,"transformIndentation");function NWo(t){return!t||!t.trim()}a(NWo,"isFalsyOrWhitespace");function MWo(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(MWo,"countOccurrences");function OWo(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(OWo,"computeLevenshteinDistance");function jIe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(jIe,"replaceExplicitTabs");function pZe(t){return jIe(t.replaceAll("\\n",` +`))}a(pZe,"replaceExplicitNl");var kjt=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]=W1n(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 Wh(`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([Mle]);){let e=this.readStr(Ble);if(e){if(this.patch.actions[e])throw new Wh(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(RWo);if(!(e in this.currentFiles))throw new Wh(`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(XQ),e){if(this.patch.actions[e])throw new Wh(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new Wh(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(Ole),e){if(this.patch.actions[e])throw new Wh(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new Wh(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new Wh(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(Mle.trim()))throw new sO("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=!PWo.test(e.trimEnd()),l=0;for(;!this.isDone([Mle,Ble,XQ,Ole,Pjt]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new Wh(`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 sue(`Invalid EOF context at character ${l}: -${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new sue(`Invalid context at character ${l}: -${_}`,r,v)}}this.fuzz+=h.fuzz;let m=DTn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=NTn(s[h.line]??"",n.tabSize),A=h.fuzz&4?yxe(f.nextChunkContext[0]??""):h.fuzz&128?rXe(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?NTn(A,m.tabSize):0,E=LJo(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(rXe),_.delLines=_.delLines.map(rXe)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(yxe)),_.insLines=_.insLines.map(v=>UJo(v)?v:E+FJo(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(yxe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([nue,oue,Aq,iue]);){let r=this.readStr();if(!r.startsWith("+"))throw new yO(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` +`);if(f.eof)throw new Lle(`Invalid EOF context at character ${l}: +${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new Lle(`Invalid context at character ${l}: +${_}`,r,v)}}this.fuzz+=h.fuzz;let m=W1n(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=z1n(s[h.line]??"",n.tabSize),A=h.fuzz&4?jIe(f.nextChunkContext[0]??""):h.fuzz&128?pZe(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?z1n(A,m.tabSize):0,E=kWo(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(pZe),_.delLines=_.delLines.map(pZe)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(jIe)),_.insLines=_.insLines.map(v=>NWo(v)?v:E+DWo(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(jIe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([Mle,Ble,XQ,Ole]);){let r=this.readStr();if(!r.startsWith("+"))throw new sO(`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 yO(`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}),s(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 sO(`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 Wh(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new Wh(`${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(HJo,"getUpdatedFile");function GJo(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=HJo(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(GJo,"patchToCommit");async function $Jo(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new Wh(`File not found: ${n}`)}return r}a($Jo,"loadFiles");async function BTn(t,e){if(!t.startsWith(MTn))throw new yO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=MK(t),n=await $Jo(r,e),[o]=jJo(t,n);return GJo(o,n)}a(BTn,"processPatch");var EO=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=MK(s),l=aue(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(zx),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(zx),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. +`)}a(LWo,"getUpdatedFile");function FWo(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=LWo(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(FWo,"patchToCommit");async function UWo(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new Wh(`File not found: ${n}`)}return r}a(UWo,"loadFiles");async function J1n(t,e){if(!t.startsWith(Y1n))throw new sO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=mK(t),n=await UWo(r,e),[o]=BWo(t,n);return FWo(o,n)}a(J1n,"processPatch");var aO=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=mK(s),l=Fle(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(qx),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(qx),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 cue=new ge("AutoApproveService"),OK=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(NN()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(qt(e.ctx,je.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return cue.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!PTn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return cue.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return cue.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(qt(e.ctx,je.AutoApproveYoloMode)===!0)return cue.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=qt(e.ctx,je.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=qt(e.ctx,je.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=qt(e.ctx,je.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return cue.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":EO.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(N3).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(qt(this.ctx,je.TrustToolAnnotations)){let o=this.ctx.get(us).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(qS),c=kK(e.description)||"sh";cue.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=EO.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function Exe(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(WJo,"isUndefined");function FHt(t){return Buffer.from(t,"base64").toString("utf-8")}a(FHt,"decodeBase64");function UTn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(UTn,"isObject");p();var yq="activate_",F_=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(yq))throw new Error(`Virtual tool name must start with '${yq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(yq+e+this.name.slice(yq.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))}},UHt=class extends sr{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))}},nXe=class extends sr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Eq.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(Eq.UserMessage,null,this.props.tools.map(e=>vscpp(_xe,{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)))}},iXe=class extends sr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Eq.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(Eq.UserMessage,null,this.props.tools.map(e=>vscpp(_xe,{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)))}},oXe=class extends sr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Eq.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(Eq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(UHt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(_xe,{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 zHt={};wi(zHt,{arrayReplaceAt:()=>WHt,asciiTrim:()=>QK,assign:()=>fue,escapeHtml:()=>O3,escapeRE:()=>RZo,fromCodePoint:()=>pue,has:()=>yZo,isMdAsciiPunct:()=>FK,isPunctChar:()=>sIn,isPunctCharCode:()=>LK,isSpace:()=>zs,isString:()=>AXe,isValidEntityCode:()=>yXe,isWhiteSpace:()=>BK,lib:()=>kZo,normalizeReference:()=>UK,unescapeAll:()=>M3,unescapeMd:()=>bZo});p();var uXe={};wi(uXe,{decode:()=>Cxe,encode:()=>cXe,format:()=>lue,parse:()=>vxe});p();p();var QTn={};function zJo(t){let e=QTn[t];if(e)return e;e=QTn[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(sXe,"decode");sXe.defaultChars=";/?:@&=+$,#";sXe.componentChars="";var Cxe=sXe;p();var qTn={};function YJo(t){let e=qTn[t];if(e)return e;e=qTn[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=YJo(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(aXe,"encode");aXe.defaultChars=";/?:@&=+$,-_.!~*'()#";aXe.componentChars="-_.!~*'()";var cXe=aXe;p();function lue(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(lue,"format");p();function lXe(){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(lXe,"Url");var KJo=/^([a-z0-9.+-]+:)/i,JJo=/:[0-9]*$/,ZJo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,XJo=["<",">",'"',"`"," ","\r",` -`," "],eZo=["{","}","|","\\","^","`"].concat(XJo),tZo=["'"].concat(eZo),jTn=["%","/","?",";","#"].concat(tZo),HTn=["/","?","#"],rZo=255,GTn=/^[+a-z0-9A-Z_-]{0,63}$/,nZo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,$Tn={javascript:!0,"javascript:":!0},VTn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function iZo(t,e){if(t&&t instanceof lXe)return t;let r=new lXe;return r.parse(t,e),r}a(iZo,"urlParse");lXe.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=ZJo.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=KJo.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&&$Tn[c])&&(s=s.substr(2),this.slashes=!0)),!$Tn[c]&&(o||c&&!VTn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(GTn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(nZo);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>rZo&&(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),VTn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};lXe.prototype.parseHost=function(t){let e=JJo.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 vxe=iZo;var QHt={};wi(QHt,{Any:()=>dXe,Cc:()=>fXe,Cf:()=>WTn,P:()=>uue,S:()=>pXe,Z:()=>hXe});p();p();var dXe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var fXe=/[\0-\x1F\x7F-\x9F]/;p();var WTn=/[\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 uue=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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 pXe=/[\$\+<->\^`\|~\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 hXe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var zTn=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 YTn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var qHt,oZo=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]]),jHt=(qHt=String.fromCodePoint)!==null&&qHt!==void 0?qHt: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 HHt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=oZo.get(t))!==null&&e!==void 0?e:t}a(HHt,"replaceCodePoint");var ug;(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"})(ug||(ug={}));var sZo=32,_q;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(_q||(_q={}));function GHt(t){return t>=ug.ZERO&&t<=ug.NINE}a(GHt,"isNumber");function aZo(t){return t>=ug.UPPER_A&&t<=ug.UPPER_F||t>=ug.LOWER_A&&t<=ug.LOWER_F}a(aZo,"isHexadecimalCharacter");function cZo(t){return t>=ug.UPPER_A&&t<=ug.UPPER_Z||t>=ug.LOWER_A&&t<=ug.LOWER_Z||GHt(t)}a(cZo,"isAsciiAlphaNumeric");function lZo(t){return t===ug.EQUALS||cZo(t)}a(lZo,"isEntityInAttributeInvalidEnd");var lg;(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"})(lg||(lg={}));var NP;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(NP||(NP={}));var mXe=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=lg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=NP.Strict}startEntity(e){this.decodeMode=e,this.state=lg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case lg.EntityStart:return e.charCodeAt(r)===ug.NUM?(this.state=lg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=lg.NamedEntity,this.stateNamedEntity(e,r));case lg.NumericStart:return this.stateNumericStart(e,r);case lg.NumericDecimal:return this.stateNumericDecimal(e,r);case lg.NumericHex:return this.stateNumericHex(e,r);case lg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|sZo)===ug.LOWER_X?(this.state=lg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=lg.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===ug.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==NP.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]&_q.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]&~_q.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case lg.NamedEntity:return this.result!==0&&(this.decodeMode!==NP.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case lg.NumericDecimal:return this.emitNumericEntity(0,2);case lg.NumericHex:return this.emitNumericEntity(0,3);case lg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case lg.EntityStart:return 0}}};function KTn(t){let e="",r=new mXe(t,n=>e+=jHt(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(KTn,"getDecoder");function uZo(t,e,r,n){let o=(e&_q.BRANCH_LENGTH)>>7,s=e&_q.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(uZo,"determineBranch");var JTn=KTn(zTn),Fwd=KTn(YTn);function due(t,e=NP.Legacy){return JTn(t,e)}a(due,"decodeHTML");function bxe(t){return JTn(t,NP.Strict)}a(bxe,"decodeHTMLStrict");p();p();function gXe(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 $Ht(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($Ht,"getEscaper");var ZTn=$Ht(/[&<>'"]/g,fZo),XTn=$Ht(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),eIn=$Ht(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var tIn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(tIn||(tIn={}));var rIn;(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"})(rIn||(rIn={}));function gZo(t){return Object.prototype.toString.call(t)}a(gZo,"_class");function AXe(t){return gZo(t)==="[object String]"}a(AXe,"isString");var AZo=Object.prototype.hasOwnProperty;function yZo(t,e){return AZo.call(t,e)}a(yZo,"has");function fue(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(fue,"assign");function WHt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(WHt,"arrayReplaceAt");function yXe(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(yXe,"isValidEntityCode");function pue(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(pue,"fromCodePoint");var oIn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,EZo=/&([a-z#][a-z0-9]{1,31});/gi,_Zo=new RegExp(oIn.source+"|"+EZo.source,"gi"),CZo=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function vZo(t,e){if(e.charCodeAt(0)===35&&CZo.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return yXe(n)?pue(n):t}let r=due(t);return r!==t?r:t}a(vZo,"replaceEntityPattern");function bZo(t){return t.indexOf("\\")<0?t:t.replace(oIn,"$1")}a(bZo,"unescapeMd");function M3(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(_Zo,function(e,r,n){return r||vZo(e,n)})}a(M3,"unescapeAll");var SZo=/[&<>"]/,TZo=/[&<>"]/g,IZo={"&":"&","<":"<",">":">",'"':"""};function xZo(t){return IZo[t]}a(xZo,"replaceUnsafeChar");function O3(t){return SZo.test(t)?t.replace(TZo,xZo):t}a(O3,"escapeHtml");var wZo=/[.?*+^$[\]\\(){}|-]/g;function RZo(t){return t.replace(wZo,"\\$&")}a(RZo,"escapeRE");function zs(t){switch(t){case 9:case 32:return!0}return!1}a(zs,"isSpace");function BK(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(BK,"isWhiteSpace");function sIn(t){return uue.test(t)||pXe.test(t)}a(sIn,"isPunctChar");function LK(t){return sIn(pue(t))}a(LK,"isPunctCharCode");function FK(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(FK,"isMdAsciiPunct");function UK(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(UK,"normalizeReference");function iIn(t){return t===32||t===9||t===10||t===13}a(iIn,"isAsciiTrimmable");function QK(t){let e=0;for(;e=e&&iIn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(QK,"asciiTrim");var kZo={mdurl:uXe,ucmicro:QHt};var ZHt={};wi(ZHt,{parseLinkDestination:()=>KHt,parseLinkLabel:()=>YHt,parseLinkTitle:()=>JHt});p();p();function YHt(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=M3(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(KHt,"parseLinkDestination");p();function JHt(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"+O3(s.content)+""};_O.code_block=function(t,e,r,n,o){let s=t[e];return""+O3(t[e].content)+` -`};_O.fence=function(t,e,r,n,o){let s=t[e],c=s.info?M3(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)||O3(s.content):d=O3(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(qWo,"isUndefined");function Djt(t){return Buffer.from(t,"base64").toString("utf-8")}a(Djt,"decodeBase64");function eSn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(eSn,"isObject");p();var eq="activate_",O_=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(eq))throw new Error(`Virtual tool name must start with '${eq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(eq+e+this.name.slice(eq.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))}},Njt=class extends ar{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))}},hZe=class extends ar{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(tq.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(tq.UserMessage,null,this.props.tools.map(e=>vscpp(GIe,{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)))}},mZe=class extends ar{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(tq.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(tq.UserMessage,null,this.props.tools.map(e=>vscpp(GIe,{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)))}},gZe=class extends ar{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(tq.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(tq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(Njt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(GIe,{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 jjt={};xi(jjt,{arrayReplaceAt:()=>qjt,asciiTrim:()=>vK,assign:()=>Hle,escapeHtml:()=>v3,escapeRE:()=>bzo,fromCodePoint:()=>Gle,has:()=>fzo,isMdAsciiPunct:()=>EK,isPunctChar:()=>vSn,isPunctCharCode:()=>yK,isSpace:()=>Gs,isString:()=>wZe,isValidEntityCode:()=>RZe,isWhiteSpace:()=>AK,lib:()=>Szo,normalizeReference:()=>_K,unescapeAll:()=>_3,unescapeMd:()=>Azo});p();var vZe={};xi(vZe,{decode:()=>$Ie,encode:()=>EZe,format:()=>Qle,parse:()=>VIe});p();p();var tSn={};function jWo(t){let e=tSn[t];if(e)return e;e=tSn[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(AZe,"decode");AZe.defaultChars=";/?:@&=+$,#";AZe.componentChars="";var $Ie=AZe;p();var rSn={};function HWo(t){let e=rSn[t];if(e)return e;e=rSn[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=HWo(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(yZe,"encode");yZe.defaultChars=";/?:@&=+$,-_.!~*'()#";yZe.componentChars="-_.!~*'()";var EZe=yZe;p();function Qle(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(Qle,"format");p();function _Ze(){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(_Ze,"Url");var GWo=/^([a-z0-9.+-]+:)/i,$Wo=/:[0-9]*$/,VWo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,WWo=["<",">",'"',"`"," ","\r",` +`," "],zWo=["{","}","|","\\","^","`"].concat(WWo),YWo=["'"].concat(zWo),nSn=["%","/","?",";","#"].concat(YWo),iSn=["/","?","#"],KWo=255,oSn=/^[+a-z0-9A-Z_-]{0,63}$/,JWo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,sSn={javascript:!0,"javascript:":!0},aSn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ZWo(t,e){if(t&&t instanceof _Ze)return t;let r=new _Ze;return r.parse(t,e),r}a(ZWo,"urlParse");_Ze.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=VWo.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=GWo.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&&sSn[c])&&(s=s.substr(2),this.slashes=!0)),!sSn[c]&&(o||c&&!aSn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(oSn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(JWo);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>KWo&&(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),aSn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};_Ze.prototype.parseHost=function(t){let e=$Wo.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 VIe=ZWo;var Mjt={};xi(Mjt,{Any:()=>CZe,Cc:()=>bZe,Cf:()=>cSn,P:()=>qle,S:()=>SZe,Z:()=>TZe});p();p();var CZe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var bZe=/[\0-\x1F\x7F-\x9F]/;p();var cSn=/[\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 qle=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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 SZe=/[\$\+<->\^`\|~\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 TZe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var lSn=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 uSn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var Ojt,XWo=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]]),Bjt=(Ojt=String.fromCodePoint)!==null&&Ojt!==void 0?Ojt: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 Ljt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=XWo.get(t))!==null&&e!==void 0?e:t}a(Ljt,"replaceCodePoint");var ug;(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"})(ug||(ug={}));var ezo=32,rq;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(rq||(rq={}));function Fjt(t){return t>=ug.ZERO&&t<=ug.NINE}a(Fjt,"isNumber");function tzo(t){return t>=ug.UPPER_A&&t<=ug.UPPER_F||t>=ug.LOWER_A&&t<=ug.LOWER_F}a(tzo,"isHexadecimalCharacter");function rzo(t){return t>=ug.UPPER_A&&t<=ug.UPPER_Z||t>=ug.LOWER_A&&t<=ug.LOWER_Z||Fjt(t)}a(rzo,"isAsciiAlphaNumeric");function nzo(t){return t===ug.EQUALS||rzo(t)}a(nzo,"isEntityInAttributeInvalidEnd");var lg;(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"})(lg||(lg={}));var Ik;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Ik||(Ik={}));var IZe=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=lg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ik.Strict}startEntity(e){this.decodeMode=e,this.state=lg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case lg.EntityStart:return e.charCodeAt(r)===ug.NUM?(this.state=lg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=lg.NamedEntity,this.stateNamedEntity(e,r));case lg.NumericStart:return this.stateNumericStart(e,r);case lg.NumericDecimal:return this.stateNumericDecimal(e,r);case lg.NumericHex:return this.stateNumericHex(e,r);case lg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|ezo)===ug.LOWER_X?(this.state=lg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=lg.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===ug.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ik.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]&rq.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]&~rq.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case lg.NamedEntity:return this.result!==0&&(this.decodeMode!==Ik.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case lg.NumericDecimal:return this.emitNumericEntity(0,2);case lg.NumericHex:return this.emitNumericEntity(0,3);case lg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case lg.EntityStart:return 0}}};function dSn(t){let e="",r=new IZe(t,n=>e+=Bjt(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(dSn,"getDecoder");function izo(t,e,r,n){let o=(e&rq.BRANCH_LENGTH)>>7,s=e&rq.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(izo,"determineBranch");var fSn=dSn(lSn),kbd=dSn(uSn);function jle(t,e=Ik.Legacy){return fSn(t,e)}a(jle,"decodeHTML");function WIe(t){return fSn(t,Ik.Strict)}a(WIe,"decodeHTMLStrict");p();p();function xZe(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 Ujt(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(Ujt,"getEscaper");var pSn=Ujt(/[&<>'"]/g,szo),hSn=Ujt(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),mSn=Ujt(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var gSn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(gSn||(gSn={}));var ASn;(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"})(ASn||(ASn={}));function uzo(t){return Object.prototype.toString.call(t)}a(uzo,"_class");function wZe(t){return uzo(t)==="[object String]"}a(wZe,"isString");var dzo=Object.prototype.hasOwnProperty;function fzo(t,e){return dzo.call(t,e)}a(fzo,"has");function Hle(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(Hle,"assign");function qjt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(qjt,"arrayReplaceAt");function RZe(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(RZe,"isValidEntityCode");function Gle(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(Gle,"fromCodePoint");var _Sn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,pzo=/&([a-z#][a-z0-9]{1,31});/gi,hzo=new RegExp(_Sn.source+"|"+pzo.source,"gi"),mzo=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function gzo(t,e){if(e.charCodeAt(0)===35&&mzo.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return RZe(n)?Gle(n):t}let r=jle(t);return r!==t?r:t}a(gzo,"replaceEntityPattern");function Azo(t){return t.indexOf("\\")<0?t:t.replace(_Sn,"$1")}a(Azo,"unescapeMd");function _3(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(hzo,function(e,r,n){return r||gzo(e,n)})}a(_3,"unescapeAll");var yzo=/[&<>"]/,Ezo=/[&<>"]/g,_zo={"&":"&","<":"<",">":">",'"':"""};function vzo(t){return _zo[t]}a(vzo,"replaceUnsafeChar");function v3(t){return yzo.test(t)?t.replace(Ezo,vzo):t}a(v3,"escapeHtml");var Czo=/[.?*+^$[\]\\(){}|-]/g;function bzo(t){return t.replace(Czo,"\\$&")}a(bzo,"escapeRE");function Gs(t){switch(t){case 9:case 32:return!0}return!1}a(Gs,"isSpace");function AK(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(AK,"isWhiteSpace");function vSn(t){return qle.test(t)||SZe.test(t)}a(vSn,"isPunctChar");function yK(t){return vSn(Gle(t))}a(yK,"isPunctCharCode");function EK(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(EK,"isMdAsciiPunct");function _K(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(_K,"normalizeReference");function ESn(t){return t===32||t===9||t===10||t===13}a(ESn,"isAsciiTrimmable");function vK(t){let e=0;for(;e=e&&ESn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(vK,"asciiTrim");var Szo={mdurl:vZe,ucmicro:Mjt};var Vjt={};xi(Vjt,{parseLinkDestination:()=>Gjt,parseLinkLabel:()=>Hjt,parseLinkTitle:()=>$jt});p();p();function Hjt(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=_3(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(Gjt,"parseLinkDestination");p();function $jt(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"+v3(s.content)+""};cO.code_block=function(t,e,r,n,o){let s=t[e];return""+v3(t[e].content)+` +`};cO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?_3(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)||v3(s.content):d=v3(s.content),d.indexOf("${d} `}return`
${d}
-`};_O.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)};_O.hardbreak=function(t,e,r){return r.xhtmlOut?`
+`};cO.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)};cO.hardbreak=function(t,e,r){return r.xhtmlOut?`
`:`
-`};_O.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
+`};cO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` -`};_O.text=function(t,e){return O3(t[e].content)};_O.html_block=function(t,e){return t[e].content};_O.html_inline=function(t,e){return t[e].content};function hue(){this.rules=fue({},_O)}a(hue,"Renderer");hue.prototype.renderAttrs=a(function(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r -`:">",s},"renderToken");hue.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");mue.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 B3=mue;function cIn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(cIn,"StateCore");cIn.prototype.Token=B3;var lIn=cIn;p();var PZo=/\r\n?|\n/g,DZo=/\0/g;function XHt(t){let e;e=t.src.replace(PZo,` -`),e=e.replace(DZo,"\uFFFD"),t.src=e}a(XHt,"normalize");p();function eGt(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(eGt,"block");p();function tGt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(NZo,"isLinkOpen");function MZo(t){return/^<\/a\s*>/i.test(t)}a(MZo,"isLinkClose");function rGt(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"&&(NZo(l.content)&&s>0&&s--,MZo(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(BZo,FZo)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(UZo,"replace_scoped");function QZo(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&uIn.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(QZo,"replace_rare");function nGt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(OZo.test(t.tokens[e].content)&&UZo(t.tokens[e].children),uIn.test(t.tokens[e].content)&&QZo(t.tokens[e].children))}a(nGt,"replace");p();var qZo=/['"]/,dIn=/['"]/g,fIn="\u2019";function EXe(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(EXe,"addReplacement");function jZo(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&&EXe(o,s,h.index,fIn);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"||!qZo.test(t.tokens[e].content)||HZo(t.tokens[e].children,t)}a(iGt,"smartquotes");p();function oGt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};CO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");CO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");CO.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");CO.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");CO.prototype.Token=B3;var hIn=CO;p();var GZo=65536;function cGt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(cGt,"getLine");function mIn(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=mIn(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=mIn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>GZo))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(uGt,"code");p();function dGt(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 k=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]=k-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=AIn(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=gIn(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 k=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=k,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,q=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"),k=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(mGt,"reference");p();p();var yIn=["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 VZo="[a-zA-Z_:][a-zA-Z0-9:._-]*",WZo="[^\"'=<>`\\x00-\\x20]+",zZo="'[^']*'",YZo='"[^"]*"',KZo="(?:"+WZo+"|"+zZo+"|"+YZo+")",JZo="(?:\\s+"+VZo+"(?:\\s*=\\s*"+KZo+")?)",EIn="<[A-Za-z][A-Za-z0-9\\-]*"+JZo+"*\\s*\\/?>",_In="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ZZo="",XZo="<[?][\\s\\S]*?[?]>",eXo="]*>",tXo="",CIn=new RegExp("^(?:"+EIn+"|"+_In+"|"+ZZo+"|"+XZo+"|"+eXo+"|"+tXo+")"),vIn=new RegExp("^(?:"+EIn+"|"+_In+")");var jK=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(vIn.source+"\\s*$"),/^$/,!1]];function gGt(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=QK(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(AGt,"heading");p();function yGt(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};Sxe.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(nXo);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(CGt,"linkify");p();function vGt(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){bGt[t.charCodeAt(0)]=1});function SGt(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&&bGt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(SGt,"escape");p();function TGt(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(IIn,"postProcess");function aXo(t){let e=t.tokens_meta,r=t.tokens_meta.length;IIn(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[UK(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(wGt,"link");p();function RGt(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[UK(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(RGt,"image");p();var cXo=/^([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])?)*)$/,lXo=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function kGt(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(lXo.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(cXo.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(kGt,"autolink");p();function uXo(t){return/^\s]/i.test(t)}a(uXo,"isLinkOpen");function dXo(t){return/^<\/a\s*>/i.test(t)}a(dXo,"isLinkClose");function fXo(t){let e=t|32;return e>=97&&e<=122}a(fXo,"isLetter");function PGt(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&&!fXo(o))return!1;let s=t.src.slice(n).match(CIn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],uXo(c.content)&&t.linkLevel++,dXo(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(PGt,"html_inline");p();var pXo=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,hXo=/^&([a-z][a-z0-9]{1,31});/i;function DGt(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(pXo);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=yXe(c)?pue(c):pue(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(hXo);if(s){let c=bxe(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(DGt,"entity");p();function xIn(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(xIn,"processDelimiters");function NGt(t){let e=t.tokens_meta,r=t.tokens_meta.length;xIn(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};Txe.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()};Txe.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(LGt,"default");function FGt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(FGt,"assign");function bXe(t){return Object.prototype.toString.call(t)}a(bXe,"_class");function mXo(t){return bXe(t)==="[object String]"}a(mXo,"isString");function gXo(t){return bXe(t)==="[object Object]"}a(gXo,"isObject");function AXo(t){return bXe(t)==="[object RegExp]"}a(AXo,"isRegExp");function RIn(t){return bXe(t)==="[object Function]"}a(RIn,"isFunction");function yXo(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(yXo,"escapeRE");var PIn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function EXo(t){return Object.keys(t||{}).reduce(function(e,r){return e||PIn.hasOwnProperty(r)},!1)}a(EXo,"isOptionsObj");var _Xo={"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")}},CXo="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]",vXo="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function bXo(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(bXo,"createValidator");function kIn(){return function(t,e){e.normalize(t)}}a(kIn,"createNormalizer");function vXe(t){let e=t.re=LGt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(CXo),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,gXo(u)){AXo(u.validate)?d.validate=bXo(u.validate):RIn(u.validate)?d.validate=u.validate:s(l,u),RIn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=kIn();return}if(mXo(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:kIn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(yXo).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(vXe,"compile");function DIn(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(DIn,"Match");function jS(t,e){if(!(this instanceof jS))return new jS(t,e);e||EXo(t)&&(e=t,t={}),this.__opts__=FGt({},PIn,e),this.__schemas__=FGt({},_Xo,t),this.__compiled__={},this.__tlds__=vXo,this.__tlds_replaced__=!1,this.re={},vXe(this)}a(jS,"LinkifyIt");jS.prototype.add=a(function(e,r){return this.__schemas__[e]=r,vXe(this),this},"add");jS.prototype.set=a(function(e){return this.__opts__=FGt(this.__opts__,e),this},"set");jS.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");jS.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");jS.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");jS.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"},UGt=35,vO=Math.floor,QGt=String.fromCharCode;function Cq(t){throw new RangeError(xXo[t])}a(Cq,"error");function wXo(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(wXo,"map");function OIn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(IXo,".");let o=t.split("."),s=wXo(o,e).join(".");return n+s}a(OIn,"mapDomain");function BIn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),kXo=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"),MIn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),LIn=a(function(t,e,r){let n=0;for(t=r?vO(t/700):t>>1,t+=vO(t/e);t>UGt*26>>1;n+=36)t=vO(t/UGt);return vO(n+(UGt+1)*t/(t+38))},"adapt"),FIn=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&&Cq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Cq("invalid-input");let m=kXo(t.charCodeAt(l++));m>=36&&Cq("invalid-input"),m>vO((2147483647-n)/f)&&Cq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mvO(2147483647/A)&&Cq("overflow"),f*=A}let d=e.length+1;s=LIn(n-u,d,u==0),vO(n/d)>2147483647-o&&Cq("overflow"),o+=vO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),UIn=a(function(t){let e=[];t=BIn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(QGt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fvO((2147483647-o)/d)&&Cq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Cq("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=qGt.toASCII(e.hostname)}catch{}return cXe(lue(e))}a(FXo,"normalizeLink");function UXo(t){let e=vxe(t,!0);if(e.hostname&&(!e.protocol||HIn.indexOf(e.protocol)>=0))try{e.hostname=qGt.toUnicode(e.hostname)}catch{}return Cxe(lue(e),Cxe.defaultChars+"%")}a(UXo,"normalizeLinkText");function Yx(t,e){if(!(this instanceof Yx))return new Yx(t,e);e||AXe(t)||(e=t||{},t="default"),this.inline=new wIn,this.block=new bIn,this.core=new pIn,this.renderer=new aIn,this.linkify=new NIn,this.validateLink=LXo,this.normalizeLink=FXo,this.normalizeLinkText=UXo,this.utils=zHt,this.helpers=fue({},ZHt),this.options={},this.configure(t),e&&this.set(e)}a(Yx,"MarkdownIt");Yx.prototype.set=function(t){return fue(this.options,t),this};Yx.prototype.configure=function(t){let e=this;if(AXe(t)){let r=t;if(t=MXo[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};Yx.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};Yx.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};Yx.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Yx.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};Yx.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Yx.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};Yx.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var jGt=Yx;function HGt(t){return Array.isArray(t)}a(HGt,"isArray");function QXo(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||HGt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(QXo,"isFenceToken");function*GIn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;HGt(r.children)&&(yield*GIn(r.children))}}a(GIn,"flattenTokensLists");function qXo(){return new jGt}a(qXo,"createMarkdownIt");function $In(t){let e=[],n=qXo().parse(t,{});if(!HGt(n))return e;for(let o of GIn(n)){if(!o||typeof o!="object")continue;let s=o;if(QXo(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($In,"extractCodeBlocks");function GGt(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(GGt,"escapeProblematicHtmlTags");var VGt=Tn.Gpt4oMini,VIn=new ge("virtualToolSummarizer"),Ixe=class extends Error{static{a(this,"SummarizerError")}};function WIn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(WIn,"isValidCategoryItem");function zIn(t,e){if(!Array.isArray(t))throw new Ixe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(WIn))throw new Ixe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(zIn,"validateCategoriesWithoutToolsResponse");function jXo(t){return WIn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(jXo,"isValidCategorizationItem");function YIn(t,e){if(zIn(t,e),!t.every(jXo))throw new Ixe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(YIn,"validateCategorizationResponse");function KIn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(KIn,"deduplicateTools");function HXo(t){let e=new Map;for(let r of t){let n=ZIn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} +`:">",s},"renderToken");$le.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");Vle.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 C3=Vle;function bSn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(bSn,"StateCore");bSn.prototype.Token=C3;var SSn=bSn;p();var Tzo=/\r\n?|\n/g,Izo=/\0/g;function Wjt(t){let e;e=t.src.replace(Tzo,` +`),e=e.replace(Izo,"\uFFFD"),t.src=e}a(Wjt,"normalize");p();function zjt(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(zjt,"block");p();function Yjt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(xzo,"isLinkOpen");function wzo(t){return/^<\/a\s*>/i.test(t)}a(wzo,"isLinkClose");function Kjt(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"&&(xzo(l.content)&&s>0&&s--,wzo(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(Pzo,Dzo)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Nzo,"replace_scoped");function Mzo(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&TSn.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(Mzo,"replace_rare");function Jjt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Rzo.test(t.tokens[e].content)&&Nzo(t.tokens[e].children),TSn.test(t.tokens[e].content)&&Mzo(t.tokens[e].children))}a(Jjt,"replace");p();var Ozo=/['"]/,ISn=/['"]/g,xSn="\u2019";function PZe(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(PZe,"addReplacement");function Bzo(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&&PZe(o,s,h.index,xSn);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"||!Ozo.test(t.tokens[e].content)||Lzo(t.tokens[e].children,t)}a(Zjt,"smartquotes");p();function Xjt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};lO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");lO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!Gs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");lO.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");lO.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");lO.prototype.Token=C3;var RSn=lO;p();var Fzo=65536;function rHt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(rHt,"getLine");function PSn(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&&!Gs(l)||c===45&&Gs(l))return!1;for(;s=4)return!1;d=PSn(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=PSn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>Fzo))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(iHt,"code");p();function oHt(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=DSn(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=kSn(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,q=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(lHt,"reference");p();p();var NSn=["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 Qzo="[a-zA-Z_:][a-zA-Z0-9:._-]*",qzo="[^\"'=<>`\\x00-\\x20]+",jzo="'[^']*'",Hzo='"[^"]*"',Gzo="(?:"+qzo+"|"+jzo+"|"+Hzo+")",$zo="(?:\\s+"+Qzo+"(?:\\s*=\\s*"+Gzo+")?)",MSn="<[A-Za-z][A-Za-z0-9\\-]*"+$zo+"*\\s*\\/?>",OSn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Vzo="",Wzo="<[?][\\s\\S]*?[?]>",zzo="]*>",Yzo="",BSn=new RegExp("^(?:"+MSn+"|"+OSn+"|"+Vzo+"|"+Wzo+"|"+zzo+"|"+Yzo+")"),LSn=new RegExp("^(?:"+MSn+"|"+OSn+")");var bK=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(LSn.source+"\\s*$"),/^$/,!1]];function uHt(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&&Gs(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=vK(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(dHt,"heading");p();function fHt(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};zIe.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(Jzo);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(mHt,"linkify");p();function gHt(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){AHt[t.charCodeAt(0)]=1});function yHt(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&&AHt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(yHt,"escape");p();function EHt(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(qSn,"postProcess");function tYo(t){let e=t.tokens_meta,r=t.tokens_meta.length;qSn(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[_K(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(CHt,"link");p();function bHt(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[_K(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(bHt,"image");p();var rYo=/^([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])?)*)$/,nYo=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function SHt(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(nYo.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(rYo.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(SHt,"autolink");p();function iYo(t){return/^\s]/i.test(t)}a(iYo,"isLinkOpen");function oYo(t){return/^<\/a\s*>/i.test(t)}a(oYo,"isLinkClose");function sYo(t){let e=t|32;return e>=97&&e<=122}a(sYo,"isLetter");function THt(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&&!sYo(o))return!1;let s=t.src.slice(n).match(BSn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],iYo(c.content)&&t.linkLevel++,oYo(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(THt,"html_inline");p();var aYo=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,cYo=/^&([a-z][a-z0-9]{1,31});/i;function IHt(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(aYo);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=RZe(c)?Gle(c):Gle(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(cYo);if(s){let c=WIe(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(IHt,"entity");p();function jSn(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(jSn,"processDelimiters");function xHt(t){let e=t.tokens_meta,r=t.tokens_meta.length;jSn(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};YIe.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()};YIe.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(kHt,"default");function DHt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(DHt,"assign");function MZe(t){return Object.prototype.toString.call(t)}a(MZe,"_class");function lYo(t){return MZe(t)==="[object String]"}a(lYo,"isString");function uYo(t){return MZe(t)==="[object Object]"}a(uYo,"isObject");function dYo(t){return MZe(t)==="[object RegExp]"}a(dYo,"isRegExp");function GSn(t){return MZe(t)==="[object Function]"}a(GSn,"isFunction");function fYo(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(fYo,"escapeRE");var VSn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function pYo(t){return Object.keys(t||{}).reduce(function(e,r){return e||VSn.hasOwnProperty(r)},!1)}a(pYo,"isOptionsObj");var hYo={"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")}},mYo="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]",gYo="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function AYo(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(AYo,"createValidator");function $Sn(){return function(t,e){e.normalize(t)}}a($Sn,"createNormalizer");function NZe(t){let e=t.re=kHt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(mYo),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,uYo(u)){dYo(u.validate)?d.validate=AYo(u.validate):GSn(u.validate)?d.validate=u.validate:s(l,u),GSn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=$Sn();return}if(lYo(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:$Sn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(fYo).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(NZe,"compile");function WSn(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(WSn,"Match");function OS(t,e){if(!(this instanceof OS))return new OS(t,e);e||pYo(t)&&(e=t,t={}),this.__opts__=DHt({},VSn,e),this.__schemas__=DHt({},hYo,t),this.__compiled__={},this.__tlds__=gYo,this.__tlds_replaced__=!1,this.re={},NZe(this)}a(OS,"LinkifyIt");OS.prototype.add=a(function(e,r){return this.__schemas__[e]=r,NZe(this),this},"add");OS.prototype.set=a(function(e){return this.__opts__=DHt(this.__opts__,e),this},"set");OS.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");OS.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");OS.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");OS.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"},NHt=35,uO=Math.floor,MHt=String.fromCharCode;function nq(t){throw new RangeError(vYo[t])}a(nq,"error");function CYo(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(CYo,"map");function KSn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(_Yo,".");let o=t.split("."),s=CYo(o,e).join(".");return n+s}a(KSn,"mapDomain");function JSn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),SYo=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"),YSn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),ZSn=a(function(t,e,r){let n=0;for(t=r?uO(t/700):t>>1,t+=uO(t/e);t>NHt*26>>1;n+=36)t=uO(t/NHt);return uO(n+(NHt+1)*t/(t+38))},"adapt"),XSn=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&&nq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&nq("invalid-input");let m=SYo(t.charCodeAt(l++));m>=36&&nq("invalid-input"),m>uO((2147483647-n)/f)&&nq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(muO(2147483647/A)&&nq("overflow"),f*=A}let d=e.length+1;s=ZSn(n-u,d,u==0),uO(n/d)>2147483647-o&&nq("overflow"),o+=uO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),eTn=a(function(t){let e=[];t=JSn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(MHt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fuO((2147483647-o)/d)&&nq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&nq("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=OHt.toASCII(e.hostname)}catch{}return EZe(Qle(e))}a(DYo,"normalizeLink");function NYo(t){let e=VIe(t,!0);if(e.hostname&&(!e.protocol||iTn.indexOf(e.protocol)>=0))try{e.hostname=OHt.toUnicode(e.hostname)}catch{}return $Ie(Qle(e),$Ie.defaultChars+"%")}a(NYo,"normalizeLinkText");function jx(t,e){if(!(this instanceof jx))return new jx(t,e);e||wZe(t)||(e=t||{},t="default"),this.inline=new HSn,this.block=new FSn,this.core=new wSn,this.renderer=new CSn,this.linkify=new zSn,this.validateLink=kYo,this.normalizeLink=DYo,this.normalizeLinkText=NYo,this.utils=jjt,this.helpers=Hle({},Vjt),this.options={},this.configure(t),e&&this.set(e)}a(jx,"MarkdownIt");jx.prototype.set=function(t){return Hle(this.options,t),this};jx.prototype.configure=function(t){let e=this;if(wZe(t)){let r=t;if(t=wYo[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};jx.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};jx.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};jx.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};jx.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};jx.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};jx.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};jx.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var BHt=jx;function LHt(t){return Array.isArray(t)}a(LHt,"isArray");function MYo(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||LHt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(MYo,"isFenceToken");function*oTn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;LHt(r.children)&&(yield*oTn(r.children))}}a(oTn,"flattenTokensLists");function OYo(){return new BHt}a(OYo,"createMarkdownIt");function sTn(t){let e=[],n=OYo().parse(t,{});if(!LHt(n))return e;for(let o of oTn(n)){if(!o||typeof o!="object")continue;let s=o;if(MYo(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(sTn,"extractCodeBlocks");function FHt(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(FHt,"escapeProblematicHtmlTags");var QHt=Tn.Gpt4oMini,aTn=new Ee("virtualToolSummarizer"),KIe=class extends Error{static{a(this,"SummarizerError")}};function cTn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(cTn,"isValidCategoryItem");function lTn(t,e){if(!Array.isArray(t))throw new KIe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(cTn))throw new KIe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(lTn,"validateCategoriesWithoutToolsResponse");function BYo(t){return cTn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(BYo,"isValidCategorizationItem");function uTn(t,e){if(lTn(t,e),!t.every(BYo))throw new KIe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(uTn,"validateCategorizationResponse");function dTn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(dTn,"deduplicateTools");function LYo(t){let e=new Map;for(let r of t){let n=pTn(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=KIn(r.tools);return[...e.values()]}a(HXo,"validateAndCleanupCategories");function JIn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(FTn)}));return HXo(r)}a(JIn,"processCategorizationResponse");function ZIn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(ZIn,"normalizeGroupName");function $Gt(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:ZZe,summary:kTn,tools:[...r.values()]}),t}a($Gt,"addUncategorizedToolsIfNeeded");async function WGt(t,e,r,n){if(n.isCancellationRequested)return VIn.debug(t.ctx,"Summarization cancelled"),null;let o=gA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await Jc(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new rc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return VIn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of $In(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(WGt,"getResponse");async function XIn(t,e,r){let n=await t.ctx.get(Bc).getBestChatModelConfig([VGt]),s=await Kf.create(nXe,{tools:e},n).renderPrompt(void 0,r),c=await WGt(t,s,n,r);if(!c)return;let l=[c];return zIn(l,"categorizer"),{...l[0],tools:KIn(e),name:ZIn(l[0].name)}}a(XIn,"summarizeToolGroup");async function exn(t,e,r){let n=await t.ctx.get(Bc).getBestChatModelConfig([VGt]),s=await Kf.create(iXe,{tools:e},n).renderPrompt(void 0,r),c=await WGt(t,s,n,r);if(!c)return;YIn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=JIn(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 zGt(t,u,f,r);h&&(u=h),u=$Gt(u,l)}return u}a(exn,"divideToolsIntoGroups");async function zGt(t,e,r,n){let o=await t.ctx.get(Bc).getBestChatModelConfig([VGt]),c=await Kf.create(oXe,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await WGt(t,c,o,n);if(!l)return;YIn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=JIn(l,d);return $Gt(f,d)}a(zGt,"divideToolsIntoExistingGroups");var nxn=ce(require("crypto"));var YGt=new ge("virtualToolGrouper"),rxn="builtin",WXo=`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=dTn(r.tools);return[...e.values()]}a(LYo,"validateAndCleanupCategories");function fTn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(X1n)}));return LYo(r)}a(fTn,"processCategorizationResponse");function pTn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(pTn,"normalizeGroupName");function UHt(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:lZe,summary:$1n,tools:[...r.values()]}),t}a(UHt,"addUncategorizedToolsIfNeeded");async function qHt(t,e,r,n){if(n.isCancellationRequested)return aTn.debug(t.ctx,"Summarization cancelled"),null;let o=EA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await Yc(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new ec(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return aTn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of sTn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(qHt,"getResponse");async function hTn(t,e,r){let n=await t.ctx.get(zc).getBestChatModelConfig([QHt]),s=await Jf.create(hZe,{tools:e},n).renderPrompt(void 0,r),c=await qHt(t,s,n,r);if(!c)return;let l=[c];return lTn(l,"categorizer"),{...l[0],tools:dTn(e),name:pTn(l[0].name)}}a(hTn,"summarizeToolGroup");async function mTn(t,e,r){let n=await t.ctx.get(zc).getBestChatModelConfig([QHt]),s=await Jf.create(mZe,{tools:e},n).renderPrompt(void 0,r),c=await qHt(t,s,n,r);if(!c)return;uTn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=fTn(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 jHt(t,u,f,r);h&&(u=h),u=UHt(u,l)}return u}a(mTn,"divideToolsIntoGroups");async function jHt(t,e,r,n){let o=await t.ctx.get(zc).getBestChatModelConfig([QHt]),c=await Jf.create(gZe,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await qHt(t,c,o,n);if(!l)return;uTn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=fTn(l,d);return UHt(f,d)}a(jHt,"divideToolsIntoExistingGroups");var yTn=he(require("crypto"));var HHt=new Ee("virtualToolGrouper"),ATn="builtin",qYo=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: -`,zXo=` +`,jYo=` -Be sure to call this tool if you need a capability related to the above.`,SXe=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"?rxn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof F_&&(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===rxn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof BY);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 F_){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){YGt.error(this.turnContext.ctx,`Failed to categorize tools: ${Vu(d)}`)}}YGt.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===ZZe);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 F_(yq+d.name,WXo+d.summary+zXo,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 F_&&!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 XIn(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 zGt(this.turnContext,r,e,n):await exn(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 F_&&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 F_&&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 nxn.createHash("sha256").update(r).digest("hex")}};var TXe=class{constructor(e){this._root=new F_(yq,"",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){Exe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new SXe(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 F_)return o.isExpanded=!0,new Or([new wr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var bO=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===yl.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 TXe(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 ixn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(ixn,"calculateReducedMaxRequestTokens");Ns();var ZXo=500,IXe=3,dg=new ge("toolCallingLoop"),XXo="internal.tool_calling_loop_continue_confirmation",gue=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(vc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(us),this.transcriptPersistence=new Z0(e.ctx),this.llmRequestPersistence=zse(()=>{if(!Rze(e.ctx))return;let d=e.subagentInfo;return new wze(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 Kle(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new XZe(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=ixn(c),u=c-l;dg.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=gr(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(ZXo,qt(e.ctx,je.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new fZe(new pZe(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(X0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=MWe(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 TGe(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(kmn(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.`,OZe=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"?ATn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof O_&&(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===ATn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof yY);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 O_){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){HHt.error(this.turnContext.ctx,`Failed to categorize tools: ${Vu(d)}`)}}HHt.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===lZe);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 O_(eq+d.name,qYo+d.summary+jYo,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 O_&&!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 hTn(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 jHt(this.turnContext,r,e,n):await mTn(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 O_&&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 O_&&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 yTn.createHash("sha256").update(r).digest("hex")}};var BZe=class{constructor(e){this._root=new O_(eq,"",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){HIe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new OZe(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 O_)return o.isExpanded=!0,new Or([new wr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var dO=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===gl.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 BZe(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 ETn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(ETn,"calculateReducedMaxRequestTokens");As();var VYo=500,LZe=3,dg=new Ee("toolCallingLoop"),WYo="internal.tool_calling_loop_continue_confirmation",Wle=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(_c),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(cs),this.transcriptPersistence=new J0(e.ctx),this.llmRequestPersistence=Pse(()=>{if(!KWe(e.ctx))return;let d=e.subagentInfo;return new YWe(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 xle(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new uZe(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=ETn(c),u=c-l;dg.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=ir(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(VYo,Gt(e.ctx,Je.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new bJe(new SJe(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(X0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=tWe(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 ZHe(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(i0n(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 -`}]}));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 D3?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 y3?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=Kf.create(JZe,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=NWe(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 YQ((R,x,k,D,N,L)=>{let B=R.trim(),M=B.match(CIe)!==null&&B.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:x,references:k,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),dg.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&&(dg.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 AA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Mc;case"failed":throw this.turn.status="error",dg.error(this.turnContext.ctx,"Fetch failed:",r),new AA({message:KQ.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===MS,copilotPlan:FI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new AA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new AA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new AA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new AA({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 AA({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}=Uo.parseModelNotSupportedReason(r.reason);throw new AA({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 AA({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 AA({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 F_)this.handleVirtualToolCall(c,e,n);else if(c instanceof BY)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;dg.error(this.turnContext.ctx,l);let u=new Or([new wr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=yZe(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(bO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Or([new wr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;$6t(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=r3(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){dg.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Or([new wr(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=tTn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=yZe(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 gq||u instanceof Mc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Or([new wr("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{dg.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Vu(u)}`,u),l="error";let d=new Or([new wr(Vu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=yZe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),$6t(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=r3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){dg.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Vu(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(bO);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 dg.error(this.turnContext.ctx,`Error while computing tool grouping: ${Vu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof F_?{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"?yTn(this.modelConfiguration):e.name==="apply_patch"?_Tn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?AO.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=TQ(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+hO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(qY(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){dg.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=TQ(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(bO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(OK).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(qS),c=kK(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!EO.isPotentiallySensitiveTool(e))return;let n=EO.getMatchingRuleForToolCall(e,r,this.turnContext),o=EO.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 Mc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){dg.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=EO.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=fTn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?kK(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 gq("Cancelled by user");case"accept":return Promise.resolve();default:throw new gq(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(dg.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,dg.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new D3}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Md)}catch(s){return dg.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Vu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:XXo,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 dg.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Vu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new AA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new AA({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(Uv).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){dg.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Vu(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=ZJe(e,String(this.turn.id),null,o);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,s).catch(c=>{Ye.error(this.turnContext.ctx,`Failed to record assistant round transcript: ${c instanceof Error?c.message:String(c)}`)})}catch(o){Ye.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=NSn(String(this.turn.id),e);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r).catch(n=>{Ye.error(this.turnContext.ctx,`Failed to record rendered user message transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){Ye.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=MSn(e,r,n);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,o).catch(s=>{Ye.error(this.turnContext.ctx,`Failed to record tool execution start transcript: ${s instanceof Error?s.message:String(s)}`)})}catch(o){Ye.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=OSn(e,r,s,null,{status:n.toString()});this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,c).catch(l=>{Ye.error(this.turnContext.ctx,`Failed to record tool execution complete transcript: ${l instanceof Error?l.message:String(l)}`)})}catch(o){Ye.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}));Wse(()=>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=>Ye.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||Wse(()=>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=>Ye.debug(this.turnContext.ctx,"Failed to record subagent link",c))}recordToolInOut(e,r,n,o){if(!this.llmRequestPersistence?.isEnabled()||!e.id)return;let s=hO(n.content),c=Math.round(performance.now()-o);Wse(()=>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=>Ye.debug(this.turnContext.ctx,"Failed to record tool-in-out entry",l))}};var KGt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},JGt=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 Y9t(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(Y9t,"parseModelString");var xXe=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 Gf({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 DTe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new SY([c],e.conversation.source,e.conversation.userLanguage),f=new Wx(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=Y9t(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let k=(await f.ctx.get(dc).getMetadata()).find(D=>D.name.toLowerCase()===T);if(k){let D;k.is_chat_fallback?D=k.id:D=k.capabilities.family,h=await Uo.getModelConfiguration(e.ctx,void 0,D)}else if(T===Mze.toLowerCase())m=!0,h=await Uo.getModelConfiguration(e.ctx,void 0,MS,void 0,d.id.toString(),SQ(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let k=(await new bc(f.ctx.get(Si)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(k)h=await QM(f.ctx,k.provider,k.name);else throw new Error(`BYOK model "${b.modelName}" with provider "${b.provider}" not found`)}}else this.subagentConfig.resolveModelFamily?h=await ees(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 rc(e.ctx),A=await Jc(e.ctx,f,{languageId:""}),y=n||new KGt,E=new JGt(y,e.turn.id);await e.ctx.get(vc).begin(d,c,E),await new gue(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Rd).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?In(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 ees(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 Uo.getModelConfiguration(t.ctx,"user",s);if(o!==void 0&&c.originalBillingMultiplier!==void 0&&c.originalBillingMultiplier>o)continue;return c}catch{continue}return r}a(ees,"resolvePreferredSubagentModel");p();p();p();var vq=ce(wo());var wXe=class extends sr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=In(r.request.message),c=GM(r.response?.message,!0),l=tO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,vq.useKeepWith)();return vscpp(vscppf,null,vscpp(vq.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(vq.UserMessage,{priority:950},vscpp(jn,{name:"environment_info"},vscpp(pq,{ctx:e.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(Jle,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(vq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Mx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(vq.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 ZGt=10,tes=new Set(["file_search","grep_search","read_file"]),RXe=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Tn.ClaudeHaiku45,Tn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:ZGt,isLastTurn:o.oneBasedIterationNum>ZGt};return Kf.create(wXe,s,n)}filterTools(e){return e.filter(r=>tes.has(r.name))}getMaxRounds(){return ZGt+1}};p();var GK=ce(wo());var kXe=class extends sr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=GM(r.response?.message,!0),l=tO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,GK.useKeepWith)(),d=In(r.request.message);return vscpp(vscppf,null,vscpp(GK.SystemMessage,{priority:1e3},vscpp(eue,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(GK.UserMessage,{priority:950},vscpp(jn,{name:"environment_info"},vscpp(pq,{ctx:e.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(GK.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Mx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var XGt=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 Kf.create(kXe,s,n)}};function oxn(t){return t.isBuiltIn&&t.name==="Search"?new RXe:new XGt(t)}a(oxn,"resolveSubagentConfig");var Aue=class extends hu{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 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=Jf.create(cZe,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=eWe(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 NQ((R,x,P,D,N,L)=>{let B=R.trim(),M=B.match(zTe)!==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),dg.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&&(dg.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 _A({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Dc;case"failed":throw this.turn.status="error",dg.error(this.turnContext.ctx,"Fetch failed:",r),new _A({message:x_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===xS,copilotPlan:DI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new _A({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new _A({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new _A({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new _A({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 _A({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}=Jo.parseModelNotSupportedReason(r.reason);throw new _A({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 _A({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 _A({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 O_)this.handleVirtualToolCall(c,e,n);else if(c instanceof yY)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;dg.error(this.turnContext.ctx,l);let u=new Or([new wr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=RJe(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(dO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Or([new wr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;J8t(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=HL(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){dg.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Or([new wr(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=g1n(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=RJe(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 ZQ||u instanceof Dc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Or([new wr("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{dg.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Vu(u)}`,u),l="error";let d=new Or([new wr(Vu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=RJe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),J8t(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=HL(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){dg.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Vu(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(dO);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 dg.error(this.turnContext.ctx,`Error while computing tool grouping: ${Vu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof O_?{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"?N1n(this.modelConfiguration):e.name==="apply_patch"?O1n(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?oO.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=lQ(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+rO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(bY(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){dg.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=lQ(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(dO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(gK).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(MS),c=dK(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!aO.isPotentiallySensitiveTool(e))return;let n=aO.getMatchingRuleForToolCall(e,r,this.turnContext),o=aO.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 Dc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){dg.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=aO.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=x1n(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?dK(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 ZQ("Cancelled by user");case"accept":return Promise.resolve();default:throw new ZQ(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(dg.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,dg.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new y3}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Dd)}catch(s){return dg.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Vu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:WYo,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 dg.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Vu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new _A({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new _A({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(NC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){dg.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Vu(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=lJe(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=zbn(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=Ybn(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=Kbn(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}));Rse(()=>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||Rse(()=>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=rO(n.content),c=Math.round(performance.now()-o);Rse(()=>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 GHt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},$Ht=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 t9t(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(t9t,"parseModelString");var FZe=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 $f({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 iTe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new cY([c],e.conversation.source,e.conversation.userLanguage),f=new Qx(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=t9t(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(lc).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P){let D;P.is_chat_fallback?D=P.id:D=P.capabilities.family,h=await Jo.getModelConfiguration(e.ctx,void 0,D)}else if(T===tze.toLowerCase())m=!0,h=await Jo.getModelConfiguration(e.ctx,void 0,xS,void 0,d.id.toString(),cQ(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new vc(f.ctx.get(bi)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await RM(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 zYo(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 ec(e.ctx),A=await Yc(e.ctx,f,{languageId:""}),y=n||new GHt,E=new $Ht(y,e.turn.id);await e.ctx.get(_c).begin(d,c,E),await new Wle(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(lu).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Rn(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 zYo(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 Jo.getModelConfiguration(t.ctx,"user",s);if(o!==void 0&&c.originalBillingMultiplier!==void 0&&c.originalBillingMultiplier>o)continue;return c}catch{continue}return r}a(zYo,"resolvePreferredSubagentModel");p();p();p();var iq=he(Io());var UZe=class extends ar{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Rn(r.request.message),c=NM(r.response?.message,!0),l=GM(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,iq.useKeepWith)();return vscpp(vscppf,null,vscpp(iq.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(iq.UserMessage,{priority:950},vscpp(jn,{name:"environment_info"},vscpp(YQ,{ctx:e.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(KQ,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(wle,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(iq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Rx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(iq.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 VHt=10,YYo=new Set(["file_search","grep_search","read_file"]),QZe=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Tn.ClaudeHaiku45,Tn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:VHt,isLastTurn:o.oneBasedIterationNum>VHt};return Jf.create(UZe,s,n)}filterTools(e){return e.filter(r=>YYo.has(r.name))}getMaxRounds(){return VHt+1}};p();var TK=he(Io());var qZe=class extends ar{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=NM(r.response?.message,!0),l=GM(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,TK.useKeepWith)(),d=Rn(r.request.message);return vscpp(vscppf,null,vscpp(TK.SystemMessage,{priority:1e3},vscpp(kle,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(TK.UserMessage,{priority:950},vscpp(jn,{name:"environment_info"},vscpp(YQ,{ctx:e.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(KQ,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(TK.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Rx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var WHt=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 Jf.create(qZe,s,n)}};function _Tn(t){return t.isBuiltIn&&t.name==="Search"?new QZe:new WHt(t)}a(_Tn,"resolveSubagentConfig");var zle=class extends pu{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. @@ -3256,9 +3212,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 Zle}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await Jc(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",Bm(r.ctx,"runSubagentTool.error",l),MI(r.ctx,"runSubagentTool.error",l),new Or([new wr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",Bm(r.ctx,"runSubagentTool.error",l),MI(r.ctx,"runSubagentTool.error",l),new Or([new wr(`Agent '${c}' is not available for model invocation`)],"error");u=oxn(d);let f=new xXe(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(vc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});ht(r.ctx,"runSubagentTool.success",y),MI(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 Rle}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await Yc(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",Bm(r.ctx,"runSubagentTool.error",l),wI(r.ctx,"runSubagentTool.error",l),new Or([new wr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",Bm(r.ctx,"runSubagentTool.error",l),wI(r.ctx,"runSubagentTool.error",l),new Or([new wr(`Agent '${c}' is not available for model invocation`)],"error");u=_Tn(d);let f=new FZe(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(_c).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});yt(r.ctx,"runSubagentTool.success",y),wI(r.ctx,"runSubagentTool.success",y);let E=`This is what has been accomplished by Custom Agent "${c}": -${A.response}`,_=new Or([new wr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof D3?(l.properties.message="Tool call round exceed",Bm(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",T9e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Or([new wr(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 $K=new ge("applyPatchTool"),res=`Use the \`apply_patch\` tool to edit files. +${A.response}`,_=new Or([new wr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof y3?(l.properties.message="Tool call round exceed",Bm(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",J6e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Or([new wr(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 IK=new Ee("applyPatchTool"),KYo=`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 @@ -3327,7 +3283,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.`,PXe=class extends hu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:res,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 Or([new wr("Missing patch text")],"error");let c=OTn(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 $K.warn(e.ctx,h),new Or([new wr(h)],"error")}let l=MK(o),u=aue(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 $K.warn(e.ctx,h),new Or([new wr(h)],"error")}let f={};try{$K.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 sue)return $K.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Or([new wr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof yO)return $K.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Or([new wr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof Wh)return $K.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Or([new wr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return $K.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Or([new wr(m)],"error")}}async buildCommit(e,r,n,o){return BTn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=Ju(c,n.uriSchemeCache),d=await n.ctx.get(Jn).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new Wh(`File not found: ${c}`);if(d.status==="invalid")throw new Wh(`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.`,jZe=class extends pu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:KYo,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 Or([new wr("Missing patch text")],"error");let c=K1n(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 IK.warn(e.ctx,h),new Or([new wr(h)],"error")}let l=mK(o),u=Fle(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 IK.warn(e.ctx,h),new Or([new wr(h)],"error")}let f={};try{IK.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 Lle)return IK.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Or([new wr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof sO)return IK.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Or([new wr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof Wh)return IK.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Or([new wr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return IK.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Or([new wr(m)],"error")}}async buildCommit(e,r,n,o){return J1n(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=Ju(c,n.uriSchemeCache),d=await n.ctx.get(ni).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new Wh(`File not found: ${c}`);if(d.status==="invalid")throw new Wh(`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(` @@ -3335,7 +3291,7 @@ ${c.map(f=>` - ${f}`).join(` ${l.map(f=>` - ${f}`).join(` `)}`);let d=u.length>0?u.join(` -`):"No changes were applied.";return new Or([new wr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(us).getToolByNameAndProvider("insert_edit_into_file",$f);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(us).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(us).getToolByNameAndProvider("create_file",$f);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(us).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=MK(n.input),s=aue(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return yA(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=MK(n.input),s=aue(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return yA(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 sxn=require("path");var nes=16,xxe=class extends hu{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 Or([new wr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(cs).getToolByNameAndProvider("insert_edit_into_file",Vf);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(cs).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(cs).getToolByNameAndProvider("create_file",Vf);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(cs).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=mK(n.input),s=Fle(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return vA(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=mK(n.input),s=Fle(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return vA(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 vTn=require("path");var JYo=16,JIe=class extends pu{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 @@ -3354,37 +3310,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(kP),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:h_n,maxResults:r.input.maxResults??nes,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Or([new wr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=Wn(f.chunk.file),m=pA(f.chunk.text);return new wr(`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(bk),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:Pyn,maxResults:r.input.maxResults??JYo,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Or([new wr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=Wn(f.chunk.file),m=gA(f.chunk.text);return new wr(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: ${m} ${f.chunk.text} -${m}`)}),d=new hQ(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,sxn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(jL(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(Mn).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 DXe=class extends hu{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 Or([new wr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(us).getToolByNameAndProvider("create_file",$f);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(us).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=DM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=hO(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 gO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Or([new wr(c.join(` -`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${yA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Md),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=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${yA(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();Ns();function VK(){return gr()}a(VK,"uuidV4");p();var Wp={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function lxn(t){let e=[],r=[],n=[],o,s;for(let c of ies(t))switch(c.marker){case void 0:r=c.content;break;case Wp.FILEPATH:o=c.content.join(` -`).trim();break;case Wp.FIND:s=axn(c.content);break;case Wp.REPLACE:if(o&&s){let l=axn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case Wp.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(lxn,"parsePatchResponse");function axn(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(axn,"extractCodeBlock");function*ies(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(Wp.FILEPATH)?s=Wp.FILEPATH:o.startsWith(Wp.FIND)?s=Wp.FIND:o.startsWith(Wp.REPLACE)?s=Wp.REPLACE:o.startsWith(Wp.COMPLETE)?s=Wp.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(ies,"iterateSections");function oes(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=ses(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=wxe(_);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=wxe(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=ces(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` -`)}a(oes,"applyPatch");function ses(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&&uxn(t.charCodeAt(n));)n--;return n<0}a(cxn,"endsWith");function aes(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}=dxn(u,n),h=f;if(hs&&NXe(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(ces,"adjustIndentation");function fxn(t,e){let r=t;for(let n of e){let o=oes(r,n);o!==void 0&&(r=o)}return r}a(fxn,"applyPatches");p();var les="InstantApplyChat";function ues(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(ues,"isProxyModel");function des(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(ues):[]}a(des,"parseProxyModels");var bq=class{constructor(e){this.ctx=e;this.logger=new ge("ProxyModelService");this.models=[];Es(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===les)}async fetchModels(e){try{let r=LI(this.ctx,e,"proxy","models"),n=await this.ctx.get(ar).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...by(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=des(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 MXe=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var eE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var WK=ce(wo());var yue=class extends sr{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=pA(d),g=pA(o);return vscpp(vscppf,null,vscpp(WK.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 ",_A," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(WK.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(jn,{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(jn,{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(WK.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(WK.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var BXe=ce(wo());var e$t=class extends sr{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 `",Wp.FILEPATH,"`, `",Wp.FIND,"` and `",Wp.REPLACE,"`.",vscpp("br",null),"After ",Wp.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",Wp.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 ",Wp.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 ",Wp.COMPLETE,".",vscpp("br",null))}},OXe=class extends sr{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=pA(u),h=pA(o),m=ho(this.props.uri);return vscpp(vscppf,null,vscpp(BXe.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 `",_A,"` 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(e$t,null),vscpp("br",null),vscpp(MZe,null),vscpp(jn,{name:"example"},vscpp(jn,{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(jn,{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(BXe.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${Wp.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(jn,{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(jn,{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 hc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Oc(`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 Oc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Oc(`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,Hce)}static subtract(e,r){return r?e.startLineNumberr)throw new Oc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=FY(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=A6t(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=A6t(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 Ql(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=SWe(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=FY(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 Ql(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var SO=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 Ql.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Wo(e.lineNumber,e.column+this.columnCount):new Wo(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 Rxe=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 hc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=FY(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Wo(n,o)}getRange(e){return Fi.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return SO.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new SO(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var t$t=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Wo(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 Rxe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Fi(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return Uze(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var L3=class extends t$t{constructor(r){super();this.value=r;this._t=new Rxe(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 kxe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Oc(`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(hc.emptyAt(h),new hc(0,m));s.push(E)}if(!f)throw new Oc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(hc.ofStartAndLength(f.replaceRange.endExclusive,0),new hc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new hc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new hc(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 hc(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(hc.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 MTe(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 hc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},pxn=class t extends kxe{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 UXe=class extends kxe{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(CA.replace(hc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new U_(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 U_(r)}normalizeEOL(e){return new U_(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=CA.replace(hc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?U_.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new L3(this.apply(e.value))}mapData(e){return new r$t(this.replacements.map(r=>new Eue(r.replaceRange,r.newText,e(r))))}},QXe=class extends FXe{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=sle(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,oIe(n,this.newText)),c=new hc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new CA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new CA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=sle(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new hc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=oIe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new hc(0,this.newText.length-o))}toEdit(){return new U_([this])}},U_=class t extends UXe{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 CA(e,r)])}static insert(e,r){return new t([new CA(hc.emptyAt(e),r)])}static delete(e){return new t([new CA(e,"")])}static fromJson(e){return new t(e.map(CA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew CA(e.replaceRange,e.newText)))}},Eue=class t extends QXe{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(hc.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 Pxe=class t{constructor(e){this.replacements=e;hUt(()=>lIe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>tE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new tE(e,r)])}static insert(e,r){return new t([new tE(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 tE(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=SO.ofText(s.text);if(e.isBefore(l)){let d=new Wo(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return qXe(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 Wo(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Wo?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Wo?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return qXe(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 Wo(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=qXe(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=qXe(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new L3(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new tE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=SO.ofText(s.text),l=Wo.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 Oc;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 L3(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Fi.fromPositions(new Wo(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 Wo(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(` -`)}},tE=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 Oc;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,vTn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(RL(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(Mn).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 HZe=class extends pu{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 Or([new wr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(cs).getToolByNameAndProvider("create_file",Vf);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(cs).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=bM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=rO(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 iO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Or([new wr(c.join(` +`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${vA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Dd),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=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${vA(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();As();function xK(){return ir()}a(xK,"uuidV4");p();var zp={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function STn(t){let e=[],r=[],n=[],o,s;for(let c of ZYo(t))switch(c.marker){case void 0:r=c.content;break;case zp.FILEPATH:o=c.content.join(` +`).trim();break;case zp.FIND:s=CTn(c.content);break;case zp.REPLACE:if(o&&s){let l=CTn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case zp.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(STn,"parsePatchResponse");function CTn(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(CTn,"extractCodeBlock");function*ZYo(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(zp.FILEPATH)?s=zp.FILEPATH:o.startsWith(zp.FIND)?s=zp.FIND:o.startsWith(zp.REPLACE)?s=zp.REPLACE:o.startsWith(zp.COMPLETE)?s=zp.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(ZYo,"iterateSections");function XYo(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=eKo(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=ZIe(_);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=ZIe(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=rKo(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` +`)}a(XYo,"applyPatch");function eKo(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&&TTn(t.charCodeAt(n));)n--;return n<0}a(bTn,"endsWith");function tKo(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}=ITn(u,n),h=f;if(hs&&GZe(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(rKo,"adjustIndentation");function xTn(t,e){let r=t;for(let n of e){let o=XYo(r,n);o!==void 0&&(r=o)}return r}a(xTn,"applyPatches");p();var nKo="InstantApplyChat";function iKo(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(iKo,"isProxyModel");function oKo(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(iKo):[]}a(oKo,"parseProxyModels");var oq=class{constructor(e){this.ctx=e;this.logger=new Ee("ProxyModelService");this.models=[];ys(e,n=>{this.fetchModels(n)});let r=e.get(Ut).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===nKo)}async fetchModels(e){try{let r=kI(this.ctx,e,"proxy","models"),n=await this.ctx.get(fr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...wy(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=oKo(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 $Ze=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var eE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var wK=he(Io());var Yle=class extends ar{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=gA(d),g=gA(o);return vscpp(vscppf,null,vscpp(wK.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 ",CA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(wK.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(jn,{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(jn,{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(wK.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(wK.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var WZe=he(Io());var zHt=class extends ar{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 `",zp.FILEPATH,"`, `",zp.FIND,"` and `",zp.REPLACE,"`.",vscpp("br",null),"After ",zp.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",zp.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 ",zp.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 ",zp.COMPLETE,".",vscpp("br",null))}},VZe=class extends ar{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=gA(u),h=gA(o),m=Yo(this.props.uri);return vscpp(vscppf,null,vscpp(WZe.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 `",CA,"` 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(zHt,null),vscpp("br",null),vscpp($Je,null),vscpp(jn,{name:"example"},vscpp(jn,{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(jn,{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(WZe.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${zp.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(jn,{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(jn,{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 fc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Nc(`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 Nc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Nc(`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,vce)}static subtract(e,r){return r?e.startLineNumberr)throw new Nc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=_Y(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=b8t(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=b8t(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 Ll(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=$Ve(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=_Y(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 Ll(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var fO=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 Li(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Li(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Li(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Ll.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Ho(e.lineNumber,e.column+this.columnCount):new Ho(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Li.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var XIe=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 fc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=_Y(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Ho(n,o)}getRange(e){return Li.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return fO.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new fO(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var YHt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Ho(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Li(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new XIe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Li(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return sze(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var b3=class extends YHt{constructor(r){super();this.value=r;this._t=new XIe(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 exe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Nc(`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(fc.emptyAt(h),new fc(0,m));s.push(E)}if(!f)throw new Nc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(fc.ofStartAndLength(f.replaceRange.endExclusive,0),new fc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new fc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new fc(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 fc(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(fc.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 sTe(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 fc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},wTn=class t extends exe{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 KZe=class extends exe{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(bA.replace(fc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new B_(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 B_(r)}normalizeEOL(e){return new B_(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=bA.replace(fc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?B_.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new b3(this.apply(e.value))}mapData(e){return new KHt(this.replacements.map(r=>new Kle(r.replaceRange,r.newText,e(r))))}},JZe=class extends YZe{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=Fce(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,DTe(n,this.newText)),c=new fc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new bA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new bA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=Fce(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new fc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=DTe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new fc(0,this.newText.length-o))}toEdit(){return new B_([this])}},B_=class t extends KZe{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 bA(e,r)])}static insert(e,r){return new t([new bA(fc.emptyAt(e),r)])}static delete(e){return new t([new bA(e,"")])}static fromJson(e){return new t(e.map(bA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew bA(e.replaceRange,e.newText)))}},Kle=class t extends JZe{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(fc.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 txe=class t{constructor(e){this.replacements=e;_9t(()=>BTe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>tE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new tE(e,r)])}static insert(e,r){return new t([new tE(Li.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 tE(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=fO.ofText(s.text);if(e.isBefore(l)){let d=new Ho(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return ZZe(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 Ho(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Ho?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Ho?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return ZZe(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 Ho(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=ZZe(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=ZZe(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new b3(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new tE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=fO.ofText(s.text),l=Ho.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 Nc;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 b3(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Li.fromPositions(new Ho(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=Li.fromPositions(r.range.getEndPosition(),new Ho(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(` +`)}},tE=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 Nc;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=>_ue.deserialize(r)))}static fromEdit(e,r){let n=Pxe.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,Hce)),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 U_(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(Ql.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 Ql(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 _ue(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 v6t(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 _ue(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},_ue=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(Ql.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=Uze(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Fi.fromPositions(new Wo(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 Wo(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 Wo(s,c)}else n=new Wo(1,1);let o=r.addToPosition(new Wo(1,1));return new tE(Fi.fromPositions(n,o),"")}else return new tE(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=>` +`),o=Fce(r,n);r=r.substring(o),n=n.substring(o);let s=DTe(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}};function ZZe(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Li.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Nc("start must be before end");return new Li(t.lineNumber,t.column,e.lineNumber,e.column)}a(ZZe,"rangeFromPositions");var rxe=class t{constructor(e){this.replacements=e;LY(BTe(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=>Jle.deserialize(r)))}static fromEdit(e,r){let n=txe.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,vce)),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 B_(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(Ll.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 Ll(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 Jle(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 w8t(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 Jle(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Jle=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(Ll.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=sze(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Li.fromPositions(new Ho(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(Li.fromPositions(e.range.getEndPosition(),new Ho(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 Ho(s,c)}else n=new Ho(1,1);let o=r.addToPosition(new Ho(1,1));return new tE(Li.fromPositions(n,o),"")}else return new tE(new Li(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 tE(Fi.fromPositions(new Wo(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 tE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new CA(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")})(fes||={});var Cue=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new jXe(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new jXe(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return hxn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return hxn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Dxe.fromEdit(e,new L3(this.originalText)),n=MTe(r.replacements,s=>s.lineRange.length),o=MTe(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}))}}},jXe=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function hxn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(hxn,"sum");p();var vue=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=U_.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=pes(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 n$t(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(n$t,"compute4GramTextSimilarity");function pes(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(pes,"applyEditsToRanges");p();p();var Nxe=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 Wo(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 HXe(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Nxe(t),c=new Nxe(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 hc(g,A);l.push(new CA(y,m))}return new U_(l)}a(HXe,"stringEditFromDiff");p();p();var mxn=ce(require("path")),gxn=require("worker_threads");var i$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 hes(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(hes,"createRpcProxy");var GXe=class{constructor(e,r,n){this.responseHandler=new i$t;this.worker=new gxn.Worker(e,r),eTe(this.worker,mxn.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=hes((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 $Xe=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 Mxe=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 Ql(s,u.original.startLineNumber),new Ql(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Ql(s,r+1),new Ql(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 TO(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Oc("not a valid diff");return new TO(new Fi(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Fi(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new TO(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(Axn(this.original.endLineNumberExclusive,e)&&Axn(this.modified.endLineNumberExclusive,r))return new TO(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 TO(Fi.fromPositions(new Wo(this.original.startLineNumber,1),bue(new Wo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Fi.fromPositions(new Wo(this.modified.startLineNumber,1),bue(new Wo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new TO(Fi.fromPositions(bue(new Wo(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),bue(new Wo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Fi.fromPositions(bue(new Wo(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),bue(new Wo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Oc}};function bue(t,e){if(t.lineNumber<1)return new Wo(1,1);if(t.lineNumber>e.length)return new Wo(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Wo(t.lineNumber,r.length+1):t}a(bue,"normalizePosition");function Axn(t,e){return t>=1&&t<=e.length}a(Axn,"isValidLineNumber");var VXe=class t extends Mxe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=Ql.join(e.map(o=>Ql.fromRangeInclusive(o.originalRange))),n=Ql.join(e.map(o=>Ql.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()])}},TO=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 Oc("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 tE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var Exn=require("fs");var Kx=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new LQ(()=>{let e=mes([Wze(__dirname,"diffWorker.js"),Wze(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new GXe(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:yxn(o.changes),moves:o.moves.map(c=>new $Xe(new Mxe(new Ql(c[0],c[1]),new Ql(c[2],c[3])),yxn(c[4])))}}};function yxn(t){return t.map(e=>new VXe(new Ql(e[0],e[1]),new Ql(e[2],e[3]),e[4]?.map(r=>new TO(new Fi(r[0],r[1],r[2],r[3]),new Fi(r[4],r[5],r[6],r[7])))))}a(yxn,"toLineRangeMappings");function mes(t){for(let e of t)if((0,Exn.existsSync)(e))return e}a(mes,"firstExistingPath");var WXe=new ge("editSurvivalReporter"),o$t=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 yQ;this._editSurvivalTracker=new vue(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=tf(this._document.uri),r=this.ctx.get(Ox);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){WXe.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=tf(this._document.uri),n=await this.ctx.get(Ox).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 WXe.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(Jn).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Oc(`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 HXe(r,n,e.get(Kx)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var zXe=class extends o$t{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Cue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new qze(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{WXe.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 vue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Cue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new vue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Cue(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw WXe.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var _xn=new ge("editSurvivalTrackerService"),OP=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n){_xn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let o;return{startReporter:a(s=>{(async()=>{try{let c=await HXe(r,n,this.ctx.get(Kx));o=new zXe(this.ctx,e,r,n,c,s,[0,30*1e3,120*1e3,300*1e3,600*1e3])}catch(c){_xn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Vu(c)}`,c)}})()},"startReporter"),cancel:a(()=>{o?.cancel()},"cancel")}}};var ges=1e3,Cxn=256e3,vxn=64e3;function Aes(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(Aes,"makeProxyInstantApplyModelConfiguration");var yes=8e3,bxn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},Ees={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},YXe=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new ge("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new eE("No uri found in code block");if(o.isCancellationRequested)throw new MXe;e.code.includes(_A)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(Jn).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 eE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(_A))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(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: ${Vu(g)}`),gi(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(bq).instantApplyModels[0]?.name??"unknown":"default"}),qt(this.ctx,je.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=Ss("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 eE("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(OP),E=VK(),_=[],v=0,b=0,T=f.length+e.code.length+ges;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(rc).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 eE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await Kf.create(yue,{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 k=_.join("");if(k){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:ji(e.resource),partialText:k,languageId:r.document.detectedLanguageId,markdownCodeFence:pA(k)});let D=y.initialize(r.document,f,k);return{code:k,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 eE(D)}}else{if(x.type==="canceled")throw new Mc;{let k=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,k,x),new eE(k)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",yue,e,r,n,o,s,c,l,u,d=>_es(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",OXe,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=lxn(d);if(h.patches.length===0)throw new eE(`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=fxn(f,h.patches);if(m===void 0)throw new eE(`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 eE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await Uo.getModelConfiguration(this.ctx,void 0,Tn.Gpt41,void 0,void 0);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 Kf.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(OP),b=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(Jt).updateExPValuesAndAssignments(b),w=VK(),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 k=await this.ctx.get(rc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(k,null,2)}`),k.type==="success"){let D=k.value;if(!D)throw new eE(`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:pA(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:k.requestId}}}else{if(k.type==="canceled")throw new Mc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${k.type}`;throw this.logger.error(this.ctx,D,k),new eE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>Cxn)throw new eE(`Document too large: ${l} characters (limit: ${Cxn})`);let u=this.ctx.get(bq).instantApplyModels[0],d=u?Aes(u.name):void 0,h=await Kf.create(yue,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??bxn).renderPrompt(void 0,n),m=h.tokenCount;if(m>vxn)throw new eE(`Prompt too large: ${m} tokens (limit: ${vxn})`);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=In(n.content);return n.role==="system"?`${r} +`).join("")),new tE(Li.fromPositions(new Ho(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Li(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new tE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new bA(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")})(sKo||={});var Zle=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new XZe(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new XZe(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return RTn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return RTn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=rxe.fromEdit(e,new b3(this.originalText)),n=sTe(r.replacements,s=>s.lineRange.length),o=sTe(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}))}}},XZe=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function RTn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(RTn,"sum");p();var Xle=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=B_.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=aKo(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 JHt(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(JHt,"compute4GramTextSimilarity");function aKo(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(aKo,"applyEditsToRanges");p();p();var nxe=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 Ho(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 eXe(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new nxe(t),c=new nxe(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 fc(g,A);l.push(new bA(y,m))}return new B_(l)}a(eXe,"stringEditFromDiff");p();p();var PTn=he(require("path")),kTn=require("worker_threads");var ZHt=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 cKo(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(cKo,"createRpcProxy");var tXe=class{constructor(e,r,n){this.responseHandler=new ZHt;this.worker=new kTn.Worker(e,r),RSe(this.worker,PTn.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=cKo((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 rXe=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 ixe=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 Ll(s,u.original.startLineNumber),new Ll(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Ll(s,r+1),new Ll(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 pO(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Nc("not a valid diff");return new pO(new Li(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Li(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new pO(new Li(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Li(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(DTn(this.original.endLineNumberExclusive,e)&&DTn(this.modified.endLineNumberExclusive,r))return new pO(new Li(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Li(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new pO(Li.fromPositions(new Ho(this.original.startLineNumber,1),eue(new Ho(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Li.fromPositions(new Ho(this.modified.startLineNumber,1),eue(new Ho(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new pO(Li.fromPositions(eue(new Ho(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),eue(new Ho(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Li.fromPositions(eue(new Ho(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),eue(new Ho(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Nc}};function eue(t,e){if(t.lineNumber<1)return new Ho(1,1);if(t.lineNumber>e.length)return new Ho(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Ho(t.lineNumber,r.length+1):t}a(eue,"normalizePosition");function DTn(t,e){return t>=1&&t<=e.length}a(DTn,"isValidLineNumber");var nXe=class t extends ixe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=Ll.join(e.map(o=>Ll.fromRangeInclusive(o.originalRange))),n=Ll.join(e.map(o=>Ll.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()])}},pO=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 Nc("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 tE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var MTn=require("fs");var Hx=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new vQ(()=>{let e=lKo([hze(__dirname,"diffWorker.js"),hze(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new tXe(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:NTn(o.changes),moves:o.moves.map(c=>new rXe(new ixe(new Ll(c[0],c[1]),new Ll(c[2],c[3])),NTn(c[4])))}}};function NTn(t){return t.map(e=>new nXe(new Ll(e[0],e[1]),new Ll(e[2],e[3]),e[4]?.map(r=>new pO(new Li(r[0],r[1],r[2],r[3]),new Li(r[4],r[5],r[6],r[7])))))}a(NTn,"toLineRangeMappings");function lKo(t){for(let e of t)if((0,MTn.existsSync)(e))return e}a(lKo,"firstExistingPath");var iXe=new Ee("editSurvivalReporter"),XHt=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 nQ;this._editSurvivalTracker=new Xle(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=Xd(this._document.uri),r=this.ctx.get(Px);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){iXe.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=Xd(this._document.uri),n=await this.ctx.get(Px).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 iXe.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 Nc(`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 eXe(r,n,e.get(Hx)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var oXe=class extends XHt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Zle(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new cze(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{iXe.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 Xle(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Zle(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Xle(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Zle(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw iXe.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var OTn=new Ee("editSurvivalTrackerService"),wk=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n){OTn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let o;return{startReporter:a(s=>{(async()=>{try{let c=await eXe(r,n,this.ctx.get(Hx));o=new oXe(this.ctx,e,r,n,c,s,[0,30*1e3,120*1e3,300*1e3,600*1e3])}catch(c){OTn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Vu(c)}`,c)}})()},"startReporter"),cancel:a(()=>{o?.cancel()},"cancel")}}};var uKo=1e3,BTn=256e3,LTn=64e3;function dKo(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(dKo,"makeProxyInstantApplyModelConfiguration");var fKo=8e3,FTn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},pKo={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},sXe=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new Ee("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new eE("No uri found in code block");if(o.isCancellationRequested)throw new $Ze;e.code.includes(CA)||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 eE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(CA))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(Ut).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: ${Vu(g)}`),gi(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(oq).instantApplyModels[0]?.name??"unknown":"default"}),Gt(this.ctx,Je.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=Ds("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 eE("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(wk),E=xK(),_=[],v=0,b=0,T=f.length+e.code.length+uKo;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(ec).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 eE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await Jf.create(Yle,{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:gA(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 eE(D)}}else{if(x.type==="canceled")throw new Dc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new eE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",Yle,e,r,n,o,s,c,l,u,d=>hKo(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",VZe,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=STn(d);if(h.patches.length===0)throw new eE(`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=xTn(f,h.patches);if(m===void 0)throw new eE(`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 eE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await Jo.getModelConfiguration(this.ctx,void 0,Tn.Gpt41,void 0,void 0);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 Jf.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(wk),b=await this.ctx.get(Ut).getToken(),T=await this.ctx.get(Jt).updateExPValuesAndAssignments(b),w=xK(),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(ec).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 eE(`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:gA(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 Dc;{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 eE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>BTn)throw new eE(`Document too large: ${l} characters (limit: ${BTn})`);let u=this.ctx.get(oq).instantApplyModels[0],d=u?dKo(u.name):void 0,h=await Jf.create(Yle,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??FTn).renderPrompt(void 0,n),m=h.tokenCount;if(m>LTn)throw new eE(`Prompt too large: ${m} tokens (limit: ${LTn})`);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=Rn(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 _es(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(_es,"extractCodeBlock");var KXe=class extends hu{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 hKo(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(hKo,"extractCodeBlock");var aXe=class extends pu{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... @@ -3418,9 +3374,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 Or([new wr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=Ju(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new YXe(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(us).getToolByNameAndProvider("insert_edit_into_file",$f);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(us).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=DM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await Jc(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=hO(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 gO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Or([new wr(u.join(` -`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Dmn(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=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${yA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Md),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=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${yA(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 Sxn=require("crypto"),xO=ce(require("fs/promises")),Txn=require("os"),IO=ce(require("path"));var F3=class{constructor(e){this.ctx=e;this.logger=new ge("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=IO.extname(__filename)===".ts"?IO.resolve(__dirname,"../../../packages/ripgrep/bin"):IO.resolve(__dirname,"./bin"),c=IO.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 xO.readFile(c),u=(0,Sxn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||IO.join((0,Txn.homedir)(),".cache"),f=IO.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await xO.mkdir(f,{recursive:!0});let h=ji(Ia(c)),m=IO.join(f,h);try{await xO.stat(m)}catch{await xO.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await xO.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 Ixn=require("child_process"),s$t=require("perf_hooks");var U3=new ge("ripgrepProcessManager"),Q3=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,U3.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){U3.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){U3.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){U3.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){U3.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}U3.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:VK(),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(` -`);U3.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=s$t.performance.now();U3.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,Ixn.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=s$t.performance.now()-r;U3.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 JXe(t){return t.some(e=>!aa.isRegisteredScheme(To(e.uri).scheme))}a(JXe,"hasRipgrepWorkspaceFolder");async function ZXe(t,e){try{return{rgPath:await t.ctx.get(F3).resolvePath(),ripgrepManager:t.ctx.get(Q3)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(ZXe,"resolveRipgrepResources");var xxn=new ge("findFilesTool"),XXe=class t extends hu{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 Or([new wr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=Ju(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new sXe(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(cs).getToolByNameAndProvider("insert_edit_into_file",Vf);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(cs).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=bM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await Yc(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=rO(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 iO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Or([new wr(u.join(` +`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){s0n(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=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${vA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Dd),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=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${vA(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 UTn=require("crypto"),mO=he(require("fs/promises")),QTn=require("os"),hO=he(require("path"));var S3=class{constructor(e){this.ctx=e;this.logger=new Ee("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=hO.extname(__filename)===".ts"?hO.resolve(__dirname,"../../../packages/ripgrep/bin"):hO.resolve(__dirname,"./bin"),c=hO.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 mO.readFile(c),u=(0,UTn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||hO.join((0,QTn.homedir)(),".cache"),f=hO.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await mO.mkdir(f,{recursive:!0});let h=Ki(ba(c)),m=hO.join(f,h);try{await mO.stat(m)}catch{await mO.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await mO.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 qTn=require("child_process"),eGt=require("perf_hooks");var T3=new Ee("ripgrepProcessManager"),I3=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,T3.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){T3.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){T3.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){T3.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){T3.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}T3.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:xK(),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(` +`);T3.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=eGt.performance.now();T3.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,qTn.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=eGt.performance.now()-r;T3.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 cXe(t){return t.some(e=>!na.isRegisteredScheme(po(e.uri).scheme))}a(cXe,"hasRipgrepWorkspaceFolder");async function lXe(t,e){try{return{rgPath:await t.ctx.get(S3).resolvePath(),ripgrepManager:t.ctx.get(I3)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(lXe,"resolveRipgrepResources");var jTn=new Ee("findFilesTool"),uXe=class t extends pu{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 @@ -3436,12 +3392,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 Or([new wr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(JXe(c)){if(n.isCancellationRequested)return new Or([new wr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await ZXe(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{xxn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),aa.isRegisteredScheme(To(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),xxn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` -`)}`)}catch(E){if(E instanceof $y){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 Or([new wr(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 Or([new wr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(cXe(c)){if(n.isCancellationRequested)return new Or([new wr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await lXe(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{jTn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),na.isRegisteredScheme(po(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),jTn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` +`)}`)}catch(E){if(E instanceof W0){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 Or([new wr(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 Or([new wr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(aa).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:Wn(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${Wn(xa(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 wxn=new ge("findTextInFilesTool"),eet=class t extends hu{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 Or([new wr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(na).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:Wn(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${Wn(Sa(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 HTn=new Ee("findTextInFilesTool"),dXe=class t extends pu{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) @@ -3454,13 +3410,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 Or([new wr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(JXe(u)){if(n.isCancellationRequested)return new Or([new wr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await ZXe(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{wxn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),aa.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),wxn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` -`)}`)}catch(v){if(v instanceof $y){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 Or([new wr(_)],"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 Or([new wr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(cXe(u)){if(n.isCancellationRequested)return new Or([new wr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await lXe(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{HTn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),na.isRegisteredScheme(po(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),HTn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` +`)}`)}catch(v){if(v instanceof W0){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 Or([new wr(_)],"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 Or([new wr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(aa).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",Wn(n.uri)];return(await e.execute(r,u,l,{cwd:Wn(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 ret=ce(require("path"));var tet=class extends hu{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=Ju(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Or([new wr("Error: Path is outside of workspace folders")],"error");let u=await vZe(e.ctx,l.toString());return u.length===0?new Or([new wr("Folder is empty")],"success"):new Or([new wr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` -`))],"success")}prepareInvocation(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${yA(n)}`}}prepareCompletion(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${yA(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=ho(e),o=ho(r);if(!n||!o)return!1;let s=ret.relative(o,n);return s===""?!0:!s.startsWith("..")&&!ret.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var net=2e3,iet=class t extends hu{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 Or([new wr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(na).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",Wn(n.uri)];return(await e.execute(r,u,l,{cwd:Wn(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 pXe=he(require("path"));var fXe=class extends pu{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=Ju(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Or([new wr("Error: Path is outside of workspace folders")],"error");let u=await NJe(e.ctx,l.toString());return u.length===0?new Or([new wr("Folder is empty")],"success"):new Or([new wr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` +`))],"success")}prepareInvocation(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${vA(n)}`}}prepareCompletion(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${vA(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=Yo(e),o=Yo(r);if(!n||!o)return!1;let s=pXe.relative(o,n);return s===""?!0:!s.startsWith("..")&&!pXe.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var hXe=2e3,mXe=class t extends pu{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 @@ -3471,33 +3427,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??net),net),u=Math.max(1,s??1),d=u+l-1,f=Ju(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(Jn).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Or([new wr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Or([new wr(`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 Oxe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},oet=class extends Oxe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},set=class extends Oxe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},aet=class extends Oxe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Ces(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Ces,"escapeRegex");function ves(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(ves,"calculateSimilarity");function a$t(t,e,r,n){let o=r.replace(/\r\n/g,` -`).replace(/\n/g,n),s=bes(t,e,o);if(s.type!=="none")return s;let c=Ses(t,e,o,n);if(c.type!=="none")return c;let l=Tes(t,e,o,n);if(l.type!=="none")return l;let u=Ies(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(a$t,"findAndReplaceOne");function bes(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(bes,"tryExactMatch");function Ses(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(Ses,"tryWhitespaceFlexibleMatch");function Tes(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??hXe),hXe),u=Math.max(1,s??1),d=u+l-1,f=Ju(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 Or([new wr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Or([new wr(`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 oxe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},gXe=class extends oxe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},AXe=class extends oxe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},yXe=class extends oxe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function mKo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(mKo,"escapeRegex");function gKo(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(gKo,"calculateSimilarity");function tGt(t,e,r,n){let o=r.replace(/\r\n/g,` +`).replace(/\n/g,n),s=AKo(t,e,o);if(s.type!=="none")return s;let c=yKo(t,e,o,n);if(c.type!=="none")return c;let l=EKo(t,e,o,n);if(l.type!=="none")return l;let u=_Ko(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(tGt,"findAndReplaceOne");function AKo(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(AKo,"tryExactMatch");function yKo(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(yKo,"tryWhitespaceFlexibleMatch");function EKo(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=Ces(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(Tes,"tryFuzzyMatch");function Ies(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(Ies,"trySimilarityMatch");var Rxn=new ge("replaceStringTool"),cet=class extends hu{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{Rxn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=Ju(o,e.uriSchemeCache);if(s===c)throw new aet("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=mKo(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(EKo,"tryFuzzyMatch");function _Ko(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(_Ko,"trySimilarityMatch");var GTn=new Ee("replaceStringTool"),EXe=class extends pu{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{GTn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=Ju(o,e.uriSchemeCache);if(s===c)throw new yXe("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r `)?`\r `:` -`,f=a$t(u,s,c,d);if(f.type==="none"&&s.endsWith(` +`,f=tGt(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)&&(Rxn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=a$t(u,g,c,d))}if(f.type==="none")throw new oet(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new set(`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 Or([new wr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(Jn).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(us).getToolByNameAndProvider("insert_edit_into_file",$f);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(us).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 Or([new wr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${yA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Md),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=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${yA(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 det=ce(DL());var Xf=new ge("validateCvesTool"),uet=class t extends hu{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(WUt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return Xf.debug(e.ctx,"CVE validation cancelled at start"),new Or([new wr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return Xf.debug(e.ctx,"No dependencies provided to validate"),new Or([new wr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(Xf.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return Xf.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Or([new wr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(Xf.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");Xf.debug(e.ctx,`CVE summary: ${u}`)}return new Or([new wr(l)],"success")}catch(c){if(tP(c))return Xf.debug(e.ctx,"CVE validation cancelled"),new Or([new wr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return Xf.exception(e.ctx,c,".invoke"),new Or([new wr(`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){Xf.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 Xf.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw Xf.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){Xf.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),Xf.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=det.coerce(m);if(!g){f.push(h.id),Xf.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}Xf.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||det.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return Xf.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}): ${GGt(f.summary)} +`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(GTn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=tGt(u,g,c,d))}if(f.type==="none")throw new gXe(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new AXe(`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 Or([new wr(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(cs).getToolByNameAndProvider("insert_edit_into_file",Vf);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(cs).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 Or([new wr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${vA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Dd),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=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${vA(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 vXe=he(_L());var ep=new Ee("validateCvesTool"),_Xe=class t extends pu{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(X9t,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return ep.debug(e.ctx,"CVE validation cancelled at start"),new Or([new wr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return ep.debug(e.ctx,"No dependencies provided to validate"),new Or([new wr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(ep.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return ep.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Or([new wr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(ep.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");ep.debug(e.ctx,`CVE summary: ${u}`)}return new Or([new wr(l)],"success")}catch(c){if(zP(c))return ep.debug(e.ctx,"CVE validation cancelled"),new Or([new wr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return ep.exception(e.ctx,c,".invoke"),new Or([new wr(`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){ep.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 ep.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw ep.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){ep.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),ep.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=vXe.coerce(m);if(!g){f.push(h.id),ep.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}ep.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||vXe.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return ep.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}): ${FHt(f.summary)} `;return h+=` - **Severity**: **${f.severity.toUpperCase()}** -`,h+=` - **Details**: ${GGt(f.description)}`,h}).join(` +`,h+=` - **Details**: ${FHt(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 xes(t){return[new tet,new iet,new KXe,new cet,new PXe,new DXe,new XXe,new eet,new uet]}a(xes,"getAllClsTools");function kxn(t,e){xes(t).forEach(e.registerTool.bind(e)),t.get(Mn).onDidSetCapabilities(r=>{t.get(uu).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new Aue):r.subAgent?e.registerTool(new Aue):e.unregisterTool(new Aue),r.manageTodoListTool?e.registerTool(new AO(t)):e.unregisterTool(new AO(t)),r.watchedFiles?e.registerTool(new xxe):e.unregisterTool(new xxe)})}a(kxn,"registerAllClsTools");var us=class{constructor(e){this.ctx=e;this._toolRegistry=new CWe;kxn(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 Mc;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 Or([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Mc;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=>pTn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>hTn.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(Ym.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(Ym.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(Ym.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(Ym.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get($f.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get($f.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(Ym.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(Ym.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get($f.id)?.find(m=>m.name==="create_file");if(c){let m=e.get($f.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(Ym.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(Ym.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($f.id)??[],f=e.get(Ym.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==Ym.id&&m!==$f.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(jp);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(!NTe(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===Ym.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===$f.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===Ym.id||o.toolProvider.id===$f.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===Ym.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===$f.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(NTe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===$f.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===Ym.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Ym.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 Sq=class extends fQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:$f,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(v_).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 Mc;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(Md).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var P={};wi(P,{$brand:()=>c$t,$input:()=>izt,$output:()=>nzt,NEVER:()=>Lxe,TimePrecision:()=>azt,ZodAny:()=>cwn,ZodArray:()=>fwn,ZodBase64:()=>AYt,ZodBase64URL:()=>yYt,ZodBigInt:()=>bwe,ZodBigIntFormat:()=>CYt,ZodBoolean:()=>vwe,ZodCIDRv4:()=>mYt,ZodCIDRv6:()=>gYt,ZodCUID:()=>cYt,ZodCUID2:()=>lYt,ZodCatch:()=>xwn,ZodCustom:()=>att,ZodCustomStringFormat:()=>iwn,ZodDate:()=>itt,ZodDefault:()=>Cwn,ZodDiscriminatedUnion:()=>pwn,ZodE164:()=>EYt,ZodEmail:()=>nYt,ZodEmoji:()=>sYt,ZodEnum:()=>Ewe,ZodError:()=>frs,ZodFile:()=>Ewn,ZodGUID:()=>Xet,ZodIPv4:()=>pYt,ZodIPv6:()=>hYt,ZodISODate:()=>Ket,ZodISODateTime:()=>Yet,ZodISODuration:()=>Zet,ZodISOTime:()=>Jet,ZodIntersection:()=>hwn,ZodIssueCode:()=>PYt,ZodJWT:()=>_Yt,ZodKSUID:()=>fYt,ZodLazy:()=>Nwn,ZodLiteral:()=>ywn,ZodMap:()=>gwn,ZodNaN:()=>Rwn,ZodNanoID:()=>aYt,ZodNever:()=>uwn,ZodNonOptional:()=>wYt,ZodNull:()=>awn,ZodNullable:()=>_wn,ZodNumber:()=>Cwe,ZodNumberFormat:()=>Lue,ZodObject:()=>ott,ZodOptional:()=>xYt,ZodPipe:()=>RYt,ZodPrefault:()=>bwn,ZodPromise:()=>Own,ZodReadonly:()=>kwn,ZodRealError:()=>Bue,ZodRecord:()=>SYt,ZodSet:()=>Awn,ZodString:()=>_we,ZodStringFormat:()=>mu,ZodSuccess:()=>Iwn,ZodSymbol:()=>own,ZodTemplateLiteral:()=>Dwn,ZodTransform:()=>TYt,ZodTuple:()=>mwn,ZodType:()=>Is,ZodULID:()=>uYt,ZodURL:()=>iYt,ZodUUID:()=>V3,ZodUndefined:()=>swn,ZodUnion:()=>bYt,ZodUnknown:()=>lwn,ZodVoid:()=>dwn,ZodXID:()=>dYt,_ZodString:()=>rYt,_default:()=>vwn,any:()=>vYt,array:()=>Fr,base64:()=>Prs,base64url:()=>Drs,bigint:()=>Qrs,boolean:()=>tl,catch:()=>wwn,check:()=>Bwn,cidrv4:()=>Rrs,cidrv6:()=>krs,clone:()=>HS,coerce:()=>Twe,config:()=>zh,core:()=>$3,cuid:()=>vrs,cuid2:()=>brs,custom:()=>kYt,date:()=>Vrs,discriminatedUnion:()=>stt,e164:()=>Nrs,email:()=>hrs,emoji:()=>_rs,endsWith:()=>dwe,enum:()=>Q_,file:()=>ens,flattenError:()=>Vxe,float32:()=>Brs,float64:()=>Lrs,formatError:()=>Wxe,function:()=>$zt,getErrorMap:()=>uns,globalRegistry:()=>RO,gt:()=>H3,gte:()=>jv,guid:()=>mrs,includes:()=>lwe,instanceof:()=>sns,int:()=>tYt,int32:()=>Frs,int64:()=>qrs,intersection:()=>Swe,ipv4:()=>xrs,ipv6:()=>wrs,iso:()=>Oue,json:()=>cns,jwt:()=>Mrs,keyof:()=>Wrs,ksuid:()=>Irs,lazy:()=>Mwn,length:()=>Mue,literal:()=>Hn,locales:()=>nwe,looseObject:()=>Yh,lowercase:()=>awe,lt:()=>j3,lte:()=>Jx,map:()=>Jrs,maxLength:()=>Nue,maxSize:()=>Due,mime:()=>fwe,minLength:()=>Iq,minSize:()=>tJ,multipleOf:()=>eJ,nan:()=>nns,nanoid:()=>Crs,nativeEnum:()=>Xrs,negative:()=>Ozt,never:()=>ntt,nonnegative:()=>Lzt,nonoptional:()=>Twn,nonpositive:()=>Bzt,normalize:()=>pwe,null:()=>rtt,nullable:()=>ett,nullish:()=>tns,number:()=>Ra,object:()=>Wr,optional:()=>gu,overwrite:()=>G3,parse:()=>Jzt,parseAsync:()=>Zzt,partialRecord:()=>Krs,pipe:()=>ttt,positive:()=>Mzt,prefault:()=>Swn,preprocess:()=>ctt,prettifyError:()=>C$t,promise:()=>ons,property:()=>Fzt,readonly:()=>Pwn,record:()=>vl,refine:()=>Lwn,regex:()=>swe,regexes:()=>JK,registry:()=>Iet,safeParse:()=>Xzt,safeParseAsync:()=>eYt,set:()=>Zrs,setErrorMap:()=>lns,size:()=>owe,startsWith:()=>uwe,strictObject:()=>zrs,string:()=>qe,stringFormat:()=>Ors,stringbool:()=>ans,success:()=>rns,superRefine:()=>Fwn,symbol:()=>Hrs,templateLiteral:()=>ins,toJSONSchema:()=>Vzt,toLowerCase:()=>mwe,toUpperCase:()=>gwe,transform:()=>IYt,treeifyError:()=>_$t,trim:()=>hwe,tuple:()=>Yrs,uint32:()=>Urs,uint64:()=>jrs,ulid:()=>Srs,undefined:()=>Grs,union:()=>Cl,unknown:()=>Zu,uppercase:()=>cwe,url:()=>oYt,uuid:()=>grs,uuidv4:()=>Ars,uuidv6:()=>yrs,uuidv7:()=>Ers,void:()=>$rs,xid:()=>Trs});p();var $3={};wi($3,{$ZodAny:()=>WVt,$ZodArray:()=>Xxe,$ZodAsyncError:()=>wO,$ZodBase64:()=>LVt,$ZodBase64URL:()=>FVt,$ZodBigInt:()=>bet,$ZodBigIntFormat:()=>HVt,$ZodBoolean:()=>Zxe,$ZodCIDRv4:()=>MVt,$ZodCIDRv6:()=>OVt,$ZodCUID:()=>bVt,$ZodCUID2:()=>SVt,$ZodCatch:()=>fWt,$ZodCheck:()=>mf,$ZodCheckBigIntFormat:()=>X$t,$ZodCheckEndsWith:()=>dVt,$ZodCheckGreaterThan:()=>Eet,$ZodCheckIncludes:()=>lVt,$ZodCheckLengthEquals:()=>oVt,$ZodCheckLessThan:()=>yet,$ZodCheckLowerCase:()=>aVt,$ZodCheckMaxLength:()=>nVt,$ZodCheckMaxSize:()=>eVt,$ZodCheckMimeType:()=>pVt,$ZodCheckMinLength:()=>iVt,$ZodCheckMinSize:()=>tVt,$ZodCheckMultipleOf:()=>J$t,$ZodCheckNumberFormat:()=>Z$t,$ZodCheckOverwrite:()=>hVt,$ZodCheckProperty:()=>fVt,$ZodCheckRegex:()=>sVt,$ZodCheckSizeEquals:()=>rVt,$ZodCheckStartsWith:()=>uVt,$ZodCheckStringFormat:()=>wue,$ZodCheckUpperCase:()=>cVt,$ZodCustom:()=>yWt,$ZodCustomStringFormat:()=>qVt,$ZodDate:()=>KVt,$ZodDefault:()=>cWt,$ZodDiscriminatedUnion:()=>ZVt,$ZodE164:()=>UVt,$ZodEmail:()=>EVt,$ZodEmoji:()=>CVt,$ZodEnum:()=>nWt,$ZodError:()=>$xe,$ZodFile:()=>oWt,$ZodFunction:()=>zet,$ZodGUID:()=>AVt,$ZodIPv4:()=>DVt,$ZodIPv6:()=>NVt,$ZodISODate:()=>RVt,$ZodISODateTime:()=>wVt,$ZodISODuration:()=>PVt,$ZodISOTime:()=>kVt,$ZodIntersection:()=>XVt,$ZodJWT:()=>QVt,$ZodKSUID:()=>xVt,$ZodLazy:()=>AWt,$ZodLiteral:()=>iWt,$ZodMap:()=>tWt,$ZodNaN:()=>pWt,$ZodNanoID:()=>vVt,$ZodNever:()=>zVt,$ZodNonOptional:()=>uWt,$ZodNull:()=>VVt,$ZodNullable:()=>aWt,$ZodNumber:()=>vet,$ZodNumberFormat:()=>jVt,$ZodObject:()=>JVt,$ZodOptional:()=>sWt,$ZodPipe:()=>twe,$ZodPrefault:()=>lWt,$ZodPromise:()=>gWt,$ZodReadonly:()=>hWt,$ZodRealError:()=>Iue,$ZodRecord:()=>eWt,$ZodRegistry:()=>kue,$ZodSet:()=>rWt,$ZodString:()=>ZK,$ZodStringFormat:()=>ql,$ZodSuccess:()=>dWt,$ZodSymbol:()=>GVt,$ZodTemplateLiteral:()=>mWt,$ZodTransform:()=>ewe,$ZodTuple:()=>XK,$ZodType:()=>uo,$ZodULID:()=>TVt,$ZodURL:()=>_Vt,$ZodUUID:()=>yVt,$ZodUndefined:()=>$Vt,$ZodUnion:()=>Tet,$ZodUnknown:()=>Rue,$ZodVoid:()=>YVt,$ZodXID:()=>IVt,$brand:()=>c$t,$constructor:()=>it,$input:()=>izt,$output:()=>nzt,Doc:()=>Jxe,JSONSchema:()=>twn,JSONSchemaGenerator:()=>ywe,NEVER:()=>Lxe,TimePrecision:()=>azt,_any:()=>wzt,_array:()=>Awe,_base64:()=>Get,_base64url:()=>$et,_bigint:()=>Czt,_boolean:()=>Ezt,_catch:()=>ors,_cidrv4:()=>jet,_cidrv6:()=>Het,_coercedBigint:()=>vzt,_coercedBoolean:()=>_zt,_coercedDate:()=>Dzt,_coercedNumber:()=>pzt,_coercedString:()=>szt,_cuid:()=>Oet,_cuid2:()=>Bet,_custom:()=>qzt,_date:()=>Pzt,_default:()=>rrs,_discriminatedUnion:()=>$ts,_e164:()=>Vet,_email:()=>xet,_emoji:()=>Net,_endsWith:()=>dwe,_enum:()=>Kts,_file:()=>Qzt,_float32:()=>mzt,_float64:()=>gzt,_gt:()=>H3,_gte:()=>jv,_guid:()=>iwe,_includes:()=>lwe,_int:()=>hzt,_int32:()=>Azt,_int64:()=>bzt,_intersection:()=>Vts,_ipv4:()=>Qet,_ipv6:()=>qet,_isoDate:()=>lzt,_isoDateTime:()=>czt,_isoDuration:()=>dzt,_isoTime:()=>uzt,_jwt:()=>Wet,_ksuid:()=>Uet,_lazy:()=>lrs,_length:()=>Mue,_literal:()=>Zts,_lowercase:()=>awe,_lt:()=>j3,_lte:()=>Jx,_map:()=>zts,_max:()=>Jx,_maxLength:()=>Nue,_maxSize:()=>Due,_mime:()=>fwe,_min:()=>jv,_minLength:()=>Iq,_minSize:()=>tJ,_multipleOf:()=>eJ,_nan:()=>Nzt,_nanoid:()=>Met,_nativeEnum:()=>Jts,_negative:()=>Ozt,_never:()=>Rzt,_nonnegative:()=>Lzt,_nonoptional:()=>nrs,_nonpositive:()=>Bzt,_normalize:()=>pwe,_null:()=>xzt,_nullable:()=>trs,_number:()=>fzt,_optional:()=>ers,_overwrite:()=>G3,_parse:()=>pet,_parseAsync:()=>het,_pipe:()=>srs,_positive:()=>Mzt,_promise:()=>urs,_property:()=>Fzt,_readonly:()=>ars,_record:()=>Wts,_refine:()=>jzt,_regex:()=>swe,_safeParse:()=>met,_safeParseAsync:()=>get,_set:()=>Yts,_size:()=>owe,_startsWith:()=>uwe,_string:()=>ozt,_stringFormat:()=>Gzt,_stringbool:()=>Hzt,_success:()=>irs,_symbol:()=>Tzt,_templateLiteral:()=>crs,_toLowerCase:()=>mwe,_toUpperCase:()=>gwe,_transform:()=>Xts,_trim:()=>hwe,_tuple:()=>Uzt,_uint32:()=>yzt,_uint64:()=>Szt,_ulid:()=>Let,_undefined:()=>Izt,_union:()=>Gts,_unknown:()=>Pue,_uppercase:()=>cwe,_url:()=>Det,_uuid:()=>wet,_uuidv4:()=>Ret,_uuidv6:()=>ket,_uuidv7:()=>Pet,_void:()=>kzt,_xid:()=>Fet,clone:()=>HS,config:()=>zh,flattenError:()=>Vxe,formatError:()=>Wxe,function:()=>$zt,globalConfig:()=>Bxe,globalRegistry:()=>RO,isValidBase64:()=>BVt,isValidBase64URL:()=>Kxn,isValidJWT:()=>Jxn,locales:()=>nwe,parse:()=>zxe,parseAsync:()=>Yxe,prettifyError:()=>C$t,regexes:()=>JK,registry:()=>Iet,safeParse:()=>xue,safeParseAsync:()=>Kxe,toDotPath:()=>Dxn,toJSONSchema:()=>Vzt,treeifyError:()=>_$t,util:()=>qr,version:()=>mVt});p();p();var Lxe=Object.freeze({status:"aborted"});function it(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(it,"$constructor");var c$t=Symbol("zod_brand"),wO=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Bxe={};function zh(t){return t&&Object.assign(Bxe,t),Bxe}a(zh,"config");p();p();var qr={};wi(qr,{BIGINT_FORMAT_RANGES:()=>y$t,Class:()=>u$t,NUMBER_FORMAT_RANGES:()=>A$t,aborted:()=>YK,allowsEval:()=>h$t,assert:()=>Des,assertEqual:()=>wes,assertIs:()=>kes,assertNever:()=>Pes,assertNotEqual:()=>Res,assignProp:()=>p$t,cached:()=>Qxe,captureStackTrace:()=>fet,cleanEnum:()=>$es,cleanRegex:()=>qxe,clone:()=>HS,createTransparentProxy:()=>Fes,defineLazy:()=>Tc,esc:()=>zK,escapeRegex:()=>q3,extend:()=>qes,finalizeIssue:()=>GS,floatSafeRemainder:()=>f$t,getElementAtPath:()=>Nes,getEnumValues:()=>Uxe,getLengthableOrigin:()=>Gxe,getParsedType:()=>Les,getSizableOrigin:()=>Hxe,isObject:()=>Sue,isPlainObject:()=>Tue,issue:()=>E$t,joinValues:()=>Ft,jsonStringifyReplacer:()=>d$t,merge:()=>jes,normalizeParams:()=>Tr,nullish:()=>Tq,numKeys:()=>Bes,omit:()=>Qes,optionalKeys:()=>g$t,partial:()=>Hes,pick:()=>Ues,prefixIssues:()=>qv,primitiveTypes:()=>m$t,promiseAllObject:()=>Mes,propertyKeyTypes:()=>jxe,randomString:()=>Oes,required:()=>Ges,stringifyPrimitive:()=>Qr,unwrapMessage:()=>Fxe});p();function wes(t){return t}a(wes,"assertEqual");function Res(t){return t}a(Res,"assertNotEqual");function kes(t){}a(kes,"assertIs");function Pes(t){throw new Error}a(Pes,"assertNever");function Des(t){}a(Des,"assert");function Uxe(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(Uxe,"getEnumValues");function Ft(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(Ft,"joinValues");function d$t(t,e){return typeof e=="bigint"?e.toString():e}a(d$t,"jsonStringifyReplacer");function Qxe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Qxe,"cached");function Tq(t){return t==null}a(Tq,"nullish");function qxe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(qxe,"cleanRegex");function f$t(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(f$t,"floatSafeRemainder");function Tc(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(Tc,"defineLazy");function p$t(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(p$t,"assignProp");function Nes(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(Nes,"getElementAtPath");function Mes(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 Sue(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Sue,"isObject");var h$t=Qxe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Tue(t){if(Sue(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(Sue(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Tue,"isPlainObject");function Bes(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Bes,"numKeys");var Les=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"),jxe=new Set(["string","number","symbol"]),m$t=new Set(["string","number","bigint","boolean","symbol","undefined"]);function q3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(q3,"escapeRegex");function HS(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(HS,"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 Fes(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(Fes,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function g$t(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(g$t,"optionalKeys");var A$t={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]},y$t={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ues(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 HS(t,{...t._zod.def,shape:r,checks:[]})}a(Ues,"pick");function Qes(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 HS(t,{...t._zod.def,shape:r,checks:[]})}a(Qes,"omit");function qes(t,e){if(!Tue(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 p$t(this,"shape",n),n},checks:[]};return HS(t,r)}a(qes,"extend");function jes(t,e){return HS(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return p$t(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(jes,"merge");function Hes(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 HS(e,{...e._zod.def,shape:o,checks:[]})}a(Hes,"partial");function Ges(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 HS(e,{...e._zod.def,shape:o,checks:[]})}a(Ges,"required");function YK(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(qv,"prefixIssues");function Fxe(t){return typeof t=="string"?t:t?.message}a(Fxe,"unwrapMessage");function GS(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Fxe(t.inst?._zod.def?.error?.(t))??Fxe(e?.error?.(t))??Fxe(r.customError?.(t))??Fxe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(GS,"finalizeIssue");function Hxe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(Hxe,"getSizableOrigin");function Gxe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Gxe,"getLengthableOrigin");function E$t(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(E$t,"issue");function $es(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a($es,"cleanEnum");var u$t=class{static{a(this,"Class")}constructor(...e){}};var Pxn=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,d$t,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),$xe=it("$ZodError",Pxn),Iue=it("$ZodError",Pxn,{Parent:Error});function Vxe(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(Vxe,"flattenError");function Wxe(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 ${Dxn(n.path)}`);return e.join(` -`)}a(C$t,"prettifyError");var pet=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 wO;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>GS(u,s,zh())));throw fet(l,o?.callee),l}return c.value},"_parse"),zxe=pet(Iue),het=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=>GS(u,s,zh())));throw fet(l,o?.callee),l}return c.value},"_parseAsync"),Yxe=het(Iue),met=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 wO;return s.issues.length?{success:!1,error:new(t??$xe)(s.issues.map(c=>GS(c,o,zh())))}:{success:!0,data:s.value}},"_safeParse"),xue=met(Iue),get=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=>GS(c,o,zh())))}:{success:!0,data:s.value}},"_safeParseAsync"),Kxe=get(Iue);p();p();var JK={};wi(JK,{_emoji:()=>Nxn,base64:()=>B$t,base64url:()=>Aet,bigint:()=>H$t,boolean:()=>V$t,browserEmail:()=>ets,cidrv4:()=>M$t,cidrv6:()=>O$t,cuid:()=>v$t,cuid2:()=>b$t,date:()=>U$t,datetime:()=>q$t,domain:()=>tts,duration:()=>w$t,e164:()=>F$t,email:()=>k$t,emoji:()=>P$t,extendedDuration:()=>Wes,guid:()=>R$t,hostname:()=>L$t,html5Email:()=>Jes,integer:()=>G$t,ipv4:()=>D$t,ipv6:()=>N$t,ksuid:()=>I$t,lowercase:()=>Y$t,nanoid:()=>x$t,null:()=>W$t,number:()=>$$t,rfc5322Email:()=>Zes,string:()=>j$t,time:()=>Q$t,ulid:()=>S$t,undefined:()=>z$t,unicodeEmail:()=>Xes,uppercase:()=>K$t,uuid:()=>KK,uuid4:()=>zes,uuid6:()=>Yes,uuid7:()=>Kes,xid:()=>T$t});p();var v$t=/^[cC][^\s-]{8,}$/,b$t=/^[0-9a-z]+$/,S$t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,T$t=/^[0-9a-vA-V]{20}$/,I$t=/^[A-Za-z0-9]{27}$/,x$t=/^[a-zA-Z0-9_-]{21}$/,w$t=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Wes=/^[-+]?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)?)??$/,R$t=/^([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})$/,KK=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"),zes=KK(4),Yes=KK(6),Kes=KK(7),k$t=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jes=/^[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])?)*$/,Zes=/^(([^<>()\[\]\\.,;:\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,}))$/,Xes=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ets=/^[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])?)*$/,Nxn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function P$t(){return new RegExp(Nxn,"u")}a(P$t,"emoji");var D$t=/^(?:(?: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])$/,N$t=/^(([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})$/,M$t=/^((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])$/,O$t=/^(([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])$/,B$t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Aet=/^[A-Za-z0-9_-]*$/,L$t=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,tts=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,F$t=/^\+(?:[0-9]){6,14}[0-9]$/,Mxn="(?:(?:\\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])))",U$t=new RegExp(`^${Mxn}$`);function Oxn(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(Oxn,"timeSource");function Q$t(t){return new RegExp(`^${Oxn(t)}$`)}a(Q$t,"time");function q$t(t){let e=Oxn({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(`^${Mxn}T(?:${n})$`)}a(q$t,"datetime");var j$t=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),H$t=/^\d+n?$/,G$t=/^\d+$/,$$t=/^-?\d+(?:\.\d+)?/i,V$t=/true|false/i,W$t=/null/i;var z$t=/undefined/i;var Y$t=/^[^A-Z]*$/,K$t=/^[^a-z]*$/;var mf=it("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Lxn={number:"number",bigint:"bigint",object:"date"},yet=it("$ZodCheckLessThan",(t,e)=>{mf.init(t,e);let r=Lxn[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{mf.init(t,e);let r=Lxn[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})}}),J$t=it("$ZodCheckMultipleOf",(t,e)=>{mf.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):f$t(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})}}),Z$t=it("$ZodCheckNumberFormat",(t,e)=>{mf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=A$t[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=G$t)}),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})}}),X$t=it("$ZodCheckBigIntFormat",(t,e)=>{mf.init(t,e);let[r,n]=y$t[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})}}),eVt=it("$ZodCheckMaxSize",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(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:Hxe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),tVt=it("$ZodCheckMinSize",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(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:Hxe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),rVt=it("$ZodCheckSizeEquals",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(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:Hxe(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})}}),nVt=it("$ZodCheckMaxLength",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(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=Gxe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),iVt=it("$ZodCheckMinLength",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(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=Gxe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),oVt=it("$ZodCheckLengthEquals",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(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=Gxe(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})}}),wue=it("$ZodCheckStringFormat",(t,e)=>{var r,n;mf.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=()=>{})}),sVt=it("$ZodCheckRegex",(t,e)=>{wue.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})}}),aVt=it("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Y$t),wue.init(t,e)}),cVt=it("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=K$t),wue.init(t,e)}),lVt=it("$ZodCheckIncludes",(t,e)=>{mf.init(t,e);let r=q3(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})}}),uVt=it("$ZodCheckStartsWith",(t,e)=>{mf.init(t,e);let r=new RegExp(`^${q3(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})}}),dVt=it("$ZodCheckEndsWith",(t,e)=>{mf.init(t,e);let r=new RegExp(`.*${q3(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 Bxn(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues))}a(Bxn,"handleCheckPropertyResult");var fVt=it("$ZodCheckProperty",(t,e)=>{mf.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=>Bxn(o,r,e.property));Bxn(n,r,e.property)}}),pVt=it("$ZodCheckMimeType",(t,e)=>{mf.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})}}),hVt=it("$ZodCheckOverwrite",(t,e)=>{mf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var Jxe=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 vKo(t){return[new fXe,new mXe,new aXe,new EXe,new jZe,new HZe,new uXe,new dXe,new _Xe]}a(vKo,"getAllClsTools");function $Tn(t,e){vKo(t).forEach(e.registerTool.bind(e)),t.get(Mn).onDidSetCapabilities(r=>{t.get(cu).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new zle):r.subAgent?e.registerTool(new zle):e.unregisterTool(new zle),r.manageTodoListTool?e.registerTool(new oO(t)):e.unregisterTool(new oO(t)),r.watchedFiles?e.registerTool(new JIe):e.unregisterTool(new JIe)})}a($Tn,"registerAllClsTools");var cs=class{constructor(e){this.ctx=e;this._toolRegistry=new jVe;$Tn(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 Dc;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 Or([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Dc;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=>w1n.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>R1n.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(Ym.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(Ym.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(Ym.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(Ym.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(Vf.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(Vf.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(Ym.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(Ym.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(Vf.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(Vf.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(Ym.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(Ym.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(Vf.id)??[],f=e.get(Ym.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==Ym.id&&m!==Vf.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(Hp);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(!oTe(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===Ym.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Vf.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===Ym.id||o.toolProvider.id===Vf.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===Ym.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===Vf.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(oTe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===Vf.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===Ym.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Ym.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 sq=class extends J7{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:Vf,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(E_).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 Dc;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(Dd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};xi(k,{$brand:()=>rGt,$input:()=>ZVt,$output:()=>JVt,NEVER:()=>axe,TimePrecision:()=>tWt,ZodAny:()=>bIn,ZodArray:()=>xIn,ZodBase64:()=>dzt,ZodBase64URL:()=>fzt,ZodBigInt:()=>Wxe,ZodBigIntFormat:()=>mzt,ZodBoolean:()=>Vxe,ZodCIDRv4:()=>lzt,ZodCIDRv6:()=>uzt,ZodCUID:()=>rzt,ZodCUID2:()=>nzt,ZodCatch:()=>jIn,ZodCustom:()=>Aet,ZodCustomStringFormat:()=>EIn,ZodDate:()=>het,ZodDefault:()=>BIn,ZodDiscriminatedUnion:()=>wIn,ZodE164:()=>pzt,ZodEmail:()=>JWt,ZodEmoji:()=>ezt,ZodEnum:()=>Hxe,ZodError:()=>sZo,ZodFile:()=>MIn,ZodGUID:()=>cet,ZodIPv4:()=>azt,ZodIPv6:()=>czt,ZodISODate:()=>oet,ZodISODateTime:()=>iet,ZodISODuration:()=>aet,ZodISOTime:()=>set,ZodIntersection:()=>RIn,ZodIssueCode:()=>Tzt,ZodJWT:()=>hzt,ZodKSUID:()=>szt,ZodLazy:()=>zIn,ZodLiteral:()=>NIn,ZodMap:()=>kIn,ZodNaN:()=>GIn,ZodNanoID:()=>tzt,ZodNever:()=>TIn,ZodNonOptional:()=>Czt,ZodNull:()=>CIn,ZodNullable:()=>OIn,ZodNumber:()=>$xe,ZodNumberFormat:()=>hue,ZodObject:()=>met,ZodOptional:()=>vzt,ZodPipe:()=>bzt,ZodPrefault:()=>FIn,ZodPromise:()=>KIn,ZodReadonly:()=>$In,ZodRealError:()=>pue,ZodRecord:()=>yzt,ZodSet:()=>DIn,ZodString:()=>Gxe,ZodStringFormat:()=>hu,ZodSuccess:()=>qIn,ZodSymbol:()=>_In,ZodTemplateLiteral:()=>WIn,ZodTransform:()=>Ezt,ZodTuple:()=>PIn,ZodType:()=>bs,ZodULID:()=>izt,ZodURL:()=>ZWt,ZodUUID:()=>D3,ZodUndefined:()=>vIn,ZodUnion:()=>Azt,ZodUnknown:()=>SIn,ZodVoid:()=>IIn,ZodXID:()=>ozt,_ZodString:()=>KWt,_default:()=>LIn,any:()=>gzt,array:()=>Ur,base64:()=>TZo,base64url:()=>IZo,bigint:()=>MZo,boolean:()=>Xc,catch:()=>HIn,check:()=>JIn,cidrv4:()=>bZo,cidrv6:()=>SZo,clone:()=>BS,coerce:()=>Yxe,config:()=>zh,core:()=>k3,cuid:()=>gZo,cuid2:()=>AZo,custom:()=>Szt,date:()=>QZo,discriminatedUnion:()=>get,e164:()=>xZo,email:()=>cZo,emoji:()=>hZo,endsWith:()=>Oxe,enum:()=>L_,file:()=>zZo,flattenError:()=>gxe,float32:()=>PZo,float64:()=>kZo,formatError:()=>Axe,function:()=>UWt,getErrorMap:()=>iXo,globalRegistry:()=>AO,gt:()=>R3,gte:()=>BC,guid:()=>lZo,includes:()=>Nxe,instanceof:()=>eXo,int:()=>YWt,int32:()=>DZo,int64:()=>OZo,intersection:()=>zxe,ipv4:()=>vZo,ipv6:()=>CZo,iso:()=>fue,json:()=>rXo,jwt:()=>wZo,keyof:()=>qZo,ksuid:()=>_Zo,lazy:()=>YIn,length:()=>due,literal:()=>Hn,locales:()=>xxe,looseObject:()=>Yh,lowercase:()=>kxe,lt:()=>w3,lte:()=>Gx,map:()=>$Zo,maxLength:()=>uue,maxSize:()=>lue,mime:()=>Bxe,minLength:()=>cq,minSize:()=>BK,multipleOf:()=>OK,nan:()=>JZo,nanoid:()=>mZo,nativeEnum:()=>WZo,negative:()=>RWt,never:()=>pet,nonnegative:()=>kWt,nonoptional:()=>QIn,nonpositive:()=>PWt,normalize:()=>Lxe,null:()=>fet,nullable:()=>uet,nullish:()=>YZo,number:()=>Ia,object:()=>Wr,optional:()=>mu,overwrite:()=>P3,parse:()=>$Wt,parseAsync:()=>VWt,partialRecord:()=>GZo,pipe:()=>det,positive:()=>wWt,prefault:()=>UIn,preprocess:()=>yet,prettifyError:()=>mGt,promise:()=>XZo,property:()=>DWt,readonly:()=>VIn,record:()=>_l,refine:()=>ZIn,regex:()=>Pxe,regexes:()=>DK,registry:()=>OXe,safeParse:()=>WWt,safeParseAsync:()=>zWt,set:()=>VZo,setErrorMap:()=>nXo,size:()=>Rxe,startsWith:()=>Mxe,strictObject:()=>jZo,string:()=>Ke,stringFormat:()=>RZo,stringbool:()=>tXo,success:()=>KZo,superRefine:()=>XIn,symbol:()=>LZo,templateLiteral:()=>ZZo,toJSONSchema:()=>QWt,toLowerCase:()=>Uxe,toUpperCase:()=>Qxe,transform:()=>_zt,treeifyError:()=>hGt,trim:()=>Fxe,tuple:()=>HZo,uint32:()=>NZo,uint64:()=>BZo,ulid:()=>yZo,undefined:()=>FZo,union:()=>El,unknown:()=>Zu,uppercase:()=>Dxe,url:()=>XWt,uuid:()=>uZo,uuidv4:()=>dZo,uuidv6:()=>fZo,uuidv7:()=>pZo,void:()=>UZo,xid:()=>EZo});p();var k3={};xi(k3,{$ZodAny:()=>q$t,$ZodArray:()=>bxe,$ZodAsyncError:()=>gO,$ZodBase64:()=>k$t,$ZodBase64URL:()=>D$t,$ZodBigInt:()=>NXe,$ZodBigIntFormat:()=>L$t,$ZodBoolean:()=>Cxe,$ZodCIDRv4:()=>w$t,$ZodCIDRv6:()=>R$t,$ZodCUID:()=>A$t,$ZodCUID2:()=>y$t,$ZodCatch:()=>sVt,$ZodCheck:()=>pf,$ZodCheckBigIntFormat:()=>WGt,$ZodCheckEndsWith:()=>o$t,$ZodCheckGreaterThan:()=>RXe,$ZodCheckIncludes:()=>n$t,$ZodCheckLengthEquals:()=>XGt,$ZodCheckLessThan:()=>wXe,$ZodCheckLowerCase:()=>t$t,$ZodCheckMaxLength:()=>JGt,$ZodCheckMaxSize:()=>zGt,$ZodCheckMimeType:()=>a$t,$ZodCheckMinLength:()=>ZGt,$ZodCheckMinSize:()=>YGt,$ZodCheckMultipleOf:()=>$Gt,$ZodCheckNumberFormat:()=>VGt,$ZodCheckOverwrite:()=>c$t,$ZodCheckProperty:()=>s$t,$ZodCheckRegex:()=>e$t,$ZodCheckSizeEquals:()=>KGt,$ZodCheckStartsWith:()=>i$t,$ZodCheckStringFormat:()=>oue,$ZodCheckUpperCase:()=>r$t,$ZodCustom:()=>fVt,$ZodCustomStringFormat:()=>O$t,$ZodDate:()=>G$t,$ZodDefault:()=>rVt,$ZodDiscriminatedUnion:()=>V$t,$ZodE164:()=>N$t,$ZodEmail:()=>p$t,$ZodEmoji:()=>m$t,$ZodEnum:()=>J$t,$ZodError:()=>mxe,$ZodFile:()=>X$t,$ZodFunction:()=>net,$ZodGUID:()=>d$t,$ZodIPv4:()=>I$t,$ZodIPv6:()=>x$t,$ZodISODate:()=>b$t,$ZodISODateTime:()=>C$t,$ZodISODuration:()=>T$t,$ZodISOTime:()=>S$t,$ZodIntersection:()=>W$t,$ZodJWT:()=>M$t,$ZodKSUID:()=>v$t,$ZodLazy:()=>dVt,$ZodLiteral:()=>Z$t,$ZodMap:()=>Y$t,$ZodNaN:()=>aVt,$ZodNanoID:()=>g$t,$ZodNever:()=>j$t,$ZodNonOptional:()=>iVt,$ZodNull:()=>Q$t,$ZodNullable:()=>tVt,$ZodNumber:()=>DXe,$ZodNumberFormat:()=>B$t,$ZodObject:()=>$$t,$ZodOptional:()=>eVt,$ZodPipe:()=>Txe,$ZodPrefault:()=>nVt,$ZodPromise:()=>uVt,$ZodReadonly:()=>cVt,$ZodRealError:()=>nue,$ZodRecord:()=>z$t,$ZodRegistry:()=>aue,$ZodSet:()=>K$t,$ZodString:()=>NK,$ZodStringFormat:()=>Fl,$ZodSuccess:()=>oVt,$ZodSymbol:()=>F$t,$ZodTemplateLiteral:()=>lVt,$ZodTransform:()=>Sxe,$ZodTuple:()=>MK,$ZodType:()=>lo,$ZodULID:()=>E$t,$ZodURL:()=>h$t,$ZodUUID:()=>f$t,$ZodUndefined:()=>U$t,$ZodUnion:()=>MXe,$ZodUnknown:()=>sue,$ZodVoid:()=>H$t,$ZodXID:()=>_$t,$brand:()=>rGt,$constructor:()=>ut,$input:()=>ZVt,$output:()=>JVt,Doc:()=>vxe,JSONSchema:()=>gIn,JSONSchemaGenerator:()=>jxe,NEVER:()=>axe,TimePrecision:()=>tWt,_any:()=>CWt,_array:()=>qxe,_base64:()=>XXe,_base64url:()=>eet,_bigint:()=>mWt,_boolean:()=>pWt,_catch:()=>XJo,_cidrv4:()=>JXe,_cidrv6:()=>ZXe,_coercedBigint:()=>gWt,_coercedBoolean:()=>hWt,_coercedDate:()=>IWt,_coercedNumber:()=>aWt,_coercedString:()=>eWt,_cuid:()=>GXe,_cuid2:()=>$Xe,_custom:()=>OWt,_date:()=>TWt,_default:()=>KJo,_discriminatedUnion:()=>UJo,_e164:()=>tet,_email:()=>BXe,_emoji:()=>jXe,_endsWith:()=>Oxe,_enum:()=>GJo,_file:()=>MWt,_float32:()=>lWt,_float64:()=>uWt,_gt:()=>R3,_gte:()=>BC,_guid:()=>wxe,_includes:()=>Nxe,_int:()=>cWt,_int32:()=>dWt,_int64:()=>AWt,_intersection:()=>QJo,_ipv4:()=>YXe,_ipv6:()=>KXe,_isoDate:()=>nWt,_isoDateTime:()=>rWt,_isoDuration:()=>oWt,_isoTime:()=>iWt,_jwt:()=>ret,_ksuid:()=>zXe,_lazy:()=>nZo,_length:()=>due,_literal:()=>VJo,_lowercase:()=>kxe,_lt:()=>w3,_lte:()=>Gx,_map:()=>jJo,_max:()=>Gx,_maxLength:()=>uue,_maxSize:()=>lue,_mime:()=>Bxe,_min:()=>BC,_minLength:()=>cq,_minSize:()=>BK,_multipleOf:()=>OK,_nan:()=>xWt,_nanoid:()=>HXe,_nativeEnum:()=>$Jo,_negative:()=>RWt,_never:()=>bWt,_nonnegative:()=>kWt,_nonoptional:()=>JJo,_nonpositive:()=>PWt,_normalize:()=>Lxe,_null:()=>vWt,_nullable:()=>YJo,_number:()=>sWt,_optional:()=>zJo,_overwrite:()=>P3,_parse:()=>bXe,_parseAsync:()=>SXe,_pipe:()=>eZo,_positive:()=>wWt,_promise:()=>iZo,_property:()=>DWt,_readonly:()=>tZo,_record:()=>qJo,_refine:()=>BWt,_regex:()=>Pxe,_safeParse:()=>TXe,_safeParseAsync:()=>IXe,_set:()=>HJo,_size:()=>Rxe,_startsWith:()=>Mxe,_string:()=>XVt,_stringFormat:()=>FWt,_stringbool:()=>LWt,_success:()=>ZJo,_symbol:()=>EWt,_templateLiteral:()=>rZo,_toLowerCase:()=>Uxe,_toUpperCase:()=>Qxe,_transform:()=>WJo,_trim:()=>Fxe,_tuple:()=>NWt,_uint32:()=>fWt,_uint64:()=>yWt,_ulid:()=>VXe,_undefined:()=>_Wt,_union:()=>FJo,_unknown:()=>cue,_uppercase:()=>Dxe,_url:()=>qXe,_uuid:()=>LXe,_uuidv4:()=>FXe,_uuidv6:()=>UXe,_uuidv7:()=>QXe,_void:()=>SWt,_xid:()=>WXe,clone:()=>BS,config:()=>zh,flattenError:()=>gxe,formatError:()=>Axe,function:()=>UWt,globalConfig:()=>sxe,globalRegistry:()=>AO,isValidBase64:()=>P$t,isValidBase64URL:()=>dIn,isValidJWT:()=>fIn,locales:()=>xxe,parse:()=>yxe,parseAsync:()=>Exe,prettifyError:()=>mGt,regexes:()=>DK,registry:()=>OXe,safeParse:()=>iue,safeParseAsync:()=>_xe,toDotPath:()=>WTn,toJSONSchema:()=>QWt,treeifyError:()=>hGt,util:()=>qr,version:()=>l$t});p();p();var axe=Object.freeze({status:"aborted"});function ut(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(ut,"$constructor");var rGt=Symbol("zod_brand"),gO=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},sxe={};function zh(t){return t&&Object.assign(sxe,t),sxe}a(zh,"config");p();p();var qr={};xi(qr,{BIGINT_FORMAT_RANGES:()=>fGt,Class:()=>iGt,NUMBER_FORMAT_RANGES:()=>dGt,aborted:()=>PK,allowsEval:()=>cGt,assert:()=>IKo,assertEqual:()=>CKo,assertIs:()=>SKo,assertNever:()=>TKo,assertNotEqual:()=>bKo,assignProp:()=>aGt,cached:()=>uxe,captureStackTrace:()=>CXe,cleanEnum:()=>UKo,cleanRegex:()=>dxe,clone:()=>BS,createTransparentProxy:()=>DKo,defineLazy:()=>bc,esc:()=>RK,escapeRegex:()=>x3,extend:()=>OKo,finalizeIssue:()=>LS,floatSafeRemainder:()=>sGt,getElementAtPath:()=>xKo,getEnumValues:()=>lxe,getLengthableOrigin:()=>hxe,getParsedType:()=>kKo,getSizableOrigin:()=>pxe,isObject:()=>tue,isPlainObject:()=>rue,issue:()=>pGt,joinValues:()=>Qt,jsonStringifyReplacer:()=>oGt,merge:()=>BKo,normalizeParams:()=>Tr,nullish:()=>aq,numKeys:()=>PKo,omit:()=>MKo,optionalKeys:()=>uGt,partial:()=>LKo,pick:()=>NKo,prefixIssues:()=>OC,primitiveTypes:()=>lGt,promiseAllObject:()=>wKo,propertyKeyTypes:()=>fxe,randomString:()=>RKo,required:()=>FKo,stringifyPrimitive:()=>Qr,unwrapMessage:()=>cxe});p();function CKo(t){return t}a(CKo,"assertEqual");function bKo(t){return t}a(bKo,"assertNotEqual");function SKo(t){}a(SKo,"assertIs");function TKo(t){throw new Error}a(TKo,"assertNever");function IKo(t){}a(IKo,"assert");function lxe(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(lxe,"getEnumValues");function Qt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(Qt,"joinValues");function oGt(t,e){return typeof e=="bigint"?e.toString():e}a(oGt,"jsonStringifyReplacer");function uxe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(uxe,"cached");function aq(t){return t==null}a(aq,"nullish");function dxe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(dxe,"cleanRegex");function sGt(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(sGt,"floatSafeRemainder");function bc(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(bc,"defineLazy");function aGt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(aGt,"assignProp");function xKo(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(xKo,"getElementAtPath");function wKo(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 tue(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(tue,"isObject");var cGt=uxe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function rue(t){if(tue(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(tue(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(rue,"isPlainObject");function PKo(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(PKo,"numKeys");var kKo=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"),fxe=new Set(["string","number","symbol"]),lGt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function x3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(x3,"escapeRegex");function BS(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(BS,"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 DKo(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(DKo,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function uGt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(uGt,"optionalKeys");var dGt={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]},fGt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function NKo(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 BS(t,{...t._zod.def,shape:r,checks:[]})}a(NKo,"pick");function MKo(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 BS(t,{...t._zod.def,shape:r,checks:[]})}a(MKo,"omit");function OKo(t,e){if(!rue(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 aGt(this,"shape",n),n},checks:[]};return BS(t,r)}a(OKo,"extend");function BKo(t,e){return BS(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return aGt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(BKo,"merge");function LKo(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 BS(e,{...e._zod.def,shape:o,checks:[]})}a(LKo,"partial");function FKo(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 BS(e,{...e._zod.def,shape:o,checks:[]})}a(FKo,"required");function PK(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(OC,"prefixIssues");function cxe(t){return typeof t=="string"?t:t?.message}a(cxe,"unwrapMessage");function LS(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=cxe(t.inst?._zod.def?.error?.(t))??cxe(e?.error?.(t))??cxe(r.customError?.(t))??cxe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(LS,"finalizeIssue");function pxe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(pxe,"getSizableOrigin");function hxe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(hxe,"getLengthableOrigin");function pGt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(pGt,"issue");function UKo(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(UKo,"cleanEnum");var iGt=class{static{a(this,"Class")}constructor(...e){}};var VTn=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,oGt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),mxe=ut("$ZodError",VTn),nue=ut("$ZodError",VTn,{Parent:Error});function gxe(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(gxe,"flattenError");function Axe(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 ${WTn(n.path)}`);return e.join(` +`)}a(mGt,"prettifyError");var bXe=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 gO;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>LS(u,s,zh())));throw CXe(l,o?.callee),l}return c.value},"_parse"),yxe=bXe(nue),SXe=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=>LS(u,s,zh())));throw CXe(l,o?.callee),l}return c.value},"_parseAsync"),Exe=SXe(nue),TXe=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 gO;return s.issues.length?{success:!1,error:new(t??mxe)(s.issues.map(c=>LS(c,o,zh())))}:{success:!0,data:s.value}},"_safeParse"),iue=TXe(nue),IXe=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=>LS(c,o,zh())))}:{success:!0,data:s.value}},"_safeParseAsync"),_xe=IXe(nue);p();p();var DK={};xi(DK,{_emoji:()=>zTn,base64:()=>PGt,base64url:()=>xXe,bigint:()=>LGt,boolean:()=>QGt,browserEmail:()=>zKo,cidrv4:()=>wGt,cidrv6:()=>RGt,cuid:()=>gGt,cuid2:()=>AGt,date:()=>NGt,datetime:()=>OGt,domain:()=>YKo,duration:()=>CGt,e164:()=>DGt,email:()=>SGt,emoji:()=>TGt,extendedDuration:()=>qKo,guid:()=>bGt,hostname:()=>kGt,html5Email:()=>$Ko,integer:()=>FGt,ipv4:()=>IGt,ipv6:()=>xGt,ksuid:()=>_Gt,lowercase:()=>HGt,nanoid:()=>vGt,null:()=>qGt,number:()=>UGt,rfc5322Email:()=>VKo,string:()=>BGt,time:()=>MGt,ulid:()=>yGt,undefined:()=>jGt,unicodeEmail:()=>WKo,uppercase:()=>GGt,uuid:()=>kK,uuid4:()=>jKo,uuid6:()=>HKo,uuid7:()=>GKo,xid:()=>EGt});p();var gGt=/^[cC][^\s-]{8,}$/,AGt=/^[0-9a-z]+$/,yGt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,EGt=/^[0-9a-vA-V]{20}$/,_Gt=/^[A-Za-z0-9]{27}$/,vGt=/^[a-zA-Z0-9_-]{21}$/,CGt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qKo=/^[-+]?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)?)??$/,bGt=/^([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})$/,kK=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"),jKo=kK(4),HKo=kK(6),GKo=kK(7),SGt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$Ko=/^[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])?)*$/,VKo=/^(([^<>()\[\]\\.,;:\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,}))$/,WKo=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,zKo=/^[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])?)*$/,zTn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function TGt(){return new RegExp(zTn,"u")}a(TGt,"emoji");var IGt=/^(?:(?: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])$/,xGt=/^(([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})$/,wGt=/^((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])$/,RGt=/^(([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])$/,PGt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xXe=/^[A-Za-z0-9_-]*$/,kGt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,YKo=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,DGt=/^\+(?:[0-9]){6,14}[0-9]$/,YTn="(?:(?:\\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])))",NGt=new RegExp(`^${YTn}$`);function KTn(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(KTn,"timeSource");function MGt(t){return new RegExp(`^${KTn(t)}$`)}a(MGt,"time");function OGt(t){let e=KTn({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(`^${YTn}T(?:${n})$`)}a(OGt,"datetime");var BGt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),LGt=/^\d+n?$/,FGt=/^\d+$/,UGt=/^-?\d+(?:\.\d+)?/i,QGt=/true|false/i,qGt=/null/i;var jGt=/undefined/i;var HGt=/^[^A-Z]*$/,GGt=/^[^a-z]*$/;var pf=ut("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),ZTn={number:"number",bigint:"bigint",object:"date"},wXe=ut("$ZodCheckLessThan",(t,e)=>{pf.init(t,e);let r=ZTn[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{pf.init(t,e);let r=ZTn[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})}}),$Gt=ut("$ZodCheckMultipleOf",(t,e)=>{pf.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):sGt(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})}}),VGt=ut("$ZodCheckNumberFormat",(t,e)=>{pf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=dGt[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=FGt)}),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})}}),WGt=ut("$ZodCheckBigIntFormat",(t,e)=>{pf.init(t,e);let[r,n]=fGt[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})}}),zGt=ut("$ZodCheckMaxSize",(t,e)=>{var r;pf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!aq(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:pxe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),YGt=ut("$ZodCheckMinSize",(t,e)=>{var r;pf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!aq(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:pxe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),KGt=ut("$ZodCheckSizeEquals",(t,e)=>{var r;pf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!aq(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:pxe(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})}}),JGt=ut("$ZodCheckMaxLength",(t,e)=>{var r;pf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!aq(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=hxe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),ZGt=ut("$ZodCheckMinLength",(t,e)=>{var r;pf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!aq(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=hxe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),XGt=ut("$ZodCheckLengthEquals",(t,e)=>{var r;pf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!aq(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=hxe(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})}}),oue=ut("$ZodCheckStringFormat",(t,e)=>{var r,n;pf.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=()=>{})}),e$t=ut("$ZodCheckRegex",(t,e)=>{oue.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})}}),t$t=ut("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=HGt),oue.init(t,e)}),r$t=ut("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=GGt),oue.init(t,e)}),n$t=ut("$ZodCheckIncludes",(t,e)=>{pf.init(t,e);let r=x3(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})}}),i$t=ut("$ZodCheckStartsWith",(t,e)=>{pf.init(t,e);let r=new RegExp(`^${x3(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})}}),o$t=ut("$ZodCheckEndsWith",(t,e)=>{pf.init(t,e);let r=new RegExp(`.*${x3(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 JTn(t,e,r){t.issues.length&&e.issues.push(...OC(r,t.issues))}a(JTn,"handleCheckPropertyResult");var s$t=ut("$ZodCheckProperty",(t,e)=>{pf.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=>JTn(o,r,e.property));JTn(n,r,e.property)}}),a$t=ut("$ZodCheckMimeType",(t,e)=>{pf.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})}}),c$t=ut("$ZodCheckOverwrite",(t,e)=>{pf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var vxe=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 mVt={major:4,minor:0,patch:0};var uo=it("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=mVt;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=YK(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 wO;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=YK(s,h)))});else{if(s.issues.length===h)continue;u||(u=YK(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 wO;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=xue(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Kxe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),ZK=it("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??j$t(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}}),ql=it("$ZodStringFormat",(t,e)=>{wue.init(t,e),ZK.init(t,e)}),AVt=it("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=R$t),ql.init(t,e)}),yVt=it("$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=KK(n))}else e.pattern??(e.pattern=KK());ql.init(t,e)}),EVt=it("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=k$t),ql.init(t,e)}),_Vt=it("$ZodURL",(t,e)=>{ql.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:L$t.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})}}}),CVt=it("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=P$t()),ql.init(t,e)}),vVt=it("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=x$t),ql.init(t,e)}),bVt=it("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=v$t),ql.init(t,e)}),SVt=it("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=b$t),ql.init(t,e)}),TVt=it("$ZodULID",(t,e)=>{e.pattern??(e.pattern=S$t),ql.init(t,e)}),IVt=it("$ZodXID",(t,e)=>{e.pattern??(e.pattern=T$t),ql.init(t,e)}),xVt=it("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=I$t),ql.init(t,e)}),wVt=it("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=q$t(e)),ql.init(t,e)}),RVt=it("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=U$t),ql.init(t,e)}),kVt=it("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Q$t(e)),ql.init(t,e)}),PVt=it("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=w$t),ql.init(t,e)}),DVt=it("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=D$t),ql.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),NVt=it("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=N$t),ql.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})}}}),MVt=it("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=M$t),ql.init(t,e)}),OVt=it("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=O$t),ql.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 BVt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(BVt,"isValidBase64");var LVt=it("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=B$t),ql.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{BVt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Kxn(t){if(!Aet.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return BVt(r)}a(Kxn,"isValidBase64URL");var FVt=it("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Aet),ql.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Kxn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),UVt=it("$ZodE164",(t,e)=>{e.pattern??(e.pattern=F$t),ql.init(t,e)});function Jxn(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(Jxn,"isValidJWT");var QVt=it("$ZodJWT",(t,e)=>{ql.init(t,e),t._zod.check=r=>{Jxn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),qVt=it("$ZodCustomStringFormat",(t,e)=>{ql.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})}}),vet=it("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??$$t,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}}),jVt=it("$ZodNumber",(t,e)=>{Z$t.init(t,e),vet.init(t,e)}),Zxe=it("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=V$t,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}}),bet=it("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=H$t,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}}),HVt=it("$ZodBigInt",(t,e)=>{X$t.init(t,e),bet.init(t,e)}),GVt=it("$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}}),$Vt=it("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=z$t,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}}),VVt=it("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=W$t,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}}),WVt=it("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Rue=it("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),zVt=it("$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)}),YVt=it("$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}}),KVt=it("$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 Uxn(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues)),e.value[r]=t.value}a(Uxn,"handleArrayResult");var Xxe=it("$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;cUxn(d,r,c))):Uxn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function _et(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues)),e.value[r]=t.value}a(_et,"handleObjectResult");function Qxn(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(...qv(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Qxn,"handleOptionalObjectResult");var JVt=it("$ZodObject",(t,e)=>{uo.init(t,e);let r=Qxe(()=>{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=g$t(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});Tc(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 Jxe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=zK(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=zK(v);m.write(` +`))}};p();var l$t={major:4,minor:0,patch:0};var lo=ut("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=l$t;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=PK(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 gO;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=PK(s,h)))});else{if(s.issues.length===h)continue;u||(u=PK(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 gO;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=iue(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return _xe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),NK=ut("$ZodString",(t,e)=>{lo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??BGt(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}}),Fl=ut("$ZodStringFormat",(t,e)=>{oue.init(t,e),NK.init(t,e)}),d$t=ut("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=bGt),Fl.init(t,e)}),f$t=ut("$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=kK(n))}else e.pattern??(e.pattern=kK());Fl.init(t,e)}),p$t=ut("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=SGt),Fl.init(t,e)}),h$t=ut("$ZodURL",(t,e)=>{Fl.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:kGt.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})}}}),m$t=ut("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=TGt()),Fl.init(t,e)}),g$t=ut("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=vGt),Fl.init(t,e)}),A$t=ut("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=gGt),Fl.init(t,e)}),y$t=ut("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=AGt),Fl.init(t,e)}),E$t=ut("$ZodULID",(t,e)=>{e.pattern??(e.pattern=yGt),Fl.init(t,e)}),_$t=ut("$ZodXID",(t,e)=>{e.pattern??(e.pattern=EGt),Fl.init(t,e)}),v$t=ut("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=_Gt),Fl.init(t,e)}),C$t=ut("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=OGt(e)),Fl.init(t,e)}),b$t=ut("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=NGt),Fl.init(t,e)}),S$t=ut("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=MGt(e)),Fl.init(t,e)}),T$t=ut("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=CGt),Fl.init(t,e)}),I$t=ut("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=IGt),Fl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),x$t=ut("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=xGt),Fl.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})}}}),w$t=ut("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=wGt),Fl.init(t,e)}),R$t=ut("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=RGt),Fl.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 P$t(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(P$t,"isValidBase64");var k$t=ut("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=PGt),Fl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{P$t(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function dIn(t){if(!xXe.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return P$t(r)}a(dIn,"isValidBase64URL");var D$t=ut("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=xXe),Fl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{dIn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),N$t=ut("$ZodE164",(t,e)=>{e.pattern??(e.pattern=DGt),Fl.init(t,e)});function fIn(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(fIn,"isValidJWT");var M$t=ut("$ZodJWT",(t,e)=>{Fl.init(t,e),t._zod.check=r=>{fIn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),O$t=ut("$ZodCustomStringFormat",(t,e)=>{Fl.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})}}),DXe=ut("$ZodNumber",(t,e)=>{lo.init(t,e),t._zod.pattern=t._zod.bag.pattern??UGt,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}}),B$t=ut("$ZodNumber",(t,e)=>{VGt.init(t,e),DXe.init(t,e)}),Cxe=ut("$ZodBoolean",(t,e)=>{lo.init(t,e),t._zod.pattern=QGt,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}}),NXe=ut("$ZodBigInt",(t,e)=>{lo.init(t,e),t._zod.pattern=LGt,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}}),L$t=ut("$ZodBigInt",(t,e)=>{WGt.init(t,e),NXe.init(t,e)}),F$t=ut("$ZodSymbol",(t,e)=>{lo.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}}),U$t=ut("$ZodUndefined",(t,e)=>{lo.init(t,e),t._zod.pattern=jGt,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}}),Q$t=ut("$ZodNull",(t,e)=>{lo.init(t,e),t._zod.pattern=qGt,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}}),q$t=ut("$ZodAny",(t,e)=>{lo.init(t,e),t._zod.parse=r=>r}),sue=ut("$ZodUnknown",(t,e)=>{lo.init(t,e),t._zod.parse=r=>r}),j$t=ut("$ZodNever",(t,e)=>{lo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),H$t=ut("$ZodVoid",(t,e)=>{lo.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}}),G$t=ut("$ZodDate",(t,e)=>{lo.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 eIn(t,e,r){t.issues.length&&e.issues.push(...OC(r,t.issues)),e.value[r]=t.value}a(eIn,"handleArrayResult");var bxe=ut("$ZodArray",(t,e)=>{lo.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;ceIn(d,r,c))):eIn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function PXe(t,e,r){t.issues.length&&e.issues.push(...OC(r,t.issues)),e.value[r]=t.value}a(PXe,"handleObjectResult");function tIn(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(...OC(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(tIn,"handleOptionalObjectResult");var $$t=ut("$ZodObject",(t,e)=>{lo.init(t,e);let r=uxe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof lo))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=uGt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});bc(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 vxe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=RK(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=RK(v);m.write(` if (${b}.issues.length) { if (input[${T}] === undefined) { if (${T} in input) { @@ -3519,117 +3475,118 @@ ${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${GGt(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 ? [${zK(v)}, ...iss.path] : [${zK(v)}] - })));`),m.write(`newResult[${zK(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=Sue,c=!Bxe.jitless,u=c&&h$t.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(k=>x?Qxn(k,h,T,g):_et(k,h,T))):x?Qxn(R,h,T,g):_et(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=>_et(w,h,b))):_et(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 qxn(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=>GS(s,n,zh())))}),e}a(qxn,"handleUnionResults");var Tet=it("$ZodUnion",(t,e)=>{uo.init(t,e),Tc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Tc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Tc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Tc(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=>qxe(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=>qxn(c,r,t,n)):qxn(s,r,t,n)}}),ZVt=it("$ZodDiscriminatedUnion",(t,e)=>{Tet.init(t,e);let r=t._zod.parse;Tc(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=Qxe(()=>{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(!Sue(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)}}),XVt=it("$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])=>jxn(r,u,d)):jxn(r,s,c)}});function gVt(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(Tue(t)&&Tue(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=gVt(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=>Cet(h,o,u))):Cet(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=>Cet(m,o,u))):Cet(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function Cet(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues)),e.value[r]=t.value}a(Cet,"handleTupleResult");var eWt=it("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Tue(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(...qv(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...qv(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=>GS(d,n,zh())),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(...qv(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...qv(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),tWt=it("$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])=>{Hxn(f,h,r,c,o,t,n)})):Hxn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Hxn(t,e,r,n,o,s,c){t.issues.length&&(jxe.has(typeof n)?r.issues.push(...qv(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>GS(l,c,zh()))})),e.issues.length&&(jxe.has(typeof n)?r.issues.push(...qv(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>GS(l,c,zh()))})),r.value.set(t.value,e.value)}a(Hxn,"handleMapResult");var rWt=it("$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=>Gxn(u,r))):Gxn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function Gxn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(Gxn,"handleSetResult");var nWt=it("$ZodEnum",(t,e)=>{uo.init(t,e);let r=Uxe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>jxe.has(typeof n)).map(n=>typeof n=="string"?q3(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}}),iWt=it("$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"?q3(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}}),oWt=it("$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}}),ewe=it("$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 wO;return r.value=o,r}}),sWt=it("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Tc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Tc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${qxe(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)}),aWt=it("$ZodNullable",(t,e)=>{uo.init(t,e),Tc(t._zod,"optin",()=>e.innerType._zod.optin),Tc(t._zod,"optout",()=>e.innerType._zod.optout),Tc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${qxe(r.source)}|null)$`):void 0}),Tc(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)}),cWt=it("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",Tc(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=>$xn(s,e)):$xn(o,e)}});function $xn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a($xn,"handleDefaultResult");var lWt=it("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",Tc(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))}),uWt=it("$ZodNonOptional",(t,e)=>{uo.init(t,e),Tc(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=>Vxn(s,t)):Vxn(o,t)}});function Vxn(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(Vxn,"handleNonOptionalResult");var dWt=it("$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)}}),fWt=it("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",Tc(t._zod,"optout",()=>e.innerType._zod.optout),Tc(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=>GS(c,n,zh()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>GS(s,n,zh()))},input:r.value}),r.issues=[]),r)}}),pWt=it("$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)}),twe=it("$ZodPipe",(t,e)=>{uo.init(t,e),Tc(t._zod,"values",()=>e.in._zod.values),Tc(t._zod,"optin",()=>e.in._zod.optin),Tc(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=>Wxn(s,e,n)):Wxn(o,e,n)}});function Wxn(t,e,r){return YK(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(Wxn,"handlePipeResult");var hWt=it("$ZodReadonly",(t,e)=>{uo.init(t,e),Tc(t._zod,"propValues",()=>e.innerType._zod.propValues),Tc(t._zod,"values",()=>e.innerType._zod.values),Tc(t._zod,"optin",()=>e.innerType._zod.optin),Tc(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(zxn):zxn(o)}});function zxn(t){return t.value=Object.freeze(t.value),t}a(zxn,"handleReadonlyResult");var mWt=it("$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||m$t.has(typeof n))r.push(q3(`${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)}),gWt=it("$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))}),AWt=it("$ZodLazy",(t,e)=>{uo.init(t,e),Tc(t._zod,"innerType",()=>e.getter()),Tc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Tc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Tc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Tc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),yWt=it("$ZodCustom",(t,e)=>{mf.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=>Yxn(s,r,n,t));Yxn(o,r,n,t)}});function Yxn(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(E$t(o))}}a(Yxn,"handleRefineResult");var nwe={};wi(nwe,{ar:()=>EWt,az:()=>_Wt,be:()=>CWt,ca:()=>vWt,cs:()=>bWt,de:()=>SWt,en:()=>rwe,eo:()=>TWt,es:()=>IWt,fa:()=>xWt,fi:()=>wWt,fr:()=>RWt,frCA:()=>kWt,he:()=>PWt,hu:()=>DWt,id:()=>NWt,it:()=>MWt,ja:()=>OWt,kh:()=>BWt,ko:()=>LWt,mk:()=>FWt,ms:()=>UWt,nl:()=>QWt,no:()=>qWt,ota:()=>jWt,pl:()=>GWt,ps:()=>HWt,pt:()=>$Wt,ru:()=>VWt,sl:()=>WWt,sv:()=>zWt,ta:()=>YWt,th:()=>KWt,tr:()=>JWt,ua:()=>ZWt,ur:()=>XWt,vi:()=>ezt,zhCN:()=>tzt,zhTW:()=>rzt});p();p();var rts=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: ${Ft(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":""}: ${Ft(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 EWt(){return{localeError:rts()}}a(EWt,"default");p();var nts=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: ${Ft(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":""}: ${Ft(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 _Wt(){return{localeError:nts()}}a(_Wt,"default");p();function Xxn(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(Xxn,"getBelarusianPlural");var its=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 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Xxn(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=Xxn(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"}: ${Ft(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 CWt(){return{localeError:its()}}a(CWt,"default");p();var ots=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 ${Ft(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":""}: ${Ft(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 vWt(){return{localeError:ots()}}a(vWt,"default");p();var sts=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 ${Ft(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: ${Ft(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 bWt(){return{localeError:sts()}}a(bWt,"default");p();var ats=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 ${Ft(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"}: ${Ft(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 SWt(){return{localeError:ats()}}a(SWt,"default");p();var cts=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"),lts=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 ${cts(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${Ft(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":""}: ${Ft(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 rwe(){return{localeError:lts()}}a(rwe,"default");p();var uts=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"),dts=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 ${uts(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Ft(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":""}: ${Ft(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 TWt(){return{localeError:dts()}}a(TWt,"default");p();var fts=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 ${Ft(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":""}: ${Ft(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 IWt(){return{localeError:fts()}}a(IWt,"default");p();var pts=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 ${Ft(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: ${Ft(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 xWt(){return{localeError:pts()}}a(xWt,"default");p();var hts=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: ${Ft(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"}: ${Ft(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 wWt(){return{localeError:hts()}}a(wWt,"default");p();var mts=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 ${Ft(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":""} : ${Ft(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 RWt(){return{localeError:mts()}}a(RWt,"default");p();var gts=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 ${Ft(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":""} : ${Ft(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 kWt(){return{localeError:gts()}}a(kWt,"default");p();var Ats=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 ${Ft(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"}: ${Ft(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 PWt(){return{localeError:Ats()}}a(PWt,"default");p();var yts=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 ${Ft(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":""}: ${Ft(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 DWt(){return{localeError:yts()}}a(DWt,"default");p();var Ets=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 ${Ft(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":""}: ${Ft(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 NWt(){return{localeError:Ets()}}a(NWt,"default");p();var _ts=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 ${Ft(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"}: ${Ft(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 MWt(){return{localeError:_ts()}}a(MWt,"default");p();var Cts=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: ${Ft(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":""}: ${Ft(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 OWt(){return{localeError:Cts()}}a(OWt,"default");p();var vts=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 ${Ft(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 ${Ft(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 BWt(){return{localeError:vts()}}a(BWt,"default");p();var bts=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: ${Ft(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: ${Ft(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 LWt(){return{localeError:bts()}}a(LWt,"default");p();var Sts=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 ${Ft(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"}: ${Ft(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 FWt(){return{localeError:Sts()}}a(FWt,"default");p();var Tts=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 ${Ft(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: ${Ft(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 UWt(){return{localeError:Tts()}}a(UWt,"default");p();var Its=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 ${Ft(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":""}: ${Ft(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 QWt(){return{localeError:Its()}}a(QWt,"default");p();var xts=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 ${Ft(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"}: ${Ft(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 qWt(){return{localeError:xts()}}a(qWt,"default");p();var wts=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 ${Ft(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":""}: ${Ft(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 jWt(){return{localeError:wts()}}a(jWt,"default");p();var Rts=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 ${Ft(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"}: ${Ft(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 HWt(){return{localeError:Rts()}}a(HWt,"default");p();var kts=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 ${Ft(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":""}: ${Ft(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 GWt(){return{localeError:kts()}}a(GWt,"default");p();var Pts=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 ${Ft(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":""}: ${Ft(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 $Wt(){return{localeError:Pts()}}a($Wt,"default");p();function ewn(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(ewn,"getRussianPlural");var Dts=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 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=ewn(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=ewn(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":""}: ${Ft(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 VWt(){return{localeError:Dts()}}a(VWt,"default");p();var Nts=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 ${Ft(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"}: ${Ft(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 WWt(){return{localeError:Nts()}}a(WWt,"default");p();var Mts=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 ${Ft(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"}: ${Ft(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 zWt(){return{localeError:Mts()}}a(zWt,"default");p();var Ots=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 ${Ft(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":""}: ${Ft(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 YWt(){return{localeError:Ots()}}a(YWt,"default");p();var Bts=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 ${Ft(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: ${Ft(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 KWt(){return{localeError:Bts()}}a(KWt,"default");p();var Lts=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"),Fts=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 ${Lts(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: ${Ft(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":""}: ${Ft(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 JWt(){return{localeError:Fts()}}a(JWt,"default");p();var Uts=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 ${Ft(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":""}: ${Ft(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 ZWt(){return{localeError:Uts()}}a(ZWt,"default");p();var Qts=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: ${Ft(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":""}: ${Ft(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 XWt(){return{localeError:Qts()}}a(XWt,"default");p();var qts=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 ${Ft(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: ${Ft(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 ezt(){return{localeError:qts()}}a(ezt,"default");p();var jts=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 ${Ft(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): ${Ft(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 tzt(){return{localeError:jts()}}a(tzt,"default");p();var Hts=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 ${Ft(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${Ft(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 rzt(){return{localeError:Hts()}}a(rzt,"default");p();var nzt=Symbol("ZodOutput"),izt=Symbol("ZodInput"),kue=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 Iet(){return new kue}a(Iet,"registry");var RO=Iet();p();p();function ozt(t,e){return new t({type:"string",...Tr(e)})}a(ozt,"_string");function szt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(szt,"_coercedString");function xet(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(xet,"_email");function iwe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(iwe,"_guid");function wet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(wet,"_uuid");function Ret(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(Ret,"_uuidv4");function ket(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(ket,"_uuidv6");function Pet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Pet,"_uuidv7");function Det(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(Det,"_url");function Net(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Net,"_emoji");function Met(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Met,"_nanoid");function Oet(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(Oet,"_cuid");function Bet(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(Bet,"_cuid2");function Let(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(Let,"_ulid");function Fet(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(Fet,"_xid");function Uet(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(Uet,"_ksuid");function Qet(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(Qet,"_ipv4");function qet(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(qet,"_ipv6");function jet(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(jet,"_cidrv4");function Het(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(Het,"_cidrv6");function Get(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(Get,"_base64");function $et(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a($et,"_base64url");function Vet(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(Vet,"_e164");function Wet(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(Wet,"_jwt");var azt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function czt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(czt,"_isoDateTime");function lzt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(lzt,"_isoDate");function uzt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(uzt,"_isoTime");function dzt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(dzt,"_isoDuration");function fzt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(fzt,"_number");function pzt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(pzt,"_coercedNumber");function hzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(hzt,"_int");function mzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(mzt,"_float32");function gzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(gzt,"_float64");function Azt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(Azt,"_int32");function yzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(yzt,"_uint32");function Ezt(t,e){return new t({type:"boolean",...Tr(e)})}a(Ezt,"_boolean");function _zt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(_zt,"_coercedBoolean");function Czt(t,e){return new t({type:"bigint",...Tr(e)})}a(Czt,"_bigint");function vzt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(vzt,"_coercedBigint");function bzt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(bzt,"_int64");function Szt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(Szt,"_uint64");function Tzt(t,e){return new t({type:"symbol",...Tr(e)})}a(Tzt,"_symbol");function Izt(t,e){return new t({type:"undefined",...Tr(e)})}a(Izt,"_undefined");function xzt(t,e){return new t({type:"null",...Tr(e)})}a(xzt,"_null");function wzt(t){return new t({type:"any"})}a(wzt,"_any");function Pue(t){return new t({type:"unknown"})}a(Pue,"_unknown");function Rzt(t,e){return new t({type:"never",...Tr(e)})}a(Rzt,"_never");function kzt(t,e){return new t({type:"void",...Tr(e)})}a(kzt,"_void");function Pzt(t,e){return new t({type:"date",...Tr(e)})}a(Pzt,"_date");function Dzt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(Dzt,"_coercedDate");function Nzt(t,e){return new t({type:"nan",...Tr(e)})}a(Nzt,"_nan");function j3(t,e){return new yet({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(j3,"_lt");function Jx(t,e){return new yet({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(Jx,"_lte");function H3(t,e){return new Eet({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(H3,"_gt");function jv(t,e){return new Eet({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(jv,"_gte");function Mzt(t){return H3(0,t)}a(Mzt,"_positive");function Ozt(t){return j3(0,t)}a(Ozt,"_negative");function Bzt(t){return Jx(0,t)}a(Bzt,"_nonpositive");function Lzt(t){return jv(0,t)}a(Lzt,"_nonnegative");function eJ(t,e){return new J$t({check:"multiple_of",...Tr(e),value:t})}a(eJ,"_multipleOf");function Due(t,e){return new eVt({check:"max_size",...Tr(e),maximum:t})}a(Due,"_maxSize");function tJ(t,e){return new tVt({check:"min_size",...Tr(e),minimum:t})}a(tJ,"_minSize");function owe(t,e){return new rVt({check:"size_equals",...Tr(e),size:t})}a(owe,"_size");function Nue(t,e){return new nVt({check:"max_length",...Tr(e),maximum:t})}a(Nue,"_maxLength");function Iq(t,e){return new iVt({check:"min_length",...Tr(e),minimum:t})}a(Iq,"_minLength");function Mue(t,e){return new oVt({check:"length_equals",...Tr(e),length:t})}a(Mue,"_length");function swe(t,e){return new sVt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(swe,"_regex");function awe(t){return new aVt({check:"string_format",format:"lowercase",...Tr(t)})}a(awe,"_lowercase");function cwe(t){return new cVt({check:"string_format",format:"uppercase",...Tr(t)})}a(cwe,"_uppercase");function lwe(t,e){return new lVt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(lwe,"_includes");function uwe(t,e){return new uVt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(uwe,"_startsWith");function dwe(t,e){return new dVt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(dwe,"_endsWith");function Fzt(t,e,r){return new fVt({check:"property",property:t,schema:e,...Tr(r)})}a(Fzt,"_property");function fwe(t,e){return new pVt({check:"mime_type",mime:t,...Tr(e)})}a(fwe,"_mime");function G3(t){return new hVt({check:"overwrite",tx:t})}a(G3,"_overwrite");function pwe(t){return G3(e=>e.normalize(t))}a(pwe,"_normalize");function hwe(){return G3(t=>t.trim())}a(hwe,"_trim");function mwe(){return G3(t=>t.toLowerCase())}a(mwe,"_toLowerCase");function gwe(){return G3(t=>t.toUpperCase())}a(gwe,"_toUpperCase");function Awe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(Awe,"_array");function Gts(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(Gts,"_union");function $ts(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a($ts,"_discriminatedUnion");function Vts(t,e,r){return new t({type:"intersection",left:e,right:r})}a(Vts,"_intersection");function Uzt(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(Uzt,"_tuple");function Wts(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(Wts,"_record");function zts(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(zts,"_map");function Yts(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(Yts,"_set");function Kts(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(Kts,"_enum");function Jts(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(Jts,"_nativeEnum");function Zts(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(Zts,"_literal");function Qzt(t,e){return new t({type:"file",...Tr(e)})}a(Qzt,"_file");function Xts(t,e){return new t({type:"transform",transform:e})}a(Xts,"_transform");function ers(t,e){return new t({type:"optional",innerType:e})}a(ers,"_optional");function trs(t,e){return new t({type:"nullable",innerType:e})}a(trs,"_nullable");function rrs(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(rrs,"_default");function nrs(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(nrs,"_nonoptional");function irs(t,e){return new t({type:"success",innerType:e})}a(irs,"_success");function ors(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(ors,"_catch");function srs(t,e,r){return new t({type:"pipe",in:e,out:r})}a(srs,"_pipe");function ars(t,e){return new t({type:"readonly",innerType:e})}a(ars,"_readonly");function crs(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(crs,"_templateLiteral");function lrs(t,e){return new t({type:"lazy",getter:e})}a(lrs,"_lazy");function urs(t,e){return new t({type:"promise",innerType:e})}a(urs,"_promise");function qzt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(qzt,"_custom");function jzt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(jzt,"_refine");function Hzt(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??twe,u=t.Boolean??Zxe,d=t.String??ZK,f=t.Transform??ewe,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(Hzt,"_stringbool");function Gzt(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(Gzt,"_stringFormat");var zet=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?zxe(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?zxe(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 Yxe(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?Yxe(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 XK({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 $zt(t){return new zet({type:"function",input:Array.isArray(t?.input)?Uzt(XK,t?.input):t?.input??Awe(Xxe,Pue(Rue)),output:t?.output??Pue(Rue)})}a($zt,"_function");p();var ywe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??RO,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=Uxe(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"&&em(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 ? [${RK(v)}, ...iss.path] : [${RK(v)}] + })));`),m.write(`newResult[${RK(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=tue,c=!sxe.jitless,u=c&&cGt.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?tIn(P,h,T,g):PXe(P,h,T))):x?tIn(R,h,T,g):PXe(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=>PXe(w,h,b))):PXe(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 rIn(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=>LS(s,n,zh())))}),e}a(rIn,"handleUnionResults");var MXe=ut("$ZodUnion",(t,e)=>{lo.init(t,e),bc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),bc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),bc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),bc(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=>dxe(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=>rIn(c,r,t,n)):rIn(s,r,t,n)}}),V$t=ut("$ZodDiscriminatedUnion",(t,e)=>{MXe.init(t,e);let r=t._zod.parse;bc(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=uxe(()=>{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(!tue(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)}}),W$t=ut("$ZodIntersection",(t,e)=>{lo.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])=>nIn(r,u,d)):nIn(r,s,c)}});function u$t(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(rue(t)&&rue(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=u$t(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{lo.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=>kXe(h,o,u))):kXe(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=>kXe(m,o,u))):kXe(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function kXe(t,e,r){t.issues.length&&e.issues.push(...OC(r,t.issues)),e.value[r]=t.value}a(kXe,"handleTupleResult");var z$t=ut("$ZodRecord",(t,e)=>{lo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!rue(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(...OC(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...OC(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=>LS(d,n,zh())),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(...OC(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...OC(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Y$t=ut("$ZodMap",(t,e)=>{lo.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])=>{iIn(f,h,r,c,o,t,n)})):iIn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function iIn(t,e,r,n,o,s,c){t.issues.length&&(fxe.has(typeof n)?r.issues.push(...OC(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>LS(l,c,zh()))})),e.issues.length&&(fxe.has(typeof n)?r.issues.push(...OC(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>LS(l,c,zh()))})),r.value.set(t.value,e.value)}a(iIn,"handleMapResult");var K$t=ut("$ZodSet",(t,e)=>{lo.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=>oIn(u,r))):oIn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function oIn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(oIn,"handleSetResult");var J$t=ut("$ZodEnum",(t,e)=>{lo.init(t,e);let r=lxe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>fxe.has(typeof n)).map(n=>typeof n=="string"?x3(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}}),Z$t=ut("$ZodLiteral",(t,e)=>{lo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?x3(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}}),X$t=ut("$ZodFile",(t,e)=>{lo.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}}),Sxe=ut("$ZodTransform",(t,e)=>{lo.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 gO;return r.value=o,r}}),eVt=ut("$ZodOptional",(t,e)=>{lo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",bc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),bc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dxe(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)}),tVt=ut("$ZodNullable",(t,e)=>{lo.init(t,e),bc(t._zod,"optin",()=>e.innerType._zod.optin),bc(t._zod,"optout",()=>e.innerType._zod.optout),bc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dxe(r.source)}|null)$`):void 0}),bc(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)}),rVt=ut("$ZodDefault",(t,e)=>{lo.init(t,e),t._zod.optin="optional",bc(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=>sIn(s,e)):sIn(o,e)}});function sIn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(sIn,"handleDefaultResult");var nVt=ut("$ZodPrefault",(t,e)=>{lo.init(t,e),t._zod.optin="optional",bc(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))}),iVt=ut("$ZodNonOptional",(t,e)=>{lo.init(t,e),bc(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=>aIn(s,t)):aIn(o,t)}});function aIn(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(aIn,"handleNonOptionalResult");var oVt=ut("$ZodSuccess",(t,e)=>{lo.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)}}),sVt=ut("$ZodCatch",(t,e)=>{lo.init(t,e),t._zod.optin="optional",bc(t._zod,"optout",()=>e.innerType._zod.optout),bc(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=>LS(c,n,zh()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>LS(s,n,zh()))},input:r.value}),r.issues=[]),r)}}),aVt=ut("$ZodNaN",(t,e)=>{lo.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)}),Txe=ut("$ZodPipe",(t,e)=>{lo.init(t,e),bc(t._zod,"values",()=>e.in._zod.values),bc(t._zod,"optin",()=>e.in._zod.optin),bc(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=>cIn(s,e,n)):cIn(o,e,n)}});function cIn(t,e,r){return PK(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(cIn,"handlePipeResult");var cVt=ut("$ZodReadonly",(t,e)=>{lo.init(t,e),bc(t._zod,"propValues",()=>e.innerType._zod.propValues),bc(t._zod,"values",()=>e.innerType._zod.values),bc(t._zod,"optin",()=>e.innerType._zod.optin),bc(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(lIn):lIn(o)}});function lIn(t){return t.value=Object.freeze(t.value),t}a(lIn,"handleReadonlyResult");var lVt=ut("$ZodTemplateLiteral",(t,e)=>{lo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof lo){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||lGt.has(typeof n))r.push(x3(`${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)}),uVt=ut("$ZodPromise",(t,e)=>{lo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),dVt=ut("$ZodLazy",(t,e)=>{lo.init(t,e),bc(t._zod,"innerType",()=>e.getter()),bc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),bc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),bc(t._zod,"optin",()=>t._zod.innerType._zod.optin),bc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),fVt=ut("$ZodCustom",(t,e)=>{pf.init(t,e),lo.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=>uIn(s,r,n,t));uIn(o,r,n,t)}});function uIn(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(pGt(o))}}a(uIn,"handleRefineResult");var xxe={};xi(xxe,{ar:()=>pVt,az:()=>hVt,be:()=>mVt,ca:()=>gVt,cs:()=>AVt,de:()=>yVt,en:()=>Ixe,eo:()=>EVt,es:()=>_Vt,fa:()=>vVt,fi:()=>CVt,fr:()=>bVt,frCA:()=>SVt,he:()=>TVt,hu:()=>IVt,id:()=>xVt,it:()=>wVt,ja:()=>RVt,kh:()=>PVt,ko:()=>kVt,mk:()=>DVt,ms:()=>NVt,nl:()=>MVt,no:()=>OVt,ota:()=>BVt,pl:()=>FVt,ps:()=>LVt,pt:()=>UVt,ru:()=>QVt,sl:()=>qVt,sv:()=>jVt,ta:()=>HVt,th:()=>GVt,tr:()=>$Vt,ua:()=>VVt,ur:()=>WVt,vi:()=>zVt,zhCN:()=>YVt,zhTW:()=>KVt});p();p();var KKo=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 pVt(){return{localeError:KKo()}}a(pVt,"default");p();var JKo=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 hVt(){return{localeError:JKo()}}a(hVt,"default");p();function hIn(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(hIn,"getBelarusianPlural");var ZKo=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=hIn(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=hIn(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 mVt(){return{localeError:ZKo()}}a(mVt,"default");p();var XKo=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 gVt(){return{localeError:XKo()}}a(gVt,"default");p();var eJo=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 AVt(){return{localeError:eJo()}}a(AVt,"default");p();var tJo=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 yVt(){return{localeError:tJo()}}a(yVt,"default");p();var rJo=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"),nJo=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 ${rJo(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 Ixe(){return{localeError:nJo()}}a(Ixe,"default");p();var iJo=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"),oJo=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 ${iJo(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 EVt(){return{localeError:oJo()}}a(EVt,"default");p();var sJo=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 _Vt(){return{localeError:sJo()}}a(_Vt,"default");p();var aJo=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 vVt(){return{localeError:aJo()}}a(vVt,"default");p();var cJo=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 CVt(){return{localeError:cJo()}}a(CVt,"default");p();var lJo=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 bVt(){return{localeError:lJo()}}a(bVt,"default");p();var uJo=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 SVt(){return{localeError:uJo()}}a(SVt,"default");p();var dJo=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 TVt(){return{localeError:dJo()}}a(TVt,"default");p();var fJo=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 IVt(){return{localeError:fJo()}}a(IVt,"default");p();var pJo=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 xVt(){return{localeError:pJo()}}a(xVt,"default");p();var hJo=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 wVt(){return{localeError:hJo()}}a(wVt,"default");p();var mJo=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 RVt(){return{localeError:mJo()}}a(RVt,"default");p();var gJo=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 PVt(){return{localeError:gJo()}}a(PVt,"default");p();var AJo=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 kVt(){return{localeError:AJo()}}a(kVt,"default");p();var yJo=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 DVt(){return{localeError:yJo()}}a(DVt,"default");p();var EJo=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 NVt(){return{localeError:EJo()}}a(NVt,"default");p();var _Jo=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 MVt(){return{localeError:_Jo()}}a(MVt,"default");p();var vJo=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 OVt(){return{localeError:vJo()}}a(OVt,"default");p();var CJo=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 BVt(){return{localeError:CJo()}}a(BVt,"default");p();var bJo=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 LVt(){return{localeError:bJo()}}a(LVt,"default");p();var SJo=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 FVt(){return{localeError:SJo()}}a(FVt,"default");p();var TJo=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 UVt(){return{localeError:TJo()}}a(UVt,"default");p();function mIn(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(mIn,"getRussianPlural");var IJo=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=mIn(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=mIn(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 QVt(){return{localeError:IJo()}}a(QVt,"default");p();var xJo=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 qVt(){return{localeError:xJo()}}a(qVt,"default");p();var wJo=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 jVt(){return{localeError:wJo()}}a(jVt,"default");p();var RJo=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 HVt(){return{localeError:RJo()}}a(HVt,"default");p();var PJo=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 GVt(){return{localeError:PJo()}}a(GVt,"default");p();var kJo=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"),DJo=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 ${kJo(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 $Vt(){return{localeError:DJo()}}a($Vt,"default");p();var NJo=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 VVt(){return{localeError:NJo()}}a(VVt,"default");p();var MJo=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 WVt(){return{localeError:MJo()}}a(WVt,"default");p();var OJo=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 zVt(){return{localeError:OJo()}}a(zVt,"default");p();var BJo=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 YVt(){return{localeError:BJo()}}a(YVt,"default");p();var LJo=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 KVt(){return{localeError:LJo()}}a(KVt,"default");p();var JVt=Symbol("ZodOutput"),ZVt=Symbol("ZodInput"),aue=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 OXe(){return new aue}a(OXe,"registry");var AO=OXe();p();p();function XVt(t,e){return new t({type:"string",...Tr(e)})}a(XVt,"_string");function eWt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(eWt,"_coercedString");function BXe(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(BXe,"_email");function wxe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(wxe,"_guid");function LXe(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(LXe,"_uuid");function FXe(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(FXe,"_uuidv4");function UXe(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(UXe,"_uuidv6");function QXe(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(QXe,"_uuidv7");function qXe(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(qXe,"_url");function jXe(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(jXe,"_emoji");function HXe(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(HXe,"_nanoid");function GXe(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(GXe,"_cuid");function $Xe(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a($Xe,"_cuid2");function VXe(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(VXe,"_ulid");function WXe(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(WXe,"_xid");function zXe(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(zXe,"_ksuid");function YXe(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(YXe,"_ipv4");function KXe(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(KXe,"_ipv6");function JXe(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(JXe,"_cidrv4");function ZXe(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(ZXe,"_cidrv6");function XXe(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(XXe,"_base64");function eet(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(eet,"_base64url");function tet(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(tet,"_e164");function ret(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(ret,"_jwt");var tWt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function rWt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(rWt,"_isoDateTime");function nWt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(nWt,"_isoDate");function iWt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(iWt,"_isoTime");function oWt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(oWt,"_isoDuration");function sWt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(sWt,"_number");function aWt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(aWt,"_coercedNumber");function cWt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(cWt,"_int");function lWt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(lWt,"_float32");function uWt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(uWt,"_float64");function dWt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(dWt,"_int32");function fWt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(fWt,"_uint32");function pWt(t,e){return new t({type:"boolean",...Tr(e)})}a(pWt,"_boolean");function hWt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(hWt,"_coercedBoolean");function mWt(t,e){return new t({type:"bigint",...Tr(e)})}a(mWt,"_bigint");function gWt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(gWt,"_coercedBigint");function AWt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(AWt,"_int64");function yWt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(yWt,"_uint64");function EWt(t,e){return new t({type:"symbol",...Tr(e)})}a(EWt,"_symbol");function _Wt(t,e){return new t({type:"undefined",...Tr(e)})}a(_Wt,"_undefined");function vWt(t,e){return new t({type:"null",...Tr(e)})}a(vWt,"_null");function CWt(t){return new t({type:"any"})}a(CWt,"_any");function cue(t){return new t({type:"unknown"})}a(cue,"_unknown");function bWt(t,e){return new t({type:"never",...Tr(e)})}a(bWt,"_never");function SWt(t,e){return new t({type:"void",...Tr(e)})}a(SWt,"_void");function TWt(t,e){return new t({type:"date",...Tr(e)})}a(TWt,"_date");function IWt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(IWt,"_coercedDate");function xWt(t,e){return new t({type:"nan",...Tr(e)})}a(xWt,"_nan");function w3(t,e){return new wXe({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(w3,"_lt");function Gx(t,e){return new wXe({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(Gx,"_lte");function R3(t,e){return new RXe({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(R3,"_gt");function BC(t,e){return new RXe({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(BC,"_gte");function wWt(t){return R3(0,t)}a(wWt,"_positive");function RWt(t){return w3(0,t)}a(RWt,"_negative");function PWt(t){return Gx(0,t)}a(PWt,"_nonpositive");function kWt(t){return BC(0,t)}a(kWt,"_nonnegative");function OK(t,e){return new $Gt({check:"multiple_of",...Tr(e),value:t})}a(OK,"_multipleOf");function lue(t,e){return new zGt({check:"max_size",...Tr(e),maximum:t})}a(lue,"_maxSize");function BK(t,e){return new YGt({check:"min_size",...Tr(e),minimum:t})}a(BK,"_minSize");function Rxe(t,e){return new KGt({check:"size_equals",...Tr(e),size:t})}a(Rxe,"_size");function uue(t,e){return new JGt({check:"max_length",...Tr(e),maximum:t})}a(uue,"_maxLength");function cq(t,e){return new ZGt({check:"min_length",...Tr(e),minimum:t})}a(cq,"_minLength");function due(t,e){return new XGt({check:"length_equals",...Tr(e),length:t})}a(due,"_length");function Pxe(t,e){return new e$t({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(Pxe,"_regex");function kxe(t){return new t$t({check:"string_format",format:"lowercase",...Tr(t)})}a(kxe,"_lowercase");function Dxe(t){return new r$t({check:"string_format",format:"uppercase",...Tr(t)})}a(Dxe,"_uppercase");function Nxe(t,e){return new n$t({check:"string_format",format:"includes",...Tr(e),includes:t})}a(Nxe,"_includes");function Mxe(t,e){return new i$t({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(Mxe,"_startsWith");function Oxe(t,e){return new o$t({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(Oxe,"_endsWith");function DWt(t,e,r){return new s$t({check:"property",property:t,schema:e,...Tr(r)})}a(DWt,"_property");function Bxe(t,e){return new a$t({check:"mime_type",mime:t,...Tr(e)})}a(Bxe,"_mime");function P3(t){return new c$t({check:"overwrite",tx:t})}a(P3,"_overwrite");function Lxe(t){return P3(e=>e.normalize(t))}a(Lxe,"_normalize");function Fxe(){return P3(t=>t.trim())}a(Fxe,"_trim");function Uxe(){return P3(t=>t.toLowerCase())}a(Uxe,"_toLowerCase");function Qxe(){return P3(t=>t.toUpperCase())}a(Qxe,"_toUpperCase");function qxe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(qxe,"_array");function FJo(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(FJo,"_union");function UJo(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(UJo,"_discriminatedUnion");function QJo(t,e,r){return new t({type:"intersection",left:e,right:r})}a(QJo,"_intersection");function NWt(t,e,r,n){let o=r instanceof lo,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(NWt,"_tuple");function qJo(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(qJo,"_record");function jJo(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(jJo,"_map");function HJo(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(HJo,"_set");function GJo(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(GJo,"_enum");function $Jo(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a($Jo,"_nativeEnum");function VJo(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(VJo,"_literal");function MWt(t,e){return new t({type:"file",...Tr(e)})}a(MWt,"_file");function WJo(t,e){return new t({type:"transform",transform:e})}a(WJo,"_transform");function zJo(t,e){return new t({type:"optional",innerType:e})}a(zJo,"_optional");function YJo(t,e){return new t({type:"nullable",innerType:e})}a(YJo,"_nullable");function KJo(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(KJo,"_default");function JJo(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(JJo,"_nonoptional");function ZJo(t,e){return new t({type:"success",innerType:e})}a(ZJo,"_success");function XJo(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(XJo,"_catch");function eZo(t,e,r){return new t({type:"pipe",in:e,out:r})}a(eZo,"_pipe");function tZo(t,e){return new t({type:"readonly",innerType:e})}a(tZo,"_readonly");function rZo(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(rZo,"_templateLiteral");function nZo(t,e){return new t({type:"lazy",getter:e})}a(nZo,"_lazy");function iZo(t,e){return new t({type:"promise",innerType:e})}a(iZo,"_promise");function OWt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(OWt,"_custom");function BWt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(BWt,"_refine");function LWt(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??Txe,u=t.Boolean??Cxe,d=t.String??NK,f=t.Transform??Sxe,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(LWt,"_stringbool");function FWt(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(FWt,"_stringFormat");var net=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?yxe(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?yxe(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 Exe(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?Exe(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 MK({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 UWt(t){return new net({type:"function",input:Array.isArray(t?.input)?NWt(MK,t?.input):t?.input??qxe(bxe,cue(sue)),output:t?.output??cue(sue)})}a(UWt,"_function");p();var jxe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??AO,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=lxe(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"&&em(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 Vzt(t,e){if(t instanceof kue){let n=new ywe(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 ywe(e);return r.process(t),r.emit(t,e)}a(Vzt,"toJSONSchema");function em(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 em(o.element,r);case"object":{for(let s in o.shape)if(em(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(em(s,r))return!0;return!1}case"intersection":return em(o.left,r)||em(o.right,r);case"tuple":{for(let s of o.items)if(em(s,r))return!0;return!!(o.rest&&em(o.rest,r))}case"record":return em(o.keyType,r)||em(o.valueType,r);case"map":return em(o.keyType,r)||em(o.valueType,r);case"set":return em(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return em(o.innerType,r);case"lazy":return em(o.getter(),r);case"default":return em(o.innerType,r);case"prefault":return em(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return em(o.in,r)||em(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(em,"isTransforming");var twn={};p();p();p();var Oue={};wi(Oue,{ZodISODate:()=>Ket,ZodISODateTime:()=>Yet,ZodISODuration:()=>Zet,ZodISOTime:()=>Jet,date:()=>zzt,datetime:()=>Wzt,duration:()=>Kzt,time:()=>Yzt});p();var Yet=it("ZodISODateTime",(t,e)=>{wVt.init(t,e),mu.init(t,e)});function Wzt(t){return czt(Yet,t)}a(Wzt,"datetime");var Ket=it("ZodISODate",(t,e)=>{RVt.init(t,e),mu.init(t,e)});function zzt(t){return lzt(Ket,t)}a(zzt,"date");var Jet=it("ZodISOTime",(t,e)=>{kVt.init(t,e),mu.init(t,e)});function Yzt(t){return uzt(Jet,t)}a(Yzt,"time");var Zet=it("ZodISODuration",(t,e)=>{PVt.init(t,e),mu.init(t,e)});function Kzt(t){return dzt(Zet,t)}a(Kzt,"duration");p();p();var nwn=a((t,e)=>{$xe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>Wxe(t,r),"value")},flatten:{value:a(r=>Vxe(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"),frs=it("ZodError",nwn),Bue=it("ZodError",nwn,{Parent:Error});var Jzt=pet(Bue),Zzt=het(Bue),Xzt=met(Bue),eYt=get(Bue);var Is=it("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)=>HS(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>Jzt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Xzt(t,r,n),t.parseAsync=async(r,n)=>Zzt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>eYt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Lwn(r,n)),t.superRefine=r=>t.check(Fwn(r)),t.overwrite=r=>t.check(G3(r)),t.optional=()=>gu(t),t.nullable=()=>ett(t),t.nullish=()=>gu(ett(t)),t.nonoptional=r=>Twn(t,r),t.array=()=>Fr(t),t.or=r=>Cl([t,r]),t.and=r=>Swe(t,r),t.transform=r=>ttt(t,IYt(r)),t.default=r=>vwn(t,r),t.prefault=r=>Swn(t,r),t.catch=r=>wwn(t,r),t.pipe=r=>ttt(t,r),t.readonly=()=>Pwn(t),t.describe=r=>{let n=t.clone();return RO.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return RO.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return RO.get(t);let n=t.clone();return RO.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),rYt=it("_ZodString",(t,e)=>{ZK.init(t,e),Is.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(swe(...n)),t.includes=(...n)=>t.check(lwe(...n)),t.startsWith=(...n)=>t.check(uwe(...n)),t.endsWith=(...n)=>t.check(dwe(...n)),t.min=(...n)=>t.check(Iq(...n)),t.max=(...n)=>t.check(Nue(...n)),t.length=(...n)=>t.check(Mue(...n)),t.nonempty=(...n)=>t.check(Iq(1,...n)),t.lowercase=n=>t.check(awe(n)),t.uppercase=n=>t.check(cwe(n)),t.trim=()=>t.check(hwe()),t.normalize=(...n)=>t.check(pwe(...n)),t.toLowerCase=()=>t.check(mwe()),t.toUpperCase=()=>t.check(gwe())}),_we=it("ZodString",(t,e)=>{ZK.init(t,e),rYt.init(t,e),t.email=r=>t.check(xet(nYt,r)),t.url=r=>t.check(Det(iYt,r)),t.jwt=r=>t.check(Wet(_Yt,r)),t.emoji=r=>t.check(Net(sYt,r)),t.guid=r=>t.check(iwe(Xet,r)),t.uuid=r=>t.check(wet(V3,r)),t.uuidv4=r=>t.check(Ret(V3,r)),t.uuidv6=r=>t.check(ket(V3,r)),t.uuidv7=r=>t.check(Pet(V3,r)),t.nanoid=r=>t.check(Met(aYt,r)),t.guid=r=>t.check(iwe(Xet,r)),t.cuid=r=>t.check(Oet(cYt,r)),t.cuid2=r=>t.check(Bet(lYt,r)),t.ulid=r=>t.check(Let(uYt,r)),t.base64=r=>t.check(Get(AYt,r)),t.base64url=r=>t.check($et(yYt,r)),t.xid=r=>t.check(Fet(dYt,r)),t.ksuid=r=>t.check(Uet(fYt,r)),t.ipv4=r=>t.check(Qet(pYt,r)),t.ipv6=r=>t.check(qet(hYt,r)),t.cidrv4=r=>t.check(jet(mYt,r)),t.cidrv6=r=>t.check(Het(gYt,r)),t.e164=r=>t.check(Vet(EYt,r)),t.datetime=r=>t.check(Wzt(r)),t.date=r=>t.check(zzt(r)),t.time=r=>t.check(Yzt(r)),t.duration=r=>t.check(Kzt(r))});function qe(t){return ozt(_we,t)}a(qe,"string");var mu=it("ZodStringFormat",(t,e)=>{ql.init(t,e),rYt.init(t,e)}),nYt=it("ZodEmail",(t,e)=>{EVt.init(t,e),mu.init(t,e)});function hrs(t){return xet(nYt,t)}a(hrs,"email");var Xet=it("ZodGUID",(t,e)=>{AVt.init(t,e),mu.init(t,e)});function mrs(t){return iwe(Xet,t)}a(mrs,"guid");var V3=it("ZodUUID",(t,e)=>{yVt.init(t,e),mu.init(t,e)});function grs(t){return wet(V3,t)}a(grs,"uuid");function Ars(t){return Ret(V3,t)}a(Ars,"uuidv4");function yrs(t){return ket(V3,t)}a(yrs,"uuidv6");function Ers(t){return Pet(V3,t)}a(Ers,"uuidv7");var iYt=it("ZodURL",(t,e)=>{_Vt.init(t,e),mu.init(t,e)});function oYt(t){return Det(iYt,t)}a(oYt,"url");var sYt=it("ZodEmoji",(t,e)=>{CVt.init(t,e),mu.init(t,e)});function _rs(t){return Net(sYt,t)}a(_rs,"emoji");var aYt=it("ZodNanoID",(t,e)=>{vVt.init(t,e),mu.init(t,e)});function Crs(t){return Met(aYt,t)}a(Crs,"nanoid");var cYt=it("ZodCUID",(t,e)=>{bVt.init(t,e),mu.init(t,e)});function vrs(t){return Oet(cYt,t)}a(vrs,"cuid");var lYt=it("ZodCUID2",(t,e)=>{SVt.init(t,e),mu.init(t,e)});function brs(t){return Bet(lYt,t)}a(brs,"cuid2");var uYt=it("ZodULID",(t,e)=>{TVt.init(t,e),mu.init(t,e)});function Srs(t){return Let(uYt,t)}a(Srs,"ulid");var dYt=it("ZodXID",(t,e)=>{IVt.init(t,e),mu.init(t,e)});function Trs(t){return Fet(dYt,t)}a(Trs,"xid");var fYt=it("ZodKSUID",(t,e)=>{xVt.init(t,e),mu.init(t,e)});function Irs(t){return Uet(fYt,t)}a(Irs,"ksuid");var pYt=it("ZodIPv4",(t,e)=>{DVt.init(t,e),mu.init(t,e)});function xrs(t){return Qet(pYt,t)}a(xrs,"ipv4");var hYt=it("ZodIPv6",(t,e)=>{NVt.init(t,e),mu.init(t,e)});function wrs(t){return qet(hYt,t)}a(wrs,"ipv6");var mYt=it("ZodCIDRv4",(t,e)=>{MVt.init(t,e),mu.init(t,e)});function Rrs(t){return jet(mYt,t)}a(Rrs,"cidrv4");var gYt=it("ZodCIDRv6",(t,e)=>{OVt.init(t,e),mu.init(t,e)});function krs(t){return Het(gYt,t)}a(krs,"cidrv6");var AYt=it("ZodBase64",(t,e)=>{LVt.init(t,e),mu.init(t,e)});function Prs(t){return Get(AYt,t)}a(Prs,"base64");var yYt=it("ZodBase64URL",(t,e)=>{FVt.init(t,e),mu.init(t,e)});function Drs(t){return $et(yYt,t)}a(Drs,"base64url");var EYt=it("ZodE164",(t,e)=>{UVt.init(t,e),mu.init(t,e)});function Nrs(t){return Vet(EYt,t)}a(Nrs,"e164");var _Yt=it("ZodJWT",(t,e)=>{QVt.init(t,e),mu.init(t,e)});function Mrs(t){return Wet(_Yt,t)}a(Mrs,"jwt");var iwn=it("ZodCustomStringFormat",(t,e)=>{qVt.init(t,e),mu.init(t,e)});function Ors(t,e,r={}){return Gzt(iwn,t,e,r)}a(Ors,"stringFormat");var Cwe=it("ZodNumber",(t,e)=>{vet.init(t,e),Is.init(t,e),t.gt=(n,o)=>t.check(H3(n,o)),t.gte=(n,o)=>t.check(jv(n,o)),t.min=(n,o)=>t.check(jv(n,o)),t.lt=(n,o)=>t.check(j3(n,o)),t.lte=(n,o)=>t.check(Jx(n,o)),t.max=(n,o)=>t.check(Jx(n,o)),t.int=n=>t.check(tYt(n)),t.safe=n=>t.check(tYt(n)),t.positive=n=>t.check(H3(0,n)),t.nonnegative=n=>t.check(jv(0,n)),t.negative=n=>t.check(j3(0,n)),t.nonpositive=n=>t.check(Jx(0,n)),t.multipleOf=(n,o)=>t.check(eJ(n,o)),t.step=(n,o)=>t.check(eJ(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 Ra(t){return fzt(Cwe,t)}a(Ra,"number");var Lue=it("ZodNumberFormat",(t,e)=>{jVt.init(t,e),Cwe.init(t,e)});function tYt(t){return hzt(Lue,t)}a(tYt,"int");function Brs(t){return mzt(Lue,t)}a(Brs,"float32");function Lrs(t){return gzt(Lue,t)}a(Lrs,"float64");function Frs(t){return Azt(Lue,t)}a(Frs,"int32");function Urs(t){return yzt(Lue,t)}a(Urs,"uint32");var vwe=it("ZodBoolean",(t,e)=>{Zxe.init(t,e),Is.init(t,e)});function tl(t){return Ezt(vwe,t)}a(tl,"boolean");var bwe=it("ZodBigInt",(t,e)=>{bet.init(t,e),Is.init(t,e),t.gte=(n,o)=>t.check(jv(n,o)),t.min=(n,o)=>t.check(jv(n,o)),t.gt=(n,o)=>t.check(H3(n,o)),t.gte=(n,o)=>t.check(jv(n,o)),t.min=(n,o)=>t.check(jv(n,o)),t.lt=(n,o)=>t.check(j3(n,o)),t.lte=(n,o)=>t.check(Jx(n,o)),t.max=(n,o)=>t.check(Jx(n,o)),t.positive=n=>t.check(H3(BigInt(0),n)),t.negative=n=>t.check(j3(BigInt(0),n)),t.nonpositive=n=>t.check(Jx(BigInt(0),n)),t.nonnegative=n=>t.check(jv(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(eJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Qrs(t){return Czt(bwe,t)}a(Qrs,"bigint");var CYt=it("ZodBigIntFormat",(t,e)=>{HVt.init(t,e),bwe.init(t,e)});function qrs(t){return bzt(CYt,t)}a(qrs,"int64");function jrs(t){return Szt(CYt,t)}a(jrs,"uint64");var own=it("ZodSymbol",(t,e)=>{GVt.init(t,e),Is.init(t,e)});function Hrs(t){return Tzt(own,t)}a(Hrs,"symbol");var swn=it("ZodUndefined",(t,e)=>{$Vt.init(t,e),Is.init(t,e)});function Grs(t){return Izt(swn,t)}a(Grs,"_undefined");var awn=it("ZodNull",(t,e)=>{VVt.init(t,e),Is.init(t,e)});function rtt(t){return xzt(awn,t)}a(rtt,"_null");var cwn=it("ZodAny",(t,e)=>{WVt.init(t,e),Is.init(t,e)});function vYt(){return wzt(cwn)}a(vYt,"any");var lwn=it("ZodUnknown",(t,e)=>{Rue.init(t,e),Is.init(t,e)});function Zu(){return Pue(lwn)}a(Zu,"unknown");var uwn=it("ZodNever",(t,e)=>{zVt.init(t,e),Is.init(t,e)});function ntt(t){return Rzt(uwn,t)}a(ntt,"never");var dwn=it("ZodVoid",(t,e)=>{YVt.init(t,e),Is.init(t,e)});function $rs(t){return kzt(dwn,t)}a($rs,"_void");var itt=it("ZodDate",(t,e)=>{KVt.init(t,e),Is.init(t,e),t.min=(n,o)=>t.check(jv(n,o)),t.max=(n,o)=>t.check(Jx(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 Vrs(t){return Pzt(itt,t)}a(Vrs,"date");var fwn=it("ZodArray",(t,e)=>{Xxe.init(t,e),Is.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Iq(r,n)),t.nonempty=r=>t.check(Iq(1,r)),t.max=(r,n)=>t.check(Nue(r,n)),t.length=(r,n)=>t.check(Mue(r,n)),t.unwrap=()=>t.element});function Fr(t,e){return Awe(fwn,t,e)}a(Fr,"array");function Wrs(t){let e=t._zod.def.shape;return Hn(Object.keys(e))}a(Wrs,"keyof");var ott=it("ZodObject",(t,e)=>{JVt.init(t,e),Is.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Q_(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Zu()}),t.loose=()=>t.clone({...t._zod.def,catchall:Zu()}),t.strict=()=>t.clone({...t._zod.def,catchall:ntt()}),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(xYt,t,r[0]),t.required=(...r)=>qr.required(wYt,t,r[0])});function Wr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new ott(r)}a(Wr,"object");function zrs(t,e){return new ott({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:ntt(),...qr.normalizeParams(e)})}a(zrs,"strictObject");function Yh(t,e){return new ott({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Zu(),...qr.normalizeParams(e)})}a(Yh,"looseObject");var bYt=it("ZodUnion",(t,e)=>{Tet.init(t,e),Is.init(t,e),t.options=e.options});function Cl(t,e){return new bYt({type:"union",options:t,...qr.normalizeParams(e)})}a(Cl,"union");var pwn=it("ZodDiscriminatedUnion",(t,e)=>{bYt.init(t,e),ZVt.init(t,e)});function stt(t,e,r){return new pwn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(stt,"discriminatedUnion");var hwn=it("ZodIntersection",(t,e)=>{XVt.init(t,e),Is.init(t,e)});function Swe(t,e){return new hwn({type:"intersection",left:t,right:e})}a(Swe,"intersection");var mwn=it("ZodTuple",(t,e)=>{XK.init(t,e),Is.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Yrs(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new mwn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(Yrs,"tuple");var SYt=it("ZodRecord",(t,e)=>{eWt.init(t,e),Is.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function vl(t,e,r){return new SYt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(vl,"record");function Krs(t,e,r){return new SYt({type:"record",keyType:Cl([t,ntt()]),valueType:e,...qr.normalizeParams(r)})}a(Krs,"partialRecord");var gwn=it("ZodMap",(t,e)=>{tWt.init(t,e),Is.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function Jrs(t,e,r){return new gwn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(Jrs,"map");var Awn=it("ZodSet",(t,e)=>{rWt.init(t,e),Is.init(t,e),t.min=(...r)=>t.check(tJ(...r)),t.nonempty=r=>t.check(tJ(1,r)),t.max=(...r)=>t.check(Due(...r)),t.size=(...r)=>t.check(owe(...r))});function Zrs(t,e){return new Awn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(Zrs,"set");var Ewe=it("ZodEnum",(t,e)=>{nWt.init(t,e),Is.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 Ewe({...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 Ewe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function Q_(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Ewe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(Q_,"_enum");function Xrs(t,e){return new Ewe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(Xrs,"nativeEnum");var ywn=it("ZodLiteral",(t,e)=>{iWt.init(t,e),Is.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 Hn(t,e){return new ywn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Hn,"literal");var Ewn=it("ZodFile",(t,e)=>{oWt.init(t,e),Is.init(t,e),t.min=(r,n)=>t.check(tJ(r,n)),t.max=(r,n)=>t.check(Due(r,n)),t.mime=(r,n)=>t.check(fwe(Array.isArray(r)?r:[r],n))});function ens(t){return Qzt(Ewn,t)}a(ens,"file");var TYt=it("ZodTransform",(t,e)=>{ewe.init(t,e),Is.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 IYt(t){return new TYt({type:"transform",transform:t})}a(IYt,"transform");var xYt=it("ZodOptional",(t,e)=>{sWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function gu(t){return new xYt({type:"optional",innerType:t})}a(gu,"optional");var _wn=it("ZodNullable",(t,e)=>{aWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ett(t){return new _wn({type:"nullable",innerType:t})}a(ett,"nullable");function tns(t){return gu(ett(t))}a(tns,"nullish");var Cwn=it("ZodDefault",(t,e)=>{cWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function vwn(t,e){return new Cwn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(vwn,"_default");var bwn=it("ZodPrefault",(t,e)=>{lWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Swn(t,e){return new bwn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(Swn,"prefault");var wYt=it("ZodNonOptional",(t,e)=>{uWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Twn(t,e){return new wYt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(Twn,"nonoptional");var Iwn=it("ZodSuccess",(t,e)=>{dWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function rns(t){return new Iwn({type:"success",innerType:t})}a(rns,"success");var xwn=it("ZodCatch",(t,e)=>{fWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function wwn(t,e){return new xwn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(wwn,"_catch");var Rwn=it("ZodNaN",(t,e)=>{pWt.init(t,e),Is.init(t,e)});function nns(t){return Nzt(Rwn,t)}a(nns,"nan");var RYt=it("ZodPipe",(t,e)=>{twe.init(t,e),Is.init(t,e),t.in=e.in,t.out=e.out});function ttt(t,e){return new RYt({type:"pipe",in:t,out:e})}a(ttt,"pipe");var kwn=it("ZodReadonly",(t,e)=>{hWt.init(t,e),Is.init(t,e)});function Pwn(t){return new kwn({type:"readonly",innerType:t})}a(Pwn,"readonly");var Dwn=it("ZodTemplateLiteral",(t,e)=>{mWt.init(t,e),Is.init(t,e)});function ins(t,e){return new Dwn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(ins,"templateLiteral");var Nwn=it("ZodLazy",(t,e)=>{AWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.getter()});function Mwn(t){return new Nwn({type:"lazy",getter:t})}a(Mwn,"lazy");var Own=it("ZodPromise",(t,e)=>{gWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ons(t){return new Own({type:"promise",innerType:t})}a(ons,"promise");var att=it("ZodCustom",(t,e)=>{yWt.init(t,e),Is.init(t,e)});function Bwn(t){let e=new mf({check:"custom"});return e._zod.check=t,e}a(Bwn,"check");function kYt(t,e){return qzt(att,t??(()=>!0),e)}a(kYt,"custom");function Lwn(t,e={}){return jzt(att,t,e)}a(Lwn,"refine");function Fwn(t){let e=Bwn(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(Fwn,"superRefine");function sns(t,e={error:`Input not instance of ${t.name}`}){let r=new att({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(sns,"_instanceof");var ans=a((...t)=>Hzt({Pipe:RYt,Boolean:vwe,String:_we,Transform:TYt},...t),"stringbool");function cns(t){let e=Mwn(()=>Cl([qe(t),Ra(),tl(),rtt(),Fr(e),vl(qe(),e)]));return e}a(cns,"json");function ctt(t,e){return ttt(IYt(t),e)}a(ctt,"preprocess");p();var PYt={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 lns(t){zh({customError:t})}a(lns,"setErrorMap");function uns(){return zh().customError}a(uns,"getErrorMap");var Twe={};wi(Twe,{bigint:()=>hns,boolean:()=>pns,date:()=>mns,number:()=>fns,string:()=>dns});p();function dns(t){return szt(_we,t)}a(dns,"string");function fns(t){return pzt(Cwe,t)}a(fns,"number");function pns(t){return _zt(vwe,t)}a(pns,"boolean");function hns(t){return vzt(bwe,t)}a(hns,"bigint");function mns(t){return Dzt(itt,t)}a(mns,"date");zh(rwe());p();var si={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"},gf={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"},ltt=1;p();var Ans=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminal:P.boolean().optional().default(!1)}),yns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),label:P.string().nullish(),name:P.string(),optional:P.boolean().optional().default(!1),secret:P.boolean().optional().default(!0)}),Ens=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),name:P.string()}),_ns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),link:P.string().nullish(),name:P.string(),vars:P.array(yns)}),Cns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),description:P.string().nullish(),env:P.record(P.string(),P.string()).optional(),id:P.string(),name:P.string()}),vns=P.union([_ns.and(P.object({type:P.literal("env_var")})),Cns.and(P.object({type:P.literal("terminal")})),Ens]),NYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),methodId:P.string()}),bns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Sns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),blob:P.string(),mimeType:P.string().nullish(),uri:P.string()}),Tns=P.object({default:P.boolean().nullish(),description:P.string().nullish(),title:P.string().nullish()}),Ins=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),xns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),wns=P.object({amount:P.number(),currency:P.string()}),Rns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),kns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Pns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),newText:P.string(),oldText:P.string().nullish(),path:P.string()}),MYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string()}),Dns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Nns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Mns=P.union([P.string(),P.number(),P.number(),P.boolean(),P.array(P.string())]),Ons=P.object({content:P.record(P.string(),Mns).nullish()}),Bns=P.intersection(P.union([Ons.and(P.object({action:P.literal("accept")})),P.object({action:P.literal("decline")}),P.object({action:P.literal("cancel")})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish()})),Lns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Uwn=P.string(),OYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),elicitationId:Uwn}),Fns=P.literal("object"),Uns=P.literal("string"),Qns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),qns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),form:Lns.nullish(),url:Qns.nullish()}),Qwn=P.object({const:P.string(),title:P.string()}),qwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),jns=P.union([P.literal(-32700),P.literal(-32600),P.literal(-32601),P.literal(-32602),P.literal(-32603),P.literal(-32800),P.literal(-32e3),P.literal(-32002),P.literal(-32042),P.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),jwn=P.object({code:jns,data:P.unknown().optional(),message:P.string()}),Hwn=P.unknown(),Gwn=P.unknown(),$wn=P.unknown(),Hns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),readTextFile:P.boolean().optional().default(!1),writeTextFile:P.boolean().optional().default(!1)}),Vwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),Wwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),title:P.string().nullish(),version:P.string()}),Gns=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),$ns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),BYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),LYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cursor:P.string().nullish(),cwd:P.string().nullish()}),FYt=P.union([P.literal("anthropic"),P.literal("openai"),P.literal("azure"),P.literal("vertex"),P.literal("bedrock"),P.string()]),Vns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Wns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),logout:Vns.nullish()}),UYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),zns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Yns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acp:P.boolean().optional().default(!1),http:P.boolean().optional().default(!1),sse:P.boolean().optional().default(!1)}),utt=P.string(),Kns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt}),Jns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt}),zwn=P.string(),Zns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acpId:zwn}),Xns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:zwn,name:P.string()}),eis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(Vwn),name:P.string(),url:P.string()}),tis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(Vwn),name:P.string(),url:P.string()}),ris=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()),command:P.string(),env:P.array(qwn),name:P.string()}),dtt=P.union([eis.and(P.object({type:P.literal("http")})),tis.and(P.object({type:P.literal("sse")})),Xns.and(P.object({type:P.literal("acp")})),ris]),Ywn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),Kwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),Jwn=P.unknown(),QYt=P.string(),nis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),modelId:QYt,name:P.string()}),iis=P.union([P.literal("error"),P.literal("warning"),P.literal("information"),P.literal("hint")]),ois=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),sis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ais=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),cis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),lis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),uis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),dis=P.object({diff:P.string(),uri:P.string()}),fis=P.object({endLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:P.string()}),pis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),his=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),mis=P.object({languageId:P.string(),text:P.string(),uri:P.string()}),gis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Ais=P.union([P.literal("rejected"),P.literal("ignored"),P.literal("replaced"),P.literal("cancelled")]),yis=P.object({excerpts:P.array(fis),uri:P.string()}),Eis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),_is=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Cis=P.object({name:P.string(),owner:P.string(),remoteUrl:P.string()}),vis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),bis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),jump:pis.nullish(),rename:_is.nullish(),searchAndReplace:vis.nullish()}),Sis=P.object({id:P.string(),isRegex:P.boolean().nullish(),replace:P.string(),search:P.string(),uri:P.string()}),Tis=P.union([P.literal("automatic"),P.literal("diagnostic"),P.literal("manual")]),Iis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),xis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:ois.nullish(),editHistory:uis.nullish(),openFiles:his.nullish(),recentFiles:gis.nullish(),relatedSnippets:Eis.nullish(),userActions:Iis.nullish()}),qYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt)}),wis=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),Zwn=P.string(),Ris=P.union([P.literal("allow_once"),P.literal("allow_always"),P.literal("reject_once"),P.literal("reject_always")]),kis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),kind:Ris,name:P.string(),optionId:Zwn}),Pis=P.union([P.literal("high"),P.literal("medium"),P.literal("low")]),Dis=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed")]),Nis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),priority:Pis,status:Dis}),Mis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),entries:P.array(Nis)}),xq=P.object({character:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),Ois=P.object({id:P.string(),position:xq,uri:P.string()}),Bis=P.object({id:P.string(),newName:P.string(),position:xq,uri:P.string()}),Lis=P.object({action:P.string(),position:xq,timestampMs:P.number(),uri:P.string()}),Xwn=P.union([P.literal("utf-16"),P.literal("utf-32"),P.literal("utf-8")]),Fis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:Ans.optional().default({terminal:!1}),elicitation:qns.nullish(),fs:Hns.optional().default({readTextFile:!1,writeTextFile:!1}),nes:bis.nullish(),positionEncodings:P.array(Xwn).optional(),terminal:P.boolean().optional().default(!1)}),Uis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audio:P.boolean().optional().default(!1),embeddedContext:P.boolean().optional().default(!1),image:P.boolean().optional().default(!1)}),eRn=P.number().int().gte(0).lte(65535),jYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),clientCapabilities:Fis.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:Wwn.nullish(),protocolVersion:eRn}),Qis=P.object({apiType:FYt,baseUrl:P.string()}),qis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),current:Qis.nullish(),id:P.string(),required:P.boolean(),supported:P.array(FYt)}),jis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),providers:P.array(qis)}),His=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Fue=P.object({end:xq,start:xq}),Gis=P.object({message:P.string(),range:Fue,severity:iis,uri:P.string()}),$is=P.object({languageId:P.string(),lastFocusedMs:P.number().nullish(),uri:P.string(),visibleRange:Fue.nullish()}),Vis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:P.array(Gis).nullish(),editHistory:P.array(dis).nullish(),openFiles:P.array($is).nullish(),recentFiles:P.array(mis).nullish(),relatedSnippets:P.array(yis).nullish(),userActions:P.array(Lis).nullish()}),Wis=P.object({newText:P.string(),range:Fue}),zis=P.object({cursorPosition:xq.nullish(),edits:P.array(Wis),id:P.string(),uri:P.string()}),Yis=P.union([zis.and(P.object({kind:P.literal("edit")})),Ois.and(P.object({kind:P.literal("jump")})),Bis.and(P.object({kind:P.literal("rename")})),Sis.and(P.object({kind:P.literal("searchAndReplace")}))]),Kis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string()}),Jis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),wq=P.union([P.number(),P.string()]).nullable(),dHd=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),requestId:wq}),tRn=P.object({requestId:wq}),Zis=P.enum(["assistant","user"]),Iwe=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audience:P.array(Zis).nullish(),lastModified:P.string().nullish(),priority:P.number().nullish()}),Xis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),data:P.string(),mimeType:P.string()}),eos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),data:P.string(),mimeType:P.string(),uri:P.string().nullish()}),tos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),description:P.string().nullish(),mimeType:P.string().nullish(),name:P.string(),size:P.number().nullish(),title:P.string().nullish(),uri:P.string()}),ros=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),optionId:Zwn}),nos=P.union([P.object({outcome:P.literal("cancelled")}),ros.and(P.object({outcome:P.literal("selected")}))]),ios=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),outcome:nos}),oos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),sos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),aos=P.object({currentValue:P.boolean()}),cos=P.string(),rRn=P.string(),los=P.union([P.literal("mode"),P.literal("model"),P.literal("thought_level"),P.string()]),HYt=P.string(),nRn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),name:P.string(),value:HYt}),uos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),group:cos,name:P.string(),options:P.array(nRn)}),dos=P.union([P.array(nRn),P.array(uos)]),fos=P.object({currentValue:HYt,options:dos}),Uue=P.intersection(P.union([fos.and(P.object({type:P.literal("select")})),aos.and(P.object({type:P.literal("boolean")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),category:los.nullish(),description:P.string().nullish(),id:rRn,name:P.string()})),pos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue)}),hos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),mos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),nc=P.string(),GYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),sessionId:nc}),$Yt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),VYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),WYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),zYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),command:P.string(),cwd:P.string().nullish(),env:P.array(qwn).optional(),outputByteLimit:P.number().nullish(),sessionId:nc}),YYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),KYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,uri:P.string()}),JYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),position:xq,sessionId:nc,uri:P.string(),version:P.number(),visibleRange:Fue}),ZYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),languageId:P.string(),sessionId:nc,text:P.string(),uri:P.string(),version:P.number()}),XYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,uri:P.string()}),eKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt).optional(),sessionId:nc}),tKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),rKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt),sessionId:nc}),nKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),limit:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string(),sessionId:nc}),iKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),reason:Ais.nullish(),sessionId:nc}),oKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),sKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt).optional(),sessionId:nc}),gos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),sessionId:nc,title:P.string().nullish(),updatedAt:P.string().nullish()}),Aos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),nextCursor:P.string().nullish(),sessions:P.array(gos)}),yos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),title:P.string().nullish(),updatedAt:P.string().nullish()}),Eos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ftt=P.string(),_os=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),currentModeId:ftt}),Cos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:ftt,name:P.string()}),ptt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModes:P.array(Cos),currentModeId:ftt}),htt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModels:P.array(nis),currentModelId:QYt}),vos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish(),sessionId:nc}),bos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish()}),Sos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish(),sessionId:nc}),Tos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish()}),Ios=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),xos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:oos.nullish(),close:sos.nullish(),delete:hos.nullish(),fork:mos.nullish(),list:Eos.nullish(),resume:Ios.nullish()}),aKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),apiType:FYt,baseUrl:P.string(),headers:P.record(P.string(),P.string()).optional(),id:P.string()}),wos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),cKt=P.intersection(P.union([P.object({type:P.literal("boolean"),value:P.boolean()}),P.object({value:HYt})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configId:rRn,sessionId:nc})),Ros=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue)}),lKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modeId:ftt,sessionId:nc}),kos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),uKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modelId:QYt,sessionId:nc}),Pos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Dos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),Nos=P.union([P.literal("end_turn"),P.literal("max_tokens"),P.literal("max_turn_requests"),P.literal("refusal"),P.literal("cancelled")]),Mos=P.union([P.literal("email"),P.literal("uri"),P.literal("date"),P.literal("date-time")]),Oos=P.object({default:P.string().nullish(),description:P.string().nullish(),enum:P.array(P.string()).nullish(),format:Mos.nullish(),maxLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:P.array(Qwn).nullish(),pattern:P.string().nullish(),title:P.string().nullish()}),dKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:Vis.nullish(),position:xq,selection:Fue.nullish(),sessionId:nc,triggerKind:Tis,uri:P.string(),version:P.number()}),Bos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),suggestions:P.array(Yis)}),Los=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),Fos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),fKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),Uos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitStatus:Fos.nullish(),output:P.string(),truncated:P.boolean()}),Qos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),text:P.string()}),qos=P.object({range:Fue.nullish(),text:P.string()}),pKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),contentChanges:P.array(qos),sessionId:nc,uri:P.string(),version:P.number()}),fHd=P.object({method:P.string(),params:P.union([$Yt,ZYt,pKt,KYt,XYt,JYt,GYt,iKt,Ywn,Hwn]).nullish()}),jos=P.union([P.literal("full"),P.literal("incremental")]),Hos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),syncKind:jos}),Gos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),didChange:Hos.nullish(),didClose:sis.nullish(),didFocus:ais.nullish(),didOpen:cis.nullish(),didSave:lis.nullish()}),$os=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),document:Gos.nullish()}),Vos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:xis.nullish(),events:$os.nullish()}),Wos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:Wns.optional().default({}),loadSession:P.boolean().optional().default(!1),mcpCapabilities:Yns.optional().default({acp:!1,http:!1,sse:!1}),nes:Vos.nullish(),positionEncoding:Xwn.nullish(),promptCapabilities:Uis.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:His.nullish(),sessionCapabilities:xos.optional().default({})}),zos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),agentCapabilities:Wos.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:Wwn.nullish(),authMethods:P.array(vns).optional().default([]),protocolVersion:eRn}),Yos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),mimeType:P.string().nullish(),text:P.string(),uri:P.string()}),Kos=P.union([Yos,Sns]),Jos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),resource:Kos}),hKt=P.union([Qos.and(P.object({type:P.literal("text")})),eos.and(P.object({type:P.literal("image")})),Xis.and(P.object({type:P.literal("audio")})),tos.and(P.object({type:P.literal("resource_link")})),Jos.and(P.object({type:P.literal("resource")}))]),Zos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:hKt}),DYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:hKt,messageId:P.string().nullish()}),mKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),messageId:P.string().nullish(),prompt:P.array(hKt),sessionId:nc}),Xos=P.object({anyOf:P.array(Qwn)}),iRn=P.union([Zos.and(P.object({type:P.literal("content")})),Pns.and(P.object({type:P.literal("diff")})),Los.and(P.object({type:P.literal("terminal")}))]),gKt=P.string(),oRn=P.object({sessionId:nc,toolCallId:gKt.nullish()}),ess=P.intersection(P.union([oRn,tRn]),P.object({elicitationId:Uwn,url:P.string().url()})),sRn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string()}),aRn=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed"),P.literal("failed")]),cRn=P.union([P.literal("read"),P.literal("edit"),P.literal("delete"),P.literal("move"),P.literal("search"),P.literal("execute"),P.literal("think"),P.literal("fetch"),P.literal("switch_mode"),P.literal("other")]),tss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(iRn).optional(),kind:cRn.optional(),locations:P.array(sRn).optional(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:aRn.optional(),title:P.string(),toolCallId:gKt}),lRn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(iRn).nullish(),kind:cRn.nullish(),locations:P.array(sRn).nullish(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:aRn.nullish(),title:P.string().nullish(),toolCallId:gKt}),AKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),options:P.array(kis),sessionId:nc,toolCall:lRn}),rss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),hint:P.string()}),nss=rss,iss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string(),input:nss.nullish(),name:P.string()}),oss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableCommands:P.array(iss)}),sss=P.object({enum:P.array(P.string()),type:Uns}),ass=P.union([sss,Xos]),css=P.object({default:P.array(P.string()).nullish(),description:P.string().nullish(),items:ass,maxItems:P.number().nullish(),minItems:P.number().nullish(),title:P.string().nullish()}),lss=P.union([Oos.and(P.object({type:P.literal("string")})),wis.and(P.object({type:P.literal("number")})),Gns.and(P.object({type:P.literal("integer")})),Tns.and(P.object({type:P.literal("boolean")})),css.and(P.object({type:P.literal("array")}))]),uss=P.object({description:P.string().nullish(),properties:P.record(P.string(),lss).optional().default({}),required:P.array(P.string()).nullish(),title:P.string().nullish(),type:Fns.optional().default("object")}),dss=P.intersection(P.union([oRn,tRn]),P.object({requestedSchema:uss})),yKt=P.intersection(P.union([dss.and(P.object({mode:P.literal("form")})),ess.and(P.object({mode:P.literal("url")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),message:P.string()})),fss=P.object({cachedReadTokens:P.number().nullish(),cachedWriteTokens:P.number().nullish(),inputTokens:P.number(),outputTokens:P.number(),thoughtTokens:P.number().nullish(),totalTokens:P.number()}),pss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),stopReason:Nos,usage:fss.nullish(),userMessageId:P.string().nullish()}),pHd=P.union([P.object({id:wq,result:P.union([zos,bns,jis,wos,Dns,zns,Sos,bos,Aos,kns,vos,Tos,xns,kos,Ros,pss,Pos,Dos,Bos,Ins,$wn,Jwn])}),P.object({error:jwn,id:wq})]),hss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cost:wns.nullish(),size:P.number(),used:P.number()}),mss=P.union([DYt.and(P.object({sessionUpdate:P.literal("user_message_chunk")})),DYt.and(P.object({sessionUpdate:P.literal("agent_message_chunk")})),DYt.and(P.object({sessionUpdate:P.literal("agent_thought_chunk")})),tss.and(P.object({sessionUpdate:P.literal("tool_call")})),lRn.and(P.object({sessionUpdate:P.literal("tool_call_update")})),Mis.and(P.object({sessionUpdate:P.literal("plan")})),oss.and(P.object({sessionUpdate:P.literal("available_commands_update")})),_os.and(P.object({sessionUpdate:P.literal("current_mode_update")})),pos.and(P.object({sessionUpdate:P.literal("config_option_update")})),yos.and(P.object({sessionUpdate:P.literal("session_info_update")})),hss.and(P.object({sessionUpdate:P.literal("usage_update")}))]),EKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,update:mss}),hHd=P.object({method:P.string(),params:P.union([EKt,OYt,Ywn,Hwn]).nullish()}),_Kt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),gss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),Ass=P.object({name:P.string(),uri:P.string()}),CKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),repository:Cis.nullish(),workspaceFolders:P.array(Ass).nullish(),workspaceUri:P.string().nullish()}),mHd=P.object({id:wq,method:P.string(),params:P.union([jYt,NYt,BYt,aKt,MYt,UYt,qYt,rKt,LYt,YYt,eKt,sKt,WYt,lKt,cKt,mKt,uKt,CKt,dKt,VYt,Kwn,Gwn]).nullish()}),vKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),path:P.string(),sessionId:nc}),gHd=P.object({id:wq,method:P.string(),params:P.union([vKt,nKt,AKt,zYt,fKt,oKt,_Kt,tKt,yKt,Zns,Kwn,Jns,Gwn]).nullish()}),yss=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),AHd=P.union([P.object({id:wq,result:P.union([yss,Kis,ios,Rns,Uos,Jis,gss,$ns,Bns,Kns,Nns,$wn,Jwn])}),P.object({error:jwn,id:wq})]);p();function xwe(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 QWt(t,e){if(t instanceof aue){let n=new jxe(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 jxe(e);return r.process(t),r.emit(t,e)}a(QWt,"toJSONSchema");function em(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 em(o.element,r);case"object":{for(let s in o.shape)if(em(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(em(s,r))return!0;return!1}case"intersection":return em(o.left,r)||em(o.right,r);case"tuple":{for(let s of o.items)if(em(s,r))return!0;return!!(o.rest&&em(o.rest,r))}case"record":return em(o.keyType,r)||em(o.valueType,r);case"map":return em(o.keyType,r)||em(o.valueType,r);case"set":return em(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return em(o.innerType,r);case"lazy":return em(o.getter(),r);case"default":return em(o.innerType,r);case"prefault":return em(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return em(o.in,r)||em(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(em,"isTransforming");var gIn={};p();p();p();var fue={};xi(fue,{ZodISODate:()=>oet,ZodISODateTime:()=>iet,ZodISODuration:()=>aet,ZodISOTime:()=>set,date:()=>jWt,datetime:()=>qWt,duration:()=>GWt,time:()=>HWt});p();var iet=ut("ZodISODateTime",(t,e)=>{C$t.init(t,e),hu.init(t,e)});function qWt(t){return rWt(iet,t)}a(qWt,"datetime");var oet=ut("ZodISODate",(t,e)=>{b$t.init(t,e),hu.init(t,e)});function jWt(t){return nWt(oet,t)}a(jWt,"date");var set=ut("ZodISOTime",(t,e)=>{S$t.init(t,e),hu.init(t,e)});function HWt(t){return iWt(set,t)}a(HWt,"time");var aet=ut("ZodISODuration",(t,e)=>{T$t.init(t,e),hu.init(t,e)});function GWt(t){return oWt(aet,t)}a(GWt,"duration");p();p();var yIn=a((t,e)=>{mxe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>Axe(t,r),"value")},flatten:{value:a(r=>gxe(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"),sZo=ut("ZodError",yIn),pue=ut("ZodError",yIn,{Parent:Error});var $Wt=bXe(pue),VWt=SXe(pue),WWt=TXe(pue),zWt=IXe(pue);var bs=ut("ZodType",(t,e)=>(lo.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)=>BS(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>$Wt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>WWt(t,r,n),t.parseAsync=async(r,n)=>VWt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>zWt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(ZIn(r,n)),t.superRefine=r=>t.check(XIn(r)),t.overwrite=r=>t.check(P3(r)),t.optional=()=>mu(t),t.nullable=()=>uet(t),t.nullish=()=>mu(uet(t)),t.nonoptional=r=>QIn(t,r),t.array=()=>Ur(t),t.or=r=>El([t,r]),t.and=r=>zxe(t,r),t.transform=r=>det(t,_zt(r)),t.default=r=>LIn(t,r),t.prefault=r=>UIn(t,r),t.catch=r=>HIn(t,r),t.pipe=r=>det(t,r),t.readonly=()=>VIn(t),t.describe=r=>{let n=t.clone();return AO.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return AO.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return AO.get(t);let n=t.clone();return AO.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),KWt=ut("_ZodString",(t,e)=>{NK.init(t,e),bs.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(Pxe(...n)),t.includes=(...n)=>t.check(Nxe(...n)),t.startsWith=(...n)=>t.check(Mxe(...n)),t.endsWith=(...n)=>t.check(Oxe(...n)),t.min=(...n)=>t.check(cq(...n)),t.max=(...n)=>t.check(uue(...n)),t.length=(...n)=>t.check(due(...n)),t.nonempty=(...n)=>t.check(cq(1,...n)),t.lowercase=n=>t.check(kxe(n)),t.uppercase=n=>t.check(Dxe(n)),t.trim=()=>t.check(Fxe()),t.normalize=(...n)=>t.check(Lxe(...n)),t.toLowerCase=()=>t.check(Uxe()),t.toUpperCase=()=>t.check(Qxe())}),Gxe=ut("ZodString",(t,e)=>{NK.init(t,e),KWt.init(t,e),t.email=r=>t.check(BXe(JWt,r)),t.url=r=>t.check(qXe(ZWt,r)),t.jwt=r=>t.check(ret(hzt,r)),t.emoji=r=>t.check(jXe(ezt,r)),t.guid=r=>t.check(wxe(cet,r)),t.uuid=r=>t.check(LXe(D3,r)),t.uuidv4=r=>t.check(FXe(D3,r)),t.uuidv6=r=>t.check(UXe(D3,r)),t.uuidv7=r=>t.check(QXe(D3,r)),t.nanoid=r=>t.check(HXe(tzt,r)),t.guid=r=>t.check(wxe(cet,r)),t.cuid=r=>t.check(GXe(rzt,r)),t.cuid2=r=>t.check($Xe(nzt,r)),t.ulid=r=>t.check(VXe(izt,r)),t.base64=r=>t.check(XXe(dzt,r)),t.base64url=r=>t.check(eet(fzt,r)),t.xid=r=>t.check(WXe(ozt,r)),t.ksuid=r=>t.check(zXe(szt,r)),t.ipv4=r=>t.check(YXe(azt,r)),t.ipv6=r=>t.check(KXe(czt,r)),t.cidrv4=r=>t.check(JXe(lzt,r)),t.cidrv6=r=>t.check(ZXe(uzt,r)),t.e164=r=>t.check(tet(pzt,r)),t.datetime=r=>t.check(qWt(r)),t.date=r=>t.check(jWt(r)),t.time=r=>t.check(HWt(r)),t.duration=r=>t.check(GWt(r))});function Ke(t){return XVt(Gxe,t)}a(Ke,"string");var hu=ut("ZodStringFormat",(t,e)=>{Fl.init(t,e),KWt.init(t,e)}),JWt=ut("ZodEmail",(t,e)=>{p$t.init(t,e),hu.init(t,e)});function cZo(t){return BXe(JWt,t)}a(cZo,"email");var cet=ut("ZodGUID",(t,e)=>{d$t.init(t,e),hu.init(t,e)});function lZo(t){return wxe(cet,t)}a(lZo,"guid");var D3=ut("ZodUUID",(t,e)=>{f$t.init(t,e),hu.init(t,e)});function uZo(t){return LXe(D3,t)}a(uZo,"uuid");function dZo(t){return FXe(D3,t)}a(dZo,"uuidv4");function fZo(t){return UXe(D3,t)}a(fZo,"uuidv6");function pZo(t){return QXe(D3,t)}a(pZo,"uuidv7");var ZWt=ut("ZodURL",(t,e)=>{h$t.init(t,e),hu.init(t,e)});function XWt(t){return qXe(ZWt,t)}a(XWt,"url");var ezt=ut("ZodEmoji",(t,e)=>{m$t.init(t,e),hu.init(t,e)});function hZo(t){return jXe(ezt,t)}a(hZo,"emoji");var tzt=ut("ZodNanoID",(t,e)=>{g$t.init(t,e),hu.init(t,e)});function mZo(t){return HXe(tzt,t)}a(mZo,"nanoid");var rzt=ut("ZodCUID",(t,e)=>{A$t.init(t,e),hu.init(t,e)});function gZo(t){return GXe(rzt,t)}a(gZo,"cuid");var nzt=ut("ZodCUID2",(t,e)=>{y$t.init(t,e),hu.init(t,e)});function AZo(t){return $Xe(nzt,t)}a(AZo,"cuid2");var izt=ut("ZodULID",(t,e)=>{E$t.init(t,e),hu.init(t,e)});function yZo(t){return VXe(izt,t)}a(yZo,"ulid");var ozt=ut("ZodXID",(t,e)=>{_$t.init(t,e),hu.init(t,e)});function EZo(t){return WXe(ozt,t)}a(EZo,"xid");var szt=ut("ZodKSUID",(t,e)=>{v$t.init(t,e),hu.init(t,e)});function _Zo(t){return zXe(szt,t)}a(_Zo,"ksuid");var azt=ut("ZodIPv4",(t,e)=>{I$t.init(t,e),hu.init(t,e)});function vZo(t){return YXe(azt,t)}a(vZo,"ipv4");var czt=ut("ZodIPv6",(t,e)=>{x$t.init(t,e),hu.init(t,e)});function CZo(t){return KXe(czt,t)}a(CZo,"ipv6");var lzt=ut("ZodCIDRv4",(t,e)=>{w$t.init(t,e),hu.init(t,e)});function bZo(t){return JXe(lzt,t)}a(bZo,"cidrv4");var uzt=ut("ZodCIDRv6",(t,e)=>{R$t.init(t,e),hu.init(t,e)});function SZo(t){return ZXe(uzt,t)}a(SZo,"cidrv6");var dzt=ut("ZodBase64",(t,e)=>{k$t.init(t,e),hu.init(t,e)});function TZo(t){return XXe(dzt,t)}a(TZo,"base64");var fzt=ut("ZodBase64URL",(t,e)=>{D$t.init(t,e),hu.init(t,e)});function IZo(t){return eet(fzt,t)}a(IZo,"base64url");var pzt=ut("ZodE164",(t,e)=>{N$t.init(t,e),hu.init(t,e)});function xZo(t){return tet(pzt,t)}a(xZo,"e164");var hzt=ut("ZodJWT",(t,e)=>{M$t.init(t,e),hu.init(t,e)});function wZo(t){return ret(hzt,t)}a(wZo,"jwt");var EIn=ut("ZodCustomStringFormat",(t,e)=>{O$t.init(t,e),hu.init(t,e)});function RZo(t,e,r={}){return FWt(EIn,t,e,r)}a(RZo,"stringFormat");var $xe=ut("ZodNumber",(t,e)=>{DXe.init(t,e),bs.init(t,e),t.gt=(n,o)=>t.check(R3(n,o)),t.gte=(n,o)=>t.check(BC(n,o)),t.min=(n,o)=>t.check(BC(n,o)),t.lt=(n,o)=>t.check(w3(n,o)),t.lte=(n,o)=>t.check(Gx(n,o)),t.max=(n,o)=>t.check(Gx(n,o)),t.int=n=>t.check(YWt(n)),t.safe=n=>t.check(YWt(n)),t.positive=n=>t.check(R3(0,n)),t.nonnegative=n=>t.check(BC(0,n)),t.negative=n=>t.check(w3(0,n)),t.nonpositive=n=>t.check(Gx(0,n)),t.multipleOf=(n,o)=>t.check(OK(n,o)),t.step=(n,o)=>t.check(OK(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 Ia(t){return sWt($xe,t)}a(Ia,"number");var hue=ut("ZodNumberFormat",(t,e)=>{B$t.init(t,e),$xe.init(t,e)});function YWt(t){return cWt(hue,t)}a(YWt,"int");function PZo(t){return lWt(hue,t)}a(PZo,"float32");function kZo(t){return uWt(hue,t)}a(kZo,"float64");function DZo(t){return dWt(hue,t)}a(DZo,"int32");function NZo(t){return fWt(hue,t)}a(NZo,"uint32");var Vxe=ut("ZodBoolean",(t,e)=>{Cxe.init(t,e),bs.init(t,e)});function Xc(t){return pWt(Vxe,t)}a(Xc,"boolean");var Wxe=ut("ZodBigInt",(t,e)=>{NXe.init(t,e),bs.init(t,e),t.gte=(n,o)=>t.check(BC(n,o)),t.min=(n,o)=>t.check(BC(n,o)),t.gt=(n,o)=>t.check(R3(n,o)),t.gte=(n,o)=>t.check(BC(n,o)),t.min=(n,o)=>t.check(BC(n,o)),t.lt=(n,o)=>t.check(w3(n,o)),t.lte=(n,o)=>t.check(Gx(n,o)),t.max=(n,o)=>t.check(Gx(n,o)),t.positive=n=>t.check(R3(BigInt(0),n)),t.negative=n=>t.check(w3(BigInt(0),n)),t.nonpositive=n=>t.check(Gx(BigInt(0),n)),t.nonnegative=n=>t.check(BC(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(OK(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function MZo(t){return mWt(Wxe,t)}a(MZo,"bigint");var mzt=ut("ZodBigIntFormat",(t,e)=>{L$t.init(t,e),Wxe.init(t,e)});function OZo(t){return AWt(mzt,t)}a(OZo,"int64");function BZo(t){return yWt(mzt,t)}a(BZo,"uint64");var _In=ut("ZodSymbol",(t,e)=>{F$t.init(t,e),bs.init(t,e)});function LZo(t){return EWt(_In,t)}a(LZo,"symbol");var vIn=ut("ZodUndefined",(t,e)=>{U$t.init(t,e),bs.init(t,e)});function FZo(t){return _Wt(vIn,t)}a(FZo,"_undefined");var CIn=ut("ZodNull",(t,e)=>{Q$t.init(t,e),bs.init(t,e)});function fet(t){return vWt(CIn,t)}a(fet,"_null");var bIn=ut("ZodAny",(t,e)=>{q$t.init(t,e),bs.init(t,e)});function gzt(){return CWt(bIn)}a(gzt,"any");var SIn=ut("ZodUnknown",(t,e)=>{sue.init(t,e),bs.init(t,e)});function Zu(){return cue(SIn)}a(Zu,"unknown");var TIn=ut("ZodNever",(t,e)=>{j$t.init(t,e),bs.init(t,e)});function pet(t){return bWt(TIn,t)}a(pet,"never");var IIn=ut("ZodVoid",(t,e)=>{H$t.init(t,e),bs.init(t,e)});function UZo(t){return SWt(IIn,t)}a(UZo,"_void");var het=ut("ZodDate",(t,e)=>{G$t.init(t,e),bs.init(t,e),t.min=(n,o)=>t.check(BC(n,o)),t.max=(n,o)=>t.check(Gx(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 QZo(t){return TWt(het,t)}a(QZo,"date");var xIn=ut("ZodArray",(t,e)=>{bxe.init(t,e),bs.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(cq(r,n)),t.nonempty=r=>t.check(cq(1,r)),t.max=(r,n)=>t.check(uue(r,n)),t.length=(r,n)=>t.check(due(r,n)),t.unwrap=()=>t.element});function Ur(t,e){return qxe(xIn,t,e)}a(Ur,"array");function qZo(t){let e=t._zod.def.shape;return Hn(Object.keys(e))}a(qZo,"keyof");var met=ut("ZodObject",(t,e)=>{$$t.init(t,e),bs.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>L_(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Zu()}),t.loose=()=>t.clone({...t._zod.def,catchall:Zu()}),t.strict=()=>t.clone({...t._zod.def,catchall:pet()}),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(vzt,t,r[0]),t.required=(...r)=>qr.required(Czt,t,r[0])});function Wr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new met(r)}a(Wr,"object");function jZo(t,e){return new met({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:pet(),...qr.normalizeParams(e)})}a(jZo,"strictObject");function Yh(t,e){return new met({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Zu(),...qr.normalizeParams(e)})}a(Yh,"looseObject");var Azt=ut("ZodUnion",(t,e)=>{MXe.init(t,e),bs.init(t,e),t.options=e.options});function El(t,e){return new Azt({type:"union",options:t,...qr.normalizeParams(e)})}a(El,"union");var wIn=ut("ZodDiscriminatedUnion",(t,e)=>{Azt.init(t,e),V$t.init(t,e)});function get(t,e,r){return new wIn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(get,"discriminatedUnion");var RIn=ut("ZodIntersection",(t,e)=>{W$t.init(t,e),bs.init(t,e)});function zxe(t,e){return new RIn({type:"intersection",left:t,right:e})}a(zxe,"intersection");var PIn=ut("ZodTuple",(t,e)=>{MK.init(t,e),bs.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function HZo(t,e,r){let n=e instanceof lo,o=n?r:e,s=n?e:null;return new PIn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(HZo,"tuple");var yzt=ut("ZodRecord",(t,e)=>{z$t.init(t,e),bs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function _l(t,e,r){return new yzt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(_l,"record");function GZo(t,e,r){return new yzt({type:"record",keyType:El([t,pet()]),valueType:e,...qr.normalizeParams(r)})}a(GZo,"partialRecord");var kIn=ut("ZodMap",(t,e)=>{Y$t.init(t,e),bs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function $Zo(t,e,r){return new kIn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a($Zo,"map");var DIn=ut("ZodSet",(t,e)=>{K$t.init(t,e),bs.init(t,e),t.min=(...r)=>t.check(BK(...r)),t.nonempty=r=>t.check(BK(1,r)),t.max=(...r)=>t.check(lue(...r)),t.size=(...r)=>t.check(Rxe(...r))});function VZo(t,e){return new DIn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(VZo,"set");var Hxe=ut("ZodEnum",(t,e)=>{J$t.init(t,e),bs.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 Hxe({...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 Hxe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function L_(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Hxe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(L_,"_enum");function WZo(t,e){return new Hxe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(WZo,"nativeEnum");var NIn=ut("ZodLiteral",(t,e)=>{Z$t.init(t,e),bs.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 Hn(t,e){return new NIn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Hn,"literal");var MIn=ut("ZodFile",(t,e)=>{X$t.init(t,e),bs.init(t,e),t.min=(r,n)=>t.check(BK(r,n)),t.max=(r,n)=>t.check(lue(r,n)),t.mime=(r,n)=>t.check(Bxe(Array.isArray(r)?r:[r],n))});function zZo(t){return MWt(MIn,t)}a(zZo,"file");var Ezt=ut("ZodTransform",(t,e)=>{Sxe.init(t,e),bs.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 _zt(t){return new Ezt({type:"transform",transform:t})}a(_zt,"transform");var vzt=ut("ZodOptional",(t,e)=>{eVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mu(t){return new vzt({type:"optional",innerType:t})}a(mu,"optional");var OIn=ut("ZodNullable",(t,e)=>{tVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function uet(t){return new OIn({type:"nullable",innerType:t})}a(uet,"nullable");function YZo(t){return mu(uet(t))}a(YZo,"nullish");var BIn=ut("ZodDefault",(t,e)=>{rVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function LIn(t,e){return new BIn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(LIn,"_default");var FIn=ut("ZodPrefault",(t,e)=>{nVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function UIn(t,e){return new FIn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(UIn,"prefault");var Czt=ut("ZodNonOptional",(t,e)=>{iVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function QIn(t,e){return new Czt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(QIn,"nonoptional");var qIn=ut("ZodSuccess",(t,e)=>{oVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function KZo(t){return new qIn({type:"success",innerType:t})}a(KZo,"success");var jIn=ut("ZodCatch",(t,e)=>{sVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function HIn(t,e){return new jIn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(HIn,"_catch");var GIn=ut("ZodNaN",(t,e)=>{aVt.init(t,e),bs.init(t,e)});function JZo(t){return xWt(GIn,t)}a(JZo,"nan");var bzt=ut("ZodPipe",(t,e)=>{Txe.init(t,e),bs.init(t,e),t.in=e.in,t.out=e.out});function det(t,e){return new bzt({type:"pipe",in:t,out:e})}a(det,"pipe");var $In=ut("ZodReadonly",(t,e)=>{cVt.init(t,e),bs.init(t,e)});function VIn(t){return new $In({type:"readonly",innerType:t})}a(VIn,"readonly");var WIn=ut("ZodTemplateLiteral",(t,e)=>{lVt.init(t,e),bs.init(t,e)});function ZZo(t,e){return new WIn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(ZZo,"templateLiteral");var zIn=ut("ZodLazy",(t,e)=>{dVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.getter()});function YIn(t){return new zIn({type:"lazy",getter:t})}a(YIn,"lazy");var KIn=ut("ZodPromise",(t,e)=>{uVt.init(t,e),bs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function XZo(t){return new KIn({type:"promise",innerType:t})}a(XZo,"promise");var Aet=ut("ZodCustom",(t,e)=>{fVt.init(t,e),bs.init(t,e)});function JIn(t){let e=new pf({check:"custom"});return e._zod.check=t,e}a(JIn,"check");function Szt(t,e){return OWt(Aet,t??(()=>!0),e)}a(Szt,"custom");function ZIn(t,e={}){return BWt(Aet,t,e)}a(ZIn,"refine");function XIn(t){let e=JIn(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(XIn,"superRefine");function eXo(t,e={error:`Input not instance of ${t.name}`}){let r=new Aet({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(eXo,"_instanceof");var tXo=a((...t)=>LWt({Pipe:bzt,Boolean:Vxe,String:Gxe,Transform:Ezt},...t),"stringbool");function rXo(t){let e=YIn(()=>El([Ke(t),Ia(),Xc(),fet(),Ur(e),_l(Ke(),e)]));return e}a(rXo,"json");function yet(t,e){return det(_zt(t),e)}a(yet,"preprocess");p();var Tzt={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 nXo(t){zh({customError:t})}a(nXo,"setErrorMap");function iXo(){return zh().customError}a(iXo,"getErrorMap");var Yxe={};xi(Yxe,{bigint:()=>cXo,boolean:()=>aXo,date:()=>lXo,number:()=>sXo,string:()=>oXo});p();function oXo(t){return eWt(Gxe,t)}a(oXo,"string");function sXo(t){return aWt($xe,t)}a(sXo,"number");function aXo(t){return hWt(Vxe,t)}a(aXo,"boolean");function cXo(t){return gWt(Wxe,t)}a(cXo,"bigint");function lXo(t){return IWt(het,t)}a(lXo,"date");zh(Ixe());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"},hf={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"},Eet=1;p();var dXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),fXo=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)}),pXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),hXo=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(fXo)}),mXo=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()}),gXo=k.union([hXo.and(k.object({type:k.literal("env_var")})),mXo.and(k.object({type:k.literal("terminal")})),pXo]),xzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),AXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),yXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),EXo=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),_Xo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),vXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),CXo=k.object({amount:k.number(),currency:k.string()}),bXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),SXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),TXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),wzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),IXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),xXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),wXo=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),RXo=k.object({content:k.record(k.string(),wXo).nullish()}),PXo=k.intersection(k.union([RXo.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()})),kXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),exn=k.string(),Rzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:exn}),DXo=k.literal("object"),NXo=k.literal("string"),MXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),OXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:kXo.nullish(),url:MXo.nullish()}),txn=k.object({const:k.string(),title:k.string()}),rxn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),BXo=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"})]),nxn=k.object({code:BXo,data:k.unknown().optional(),message:k.string()}),ixn=k.unknown(),oxn=k.unknown(),sxn=k.unknown(),LXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),axn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),cxn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),FXo=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),UXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Pzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),kzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),Dzt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),QXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:QXo.nullish()}),Nzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),HXo=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)}),_et=k.string(),GXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:_et}),$Xo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:_et}),lxn=k.string(),VXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:lxn}),WXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:lxn,name:k.string()}),zXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(axn),name:k.string(),url:k.string()}),YXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(axn),name:k.string(),url:k.string()}),KXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(rxn),name:k.string()}),vet=k.union([zXo.and(k.object({type:k.literal("http")})),YXo.and(k.object({type:k.literal("sse")})),WXo.and(k.object({type:k.literal("acp")})),KXo]),uxn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:_et,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),dxn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:_et,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),fxn=k.unknown(),Mzt=k.string(),JXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:Mzt,name:k.string()}),ZXo=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),XXo=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ees=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tes=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),res=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nes=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ies=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()}),oes=k.object({diff:k.string(),uri:k.string()}),ses=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()}),aes=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ces=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),les=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),ues=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()}),des=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),fes=k.object({excerpts:k.array(ses),uri:k.string()}),pes=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hes=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mes=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),ges=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Aes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:aes.nullish(),rename:hes.nullish(),searchAndReplace:ges.nullish()}),yes=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Ees=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),_es=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()}),ves=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:XXo.nullish(),editHistory:ies.nullish(),openFiles:ces.nullish(),recentFiles:ues.nullish(),relatedSnippets:pes.nullish(),userActions:_es.nullish()}),Ozt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(vet)}),Ces=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),pxn=k.string(),bes=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Ses=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:bes,name:k.string(),optionId:pxn}),Tes=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),Ies=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),xes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Tes,status:Ies}),wes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(xes)}),lq=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"})}),Res=k.object({id:k.string(),position:lq,uri:k.string()}),Pes=k.object({id:k.string(),newName:k.string(),position:lq,uri:k.string()}),kes=k.object({action:k.string(),position:lq,timestampMs:k.number(),uri:k.string()}),hxn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Des=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:dXo.optional().default({terminal:!1}),elicitation:OXo.nullish(),fs:LXo.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Aes.nullish(),positionEncodings:k.array(hxn).optional(),terminal:k.boolean().optional().default(!1)}),Nes=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)}),mxn=k.number().int().gte(0).lte(65535),Bzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Des.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:cxn.nullish(),protocolVersion:mxn}),Mes=k.object({apiType:Dzt,baseUrl:k.string()}),Oes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:Mes.nullish(),id:k.string(),required:k.boolean(),supported:k.array(Dzt)}),Bes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(Oes)}),Les=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mue=k.object({end:lq,start:lq}),Fes=k.object({message:k.string(),range:mue,severity:ZXo,uri:k.string()}),Ues=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:mue.nullish()}),Qes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(Fes).nullish(),editHistory:k.array(oes).nullish(),openFiles:k.array(Ues).nullish(),recentFiles:k.array(les).nullish(),relatedSnippets:k.array(fes).nullish(),userActions:k.array(kes).nullish()}),qes=k.object({newText:k.string(),range:mue}),jes=k.object({cursorPosition:lq.nullish(),edits:k.array(qes),id:k.string(),uri:k.string()}),Hes=k.union([jes.and(k.object({kind:k.literal("edit")})),Res.and(k.object({kind:k.literal("jump")})),Pes.and(k.object({kind:k.literal("rename")})),yes.and(k.object({kind:k.literal("searchAndReplace")}))]),Ges=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),$es=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),uq=k.union([k.number(),k.string()]).nullable(),i9d=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:uq}),gxn=k.object({requestId:uq}),Ves=k.enum(["assistant","user"]),Kxe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(Ves).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),Wes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:Kxe.nullish(),data:k.string(),mimeType:k.string()}),zes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:Kxe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),Yes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:Kxe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),Kes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:pxn}),Jes=k.union([k.object({outcome:k.literal("cancelled")}),Kes.and(k.object({outcome:k.literal("selected")}))]),Zes=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:Jes}),Xes=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ets=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tts=k.object({currentValue:k.boolean()}),rts=k.string(),Axn=k.string(),nts=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),Lzt=k.string(),yxn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:Lzt}),its=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:rts,name:k.string(),options:k.array(yxn)}),ots=k.union([k.array(yxn),k.array(its)]),sts=k.object({currentValue:Lzt,options:ots}),gue=k.intersection(k.union([sts.and(k.object({type:k.literal("select")})),tts.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:nts.nullish(),description:k.string().nullish(),id:Axn,name:k.string()})),ats=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(gue)}),cts=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),lts=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tc=k.string(),Fzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:tc}),Uzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc}),Qzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc}),qzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc}),jzt=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(rxn).optional(),outputByteLimit:k.number().nullish(),sessionId:tc}),Hzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc}),Gzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc,uri:k.string()}),$zt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:lq,sessionId:tc,uri:k.string(),version:k.number(),visibleRange:mue}),Vzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:tc,text:k.string(),uri:k.string(),version:k.number()}),Wzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc,uri: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(vet).optional(),sessionId:tc}),Yzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc,terminalId: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(vet),sessionId:tc}),Jzt=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:tc}),Zzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:des.nullish(),sessionId:tc}),Xzt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc,terminalId:k.string()}),eYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(vet).optional(),sessionId:tc}),uts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:tc,title:k.string().nullish(),updatedAt:k.string().nullish()}),dts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(uts)}),fts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),pts=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cet=k.string(),hts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:Cet}),mts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:Cet,name:k.string()}),bet=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(mts),currentModeId:Cet}),Tet=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(JXo),currentModelId:Mzt}),gts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(gue).nullish(),models:Tet.nullish(),modes:bet.nullish(),sessionId:tc}),Ats=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(gue).nullish(),models:Tet.nullish(),modes:bet.nullish()}),yts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(gue).nullish(),models:Tet.nullish(),modes:bet.nullish(),sessionId:tc}),Ets=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(gue).nullish(),models:Tet.nullish(),modes:bet.nullish()}),_ts=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),vts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:Xes.nullish(),close:ets.nullish(),delete:cts.nullish(),fork:lts.nullish(),list:pts.nullish(),resume:_ts.nullish()}),tYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:Dzt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),Cts=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),rYt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:Lzt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:Axn,sessionId:tc})),bts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(gue)}),nYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:Cet,sessionId:tc}),Sts=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),iYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:Mzt,sessionId:tc}),Tts=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Its=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc}),xts=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),wts=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),Rts=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:wts.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(txn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),oYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Qes.nullish(),position:lq,selection:mue.nullish(),sessionId:tc,triggerKind:Ees,uri:k.string(),version:k.number()}),Pts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(Hes)}),kts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Dts=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()}),sYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc,terminalId:k.string()}),Nts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:Dts.nullish(),output:k.string(),truncated:k.boolean()}),Mts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:Kxe.nullish(),text:k.string()}),Ots=k.object({range:mue.nullish(),text:k.string()}),aYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(Ots),sessionId:tc,uri:k.string(),version:k.number()}),o9d=k.object({method:k.string(),params:k.union([Uzt,Vzt,aYt,Gzt,Wzt,$zt,Fzt,Zzt,uxn,ixn]).nullish()}),Bts=k.union([k.literal("full"),k.literal("incremental")]),Lts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:Bts}),Fts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:Lts.nullish(),didClose:ees.nullish(),didFocus:tes.nullish(),didOpen:res.nullish(),didSave:nes.nullish()}),Uts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:Fts.nullish()}),Qts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:ves.nullish(),events:Uts.nullish()}),qts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:qXo.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:HXo.optional().default({acp:!1,http:!1,sse:!1}),nes:Qts.nullish(),positionEncoding:hxn.nullish(),promptCapabilities:Nes.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:Les.nullish(),sessionCapabilities:vts.optional().default({})}),jts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:qts.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:cxn.nullish(),authMethods:k.array(gXo).optional().default([]),protocolVersion:mxn}),Hts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),Gts=k.union([Hts,yXo]),$ts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:Kxe.nullish(),resource:Gts}),cYt=k.union([Mts.and(k.object({type:k.literal("text")})),zes.and(k.object({type:k.literal("image")})),Wes.and(k.object({type:k.literal("audio")})),Yes.and(k.object({type:k.literal("resource_link")})),$ts.and(k.object({type:k.literal("resource")}))]),Vts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:cYt}),Izt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:cYt,messageId:k.string().nullish()}),lYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(cYt),sessionId:tc}),Wts=k.object({anyOf:k.array(txn)}),Exn=k.union([Vts.and(k.object({type:k.literal("content")})),TXo.and(k.object({type:k.literal("diff")})),kts.and(k.object({type:k.literal("terminal")}))]),uYt=k.string(),_xn=k.object({sessionId:tc,toolCallId:uYt.nullish()}),zts=k.intersection(k.union([_xn,gxn]),k.object({elicitationId:exn,url:k.string().url()})),vxn=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()}),Cxn=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),bxn=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")]),Yts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(Exn).optional(),kind:bxn.optional(),locations:k.array(vxn).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:Cxn.optional(),title:k.string(),toolCallId:uYt}),Sxn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(Exn).nullish(),kind:bxn.nullish(),locations:k.array(vxn).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:Cxn.nullish(),title:k.string().nullish(),toolCallId:uYt}),dYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Ses),sessionId:tc,toolCall:Sxn}),Kts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),Jts=Kts,Zts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:Jts.nullish(),name:k.string()}),Xts=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(Zts)}),ers=k.object({enum:k.array(k.string()),type:NXo}),trs=k.union([ers,Wts]),rrs=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:trs,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),nrs=k.union([Rts.and(k.object({type:k.literal("string")})),Ces.and(k.object({type:k.literal("number")})),FXo.and(k.object({type:k.literal("integer")})),EXo.and(k.object({type:k.literal("boolean")})),rrs.and(k.object({type:k.literal("array")}))]),irs=k.object({description:k.string().nullish(),properties:k.record(k.string(),nrs).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:DXo.optional().default("object")}),ors=k.intersection(k.union([_xn,gxn]),k.object({requestedSchema:irs})),fYt=k.intersection(k.union([ors.and(k.object({mode:k.literal("form")})),zts.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),srs=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),ars=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:xts,usage:srs.nullish(),userMessageId:k.string().nullish()}),s9d=k.union([k.object({id:uq,result:k.union([jts,AXo,Bes,Cts,IXo,jXo,yts,Ats,dts,SXo,gts,Ets,vXo,Sts,bts,ars,Tts,Its,Pts,_Xo,sxn,fxn])}),k.object({error:nxn,id:uq})]),crs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:CXo.nullish(),size:k.number(),used:k.number()}),lrs=k.union([Izt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),Izt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),Izt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),Yts.and(k.object({sessionUpdate:k.literal("tool_call")})),Sxn.and(k.object({sessionUpdate:k.literal("tool_call_update")})),wes.and(k.object({sessionUpdate:k.literal("plan")})),Xts.and(k.object({sessionUpdate:k.literal("available_commands_update")})),hts.and(k.object({sessionUpdate:k.literal("current_mode_update")})),ats.and(k.object({sessionUpdate:k.literal("config_option_update")})),fts.and(k.object({sessionUpdate:k.literal("session_info_update")})),crs.and(k.object({sessionUpdate:k.literal("usage_update")}))]),pYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc,update:lrs}),a9d=k.object({method:k.string(),params:k.union([pYt,Rzt,uxn,ixn]).nullish()}),hYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:tc,terminalId:k.string()}),urs=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()}),drs=k.object({name:k.string(),uri:k.string()}),mYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:mes.nullish(),workspaceFolders:k.array(drs).nullish(),workspaceUri:k.string().nullish()}),c9d=k.object({id:uq,method:k.string(),params:k.union([Bzt,xzt,Pzt,tYt,wzt,Nzt,Ozt,Kzt,kzt,Hzt,zzt,eYt,qzt,nYt,rYt,lYt,iYt,mYt,oYt,Qzt,dxn,oxn]).nullish()}),gYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:tc}),l9d=k.object({id:uq,method:k.string(),params:k.union([gYt,Jzt,dYt,jzt,sYt,Xzt,hYt,Yzt,fYt,VXo,dxn,$Xo,oxn]).nullish()}),frs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),u9d=k.union([k.object({id:uq,result:k.union([frs,Ges,Zes,bXo,Nts,$es,urs,UXo,PXo,GXo,xXo,sxn,fxn])}),k.object({error:nxn,id:uq})]);p();function Jxe(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(xwe,"ndJsonStream");function Zx(t){return t??{}}a(Zx,"emptyObjectResponse");function uRn(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(uRn,"rejectedPromise");var wwe=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case si.initialize:{let u=jYt.parse(l);return n.initialize(u)}case si.session_new:{let u=qYt.parse(l);return n.newSession(u)}case si.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=rKt.parse(l);return n.loadSession(u)}case si.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=LYt.parse(l);return n.listSessions(u)}case si.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=YYt.parse(l);return await n.unstable_deleteSession(u)??{}}case si.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=eKt.parse(l);return n.unstable_forkSession(u)}case si.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=sKt.parse(l);return n.resumeSession(u)}case si.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=WYt.parse(l);return await n.closeSession(u)??{}}case si.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=lKt.parse(l);return await n.setSessionMode(u)??{}}case si.authenticate:{let u=NYt.parse(l);return await n.authenticate(u)??{}}case si.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=BYt.parse(l);return n.unstable_listProviders(u)}case si.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=aKt.parse(l);return await n.unstable_setProvider(u)??{}}case si.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=MYt.parse(l);return await n.unstable_disableProvider(u)??{}}case si.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=UYt.parse(l);return await n.unstable_logout(u)??{}}case si.session_prompt:{let u=mKt.parse(l);return n.prompt(u)}case si.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=uKt.parse(l);return await n.unstable_setSessionModel(u)??{}}case si.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=cKt.parse(l);return n.setSessionConfigOption(u)}case si.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=CKt.parse(l);return n.unstable_startNes(u)}case si.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=dKt.parse(l);return n.unstable_suggestNes(u)}case si.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=VYt.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 si.session_cancel:{let u=$Yt.parse(l);return n.cancel(u)}case si.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=ZYt.parse(l);return n.unstable_didOpenDocument(u)}case si.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=pKt.parse(l);return n.unstable_didChangeDocument(u)}case si.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=KYt.parse(l);return n.unstable_didCloseDocument(u)}case si.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=XYt.parse(l);return n.unstable_didSaveDocument(u)}case si.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=JYt.parse(l);return n.unstable_didFocusDocument(u)}case si.nes_accept:{if(!n.unstable_acceptNes)return;let u=GYt.parse(l);return n.unstable_acceptNes(u)}case si.nes_reject:{if(!n.unstable_rejectNes)return;let u=iKt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new gtt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(gf.session_update,e)}requestPermission(e){return this.connection.sendRequest(gf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(gf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(gf.fs_write_text_file,e,Zx)}createTerminal(e){return this.connection.sendRequest(gf.terminal_create,e,r=>new bKt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(gf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(gf.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}},bKt=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(gf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(gf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(gf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},Zx)}release(){return this.connection.sendRequest(gf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},Zx)}async[Symbol.asyncDispose](){await this.release()}},mtt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case gf.fs_write_text_file:{let u=vKt.parse(l);return await n.writeTextFile?.(u)??{}}case gf.fs_read_text_file:{let u=nKt.parse(l);return n.readTextFile?.(u)}case gf.session_request_permission:{let u=AKt.parse(l);return n.requestPermission(u)}case gf.terminal_create:{let u=zYt.parse(l);return n.createTerminal?.(u)}case gf.terminal_output:{let u=fKt.parse(l);return n.terminalOutput?.(u)}case gf.terminal_release:{let u=oKt.parse(l);return await n.releaseTerminal?.(u)??{}}case gf.terminal_wait_for_exit:{let u=_Kt.parse(l);return n.waitForTerminalExit?.(u)}case gf.terminal_kill:{let u=tKt.parse(l);return await n.killTerminal?.(u)??{}}case gf.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=yKt.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 gf.session_update:{let u=EKt.parse(l);return n.sessionUpdate(u)}case gf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=OYt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new gtt(o,s,r)}initialize(e){return this.connection.sendRequest(si.initialize,e)}newSession(e){return this.connection.sendRequest(si.session_new,e)}loadSession(e){return this.connection.sendRequest(si.session_load,e,Zx)}unstable_forkSession(e){return this.connection.sendRequest(si.session_fork,e)}listSessions(e){return this.connection.sendRequest(si.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(si.session_delete,e,Zx)}resumeSession(e){return this.connection.sendRequest(si.session_resume,e)}closeSession(e){return this.connection.sendRequest(si.session_close,e)}setSessionMode(e){return this.connection.sendRequest(si.session_set_mode,e,Zx)}unstable_setSessionModel(e){return this.connection.sendRequest(si.session_set_model,e,Zx)}setSessionConfigOption(e){return this.connection.sendRequest(si.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(si.authenticate,e,Zx)}unstable_listProviders(e){return this.connection.sendRequest(si.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(si.providers_set,e,Zx)}unstable_disableProvider(e){return this.connection.sendRequest(si.providers_disable,e,Zx)}unstable_logout(e){return this.connection.sendRequest(si.logout,e,Zx)}prompt(e){return this.connection.sendRequest(si.session_prompt,e)}cancel(e){return this.connection.sendNotification(si.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(si.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(si.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(si.nes_close,e,Zx)}unstable_didOpenDocument(e){return this.connection.sendNotification(si.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(si.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(si.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(si.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(si.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(si.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(si.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}},gtt=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 P.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 P.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 uRn(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?uRn(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 Q_e=require("node:stream");p();Ns();p();var Hv=class extends Jz{constructor(r){super(new lce,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","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${_ss(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(je[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 _ss(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(_ss,"camelCaseToSnakeCaseAllCaps");var Css="unknown-editor",dRn="unknown-editor-plugin",Rq=class extends Lr{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:Css,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:dRn,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}};function fRn(t){return t.getEditorPluginInfo().name!==dRn}a(fRn,"hasValidInfo");p();p();var Att=new ge("agenticTurnProcessor"),kwe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.turnSuggestions=new HQ(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Z0(e.ctx),this.hookTrigger=new Kle(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s,c,l){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s,c,l)}catch(u){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u);let d=u instanceof Error?u.message:String(u);this.turn.status="error",this.updateTurnResponseWithError(d),u instanceof Error?await this.fireErrorOccurredHook(u):await this.fireErrorOccurredHook(new Error(String(u))),await this.endProgress({error:{message:d,code:mQ.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c,l,u){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let d=await Jc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!K0n(this.turn.chatMode)){let g=d.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ht(this.turnContext.ctx,"customAgent.turn",g),MI(this.turnContext.ctx,"customAgent.turn",g)}r.onCancellationRequested(async()=>{Att.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let f=xK().find(g=>g.id===this.turn.template?.templateId);if(f?.response){await this.handleTemplateResponse(f,this.turn.template.userQuestion,r);return}let m=(await Px(this.turnContext.ctx)).find(g=>g.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,d,f,m);try{let g=l&&c?await QM(this.turnContext.ctx,l,c):await Uo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),SQ(this.conversation.turns));Uo.applyModelConfigurationOverrides(this.turnContext.ctx,g,u),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(Uv).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(E){Ye.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}await new gue(this.turnContext,this.chatFetcher,g,d).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,d.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(g){if(g instanceof gq)Att.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,g),this.turn.status="cancelled",await this.cancelProgress();else if(g instanceof Mc)Att.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,g),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(g instanceof D3)this.turn.status="error",this.updateTurnResponseWithError(g.message),await this.fireErrorOccurredHook(g),await this.endProgress({error:{message:g.message,code:mQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(g instanceof AA)this.turn.status="error",this.updateTurnResponseWithError(g.message),await this.fireErrorOccurredHook(g),await this.endProgress({error:g.conversationError});else throw Att.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,g),g}}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 lle(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 Ye.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=TQ(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=XJe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){Ye.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=zle(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){Ye.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 SKt="collect-context",TKt="generate-response",ytt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.postProcessor=new Ale(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Z0(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s,c,l){try{await this.processWithModel(e,r,this.turnContext,n,o,s,c,l)}catch(u){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u);let d=u instanceof Error?u.message:String(u);this.turn.status="error",this.turn.response={message:d,type:"meta"},await this.endProgress({error:{message:d,code:mQ.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c,l,u){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let d=await Jc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(d=d.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let f=xK().find(A=>A.id===this.turn.template?.templateId);if(f?.response){await this.handleTemplateResponse(f,this.turn.template.userQuestion,r);return}let h=(await Px(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(h){let A=await this.checkAgentPreconditions(h);if(A){await this.endProgress(A);return}}await n.steps.start(SKt,"Collecting context"),await this.collectContext(n,r,d,this.strategy.uiKind,f,h);let m;l?m="customized":c?m=(await Uo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),SQ(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(SKt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(SKt),await n.steps.start(TKt,"Generating response");let A=this.augmentTelemetry(g,d,f,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,d.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c,l,u),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){Ye.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 lle(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,l,u){r.onCancellationRequested(async()=>{await this.cancelProgress()});let d="",f=0,h=new YQ((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(CIe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:E,annotations:_,references:v,hideText:x,notifications:b.map(k=>({severity:"warning",message:k.message})),thinking:w}),this.turn.response?this.turn.response.message=tKe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),d+=E,this.strategy.currentDocument){let k=this.strategy.extractEditsFromResponse(d,this.strategy.currentDocument);k&&k.length>0&&(d="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:k}),f+=k.length)}}),m=l&&c?await QM(this.turnContext.ctx,l,c):await Uo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),Nmn(e));Uo.applyModelConfigurationOverrides(this.turnContext.ctx,m,u),e=Uo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(Uv).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(E){Ye.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:In(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(E,_)=>h.isFinishedAfter(E,_));return o=o.extendedBy(void 0,{numCodeEdits:f}),await this.postProcessor.postProcess(y,r,h.appliedText,n,o,In(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Imn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,In(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=QTe(this.conversation,this.strategy.uiKind,In(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=QTe(this.conversation,this.strategy.uiKind,In(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(TKt,e.error.message):await r.steps.finish(TKt)}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=XJe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){Ye.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=zle(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){Ye.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}};p();Ns();p();var qHi=ce(Al()),jHi=ce(sP());p();p();var Ke={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 vA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(pRn(e))}};function Ne(t,e){let r=Ou.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=pRn(r.Errors(s));return[null,{code:Ke.InvalidParams,message:c}]}return e(n,o,s)}}a(Ne,"addMethodHandlerValidation");function pRn(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(Jxe,"ndJsonStream");function $x(t){return t??{}}a($x,"emptyObjectResponse");function Txn(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(Txn,"rejectedPromise");var Zxe=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=Bzt.parse(l);return n.initialize(u)}case ai.session_new:{let u=Ozt.parse(l);return n.newSession(u)}case ai.session_load:{if(!n.loadSession)throw uo.methodNotFound(c);let u=Kzt.parse(l);return n.loadSession(u)}case ai.session_list:{if(!n.listSessions)throw uo.methodNotFound(c);let u=kzt.parse(l);return n.listSessions(u)}case ai.session_delete:{if(!n.unstable_deleteSession)throw uo.methodNotFound(c);let u=Hzt.parse(l);return await n.unstable_deleteSession(u)??{}}case ai.session_fork:{if(!n.unstable_forkSession)throw uo.methodNotFound(c);let u=zzt.parse(l);return n.unstable_forkSession(u)}case ai.session_resume:{if(!n.resumeSession)throw uo.methodNotFound(c);let u=eYt.parse(l);return n.resumeSession(u)}case ai.session_close:{if(!n.closeSession)throw uo.methodNotFound(c);let u=qzt.parse(l);return await n.closeSession(u)??{}}case ai.session_set_mode:{if(!n.setSessionMode)throw uo.methodNotFound(c);let u=nYt.parse(l);return await n.setSessionMode(u)??{}}case ai.authenticate:{let u=xzt.parse(l);return await n.authenticate(u)??{}}case ai.providers_list:{if(!n.unstable_listProviders)throw uo.methodNotFound(c);let u=Pzt.parse(l);return n.unstable_listProviders(u)}case ai.providers_set:{if(!n.unstable_setProvider)throw uo.methodNotFound(c);let u=tYt.parse(l);return await n.unstable_setProvider(u)??{}}case ai.providers_disable:{if(!n.unstable_disableProvider)throw uo.methodNotFound(c);let u=wzt.parse(l);return await n.unstable_disableProvider(u)??{}}case ai.logout:{if(!n.unstable_logout)throw uo.methodNotFound(c);let u=Nzt.parse(l);return await n.unstable_logout(u)??{}}case ai.session_prompt:{let u=lYt.parse(l);return n.prompt(u)}case ai.session_set_model:{if(!n.unstable_setSessionModel)throw uo.methodNotFound(c);let u=iYt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ai.session_set_config_option:{if(!n.setSessionConfigOption)throw uo.methodNotFound(c);let u=rYt.parse(l);return n.setSessionConfigOption(u)}case ai.nes_start:{if(!n.unstable_startNes)throw uo.methodNotFound(c);let u=mYt.parse(l);return n.unstable_startNes(u)}case ai.nes_suggest:{if(!n.unstable_suggestNes)throw uo.methodNotFound(c);let u=oYt.parse(l);return n.unstable_suggestNes(u)}case ai.nes_close:{if(!n.unstable_closeNes)throw uo.methodNotFound(c);let u=Qzt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw uo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case ai.session_cancel:{let u=Uzt.parse(l);return n.cancel(u)}case ai.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=Vzt.parse(l);return n.unstable_didOpenDocument(u)}case ai.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=aYt.parse(l);return n.unstable_didChangeDocument(u)}case ai.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=Gzt.parse(l);return n.unstable_didCloseDocument(u)}case ai.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=Wzt.parse(l);return n.unstable_didSaveDocument(u)}case ai.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=$zt.parse(l);return n.unstable_didFocusDocument(u)}case ai.nes_accept:{if(!n.unstable_acceptNes)return;let u=Fzt.parse(l);return n.unstable_acceptNes(u)}case ai.nes_reject:{if(!n.unstable_rejectNes)return;let u=Zzt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw uo.methodNotFound(c)}},"notificationHandler");this.connection=new xet(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(hf.session_update,e)}requestPermission(e){return this.connection.sendRequest(hf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(hf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(hf.fs_write_text_file,e,$x)}createTerminal(e){return this.connection.sendRequest(hf.terminal_create,e,r=>new AYt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(hf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(hf.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}},AYt=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(hf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(hf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(hf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},$x)}release(){return this.connection.sendRequest(hf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},$x)}async[Symbol.asyncDispose](){await this.release()}},Iet=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case hf.fs_write_text_file:{let u=gYt.parse(l);return await n.writeTextFile?.(u)??{}}case hf.fs_read_text_file:{let u=Jzt.parse(l);return n.readTextFile?.(u)}case hf.session_request_permission:{let u=dYt.parse(l);return n.requestPermission(u)}case hf.terminal_create:{let u=jzt.parse(l);return n.createTerminal?.(u)}case hf.terminal_output:{let u=sYt.parse(l);return n.terminalOutput?.(u)}case hf.terminal_release:{let u=Xzt.parse(l);return await n.releaseTerminal?.(u)??{}}case hf.terminal_wait_for_exit:{let u=hYt.parse(l);return n.waitForTerminalExit?.(u)}case hf.terminal_kill:{let u=Yzt.parse(l);return await n.killTerminal?.(u)??{}}case hf.elicitation_create:{if(!n.unstable_createElicitation)throw uo.methodNotFound(c);let u=fYt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw uo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case hf.session_update:{let u=pYt.parse(l);return n.sessionUpdate(u)}case hf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=Rzt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw uo.methodNotFound(c)}},"notificationHandler");this.connection=new xet(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,$x)}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,$x)}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,$x)}unstable_setSessionModel(e){return this.connection.sendRequest(ai.session_set_model,e,$x)}setSessionConfigOption(e){return this.connection.sendRequest(ai.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ai.authenticate,e,$x)}unstable_listProviders(e){return this.connection.sendRequest(ai.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ai.providers_set,e,$x)}unstable_disableProvider(e){return this.connection.sendRequest(ai.providers_disable,e,$x)}unstable_logout(e){return this.connection.sendRequest(ai.logout,e,$x)}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,$x)}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}},xet=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 uo)return n.toResult();if(n instanceof k.ZodError)return uo.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 uo.internalError(o?JSON.parse(o):{}).toResult()}catch{return uo.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof uo)return n.toResult();if(n instanceof k.ZodError)return uo.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 uo.internalError(o?JSON.parse(o):{}).toResult()}catch{return uo.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 uo(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 Txn(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?Txn(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}},uo=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 A_e=require("node:stream");p();As();p();var LC=class extends Mz{constructor(r){super(new $ae,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","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${hrs(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Je[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 hrs(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(hrs,"camelCaseToSnakeCaseAllCaps");var mrs="unknown-editor",Ixn="unknown-editor-plugin",dq=class extends Lr{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:mrs,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:Ixn,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}};function xxn(t){return t.getEditorPluginInfo().name!==Ixn}a(xxn,"hasValidInfo");p();p();var wet=new Ee("agenticTurnProcessor"),ewe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(_c),this.chatFetcher=this.chatFetcher??new ec(e.ctx),this.turnSuggestions=new xQ(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new J0(e.ctx),this.hookTrigger=new xle(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s,c,l){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s,c,l)}catch(u){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u);let d=u instanceof Error?u.message:String(u);this.turn.status="error",this.updateTurnResponseWithError(d),u instanceof Error?await this.fireErrorOccurredHook(u):await this.fireErrorOccurredHook(new Error(String(u))),await this.endProgress({error:{message:d,code:eQ.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c,l,u){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let d=await Yc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!Thn(this.turn.chatMode)){let g=d.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});yt(this.turnContext.ctx,"customAgent.turn",g),wI(this.turnContext.ctx,"customAgent.turn",g)}r.onCancellationRequested(async()=>{wet.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let f=cK().find(g=>g.id===this.turn.template?.templateId);if(f?.response){await this.handleTemplateResponse(f,this.turn.template.userQuestion,r);return}let m=(await Ix(this.turnContext.ctx)).find(g=>g.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,d,f,m);try{let g=l&&c?await RM(this.turnContext.ctx,l,c):await Jo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),cQ(this.conversation.turns));Jo.applyModelConfigurationOverrides(this.turnContext.ctx,g,u),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(NC).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 Wle(this.turnContext,this.chatFetcher,g,d).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,d.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(g){if(g instanceof ZQ)wet.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,g),this.turn.status="cancelled",await this.cancelProgress();else if(g instanceof Dc)wet.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,g),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(g instanceof y3)this.turn.status="error",this.updateTurnResponseWithError(g.message),await this.fireErrorOccurredHook(g),await this.endProgress({error:{message:g.message,code:eQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(g instanceof _A)this.turn.status="error",this.updateTurnResponseWithError(g.message),await this.fireErrorOccurredHook(g),await this.endProgress({error:g.conversationError});else throw wet.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,g),g}}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 qce(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=lQ(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=uJe(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=Tle(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 yYt="collect-context",EYt="generate-response",Ret=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(_c),this.chatFetcher=this.chatFetcher??new ec(e.ctx),this.postProcessor=new zce(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new J0(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s,c,l){try{await this.processWithModel(e,r,this.turnContext,n,o,s,c,l)}catch(u){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u);let d=u instanceof Error?u.message:String(u);this.turn.status="error",this.turn.response={message:d,type:"meta"},await this.endProgress({error:{message:d,code:eQ.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c,l,u){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let d=await Yc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(d=d.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let f=cK().find(A=>A.id===this.turn.template?.templateId);if(f?.response){await this.handleTemplateResponse(f,this.turn.template.userQuestion,r);return}let h=(await Ix(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(h){let A=await this.checkAgentPreconditions(h);if(A){await this.endProgress(A);return}}await n.steps.start(yYt,"Collecting context"),await this.collectContext(n,r,d,this.strategy.uiKind,f,h);let m;l?m="customized":c?m=(await Jo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),cQ(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(yYt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(yYt),await n.steps.start(EYt,"Generating response");let A=this.augmentTelemetry(g,d,f,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,d.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c,l,u),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 qce(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,l,u){r.onCancellationRequested(async()=>{await this.cancelProgress()});let d="",f=0,h=new NQ((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(zTe)!==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=mYe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),d+=E,this.strategy.currentDocument){let P=this.strategy.extractEditsFromResponse(d,this.strategy.currentDocument);P&&P.length>0&&(d="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:P}),f+=P.length)}}),m=l&&c?await RM(this.turnContext.ctx,l,c):await Jo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),a0n(e));Jo.applyModelConfigurationOverrides(this.turnContext.ctx,m,u),e=Jo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(NC).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:Rn(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(E,_)=>h.isFinishedAfter(E,_));return o=o.extendedBy(void 0,{numCodeEdits:f}),await this.postProcessor.postProcess(y,r,h.appliedText,n,o,Rn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",e0n(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Rn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=pTe(this.conversation,this.strategy.uiKind,Rn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=pTe(this.conversation,this.strategy.uiKind,Rn(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(EYt,e.error.message):await r.steps.finish(EYt)}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=uJe(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=Tle(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();As();p();var yji=he(ml()),Eji=he(XP());p();p();var it={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 SA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(wxn(e))}};function je(t,e){let r=Mu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=wxn(r.Errors(s));return[null,{code:it.InvalidParams,message:c}]}return e(n,o,s)}}a(je,"addMethodHandlerValidation");function wxn(t){return`Schema validation failed with the following errors: ${Array.from(t).map(r=>`- ${r.path}: ${r.message}`).join(` -`)}`}a(pRn,"createErrorMessage");p();p();p();p();var vss=new ge("BackgroundAgent.Attachments");function hRn(t,e){let r=[];for(let n of t){let o=bss(n);o?r.push(o):vss.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(hRn,"convertReferencesToAttachments");function bss(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(bss,"convertReferenceToAttachment");p();var IKt=new ge("BackgroundAgent.CustomAgents");async function xKt(t,e){try{if(qt(t,je.EnableCustomAgents)===!1)return IKt.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(jp).listCustomAgents([e]);return o.length>0&&IKt.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>Sss(s))}catch(r){return IKt.warn(t,"Failed to load custom agents:",r),[]}}a(xKt,"loadCustomAgents");function Sss(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(Sss,"toSweCustomAgent");p();var wKt=new ge("BackgroundAgent.Hooks");function mRn(t,e){return{preToolUse:[Tss(t,e)],postToolUse:[Iss(t,e)],userPromptSubmitted:[xss(t,e)]}}a(mRn,"buildSessionHooks");function Tss(t,e){return async r=>{try{let o=await t.get(Xy).hook(t,k3,{timestamp:r.timestamp,cwd:Wn(e.uri),toolName:r.toolName,toolArgs:gRn(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===AZe.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){wKt.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}}}a(Tss,"createPreToolUseHandler");function Iss(t,e){return async r=>{try{await t.get(Xy).hook(t,R3,{timestamp:r.timestamp,cwd:Wn(e.uri),toolName:r.toolName,toolArgs:gRn(r.toolArgs),toolResult:{resultType:wss(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){wKt.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}}}a(Iss,"createPostToolUseHandler");function xss(t,e){return async r=>{try{await t.get(Xy).hook(t,P3,{timestamp:r.timestamp,cwd:Wn(e.uri),prompt:r.prompt},e);return}catch(n){wKt.error(t,"Failed to execute UserPromptSubmitted hook",n);return}}}a(xss,"createUserPromptSubmittedHandler");function gRn(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(gRn,"safeStringifyToolArgs");function wss(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(wss,"toClsToolResultType");p();var Rss=["model-agents-md","cwd-model-agents-md"],kss=["model-claude-md","cwd-model-claude-md"],Pss="nested-agents";function yRn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of Rss)e.add(r);if(t.useClaudeMdFile===!1)for(let r of kss)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(Pss),e}a(yRn,"computeDisabledInstructionSources");var Dss=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),Nss=2,ARn="CLAUDE.md";function Mss(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(Mss,"joinPath");async function Oss(t,e){let r=[],n=a(async(o,s)=>{let c;try{c=await t(Mss(e,o))}catch{return}for(let[l,u]of c){let d=(u&1)!==0,f=(u&2)!==0;d&&l===ARn&&o.length>0?r.push([...o,ARn].join("/")):f&&s{let n=r.lastIndexOf("/"),o=n===-1?".":r.slice(0,n);return`| ${o}/ | '${r}' | Agent instructions for ${o}/**/* |`})].join(` -`)}a(Bss,"buildNestedClaudeInstructionsSection");async function ERn(t,e){let r=await Oss(t,e);return Bss(r)}a(ERn,"scanNestedClaudeInstructions");function _Rn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` +`)}`}a(wxn,"createErrorMessage");p();p();p();p();var Rxn=new Ee("BackgroundAgent.AuthBinding"),Pet=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let r=await this.ctx.get(Fr).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(Ut).getToken()).endpoints.api;l&&(o={endpoints:{api:l}})}catch(s){Rxn.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(Fr).resolveSession())?.accessToken}catch(o){return Rxn.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 grs=new Ee("BackgroundAgent.Attachments");function Pxn(t,e){let r=[];for(let n of t){let o=Ars(n);o?r.push(o):grs.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(Pxn,"convertReferencesToAttachments");function Ars(t){switch(t.type){case"file":{let e=po(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=po(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(Ars,"convertReferenceToAttachment");p();function kxn(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(kxn,"routeInteraction");p();var Dxn=new Ee("BackgroundAgent.OTelEnv"),_Yt=new Map,vYt=new Set;function ket(t,e){process.env[t]||(_Yt.has(t)||_Yt.set(t,process.env[t]),process.env[t]=e,vYt.add(t))}a(ket,"setEnvIfAbsent");function Nxn(){for(let t of vYt){let e=_Yt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}vYt.clear()}a(Nxn,"restoreOTelEnvironment");function Mxn(t){if(!t.get(Mn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&Dxn.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),ket("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&&(ket("COPILOT_OTEL_EXPORTER_TYPE","file"),ket("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),ket("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),Dxn.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(Mxn,"applyOTelEnvironment");p();p();var R4n=he(require("crypto")),P4n=he(require("fs")),ant=he(x4n()),k4n=require("tls"),D4n=he(w4n());var xde=new Ee("certificates"),np=class{static{a(this,"RootCertificateReader")}};function cnt(t,e=process.platform){return new WXt(t,[new zXt,new YXt,gys(t,e)])}a(cnt,"getRootCertificateReader");function gys(t,e){switch(e){case"linux":return new KXt(t);case"darwin":return new JXt(t);case"win32":return new ZXt(t);default:return new XXt}}a(gys,"createPlatformReader");var VXt=class extends np{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 xde.warn(this.ctx,"Failed to read root certificates:",r),[]}}},WXt=class extends np{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new VXt(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 R4n.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return xde.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&xde.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},zXt=class extends np{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return k4n.rootCertificates}},YXt=class extends np{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await N4n(e):[]}},KXt=class extends np{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 N4n(n);xde.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},JXt=class extends np{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=ant.get({excludeBundled:!1,format:ant.Format.pem});return xde.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},ZXt=class extends np{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=D4n.all();return xde.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},XXt=class extends np{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function N4n(t){let e;try{e=await P4n.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(N4n,"readCertsFromFile");var pj=he(Iir());var wir=new Ee("BackgroundAgent.ProxyEnv"),Rir=new Map,Pir=new Set,SPe;function kir(){for(let t of Pir){let e=Rir.get(t);e===void 0?delete process.env[t]:process.env[t]=e}Pir.clear(),SPe&&((0,pj.setGlobalDispatcher)(SPe),SPe=void 0)}a(kir,"restoreProxyEnvironment");function xir(t,e,r){process.env[t]||process.env[e]||(Rir.has(t)||Rir.set(t,process.env[t]),process.env[t]=r,Pir.add(t))}a(xir,"setEnvIfAbsent");function wDs(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(wDs,"buildProxyUrl");async function RDs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(np).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{wir.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(RDs,"buildTlsOptions");async function sot(t){try{kir();let e=t.get(zo).getHttpSettings();if(!e.proxy)return;let r=wDs(e.proxy,e.proxyAuthorization);xir("HTTPS_PROXY","https_proxy",r),xir("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&xir("NO_PROXY","no_proxy",n),SPe||(SPe=(0,pj.getGlobalDispatcher)());let o=await RDs(t,e.proxyStrictSSL);(0,pj.setGlobalDispatcher)(new pj.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),wir.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,pj.getGlobalDispatcher)().constructor.name})}catch(e){wir.warn(t,"Failed to apply proxy settings to environment:",e)}}a(sot,"applyProxyToEnvironment");p();p();function iQn(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(iQn,"setPermissionsRequired");function oQn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(oQn,"setRemoteDelegate");function Dir(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(Dir,"emitSessionEvent");function Nir(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(Nir,"getRemoteHandle");function sQn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(sQn,"createAutoModeSessionManager");function aQn(t){if(t)try{t.clear()}catch{}}a(aQn,"clearAutoModeManager");p();p();p();var aot=require("fs"),cot=he(require("path"));var Mir=new Ee("OtelSpanFilePersistence"),PDs="debug.jsonl",dF=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Gt(this.ctx,Je.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=kDs(n);if(!o){Mir.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 aot.promises.mkdir(cot.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` +`)+` +`;await aot.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){Mir.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 aot.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"?[]:(Mir.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 cot.join(r,DDs(e),PDs)}};function kDs(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(kDs,"conversationIdOf");function DDs(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(DDs,"sanitizeForPath");p();var NDs={0:1,1:2,2:3,3:4,4:5};function Oir(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(Oir,"hrTimeToNano");function lQn(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=>lQn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(lQn,"encodeAnyValue");function cQn(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=lQn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(cQn,"encodeAttributes");function uQn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:NDs[t.kind]??1,startTimeUnixNano:Oir(t.startTime),endTimeUnixNano:Oir(t.endTime),attributes:cQn(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:Oir(n.time),attributes:cQn(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(uQn,"encodeSpan");var MPe=new Ee("OtelBridge"),TNs=1e3,OPe=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(dF)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(ao(),ya(r5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return MPe.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),MPe.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return MPe.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()},TNs)))}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(uQn)}catch(n){MPe.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){MPe.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var yqn=require("node:module");var Aqn=new Ee("BackgroundAgent.ManagerLifecycle");async function INs(){return"pkg"in process?(0,yqn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(INs,"importSdk");var Cot=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(Mn).getCapabilities().agentDebugLog)return;let e=OPe.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){aQn(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(){Aqn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),Mxn(this.ctx);let e=performance.now();try{this.sdk=await INs(),_t(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw gi(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await sot(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService,featureFlagService:this.sdk.createLocalFeatureFlagService()},n=sQn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),Aqn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();p();p();p();function bot(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(bot,"isJsonRpcRequest");function Eqn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(Eqn,"isJsonRpcNotification");var gw={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},mw=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();p();var Ql={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();var Aw="2025-11-25";var Tot=[Aw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],gj="io.modelcontextprotocol/related-task",Iot="2.0",rm=Szt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),_qn=El([Ke(),Ia().int()]),vqn=Ke(),hnf=Yh({ttl:Ia().optional(),pollInterval:Ia().optional()}),wNs=Wr({ttl:Ia().optional()}),RNs=Wr({taskId:Ke()}),oor=Yh({progressToken:_qn.optional(),[gj]:RNs.optional()}),uT=Wr({_meta:oor.optional()}),BPe=uT.extend({task:wNs.optional()}),Cqn=a(t=>BPe.safeParse(t).success,"isTaskAugmentedRequestParams"),kA=Wr({method:Ke(),params:uT.loose().optional()}),yw=Wr({_meta:oor.optional()}),Ew=Wr({method:Ke(),params:yw.loose().optional()}),DA=Yh({_meta:oor.optional()}),xot=El([Ke(),Ia().int()]),bqn=Wr({jsonrpc:Hn(Iot),id:xot,...kA.shape}).strict(),LPe=a(t=>bqn.safeParse(t).success,"isJSONRPCRequest"),Sqn=Wr({jsonrpc:Hn(Iot),...Ew.shape}).strict(),Tqn=a(t=>Sqn.safeParse(t).success,"isJSONRPCNotification"),sor=Wr({jsonrpc:Hn(Iot),id:xot,result:DA}).strict(),eZ=a(t=>sor.safeParse(t).success,"isJSONRPCResultResponse");var Xn;(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"})(Xn||(Xn={}));var aor=Wr({jsonrpc:Hn(Iot),id:xot.optional(),error:Wr({code:Ia().int(),message:Ke(),data:Zu().optional()})}).strict();var Iqn=a(t=>aor.safeParse(t).success,"isJSONRPCErrorResponse");var Aj=El([bqn,Sqn,sor,aor]),mnf=El([sor,aor]),tZ=DA.strict(),PNs=yw.extend({requestId:xot.optional(),reason:Ke().optional()}),wot=Ew.extend({method:Hn("notifications/cancelled"),params:PNs}),kNs=Wr({src:Ke(),mimeType:Ke().optional(),sizes:Ur(Ke()).optional(),theme:L_(["light","dark"]).optional()}),FPe=Wr({icons:Ur(kNs).optional()}),Efe=Wr({name:Ke(),title:Ke().optional()}),xqn=Efe.extend({...Efe.shape,...FPe.shape,version:Ke(),websiteUrl:Ke().optional(),description:Ke().optional()}),DNs=zxe(Wr({applyDefaults:Xc().optional()}),_l(Ke(),Zu())),NNs=yet(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,zxe(Wr({form:DNs.optional(),url:rm.optional()}),_l(Ke(),Zu()).optional())),MNs=Yh({list:rm.optional(),cancel:rm.optional(),requests:Yh({sampling:Yh({createMessage:rm.optional()}).optional(),elicitation:Yh({create:rm.optional()}).optional()}).optional()}),ONs=Yh({list:rm.optional(),cancel:rm.optional(),requests:Yh({tools:Yh({call:rm.optional()}).optional()}).optional()}),BNs=Wr({experimental:_l(Ke(),rm).optional(),sampling:Wr({context:rm.optional(),tools:rm.optional()}).optional(),elicitation:NNs.optional(),roots:Wr({listChanged:Xc().optional()}).optional(),tasks:MNs.optional(),extensions:_l(Ke(),rm).optional()}),LNs=uT.extend({protocolVersion:Ke(),capabilities:BNs,clientInfo:xqn}),FNs=kA.extend({method:Hn("initialize"),params:LNs});var UNs=Wr({experimental:_l(Ke(),rm).optional(),logging:rm.optional(),completions:rm.optional(),prompts:Wr({listChanged:Xc().optional()}).optional(),resources:Wr({subscribe:Xc().optional(),listChanged:Xc().optional()}).optional(),tools:Wr({listChanged:Xc().optional()}).optional(),tasks:ONs.optional(),extensions:_l(Ke(),rm).optional()}),cor=DA.extend({protocolVersion:Ke(),capabilities:UNs,serverInfo:xqn,instructions:Ke().optional()}),wqn=Ew.extend({method:Hn("notifications/initialized"),params:yw.optional()}),Rqn=a(t=>wqn.safeParse(t).success,"isInitializedNotification"),Rot=kA.extend({method:Hn("ping"),params:uT.optional()}),QNs=Wr({progress:Ia(),total:mu(Ia()),message:mu(Ke())}),qNs=Wr({...yw.shape,...QNs.shape,progressToken:_qn}),Pot=Ew.extend({method:Hn("notifications/progress"),params:qNs}),jNs=uT.extend({cursor:vqn.optional()}),UPe=kA.extend({params:jNs.optional()}),QPe=DA.extend({nextCursor:vqn.optional()}),HNs=L_(["working","input_required","completed","failed","cancelled"]),qPe=Wr({taskId:Ke(),status:HNs,ttl:El([Ia(),fet()]),createdAt:Ke(),lastUpdatedAt:Ke(),pollInterval:mu(Ia()),statusMessage:mu(Ke())}),rZ=DA.extend({task:qPe}),GNs=yw.merge(qPe),jPe=Ew.extend({method:Hn("notifications/tasks/status"),params:GNs}),kot=kA.extend({method:Hn("tasks/get"),params:uT.extend({taskId:Ke()})}),Dot=DA.merge(qPe),Not=kA.extend({method:Hn("tasks/result"),params:uT.extend({taskId:Ke()})}),gnf=DA.loose(),Mot=UPe.extend({method:Hn("tasks/list")}),Oot=QPe.extend({tasks:Ur(qPe)}),Bot=kA.extend({method:Hn("tasks/cancel"),params:uT.extend({taskId:Ke()})}),Pqn=DA.merge(qPe),kqn=Wr({uri:Ke(),mimeType:mu(Ke()),_meta:_l(Ke(),Zu()).optional()}),Dqn=kqn.extend({text:Ke()}),lor=Ke().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Nqn=kqn.extend({blob:lor}),HPe=L_(["user","assistant"]),_fe=Wr({audience:Ur(HPe).optional(),priority:Ia().min(0).max(1).optional(),lastModified:fue.datetime({offset:!0}).optional()}),Mqn=Wr({...Efe.shape,...FPe.shape,uri:Ke(),description:mu(Ke()),mimeType:mu(Ke()),size:mu(Ia()),annotations:_fe.optional(),_meta:mu(Yh({}))}),$Ns=Wr({...Efe.shape,...FPe.shape,uriTemplate:Ke(),description:mu(Ke()),mimeType:mu(Ke()),annotations:_fe.optional(),_meta:mu(Yh({}))}),VNs=UPe.extend({method:Hn("resources/list")}),uor=QPe.extend({resources:Ur(Mqn)}),WNs=UPe.extend({method:Hn("resources/templates/list")}),dor=QPe.extend({resourceTemplates:Ur($Ns)}),por=uT.extend({uri:Ke()}),zNs=por,YNs=kA.extend({method:Hn("resources/read"),params:zNs}),hor=DA.extend({contents:Ur(El([Dqn,Nqn]))}),pF=Ew.extend({method:Hn("notifications/resources/list_changed"),params:yw.optional()}),KNs=por,JNs=kA.extend({method:Hn("resources/subscribe"),params:KNs}),ZNs=por,XNs=kA.extend({method:Hn("resources/unsubscribe"),params:ZNs}),eMs=yw.extend({uri:Ke()}),mor=Ew.extend({method:Hn("notifications/resources/updated"),params:eMs}),tMs=Wr({name:Ke(),description:mu(Ke()),required:mu(Xc())}),rMs=Wr({...Efe.shape,...FPe.shape,description:mu(Ke()),arguments:mu(Ur(tMs)),_meta:mu(Yh({}))}),nMs=UPe.extend({method:Hn("prompts/list")}),gor=QPe.extend({prompts:Ur(rMs)}),iMs=uT.extend({name:Ke(),arguments:_l(Ke(),Ke()).optional()}),oMs=kA.extend({method:Hn("prompts/get"),params:iMs}),Aor=Wr({type:Hn("text"),text:Ke(),annotations:_fe.optional(),_meta:_l(Ke(),Zu()).optional()}),yor=Wr({type:Hn("image"),data:lor,mimeType:Ke(),annotations:_fe.optional(),_meta:_l(Ke(),Zu()).optional()}),Eor=Wr({type:Hn("audio"),data:lor,mimeType:Ke(),annotations:_fe.optional(),_meta:_l(Ke(),Zu()).optional()}),sMs=Wr({type:Hn("tool_use"),name:Ke(),id:Ke(),input:_l(Ke(),Zu()),_meta:_l(Ke(),Zu()).optional()}),aMs=Wr({type:Hn("resource"),resource:El([Dqn,Nqn]),annotations:_fe.optional(),_meta:_l(Ke(),Zu()).optional()}),cMs=Mqn.extend({type:Hn("resource_link")}),_or=El([Aor,yor,Eor,cMs,aMs]),lMs=Wr({role:HPe,content:_or}),vor=DA.extend({description:Ke().optional(),messages:Ur(lMs)}),hF=Ew.extend({method:Hn("notifications/prompts/list_changed"),params:yw.optional()}),uMs=Wr({title:Ke().optional(),readOnlyHint:Xc().optional(),destructiveHint:Xc().optional(),idempotentHint:Xc().optional(),openWorldHint:Xc().optional()}),dMs=Wr({taskSupport:L_(["required","optional","forbidden"]).optional()}),Oqn=Wr({...Efe.shape,...FPe.shape,description:Ke().optional(),inputSchema:Wr({type:Hn("object"),properties:_l(Ke(),rm).optional(),required:Ur(Ke()).optional()}).catchall(Zu()),outputSchema:Wr({type:Hn("object"),properties:_l(Ke(),rm).optional(),required:Ur(Ke()).optional()}).catchall(Zu()).optional(),annotations:uMs.optional(),execution:dMs.optional(),_meta:_l(Ke(),Zu()).optional()}),fMs=UPe.extend({method:Hn("tools/list")}),Cor=QPe.extend({tools:Ur(Oqn)}),yj=DA.extend({content:Ur(_or).default([]),structuredContent:_l(Ke(),Zu()).optional(),isError:Xc().optional()}),Anf=yj.or(DA.extend({toolResult:Zu()})),pMs=BPe.extend({name:Ke(),arguments:_l(Ke(),Zu()).optional()}),hMs=kA.extend({method:Hn("tools/call"),params:pMs}),mF=Ew.extend({method:Hn("notifications/tools/list_changed"),params:yw.optional()}),Bqn=Wr({autoRefresh:Xc().default(!0),debounceMs:Ia().int().nonnegative().default(300)}),Lqn=L_(["debug","info","notice","warning","error","critical","alert","emergency"]),mMs=uT.extend({level:Lqn}),gMs=kA.extend({method:Hn("logging/setLevel"),params:mMs}),AMs=yw.extend({level:Lqn,logger:Ke().optional(),data:Zu()}),nZ=Ew.extend({method:Hn("notifications/message"),params:AMs}),yMs=Wr({name:Ke().optional()}),EMs=Wr({hints:Ur(yMs).optional(),costPriority:Ia().min(0).max(1).optional(),speedPriority:Ia().min(0).max(1).optional(),intelligencePriority:Ia().min(0).max(1).optional()}),_Ms=Wr({mode:L_(["auto","required","none"]).optional()}),vMs=Wr({type:Hn("tool_result"),toolUseId:Ke().describe("The unique identifier for the corresponding tool call."),content:Ur(_or).default([]),structuredContent:Wr({}).loose().optional(),isError:Xc().optional(),_meta:_l(Ke(),Zu()).optional()}),CMs=get("type",[Aor,yor,Eor]),Sot=get("type",[Aor,yor,Eor,sMs,vMs]),bMs=Wr({role:HPe,content:El([Sot,Ur(Sot)]),_meta:_l(Ke(),Zu()).optional()}),SMs=BPe.extend({messages:Ur(bMs),modelPreferences:EMs.optional(),systemPrompt:Ke().optional(),includeContext:L_(["none","thisServer","allServers"]).optional(),temperature:Ia().optional(),maxTokens:Ia().int(),stopSequences:Ur(Ke()).optional(),metadata:rm.optional(),tools:Ur(Oqn).optional(),toolChoice:_Ms.optional()}),GPe=kA.extend({method:Hn("sampling/createMessage"),params:SMs}),bor=DA.extend({model:Ke(),stopReason:mu(L_(["endTurn","stopSequence","maxTokens"]).or(Ke())),role:HPe,content:CMs}),Sor=DA.extend({model:Ke(),stopReason:mu(L_(["endTurn","stopSequence","maxTokens","toolUse"]).or(Ke())),role:HPe,content:El([Sot,Ur(Sot)])}),TMs=Wr({type:Hn("boolean"),title:Ke().optional(),description:Ke().optional(),default:Xc().optional()}),IMs=Wr({type:Hn("string"),title:Ke().optional(),description:Ke().optional(),minLength:Ia().optional(),maxLength:Ia().optional(),format:L_(["email","uri","date","date-time"]).optional(),default:Ke().optional()}),xMs=Wr({type:L_(["number","integer"]),title:Ke().optional(),description:Ke().optional(),minimum:Ia().optional(),maximum:Ia().optional(),default:Ia().optional()}),wMs=Wr({type:Hn("string"),title:Ke().optional(),description:Ke().optional(),enum:Ur(Ke()),default:Ke().optional()}),RMs=Wr({type:Hn("string"),title:Ke().optional(),description:Ke().optional(),oneOf:Ur(Wr({const:Ke(),title:Ke()})),default:Ke().optional()}),PMs=Wr({type:Hn("string"),title:Ke().optional(),description:Ke().optional(),enum:Ur(Ke()),enumNames:Ur(Ke()).optional(),default:Ke().optional()}),kMs=El([wMs,RMs]),DMs=Wr({type:Hn("array"),title:Ke().optional(),description:Ke().optional(),minItems:Ia().optional(),maxItems:Ia().optional(),items:Wr({type:Hn("string"),enum:Ur(Ke())}),default:Ur(Ke()).optional()}),NMs=Wr({type:Hn("array"),title:Ke().optional(),description:Ke().optional(),minItems:Ia().optional(),maxItems:Ia().optional(),items:Wr({anyOf:Ur(Wr({const:Ke(),title:Ke()}))}),default:Ur(Ke()).optional()}),MMs=El([DMs,NMs]),OMs=El([PMs,kMs,MMs]),BMs=El([OMs,TMs,IMs,xMs]),LMs=BPe.extend({mode:Hn("form").optional(),message:Ke(),requestedSchema:Wr({type:Hn("object"),properties:_l(Ke(),BMs),required:Ur(Ke()).optional()})}),FMs=BPe.extend({mode:Hn("url"),message:Ke(),elicitationId:Ke(),url:Ke().url()}),UMs=El([LMs,FMs]),$Pe=kA.extend({method:Hn("elicitation/create"),params:UMs}),QMs=yw.extend({elicitationId:Ke()}),qMs=Ew.extend({method:Hn("notifications/elicitation/complete"),params:QMs}),Tor=DA.extend({action:L_(["accept","decline","cancel"]),content:yet(t=>t===null?void 0:t,_l(Ke(),El([Ke(),Ia(),Xc(),Ur(Ke())])).optional())}),jMs=Wr({type:Hn("ref/resource"),uri:Ke()});var HMs=Wr({type:Hn("ref/prompt"),name:Ke()}),GMs=uT.extend({ref:El([HMs,jMs]),argument:Wr({name:Ke(),value:Ke()}),context:Wr({arguments:_l(Ke(),Ke()).optional()}).optional()}),$Ms=kA.extend({method:Hn("completion/complete"),params:GMs});var Ior=DA.extend({completion:Yh({values:Ur(Ke()).max(100),total:mu(Ia().int()),hasMore:mu(Xc())})}),VMs=Wr({uri:Ke().startsWith("file://"),name:Ke().optional(),_meta:_l(Ke(),Zu()).optional()}),xor=kA.extend({method:Hn("roots/list"),params:uT.optional()}),WMs=DA.extend({roots:Ur(VMs)}),zMs=Ew.extend({method:Hn("notifications/roots/list_changed"),params:yw.optional()}),ynf=El([Rot,FNs,$Ms,gMs,oMs,nMs,VNs,WNs,YNs,JNs,XNs,hMs,fMs,kot,Not,Mot,Bot]),Enf=El([wot,Pot,wqn,zMs,jPe]),_nf=El([tZ,bor,Sor,Tor,WMs,Dot,Oot,rZ]),vnf=El([Rot,GPe,$Pe,xor,kot,Not,Mot,Bot]),Cnf=El([wot,Pot,nZ,mor,pF,mF,hF,jPe,qMs]),bnf=El([tZ,cor,Ior,vor,gor,uor,dor,hor,yj,Cor,Dot,Oot,rZ]),Ln=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===Xn.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new ior(o.elicitations,r)}return new t(e,r,n)}},ior=class extends Ln{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Xn.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var Yk=new Ee("mcpGateway"),WPe="Copilot MCP Gateway",zPe="0.1.0",VPe=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(Ql.ToolsListChanged,this._onToolsListChanged),this._invoker.on(Ql.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(Ql.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(Ql.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),Yk.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),Yk.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)bot(o)?n.push(await this._dispatchRequest(o)):Eqn(o)?this._dispatchNotification(o):Yk.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,Yk.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(Ql.ToolsListChanged,this._onToolsListChanged),this._invoker.off(Ql.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(Ql.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(Ql.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){Yk.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 mw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(Yk.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:gw.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 mw(gw.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 mw(gw.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&&Tot.includes(n)?n:Aw;return Yk.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&Yk.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:WPe,version:zPe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new mw(gw.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 mw(gw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new mw(gw.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 mw(gw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new mw(gw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){Yk.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,Yk.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){Yk.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 Fqn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(Fqn,"isInitializeMessage");var wor=require("crypto"),Uqn=require("events"),Qqn=he(require("http"));var Ej=new Ee("mcpGateway"),YMs="mcp-session-id",KMs=1024*1024,JMs=5e3,Lot={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},iZ={MountsChanged:"mountsChanged"},_j=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new Uqn.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,Ej.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),_t(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(iZ.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=Lot.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,wor.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 Ej.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),_t(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(iZ.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),Ej.info(this._ctx,`unregistered mount '${n.label}' (${e})`),_t(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(iZ.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=Qqn.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")),JMs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),Ej.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){Ej.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:gw.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){Ej.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(!Fqn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,wor.randomUUID)(),c=new VPe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&Ej.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),Ej.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(bot)}_getSessionId(e){let r=e.headers[YMs];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>KMs)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 dT=class{static{a(this,"McpGatewayHost")}constructor(e,r){this._service=r}get service(){return this._service}buildMcpServers(){let e={};for(let r of this._service.listMounts())r.status===Lot.Ready&&(e[r.id]={type:"http",url:r.url,tools:["*"]});return e}async dispose(){}};p();p();p();var Ror;Ror=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function ZMs(t){return(await Ror).getRandomValues(new Uint8Array(t))}a(ZMs,"getRandomValues");async function XMs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await ZMs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await eOs(t),r=await tOs(e);return{code_verifier:e,code_challenge:r}}a(Por,"pkceChallenge");p();var NA=XWt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:Tzt.custom,message:"URL must be parseable",fatal:!0}),axe}).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"}),jqn=Yh({resource:Ke().url(),authorization_servers:Ur(NA).optional(),jwks_uri:Ke().url().optional(),scopes_supported:Ur(Ke()).optional(),bearer_methods_supported:Ur(Ke()).optional(),resource_signing_alg_values_supported:Ur(Ke()).optional(),resource_name:Ke().optional(),resource_documentation:Ke().optional(),resource_policy_uri:Ke().url().optional(),resource_tos_uri:Ke().url().optional(),tls_client_certificate_bound_access_tokens:Xc().optional(),authorization_details_types_supported:Ur(Ke()).optional(),dpop_signing_alg_values_supported:Ur(Ke()).optional(),dpop_bound_access_tokens_required:Xc().optional()}),kor=Yh({issuer:Ke(),authorization_endpoint:NA,token_endpoint:NA,registration_endpoint:NA.optional(),scopes_supported:Ur(Ke()).optional(),response_types_supported:Ur(Ke()),response_modes_supported:Ur(Ke()).optional(),grant_types_supported:Ur(Ke()).optional(),token_endpoint_auth_methods_supported:Ur(Ke()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),service_documentation:NA.optional(),revocation_endpoint:NA.optional(),revocation_endpoint_auth_methods_supported:Ur(Ke()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),introspection_endpoint:Ke().optional(),introspection_endpoint_auth_methods_supported:Ur(Ke()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),code_challenge_methods_supported:Ur(Ke()).optional(),client_id_metadata_document_supported:Xc().optional()}),rOs=Yh({issuer:Ke(),authorization_endpoint:NA,token_endpoint:NA,userinfo_endpoint:NA.optional(),jwks_uri:NA,registration_endpoint:NA.optional(),scopes_supported:Ur(Ke()).optional(),response_types_supported:Ur(Ke()),response_modes_supported:Ur(Ke()).optional(),grant_types_supported:Ur(Ke()).optional(),acr_values_supported:Ur(Ke()).optional(),subject_types_supported:Ur(Ke()),id_token_signing_alg_values_supported:Ur(Ke()),id_token_encryption_alg_values_supported:Ur(Ke()).optional(),id_token_encryption_enc_values_supported:Ur(Ke()).optional(),userinfo_signing_alg_values_supported:Ur(Ke()).optional(),userinfo_encryption_alg_values_supported:Ur(Ke()).optional(),userinfo_encryption_enc_values_supported:Ur(Ke()).optional(),request_object_signing_alg_values_supported:Ur(Ke()).optional(),request_object_encryption_alg_values_supported:Ur(Ke()).optional(),request_object_encryption_enc_values_supported:Ur(Ke()).optional(),token_endpoint_auth_methods_supported:Ur(Ke()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),display_values_supported:Ur(Ke()).optional(),claim_types_supported:Ur(Ke()).optional(),claims_supported:Ur(Ke()).optional(),service_documentation:Ke().optional(),claims_locales_supported:Ur(Ke()).optional(),ui_locales_supported:Ur(Ke()).optional(),claims_parameter_supported:Xc().optional(),request_parameter_supported:Xc().optional(),request_uri_parameter_supported:Xc().optional(),require_request_uri_registration:Xc().optional(),op_policy_uri:NA.optional(),op_tos_uri:NA.optional(),client_id_metadata_document_supported:Xc().optional()}),Hqn=Wr({...rOs.shape,...kor.pick({code_challenge_methods_supported:!0}).shape}),Gqn=Wr({access_token:Ke(),id_token:Ke().optional(),token_type:Ke(),expires_in:Yxe.number().optional(),scope:Ke().optional(),refresh_token:Ke().optional()}).strip(),$qn=Wr({error:Ke(),error_description:Ke().optional(),error_uri:Ke().optional()}),qqn=NA.optional().or(Hn("").transform(()=>{})),nOs=Wr({redirect_uris:Ur(NA),token_endpoint_auth_method:Ke().optional(),grant_types:Ur(Ke()).optional(),response_types:Ur(Ke()).optional(),client_name:Ke().optional(),client_uri:NA.optional(),logo_uri:qqn,scope:Ke().optional(),contacts:Ur(Ke()).optional(),tos_uri:qqn,policy_uri:Ke().optional(),jwks_uri:NA.optional(),jwks:gzt().optional(),software_id:Ke().optional(),software_version:Ke().optional(),software_statement:Ke().optional()}).strip(),iOs=Wr({client_id:Ke(),client_secret:Ke().optional(),client_id_issued_at:Ia().optional(),client_secret_expires_at:Ia().optional()}).strip(),Vqn=nOs.merge(iOs),oif=Wr({error:Ke(),error_description:Ke().optional()}).strip(),sif=Wr({token:Ke(),token_type_hint:Ke().optional()}).strip();p();function Wqn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(Wqn,"resourceUrlFromServerUrl");function zqn({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(hOs,"shouldAttemptFallback");async function mOs(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??Aw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=pOs(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await Kqn(c,s,r);if(!n?.metadataUrl&&hOs(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await Kqn(u,s,r)}return l}a(mOs,"discoverMetadataWithFallback");function gOs(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(gOs,"buildDiscoveryUrls");async function Xqn(t,{fetchFn:e=fetch,protocolVersion:r=Aw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=gOs(t);for(let{url:s,type:c}of o){let l=await Bor(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"?kor.parse(await l.json()):Hqn.parse(await l.json())}}}a(Xqn,"discoverAuthorizationServerMetadata");async function AOs(t,e){let r,n;try{r=await Zqn(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 Xqn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(AOs,"discoverOAuthServerInfo");async function yOs(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(Dor))throw new Error(`Incompatible auth server: does not support response type ${Dor}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(Nor))throw new Error(`Incompatible auth server: does not support code challenge method ${Nor}`)}else l=new URL("/authorize",t);let u=await Por(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",Dor),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",Nor),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(yOs,"startAuthorization");function EOs(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(EOs,"prepareAuthorizationCodeRequest");async function ejn(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=sOs(n,f);aOs(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await Jqn(d);return Gqn.parse(await d.json())}a(ejn,"executeTokenRequest");async function _Os(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 ejn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(_Os,"refreshAuthorization");async function vOs(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=EOs(o,d,t.redirectUrl)}let u=await t.clientInformation();return ejn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(vOs,"fetchToken");async function COs(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 Jqn(c);return Vqn.parse(await c.json())}a(COs,"registerClient");p();p();p();p();function Cfe(t){return!!t._zod}a(Cfe,"isZ4Schema");function Kk(t,e){return Cfe(t)?iue(t,e):t.safeParse(e)}a(Kk,"safeParse");function Fot(t){if(!t)return;let e;if(Cfe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Fot,"getObjectShape");function tjn(t){if(Cfe(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(tjn,"getLiteralValue");p();function vj(t){return t==="completed"||t==="failed"||t==="cancelled"}a(vj,"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 Hof=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function Lor(t){let r=Fot(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=tjn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(Lor,"getMethodLiteral");function For(t,e){let r=Kk(t,e);if(!r.success)throw r.error;return r.data}a(For,"parseWithCompat");var wOs=6e4,Uot=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(wot,r=>{this._oncancel(r)}),this.setNotificationHandler(Pot,r=>{this._onprogress(r)}),this.setRequestHandler(Rot,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(kot,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Ln(Xn.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Not,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 Ln(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 Ln(Xn.InvalidParams,`Task not found: ${s}`);if(!vj(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(vj(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[gj]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(Mot,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 Ln(Xn.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Bot,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Ln(Xn.InvalidParams,`Task not found: ${r.params.taskId}`);if(vj(o.status))throw new Ln(Xn.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 Ln(Xn.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Ln?o:new Ln(Xn.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),Ln.fromError(Xn.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),eZ(s)||Iqn(s)?this._onresponse(s):LPe(s)?this._onrequest(s,c):Tqn(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=Ln.fromError(Xn.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?.[gj]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Xn.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=Cqn(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 Ln(Xn.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:Xn.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),eZ(e))n(e);else{let c=new Ln(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(eZ(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),eZ(e))o(e);else{let c=Ln.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 Ln?c:new Ln(Xn.InternalError,String(c))}}return}let s;try{let c=await this.request(e,rZ,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Ln(Xn.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},vj(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Ln(Xn.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Ln(Xn.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 Ln?c:new Ln(Xn.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||{},[gj]: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 Ln?v:new Ln(Xn.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=Kk(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??wOs,E=a(()=>A(Ln.fromError(Xn.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},Dot,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},Oot,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Pqn,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||{},[gj]: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||{},[gj]: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||{},[gj]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=Lor(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=For(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=Lor(e);this._notificationHandlers.set(n,o=>{let s=For(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"&&LPe(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Ln(Xn.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 Ln(Xn.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Ln(Xn.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 Ln(Xn.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=jPe.parse({method:"notifications/tasks/status",params:l});await this.notification(u),vj(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 Ln(Xn.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(vj(l.status))throw new Ln(Xn.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=jPe.parse({method:"notifications/tasks/status",params:u});await this.notification(d),vj(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function rjn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(rjn,"isPlainObject");function njn(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];rjn(c)&&rjn(s)?r[o]={...c,...s}:r[o]=s}return r}a(njn,"mergeCapabilities");p();var zGn=he(Tar(),1),YGn=he(WGn(),1);function kFs(){let t=new zGn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,YGn.default)(t),t}a(kFs,"createDefaultAjvInstance");var _st=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??kFs()}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 vst=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=yj,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 Ln(Xn.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 Ln(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Ln){yield{type:"error",error:f};return}yield{type:"error",error:new Ln(Xn.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 KGn(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(KGn,"assertToolsCallTaskCapability");function JGn(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(JGn,"assertClientRequestTaskCapability");function Cst(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&&Cst(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&Cst(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&Cst(r,e)}}a(Cst,"applyElicitationDefaults");function DFs(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(DFs,"getSupportedElicitationModes");var Pj=class extends Uot{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 _st,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",mF,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",hF,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",pF,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new vst(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=njn(this._capabilities,e)}setRequestHandler(e,r){let o=Fot(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Cfe(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=Kk($Pe,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Ln(Xn.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=DFs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Ln(Xn.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Ln(Xn.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=Kk(rZ,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Ln(Xn.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=Kk(Tor,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Ln(Xn.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{Cst(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=Kk(GPe,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Ln(Xn.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=Kk(rZ,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Ln(Xn.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?Sor:bor,y=Kk(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Ln(Xn.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:Aw,capabilities:this._capabilities,clientInfo:this._clientInfo}},cor,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Tot.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){KGn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&JGn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},tZ,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},Ior,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},tZ,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},vor,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},gor,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},uor,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},dor,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},hor,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},tZ,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},tZ,r)}async callTool(e,r=yj,n){if(this.isToolTaskRequired(e.name))throw new Ln(Xn.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 Ln(Xn.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 Ln(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Ln?c:new Ln(Xn.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},Cor,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=Bqn.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 bst=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 Nar(t){}a(Nar,"noop");function Sst(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=Nar,onError:r=Nar,onRetry:n=Nar,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=NFs(`${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 bst(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new bst(`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(Sst,"createParser");function NFs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),jar=a((t,e,r)=>e.has(t)||e$n("Cannot "+r),"__accessCheck"),Ys=a((t,e,r)=>(jar(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),nm=a((t,e,r)=>e.has(t)?e$n("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Ld=a((t,e,r,n)=>(jar(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),bF=a((t,e,r)=>(jar(t,e,"access private method"),r),"__privateMethod"),cb,_Z,qfe,Tst,xst,Uke,Gfe,Qke,kj,jfe,$fe,Hfe,Lke,r2,Oar,Bar,Lar,XGn,Far,Uar,Fke,Qar,qar,vZ=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),nm(this,r2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,nm(this,cb),nm(this,_Z),nm(this,qfe),nm(this,Tst),nm(this,xst),nm(this,Uke),nm(this,Gfe),nm(this,Qke,null),nm(this,kj),nm(this,jfe),nm(this,$fe,null),nm(this,Hfe,null),nm(this,Lke,null),nm(this,Bar,async s=>{var c;Ys(this,jfe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){bF(this,r2,Fke).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Ld(this,qfe,new URL(s.url)):Ld(this,qfe,void 0),d!==200){bF(this,r2,Fke).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){bF(this,r2,Fke).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(Ys(this,cb)===this.CLOSED)return;Ld(this,cb,this.OPEN);let h=new Event("open");if((c=Ys(this,Lke))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){bF(this,r2,Fke).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&&Ys(this,jfe).feed(m.decode(E,{stream:!y})),y&&(A=!1,Ys(this,jfe).reset(),bF(this,r2,Qar).call(this))}while(A)}),nm(this,Lar,s=>{Ld(this,kj,void 0),!(s.name==="AbortError"||s.type==="aborted")&&bF(this,r2,Qar).call(this,Mar(s))}),nm(this,Far,s=>{typeof s.id=="string"&&Ld(this,Qke,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:Ys(this,qfe)?Ys(this,qfe).origin:Ys(this,_Z).origin,lastEventId:s.id||""});Ys(this,Hfe)&&(!s.event||s.event==="message")&&Ys(this,Hfe).call(this,c),this.dispatchEvent(c)}),nm(this,Uar,s=>{Ld(this,Uke,s)}),nm(this,qar,()=>{Ld(this,Gfe,void 0),Ys(this,cb)===this.CONNECTING&&bF(this,r2,Oar).call(this)});try{if(e instanceof URL)Ld(this,_Z,e);else if(typeof e=="string")Ld(this,_Z,new URL(e,OFs()));else throw new Error("Invalid URL")}catch{throw MFs("An invalid or illegal string was specified")}Ld(this,jfe,Sst({onEvent:Ys(this,Far),onRetry:Ys(this,Uar)})),Ld(this,cb,this.CONNECTING),Ld(this,Uke,3e3),Ld(this,xst,(n=r?.fetch)!=null?n:globalThis.fetch),Ld(this,Tst,(o=r?.withCredentials)!=null?o:!1),bF(this,r2,Oar).call(this)}get readyState(){return Ys(this,cb)}get url(){return Ys(this,_Z).href}get withCredentials(){return Ys(this,Tst)}get onerror(){return Ys(this,$fe)}set onerror(e){Ld(this,$fe,e)}get onmessage(){return Ys(this,Hfe)}set onmessage(e){Ld(this,Hfe,e)}get onopen(){return Ys(this,Lke)}set onopen(e){Ld(this,Lke,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(){Ys(this,Gfe)&&clearTimeout(Ys(this,Gfe)),Ys(this,cb)!==this.CLOSED&&(Ys(this,kj)&&Ys(this,kj).abort(),Ld(this,cb,this.CLOSED),Ld(this,kj,void 0))}};cb=new WeakMap,_Z=new WeakMap,qfe=new WeakMap,Tst=new WeakMap,xst=new WeakMap,Uke=new WeakMap,Gfe=new WeakMap,Qke=new WeakMap,kj=new WeakMap,jfe=new WeakMap,$fe=new WeakMap,Hfe=new WeakMap,Lke=new WeakMap,r2=new WeakSet,Oar=a(function(){Ld(this,cb,this.CONNECTING),Ld(this,kj,new AbortController),Ys(this,xst)(Ys(this,_Z),bF(this,r2,XGn).call(this)).then(Ys(this,Bar)).catch(Ys(this,Lar))},"connect_fn"),Bar=new WeakMap,Lar=new WeakMap,XGn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ys(this,Qke)?{"Last-Event-ID":Ys(this,Qke)}:void 0},cache:"no-store",signal:(t=Ys(this,kj))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),Far=new WeakMap,Uar=new WeakMap,Fke=a(function(t,e){var r;Ys(this,cb)!==this.CLOSED&&Ld(this,cb,this.CLOSED);let n=new Ist("error",{code:e,message:t});(r=Ys(this,$fe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),Qar=a(function(t,e){var r;if(Ys(this,cb)===this.CLOSED)return;Ld(this,cb,this.CONNECTING);let n=new Ist("error",{code:e,message:t});(r=Ys(this,$fe))==null||r.call(this,n),this.dispatchEvent(n),Ld(this,Gfe,setTimeout(Ys(this,qar),Ys(this,Uke)))},"scheduleReconnect_fn"),qar=new WeakMap,vZ.CONNECTING=0,vZ.OPEN=1,vZ.CLOSED=2;function OFs(){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(OFs,"getBaseURL");p();function Vfe(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(Vfe,"normalizeHeaders");function wst(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...Vfe(e.headers),...Vfe(n.headers)}:e.headers};return t(r,o)}:t}a(wst,"createFetchWithInit");var qke=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},Wfe=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=wst(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new MA("No auth provider");let e;try{e=await AF(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 MA;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=Vfe(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 vZ(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}=vfe(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 qke(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=Aj.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 MA("No auth provider");if(await AF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new MA("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}=vfe(o);if(this._resourceMetadataUrl=c,this._scope=l,await AF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new MA;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 Rst=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=Sst({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 BFs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Sw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},zfe=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=wst(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??BFs}async _authThenStart(){if(!this._authProvider)throw new MA("No auth provider");let e;try{e=await AF(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 MA;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=Vfe(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 Sw(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 Rst({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=Aj.parse(JSON.parse(g.data));eZ(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 MA("No auth provider");if(await AF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new MA("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:LPe(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 Sw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=vfe(l);if(this._resourceMetadataUrl=g,this._scope=A,await AF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new MA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=vfe(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Sw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await AF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new MA;return this.send(e)}}throw new Sw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),Rqn(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=>Aj.parse(A)):[Aj.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Sw(-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 Sw(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 n$n=require("events");var Yfe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},jke=class{constructor(e){this._transport=null;this._emitter=new n$n.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 Pj({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=LFs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!t$n(l))throw l}}throw t$n(n)?new Yfe: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 Wfe(r,r$n(this._options.sseOptions,e)):new zfe(r,r$n(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(mF,()=>{this._emitter.emit(Ql.ToolsListChanged)}),this._client.setNotificationHandler(pF,()=>{this._emitter.emit(Ql.ResourcesListChanged)}),this._client.setNotificationHandler(hF,()=>{this._emitter.emit(Ql.PromptsListChanged)}),this._client.setNotificationHandler(nZ,o=>{this._emitter.emit(Ql.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 t$n(t){if(t instanceof MA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(t$n,"isUnauthorized");function LFs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Sw||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(LFs,"httpFallbackCode");function r$n(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(r$n,"withBearer");p();p();p();p();p();var n2=class{static{a(this,"McpRuntimeNotifier")}},Pst=class extends n2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var or=new Ee("CopilotMCP");async function Har(t,e){await t.get(n2).notifyLog(e)}a(Har,"notifyMCPRuntimeLog");async function im(t,e){await Har(t,{...e,level:"error"})}a(im,"notifyMCPRuntimeError");async function CZ(t,e){await Har(t,{...e,level:"warning"})}a(CZ,"notifyMCPRuntimeWarning");async function ic(t,e){await Har(t,{...e,level:"info"})}a(ic,"notifyMCPRuntimeInfo");p();async function bZ(t,e,r,n,o){return await t.get(fr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(bZ,"fetchOauthServer");async function Gar(t){try{return await t.text()}catch{return t.statusText}}a(Gar,"getErrText");p();var i$n="/.well-known",$ar=`${i$n}/oauth-protected-resource`,o$n=`${i$n}/oauth-authorization-server`,s$n=" ";function a$n(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(a$n,"isAuthorizationProtectedResourceMetadata");function c$n(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(c$n,"isAuthorizationServerMetadata");function kst(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(kst,"parseWWWAuthenticateHeader");function l$n(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(l$n,"getMetadataWithDefaultValues");function u$n(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(u$n,"getDefaultMetadataForUrl");function d$n(t){let e=new URL(t);if(!e.pathname.startsWith($ar))throw new Error(`Invalid discovery URL: expected path to start with ${$ar}`);let r=e.pathname.substring($ar.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(d$n,"getResourceServerBaseUrlFromDiscoveryUrl");function f$n(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(f$n,"isAuthorizationDynamicClientRegistrationResponse");function Dst(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Dst,"isAuthorizationTokenResponse");function Var(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(Djt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(Djt(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(Var,"getClaimsFromJWT");var War=class{static{a(this,"AuthMetadata")}},Kfe=class extends War{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=l$n(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},or.info(this.ctx,"authMetadata",f),f}catch(m){or.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=u$n(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 bZ(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}=kst(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 bZ(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":Aw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await Gar(c)}`);let l=await c.json();if(a$n(l)){let u=d$n(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(o$n,e).toString()+o,c=await bZ(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Aw});if(c.status!==200&&(c=await bZ(this.ctx,Sa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Aw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await Gar(c)}`);let l=await c.json();if(c$n(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var lb=class{static{a(this,"McpAuthService")}};var u5=new Ee("mcpGateway");async function p$n(t,e,r){u5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new Kfe(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return u5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),_t(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){u5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),gi(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(p$n,"discoverAuthMetadata");async function Nst(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=m$n(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return _t(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return _t(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Nst,"acquireSilent");async function h$n(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=FFs(t),d=m$n(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"){u5.warn(t,`mount '${o}': user cancelled the account selection`),_t(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){u5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),_t(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}_t(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){u5.error(t,`mount '${o}': failed during account selection`,h),gi(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"){u5.warn(t,`mount '${o}': user declined OAuth confirmation`),_t(t,"mcpGateway.oauth.interactive",{result:"declined"});return}_t(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){u5.error(t,`mount '${o}': failed to show auth confirmation`,f),gi(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||u5.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}.`),_t(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){u5.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)}`),gi(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(h$n,"acquireInteractive");function FFs(t){try{return t.get(ra)}catch{return}}a(FFs,"tryGetNotificationSender");function m$n(t){try{return t.get(lb)}catch{return}}a(m$n,"tryGetMcpAuthService");p();p();var oVn=he(nVn(),1),Bst=he(require("node:process"),1),sVn=require("node:stream");p();var Ost=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),d8s(r)}clear(){this._buffer=void 0}};function d8s(t){return Aj.parse(JSON.parse(t))}a(d8s,"deserializeMessage");function iVn(t){return JSON.stringify(t)+` +`}a(iVn,"serializeMessage");var f8s=Bst.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function p8s(){let t={};for(let e of f8s){let r=Bst.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(p8s,"getDefaultEnvironment");var Xfe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new Ost,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new sVn.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,oVn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...p8s(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Bst.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=iVn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var aVn=require("child_process"),cVn=require("events"),lVn=require("util");var ncr=1e4,h8s=(0,lVn.promisify)(aVn.exec),Hke=class{constructor(e){this._transport=null;this._emitter=new cVn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new Pj({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 Xfe(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(mF,()=>{this._emitter.emit(Ql.ToolsListChanged)}),this._client.setNotificationHandler(pF,()=>{this._emitter.emit(Ql.ResourcesListChanged)}),this._client.setNotificationHandler(hF,()=>{this._emitter.emit(Ql.PromptsListChanged)}),this._client.setNotificationHandler(nZ,n=>{this._emitter.emit(Ql.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),ncr))]),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 h8s(`taskkill /pid ${o} /t /f`,{timeout:ncr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,ncr));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 e0=class{static{a(this,"AuthenticationService")}};var fT=new Ee("mcpGateway.manager"),Dj=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},m8s={tools:[],resources:[],resourceTemplates:[],prompts:[]},ub=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(){let e=[];for(let r of this._entries.values())e.push({name:r.key.name,source:r.key.source,status:r.status,error:r.error,authInfo:r.authInfo,registryInfo:r.registryInfo});return e}getServerDetails(e){let r=this._entries.get(SZ(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}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 _applyConfigLocked(e){let r={kind:"user"},n=new Map,o=[];for(let[l,u]of Object.entries(e)){let d=A8s(l,u);if(!d){o.push(l);continue}n.set(SZ({source:r,name:l}),{classified:d,hash:g8s(u)})}o.length>0&&fT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)u.key.source.kind==="user"&&!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:r,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged()}serverAction(e,r){let n=SZ(e),o=this._entries.get(n);if(!o)throw new Dj("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new Dj("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new Dj("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();return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(),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:{...m8s},listeners:null};return this._entries.set(SZ(e),o),o}async _removeEntry(e){let r=this._entries.get(e);r&&(await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged())}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());let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}try{await this._service.registerMount(n,r.key.name)}catch(o){throw fT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(SZ(r.key)),await n.stop().catch(()=>{});return}if(r.status="running",r.error=void 0,await this._refreshContents(r).catch(o=>{fT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof Yfe?(r.status="unauthorized",r.error=void 0,fT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),fT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged()}}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(SZ(e.key)),this._sender.serversChanged(),n&&await n.stop().catch(o=>{fT.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(Ql.ToolsListChanged,n.toolsChanged),r.on(Ql.ResourcesListChanged,n.resourcesChanged),r.on(Ql.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(Ql.ToolsListChanged,n.toolsChanged),r.off(Ql.ResourcesListChanged,n.resourcesChanged),r.off(Ql.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){fT.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=SZ(e.key),o=e.key.name;return r.kind==="stdio"?new Hke({id:n,label:o,params:r.params,clientInfo:{name:WPe,version:zPe}}):new jke({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:WPe,version:zPe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{fT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),_t(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(e0)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await p$n(this._ctx,r,n);if(!s){fT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Nst(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){fT.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 Nst(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 Nst(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 h$n(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())}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=>fT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){fT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){fT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged()}};function SZ(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(SZ,"serializeKey");function g8s(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(g8s,"canonicalEntryHash");function A8s(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(A8s,"classifyEntry");var icr=new Ee("BackgroundAgent.McpSync"),Lst=class{constructor(e,r){this.ctx=e;this.registry=r;this.syncScheduled=!1;try{let n=e.get(dT);this.host=n,this.mountsChangedListener=()=>this.schedule(),n.service.on(iZ.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof W0))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(iZ.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(){let e;try{e=this.ctx.get(dT).buildMcpServers()}catch(r){r instanceof W0||icr.warn(this.ctx,"Failed to read MCP gateway servers for active-session sync",{error:r instanceof Error?r.message:String(r)});return}this.registry.size()!==0&&(icr.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size(),mcpServerCount:Object.keys(e).length}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{try{await n.reloadMcpServers({mcpServers:e})}catch(o){icr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:o instanceof Error?o.message:String(o)})}})))}};p();p();var Fst="/agents/sessions",Ust=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(Fst),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 uVn(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(`${Fst}/${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 uVn(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(`${Fst}/${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(`${Fst}/${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 uVn(t){try{return await t.text()}catch{return""}}a(uVn,"safeReadText");p();p();var Qst=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 y8s=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 dVn(t){return!(!t.type||y8s.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(dVn,"shouldForwardMissionControlEvent");function ocr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(ocr,"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 mVn=require("node:crypto");var E8s=500,_8s=3e3,v8s=1e4,C8s=500,Gke=2e3,b8s=256,pVn=80,qst=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new Qst({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 bfn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await Sfn(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=T8s(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: ${TZ(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: ${TZ(A)}`)}try{Dir(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${TZ(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}`))},E8s),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},_8s),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{Dir(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${TZ(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,mVn.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(!dVn(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:ocr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",ocr(r))),e.eventBuffer.length>Gke&&e.eventBuffer.splice(0,e.eventBuffer.length-Gke)}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=S8s(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>=b8s){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>Gke&&e.eventBuffer.splice(0,e.eventBuffer.length-Gke);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=v8s;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,C8s);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<=Gke&&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: ${TZ(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=hVn(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}): ${TZ(c)}`)}return}case"ask_user_response":{let n=hVn(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}): ${TZ(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 hVn(t){try{return JSON.parse(t)}catch{return}}a(hVn,"safeJsonParse");function TZ(t){return t instanceof Error?t.message:String(t)}a(TZ,"errMsg");function S8s(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>pVn?e.slice(0,pVn-1).trimEnd()+"\u2026":e:""}a(S8s,"deriveTitleFromMessage");function T8s(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(T8s,"toVscodeUriShape");var scr=new Ee("BackgroundAgent.RemoteController"),jst=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 Ust(this.ctx,scr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new qst(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:scr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!oQn(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=Nir(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=Nir(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){scr.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(Ut).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Fr).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 acr=new Ee("BackgroundAgent.CustomAgents");async function Hst(t,e){try{if(Gt(t,Je.EnableCustomAgents)===!1)return acr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Hp).listCustomAgents([e]);return o.length>0&&acr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>I8s(s))}catch(r){return acr.warn(t,"Failed to load custom agents:",r),[]}}a(Hst,"loadCustomAgents");function I8s(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(I8s,"toSweCustomAgent");p();var ccr=new Ee("BackgroundAgent.Hooks");function gVn(t,e){return{preToolUse:[x8s(t,e)],postToolUse:[w8s(t,e)],userPromptSubmitted:[R8s(t,e)]}}a(gVn,"buildSessionHooks");function x8s(t,e){return async r=>{try{let o=await t.get(Xy).hook(t,g3,{timestamp:r.timestamp,cwd:Wn(e.uri),toolName:r.toolName,toolArgs:AVn(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===wJe.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){ccr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}}}a(x8s,"createPreToolUseHandler");function w8s(t,e){return async r=>{try{await t.get(Xy).hook(t,m3,{timestamp:r.timestamp,cwd:Wn(e.uri),toolName:r.toolName,toolArgs:AVn(r.toolArgs),toolResult:{resultType:P8s(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){ccr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}}}a(w8s,"createPostToolUseHandler");function R8s(t,e){return async r=>{try{await t.get(Xy).hook(t,A3,{timestamp:r.timestamp,cwd:Wn(e.uri),prompt:r.prompt},e);return}catch(n){ccr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}}}a(R8s,"createUserPromptSubmittedHandler");function AVn(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(AVn,"safeStringifyToolArgs");function P8s(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(P8s,"toClsToolResultType");p();var k8s=["model-agents-md","cwd-model-agents-md"],D8s=["model-claude-md","cwd-model-claude-md"],N8s="nested-agents";function EVn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of k8s)e.add(r);if(t.useClaudeMdFile===!1)for(let r of D8s)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(N8s),e}a(EVn,"computeDisabledInstructionSources");var M8s=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),O8s=2,yVn="CLAUDE.md";function B8s(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(B8s,"joinPath");async function L8s(t,e){let r=[],n=a(async(o,s)=>{let c;try{c=await t(B8s(e,o))}catch{return}for(let[l,u]of c){let d=(u&1)!==0,f=(u&2)!==0;d&&l===yVn&&o.length>0?r.push([...o,yVn].join("/")):f&&s{let n=r.lastIndexOf("/"),o=n===-1?".":r.slice(0,n);return`| ${o}/ | '${r}' | Agent instructions for ${o}/**/* |`})].join(` +`)}a(F8s,"buildNestedClaudeInstructionsSection");async function _Vn(t,e){let r=await L8s(t,e);return F8s(r)}a(_Vn,"scanNestedClaudeInstructions");function vVn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` -`)}a(_Rn,"composeBackgroundAgentSystemMessage");p();function CRn(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(CRn,"routeInteraction");p();var vRn=new ge("BackgroundAgent.OTelEnv"),RKt=new Map,kKt=new Set;function Ett(t,e){process.env[t]||(RKt.has(t)||RKt.set(t,process.env[t]),process.env[t]=e,kKt.add(t))}a(Ett,"setEnvIfAbsent");function bRn(){for(let t of kKt){let e=RKt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}kKt.clear()}a(bRn,"restoreOTelEnvironment");function SRn(t){if(!t.get(Mn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&vRn.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),Ett("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&&(Ett("COPILOT_OTEL_EXPORTER_TYPE","file"),Ett("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),Ett("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),vRn.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(SRn,"applyOTelEnvironment");p();var PKt=require("node:fs"),rJ=ce(require("node:path"));function TRn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(TRn,"sanitizePathSegment");function Ctt(t){return typeof t=="string"?t:void 0}a(Ctt,"asString");function _tt(t){return typeof t=="number"?t:void 0}a(_tt,"asNumber");function Lss(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:Ctt(r.toolCallId),tool:Ctt(r.name)}}):[]}a(Lss,"asToolCallArray");function Fss(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(Fss,"toToolResultText");function Uss(t){try{return JSON.stringify(t)}catch{return}}a(Uss,"safeStringify");var DKt=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=V9t(new Date),s=TRn(r);this.sessionDir=rJ.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?rJ.join(this.sessionDir,"runSubAgent",TRn(e)):this.sessionDir}appendJsonl(e,r){let n=Uss(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await PKt.promises.mkdir(rJ.dirname(e),{recursive:!0}),await PKt.promises.appendFile(e,`${n} -`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:_tt(e.data.inputTokens),outputTokens:_tt(e.data.outputTokens),cacheReadTokens:_tt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=Lss(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(rJ.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:_tt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=Ctt(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=Ctt(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(rJ.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:Fss(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function IRn(t,e,r){let n=qt(t,je.PromptPersistBasePath)?.trim()||void 0;if(n)return new DKt(n,e,r)}a(IRn,"createBackgroundAgentPersistence");p();var Que=new ge("BackgroundAgent.ProviderConfig");async function xRn(t,e,r){if(!e)return;let n=await vWe(t,e,r);if(!n){Que.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new bc(t.get(Si)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){Que.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===Ao.Anthropic)return{type:"anthropic",baseUrl:o??Vce[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===Ao.Azure){if(!o){Que.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return Qss(t,o,n,r,l)}if(Qce(e))return{type:"openai",baseUrl:o??Vce[e],apiKey:n,modelId:r,wireModel:r,...l};Que.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(xRn,"buildProviderConfig");function Qss(t,e,r,n,o){let s;try{s=new URL(e)}catch{Que.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};Que.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(Qss,"buildAzureProviderConfig");p();p();var vLn=ce(require("crypto")),bLn=ce(require("fs")),Jnt=ce(_Ln()),SLn=require("tls"),TLn=ce(CLn());var Jde=new ge("certificates"),rp=class{static{a(this,"RootCertificateReader")}};function Znt(t,e=process.platform){return new itr(t,[new otr,new str,Uvs(t,e)])}a(Znt,"getRootCertificateReader");function Uvs(t,e){switch(e){case"linux":return new atr(t);case"darwin":return new ctr(t);case"win32":return new ltr(t);default:return new utr}}a(Uvs,"createPlatformReader");var ntr=class extends rp{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 Jde.warn(this.ctx,"Failed to read root certificates:",r),[]}}},itr=class extends rp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new ntr(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 vLn.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return Jde.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&Jde.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},otr=class extends rp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return SLn.rootCertificates}},str=class extends rp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await ILn(e):[]}},atr=class extends rp{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 ILn(n);Jde.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},ctr=class extends rp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=Jnt.get({excludeBundled:!1,format:Jnt.Format.pem});return Jde.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},ltr=class extends rp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=TLn.all();return Jde.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},utr=class extends rp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function ILn(t){let e;try{e=await bLn.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(ILn,"readCertsFromFile");var Pj=ce(For());var Qor=new ge("BackgroundAgent.ProxyEnv"),qor=new Map,jor=new Set,ePe;function Hor(){for(let t of jor){let e=qor.get(t);e===void 0?delete process.env[t]:process.env[t]=e}jor.clear(),ePe&&((0,Pj.setGlobalDispatcher)(ePe),ePe=void 0)}a(Hor,"restoreProxyEnvironment");function Uor(t,e,r){process.env[t]||process.env[e]||(qor.has(t)||qor.set(t,process.env[t]),process.env[t]=r,jor.add(t))}a(Uor,"setEnvIfAbsent");function J5s(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(J5s,"buildProxyUrl");async function Z5s(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(rp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{Qor.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(Z5s,"buildTlsOptions");async function Gor(t){try{Hor();let e=t.get(Zo).getHttpSettings();if(!e.proxy)return;let r=J5s(e.proxy,e.proxyAuthorization);Uor("HTTPS_PROXY","https_proxy",r),Uor("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Uor("NO_PROXY","no_proxy",n),ePe||(ePe=(0,Pj.getGlobalDispatcher)());let o=await Z5s(t,e.proxyStrictSSL);(0,Pj.setGlobalDispatcher)(new Pj.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),Qor.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,Pj.getGlobalDispatcher)().constructor.name})}catch(e){Qor.warn(t,"Failed to apply proxy settings to environment:",e)}}a(Gor,"applyProxyToEnvironment");p();var Ufe=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}},Kot=class extends Ufe{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},Jot=class extends Ufe{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();var Zot=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();var X5s=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"];async function Jqn(t,e,r){let n,o,s,c;e==="ask"?(n=[...X5s],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={}):(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers());let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(Jqn,"applyChatMode");p();var Xot="/agents/sessions",est=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(Xot),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 Zqn(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(`${Xot}/${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 Zqn(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(`${Xot}/${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(`${Xot}/${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 Zqn(t){try{return await t.text()}catch{return""}}a(Zqn,"safeReadText");p();p();var tst=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 e4s=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 Xqn(t){return!(!t.type||e4s.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(Xqn,"shouldForwardMissionControlEvent");function $or(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a($or,"getMissionControlEventData");function ejn(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(ejn,"maybeAcknowledgeMissionControlCommandFromEvent");p();function tjn(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(tjn,"setPermissionsRequired");function rjn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(rjn,"setRemoteDelegate");function Vor(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(Vor,"emitSessionEvent");function Wor(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(Wor,"getRemoteHandle");function njn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(njn,"createAutoModeSessionManager");function ijn(t){if(t)try{t.clear()}catch{}}a(ijn,"clearAutoModeManager");var ajn=require("node:crypto");var t4s=500,r4s=3e3,n4s=1e4,i4s=500,tPe=2e3,o4s=256,ojn=80,rst=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new tst({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 Ipn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await xpn(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=a4s(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: ${mZ(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: ${mZ(A)}`)}try{Vor(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${mZ(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}`))},t4s),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},r4s),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{Vor(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${mZ(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,ajn.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(!Xqn(r))return;ejn(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:$or(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",$or(r))),e.eventBuffer.length>tPe&&e.eventBuffer.splice(0,e.eventBuffer.length-tPe)}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=s4s(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>=o4s){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>tPe&&e.eventBuffer.splice(0,e.eventBuffer.length-tPe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=n4s;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,i4s);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<=tPe&&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: ${mZ(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=sjn(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}): ${mZ(c)}`)}return}case"ask_user_response":{let n=sjn(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}): ${mZ(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 sjn(t){try{return JSON.parse(t)}catch{return}}a(sjn,"safeJsonParse");function mZ(t){return t instanceof Error?t.message:String(t)}a(mZ,"errMsg");function s4s(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>ojn?e.slice(0,ojn-1).trimEnd()+"\u2026":e:""}a(s4s,"deriveTitleFromMessage");function a4s(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(a4s,"toVscodeUriShape");p();Ns();var c4s={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 zor(t,e){return t.get(pf).getInstructions(t,e,c4s)}a(zor,"getGitCommitInstructions");var gZ=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(vVn,"composeBackgroundAgentSystemMessage");p();As();var U8s={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 lcr(t,e){return t.get(df).getInstructions(t,e,U8s)}a(lcr,"getGitCommitInstructions");var IZ=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!==null&&(typeof t=="object"||typeof t=="function")),ljn=Cl([qe(),Ra().int()]),ujn=qe(),Csf=Yh({ttl:Ra().optional(),pollInterval:Ra().optional()}),u4s=Wr({ttl:Ra().optional()}),d4s=Wr({taskId:qe()}),Kor=Yh({progressToken:ljn.optional(),[Dj]:d4s.optional()}),mT=Wr({_meta:Kor.optional()}),rPe=mT.extend({task:u4s.optional()}),djn=a(t=>rPe.safeParse(t).success,"isTaskAugmentedRequestParams"),RA=Wr({method:qe(),params:mT.loose().optional()}),Tw=Wr({_meta:Kor.optional()}),Iw=Wr({method:qe(),params:Tw.loose().optional()}),kA=Yh({_meta:Kor.optional()}),ast=Cl([qe(),Ra().int()]),fjn=Wr({jsonrpc:Hn(sst),id:ast,...RA.shape}).strict(),nPe=a(t=>fjn.safeParse(t).success,"isJSONRPCRequest"),pjn=Wr({jsonrpc:Hn(sst),...Iw.shape}).strict(),hjn=a(t=>pjn.safeParse(t).success,"isJSONRPCNotification"),Jor=Wr({jsonrpc:Hn(sst),id:ast,result:kA}).strict(),AZ=a(t=>Jor.safeParse(t).success,"isJSONRPCResultResponse");var Xn;(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"})(Xn||(Xn={}));var Zor=Wr({jsonrpc:Hn(sst),id:ast.optional(),error:Wr({code:Ra().int(),message:qe(),data:Zu().optional()})}).strict();var mjn=a(t=>Zor.safeParse(t).success,"isJSONRPCErrorResponse");var Nj=Cl([fjn,pjn,Jor,Zor]),vsf=Cl([Jor,Zor]),yZ=kA.strict(),f4s=Tw.extend({requestId:ast.optional(),reason:qe().optional()}),cst=Iw.extend({method:Hn("notifications/cancelled"),params:f4s}),p4s=Wr({src:qe(),mimeType:qe().optional(),sizes:Fr(qe()).optional(),theme:Q_(["light","dark"]).optional()}),iPe=Wr({icons:Fr(p4s).optional()}),Qfe=Wr({name:qe(),title:qe().optional()}),gjn=Qfe.extend({...Qfe.shape,...iPe.shape,version:qe(),websiteUrl:qe().optional(),description:qe().optional()}),h4s=Swe(Wr({applyDefaults:tl().optional()}),vl(qe(),Zu())),m4s=ctt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Swe(Wr({form:h4s.optional(),url:rm.optional()}),vl(qe(),Zu()).optional())),g4s=Yh({list:rm.optional(),cancel:rm.optional(),requests:Yh({sampling:Yh({createMessage:rm.optional()}).optional(),elicitation:Yh({create:rm.optional()}).optional()}).optional()}),A4s=Yh({list:rm.optional(),cancel:rm.optional(),requests:Yh({tools:Yh({call:rm.optional()}).optional()}).optional()}),y4s=Wr({experimental:vl(qe(),rm).optional(),sampling:Wr({context:rm.optional(),tools:rm.optional()}).optional(),elicitation:m4s.optional(),roots:Wr({listChanged:tl().optional()}).optional(),tasks:g4s.optional(),extensions:vl(qe(),rm).optional()}),E4s=mT.extend({protocolVersion:qe(),capabilities:y4s,clientInfo:gjn}),_4s=RA.extend({method:Hn("initialize"),params:E4s});var C4s=Wr({experimental:vl(qe(),rm).optional(),logging:rm.optional(),completions:rm.optional(),prompts:Wr({listChanged:tl().optional()}).optional(),resources:Wr({subscribe:tl().optional(),listChanged:tl().optional()}).optional(),tools:Wr({listChanged:tl().optional()}).optional(),tasks:A4s.optional(),extensions:vl(qe(),rm).optional()}),Xor=kA.extend({protocolVersion:qe(),capabilities:C4s,serverInfo:gjn,instructions:qe().optional()}),Ajn=Iw.extend({method:Hn("notifications/initialized"),params:Tw.optional()}),yjn=a(t=>Ajn.safeParse(t).success,"isInitializedNotification"),lst=RA.extend({method:Hn("ping"),params:mT.optional()}),v4s=Wr({progress:Ra(),total:gu(Ra()),message:gu(qe())}),b4s=Wr({...Tw.shape,...v4s.shape,progressToken:ljn}),ust=Iw.extend({method:Hn("notifications/progress"),params:b4s}),S4s=mT.extend({cursor:ujn.optional()}),oPe=RA.extend({params:S4s.optional()}),sPe=kA.extend({nextCursor:ujn.optional()}),T4s=Q_(["working","input_required","completed","failed","cancelled"]),aPe=Wr({taskId:qe(),status:T4s,ttl:Cl([Ra(),rtt()]),createdAt:qe(),lastUpdatedAt:qe(),pollInterval:gu(Ra()),statusMessage:gu(qe())}),EZ=kA.extend({task:aPe}),I4s=Tw.merge(aPe),cPe=Iw.extend({method:Hn("notifications/tasks/status"),params:I4s}),dst=RA.extend({method:Hn("tasks/get"),params:mT.extend({taskId:qe()})}),fst=kA.merge(aPe),pst=RA.extend({method:Hn("tasks/result"),params:mT.extend({taskId:qe()})}),bsf=kA.loose(),hst=oPe.extend({method:Hn("tasks/list")}),mst=sPe.extend({tasks:Fr(aPe)}),gst=RA.extend({method:Hn("tasks/cancel"),params:mT.extend({taskId:qe()})}),Ejn=kA.merge(aPe),_jn=Wr({uri:qe(),mimeType:gu(qe()),_meta:vl(qe(),Zu()).optional()}),Cjn=_jn.extend({text:qe()}),esr=qe().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),vjn=_jn.extend({blob:esr}),lPe=Q_(["user","assistant"]),qfe=Wr({audience:Fr(lPe).optional(),priority:Ra().min(0).max(1).optional(),lastModified:Oue.datetime({offset:!0}).optional()}),bjn=Wr({...Qfe.shape,...iPe.shape,uri:qe(),description:gu(qe()),mimeType:gu(qe()),size:gu(Ra()),annotations:qfe.optional(),_meta:gu(Yh({}))}),x4s=Wr({...Qfe.shape,...iPe.shape,uriTemplate:qe(),description:gu(qe()),mimeType:gu(qe()),annotations:qfe.optional(),_meta:gu(Yh({}))}),w4s=oPe.extend({method:Hn("resources/list")}),tsr=sPe.extend({resources:Fr(bjn)}),R4s=oPe.extend({method:Hn("resources/templates/list")}),rsr=sPe.extend({resourceTemplates:Fr(x4s)}),nsr=mT.extend({uri:qe()}),k4s=nsr,P4s=RA.extend({method:Hn("resources/read"),params:k4s}),isr=kA.extend({contents:Fr(Cl([Cjn,vjn]))}),TF=Iw.extend({method:Hn("notifications/resources/list_changed"),params:Tw.optional()}),D4s=nsr,N4s=RA.extend({method:Hn("resources/subscribe"),params:D4s}),M4s=nsr,O4s=RA.extend({method:Hn("resources/unsubscribe"),params:M4s}),B4s=Tw.extend({uri:qe()}),osr=Iw.extend({method:Hn("notifications/resources/updated"),params:B4s}),L4s=Wr({name:qe(),description:gu(qe()),required:gu(tl())}),F4s=Wr({...Qfe.shape,...iPe.shape,description:gu(qe()),arguments:gu(Fr(L4s)),_meta:gu(Yh({}))}),U4s=oPe.extend({method:Hn("prompts/list")}),ssr=sPe.extend({prompts:Fr(F4s)}),Q4s=mT.extend({name:qe(),arguments:vl(qe(),qe()).optional()}),q4s=RA.extend({method:Hn("prompts/get"),params:Q4s}),asr=Wr({type:Hn("text"),text:qe(),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),csr=Wr({type:Hn("image"),data:esr,mimeType:qe(),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),lsr=Wr({type:Hn("audio"),data:esr,mimeType:qe(),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),j4s=Wr({type:Hn("tool_use"),name:qe(),id:qe(),input:vl(qe(),Zu()),_meta:vl(qe(),Zu()).optional()}),H4s=Wr({type:Hn("resource"),resource:Cl([Cjn,vjn]),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),G4s=bjn.extend({type:Hn("resource_link")}),usr=Cl([asr,csr,lsr,G4s,H4s]),$4s=Wr({role:lPe,content:usr}),dsr=kA.extend({description:qe().optional(),messages:Fr($4s)}),IF=Iw.extend({method:Hn("notifications/prompts/list_changed"),params:Tw.optional()}),V4s=Wr({title:qe().optional(),readOnlyHint:tl().optional(),destructiveHint:tl().optional(),idempotentHint:tl().optional(),openWorldHint:tl().optional()}),W4s=Wr({taskSupport:Q_(["required","optional","forbidden"]).optional()}),Sjn=Wr({...Qfe.shape,...iPe.shape,description:qe().optional(),inputSchema:Wr({type:Hn("object"),properties:vl(qe(),rm).optional(),required:Fr(qe()).optional()}).catchall(Zu()),outputSchema:Wr({type:Hn("object"),properties:vl(qe(),rm).optional(),required:Fr(qe()).optional()}).catchall(Zu()).optional(),annotations:V4s.optional(),execution:W4s.optional(),_meta:vl(qe(),Zu()).optional()}),z4s=oPe.extend({method:Hn("tools/list")}),fsr=sPe.extend({tools:Fr(Sjn)}),Mj=kA.extend({content:Fr(usr).default([]),structuredContent:vl(qe(),Zu()).optional(),isError:tl().optional()}),Ssf=Mj.or(kA.extend({toolResult:Zu()})),Y4s=rPe.extend({name:qe(),arguments:vl(qe(),Zu()).optional()}),K4s=RA.extend({method:Hn("tools/call"),params:Y4s}),xF=Iw.extend({method:Hn("notifications/tools/list_changed"),params:Tw.optional()}),Tjn=Wr({autoRefresh:tl().default(!0),debounceMs:Ra().int().nonnegative().default(300)}),Ijn=Q_(["debug","info","notice","warning","error","critical","alert","emergency"]),J4s=mT.extend({level:Ijn}),Z4s=RA.extend({method:Hn("logging/setLevel"),params:J4s}),X4s=Tw.extend({level:Ijn,logger:qe().optional(),data:Zu()}),_Z=Iw.extend({method:Hn("notifications/message"),params:X4s}),eBs=Wr({name:qe().optional()}),tBs=Wr({hints:Fr(eBs).optional(),costPriority:Ra().min(0).max(1).optional(),speedPriority:Ra().min(0).max(1).optional(),intelligencePriority:Ra().min(0).max(1).optional()}),rBs=Wr({mode:Q_(["auto","required","none"]).optional()}),nBs=Wr({type:Hn("tool_result"),toolUseId:qe().describe("The unique identifier for the corresponding tool call."),content:Fr(usr).default([]),structuredContent:Wr({}).loose().optional(),isError:tl().optional(),_meta:vl(qe(),Zu()).optional()}),iBs=stt("type",[asr,csr,lsr]),ist=stt("type",[asr,csr,lsr,j4s,nBs]),oBs=Wr({role:lPe,content:Cl([ist,Fr(ist)]),_meta:vl(qe(),Zu()).optional()}),sBs=rPe.extend({messages:Fr(oBs),modelPreferences:tBs.optional(),systemPrompt:qe().optional(),includeContext:Q_(["none","thisServer","allServers"]).optional(),temperature:Ra().optional(),maxTokens:Ra().int(),stopSequences:Fr(qe()).optional(),metadata:rm.optional(),tools:Fr(Sjn).optional(),toolChoice:rBs.optional()}),uPe=RA.extend({method:Hn("sampling/createMessage"),params:sBs}),psr=kA.extend({model:qe(),stopReason:gu(Q_(["endTurn","stopSequence","maxTokens"]).or(qe())),role:lPe,content:iBs}),hsr=kA.extend({model:qe(),stopReason:gu(Q_(["endTurn","stopSequence","maxTokens","toolUse"]).or(qe())),role:lPe,content:Cl([ist,Fr(ist)])}),aBs=Wr({type:Hn("boolean"),title:qe().optional(),description:qe().optional(),default:tl().optional()}),cBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),minLength:Ra().optional(),maxLength:Ra().optional(),format:Q_(["email","uri","date","date-time"]).optional(),default:qe().optional()}),lBs=Wr({type:Q_(["number","integer"]),title:qe().optional(),description:qe().optional(),minimum:Ra().optional(),maximum:Ra().optional(),default:Ra().optional()}),uBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),enum:Fr(qe()),default:qe().optional()}),dBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),oneOf:Fr(Wr({const:qe(),title:qe()})),default:qe().optional()}),fBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),enum:Fr(qe()),enumNames:Fr(qe()).optional(),default:qe().optional()}),pBs=Cl([uBs,dBs]),hBs=Wr({type:Hn("array"),title:qe().optional(),description:qe().optional(),minItems:Ra().optional(),maxItems:Ra().optional(),items:Wr({type:Hn("string"),enum:Fr(qe())}),default:Fr(qe()).optional()}),mBs=Wr({type:Hn("array"),title:qe().optional(),description:qe().optional(),minItems:Ra().optional(),maxItems:Ra().optional(),items:Wr({anyOf:Fr(Wr({const:qe(),title:qe()}))}),default:Fr(qe()).optional()}),gBs=Cl([hBs,mBs]),ABs=Cl([fBs,pBs,gBs]),yBs=Cl([ABs,aBs,cBs,lBs]),EBs=rPe.extend({mode:Hn("form").optional(),message:qe(),requestedSchema:Wr({type:Hn("object"),properties:vl(qe(),yBs),required:Fr(qe()).optional()})}),_Bs=rPe.extend({mode:Hn("url"),message:qe(),elicitationId:qe(),url:qe().url()}),CBs=Cl([EBs,_Bs]),dPe=RA.extend({method:Hn("elicitation/create"),params:CBs}),vBs=Tw.extend({elicitationId:qe()}),bBs=Iw.extend({method:Hn("notifications/elicitation/complete"),params:vBs}),msr=kA.extend({action:Q_(["accept","decline","cancel"]),content:ctt(t=>t===null?void 0:t,vl(qe(),Cl([qe(),Ra(),tl(),Fr(qe())])).optional())}),SBs=Wr({type:Hn("ref/resource"),uri:qe()});var TBs=Wr({type:Hn("ref/prompt"),name:qe()}),IBs=mT.extend({ref:Cl([TBs,SBs]),argument:Wr({name:qe(),value:qe()}),context:Wr({arguments:vl(qe(),qe()).optional()}).optional()}),xBs=RA.extend({method:Hn("completion/complete"),params:IBs});var gsr=kA.extend({completion:Yh({values:Fr(qe()).max(100),total:gu(Ra().int()),hasMore:gu(tl())})}),wBs=Wr({uri:qe().startsWith("file://"),name:qe().optional(),_meta:vl(qe(),Zu()).optional()}),Asr=RA.extend({method:Hn("roots/list"),params:mT.optional()}),RBs=kA.extend({roots:Fr(wBs)}),kBs=Iw.extend({method:Hn("notifications/roots/list_changed"),params:Tw.optional()}),Tsf=Cl([lst,_4s,xBs,Z4s,q4s,U4s,w4s,R4s,P4s,N4s,O4s,K4s,z4s,dst,pst,hst,gst]),Isf=Cl([cst,ust,Ajn,kBs,cPe]),xsf=Cl([yZ,psr,hsr,msr,RBs,fst,mst,EZ]),wsf=Cl([lst,uPe,dPe,Asr,dst,pst,hst,gst]),Rsf=Cl([cst,ust,_Z,osr,TF,xF,IF,cPe,bBs]),ksf=Cl([yZ,Xor,gsr,dsr,ssr,tsr,rsr,isr,Mj,fsr,fst,mst,EZ]),Ln=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===Xn.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Yor(o.elicitations,r)}return new t(e,r,n)}},Yor=class extends Ln{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Xn.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var r2=new ge("mcpGateway"),pPe="Copilot MCP Gateway",hPe="0.1.0",fPe=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(Hl.ToolsListChanged,this._onToolsListChanged),this._invoker.on(Hl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(Hl.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(Hl.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),r2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),r2.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)nst(o)?n.push(await this._dispatchRequest(o)):cjn(o)?this._dispatchNotification(o):r2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,r2.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(Hl.ToolsListChanged,this._onToolsListChanged),this._invoker.off(Hl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(Hl.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(Hl.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){r2.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 vw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(r2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:bw.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 vw(bw.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 vw(bw.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&&ost.includes(n)?n:Sw;return r2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&r2.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:pPe,version:hPe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new vw(bw.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 vw(bw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new vw(bw.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 vw(bw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new vw(bw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){r2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,r2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){r2.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 xjn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(xjn,"isInitializeMessage");var ysr=require("crypto"),wjn=require("events"),Rjn=ce(require("http"));var Oj=new ge("mcpGateway"),PBs="mcp-session-id",DBs=1024*1024,NBs=5e3,Ast={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},CZ={MountsChanged:"mountsChanged"},Bj=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new wjn.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,Oj.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),gt(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(CZ.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=Ast.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,ysr.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 Oj.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),gt(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(CZ.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),Oj.info(this._ctx,`unregistered mount '${n.label}' (${e})`),gt(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(CZ.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=Rjn.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")),NBs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),Oj.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){Oj.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:bw.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){Oj.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(!xjn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,ysr.randomUUID)(),c=new fPe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&Oj.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),Oj.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(nst)}_getSessionId(e){let r=e.headers[PBs];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>DBs)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 n2=class{static{a(this,"McpGatewayHost")}constructor(e,r){this._service=r}get service(){return this._service}buildMcpServers(){let e={};for(let r of this._service.listMounts())r.status===Ast.Ready&&(e[r.id]={type:"http",url:r.url,tools:["*"]});return e}async dispose(){}};p();p();p();var Esr;Esr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function MBs(t){return(await Esr).getRandomValues(new Uint8Array(t))}a(MBs,"getRandomValues");async function OBs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await MBs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await BBs(t),r=await LBs(e);return{code_verifier:e,code_challenge:r}}a(_sr,"pkceChallenge");p();var PA=oYt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:PYt.custom,message:"URL must be parseable",fatal:!0}),Lxe}).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"}),Pjn=Yh({resource:qe().url(),authorization_servers:Fr(PA).optional(),jwks_uri:qe().url().optional(),scopes_supported:Fr(qe()).optional(),bearer_methods_supported:Fr(qe()).optional(),resource_signing_alg_values_supported:Fr(qe()).optional(),resource_name:qe().optional(),resource_documentation:qe().optional(),resource_policy_uri:qe().url().optional(),resource_tos_uri:qe().url().optional(),tls_client_certificate_bound_access_tokens:tl().optional(),authorization_details_types_supported:Fr(qe()).optional(),dpop_signing_alg_values_supported:Fr(qe()).optional(),dpop_bound_access_tokens_required:tl().optional()}),Csr=Yh({issuer:qe(),authorization_endpoint:PA,token_endpoint:PA,registration_endpoint:PA.optional(),scopes_supported:Fr(qe()).optional(),response_types_supported:Fr(qe()),response_modes_supported:Fr(qe()).optional(),grant_types_supported:Fr(qe()).optional(),token_endpoint_auth_methods_supported:Fr(qe()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),service_documentation:PA.optional(),revocation_endpoint:PA.optional(),revocation_endpoint_auth_methods_supported:Fr(qe()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),introspection_endpoint:qe().optional(),introspection_endpoint_auth_methods_supported:Fr(qe()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),code_challenge_methods_supported:Fr(qe()).optional(),client_id_metadata_document_supported:tl().optional()}),FBs=Yh({issuer:qe(),authorization_endpoint:PA,token_endpoint:PA,userinfo_endpoint:PA.optional(),jwks_uri:PA,registration_endpoint:PA.optional(),scopes_supported:Fr(qe()).optional(),response_types_supported:Fr(qe()),response_modes_supported:Fr(qe()).optional(),grant_types_supported:Fr(qe()).optional(),acr_values_supported:Fr(qe()).optional(),subject_types_supported:Fr(qe()),id_token_signing_alg_values_supported:Fr(qe()),id_token_encryption_alg_values_supported:Fr(qe()).optional(),id_token_encryption_enc_values_supported:Fr(qe()).optional(),userinfo_signing_alg_values_supported:Fr(qe()).optional(),userinfo_encryption_alg_values_supported:Fr(qe()).optional(),userinfo_encryption_enc_values_supported:Fr(qe()).optional(),request_object_signing_alg_values_supported:Fr(qe()).optional(),request_object_encryption_alg_values_supported:Fr(qe()).optional(),request_object_encryption_enc_values_supported:Fr(qe()).optional(),token_endpoint_auth_methods_supported:Fr(qe()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),display_values_supported:Fr(qe()).optional(),claim_types_supported:Fr(qe()).optional(),claims_supported:Fr(qe()).optional(),service_documentation:qe().optional(),claims_locales_supported:Fr(qe()).optional(),ui_locales_supported:Fr(qe()).optional(),claims_parameter_supported:tl().optional(),request_parameter_supported:tl().optional(),request_uri_parameter_supported:tl().optional(),require_request_uri_registration:tl().optional(),op_policy_uri:PA.optional(),op_tos_uri:PA.optional(),client_id_metadata_document_supported:tl().optional()}),Djn=Wr({...FBs.shape,...Csr.pick({code_challenge_methods_supported:!0}).shape}),Njn=Wr({access_token:qe(),id_token:qe().optional(),token_type:qe(),expires_in:Twe.number().optional(),scope:qe().optional(),refresh_token:qe().optional()}).strip(),Mjn=Wr({error:qe(),error_description:qe().optional(),error_uri:qe().optional()}),kjn=PA.optional().or(Hn("").transform(()=>{})),UBs=Wr({redirect_uris:Fr(PA),token_endpoint_auth_method:qe().optional(),grant_types:Fr(qe()).optional(),response_types:Fr(qe()).optional(),client_name:qe().optional(),client_uri:PA.optional(),logo_uri:kjn,scope:qe().optional(),contacts:Fr(qe()).optional(),tos_uri:kjn,policy_uri:qe().optional(),jwks_uri:PA.optional(),jwks:vYt().optional(),software_id:qe().optional(),software_version:qe().optional(),software_statement:qe().optional()}).strip(),QBs=Wr({client_id:qe(),client_secret:qe().optional(),client_id_issued_at:Ra().optional(),client_secret_expires_at:Ra().optional()}).strip(),Ojn=UBs.merge(QBs),faf=Wr({error:qe(),error_description:qe().optional()}).strip(),paf=Wr({token:qe(),token_type_hint:qe().optional()}).strip();p();function Bjn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(Bjn,"resourceUrlFromServerUrl");function Ljn({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(KBs,"shouldAttemptFallback");async function JBs(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??Sw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=YBs(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await Ujn(c,s,r);if(!n?.metadataUrl&&KBs(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await Ujn(u,s,r)}return l}a(JBs,"discoverMetadataWithFallback");function ZBs(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(ZBs,"buildDiscoveryUrls");async function jjn(t,{fetchFn:e=fetch,protocolVersion:r=Sw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=ZBs(t);for(let{url:s,type:c}of o){let l=await Isr(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"?Csr.parse(await l.json()):Djn.parse(await l.json())}}}a(jjn,"discoverAuthorizationServerMetadata");async function XBs(t,e){let r,n;try{r=await qjn(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 jjn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(XBs,"discoverOAuthServerInfo");async function eLs(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(vsr))throw new Error(`Incompatible auth server: does not support response type ${vsr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(bsr))throw new Error(`Incompatible auth server: does not support code challenge method ${bsr}`)}else l=new URL("/authorize",t);let u=await _sr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",vsr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",bsr),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(eLs,"startAuthorization");function tLs(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(tLs,"prepareAuthorizationCodeRequest");async function Hjn(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=jBs(n,f);HBs(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await Qjn(d);return Njn.parse(await d.json())}a(Hjn,"executeTokenRequest");async function rLs(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 Hjn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(rLs,"refreshAuthorization");async function nLs(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=tLs(o,d,t.redirectUrl)}let u=await t.clientInformation();return Hjn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(nLs,"fetchToken");async function iLs(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 Qjn(c);return Ojn.parse(await c.json())}a(iLs,"registerClient");p();p();p();p();function Hfe(t){return!!t._zod}a(Hfe,"isZ4Schema");function i2(t,e){return Hfe(t)?xue(t,e):t.safeParse(e)}a(i2,"safeParse");function yst(t){if(!t)return;let e;if(Hfe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(yst,"getObjectShape");function Gjn(t){if(Hfe(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(Gjn,"getLiteralValue");p();function Lj(t){return t==="completed"||t==="failed"||t==="cancelled"}a(Lj,"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 Kcf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function xsr(t){let r=yst(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Gjn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(xsr,"getMethodLiteral");function wsr(t,e){let r=i2(t,e);if(!r.success)throw r.error;return r.data}a(wsr,"parseWithCompat");var uLs=6e4,Est=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(cst,r=>{this._oncancel(r)}),this.setNotificationHandler(ust,r=>{this._onprogress(r)}),this.setRequestHandler(lst,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(dst,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Ln(Xn.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(pst,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 Ln(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 Ln(Xn.InvalidParams,`Task not found: ${s}`);if(!Lj(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Lj(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Dj]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(hst,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 Ln(Xn.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(gst,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Ln(Xn.InvalidParams,`Task not found: ${r.params.taskId}`);if(Lj(o.status))throw new Ln(Xn.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 Ln(Xn.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Ln?o:new Ln(Xn.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),Ln.fromError(Xn.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),AZ(s)||mjn(s)?this._onresponse(s):nPe(s)?this._onrequest(s,c):hjn(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=Ln.fromError(Xn.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?.[Dj]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Xn.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=djn(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 Ln(Xn.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:Xn.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),AZ(e))n(e);else{let c=new Ln(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(AZ(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),AZ(e))o(e);else{let c=Ln.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 Ln?c:new Ln(Xn.InternalError,String(c))}}return}let s;try{let c=await this.request(e,EZ,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Ln(Xn.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Lj(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Ln(Xn.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Ln(Xn.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 Ln?c:new Ln(Xn.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||{},[Dj]: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 Ln?v:new Ln(Xn.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=i2(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??uLs,E=a(()=>A(Ln.fromError(Xn.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},fst,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},mst,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Ejn,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||{},[Dj]: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||{},[Dj]: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||{},[Dj]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=xsr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=wsr(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=xsr(e);this._notificationHandlers.set(n,o=>{let s=wsr(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"&&nPe(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Ln(Xn.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 Ln(Xn.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Ln(Xn.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 Ln(Xn.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=cPe.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Lj(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 Ln(Xn.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Lj(l.status))throw new Ln(Xn.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=cPe.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Lj(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function $jn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a($jn,"isPlainObject");function Vjn(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];$jn(c)&&$jn(s)?r[o]={...c,...s}:r[o]=s}return r}a(Vjn,"mergeCapabilities");p();var L$n=ce(mcr(),1),F$n=ce(B$n(),1);function pUs(){let t=new L$n.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,F$n.default)(t),t}a(pUs,"createDefaultAjvInstance");var eat=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??pUs()}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 tat=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=Mj,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 Ln(Xn.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 Ln(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Ln){yield{type:"error",error:f};return}yield{type:"error",error:new Ln(Xn.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 U$n(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(U$n,"assertToolsCallTaskCapability");function Q$n(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(Q$n,"assertClientRequestTaskCapability");function rat(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&&rat(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&rat(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&rat(r,e)}}a(rat,"applyElicitationDefaults");function hUs(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(hUs,"getSupportedElicitationModes");var Vj=class extends Est{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 eat,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",xF,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",IF,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",TF,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new tat(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Vjn(this._capabilities,e)}setRequestHandler(e,r){let o=yst(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Hfe(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=i2(dPe,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Ln(Xn.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=hUs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Ln(Xn.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Ln(Xn.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=i2(EZ,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Ln(Xn.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=i2(msr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Ln(Xn.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{rat(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=i2(uPe,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Ln(Xn.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=i2(EZ,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Ln(Xn.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?hsr:psr,y=i2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Ln(Xn.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:Sw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Xor,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!ost.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){U$n(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&Q$n(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},yZ,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},gsr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},yZ,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},dsr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},ssr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},tsr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},rsr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},isr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},yZ,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},yZ,r)}async callTool(e,r=Mj,n){if(this.isToolTaskRequired(e.name))throw new Ln(Xn.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 Ln(Xn.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 Ln(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Ln?c:new Ln(Xn.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},fsr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=Tjn.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 nat=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 bcr(t){}a(bcr,"noop");function iat(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=bcr,onError:r=bcr,onRetry:n=bcr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=mUs(`${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 nat(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new nat(`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(iat,"createParser");function mUs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),Dcr=a((t,e,r)=>e.has(t)||H$n("Cannot "+r),"__accessCheck"),Xs=a((t,e,r)=>(Dcr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),nm=a((t,e,r)=>e.has(t)?H$n("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Ud=a((t,e,r,n)=>(Dcr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),OF=a((t,e,r)=>(Dcr(t,e,"access private method"),r),"__privateMethod"),db,LZ,cpe,oat,aat,o2e,dpe,s2e,Wj,lpe,fpe,upe,n2e,u2,Tcr,Icr,xcr,j$n,wcr,Rcr,i2e,kcr,Pcr,FZ=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),nm(this,u2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,nm(this,db),nm(this,LZ),nm(this,cpe),nm(this,oat),nm(this,aat),nm(this,o2e),nm(this,dpe),nm(this,s2e,null),nm(this,Wj),nm(this,lpe),nm(this,fpe,null),nm(this,upe,null),nm(this,n2e,null),nm(this,Icr,async s=>{var c;Xs(this,lpe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){OF(this,u2,i2e).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Ud(this,cpe,new URL(s.url)):Ud(this,cpe,void 0),d!==200){OF(this,u2,i2e).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){OF(this,u2,i2e).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(Xs(this,db)===this.CLOSED)return;Ud(this,db,this.OPEN);let h=new Event("open");if((c=Xs(this,n2e))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){OF(this,u2,i2e).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&&Xs(this,lpe).feed(m.decode(E,{stream:!y})),y&&(A=!1,Xs(this,lpe).reset(),OF(this,u2,kcr).call(this))}while(A)}),nm(this,xcr,s=>{Ud(this,Wj,void 0),!(s.name==="AbortError"||s.type==="aborted")&&OF(this,u2,kcr).call(this,Scr(s))}),nm(this,wcr,s=>{typeof s.id=="string"&&Ud(this,s2e,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:Xs(this,cpe)?Xs(this,cpe).origin:Xs(this,LZ).origin,lastEventId:s.id||""});Xs(this,upe)&&(!s.event||s.event==="message")&&Xs(this,upe).call(this,c),this.dispatchEvent(c)}),nm(this,Rcr,s=>{Ud(this,o2e,s)}),nm(this,Pcr,()=>{Ud(this,dpe,void 0),Xs(this,db)===this.CONNECTING&&OF(this,u2,Tcr).call(this)});try{if(e instanceof URL)Ud(this,LZ,e);else if(typeof e=="string")Ud(this,LZ,new URL(e,AUs()));else throw new Error("Invalid URL")}catch{throw gUs("An invalid or illegal string was specified")}Ud(this,lpe,iat({onEvent:Xs(this,wcr),onRetry:Xs(this,Rcr)})),Ud(this,db,this.CONNECTING),Ud(this,o2e,3e3),Ud(this,aat,(n=r?.fetch)!=null?n:globalThis.fetch),Ud(this,oat,(o=r?.withCredentials)!=null?o:!1),OF(this,u2,Tcr).call(this)}get readyState(){return Xs(this,db)}get url(){return Xs(this,LZ).href}get withCredentials(){return Xs(this,oat)}get onerror(){return Xs(this,fpe)}set onerror(e){Ud(this,fpe,e)}get onmessage(){return Xs(this,upe)}set onmessage(e){Ud(this,upe,e)}get onopen(){return Xs(this,n2e)}set onopen(e){Ud(this,n2e,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(){Xs(this,dpe)&&clearTimeout(Xs(this,dpe)),Xs(this,db)!==this.CLOSED&&(Xs(this,Wj)&&Xs(this,Wj).abort(),Ud(this,db,this.CLOSED),Ud(this,Wj,void 0))}};db=new WeakMap,LZ=new WeakMap,cpe=new WeakMap,oat=new WeakMap,aat=new WeakMap,o2e=new WeakMap,dpe=new WeakMap,s2e=new WeakMap,Wj=new WeakMap,lpe=new WeakMap,fpe=new WeakMap,upe=new WeakMap,n2e=new WeakMap,u2=new WeakSet,Tcr=a(function(){Ud(this,db,this.CONNECTING),Ud(this,Wj,new AbortController),Xs(this,aat)(Xs(this,LZ),OF(this,u2,j$n).call(this)).then(Xs(this,Icr)).catch(Xs(this,xcr))},"connect_fn"),Icr=new WeakMap,xcr=new WeakMap,j$n=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Xs(this,s2e)?{"Last-Event-ID":Xs(this,s2e)}:void 0},cache:"no-store",signal:(t=Xs(this,Wj))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),wcr=new WeakMap,Rcr=new WeakMap,i2e=a(function(t,e){var r;Xs(this,db)!==this.CLOSED&&Ud(this,db,this.CLOSED);let n=new sat("error",{code:e,message:t});(r=Xs(this,fpe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),kcr=a(function(t,e){var r;if(Xs(this,db)===this.CLOSED)return;Ud(this,db,this.CONNECTING);let n=new sat("error",{code:e,message:t});(r=Xs(this,fpe))==null||r.call(this,n),this.dispatchEvent(n),Ud(this,dpe,setTimeout(Xs(this,Pcr),Xs(this,o2e)))},"scheduleReconnect_fn"),Pcr=new WeakMap,FZ.CONNECTING=0,FZ.OPEN=1,FZ.CLOSED=2;function AUs(){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(AUs,"getBaseURL");p();function ppe(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(ppe,"normalizeHeaders");function cat(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...ppe(e.headers),...ppe(n.headers)}:e.headers};return t(r,o)}:t}a(cat,"createFetchWithInit");var a2e=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},hpe=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=cat(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new DA("No auth provider");let e;try{e=await RF(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 DA;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=ppe(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 FZ(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}=jfe(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 a2e(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=Nj.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 DA("No auth provider");if(await RF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA("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}=jfe(o);if(this._resourceMetadataUrl=c,this._scope=l,await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA;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 lat=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=iat({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 yUs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Pw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},mpe=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=cat(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??yUs}async _authThenStart(){if(!this._authProvider)throw new DA("No auth provider");let e;try{e=await RF(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 DA;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=ppe(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 Pw(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 lat({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=Nj.parse(JSON.parse(g.data));AZ(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 DA("No auth provider");if(await RF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA("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:nPe(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 Pw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=jfe(l);if(this._resourceMetadataUrl=g,this._scope=A,await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=jfe(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Pw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new DA;return this.send(e)}}throw new Pw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),yjn(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=>Nj.parse(A)):[Nj.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Pw(-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 Pw(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 V$n=require("events");var gpe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},c2e=class{constructor(e){this._transport=null;this._emitter=new V$n.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 Vj({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=EUs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!G$n(l))throw l}}throw G$n(n)?new gpe: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 hpe(r,$$n(this._options.sseOptions,e)):new mpe(r,$$n(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(xF,()=>{this._emitter.emit(Hl.ToolsListChanged)}),this._client.setNotificationHandler(TF,()=>{this._emitter.emit(Hl.ResourcesListChanged)}),this._client.setNotificationHandler(IF,()=>{this._emitter.emit(Hl.PromptsListChanged)}),this._client.setNotificationHandler(_Z,o=>{this._emitter.emit(Hl.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 G$n(t){if(t instanceof DA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(G$n,"isUnauthorized");function EUs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Pw||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(EUs,"httpFallbackCode");function $$n(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($$n,"withBearer");p();p();p();p();p();var d2=class{static{a(this,"McpRuntimeNotifier")}},uat=class extends d2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var ir=new ge("CopilotMCP");async function Ncr(t,e){await t.get(d2).notifyLog(e)}a(Ncr,"notifyMCPRuntimeLog");async function im(t,e){await Ncr(t,{...e,level:"error"})}a(im,"notifyMCPRuntimeError");async function UZ(t,e){await Ncr(t,{...e,level:"warning"})}a(UZ,"notifyMCPRuntimeWarning");async function sc(t,e){await Ncr(t,{...e,level:"info"})}a(sc,"notifyMCPRuntimeInfo");p();async function QZ(t,e,r,n,o){return await t.get(ar).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(QZ,"fetchOauthServer");async function Mcr(t){try{return await t.text()}catch{return t.statusText}}a(Mcr,"getErrText");p();var W$n="/.well-known",Ocr=`${W$n}/oauth-protected-resource`,z$n=`${W$n}/oauth-authorization-server`,Y$n=" ";function K$n(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(K$n,"isAuthorizationProtectedResourceMetadata");function J$n(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(J$n,"isAuthorizationServerMetadata");function dat(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(dat,"parseWWWAuthenticateHeader");function Z$n(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(Z$n,"getMetadataWithDefaultValues");function X$n(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(X$n,"getDefaultMetadataForUrl");function eVn(t){let e=new URL(t);if(!e.pathname.startsWith(Ocr))throw new Error(`Invalid discovery URL: expected path to start with ${Ocr}`);let r=e.pathname.substring(Ocr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(eVn,"getResourceServerBaseUrlFromDiscoveryUrl");function tVn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(tVn,"isAuthorizationDynamicClientRegistrationResponse");function fat(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(fat,"isAuthorizationTokenResponse");function Bcr(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(FHt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(FHt(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(Bcr,"getClaimsFromJWT");var Lcr=class{static{a(this,"AuthMetadata")}},Ape=class extends Lcr{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=Z$n(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},ir.info(this.ctx,"authMetadata",f),f}catch(m){ir.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=X$n(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 QZ(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}=dat(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 QZ(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":Sw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await Mcr(c)}`);let l=await c.json();if(K$n(l)){let u=eVn(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(z$n,e).toString()+o,c=await QZ(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Sw});if(c.status!==200&&(c=await QZ(this.ctx,xa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Sw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await Mcr(c)}`);let l=await c.json();if(J$n(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var fb=class{static{a(this,"McpAuthService")}};var E5=new ge("mcpGateway");async function rVn(t,e,r){E5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new Ape(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return E5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),gt(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){E5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),gi(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(rVn,"discoverAuthMetadata");async function pat(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=iVn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return gt(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return gt(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(pat,"acquireSilent");async function nVn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=_Us(t),d=iVn(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"){E5.warn(t,`mount '${o}': user cancelled the account selection`),gt(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){E5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),gt(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}gt(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){E5.error(t,`mount '${o}': failed during account selection`,h),gi(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"){E5.warn(t,`mount '${o}': user declined OAuth confirmation`),gt(t,"mcpGateway.oauth.interactive",{result:"declined"});return}gt(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){E5.error(t,`mount '${o}': failed to show auth confirmation`,f),gi(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||E5.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}.`),gt(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){E5.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)}`),gi(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(nVn,"acquireInteractive");function _Us(t){try{return t.get(sa)}catch{return}}a(_Us,"tryGetNotificationSender");function iVn(t){try{return t.get(fb)}catch{return}}a(iVn,"tryGetMcpAuthService");p();p();var zVn=ce(VVn(),1),gat=ce(require("node:process"),1),YVn=require("node:stream");p();var mat=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),WUs(r)}clear(){this._buffer=void 0}};function WUs(t){return Nj.parse(JSON.parse(t))}a(WUs,"deserializeMessage");function WVn(t){return JSON.stringify(t)+` -`}a(WVn,"serializeMessage");var zUs=gat.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function YUs(){let t={};for(let e of zUs){let r=gat.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(YUs,"getDefaultEnvironment");var _pe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new mat,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new YVn.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,zVn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...YUs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:gat.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=WVn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var KVn=require("child_process"),JVn=require("events"),ZVn=require("util");var Wcr=1e4,KUs=(0,ZVn.promisify)(KVn.exec),l2e=class{constructor(e){this._transport=null;this._emitter=new JVn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new Vj({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 _pe(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(xF,()=>{this._emitter.emit(Hl.ToolsListChanged)}),this._client.setNotificationHandler(TF,()=>{this._emitter.emit(Hl.ResourcesListChanged)}),this._client.setNotificationHandler(IF,()=>{this._emitter.emit(Hl.PromptsListChanged)}),this._client.setNotificationHandler(_Z,n=>{this._emitter.emit(Hl.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),Wcr))]),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 KUs(`taskkill /pid ${o} /t /f`,{timeout:Wcr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Wcr));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 e0=class{static{a(this,"AuthenticationService")}};var gT=new ge("mcpGateway.manager"),zj=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},JUs={tools:[],resources:[],resourceTemplates:[],prompts:[]},pb=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(){let e=[];for(let r of this._entries.values())e.push({name:r.key.name,source:r.key.source,status:r.status,error:r.error,authInfo:r.authInfo,registryInfo:r.registryInfo});return e}getServerDetails(e){let r=this._entries.get(qZ(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}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 _applyConfigLocked(e){let r={kind:"user"},n=new Map,o=[];for(let[l,u]of Object.entries(e)){let d=XUs(l,u);if(!d){o.push(l);continue}n.set(qZ({source:r,name:l}),{classified:d,hash:ZUs(u)})}o.length>0&&gT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)u.key.source.kind==="user"&&!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:r,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged()}serverAction(e,r){let n=qZ(e),o=this._entries.get(n);if(!o)throw new zj("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new zj("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new zj("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();return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(),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:{...JUs},listeners:null};return this._entries.set(qZ(e),o),o}async _removeEntry(e){let r=this._entries.get(e);r&&(await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged())}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());let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}try{await this._service.registerMount(n,r.key.name)}catch(o){throw gT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(qZ(r.key)),await n.stop().catch(()=>{});return}if(r.status="running",r.error=void 0,await this._refreshContents(r).catch(o=>{gT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof gpe?(r.status="unauthorized",r.error=void 0,gT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),gT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged()}}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(qZ(e.key)),this._sender.serversChanged(),n&&await n.stop().catch(o=>{gT.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(Hl.ToolsListChanged,n.toolsChanged),r.on(Hl.ResourcesListChanged,n.resourcesChanged),r.on(Hl.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(Hl.ToolsListChanged,n.toolsChanged),r.off(Hl.ResourcesListChanged,n.resourcesChanged),r.off(Hl.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){gT.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=qZ(e.key),o=e.key.name;return r.kind==="stdio"?new l2e({id:n,label:o,params:r.params,clientInfo:{name:pPe,version:hPe}}):new c2e({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:pPe,version:hPe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{gT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),gt(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(e0)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await rVn(this._ctx,r,n);if(!s){gT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await pat(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){gT.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 pat(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 pat(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 nVn(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())}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=>gT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){gT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){gT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged()}};function qZ(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(qZ,"serializeKey");function ZUs(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(ZUs,"canonicalEntryHash");function XUs(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(XUs,"classifyEntry");p();p();p();var Aat=require("fs"),yat=ce(require("path"));var zcr=new ge("OtelSpanFilePersistence"),e7s="debug.jsonl",BF=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=qt(this.ctx,je.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=t7s(n);if(!o){zcr.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 Aat.promises.mkdir(yat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` -`)+` -`;await Aat.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){zcr.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 Aat.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"?[]:(zcr.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 yat.join(r,r7s(e),e7s)}};function t7s(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(t7s,"conversationIdOf");function r7s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(r7s,"sanitizeForPath");p();var n7s={0:1,1:2,2:3,3:4,4:5};function Ycr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(Ycr,"hrTimeToNano");function eWn(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=>eWn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(eWn,"encodeAnyValue");function XVn(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=eWn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(XVn,"encodeAttributes");function tWn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:n7s[t.kind]??1,startTimeUnixNano:Ycr(t.startTime),endTimeUnixNano:Ycr(t.endTime),attributes:XVn(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:Ycr(n.time),attributes:XVn(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(tWn,"encodeSpan");var E2e=new ge("OtelBridge"),Y7s=1e3,_2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(BF)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),Ca(v5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return E2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),E2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return E2e.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()},Y7s)))}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(tWn)}catch(n){E2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){E2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var czn=require("node:module");Ns();var qo=new ge("BackgroundAgent"),K7s=20,FF="backgroundAgent",J7s="backgroundAgent.remote",Z7s=new Set(["system.message","hook.start","hook.end"]);async function X7s(){return"pkg"in process?(0,czn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(X7s,"importSdk");var Us=class{constructor(e){this.ctx=e;this.activeSessions=new Map;this.currentChatMode=new Map;this.remoteDelegates=new Map;this.sessionWorkingDirs=new Map;this.lastBoundProviderModel=new Map;this.processedEventIds=new Map;this.pendingExternalToolDefs=new Map;this.turnIndexes=new Map;this._mcpSyncScheduled=!1;this.notificationSender=e.get(sa),e.get(Zo).onDidChangeHttpSettings(()=>{Gor(this.ctx)}),Es(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(EA).onDidChangeSkillsEnabled(()=>{this.currentChatMode.clear()})}catch(n){if(!(n instanceof $y))throw n}try{let n=e.get(n2);this._mcpGatewayHost=n,this._mountsChangedListener=()=>this.scheduleMcpServersSync(),n.service.on(CZ.MountsChanged,this._mountsChangedListener)}catch(n){if(!(n instanceof $y))throw n}}static{a(this,"BackgroundAgentService")}scheduleMcpServersSync(){this._mcpSyncScheduled||(this._mcpSyncScheduled=!0,queueMicrotask(()=>{this._mcpSyncScheduled=!1,this.syncMcpServersToActiveSessions()}))}async syncMcpServersToActiveSessions(){let e;try{e=this.ctx.get(n2).buildMcpServers()}catch(r){r instanceof $y||qo.warn(this.ctx,"Failed to read MCP gateway servers for active-session sync",{error:r instanceof Error?r.message:String(r)});return}this.activeSessions.size!==0&&(qo.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.activeSessions.size,mcpServerCount:Object.keys(e).length}),await Promise.all([...this.activeSessions].map(async([r,n])=>{try{await n.reloadMcpServers({mcpServers:e})}catch(o){qo.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:o instanceof Error?o.message:String(o)})}})))}async handleAuthStateChange(){let e;try{e=(await this.ctx.get(Ur).resolveSession())?.accessToken}catch(r){qo.warn(this.ctx,"Failed to read GitHub session on auth change; skipping cache invalidation",{error:r instanceof Error?r.message:String(r)});return}this.lastAccessToken!==e&&(qo.info(this.ctx,"GitHub identity changed, clearing cached sessions",{hadPrevious:this.lastAccessToken!==void 0,hasCurrent:e!==void 0,cachedSessionCount:this.activeSessions.size,remoteDelegateCount:this.remoteDelegates.size}),this.lastAccessToken=e,this.clearUserScopedState())}clearUserScopedState(){for(let e of this.remoteDelegates.values())e.disable().catch(()=>{});this.remoteDelegates.clear(),this.sessionWorkingDirs.clear(),this.activeSessions.clear(),this.pendingExternalToolDefs.clear(),this.processedEventIds.clear(),this.turnIndexes.clear(),this.lastBoundProviderModel.clear(),this.currentChatMode.clear(),ijn(this.autoModeManager)}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}async initManager(){qo.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),SRn(this.ctx);let e=performance.now();try{this.sdk=await X7s(),gt(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw gi(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await Gor(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService,featureFlagService:this.sdk.createLocalFeatureFlagService()},n=njn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),qo.info(this.ctx,"LocalSessionManager initialized.")}installBridgeSpanProcessor(){if(this.installedBridge!==void 0||!this.ctx.get(Mn).getCapabilities().agentDebugLog)return;let e=_2e.installInto(this.ctx);this.installedBridge=e.processor}cacheSession(e,r){if(this.activeSessions.has(e)&&this.activeSessions.delete(e),this.activeSessions.set(e,r),this.activeSessions.size>K7s){let n=this.activeSessions.keys().next().value;n!==void 0&&(qo.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.activeSessions.delete(n))}}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=CRn(n,e);return gt(this.ctx,"backgroundAgent.interaction",{requestSource:FF,sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type,resultKind:e.type==="permission"?e.result.kind:""},{totalTimeMs:performance.now()-r}),o}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){qo.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 applyTurnOverrides(e,r){let n=r.providerName?r.providerName:void 0;if(n!==void 0&&!AQ(await this.ctx.get(Qt).getToken()))throw new Jot(`BYOK is disabled for this account. Provider '${n}' cannot be used for model '${r.model??""}'.`,n,r.model);let o=await xRn(this.ctx,n,r.model);if(n!==void 0&&o===void 0)throw new Kot(`BYOK provider '${n}' is misconfigured for model '${r.model??""}'. Verify the API key`+(n===Ao.Azure?" and per-model deployment URL":"")+" is configured for this provider/model.",n,r.model);let s=this.lastBoundProviderModel.get(r.sessionId),c=r.model,l=c!==void 0&&s?.model!==c,u=s!==void 0&&s.provider!==n,d=s!==void 0&&(u||l),f=e,h=!1;if(d){qo.info(this.ctx,`Provider/model changed for session ${r.sessionId} (${s?.provider??"(built-in)"}/${s?.model??"(unchanged)"} \u2192 ${n??"(built-in)"}/${c??"(unchanged)"}); forcing close+resume cycle to strip provider-bound reasoning state.`);let m=await this.ensureManager();this.activeSessions.delete(r.sessionId),this.currentChatMode.delete(r.sessionId);try{await m.closeSession(r.sessionId),h=!0,f=await this.getOrResumeSession(r.sessionId)}catch(g){if(h)throw this.lastBoundProviderModel.delete(r.sessionId),new Error(`Failed to resume session ${r.sessionId} after provider/model change: `+(g instanceof Error?g.message:String(g)));qo.warn(this.ctx,`Failed to close session ${r.sessionId} for provider/model change; continuing with existing session: `+(g instanceof Error?g.message:String(g))),f=e}}try{f.updateOptions({provider:o??null,...c?{model:c}:{},...r.reasoningEffort?{reasoningEffort:r.reasoningEffort}:{},...r.contextTier?{contextTier:r.contextTier}:{}})}catch(m){throw new Error(`Failed to bind BYOK provider '${n??"(built-in)"}' to session ${r.sessionId}: ${m instanceof Error?m.message:String(m)}`)}return this.lastBoundProviderModel.set(r.sessionId,{provider:n,model:c??s?.model}),qo.info(this.ctx,`Rebound session ${r.sessionId} for this turn: provider=${n??"(built-in)"}, model=${c??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),f}async applyChatModeSelection(e,r){if(r.chatMode===void 0||r.chatMode==="ask")return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),qo.info(this.ctx,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),qo.info(this.ctx,`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.`)}}async buildSessionOptions(e,r){let n=await this.buildAuthInfo(),o=To(r.workspaceFolder.uri).fsPath,s;try{s=this.ctx.get(EA).getSkillDirectories(o),s.length===0&&(s=void 0)}catch{}let c={clientName:this.ctx.get(Lr).getEditorPluginInfo().name,sessionId:e,authInfo:n,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:s,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:o};try{await this.ctx.get(YL)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let l=await xKt(this.ctx,r.workspaceFolder);l.length>0&&(c.customAgents=l);try{let m=this.ctx.get(n2).buildMcpServers();qo.info(this.ctx,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:m}),Object.keys(m).length>0&&(c.mcpServers=m)}catch(m){if(!(m instanceof $y))throw m}c.hooks=mRn(this.ctx,r.workspaceFolder);let u=await zor(this.ctx,[r.workspaceFolder]).catch(m=>{qo.warn(this.ctx,"Failed to load git commit instructions for systemMessage",m)}),d=r.useNestedClaudeMdFiles===!0?await this.scanNestedClaudeSection(o):void 0,f=_Rn({gitCommitInstructions:u,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:d});f!==void 0&&(c.systemMessage={mode:"append",content:f}),r.externalToolDefinitions?.length&&(c.externalToolDefinitions=r.externalToolDefinitions);let h=yRn(r);return h.size>0&&(c.disabledInstructionSources=h),c}async scanNestedClaudeSection(e){let r;try{r=this.ctx.get(Fo)}catch{return}try{return await ERn(async n=>r.readDirectory(Ia(n)),e)}catch(n){qo.warn(this.ctx,"Failed to scan nested CLAUDE.md files",n);return}}async createSession(e){let r=performance.now();qo.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??gr(),s=await this.buildSessionOptions(o,e),c=await n.createSession(s);return qo.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),gt(this.ctx,"backgroundAgent.create",{requestSource:FF,modelId:e.model??"",reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.cacheSession(o,c),this.sessionWorkingDirs.set(o,To(e.workspaceFolder.uri).fsPath),{sessionId:o,workspacePath:c.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),qo.info(this.ctx,"Stored pending external tool definitions",{sessionId:e,toolCount:r.length}))}async getOrResumeSession(e,r={}){let n=this.activeSessions.get(e);if(n){let f=this.pendingExternalToolDefs.get(e);return f&&(this.pendingExternalToolDefs.delete(e),n.updateOptions({externalToolDefinitions:f}),qo.info(this.ctx,"Applied pending external tool definitions to cached session",{sessionId:e,toolCount:f.length})),n}let o=await this.ensureManager(),s=r.workspaceFolder;if(!s){let f=await o.getSessionMetadata({sessionId:e});if(!f)throw new Error(`Session not found: ${e}`);let h=f.context?.cwd;if(!h)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);s={uri:Ia(h)},qo.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}`);if(this.cacheSession(e,u),!this.turnIndexes.has(e)){let f=Array.from(u.getEvents()).filter(h=>h.type==="user.message").length;f>0&&this.turnIndexes.set(e,f-1)}this.currentChatMode.delete(e),this.installBridgeSpanProcessor();let d=s?.uri?To(s.uri).fsPath:void 0;return d&&this.sessionWorkingDirs.set(e,d),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),await this.expandPromptTemplate(e.sessionId,e),await this.applyChatModeSelection(o,e);let s={prompt:e.message,...e.sendMode?{mode:e.sendMode}:{}};if(this.applyAgentModeOverride(o,e,s),e.references?.length){let f=hRn(e.references,this.ctx);f.length>0&&(s.attachments=f)}let c=performance.now(),l=this.nextTurnIndex(e.sessionId);this.wireTurnAndSend(e.sessionId,o,s,l,r);let u={requestSource:FF,chatMode:this.currentChatMode.get(e.sessionId)??"agent",sessionId:e.sessionId,modelId:e.model??"",providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(l)},d={totalTimeMs:performance.now()-c,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return gt(this.ctx,"backgroundAgent.send",u,d),ht(this.ctx,"backgroundAgent.send",jt.createAndMarkAsIssued(u,d)),{}}async applyChatModeOverride(e,r,n){let s=(n.chatMode??"agent")==="ask"?"ask":"agent";if(this.currentChatMode.get(e)===s)return;let l=this.sessionWorkingDirs.get(e);if(!l)throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);let u={uri:Ia(l)};this.currentChatMode.delete(e),await Jqn(r,s,{loadCustomAgents:a(()=>xKt(this.ctx,u),"loadCustomAgents"),getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(d=>d.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let d;try{d=this.ctx.get(EA)}catch{return[]}return d.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{try{return Promise.resolve(this.ctx.get(n2).buildMcpServers())}catch(d){if(d instanceof $y)return Promise.resolve({});throw d}},"getMcpServers")}),this.currentChatMode.set(e,s)}applyAgentModeOverride(e,r,n){r.agentMode&&(e.currentMode=r.agentMode,n.agentMode=r.agentMode)}async injectRemoteUserMessage(e,r,n){let o=await this.getOrResumeSession(e),s={message:r};await this.expandPromptTemplate(e,s);let c={prompt:s.message,source:n},l=performance.now(),u=this.nextTurnIndex(e);this.wireTurnAndSend(e,o,c,u),gt(this.ctx,"backgroundAgent.send",{requestSource:J7s,sessionId:e,modelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(u)},{totalTimeMs:performance.now()-l,messageCharLen:s.message.length,referenceCount:0})}getWorkspaceFolderForSession(e){let r=this.sessionWorkingDirs.get(e);return r?{uri:Ia(r)}:void 0}nextTurnIndex(e){let r=(this.turnIndexes.get(e)??-1)+1;return this.turnIndexes.set(e,r),r}async expandPromptTemplate(e,r){let n=this.getWorkspaceFolderForSession(e);await this.ctx.get(ag).applyPromptTemplateToRequest(r,n?[n]:[])}wireTurnAndSend(e,r,n,o,s){let c=performance.now(),l=IRn(this.ctx,e,`bg-turn-${gr()}`);this.processedEventIds.set(e,new Set);let u=a(()=>{},"noop"),d=r.on("user_input.requested",u),f=r.on("permission.requested",u),h=r.on("exit_plan_mode.requested",u);tjn(r,!0);let m=new Zot,g=r.on("*",b=>{if(l)try{l.persistEvent(b)}catch(T){qo.warn(this.ctx,"Failed to persist background-agent event",{eventType:b.type,error:T instanceof Error?T.message:String(T)})}m.trackEvent(b),this.handleSessionEvent(e,b,o)}),A=!1,y=a(()=>{A||(A=!0,this.emitTurnCompleteTelemetry(e,c,m.data,o),this.emitSessionMetricsTelemetry(e,r,o)),v?.dispose(),d(),f(),h(),g(),E(),_(),this.processedEventIds.delete(e)},"cleanup"),E=r.on("session.idle",()=>{y()}),_=r.on("session.error",()=>{y()}),v;s&&(v=s.onCancellationRequested(()=>{qo.info(this.ctx,"Cancellation requested, aborting session:",e),r.abort()})),r.send(n).catch(b=>{y();let T={type:"session.error",id:gr(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:b instanceof Error?b.message:String(b)}};this.sendSessionUpdateNotification(e,T,o)})}async destroySession(e){try{let r=this.remoteDelegates.get(e.sessionId);if(r){try{await r.disable()}catch{}try{await r.deleteRemote()}catch(o){qo.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e.sessionId,error:o instanceof Error?o.message:String(o)})}this.remoteDelegates.delete(e.sessionId)}return this.sessionWorkingDirs.delete(e.sessionId),this.activeSessions.delete(e.sessionId),this.pendingExternalToolDefs.delete(e.sessionId),this.currentChatMode.delete(e.sessionId),this.lastBoundProviderModel.delete(e.sessionId),this.turnIndexes.delete(e.sessionId),await(await this.ensureManager()).deleteSession(e.sessionId),{success:!0}}catch(r){return qo.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);qo.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&qo.info(this.ctx,"Aborted in-progress manual compaction:",e),await n.abort(),gt(this.ctx,"backgroundAgent.stop",{requestSource:FF,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);qo.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return gt(this.ctx,"backgroundAgent.compactHistory",{requestSource:FF,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);qo.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return gt(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:FF,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();qo.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());gt(this.ctx,"backgroundAgent.resume",{requestSource:FF,modelId:e.model??"",reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!Z7s.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){qo.info(this.ctx,"listModels called",{forceRefresh:e}),await this.ensureManager();let r=await this.buildAuthInfo();qo.info(this.ctx,"listModels proxy diagnostics",{HTTPS_PROXY:process.env.HTTPS_PROXY?"(set)":"(not set)",HTTP_PROXY:process.env.HTTP_PROXY?"(set)":"(not set)",NO_PROXY:process.env.NO_PROXY??"(not set)",NODE_TLS_REJECT_UNAUTHORIZED:process.env.NODE_TLS_REJECT_UNAUTHORIZED??"(not set)",NODE_EXTRA_CA_CERTS:process.env.NODE_EXTRA_CA_CERTS??"(not set)"});try{let n=await this.sdk.getAvailableModels(r);n.length===0?qo.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):qo.info(this.ctx,`Successfully retrieved ${n.length} models`);let o=[];this.ctx.get(uu).getPolicyValue("autoModel.enabled")!==!1&&o.push(this.buildAutoModelEntry());let s=[...o,...n];return qo.debug(this.ctx,"Models retrieved:",s.map(c=>c.id)),{models:s}}catch(n){let o=n instanceof Error?n.message:String(n);throw qo.error(this.ctx,"getAvailableModels failed",{error:o,stack:n instanceof Error?n.stack:void 0}),new Error(`Failed to retrieve models: ${o}`)}}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 handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){qo.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){qo.error(this.ctx,"Failed to send session update notification:",o)}}emitTurnCompleteTelemetry(e,r,n,o){try{let s=performance.now()-r,c=this.currentChatMode.get(e)??"agent";gt(this.ctx,"backgroundAgent.turn.complete",{requestSource:FF,sessionId:e,chatMode:c,agentProvider:"BACKGROUND",turnIndex:o!=null?String(o):""},{totalDurationMs:s,totalUserWaitMs:n?n.permission.totalMs+n.user_input.totalMs+n.exit_plan_mode.totalMs:0,permissionWaitMs:n?.permission.totalMs??0,permissionWaitCount:n?.permission.count??0,userInputWaitMs:n?.user_input.totalMs??0,userInputWaitCount:n?.user_input.count??0,exitPlanModeWaitMs:n?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:n?.exit_plan_mode.count??0})}catch(s){qo.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}async emitSessionMetricsTelemetry(e,r,n){try{let o=await r.usage.getMetrics(),s=0,c=0,l=0,u=0,d=0,f=0,h=[];for(let[m,g]of Object.entries(o.modelMetrics))s+=g.usage.inputTokens,c+=g.usage.outputTokens,l+=g.usage.cacheReadTokens,u+=g.usage.cacheWriteTokens,d+=g.usage.reasoningTokens??0,f+=g.requests.count,h.push(m);gt(this.ctx,"backgroundAgent.session.metrics",{requestSource:FF,sessionId:e,agentProvider:"BACKGROUND",modelNames:h.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:o.totalApiDurationMs,totalInputTokens:s,totalOutputTokens:c,totalCacheReadTokens:l,totalCacheWriteTokens:u,totalReasoningTokens:d,llmCallCount:f,totalPremiumRequestCost:o.totalPremiumRequestCost})}catch(o){qo.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:o instanceof Error?o.message:String(o)})}}attachRemoteDelegateLazy(e,r){let n=this.remoteDelegates.get(e);if(n)return n;let o=this.sessionWorkingDirs.get(e);if(!o)throw new Error(`Mission Control: working directory unknown for session ${e}; cannot attach delegate.`);let s=new est(this.ctx,qo,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new rst(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:qo,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.injectRemoteUserMessage(l,u,d),"injectUserMessage")});if(!rjn(r,c))throw new Error("SDK capability missing: LocalSession.setRemoteDelegate");return this.remoteDelegates.set(e,c),c}async enableRemote(e){let r=await this.getOrResumeSession(e);this.attachRemoteDelegateLazy(e,r);let n=Wor(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableRemote(e){let r=await this.getOrResumeSession(e),n=Wor(r);n&&await n.disable()}getRemoteStatus(e){let r=this.remoteDelegates.get(e);return r?r.getStatus():{remoteSteerable:!1}}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"}async shutdown(){this._mcpGatewayHost&&this._mountsChangedListener&&(this._mcpGatewayHost.service.off(CZ.MountsChanged,this._mountsChangedListener),this._mountsChangedListener=void 0,this._mcpGatewayHost=void 0),this._skillsEnabledListener?.dispose(),this._skillsEnabledListener=void 0,this.clearUserScopedState(),Hor(),bRn(),this.manager&&(await this.manager.dispose(),this.manager=void 0),this.sdk=void 0,this.autoModeManager=void 0,this.managerInitPromise=void 0}};p();p();var t0=(r=>(r.Background="BACKGROUND",r.Claude="CLAUDE",r))(t0||{});p();var lzn=ce(require("path"));function WZ(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(WZ,"assertClaudeProvider");function Tpe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Tpe,"assertNonEmptyString");function eQs(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(eQs,"assertFsUri");function tQs(t,e,r){if(!lzn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(tQs,"assertAbsolutePath");async function C2e(t,e){if(e===void 0)return;let n=(await t.get(dc).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!JHe(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(C2e,"validateClaudeModel");async function uzn(t,e){WZ("createSession",e.agentProvider),eQs("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await C2e(t,e.model)}a(uzn,"validateAgentCreate");async function dzn(t,e){WZ("resumeSession",e.agentProvider),Tpe("resumeSession","sessionId",e.sessionId),await C2e(t,e.model)}a(dzn,"validateAgentResume");async function fzn(t,e){WZ("sendMessage",e.agentProvider),Tpe("sendMessage","sessionId",e.sessionId),Tpe("sendMessage","message",e.message),await C2e(t,e.model)}a(fzn,"validateAgentSend");function pzn(t,e){WZ("stopSession",e.agentProvider),Tpe("stopSession","sessionId",e.sessionId)}a(pzn,"validateAgentStop");function hzn(t,e){WZ("destroySession",e.agentProvider),Tpe("destroySession","sessionId",e.sessionId)}a(hzn,"validateAgentDestroy");function mzn(t,e){WZ("listSessions",e.agentProvider),Tpe("listSessions","cwd",e.cwd),tQs("listSessions","cwd",e.cwd)}a(mzn,"validateAgentListSessions");function gzn(t,e){WZ("listModels",e.agentProvider)}a(gzn,"validateAgentListModels");p();p();var yzn=require("child_process"),Ipe=ce(require("path")),v2e=ce(DL()),Ezn=require("util");var _zn=5e3,Azn=200,ylr=class{constructor(){this.execFile=(0,Ezn.promisify)(yzn.execFile);this.cache=new Map}static{a(this,"ClaudeCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:"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."});let r=Ipe.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(Ipe.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=rQs(),n=v2e.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.`};let o=nQs(e);if(o)return{severity:"error",message:o};let s;try{s=(await this.execFile(e,["--version"],{timeout:_zn,windowsHide:!0})).stdout}catch(l){return{severity:"error",message:iQs(e,l)}}let c=v2e.coerce(s);return c?v2e.satisfies(c,`~${n.major}.${n.minor}.0`)?{severity:"ok"}:{severity:"warning",message:`Claude Code CLI at "${e}" reports version ${c.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.`}:{severity:"error",message:`Could not parse Claude Code CLI version from "${e}" --version output: "${Czn(s)}".`}}},xpe=new ylr;function rQs(){let t=FSe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(rQs,"getExpectedVersionRaw");function nQs(t){let e=Ipe.basename(t).toLowerCase(),r=process.platform==="win32"?"claude.exe":"claude";if(e!==r)return`Claude Code CLI path "${t}" must point at the "${r}" executable, but the basename is "${Ipe.basename(t)}". Open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the binary itself (typically under \`/node_modules/@anthropic-ai/claude-code/bin/\`).`}a(nQs,"validateBasename");function iQs(t,e){let r=e;if(r?.code==="ENOENT")return`Claude Code CLI not found at "${t}". Check that the file exists and is executable.`;if(r?.killed&&r?.signal==="SIGTERM")return`Claude Code CLI at "${t}" did not respond to --version within ${_zn/1e3}s.`;let n=typeof r?.stderr=="string"?Czn(r.stderr):"",o=r?.code!==void 0?` (exit code ${String(r.code)})`:"",s=n?` stderr: "${n}"`:"",c=r?.message?`: ${r.message}`:"";return`Failed to run "${t} --version"${o}${c}${s}`}a(iQs,"formatSpawnError");function Czn(t){let e=t.trim();return e.length<=Azn?e:`${e.slice(0,Azn)}\u2026`}a(Czn,"truncate");p();var Elr=require("fs"),bzn=ce(require("path"));var b2e=new ge("ClaudeCode.ReferenceFormatter"),oQs={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},vzn=5*1024*1024;async function Szn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=ho(s.uri);if(!c){b2e.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=aQs(c);if(l){let u=await sQs(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=ho(s.uri);if(!c){b2e.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:b2e.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:cQs(n)}),o}a(Szn,"buildReferences");async function sQs(t,e,r){try{let n=await Elr.promises.stat(t);if(n.size>vzn){b2e.debug(r,`Skipping oversize image reference (${n.size} > ${vzn} bytes): ${t}`);return}let o=(await Elr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){b2e.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(sQs,"tryReadImageBlock");function aQs(t){return oQs[bzn.extname(t).toLowerCase()]}a(aQs,"imageMediaTypeForPath");function cQs(t){return` +`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;r0&&(l.customAgents=u);try{let g=t.get(dT).buildMcpServers();ucr.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:g}),Object.keys(g).length>0&&(l.mcpServers=g)}catch(g){if(!(g instanceof W0))throw g}l.hooks=gVn(t,r.workspaceFolder);let d=await lcr(t,[r.workspaceFolder]).catch(g=>{ucr.warn(t,"Failed to load git commit instructions for systemMessage",g)}),f=r.useNestedClaudeMdFiles===!0?await Q8s(t,s):void 0,h=vVn({gitCommitInstructions:d,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:f});h!==void 0&&(l.systemMessage={mode:"append",content:h}),r.externalToolDefinitions?.length&&(l.externalToolDefinitions=r.externalToolDefinitions);let m=EVn(r);return m.size>0&&(l.disabledInstructionSources=m),l}a(CVn,"buildSessionOptions");async function Q8s(t,e){let r;try{r=t.get(Bo)}catch{return}try{return await _Vn(async n=>r.readDirectory(ba(n)),e)}catch(n){ucr.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(Q8s,"scanNestedClaudeSection");p();var q8s=20,Gst=new Ee("BackgroundAgent.SessionRegistry"),$st=class{constructor(e){this.ctx=e;this.sessions=new Map;this.workingDirs=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=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>q8s){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(Gst.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>Gst.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}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)}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){Gst.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){Gst.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.workingDirs.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.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.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.children.clear()}};p();p();var dcr=require("node:fs"),xZ=he(require("node:path"));function bVn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(bVn,"sanitizePathSegment");function Wst(t){return typeof t=="string"?t:void 0}a(Wst,"asString");function Vst(t){return typeof t=="number"?t:void 0}a(Vst,"asNumber");function j8s(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:Wst(r.toolCallId),tool:Wst(r.name)}}):[]}a(j8s,"asToolCallArray");function H8s(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(H8s,"toToolResultText");function G8s(t){try{return JSON.stringify(t)}catch{return}}a(G8s,"safeStringify");var fcr=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=Z6t(new Date),s=bVn(r);this.sessionDir=xZ.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?xZ.join(this.sessionDir,"runSubAgent",bVn(e)):this.sessionDir}appendJsonl(e,r){let n=G8s(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await dcr.promises.mkdir(xZ.dirname(e),{recursive:!0}),await dcr.promises.appendFile(e,`${n} +`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Vst(e.data.inputTokens),outputTokens:Vst(e.data.outputTokens),cacheReadTokens:Vst(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=j8s(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(xZ.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Vst(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=Wst(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=Wst(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(xZ.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:H8s(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function SVn(t,e,r){let n=Gt(t,Je.PromptPersistBasePath)?.trim()||void 0;if(n)return new fcr(n,e,r)}a(SVn,"createBackgroundAgentPersistence");p();var zst=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}}}};As();var epe=new Ee("BackgroundAgent.TurnDriver"),TVn="backgroundAgent",Yst=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s){let c=performance.now(),l=SVn(this.ctx,e,`bg-turn-${ir()}`);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.forget(e)},"dispose")}));let u=a(()=>{},"noop"),d=r.on("user_input.requested",u),f=r.on("permission.requested",u),h=r.on("exit_plan_mode.requested",u);iQn(r,!0);let m=new zst,g=r.on("*",b=>{if(l)try{l.persistEvent(b)}catch(T){epe.warn(this.ctx,"Failed to persist background-agent event",{eventType:b.type,error:T instanceof Error?T.message:String(T)})}m.trackEvent(b),this.handleSessionEvent(e,b,o)}),A=!1,y=a(()=>{A||(A=!0,this.emitTurnCompleteTelemetry(e,c,m.data,o),this.emitSessionMetricsTelemetry(e,r,o)),v?.dispose(),d(),f(),h(),g(),E(),_(),this.forget(e)},"cleanup"),E=r.on("session.idle",()=>{y()}),_=r.on("session.error",()=>{y()}),v;s&&(v=s.onCancellationRequested(()=>{epe.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(b=>{y();let T={type:"session.error",id:ir(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:b instanceof Error?b.message:String(b)}};this.sendSessionUpdateNotification(e,T,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.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){epe.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){epe.error(this.ctx,"Failed to send session update notification:",o)}}emitTurnCompleteTelemetry(e,r,n,o){try{let s=performance.now()-r,c=this.registry.getChatMode(e)??"agent";_t(this.ctx,"backgroundAgent.turn.complete",{requestSource:TVn,sessionId:e,chatMode:c,agentProvider:"BACKGROUND",turnIndex:o!=null?String(o):""},{totalDurationMs:s,totalUserWaitMs:n?n.permission.totalMs+n.user_input.totalMs+n.exit_plan_mode.totalMs:0,permissionWaitMs:n?.permission.totalMs??0,permissionWaitCount:n?.permission.count??0,userInputWaitMs:n?.user_input.totalMs??0,userInputWaitCount:n?.user_input.count??0,exitPlanModeWaitMs:n?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:n?.exit_plan_mode.count??0})}catch(s){epe.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}async emitSessionMetricsTelemetry(e,r,n){try{let o=await r.usage.getMetrics(),s=0,c=0,l=0,u=0,d=0,f=0,h=[];for(let[m,g]of Object.entries(o.modelMetrics))s+=g.usage.inputTokens,c+=g.usage.outputTokens,l+=g.usage.cacheReadTokens,u+=g.usage.cacheWriteTokens,d+=g.usage.reasoningTokens??0,f+=g.requests.count,h.push(m);_t(this.ctx,"backgroundAgent.session.metrics",{requestSource:TVn,sessionId:e,agentProvider:"BACKGROUND",modelNames:h.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:o.totalApiDurationMs,totalInputTokens:s,totalOutputTokens:c,totalCacheReadTokens:l,totalCacheWriteTokens:u,totalReasoningTokens:d,llmCallCount:f,totalPremiumRequestCost:o.totalPremiumRequestCost})}catch(o){epe.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:o instanceof Error?o.message:String(o)})}}};p();function IVn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(IVn,"applyAgentModeOverride");p();p();var $8s=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"];async function xVn(t,e,r){let n,o,s,c;e==="ask"?(n=[...$8s],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={}):(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers());let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(xVn,"applyChatMode");async function wVn(t,e,r,n,o){let c=(n.chatMode??"agent")==="ask"?"ask":"agent";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:ba(u)};o.deleteChatMode(e),await xVn(r,c,{loadCustomAgents:a(()=>Hst(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(Z0)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{try{return Promise.resolve(t.get(dT).buildMcpServers())}catch(f){if(f instanceof W0)return Promise.resolve({});throw f}},"getMcpServers")}),o.setChatMode(e,c)}a(wVn,"applyChatModeOverride");p();var RVn=new Ee("BackgroundAgent.applyChatModeSelection");async function PVn(t,e,r){if(r.chatMode===void 0||r.chatMode==="ask")return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),RVn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),RVn.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(PVn,"applyChatModeSelection");p();p();var wZ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}},$ke=class extends wZ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},Vke=class extends wZ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();var tpe=new Ee("BackgroundAgent.ProviderConfig");async function kVn(t,e,r){if(!e)return;let n=await HVe(t,e,r);if(!n){tpe.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new vc(t.get(bi)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){tpe.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===go.Anthropic)return{type:"anthropic",baseUrl:o??Sce[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===go.Azure){if(!o){tpe.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return V8s(t,o,n,r,l)}if(yce(e))return{type:"openai",baseUrl:o??Sce[e],apiKey:n,modelId:r,wireModel:r,...l};tpe.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(kVn,"buildProviderConfig");function V8s(t,e,r,n,o){let s;try{s=new URL(e)}catch{tpe.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};tpe.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(V8s,"buildAzureProviderConfig");var pcr=new Ee("BackgroundAgent.applyTurnOverrides");async function DVn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!rQ(await t.get(Ut).getToken()))throw new Vke(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await kVn(t,o,r.model);if(o!==void 0&&s===void 0)throw new $ke(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===go.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){pcr.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)));pcr.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}),pcr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(DVn,"applyTurnOverrides");p();async function NVn(t,e,r,n){let o=W8s(e,n);await t.get(ag).applyPromptTemplateToRequest(r,o?[o]:[])}a(NVn,"expandPromptTemplate");function W8s(t,e){let r=e.getWorkingDir(t);return r?{uri:ba(r)}:void 0}a(W8s,"getWorkspaceFolderForSession");As();var vg=new Ee("BackgroundAgent"),RZ="backgroundAgent",z8s="backgroundAgent.remote",Y8s=new Set(["system.message","hook.start","hook.end"]),Bs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ra),this.managerLifecycle=new Cot(e),this.authBinding=new Pet(e),this.registry=new $st(e),this.mcpSync=new Lst(e,this.registry),this.remoteController=new jst(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new Yst(e,this.registry,this.notificationSender),e.get(zo).onDidChangeHttpSettings(()=>{sot(this.ctx)}),ys(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(Z0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof W0))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(vg.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=kxn(n,e);return _t(this.ctx,"backgroundAgent.interaction",{requestSource:RZ,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 DVn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return PVn(this.ctx,e,r)}buildSessionOptions(e,r){return CVn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();vg.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??ir(),s=await this.buildSessionOptions(o,e),c=await n.createSession(s);return vg.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),_t(this.ctx,"backgroundAgent.create",{requestSource:RZ,modelId:e.model??"",reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,c),this.registry.setWorkingDir(o,po(e.workspaceFolder.uri).fsPath),{sessionId:o,workspacePath:c.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),vg.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}),vg.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:ba(m)},vg.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.installBridgeSpanProcessor();let f=s?.uri?po(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),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),await this.expandPromptTemplate(e.sessionId,e),await this.applyChatModeSelection(o,e);let s={prompt:e.message,...e.sendMode?{mode:e.sendMode}:{}};if(this.applyAgentModeOverride(o,e,s),e.references?.length){let f=Pxn(e.references,this.ctx);f.length>0&&(s.attachments=f)}let c=performance.now(),l=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,s,l,r);let u={requestSource:RZ,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,modelId:e.model??"",providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(l)},d={totalTimeMs:performance.now()-c,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return _t(this.ctx,"backgroundAgent.send",u,d),yt(this.ctx,"backgroundAgent.send",Vt.createAndMarkAsIssued(u,d)),{}}applyChatModeOverride(e,r,n){return wVn(this.ctx,e,r,n,this.registry)}applyAgentModeOverride(e,r,n){IVn(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,source:n},l=performance.now(),u=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,c,u),_t(this.ctx,"backgroundAgent.send",{requestSource:z8s,sessionId:e,modelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(u)},{totalTimeMs:performance.now()-l,messageCharLen:s.message.length,referenceCount:0})}expandPromptTemplate(e,r){return NVn(this.ctx,e,r,this.registry)}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 vg.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);vg.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&vg.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),_t(this.ctx,"backgroundAgent.stop",{requestSource:RZ,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);vg.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return _t(this.ctx,"backgroundAgent.compactHistory",{requestSource:RZ,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);vg.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return _t(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:RZ,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();vg.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());_t(this.ctx,"backgroundAgent.resume",{requestSource:RZ,modelId:e.model??"",reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!Y8s.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){vg.info(this.ctx,"listModels called",{forceRefresh:e}),await this.ensureManager();let r=await this.buildAuthInfo();vg.info(this.ctx,"listModels proxy diagnostics",{HTTPS_PROXY:process.env.HTTPS_PROXY?"(set)":"(not set)",HTTP_PROXY:process.env.HTTP_PROXY?"(set)":"(not set)",NO_PROXY:process.env.NO_PROXY??"(not set)",NODE_TLS_REJECT_UNAUTHORIZED:process.env.NODE_TLS_REJECT_UNAUTHORIZED??"(not set)",NODE_EXTRA_CA_CERTS:process.env.NODE_EXTRA_CA_CERTS??"(not set)"});try{let n=await this.sdk.getAvailableModels(r);n.length===0?vg.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):vg.info(this.ctx,`Successfully retrieved ${n.length} models`);let o=[];this.ctx.get(cu).getPolicyValue("autoModel.enabled")!==!1&&o.push(this.buildAutoModelEntry());let s=[...o,...n];return vg.debug(this.ctx,"Models retrieved:",s.map(c=>c.id)),{models:s}}catch(n){let o=n instanceof Error?n.message:String(n);throw vg.error(this.ctx,"getAvailableModels failed",{error:o,stack:n instanceof Error?n.stack:void 0}),new Error(`Failed to retrieve models: ${o}`)}}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(),kir(),Nxn(),await this.managerLifecycle.dispose()}};p();p();var t0=(r=>(r.Background="BACKGROUND",r.Claude="CLAUDE",r))(t0||{});p();var MVn=he(require("path"));function PZ(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(PZ,"assertClaudeProvider");function rpe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(rpe,"assertNonEmptyString");function K8s(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{po(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(K8s,"assertFsUri");function J8s(t,e,r){if(!MVn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(J8s,"assertAbsolutePath");async function Wke(t,e){if(e===void 0)return;let n=(await t.get(lc).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!THe(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(Wke,"validateClaudeModel");async function OVn(t,e){PZ("createSession",e.agentProvider),K8s("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await Wke(t,e.model)}a(OVn,"validateAgentCreate");async function BVn(t,e){PZ("resumeSession",e.agentProvider),rpe("resumeSession","sessionId",e.sessionId),await Wke(t,e.model)}a(BVn,"validateAgentResume");async function LVn(t,e){PZ("sendMessage",e.agentProvider),rpe("sendMessage","sessionId",e.sessionId),rpe("sendMessage","message",e.message),await Wke(t,e.model)}a(LVn,"validateAgentSend");function FVn(t,e){PZ("stopSession",e.agentProvider),rpe("stopSession","sessionId",e.sessionId)}a(FVn,"validateAgentStop");function UVn(t,e){PZ("destroySession",e.agentProvider),rpe("destroySession","sessionId",e.sessionId)}a(UVn,"validateAgentDestroy");function QVn(t,e){PZ("listSessions",e.agentProvider),rpe("listSessions","cwd",e.cwd),J8s("listSessions","cwd",e.cwd)}a(QVn,"validateAgentListSessions");function qVn(t,e){PZ("listModels",e.agentProvider)}a(qVn,"validateAgentListModels");p();p();var HVn=require("child_process"),npe=he(require("path")),zke=he(_L()),GVn=require("util");var $Vn=5e3,jVn=200,hcr=class{constructor(){this.execFile=(0,GVn.promisify)(HVn.execFile);this.cache=new Map}static{a(this,"ClaudeCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:"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."});let r=npe.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(npe.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=Z8s(),n=zke.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.`};let o=X8s(e);if(o)return{severity:"error",message:o};let s;try{s=(await this.execFile(e,["--version"],{timeout:$Vn,windowsHide:!0})).stdout}catch(l){return{severity:"error",message:e6s(e,l)}}let c=zke.coerce(s);return c?zke.satisfies(c,`~${n.major}.${n.minor}.0`)?{severity:"ok"}:{severity:"warning",message:`Claude Code CLI at "${e}" reports version ${c.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.`}:{severity:"error",message:`Could not parse Claude Code CLI version from "${e}" --version output: "${VVn(s)}".`}}},ipe=new hcr;function Z8s(){let t=pSe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(Z8s,"getExpectedVersionRaw");function X8s(t){let e=npe.basename(t).toLowerCase(),r=process.platform==="win32"?"claude.exe":"claude";if(e!==r)return`Claude Code CLI path "${t}" must point at the "${r}" executable, but the basename is "${npe.basename(t)}". Open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the binary itself (typically under \`/node_modules/@anthropic-ai/claude-code/bin/\`).`}a(X8s,"validateBasename");function e6s(t,e){let r=e;if(r?.code==="ENOENT")return`Claude Code CLI not found at "${t}". Check that the file exists and is executable.`;if(r?.killed&&r?.signal==="SIGTERM")return`Claude Code CLI at "${t}" did not respond to --version within ${$Vn/1e3}s.`;let n=typeof r?.stderr=="string"?VVn(r.stderr):"",o=r?.code!==void 0?` (exit code ${String(r.code)})`:"",s=n?` stderr: "${n}"`:"",c=r?.message?`: ${r.message}`:"";return`Failed to run "${t} --version"${o}${c}${s}`}a(e6s,"formatSpawnError");function VVn(t){let e=t.trim();return e.length<=jVn?e:`${e.slice(0,jVn)}\u2026`}a(VVn,"truncate");p();var Yke=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 WVn(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(WVn,"buildPermissionRequest");function zVn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:t6s(t)}}a(zVn,"translatePermissionResult");function t6s(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(t6s,"formatDenyMessage");function YVn(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(YVn,"buildPreparedQuestions");function KVn(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(KVn,"buildUserInputRequest");p();var mcr=require("fs"),ZVn=he(require("path"));var Kke=new Ee("ClaudeCode.ReferenceFormatter"),r6s={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},JVn=5*1024*1024;async function XVn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=Yo(s.uri);if(!c){Kke.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=i6s(c);if(l){let u=await n6s(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=Yo(s.uri);if(!c){Kke.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:Kke.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:o6s(n)}),o}a(XVn,"buildReferences");async function n6s(t,e,r){try{let n=await mcr.promises.stat(t);if(n.size>JVn){Kke.debug(r,`Skipping oversize image reference (${n.size} > ${JVn} bytes): ${t}`);return}let o=(await mcr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){Kke.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(n6s,"tryReadImageBlock");function i6s(t){return r6s[ZVn.extname(t).toLowerCase()]}a(i6s,"imageMediaTypeForPath");function o6s(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(cQs,"wrapInSystemReminder");p();var xzn=require("crypto");function _lr(t,e={}){let r=new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[kzn(r,"synthetic",t.error)];switch(t.type){case"system":return lQs(t,r);case"assistant":return uQs(t,r,e.streamingEnabled===!0,e.blockCursor);case"user":return e.includeUserText===!0?fQs(t,r):dQs(t,r);case"result":return mQs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(_lr,"translate");function wzn(t,e){if(t.parent_tool_use_id!==null)return[];let r=t.event,n=new Date().toISOString();switch(r.type){case"message_start":return[{id:e,timestamp:n,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:e}}];case"content_block_delta":{let o=r.delta;switch(o.type){case"text_delta":return[{id:dE(),timestamp:n,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${r.index}`,deltaContent:o.text}}];case"thinking_delta":return[{id:dE(),timestamp:n,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${r.index}`,deltaContent:o.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(wzn,"translatePartial");function lQs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:dE(),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:dE(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:dE(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(lQs,"translateSystem");function uQs(t,e,r,n){let o=t.message?.id??dE(),s=[];r||s.push({id:o,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:o,interactionId:o}});let c=t.message?.content??[],l=n??new Map,u=l.get(o)??0;return c.forEach(d=>{let f=u++;switch(d.type){case"text":{let h=d.text;typeof h=="string"&&h.length>0&&s.push({id:dE(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${o}:${f}`,content:h,model:t.message?.model}});break}case"thinking":{let h=d.thinking;typeof h=="string"&&h.length>0&&s.push({id:dE(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${o}:${f}`,content:h}});break}case"tool_use":{let h=d;s.push({id:dE(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof h.id=="string"?h.id:dE(),toolName:typeof h.name=="string"?h.name:"unknown",arguments:h.input}});break}default:break}}),l.set(o,u),s}a(uQs,"translateAssistant");function dQs(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(Rzn(o,e));return n}a(dQs,"translateUserLive");function fQs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Izn(n);return o.length>0&&r.push(Tzn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(Rzn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Izn(s);c.length>0&&r.push(Tzn(e,c))}}}return r}a(fQs,"translateUserHistory");function Rzn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=gQs(t.content);return{id:dE(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:dE(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(Rzn,"buildToolExecutionComplete");function Tzn(t,e){return{id:dE(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(Tzn,"buildUserMessage");function pQs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(pQs,"stripSystemReminders");var hQs=/^\[Request interrupted by user[^\]]*\]$/;function Izn(t){let e=pQs(t);return hQs.test(e)?"":e}a(Izn,"sanitizeUserText");function mQs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:dE(),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.result;o.push(kzn(e,typeof l=="string"?l:"error",typeof u=="string"?u:"Claude turn ended with error"))}return o.push({id:dE(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(mQs,"translateResult");function kzn(t,e,r){return{id:dE(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(kzn,"buildSessionError");function gQs(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(gQs,"flattenToolResultContent");function dE(){return(0,xzn.randomUUID)()}a(dE,"newId");function Pzn(t){let e=[],r=new Map;for(let n of t){let o=AQs(n);if(o)try{e.push(..._lr(o,{streamingEnabled:!1,includeUserText:!0,blockCursor:r}))}catch{}}return e}a(Pzn,"translateHistory");function AQs(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&yQs(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(AQs,"adaptHistoryMessage");function yQs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(yQs,"isSyntheticReplayUserMessage");p();var om=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 Dat=ce(require("path"));Ns();var Ab=new ge("ClaudeCodeAgent.session"),yb="ClaudeCodeSession",S2e=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;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(om);s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode)}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(om).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){Ab.warn(this.ctx,`${yb}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0)return;let r=e??"default";if(r!==this._permissionMode&&(this._permissionMode=r,this.ctx.get(om).setPermissionModeForSession(this.sessionId,r),this._query))try{await this._query.setPermissionMode(r)}catch(n){Ab.warn(this.ctx,`${yb}: 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){Ab.warn(this.ctx,`${yb}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._abortController.abort(),this.ctx.get(om).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=>{Ab.warn(this.ctx,`${yb}: 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&&e.permissionMode!==this._permissionMode&&await this.setPermissionMode(e.permissionMode),this.ctx.get(om).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(om).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new rA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1;let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{Ab.info(this.ctx,`${yb}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),Ab.info(this.ctx,`${yb}.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 Szn(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??gr()};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=qt(this.ctx,je.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await xpe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(Ab.warn(this.ctx,`${yb}: ${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"],disallowedTools:["WebSearch"],thinking:{type:"adaptive"},includePartialMessages:!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,Ab.info(this.ctx,`${yb}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{Ab.error(this.ctx,`${yb}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(F3).resolvePath();return`${Dat.dirname(e)}${Dat.delimiter}${process.env.PATH??""}`}catch(e){return Ab.warn(this.ctx,`${yb}: 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 rA;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)){this._assistantBlockCursor.clear();let o=this._currentInvokeDone;this._currentInvokeDone=void 0,o?.resolve()}}this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){Ab.error(this.ctx,`${yb}: query error`,{sessionId:this.sessionId,error: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._assistantBlockCursor.clear();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&&Ab.error(this.ctx,`${yb}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{let n=e?.type==="result"?this.ctx.get(om).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=_lr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){Ab.error(this.ctx,`${yb}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=wzn(e,r);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){Ab.error(this.ctx,`${yb}: 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})}};p();var Nzn=ce(require("http")),Mzn=require("node:stream"),vlr=require("node:stream/promises"),Ozn=require("node:string_decoder");Ns();var fE=new ge("ClaudeMessagesProxyServer"),EQs=["interleaved-thinking","context-management","advanced-tool-use"],Clr="cls_claude_agent",X_={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"},_Qs=new Map([[400,X_.InvalidRequest],[401,X_.Authentication],[403,X_.Permission],[404,X_.NotFound],[413,X_.RequestTooLarge],[429,X_.RateLimit],[529,X_.Overloaded]]),Dzn=1024,CQs=32e3,zZ=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-${gr()}`,r=Nzn.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},fE.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(fE.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,X_.NotFound,"Not found")}catch(o){fE.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,X_.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=vQs(e.headers,n);if(!o.valid){fE.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,X_.Authentication,"Invalid authentication");return}o.sessionId&&fE.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await PQs(e),c;try{c=JSON.parse(s)}catch(l){fE.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,X_.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(ar),u;try{u=await c.getToken()}catch(_){fE.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,X_.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=vSe(this.ctx,u,"v1/messages"),g=SQs(this.ctx,n,d),A;try{({headers:A}=await VHe(this.ctx,g,u.token))}catch(_){fE.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,X_.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(fE.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(WHe(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";fE.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,DQs(_.status),MQs(w)??`Upstream error ${_.status}`);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(om),R=NQs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,vlr.pipeline)(b,R,o)}else await(0,vlr.pipeline)(b,o)}catch(_){if(y.signal.aborted){fE.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(fE.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,X_.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(dc).getMetadata()).find(s=>s.id===r)}catch(n){fE.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 r;let s=o?this.ctx.get(om).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&fE.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return xQs(e,n,s)?(fE.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 IQs(e)?(fE.debug(this.ctx,"stripped unknown sub-fields from cache_control.ephemeral before forwarding to CAPI"),JSON.stringify(e)):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 vQs(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(vQs,"extractSessionId");function bQs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&EQs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(bQs,"filterSupportedBetas");function SQs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...Gm(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?bQs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=TQs(u,d?PWe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Clr}/${h}`:`${Clr}${h.substring(m)}`}else s["User-Agent"]=Clr;return s}a(SQs,"buildUpstreamHeaders");function TQs(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(TQs,"mergeBetas");function IQs(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(IQs,"sanitizeCacheControl");function xQs(t,e,r){if(!e)return!1;let n=t.thinking;if(!n||typeof n!="object")return!1;let o=n.type;return o!=="adaptive"&&o!=="enabled"?!1:e.capabilities?.supports?.adaptive_thinking?wQs(t,n,e,r):kQs(t,n)}a(xQs,"normalizeThinkingForModel");function wQs(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=RQs(n,o),l={effort:CQ(o,s)??"medium"},u=e.type==="adaptive"&&Object.keys(e).length===1,d=t.output_config,f=typeof d?.effort=="string"&&d.effort===l.effort;return u&&f?!1:(t.thinking={type:"adaptive"},t.output_config=l,!0)}a(wQs,"_writeAdaptiveShape");function RQs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(RQs,"_normaliseUserEffortForCapi");function kQs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:Dzn,o=Math.min(CQs,Math.max(Dzn,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(kQs,"_writeLegacyShape");function PQs(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(PQs,"readRequestBody");function DQs(t){return _Qs.get(t)??X_.Api}a(DQs,"mapStatusToAnthropicErrorType");function NQs(t){let e=new Ozn.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 Mzn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` +`}a(o6s,"wrapInSystemReminder");p();var rWn=require("crypto");function gcr(t,e={}){let r=new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[oWn(r,"synthetic",t.error)];switch(t.type){case"system":return s6s(t,r);case"assistant":return a6s(t,r,e.streamingEnabled===!0,e.blockCursor);case"user":return e.includeUserText===!0?l6s(t,r):c6s(t,r);case"result":return f6s(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(gcr,"translate");function nWn(t,e){if(t.parent_tool_use_id!==null)return[];let r=t.event,n=new Date().toISOString();switch(r.type){case"message_start":return[{id:e,timestamp:n,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:e}}];case"content_block_delta":{let o=r.delta;switch(o.type){case"text_delta":return[{id:dE(),timestamp:n,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${r.index}`,deltaContent:o.text}}];case"thinking_delta":return[{id:dE(),timestamp:n,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${r.index}`,deltaContent:o.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(nWn,"translatePartial");function s6s(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:dE(),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:dE(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:dE(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(s6s,"translateSystem");function a6s(t,e,r,n){let o=t.message?.id??dE(),s=[];r||s.push({id:o,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:o,interactionId:o}});let c=t.message?.content??[],l=n??new Map,u=l.get(o)??0;return c.forEach(d=>{let f=u++;switch(d.type){case"text":{let h=d.text;typeof h=="string"&&h.length>0&&s.push({id:dE(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${o}:${f}`,content:h,model:t.message?.model}});break}case"thinking":{let h=d.thinking;typeof h=="string"&&h.length>0&&s.push({id:dE(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${o}:${f}`,content:h}});break}case"tool_use":{let h=d;s.push({id:dE(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof h.id=="string"?h.id:dE(),toolName:typeof h.name=="string"?h.name:"unknown",arguments:h.input}});break}default:break}}),l.set(o,u),s}a(a6s,"translateAssistant");function c6s(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(iWn(o,e));return n}a(c6s,"translateUserLive");function l6s(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=tWn(n);return o.length>0&&r.push(eWn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(iWn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=tWn(s);c.length>0&&r.push(eWn(e,c))}}}return r}a(l6s,"translateUserHistory");function iWn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=p6s(t.content);return{id:dE(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:dE(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(iWn,"buildToolExecutionComplete");function eWn(t,e){return{id:dE(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(eWn,"buildUserMessage");function u6s(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(u6s,"stripSystemReminders");var d6s=/^\[Request interrupted by user[^\]]*\]$/;function tWn(t){let e=u6s(t);return d6s.test(e)?"":e}a(tWn,"sanitizeUserText");function f6s(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:dE(),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(oWn(e,typeof l=="string"?l:"error",f))}return o.push({id:dE(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(f6s,"translateResult");function oWn(t,e,r){return{id:dE(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(oWn,"buildSessionError");function p6s(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(p6s,"flattenToolResultContent");function dE(){return(0,rWn.randomUUID)()}a(dE,"newId");function sWn(t){let e=[],r=new Map;for(let n of t){let o=h6s(n);if(o)try{e.push(...gcr(o,{streamingEnabled:!1,includeUserText:!0,blockCursor:r}))}catch{}}return e}a(sWn,"translateHistory");function h6s(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&m6s(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(h6s,"adaptHistoryMessage");function m6s(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(m6s,"isSyntheticReplayUserMessage");p();var om=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 Kst=he(require("path"));As();var Af=new Ee("ClaudeCodeAgent.session"),yf="ClaudeCodeSession",Jke=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new Yke;this._userInputRegistry=new Yke;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ToolSearch"||e==="ExitPlanMode"?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(om);s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode)}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(om).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){Af.warn(this.ctx,`${yf}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0)return;let r=e??"default";if(r!==this._permissionMode&&(this._permissionMode=r,this.ctx.get(om).setPermissionModeForSession(this.sessionId,r),this._query))try{await this._query.setPermissionMode(r)}catch(n){Af.warn(this.ctx,`${yf}: 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){Af.warn(this.ctx,`${yf}: 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(om).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=>{Af.warn(this.ctx,`${yf}: 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&&e.permissionMode!==this._permissionMode&&await this.setPermissionMode(e.permissionMode),this.ctx.get(om).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(om).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new iA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1;let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{Af.info(this.ctx,`${yf}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),Af.info(this.ctx,`${yf}.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 XVn(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??ir()};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=Gt(this.ctx,Je.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await ipe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(Af.warn(this.ctx,`${yf}: ${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"],disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,thinking:{type:"adaptive"},includePartialMessages:!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,Af.info(this.ctx,`${yf}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{Af.error(this.ctx,`${yf}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(S3).resolvePath();return`${Kst.dirname(e)}${Kst.delimiter}${process.env.PATH??""}`}catch(e){return Af.warn(this.ctx,`${yf}: 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 iA;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)){this._assistantBlockCursor.clear();let o=this._currentInvokeDone;this._currentInvokeDone=void 0,o?.resolve()}}this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){Af.error(this.ctx,`${yf}: query error`,{sessionId:this.sessionId,error: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();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&&Af.error(this.ctx,`${yf}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{let n=e?.type==="result"?this.ctx.get(om).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=gcr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){Af.error(this.ctx,`${yf}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=nWn(e,r);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){Af.error(this.ctx,`${yf}: 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 Af.warn(this.ctx,`${yf}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;if(e.type==="permission"){let r=this._permissionRegistry.respond(e.requestId,e.result);return r||Af.warn(this.ctx,`${yf}: respondToInteraction for unknown permission requestId`,{sessionId:this.sessionId,requestId:e.requestId}),r}if(e.type==="user_input"){let r=this._userInputRegistry.respond(e.requestId,e.response);return r||Af.warn(this.ctx,`${yf}: respondToInteraction for unknown user_input requestId`,{sessionId:this.sessionId,requestId:e.requestId}),r}return Af.warn(this.ctx,`${yf}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}_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}`))}_handlePermissionRequest(e,r,n){let o=n.toolUseID??ir();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=WVn(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=YVn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=ir(),u=await this._requestUserInputFromIde(l,KVn(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)}`}}}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()||(Af.error(this.ctx,`${yf}: 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=zVn(h,n);Af.info(this.ctx,`${yf}: 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=>{Af.warn(this.ctx,`${yf}: 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()||(Af.error(this.ctx,`${yf}: 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=>{Af.warn(this.ctx,`${yf}: 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:ir(),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:ir(),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:ir(),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:ir(),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")}};p();var lWn=he(require("http")),uWn=require("node:stream"),ycr=require("node:stream/promises"),dWn=require("node:string_decoder");As();var FA=new Ee("ClaudeMessagesProxyServer"),g6s=["interleaved-thinking","context-management","advanced-tool-use"],Acr="cls_claude_agent",Cg={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"},A6s=new Map([[400,Cg.InvalidRequest],[401,Cg.Authentication],[402,Cg.Permission],[403,Cg.Permission],[404,Cg.NotFound],[413,Cg.RequestTooLarge],[424,Cg.InvalidRequest],[429,Cg.RateLimit],[466,Cg.InvalidRequest],[529,Cg.Overloaded]]),aWn=1024,y6s=32e3,kZ=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-${ir()}`,r=lWn.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},FA.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(FA.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,Cg.NotFound,"Not found")}catch(o){FA.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Cg.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=E6s(e.headers,n);if(!o.valid){FA.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Cg.Authentication,"Invalid authentication");return}o.sessionId&&FA.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await w6s(e),c;try{c=JSON.parse(s)}catch(l){FA.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Cg.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(Ut),l=this.ctx.get(fr),u;try{u=await c.getToken()}catch(_){FA.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Cg.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=_He(this.ctx,u,"v1/messages"),g=v6s(this.ctx,n,d),A;try{({headers:A}=await EHe(this.ctx,g,u.token))}catch(_){FA.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Cg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(FA.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(vHe(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";FA.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,R6s(_.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(om),R=P6s(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,ycr.pipeline)(b,R,o)}else await(0,ycr.pipeline)(b,o)}catch(_){if(y.signal.aborted){FA.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(FA.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Cg.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(lc).getMetadata()).find(s=>s.id===r)}catch(n){FA.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 r;let s=o?this.ctx.get(om).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&FA.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return S6s(e,n,s)?(FA.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 b6s(e)?(FA.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:k6s(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return x_.translateErrorMessage(o,s,void 0,F9(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(lu).overageEnabled;return x_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:F9(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return FA.exception(this.ctx,s,"._buildReasonForStatus/402"),cWn(r)??"Quota Exceeded."}if(o===400){let s=x_.translate400Reason(r);if(s!==void 0)return s}return cWn(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 E6s(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(E6s,"extractSessionId");function _6s(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&g6s.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(_6s,"filterSupportedBetas");function v6s(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...uA(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?_6s(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=C6s(u,d?ZVe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Acr}/${h}`:`${Acr}${h.substring(m)}`}else s["User-Agent"]=Acr;return s}a(v6s,"buildUpstreamHeaders");function C6s(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(C6s,"mergeBetas");function b6s(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(b6s,"sanitizeCacheControl");function S6s(t,e,r){if(!e)return!1;let n=t.thinking;if(!n||typeof n!="object")return!1;let o=n.type;return o!=="adaptive"&&o!=="enabled"?!1:e.capabilities?.supports?.adaptive_thinking?T6s(t,n,e,r):x6s(t,n)}a(S6s,"normalizeThinkingForModel");function T6s(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=I6s(n,o),l={effort:oQ(o,s)??"medium"},u=e.type==="adaptive"&&Object.keys(e).length===1,d=t.output_config,f=typeof d?.effort=="string"&&d.effort===l.effort;return u&&f?!1:(t.thinking={type:"adaptive"},t.output_config=l,!0)}a(T6s,"_writeAdaptiveShape");function I6s(t,e){if(t&&!(!e||!e.includes(t)))return t}a(I6s,"_normaliseUserEffortForCapi");function x6s(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:aWn,o=Math.min(y6s,Math.max(aWn,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(x6s,"_writeLegacyShape");function w6s(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(w6s,"readRequestBody");function R6s(t){return A6s.get(t)??Cg.Api}a(R6s,"mapStatusToAnthropicErrorType");function P6s(t){let e=new dWn.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 uWn.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(NQs,"createCopilotUsageSniffer");function MQs(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(MQs,"extractErrorMessage");Ns();var pE=new ge("ClaudeCodeAgent"),hE="ClaudeCodeAgentService",UF=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(sa)}static{a(this,"ClaudeCodeAgentService")}async createSession(e){return this.runWithTelemetry("claudeCodeAgent.createSession",async r=>{await uzn(this.ctx,e);let n=e.sessionId??gr(),o=this._sessions.get(n);if(o)return pE.info(this.ctx,`${hE}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=Wn(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new S2e(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,permissionMode:"bypassPermissions",isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),pE.info(this.ctx,`${hE}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return this.runWithTelemetry("claudeCodeAgent.resumeSession",async r=>{await dzn(this.ctx,e);let{sessionId:n}=e,o=this._sessions.get(n);if(o)return pE.info(this.ctx,`${hE}.resumeSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="memory",r.properties.modelId=e.model??"",r.measurements.eventCount=0,{sessionId:n,workspacePath:o.cwd};let s=await this.sdkWrapper.getSessionInfo(n);if(!s?.cwd)throw new Error(`Session not found: ${n}`);let c=s.cwd,l=await this._ensureProxyConfig(),u=new S2e(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:c,model:e.model,permissionMode:"bypassPermissions",isNewSession:!1,proxyConfig:l});this._sessions.set(n,u),pE.info(this.ctx,`${hE}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:c});let d;try{let f=await this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0});d=Pzn(f),r.properties.transcriptOk="true"}catch(f){pE.warn(this.ctx,`${hE}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:f instanceof Error?f.message:String(f)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=f instanceof Error?f.name:"Unknown",d=void 0}return r.properties.reason="disk",r.properties.modelId=e.model??"",r.measurements.eventCount=d?.length??0,{sessionId:n,workspacePath:c,events:d}})}async sendMessage(e,r){return this.runWithTelemetry("claudeCodeAgent.sendMessage",async n=>{await fzn(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:Ia(s.cwd)};await this.ctx.get(ag).applyPromptTemplateToRequest(e,[c]);let l=gr(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:"bypassPermissions",reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{pE.warn(this.ctx,`${hE}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),this.emit("claudeCodeAgent.sendMessage.failure",u,!1,{reason:"invoke"},void 0,d)}),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}})}async listSessions(e){return this.runWithTelemetry("claudeCodeAgent.listSessions",async r=>{mzn(this.ctx,e),pE.info(this.ctx,`${hE}.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 pE.info(this.ctx,`${hE}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return this.runWithTelemetry("claudeCodeAgent.listModels",async r=>{gzn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),pE.info(this.ctx,`${hE}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(dc).getMetadata()).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>JHe(c.capabilities.family)).map(c=>{let l=c.capabilities.supports?.reasoning_effort,u=!!l&&l.length>0;return{id:c.id,name:c.name,preview:c.preview,capabilities:{family:c.capabilities.family,supports:{tool_calls:c.capabilities.supports?.tool_calls,vision:c.capabilities.supports?.vision,streaming:c.capabilities.supports?.streaming,reasoningEffort:u,reasoning_effort:l},limits:{max_prompt_tokens:c.capabilities.limits?.max_prompt_tokens,max_output_tokens:c.capabilities.limits?.max_output_tokens,max_context_window_tokens:c.capabilities.limits?.max_context_window_tokens??0}},supportedReasoningEfforts:l,defaultReasoningEffort:u?CQ(l):void 0}});return pE.info(this.ctx,`${hE}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await this.runWithTelemetry("claudeCodeAgent.stopSession",async r=>{pzn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){pE.info(this.ctx,`${hE}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return this.runWithTelemetry("claudeCodeAgent.destroySession",r=>{hzn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),pE.info(this.ctx,`${hE}.destroySession`,{sessionId:n}),{success:!0}):(pE.info(this.ctx,`${hE}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return pE.error(this.ctx,`${hE}.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 this.runWithTelemetry("claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){pE.info(this.ctx,`${hE}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await C2e(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await this.runWithTelemetry("claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){pE.info(this.ctx,`${hE}.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}emit(e,r,n,o,s,c){let l={success:n?"true":"false",...o},u={totalTimeMs:performance.now()-r,...s};c!==void 0?gi(this.ctx,e,c,l,u):gt(this.ctx,e,l,u)}async runWithTelemetry(e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return this.flush(e,n,o),s}catch(s){throw o.error??=s,this.flush(e,n,o),s}}flush(e,r,n){n.error!==void 0?this.emit(`${e}.failure`,r,!1,n.properties,n.measurements,n.error):this.emit(e,r,n.ok??!0,n.properties,n.measurements)}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(){return Promise.reject(this.unsupported("handleInteraction"))}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(){for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(zZ).start()}};p();var blr=new nn;function Bzn(t){return[...t].sort((e,r)=>{let n=blr.get(e.uri)??0;return(blr.get(r.uri)??0)-n})}a(Bzn,"sortByAccessTimes");var Lzn=a(t=>t.get(cn).onDidFocusTextDocument(e=>{e.document&&blr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var Fzn=ce(require("events"));var Nat="CompletionRequested",b5=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new Fzn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Nat,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=Pm(this.ctx,e,`event.${Nat}`);return this.#e.on(Nat,r),qn.Disposable.create(()=>this.#e.off(Nat,r))}};p();p();var Slr=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?.()}},Mat=class extends Slr{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 Eb=class{constructor(e){this.ctx=e;this.#e=new ge("AsyncCompletionManager");this.requests=new nn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Tlr(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 Mat;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 rA,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(Tlr(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)Tlr(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 Tlr(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(Tlr,"isCandidate");p();p();var I2e=class{constructor(e){this.maxSize=e;this.root=new T2e;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 T2e;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 T2e;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 I2e(100)}};p();var _b=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&&Uzn(this.choices[0].completionText,n))return OQs(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 OQs(t,e){return t.filter(r=>Uzn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(OQs,"adjustChoicesStart");function Uzn(t,e){return t.startsWith(e)&&t.length>e.length}a(Uzn,"startsWithAndExceeds");p();p();var QF={" ":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 Qzn(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 k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.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 q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let F;t[294]>1e-35?F=-.0384794324818203:t[266]>1e-35?F=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?F=.07432960094940501:F=-.035248735855751855:t[134]>1e-35?F=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?F=-.01706896375068821:F=.08212247914968074:t[2]>59.50000000000001?F=-.09546478958824225:t[6]>53.50000000000001?F=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?F=.02816463285971267:F=.15449139016588445:F=-.10199787406123524:F=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?F=-.13924786681478077:F=-.0072772442570213335:t[39]>1e-35?F=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?F=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?F=-.11174465335620831:F=.00013144040097180107:F=-.08493919336681105:t[42]>1e-35?F=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?F=-.015540659878839153:F=-.14442609417300142:t[21]>1e-35?F=-.025251979447574083:F=.0023698372645272847:t[18]>1e-35?F=.07269739695712212:t[8]>2592.5000000000005?F=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?F=-.01835130329646532:t[9]>45.50000000000001?F=.02023047454629885:F=.16469378262221102:F=-.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 W;t[183]>1e-35?t[17]>1e-35?W=.030100940443356424:t[10]>1.5000000000000002?W=-.10861112216742408:W=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?W=-.032062878390325456:W=-.10808232631806887:t[8]>1641.5000000000002?W=-.06147013392655731:t[4]>12.500000000000002?W=.03324767551088266:t[145]>1e-35?W=.028851633810612017:W=-.054871239091792784:t[134]>1e-35?W=-.023813968121342108:t[266]>1e-35?W=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?W=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?W=-.025350325484720576:W=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?W=.056817276537534815:W=-.07674158463557636:W=-.06335553143454145:t[1]>56.50000000000001?W=.16390494217299284:W=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?W=.041717597065890205:W=-.10357913492269129:t[10]>29.500000000000004?W=.1365512866715726:W=.020600048310575665:W=.09708785634773187:W=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?W=-.03146213719547347:W=.11784024316238083:W=-.050940520532045355:W=-.047988344143075616:t[191]>1e-35?W=.028764654731460032:W=.0011911575567860023;let V;t[294]>1e-35?t[10]>50.50000000000001?V=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?V=-.05103908560370243:V=.05002066201169583:V=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?V=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?V=.127983140816313:V=-.05436534163636867:V=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?V=-.009504203657088933:t[8]>819.5000000000001?V=.18689664822602375:V=.03635576744011826:V=-.029862411809998525:t[223]>1e-35?V=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?V=-.09405026597863717:t[0]>4153.500000000001?V=.053577663326799765:V=-.05062127873995668:V=.06512222894425874:t[39]>1e-35?V=-.04985311717827547:t[51]>1e-35?V=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?V=-.02860634573675884:V=.08863753005590103:V=.11158892111063744:t[0]>655.5000000000001?V=-.031005736641654926:V=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?V=-.00843386136334982:V=-.05273594615999777:V=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?V=-.015774115523598486:V=.10147367091236065:V=-.048307000563071016:V=.002118376117677254;let G;t[8]>1014.5000000000001?t[9]>137.50000000000003?G=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?G=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?G=.07211107542565391:G=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?G=-.0751486415451188:t[1]>59.50000000000001?G=.13459005084554104:G=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?G=.06715575425741895:G=-.005895690393702183:t[8]>2915.5000000000005?G=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?G=-.00029068886245881074:G=.0613467393188786:t[148]>1e-35?G=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?G=.003887223773199377:G=-.08553893131979015:G=.025654192706396767:G=-.05651733979610658:G=-.02039913645229667:t[2]>7.500000000000001?G=-.1058450646728524:G=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?G=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?G=.1283258201586378:G=-.01718135372229775:G=-.07702452408491414:t[125]>1e-35?G=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?G=.04273051857848212:G=-.04533122948101463:t[2]>196.50000000000003?G=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?G=.0231032972703664:G=-.04807386814498683:G=.002729435991332102;let Y;t[179]>1e-35?Y=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?Y=.026484626664041125:t[10]>1.5000000000000002?Y=-.10187000872941615:Y=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Y=.09574540795390041:Y=-.06454986703691233:Y=-.11411849349353141:t[266]>1e-35?Y=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?Y=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?Y=-.04403391373512386:Y=.1132928075412222:t[2]>47.50000000000001?Y=-.09700191391838056:Y=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?Y=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?Y=-.001668912999010927:Y=-.02363511102970245:t[8]>58.50000000000001?Y=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?Y=.0911011436534449:t[1]>28.500000000000004?Y=-.07192390493729035:Y=.06913818091291246:Y=-.012312625373699222:Y=.06784496312307986:Y=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?Y=.0026564453057705273:Y=-.025425772389361445:t[122]>1e-35?Y=-.12046786388602149:t[0]>3183.5000000000005?Y=.01162092842804907:t[91]>1e-35?Y=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?Y=-.0001647792543020228:Y=-.023664538532907665:Y=.01609078206180752;let re;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?re=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?re=-.017696526862422682:re=.1450050954613223:re=-.05406930069823832:re=-.08308700260259043:t[120]>1e-35?re=.058316269489189415:t[297]>1e-35?t[94]>1e-35?re=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?re=.038431826961746934:re=-.05937462906539856:t[9]>65.50000000000001?re=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?re=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?re=-.09579030954062734:re=.025064711572811746:re=.02579440518821548:re=.1044440128091862:re=-.058348633139536844:re=.07766788227934436:re=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?re=.07463684068207214:re=.18244269035484484:t[6]>39.50000000000001?re=-.06050050067471004:re=.05787759066913493:re=.010783225857972171:re=.1674891243602606:t[4]>9.500000000000002?re=-.004814132027475892:re=-.14543299413454813:re=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?re=-.07634466313617769:re=.0287825335169114:re=-.06894721943300268:re=-.00023988459059521937;let j;t[131]>1e-35?t[1]>93.50000000000001?j=-.05706887458825395:t[2]>1.5000000000000002?j=.011446637886629108:j=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?j=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?j=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?j=.026278724448495064:j=.17053138400480508:t[0]>4463.500000000001?j=-.06482289890096041:j=.03026516489536295:j=-.031785170717683144:j=.1312690622980455:t[13]>1e-35?j=.14336922540461444:j=.03523850945454039:j=-.015407465968975714:t[39]>1e-35?j=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?j=-.0659975068798723:j=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?j=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?j=.057409156184759516:j=.2024322059866388:j=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?j=.010648654146284154:t[308]>1e-35?j=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?j=.12364025998551711:j=-.02247495081065243:t[1]>22.500000000000004?j=-.0726295464624251:j=.03481895086048152:t[0]>4331.500000000001?j=-.04775443357020673:j=.07172377425057568:t[2]>89.50000000000001?j=-.11782645274716962:j=.00010092665257989378;let X;t[147]>1e-35?X=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?X=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?X=-.016101990375700172:t[0]>2579.5000000000005?X=-.13045089661551845:X=-.02874367814784938:X=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?X=.17084176915326055:X=-.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?X=.10591712319944074:X=-.024082167264285:X=.16497698867036126:X=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?X=-.021012910475524206:X=-.13058422554298485:t[0]>1102.5000000000002?X=.10955864175201457:X=-.03566689354348996:t[1]>11.500000000000002?X=-.02093884208606101:X=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?X=-.013861861436128482:X=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?X=.10163873449625677:X=-.02779270277623805:t[1]>26.500000000000004?X=-.08035058228527389:X=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?X=-.007028075523033826:X=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?X=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?X=-.0032075580718124892:X=-.04442829143298883:X=-.06597073245775804:X=.0015594090939337751;let ie;t[223]>1e-35?t[8]>668.5000000000001?ie=-.12803889879260094:ie=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ie=.08967966612917375:t[1]>39.50000000000001?ie=-.059791671514498074:ie=.05648934961902822:t[2]>59.50000000000001?ie=-.08633234097449628:t[6]>53.50000000000001?ie=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ie=.025606129643140924:ie=.13835395886271978:ie=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ie=-.09975506556937946:t[10]>36.50000000000001?ie=-.09427724661655643:t[10]>24.500000000000004?ie=.07329330653410447:ie=-.02271182965807972:ie=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ie=-.05082091374050816:ie=.1687114435254966:t[0]>2314.5000000000005?ie=-.06422664016383926:ie=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ie=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ie=-.1274167728754332:ie=.01308079126447365:t[4]>73.50000000000001?ie=.13854015371106546:t[4]>48.50000000000001?ie=-.03684255740123261:t[6]>45.50000000000001?ie=.10329912215813097:t[10]>77.50000000000001?ie=-.08630788656925215:ie=.031022006843800853:t[1]>25.500000000000004?ie=-.08278381528048026:ie=.06664374548141594:t[84]>1e-35?ie=-.05624227409079396:ie=.00012184182357340415;let we;t[179]>1e-35?we=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?we=-.07595415373151816:we=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?we=.022822510448266862:we=.17491569312933697:we=-.058362287133533565:t[2]>2.5000000000000004?we=-.03633895806364428:we=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?we=-.07294848747514579:we=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?we=-.07009535282685533:t[8]>2640.0000000000005?we=-.051761240111316276:t[131]>1e-35?we=-.06245774419231631:we=.03495606662854905:we=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?we=.0015036626973581122:we=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?we=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?we=.022343994371919224:we=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?we=.07724450228328664:t[0]>3853.5000000000005?we=-.15671707454435677:t[10]>28.500000000000004?we=-.10179090671841723:we=.014878216919760927:we=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?we=.14054154485273487:we=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?we=-.08632985141410315:we=.005524157938954954:we=-.08802502622523681:we=-.0004649168897260341;let Ae;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?Ae=-.007458687464321174:Ae=-.09444966249102484:t[1]>23.500000000000004?Ae=.08564129697360716:Ae=-.07105002902845851:Ae=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?Ae=-.10326216566705966:t[1]>26.500000000000004?Ae=.0050539832484585365:Ae=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?Ae=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?Ae=.05783632021087773:t[10]>17.500000000000004?Ae=-.06720598671764105:t[1]>47.50000000000001?Ae=.097495825172558:Ae=-.013372242800584872:Ae=-.06463226787713715:t[42]>1e-35?Ae=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?Ae=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?Ae=.11051270080118503:Ae=.027719462817590454:t[8]>597.5000000000001?Ae=-.08441503592016869:Ae=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?Ae=-.12190088985091102:Ae=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?Ae=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?Ae=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?Ae=.016585157185448045:Ae=-.11032043771149425:Ae=.01586986028570486:t[8]>388.50000000000006?Ae=-.10592413013261853:Ae=.04930703248769364:t[13]>1e-35?Ae=.003621937787920821:Ae=-.0013786331198611841;let De;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?De=.009769895322846493:De=-.10620052926943656:t[9]>19.500000000000004?De=.03781202525403449:t[9]>14.500000000000002?De=-.11485785321365344:t[9]>6.500000000000001?De=.07677177833073881:t[0]>4342.500000000001?De=-.07079285609687631:t[49]>1e-35?De=.06156814809246001:De=-.014788509042554625:De=-.032659201618470655:t[5]>5207.500000000001?De=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?De=-.03094160322187924:t[1]>29.500000000000004?De=.09474646043921069:De=.023445783928231618:De=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?De=-.07164443768784848:t[1]>29.500000000000004?De=.089473622509272:t[8]>597.5000000000001?De=-.08155349903101317:De=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?De=-.004003900679358653:t[190]>1e-35?De=-.09236113461485262:t[8]>3198.5000000000005?De=-.0124130160451179:De=.018453070064009328:t[15]>1e-35?De=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?De=-.0009580759587680961:De=-.03227283036698222:De=.01369287669536875:t[1]>50.50000000000001?De=-.04213060332500437:t[35]>1e-35?De=-.11508095777767471:t[190]>1e-35?De=-.08611884672400155:t[297]>1e-35?De=.05723551879433584:De=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let J;t[3]>7.500000000000001?J=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?J=.03642374718166293:J=.16379973756366603:J=-.03946685266127979:t[186]>1e-35?J=.07618896623420895:t[96]>1e-35?J=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?J=-.022822371600847505:J=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?J=.044416424920571296:J=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?J=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?J=.1061937286809567:t[7]>54.50000000000001?J=.11487507743121311:t[8]>819.5000000000001?J=-.07181278009001418:t[10]>25.500000000000004?J=.13499019430369633:t[1]>31.500000000000004?J=.09032979489780704:J=-.12754166393372374:t[9]>37.50000000000001?J=-.05093963635361407:J=-.005026651151683848:t[9]>2.5000000000000004?J=.07619735785573735:J=.012363301341532136:t[26]>1e-35?J=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?J=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?J=-.10764172927882483:J=.01890760098464703:J=.06573095405846417:t[8]>634.5000000000001?J=-.00783575973273707:J=-.050612689680229306:t[1]>22.500000000000004?J=-.0016842490401359626:J=.0738227088444087:J=-.02663970950432175;let z;t[31]>1e-35?t[8]>17.500000000000004?z=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?z=.007191286124908192:z=-.09347881647636902:t[10]>1.5000000000000002?z=.07938758708008091:z=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?z=.12321804057595996:z=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?z=-.04644244754790671:z=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?z=.0706108609273337:t[2]>40.50000000000001?z=-.028046629962303716:z=-.06497613993109329:z=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?z=-.03056331974267756:z=-.11886389712497057:z=.053364962175658184:t[8]>2233.5000000000005?z=-.0448152521157682:z=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?z=.03818796510453344:z=.23673992112982362:z=.02858814226507374:t[10]>44.50000000000001?z=-.1125863771551199:z=.009129996952394916:t[1]>7.500000000000001?z=-.004374525302461639:z=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?z=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?z=-.13677189943034931:t[10]>2.5000000000000004?z=.039591891437078086:z=-.09312596849507347:z=-.02423172142089822:z=.0009836986075266283;let le;t[189]>1e-35?t[0]>5269.500000000001?le=-.103183298350443:t[2]>51.50000000000001?le=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?le=-.05186168947388339:le=.0496996365539082:t[10]>23.500000000000004?le=.1404445738719:t[93]>1e-35?le=.0027146310074558505:t[5]>3821.5000000000005?le=.002153033152069652:t[4]>2.5000000000000004?le=.007663539551317215:le=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?le=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?le=-.021479467709980358:le=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?le=.021660293256233334:le=-.0927396152303864:le=.0665074081601698:t[0]>1550.5000000000002?le=.08972407105958534:le=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?le=.06761927942466854:le=-.015762168112653286:t[17]>1e-35?le=.10311304131145381:le=-.017672785252336027:le=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?le=-.10638321435298535:le=.0007073011744385905:t[18]>1e-35?le=-.027056185501334325:t[145]>1e-35?le=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?le=.09762140519655171:t[9]>110.50000000000001?le=-.06581942957595835:t[6]>54.50000000000001?le=.04959634035251596:le=.0022616298654554207:le=-.007437620924990854;let K;t[179]>1e-35?K=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?K=.1470294450403005:K=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?K=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?K=.07965955447707423:t[10]>10.500000000000002?K=-.09236156404262426:K=.03396273196231458:K=-.13246465021467432:K=.07092822261735353:K=-.08753829085942:K=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?K=.004705878789890202:K=.13775378964952867:K=-.04770928980587811:t[10]>29.500000000000004?K=.011221519891071544:t[0]>3853.5000000000005?K=.06365381191628273:K=.15506252245336827:t[1]>37.50000000000001?K=-.07254777021042061:K=.026514587757252385:t[308]>1e-35?K=.04115804816617256:t[10]>26.500000000000004?K=.02077721353011946:t[5]>3548.5000000000005?K=-.1280907116663952:K=-.021974774274438:t[306]>1e-35?K=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?K=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?K=-.005710865560475598:t[94]>1e-35?K=-.06751507982853555:K=.027250040757588703:t[9]>52.50000000000001?K=.07060357924595577:K=-.030297760713011795:K=-.0006005400085266517;let ae;t[113]>1e-35?ae=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ae=-.06996356565314456:ae=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ae=-.08317707559926495:t[21]>1e-35?ae=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ae=-.010538203005984922:ae=.08454819465349446:t[9]>124.50000000000001?ae=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ae=-.08542251249346582:t[9]>50.50000000000001?ae=-.023428882537657472:ae=.010042500833979073:ae=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ae=.03006025206979096:t[9]>108.50000000000001?ae=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ae=.04222035773042132:ae=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ae=-.07209095448054853:ae=.028065954981903313:ae=.08714651929917122:ae=-.006678820669279169:t[10]>40.50000000000001?ae=.006982396294941626:ae=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ae=-.09351114982645548:t[4]>3.5000000000000004?ae=-.004837550129223451:ae=-.08324141237464677:t[303]>1e-35?ae=.10703037493990825:t[9]>156.50000000000003?ae=-.10803018621648303:t[116]>1e-35?ae=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ae=.10261721665006701:ae=.018994509090668264:ae=.0011244262442038839;let Me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Me=-.08404263465005328:t[0]>3682.5000000000005?Me=.041259223920298876:t[1]>29.500000000000004?Me=-.09541257493441671:Me=.001482192721625409:Me=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Me=-.08268996098437432:t[230]>1e-35?Me=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Me=-913218977737457e-19:t[4]>10.500000000000002?Me=-.056334165674005156:t[127]>1e-35?Me=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Me=-.04231200150318989:t[10]>42.50000000000001?Me=.10182973257894812:Me=.015934763950068445:Me=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Me=-.041117068322885315:Me=.1167767830037126:Me=.13611206992387337:t[10]>41.50000000000001?Me=-.07120286010564107:Me=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Me=-.07702290997669524:t[198]>1e-35?Me=.08776558554437136:Me=-.008290740324975692:t[2]>32.50000000000001?Me=.07198457624219955:Me=.005463113714361629:Me=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Me=.03295785445437507:Me=.15140250150674536:Me=-.035613213948910254:t[186]>1e-35?Me=.06849425535860769:t[96]>1e-35?Me=.06028225812727254:Me=-.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 se;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?se=-.01386103677247845:se=.11386694333005128:t[4]>27.500000000000004?se=-.021862617610091336:t[2]>31.500000000000004?se=.0828858469030438:se=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?se=.11303635767048735:se=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?se=-.04238798044549342:se=.022091190130494303:t[5]>5082.500000000001?se=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?se=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?se=-.04291104140431434:t[17]>1e-35?se=.11256797532342613:se=-.017206916368289193:se=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?se=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?se=.03581712466863222:se=.14770264307668884:t[8]>73.50000000000001?se=-.13093289429740068:se=.042461737442702936:t[52]>1e-35?se=.0501831919044939:se=-.010450249720465756:se=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?se=.0005381332165438493:se=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?se=.04849637311285226:se=-.036671377119808564:t[0]>421.50000000000006?se=.00020968499911058945:se=.11636422423182405:se=-.12687837788222575:se=.0012774367867215346;let Ie;t[120]>1e-35?Ie=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ie=-.042799574885345304:Ie=.07412430171193245:Ie=-.11248270469336048:t[193]>1e-35?Ie=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ie=.028911612178122104:Ie=.12326369727728437:t[0]>4091.5000000000005?Ie=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ie=.1159839898100149:Ie=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ie=-.0216343737351583:Ie=-.1220272260878369:t[2]>18.500000000000004?Ie=.09152924475072398:t[8]>55.50000000000001?Ie=.039508716651005665:Ie=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ie=.06793009902674053:Ie=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ie=-.04391068849624096:Ie=.04009967593394672:t[8]>1085.5000000000002?Ie=-.024773826356034825:Ie=-.13919707884246582:Ie=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ie=-.11567917501901476:Ie=-.006813640337684114:t[3]>7.500000000000001?Ie=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ie=-.001754586408351048:Ie=-.055422422450722056:Ie=-.06090032532532226:t[0]>5269.500000000001?Ie=.11787981735983527:Ie=-.00198119768540783:Ie=.00210412924303036;let _e;t[294]>1e-35?t[10]>50.50000000000001?_e=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?_e=-.06063239096209816:_e=.03317022411417386:_e=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?_e=-.013608609329298802:_e=.09078000157330264:t[99]>1e-35?_e=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?_e=-.07536137260189814:_e=.006253266595455118:t[10]>28.500000000000004?_e=-.006106041147592768:t[9]>156.50000000000003?_e=-.11828932797811101:t[94]>1e-35?_e=-.02566078479505714:t[303]>1e-35?_e=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?_e=-.08401252789168523:t[5]>4244.500000000001?_e=.026372887658499107:t[1]>16.500000000000004?_e=-.027836756345634026:_e=.09205362097909099:_e=.00934612788718244:t[203]>1e-35?_e=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?_e=-.09580979052540028:t[1]>50.50000000000001?_e=-.06402211827281554:_e=.08342858760095972:t[2]>36.50000000000001?_e=.008114897658204584:t[92]>1e-35?_e=.09541587072672864:_e=-.022342147210555434:_e=-.01660492519175128:_e=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?_e=.15846731118501817:_e=.039498507912023195:t[245]>1e-35?_e=.07008718676813333:_e=.0019806389728814727;let Re;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Re=-.01192072916082109:Re=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Re=.06874032717466054:t[4]>40.50000000000001?Re=-.07752510020707537:t[1]>76.50000000000001?Re=-.09944032260703917:t[8]>1381.5000000000002?Re=-.054466635810800745:t[1]>32.50000000000001?Re=.05974084520839573:Re=-.0384718740755954:Re=-.11374190719134032:t[0]>2151.5000000000005?Re=-.13703645155803298:Re=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Re=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Re=.013539805885738608:Re=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Re=.09941880179344399:Re=-.01608127391210995:Re=.08025226531247417:t[9]>67.50000000000001?Re=.13525448212444113:t[6]>61.50000000000001?Re=-.05511099182158894:t[94]>1e-35?Re=-.06821509831783572:t[128]>1e-35?Re=.11361314817714643:Re=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Re=-.09954181329804547:t[197]>1e-35?Re=.10102833149755386:t[188]>1e-35?Re=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Re=-.03781554214742005:Re=.09927933385592314:Re=-.020006000056720083:Re=-.10520473615957895:Re=-.12006990846253787:Re=-.00026111570975317574;let Je;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?Je=-.019188245509744628:Je=-.13354864350075848:t[0]>2461.5000000000005?Je=.051885477468354396:Je=-.0833581968852119:Je=.08233441701532287:Je=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?Je=.09926337893072812:Je=-.027753610497327715:t[0]>1972.5000000000002?Je=-.09780045823152517:Je=.032380915168504935:Je=.11502632261226381:t[17]>1e-35?Je=-.06094965899579662:t[10]>40.50000000000001?Je=-.07500475582440802:Je=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?Je=-.09584538995220808:Je=-.00908705814304442:Je=.03203281520813893:t[10]>49.50000000000001?Je=-.03146271513986384:t[2]>63.50000000000001?Je=.13172001315536286:t[224]>1e-35?Je=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?Je=.09521549382082259:Je=-.04414925613522197:t[0]>1847.5000000000002?Je=-.09118580379557353:Je=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?Je=.03525144509943896:Je=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?Je=-.04766112322938157:t[2]>10.500000000000002?Je=.0728516504357201:Je=-.05049625965272536:Je=-.10868663055825774:Je=.0005382613419948969;let Xe;t[147]>1e-35?t[1]>53.50000000000001?Xe=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Xe=-.030504020655417463:Xe=.07102458639110094:Xe=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?Xe=.055304563442710876:t[1]>53.50000000000001?Xe=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?Xe=-.1568835288372895:Xe=-.0279829124400056:Xe=.04493843959601833:Xe=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?Xe=-.054133834303687026:t[9]>48.50000000000001?Xe=.11263810289007213:t[9]>9.500000000000002?Xe=-.02202034562838259:t[4]>45.50000000000001?Xe=-.03410927569045158:Xe=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?Xe=-.029687297407295893:Xe=.10673602850001934:t[4]>42.50000000000001?Xe=.0036275562945108117:Xe=-.0760789221330622:Xe=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Xe=.08274426793676076:Xe=-.07076234425516396:Xe=.13890177606150175:Xe=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?Xe=-.09250637750836187:Xe=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?Xe=-.01897867921812603:Xe=.04890781705365262:Xe=-.11569892307597907:t[2]>106.50000000000001?Xe=.09032697440623969:Xe=.00047935919155035045;let Ct;t[115]>1e-35?Ct=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Ct=-.10131179514695865:t[8]>938.5000000000001?Ct=.10203729808015481:Ct=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Ct=.03574015165562999:Ct=-.07763042506449493:Ct=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Ct=.0665706259130275:Ct=-.06586817559309924:Ct=.11925564412287476:Ct=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Ct=.046017146627455346:Ct=-.08623321630086885:t[8]>1765.5000000000002?Ct=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Ct=.11143827902215087:Ct=-.01817808730473413:Ct=.16980985030210127:Ct=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Ct=.010168994879727824:Ct=-.09099594488792513:t[9]>1.5000000000000002?Ct=.0533459678147928:Ct=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Ct=-.062346959148773695:t[1]>47.50000000000001?Ct=-.0021578343835599316:t[2]>27.500000000000004?Ct=.19567373210166172:Ct=.07851555379116423:t[18]>1e-35?Ct=.03711549097804649:t[8]>359.50000000000006?Ct=.012492346746905587:t[4]>20.500000000000004?Ct=.047511695735697544:Ct=-.07999269063948773:Ct=6802045404471004e-20;let Ot;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Ot=.0011484728213539738:Ot=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Ot=-.09828874964938798:t[8]>1586.5000000000002?Ot=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Ot=.011938269926919522:Ot=.17541983715953954:t[19]>1e-35?Ot=.023002786011088672:Ot=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Ot=.06508934844183291:Ot=-.10168553534835639:Ot=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Ot=.021140806225203937:Ot=-.1167833342453639:t[2]>33.50000000000001?Ot=.13163585734056618:Ot=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Ot=.06314479201263888:Ot=-.09639088327091713:t[10]>29.500000000000004?Ot=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Ot=40577156464836036e-21:Ot=.12322387121810757:Ot=-.03697224045046014:t[1]>22.500000000000004?Ot=.016474835887320276:Ot=.16919298733903063:Ot=.07633203630214054:Ot=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ot=.14150493354700563:Ot=-.01831155354975749:t[1]>28.500000000000004?Ot=-.07952557178685365:t[10]>28.500000000000004?Ot=.0665695554984927:Ot=-.053640139319277094:Ot=.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 Ee;t[71]>1e-35?t[4]>17.500000000000004?Ee=.12586844370423247:Ee=-.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?Ee=-.08474891624263797:t[8]>125.50000000000001?Ee=.08125086980439704:Ee=-.04082085238068532:t[0]>3863.5000000000005?Ee=.020481535807469208:Ee=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ee=-.019110200161573936:Ee=-.12387719685855114:t[0]>1102.5000000000002?Ee=.08376595701957407:Ee=-.031821919580524834:t[9]>4.500000000000001?Ee=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ee=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ee=.1349841206807871:Ee=.011864053595560297:t[1]>41.50000000000001?Ee=-.08203662486612544:t[2]>18.500000000000004?Ee=-.009541865642346947:Ee=.08345043168501759:t[2]>10.500000000000002?Ee=-.09585031818030947:Ee=.019432330487099865:Ee=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ee=.11951517733981365:Ee=-.016651014735738538:t[1]>28.500000000000004?Ee=-.07410922545030711:t[10]>28.500000000000004?Ee=.05886430683844788:Ee=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ee=.04802269879144705:Ee=-.026208212831796737:t[4]>45.50000000000001?Ee=-.03227476944664786:Ee=.05124575625622705:Ee=.00020506696916003137;let Qe;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?Qe=-.03042091758483443:t[10]>14.500000000000002?Qe=.09816619204768777:Qe=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?Qe=-.02381165060401718:Qe=-.10950361804974783:Qe=.03538211665111128:t[212]>1e-35?t[19]>1e-35?Qe=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?Qe=-.06371052144380579:Qe=.0835500621252692:Qe=-.10408255929333915:t[1]>74.50000000000001?Qe=.13208968122712403:t[1]>64.50000000000001?Qe=-.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?Qe=.09922816902423433:Qe=.016366955328796718:Qe=.1592412560903584:t[1]>39.50000000000001?Qe=.05409467990258923:Qe=-.08260633210459611:Qe=-.06307205775247567:t[9]>36.50000000000001?Qe=.040253940015648144:Qe=.14202568969471283:Qe=-.028761848341594044:Qe=.08994073058773508:t[0]>807.5000000000001?Qe=-.043427848826323195:Qe=.04573516446846493:t[20]>1e-35?t[188]>1e-35?Qe=-.0758877731600639:t[23]>1e-35?Qe=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?Qe=.08124700978741987:Qe=.013296063087086852:t[7]>5.500000000000001?Qe=-.01640196088612987:Qe=-.12685498840146067:Qe=-.0004940792382459551;let nt;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?nt=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?nt=.08513773825688947:nt=-.1184664832315282:nt=.05676963535893477:nt=.14263843210340613:nt=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?nt=-.10669720555606924:nt=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?nt=.0664744575868955:nt=-.08469256188890871:nt=-.026746678040592144:t[281]>1e-35?nt=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?nt=.012131807587207655:nt=-.12776015795398743:nt=.04320472481083551:nt=.08390980661550446:t[10]>227.50000000000003?nt=-.09771783809101153:t[10]>130.50000000000003?nt=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?nt=-.07610698254064358:t[8]>902.5000000000001?nt=-.03136381213599649:t[131]>1e-35?nt=.0704821739127936:t[224]>1e-35?nt=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?nt=.10431473040024908:t[8]>841.5000000000001?nt=.07304745320500514:nt=-.038011541882439825:nt=-.01679746695007364:t[0]>3129.5000000000005?nt=.05589952587431965:t[210]>1e-35?nt=.06227198085800842:nt=-.0011341890997947812:t[8]>740.5000000000001?nt=.04817300084412584:nt=-.000577001010789238;let mt;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?mt=-.10504730480402079:t[5]>3341.5000000000005?mt=.11087894671081754:mt=-.0406668834674614:mt=.03308382165616109:t[8]>104.50000000000001?mt=-.10431436764549162:mt=.0073928337244891455:t[4]>34.50000000000001?mt=-.10571751512748416:mt=-.006081128814142983:t[13]>1e-35?mt=.1299673566095023:t[4]>60.50000000000001?mt=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?mt=.04857126072645073:mt=-.03431365358104773:t[4]>16.500000000000004?mt=.04101865986596709:mt=.16480274980378218:t[10]>26.500000000000004?mt=.03673978504199255:t[10]>9.500000000000002?mt=-.10996402743800027:t[308]>1e-35?mt=.0553693735082498:mt=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?mt=.010902983761213922:mt=.1325118659895645:mt=-.064362945508595:t[1]>66.50000000000001?mt=.033416767779331176:mt=-.054080316225040496:t[42]>1e-35?mt=-.07762364337810815:t[10]>1089.5000000000002?mt=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?mt=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?mt=.0220102041325908:mt=-.06516708740003069:mt=.012833498905748267:t[224]>1e-35?mt=-.007038418272997865:mt=.00037666304316290967;let xe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?xe=.07554189644995735:xe=-.052089349455904946:xe=-.10148206848169845:t[113]>1e-35?xe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?xe=.07172653627995676:xe=-.07602959317610998:xe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?xe=-.0399322883690891:xe=.06523495517476098:xe=-.10358715295743802:t[193]>1e-35?xe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?xe=.015928764772252406:xe=.1341513061552287:xe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?xe=-.033592997607280156:xe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?xe=-.08402551858097379:xe=.017401984506038796:t[1]>25.500000000000004?xe=.13337205393591278:xe=-.01160208350090984:xe=.06708317942315471:t[8]>227.50000000000003?xe=-.08486943882418681:xe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?xe=-.10496268177586783:xe=-.020921489532370493:xe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?xe=.11639296062157028:xe=-.004275784356569115:t[32]>1e-35?xe=-.07297384970166025:xe=.006026841626381599:xe=.002034611134960428;let He;t[248]>1e-35?He=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?He=-.06455513326540585:t[1]>29.500000000000004?He=.07718474591552532:t[4]>7.500000000000001?He=.040139336931404826:He=-.09685734690563386:He=.00015327283570347363:t[9]>88.50000000000001?He=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?He=-.04077257804338707:He=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?He=.03778141591008941:He=-.06459919920634845:He=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?He=.14063930759326346:t[0]>179.50000000000003?He=.07287482250668585:t[8]>1180.5000000000002?He=-.14419393112726253:t[10]>28.500000000000004?He=-.07993142770099469:t[17]>1e-35?He=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?He=.05527969663610186:He=-.10824385941441346:t[3]>11.500000000000002?He=.12358502961047915:He=-.017509147119622873:t[0]>74.50000000000001?He=-.014907705458730486:t[8]>95.50000000000001?He=-.02225118168342062:He=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?He=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?He=.04962819555610421:He=-.07213577821855309:He=.09139529824708481:t[19]>1e-35?He=.013439401088345224:He=-.049274647207292056:He=.10531673719686951;let Ze;t[40]>1e-35?t[0]>1937.5000000000002?Ze=-.06421671152073961:Ze=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Ze=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Ze=-.03520420769287065:t[8]>1085.5000000000002?Ze=-.019817352506127633:Ze=.11444439424520964:Ze=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Ze=-.010490117519863269:Ze=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Ze=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Ze=.06619344145920268:t[0]>4091.5000000000005?Ze=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ze=.10016091391222309:Ze=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Ze=-.019511460451434884:Ze=-.11643672465055221:t[2]>18.500000000000004?Ze=.07848228087333317:t[8]>55.50000000000001?Ze=.032583027899956235:Ze=-.11209832692153521:t[11]>1e-35?Ze=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Ze=-.09996887746328006:t[9]>2.5000000000000004?Ze=.02157682011863397:Ze=-.05247727848991843:Ze=.07409150201483244:t[1]>38.50000000000001?Ze=-.11378466075449625:t[224]>1e-35?Ze=-.10741749127732923:t[1]>26.500000000000004?Ze=.07343136534146562:Ze=-.07013573628594773:t[25]>1e-35?Ze=-.04626669734164317:Ze=.05518333197956482:Ze=.00032434010867555516;let at;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?at=.026313251010808853:at=-.08997339150292381:at=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?at=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?at=.0905155504503746:t[8]>1049.5000000000002?at=-.062312558183394054:t[8]>719.5000000000001?at=.09583836191410239:t[0]>3719.5000000000005?at=-.0778097309430818:at=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?at=-.12920865648544927:t[0]>2699.5000000000005?at=-.07086587879041864:at=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?at=-.11377786322600797:at=-.009486325820117998:t[1]>55.50000000000001?at=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?at=-.07938291201004219:t[2]>36.50000000000001?at=.01520046732530246:at=.13649854049662832:at=-.07145015938528873:t[8]>407.50000000000006?at=-.00350257360822279:at=.11332047082193297:at=-.10060624458629897:at=.05429496612497562:t[8]>1446.5000000000002?at=.006073419197482838:at=-.08718676350883998:at=-.11532497988252638:at=.10766270463068293:t[34]>1e-35?at=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?at=-.0004109812623829506:at=.021601073497455662:at=-7343540098965853e-20;let ct;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ct=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?ct=.05995640200798119:t[0]>3443.5000000000005?ct=-.14698883458733583:ct=-.030039164579240187:t[189]>1e-35?ct=-.06086763220538141:t[1]>86.50000000000001?ct=-.05096727866142538:t[4]>64.50000000000001?ct=.11240554253834577:t[4]>45.50000000000001?ct=-.030279760168394117:t[6]>45.50000000000001?ct=.10161088917815142:t[10]>77.50000000000001?ct=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?ct=-.06672020005240323:ct=.08831457502630258:t[8]>2592.5000000000005?ct=-.052617701047376654:t[10]>29.500000000000004?ct=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?ct=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?ct=-.064099222705728:ct=.044332487521538365:t[0]>2882.5000000000005?ct=.031099546885005065:ct=.12938467051623853:t[0]>4221.500000000001?ct=-.0928676413498701:t[9]>30.500000000000004?ct=-.05781824812803708:ct=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?ct=-.06648105454098469:ct=.05985487552383097:ct=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?ct=.05282385499619401:t[1]>66.50000000000001?ct=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?ct=.027885690791379255:ct=-.08407126408362446:ct=.014432924125571093:ct=-9903435845205118e-20;let ut;t[76]>1e-35?ut=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?ut=.013633653464240465:ut=-.10164319411983509:ut=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?ut=.00632864847804078:ut=-.08393000368134668:ut=.07870508617440916:t[284]>1e-35?ut=.1092302727710421:ut=-.0025505047582483234:t[248]>1e-35?ut=.07101822393621864:t[274]>1e-35?ut=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?ut=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?ut=.025081789181021243:ut=-.014813325803582618:t[9]>33.50000000000001?ut=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?ut=.11926990418060353:ut=.01852125513565268:ut=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?ut=-.1178464984373743:t[283]>1e-35?ut=.043370859226927405:t[5]>4320.500000000001?ut=-.01103141226366587:t[8]>1104.5000000000002?ut=-.023053423988095886:ut=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?ut=.000579145585864887:ut=.03389152834202143:t[128]>1e-35?ut=-.14527722052568462:t[210]>1e-35?ut=-.08915971541902741:t[7]>9.500000000000002?ut=-.03307314577076116:t[18]>1e-35?ut=-.05521712302023565:ut=.009315605032770029:ut=.0036332551852289933;let ee;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?ee=-.07583539600416284:t[188]>1e-35?ee=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?ee=-.011038193049597113:ee=.08154028164397753:t[1]>85.50000000000001?ee=.10259361975201933:ee=.011640408330521594:ee=-.00023319159023748508:t[92]>1e-35?ee=.13771692859530546:ee=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?ee=.09967230141007705:t[30]>1e-35?ee=-.08888529037551285:ee=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?ee=.08284665960761373:ee=-.029292565021289504:t[7]>7.500000000000001?ee=-.09945093355204493:ee=-.008381393701708593:t[20]>1e-35?ee=-.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?ee=.07585582641438211:t[8]>284.50000000000006?ee=-.029387993239886723:ee=.07716738177321587:t[1]>18.500000000000004?ee=.026745348497993746:ee=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?ee=.02337306890530338:ee=-.10390355904767366:ee=.07390521199638532:ee=-.06788247515155237:ee=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?ee=-.06360325615644084:ee=.04342192339836601:ee=-.10598779152030145:ee=.05253384605768211;let pe;t[3]>7.500000000000001?t[157]>1e-35?pe=-.07514182877923786:pe=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?pe=.028692053800951845:pe=.14081686716133598:pe=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?pe=.0037139292567243084:pe=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?pe=.01202688580305612:pe=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?pe=.043935495082738626:pe=-.05639305759669704:t[247]>1e-35?pe=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?pe=.10331836202616368:pe=.0006926658459781341:t[96]>1e-35?pe=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?pe=-.0741403257305367:pe=.022900127535540854:t[7]>3.5000000000000004?pe=.038110741403836294:pe=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?pe=-.09552842289807008:t[1]>27.500000000000004?pe=.012505935885798007:pe=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?pe=-.1046104767723845:pe=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?pe=.023466328488582572:pe=.11730925774586994:pe=-.04771965631104874:pe=.17059689880751394:pe=-.08181850955999449:t[26]>1e-35?pe=-.12727482696678769:pe=-.014343123272734182;let ke;t[147]>1e-35?t[1]>53.50000000000001?ke=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?ke=-.02763546051134888:ke=.06423344777499343:ke=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?ke=.049825139823021586:t[7]>22.500000000000004?ke=-.01131680751379858:t[0]>2579.5000000000005?ke=-.10673674485369694:ke=-.015387212937189957:ke=.04347325151148724:t[179]>1e-35?ke=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ke=.0650355590939066:ke=-.0473332870892226:ke=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?ke=.11139543329789044:t[126]>1e-35?ke=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?ke=.06370903833231022:t[10]>29.500000000000004?ke=.03415223859607161:t[10]>3.5000000000000004?ke=-.07415518117873297:ke=-.0014119203473324082:ke=.12617652343819508:t[9]>41.50000000000001?ke=-.10311145857176976:t[8]>2757.5000000000005?ke=-.08106484219011428:t[7]>71.50000000000001?ke=-.09783384432091176:t[1]>88.50000000000001?ke=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?ke=-.008884084501608536:ke=.061339437777743616:ke=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?ke=.01526664064166223:ke=.13534828515415498:ke=-.06985484465894776:ke=.0005758961943178744;let Le;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Le=-.029152732370514342:Le=.07173628916139178:t[1]>36.50000000000001?Le=-.08859111297255318:Le=.0018030071815630785:Le=.13652461563759322:Le=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Le=-.07145140450454163:t[21]>1e-35?Le=-.07422841663493233:Le=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Le=.11864240653986852:t[3]>33.50000000000001?Le=-.08821209591953476:Le=.05706392280054726:Le=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Le=.01953613016837112:Le=-.059781039130025006:t[148]>1e-35?Le=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Le=.07207826841738371:t[202]>1e-35?Le=.08163917539410503:Le=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Le=-.06858280496900336:Le=-.1781828899516648:Le=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Le=.018232649414147116:Le=-.04419781124222661:Le=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Le=.11452368095776105:Le=-.036496437259924026:Le=-.040445338739465486:Le=.0816572651001145:Le=-.08968914517368663:Le=.0002826343082585516;let Ve;t[189]>1e-35?t[0]>5269.500000000001?Ve=-.08839493050459957:t[10]>85.50000000000001?Ve=.10046908365702462:t[8]>2592.5000000000005?Ve=-.09632233975926387:t[8]>2000.5000000000002?Ve=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?Ve=.035504970430426296:t[1]>31.500000000000004?Ve=-.1133764813142531:Ve=-.01138280942244812:t[8]>1125.5000000000002?Ve=.09800530246229806:Ve=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?Ve=.07316772160107896:Ve=-.059095014819051765:Ve=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?Ve=-.09150209066166894:t[8]>3084.0000000000005?Ve=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?Ve=-.04449234460408263:Ve=.05568837973347338:Ve=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?Ve=.12741077850267066:Ve=.007372371864985329:t[2]>39.50000000000001?Ve=.02295917234617787:Ve=.14966532083907075:t[1]>39.50000000000001?Ve=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?Ve=-.02511861881285652:t[1]>27.500000000000004?Ve=.08683660011672288:Ve=.02956214835267301:t[9]>15.500000000000002?Ve=-.016538805462996232:Ve=.04352738094981517:Ve=-.05561856645643868:t[9]>170.50000000000003?Ve=-.07996752635874248:t[179]>1e-35?Ve=-.09065975936933919:Ve=-.00042817975060427177;let tt;t[39]>1e-35?t[4]>25.500000000000004?tt=.03443173196222934:tt=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?tt=-.0013415395759330318:tt=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?tt=.002297618040307216:tt=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?tt=-.015297257305397608:tt=.09651828834062742:tt=-.06636003334371929:t[10]>11.500000000000002?tt=.17631616138309397:t[0]>1639.5000000000002?tt=3804386478092585e-20:tt=-.09099296398683193:tt=-.06874415876172972:t[0]>2151.5000000000005?tt=-.1311264883406766:tt=.00809052010141122:t[253]>1e-35?tt=-.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?tt=.045038497754638605:tt=-.07770167665661752:tt=-.08596294280650517:tt=.08538655727027213:tt=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?tt=.054627956617973275:t[1]>61.50000000000001?tt=-.11994465088415499:t[4]>8.500000000000002?tt=.06676200239406452:tt=-.027503148069376867:t[8]>676.5000000000001?tt=-.10363964928357075:t[4]>8.500000000000002?tt=-.07589816227175682:tt=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?tt=.009093153189012338:tt=-.06119765876605404:tt=.0004668642103528348;let vt;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?vt=-.10100794502567233:vt=.08000205636470442:vt=-.11945419826856896:t[113]>1e-35?vt=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?vt=.1224302423880318:vt=-.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?vt=.0019277012166729114:t[1]>28.500000000000004?vt=-.054445821715687494:vt=.045645722976713245:t[30]>1e-35?vt=.13402660155331655:vt=.008921176001777645:vt=-.058547426505451076:vt=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?vt=-.13526418192218206:vt=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?vt=.0007263224246135398:vt=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?vt=-.11575657261278308:vt=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?vt=-.01995960178292952:vt=.11216586049153021:vt=-.10050961087149474:vt=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?vt=.10303451081526649:vt=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?vt=-.043799548968209395:vt=-.12451444314954115:t[4]>12.500000000000002?vt=-.03838117361958468:vt=.06504990789767144:t[57]>1e-35?vt=.06890006938293915:vt=.0003914274695562949;let Nt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?Nt=.004271749009686975:Nt=-.10523878297127605:Nt=.04633982158107851:Nt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?Nt=-.08655730561951676:t[8]>919.5000000000001?Nt=-.0676453705610183:t[7]>18.500000000000004?Nt=-.027787974193650575:Nt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?Nt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?Nt=-.03473877164537313:t[8]>719.5000000000001?Nt=.10471053866934404:Nt=.008236107678382981:t[4]>57.50000000000001?Nt=.09412219478825269:t[10]>66.50000000000001?Nt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?Nt=-.040681323751002293:Nt=.06374650297561021:Nt=.12884615227401788:t[10]>5.500000000000001?Nt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?Nt=-.05474068967150784:Nt=.03744700650806603:Nt=-.07846396348680855:t[1]>42.50000000000001?Nt=.018972315810821302:Nt=.10953621007604744:t[5]>4439.500000000001?Nt=.010999776705494586:t[1]>40.50000000000001?Nt=-.12394200059775967:t[10]>2.5000000000000004?Nt=.013528093962849453:Nt=-.09222088417048682:Nt=-.12662967149701485:Nt=.09327296405849603:t[3]>99.50000000000001?Nt=-.013581954439986752:Nt=.0005526498251862075;let Vt;t[187]>1e-35?t[243]>1e-35?Vt=-.08392792551692502:t[10]>68.50000000000001?Vt=.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?Vt=-.0825306209711224:Vt=.049559996084532945:Vt=-.1064938580886302:Vt=.03353240732240275:Vt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?Vt=.16966001471529374:t[1]>57.50000000000001?Vt=-.005772777673676247:Vt=.09383677041525058:t[8]>747.5000000000001?Vt=.054068175469351235:Vt=-.049968216310277036:t[8]>753.5000000000001?Vt=-.0679383555784074:t[4]>8.500000000000002?Vt=-.059757341189735386:Vt=.05701083682780414:Vt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?Vt=.05820296128730006:Vt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?Vt=.15340611616954566:Vt=.04385036188666874:t[0]>4449.500000000001?Vt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?Vt=.004840354641006495:Vt=.09967827580276283:Vt=.11605363537391578:t[9]>19.500000000000004?Vt=-.0735831692725717:Vt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?Vt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?Vt=-.02442182361342386:Vt=.10334853004243093:Vt=-.030431948680167104:Vt=-956078595250818e-19;let It;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?It=-.040232505718244854:t[0]>3030.5000000000005?It=.0634109586813073:It=-.04043617034245621:It=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?It=-.007859096946435131:It=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?It=.05515771679628051:It=-.04214471312668263:It=-.09589322222261765:t[193]>1e-35?It=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?It=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?It=-.08152604001147906:t[11]>1e-35?It=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?It=.13100930780107503:t[10]>25.500000000000004?It=.05921074710011526:It=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?It=.0009447118243153454:It=-.09820565036865991:It=.057146909749745546:t[0]>2115.5000000000005?It=-.12331216726611678:It=.007281983677694285:t[2]>56.50000000000001?It=.012310154675612615:It=-.08873665774670461:t[6]>25.500000000000004?It=.134708740821879:t[9]>5.500000000000001?It=-.0805901581148979:t[224]>1e-35?It=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?It=.10842593386554122:t[2]>13.500000000000002?It=.06466798320378395:It=-.08578130788886655:It=-.03590892078300114:It=.0003499894043880708;let Be;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?Be=.10839808814624702:Be=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?Be=-.007478368069393829:Be=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?Be=.04035247751736232:t[0]>4255.500000000001?Be=-.1310865624507367:t[0]>4004.5000000000005?Be=.06647367311982634:Be=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?Be=-.011618902907510411:Be=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?Be=.09356028223727986:Be=-.03811765057032162:Be=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?Be=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?Be=.1146142460964847:t[1]>62.50000000000001?Be=-.09679869865322362:t[9]>71.50000000000001?Be=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?Be=-.039046426387852974:Be=.04558778688367152:Be=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?Be=.03261697816211156:t[15]>1e-35?Be=.02586252542264368:t[2]>14.500000000000002?Be=-.016420452667484604:Be=-.1011799626006976:Be=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?Be=.010193588102560583:Be=.11748729525930773:Be=-.04468162226743652:Be=-.028365274393617957:t[71]>1e-35?Be=.05115139346588793:Be=-.0001510425316936658;let oe;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?oe=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?oe=.020637047900190317:oe=-.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?oe=-.04632587527094407:oe=.08603684785510396:oe=-.05101401015448496:oe=.025466432054358498:oe=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?oe=.020385355430046367:oe=.12032592051335252:oe=-.012387370292173013:t[2]>23.500000000000004?oe=-.12568545484492677:oe=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?oe=.043528764484784536:oe=.14352071657196003:oe=-.009332833816977268:oe=.11186782227735846:oe=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?oe=-.05649104643152564:oe=.03884200719305747:t[42]>1e-35?oe=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?oe=-.04103416502526736:oe=.04881823954656287:t[4]>15.500000000000002?oe=.009342724662897898:t[0]>3969.5000000000005?oe=-.025637309961309498:oe=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?oe=-.08185697075265091:t[0]>2215.5000000000005?oe=.030063975892297354:t[0]>807.5000000000001?oe=-.03924325550733229:oe=.0415330999189793:oe=-.00024374664461674863;let ve;t[3]>7.500000000000001?ve=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ve=.025798416259686565:ve=.13251610353146012:ve=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?ve=-.11098564237775424:ve=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?ve=.15347826616466054:t[3]>4.500000000000001?ve=.10379320730958941:ve=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?ve=.03159791088468647:ve=-.10612873364104258:ve=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?ve=-.02335760775001469:ve=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?ve=-.011164334474672973:ve=-.06594044410501655:t[207]>1e-35?ve=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?ve=-.01725821503981916:ve=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?ve=-.04226531631656534:ve=-.14409800530171432:ve=-.03245576341206398:t[8]>4214.500000000001?ve=.0895409165534886:t[247]>1e-35?ve=-.06506383629143335:t[118]>1e-35?ve=-.07214270121257443:t[8]>546.5000000000001?ve=-.004385020865473831:ve=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?ve=.046278501133958524:ve=-.030835570926968044:t[0]>493.50000000000006?ve=-.12794504651610425:ve=.009415039807550776;let Se;t[304]>1e-35?Se=-.04717777269217453:t[76]>1e-35?Se=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Se=-.09648224457374217:t[132]>1e-35?Se=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Se=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Se=.10838431695638147:t[230]>1e-35?Se=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Se=.050071316251979:Se=-.006356941111525215:t[6]>8.500000000000002?Se=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Se=.10217402850540398:Se=-.048840949025349197:Se=-.03668313197909846:t[7]>39.50000000000001?Se=-.0562642841496003:t[10]>2.5000000000000004?Se=.09749777369987417:Se=-.04848223121417616:t[0]>5453.500000000001?Se=.08316648226133942:Se=-.0261979698267618:t[212]>1e-35?Se=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Se=.04837009746506856:Se=-.09184360565631328:Se=.0032411047845613606:t[0]>4733.500000000001?Se=.0977378556864798:Se=.010776545559325588:Se=-.012483310473120218:Se=-.049284121449103935:Se=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Se=-.08380361910948711:Se=.07375088778585813:Se=-.1084864186071348:Se=.0007819503469605476;let de;t[7]>17.500000000000004?t[115]>1e-35?de=.08741852531696623:t[167]>1e-35?de=.10078975495600809:de=-.0018324767784017562:t[290]>1e-35?de=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?de=.1379733311640402:de=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?de=-.09360083033774169:de=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?de=-.015599362579530679:t[0]>4593.500000000001?de=-.12029549262691491:de=-.018917032256501397:de=.04632831686576592:de=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?de=-.05894883236412263:de=.05213944998315824:de=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?de=.07577412405680808:de=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?de=-.0277076900736147:t[1]>65.50000000000001?de=-.023587471585763506:de=.10184896592433082:de=-.057699270527916825:de=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?de=.06566902102799584:t[10]>25.500000000000004?de=-.07033633753181047:de=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?de=-.08108035861059537:de=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?de=-.12431182772561139:de=.01886235886984271:de=.0025579594894418116;let te;t[8]>2915.5000000000005?t[101]>1e-35?te=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?te=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?te=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?te=.0687641681341721:t[10]>102.50000000000001?te=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?te=-.06762578396473291:t[10]>65.50000000000001?te=-.05226727783610509:t[282]>1e-35?te=.09911438410640917:t[19]>1e-35?te=.06915156336429933:te=-.006565637886508241:te=-.08344300251849307:te=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?te=.19428463865406298:te=.016073883020956765:t[13]>1e-35?te=.06864077097923665:te=-.01388867527034731:t[0]>1847.5000000000002?te=.004655280608161356:t[1]>40.50000000000001?te=.031406054057765996:te=.12798062439212832:te=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?te=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?te=-.0706095614785733:te=.04227164041372561:te=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?te=-.07139533369873902:te=.008952586782921625:te=.06086212582180936:te=-.0816938490403437:te=-.051224901945956025:te=-.10525399124186095:te=.000270924147208224;let Fe;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Fe=.029186512383291244:t[7]>1.5000000000000002?Fe=-.14984127276725573:t[1]>40.50000000000001?Fe=.032757060730648144:Fe=-.07675575422749602:t[6]>8.500000000000002?Fe=.10599766037117893:Fe=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Fe=-.051394622947855385:Fe=.03237141302699347:Fe=.12526173027943244:Fe=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Fe=-.07383912482657777:t[0]>5147.500000000001?Fe=.07008813937042091:t[10]>38.50000000000001?Fe=-.06779203808365307:Fe=-.013782769999524498:Fe=.0880038869117715:Fe=-.12846294176070952:t[281]>1e-35?Fe=-.06810806903850834:t[10]>227.50000000000003?Fe=-.08937977001661111:t[10]>130.50000000000003?Fe=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Fe=.011036530162093841:Fe=-.11500797478569702:Fe=.03702229366129399:Fe=.07242026683784307:t[189]>1e-35?Fe=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Fe=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Fe=-.02608892716555304:Fe=.09609599320761308:t[9]>105.50000000000001?Fe=-.06848127135991534:Fe=.0023675721254089715:t[86]>1e-35?Fe=-.11049635625500497:Fe=-.004847764219432233;let et;t[125]>1e-35?t[0]>3969.5000000000005?et=-.09462233499115416:et=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?et=-.030700661288166148:et=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?et=.03149547314036763:et=-.08166208257451366:t[0]>5850.500000000001?et=-.10228136324773157:t[102]>1e-35?et=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?et=.01782894842128785:t[13]>1e-35?et=.002680190260979968:et=.1773965720476949:t[2]>72.50000000000001?et=.09090831938627947:t[1]>59.50000000000001?et=-.12297206702816128:t[0]>4977.500000000001?et=.09899015653118268:et=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?et=-.0675900954187773:et=.012336403425364092:et=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?et=-.02671721777458802:et=-.09242452991958029:t[284]>1e-35?et=-.08585691288582491:et=.013332890564324447:t[4]>14.500000000000002?et=-.005245022074799553:t[23]>1e-35?et=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?et=-.09289852307936758:t[116]>1e-35?et=-.09686573010015055:t[8]>804.5000000000001?et=.03812547148215318:et=.005162744968176633:t[9]>43.50000000000001?et=-.059246106396159376:et=.050370113808135275:et=.000794041852811028;let Ht;t[3]>7.500000000000001?Ht=.0004981426543104341:t[9]>114.50000000000001?Ht=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Ht=-.019061766497948867:Ht=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Ht=-.006044199577160493:Ht=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Ht=.11486607015912494:t[9]>16.500000000000004?Ht=-.08686820858087294:Ht=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Ht=-.022230207980026437:Ht=.1056683690528792:Ht=-.05859530800943035:Ht=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Ht=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Ht=-.05177544573528314:Ht=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Ht=.15159657923771555:Ht=-.0060542654587671055:t[9]>5.500000000000001?Ht=-.042808028205051786:t[1]>48.50000000000001?Ht=-.010449538258110742:Ht=.10026907521968294:Ht=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Ht=-.02272452389409874:Ht=-.11202691218244319:t[5]>1809.5000000000002?Ht=-.04460413584255906:Ht=.08196329474205256:t[10]>69.50000000000001?Ht=.10221481166238167:Ht=.0004063052701699382:t[243]>1e-35?Ht=-.07563941678849846:t[18]>1e-35?Ht=.02563513231103432:Ht=-.004740081147303786;let mr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?mr=.057446442918106:mr=-.04404018270156349:mr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?mr=-.05930486238817954:t[1]>29.500000000000004?mr=.06955866121256543:t[8]>597.5000000000001?mr=-.06538593556505168:mr=.06212512595497445:mr=.00021102929959182257:t[9]>90.50000000000001?mr=.0958061289119631:t[102]>1e-35?mr=.07172059675638813:t[1]>47.50000000000001?mr=-.03879798603977766:t[297]>1e-35?mr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?mr=.003805910996312012:mr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?mr=.11252376801858695:t[288]>1e-35?mr=-.10293901912180432:mr=.014669268837893872:t[1]>42.50000000000001?mr=-.05988274123836837:t[145]>1e-35?mr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?mr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?mr=-.03366718308159971:mr=.11936550608549797:t[1]>31.500000000000004?mr=-.07454716789539667:mr=.027859650621164217:t[10]>10.500000000000002?mr=-.11806374092321247:mr=-.03506042229223101:mr=-.0007080765837654515:t[10]>6.500000000000001?mr=-.028077713664996503:t[2]>7.500000000000001?mr=.15803724124216814:mr=.0351381284833169:mr=-.07877953381054767;let or;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?or=.14144941521975005:or=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?or=.10514088112381886:t[7]>18.500000000000004?or=-.10370643555956745:or=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?or=-.0508129468802936:t[224]>1e-35?or=-.037816066368733595:t[10]>43.50000000000001?or=.07793408602607932:or=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?or=.036972453794202324:or=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?or=.09475302525132188:or=-.03580104945898193:or=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?or=-.1282448778804823:or=-.014395808269207212:or=-.008940927190750592:or=-.1459118815453748:t[0]>4897.500000000001?or=-.09733068457286576:t[1]>57.50000000000001?or=.06575271409540207:or=-.019556422817450115:or=-.10623959222984136:t[18]>1e-35?or=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?or=.008125645893104896:or=-.11084368630465868:or=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?or=-.05854904579626861:t[4]>5.500000000000001?or=.02985784951394175:or=-.03247600140149334:or=-.11152899295304973:or=-.00035424577714215764;let Nr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Nr=-.06563670567578264:Nr=.067656954313663:Nr=-.10388217548685377:t[8]>2302.5000000000005?Nr=.07190621943790435:t[4]>67.50000000000001?Nr=.060020507643618604:t[4]>38.50000000000001?Nr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Nr=-.06568134366461277:t[8]>1075.5000000000002?Nr=-.004768057709758692:Nr=.11785959165999467:Nr=-.05080221682879267:Nr=.14814206127494542:Nr=-.07241946332311736:t[253]>1e-35?Nr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Nr=-.02471195342450034:Nr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Nr=-.10741850739482771:Nr=.010051635824944:Nr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Nr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Nr=-.08992396138178163:Nr=.010944365997007212:Nr=.06221307021813793:Nr=.1286024087559141:t[127]>1e-35?Nr=.06568148624531012:t[10]>40.50000000000001?Nr=-.07567979134643352:t[5]>5647.500000000001?Nr=.07594672895572069:Nr=-.018158016446439187:t[6]>55.50000000000001?Nr=.009293422430111872:t[4]>45.50000000000001?Nr=-.017749818406964022:t[2]>46.50000000000001?Nr=.01714136511113982:Nr=-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 wm=BQs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+k+D+N+L+B+Q+M+O+q+F+U+W+V+G+Y+re+j+X+ie+we+Ae+De+Te+Z+J+z+le+K+ae+Me+ne+se+Ie+_e+Re+Je+Xe+Ct+Ot+$t+Gt+Ee+Qe+nt+mt+xe+He+Ze+at+ct+ut+ee+pe+ke+Le+Ve+tt+vt+Nt+Vt+It+Be+oe+ve+Se+de+te+Fe+et+Ht+mr+or+Nr+Hr+Gr+zt+_r);return[1-wm,wm]}a(Qzn,"multilineModelPredict");function BQs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(BQs,"sigmoid");var LQs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},qzn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function jzn(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(LQs[r]??[]).some(l=>s.includes(l))}a(jzn,"hasComment");var Oat=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=jzn(e,-2,r),this.rstripSecondToLastLineHasComment=jzn(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)}}catch{}l(null,s)},flush(s){try{r+=e.end(),r&&o(r.replace(/\r$/,"")),n>0&&t(n)}catch{}s()}})}a(P6s,"createCopilotUsageSniffer");function cWn(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(cWn,"extractErrorMessage");function k6s(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(k6s,"extractErrorCode");As();var UA=new Ee("ClaudeCodeAgent"),QA="ClaudeCodeAgentService";function D6s(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.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:oQ(e)}:{}}}a(D6s,"toAgentModelInfo");var SF=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(ra)}static{a(this,"ClaudeCodeAgentService")}async createSession(e){return this.runWithTelemetry("claudeCodeAgent.createSession",async r=>{await OVn(this.ctx,e);let n=e.sessionId??ir(),o=this._sessions.get(n);if(o)return UA.info(this.ctx,`${QA}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=Wn(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new Jke(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),UA.info(this.ctx,`${QA}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return this.runWithTelemetry("claudeCodeAgent.resumeSession",async r=>{await BVn(this.ctx,e);let{sessionId:n}=e,o=this._sessions.get(n);if(o)return UA.info(this.ctx,`${QA}.resumeSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="memory",r.properties.modelId=e.model??"",r.measurements.eventCount=0,{sessionId:n,workspacePath:o.cwd};let s=await this.sdkWrapper.getSessionInfo(n);if(!s?.cwd)throw new Error(`Session not found: ${n}`);let c=s.cwd,l=await this._ensureProxyConfig(),u=new Jke(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:c,model:e.model,isNewSession:!1,proxyConfig:l});this._sessions.set(n,u),UA.info(this.ctx,`${QA}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:c});let d;try{let f=await this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0});d=sWn(f),r.properties.transcriptOk="true"}catch(f){UA.warn(this.ctx,`${QA}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:f instanceof Error?f.message:String(f)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=f instanceof Error?f.name:"Unknown",d=void 0}return r.properties.reason="disk",r.properties.modelId=e.model??"",r.measurements.eventCount=d?.length??0,{sessionId:n,workspacePath:c,events:d}})}async sendMessage(e,r){return this.runWithTelemetry("claudeCodeAgent.sendMessage",async n=>{await LVn(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:ba(s.cwd)};await this.ctx.get(ag).applyPromptTemplateToRequest(e,[c]);let l=ir(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{UA.warn(this.ctx,`${QA}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),this.emit("claudeCodeAgent.sendMessage.failure",u,!1,{reason:"invoke"},void 0,d)}),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}})}async listSessions(e){return this.runWithTelemetry("claudeCodeAgent.listSessions",async r=>{QVn(this.ctx,e),UA.info(this.ctx,`${QA}.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 UA.info(this.ctx,`${QA}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return this.runWithTelemetry("claudeCodeAgent.listModels",async r=>{qVn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),UA.info(this.ctx,`${QA}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(lc).getMetadata()).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>THe(c.capabilities.family)).map(D6s);return UA.info(this.ctx,`${QA}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await this.runWithTelemetry("claudeCodeAgent.stopSession",async r=>{FVn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){UA.info(this.ctx,`${QA}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return this.runWithTelemetry("claudeCodeAgent.destroySession",r=>{UVn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),UA.info(this.ctx,`${QA}.destroySession`,{sessionId:n}),{success:!0}):(UA.info(this.ctx,`${QA}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return UA.error(this.ctx,`${QA}.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 this.runWithTelemetry("claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){UA.info(this.ctx,`${QA}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await Wke(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await this.runWithTelemetry("claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){UA.info(this.ctx,`${QA}.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}emit(e,r,n,o,s,c){let l={success:n?"true":"false",...o},u={totalTimeMs:performance.now()-r,...s};c!==void 0?gi(this.ctx,e,c,l,u):_t(this.ctx,e,l,u)}async runWithTelemetry(e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return this.flush(e,n,o),s}catch(s){throw o.error??=s,this.flush(e,n,o),s}}flush(e,r,n){n.error!==void 0?this.emit(`${e}.failure`,r,!1,n.properties,n.measurements,n.error):this.emit(e,r,n.ok??!0,n.properties,n.measurements)}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return UA.warn(this.ctx,`${QA}.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(){for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(kZ).start()}};p();var Ecr=new yn;function fWn(t){return[...t].sort((e,r)=>{let n=Ecr.get(e.uri)??0;return(Ecr.get(r.uri)??0)-n})}a(fWn,"sortByAccessTimes");var pWn=a(t=>t.get(an).onDidFocusTextDocument(e=>{e.document&&Ecr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var hWn=he(require("events"));var Jst="CompletionRequested",d5=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new hWn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Jst,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=km(this.ctx,e,`event.${Jst}`);return this.#e.on(Jst,r),qn.Disposable.create(()=>this.#e.off(Jst,r))}};p();p();var _cr=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?.()}},Zst=class extends _cr{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 db=class{constructor(e){this.ctx=e;this.#e=new Ee("AsyncCompletionManager");this.requests=new yn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(vcr(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 Zst;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 iA,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(vcr(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)vcr(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 vcr(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(vcr,"isCandidate");p();p();var Xke=class{constructor(e){this.maxSize=e;this.root=new Zke;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 Zke;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 Zke;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 Xke(100)}};p();var fb=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&&mWn(this.choices[0].completionText,n))return N6s(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 N6s(t,e){return t.filter(r=>mWn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(N6s,"adjustChoicesStart");function mWn(t,e){return t.startsWith(e)&&t.length>e.length}a(mWn,"startsWithAndExceeds");p();p();var TF={" ":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 gWn(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 q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.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 z;t[183]>1e-35?t[17]>1e-35?z=.030100940443356424:t[10]>1.5000000000000002?z=-.10861112216742408:z=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?z=-.032062878390325456:z=-.10808232631806887:t[8]>1641.5000000000002?z=-.06147013392655731:t[4]>12.500000000000002?z=.03324767551088266:t[145]>1e-35?z=.028851633810612017:z=-.054871239091792784:t[134]>1e-35?z=-.023813968121342108:t[266]>1e-35?z=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?z=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?z=-.025350325484720576:z=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?z=.056817276537534815:z=-.07674158463557636:z=-.06335553143454145:t[1]>56.50000000000001?z=.16390494217299284:z=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?z=.041717597065890205:z=-.10357913492269129:t[10]>29.500000000000004?z=.1365512866715726:z=.020600048310575665:z=.09708785634773187:z=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?z=-.03146213719547347:z=.11784024316238083:z=-.050940520532045355:z=-.047988344143075616:t[191]>1e-35?z=.028764654731460032:z=.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 $;t[8]>1014.5000000000001?t[9]>137.50000000000003?$=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?$=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?$=.07211107542565391:$=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?$=-.0751486415451188:t[1]>59.50000000000001?$=.13459005084554104:$=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?$=.06715575425741895:$=-.005895690393702183:t[8]>2915.5000000000005?$=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?$=-.00029068886245881074:$=.0613467393188786:t[148]>1e-35?$=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?$=.003887223773199377:$=-.08553893131979015:$=.025654192706396767:$=-.05651733979610658:$=-.02039913645229667:t[2]>7.500000000000001?$=-.1058450646728524:$=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?$=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?$=.1283258201586378:$=-.01718135372229775:$=-.07702452408491414:t[125]>1e-35?$=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?$=.04273051857848212:$=-.04533122948101463:t[2]>196.50000000000003?$=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?$=.0231032972703664:$=-.04807386814498683:$=.002729435991332102;let J;t[179]>1e-35?J=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?J=.026484626664041125:t[10]>1.5000000000000002?J=-.10187000872941615:J=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?J=.09574540795390041:J=-.06454986703691233:J=-.11411849349353141:t[266]>1e-35?J=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?J=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?J=-.04403391373512386:J=.1132928075412222:t[2]>47.50000000000001?J=-.09700191391838056:J=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?J=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?J=-.001668912999010927:J=-.02363511102970245:t[8]>58.50000000000001?J=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?J=.0911011436534449:t[1]>28.500000000000004?J=-.07192390493729035:J=.06913818091291246:J=-.012312625373699222:J=.06784496312307986:J=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?J=.0026564453057705273:J=-.025425772389361445:t[122]>1e-35?J=-.12046786388602149:t[0]>3183.5000000000005?J=.01162092842804907:t[91]>1e-35?J=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?J=-.0001647792543020228:J=-.023664538532907665:J=.01609078206180752;let ne;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ne=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ne=-.017696526862422682:ne=.1450050954613223:ne=-.05406930069823832:ne=-.08308700260259043:t[120]>1e-35?ne=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ne=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ne=.038431826961746934:ne=-.05937462906539856:t[9]>65.50000000000001?ne=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ne=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ne=-.09579030954062734:ne=.025064711572811746:ne=.02579440518821548:ne=.1044440128091862:ne=-.058348633139536844:ne=.07766788227934436:ne=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ne=.07463684068207214:ne=.18244269035484484:t[6]>39.50000000000001?ne=-.06050050067471004:ne=.05787759066913493:ne=.010783225857972171:ne=.1674891243602606:t[4]>9.500000000000002?ne=-.004814132027475892:ne=-.14543299413454813:ne=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ne=-.07634466313617769:ne=.0287825335169114:ne=-.06894721943300268:ne=-.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 ae;t[223]>1e-35?t[8]>668.5000000000001?ae=-.12803889879260094:ae=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ae=.08967966612917375:t[1]>39.50000000000001?ae=-.059791671514498074:ae=.05648934961902822:t[2]>59.50000000000001?ae=-.08633234097449628:t[6]>53.50000000000001?ae=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ae=.025606129643140924:ae=.13835395886271978:ae=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ae=-.09975506556937946:t[10]>36.50000000000001?ae=-.09427724661655643:t[10]>24.500000000000004?ae=.07329330653410447:ae=-.02271182965807972:ae=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ae=-.05082091374050816:ae=.1687114435254966:t[0]>2314.5000000000005?ae=-.06422664016383926:ae=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ae=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ae=-.1274167728754332:ae=.01308079126447365:t[4]>73.50000000000001?ae=.13854015371106546:t[4]>48.50000000000001?ae=-.03684255740123261:t[6]>45.50000000000001?ae=.10329912215813097:t[10]>77.50000000000001?ae=-.08630788656925215:ae=.031022006843800853:t[1]>25.500000000000004?ae=-.08278381528048026:ae=.06664374548141594:t[84]>1e-35?ae=-.05624227409079396:ae=.00012184182357340415;let Oe;t[179]>1e-35?Oe=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Oe=-.07595415373151816:Oe=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Oe=.022822510448266862:Oe=.17491569312933697:Oe=-.058362287133533565:t[2]>2.5000000000000004?Oe=-.03633895806364428:Oe=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Oe=-.07294848747514579:Oe=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Oe=-.07009535282685533:t[8]>2640.0000000000005?Oe=-.051761240111316276:t[131]>1e-35?Oe=-.06245774419231631:Oe=.03495606662854905:Oe=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Oe=.0015036626973581122:Oe=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Oe=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Oe=.022343994371919224:Oe=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Oe=.07724450228328664:t[0]>3853.5000000000005?Oe=-.15671707454435677:t[10]>28.500000000000004?Oe=-.10179090671841723:Oe=.014878216919760927:Oe=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Oe=.14054154485273487:Oe=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Oe=-.08632985141410315:Oe=.005524157938954954:Oe=-.08802502622523681:Oe=-.0004649168897260341;let ve;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ve=-.007458687464321174:ve=-.09444966249102484:t[1]>23.500000000000004?ve=.08564129697360716:ve=-.07105002902845851:ve=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ve=-.10326216566705966:t[1]>26.500000000000004?ve=.0050539832484585365:ve=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ve=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ve=.05783632021087773:t[10]>17.500000000000004?ve=-.06720598671764105:t[1]>47.50000000000001?ve=.097495825172558:ve=-.013372242800584872:ve=-.06463226787713715:t[42]>1e-35?ve=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ve=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ve=.11051270080118503:ve=.027719462817590454:t[8]>597.5000000000001?ve=-.08441503592016869:ve=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ve=-.12190088985091102:ve=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ve=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ve=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ve=.016585157185448045:ve=-.11032043771149425:ve=.01586986028570486:t[8]>388.50000000000006?ve=-.10592413013261853:ve=.04930703248769364:t[13]>1e-35?ve=.003621937787920821:ve=-.0013786331198611841;let Fe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Fe=.009769895322846493:Fe=-.10620052926943656:t[9]>19.500000000000004?Fe=.03781202525403449:t[9]>14.500000000000002?Fe=-.11485785321365344:t[9]>6.500000000000001?Fe=.07677177833073881:t[0]>4342.500000000001?Fe=-.07079285609687631:t[49]>1e-35?Fe=.06156814809246001:Fe=-.014788509042554625:Fe=-.032659201618470655:t[5]>5207.500000000001?Fe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Fe=-.03094160322187924:t[1]>29.500000000000004?Fe=.09474646043921069:Fe=.023445783928231618:Fe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Fe=-.07164443768784848:t[1]>29.500000000000004?Fe=.089473622509272:t[8]>597.5000000000001?Fe=-.08155349903101317:Fe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Fe=-.004003900679358653:t[190]>1e-35?Fe=-.09236113461485262:t[8]>3198.5000000000005?Fe=-.0124130160451179:Fe=.018453070064009328:t[15]>1e-35?Fe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Fe=-.0009580759587680961:Fe=-.03227283036698222:Fe=.01369287669536875:t[1]>50.50000000000001?Fe=-.04213060332500437:t[35]>1e-35?Fe=-.11508095777767471:t[190]>1e-35?Fe=-.08611884672400155:t[297]>1e-35?Fe=.05723551879433584:Fe=-.004829340082311461;let Pe;t[183]>1e-35?Pe=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Pe=-.11753465135886734:Pe=-.007515490299047085:Pe=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Pe=-.12371142493530439:t[1]>36.50000000000001?Pe=.032189417575190435:Pe=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Pe=-.0784518658439288:t[2]>54.50000000000001?Pe=.12477882322370665:Pe=.000313468482399738:Pe=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Pe=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Pe=.0353146070135579:Pe=-.06327619611098285:Pe=.02813577701641991:Pe=-.12354390728506215:t[34]>1e-35?Pe=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Pe=-.01245803535276381:Pe=-.07169472553475001:t[1]>11.500000000000002?Pe=.12989984824561698:Pe=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Pe=.010390226893521422:t[10]>14.500000000000002?Pe=.16790888126487719:Pe=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Pe=-.043398307129729134:Pe=.09963544907820426:t[9]>30.500000000000004?Pe=-.13540713124984502:t[9]>17.500000000000004?Pe=.0509435850590757:Pe=-.04761897852404613:t[4]>78.50000000000001?Pe=.09197086656470652:Pe=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.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 fe;t[189]>1e-35?t[0]>5269.500000000001?fe=-.103183298350443:t[2]>51.50000000000001?fe=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?fe=-.05186168947388339:fe=.0496996365539082:t[10]>23.500000000000004?fe=.1404445738719:t[93]>1e-35?fe=.0027146310074558505:t[5]>3821.5000000000005?fe=.002153033152069652:t[4]>2.5000000000000004?fe=.007663539551317215:fe=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?fe=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?fe=-.021479467709980358:fe=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?fe=.021660293256233334:fe=-.0927396152303864:fe=.0665074081601698:t[0]>1550.5000000000002?fe=.08972407105958534:fe=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?fe=.06761927942466854:fe=-.015762168112653286:t[17]>1e-35?fe=.10311304131145381:fe=-.017672785252336027:fe=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?fe=-.10638321435298535:fe=.0007073011744385905:t[18]>1e-35?fe=-.027056185501334325:t[145]>1e-35?fe=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?fe=.09762140519655171:t[9]>110.50000000000001?fe=-.06581942957595835:t[6]>54.50000000000001?fe=.04959634035251596:fe=.0022616298654554207:fe=-.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 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 ie;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ie=.08396556264106572:ie=-.0562516995099192:ie=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ie=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ie=.0052017514017035915:ie=-.11194119432743639:ie=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ie=-.025692451287403446:ie=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ie=-.11892250746801664:t[10]>22.500000000000004?ie=.07548493166973796:ie=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ie=.13750699058082427:t[18]>1e-35?ie=.06535408879552801:ie=-.054118179035040674:ie=.1344282838979622:t[0]>3982.5000000000005?ie=-.10409582202467015:t[19]>1e-35?ie=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ie=.012705935670766466:ie=.14149359442527545:ie=-.047977876173706004:t[20]>1e-35?ie=.057945228080337946:t[0]>3642.5000000000005?ie=-.008726535792122467:ie=-.08424769891378858:t[34]>1e-35?ie=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ie=.01196849566739346:ie=.1614642278429876:ie=-.043022338150701625:t[3]>5.500000000000001?ie=-.03907848255033881:ie=.018280601026175593:ie=.0006654540402589085;let le;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?le=-.01386103677247845:le=.11386694333005128:t[4]>27.500000000000004?le=-.021862617610091336:t[2]>31.500000000000004?le=.0828858469030438:le=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?le=.11303635767048735:le=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?le=-.04238798044549342:le=.022091190130494303:t[5]>5082.500000000001?le=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?le=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?le=-.04291104140431434:t[17]>1e-35?le=.11256797532342613:le=-.017206916368289193:le=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?le=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?le=.03581712466863222:le=.14770264307668884:t[8]>73.50000000000001?le=-.13093289429740068:le=.042461737442702936:t[52]>1e-35?le=.0501831919044939:le=-.010450249720465756:le=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?le=.0005381332165438493:le=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?le=.04849637311285226:le=-.036671377119808564:t[0]>421.50000000000006?le=.00020968499911058945:le=.11636422423182405:le=-.12687837788222575:le=.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 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 Et;t[115]>1e-35?Et=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Et=-.10131179514695865:t[8]>938.5000000000001?Et=.10203729808015481:Et=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Et=.03574015165562999:Et=-.07763042506449493:Et=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Et=.0665706259130275:Et=-.06586817559309924:Et=.11925564412287476:Et=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Et=.046017146627455346:Et=-.08623321630086885:t[8]>1765.5000000000002?Et=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Et=.11143827902215087:Et=-.01817808730473413:Et=.16980985030210127:Et=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Et=.010168994879727824:Et=-.09099594488792513:t[9]>1.5000000000000002?Et=.0533459678147928:Et=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Et=-.062346959148773695:t[1]>47.50000000000001?Et=-.0021578343835599316:t[2]>27.500000000000004?Et=.19567373210166172:Et=.07851555379116423:t[18]>1e-35?Et=.03711549097804649:t[8]>359.50000000000006?Et=.012492346746905587:t[4]>20.500000000000004?Et=.047511695735697544:Et=-.07999269063948773:Et=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 jt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?jt=.018337297491457794:jt=-.05926206443180149:jt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?jt=.10747078482128616:t[126]>1e-35?jt=-.10550625192391357:t[7]>71.50000000000001?jt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?jt=.1317396472229434:jt=-.025035791351328947:jt=-.0728334305864372:t[8]>963.5000000000001?jt=.023642201723096064:jt=.183010326734258:t[128]>1e-35?jt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?jt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?jt=-.1088876900335281:jt=.02758317023002635:jt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?jt=-.01928020117446408:jt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?jt=.07893723375925096:jt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?jt=-.10301657587280551:jt=.005787463140224318:jt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?jt=-.019296977889522397:jt=-.07274529751752634:t[1]>30.500000000000004?jt=-.050368901143148286:jt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?jt=.0015332402792773946:jt=.09930153676749967:jt=-.06370844564357069:jt=.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 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 de;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?de=.07554189644995735:de=-.052089349455904946:de=-.10148206848169845:t[113]>1e-35?de=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?de=.07172653627995676:de=-.07602959317610998:de=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?de=-.0399322883690891:de=.06523495517476098:de=-.10358715295743802:t[193]>1e-35?de=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?de=.015928764772252406:de=.1341513061552287:de=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?de=-.033592997607280156:de=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?de=-.08402551858097379:de=.017401984506038796:t[1]>25.500000000000004?de=.13337205393591278:de=-.01160208350090984:de=.06708317942315471:t[8]>227.50000000000003?de=-.08486943882418681:de=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?de=-.10496268177586783:de=-.020921489532370493:de=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?de=.11639296062157028:de=-.004275784356569115:t[32]>1e-35?de=-.07297384970166025:de=.006026841626381599:de=.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 Le;t[40]>1e-35?t[0]>1937.5000000000002?Le=-.06421671152073961:Le=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Le=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Le=-.03520420769287065:t[8]>1085.5000000000002?Le=-.019817352506127633:Le=.11444439424520964:Le=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Le=-.010490117519863269:Le=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Le=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Le=.06619344145920268:t[0]>4091.5000000000005?Le=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Le=.10016091391222309:Le=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Le=-.019511460451434884:Le=-.11643672465055221:t[2]>18.500000000000004?Le=.07848228087333317:t[8]>55.50000000000001?Le=.032583027899956235:Le=-.11209832692153521:t[11]>1e-35?Le=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Le=-.09996887746328006:t[9]>2.5000000000000004?Le=.02157682011863397:Le=-.05247727848991843:Le=.07409150201483244:t[1]>38.50000000000001?Le=-.11378466075449625:t[224]>1e-35?Le=-.10741749127732923:t[1]>26.500000000000004?Le=.07343136534146562:Le=-.07013573628594773:t[25]>1e-35?Le=-.04626669734164317:Le=.05518333197956482:Le=.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 Y;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?Y=-.07583539600416284:t[188]>1e-35?Y=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?Y=-.011038193049597113:Y=.08154028164397753:t[1]>85.50000000000001?Y=.10259361975201933:Y=.011640408330521594:Y=-.00023319159023748508:t[92]>1e-35?Y=.13771692859530546:Y=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?Y=.09967230141007705:t[30]>1e-35?Y=-.08888529037551285:Y=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?Y=.08284665960761373:Y=-.029292565021289504:t[7]>7.500000000000001?Y=-.09945093355204493:Y=-.008381393701708593:t[20]>1e-35?Y=-.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?Y=.07585582641438211:t[8]>284.50000000000006?Y=-.029387993239886723:Y=.07716738177321587:t[1]>18.500000000000004?Y=.026745348497993746:Y=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?Y=.02337306890530338:Y=-.10390355904767366:Y=.07390521199638532:Y=-.06788247515155237:Y=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?Y=-.06360325615644084:Y=.04342192339836601:Y=-.10598779152030145:Y=.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 pe;t[147]>1e-35?t[1]>53.50000000000001?pe=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?pe=-.02763546051134888:pe=.06423344777499343:pe=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?pe=.049825139823021586:t[7]>22.500000000000004?pe=-.01131680751379858:t[0]>2579.5000000000005?pe=-.10673674485369694:pe=-.015387212937189957:pe=.04347325151148724:t[179]>1e-35?pe=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.0650355590939066:pe=-.0473332870892226:pe=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?pe=.11139543329789044:t[126]>1e-35?pe=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?pe=.06370903833231022:t[10]>29.500000000000004?pe=.03415223859607161:t[10]>3.5000000000000004?pe=-.07415518117873297:pe=-.0014119203473324082:pe=.12617652343819508:t[9]>41.50000000000001?pe=-.10311145857176976:t[8]>2757.5000000000005?pe=-.08106484219011428:t[7]>71.50000000000001?pe=-.09783384432091176:t[1]>88.50000000000001?pe=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?pe=-.008884084501608536:pe=.061339437777743616:pe=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?pe=.01526664064166223:pe=.13534828515415498:pe=-.06985484465894776:pe=.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 Xe;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?Xe=-.10100794502567233:Xe=.08000205636470442:Xe=-.11945419826856896:t[113]>1e-35?Xe=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?Xe=.1224302423880318:Xe=-.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?Xe=.0019277012166729114:t[1]>28.500000000000004?Xe=-.054445821715687494:Xe=.045645722976713245:t[30]>1e-35?Xe=.13402660155331655:Xe=.008921176001777645:Xe=-.058547426505451076:Xe=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?Xe=-.13526418192218206:Xe=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?Xe=.0007263224246135398:Xe=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?Xe=-.11575657261278308:Xe=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?Xe=-.01995960178292952:Xe=.11216586049153021:Xe=-.10050961087149474:Xe=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Xe=.10303451081526649:Xe=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?Xe=-.043799548968209395:Xe=-.12451444314954115:t[4]>12.500000000000002?Xe=-.03838117361958468:Xe=.06504990789767144:t[57]>1e-35?Xe=.06890006938293915:Xe=.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 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 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 ge;t[7]>17.500000000000004?t[115]>1e-35?ge=.08741852531696623:t[167]>1e-35?ge=.10078975495600809:ge=-.0018324767784017562:t[290]>1e-35?ge=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ge=.1379733311640402:ge=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ge=-.09360083033774169:ge=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ge=-.015599362579530679:t[0]>4593.500000000001?ge=-.12029549262691491:ge=-.018917032256501397:ge=.04632831686576592:ge=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ge=-.05894883236412263:ge=.05213944998315824:ge=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ge=.07577412405680808:ge=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ge=-.0277076900736147:t[1]>65.50000000000001?ge=-.023587471585763506:ge=.10184896592433082:ge=-.057699270527916825:ge=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ge=.06566902102799584:t[10]>25.500000000000004?ge=-.07033633753181047:ge=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ge=-.08108035861059537:ge=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ge=-.12431182772561139:ge=.01886235886984271:ge=.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 $t;t[3]>7.500000000000001?$t=.0004981426543104341:t[9]>114.50000000000001?$t=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?$t=-.019061766497948867:$t=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?$t=-.006044199577160493:$t=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?$t=.11486607015912494:t[9]>16.500000000000004?$t=-.08686820858087294:$t=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?$t=-.022230207980026437:$t=.1056683690528792:$t=-.05859530800943035:$t=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?$t=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?$t=-.05177544573528314:$t=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?$t=.15159657923771555:$t=-.0060542654587671055:t[9]>5.500000000000001?$t=-.042808028205051786:t[1]>48.50000000000001?$t=-.010449538258110742:$t=.10026907521968294:$t=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?$t=-.02272452389409874:$t=-.11202691218244319:t[5]>1809.5000000000002?$t=-.04460413584255906:$t=.08196329474205256:t[10]>69.50000000000001?$t=.10221481166238167:$t=.0004063052701699382:t[243]>1e-35?$t=-.07563941678849846:t[18]>1e-35?$t=.02563513231103432:$t=-.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 sr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?sr=.14144941521975005:sr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?sr=.10514088112381886:t[7]>18.500000000000004?sr=-.10370643555956745:sr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?sr=-.0508129468802936:t[224]>1e-35?sr=-.037816066368733595:t[10]>43.50000000000001?sr=.07793408602607932:sr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?sr=.036972453794202324:sr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?sr=.09475302525132188:sr=-.03580104945898193:sr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?sr=-.1282448778804823:sr=-.014395808269207212:sr=-.008940927190750592:sr=-.1459118815453748:t[0]>4897.500000000001?sr=-.09733068457286576:t[1]>57.50000000000001?sr=.06575271409540207:sr=-.019556422817450115:sr=-.10623959222984136:t[18]>1e-35?sr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?sr=.008125645893104896:sr=-.11084368630465868:sr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?sr=-.05854904579626861:t[4]>5.500000000000001?sr=.02985784951394175:sr=-.03247600140149334:sr=-.11152899295304973:sr=-.00035424577714215764;let Nr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Nr=-.06563670567578264:Nr=.067656954313663:Nr=-.10388217548685377:t[8]>2302.5000000000005?Nr=.07190621943790435:t[4]>67.50000000000001?Nr=.060020507643618604:t[4]>38.50000000000001?Nr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Nr=-.06568134366461277:t[8]>1075.5000000000002?Nr=-.004768057709758692:Nr=.11785959165999467:Nr=-.05080221682879267:Nr=.14814206127494542:Nr=-.07241946332311736:t[253]>1e-35?Nr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Nr=-.02471195342450034:Nr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Nr=-.10741850739482771:Nr=.010051635824944:Nr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Nr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Nr=-.08992396138178163:Nr=.010944365997007212:Nr=.06221307021813793:Nr=.1286024087559141:t[127]>1e-35?Nr=.06568148624531012:t[10]>40.50000000000001?Nr=-.07567979134643352:t[5]>5647.500000000001?Nr=.07594672895572069:Nr=-.018158016446439187:t[6]>55.50000000000001?Nr=.009293422430111872:t[4]>45.50000000000001?Nr=-.017749818406964022:t[2]>46.50000000000001?Nr=.01714136511113982:Nr=-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 wm=M6s(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+q+Q+U+z+W+$+J+ne+H+re+ae+Oe+ve+Fe+Pe+Z+ee+K+fe+X+ue+qe+ie+le+Ne+we+Be+tt+st+Et+kt+Ht+jt+Ie+F+be+Ue+de+Se+Le+te+Te+Ge+Y+se+pe+Ce+He+$e+Xe+ct+bt+ht+We+ce+Re+Me+ge+oe+ze+at+$t+gr+sr+Nr+Hr+Gr+zt+_r);return[1-wm,wm]}a(gWn,"multilineModelPredict");function M6s(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(M6s,"sigmoid");var O6s={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},AWn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function yWn(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(O6s[r]??[]).some(l=>s.includes(l))}a(yWn,"hasComment");var Xst=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=yWn(e,-2,r),this.rstripSecondToLastLineHasComment=yWn(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]}},Ilr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Oat(e,n),this.suffixFeatures=new Oat(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(qzn).length+1).fill(0);r[qzn[this.language]??0]=1;let n=new Array(Object.keys(QF).length+1).fill(0);n[QF[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(QF).length+1).fill(0);o[QF[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(QF).length+1).fill(0);s[QF[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(QF).length+1).fill(0);return c[QF[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function FQs(t,e){return new Ilr(t.prefix,t.suffix,e)}a(FQs,"constructMultilineFeatures");function Hzn(t,e){let r=FQs(t,e).constructFeatures();return Qzn(r)[1]}a(Hzn,"requestMultilineScore");p();var xlr=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}},Bat=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 xlr(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 RGe(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=LWe(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 BA=class{static{a(this,"InlineCompletionManager")}};var Lat=new ge("getCompletions"),x2e="legacy",w2e=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","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 Fat(t,e,r){t.get(BA).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=Rpe(r.resultType),n.properties.completionsImplementation??=x2e,ht(t,o,n),gt(t,o,R9(n.properties,w2e),n.measurements)}a(Fat,"telemetryShown");function Gzn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=x2e,ht(t,n,r),gt(t,n,R9(r.properties,w2e),r.measurements)}a(Gzn,"telemetryAccepted");function $zn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=x2e,ht(t,n,r),gt(t,n,R9(r.properties,w2e),r.measurements)}a($zn,"telemetryRejected");function Jj(t,e={}){return t.properties.completionsImplementation??=x2e,{...e,telemetryBlob:t}}a(Jj,"mkCanceledResultTelemetry");function ap(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??x2e};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(ik).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(ap,"mkBasicResultTelemetry");function Vzn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=pl()-e.telemetryBlob.issuedTime,n=Rpe(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 Lat.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),goe(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Lat.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){ht(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}goe(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(Vzn,"handleGhostTextResultTelemetry");function Rpe(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(Rpe,"resultTypeToString");p();p();p();var UQs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},QQs="ms-vscode.cpptools",qQs="CppCompletionContextProvider";function Wzn(t,e,r,n){(e.includes(qQs)||e.length===1&&e[0]==="*")&&Yzn(t,r,n)}a(Wzn,"fillInCppVSActiveExperiments");function zzn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(QQs))&&Yzn(t,r,n)}a(zzn,"fillInCppVSCodeActiveExperiments");function Yzn(t,e,r){try{let n=UQs,o=t.get(Jt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Dr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Dr.exception(t,n,"fillInCppActiveExperiments")}}a(Yzn,"addActiveExperiments");p();function Uat(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 Dr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(Uat,"fillInCSharpActiveExperiments");p();var wlr="fallbackContextProvider",Rlr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function Kzn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(wlr))&&jQs(t,r,n)}a(Kzn,"fillInMultiLanguageActiveExperiments");function jQs(t,e,r){try{let n=HQs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Dr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(jQs,"addActiveExperiments");function HQs(t,e){let r=Rlr,n=t.get(Jt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Dr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(HQs,"getMultiLanguageContextProviderParamsFromExp");p();var GQs="typescript-ai-context-provider";function Jzn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(GQs)))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 Dr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(Jzn,"fillInTsActiveExperiments");p();Ns();var Zzn=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")]))}),Xzn=S.Intersect([S.Object({name:S.String(),value:S.String()}),Zzn]),eYn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),Zzn]),$Qs=[Xzn,eYn],VQs=S.Union($Qs),WQs=new Map([["Trait",Ou.Compile(Xzn)],["CodeSnippet",Ou.Compile(eYn)]]),zQs=a(t=>t,"ensureTypesAreEqual");zQs(!0);var YQs=S.Object({contextItems:S.Array(VQs)}),KQs=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())})]))}),klr=S.Object({id:S.String()}),JQs=S.Intersect([klr,KQs]),ZQs=S.Intersect([klr,YQs]),tYn=S.Object({providers:S.Array(JQs)}),rYn=S.Object({providers:S.Array(klr)}),Plr=S.Object({providers:S.Array(ZQs),updating:S.Optional(S.Array(S.String()))}),nYn=S.Intersect([vyn,S.Object({contextItems:S.Optional(Plr)})]);function Qat(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(Qat,"filterContextItemsByType");function iYn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of WQs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(iYn,"filterSupportedContextItems");function XQs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(XQs,"validateContextItemId");function oYn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??gr();if(!XQs(s)){let c=gr();Dr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=gr();Dr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(oYn,"addOrValidateContextItemsIDs");p();var r0=class{constructor(e=()=>new Dlr){this.createStatistics=e;this.statistics=new nn(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)}}},Dlr=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 qat(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(qat,"componentStatisticsToPromptMatcher");var sYn=ce(ti());var n0=class{static{a(this,"ContextProviderRegistry")}},S5=class{static{a(this,"DefaultContextProviders")}},kpe=class extends S5{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Nlr=class extends n0{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 Dr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;Uat(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 Dr.debug(this.ctx,"Resolving context providers cancelled"),[];zzn(this.ctx,h.map(T=>T[0].id),u,s),Kzn(this.ctx,h.map(T=>T[0].id),u,s),Jzn(this.ctx,h.map(T=>T[0].id),u,s);let g=new sYn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=lCe(this.ctx)&&!a6e(this.ctx)?0:eqs(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(r0).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await sln(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")tP(R.reason)||Dr.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")&&(Dr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);L3t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Dr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[k,D]=iYn(x);D&&Dr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=oYn(this.ctx,k),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(r0).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Dr.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=aYn(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}},Mlr=class extends n0{constructor(r){super();this.delegate=r;this._cachedContextItems=new nn(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 jat(t,e){return new Mlr(new Nlr(t,e))}a(jat,"getContextProviderRegistry");function Hat(t,e,r){let n=t.get(r0).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(Hat,"telemetrizeContextItems");function Gat(t){return t.matchScore>0&&t.resolution!=="error"}a(Gat,"matchContextItems");function aYn(t,e){let r=Olr(t,e),n=qt(t,je.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(S5).getIds();return Array.from(new Set([...o,...r,...n]))}a(aYn,"getActiveContextProviders");function Olr(t,e){return lCe(t)?["*"]:t.get(Jt).contextProviders(e)}a(Olr,"getExpContextProviders");function Ppe(t,e){return aYn(t,e).length>0}a(Ppe,"useContextProviderAPI");function eqs(t,e){let r=qt(t,je.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Jt).contextProviderTimeBudget(e)}a(eqs,"getContextProviderTimeBudget");var Cb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new nn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(n0),{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 $at=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 k7(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)}},Vat=class extends $at{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]}},Ccr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Xst(e,n),this.suffixFeatures=new Xst(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(AWn).length+1).fill(0);r[AWn[this.language]??0]=1;let n=new Array(Object.keys(TF).length+1).fill(0);n[TF[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(TF).length+1).fill(0);o[TF[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(TF).length+1).fill(0);s[TF[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(TF).length+1).fill(0);return c[TF[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function B6s(t,e){return new Ccr(t.prefix,t.suffix,e)}a(B6s,"constructMultilineFeatures");function EWn(t,e){let r=B6s(t,e).constructFeatures();return gWn(r)[1]}a(EWn,"requestMultilineScore");p();var bcr=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}},eat=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 bcr(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 rGe(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=iWe(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 qA=class{static{a(this,"InlineCompletionManager")}};var tat=new Ee("getCompletions"),e2e="legacy",t2e=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","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 rat(t,e,r){t.get(qA).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=spe(r.resultType),n.properties.completionsImplementation??=e2e,yt(t,o,n),_t(t,o,m9(n.properties,t2e),n.measurements)}a(rat,"telemetryShown");function _Wn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=e2e,yt(t,n,r),_t(t,n,m9(r.properties,t2e),r.measurements)}a(_Wn,"telemetryAccepted");function vWn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=e2e,yt(t,n,r),_t(t,n,m9(r.properties,t2e),r.measurements)}a(vWn,"telemetryRejected");function Nj(t,e={}){return t.properties.completionsImplementation??=e2e,{...e,telemetryBlob:t}}a(Nj,"mkCanceledResultTelemetry");function cp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??e2e};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(JR).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(cp,"mkBasicResultTelemetry");function CWn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=dl()-e.telemetryBlob.issuedTime,n=spe(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 tat.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),Xie(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(tat.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){yt(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}Xie(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(CWn,"handleGhostTextResultTelemetry");function spe(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(spe,"resultTypeToString");p();p();p();var L6s={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},F6s="ms-vscode.cpptools",U6s="CppCompletionContextProvider";function bWn(t,e,r,n){(e.includes(U6s)||e.length===1&&e[0]==="*")&&TWn(t,r,n)}a(bWn,"fillInCppVSActiveExperiments");function SWn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(F6s))&&TWn(t,r,n)}a(SWn,"fillInCppVSCodeActiveExperiments");function TWn(t,e,r){try{let n=L6s,o=t.get(Jt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Dr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Dr.exception(t,n,"fillInCppActiveExperiments")}}a(TWn,"addActiveExperiments");p();function nat(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 Dr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(nat,"fillInCSharpActiveExperiments");p();var Scr="fallbackContextProvider",Tcr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function IWn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Scr))&&Q6s(t,r,n)}a(IWn,"fillInMultiLanguageActiveExperiments");function Q6s(t,e,r){try{let n=q6s(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Dr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(Q6s,"addActiveExperiments");function q6s(t,e){let r=Tcr,n=t.get(Jt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Dr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(q6s,"getMultiLanguageContextProviderParamsFromExp");p();var j6s="typescript-ai-context-provider";function xWn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(j6s)))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 Dr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(xWn,"fillInTsActiveExperiments");p();As();var wWn=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")]))}),RWn=S.Intersect([S.Object({name:S.String(),value:S.String()}),wWn]),PWn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),wWn]),H6s=[RWn,PWn],G6s=S.Union(H6s),$6s=new Map([["Trait",Mu.Compile(RWn)],["CodeSnippet",Mu.Compile(PWn)]]),V6s=a(t=>t,"ensureTypesAreEqual");V6s(!0);var W6s=S.Object({contextItems:S.Array(G6s)}),z6s=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())})]))}),Icr=S.Object({id:S.String()}),Y6s=S.Intersect([Icr,z6s]),K6s=S.Intersect([Icr,W6s]),kWn=S.Object({providers:S.Array(Y6s)}),DWn=S.Object({providers:S.Array(Icr)}),xcr=S.Object({providers:S.Array(K6s),updating:S.Optional(S.Array(S.String()))}),NWn=S.Intersect([Kgn,S.Object({contextItems:S.Optional(xcr)})]);function iat(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(iat,"filterContextItemsByType");function MWn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of $6s.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(MWn,"filterSupportedContextItems");function J6s(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(J6s,"validateContextItemId");function OWn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??ir();if(!J6s(s)){let c=ir();Dr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=ir();Dr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(OWn,"addOrValidateContextItemsIDs");p();var r0=class{constructor(e=()=>new wcr){this.createStatistics=e;this.statistics=new yn(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)}}},wcr=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 oat(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(oat,"componentStatisticsToPromptMatcher");var BWn=he(ti());var n0=class{static{a(this,"ContextProviderRegistry")}},f5=class{static{a(this,"DefaultContextProviders")}},ape=class extends f5{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Rcr=class extends n0{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 Dr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;nat(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 Dr.debug(this.ctx,"Resolving context providers cancelled"),[];SWn(this.ctx,h.map(T=>T[0].id),u,s),IWn(this.ctx,h.map(T=>T[0].id),u,s),xWn(this.ctx,h.map(T=>T[0].id),u,s);let g=new BWn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=Q_e(this.ctx)&&!N8e(this.ctx)?0:Z6s(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(r0).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await ncn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")zP(R.reason)||Dr.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")&&(Dr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);t3t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Dr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[P,D]=MWn(x);D&&Dr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=OWn(this.ctx,P),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(r0).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Dr.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=LWn(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}},Pcr=class extends n0{constructor(r){super();this.delegate=r;this._cachedContextItems=new yn(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 sat(t,e){return new Pcr(new Rcr(t,e))}a(sat,"getContextProviderRegistry");function aat(t,e,r){let n=t.get(r0).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(aat,"telemetrizeContextItems");function cat(t){return t.matchScore>0&&t.resolution!=="error"}a(cat,"matchContextItems");function LWn(t,e){let r=kcr(t,e),n=Gt(t,Je.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(f5).getIds();return Array.from(new Set([...o,...r,...n]))}a(LWn,"getActiveContextProviders");function kcr(t,e){return Q_e(t)?["*"]:t.get(Jt).contextProviders(e)}a(kcr,"getExpContextProviders");function cpe(t,e){return LWn(t,e).length>0}a(cpe,"useContextProviderAPI");function Z6s(t,e){let r=Gt(t,Je.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Jt).contextProviderTimeBudget(e)}a(Z6s,"getContextProviderTimeBudget");var pb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new yn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(n0),{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 lat=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 A7(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)}},uat=class extends lat{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(lYn,"rewindToNearestNonWs");function cYn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(cYn,"indent");function rqs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=cYn(t,r),o=cYn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(rqs,"outdented");var T5=class extends $at{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&&Icn(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()}}},nqs={python:new T5("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 T5("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 T5("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 T5("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 Vat("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 Vat("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 T5("csharp",{},new Map([]),[],"block",null,!0),java:new T5("java",{},new Map([]),[],"block",null,!0),php:new T5("php",{},new Map([]),[],"block",null,!0),cpp:new T5("cpp",{},new Map([]),[],"block",null,!0)};function Blr(t){if(!AS(t))throw new Error(`Language ${t} is not supported`);return nqs[xGe(t)]}a(Blr,"getBlockParser");async function uYn(t,e,r){return AS(t)?Blr(t).isEmptyBlockStart(e,r):!1}a(uYn,"isEmptyBlockStart");async function dYn(t,e,r,n){if(AS(t))return Blr(t).isBlockBodyFinished(e,r,n)}a(dYn,"isBlockBodyFinished");async function fYn(t,e,r){if(AS(t))return Blr(t).getNodeStart(e,r)}a(fYn,"getNodeStart");var rxf=new ge("parseBlock");function R2e(t,e,r){let n=e.getText(Ll.range(Ll.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>dYn(s,n,c,o)}a(R2e,"parsingBlockFinished");function zat(t,e){return uYn(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(zat,"isEmptyBlockStartUtil");async function pYn(t,e,r,n){let s=e.getText(Ll.range(Ll.position(0,0),r))+n,c=await fYn(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(pYn,"getNodeStartUtil");var iqs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),oqs=new RegExp(`^(${iqs.join("|")})`);function sqs(t){return oqs.test(t.trimLeft().toLowerCase())}a(sqs,"isContinuationLine");function Wat(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Wat,"indentationOfLine");function Yat(t,e){let r=t.getText(),n=t.offsetAt(e);return Llr(r,n,t.detectedLanguageId)}a(Yat,"contextIndentation");function Llr(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(X6s,"getLineAtOffset");function UWn(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(UWn,"rewindToNearestNonWs");function FWn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(FWn,"indent");function e9s(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=FWn(t,r),o=FWn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(e9s,"outdented");var p5=class extends lat{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&&ban(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()}}},t9s={python:new p5("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 p5("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 p5("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 p5("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 uat("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 uat("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 p5("csharp",{},new Map([]),[],"block",null,!0),java:new p5("java",{},new Map([]),[],"block",null,!0),php:new p5("php",{},new Map([]),[],"block",null,!0),cpp:new p5("cpp",{},new Map([]),[],"block",null,!0)};function Dcr(t){if(!lS(t))throw new Error(`Language ${t} is not supported`);return t9s[eGe(t)]}a(Dcr,"getBlockParser");async function QWn(t,e,r){return lS(t)?Dcr(t).isEmptyBlockStart(e,r):!1}a(QWn,"isEmptyBlockStart");async function qWn(t,e,r,n){if(lS(t))return Dcr(t).isBlockBodyFinished(e,r,n)}a(qWn,"isBlockBodyFinished");async function jWn(t,e,r){if(lS(t))return Dcr(t).getNodeStart(e,r)}a(jWn,"getNodeStart");var mbf=new Ee("parseBlock");function r2e(t,e,r){let n=e.getText(au.range(au.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>qWn(s,n,c,o)}a(r2e,"parsingBlockFinished");function fat(t,e){return QWn(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(fat,"isEmptyBlockStartUtil");async function HWn(t,e,r,n){let s=e.getText(au.range(au.position(0,0),r))+n,c=await jWn(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(HWn,"getNodeStartUtil");var r9s=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),n9s=new RegExp(`^(${r9s.join("|")})`);function i9s(t){return n9s.test(t.trimLeft().toLowerCase())}a(i9s,"isContinuationLine");function dat(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(dat,"indentationOfLine");function pat(t,e){let r=t.getText(),n=t.offsetAt(e);return Ncr(r,n,t.detectedLanguageId)}a(pat,"contextIndentation");function Ncr(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=Wat(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=Wat(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=dat(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=dat(n[f]);if(h!==void 0&&h{let n=cqs(r,t,e);return n==="continue"?void 0:n}}a(hYn,"indentationBlockFinished");p();p();p();p();p();p();var lqs={tokenizerName:"o200k_base"};function uqs(t){return{...lqs,...t}}a(uqs,"cursorContextOptions");function k2e(t,e={}){let r=uqs(e),n=Ss(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&&o9s&&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=s9s(r,t,e);return n==="continue"?void 0:n}}a(GWn,"indentationBlockFinished");p();p();p();p();p();p();var a9s={tokenizerName:"o200k_base"};function c9s(t){return{...a9s,...t}}a(c9s,"cursorContextOptions");function n2e(t,e={}){let r=c9s(e),n=Ds(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(k2e,"getCursorContext");p();p();var dqs={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 mYn(t){let e=dqs[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(mYn,"announceSnippet");var Flr=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 Ulr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=mqs.get(e.languageId)??hqs}tokenize(e){return new Set(fqs(e).filter(r=>!this.stopsForLanguage.has(r)))}},gYn=new Flr(20),Dpe=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new Ulr(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=gYn.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 Ocr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=p9s.get(e.languageId)??f9s}tokenize(e){return new Set(u9s(e).filter(r=>!this.stopsForLanguage.has(r)))}},VWn=new Mcr(20),lpe=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new Ocr(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=VWn.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(fqs,"splitIntoWords");var pqs=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"]),hqs=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",...pqs]),mqs=new Map([]);p();function Kat(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 Kat(this.windowLength,e)}_getCursorContextInfo(e){return k2e(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return gqs(e,r)}};function gqs(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(gqs,"computeScore");p();var Zat=class t extends Dpe{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 Kat(this.windowLength,e)}_getCursorContextInfo(e){return k2e(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):k2e(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return Aqs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await k7(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 Aqs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(Aqs,"computeScore");var yqs=0,Eqs=60,_qs=4,Cqs=1,vqs=20,bqs=1e4,AYn={snippetLength:Eqs,threshold:yqs,maxTopSnippets:_qs,maxCharPerFile:bqs,maxNumberOfFiles:vqs,maxSnippetsPerFile:Cqs,useSubsetMatching:!1};var Qlr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Sqs(t,e){return(e.useSubsetMatching?Zat.FACTORY(e.snippetLength):Jat.FACTORY(e.snippetLength)).to(t)}a(Sqs,"getMatcher");async function yYn(t,e,r){let n=Sqs(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(yYn,"getSimilarSnippets");function EYn(t,e){return{...Qlr,useSubsetMatching:qlr(t,e)}}a(EYn,"getCppSimilarFilesOptions");function _Yn(t){return Qlr.maxTopSnippets}a(_Yn,"getCppNumberOfSnippets");var Tqs=new Map([["cpp",EYn]]);function Xat(t,e,r){let n=Tqs.get(r);return n?n(t,e):{...AYn,useSubsetMatching:qlr(t,e)}}a(Xat,"getSimilarFilesOptions");var Iqs=new Map([["cpp",_Yn]]);function CYn(t,e){let r=Iqs.get(e);return r?r(t):vcn}a(CYn,"getNumberOfSnippets");function qlr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||qt(t,je.UseSubsetMatching))??!1}a(qlr,"useSubsetMatching");p();p();p();p();var xqs="content_excluded";async function ect(t,e,r,n){let o=Qat(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(cn),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(r0).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,xqs]]),m}).map(f=>f.data)}a(ect,"getCodeSnippetsFromContextItems");function vYn(t,e){let r=t.get(cn);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(vYn,"addRelativePathToCodeSnippets");p();function cp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(cp,"Text");function Zj(t){return t.children}a(Zj,"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 p2(t){return{type:"f",children:t}}a(p2,"fragmentFunction");p2.isFragmentFunction=!0;var tct=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(vb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=vYn(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=$lr(c);return zn(p2,{children:[zn(YZ,{document:r,position:o,maxCharacters:m}),zn(ict,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(D2e,"CurrentFile");function YZ(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(YZ,"BeforeCursor");function ict(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=Ss(t.tokenizer),u=l.takeFirstTokens(s,P2e);u.tokens.length>0&&100*nct(u.tokens,l.takeFirstTokens(r,P2e).tokens)?.score<(t.suffixMatchThreshold??bGe)*u.tokens.length&&(c=r)}return c!==r&&n(c),zn(cp,{children:c})}a(ict,"AfterCursor");function bYn(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(vb,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=$lr(c);return zn(YZ,{document:r,position:o,maxCharacters:u})}a(bYn,"DocumentPrefix");function SYn(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(vb,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=$lr(c);return zn(ict,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(SYn,"DocumentSuffix");p();var oct=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 TYn(t){return t.map(e=>e.elidedValue).join("")}a(TYn,"makePrompt");function IYn(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(IYn,"makePrefixPrompt");function xYn(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(xYn,"makeContextPrompt");p();var Npe=class{constructor(e,r=Vlr()){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 Vlr(){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===Zj.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(Vlr,"defaultTransformers");p();var Wlr={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"]}},wYn={};for(let[t,e]of Object.entries(Wlr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)wYn[r]=t;else wYn[t]=t;var wqs={start:"//",end:""},Rqs=["php","plaintext"],zlr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function RYn(t){return Object.values(zlr).includes(t.trim())}a(RYn,"isShebangLine");function kqs({source:t}){return t.startsWith("#!")||t.startsWith("e.length>0)}a(u9s,"splitIntoWords");var d9s=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"]),f9s=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",...d9s]),p9s=new Map([]);p();function hat(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 hat(this.windowLength,e)}_getCursorContextInfo(e){return n2e(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return h9s(e,r)}};function h9s(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(h9s,"computeScore");p();var gat=class t extends lpe{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 hat(this.windowLength,e)}_getCursorContextInfo(e){return n2e(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):n2e(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return m9s(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await A7(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 m9s(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(m9s,"computeScore");var g9s=0,A9s=60,y9s=4,E9s=1,_9s=20,v9s=1e4,WWn={snippetLength:A9s,threshold:g9s,maxTopSnippets:y9s,maxCharPerFile:v9s,maxNumberOfFiles:_9s,maxSnippetsPerFile:E9s,useSubsetMatching:!1};var Bcr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function C9s(t,e){return(e.useSubsetMatching?gat.FACTORY(e.snippetLength):mat.FACTORY(e.snippetLength)).to(t)}a(C9s,"getMatcher");async function zWn(t,e,r){let n=C9s(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(zWn,"getSimilarSnippets");function YWn(t,e){return{...Bcr,useSubsetMatching:Lcr(t,e)}}a(YWn,"getCppSimilarFilesOptions");function KWn(t){return Bcr.maxTopSnippets}a(KWn,"getCppNumberOfSnippets");var b9s=new Map([["cpp",YWn]]);function Aat(t,e,r){let n=b9s.get(r);return n?n(t,e):{...WWn,useSubsetMatching:Lcr(t,e)}}a(Aat,"getSimilarFilesOptions");var S9s=new Map([["cpp",KWn]]);function JWn(t,e){let r=S9s.get(e);return r?r(t):Ean}a(JWn,"getNumberOfSnippets");function Lcr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Gt(t,Je.UseSubsetMatching))??!1}a(Lcr,"useSubsetMatching");p();p();p();p();var T9s="content_excluded";async function yat(t,e,r,n){let o=iat(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(an),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(r0).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,T9s]]),m}).map(f=>f.data)}a(yat,"getCodeSnippetsFromContextItems");function ZWn(t,e){let r=t.get(an);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(ZWn,"addRelativePathToCodeSnippets");p();function lp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(lp,"Text");function Mj(t){return t.children}a(Mj,"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 o2(t){return{type:"f",children:t}}a(o2,"fragmentFunction");o2.isFragmentFunction=!0;var Eat=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(hb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=ZWn(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(lp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(zn(lp,{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=qcr(c);return zn(o2,{children:[zn(DZ,{document:r,position:o,maxCharacters:m}),zn(Cat,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(o2e,"CurrentFile");function DZ(t){if(t.document===void 0||t.position===void 0)return zn(lp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),zn(lp,{children:e})}a(DZ,"BeforeCursor");function Cat(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return zn(lp,{});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(lp,{});if(r===s)return zn(lp,{children:r});let c=s;if(r!==""){let l=Ds(t.tokenizer),u=l.takeFirstTokens(s,i2e);u.tokens.length>0&&100*vat(u.tokens,l.takeFirstTokens(r,i2e).tokens)?.score<(t.suffixMatchThreshold??KHe)*u.tokens.length&&(c=r)}return c!==r&&n(c),zn(lp,{children:c})}a(Cat,"AfterCursor");function XWn(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(hb,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=qcr(c);return zn(DZ,{document:r,position:o,maxCharacters:u})}a(XWn,"DocumentPrefix");function ezn(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(hb,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=qcr(c);return zn(Cat,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(ezn,"DocumentSuffix");p();var bat=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 tzn(t){return t.map(e=>e.elidedValue).join("")}a(tzn,"makePrompt");function rzn(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(rzn,"makePrefixPrompt");function nzn(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(nzn,"makeContextPrompt");p();var upe=class{constructor(e,r=jcr()){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 jcr(){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===Mj.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(jcr,"defaultTransformers");p();var Hcr={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"]}},izn={};for(let[t,e]of Object.entries(Hcr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)izn[r]=t;else izn[t]=t;var I9s={start:"//",end:""},x9s=["php","plaintext"],Gcr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function ozn(t){return Object.values(Gcr).includes(t.trim())}a(ozn,"isShebangLine");function w9s({source:t}){return t.startsWith("#!")||t.startsWith("Pqs(s,e)).join(` +`).map(s=>R9s(s,e)).join(` `);return r?o+` -`:o}a(I5,"commentBlockAsSingles");function sct(t){let{languageId:e}=t;return Rqs.indexOf(e)===-1&&!kqs(t)?e in zlr?zlr[e]:`Language: ${e}`:""}a(sct,"getLanguageMarker");function act(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(act,"getPathMarker");function N2e(t){return t===""||t.endsWith(` +`:o}a(h5,"commentBlockAsSingles");function Sat(t){let{languageId:e}=t;return x9s.indexOf(e)===-1&&!w9s(t)?e in Gcr?Gcr[e]:`Language: ${e}`:""}a(Sat,"getLanguageMarker");function Tat(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Tat,"getPathMarker");function s2e(t){return t===""||t.endsWith(` `)?t:t+` -`}a(N2e,"newLineEnded");var Dqs=5,Mpe=class{constructor(){this.renderId=0;this.formatPrefix=TYn}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 oct,{blocks:[y,...E]}=A.elide(u,h,d,m,Ss(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(...Nqs([...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-Dqs: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 Npe(e,Ylr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===D2e.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:M2e(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:RYn(f.value)?y=A:y=I5(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:M2e(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${D2e.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}}},Ylr=[...Vlr(),(t,e,r)=>rct(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===YZ.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===ict.name?{...r,type:"suffix"}:r];function Nqs(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(Nqs,"computeComponentStatistics");function M2e(t){return t.replace(/\r\n?/g,` -`)}a(M2e,"normalizeLineEndings");p();var cct=a((t,e)=>{let[r,n]=e.useState();if(e.useData(vb,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get(cn),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(Mqs,{docInfo:c}):zn(Oqs,{docInfo:c})}},"DocumentMarker"),Mqs=a(t=>zn(cp,{children:act(t.docInfo)}),"PathMarker"),Oqs=a(t=>zn(cp,{children:sct(t.docInfo)}),"LanguageMarker");p();p();p();var OGs=ce(cX()),BGs=ce(B5()),_Jn=ce(ko()),LGs=ce(Rct());var L5=class extends _Jn.Disposable{static{a(this,"RecentEditsProvider")}};function FGs(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(FGs,"editIsTooCloseToCursor");var rlt=a((t,e)=>{let[r,n]=e.useState();return e.useData(vb,async o=>{if(!o.document)return;let s=t.ctx.get(L5);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get(cn),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(FGs(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(N2e(`File: ${T}`)+N2e(b))}}if(f.length===0){n(void 0);return}let h=N2e("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+N2e("End of recent edits");n(h)}),r?zn(Zj,{children:zn(cp,{children:r})}):void 0},"RecentEdits");p();p();p();var nlt=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>uX.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&ilt(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(Bzn(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 CJn(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(CJn,"shortCircuit");p();function QGs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(QGs,"defaultHash");function Zur(t,e={}){let{hash:r=QGs,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(Zur,"memoize");var vJn={entries:[],traits:[]},olt={entries:new Map,traits:[]},Xur=class extends nn{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=jGs?c=olt:c=void 0);let l=performance.now()-s;if(sm.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 slt;return c}a(SJn,"getRelatedFiles");var edr=Zur(SJn,{cache:bJn,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});edr=CJn(edr,200,olt);async function alt(t,e,r,n,o,s=!1){let c=t.get(dX),l=olt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await SJn(t,u,r,n,c):await edr(t,u,r,n,c)}catch(u){l=olt,u instanceof slt&&ht(t,"getRelatedFilesList",r)}return sm.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(alt,"getRelatedFilesAndTraits");function ilt(t,e){return kSe(t)===kSe(e)}a(ilt,"considerNeighborFile");var uX=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(cn);t.instance===void 0&&(t.instance=new nlt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(HGs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return sm.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 sm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await alt(e,f,o,s,c,l);return m.entries.size===0?(sm.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 HGs(t,e){return t.get(Jt).excludeRelatedFiles(e)||qt(t,je.ExcludeRelatedFiles)}a(HGs,"isExcludeRelatedFilesActive");function TJn(t,e){return t.get(Jt).includeNeighboringFiles(e)||qt(t,je.IncludeNeighboringFiles)}a(TJn,"isIncludeNeighborFilesActive");var clt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(vb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=uX.defaultEmptyResult();u.turnOffSimilarFiles||(d=await uX.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=ehe(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=>({...mYn(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||Xat(t.ctx,d,f.detectedLanguageId),y=t.ctx.get(cn).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await yYn(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),zn(p2,{children:[...o.map((u,d)=>zn(GGs,{snippet:u}))]})},"SimilarFiles"),GGs=a((t,e)=>zn(Zj,{children:[zn(cp,{children:t.snippet.headline}),zn(cp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var llt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(vb,c=>{c.traits!==r&&n(c.traits);let l=kSe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return zn(p2,{children:[zn(cp,{children:`Consider this related information: -`}),...r.map(c=>zn(cp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function IJn(t,e){return qt(t,je.UseSplitContextPrompt)??t.get(Jt).enablePromptContextProxyField(e)}a(IJn,"shouldUseSplitContextPrompt");function xJn(t){return zn(p2,{children:[zn(Hlr,{children:[zn(cct,{ctx:t,weight:.7}),zn(llt,{weight:.6}),zn(tct,{ctx:t,weight:.9}),zn(clt,{ctx:t,weight:.8})]}),zn(SYn,{weight:1}),zn(Glr,{children:zn(rlt,{ctx:t,weight:.99})}),zn(bYn,{weight:1})]})}a(xJn,"splitContextCompletionsPrompt");p();var wJn=0;function $Gs(){wJn=0}a($Gs,"resetContextIndex");function VGs(){return wJn++}a(VGs,"getNextContextIndex");var ult=class extends Mpe{constructor(){super(...arguments);this.formatPrefix=IYn;this.formatContext=xYn}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if($Gs(),new Npe(r,WGs).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===YZ.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:M2e(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:M2e(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 ${YZ.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}}},WGs=[...Ylr,(t,e,r)=>rct(t)?{...r,index:VGs()}:r];p();function dlt(t,e,r){let n=Qat(r,"Trait");for(let s of n)zGs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(dlt,"getTraitsFromContextItems");function zGs(t,e,r,n){let o=t.get(r0).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(zGs,"setupExpectationsForTraits");var YGs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function flt(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=YGs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return ht(e,t,l)}}a(flt,"ReportTraitsTelemetry");p();p();p();var plt=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}},hlt=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 mlt=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(KGs(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 rdr(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 tdr([])),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)}},tdr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},rdr=class{constructor(e){this.lifecycleData=e;this.stateHook=new plt(e.state),this.dataHook=new hlt(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 KGs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(KGs,"isFragmentFunction");var X2e=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new mlt(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 vb(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(vb,"isCompletionRequestData");var ndr={default:{promptFunction:RJn,renderer:Mpe},splitContext:{promptFunction:xJn,renderer:ult}};function RJn(t){return zn(p2,{children:[zn(jlr,{children:[zn(cct,{ctx:t,weight:.7}),zn(llt,{weight:.6}),zn(tct,{ctx:t,weight:.9}),zn(clt,{ctx:t,weight:.8}),zn(rlt,{ctx:t,weight:.99})]}),zn(D2e,{weight:1})]})}a(RJn,"defaultCompletionsPrompt");var glt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new X2e(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}=ehe(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 $F;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return $F;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 $F;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=oH(v.prefix),w={...v,prefix:b},R;if(Ppe(this.ctx,n)){let k=qat(v.metadata.componentStatistics);this.ctx.get(r0).getStatisticsForCompletion(e).computeMatch(k),R=Hat(this.ctx,e,y),Dr.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(Ppe(this.ctx,n)){c=await this.ctx.get(Cb).resolution(e);let{textDocument:f}=r,h=c.filter(Gat);ZGs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=dlt(this.ctx,e,h),flt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await ect(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 $F;if((await this.ctx.get(Cc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Elt;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 _s(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),the}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new X2e(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(ndr[this.promptOrdering]?.promptFunction??RJn)(this.ctx)}getRenderer(){let e=ndr[this.promptOrdering]??ndr.default;return new e.renderer}};function ZGs(t,e,r,n){let o=["cpp","c"];return TJn(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(ZGs,"similarFilesEnabled");p();p();p();var NJn=2e4,kJn=0,PJn=new nn;function MJn(t,e,r,n){kJn++;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=PJn?.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=Ss(o);m=uln(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),PJn.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:kJn,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(MJn,"renderWithMetadata");function OJn(t,e){return r=>{let n=r.text.join("")+` -`;return G0(e,n,()=>t.tokenLength(n)+1)}}a(OJn,"cachedLineCostFunction");function BJn(t,e,r){let o=t.split(` -`).map(f=>({id:uf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` -`),"");let c={id:uf(),text:s,children:o,canMerge:!0},u=JSe(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(BJn,"getLinewiseNode");var _lt=class{constructor(){this.name="basicPrefix";this.costCache=new nn(NJn)}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=Ss(n?.tokenizer),c=OJn(s,this.costCache);return{root:BJn(o,c,!1)}}},DJn={root:Q7,text:"",cost:0},Clt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new nn(5);this.costCache=new nn(NJn)}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 DJn;let l=this.cache.get(r.textDocument.uri)||DJn;if(l.text===c)return l;let u=this.ctx.get(Jt).suffixMatchThreshold(n);if(l.text!==""){let g=new rce,A=g.takeFirstTokens(c,P2e);if(A.tokens.length>0&&100*nct(A.tokens,g.takeFirstTokens(l.text,P2e).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},vlt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ss(n?.tokenizer);if(!r||r.traits.length===0)return{root:Q7};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=uf(),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(s2e,"newLineEnded");var P9s=5,dpe=class{constructor(){this.renderId=0;this.formatPrefix=tzn}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 bat,{blocks:[y,...E]}=A.elide(u,h,d,m,Ds(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(...k9s([...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-P9s: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 upe(e,$cr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===o2e.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:a2e(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:ozn(f.value)?y=A:y=h5(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:a2e(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${o2e.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}}},$cr=[...jcr(),(t,e,r)=>_at(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===DZ.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Cat.name?{...r,type:"suffix"}:r];function k9s(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(k9s,"computeComponentStatistics");function a2e(t){return t.replace(/\r\n?/g,` +`)}a(a2e,"normalizeLineEndings");p();var Iat=a((t,e)=>{let[r,n]=e.useState();if(e.useData(hb,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get(an),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(D9s,{docInfo:c}):zn(N9s,{docInfo:c})}},"DocumentMarker"),D9s=a(t=>zn(lp,{children:Tat(t.docInfo)}),"PathMarker"),N9s=a(t=>zn(lp,{children:Sat(t.docInfo)}),"LanguageMarker");p();p();p();var NQs=he($Z()),MQs=he(S5()),KYn=he(wo()),OQs=he(Wat());var T5=class extends KYn.Disposable{static{a(this,"RecentEditsProvider")}};function BQs(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(BQs,"editIsTooCloseToCursor");var _ct=a((t,e)=>{let[r,n]=e.useState();return e.useData(hb,async o=>{if(!o.document)return;let s=t.ctx.get(T5);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get(an),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(BQs(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(s2e(`File: ${T}`)+s2e(b))}}if(f.length===0){n(void 0);return}let h=s2e("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+s2e("End of recent edits");n(h)}),r?zn(Mj,{children:zn(lp,{children:r})}):void 0},"RecentEdits");p();p();p();var vct=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>WZ.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&Cct(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(fWn(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 JYn(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(JYn,"shortCircuit");p();function FQs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(FQs,"defaultHash");function zlr(t,e={}){let{hash:r=FQs,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(zlr,"memoize");var ZYn={entries:[],traits:[]},bct={entries:new Map,traits:[]},Ylr=class extends yn{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=QQs?c=bct:c=void 0);let l=performance.now()-s;if(sm.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 Sct;return c}a(eKn,"getRelatedFiles");var Klr=zlr(eKn,{cache:XYn,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});Klr=JYn(Klr,200,bct);async function Tct(t,e,r,n,o,s=!1){let c=t.get(zZ),l=bct;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await eKn(t,u,r,n,c):await Klr(t,u,r,n,c)}catch(u){l=bct,u instanceof Sct&&yt(t,"getRelatedFilesList",r)}return sm.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(Tct,"getRelatedFilesAndTraits");function Cct(t,e){return oSe(t)===oSe(e)}a(Cct,"considerNeighborFile");var WZ=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(an);t.instance===void 0&&(t.instance=new vct(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(qQs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return sm.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 sm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await Tct(e,f,o,s,c,l);return m.entries.size===0?(sm.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 qQs(t,e){return t.get(Jt).excludeRelatedFiles(e)||Gt(t,Je.ExcludeRelatedFiles)}a(qQs,"isExcludeRelatedFilesActive");function tKn(t,e){return t.get(Jt).includeNeighboringFiles(e)||Gt(t,Je.IncludeNeighboringFiles)}a(tKn,"isIncludeNeighborFilesActive");var Ict=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(hb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=WZ.defaultEmptyResult();u.turnOffSimilarFiles||(d=await WZ.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=kpe(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=>({...$Wn(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||Aat(t.ctx,d,f.detectedLanguageId),y=t.ctx.get(an).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await zWn(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),zn(o2,{children:[...o.map((u,d)=>zn(jQs,{snippet:u}))]})},"SimilarFiles"),jQs=a((t,e)=>zn(Mj,{children:[zn(lp,{children:t.snippet.headline}),zn(lp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var xct=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(hb,c=>{c.traits!==r&&n(c.traits);let l=oSe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return zn(o2,{children:[zn(lp,{children:`Consider this related information: +`}),...r.map(c=>zn(lp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function rKn(t,e){return Gt(t,Je.UseSplitContextPrompt)??t.get(Jt).enablePromptContextProxyField(e)}a(rKn,"shouldUseSplitContextPrompt");function nKn(t){return zn(o2,{children:[zn(Ucr,{children:[zn(Iat,{ctx:t,weight:.7}),zn(xct,{weight:.6}),zn(Eat,{ctx:t,weight:.9}),zn(Ict,{ctx:t,weight:.8})]}),zn(ezn,{weight:1}),zn(Qcr,{children:zn(_ct,{ctx:t,weight:.99})}),zn(XWn,{weight:1})]})}a(nKn,"splitContextCompletionsPrompt");p();var iKn=0;function HQs(){iKn=0}a(HQs,"resetContextIndex");function GQs(){return iKn++}a(GQs,"getNextContextIndex");var wct=class extends dpe{constructor(){super(...arguments);this.formatPrefix=rzn;this.formatContext=nzn}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(HQs(),new upe(r,$Qs).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===DZ.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:a2e(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:a2e(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 ${DZ.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}}},$Qs=[...$cr,(t,e,r)=>_at(t)?{...r,index:GQs()}:r];p();function Rct(t,e,r){let n=iat(r,"Trait");for(let s of n)VQs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Rct,"getTraitsFromContextItems");function VQs(t,e,r,n){let o=t.get(r0).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(VQs,"setupExpectationsForTraits");var WQs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Pct(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=WQs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return yt(e,t,l)}}a(Pct,"ReportTraitsTelemetry");p();p();p();var kct=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}},Dct=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 Nct=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(zQs(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 Zlr(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 Jlr([])),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)}},Jlr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},Zlr=class{constructor(e){this.lifecycleData=e;this.stateHook=new kct(e.state),this.dataHook=new Dct(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 zQs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(zQs,"isFragmentFunction");var I2e=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Nct(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 hb(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(hb,"isCompletionRequestData");var Xlr={default:{promptFunction:oKn,renderer:dpe},splitContext:{promptFunction:nKn,renderer:wct}};function oKn(t){return zn(o2,{children:[zn(Fcr,{children:[zn(Iat,{ctx:t,weight:.7}),zn(xct,{weight:.6}),zn(Eat,{ctx:t,weight:.9}),zn(Ict,{ctx:t,weight:.8}),zn(_ct,{ctx:t,weight:.99})]}),zn(o2e,{weight:1})]})}a(oKn,"defaultCompletionsPrompt");var Mct=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new I2e(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}=kpe(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 PF;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return PF;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 PF;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=qj(v.prefix),w={...v,prefix:b},R;if(cpe(this.ctx,n)){let P=oat(v.metadata.componentStatistics);this.ctx.get(r0).getStatisticsForCompletion(e).computeMatch(P),R=aat(this.ctx,e,y),Dr.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(cpe(this.ctx,n)){c=await this.ctx.get(pb).resolution(e);let{textDocument:f}=r,h=c.filter(cat);KQs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=Rct(this.ctx,e,h),Pct("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await yat(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 PF;if((await this.ctx.get(Ec).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Lct;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 La(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),Dpe}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new I2e(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(Xlr[this.promptOrdering]?.promptFunction??oKn)(this.ctx)}getRenderer(){let e=Xlr[this.promptOrdering]??Xlr.default;return new e.renderer}};function KQs(t,e,r,n){let o=["cpp","c"];return tKn(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(KQs,"similarFilesEnabled");p();p();p();var lKn=2e4,sKn=0,aKn=new yn;function uKn(t,e,r,n){sKn++;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=aKn?.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=Ds(o);m=acn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),aKn.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:sKn,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(uKn,"renderWithMetadata");function dKn(t,e){return r=>{let n=r.text.join("")+` +`;return G0(e,n,()=>t.tokenLength(n)+1)}}a(dKn,"cachedLineCostFunction");function fKn(t,e,r){let o=t.split(` +`).map(f=>({id:cf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` +`),"");let c={id:cf(),text:s,children:o,canMerge:!0},u=ISe(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(fKn,"getLinewiseNode");var Fct=class{constructor(){this.name="basicPrefix";this.costCache=new yn(lKn)}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=Ds(n?.tokenizer),c=dKn(s,this.costCache);return{root:fKn(o,c,!1)}}},cKn={root:I7,text:"",cost:0},Uct=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new yn(5);this.costCache=new yn(lKn)}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 cKn;let l=this.cache.get(r.textDocument.uri)||cKn;if(l.text===c)return l;let u=this.ctx.get(Jt).suffixMatchThreshold(n);if(l.text!==""){let g=new Fae,A=g.takeFirstTokens(c,i2e);if(A.tokens.length>0&&100*vat(A.tokens,g.takeFirstTokens(l.text,i2e).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Qct=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ds(n?.tokenizer);if(!r||r.traits.length===0)return{root:I7};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=cf(),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:uf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return KSe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},blt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ss(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:Q7};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;G0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get(cn);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:cf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return TSe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},qct=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ds(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:I7};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;G0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get(an);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=uf();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:uf(),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:uf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return KSe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},Slt=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!==Q7.id);if(o.length===0)return{root:Q7};let s=["",...Array(o.length-1).fill(` -`),""],c={id:uf(),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 XGs=.8,Tlt=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;Ppe(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}=ehe(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>XGs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=MJn(this.components[N],L,e,d);b=L-B.cost,h[N]=B,e$s(m,B.metadata)}let[T,w]=oH(h.prefix.text),R=performance.now(),x=Ppe(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],k=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:I5(k.join(` +`)],v=[];for(let b of A){let T=cf();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:cf(),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:cf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return TSe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},jct=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!==I7.id);if(o.length===0)return{root:I7};let s=["",...Array(o.length-1).fill(` +`),""],c={id:cf(),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 JQs=.8,Hct=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;cpe(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}=kpe(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>JQs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=uKn(this.components[N],L,e,d);b=L-B.cost,h[N]=B,ZQs(m,B.metadata)}let[T,w]=qj(h.prefix.text),R=performance.now(),x=cpe(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:h5(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?k: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(Cb).resolution(e),{textDocument:c}=r,l=s.filter(Gat),u=dlt(this.ctx,e,l);flt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await ect(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=qat(r);this.ctx.get(r0).getStatisticsForCompletion(e).computeMatch(o);let s=Hat(this.ctx,e,n);return Dr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return $F;if((await this.ctx.get(Cc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Elt;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),qn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),qn.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(D7(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=r$s){this.dispose();break}}await rx(this.config.UpdateInterval)}}};function FJn(t,e){let r=Pm(t,e,"event.WorkspaceContextUpdate");return t.get(E2).onUpdate(r)}a(FJn,"onWorkspaceContextUpdate");p();var Ilt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=Q7;this.disposables=[];this.rootWithPathCache=new nn;this.disposables.push(FJn(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=G0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:uf(),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(cn),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?I5(act(s),s.languageId):I5(sct(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:uf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=DM({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:uf(),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(pb).resolution(e),{textDocument:c}=r,l=s.filter(cat),u=Rct(this.ctx,e,l);Pct("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await yat(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=oat(r);this.ctx.get(r0).getStatisticsForCompletion(e).computeMatch(o);let s=aat(this.ctx,e,n);return Dr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return PF;if((await this.ctx.get(Ec).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Lct;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),qn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),qn.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(y7(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=eqs){this.dispose();break}}await KI(this.config.UpdateInterval)}}};function hKn(t,e){let r=km(t,e,"event.WorkspaceContextUpdate");return t.get(d2).onUpdate(r)}a(hKn,"onWorkspaceContextUpdate");p();var Gct=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=I7;this.disposables=[];this.rootWithPathCache=new yn;this.disposables.push(hKn(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=G0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:cf(),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(an),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?h5(Tat(s),s.languageId):h5(Sat(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:cf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=bM({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:cf(),text:[o,` -`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get(cn).getRelativePath({uri:e});return I5(`Related portions of ${o??e}: -`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var xlt=class extends Tlt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Ilt(e),prefix:new _lt,suffix:new Clt(e),volatileContext:new Slt("volatileContext",[new vlt,new blt(e)])};super(e,r)}};var UJn=ce(ti());var VF=class{static{a(this,"CompletionsPromptFactory")}};function wlt(t,e,r){return new idr(new odr(new sdr(t,new glt(t,e,r),new xlt(t),i$s)))}a(wlt,"createCompletionsPromptFactory");var idr=class extends VF{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 $F;try{return await this.delegate.prompt(r,n)}catch{return the}}},n$s=1200,odr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new UJn.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(QJn)},n$s)})])}},sdr=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 i$s(t,e){let r=t.get(E2);return r.isEnabled(e)&&r.isActive()}a(i$s,"workspaceContextEnabledAndActive");var Alt=10,ylt={type:"contextTooShort"},Elt={type:"copilotContentExclusion"},the={type:"promptError"},$F={type:"promptCancelled"},QJn={type:"promptTimeout"};function oH(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(oH,"trimLastLine");function rhe(t,e,r,n,o,s={}){let l=t.get(cn).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=s$s(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=IJn(t,n);return t.get(VF).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(rhe,"extractPrompt");function o$s(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:I5(n,e)}a(o$s,"addNeighboringCellsToPrompt");function s$s(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>o$s(l,r.document.detectedLanguageId)).join(` +`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get(an).getRelativePath({uri:e});return h5(`Related portions of ${o??e}: +`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var $ct=class extends Hct{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Gct(e),prefix:new Fct,suffix:new Uct(e),volatileContext:new jct("volatileContext",[new Qct,new qct(e)])};super(e,r)}};var mKn=he(ti());var kF=class{static{a(this,"CompletionsPromptFactory")}};function Vct(t,e,r){return new eur(new tur(new rur(t,new Mct(t,e,r),new $ct(t),rqs)))}a(Vct,"createCompletionsPromptFactory");var eur=class extends kF{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 PF;try{return await this.delegate.prompt(r,n)}catch{return Dpe}}},tqs=1200,tur=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new mKn.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(gKn)},tqs)})])}},rur=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 rqs(t,e){let r=t.get(d2);return r.isEnabled(e)&&r.isActive()}a(rqs,"workspaceContextEnabledAndActive");var Oct=10,Bct={type:"contextTooShort"},Lct={type:"copilotContentExclusion"},Dpe={type:"promptError"},PF={type:"promptCancelled"},gKn={type:"promptTimeout"};function qj(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(qj,"trimLastLine");function Npe(t,e,r,n,o,s={}){let l=t.get(an).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=iqs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=rKn(t,n);return t.get(kF).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Npe,"extractPrompt");function nqs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:h5(n,e)}a(nqs,"addNeighboringCellsToPrompt");function iqs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>nqs(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(s$s,"applyEditsForNotebook");function ehe(t,e,r){let o=t.get(Jt).maxPromptCompletionTokens(e)-FWe(t),s=CYn(e,r),c=Xat(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(ehe,"getPromptOptions");p();p();var qJn=2.98410452738298,jJn=-.838732736843507,HJn=1.50314646255716,GJn=-.237798634012662,Rlt={python:.314368072478742},$Jn={"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 a$s={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function c$s(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)}},adr=class{constructor(e,r,n){this.link=a$s;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 c$s(n,this.logitsToQuantiles)}},VJn=new adr(qJn,[new nhe("compCharLen",jJn,t=>Math.log(1+t)),new nhe("meanLogProb",HJn),new nhe("meanAlternativeLogProb",GJn)].concat(Object.entries(Rlt).map(t=>new nhe(t[0],t[1]))),$Jn);function WJn(t,e){let r={...e.measurements};return Object.keys(Rlt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),VJn.predict(t,r)}a(WJn,"ghostTextScoreConfidence");function zJn(t,e){let r={...e.measurements};return Object.keys(Rlt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),VJn.quantile(t,r)}a(zJn,"ghostTextScoreQuantile");p();function l$s(t,e,r,n){let o="}";try{o=Tcn(e.detectedLanguageId)??"}"}catch{}return u$s({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(l$s,"maybeSnipCompletion");function u$s(t,e,r,n){let o=d$s(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(u$s,"maybeSnipCompletionImpl");function d$s(t){let e=t.includes(`\r +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(iqs,"applyEditsForNotebook");function kpe(t,e,r){let o=t.get(Jt).maxPromptCompletionTokens(e)-oWe(t),s=JWn(e,r),c=Aat(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(kpe,"getPromptOptions");p();p();var AKn=2.98410452738298,yKn=-.838732736843507,EKn=1.50314646255716,_Kn=-.237798634012662,Wct={python:.314368072478742},vKn={"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 oqs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function sqs(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)}},nur=class{constructor(e,r,n){this.link=oqs;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 sqs(n,this.logitsToQuantiles)}},CKn=new nur(AKn,[new Mpe("compCharLen",yKn,t=>Math.log(1+t)),new Mpe("meanLogProb",EKn),new Mpe("meanAlternativeLogProb",_Kn)].concat(Object.entries(Wct).map(t=>new Mpe(t[0],t[1]))),vKn);function bKn(t,e){let r={...e.measurements};return Object.keys(Wct).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),CKn.predict(t,r)}a(bKn,"ghostTextScoreConfidence");function SKn(t,e){let r={...e.measurements};return Object.keys(Wct).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),CKn.quantile(t,r)}a(SKn,"ghostTextScoreQuantile");p();function aqs(t,e,r,n){let o="}";try{o=Can(e.detectedLanguageId)??"}"}catch{}return cqs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(aqs,"maybeSnipCompletion");function cqs(t,e,r,n){let o=lqs(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(cqs,"maybeSnipCompletionImpl");function lqs(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(d$s,"splitByNewLine");function f$s(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(YJn,"checkSuffix");var XJn=ce(IB());Ns();var sl=new ge("ghostText");var KJn=20;async function eZn(t,e,r,n,o,s,c){sl.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Wce(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:kcn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=qt(t,je.ModelAlwaysTerminatesSingleline)??t.get(Jt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&PM.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(HM).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:ap(r,t)}:E.type==="canceled"?(sl.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:Jj(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(P0(y))return{type:"canceled",reason:"network request aborted",telemetryData:Jj(r,{cancelledNetworkRequest:!0})};if(sl.exception(t,y,"Error on ghost text request"),t.get(lv).notifyUser(t,y),Eie(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:ap(r,t)}}}a(eZn,"genericGetCompletionsFromNetwork");function cdr(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(cdr,"postProcessChoices");async function h$s(t,e,r,n,o){return eZn(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return sl.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:ap(r,t)};if(n?.isCancellationRequested)return sl.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:Jj(r)};let f=d.value;if(f===void 0)return sl.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:ap(r,t)};rZn(t,"performance",f,s,c),sl.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=cdr(f,e);h&&(klt(t,e,h),sl.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;sl.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=cdr(A,e,g);y&&(g.push(y),klt(t,e,y))}})();return v1(t)&&await m,h?{type:"success",value:[ldr(h,{forceSingleLine:!1}),m],telemetryData:ap(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:ap(r,t)}})}a(h$s,"getCompletionsFromNetwork");async function m$s(t,e,r,n,o){return eZn(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return sl.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:Jj(r)};let f=cdr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)klt(t,e,d);rZn(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:ap(r,t),telemetryBlob:r,resultType:3}})}a(m$s,"getAllCompletionsFromNetwork");function ldr(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(lqs,"splitByNewLine");function uqs(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(TKn,"checkSuffix");var RKn=he(h9());As();var il=new Ee("ghostText");var IKn=20;async function PKn(t,e,r,n,o,s,c){il.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Tce(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:xan(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Gt(t,Je.ModelAlwaysTerminatesSingleline)??t.get(Jt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&CM.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(DM).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:cp(r,t)}:E.type==="canceled"?(il.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:Nj(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(k0(y))return{type:"canceled",reason:"network request aborted",telemetryData:Nj(r,{cancelledNetworkRequest:!0})};if(il.exception(t,y,"Error on ghost text request"),t.get(oC).notifyUser(t,y),rie(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:cp(r,t)}}}a(PKn,"genericGetCompletionsFromNetwork");function iur(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(iur,"postProcessChoices");async function fqs(t,e,r,n,o){return PKn(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return il.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:cp(r,t)};if(n?.isCancellationRequested)return il.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:Nj(r)};let f=d.value;if(f===void 0)return il.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:cp(r,t)};DKn(t,"performance",f,s,c),il.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=iur(f,e);h&&(zct(t,e,h),il.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;il.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=iur(A,e,g);y&&(g.push(y),zct(t,e,y))}})();return h1(t)&&await m,h?{type:"success",value:[our(h,{forceSingleLine:!1}),m],telemetryData:cp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:cp(r,t)}})}a(fqs,"getCompletionsFromNetwork");async function pqs(t,e,r,n,o){return PKn(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return il.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:Nj(r)};let f=iur(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)zct(t,e,d);DKn(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:cp(r,t),telemetryBlob:r,resultType:3}})}a(pqs,"getAllCompletionsFromNetwork");function our(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(ldr,"makeGhostAPIChoice");function JJn(t){return e=>{let r=e?.split(` +`)[0]}return r}a(our,"makeGhostAPIChoice");function xKn(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(JJn,"takeNLines");async function g$s(t,e,r,n,o,s,c,l){let u=t.get(Jt).multilineAfterAcceptLines(l),d=t.get(eP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:JJn(u),stop:[` +`).length}}a(xKn,"takeNLines");async function hqs(t,e,r,n,o,s,c,l){let u=t.get(Jt).multilineAfterAcceptLines(l),d=t.get(WP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:xKn(u),stop:[` -`],maxTokens:KJn*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await T$s(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=Ll.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...ZJn(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:JJn(u),stop:[` +`],maxTokens:IKn*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await bqs(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,...wKn(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:xKn(u),stop:[` -`],maxTokens:KJn*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...ZJn(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(g$s,"getGhostTextStrategy");function ZJn(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&PM.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Jt).longLookaheadSize(u):t.get(Jt).shortLookaheadSize(u);return{finishedCb:new Bat(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};klt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Jt).maxMultilineTokens(u)}}return{finishedCb:c?R2e(t,r,n):d=>{}}}a(ZJn,"buildFinishedCallback");var A$s={isCycling:!1,promptOnly:!1,isSpeculative:!1};function y$s(t,e,r){let n=qt(t,je.CompletionsDebounce)??t.get(Jt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=pl()-r.issuedTime;return Math.max(0,n-o)}a(y$s,"getRemainingDebounceMs");function tDe(t,e,r){return r?.isCancellationRequested||e!==t.get(_b).currentRequestId}a(tDe,"inlineCompletionRequestCancelled");async function E$s(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=pl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Jt);if(tDe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:ap(n,t)};let f=C$s(e.textDocument,e.position);if(f===void 0)return sl.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:ap(n,t)};let h=w7(t,n),m={...A$s,...s,tokenizer:h.tokenizer},g=await rhe(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return sl.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:ap(n,t)};if(g.type==="contextTooShort")return sl.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:ap(n,t)};if(g.type==="promptError")return sl.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:ap(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return sl.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:ap(n,t)};if(g.type==="promptTimeout")return sl.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:ap(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return sl.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:ap(n,t)};let A=y$s(t,m,n);return A>0&&(sl.debug(t,`Debouncing ghost text request for ${A}ms`),await rx(A),tDe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:ap(n,t)}:t.get(as).trackCompletionJob(async()=>{let[E]=oH(e.textDocument.getText(Ll.range(Ll.position(0,0),e.position))),_=t.get(_b).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await g$s(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=_$s(t,E,v,b.requestMultiline);u("cache");let w=R7(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:Yat(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=k$s(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Eb).shouldWaitForAsyncCompletions(E,g.prompt)){let q=await t.get(Eb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),q){let F=!b.requestMultiline;T=[[ldr(q[0],{forceSingleLine:F})],4]}if(tDe(t,r,o))return sl.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:ap(x,t)}}let k=b.blockMode==="moremultiline"&&PM.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(q=>eDe(t,e.textDocument,e.position,q,k,sl)).filter(q=>q!==void 0)),T!==void 0&&T[0].length===0)return sl.debug(t,`Found empty inline suggestions locally via ${Rpe(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:ap(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))sl.debug(t,`Found inline suggestions locally via ${Rpe(T[1])}`);else{if(m.isCycling){let q=await m$s(t,R,x,o,b.finishedCb);if(q.type==="success"){let F=T?.[0]??[];q.value[0].forEach(U=>{F.findIndex(W=>W.completionText.trim()===U.completionText.trim())===-1&&F.push(U)}),T=[F,3]}else if(T===void 0)return q}else{let q=a((V,G)=>(t.get(Eb).updateCompletion(r,V),b.finishedCb(V,G)),"finishedCb"),F=new qn.CancellationTokenSource,U=h$s(t,R,x,F.token,q);t.get(Eb).queueCompletionRequest(r,E,g.prompt,F,U);let W=await t.get(Eb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(W===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:ap(x,t)};T=[[W[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:ap(x,t)};let[D,N]=T,L=D.map(q=>eDe(t,e.textDocument,e.position,q,k,sl)).filter(q=>q!==void 0),B=qt(t,je.CompletionsDelay)??d.completionsDelay(n),Q=pl()-n.issuedTime,M=Math.max(B-Q,0);if(N!==2&&!m.isCycling&&M>0&&(sl.debug(t,`Waiting ${M}ms before returning completion`),await rx(M),tDe(t,r,o)))return sl.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:Jj(x)};let O=[];for(let q of L){let F=R$s(t,e.textDocument,R,q,x),U=f?YJn(e.textDocument,e.position,q):0,V={completion:I$s(q.choiceIndex,q.completionText,g.trailingWs),telemetry:F,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:q.copilotAnnotations,clientCompletionId:q.clientCompletionId};O.push(V)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,sl.debug(t,`Produced ${O.length} results from ${Rpe(N)} at ${x.measurements.foundOffset} offset`),tDe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:Jj(x)}:(m.isSpeculative||t.get(_b).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:ap(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(E$s,"getGhostTextWithoutAbortHandling");async function udr(t,e,r,n){let o=gr();t.get(_b).currentRequestId=o;let s=await w$s(t,e.textDocument,o,n);await SSe.catch(()=>{});try{return t.get(Cb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(b5).notifyRequest(e,o,s,r,n),await E$s(t,e,o,s,r,n)}catch(c){if(P0(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:Jj(s,{cancelledNetworkRequest:!0})};throw c}}a(udr,"getGhostText");function _$s(t,e,r,n){let o=t.get(_b).getCompletionsForUserTyping(e,r.suffix),s=x$s(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(_$s,"getLocalInlineSuggestion");function C$s(t,e){let r=v$s(e,t),n=b$s(e,t);return r&&!n?void 0:r&&n}a(C$s,"isInlineSuggestion");function v$s(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(v$s,"isMiddleOfTheLine");function b$s(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(b$s,"isValidMiddleOfTheLinePosition");function S$s(t,e){return e.lineAt(t).text.trim().length===0}a(S$s,"isNewLine");var WF=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function T$s(t,e,r,n,o,s,c){if(t.get(WF).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)ht(t,"ghostText.longFileMultilineSkip",jt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&PM.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await xcn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&S$s(n,r))return{requestMultiline:!0};let u=!1;return!o&&AS(r.detectedLanguageId)?u=await zat(r,n):o&&AS(r.detectedLanguageId)&&(u=await zat(r,n)||await zat(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=Hzn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(T$s,"shouldRequestMultiline");function klt(t,e,r){t.get(f2).append(e.prefix,e.prompt.suffix,r)}a(klt,"appendToCache");function I$s(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(I$s,"adjustLeadingWhitespace");function x$s(t,e,r,n){let o=t.get(f2).findAll(e,r);return o.length===0?(sl.debug(t,"Found no completions in cache"),[]):(sl.debug(t,`Found ${o.length} completions in cache`),o.map(s=>ldr(s,{forceSingleLine:!n})))}a(x$s,"getCompletionsFromCache");async function w$s(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=jt.createAndMarkAsIssued(o);return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(w$s,"createTelemetryWithExp");function R$s(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,tZn(u,e),u.extendWithRequestId(s),u.measurements.confidence=WJn(t,u),u.measurements.quantile=zJn(t,u),sl.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(R$s,"telemetryWithAddData");function k$s(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);tZn(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(Ll.range(h.range.start,n)),g=e.getText(Ll.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,XJn.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...hoe(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 ht(t,"ghostText.issued",_),d}a(k$s,"telemetryIssued");function tZn(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(tZn,"addDocumentTelemetry");function rZn(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),ht(t,`ghostText.${e}`,l)}a(rZn,"telemetryPerformance");p();p();var fX=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get(cn);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")}},Plt=class extends vT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var ddr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??qn.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=Nlt.indexOf(_);v!==-1&&Nlt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Nlt)_()}a(e,"afterUpdateConnection");function r(_){_2.connection!==_&&(_2.connection=_,e())}a(r,"updateConnection");function n(){return _2.connection==="connected"}a(n,"isConnected");function o(){return _2.connection==="disconnected"}a(o,"isDisconnected");function s(){return _2.connection==="retry"}a(s,"isRetrying");function c(){return _2.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(_){_2.initialWait!==_&&(_2.initialWait=_)}a(h,"setInitialWait");function m(_,v=P$s){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return _2.initialWait}a(g,"isInitialWait");async function A(_,v){bb.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(ar);function T(w,R){if(w>iZn){bb.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{_2.retryAttempts=Math.min(_2.retryAttempts+1,oZn);try{bb.info(R,`Pinging service after ${w} second(s)`);let k=await b.fetch(new URL("_ping",HB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(k.status!==200||!k.ok)T(w**2,R);else{bb.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),bb.info(_,"Attempting to reconnect."),T(fdr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Dlt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Dlt}a(D$s,"registerConnectionState");var hX=D$s();p();var Cg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},rDe={[Cg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Cg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Cg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function pdr(t){return t===401?Cg.Unauthorized:t===400?Cg.BadArguments:t===404?Cg.NotFound:t===429?Cg.RateLimit:t>=500&&t<600?Cg.InternalError:t>=600?Cg.ConnectionError:Cg.Unknown}a(pdr,"getErrorType");function F5(t,e,r={}){return{kind:"failure",reason:pdr(Number(t)),code:Number(t),msg:e,meta:r}}a(F5,"createErrorResponse");p();var N$s=/^[1-6][0-9][0-9]$/,M$s=/([A-Z][a-z]+)/,O$s="code_referencing",nDe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[O$s,this.baseKey,...e].join(".")}},hdr=class extends nDe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=jt.createAndMarkAsIssued();ht(e,r,n)}handleFocus({context:e}){let r=jt.createAndMarkAsIssued(),n=this.buildKey("focus","count");ht(e,n,r)}handleWrite({context:e}){let r=jt.createAndMarkAsIssued(),n=this.buildKey("write","count");ht(e,n,r)}},Z4f=new hdr,mdr=class extends nDe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=jt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");ht(e,o,n)}handleDismiss({context:e,actor:r}){let n=jt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");ht(e,o,n)}},X4f=new mdr,gdr=class extends nDe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=jt.createAndMarkAsIssued({origin:r,reason:n});Bm(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=jt.createAndMarkAsIssued({origin:r,reason:n});Bm(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(N$s)){bb.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(M$s).filter(l=>!!l).join("_").toLowerCase(),c=jt.createAndMarkAsIssued({message:o});Bm(e,this.buildKey(s,r),c)}},Mlt=new gdr;var B$s="twirp/github.snippy.v1.SnippyAPI";async function Adr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return hX.setDisconnected(),F5(401,rDe[Cg.Unauthorized])}if(bb.info(t,`Calling ${e}`),hX.isRetrying())return F5(600,"Attempting to reconnect to the public code matching service.");if(hX.isDisconnected())return F5(601,"The public code matching service is offline.");let s;try{s=await t.get(ar).fetch(LI(t,o,"origin-tracker",`${B$s}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...by(t)},signal:n})}catch{return hX.enableRetry(t),F5(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 Mlt.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=pdr(h),g=d||"unknown error";switch(m){case Cg.Unauthorized:return F5(u,rDe[Cg.Unauthorized],f);case Cg.BadArguments:return F5(u,g,f);case Cg.RateLimit:return hX.enableRetry(t,60*1e3),F5(u,rDe.RateLimitError,f);case Cg.InternalError:return hX.enableRetry(t),F5(u,rDe[Cg.InternalError],f);default:return F5(u,g,f)}}a(Adr,"call");p();var Olt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),F$s=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),sZn=S.Object({source:S.String()}),U$s=S.Object({snippets:S.Array(F$s)}),aZn=S.Union([U$s,Olt]),cZn=S.Object({cursor:S.String()}),Q$s=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),q$s=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),j$s=S.Object({count:S.Record(S.String(),S.String())}),H$s=S.Object({file_matches:S.Array(Q$s),page_info:q$s,license_stats:j$s}),lZn=S.Union([H$s,Olt]);async function uZn(t,e,r){let n=await Adr(t,"Match",{method:"POST",body:PY(sZn,{source:e})},r);return PY(aZn,n)}a(uZn,"Match");async function dZn(t,{cursor:e},r){let n=await Adr(t,"FilesForMatch",{method:"POST",body:PY(cZn,{cursor:e})},r);return PY(lZn,n)}a(dZn,"FilesForMatch");p();var iDe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Blt=65;function V$s(t){let e=0,r;iDe.lastIndex=0;do if(r=iDe.exec(t),r&&(e+=1),e>=Blt)break;while(r);return e}a(V$s,"lexemeLength");function W$s(t,e){let r=0,n;iDe.lastIndex=0;do if(n=iDe.exec(t),n&&(r+=1,r>=e))return iDe.lastIndex;while(n);return t.length}a(W$s,"offsetFirstLexemes");function fZn(t,e){let r=t.split("").reverse().join(""),n=W$s(r,e);return r.length-n}a(fZn,"offsetLastLexemes");function oDe(t){return V$s(t)>=Blt}a(oDe,"hasMinLexemeLength");function Y$s(t){return RM.Check(Olt,t)}a(Y$s,"isError");async function pZn(t,e){let r=await e();if(Y$s(r)){Mlt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(pZn,"snippyRequest");function hZn(t){return"kind"in t&&t.kind==="failure"}a(hZn,"isMatchError");async function mZn(t,e,r,n){let s=await t.get(cn).getTextDocument({uri:e});if(!s){bb.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!oDe(c)||!oDe(c))return;let l=r;if(!oDe(r)){let g=c.slice(0,n),A=fZn(g,Blt);l=c.slice(A,n+r.length)}if(!oDe(l))return;let u=await pZn(t,()=>uZn(t,l));if(!u||hZn(u)||!u.snippets.length){bb.info(t,"No match found");return}bb.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await pZn(t,()=>dZn(t,{cursor:g.cursor}));if(!A||hZn(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(mZn,"fetchCitations");p();function ydr(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(Z$s,"lexGeneratorWords");function gZn(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(gZn,"lexicalAnalyzer");function AZn(t){return t!==" "}a(AZn,"notSingleSpace");function yZn(t,e,r=Z$s){let[n,o]=gZn(t,K$s(),r,AZn),[s,c]=gZn(e,o,r,AZn);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=J$s(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=ydr(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(yZn,"lexEditDistance");p();function sH(t){return t.length===0?0:t.split(` -`).length}a(sH,"countLines");function EZn(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(EZn,"computeCompletionText");var aH=new ge("postInsertion"),_Zn=[{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}],CZn=50,X$s=1500,eVs=.5,tVs=500,Edr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function vZn(t,e,r,n,o){let s=await t.get(Jn).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return aH.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 rhe(t,r.properties.headerRequestId,pX(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=Llr(u,n,c.detectedLanguageId),y=hYn(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:tVs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(vZn,"captureCode");function Llt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{aH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),$zn(t,e,d)});let s=new fX(t,n,r-1),c=new fX(t,n,r),l=a(async u=>{aH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await vZn(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});aH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),ht(t,e+".capturedAfterRejected",A,1)},"checkInCode");_Zn.filter(u=>u.captureRejection).map(u=>s.push(Pm(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Llt,"postRejectionTasks");function sDe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});aH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),Gzn(t,e,u);let d=r;r=EZn(r,c);let f=r.trim(),h=new fX(t,o,n),m=new fX(t,o,n+r.length),g=a(async A=>{await oVs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Edr.triggerPostInsertionSynchroneously&&v1(t)){let A=g({seconds:0,captureCode:Edr.captureCode,captureRejection:Edr.captureRejection});t.get(_d).register(A)}else _Zn.map(A=>h.push(Pm(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));Pm(t,rVs,"post insertion citation check")(t,o,d,r,n,l)}a(sDe,"postInsertionTasks");async function rVs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(FI(t)?.getTokenValue("sn")==="1")return;await mZn(t,e,n,o);return}let c=await t.get(cn).getTextDocument({uri:e});if(c){let l=_dr(c.getText(),n,CZn,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=nVs(r.length,n.length,l.start_offset);if(u===void 0){aH.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+iVs(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(rVs,"citationCheck");function nVs(t,e,r){if(!(ee))return r}a(nVs,"computeCitationStart");function iVs(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(cVs,"computeRejectedCompletions");function Cdr(t,e){let r=t.get(FA);if(!r.position||!r.uri)return;let n=cVs(r);n.length>0&&Llt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Cdr,"rejectLastShown");function bZn(t,e,r,n){let o=t.get(FA);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Cdr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(bZn,"setLastShown");function SZn(t,e){let r=t.get(FA);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;aVs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Fat(t,"ghostText",e)}}a(SZn,"handleGhostTextShown");function lVs(t,e,r){let n=t.get(FA);n.linesLeft===void 0&&(n.linesAccepted=sH(e.insertText.substring(0,r)),n.linesLeft=sH(e.displayText));let o=sH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(lVs,"handleLineAcceptance");function ihe(t,e,r="ghostText"){let n=t.get(FA),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:sH(e.displayText)},n.resetState(),sDe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(ihe,"handleGhostTextPostInsert");function Flt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(FA),l;return s==="cumulative"?(uVs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(lVs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),sDe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(Flt,"handlePartialGhostTextPostInsert");function uVs(t,e,r){let n=t.get(FA);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=sH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(uVs,"handleCumulativeAcceptance");p();var U5=new Map;U5.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});U5.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});U5.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});U5.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});U5.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});U5.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var dVs=new ge("sdk");function Ult(t,e){U5.has(t.get(Lr).getEditorPluginInfo().name)||dVs.warn(t,...e)}a(Ult,"deprecationWarning");var QHi=ce(DL()),aI=ce(sP());p();p();p();p();var Qlt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function ohe(t,e){let r=jt.createAndMarkAsIssued({authType:e});ht(t,Qlt.NewGitHubLogin,r),gt(t,Qlt.NewGitHubLogin,{authType:e})}a(ohe,"telemetryNewGitHubLogin");function C2(t,e,r,n,o){gi(t,Qlt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(C2,"telemetryGitHubLoginResult");function aDe(t,e,r){gi(t,Qlt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(aDe,"telemetryCodeFlowError");var TZn=["repo","workflow"],vdr=class extends Ai{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function fVs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...by(t)},json:{client_id:e,scope:TZn.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(ar).fetch(s,n)}catch(c){throw c instanceof Error&&OI(c)?new Ai(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new Ai(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(fVs,"requestDeviceFlowStage1");async function pVs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...by(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(ar).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 vdr(c):new Ai(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(pVs,"requestDeviceFlowStage2");async function hVs(t,e){let n=await(await Td(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ai(`Error retrieving user information: ${String(n.errors)}`);return n}a(hVs,"requestUserInfo");var bT=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(Bp).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(Bp).githubAppId=n;let d=await this.save(u);return C2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{C2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw C2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(lv).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;ohe(n,"deviceFlow");let o=await fVs(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 pVs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await hVs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):TZn;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new Ai(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var bdr=ce(ti());p();var Uw=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var qlt="github.copilot.finishDeviceFlow",Sdr=class extends Uw{constructor(){super(...arguments);this.name=qlt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(bT),s=o.pendingSignIn;if(!s)throw new bdr.ResponseError(Ke.InvalidRequest,"No pending sign in");try{await this.ctx.get(N0).open(s.verificationUri)}catch(c){Jg.warn(this.ctx,"Failed to open",s.verificationUri),Jg.exception(this.ctx,c,qlt)}try{return await s.status}catch(c){throw new bdr.ResponseError(Ke.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},IZn=[Sdr];p();p();var vu=class extends nn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var cDe="github.copilot.didAcceptCompletionItem",Tdr=class extends Uw{constructor(){super(...arguments);this.name=cDe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(vu).get(n);return s?(ihe(this.ctx,s),!0):!1}},xZn=[Tdr];p();p();p();p();p();p();function wZn(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`],maxTokens:IKn*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...wKn(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(hqs,"getGhostTextStrategy");function wKn(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&CM.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Jt).longLookaheadSize(u):t.get(Jt).shortLookaheadSize(u);return{finishedCb:new eat(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};zct(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Jt).maxMultilineTokens(u)}}return{finishedCb:c?r2e(t,r,n):d=>{}}}a(wKn,"buildFinishedCallback");var mqs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function gqs(t,e,r){let n=Gt(t,Je.CompletionsDebounce)??t.get(Jt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=dl()-r.issuedTime;return Math.max(0,n-o)}a(gqs,"getRemainingDebounceMs");function w2e(t,e,r){return r?.isCancellationRequested||e!==t.get(fb).currentRequestId}a(w2e,"inlineCompletionRequestCancelled");async function Aqs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=dl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Jt);if(w2e(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:cp(n,t)};let f=Eqs(e.textDocument,e.position);if(f===void 0)return il.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:cp(n,t)};let h=m7(t,n),m={...mqs,...s,tokenizer:h.tokenizer},g=await Npe(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return il.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:cp(n,t)};if(g.type==="contextTooShort")return il.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:cp(n,t)};if(g.type==="promptError")return il.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:cp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return il.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:cp(n,t)};if(g.type==="promptTimeout")return il.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:cp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return il.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:cp(n,t)};let A=gqs(t,m,n);return A>0&&(il.debug(t,`Debouncing ghost text request for ${A}ms`),await KI(A),w2e(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:cp(n,t)}:t.get(os).trackCompletionJob(async()=>{let[E]=qj(e.textDocument.getText(au.range(au.position(0,0),e.position))),_=t.get(fb).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await hqs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=yqs(t,E,v,b.requestMultiline);u("cache");let w=g7(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:pat(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=wqs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(db).shouldWaitForAsyncCompletions(E,g.prompt)){let q=await t.get(db).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),q){let Q=!b.requestMultiline;T=[[our(q[0],{forceSingleLine:Q})],4]}if(w2e(t,r,o))return il.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:cp(x,t)}}let P=b.blockMode==="moremultiline"&&CM.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(q=>x2e(t,e.textDocument,e.position,q,P,il)).filter(q=>q!==void 0)),T!==void 0&&T[0].length===0)return il.debug(t,`Found empty inline suggestions locally via ${spe(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:cp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))il.debug(t,`Found inline suggestions locally via ${spe(T[1])}`);else{if(m.isCycling){let q=await pqs(t,R,x,o,b.finishedCb);if(q.type==="success"){let Q=T?.[0]??[];q.value[0].forEach(U=>{Q.findIndex(z=>z.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return q}else{let q=a((W,$)=>(t.get(db).updateCompletion(r,W),b.finishedCb(W,$)),"finishedCb"),Q=new qn.CancellationTokenSource,U=fqs(t,R,x,Q.token,q);t.get(db).queueCompletionRequest(r,E,g.prompt,Q,U);let z=await t.get(db).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(z===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:cp(x,t)};T=[[z[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:cp(x,t)};let[D,N]=T,L=D.map(q=>x2e(t,e.textDocument,e.position,q,P,il)).filter(q=>q!==void 0),B=Gt(t,Je.CompletionsDelay)??d.completionsDelay(n),j=dl()-n.issuedTime,M=Math.max(B-j,0);if(N!==2&&!m.isCycling&&M>0&&(il.debug(t,`Waiting ${M}ms before returning completion`),await KI(M),w2e(t,r,o)))return il.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:Nj(x)};let O=[];for(let q of L){let Q=xqs(t,e.textDocument,R,q,x),U=f?TKn(e.textDocument,e.position,q):0,W={completion:Sqs(q.choiceIndex,q.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:q.copilotAnnotations,clientCompletionId:q.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,il.debug(t,`Produced ${O.length} results from ${spe(N)} at ${x.measurements.foundOffset} offset`),w2e(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:Nj(x)}:(m.isSpeculative||t.get(fb).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:cp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(Aqs,"getGhostTextWithoutAbortHandling");async function sur(t,e,r,n){let o=ir();t.get(fb).currentRequestId=o;let s=await Iqs(t,e.textDocument,o,n);await X1e.catch(()=>{});try{return t.get(pb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(d5).notifyRequest(e,o,s,r,n),await Aqs(t,e,o,s,r,n)}catch(c){if(k0(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:Nj(s,{cancelledNetworkRequest:!0})};throw c}}a(sur,"getGhostText");function yqs(t,e,r,n){let o=t.get(fb).getCompletionsForUserTyping(e,r.suffix),s=Tqs(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(yqs,"getLocalInlineSuggestion");function Eqs(t,e){let r=_qs(e,t),n=vqs(e,t);return r&&!n?void 0:r&&n}a(Eqs,"isInlineSuggestion");function _qs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(_qs,"isMiddleOfTheLine");function vqs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(vqs,"isValidMiddleOfTheLinePosition");function Cqs(t,e){return e.lineAt(t).text.trim().length===0}a(Cqs,"isNewLine");var DF=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function bqs(t,e,r,n,o,s,c){if(t.get(DF).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)yt(t,"ghostText.longFileMultilineSkip",Vt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&CM.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await San(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&Cqs(n,r))return{requestMultiline:!0};let u=!1;return!o&&lS(r.detectedLanguageId)?u=await fat(r,n):o&&lS(r.detectedLanguageId)&&(u=await fat(r,n)||await fat(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=EWn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(bqs,"shouldRequestMultiline");function zct(t,e,r){t.get(i2).append(e.prefix,e.prompt.suffix,r)}a(zct,"appendToCache");function Sqs(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(Sqs,"adjustLeadingWhitespace");function Tqs(t,e,r,n){let o=t.get(i2).findAll(e,r);return o.length===0?(il.debug(t,"Found no completions in cache"),[]):(il.debug(t,`Found ${o.length} completions in cache`),o.map(s=>our(s,{forceSingleLine:!n})))}a(Tqs,"getCompletionsFromCache");async function Iqs(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(Iqs,"createTelemetryWithExp");function xqs(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,kKn(u,e),u.extendWithRequestId(s),u.measurements.confidence=bKn(t,u),u.measurements.quantile=SKn(t,u),il.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(xqs,"telemetryWithAddData");function wqs(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);kKn(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,RKn.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...Jie(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 yt(t,"ghostText.issued",_),d}a(wqs,"telemetryIssued");function kKn(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(kKn,"addDocumentTelemetry");function DKn(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),yt(t,`ghostText.${e}`,l)}a(DKn,"telemetryPerformance");p();p();var YZ=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get(an);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 gT=class{static{a(this,"CitationManager")}},Yct=class extends gT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var aur=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??qn.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=Jct.indexOf(_);v!==-1&&Jct.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Jct)_()}a(e,"afterUpdateConnection");function r(_){f2.connection!==_&&(f2.connection=_,e())}a(r,"updateConnection");function n(){return f2.connection==="connected"}a(n,"isConnected");function o(){return f2.connection==="disconnected"}a(o,"isDisconnected");function s(){return f2.connection==="retry"}a(s,"isRetrying");function c(){return f2.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(_){f2.initialWait!==_&&(f2.initialWait=_)}a(h,"setInitialWait");function m(_,v=Rqs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return f2.initialWait}a(g,"isInitialWait");async function A(_,v){mb.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(fr);function T(w,R){if(w>MKn){mb.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{f2.retryAttempts=Math.min(f2.retryAttempts+1,OKn);try{mb.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",kB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{mb.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),mb.info(_,"Attempting to reconnect."),T(cur,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Kct={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Kct}a(Pqs,"registerConnectionState");var JZ=Pqs();p();var bg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},R2e={[bg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[bg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[bg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function lur(t){return t===401?bg.Unauthorized:t===400?bg.BadArguments:t===404?bg.NotFound:t===429?bg.RateLimit:t>=500&&t<600?bg.InternalError:t>=600?bg.ConnectionError:bg.Unknown}a(lur,"getErrorType");function I5(t,e,r={}){return{kind:"failure",reason:lur(Number(t)),code:Number(t),msg:e,meta:r}}a(I5,"createErrorResponse");p();var kqs=/^[1-6][0-9][0-9]$/,Dqs=/([A-Z][a-z]+)/,Nqs="code_referencing",P2e=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[Nqs,this.baseKey,...e].join(".")}},uur=class extends P2e{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Vt.createAndMarkAsIssued();yt(e,r,n)}handleFocus({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("focus","count");yt(e,n,r)}handleWrite({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("write","count");yt(e,n,r)}},dNf=new uur,dur=class extends P2e{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");yt(e,o,n)}handleDismiss({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");yt(e,o,n)}},fNf=new dur,fur=class extends P2e{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});Bm(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});Bm(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(kqs)){mb.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(Dqs).filter(l=>!!l).join("_").toLowerCase(),c=Vt.createAndMarkAsIssued({message:o});Bm(e,this.buildKey(s,r),c)}},Zct=new fur;var Mqs="twirp/github.snippy.v1.SnippyAPI";async function pur(t,e,r,n){let o;try{o=await t.get(Ut).getToken()}catch{return JZ.setDisconnected(),I5(401,R2e[bg.Unauthorized])}if(mb.info(t,`Calling ${e}`),JZ.isRetrying())return I5(600,"Attempting to reconnect to the public code matching service.");if(JZ.isDisconnected())return I5(601,"The public code matching service is offline.");let s;try{s=await t.get(fr).fetch(kI(t,o,"origin-tracker",`${Mqs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...wy(t)},signal:n})}catch{return JZ.enableRetry(t),I5(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Ut).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw Zct.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=lur(h),g=d||"unknown error";switch(m){case bg.Unauthorized:return I5(u,R2e[bg.Unauthorized],f);case bg.BadArguments:return I5(u,g,f);case bg.RateLimit:return JZ.enableRetry(t,60*1e3),I5(u,R2e.RateLimitError,f);case bg.InternalError:return JZ.enableRetry(t),I5(u,R2e[bg.InternalError],f);default:return I5(u,g,f)}}a(pur,"call");p();var Xct=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),Bqs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),BKn=S.Object({source:S.String()}),Lqs=S.Object({snippets:S.Array(Bqs)}),LKn=S.Union([Lqs,Xct]),FKn=S.Object({cursor:S.String()}),Fqs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),Uqs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),Qqs=S.Object({count:S.Record(S.String(),S.String())}),qqs=S.Object({file_matches:S.Array(Fqs),page_info:Uqs,license_stats:Qqs}),UKn=S.Union([qqs,Xct]);async function QKn(t,e,r){let n=await pur(t,"Match",{method:"POST",body:pY(BKn,{source:e})},r);return pY(LKn,n)}a(QKn,"Match");async function qKn(t,{cursor:e},r){let n=await pur(t,"FilesForMatch",{method:"POST",body:pY(FKn,{cursor:e})},r);return pY(UKn,n)}a(qKn,"FilesForMatch");p();var k2e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),elt=65;function Gqs(t){let e=0,r;k2e.lastIndex=0;do if(r=k2e.exec(t),r&&(e+=1),e>=elt)break;while(r);return e}a(Gqs,"lexemeLength");function $qs(t,e){let r=0,n;k2e.lastIndex=0;do if(n=k2e.exec(t),n&&(r+=1,r>=e))return k2e.lastIndex;while(n);return t.length}a($qs,"offsetFirstLexemes");function jKn(t,e){let r=t.split("").reverse().join(""),n=$qs(r,e);return r.length-n}a(jKn,"offsetLastLexemes");function D2e(t){return Gqs(t)>=elt}a(D2e,"hasMinLexemeLength");function Wqs(t){return _M.Check(Xct,t)}a(Wqs,"isError");async function HKn(t,e){let r=await e();if(Wqs(r)){Zct.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(HKn,"snippyRequest");function GKn(t){return"kind"in t&&t.kind==="failure"}a(GKn,"isMatchError");async function $Kn(t,e,r,n){let s=await t.get(an).getTextDocument({uri:e});if(!s){mb.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!D2e(c)||!D2e(c))return;let l=r;if(!D2e(r)){let g=c.slice(0,n),A=jKn(g,elt);l=c.slice(A,n+r.length)}if(!D2e(l))return;let u=await HKn(t,()=>QKn(t,l));if(!u||GKn(u)||!u.snippets.length){mb.info(t,"No match found");return}mb.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await HKn(t,()=>qKn(t,{cursor:g.cursor}));if(!A||GKn(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(gT).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($Kn,"fetchCitations");p();function hur(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(Kqs,"lexGeneratorWords");function VKn(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(VKn,"lexicalAnalyzer");function WKn(t){return t!==" "}a(WKn,"notSingleSpace");function zKn(t,e,r=Kqs){let[n,o]=VKn(t,zqs(),r,WKn),[s,c]=VKn(e,o,r,WKn);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=Yqs(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=hur(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(zKn,"lexEditDistance");p();function jj(t){return t.length===0?0:t.split(` +`).length}a(jj,"countLines");function YKn(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(YKn,"computeCompletionText");var Hj=new Ee("postInsertion"),KKn=[{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}],JKn=50,Jqs=1500,Zqs=.5,Xqs=500,mur={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function ZKn(t,e,r,n,o){let s=await t.get(ni).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return Hj.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 Npe(t,r.properties.headerRequestId,KZ(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=Ncr(u,n,c.detectedLanguageId),y=GWn(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:Xqs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(ZKn,"captureCode");function tlt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{Hj.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),vWn(t,e,d)});let s=new YZ(t,n,r-1),c=new YZ(t,n,r),l=a(async u=>{Hj.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await ZKn(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});Hj.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),yt(t,e+".capturedAfterRejected",A,1)},"checkInCode");KKn.filter(u=>u.captureRejection).map(u=>s.push(km(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(tlt,"postRejectionTasks");function N2e(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});Hj.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),_Wn(t,e,u);let d=r;r=YKn(r,c);let f=r.trim(),h=new YZ(t,o,n),m=new YZ(t,o,n+r.length),g=a(async A=>{await njs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(mur.triggerPostInsertionSynchroneously&&h1(t)){let A=g({seconds:0,captureCode:mur.captureCode,captureRejection:mur.captureRejection});t.get(_d).register(A)}else KKn.map(A=>h.push(km(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));km(t,ejs,"post insertion citation check")(t,o,d,r,n,l)}a(N2e,"postInsertionTasks");async function ejs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(DI(t)?.getTokenValue("sn")==="1")return;await $Kn(t,e,n,o);return}let c=await t.get(an).getTextDocument({uri:e});if(c){let l=gur(c.getText(),n,JKn,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=tjs(r.length,n.length,l.start_offset);if(u===void 0){Hj.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+rjs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(gT).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(ejs,"citationCheck");function tjs(t,e,r){if(!(ee))return r}a(tjs,"computeCitationStart");function rjs(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(sjs,"computeRejectedCompletions");function Aur(t,e){let r=t.get(HA);if(!r.position||!r.uri)return;let n=sjs(r);n.length>0&&tlt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Aur,"rejectLastShown");function XKn(t,e,r,n){let o=t.get(HA);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Aur(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(XKn,"setLastShown");function eJn(t,e){let r=t.get(HA);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;ojs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,rat(t,"ghostText",e)}}a(eJn,"handleGhostTextShown");function ajs(t,e,r){let n=t.get(HA);n.linesLeft===void 0&&(n.linesAccepted=jj(e.insertText.substring(0,r)),n.linesLeft=jj(e.displayText));let o=jj(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(ajs,"handleLineAcceptance");function Ope(t,e,r="ghostText"){let n=t.get(HA),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:jj(e.displayText)},n.resetState(),N2e(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Ope,"handleGhostTextPostInsert");function rlt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(HA),l;return s==="cumulative"?(cjs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(ajs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),N2e(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(rlt,"handlePartialGhostTextPostInsert");function cjs(t,e,r){let n=t.get(HA);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=jj(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(cjs,"handleCumulativeAcceptance");p();var x5=new Map;x5.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});x5.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});x5.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});x5.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});x5.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});x5.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var ljs=new Ee("sdk");function nlt(t,e){x5.has(t.get(Lr).getEditorPluginInfo().name)||ljs.warn(t,...e)}a(nlt,"deprecationWarning");var Aji=he(_L()),tI=he(XP());p();p();p();p();var ilt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Bpe(t,e){let r=Vt.createAndMarkAsIssued({authType:e});yt(t,ilt.NewGitHubLogin,r),_t(t,ilt.NewGitHubLogin,{authType:e})}a(Bpe,"telemetryNewGitHubLogin");function p2(t,e,r,n,o){gi(t,ilt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(p2,"telemetryGitHubLoginResult");function M2e(t,e,r){gi(t,ilt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(M2e,"telemetryCodeFlowError");var tJn=["repo","workflow"],yur=class extends Jn{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function ujs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...wy(t)},json:{client_id:e,scope:tJn.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(fr).fetch(s,n)}catch(c){throw c instanceof Error&&RI(c)?new Jn(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new Jn(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(ujs,"requestDeviceFlowStage1");async function djs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...wy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(fr).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 yur(c):new Jn(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(djs,"requestDeviceFlowStage2");async function fjs(t,e){let n=await(await Bf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Jn(`Error retrieving user information: ${String(n.errors)}`);return n}a(fjs,"requestUserInfo");var AT=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Fr)}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(Lp).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(Lp).githubAppId=n;let d=await this.save(u);return p2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{p2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw p2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(oC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Bpe(n,"deviceFlow");let o=await ujs(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 djs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await fjs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):tJn;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new Jn(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var Eur=he(ti());p();var Dw=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var olt="github.copilot.finishDeviceFlow",_ur=class extends Dw{constructor(){super(...arguments);this.name=olt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(AT),s=o.pendingSignIn;if(!s)throw new Eur.ResponseError(it.InvalidRequest,"No pending sign in");try{await this.ctx.get(N0).open(s.verificationUri)}catch(c){Xg.warn(this.ctx,"Failed to open",s.verificationUri),Xg.exception(this.ctx,c,olt)}try{return await s.status}catch(c){throw new Eur.ResponseError(it.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},rJn=[_ur];p();p();var vu=class extends yn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var O2e="github.copilot.didAcceptCompletionItem",vur=class extends Dw{constructor(){super(...arguments);this.name=O2e;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(vu).get(n);return s?(Ope(this.ctx,s),!0):!1}},nJn=[vur];p();p();p();p();p();p();function iJn(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(wZn,"normalizeIndentCharacter");Ns();function RZn(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=Ll.range(Ll.position(o.line,0),Ll.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=wZn(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=Ll.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:gr(),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(RZn,"completionsFromGhostTextResults");p();var v2=class{constructor(){this.cache=new nn(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 she=class extends BA{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 udr(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=bZn(s,r.textDocument,r.position,d),h=RZn(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(()=>udr(s,r,void 0,g),"fn");s.get(v2).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=qn.Range.create(A,qn.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(pX(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(pX(r,n),o,s);return Vzn(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}});Lat.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(v2).request(r.clientCompletionId)}};var b8i=ce(uMr()),S8i=ce(c0t()),T8i=ce(cX()),TBe=ce(Sc()),gMr=ce(ko());var dMr=class extends gMr.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 TBe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new TBe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new TBe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(Es(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.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(),evt(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 evt(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function evt(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new S8i.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(Ih).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(evt,"asChatLibCopilotToken");var fMr=class extends gMr.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new TBe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(Es(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(mx),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){_s(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.")}},pMr=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(Cc).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get(cn).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},hMr=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}}}},mMr=class extends BA{constructor(r){super();this.ctx=r;this._telemetrySender=new IBe(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(n0).matchFunction,o=new wBe(this.ctx.get(ar)),s=uce(r),c={fetcher:o,authService:new dMr(r),telemetrySender:this._telemetrySender,logTarget:new xBe(r),isRunningInTest:v1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new hMr(r.get(as)),documentManager:r.get(cn),workspace:r.get(T8i.ObservableWorkspace),urlOpener:r.get(N0),editorInfo:r.get(Lr).getEditorInfo(),editorPluginInfo:r.get(Lr).getEditorPluginInfo(),relatedPluginInfo:r.get(Lr).getRelatedPluginInfo(),editorSession:r.get(Fa),notificationSender:r.get(sa),ignoreService:new pMr(r),waitForTreatmentVariables:!1,endpointProvider:new fMr(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s},l=(0,b8i.createInlineCompletionsProvider)(c);return this.ctx.get(Zo).onDidChangeCopilotSettings(()=>{let u=uce(this.ctx);l.setConfigs(u).catch(d=>{_s(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(c.filtersAndExp.exp),this.completionProvider.updateTreatmentVariables(c.filtersAndExp.exp.variables),this.asLocalResult(await this.completionProvider.getInlineCompletions(r,n,o,s),c)}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 NI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new SB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new XC(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)}},tvt=class extends BA{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new she(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new mMr(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return qt(this.ctx,je.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)}},IBe=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),goe(this.ctx,e,o.properties,o.measurements,0),gt(this.ctx,e,R9(o.properties,w2e),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),goe(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",jt.createAndMarkAsIssued(n,o)}};p();var I8i=ce($G()),x8i=ce(Sc()),RBe=ce(T1r()),w8i=ce(S4());var Jbc=16,B6=class extends I8i.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new nn(Jbc);this._onDidChangeDiagnostics=new x8i.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(Zbc);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 Zbc(t){let e=new w8i.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?RBe.DiagnosticSeverity.Error:RBe.DiagnosticSeverity.Warning,n=new RBe.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(Zbc,"toVscodeDiagnostic");p();var VAe=ce(Hre()),R8i=ce(kD()),AMr=ce(Xct()),ivt=ce(cX()),k8i=ce(Ts()),P8i=ce(y2()),kBe=ce(gE()),nvt=ce(I_()),yMr=ce(sd()),D8i=ce(CT()),N8i=ce(ti());p();var rvt=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new no;this._onDidChangeTextDocument=new no;this._onDidCloseTextDocument=new no;this._onDidSelectTextDocument=new no;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(cn)}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 WAe=class extends ivt.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,P8i.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new rvt(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get(cn);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=VAe.DocumentId.create(ca(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=VAe.DocumentId.create(ca(ca(r)));return this.addDocument({id:s,initialValue:o,languageId:AMr.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=VAe.DocumentId.create(ca(ca(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=VAe.DocumentId.create(ca(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=VAe.DocumentId.create(ca(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 EMr(r.id,new D8i.StringText(r.initialValue??""),[],r.languageId??AMr.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()}},EMr=class extends ivt.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 nvt.Position(e.lineNumber+1,e.column+1));this.updateSelection([new yMr.OffsetRange(r,r)])}editFromLspContentChanges(e){return new R8i.Edits(kBe.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(N8i.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new nvt.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new nvt.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 k8i.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 kBe.StringEdit.single(new kBe.StringReplacement(new yMr.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var L6=ce(uMr()),O8i=ce(Hre()),_Mr=ce(cX()),B8i=ce(ey()),L8i=ce(K_t()),F8i=ce(Sc()),CMr=require("node:stream");Ns();var M8i=10,Xbc={[L6.LogLevel.Off]:4,[L6.LogLevel.Trace]:4,[L6.LogLevel.Debug]:4,[L6.LogLevel.Info]:3,[L6.LogLevel.Warning]:2,[L6.LogLevel.Error]:1},xBe=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Df).logIt(this.ctx,Xbc[e],r,...n)}},DC=class{constructor(e){this.lastResultsById=new nn(M8i);this.lastResultsByUri=new nn(M8i);this.ctx=e,this.telemetrySender=new IBe(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(_Mr.ObservableWorkspace);if(s instanceof WAe&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let y=this.lastResultsByUri.get(e);y&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(y.resultId),y.isShown&&o.handleRejection(y.nextEditResult))}let c=O8i.DocumentId.create(ca(e)),l=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(l.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(l.filtersAndExp.exp);let u=await o.getNextEdit(c.toUri(),n);if(u.result==null)return;let d=await this.ctx.get(cn).getTextDocument({uri:e});if(!d)return;let f=d.positionAt(u.result.range.start),h=d.positionAt(u.result.range.endExclusive),m=gr(),g={resultId:m,nextEditResult:u,documentId:c,isShown:!1};return this.lastResultsById.set(m,g),this.lastResultsByUri.set(e,g),[{edit:{text:u.result.newText,range:{start:f,end:h},textDocument:{uri:e,version:r}},id:m}]}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),await r.handleAcceptance(n.nextEditResult))}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&&e1c(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(_Mr.ObservableWorkspace),r=new wBe(this.ctx.get(ar)),n=new vMr(this.ctx),o=uce(this.ctx),s=await(0,L6.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:L8i.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new xBe(this.ctx),languageDiagnosticsService:this.ctx.get(B6)});return this.ctx.get(Zo).onDidChangeCopilotSettings(()=>{let c=uce(this.ctx);s.setConfigs(c).catch(l=>{_s(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return qt(this.ctx,je.NESUseExplicitRejection)}};function e1c(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){_s(t,o,"nesProvider.setDisposalReason")}}a(e1c,"trySetChatLibDisposalReason");var vMr=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new F8i.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 evt(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},wBe=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 CMr.Readable?c=CMr.Readable.toWeb(s):c=s),new B8i.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},gr(),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 OI(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 t1c="github.copilot.didAcceptNextEditSuggestionItem",bMr=class extends Uw{constructor(){super(...arguments);this.name=t1c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(DC).handleAcceptance(n),!0}},r1c="github.copilot.didRejectNextEditSuggestionItem",SMr=class extends Uw{constructor(){super(...arguments);this.name=r1c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(DC).handleRejection(n),!0}},n1c="github.copilot.didIgnoreNextEditSuggestionItem",TMr=class extends Uw{constructor(){super(...arguments);this.name=n1c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(DC).handleIgnored(n),!0}},U8i=[bMr,SMr,TMr];p();var xMr="github.copilot.didAcceptPanelCompletionItem",IMr=class extends Uw{constructor(){super(...arguments);this.name=xMr;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(vu).get(o);return c?(sDe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:sH(c.displayText)},c.copilotAnnotations),!0):!1}},Q8i=[IMr];var i1c=[...IZn,...xZn,...U8i,...Q8i];function q8i(t,e){let r=new Map;for(let n of i1c){let o=new n(t),s=Ou.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=F6(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Lr).getEditorPluginInfo();await e.get(Si).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Lr).getEditorPluginInfo(),n=await e.get(Si).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,PBe.gt)((0,PBe.coerce)(r.version),(0,PBe.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Lr).getEditorPluginInfo();await e.get(Si).delete("versions",r.name),(await e.get(Si).listKeys("versions")).length===0&&await e.get(Si).deleteSetting("versions")}};p();var V8i=ce(Xc()),W8i=require("crypto"),lvt=ce(require("path")),YAe=ce(Al());var a1c={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},c1c=new YAe.ProgressType,zD=class t{constructor(e){this.ctx=e;this.#e=new no;this._changeHandlerLimiter=new V8i.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new YAe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ur).connection}init(){this.ctx.get(Mn).getCapabilities().watchedFiles&&this.connection.onNotification(YAe.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(Mn).getCapabilities().watchedFiles)return a1c;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(Mn).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=lvt.extname(l).toLowerCase();N7.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=lvt.extname(s.uri).toLowerCase();if(!N7.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.getValidDocument(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 getValidDocument(e){let n=await this.ctx.get(Jn).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,W8i.randomUUID)(),n=[],o=this.connection.onProgress(c1c,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=lvt.extname(l).toLowerCase();if(!N7.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();p();p();var z8i=new ge("AgentRouter"),Y8i="AgentRouter";function XT(t){return t.agentProvider??"BACKGROUND"}a(XT,"resolveProvider");var kc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Us);case"CLAUDE":return this.ctx.get(UF)}}logDispatch(e,r){z8i.debug(this.ctx,`${Y8i}.${e}`,r)}create(e){this.logDispatch("create",e);let r=XT(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=XT(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=XT(e);return this.serviceFor(n).sendMessage(e,r)}stop(e){this.logDispatch("stop",e);let r=XT(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=XT(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=XT(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=XT(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=XT(e);return this.serviceFor(r).handleInteraction(e)}getPlanPath(e){this.logDispatch("getPlanPath",e);let r=XT(e);return this.serviceFor(r).getPlanPath(e.sessionId)}enableRemote(e){this.logDispatch("enableRemote",e);let r=XT(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=XT(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=XT(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=XT(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{z8i.info(this.ctx,`${Y8i}.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 l1c=S.Union([S.String(),S.Number()]),Ui=S.String(),KAe=S.Optional(S.Union([S.Literal("none"),S.Literal("low"),S.Literal("medium"),S.Literal("high"),S.Literal("xhigh")])),u1c=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())}),wMr=S.Array(u1c),DBe=S.Union([S.Literal("default"),S.Literal("long_context")]),JAe=S.Object({model:S.Optional(S.String()),reasoningEffort:KAe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(wMr),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean())});async function Ii(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof Ufe?e.data:void 0;return[null,{code:Ke.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Ii,"withServiceErrorHandling");var K8i=new ge("BackgroundAgent.compactHistory"),d1c=S.Object({sessionId:Ui});async function RMr(t,e,r){K8i.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Us),o=e.onCancellationRequested(()=>{K8i.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await Ii(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(RMr,"handleBackgroundAgentCompactHistoryChecked");var d7p=Ne(d1c,RMr);p();var f1c=S.Union(Object.values(t0).map(t=>S.Literal(t))),Nl=S.Optional(f1c),uvt=S.Intersect([JAe,S.Object({agentProvider:Nl})]);var J8i=new ge("BackgroundAgent.compactHistory"),p1c=S.Object({sessionId:Ui,agentProvider:Nl});async function h1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return RMr(t,e,r);J8i.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.compactHistory(s,e);return J8i.info(t,"compactHistory succeeded"),c})}a(h1c,"handleAgentCompactHistoryChecked");var Z8i=Ne(p1c,h1c);p();p();var X8i=new ge("BackgroundAgent.create"),m1c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),JAe]);async function kMr(t,e,r){X8i.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Us),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};return Ii(async()=>{let s=await n.createSession(o);return X8i.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(kMr,"handleBackgroundAgentCreateChecked");var U7p=Ne(m1c,kMr);var e6i=new ge("BackgroundAgent.create"),g1c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),uvt]);async function A1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return kMr(t,e,r);e6i.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.create(s);return e6i.info(t,"create succeeded:",c.sessionId),c})}a(A1c,"handleAgentCreateChecked");var t6i=Ne(g1c,A1c);p();p();var y1c=S.Object({sessionId:Ui});async function PMr(t,e,r){let n=t.get(Us);return Ii(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(PMr,"handleBackgroundAgentDestroyChecked");var oQp=Ne(y1c,PMr);var E1c=new ge("BackgroundAgent.destroy"),_1c=S.Object({sessionId:Ui,agentProvider:Nl});async function C1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return PMr(t,e,r);E1c.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.destroy(s))}a(C1c,"handleAgentDestroyChecked");var r6i=Ne(_1c,C1c);p();p();var v1c=new ge("BackgroundAgent.disableRemote"),b1c=S.Object({sessionId:Ui});async function DMr(t,e,r){v1c.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(DMr,"handleBackgroundAgentDisableRemoteChecked");var IQp=Ne(b1c,DMr);var n6i=new ge("BackgroundAgent.disableRemote"),S1c=S.Object({sessionId:Ui,agentProvider:Nl});async function T1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return DMr(t,e,r);n6i.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.disableRemote(s);return n6i.info(t,"disableRemote succeeded"),c})}a(T1c,"handleAgentDisableRemoteChecked");var i6i=Ne(S1c,T1c);p();p();var I1c=new ge("BackgroundAgent.enableRemote"),x1c=S.Object({sessionId:Ui});async function NMr(t,e,r){I1c.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(async()=>n.enableRemote(r.sessionId))}a(NMr,"handleBackgroundAgentEnableRemoteChecked");var WQp=Ne(x1c,NMr);var o6i=new ge("BackgroundAgent.enableRemote"),w1c=S.Object({sessionId:Ui,agentProvider:Nl});async function R1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return NMr(t,e,r);o6i.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.enableRemote(s);return o6i.info(t,"enableRemote succeeded"),c})}a(R1c,"handleAgentEnableRemoteChecked");var s6i=Ne(w1c,R1c);p();p();var k1c=S.Object({sessionId:Ui});async function MMr(t,e,r){let n=t.get(Us);return Ii(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(MMr,"handleBackgroundAgentGetPlanPathChecked");var pqp=Ne(k1c,MMr);var P1c=new ge("BackgroundAgent.getPlanPath"),D1c=S.Object({sessionId:Ui,agentProvider:Nl});async function N1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[c,l]=await MMr(t,e,r);return l?[null,l]:[c.path,null]}P1c.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.getPlanPath(s))}a(N1c,"handleAgentGetPlanPathChecked");var a6i=Ne(D1c,N1c);p();p();var M1c=new ge("BackgroundAgent.getRemoteStatus"),O1c=S.Object({sessionId:Ui});async function OMr(t,e,r){M1c.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(OMr,"handleBackgroundAgentGetRemoteStatusChecked");var Mqp=Ne(O1c,OMr);var B1c=new ge("BackgroundAgent.getRemoteStatus"),L1c=S.Object({sessionId:Ui,agentProvider:Nl});async function F1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return OMr(t,e,r);B1c.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.getRemoteStatus(s))}a(F1c,"handleAgentGetRemoteStatusChecked");var c6i=Ne(L1c,F1c);p();p();var U1c=new ge("BackgroundAgent.interaction"),Q1c=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()})]),q1c=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),j1c=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())])))}),H1c=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())}),G1c=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),$1c=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())})]),V1c=S.Union([S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("permission"),result:Q1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("user_input"),response:q1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("elicitation"),response:j1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:H1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("queued_command"),result:G1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("external_tool"),result:$1c})]);async function BMr(t,e,r){U1c.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Us);return Ii(async()=>await n.handleInteraction(r))}a(BMr,"handleBackgroundAgentInteractionChecked");var tjp=Ne(V1c,BMr);var l6i=new ge("BackgroundAgent.interaction"),W1c=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()})]),z1c=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Y1c=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())])))}),K1c=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())}),J1c=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),Z1c=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())})]),X1c=S.Union([S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("permission"),result:W1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("user_input"),response:z1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("elicitation"),response:Y1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:K1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("queued_command"),result:J1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("external_tool"),result:Z1c,agentProvider:Nl})]);async function eSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return BMr(t,e,r);l6i.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.interaction(s);return l6i.info(t,"interaction succeeded"),c})}a(eSc,"handleAgentInteractionChecked");var u6i=Ne(X1c,eSc);p();p();var d6i=new ge("BackgroundAgent.listSessions"),tSc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function LMr(t,e,r){d6i.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Us);return Ii(async()=>{let o=await n.listSessions(r);return d6i.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(LMr,"handleBackgroundAgentSessionsListChecked");var bjp=Ne(tSc,LMr);var f6i=new ge("BackgroundAgent.listSessions"),rSc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Nl});async function nSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return LMr(t,e,r);f6i.info(t,"handleAgentSessionsList called",r);let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.listSessions(s);return f6i.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(nSc,"handleAgentSessionsListChecked");var p6i=Ne(rSc,nSc);p();p();var h6i=new ge("BackgroundAgent.listModels"),iSc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function FMr(t,e,r){h6i.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Us);return Ii(async()=>{let o=await n.listModels(r.forceRefresh);return h6i.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(FMr,"handleBackgroundAgentListModelsChecked");var $jp=Ne(iSc,FMr);var m6i=new ge("BackgroundAgent.listModels"),oSc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Nl});async function sSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return FMr(t,e,r);m6i.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.listModels(s);return m6i.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(sSc,"handleAgentListModelsChecked");var g6i=Ne(oSc,sSc);p();p();var A6i=new ge("BackgroundAgent.resume"),aSc=S.Intersect([S.Object({sessionId:Ui}),JAe]);async function UMr(t,e,r){A6i.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Us),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};return Ii(async()=>{let s=await n.resumeSession(o);return A6i.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(UMr,"handleBackgroundAgentResumeChecked");var fHp=Ne(aSc,UMr);var y6i=new ge("BackgroundAgent.resume"),cSc=S.Intersect([S.Object({sessionId:Ui}),uvt]);async function lSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return UMr(t,e,r);y6i.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.resume(s);return y6i.info(t,"resume succeeded:",c.sessionId),c})}a(lSc,"handleAgentResumeChecked");var E6i=Ne(cSc,lSc);p();p();var uSc=S.Union([S.Literal(""),...Object.values(Ao).map(t=>S.Literal(t))]),dSc=["interactive","plan","autopilot"],fSc=S.Union(dSc.map(t=>S.Literal(t))),pSc=S.String({minLength:1}),hSc=S.Object({sessionId:Ui,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(uSc),reasoningEffort:KAe,references:S.Optional(S.Array(oO)),agentMode:S.Optional(fSc),chatMode:S.Optional(pSc),contextTier:S.Optional(DBe),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function QMr(t,e,r){let n=t.get(Us),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 Ii(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(QMr,"handleBackgroundAgentSendChecked");var OHp=Ne(hSc,QMr);var _6i=new ge("BackgroundAgent.send"),mSc=S.Union([S.Literal(""),...Object.values(Ao).map(t=>S.Literal(t))]),gSc=["interactive","plan","autopilot"],ASc=S.Union(gSc.map(t=>S.Literal(t))),ySc=S.String({minLength:1}),ESc=S.Object({sessionId:Ui,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(mSc),reasoningEffort:KAe,references:S.Optional(S.Array(oO)),agentMode:S.Optional(ASc),chatMode:S.Optional(ySc),contextTier:S.Optional(DBe),agentProvider:Nl});async function _Sc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return QMr(t,e,r);_6i.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.send(s,e);return _6i.info(t,"resume succeeded:",c.messageId),c})}a(_Sc,"handleAgentSendChecked");var C6i=Ne(ESc,_Sc);p();p();var CSc=new ge("BackgroundAgent.stop"),vSc=S.Object({sessionId:Ui});async function qMr(t,e,r){CSc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(qMr,"handleBackgroundAgentStopChecked");var iGp=Ne(vSc,qMr);var bSc=new ge("BackgroundAgent.stop"),SSc=S.Object({sessionId:Ui,agentProvider:Nl});async function TSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await qMr(t,e,r);return c?[null,c]:[void 0,null]}bSc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.stop(s))}a(TSc,"handleAgentStopChecked");var v6i=Ne(SSc,TSc);p();var ISc=S.Object({});async function xSc(t,e,r){return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Ur).listAvailableTokens()},null]}a(xSc,"handleListAvailableTokensChecked");var b6i=Ne(ISc,xSc);p();var wSc=S.Object({tokenId:S.Number()});async function RSc(t,e,r){return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Ur).useExistingToken(r.tokenId),null]}a(RSc,"handleUseExistingTokenChecked");var S6i=Ne(wSc,RSc);p();var kSc=S.Object({providerName:S.String()});async function PSc(t,e,r){try{let{providerName:n}=r,o=gQ(n);if(o!==0)return[null,{code:Ke.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new bc(t.get(Si));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(PSc,"handleBYOKDeleteApiKeyChecked");var T6i=Ne(kSc,PSc);p();var DSc=S.Object({providerName:S.String(),modelId:S.String()});async function NSc(t,e,r){try{let n=new bc(t.get(Si)),{providerName:o,modelId:s}=r,c=gQ(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:Ke.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(NSc,"handleBYOKDeleteModelChecked");var I6i=Ne(DSc,NSc);p();var MSc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())});async function OSc(t,e,r){try{let n=new bc(t.get(Si)),{providerName:o,modelId:s}=r;if(!o){let l=t.get(Si),u=await l.listKeys("byok"),d=[];for(let f of u)if(f.endsWith("-api-key")){let h=await l.read("byok",f);if(h){let g=f.replace("-api-key","").split("-");if(g.length===1)d.push({providerName:g[0],apiKey:h});else if(g.length>=2){let A=g[0],y=g.slice(1).join("-");d.push({providerName:A,modelId:y,apiKey:h})}}}return[{apiKeys:d},null]}return[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(OSc,"handleBYOKListApiKeysChecked");var x6i=Ne(MSc,OSc);p();p();p();POr();var ybt=class extends Rx{static{a(this,"AnthropicProvider")}constructor(e){super(Ao.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new bc(this.ctx.get(Si)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new nB({apiKey:e,fetch:FIc(this.ctx.get(ar))});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 OTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function FIc(t){return async(e,r)=>{let n=UIc(e,r),o=qIc(r),s=await t.fetch(n,o);return HIc(s)}}a(FIc,"createAnthropicFetchAdapter");function UIc(t,e){return t instanceof Request?(QIc(t,e),t.url):t instanceof URL?t.toString():t}a(UIc,"convertInputToString");function QIc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(QIc,"mergeRequestInit");function qIc(t){let e;return t?.headers&&(e=jIc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(qIc,"convertToFetchOptions");function jIc(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(jIc,"convertHeaders");async function HIc(t){let e=t.body(),r=null;if(e)r=GIc(e);else{let n=await t.text();r=VIc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(HIc,"convertToWebResponse");function GIc(t){return new ReadableStream({start(e){let r=$Ic(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(GIc,"createReadableStreamFromNodeStream");function $Ic(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($Ic,"setupStreamHandlers");function VIc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(VIc,"createReadableStreamFromText");p();var Ebt=class extends Rx{static{a(this,"GeminiProvider")}constructor(e){super(Ao.Gemini,e)}};p();var _bt=class extends Rx{static{a(this,"GroqProvider")}constructor(e){super(Ao.Groq,e)}};p();var Cbt=class extends Rx{static{a(this,"OpenAIProvider")}constructor(e){super(Ao.OpenAI,e)}};p();var YUi=16e3,vbt=class extends Rx{static{a(this,"OpenRouterProvider")}constructor(e){super(Ao.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new bc(this.ctx.get(Si)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(ar).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-YUi),maxOutputTokens:YUi,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw OTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var bne=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[Ao.OpenAI,new Cbt(e)],[Ao.Gemini,new Ebt(e)],[Ao.Groq,new _bt(e)],[Ao.OpenRouter,new vbt(e)],[Ao.Anthropic,new ybt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var WIc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function zIc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new bc(t.get(Si)),c=[];if(n)if(o){if(!Qce(n))return[null,{code:Ke.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Ke.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(bne).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=Object.values(Ao);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:Ke.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(zIc,"handleBYOKListModelsChecked");var KUi=Ne(WIc,zIc);p();var YIc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function KIc(t,e,r){try{let n=new bc(t.get(Si)),{providerName:o,apiKey:s,modelId:c}=r,l=gQ(o);if(l===1&&!c)return[null,{code:Ke.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:Ke.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(KIc,"handleBYOKSaveApiKeyChecked");var JUi=Ne(YIc,KIc);p();var JIc=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 ZIc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new bc(t.get(Si)),h=gQ(n);if(h===1&&!l)return[null,{code:Ke.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];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:Ke.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(ZIc,"handleBYOKSaveModelChecked");var ZUi=Ne(JIc,ZIc);p();var XIc=S.Object({cliPath:S.String()});async function exc(t,e,r){return[await xpe.check(r.cliPath),null]}a(exc,"handleCheckClaudeCliCompatibilityChecked");var XUi=Ne(XIc,exc);p();var txc=S.Object({uri:S.String({minLength:1})});async function rxc(t,e,r){let n=await t.get(Jn).getOrReadTextDocument(r);return[{status:zu(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(rxc,"handleCheckFileStatusChecked");var e7i=Ne(txc,rxc);p();var nxc=S.Object({});function t7i(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(t7i,"calculatePercentRemaining");function M5r(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(M5r,"buildQuotaSnapshot");async function ixc(t,e,r){let n=await t.get(Ur).resolveSession();if(!n)return[null,{code:Ke.InternalError,message:"Not signed in"}];let o=await QCe(t,n);if(o.ok){let s=await o.json();return t.get(Rd).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:M5r(s.quota_snapshots?.chat),completions:M5r(s.quota_snapshots?.completions),premiumInteractions:M5r(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:t7i(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:t7i(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:Ke.InternalError,message:"Failed to fetch quota info"}]}a(ixc,"handleCheckQuotaChecked");var r7i=Ne(nxc,ixc);p();var oxc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function sxc(t,e,r){return[await t.get(Ur).checkAndUpdateStatus(r.options),null]}a(sxc,"handleCheckStatusChecked");var n7i=Ne(oxc,sxc);p();var axc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function cxc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let o=await new zy(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return gt(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(gi(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(cxc,"handleCloudAgentAddPullRequestCommentChecked");var i7i=Ne(axc,cxc);p();var lxc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function uxc(t,e,r){try{let o=await new Nx(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Ke.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(ht(t,"githubApi.cancelCodingAgent",jt.createAndMarkAsIssued()),gt(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new zy(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),ht(t,"githubApi.cancelCodingAgent",jt.createAndMarkAsIssued()),gt(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ke.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(_s(t,n,"githubApi.cancelCodingAgent"),gi(t,"githubApi.cancelCodingAgent",n),n instanceof Dx)return[null,{code:Ke.NoCopilotToken,message:n.message}];if(n instanceof Yf)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(uxc,"handleCancelCodingAgentChecked");var o7i=Ne(lxc,uxc);p();var dxc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Lc))});function fxc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(fxc,"pickWorkspaceFolder");async function pxc(t,e,r){try{let n=fxc(r);if(!n)return[null,{code:Ke.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a Coding Agent job."}];let s=await new W0(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Ke.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Ke.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new $Q([new VQ,new WQ]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Ke.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a Coding Agent job."}];let u=l.currentBranch,d=TYe(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let h=await new Nx(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return gt(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(gi(t,"cloudAgent.createJob",n,{result:"error"}),_6t(n))return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];if(n instanceof Dx)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Yf)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(pxc,"handleCloudAgentCreateJobChecked");var s7i=Ne(dxc,pxc);p();var hxc=S.Object({sessionId:S.String({minLength:1})});async function mxc(t,e,r){try{let o=await new Nx(t).getSessionLogs(r.sessionId,e);return gt(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(gi(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof Dx)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Yf||n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(mxc,"handleCloudAgentGetSessionLogsChecked");var a7i=Ne(hxc,mxc);p();var gxc=S.Object({pullRequestId:S.Integer()});async function Axc(t,e,r){try{let o=await new Nx(t).getAllSessions(r.pullRequestId,e);return gt(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(gi(t,"cloudAgent.listSessions",n),n instanceof Dx)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Yf||n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(Axc,"handleCloudAgentListSessionsChecked");var c7i=Ne(gxc,Axc);p();var yxc=S.Object({});async function Exc(t,e,r){return[(await Px(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(Exc,"handleConversationAgentsChecked");var l7i=Ne(yxc,Exc);p();p();var yLe=ce(Al());function _xc(t,e,r){let n=jt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return ht(t,"getCompletions.docVersionMismatch",n)}a(_xc,"telemetryVersionMismatch");async function K6(t,e,r){let o=t.get(cn).getTextDocumentUnsafe(e);if(!o)throw new yLe.ResponseError(Ke.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Bce(t,e,o.getText());if(s.status==="invalid")throw t.get(as).setClsInactive(s.reason),new yLe.ResponseError(Ke.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(_xc(t,o,e.version),ys.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new yLe.ResponseError(Ke.ContentModified,"Document Version Mismatch");return o}a(K6,"getTextDocument");async function iB(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await K6(t,n,r)}catch(o){if(o instanceof yLe.ResponseError){if(o.code===Ke.CopilotNotAvailable)return;if(o.code===Ke.InvalidParams){ys.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(iB,"getTextDocumentIfAvailable");var Cxc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),vxc=S.Object({turnId:uK,codeBlockIndex:S.Number(),source:Cxc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(XYe),textDocument:S.Optional(Rv),position:S.Optional(rg),conversationSource:S.Optional(sO)});async function bxc(t,e,r){let n=await iB(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=bQ(r.conversationSource),l=t.get(Vo).findByTurnId(r.turnId),u=await Jc(t,l,{languageId:n?.detectedLanguageId??""});return wS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${Hy(c)}.acceptedCopy`,u),["OK",null]}a(bxc,"handleConversationCodeCopyChecked");var u7i=Ne(vxc,bxc);p();var Sxc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),Txc=S.Object({turnId:uK,source:Sxc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(XYe),textDocument:S.Optional(Rv),position:S.Optional(rg),conversationSource:S.Optional(sO)});async function Ixc(t,e,r){let n=await iB(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=bQ(r.conversationSource),l=t.get(Vo).findByTurnId(r.turnId),u=await Jc(t,l,{languageId:n?.detectedLanguageId??""});return wS(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(iJn,"normalizeIndentCharacter");As();function oJn(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=iJn(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:ir(),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(oJn,"completionsFromGhostTextResults");p();var h2=class{constructor(){this.cache=new yn(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 Lpe=class extends qA{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 sur(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=XKn(s,r.textDocument,r.position,d),h=oJn(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(()=>sur(s,r,void 0,g),"fn");s.get(h2).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=qn.Range.create(A,qn.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(KZ(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(KZ(r,n),o,s);return CWn(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}});tat.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(h2).request(r.clientCompletionId)}};var X3i=he(sNr()),eFi=he(Iht()),tFi=he($Z()),Z4e=he(Cc()),fNr=he(wo());var aNr=class extends fNr.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 Z4e.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new Z4e.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new Z4e.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(ys(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Fr).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(Ut).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),yvt(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Ut);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Fr).resolveSession();return yvt(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Ut).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function yvt(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new eFi.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(xh).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(yvt,"asChatLibCopilotToken");var cNr=class extends fNr.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new Z4e.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(ys(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(lx),o=await this.ctx.get(Ut).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){La(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.")}},lNr=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(Ec).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get(an).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},uNr=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}}}},dNr=class extends qA{constructor(r){super();this.ctx=r;this._telemetrySender=new X4e(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(n0).matchFunction,o=new tBe(this.ctx.get(fr)),s=Vae(r),c={fetcher:o,authService:new aNr(r),telemetrySender:this._telemetrySender,logTarget:new eBe(r),isRunningInTest:h1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new uNr(r.get(os)),documentManager:r.get(an),workspace:r.get(tFi.ObservableWorkspace),urlOpener:r.get(N0),editorInfo:r.get(Lr).getEditorInfo(),editorPluginInfo:r.get(Lr).getEditorPluginInfo(),relatedPluginInfo:r.get(Lr).getRelatedPluginInfo(),editorSession:r.get(Oa),notificationSender:r.get(ra),ignoreService:new lNr(r),waitForTreatmentVariables:!1,endpointProvider:new cNr(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s},l=(0,X3i.createInlineCompletionsProvider)(c);return this.ctx.get(zo).onDidChangeCopilotSettings(()=>{let u=Vae(this.ctx);l.setConfigs(u).catch(d=>{La(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(c.filtersAndExp.exp),this.completionProvider.updateTreatmentVariables(c.filtersAndExp.exp.variables),this.asLocalResult(await this.completionProvider.getInlineCompletions(r,n,o,s),c)}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 xI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new fB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new Yv(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)}},Evt=class extends qA{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new Lpe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new dNr(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return Gt(this.ctx,Je.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)}},X4e=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),Xie(this.ctx,e,o.properties,o.measurements,0),_t(this.ctx,e,m9(o.properties,t2e),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),Xie(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 rFi=he(xG()),nFi=he(Cc()),rBe=he(vbr()),iFi=he(f4());var YEc=16,v6=class extends rFi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new yn(YEc);this._onDidChangeDiagnostics=new nFi.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(KEc);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 KEc(t){let e=new iFi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?rBe.DiagnosticSeverity.Error:rBe.DiagnosticSeverity.Warning,n=new rBe.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(KEc,"toVscodeDiagnostic");p();var bAe=he(Ire()),oFi=he(CD()),pNr=he(Act()),Cvt=he($Z()),sFi=he(Cs()),aFi=he(u2()),nBe=he(pE()),vvt=he(b_()),hNr=he(sd()),cFi=he(mT()),lFi=he(ti());p();var _vt=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new ro;this._onDidChangeTextDocument=new ro;this._onDidCloseTextDocument=new ro;this._onDidSelectTextDocument=new ro;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(an)}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 SAe=class extends Cvt.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,aFi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new _vt(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get(an);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=bAe.DocumentId.create(ia(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=bAe.DocumentId.create(ia(ia(r)));return this.addDocument({id:s,initialValue:o,languageId:pNr.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=bAe.DocumentId.create(ia(ia(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=bAe.DocumentId.create(ia(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=bAe.DocumentId.create(ia(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 mNr(r.id,new cFi.StringText(r.initialValue??""),[],r.languageId??pNr.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()}},mNr=class extends Cvt.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 vvt.Position(e.lineNumber+1,e.column+1));this.updateSelection([new hNr.OffsetRange(r,r)])}editFromLspContentChanges(e){return new oFi.Edits(nBe.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(lFi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new vvt.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new vvt.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 sFi.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 nBe.StringEdit.single(new nBe.StringReplacement(new hNr.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var C6=he(sNr()),dFi=he(Ire()),gNr=he($Z()),fFi=he(oy()),pFi=he(h_t()),hFi=he(Cc()),ANr=require("node:stream");As();var uFi=10,JEc={[C6.LogLevel.Off]:4,[C6.LogLevel.Trace]:4,[C6.LogLevel.Debug]:4,[C6.LogLevel.Info]:3,[C6.LogLevel.Warning]:2,[C6.LogLevel.Error]:1},eBe=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Df).logIt(this.ctx,JEc[e],r,...n)}},wv=class{constructor(e){this.lastResultsById=new yn(uFi);this.lastResultsByUri=new yn(uFi);this.ctx=e,this.telemetrySender=new X4e(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(gNr.ObservableWorkspace);if(s instanceof SAe&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let y=this.lastResultsByUri.get(e);y&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(y.resultId),y.isShown&&o.handleRejection(y.nextEditResult))}let c=dFi.DocumentId.create(ia(e)),l=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(l.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(l.filtersAndExp.exp);let u=await o.getNextEdit(c.toUri(),n);if(u.result==null)return;let d=await this.ctx.get(an).getTextDocument({uri:e});if(!d)return;let f=d.positionAt(u.result.range.start),h=d.positionAt(u.result.range.endExclusive),m=ir(),g={resultId:m,nextEditResult:u,documentId:c,isShown:!1};return this.lastResultsById.set(m,g),this.lastResultsByUri.set(e,g),[{edit:{text:u.result.newText,range:{start:f,end:h},textDocument:{uri:e,version:r}},id:m}]}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),await r.handleAcceptance(n.nextEditResult))}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&&ZEc(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(gNr.ObservableWorkspace),r=new tBe(this.ctx.get(fr)),n=new yNr(this.ctx),o=Vae(this.ctx),s=await(0,C6.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:pFi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new eBe(this.ctx),languageDiagnosticsService:this.ctx.get(v6)});return this.ctx.get(zo).onDidChangeCopilotSettings(()=>{let c=Vae(this.ctx);s.setConfigs(c).catch(l=>{La(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Gt(this.ctx,Je.NESUseExplicitRejection)}};function ZEc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){La(t,o,"nesProvider.setDisposalReason")}}a(ZEc,"trySetChatLibDisposalReason");var yNr=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new hFi.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Ut).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Ut);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Fr).resolveSession();return yvt(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Ut).resetToken("nes",e)}},tBe=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 ANr.Readable?c=ANr.Readable.toWeb(s):c=s),new fFi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},ir(),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 RI(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 XEc="github.copilot.didAcceptNextEditSuggestionItem",ENr=class extends Dw{constructor(){super(...arguments);this.name=XEc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(wv).handleAcceptance(n),!0}},e_c="github.copilot.didRejectNextEditSuggestionItem",_Nr=class extends Dw{constructor(){super(...arguments);this.name=e_c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(wv).handleRejection(n),!0}},t_c="github.copilot.didIgnoreNextEditSuggestionItem",vNr=class extends Dw{constructor(){super(...arguments);this.name=t_c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(wv).handleIgnored(n),!0}},mFi=[ENr,_Nr,vNr];p();var bNr="github.copilot.didAcceptPanelCompletionItem",CNr=class extends Dw{constructor(){super(...arguments);this.name=bNr;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(vu).get(o);return c?(N2e(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:jj(c.displayText)},c.copilotAnnotations),!0):!1}},gFi=[CNr];var r_c=[...rJn,...nJn,...mFi,...gFi];function AFi(t,e){let r=new Map;for(let n of r_c){let o=new n(t),s=Mu.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=b6(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Lr).getEditorPluginInfo();await e.get(bi).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Lr).getEditorPluginInfo(),n=await e.get(bi).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,iBe.gt)((0,iBe.coerce)(r.version),(0,iBe.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Lr).getEditorPluginInfo();await e.get(bi).delete("versions",r.name),(await e.get(bi).listKeys("versions")).length===0&&await e.get(bi).deleteSetting("versions")}};p();var CFi=he(Jc()),bFi=require("crypto"),xvt=he(require("path")),IAe=he(ml());var o_c={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},s_c=new IAe.ProgressType,QD=class t{constructor(e){this.ctx=e;this.#e=new ro;this._changeHandlerLimiter=new CFi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new IAe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ur).connection}init(){this.ctx.get(Mn).getCapabilities().watchedFiles&&this.connection.onNotification(IAe.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(Mn).getCapabilities().watchedFiles)return o_c;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(Mn).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=xvt.extname(l).toLowerCase();E7.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=xvt.extname(s.uri).toLowerCase();if(!E7.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.getValidDocument(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 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,bFi.randomUUID)(),n=[],o=this.connection.onProgress(s_c,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=xvt.extname(l).toLowerCase();if(!E7.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();p();p();var SFi=new Ee("AgentRouter"),TFi="AgentRouter";function WT(t){return t.agentProvider??"BACKGROUND"}a(WT,"resolveProvider");var wc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Bs);case"CLAUDE":return this.ctx.get(SF)}}logDispatch(e,r){SFi.debug(this.ctx,`${TFi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=WT(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=WT(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=WT(e);return this.serviceFor(n).sendMessage(e,r)}stop(e){this.logDispatch("stop",e);let r=WT(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=WT(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=WT(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=WT(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=WT(e);return this.serviceFor(r).handleInteraction(e)}getPlanPath(e){this.logDispatch("getPlanPath",e);let r=WT(e);return this.serviceFor(r).getPlanPath(e.sessionId)}enableRemote(e){this.logDispatch("enableRemote",e);let r=WT(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=WT(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=WT(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=WT(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{SFi.info(this.ctx,`${TFi}.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 a_c=S.Union([S.String(),S.Number()]),Fi=S.String(),xAe=S.Optional(S.Union([S.Literal("none"),S.Literal("low"),S.Literal("medium"),S.Literal("high"),S.Literal("xhigh")])),c_c=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())}),SNr=S.Array(c_c),oBe=S.Union([S.Literal("default"),S.Literal("long_context")]),wAe=S.Object({model:S.Optional(S.String()),reasoningEffort:xAe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(SNr),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean())});async function Ti(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof wZ?e.data:void 0;return[null,{code:it.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Ti,"withServiceErrorHandling");var IFi=new Ee("BackgroundAgent.compactHistory"),l_c=S.Object({sessionId:Fi});async function TNr(t,e,r){IFi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Bs),o=e.onCancellationRequested(()=>{IFi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await Ti(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(TNr,"handleBackgroundAgentCompactHistoryChecked");var SFp=je(l_c,TNr);p();var u_c=S.Union(Object.values(t0).map(t=>S.Literal(t))),kl=S.Optional(u_c),wvt=S.Intersect([wAe,S.Object({agentProvider:kl})]);var xFi=new Ee("BackgroundAgent.compactHistory"),d_c=S.Object({sessionId:Fi,agentProvider:kl});async function f_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return TNr(t,e,r);xFi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.compactHistory(s,e);return xFi.info(t,"compactHistory succeeded"),c})}a(f_c,"handleAgentCompactHistoryChecked");var wFi=je(d_c,f_c);p();p();var RFi=new Ee("BackgroundAgent.create"),p_c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),wAe]);async function INr(t,e,r){RFi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Bs),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};return Ti(async()=>{let s=await n.createSession(o);return RFi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(INr,"handleBackgroundAgentCreateChecked");var ZFp=je(p_c,INr);var PFi=new Ee("BackgroundAgent.create"),h_c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),wvt]);async function m_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return INr(t,e,r);PFi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.create(s);return PFi.info(t,"create succeeded:",c.sessionId),c})}a(m_c,"handleAgentCreateChecked");var kFi=je(h_c,m_c);p();p();var g_c=S.Object({sessionId:Fi});async function xNr(t,e,r){let n=t.get(Bs);return Ti(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(xNr,"handleBackgroundAgentDestroyChecked");var y8p=je(g_c,xNr);var A_c=new Ee("BackgroundAgent.destroy"),y_c=S.Object({sessionId:Fi,agentProvider:kl});async function E_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return xNr(t,e,r);A_c.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.destroy(s))}a(E_c,"handleAgentDestroyChecked");var DFi=je(y_c,E_c);p();p();var __c=new Ee("BackgroundAgent.disableRemote"),v_c=S.Object({sessionId:Fi});async function wNr(t,e,r){__c.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Bs);return Ti(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(wNr,"handleBackgroundAgentDisableRemoteChecked");var U8p=je(v_c,wNr);var NFi=new Ee("BackgroundAgent.disableRemote"),C_c=S.Object({sessionId:Fi,agentProvider:kl});async function b_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return wNr(t,e,r);NFi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.disableRemote(s);return NFi.info(t,"disableRemote succeeded"),c})}a(b_c,"handleAgentDisableRemoteChecked");var MFi=je(C_c,b_c);p();p();var S_c=new Ee("BackgroundAgent.enableRemote"),T_c=S.Object({sessionId:Fi});async function RNr(t,e,r){S_c.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Bs);return Ti(async()=>n.enableRemote(r.sessionId))}a(RNr,"handleBackgroundAgentEnableRemoteChecked");var s6p=je(T_c,RNr);var OFi=new Ee("BackgroundAgent.enableRemote"),I_c=S.Object({sessionId:Fi,agentProvider:kl});async function x_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return RNr(t,e,r);OFi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.enableRemote(s);return OFi.info(t,"enableRemote succeeded"),c})}a(x_c,"handleAgentEnableRemoteChecked");var BFi=je(I_c,x_c);p();p();var w_c=S.Object({sessionId:Fi});async function PNr(t,e,r){let n=t.get(Bs);return Ti(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(PNr,"handleBackgroundAgentGetPlanPathChecked");var I6p=je(w_c,PNr);var R_c=new Ee("BackgroundAgent.getPlanPath"),P_c=S.Object({sessionId:Fi,agentProvider:kl});async function k_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[c,l]=await PNr(t,e,r);return l?[null,l]:[c.path,null]}R_c.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.getPlanPath(s))}a(k_c,"handleAgentGetPlanPathChecked");var LFi=je(P_c,k_c);p();p();var D_c=new Ee("BackgroundAgent.getRemoteStatus"),N_c=S.Object({sessionId:Fi});async function kNr(t,e,r){D_c.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Bs);return Ti(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(kNr,"handleBackgroundAgentGetRemoteStatusChecked");var W6p=je(N_c,kNr);var M_c=new Ee("BackgroundAgent.getRemoteStatus"),O_c=S.Object({sessionId:Fi,agentProvider:kl});async function B_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return kNr(t,e,r);M_c.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.getRemoteStatus(s))}a(B_c,"handleAgentGetRemoteStatusChecked");var FFi=je(O_c,B_c);p();p();var L_c=new Ee("BackgroundAgent.interaction"),F_c=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()})]),U_c=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Q_c=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())])))}),q_c=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())}),j_c=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),H_c=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())})]),G_c=S.Union([S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("permission"),result:F_c}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("user_input"),response:U_c}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("elicitation"),response:Q_c}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:q_c}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("queued_command"),result:j_c}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("external_tool"),result:H_c})]);async function DNr(t,e,r){L_c.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Bs);return Ti(async()=>await n.handleInteraction(r))}a(DNr,"handleBackgroundAgentInteractionChecked");var h9p=je(G_c,DNr);var UFi=new Ee("BackgroundAgent.interaction"),$_c=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()})]),V_c=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),W_c=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())])))}),z_c=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())}),Y_c=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),K_c=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())})]),J_c=S.Union([S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("permission"),result:$_c,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("user_input"),response:V_c,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("elicitation"),response:W_c,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:z_c,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("queued_command"),result:Y_c,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("external_tool"),result:K_c,agentProvider:kl})]);async function Z_c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return DNr(t,e,r);UFi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.interaction(s);return UFi.info(t,"interaction succeeded"),c})}a(Z_c,"handleAgentInteractionChecked");var QFi=je(J_c,Z_c);p();p();var qFi=new Ee("BackgroundAgent.listSessions"),X_c=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function NNr(t,e,r){qFi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Bs);return Ti(async()=>{let o=await n.listSessions(r);return qFi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(NNr,"handleBackgroundAgentSessionsListChecked");var B9p=je(X_c,NNr);var jFi=new Ee("BackgroundAgent.listSessions"),evc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:kl});async function tvc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return NNr(t,e,r);jFi.info(t,"handleAgentSessionsList called",r);let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.listSessions(s);return jFi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(tvc,"handleAgentSessionsListChecked");var HFi=je(evc,tvc);p();p();var GFi=new Ee("BackgroundAgent.listModels"),rvc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function MNr(t,e,r){GFi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Bs);return Ti(async()=>{let o=await n.listModels(r.forceRefresh);return GFi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(MNr,"handleBackgroundAgentListModelsChecked");var iUp=je(rvc,MNr);var $Fi=new Ee("BackgroundAgent.listModels"),nvc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:kl});async function ivc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return MNr(t,e,r);$Fi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.listModels(s);return $Fi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(ivc,"handleAgentListModelsChecked");var VFi=je(nvc,ivc);p();p();var WFi=new Ee("BackgroundAgent.resume"),ovc=S.Intersect([S.Object({sessionId:Fi}),wAe]);async function ONr(t,e,r){WFi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Bs),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};return Ti(async()=>{let s=await n.resumeSession(o);return WFi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(ONr,"handleBackgroundAgentResumeChecked");var TUp=je(ovc,ONr);var zFi=new Ee("BackgroundAgent.resume"),svc=S.Intersect([S.Object({sessionId:Fi}),wvt]);async function avc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return ONr(t,e,r);zFi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.resume(s);return zFi.info(t,"resume succeeded:",c.sessionId),c})}a(avc,"handleAgentResumeChecked");var YFi=je(svc,avc);p();p();var cvc=S.Union([S.Literal(""),...Object.values(go).map(t=>S.Literal(t))]),lvc=["interactive","plan","autopilot"],uvc=S.Union(lvc.map(t=>S.Literal(t))),dvc=S.String({minLength:1}),fvc=S.Object({sessionId:Fi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(cvc),reasoningEffort:xAe,references:S.Optional(S.Array(WM)),agentMode:S.Optional(uvc),chatMode:S.Optional(dvc),contextTier:S.Optional(oBe),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function BNr(t,e,r){let n=t.get(Bs),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 Ti(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(BNr,"handleBackgroundAgentSendChecked");var zUp=je(fvc,BNr);var KFi=new Ee("BackgroundAgent.send"),pvc=S.Union([S.Literal(""),...Object.values(go).map(t=>S.Literal(t))]),hvc=["interactive","plan","autopilot"],mvc=S.Union(hvc.map(t=>S.Literal(t))),gvc=S.String({minLength:1}),Avc=S.Object({sessionId:Fi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(pvc),reasoningEffort:xAe,references:S.Optional(S.Array(WM)),agentMode:S.Optional(mvc),chatMode:S.Optional(gvc),contextTier:S.Optional(oBe),agentProvider:kl});async function yvc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return BNr(t,e,r);KFi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.send(s,e);return KFi.info(t,"resume succeeded:",c.messageId),c})}a(yvc,"handleAgentSendChecked");var JFi=je(Avc,yvc);p();p();var Evc=new Ee("BackgroundAgent.stop"),_vc=S.Object({sessionId:Fi});async function LNr(t,e,r){Evc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Bs);return Ti(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(LNr,"handleBackgroundAgentStopChecked");var A7p=je(_vc,LNr);var vvc=new Ee("BackgroundAgent.stop"),Cvc=S.Object({sessionId:Fi,agentProvider:kl});async function bvc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await LNr(t,e,r);return c?[null,c]:[void 0,null]}vvc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.stop(s))}a(bvc,"handleAgentStopChecked");var ZFi=je(Cvc,bvc);p();var Svc=S.Object({});async function Tvc(t,e,r){return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Fr).listAvailableTokens()},null]}a(Tvc,"handleListAvailableTokensChecked");var XFi=je(Svc,Tvc);p();var Ivc=S.Object({tokenId:S.Number()});async function xvc(t,e,r){return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Fr).useExistingToken(r.tokenId),null]}a(xvc,"handleUseExistingTokenChecked");var e8i=je(Ivc,xvc);p();var wvc=S.Object({providerName:S.String()});async function Rvc(t,e,r){try{let{providerName:n}=r,o=tQ(n);if(o!==0)return[null,{code:it.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new vc(t.get(bi));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(Rvc,"handleBYOKDeleteApiKeyChecked");var t8i=je(wvc,Rvc);p();var Pvc=S.Object({providerName:S.String(),modelId:S.String()});async function kvc(t,e,r){try{let n=new vc(t.get(bi)),{providerName:o,modelId:s}=r,c=tQ(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:it.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(kvc,"handleBYOKDeleteModelChecked");var r8i=je(Pvc,kvc);p();var Dvc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())});async function Nvc(t,e,r){try{let n=new vc(t.get(bi)),{providerName:o,modelId:s}=r;if(!o){let l=t.get(bi),u=await l.listKeys("byok"),d=[];for(let f of u)if(f.endsWith("-api-key")){let h=await l.read("byok",f);if(h){let g=f.replace("-api-key","").split("-");if(g.length===1)d.push({providerName:g[0],apiKey:h});else if(g.length>=2){let A=g[0],y=g.slice(1).join("-");d.push({providerName:A,modelId:y,apiKey:h})}}}return[{apiKeys:d},null]}return[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(Nvc,"handleBYOKListApiKeysChecked");var n8i=je(Dvc,Nvc);p();p();p();xMr();var BCt=class extends Sx{static{a(this,"AnthropicProvider")}constructor(e){super(go.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new vc(this.ctx.get(bi)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new $4({apiKey:e,fetch:Bbc(this.ctx.get(fr))});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 aTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function Bbc(t){return async(e,r)=>{let n=Lbc(e,r),o=Ubc(r),s=await t.fetch(n,o);return qbc(s)}}a(Bbc,"createAnthropicFetchAdapter");function Lbc(t,e){return t instanceof Request?(Fbc(t,e),t.url):t instanceof URL?t.toString():t}a(Lbc,"convertInputToString");function Fbc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(Fbc,"mergeRequestInit");function Ubc(t){let e;return t?.headers&&(e=Qbc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(Ubc,"convertToFetchOptions");function Qbc(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(Qbc,"convertHeaders");async function qbc(t){let e=t.body(),r=null;if(e)r=jbc(e);else{let n=await t.text();r=Gbc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(qbc,"convertToWebResponse");function jbc(t){return new ReadableStream({start(e){let r=Hbc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(jbc,"createReadableStreamFromNodeStream");function Hbc(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(Hbc,"setupStreamHandlers");function Gbc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(Gbc,"createReadableStreamFromText");p();var LCt=class extends Sx{static{a(this,"GeminiProvider")}constructor(e){super(go.Gemini,e)}};p();var FCt=class extends Sx{static{a(this,"GroqProvider")}constructor(e){super(go.Groq,e)}};p();var UCt=class extends Sx{static{a(this,"OpenAIProvider")}constructor(e){super(go.OpenAI,e)}};p();var T9i=16e3,QCt=class extends Sx{static{a(this,"OpenRouterProvider")}constructor(e){super(go.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new vc(this.ctx.get(bi)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(fr).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-T9i),maxOutputTokens:T9i,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw aTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var sne=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[go.OpenAI,new UCt(e)],[go.Gemini,new LCt(e)],[go.Groq,new FCt(e)],[go.OpenRouter,new QCt(e)],[go.Anthropic,new BCt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var $bc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function Vbc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new vc(t.get(bi)),c=[];if(n)if(o){if(!yce(n))return[null,{code:it.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:it.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(sne).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=Object.values(go);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:it.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(Vbc,"handleBYOKListModelsChecked");var I9i=je($bc,Vbc);p();var Wbc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function zbc(t,e,r){try{let n=new vc(t.get(bi)),{providerName:o,apiKey:s,modelId:c}=r,l=tQ(o);if(l===1&&!c)return[null,{code:it.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:it.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(zbc,"handleBYOKSaveApiKeyChecked");var x9i=je(Wbc,zbc);p();var Ybc=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 Kbc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new vc(t.get(bi)),h=tQ(n);if(h===1&&!l)return[null,{code:it.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];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:it.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(Kbc,"handleBYOKSaveModelChecked");var w9i=je(Ybc,Kbc);p();var Jbc=S.Object({cliPath:S.String()});async function Zbc(t,e,r){return[await ipe.check(r.cliPath),null]}a(Zbc,"handleCheckClaudeCliCompatibilityChecked");var R9i=je(Jbc,Zbc);p();var Xbc=S.Object({uri:S.String({minLength:1})});async function e1c(t,e,r){let n=await t.get(ni).getOrReadTextDocument(r);return[{status:zu(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(e1c,"handleCheckFileStatusChecked");var P9i=je(Xbc,e1c);p();var t1c=S.Object({});function k9i(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(k9i,"calculatePercentRemaining");function POr(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(POr,"buildQuotaSnapshot");async function r1c(t,e,r){let n=await t.get(Fr).resolveSession();if(!n)return[null,{code:it.InternalError,message:"Not signed in"}];let o=await Ave(t,n);if(o.ok){let s=await o.json();return t.get(lu).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:POr(s.quota_snapshots?.chat),completions:POr(s.quota_snapshots?.completions),premiumInteractions:POr(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:k9i(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:k9i(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:it.InternalError,message:"Failed to fetch quota info"}]}a(r1c,"handleCheckQuotaChecked");var D9i=je(t1c,r1c);p();var n1c=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function i1c(t,e,r){return[await t.get(Fr).checkAndUpdateStatus(r.options),null]}a(i1c,"handleCheckStatusChecked");var N9i=je(n1c,i1c);p();var o1c=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function s1c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let o=await new zy(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return _t(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(gi(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof Wy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Rd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(s1c,"handleCloudAgentAddPullRequestCommentChecked");var M9i=je(o1c,s1c);p();var a1c=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function c1c(t,e,r){try{let o=await new wx(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:it.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(yt(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),_t(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new zy(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),yt(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),_t(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:it.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(La(t,n,"githubApi.cancelCodingAgent"),gi(t,"githubApi.cancelCodingAgent",n),n instanceof xx)return[null,{code:it.NoCopilotToken,message:n.message}];if(n instanceof Kf)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof z0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Wy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Rd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(c1c,"handleCancelCodingAgentChecked");var O9i=je(a1c,c1c);p();var l1c=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Mc))});function u1c(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(u1c,"pickWorkspaceFolder");async function d1c(t,e,r){try{let n=u1c(r);if(!n)return[null,{code:it.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a Coding Agent job."}];let s=await new V0(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:it.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:it.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new RQ([new PQ,new kQ]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:it.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a Coding Agent job."}];let u=l.currentBranch,d=Vze(r.problemStatement);if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let h=await new wx(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return _t(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(gi(t,"cloudAgent.createJob",n,{result:"error"}),I8t(n))return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];if(n instanceof xx)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Kf)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof z0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Wy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Rd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(d1c,"handleCloudAgentCreateJobChecked");var B9i=je(l1c,d1c);p();var f1c=S.Object({sessionId:S.String({minLength:1})});async function p1c(t,e,r){try{let o=await new wx(t).getSessionLogs(r.sessionId,e);return _t(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(gi(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof xx)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Kf||n instanceof z0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(p1c,"handleCloudAgentGetSessionLogsChecked");var L9i=je(f1c,p1c);p();var h1c=S.Object({pullRequestId:S.Integer()});async function m1c(t,e,r){try{let o=await new wx(t).getAllSessions(r.pullRequestId,e);return _t(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(gi(t,"cloudAgent.listSessions",n),n instanceof xx)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Kf||n instanceof z0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(m1c,"handleCloudAgentListSessionsChecked");var F9i=je(h1c,m1c);p();var g1c=S.Object({});async function A1c(t,e,r){return[(await Ix(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(A1c,"handleConversationAgentsChecked");var U9i=je(g1c,A1c);p();p();var $Be=he(ml());function y1c(t,e,r){let n=Vt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return yt(t,"getCompletions.docVersionMismatch",n)}a(y1c,"telemetryVersionMismatch");async function O6(t,e,r){let o=t.get(an).getTextDocumentUnsafe(e);if(!o)throw new $Be.ResponseError(it.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await hce(t,e,o.getText());if(s.status==="invalid")throw t.get(os).setClsInactive(s.reason),new $Be.ResponseError(it.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(y1c(t,o,e.version),gs.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new $Be.ResponseError(it.ContentModified,"Document Version Mismatch");return o}a(O6,"getTextDocument");async function V4(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await O6(t,n,r)}catch(o){if(o instanceof $Be.ResponseError){if(o.code===it.CopilotNotAvailable)return;if(o.code===it.InvalidParams){gs.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(V4,"getTextDocumentIfAvailable");var E1c=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),_1c=S.Object({turnId:$Y,codeBlockIndex:S.Number(),source:E1c,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(pYe),textDocument:S.Optional(bC),position:S.Optional(ng),conversationSource:S.Optional(zM)});async function v1c(t,e,r){let n=await V4(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=aQ(r.conversationSource),l=t.get(jo).findByTurnId(r.turnId),u=await Yc(t,l,{languageId:n?.detectedLanguageId??""});return vS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${Gy(c)}.acceptedCopy`,u),["OK",null]}a(v1c,"handleConversationCodeCopyChecked");var Q9i=je(_1c,v1c);p();var C1c=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),b1c=S.Object({turnId:$Y,source:C1c,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(pYe),textDocument:S.Optional(bC),position:S.Optional(ng),conversationSource:S.Optional(zM)});async function S1c(t,e,r){let n=await V4(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=aQ(r.conversationSource),l=t.get(jo).findByTurnId(r.turnId),u=await Yc(t,l,{languageId:n?.detectedLanguageId??""});return vS(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=jt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});ht(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=jt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});ht(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=jt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});ht(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=jt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});ht(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});ht(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=jt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});ht(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){Ye.error(this.ctx,`Failed to initialize new partition transcript: ${c instanceof Error?c.message:String(c)}`)}}};p();p();var Tbt=ce(wo());var Sbt=class extends sr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Tbt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(Tbt.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});yt(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});yt(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});yt(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});yt(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});yt(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});yt(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 HCt=he(Io());var jCt=class extends ar{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(HCt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(HCt.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. @@ -3738,7 +3695,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(LYe({role:"user",content:RS(o.request.message)})),o.response){let s=GM(o.response.message,!0),c=tO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(Mx,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new Z0(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(iYe({role:"user",content:CS(o.request.message)})),o.response){let s=NM(o.response.message,!0),c=GM(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(Rx,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new J0(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. @@ -3756,7 +3713,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}};Ns();var JD=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 Kf.create(Sbt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=gA.user(o,gr()),f=NI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(rc)}catch{h=new rc(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),Ye.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 Ye.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 Ye.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=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});ht(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});ht(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});ht(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});ht(this.ctx,"partition.summary.cancelled",s,0)}};var xxc=S.Object({conversationId:S.String()});async function wxc(t,e,r){let{conversationId:n}=r,o=Date.now();Ye.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(oI);Rxc(t,n,o);try{if(e.isCancellationRequested)return Ye.debug(t,`Manual compression cancelled before start: ${n}`),[ELe(n,"Compression cancelled"),null];let c=t.get(Vo),l;try{l=c.get(n)}catch{return Ye.warn(t,`Conversation not found: ${n}`),_Le(t,n,0,"Conversation not found",Date.now()-o),[ELe(n,`Conversation not found: ${n}`),null]}let u=l.turns.length;if(u===0)return Ye.warn(t,`Cannot compress conversation with 0 turns: ${n}`),_Le(t,n,0,"No turns to compress",Date.now()-o),[ELe(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 Ye.warn(t,`Cannot compress - no new turns since last compression: ${n}`),_Le(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[ELe(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(Bc).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(JD),y=new BR(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;Ye.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${_.archivedPartitionId}, newPartitionId=${_.newPartitionId}, turnCount=${u}, summaryLength=${b.length}, durationMs=${T}`);let w;try{w=new fq().calculateContextSize(t,l,m)}catch(R){Ye.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}),kxc(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 Ye.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),_Le(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 Ye.exception(t,c,`Manual compression error: conversationId=${n}`),_Le(t,n,0,l,u),[ELe(n,`Compression failed: ${l}`),null]}}a(wxc,"handleConversationCompressChecked");function ELe(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(ELe,"createErrorResult");function Rxc(t,e,r,n){let o=jt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});ht(t,"conversationPartition.manualCompression.started",o,0)}a(Rxc,"sendStartedTelemetry");function kxc(t,e,r,n,o,s,c,l){let u=jt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});ht(t,"conversationPartition.manualCompression.completed",u,0)}a(kxc,"sendCompletedTelemetry");function _Le(t,e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});ht(t,"conversationPartition.manualCompression.failed",c,0)}a(_Le,"sendFailedTelemetry");var f7i=Ne(xxc,wxc);p();p();var Ibt=S.Array(hf);function xbt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(xbt,"resolveAsActiveEditor");p();var p7i=ce(Al());var wbt=new p7i.ProgressType,O5r=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new fq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ur).connection.sendProgress(wbt,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(ur).connection.sendProgress(wbt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ur).connection.sendProgress(wbt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ur).connection.sendProgress(wbt,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){Ye.error(e,"Failed to calculate context size",o);return}}};function Vye(t){return new O5r(t.workDoneToken)}a(Vye,"createProgressHandler");p();var h7i=ce(Al());var Wye=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 h7i.ResponseError(Ke.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function Rbt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:ji(t.uri)}]}a(Rbt,"resolveAsWorkspaceFolders");p();p();var Pxc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),qE=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?Pxc(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 ZD=class{constructor(){this.tokens=new nn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new qn.CancellationTokenSource,o=new qE([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 m7i(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(m7i,"calculateBillingMultiplier");function kbt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.model,modelProviderName:e.modelProviderName,userRequestedModel:e.model,reasoningEffort:e.modelInfo?.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:m7i(r)}}a(kbt,"buildTurnSummary");function Pbt(t,e,r,n,o,s){let c={lspMethod:e,conversationId:String(r.id),turnId:String(n.id)};tV(c,"modelName",o.modelName),tV(c,"modelProviderName",o.modelProviderName),tV(c,"userRequestedModel",o.userRequestedModel),tV(c,"reasoningEffort",o.reasoningEffort),tV(c,"chatMode",o.chatMode),tV(c,"agentSlug",o.agentSlug);let l={};tV(l,"billingMultiplier",o.billingMultiplier),tV(l,"credits",s),gt(t,"conversation.turnCompleted",c,l)}a(Pbt,"sendTurnTelemetry");function Dbt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(Dbt,"formatCredits");function tV(t,e,r){r!==void 0&&(t[e]=r)}a(tV,"assignDefined");var Dxc=S.Object({conversationId:S.Optional(ZYe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(a_n,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(Rv),textDocument:S.Optional(Rv),selection:S.Optional(hf),visibleRanges:S.Optional(Ibt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(oO)),source:S.Optional(sO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),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(rKe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(nKe)),restoreToTurnId:S.Optional(S.String())});async function Nxc(t,e,r){Wye.validate(r.workspaceFolders);let n=await iB(t,r,e),o=await t.get(Vo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(X0).setTodos(o,r.todoList);let s=o.turns.length>0?r.turns.slice(-1):r.turns;await Mxc(t,o,{...r,turns:s},n);let c=o.turns[o.turns.length-1],l=Vye(r),u=t.get(ZD).add(l.progressToken,e),d=new Wx(t,o,c,u),f=await t.get(XD).createProcessor(d,l.progressToken,r.computeSuggestions),h=t.get(Rd),m=String(c.id);h.resetTurnCredits(m);let g;try{await f.process(l,u,void 0,n,r.model,r.modelProviderName,r.modelInfo),g=h.getCreditsForTurn(m)}finally{h.resetTurnCredits(m)}let A=kbt(c,r);return Pbt(t,"conversation/create",o,c,A,g),[{conversationId:o.id,turnId:c.id,agentSlug:A.agentSlug,modelName:A.modelName,modelProviderName:A.modelProviderName,billingMultiplier:A.billingMultiplier,modelInfo:r.modelInfo,credits:Dbt(g)},null]}a(Nxc,"handleConversationCreateChecked");async function Mxc(t,e,r,n){for(let o of r.turns){let s=eKe(o.request),c=new Gf({message:s,type:"user"},o.turnId);o.response&&(c.response={message:o.response,type:"model"}),o.agentSlug&&(c.agent={agentSlug:o.agentSlug});let l=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,u=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Rbt(l),d=t.get(x_),f=eQ(r.chatMode);c.chatMode=await d.getChatMode(f,r.customChatModeId,u),c.userRequestedModel=o.model??r.model,c.needToolCallConfirmation=r.needToolCallConfirmation;let h=xbt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Vo).addTurn(e.id,c,r.references,h,l,u,r.ignoredSkills,void 0)}}a(Mxc,"addTurns");var g7i=Ne(Dxc,Nxc);p();var Oxc=S.Object({conversationId:S.String()});function Bxc(t,e,r){return t.get(Vo).destroy(r.conversationId),["OK",null]}a(Bxc,"handleConversationDestroyChecked");var A7i=Ne(Oxc,Bxc);p();var Lxc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function Fxc(t,e,r){return[(await t.get(x_).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(Fxc,"handleConversationModesChecked");var y7i=Ne(Lxc,Fxc);p();var Uxc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),Qxc=new ge("conversationNotifyCodeAcceptance");async function qxc(t,e,r){let n=t.get(Vo).findByTurnId(r.turnId);if(!n)return Qxc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await Jc(t,n,{languageId:""});return wS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${Hy("agentPanel")}.codeAcceptance`,o),["OK",null]}a(qxc,"handleConversationNotifyCodeAcceptanceChecked");var E7i=Ne(Uxc,qxc);p();var jxc=S.Object({});function Hxc(t,e,r){return[{path:t.get(Si).directory},null]}a(Hxc,"handleConversationPersistenceChecked");var _7i=Ne(jxc,Hxc);p();p();var B5r=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Ur).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},L5r=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},Gxc=[new B5r,new L5r],LR=class{constructor(e,r=Gxc){this.ctx=e;this.checks=r;this.emitter=new no;this.onChange=this.emitter.event;Es(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 $xc=S.Object({forceCheck:S.Optional(S.Boolean())});async function Vxc(t,e,r){let n=r.forceCheck??!1;return[await t.get(LR).check(n),null]}a(Vxc,"handleConversationPreconditionsChecked");var C7i=Ne($xc,Vxc);p();var Wxc=S.Object({turnId:S.String(),rating:S.Number(),doc:S.Optional(Rv),textDocument:S.Optional(Rv),source:S.Optional(sO)});async function zxc(t,e,r){let n=await iB(t,r,e),o=bQ(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await Jc(t,t.get(Vo).findByTurnId(r.turnId),{languageId:n?.detectedLanguageId??""}),l=`${Hy(o)}.messageRating`,u=wS(t,n,{rating:s,uiKind:o},{},l,c);return MI(t,l,u),["OK",null]}a(zxc,"handleConversationRatingChecked");var v7i=Ne(Wxc,zxc);p();var Yxc=S.Object({tools:S.Array(c_n)});function Kxc(t,e,r){let n=t.get(us);return r.tools.forEach(s=>{n.registerTool(new Sq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(Kxc,"conversationRegisterToolsChecked");var b7i=Ne(Yxc,Kxc);p();var Jxc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function Zxc(t,e,r){let n=yHt(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(ag),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).filter(u=>!n.some(d=>d.id===u.name)).map(u=>({id:u.name,description:u.description||"",shortDescription:"",scopes:Xxc(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(EA).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${ji(tf(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(Zxc,"handleConversationTemplatesChecked");function Xxc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(Xxc,"getCustomPromptScopes");var S7i=Ne(Jxc,Zxc);p();var ewc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:ZYe,turnId:S.Optional(uK),message:T7t,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(Rv),textDocument:S.Optional(Rv),selection:S.Optional(hf),visibleRanges:S.Optional(Ibt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(oO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Omn,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(rKe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(nKe))});async function twc(t,e,r){Wye.validate(r.workspaceFolders);let n=await iB(t,r,e),o=t.get(Vo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(X0).setTodos(s,r.todoList);let c=eKe(r.message),l=new Gf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Rbt(u),f=t.get(x_),h=eQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=r.model,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let m=xbt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,m,u,d,r.ignoredSkills,r.confirmationResponse);let g=Vye(r),A=t.get(ZD).add(g.progressToken,e),y=new Wx(t,s,l,A),E=await t.get(XD).createProcessor(y,g.progressToken,r.computeSuggestions),_=t.get(Rd),v=String(l.id);_.resetTurnCredits(v);let b;try{await E.process(g,A,r.followUp,n,r.model,r.modelProviderName,r.modelInfo),b=_.getCreditsForTurn(v)}finally{_.resetTurnCredits(v)}let T=kbt(l,r);return Pbt(t,"conversation/turn",s,l,T,b),[{conversationId:s.id,turnId:l.id,agentSlug:T.agentSlug,modelName:T.modelName,modelProviderName:T.modelProviderName,billingMultiplier:T.billingMultiplier,modelInfo:r.modelInfo,credits:Dbt(b)},null]}a(twc,"handleConversationTurnChecked");var T7i=Ne(ewc,twc);p();var rwc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(sO)});async function nwc(t,e,r){t.get(Vo).deleteTurn(r.conversationId,r.turnId);let o=bQ(r.source),s=await Jc(t,t.get(Vo).findByTurnId(r.turnId),{languageId:""});return wS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${Hy(o)}.messageDelete`,s),["OK",null]}a(nwc,"handleConversationTurnDeleteChecked");var I7i=Ne(rwc,nwc);p();var iwc=S.Object({toolIds:S.Array(S.String())});function owc(t,e,r){let n=t.get(us);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(owc,"conversationUnregisterToolsChecked");var x7i=Ne(iwc,owc);p();var swc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(JL)}))});async function awc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(x_).getChatMode(n?eQ(n):"Agent",o,s),l=t.get(us),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(awc,"conversationUpdateToolsStatusChecked");var w7i=Ne(swc,awc);p();p();Ns();var cwc=5e3,Sne=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}};As();var HD=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 Jf.create(jCt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=EA.user(o,ir()),f=xI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(ec)}catch{h=new ec(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});yt(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});yt(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});yt(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});yt(this.ctx,"partition.summary.cancelled",s,0)}};var T1c=S.Object({conversationId:S.String()});async function I1c(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(XT);x1c(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[VBe(n,"Compression cancelled"),null];let c=t.get(jo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),WBe(t,n,0,"Conversation not found",Date.now()-o),[VBe(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}`),WBe(t,n,0,"No turns to compress",Date.now()-o),[VBe(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}`),WBe(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[VBe(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(zc).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(HD),y=new RR(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 zQ().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}),w1c(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}`),WBe(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}`),WBe(t,n,0,l,u),[VBe(n,`Compression failed: ${l}`),null]}}a(I1c,"handleConversationCompressChecked");function VBe(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(VBe,"createErrorResult");function x1c(t,e,r,n){let o=Vt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});yt(t,"conversationPartition.manualCompression.started",o,0)}a(x1c,"sendStartedTelemetry");function w1c(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});yt(t,"conversationPartition.manualCompression.completed",u,0)}a(w1c,"sendCompletedTelemetry");function WBe(t,e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});yt(t,"conversationPartition.manualCompression.failed",c,0)}a(WBe,"sendFailedTelemetry");var j9i=je(T1c,I1c);p();p();var GCt=S.Array(ff);function $Ct(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a($Ct,"resolveAsActiveEditor");p();var H9i=he(ml());var VCt=new H9i.ProgressType,kOr=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new zQ}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ur).connection.sendProgress(VCt,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(ur).connection.sendProgress(VCt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ur).connection.sendProgress(VCt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ur).connection.sendProgress(VCt,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 bye(t){return new kOr(t.workDoneToken)}a(bye,"createProgressHandler");p();var G9i=he(ml());var Sye=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 G9i.ResponseError(it.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function WCt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ki(t.uri)}]}a(WCt,"resolveAsWorkspaceFolders");p();p();var R1c=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),FE=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?R1c(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 GD=class{constructor(){this.tokens=new yn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new qn.CancellationTokenSource,o=new FE([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 $9i(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a($9i,"calculateBillingMultiplier");function zCt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.model,modelProviderName:e.modelProviderName,userRequestedModel:e.model,reasoningEffort:e.modelInfo?.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:$9i(r)}}a(zCt,"buildTurnSummary");function YCt(t,e,r,n,o,s){let c={lspMethod:e,conversationId:String(r.id),turnId:String(n.id)};L$(c,"modelName",o.modelName),L$(c,"modelProviderName",o.modelProviderName),L$(c,"userRequestedModel",o.userRequestedModel),L$(c,"reasoningEffort",o.reasoningEffort),L$(c,"chatMode",o.chatMode),L$(c,"agentSlug",o.agentSlug);let l={};L$(l,"billingMultiplier",o.billingMultiplier),L$(l,"credits",s),_t(t,"conversation.turnCompleted",c,l)}a(YCt,"sendTurnTelemetry");function KCt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(KCt,"formatCredits");function L$(t,e,r){r!==void 0&&(t[e]=r)}a(L$,"assignDefined");var P1c=S.Object({conversationId:S.Optional(fYe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(Syn,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(bC),textDocument:S.Optional(bC),selection:S.Optional(ff),visibleRanges:S.Optional(GCt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(WM)),source:S.Optional(zM),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),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(gYe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(AYe)),restoreToTurnId:S.Optional(S.String())});async function k1c(t,e,r){Sye.validate(r.workspaceFolders);let n=await V4(t,r,e),o=await t.get(jo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(X0).setTodos(o,r.todoList);let s=o.turns.length>0?r.turns.slice(-1):r.turns;await D1c(t,o,{...r,turns:s},n);let c=o.turns[o.turns.length-1],l=bye(r),u=t.get(GD).add(l.progressToken,e),d=new Qx(t,o,c,u),f=await t.get($D).createProcessor(d,l.progressToken,r.computeSuggestions),h=t.get(lu),m=String(c.id);h.resetTurnCredits(m);let g;try{await f.process(l,u,void 0,n,r.model,r.modelProviderName,r.modelInfo),g=h.getCreditsForTurn(m)}finally{h.resetTurnCredits(m)}let A=zCt(c,r);return YCt(t,"conversation/create",o,c,A,g),[{conversationId:o.id,turnId:c.id,agentSlug:A.agentSlug,modelName:A.modelName,modelProviderName:A.modelProviderName,billingMultiplier:A.billingMultiplier,modelInfo:r.modelInfo,credits:KCt(g)},null]}a(k1c,"handleConversationCreateChecked");async function D1c(t,e,r,n){for(let o of r.turns){let s=hYe(o.request),c=new $f({message:s,type:"user"},o.turnId);o.response&&(c.response={message:o.response,type:"model"}),o.agentSlug&&(c.agent={agentSlug:o.agentSlug});let l=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,u=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:WCt(l),d=t.get(S_),f=Q7(r.chatMode);c.chatMode=await d.getChatMode(f,r.customChatModeId,u),c.userRequestedModel=o.model??r.model,c.needToolCallConfirmation=r.needToolCallConfirmation;let h=$Ct({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(jo).addTurn(e.id,c,r.references,h,l,u,r.ignoredSkills,void 0)}}a(D1c,"addTurns");var V9i=je(P1c,k1c);p();var N1c=S.Object({conversationId:S.String()});function M1c(t,e,r){return t.get(jo).destroy(r.conversationId),["OK",null]}a(M1c,"handleConversationDestroyChecked");var W9i=je(N1c,M1c);p();var O1c=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function B1c(t,e,r){return[(await t.get(S_).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(B1c,"handleConversationModesChecked");var z9i=je(O1c,B1c);p();var L1c=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),F1c=new Ee("conversationNotifyCodeAcceptance");async function U1c(t,e,r){let n=t.get(jo).findByTurnId(r.turnId);if(!n)return F1c.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await Yc(t,n,{languageId:""});return vS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${Gy("agentPanel")}.codeAcceptance`,o),["OK",null]}a(U1c,"handleConversationNotifyCodeAcceptanceChecked");var Y9i=je(L1c,U1c);p();var Q1c=S.Object({});function q1c(t,e,r){return[{path:t.get(bi).directory},null]}a(q1c,"handleConversationPersistenceChecked");var K9i=je(Q1c,q1c);p();p();var DOr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Fr).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},NOr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Ut).getToken()).envelope.chat_enabled?"ok":"failed"}}},j1c=[new DOr,new NOr],PR=class{constructor(e,r=j1c){this.ctx=e;this.checks=r;this.emitter=new ro;this.onChange=this.emitter.event;ys(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 H1c=S.Object({forceCheck:S.Optional(S.Boolean())});async function G1c(t,e,r){let n=r.forceCheck??!1;return[await t.get(PR).check(n),null]}a(G1c,"handleConversationPreconditionsChecked");var J9i=je(H1c,G1c);p();var $1c=S.Object({turnId:S.String(),rating:S.Number(),doc:S.Optional(bC),textDocument:S.Optional(bC),source:S.Optional(zM)});async function V1c(t,e,r){let n=await V4(t,r,e),o=aQ(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await Yc(t,t.get(jo).findByTurnId(r.turnId),{languageId:n?.detectedLanguageId??""}),l=`${Gy(o)}.messageRating`,u=vS(t,n,{rating:s,uiKind:o},{},l,c);return wI(t,l,u),["OK",null]}a(V1c,"handleConversationRatingChecked");var Z9i=je($1c,V1c);p();var W1c=S.Object({tools:S.Array(Tyn)});function z1c(t,e,r){let n=t.get(cs);return r.tools.forEach(s=>{n.registerTool(new sq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(z1c,"conversationRegisterToolsChecked");var X9i=je(W1c,z1c);p();var Y1c=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function K1c(t,e,r){let n=fjt(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(ag),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).map(u=>({id:u.uri,name:u.name,description:u.description||"",shortDescription:"",scopes:J1c(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(Z0).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${Ki(Xd(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(K1c,"handleConversationTemplatesChecked");function J1c(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(J1c,"getCustomPromptScopes");var eUi=je(Y1c,K1c);p();var Z1c=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:fYe,turnId:S.Optional($Y),message:CUt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(bC),textDocument:S.Optional(bC),selection:S.Optional(ff),visibleRanges:S.Optional(GCt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(WM)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:l0n,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(gYe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(AYe))});async function X1c(t,e,r){Sye.validate(r.workspaceFolders);let n=await V4(t,r,e),o=t.get(jo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(X0).setTodos(s,r.todoList);let c=hYe(r.message),l=new $f({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:WCt(u),f=t.get(S_),h=Q7(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=r.model,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let m=$Ct({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,m,u,d,r.ignoredSkills,r.confirmationResponse);let g=bye(r),A=t.get(GD).add(g.progressToken,e),y=new Qx(t,s,l,A),E=await t.get($D).createProcessor(y,g.progressToken,r.computeSuggestions),_=t.get(lu),v=String(l.id);_.resetTurnCredits(v);let b;try{await E.process(g,A,r.followUp,n,r.model,r.modelProviderName,r.modelInfo),b=_.getCreditsForTurn(v)}finally{_.resetTurnCredits(v)}let T=zCt(l,r);return YCt(t,"conversation/turn",s,l,T,b),[{conversationId:s.id,turnId:l.id,agentSlug:T.agentSlug,modelName:T.modelName,modelProviderName:T.modelProviderName,billingMultiplier:T.billingMultiplier,modelInfo:r.modelInfo,credits:KCt(b)},null]}a(X1c,"handleConversationTurnChecked");var tUi=je(Z1c,X1c);p();var eSc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(zM)});async function tSc(t,e,r){t.get(jo).deleteTurn(r.conversationId,r.turnId);let o=aQ(r.source),s=await Yc(t,t.get(jo).findByTurnId(r.turnId),{languageId:""});return vS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${Gy(o)}.messageDelete`,s),["OK",null]}a(tSc,"handleConversationTurnDeleteChecked");var rUi=je(eSc,tSc);p();var rSc=S.Object({toolIds:S.Array(S.String())});function nSc(t,e,r){let n=t.get(cs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(nSc,"conversationUnregisterToolsChecked");var nUi=je(rSc,nSc);p();var iSc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(LL)}))});async function oSc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(S_).getChatMode(n?Q7(n):"Agent",o,s),l=t.get(cs),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(oSc,"conversationUpdateToolsStatusChecked");var iUi=je(iSc,oSc);p();p();As();var sSc=5e3,ane=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 @@ -3798,16 +3755,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 qn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),cwc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new rc(e),u=await Uo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(Jt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:gA.user("conversation-panel",gr())},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);Ye.debug(e,`Failed to generate thinking title: errorType='${r}', reason: ${o}`),gt(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var lwc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function uwc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Ke.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Sne).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Ke.InternalError,message:"Failed to generate thinking title"}]}a(uwc,"handleThinkingTitleGenerateChecked");var R7i=Ne(lwc,uwc);p();p();p();var Nbt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var zye=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(Nbt,"")}static extractSuggestionAndText(e){Nbt.lastIndex=0;let n=Nbt.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 qn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),sSc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new ec(e),u=await Jo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Ut).getToken(),h=await e.get(Jt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:EA.user("conversation-panel",ir())},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}`),_t(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var aSc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function cSc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:it.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(ane).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:it.InternalError,message:"Failed to generate thinking title"}]}a(cSc,"handleThinkingTitleGenerateChecked");var oUi=je(aSc,cSc);p();p();p();var JCt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var Tye=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(JCt,"")}static extractSuggestionAndText(e){JCt.lastIndex=0;let n=JCt.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 Mbt=require("path");var Yye=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=LI(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=Gm(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=pl();try{return await P7(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=XL(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=pl()-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(P0(d))throw d;let f=pl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{kWe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,Mbt.basename)(e,(0,Mbt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(pf).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();Ns();var Kye=class t{constructor(e,r={}){this.ctx=e;this.id=gr(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return jt.createAndMarkAsIssued(r)}telemetrySent(){ht(this.ctx,"request.sent",this.telemetryData),gt(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){ht(this.ctx,"request.response",this.telemetryData),gt(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Fh(e,"name")??""),this.telemetryData.properties.code=String(Fh(e,"code")??""),this.telemetryData.properties.errno=String(Fh(e,"errno")??""),this.telemetryData.properties.type=String(Fh(e,"type")??""),ht(this.ctx,"request.error",this.telemetryData),gt(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var Obt=class t extends Yye{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new Kye(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(Cc),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 dwc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),fwc=S.Object({changes:S.Array(dwc),workspaceFolders:S.Optional(S.Array(Lc))}),CLe;async function pwc(t,e,r){CLe&&(CLe.cancel(),CLe.dispose()),CLe=new qn.CancellationTokenSource;let n=new qE([e,CLe.token]),o=new Obt(t,r.changes,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ke.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."}]:(Dr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Ke.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:zye.parseReviewResponse(u,d)},null]}a(pwc,"handleCopilotCodeReviewReviewChangesChecked");var k7i=Ne(fwc,pwc);p();p();var Bbt=class t extends Yye{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new Kye(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(Cc),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 hwc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),mwc=S.Object({snippets:S.Array(hwc),workspaceFolders:S.Optional(S.Array(Lc))}),vLe;async function gwc(t,e,r){vLe&&(vLe.cancel(),vLe.dispose()),vLe=new qn.CancellationTokenSource;let n=new qE([e,vLe.token]),o=new Bbt(t,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ke.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:Ke.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:zye.parseReviewResponse(u,d)},null]}a(gwc,"handleCopilotCodeReviewReviewSnippetsChecked");var P7i=Ne(mwc,gwc);p();p();var Lbt=Symbol("onMCPToolsListChanged"),Fbt=Symbol("onMCPResourcesListChanged"),Ubt=Symbol("onMCPPromptsListChanged"),D7i=Symbol("onMCPResourceUpdated"),rV=Symbol("onMCPCacheUpdated");function N7i(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(N7i,"normalizeMcpHeaders");var jE=class{static{a(this,"McpManager")}};var Awc=S.Object({}),ywc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(JL)}))}))}),Ewc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),_wc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),Cwc=S.Object({serverName:S.String(),uri:S.String()}),vwc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function bwc(t,e,r){return[t.get(jE).getAllContents(),null]}a(bwc,"handleGetMCPContentsChecked");async function Swc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(x_).getChatMode(n?eQ(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(jE).updateMCPToolsStatus(c,l),[t.get(jE).getAllContents(c),null]}a(Swc,"handleUpdateMCPToolsStatusChecked");async function Twc(t,e,r){return[await t.get(jE).readResource(r.serverName,r.uri),null]}a(Twc,"handleReadResourceChecked");async function Iwc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(jE).getPrompt(n,o,s),null]}a(Iwc,"handleGetPromptChecked");async function xwc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(jE).completePrompt(n,o,s,c,l),null]}a(xwc,"handleCompletePromptChecked");async function wwc(t,e,r){let n=t.get(jE),{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(wwc,"handleMCPServerActionChecked");var M7i=Ne(Awc,bwc),O7i=Ne(ywc,Swc),B7i=Ne(Cwc,Twc),L7i=Ne(Ewc,Iwc),F7i=Ne(_wc,xwc),U7i=Ne(vwc,wwc);p();var Rwc=S.Object({});async function kwc(t,e,r){let n=await t.get(Qt).getToken();return[Mwc(t,await t.get(dc).getMetadata(),n),null]}a(kwc,"handleCopilotModelsChecked");function Pwc(t){if((t.capabilities.supports?.reasoning_effort?.length??0)<=1)return!1;let r=t.supported_endpoints;return r?.includes(NLt.Responses)?!0:r?.includes(NLt.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!1}a(Pwc,"supportReasoningEffortLevel");function Dwc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!Xae.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(Dwc,"getModelScopes");function Nwc(t){return t.capabilities.family===_An?!1:t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(Nwc,"shouldExposeModel");function Mwc(t,e,r){let n=[];return e.forEach(o=>{Nwc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:Dwc(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:Pwc(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,degradationReason:gan(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(uu).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:MS,modelName:Mze,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:MS,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(Mwc,"filterModels");var Q7i=Ne(Rwc,kwc);p();var Owc=S.Object({});async function Bwc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(dc).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(Bwc,"handleCopilotModelsGetModelMetadataListChecked");var q7i=Ne(Owc,Bwc);p();var Lwc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function Fwc(t,e,r){return r.model&&r.status==="enabled"?await t.get(dc).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Ke.InternalError,message:"Failed to accept model policy"}]:[null,{code:Ke.InvalidRequest,message:"Invalid model or status"}]}a(Fwc,"handleCopilotModelsPolicyChecked");var j7i=Ne(Lwc,Fwc);p();p();p();p();Ns();function Uwc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(Uwc,"panelPositionForDocument");async function*H7i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(H7i,"trimChoices");var Jye=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=Uwc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function F5r(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await F5r(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(F5r,"reportSolutions");async function U5r(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:U5r(t,e)}}a(U5r,"generateSolutionsStream");function Qbt(t){return t.replace(/\s+/g,"")}a(Qbt,"normalizeCompletionText");async function G7i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=R7(t,l.uri),d=gr(),f=jt.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 rhe(t,d,pX(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=Ll.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...hoe(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),ht(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(G7i,"setupPromptAndTelemetry");function $7i(t,e,r,n,o,s){let c=t.get(eP).forLanguage(t,e.detectedLanguageId,s),l=AS(e.detectedLanguageId),u=Yat(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 ZCt=require("path");var Iye=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(Ut).getToken(),o=kI(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=uA(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=dl();try{return await Oz(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=QL(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=dl()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Ut).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(k0(d))throw d;let f=dl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{JVe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,ZCt.basename)(e,(0,ZCt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(df).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();As();var xye=class t{constructor(e,r={}){this.ctx=e;this.id=ir(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Vt.createAndMarkAsIssued(r)}telemetrySent(){yt(this.ctx,"request.sent",this.telemetryData),_t(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){yt(this.ctx,"request.response",this.telemetryData),_t(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Fh(e,"name")??""),this.telemetryData.properties.code=String(Fh(e,"code")??""),this.telemetryData.properties.errno=String(Fh(e,"errno")??""),this.telemetryData.properties.type=String(Fh(e,"type")??""),yt(this.ctx,"request.error",this.telemetryData),_t(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var XCt=class t extends Iye{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new xye(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(Ec),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 lSc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),uSc=S.Object({changes:S.Array(lSc),workspaceFolders:S.Optional(S.Array(Mc))}),zBe;async function dSc(t,e,r){zBe&&(zBe.cancel(),zBe.dispose()),zBe=new qn.CancellationTokenSource;let n=new FE([e,zBe.token]),o=new XCt(t,r.changes,r.workspaceFolders);if(!(await t.get(Ut).getToken()).isCopilotCodeReviewEnabled)return[null,{code:it.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."}]:(Dr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:it.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:Tye.parseReviewResponse(u,d)},null]}a(dSc,"handleCopilotCodeReviewReviewChangesChecked");var sUi=je(uSc,dSc);p();p();var ebt=class t extends Iye{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new xye(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(Ec),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 fSc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),pSc=S.Object({snippets:S.Array(fSc),workspaceFolders:S.Optional(S.Array(Mc))}),YBe;async function hSc(t,e,r){YBe&&(YBe.cancel(),YBe.dispose()),YBe=new qn.CancellationTokenSource;let n=new FE([e,YBe.token]),o=new ebt(t,r.workspaceFolders);if(!(await t.get(Ut).getToken()).isCopilotCodeReviewEnabled)return[null,{code:it.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:it.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:Tye.parseReviewResponse(u,d)},null]}a(hSc,"handleCopilotCodeReviewReviewSnippetsChecked");var aUi=je(pSc,hSc);p();p();var tbt=Symbol("onMCPToolsListChanged"),rbt=Symbol("onMCPResourcesListChanged"),nbt=Symbol("onMCPPromptsListChanged"),cUi=Symbol("onMCPResourceUpdated"),F$=Symbol("onMCPCacheUpdated");function lUi(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(lUi,"normalizeMcpHeaders");var UE=class{static{a(this,"McpManager")}};var mSc=S.Object({}),gSc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(LL)}))}))}),ASc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),ySc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),ESc=S.Object({serverName:S.String(),uri:S.String()}),_Sc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function vSc(t,e,r){return[t.get(UE).getAllContents(),null]}a(vSc,"handleGetMCPContentsChecked");async function CSc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(S_).getChatMode(n?Q7(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(UE).updateMCPToolsStatus(c,l),[t.get(UE).getAllContents(c),null]}a(CSc,"handleUpdateMCPToolsStatusChecked");async function bSc(t,e,r){return[await t.get(UE).readResource(r.serverName,r.uri),null]}a(bSc,"handleReadResourceChecked");async function SSc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(UE).getPrompt(n,o,s),null]}a(SSc,"handleGetPromptChecked");async function TSc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(UE).completePrompt(n,o,s,c,l),null]}a(TSc,"handleCompletePromptChecked");async function ISc(t,e,r){let n=t.get(UE),{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(ISc,"handleMCPServerActionChecked");var uUi=je(mSc,vSc),dUi=je(gSc,CSc),fUi=je(ESc,bSc),pUi=je(ASc,SSc),hUi=je(ySc,TSc),mUi=je(_Sc,ISc);p();var xSc=S.Object({});async function wSc(t,e,r){let n=await t.get(Ut).getToken();return[DSc(t,await t.get(lc).getMetadata(),n),null]}a(wSc,"handleCopilotModelsChecked");function RSc(t){if((t.capabilities.supports?.reasoning_effort?.length??0)<=1)return!1;let r=t.supported_endpoints;return r?.includes(JBt.Responses)?!0:r?.includes(JBt.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!1}a(RSc,"supportReasoningEffortLevel");function PSc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!Oae.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(PSc,"getModelScopes");function kSc(t){return t.capabilities.family===zmn?!1:t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(kSc,"shouldExposeModel");function DSc(t,e,r){let n=[];return e.forEach(o=>{kSc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:PSc(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:RSc(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,degradationReason:psn(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(cu).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:xS,modelName:tze,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:xS,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(DSc,"filterModels");var gUi=je(xSc,wSc);p();var NSc=S.Object({});async function MSc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(lc).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(MSc,"handleCopilotModelsGetModelMetadataListChecked");var AUi=je(NSc,MSc);p();var OSc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function BSc(t,e,r){return r.model&&r.status==="enabled"?await t.get(lc).acceptModelPolicy(r.model)?["OK",null]:[null,{code:it.InternalError,message:"Failed to accept model policy"}]:[null,{code:it.InvalidRequest,message:"Invalid model or status"}]}a(BSc,"handleCopilotModelsPolicyChecked");var yUi=je(OSc,BSc);p();p();p();p();As();function LSc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(LSc,"panelPositionForDocument");async function*EUi(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(EUi,"trimChoices");var wye=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=LSc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function MOr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await MOr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(MOr,"reportSolutions");async function OOr(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:OOr(t,e)}}a(OOr,"generateSolutionsStream");function ibt(t){return t.replace(/\s+/g,"")}a(ibt,"normalizeCompletionText");async function _Ui(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=g7(t,l.uri),d=ir(),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 Npe(t,d,KZ(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({},{...Jie(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),yt(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(_Ui,"setupPromptAndTelemetry");function vUi(t,e,r,n,o,s){let c=t.get(WP).forLanguage(t,e.detectedLanguageId,s),l=lS(e.detectedLanguageId),u=pat(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=w7(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?R2e(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?R2e(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a($7i,"setupCompletionParams");var Q5r=new ge("solutions");async function Qwc(t,e){let r=e.targetPosition,n=e.textDocument,o=await G7i(t,e,"open copilot",Q5r);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}=$7i(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(HM).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;_=H7i(_),_=BTe(_,T=>eDe(t,n,r,T,!1,Q5r));let v=BTe(_,async T=>{let w=T.completionText;Q5r.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await pYn(t,n,r,T.completionText)??Ll.position(r.line,0),[x]=oH(n.getText(Ll.range(R,r)));w=x+w;let k=T.completionText;c.length>0&&k.startsWith(c)&&(k=k.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:k,insertText:w,range:Ll.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return U5r(A,v[Symbol.asyncIterator]())}a(Qwc,"launchSolutions");async function qbt(t,e,r){return t.get(as).trackCompletionJob(async()=>{let o=Qwc(t,e);return await F5r(o,r)})}a(qbt,"runSolutions");var W7i=ce(IB()),SLe=ce(Al());p();Ns();p();function jbt(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(jbt,"parseChallengeDoc");var qwc=S.Object({text:S.String(),score:S.Number()}),jwc=S.Object({documents:S.Array(qwc),options:S.Optional(S.Object({}))});async function Hbt(t,e,r){let n=gr();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:NI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(Hbt,"runTestSolutions");var eN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function Hwc(t,e,r){return t.forceSet(eN,new eN(r.documents)),["OK",null]}a(Hwc,"handleTestingSetPanelCompletionDocumentsChecked");var V7i=Ne(jwc,Hwc);var z7i=eYe.type;function Gwc(t,e,r,n,o){let s=Qbt(n.completionText),c=(0,W7i.SHA256)(s).toString();return t.get(vu).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:xMr,title:`Accept completion ${o}`,arguments:[c]}}}a(Gwc,"makeCompletion");function j5r(t,e){return`${t}/${e}`}a(j5r,"progressMessage");var q5r=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(ur)}async onSolution(e){this.count+=1;let r=Gwc(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(SLe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:j5r(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return $wc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(SLe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function $wc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(SLe.WorkDoneProgress.type,t,{kind:"end",message:j5r(r,10)})}a($wc,"reportDone");var bLe;async function Vwc(t,e,r){let n=await K6(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ur).connection.sendProgress(SLe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:j5r(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(ur).connection.sendProgress(eYe.partialResult,l,{items:[f]})},"onCompletion"));let u=new q5r(t,r,c),d=t.get(eN);if(d.documents){let f=d.documents;await Hbt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new Jye(n,o,e,10);await qbt(t,f,u)}return u.error!==void 0?[null,{code:Ke.InternalError,message:u.error}]:[{items:s},null]}a(Vwc,"handleChecked");async function Wwc(t,e,r){bLe&&(bLe.cancel(),bLe.dispose()),bLe=new qn.CancellationTokenSource;let n=bLe.token,o=new qE([e,n]);try{return await Vwc(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Ke.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(Wwc,"handleCheckedWithAbort");var Y7i=Ne(kyn,Wwc);p();var Ywc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function Kwc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(jp).listCustomAgents(n)).map(c=>({id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri,storage:c.promptFileEntry?.promptPath?.storage})),null]}a(Kwc,"listCustomAgents");var K7i=Ne(Ywc,Kwc);p();var Jwc=new ge("customAgent/registerExtensionAgents"),Zwc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),Xwc=S.Object({extensionId:S.String(),agents:S.Array(Zwc)});function eRc(t,e,r){try{t.get(jp).registerExtensionAgent(r.extensionId,r.agents)}catch(n){Jwc.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Ke.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(eRc,"registerExtensionAgents");var J7i=Ne(Xwc,eRc);p();var tRc=S.Object({extensionId:S.String()});function rRc(t,e,r){return t.get(jp).unregisterExtensionAgents(r.extensionId),[null,null]}a(rRc,"unregisterExtensionAgents");var Z7i=Ne(tRc,rRc);p();var nRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function iRc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(pf).listCustomInstructions(n)).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})),null]}a(iRc,"listCustomInstructions");var X7i=Ne(nRc,iRc);p();var oRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function sRc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(ag).listCustomPrompts(n)).map(c=>({uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:c.promptFileEntry?.promptPath.storage})),null]}a(sRc,"listCustomPrompts");var eQi=Ne(oRc,sRc);p();var aRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function cRc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(EA).listSkills(n)).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage})),null]}a(cRc,"listCustomSkills");var tQi=Ne(aRc,cRc);p();p();p();function lRc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(D0).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(lRc,"urlsToCheck");async function rQi(t,e,r=HB(t),n,o){let s=lRc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await uRc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(rQi,"checkReachability");async function uRc(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(uRc,"determineReachability");var sI=ce(require("os")),Zye=ce(require("tls"));async function iQi(t,e){let r=await t.get(ar).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[fRc(t),dRc(t,n),pRc(t,r),await hRc(t,r,o?.endpoints,n,e)]}}a(iQi,"collectDiagnostics");function oQi(t){return t.sections.map(mRc).join(sI.EOL+sI.EOL)+sI.EOL}a(oQi,"formatDiagnosticsAsMarkdown");function dRc(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:N1(t),"GitHub Account":n,"Session ID":t.get(Fa).sessionId,"Send Restricted Telemetry":moe(t)?"enabled":"disabled","Content Exclusion":t.get(Cc).enabled?"enabled":"unavailable"}}}a(dRc,"collectCopilotSection");function fRc(t){let e={Plugin:ARc(t),Editor:gRc(t),"Operating System":`${sI.type()} ${sI.release()} (${sI.arch()})`};return oB(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(fRc,"collectEnvironmentSection");function pRc(t,e){let r=t.get(Zo).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":Zye.rootCertificates.length,"TLS Default Min Version":Zye.DEFAULT_MIN_VERSION,"TLS Default Max Version":Zye.DEFAULT_MAX_VERSION};return oB(n,"http_proxy"),oB(n,"https_proxy"),oB(n,"no_proxy"),oB(n,"SSL_CERT_FILE"),oB(n,"SSL_CERT_DIR"),oB(n,"OPENSSL_CONF"),oB(n,"NODE_EXTRA_CA_CERTS"),oB(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(pRc,"collectNetworkConfigSection");async function hRc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await rQi(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(hRc,"collectReachabilitySection");function nQi(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(nQi,"quoteCode");function oB(t,e){let r=process.env[e];r&&(t[nQi(e)]=nQi(r)),r!==process.env[e.toUpperCase()]&&oB(t,e.toUpperCase())}a(oB,"addEnvironmentVariable");function mRc(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(mRc,"formatSectionAsMarkdown");function gRc(t){let e=t.get(Lr).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(gRc,"getEditorDisplayVersion");function ARc(t){let e=t.get(Lr).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(ARc,"getPluginDisplayVersion");var yRc=S.Object({});async function ERc(t,e){return[{report:oQi(await iQi(t,e))},null]}a(ERc,"handleDiagnosticsChecked");var sQi=Ne(yRc,ERc);p();var _Rc=S.Object({conversationId:S.String()});async function CRc(t,e,r){return[{spans:await t.get(BF).readSpans(r.conversationId)},null]}a(CRc,"handleGetAgentDebugLogChecked");var aQi=Ne(_Rc,CRc);p();Ns();var pQi=ce(Al());p();var cQi=require("crypto");var Xye=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new G5r(e,this.id)}},G5r=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(ur),s=(0,cQi.randomUUID)(),c=o.connection.onProgress(Zze.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(Zze.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 Gbt(t,e,r){try{let n=t.get(n0),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 Xye&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof Xye&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Dr.error(t,"Failed to set context items on context providers",n)}}a(Gbt,"setContextItems");var H5r={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function lQi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return df(r.uri,o,H5r);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=df(r.uri,o.scheme||"",H5r)),"pattern"in o&&(s&&=df(r.uri,o.pattern||"",H5r)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(lQi,"match");p();var vRc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),iV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function bRc(t,e,r){return t.forceSet(iV,new iV(r.documents,r.basename||"")),["OK",null]}a(bRc,"handleTestingSetCompletionDocumentsChecked");var uQi=new ge("setCompletionDocuments"),fQi=Ne(vRc,bRc);function $bt(t,e,r,n){let o=t.get(iV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){uQi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=SRc(o,r);return c&&c.length>0?dQi(c,s,e):void 0}else return uQi.debug(t,"Returning completions for all pre-set documents"),dQi(o.documents,s,e)}}a($bt,"getTestCompletions");function dQi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=jbt(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(dQi,"sliceAndMapCompletions");function SRc(t,e){return t.basename===ji(e)?t.documents||[]:[]}a(SRc,"getFilteredDocs");var hQi=S.Object({doc:S.Object({position:rg,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:dIe,version:S.Number()}),contextItems:S.Optional(Plr)}),TLe;async function mQi(t,e,r,n){TLe&&(TLe.cancel(),TLe.dispose()),TLe=new qn.CancellationTokenSource;let o=new qE([e,TLe.token]);r.contextItems&&Gbt(t,r.contextItems);let s=$bt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:gr(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await K6(t,r.doc,o)}catch(h){if(!(h instanceof pQi.ResponseError))throw h;switch(h.code){case Ke.CopilotNotAvailable:case Ke.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(BA).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(vu);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(mQi,"handleGetCompletionsHelper");var gQi=Ne(hQi,(t,e,r)=>mQi(t,e,r,!1)),AQi=Ne(hQi,(t,e,r)=>mQi(t,e,r,!0));p();var TRc=S.Object({});function IRc(t,e,r){return[{defaultRules:t.get(zx).getDefaultRules()},null]}a(IRc,"handleGetDefaultFileSafetyRulesChecked");var yQi=Ne(TRc,IRc);p();var EQi=ce(IB()),eEe=ce(Al());var xRc=S.Object({doc:S.Object({position:rg,uri:dIe,version:S.Number()}),panelId:S.String()});function wRc(t,e,r,n,o){let s=Qbt(o.completionText),c=(0,EQi.SHA256)(s).toString();return t.get(vu).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(wRc,"makeSolution");var $5r=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(ur)}onSolution(e){return this.service.connection.sendNotification(new eEe.NotificationType("PanelSolution"),wRc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return _Qi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new eEe.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function _Qi(t,e){return e.connection.sendNotification(new eEe.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(_Qi,"reportDone");var ILe;async function RRc(t,e,r){ILe&&(ILe.cancel(),ILe.dispose()),ILe=new qn.CancellationTokenSource;let n=new qE([e,ILe.token]),o=r.doc.position,s=Ll.range(o,o),c=new $5r(t,r,s),l=t.get(eN);if(l.documents){let u=l.documents;Hbt(o,u,c)}else{let u;try{u=await K6(t,r.doc,n)}catch(f){if(!(f instanceof eEe.ResponseError))throw f;switch(f.code){case Ke.CopilotNotAvailable:case Ke.ContentModified:return kRc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new Jye(u,o,n,10);qbt(t,d,c)}return[{solutionCountTarget:10},null]}a(RRc,"handleGetPanelCompletionsChecked");async function kRc(t,e){return await _Qi(e.panelId,t.get(ur)),[{solutionCountTarget:0},null]}a(kRc,"produceEmptySolutions");var CQi=Ne(xRc,RRc);p();var PRc=S.Object({});async function DRc(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(DRc,"handleGetUserInfoChecked");var vQi=Ne(PRc,DRc);p();var NRc=S.Object({});function MRc(t,e,r){return[{version:t.get(ss).getDisplayVersion(),buildType:J9(t),runtimeVersion:`node/${process.versions.node}`},null]}a(MRc,"handleGetVersionChecked");var bQi=Ne(NRc,MRc);p();Ns();var ORc=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 BRc(t,e,r){if(r.changes.length===0)return[null,{code:Ke.InvalidRequest,message:"No changes provided"}];let n=t.get(Vo),o=n.create({capabilities:{skills:[nO]}}),s=new Gf({message:"",type:"user"});await n.addTurn(o.id,s);let c=Vye({workDoneToken:gr()});await t.get(vc).begin(o,s,c);let d=(await new Wx(t,o,s,e).skillResolver.resolve(nO))?.head?.name,h=await t.get(gZ).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ke.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(BRc,"handleGitCommitGenerateChecked");var SQi=Ne(ORc,BRc);p();var LRc=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function FRc(t,e,r){try{let o=await new zy(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return ht(t,"githubApi.listPullRequestChangedFiles",jt.createAndMarkAsIssued()),gt(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(_s(t,n,"githubApi.listPullRequestChangedFiles"),gi(t,"githubApi.listPullRequestChangedFiles",n),n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(FRc,"handleListPullRequestChangedFilesChecked");var TQi=Ne(LRc,FRc);p();p();var Vbt=new ge("GitHubGraphQLClient"),Wbt=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(ar);return this.graphqlClient=CEn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){Vbt.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++,Vbt.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` +`]);let h=m7(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?r2e(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?r2e(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(vUi,"setupCompletionParams");var BOr=new Ee("solutions");async function FSc(t,e){let r=e.targetPosition,n=e.textDocument,o=await _Ui(t,e,"open copilot",BOr);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}=vUi(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(DM).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;_=EUi(_),_=lTe(_,T=>x2e(t,n,r,T,!1,BOr));let v=lTe(_,async T=>{let w=T.completionText;BOr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await HWn(t,n,r,T.completionText)??au.position(r.line,0),[x]=qj(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 OOr(A,v[Symbol.asyncIterator]())}a(FSc,"launchSolutions");async function obt(t,e,r){return t.get(os).trackCompletionJob(async()=>{let o=FSc(t,e);return await MOr(o,r)})}a(obt,"runSolutions");var bUi=he(h9()),JBe=he(ml());p();As();p();function sbt(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(sbt,"parseChallengeDoc");var USc=S.Object({text:S.String(),score:S.Number()}),QSc=S.Object({documents:S.Array(USc),options:S.Optional(S.Object({}))});async function abt(t,e,r){let n=ir();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:xI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(abt,"runTestSolutions");var VD=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function qSc(t,e,r){return t.forceSet(VD,new VD(r.documents)),["OK",null]}a(qSc,"handleTestingSetPanelCompletionDocumentsChecked");var CUi=je(QSc,qSc);var SUi=vze.type;function jSc(t,e,r,n,o){let s=ibt(n.completionText),c=(0,bUi.SHA256)(s).toString();return t.get(vu).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:bNr,title:`Accept completion ${o}`,arguments:[c]}}}a(jSc,"makeCompletion");function FOr(t,e){return`${t}/${e}`}a(FOr,"progressMessage");var LOr=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(ur)}async onSolution(e){this.count+=1;let r=jSc(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(JBe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:FOr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return HSc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(JBe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function HSc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(JBe.WorkDoneProgress.type,t,{kind:"end",message:FOr(r,10)})}a(HSc,"reportDone");var KBe;async function GSc(t,e,r){let n=await O6(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ur).connection.sendProgress(JBe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:FOr(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(ur).connection.sendProgress(vze.partialResult,l,{items:[f]})},"onCompletion"));let u=new LOr(t,r,c),d=t.get(VD);if(d.documents){let f=d.documents;await abt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new wye(n,o,e,10);await obt(t,f,u)}return u.error!==void 0?[null,{code:it.InternalError,message:u.error}]:[{items:s},null]}a(GSc,"handleChecked");async function $Sc(t,e,r){KBe&&(KBe.cancel(),KBe.dispose()),KBe=new qn.CancellationTokenSource;let n=KBe.token,o=new FE([e,n]);try{return await GSc(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:it.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a($Sc,"handleCheckedWithAbort");var TUi=je(iAn,$Sc);p();var WSc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function zSc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Hp).listCustomAgents(n)).map(c=>({id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri,storage:c.promptFileEntry?.promptPath?.storage})),null]}a(zSc,"listCustomAgents");var IUi=je(WSc,zSc);p();var YSc=new Ee("customAgent/registerExtensionAgents"),KSc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),JSc=S.Object({extensionId:S.String(),agents:S.Array(KSc)});function ZSc(t,e,r){try{t.get(Hp).registerExtensionAgent(r.extensionId,r.agents)}catch(n){YSc.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:it.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(ZSc,"registerExtensionAgents");var xUi=je(JSc,ZSc);p();var XSc=S.Object({extensionId:S.String()});function eTc(t,e,r){return t.get(Hp).unregisterExtensionAgents(r.extensionId),[null,null]}a(eTc,"unregisterExtensionAgents");var wUi=je(XSc,eTc);p();var tTc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function rTc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(df).listCustomInstructions(n)).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})),null]}a(rTc,"listCustomInstructions");var RUi=je(tTc,rTc);p();var nTc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function iTc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(ag).listCustomPrompts(n)).map(c=>({uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:c.promptFileEntry?.promptPath.storage})),null]}a(iTc,"listCustomPrompts");var PUi=je(nTc,iTc);p();var oTc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function sTc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Z0).listSkills(n)).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage})),null]}a(sTc,"listCustomSkills");var kUi=je(oTc,sTc);p();p();p();function aTc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(D0).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(aTc,"urlsToCheck");async function DUi(t,e,r=kB(t),n,o){let s=aTc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await cTc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(DUi,"checkReachability");async function cTc(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(cTc,"determineReachability");var eI=he(require("os")),Rye=he(require("tls"));async function MUi(t,e){let r=await t.get(fr).getImplementation(),n=await t.get(Ut).getGitHubSession(),o=await t.get(Ut).getToken().catch(()=>{});return{sections:[uTc(t),lTc(t,n),dTc(t,r),await fTc(t,r,o?.endpoints,n,e)]}}a(MUi,"collectDiagnostics");function OUi(t){return t.sections.map(pTc).join(eI.EOL+eI.EOL)+eI.EOL}a(OUi,"formatDiagnosticsAsMarkdown");function lTc(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:T1(t),"GitHub Account":n,"Session ID":t.get(Oa).sessionId,"Send Restricted Telemetry":Zie(t)?"enabled":"disabled","Content Exclusion":t.get(Ec).enabled?"enabled":"unavailable"}}}a(lTc,"collectCopilotSection");function uTc(t){let e={Plugin:mTc(t),Editor:hTc(t),"Operating System":`${eI.type()} ${eI.release()} (${eI.arch()})`};return W4(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(uTc,"collectEnvironmentSection");function dTc(t,e){let r=t.get(zo).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":Rye.rootCertificates.length,"TLS Default Min Version":Rye.DEFAULT_MIN_VERSION,"TLS Default Max Version":Rye.DEFAULT_MAX_VERSION};return W4(n,"http_proxy"),W4(n,"https_proxy"),W4(n,"no_proxy"),W4(n,"SSL_CERT_FILE"),W4(n,"SSL_CERT_DIR"),W4(n,"OPENSSL_CONF"),W4(n,"NODE_EXTRA_CA_CERTS"),W4(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(dTc,"collectNetworkConfigSection");async function fTc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await DUi(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(fTc,"collectReachabilitySection");function NUi(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(NUi,"quoteCode");function W4(t,e){let r=process.env[e];r&&(t[NUi(e)]=NUi(r)),r!==process.env[e.toUpperCase()]&&W4(t,e.toUpperCase())}a(W4,"addEnvironmentVariable");function pTc(t){return`## ${t.name}`+eI.EOL+eI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(eI.EOL)}a(pTc,"formatSectionAsMarkdown");function hTc(t){let e=t.get(Lr).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(hTc,"getEditorDisplayVersion");function mTc(t){let e=t.get(Lr).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(mTc,"getPluginDisplayVersion");var gTc=S.Object({});async function ATc(t,e){return[{report:OUi(await MUi(t,e))},null]}a(ATc,"handleDiagnosticsChecked");var BUi=je(gTc,ATc);p();var yTc=S.Object({conversationId:S.String()});async function ETc(t,e,r){return[{spans:await t.get(dF).readSpans(r.conversationId)},null]}a(ETc,"handleGetAgentDebugLogChecked");var LUi=je(yTc,ETc);p();As();var HUi=he(ml());p();var FUi=require("crypto");var Pye=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new QOr(e,this.id)}},QOr=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(ur),s=(0,FUi.randomUUID)(),c=o.connection.onProgress(Eze.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(Eze.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 cbt(t,e,r){try{let n=t.get(n0),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 Pye&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof Pye&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Dr.error(t,"Failed to set context items on context providers",n)}}a(cbt,"setContextItems");var UOr={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function UUi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return lf(r.uri,o,UOr);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=lf(r.uri,o.scheme||"",UOr)),"pattern"in o&&(s&&=lf(r.uri,o.pattern||"",UOr)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(UUi,"match");p();var _Tc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),Q$=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function vTc(t,e,r){return t.forceSet(Q$,new Q$(r.documents,r.basename||"")),["OK",null]}a(vTc,"handleTestingSetCompletionDocumentsChecked");var QUi=new Ee("setCompletionDocuments"),jUi=je(_Tc,vTc);function lbt(t,e,r,n){let o=t.get(Q$);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){QUi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=CTc(o,r);return c&&c.length>0?qUi(c,s,e):void 0}else return QUi.debug(t,"Returning completions for all pre-set documents"),qUi(o.documents,s,e)}}a(lbt,"getTestCompletions");function qUi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=sbt(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(qUi,"sliceAndMapCompletions");function CTc(t,e){return t.basename===Ki(e)?t.documents||[]:[]}a(CTc,"getFilteredDocs");var GUi=S.Object({doc:S.Object({position:ng,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:FTe,version:S.Number()}),contextItems:S.Optional(xcr)}),ZBe;async function $Ui(t,e,r,n){ZBe&&(ZBe.cancel(),ZBe.dispose()),ZBe=new qn.CancellationTokenSource;let o=new FE([e,ZBe.token]);r.contextItems&&cbt(t,r.contextItems);let s=lbt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:ir(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await O6(t,r.doc,o)}catch(h){if(!(h instanceof HUi.ResponseError))throw h;switch(h.code){case it.CopilotNotAvailable:case it.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(qA).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(vu);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($Ui,"handleGetCompletionsHelper");var VUi=je(GUi,(t,e,r)=>$Ui(t,e,r,!1)),WUi=je(GUi,(t,e,r)=>$Ui(t,e,r,!0));p();var bTc=S.Object({});function STc(t,e,r){return[{defaultRules:t.get(qx).getDefaultRules()},null]}a(STc,"handleGetDefaultFileSafetyRulesChecked");var zUi=je(bTc,STc);p();var YUi=he(h9()),kye=he(ml());var TTc=S.Object({doc:S.Object({position:ng,uri:FTe,version:S.Number()}),panelId:S.String()});function ITc(t,e,r,n,o){let s=ibt(o.completionText),c=(0,YUi.SHA256)(s).toString();return t.get(vu).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(ITc,"makeSolution");var qOr=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(ur)}onSolution(e){return this.service.connection.sendNotification(new kye.NotificationType("PanelSolution"),ITc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return KUi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new kye.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function KUi(t,e){return e.connection.sendNotification(new kye.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(KUi,"reportDone");var XBe;async function xTc(t,e,r){XBe&&(XBe.cancel(),XBe.dispose()),XBe=new qn.CancellationTokenSource;let n=new FE([e,XBe.token]),o=r.doc.position,s=au.range(o,o),c=new qOr(t,r,s),l=t.get(VD);if(l.documents){let u=l.documents;abt(o,u,c)}else{let u;try{u=await O6(t,r.doc,n)}catch(f){if(!(f instanceof kye.ResponseError))throw f;switch(f.code){case it.CopilotNotAvailable:case it.ContentModified:return wTc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new wye(u,o,n,10);obt(t,d,c)}return[{solutionCountTarget:10},null]}a(xTc,"handleGetPanelCompletionsChecked");async function wTc(t,e){return await KUi(e.panelId,t.get(ur)),[{solutionCountTarget:0},null]}a(wTc,"produceEmptySolutions");var JUi=je(TTc,xTc);p();var RTc=S.Object({});async function PTc(t,e,r){let o=(await t.get(Ut).getToken()).userInfo,s=o.raw,l=(await t.get(Fr).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(PTc,"handleGetUserInfoChecked");var ZUi=je(RTc,PTc);p();var kTc=S.Object({});function DTc(t,e,r){return[{version:t.get(is).getDisplayVersion(),buildType:L9(t),runtimeVersion:`node/${process.versions.node}`},null]}a(DTc,"handleGetVersionChecked");var XUi=je(kTc,DTc);p();As();var NTc=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 MTc(t,e,r){if(r.changes.length===0)return[null,{code:it.InvalidRequest,message:"No changes provided"}];let n=t.get(jo),o=n.create({capabilities:{skills:[VM]}}),s=new $f({message:"",type:"user"});await n.addTurn(o.id,s);let c=bye({workDoneToken:ir()});await t.get(_c).begin(o,s,c);let d=(await new Qx(t,o,s,e).skillResolver.resolve(VM))?.head?.name,h=await t.get(IZ).generateCommitMessage(t,e,r,d);return h==null?[null,{code:it.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(MTc,"handleGitCommitGenerateChecked");var e7i=je(NTc,MTc);p();var OTc=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function BTc(t,e,r){try{let o=await new zy(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return yt(t,"githubApi.listPullRequestChangedFiles",Vt.createAndMarkAsIssued()),_t(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(La(t,n,"githubApi.listPullRequestChangedFiles"),gi(t,"githubApi.listPullRequestChangedFiles",n),n instanceof Wy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Rd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(BTc,"handleListPullRequestChangedFilesChecked");var t7i=je(OTc,BTc);p();p();var ubt=new Ee("GitHubGraphQLClient"),dbt=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(fr);return this.graphqlClient=YAn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){ubt.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++,ubt.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 { @@ -3836,7 +3793,7 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new qn.CancellationTokenSource,s } } } - `,{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 Vbt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(Vbt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Pd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new Wy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var URc=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc))}),IQi=4,tEe=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function QRc(t,e,r){try{let n=new Wbt(t),o=await jRc(t,r),s=await n.searchPullRequests(o);await qRc(t,s);let c=HRc(s);return ht(t,"githubApi.searchPR",jt.createAndMarkAsIssued()),gt(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof tEe)return[null,{code:n.errorCode,message:n.message}];if(n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(_s(t,n,"githubApi.searchPR"),gi(t,"githubApi.searchPR",n),n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(QRc,"handleSearchPRChecked");async function qRc(t,e){let r=new zy(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(qRc,"appendCopilotWorkStatus");async function jRc(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Ur).resolveSession();if(!n)throw new tEe("The user is not logged in.",Ke.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 tEe("No workspace folder provided",Ke.InvalidRequest);let s=await t.get(W0).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 tEe(l,Ke.NoGitHubRepository)}}return r}a(jRc,"replaceTemplateVariables");function HRc(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(HRc,"buildCopilotWorkStatusMeasurements");var xQi=Ne(URc,QRc);p();var GRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function $Rc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Xy).listHooks(n)).map(c=>{let l={};for(let[u,d]of Object.entries(c.parsedPromptFile.hooks))d!==void 0&&(l[u]=[...d]);return{uri:c.promptPath.uri,storage:c.promptPath.storage,hooks:l}}),null]}a($Rc,"listHooks");var wQi=Ne(GRc,$Rc);p();Ns();var kQi=PUt.type,xLe;function RQi(t){return{title:"Completion Accepted",command:cDe,arguments:[t]}}a(RQi,"makeCommand");async function VRc(t,e,r){xLe&&(xLe.cancel(),xLe.dispose());let n=r.context.triggerKind===1;xLe=new qn.CancellationTokenSource;let o=xLe.token,s=new qE([e,o]);r.contextItems&&Gbt(t,r.contextItems,r.data);let c=$bt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:RQi(gr()),...g}))},null];let l=await K6(t,r.textDocument,s),u=r.position,d=await t.get(BA).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Ke.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(vu);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:RQi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(VRc,"handleChecked");var PQi=Ne(nYn,(t,e,r)=>VRc(t,e,r));p();p();function V5r(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 rEe(o)}a(V5r,"asReadableCert");function rEe(t){return t.replace(/\s/g,"")}a(rEe,"normalizeNewlines");var zRc=S.Object({});async function YRc(t){return[{certificates:(await t.get(rp).getAllRootCAs()).map(rEe)},null]}a(YRc,"handleListCertificatesChecked");var DQi=Ne(zRc,YRc);p();var NQi="mcpGateway/serversChanged",MQi="mcpGateway/serverDetailsChanged",OQi=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()})]),KRc=S.Object({source:OQi,name:S.String()}),JRc=S.Object({});function ZRc(t,e,r){return[{servers:t.get(pb).listServers()},null]}a(ZRc,"handleListServersChecked");var BQi=Ne(JRc,ZRc),XRc=KRc;function ekc(t,e,r){return[{details:t.get(pb).getServerDetails(r)},null]}a(ekc,"handleGetServerDetailsChecked");var LQi=Ne(XRc,ekc),tkc=S.Object({source:OQi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function rkc(t,e,r){try{return await t.get(pb).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof zj)return[null,{code:Ke.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Ke.InternalError,message:o}]}}a(rkc,"handleServerActionChecked");var FQi=Ne(tkc,rkc);p();p();p();var UQi=ce(Al());var W5r=class extends UQi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ke.InternalError){super(o,e,{errorType:r,...n})}},Tne=class extends W5r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ke.InternalError){super(e,r,{status:n},o)}},zbt=class extends Tne{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ke.NoCopilotToken)}},Ybt=class extends Tne{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var Kbt=class extends Tne{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function QQi(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(QQi,"getRegistryMetadataFromConfig");function qQi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?nkc(t,r):!1}catch{return!1}}a(qQi,"validateServerConfigurationMatch");function nkc(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(nkc,"validateRemoteURL");var jQi=300*1e3,tN=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 Kbt(u)]:[null,new Tne(`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:Ke.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:Ke.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Ke.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:Ke.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=QQi(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?qQi(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(ar).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Ke.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Ke.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:Ke.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var ikc=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),HQi=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()))}),z5r=S.Intersect([HQi,S.Object({variables:S.Optional(S.Record(S.String(),HQi))})]),okc=S.Intersect([z5r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),skc=S.Intersect([z5r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),GQi=S.Union([okc,skc]),wLe=S.Intersect([z5r,S.Object({name:S.String()})]),akc=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(wLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(wLe))})])),runtimeArguments:S.Optional(S.Array(GQi)),packageArguments:S.Optional(S.Array(GQi)),environmentVariables:S.Optional(S.Array(wLe))}),ckc=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(wLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(wLe))})]),lkc=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")]))}),ukc=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}),dkc=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}),fkc=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(ukc)},{additionalProperties:!0}),pkc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(ikc),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(lkc)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(akc)),remotes:S.Optional(S.Array(ckc)),_meta:S.Optional(dkc)}),hkc=S.Object({server:pkc,_meta:fkc}),tyh=S.Object({servers:S.Array(hkc),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),$Qi=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())}),VQi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var RLe="mcp.registry.listServers",nEe="mcp.registry.getServer";async function mkc(t,e,r,n){return await t.get(tN).fetchServer(e,r,n)}a(mkc,"fetchServer");async function gkc(t,e,r){if(!r.baseUrl)return[null,{code:Ke.InvalidParams,message:"Base URL is required"}];let n=t.get(ar),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 Bm(t,RLe,jt.createAndMarkAsIssued({message:d})),[null,{code:Ke.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return ht(t,RLe,jt.createAndMarkAsIssued()),gt(t,RLe),[u,null]}catch(c){gi(t,RLe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return Bm(t,RLe,jt.createAndMarkAsIssued({message:l})),[null,{code:Ke.InternalError,message:l}]}}a(gkc,"handleListServersChecked");async function Akc(t,e,r){if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Ke.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Ke.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Ke.InvalidParams,message:"Version is required"}];let[n,o]=await mkc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return Bm(t,nEe,jt.createAndMarkAsIssued(s)),gt(t,nEe,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return Bm(t,nEe,jt.createAndMarkAsIssued(c)),gt(t,nEe,c),[null,{code:Ke.InternalError,message:s}]}return ht(t,nEe,jt.createAndMarkAsIssued()),gt(t,nEe),[n,null]}a(Akc,"handleGetServerChecked");var WQi=Ne($Qi,gkc),zQi=Ne(VQi,Akc);p();p();var YQi=S.Object({}),ykc=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()])}),Ekc=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:ykc}),yyh=S.Object({mcp_registries:S.Array(Ekc)});async function _kc(t){return await t.get(tN).fetchMcpRegistryAllowlist()}a(_kc,"fetchMcpRegistryAllowlist");async function Ckc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await _kc(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Ke.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Ke.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(Ckc,"handleGetMcpRegistryAllowlistChecked");var KQi=Ne(YQi,Ckc);p();var XQi=ce(cX()),eqi=ce(Ku()),tqi=ce(I_());p();Ns();var vkc=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()})}))}),oV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},Y5r=new ge("setNextEditDocument");function bkc(t,e,r){return Y5r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(oV,new oV(r.edits)),["OK",null]}a(bkc,"handleTestingSetNextEditDocumentChecked");var JQi=Ne(vkc,bkc);function ZQi(t,e,r,n){let o=t.get(oV);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?(Y5r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(Y5r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>Skc(c,r,n)))}}a(ZQi,"getTestNextEditSuggestions");function Skc(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:[gr()]}}}a(Skc,"createNextEditSuggestion");async function Tkc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=ca(r.textDocument.uri);t.get(B6).setForRequest(eqi.URI.parse(n),r.diagnostics??[]);let o=ZQi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(DC);t.get(XQi.ObservableWorkspace).onUserPositionChange(n,new tqi.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:cDe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(Tkc,"handleChecked");var rqi=Ne(wyn,Tkc);p();var xkc=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function wkc(t,e,r){let n=t.get(vu),o=n.get(r.uuid);return o&&(Rkc(r,o)==="full"?(n.delete(r.uuid),ihe(t,o,o.triggerCategory)):Flt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(wkc,"notifyAcceptedChecked");function Rkc(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}));Llt(t,"ghostText",s.offset,s.uri,c),t.get(FA).resetState()}return["OK",null]}a(Nkc,"notifyRejectedChecked");var oqi=Ne(Dkc,Nkc);p();var Mkc=S.Object({uuid:S.String({minLength:1})});function Okc(t,e,r){let o=t.get(vu).get(r.uuid);return o&&Fat(t,o.triggerCategory,o),["OK",null]}a(Okc,"notifyShownChecked");var sqi=Ne(Mkc,Okc);p();var Bkc=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function Lkc(t,e,r){let n=t.get(qS),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(Lkc,"handleParseTerminalCommandChecked");var aqi=Ne(Bkc,Lkc);p();var Fkc=tYn;function Ukc(t,e,r){let n=t.get(n0),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new Xye(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(Ukc,"registerContextProviders");var cqi=Ne(Fkc,Ukc);p();p();var Qkc=S.Object({uri:S.Optional(S.String())}),qkc=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),uqi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[a9r]:S.Optional(Qkc),http:S.Optional(wcn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),kLe=Object.keys(uqi.properties).filter(t=>t!=="github"),jkc=S.Intersect([uqi,qkc]),Hkc=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),lqi=Ou.Compile(Hkc),K5r=Ou.Compile(jkc);function sB(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(sB,"normalizePromptSetting");async function Zbt(t,e){if(!lqi.Check(e))throw Jbt(t),new vA(lqi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&Gkc(t,r),Jbt(t,r),Promise.resolve()}a(Zbt,"notifyChangeConfiguration");function Gkc(t,e){for(let n of K5r.Errors(e)){let o=n.path.split("/")?.[1];ys.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!K5r.Check(e))throw new vA(K5r.Errors(e));e.http&&J5r(t,e.http);let r=e["github-enterprise"];r&&N9e(t,r.uri),e.github?.copilot&&$kc(t,e.github.copilot)}a(Gkc,"applySettingsToConfiguration");function $kc(t,e){let r=t.get(Hv),n={};for(let o of Object.values(je)){let s=Pcn(e,o);n[o]=s}r.setCopilotSettings(n),xpe.clearCache(),typeof e.mcp=="string"&&oPc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(sPc(t,e.agent),aPc(t,e.agent),cPc(t,e.agent)),Vkc(t,e.globalCopilotInstructions),Wkc(t,e.globalGitCommitInstructions),zkc(t,e.globalAgentsMdInstructions),Ykc(t,e.globalClaudeMdInstructions),Kkc(t,e.globalInstructionFiles),Jkc(t,e.globalPromptFiles),tPc(t,e.instructionFileLocations),rPc(t,e.promptFileLocations),nPc(t,e.agentFileLocations),iPc(t,e.skillFileLocations)}a($kc,"applyCopilotConfiguration");function Vkc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalCopilotInstructions(n)}catch(r){ys.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(Vkc,"applyGlobalCopilotInstructionsConfiguration");function Wkc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalGitCommitInstructions(n)}catch(r){ys.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(Wkc,"applyGlobalGitCommitInstructionsConfiguration");function zkc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalAgentsMdInstructions(n)}catch(r){ys.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(zkc,"applyGlobalAgentsMdInstructionsConfiguration");function Ykc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalClaudeMdInstructions(n)}catch(r){ys.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(Ykc,"applyGlobalClaudeMdInstructionsConfiguration");function Kkc(t,e){try{let r=t.get(pf),n=(e||[]).map(sB);r.setGlobalInstructionFiles(n)}catch(r){ys.error(t,"Failed to apply global instruction files configuration",r)}}a(Kkc,"applyGlobalInstructionFilesConfiguration");function Jkc(t,e){try{let r=t.get(ag),n=(e||[]).map(sB);r.setGlobalPromptFiles(n)}catch(r){ys.error(t,"Failed to apply global prompt files configuration",r)}}a(Jkc,"applyGlobalPromptFilesConfiguration");function Zkc(t){return t?Array.isArray(t)?t.map(sB):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(Zkc,"normalizeFileLocations");function Xkc(t){let e=sB(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(Xkc,"normalizeInstructionPromptSetting");function ePc(t){return t?Array.isArray(t)?t.map(Xkc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(ePc,"normalizeInstructionFileLocations");function tPc(t,e){try{let r=t.get(pf);if(e===void 0)return;r.setInstructionFileLocations(ePc(e))}catch(r){ys.error(t,"Failed to apply instruction file locations configuration",r)}}a(tPc,"applyInstructionFileLocationsConfiguration");function rPc(t,e){try{let r=t.get(ag);if(e===void 0)return;r.setPromptFileLocations(Zkc(e))}catch(r){ys.error(t,"Failed to apply prompt file locations configuration",r)}}a(rPc,"applyPromptFileLocationsConfiguration");function nPc(t,e){try{let r=t.get(jp);if(e===void 0)return;let n=e.map(sB);r.setAgentFileLocations(n)}catch(r){ys.error(t,"Failed to apply agent file locations configuration",r)}}a(nPc,"applyAgentFileLocationsConfiguration");function iPc(t,e){try{let r=t.get(EA);if(e===void 0)return;let n=e.map(sB);r.setSkillFileLocations(n)}catch(r){ys.error(t,"Failed to apply skill file locations configuration",r)}}a(iPc,"applySkillFileLocationsConfiguration");function J5r(t,e){let r=t.get(Hv);e.proxy===void 0&&(e=Rcn(r.env));try{r.setHttpSettings(LSe(e))}catch(n){if(!(n instanceof TypeError))throw n;ys.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(J5r,"applyHttpConfiguration");async function oPc(t,e){let r;try{r=N7i(JSON.parse(e||"{}"))}catch(n){ys.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(jE).updateMCPServers(r)}catch(n){ys.error(t,"Failed to apply MCP configuration to McpManager",n)}try{await t.get(pb).applyConfig(r)}catch(n){ys.error(t,"Failed to apply MCP configuration to McpServerManager",n)}}a(oPc,"applyMCPConfiguration");function sPc(t,e){try{let r=e;t.get(qS).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){ys.error(t,"Failed to apply settings configuration",r)}}a(sPc,"applyTerminalAutoApproveConfiguration");function aPc(t,e){try{let r=e;t.get(zx).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){ys.error(t,"Failed to apply edit auto approve configuration",r)}}a(aPc,"applyEditAutoApproveConfiguration");function cPc(t,e){try{let r=e;t.get(N3).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){ys.error(t,"Failed to apply MCP auto approve configuration",r)}}a(cPc,"applyMCPAutoApproveConfiguration");function Jbt(t,e){if(t.get(Hv).markReady(),!t.get(Mn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(Ih).initialize(r)}}a(Jbt,"initializePostConfigurationDependencies");var dqi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),lPc=S.Object({editorInfo:dqi,editorPluginInfo:dqi,editorConfiguration:S.Optional(S.Object({}))});async function uPc(t,e,r){t.get(Lr).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),Ult(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await Zbt(t,{settings:r.editorConfiguration}),ht(t,"setEditorInfo");for(let n of["github",...kLe])r.editorConfiguration&&n in r.editorConfiguration&&ht(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(uPc,"handleSetEditorInfoChecked");var fqi=Ne(lPc,uPc);p();var dPc=S.Object({options:S.Optional(S.Object({}))});async function fPc(t,e,r){let n=t.get(bT),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Ke.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Ke.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(fPc,"handleSignInConfirmChecked");var pqi=Ne(dPc,fPc);p();var pPc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function hPc(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(bT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:qlt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof Ai))throw n;return[null,{code:Ke.DeviceFlowFailed,message:n.message}]}}a(hPc,"handleSignInInitiateChecked");var Z5r=Ne(pPc,hPc);p();p();p();var hqi=["google","apple"],Xbt=S.Optional(S.Union(hqi.map(t=>S.Literal(t))));function mqi(t){return typeof t=="string"&&hqi.includes(t)}a(mqi,"isGitHubSocialProvider");function X5r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(X5r,"isGitHubSocialProviderApplicableHostname");function gqi(t,e){if(!e)return t;try{let r=new URL(t);return X5r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(gqi,"addGitHubSocialProviderToVerificationUri");p();function Aqi(){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(Aqi,"isBrowserAvailable");function mPc(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(mPc,"getGitHubOAuthServerMetadata");async function e1t(t,e,r={},n){let o=performance.now();ohe(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!Aqi())throw new eU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=tU(t,r.authAuthority),u=mPc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=X5r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h}),g=m.scopes||f,A=t.get(Bp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new Ai("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}),C2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw C2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(e1t,"performGitHubOAuthCodeFlow");p();p();p();LHe();var iEe=class extends N0{constructor(r,n=new e4r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ur);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)}},e4r=class extends N0{static{a(this,"SpawnUrlOpener")}async open(e){await cSe(e)}};p();var yqi=require("crypto"),Eqi=ce(require("http"));p();var t1t=new ge("OAuth Code Flow");function t4r(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({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 ubt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(ubt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Rd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Fr).resolveSession();if(!e)throw new Wy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var LTc=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc))}),r7i=4,Dye=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function FTc(t,e,r){try{let n=new dbt(t),o=await QTc(t,r),s=await n.searchPullRequests(o);await UTc(t,s);let c=qTc(s);return yt(t,"githubApi.searchPR",Vt.createAndMarkAsIssued()),_t(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof Dye)return[null,{code:n.errorCode,message:n.message}];if(n instanceof Wy)return[null,{code:it.NoGitHubToken,message:n.message}];if(La(t,n,"githubApi.searchPR"),gi(t,"githubApi.searchPR",n),n instanceof Rd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(FTc,"handleSearchPRChecked");async function UTc(t,e){let r=new zy(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(UTc,"appendCopilotWorkStatus");async function QTc(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Fr).resolveSession();if(!n)throw new Dye("The user is not logged in.",it.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 Dye("No workspace folder provided",it.InvalidRequest);let s=await t.get(V0).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 Dye(l,it.NoGitHubRepository)}}return r}a(QTc,"replaceTemplateVariables");function qTc(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(qTc,"buildCopilotWorkStatusMeasurements");var n7i=je(LTc,FTc);p();var jTc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function HTc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Xy).listHooks(n)).map(c=>{let l={};for(let[u,d]of Object.entries(c.parsedPromptFile.hooks))d!==void 0&&(l[u]=[...d]);return{uri:c.promptPath.uri,storage:c.promptPath.storage,hooks:l}}),null]}a(HTc,"listHooks");var i7i=je(jTc,HTc);p();As();var s7i=L9t.type,eLe;function o7i(t){return{title:"Completion Accepted",command:O2e,arguments:[t]}}a(o7i,"makeCommand");async function GTc(t,e,r){eLe&&(eLe.cancel(),eLe.dispose());let n=r.context.triggerKind===1;eLe=new qn.CancellationTokenSource;let o=eLe.token,s=new FE([e,o]);r.contextItems&&cbt(t,r.contextItems,r.data);let c=lbt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:o7i(ir()),...g}))},null];let l=await O6(t,r.textDocument,s),u=r.position,d=await t.get(qA).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:it.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(vu);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:o7i(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(GTc,"handleChecked");var a7i=je(NWn,(t,e,r)=>GTc(t,e,r));p();p();function jOr(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 Nye(o)}a(jOr,"asReadableCert");function Nye(t){return t.replace(/\s/g,"")}a(Nye,"normalizeNewlines");var VTc=S.Object({});async function WTc(t){return[{certificates:(await t.get(np).getAllRootCAs()).map(Nye)},null]}a(WTc,"handleListCertificatesChecked");var c7i=je(VTc,WTc);p();var l7i="mcpGateway/serversChanged",u7i="mcpGateway/serverDetailsChanged",d7i=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()})]),zTc=S.Object({source:d7i,name:S.String()}),YTc=S.Object({});function KTc(t,e,r){return[{servers:t.get(ub).listServers()},null]}a(KTc,"handleListServersChecked");var f7i=je(YTc,KTc),JTc=zTc;function ZTc(t,e,r){return[{details:t.get(ub).getServerDetails(r)},null]}a(ZTc,"handleGetServerDetailsChecked");var p7i=je(JTc,ZTc),XTc=S.Object({source:d7i,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function eIc(t,e,r){try{return await t.get(ub).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof Dj)return[null,{code:it.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:it.InternalError,message:o}]}}a(eIc,"handleServerActionChecked");var h7i=je(XTc,eIc);p();p();p();var m7i=he(ml());var HOr=class extends m7i.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=it.InternalError){super(o,e,{errorType:r,...n})}},cne=class extends HOr{static{a(this,"HttpStatusError")}constructor(e,r,n,o=it.InternalError){super(e,r,{status:n},o)}},fbt=class extends cne{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,it.NoCopilotToken)}},pbt=class extends cne{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var hbt=class extends cne{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function g7i(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(g7i,"getRegistryMetadataFromConfig");function A7i(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?tIc(t,r):!1}catch{return!1}}a(A7i,"validateServerConfigurationMatch");function tIc(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(tIc,"validateRemoteURL");var y7i=300*1e3,WD=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 hbt(u)]:[null,new cne(`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:it.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:it.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:it.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:it.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=g7i(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?A7i(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(fr).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:it.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:it.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:it.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var rIc=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),E7i=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()))}),GOr=S.Intersect([E7i,S.Object({variables:S.Optional(S.Record(S.String(),E7i))})]),nIc=S.Intersect([GOr,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),iIc=S.Intersect([GOr,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),_7i=S.Union([nIc,iIc]),tLe=S.Intersect([GOr,S.Object({name:S.String()})]),oIc=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(tLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(tLe))})])),runtimeArguments:S.Optional(S.Array(_7i)),packageArguments:S.Optional(S.Array(_7i)),environmentVariables:S.Optional(S.Array(tLe))}),sIc=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(tLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(tLe))})]),aIc=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")]))}),cIc=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}),lIc=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}),uIc=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(cIc)},{additionalProperties:!0}),dIc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(rIc),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(aIc)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(oIc)),remotes:S.Optional(S.Array(sIc)),_meta:S.Optional(lIc)}),fIc=S.Object({server:dIc,_meta:uIc}),hhh=S.Object({servers:S.Array(fIc),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),v7i=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())}),C7i=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var rLe="mcp.registry.listServers",Mye="mcp.registry.getServer";async function pIc(t,e,r,n){return await t.get(WD).fetchServer(e,r,n)}a(pIc,"fetchServer");async function hIc(t,e,r){if(!r.baseUrl)return[null,{code:it.InvalidParams,message:"Base URL is required"}];let n=t.get(fr),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 Bm(t,rLe,Vt.createAndMarkAsIssued({message:d})),[null,{code:it.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return yt(t,rLe,Vt.createAndMarkAsIssued()),_t(t,rLe),[u,null]}catch(c){gi(t,rLe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return Bm(t,rLe,Vt.createAndMarkAsIssued({message:l})),[null,{code:it.InternalError,message:l}]}}a(hIc,"handleListServersChecked");async function mIc(t,e,r){if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:it.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:it.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:it.InvalidParams,message:"Version is required"}];let[n,o]=await pIc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return Bm(t,Mye,Vt.createAndMarkAsIssued(s)),_t(t,Mye,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return Bm(t,Mye,Vt.createAndMarkAsIssued(c)),_t(t,Mye,c),[null,{code:it.InternalError,message:s}]}return yt(t,Mye,Vt.createAndMarkAsIssued()),_t(t,Mye),[n,null]}a(mIc,"handleGetServerChecked");var b7i=je(v7i,hIc),S7i=je(C7i,mIc);p();p();var T7i=S.Object({}),gIc=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()])}),AIc=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:gIc}),khh=S.Object({mcp_registries:S.Array(AIc)});async function yIc(t){return await t.get(WD).fetchMcpRegistryAllowlist()}a(yIc,"fetchMcpRegistryAllowlist");async function EIc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await yIc(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:it.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:it.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(EIc,"handleGetMcpRegistryAllowlistChecked");var I7i=je(T7i,EIc);p();var R7i=he($Z()),P7i=he(Ku()),k7i=he(b_());p();As();var _Ic=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()})}))}),q$=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},$Or=new Ee("setNextEditDocument");function vIc(t,e,r){return $Or.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(q$,new q$(r.edits)),["OK",null]}a(vIc,"handleTestingSetNextEditDocumentChecked");var x7i=je(_Ic,vIc);function w7i(t,e,r,n){let o=t.get(q$);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?($Or.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):($Or.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>CIc(c,r,n)))}}a(w7i,"getTestNextEditSuggestions");function CIc(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:[ir()]}}}a(CIc,"createNextEditSuggestion");async function bIc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=ia(r.textDocument.uri);t.get(v6).setForRequest(P7i.URI.parse(n),r.diagnostics??[]);let o=w7i(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(wv);t.get(R7i.ObservableWorkspace).onUserPositionChange(n,new k7i.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:O2e,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(bIc,"handleChecked");var D7i=je(rAn,bIc);p();var TIc=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function IIc(t,e,r){let n=t.get(vu),o=n.get(r.uuid);return o&&(xIc(r,o)==="full"?(n.delete(r.uuid),Ope(t,o,o.triggerCategory)):rlt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(IIc,"notifyAcceptedChecked");function xIc(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}));tlt(t,"ghostText",s.offset,s.uri,c),t.get(HA).resetState()}return["OK",null]}a(kIc,"notifyRejectedChecked");var O7i=je(PIc,kIc);p();var DIc=S.Object({uuid:S.String({minLength:1})});function NIc(t,e,r){let o=t.get(vu).get(r.uuid);return o&&rat(t,o.triggerCategory,o),["OK",null]}a(NIc,"notifyShownChecked");var B7i=je(DIc,NIc);p();var MIc=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function OIc(t,e,r){let n=t.get(MS),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(OIc,"handleParseTerminalCommandChecked");var L7i=je(MIc,OIc);p();var BIc=kWn;function LIc(t,e,r){let n=t.get(n0),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new Pye(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(LIc,"registerContextProviders");var F7i=je(BIc,LIc);p();p();var FIc=S.Object({uri:S.Optional(S.String())}),UIc=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),Q7i=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[n6r]:S.Optional(FIc),http:S.Optional(Tan),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),nLe=Object.keys(Q7i.properties).filter(t=>t!=="github"),QIc=S.Intersect([Q7i,UIc]),qIc=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),U7i=Mu.Compile(qIc),VOr=Mu.Compile(QIc);function z4(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(z4,"normalizePromptSetting");async function gbt(t,e){if(!U7i.Check(e))throw mbt(t),new SA(U7i.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&jIc(t,r),mbt(t,r),Promise.resolve()}a(gbt,"notifyChangeConfiguration");function jIc(t,e){for(let n of VOr.Errors(e)){let o=n.path.split("/")?.[1];gs.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!VOr.Check(e))throw new SA(VOr.Errors(e));e.http&&WOr(t,e.http);let r=e["github-enterprise"];r&&o9e(t,r.uri),e.github?.copilot&&HIc(t,e.github.copilot)}a(jIc,"applySettingsToConfiguration");function HIc(t,e){let r=t.get(LC),n={};for(let o of Object.values(Je)){let s=wan(e,o);n[o]=s}r.setCopilotSettings(n),ipe.clearCache(),typeof e.mcp=="string"&&nxc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(ixc(t,e.agent),oxc(t,e.agent),sxc(t,e.agent)),GIc(t,e.globalCopilotInstructions),$Ic(t,e.globalGitCommitInstructions),VIc(t,e.globalAgentsMdInstructions),WIc(t,e.globalClaudeMdInstructions),zIc(t,e.globalInstructionFiles),YIc(t,e.globalPromptFiles),XIc(t,e.instructionFileLocations),exc(t,e.promptFileLocations),txc(t,e.agentFileLocations),rxc(t,e.skillFileLocations)}a(HIc,"applyCopilotConfiguration");function GIc(t,e){try{let r=t.get(df),n=z4(e);r.setGlobalCopilotInstructions(n)}catch(r){gs.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(GIc,"applyGlobalCopilotInstructionsConfiguration");function $Ic(t,e){try{let r=t.get(df),n=z4(e);r.setGlobalGitCommitInstructions(n)}catch(r){gs.error(t,"Failed to apply global Git commit instructions configuration",r)}}a($Ic,"applyGlobalGitCommitInstructionsConfiguration");function VIc(t,e){try{let r=t.get(df),n=z4(e);r.setGlobalAgentsMdInstructions(n)}catch(r){gs.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(VIc,"applyGlobalAgentsMdInstructionsConfiguration");function WIc(t,e){try{let r=t.get(df),n=z4(e);r.setGlobalClaudeMdInstructions(n)}catch(r){gs.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(WIc,"applyGlobalClaudeMdInstructionsConfiguration");function zIc(t,e){try{let r=t.get(df),n=(e||[]).map(z4);r.setGlobalInstructionFiles(n)}catch(r){gs.error(t,"Failed to apply global instruction files configuration",r)}}a(zIc,"applyGlobalInstructionFilesConfiguration");function YIc(t,e){try{let r=t.get(ag),n=(e||[]).map(z4);r.setGlobalPromptFiles(n)}catch(r){gs.error(t,"Failed to apply global prompt files configuration",r)}}a(YIc,"applyGlobalPromptFilesConfiguration");function KIc(t){return t?Array.isArray(t)?t.map(z4):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(KIc,"normalizeFileLocations");function JIc(t){let e=z4(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(JIc,"normalizeInstructionPromptSetting");function ZIc(t){return t?Array.isArray(t)?t.map(JIc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(ZIc,"normalizeInstructionFileLocations");function XIc(t,e){try{let r=t.get(df);if(e===void 0)return;r.setInstructionFileLocations(ZIc(e))}catch(r){gs.error(t,"Failed to apply instruction file locations configuration",r)}}a(XIc,"applyInstructionFileLocationsConfiguration");function exc(t,e){try{let r=t.get(ag);if(e===void 0)return;r.setPromptFileLocations(KIc(e))}catch(r){gs.error(t,"Failed to apply prompt file locations configuration",r)}}a(exc,"applyPromptFileLocationsConfiguration");function txc(t,e){try{let r=t.get(Hp);if(e===void 0)return;let n=e.map(z4);r.setAgentFileLocations(n)}catch(r){gs.error(t,"Failed to apply agent file locations configuration",r)}}a(txc,"applyAgentFileLocationsConfiguration");function rxc(t,e){try{let r=t.get(Z0);if(e===void 0)return;let n=e.map(z4);r.setSkillFileLocations(n)}catch(r){gs.error(t,"Failed to apply skill file locations configuration",r)}}a(rxc,"applySkillFileLocationsConfiguration");function WOr(t,e){let r=t.get(LC);e.proxy===void 0&&(e=Ian(r.env));try{r.setHttpSettings(fSe(e))}catch(n){if(!(n instanceof TypeError))throw n;gs.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(WOr,"applyHttpConfiguration");async function nxc(t,e){let r;try{r=lUi(JSON.parse(e||"{}"))}catch(n){gs.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(UE).updateMCPServers(r)}catch(n){gs.error(t,"Failed to apply MCP configuration to McpManager",n)}try{await t.get(ub).applyConfig(r)}catch(n){gs.error(t,"Failed to apply MCP configuration to McpServerManager",n)}}a(nxc,"applyMCPConfiguration");function ixc(t,e){try{let r=e;t.get(MS).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){gs.error(t,"Failed to apply settings configuration",r)}}a(ixc,"applyTerminalAutoApproveConfiguration");function oxc(t,e){try{let r=e;t.get(qx).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){gs.error(t,"Failed to apply edit auto approve configuration",r)}}a(oxc,"applyEditAutoApproveConfiguration");function sxc(t,e){try{let r=e;t.get(E3).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){gs.error(t,"Failed to apply MCP auto approve configuration",r)}}a(sxc,"applyMCPAutoApproveConfiguration");function mbt(t,e){if(t.get(LC).markReady(),!t.get(Mn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(xh).initialize(r)}}a(mbt,"initializePostConfigurationDependencies");var q7i=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),axc=S.Object({editorInfo:q7i,editorPluginInfo:q7i,editorConfiguration:S.Optional(S.Object({}))});async function cxc(t,e,r){t.get(Lr).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),nlt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await gbt(t,{settings:r.editorConfiguration}),yt(t,"setEditorInfo");for(let n of["github",...nLe])r.editorConfiguration&&n in r.editorConfiguration&&yt(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(cxc,"handleSetEditorInfoChecked");var j7i=je(axc,cxc);p();var lxc=S.Object({options:S.Optional(S.Object({}))});async function uxc(t,e,r){let n=t.get(AT),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:it.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:it.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(uxc,"handleSignInConfirmChecked");var H7i=je(lxc,uxc);p();var dxc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function fxc(t,e,r){try{let o=await t.get(Fr).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(AT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:olt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof Jn))throw n;return[null,{code:it.DeviceFlowFailed,message:n.message}]}}a(fxc,"handleSignInInitiateChecked");var zOr=je(dxc,fxc);p();p();p();var G7i=["google","apple"],Abt=S.Optional(S.Union(G7i.map(t=>S.Literal(t))));function $7i(t){return typeof t=="string"&&G7i.includes(t)}a($7i,"isGitHubSocialProvider");function YOr(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(YOr,"isGitHubSocialProviderApplicableHostname");function V7i(t,e){if(!e)return t;try{let r=new URL(t);return YOr(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(V7i,"addGitHubSocialProviderToVerificationUri");p();function W7i(){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(W7i,"isBrowserAvailable");function pxc(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(pxc,"getGitHubOAuthServerMetadata");async function ybt(t,e,r={},n){let o=performance.now();Bpe(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!W7i())throw new q9("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=j9(t,r.authAuthority),u=pxc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=YOr(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h}),g=m.scopes||f,A=t.get(Lp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new Jn("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Fr).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),p2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw p2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(ybt,"performGitHubOAuthCodeFlow");p();p();async function Ebt(t,e){let r=await Bf(t,e,"user",{headers:{Accept:"application/json"}}),n;try{n=await r.json()}catch(o){throw new Jn(`Could not parse GitHub user response (HTTP ${r.status}).`,o instanceof Error?o:void 0)}if(n===null||typeof n!="object")throw new Jn(`Unexpected GitHub user response (HTTP ${r.status}).`);if(!r.ok||"errors"in n){let o=n.message??("errors"in n?String(n.errors):`HTTP ${r.status}`);throw new Jn(`Error retrieving GitHub user information: ${o}`)}if(typeof n.login!="string"||n.login.length===0)throw new Jn(`GitHub user response did not include a login (HTTP ${r.status}).`);return{id:n.id!==void 0?String(n.id):"",login:n.login}}a(Ebt,"requestGitHubUserInfo");p();p();lHe();var Oye=class extends N0{constructor(r,n=new KOr){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ur);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)}},KOr=class extends N0{static{a(this,"SpawnUrlOpener")}async open(e){await U1e(e)}};p();var Y7i=require("crypto"),K7i=he(require("http"));p();var z7i=new Ee("OAuth Code Flow");function JOr(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 @@ -3910,13 +3867,13 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new qn.CancellationTokenSource,s } -`;var n4r=["authorization_code","refresh_token"],oEe=33428,r1t=class{constructor(e,r){this._logger=new ge("LoopbackAuthServer");this.nonce=(0,yqi.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=Eqi.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 Ai("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),aDe(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 Ai(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),aDe(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 Ai("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}),aDe(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 Ai("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}),aDe(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(r4r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(r4r)}})}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 ${oEe} 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(oEe,"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 n1t=require("crypto");var PLe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,n1t.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,n1t.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 gPc="Timed out",_qi="Sign-in request was cancelled",i4r=class{static{a(this,"CodeFlow")}},sEe=class extends i4r{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=PLe.isServerSupported(n.code_challenge_methods_supported),h=f?PLe.createPKCEParameters():void 0;f?Dr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Dr.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 r1t(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Dr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new iEe(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,k)=>{let D=setTimeout(()=>k(new Error(gPc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((k,D)=>{if(x.isCancellationRequested){Dr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(_qi));return}let N=x.onCancellationRequested(()=>{Dr.info(this.ctx,"OAuth flow cancelled"),D(new Error(_qi))});b.push(N)}))}v=(await Promise.race(w)).code,Dr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Dr.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=>{Dr.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);Dr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await QZ(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 Dr.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 rN=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=>t4r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(Si).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(Bp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=mqi(r.provider)?r.provider:void 0,d=await new sEe(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,{prompt:"select_account",provider:u},r.cancellationToken),f=await this.tokenToSession(d.access_token,e);this.afterSessionLoad(f);let h=o.findIndex(g=>g.account.id===f.account.id&&t4r([...g.scopes].sort(),n)),m=new Array;return h>-1?m.push(...o.splice(h,1,f)):o.push(f),await this.storeSessions(o),f}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(Si).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(ar).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return t1t.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 t1t.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 t1t.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 APc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:Xbt});async function yPc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ke.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:Ke.AuthEnvVarConflict,message:O9e(c)}];let l=await e1t(t,(u,d)=>new rN(u,rN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider},e);if(!["OK","MaybeOK"].includes(l.status))throw new Ai("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof eU)return[null,{code:Ke.NoBrowserAvailable,message:n.message}];if(!(n instanceof Ai))throw n;return[null,{code:Ke.CodeFlowFailed,message:n.message}]}}a(yPc,"handleSignInWithCodeFlowChecked");var Cqi=Ne(APc,yPc);p();p();p();var J6=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},DLe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function vqi(t,e,r){return e.isCancellationRequested?Promise.reject(new J6):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new J6))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new DLe))},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(vqi,"raceWithCancellationAndTimeout");var EPc=["repo","workflow"];async function _Pc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...by(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(ar).fetch(s,o)}catch(l){throw l instanceof Error&&OI(l)?new Ai(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new Ai(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(_Pc,"requestDeviceCode");async function CPc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...by(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(ar).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&OI(l)?new Ai(`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 Ai(c.error_description):new Ai(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(CPc,"requestAccessToken");async function vPc(t,e){let n=await(await Td(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ai(`Error retrieving user information: ${String(n.errors)}`);return n}a(vPc,"requestUserInfo");async function bPc(t,e,r){let n=r?.githubAppId??t.get(Bp).findAppIdToAuthenticate(),o=r?.scopes??EPc,{serverUrl:s,apiUrl:c,authAuthority:l}=tU(t,r?.authAuthority),u=await _Pc(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 J6("Sign-in request was cancelled");m=await CPc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await vPc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new J6("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:Ke.AuthEnvVarConflict,message:O9e(u)}];ohe(t,"deviceFlow");let d=t.get(Ine),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ur).connection.sendNotification(IPc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await vqi(f.waitForAuth,e,xPc),m=await d.save(h);return C2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof J6)return[null,{code:Ke.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof DLe)return C2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ke.DeviceFlowFailed,message:"Sign-in request timed out"}];if(C2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof Ai))throw s;return[null,{code:Ke.DeviceFlowFailed,message:s.message}]}}a(wPc,"handleSignInWithDeviceFlowChecked");var Sqi=Ne(TPc,wPc);p();var RPc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function kPc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Ur);return[await t.get(bT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(kPc,"handleSignInWithGithubTokenChecked");var Tqi=Ne(RPc,kPc);p();var PPc=S.Object({options:S.Optional(S.Object({}))});async function DPc(t,e,r){return[await t.get(Ur).signOutEditor(),null]}a(DPc,"handleSignOutChecked");var Iqi=Ne(PPc,DPc);p();var NPc=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())})))})))}),o4r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function MPc(t,e,r){let n=t.get(ss),o=t.get(Lr).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&U5.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:Owt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},U5.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new o4r(r.stacktrace??"N/A",o.name);return l.stack=void 0,_s(t,l,r.transaction??"",s,c),["OK",null]}a(MPc,"handleTelemetryExceptionChecked");var xqi=Ne(NPc,MPc);p();p();p();Ns();function s4r(t){let e=Date.now()+((t?.refresh_in??0)+mPt)*1e3;return new lW({token:`test token ${gr()}`,refresh_in:0,expires_at:e,...t},void 0,e)}a(s4r,"createTestCopilotToken");var aEe=class extends gh{constructor(){super(...arguments);this.defaultToken=s4r({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:s4r({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 i1t=class extends gh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:s4r(await this.envelopeFn())}}};var OPc=S.Object({options:S.Optional(S.Object({}))});async function BPc(t,e,r){let n=new aEe;return t.get(Ur).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(gh,n),t.get(as).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(BPc,"handleTestingAlwaysAuthChecked");var a4r=Ne(OPc,BPc);p();Ns();var LPc=S.Object({messages:S.Array(S.Object({role:S.Enum(tc),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Tn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function FPc(t,e,r){let n=new rc(t),s=await FQ(t)?Tn.Gpt35turbo:Tn.CopilotBase,c=await t.get(Bc).getBestChatModelConfig([r.modelFamily??s]),l=await UTe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:gA.user("test",gr())},e,l),null]}a(FPc,"handleChatMLChecked");var wqi=Ne(LPc,FPc);p();p();p();var fEe=ce(Dji(),1),cSh={ALPN_HTTP2:fEe.default.ALPN_HTTP2,ALPN_HTTP2C:fEe.default.ALPN_HTTP2C,ALPN_HTTP1_1:fEe.default.ALPN_HTTP1_1,ALPN_HTTP1_0:fEe.default.ALPN_HTTP1_0},{fetch:lSh,context:Nji,reset:uSh,noCache:dSh,h1:fSh,keepAlive:pSh,h1NoCache:hSh,keepAliveNoCache:mSh,cacheStats:gSh,clearCache:ASh,offPush:ySh,onPush:ESh,createUrl:_Sh,timeoutSignal:CSh,Body:vSh,Headers:Mji,Request:bSh,Response:SSh,AbortController:TSh,AbortError:C1t,AbortSignal:ISh,FetchBaseError:xSh,FetchError:wSh,ALPN_HTTP2:RSh,ALPN_HTTP2C:kSh,ALPN_HTTP1_1:PSh,ALPN_HTTP1_0:DSh}=fEe.default;var Bji=require("crypto"),Lji=require("http"),Fji=require("stream"),Uji=require("util"),hEe=ce(sP());var sNc=6e5,aNc=new hEe.ProtocolRequestType("copilot/fetch"),cNc=new hEe.ProtocolRequestType("copilot/fetchCancel"),lNc=new hEe.ProgressType,uNc=new hEe.ProtocolRequestType("copilot/fetchDisconnectAll"),aB=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},pEe=class extends ar{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(ss).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ur).connection.sendRequest(uNc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ur).connection,c=(0,Bji.randomUUID)(),l=new qn.CancellationTokenSource,u=new Fji.PassThrough,d=a(()=>{s.sendRequest(cNc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new C1t("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new aB("EditorFetcher received unexpected abort signal");if(o.aborted)throw new C1t("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(lNc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new aB(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??sNc,y=setTimeout(()=>{gt(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new aB("Request timed out from lsp server"))},A),E=a(()=>{g(new C1t("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(aNc,fNc(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,Uji.inspect)(_.data)}`),g(new aB(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new aB("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new BI(h.status,Lji.STATUS_CODES[h.status]??"",new Mji(h.headers),()=>dNc(u),()=>u)}};function dNc(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(dNc,"consumeStream");function fNc(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(fNc,"convertOptionsToParams");var pNc=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 hNc(t,e,r){let n=new pEe(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 aB?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 aB?y.message:String(y)}`},null]}}a(hNc,"handleTestingFetchChecked");var Qji=Ne(pNc,hNc);p();var mNc=S.Object({});async function gNc(t,e,r){return await t.get(_d).flush(),["OK",null]}a(gNc,"handleTestingFlushPromiseQueueChecked");var qji=Ne(mNc,gNc);p();p();p();var cV=class{static{a(this,"FileSearch")}};p();p();p();var v1t=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 jji=ce(ti());var b1t="main.js",S1t=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=Uun(b1t,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new v1t(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new f$e(this.id++),jji.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new l$e(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new u$e(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new d$e(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new a$e(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 c$e(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 s$e(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(b1t+"'")&&(r=new Error(`Failed to load ${b1t}`),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(`${b1t} 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 QLe=ce(ti());var r9=new ge(wlr),T1t=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){r9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,QLe.CancellationToken.None);return}r9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new S1t(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{r9.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 ANc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,QLe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{r9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){r9.debug(this.ctx,`indexing workspace ${e}`);let r=b3t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${b3t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(cV),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,QLe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));r9.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)})),r9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{r9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,QLe.CancellationToken.None)}catch(n){r9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return Ucn(e)}};async function ANc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(ANc,"createIndexableWorkspaceFolder");var yNc=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 ENc(t,e,r){try{await t.get(S_).start();let n=t.get(T1t),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,Rlr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(bNc,"handleTestingNeverAuthChecked");var B4r=Ne(vNc,bNc);p();p();p();var L4r=class extends rp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},$ji=a(t=>new L4r(t),"createTestCertificateReader");function U4r(t,e,r){let n=new F4r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new BI(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(U4r,"createFakeResponse");function Vji(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),U4r(t,n,Object.assign({"content-type":"application/json"},r))}a(Vji,"createFakeJsonResponse");var qLe=class extends ar{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var I1t=class extends qLe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var F4r=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 Q4r=class extends qLe{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(Vji(200,this.fullConfig)):Promise.resolve(U4r(404,""))}},x1t=class extends Q4r{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 SNc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function TNc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(ar,new x1t(n,t.get(ar)))}return["OK",null]}a(TNc,"handleTestingOverrideExpFlagsChecked");var Wji=Ne(SNc,TNc);p();var INc=S.Object({rules:$8t});function xNc(t,e,r){return t.get(Cc).setTestingRules(r.rules),["OK",null]}a(xNc,"handleTestingSetContentExclusionRulesChecked");var zji=Ne(INc,xNc);p();var wNc=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 RNc(t,e,r){return t.get(n9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(RNc,"handleTestingSetSyntheticTurnsChecked");var Yji=Ne(wNc,RNc);p();var kNc=S.Object({});async function PNc(t,e,r){let n=t.get(sa),o=t.get(Df);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(PNc,"handleTriggerShowMessageChecked");var Kji=Ne(kNc,PNc);p();p();p();p();var Jji=ce(require("tls"));var mEe=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(rp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Jji.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 lHi=ce(require("http"));var rMc=407,cy=new ge("proxySocketFactory"),UR=class{static{a(this,"ProxySocketFactory")}},Pne=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 w1t(t){return new H4r(t,new G4r(t))}a(w1t,"getProxySocketFactory");var H4r=class extends UR{constructor(r,n,o=new HLe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new nn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(cy.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 Pne&&o.code===`ProxyStatusCode${rMc}`){cy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return cy.debug(this.ctx,"Proxy authorization successful, caching result"),ht(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&&(cy.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(cy.debug(this.ctx,"Proxy authorization successful, received token"),o)return cy.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){cy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);cy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);cy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return cy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return cy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return cy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},G4r=class extends UR{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(ss).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{cy.debug(this.ctx,"Attempting to establish connection to proxy");let l=lHi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{cy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Pne(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Pne(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(cy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{cy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Pne(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{cy.debug(this.ctx,"Proxy socket connection timeout"),c(new Pne(`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"])}},HLe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>ce(cHi()))}};var Dne=class extends ar{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new mEe(r),this.proxySocketFactory=r.get(UR),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Zo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Zo).getHttpSettings()),this.updateNoProxy(r.get(Zo).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(ss),s=this.proxySocketTimeoutForTesting;return Nji({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 oW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new BI(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var yEe=class extends D0{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(Ih).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=Sy({serverUrl:D9e(r,n.serverUrl),apiUrl:D9e(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 EEe=class extends yB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){_s(e,r,n)}};p();var _Ee=class extends L5{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var R1t=class extends vP{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var k1t=class extends Uh{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 P1t=class extends cV{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 nMc(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(nMc,"fakeChatModelConfiguration");function iMc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(iMc,"fakeEmbeddingModelConfiguration");var D1t=class extends Bc{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(nMc(r))}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(iMc(e))}};p();var N1t=class extends N0{constructor(){super(...arguments);this.openedUrls=[];this.opened=new rA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},M1t=class extends sa{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 uHi(t,e,r,n){return iP.create(P9e(t),e,r,n,e)}a(uHi,"createTextDocument");var $4r=class extends cn{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new no;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new no;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new no;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new no;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new no;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=uHi(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]=uHi(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}},O1t=class extends $4r{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 V4r=class extends Df{static{a(this,"NullLog")}logIt(...e){}},W4r=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 oMc(t){let e=new ile;e.set(Zo,t),e.set(Jz,t);let r=new W4r(e,{accessToken:"",login:"user"});e.set(Ur,r),e.set(ss,new ss),e.set(vI,new vI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(rp,$ji([])),e.set(UR,w1t(e)),e.set(dM,new dM),e.set(Qk,new QQe);let n=new aEe;e.set(gh,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Nf(e);return s.updateFromToken(n.defaultToken),e.set(Nf,s),e.set(k0,new k0),e.set(bN,new bN),e.set(sa,new M1t),e.set(N0,new N1t),e.set(yB,new EEe),e.set(Df,new V4r),e.set(lv,new lv),e.set(Fa,new Fa("test-session","test-machine","test-device")),e.set(CI,new CI(()=>Promise.resolve("test-device"))),e.set(D0,new yEe(e)),e.set(ik,new fie),e.set(Ih,new Ih(e,"copilot-test")),e.set(Jt,new Jt(e)),e.set(PN,new PN(e,o)),e.set(f2,new f2),e.set(eP,new cce),e.set(as,new LQe),e.set(_d,new _d),e.set(b5,new b5(e)),e.set(cV,new P1t),e.set(E2,new E2(e)),e.set(VF,wlt(e)),e.set(FA,new FA),e.set(_b,new _b),e.set(WF,WF.default),e.set(mx,new mx(e,!1)),e.set(Bp,new Bp),e.set(Jn,new Jn(e)),e.set(vT,new Plt),e.set(r0,new r0),e.set(n0,jat(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Cb,new Cb(e)),sMc(e),e.set(Eb,new Eb(e)),e.set(Mn,new Mn),e.set(L5,new _Ee),e.set(v2,new v2),e.set(Kx,new Kx),e.set(OP,new OP(e)),e}a(oMc,"_createBaselineContext");function sMc(t){t.set(Vo,new Vo(t)),t.set(vc,new vc(t)),t.set(dA,new dA(t)),t.set(Qh,new Qh),t.set(eg,new eg),t.set(Uh,new k1t),t.set(LR,new LR(t,[])),t.set(Bc,new D1t),t.set(vP,new R1t),t.set(rO,new rO(t)),t.set(JQ,new JQ),t.set(Y0,new Y0(t)),t.set(D_,new D_),t.set(Lx,new Lx);let e=new JD(t);t.set(JD,e),t.set(BR,new BR(e,t)),t.set(pO,new pO(t)),t.set(oI,new bbt),t.set(Uv,new Uv(t.get(BR),t.get(oI),t)),t.set(X0,new X0)}a(sMc,"registerConversation");function dHi(){let t=oMc(new Jz(new lce,new Map));return t.set(ar,new I1t),t.set(Lr,new z4r),t.set(cn,new O1t(t)),t.set(Fo,new L7),t.set(Cc,new Cc(t)),t.set(Rd,new Rd(t)),t.set(IS,new BWe),t.set(jM,new jM(t)),t.set(S5,new kpe),t.set(d2,new uat),t.set(uu,new _We),t.set(T_,new T_(t)),t.set(lA,new oWe),t.set(om,new om),iWe(t),t.set(BA,new she(t)),t}a(dHi,"createLibTestingContext");var z4r=class extends Lr{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 pHi=ce(require("fs"));var fHi=`${process.env.HOME}/.copilot-testing-gh-token`,B1t,L1t;function hHi(t){let e=mHi(),r=new i1t(aMc);return t.forceSet(gh,r),t.get(Ur).setTransientSession(e),r}a(hHi,"setIntegrationTokenManager");var aMc=a(async()=>{if(L1t)return L1t;let t=await mHi(),e=dHi(),r=new Dne(e);return e.forceSet(ar,r),L1t=gPt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new Ai('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),L1t},"getEnvelope");async function mHi(){let{session:t}=iMt(process.env);if(t)return t;try{B1t??=(await pHi.promises.readFile(fHi)).toString().trim()}catch{B1t??=process.env.GITHUB_TOKEN??""}if(!B1t)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 ${fHi}. Run "npm run get_token" to get one.`);return{...Sy({}),accessToken:B1t,login:"copilot-client tests"}}a(mHi,"getTestingGitHubSession");var cMc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function lMc(t,e,r){return hHi(t),await t.get(Qt).primeToken(),["OK",null]}a(lMc,"handleTestingUseTestingTokenChecked");var gHi=Ne(cMc,lMc);p();var uMc=S.Object({});async function dMc(t,e,r){return await new zAe().uninstall(t),["OK",null]}a(dMc,"handleUninstallChecked");var AHi=Ne(uMc,dMc);p();var fMc=rYn;function pMc(t,e,r){let n=t.get(n0),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(pMc,"unregisterContextProviders");var yHi=Ne(fMc,pMc);p();var Y4r=ce(require("os"));var hMc=S.Object({expectedCertificate:S.String()});async function mMc(t,e,r){let o=(await Znt(t).getAllRootCAs()).map(rEe),s=rEe(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${V5r(s)}. Only found those installed on the system:${Y4r.EOL}${o.map(c=>"- "+V5r(c)).join(Y4r.EOL)}`},null]}a(mMc,"handleVerifyCertificateChecked");var EHi=Ne(hMc,mMc);p();var gMc=S.Object({});async function AMc(){return[{status:!!await new HLe().load()},null]}a(AMc,"handleVerifyKerberosChecked");var _Hi=Ne(gMc,AMc);p();var yMc=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function EMc(t,e,r){let o=await t.get(cn).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(EMc,"handleVerifyStateChecked");var CHi=Ne(yMc,EMc);p();var _Mc=S.Object({});function CMc(t,e,r){return[t.get(cn).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(CMc,"handleVerifyWorkspaceStateChecked");var vHi=Ne(_Mc,CMc);p();p();var vEe=ce(require("fs/promises")),bHi=ce(require("os")),$d=ce(require("path"));var vp=new ge("GitWorktreeService"),vMc=20,CEe=class{constructor(e){this.ctx=e;this.gitInstances=new nn(vMc)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=$d.resolve(e),n=this.gitInstances.get(r);return n||(n=xJe(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=$d.resolve(e);vp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return vp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw vp.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?(vp.info(this.ctx,`Skipping checkpoint commit for ${$d.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)),vp.info(this.ctx,`Created ${n} commit for ${$d.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){vp.info(this.ctx,`Snapshotting copied changes in ${$d.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 vp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await vEe.mkdtemp($d.join(bHi.tmpdir(),"copilot-worktree-")),o=$d.join(n,"changes.patch");try{vp.info(this.ctx,`Writing temporary patch for ${$d.resolve(e)} to ${o} (${r.length} chars)`),await vEe.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 vEe.rm(n,{recursive:!0,force:!0}),vp.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=$d.basename(r),h=$d.join($d.dirname(r),`${f}.worktrees`),m=$d.join(h,d);return vp.info(this.ctx,`Preparing worktree creation for ${$d.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])),vp.info(this.ctx,`Created worktree ${m} from ${$d.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){vp.info(this.ctx,`Preparing to remove worktree ${e} from ${$d.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),vp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return vp.info(this.ctx,`Skipping status lookup for ${$d.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){vp.info(this.ctx,`Applying worktree changes from ${$d.resolve(e)} to ${$d.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");vp.info(this.ctx,o?`Committed pending worktree changes in ${$d.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${$d.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return vp.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 vp.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 vp.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"])),vp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),vp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),vp.info(this.ctx,`Popped stash in ${e}`)}};p();var SHi=ce(ti());var h1=new ge("WorktreeService");var bMc=new SHi.ProtocolRequestType("worktree/requestUserDecision"),GLe=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 h1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";h1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ur).connection.sendRequest(bMc,{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?(h1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(h1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){h1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(h1.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&&(h1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(h1.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},h1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);h1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw h1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return h1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){h1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return h1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var SMc="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",TMc=["already exists in working directory","patch does not apply","patch failed"];function IMc(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&TMc.some(n=>e.includes(n))?SMc:`Failed to apply worktree changes: ${e}`}a(IMc,"getWorktreeCompleteErrorMessage");var xMc=S.Object({repositoryPath:S.String()});async function wMc(t,e,r){try{let n=new CEe(t),o=new GLe(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:Ke.InternalError,message:`Failed to create worktree: ${o}`}]}}a(wMc,"handleWorktreeCreateChecked");var THi=Ne(xMc,wMc),RMc=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function kMc(t,e,r){try{let n=new CEe(t);return[{success:!0,baseCommit:(await new GLe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ke.InternalError,message:IMc(n)}]}}a(kMc,"handleWorktreeCompleteChecked");var IHi=Ne(RMc,kMc),PMc=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function DMc(t,e,r){try{return await new CEe(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ke.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(DMc,"handleWorktreeDeleteChecked");var xHi=Ne(PMc,DMc);var Nne=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function wHi(){let t=new Map;return t.set(kQi.method,PQi),t.set("getCompletions",gQi),t.set("getCompletionsCycling",AQi),t.set("getDefaultFileSafetyRules",yQi),t.set("copilot/parseTerminalCommand",aqi),t.set("getPanelCompletions",CQi),t.set(z7i.method,Y7i),t.set("getVersion",bQi),t.set("getUserInfo",vQi),t.set("setEditorInfo",fqi),t.set("checkStatus",n7i),t.set("checkQuota",r7i),t.set("checkFileStatus",e7i),t.set("claude/checkCliCompatibility",XUi),t.set("signInInitiate",Z5r),t.set("signIn",Z5r),t.set("signInWithCodeFlow",Cqi),t.set("signInWithDeviceFlow",Sqi),t.set("signInConfirm",pqi),t.set("signInWithGithubToken",Tqi),t.set("signOut",Iqi),t.set("auth/listAvailableTokens",b6i),t.set("auth/useExistingToken",S6i),t.set("notifyShown",sqi),t.set("notifyAccepted",nqi),t.set("notifyRejected",oqi),t.set("notifyNextEditRejected",iqi),t.set("telemetry/exception",xqi),t.set("textDocument/copilotInlineEdit",rqi),t.set("testing/overrideExpFlags",Wji),t.set("testing/alwaysAuth",a4r),t.set("testing/setAlwaysAuthed",a4r),t.set("testing/neverAuth",B4r),t.set("testing/setNeverAuthed",B4r),t.set("testing/useTestingToken",gHi),t.set("testing/setCompletionDocuments",fQi),t.set("testing/setPanelCompletionDocuments",V7i),t.set("testing/setNextEditDocument",JQi),t.set("testing/triggerShowMessageRequest",Kji),t.set("testing/flushPromiseQueue",qji),t.set("testing/getDocument",Gji),t.set("testing/chatml",wqi),t.set("testing/setSyntheticTurns",Yji),t.set("testing/fetch",Qji),t.set("testing/setContentExclusionRules",zji),t.set("testing/getContext",Hji),t.set("uninstall",AHi),t.set("debug/diagnostics",sQi),t.set("debug/listCertificates",DQi),t.set("debug/verifyState",CHi),t.set("debug/verifyCertificate",EHi),t.set("debug/verifyKerberos",_Hi),t.set("debug/verifyWorkspaceState",vHi),t.set("debug/getAgentDebugLog",aQi),t.set("context/registerProviders",cqi),t.set("context/unregisterProviders",yHi),t.set("conversation/preconditions",C7i),t.set("conversation/persistence",_7i),t.set("conversation/create",g7i),t.set("conversation/turn",T7i),t.set("conversation/turnDelete",I7i),t.set("conversation/destroy",A7i),t.set("conversation/compress",f7i),t.set("conversation/rating",v7i),t.set("conversation/copyCode",u7i),t.set("conversation/insertCode",d7i),t.set("conversation/templates",S7i),t.set("conversation/modes",y7i),t.set("conversation/agents",l7i),t.set("conversation/registerTools",b7i),t.set("conversation/unregisterTools",x7i),t.set("conversation/updateToolsStatus",w7i),t.set("conversation/notifyCodeAcceptance",E7i),t.set("customAgent/registerExtensionAgents",J7i),t.set("customAgent/unregisterExtensionAgents",Z7i),t.set("copilot/customAgent/list",K7i),t.set("copilot/customSkill/list",tQi),t.set("copilot/customPrompt/list",eQi),t.set("copilot/customInstruction/list",X7i),t.set("copilot/hook/list",wQi),t.set("copilot/models",Q7i),t.set("copilot/models/getModelMetadataList",q7i),t.set("copilot/byok/saveModel",ZUi),t.set("copilot/byok/deleteModel",I6i),t.set("copilot/byok/listModels",KUi),t.set("copilot/byok/saveApiKey",JUi),t.set("copilot/byok/deleteApiKey",T6i),t.set("copilot/byok/listApiKeys",x6i),t.set("copilot/setModelPolicy",j7i),t.set("copilot/codeReview/reviewChanges",k7i),t.set("copilot/codeReview/reviewSnippets",P7i),t.set("git/commitGenerate",SQi),t.set("thinking/generateTitle",R7i),t.set("mcp/getTools",M7i),t.set("mcp/updateToolsStatus",O7i),t.set("mcp/readResource",B7i),t.set("mcp/registry/listServers",WQi),t.set("mcp/registry/getServer",zQi),t.set("mcp/registry/getAllowlist",KQi),t.set("mcp/getPrompt",L7i),t.set("mcp/completePrompt",F7i),t.set("mcp/serverAction",U7i),t.set("mcpGateway/listServers",BQi),t.set("mcpGateway/getServerDetails",LQi),t.set("mcpGateway/serverAction",FQi),t.set("githubApi/searchPR",xQi),t.set("githubApi/cancelCodingAgent",o7i),t.set("cloudAgent/listSessions",c7i),t.set("cloudAgent/getSessionLogs",a7i),t.set("cloudAgent/createJob",s7i),t.set("cloudAgent/addPullRequestComment",i7i),t.set("githubApi/listPullRequestChangedFiles",TQi),t.set("worktree/create",THi),t.set("worktree/complete",IHi),t.set("worktree/delete",xHi),t.set("backgroundAgent/create",t6i),t.set("backgroundAgent/send",C6i),t.set("backgroundAgent/destroy",r6i),t.set("backgroundAgent/listModels",g6i),t.set("backgroundAgent/listSessions",p6i),t.set("backgroundAgent/resume",E6i),t.set("backgroundAgent/stop",v6i),t.set("backgroundAgent/interaction",u6i),t.set("backgroundAgent/enableRemote",s6i),t.set("backgroundAgent/disableRemote",i6i),t.set("backgroundAgent/getRemoteStatus",c6i),t.set("backgroundAgent/getPlanPath",a6i),t.set("backgroundAgent/compactHistory",Z8i),new Nne(t)}a(wHi,"getAllMethods");p();p();p();var RHi=ce(sP());var MC=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new RHi.NotificationType(this.name)}};var NMc=new ge("BackgroundAgent.notifications"),K4r=class extends MC{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},J4r=class extends MC{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:wMr})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){NMc.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Us).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},kHi=[K4r,J4r];p();var Z4r=class extends MC{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")}},PHi=[Z4r];p();var MMc=new ge("agentCopilotTokenManager");function eBr(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(eBr,"tokenEndpointToApiUrl");function OMc(t,e){if(!e.tokenEndpoint)return Sy(e);let r=eBr(e.tokenEndpoint);return r||MMc.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),Sy({apiUrl:r})}a(OMc,"getUrlsFromParams");var X4r=class extends MC{constructor(){super(...arguments);this.name=IUt.method;this.params=gyn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Ur),o=OMc(this.ctx,r);this.ctx.get(D0).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})}},DHi=[X4r];p();var tBr=class extends MC{constructor(){super(...arguments);this.name=DUt.method;this.params=Syn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(vu).get(n);s&&SZn(this.ctx,s)}},rBr=class extends MC{constructor(){super(...arguments);this.name=MUt.method;this.params=Ryn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(DC).handleShown(n)}},nBr=class extends MC{constructor(){super(...arguments);this.name=NUt.method;this.params=Tyn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(vu),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),ihe(this.ctx,c)):Flt(this.ctx,c,o,void 0,void 0,"cumulative"))}},NHi=[tBr,rBr,nBr];p();var F1t=class extends MC{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(ZD).cancel(r.token)}};var BMc=[...kHi,...PHi,...DHi,...NHi,F1t];function MHi(t,e){for(let r of BMc){let n=new r(t),o=Ou.Compile(n.params);e.onNotification(n.type,Pm(t,async s=>{F6(s),o.Check(s)?await n.handle(s):ys.error(t,`Notification ${n.name}:`,new vA(o.Errors(s)))},`Notification ${n.name}`))}}a(MHi,"registerNotifications");p();p();var OHi=ce(require("crypto")),BHi=require("os");Ns();var LMc=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function FMc(t){let e=t.replace(/-/g,":").toLowerCase();return!LMc.has(e)}a(FMc,"validateMacAddress");function UMc(){let t=(0,BHi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(FMc(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(UMc,"getMac");var iBr;function QMc(){try{let t=UMc();return OHi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(QMc,"getMacMachineId");function oBr(){return iBr||(iBr=QMc()||gr()),iBr}a(oBr,"getMachineId");Ns();function sBr(t){let e=t??gr()+Date.now();return new Fa(e,oBr(),oBr())}a(sBr,"createEditorSession");var LHi=sBr();p();var U1t=ce(Al());var aBr=new ge("AgentTextDocumentConfiguration"),cBr=class{constructor(e){this.ctx=e;this.#e=new no;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return iP.create(e,r,n,o)}catch(s){throw aBr.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=iP.withChanges(e,r,n);for(let l of r)if(U1t.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])}.`;aBr.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=jt.createAndMarkAsIssued({message:`Received ${g}`});ht(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}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw aBr.exception(this.ctx,o,".update"),o}}},uV=class extends cn{constructor(){super(...arguments);this.#e=new no;this.onDidOpenTextDocument=this.#e.event;this.#t=new no;this.onDidCloseTextDocument=this.#t.event;this.#r=new no;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new cBr(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new U1t.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new no;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ur).connection}init(r){this.connection.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._textDocumentConfiguration.create(o.uri,o.languageId,o.version,o.text);this._documents.set(ca(o.uri),s),this.#e.fire({document:{...o,uri:s.uri}})}),this.connection.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges,{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=ca(o.uri),u=this._documents.get(l);u!==void 0&&(u=this._textDocumentConfiguration.update(u,s,c),this._documents.set(l,u))}),this.connection.onDidCloseTextDocument(n=>{let o=ca(n.textDocument.uri);this._documents.delete(o),this.#t.fire({document:{uri:o}})}),this.connection.onNotification(RUt.type,n=>{let o=("textDocument"in n?n.textDocument:n)??{};this.#r.fire("uri"in o?{document:o}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0,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)}registerWorkspaceFolder(r){this.workspaceFolders.find(n=>n.uri===r.uri)||this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(ca(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 FHi=Ou.Compile(Cyn);function F6(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(UHi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of kLe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(KM).handleConfigurationChange(e.settings)}catch(n){ys.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return Zbt(this.ctx,F6(e))}catch(r){ys.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Df)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),MHi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(ss).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(uV).didChangeWorkspaceFolders(c)}catch(l){ys.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;let l=c.capabilities.copilot,u=F6(c.initializationOptions);if(u){if(!FHi.Check(u))throw new vA(FHi.Errors(u));let m=u,g=e.get(Lr);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):ys.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(Bp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Fa,sBr(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(uV).init(c.workspaceFolders??[]),Lzn(this.ctx),l&&(e.get(Mn).setCapabilities(l),l.contentProvider&&aa.registerSchemes(l.contentProvider),"openURL"in l&&Ult(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,ys.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(as).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(aI.DidChangeConfigurationNotification.type,{section:UHi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(Hv).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||Jbt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(as).sendInitNonAuthStatus(),new zAe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(Pm(e,h,"onInitialized")),e.get(zD).init(),l?.token&&e.get(Ur).setTransientSession({}),l?.redirectedTelemetry&&$8i(e),QHi.lt(process.versions.node,"22.0.0")&&ys.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:aI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:q8i(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 svt;this.ctx.forceSet(Df,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");gi(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Nne).handlers.get(e);if(!o)return new aI.ResponseError(Ke.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new aI.ResponseError(Ke.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new aI.ResponseError(Ke.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!fRn(this.ctx.get(Lr)))throw new aI.ResponseError(Ke.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),F6(r);try{let[s,c]=await o(this.ctx,n,r);return c?new aI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new aI.ResponseError(Ke.RequestCancelled,"Request was canceled");if(s instanceof Ai)return this.telemetryMethodFailure(e,s),new aI.ResponseError(Ke.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof aI.ResponseError||ys.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(oY).stop()}catch(e){ys.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(Q3).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(pb).dispose().catch(e=>{ys.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){ys.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(Bj).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(kP).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(UF).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose Claude Code agent service")}this.ctx.get(Us).shutdown().catch(e=>{ys.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(zm).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Df,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(Hv).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Cdr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(_d).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(k0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},ys=new ge("lsp");var OC=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new qHi.ProtocolRequestType("conversation/context");this.typeCheck=Ou.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ur).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 jHi.ResponseError(l.code,l.message,l.data);Ye.error(this.ctx,`ResponseError while resolving skill ${this.skillId}`,u);return}o=c}catch(s){Ye.error(this.ctx,`Error while resolving skill ${this.skillId}`,s);return}if(o!=null){if(!this.typeCheck.Check(o))throw new vA(this.typeCheck.Errors(o));return o}}};var lBr=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")}},n9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new lBr(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},Q1t=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(vc)}static{a(this,"SyntheticTurnProcessor")}async process(e,r){try{await this.processWithSyntheticTurns(this.syntheticTurn,e,r)}catch(n){Ye.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(Vo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new OC(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 rx(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:gr()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var XD=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(n9).get(r);if(o)return new Q1t(e,o);let c=(await Px(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 jYe(e.ctx):l=new mle(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new kwe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new kwe(e,l):new ytt(e,l)}};p();var dV=class extends v_{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 Or([new wr(r)],"success")}errorResult(r){return new Or([new wr(r)],"error")}};p();function qMc(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(qMc,"mapToolNameToKind");function jMc(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(jMc,"extractLocationsFromInput");function HMc(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(HMc,"mapToolCallStatus");var q1t=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=HMc(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=jMc(c.name,c.input);await this.reportToolCallStart(c.id,c.name,qMc(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 XOr=["authorization_code","refresh_token"],Bye=33428,_bt=class{constructor(e,r){this._logger=new Ee("LoopbackAuthServer");this.nonce=(0,Y7i.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=K7i.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 Jn("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),M2e(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 Jn(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),M2e(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 Jn("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}),M2e(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 Jn("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}),M2e(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(ZOr,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(ZOr)}})}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 ${Bye} 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(Bye,"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 vbt=require("crypto");var iLe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,vbt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,vbt.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 hxc="Timed out",J7i="Sign-in request was cancelled",e5r=class{static{a(this,"CodeFlow")}},Lye=class extends e5r{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=iLe.isServerSupported(n.code_challenge_methods_supported),h=f?iLe.createPKCEParameters():void 0;f?Dr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Dr.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 _bt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Dr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new Oye(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(hxc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Dr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(J7i));return}let N=x.onCancellationRequested(()=>{Dr.info(this.ctx,"OAuth flow cancelled"),D(new Error(J7i))});b.push(N)}))}v=(await Promise.race(w)).code,Dr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Dr.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=>{Dr.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);Dr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await bZ(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 Dr.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 zD=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=>JOr([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(bi).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(Lp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=$7i(r.provider)?r.provider:void 0,d=await new Lye(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,{prompt:"select_account",provider:u},r.cancellationToken),f=await this.tokenToSession(d.access_token,e);this.afterSessionLoad(f);let h=o.findIndex(g=>g.account.id===f.account.id&&JOr([...g.scopes].sort(),n)),m=new Array;return h>-1?m.push(...o.splice(h,1,f)):o.push(f),await this.storeSessions(o),f}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(bi).update("oauth",this.id,e)}async tokenToSession(e,r){let{id:n,login:o}=await this.fetchUserInfo(e);return{id:crypto.getRandomValues(new Uint32Array(2)).reduce((s,c)=>s+=c.toString(16),""),accessToken:e,account:{label:o,id:n},scopes:r}}async fetchUserInfo(e){let{apiUrl:r}=Lm({serverUrl:this.serverMetadata?.issuer});return Ebt(this.ctx,{apiUrl:r,accessToken:e})}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){try{let{id:r,login:n}=await this.fetchUserInfo(e.accessToken);return!r||!n}catch(r){return z7i.error(this.ctx,"Failed to fetch user info: ",r),!0}}};var mxc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:Abt});async function gxc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Fr),{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:it.AuthEnvVarConflict,message:a9e(c)}];let l=await ybt(t,(u,d)=>new zD(u,zD.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider},e);if(!["OK","MaybeOK"].includes(l.status))throw new Jn("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof q9)return[null,{code:it.NoBrowserAvailable,message:n.message}];if(!(n instanceof Jn))throw n;return[null,{code:it.CodeFlowFailed,message:n.message}]}}a(gxc,"handleSignInWithCodeFlowChecked");var Z7i=je(mxc,gxc);p();p();p();var B6=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},oLe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function X7i(t,e,r){return e.isCancellationRequested?Promise.reject(new B6):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new B6))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new oLe))},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(X7i,"raceWithCancellationAndTimeout");var Axc=["repo","workflow"];async function yxc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...wy(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(fr).fetch(s,o)}catch(l){throw l instanceof Error&&RI(l)?new Jn(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new Jn(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(yxc,"requestDeviceCode");async function Exc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...wy(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(fr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&RI(l)?new Jn(`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 Jn(c.error_description):new Jn(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(Exc,"requestAccessToken");async function _xc(t,e,r){let n=r?.githubAppId??t.get(Lp).findAppIdToAuthenticate(),o=r?.scopes??Axc,{serverUrl:s,apiUrl:c,authAuthority:l}=j9(t,r?.authAuthority),u=await yxc(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 B6("Sign-in request was cancelled");m=await Exc(t,u.device_code,n,s);let g=m.access_token;if(g){let{login:A}=await Ebt(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new B6("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,accessToken:g,scopes:y}}h=m.interval??h}while(Date.now()performance.now()-n,"getElapsedTimeMs");try{let s=t.get(Fr),{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:it.AuthEnvVarConflict,message:a9e(u)}];Bpe(t,"deviceFlow");let d=t.get(lne),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ur).connection.sendNotification(bxc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await X7i(f.waitForAuth,e,Sxc),m=await d.save(h);return p2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof B6)return[null,{code:it.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof oLe)return p2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:it.DeviceFlowFailed,message:"Sign-in request timed out"}];if(p2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof Jn))throw s;return[null,{code:it.DeviceFlowFailed,message:s.message}]}}a(Txc,"handleSignInWithDeviceFlowChecked");var tQi=je(Cxc,Txc);p();var Ixc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function xxc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Fr);return[await t.get(AT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(xxc,"handleSignInWithGithubTokenChecked");var rQi=je(Ixc,xxc);p();var wxc=S.Object({options:S.Optional(S.Object({}))});async function Rxc(t,e,r){return[await t.get(Fr).signOutEditor(),null]}a(Rxc,"handleSignOutChecked");var nQi=je(wxc,Rxc);p();var Pxc=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())})))})))}),t5r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function kxc(t,e,r){let n=t.get(is),o=t.get(Lr).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&x5.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:Xxt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},x5.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new t5r(r.stacktrace??"N/A",o.name);return l.stack=void 0,La(t,l,r.transaction??"",s,c),["OK",null]}a(kxc,"handleTelemetryExceptionChecked");var iQi=je(Pxc,kxc);p();p();p();As();function r5r(t){let e=Date.now()+((t?.refresh_in??0)+NPt)*1e3;return new $V({token:`test token ${ir()}`,refresh_in:0,expires_at:e,...t},void 0,e)}a(r5r,"createTestCopilotToken");var Fye=class extends Ah{constructor(){super(...arguments);this.defaultToken=r5r({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:r5r({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 Cbt=class extends Ah{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:r5r(await this.envelopeFn())}}};var Dxc=S.Object({options:S.Optional(S.Object({}))});async function Nxc(t,e,r){let n=new Fye;return t.get(Fr).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Ah,n),t.get(os).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(Nxc,"handleTestingAlwaysAuthChecked");var n5r=je(Dxc,Nxc);p();As();var Mxc=S.Object({messages:S.Array(S.Object({role:S.Enum(Xa),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Tn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function Oxc(t,e,r){let n=new ec(t),s=await CQ(t)?Tn.Gpt35turbo:Tn.CopilotBase,c=await t.get(zc).getBestChatModelConfig([r.modelFamily??s]),l=await fTe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:EA.user("test",ir())},e,l),null]}a(Oxc,"handleChatMLChecked");var oQi=je(Mxc,Oxc);p();p();p();var Hye=he(lqi(),1),w_h={ALPN_HTTP2:Hye.default.ALPN_HTTP2,ALPN_HTTP2C:Hye.default.ALPN_HTTP2C,ALPN_HTTP1_1:Hye.default.ALPN_HTTP1_1,ALPN_HTTP1_0:Hye.default.ALPN_HTTP1_0},{fetch:R_h,context:uqi,reset:P_h,noCache:k_h,h1:D_h,keepAlive:N_h,h1NoCache:M_h,keepAliveNoCache:O_h,cacheStats:B_h,clearCache:L_h,offPush:F_h,onPush:U_h,createUrl:Q_h,timeoutSignal:q_h,Body:j_h,Headers:dqi,Request:H_h,Response:G_h,AbortController:$_h,AbortError:Ubt,AbortSignal:V_h,FetchBaseError:W_h,FetchError:z_h,ALPN_HTTP2:Y_h,ALPN_HTTP2C:K_h,ALPN_HTTP1_1:J_h,ALPN_HTTP1_0:Z_h}=Hye.default;var pqi=require("crypto"),hqi=require("http"),mqi=require("stream"),gqi=require("util"),$ye=he(XP());var nPc=6e5,iPc=new $ye.ProtocolRequestType("copilot/fetch"),oPc=new $ye.ProtocolRequestType("copilot/fetchCancel"),sPc=new $ye.ProgressType,aPc=new $ye.ProtocolRequestType("copilot/fetchDisconnectAll"),Y4=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},Gye=class extends fr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(is).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ur).connection.sendRequest(aPc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ur).connection,c=(0,pqi.randomUUID)(),l=new qn.CancellationTokenSource,u=new mqi.PassThrough,d=a(()=>{s.sendRequest(oPc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new Ubt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new Y4("EditorFetcher received unexpected abort signal");if(o.aborted)throw new Ubt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(sPc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new Y4(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??nPc,y=setTimeout(()=>{_t(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new Y4("Request timed out from lsp server"))},A),E=a(()=>{g(new Ubt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(iPc,lPc(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,gqi.inspect)(_.data)}`),g(new Y4(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new Y4("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new PI(h.status,hqi.STATUS_CODES[h.status]??"",new dqi(h.headers),()=>cPc(u),()=>u)}};function cPc(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(cPc,"consumeStream");function lPc(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(lPc,"convertOptionsToParams");var uPc=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 dPc(t,e,r){let n=new Gye(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 Y4?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 Y4?y.message:String(y)}`},null]}}a(dPc,"handleTestingFetchChecked");var Aqi=je(uPc,dPc);p();var fPc=S.Object({});async function pPc(t,e,r){return await t.get(_d).flush(),["OK",null]}a(pPc,"handleTestingFlushPromiseQueueChecked");var yqi=je(fPc,pPc);p();p();p();var G$=class{static{a(this,"FileSearch")}};p();p();p();var Qbt=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 Eqi=he(ti());var qbt="main.js",jbt=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=Mln(qbt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new Qbt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new UGe(this.id++),Eqi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new BGe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new LGe(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new FGe(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new MGe(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 OGe(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 NGe(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(qbt+"'")&&(r=new Error(`Failed to load ${qbt}`),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(`${qbt} 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 pLe=he(ti());var q6=new Ee(Scr),Hbt=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){q6.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,pLe.CancellationToken.None);return}q6.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new jbt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{q6.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 hPc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,pLe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{q6.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){q6.debug(this.ctx,`indexing workspace ${e}`);let r=qLt.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${qLt.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(G$),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,pLe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));q6.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)})),q6.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{q6.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,pLe.CancellationToken.None)}catch(n){q6.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return Ban(e)}};async function hPc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(hPc,"createIndexableWorkspaceFolder");var mPc=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 gPc(t,e,r){try{await t.get(AS).start();let n=t.get(Hbt),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,Tcr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(_Pc,"handleTestingNeverAuthChecked");var D5r=je(EPc,_Pc);p();p();p();var N5r=class extends np{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},Cqi=a(t=>new N5r(t),"createTestCertificateReader");function O5r(t,e,r){let n=new M5r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new PI(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(O5r,"createFakeResponse");function bqi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),O5r(t,n,Object.assign({"content-type":"application/json"},r))}a(bqi,"createFakeJsonResponse");var hLe=class extends fr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var Gbt=class extends hLe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var M5r=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 B5r=class extends hLe{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(bqi(200,this.fullConfig)):Promise.resolve(O5r(404,""))}},$bt=class extends B5r{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 vPc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function CPc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(fr,new $bt(n,t.get(fr)))}return["OK",null]}a(CPc,"handleTestingOverrideExpFlagsChecked");var Sqi=je(vPc,CPc);p();var bPc=S.Object({rules:JFt});function SPc(t,e,r){return t.get(Ec).setTestingRules(r.rules),["OK",null]}a(SPc,"handleTestingSetContentExclusionRulesChecked");var Tqi=je(bPc,SPc);p();var TPc=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(WM)),options:S.Optional(S.Object({}))});function IPc(t,e,r){return t.get(j6).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(IPc,"handleTestingSetSyntheticTurnsChecked");var Iqi=je(TPc,IPc);p();var xPc=S.Object({});async function wPc(t,e,r){let n=t.get(ra),o=t.get(Df);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(wPc,"handleTriggerShowMessageChecked");var xqi=je(xPc,wPc);p();p();p();p();var wqi=he(require("tls"));var Vye=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(np)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=wqi.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 Qqi=he(require("http"));var XPc=407,py=new Ee("proxySocketFactory"),DR=class{static{a(this,"ProxySocketFactory")}},hne=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 Vbt(t){return new U5r(t,new Q5r(t))}a(Vbt,"getProxySocketFactory");var U5r=class extends DR{constructor(r,n,o=new gLe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new yn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(py.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 hne&&o.code===`ProxyStatusCode${XPc}`){py.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return py.debug(this.ctx,"Proxy authorization successful, caching result"),yt(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&&(py.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(py.debug(this.ctx,"Proxy authorization successful, received token"),o)return py.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){py.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);py.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);py.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return py.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return py.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return py.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},Q5r=class extends DR{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(is).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{py.debug(this.ctx,"Attempting to establish connection to proxy");let l=Qqi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{py.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new hne(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new hne(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(py.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{py.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new hne(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{py.debug(this.ctx,"Proxy socket connection timeout"),c(new hne(`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"])}},gLe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>he(Uqi()))}};var mne=class extends fr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new Vye(r),this.proxySocketFactory=r.get(DR),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(zo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(zo).getHttpSettings()),this.updateNoProxy(r.get(zo).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(is),s=this.proxySocketTimeoutForTesting;return uqi({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 qV(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new PI(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var Yye=class extends D0{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(Ut).resetToken("config_urls_changed"),r.get(xh).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=Lm({serverUrl:i9e(r,n.serverUrl),apiUrl:i9e(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 Kye=class extends sB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){La(e,r,n)}};p();var Jye=class extends T5{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var Wbt=class extends mk{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var zbt=class extends Uh{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 Ybt=class extends G${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 ekc(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(ekc,"fakeChatModelConfiguration");function tkc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(tkc,"fakeEmbeddingModelConfiguration");var Kbt=class extends zc{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(ekc(r))}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(tkc(e))}};p();var Jbt=class extends N0{constructor(){super(...arguments);this.openedUrls=[];this.opened=new iA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},Zbt=class extends ra{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 qqi(t,e,r,n){return JP.create(n9e(t),e,r,n,e)}a(qqi,"createTextDocument");var q5r=class extends an{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new ro;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new ro;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new ro;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new ro;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new ro;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=qqi(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]=qqi(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}},Xbt=class extends q5r{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 j5r=class extends Df{static{a(this,"NullLog")}logIt(...e){}},H5r=class extends Fr{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 rkc(t){let e=new Bce;e.set(zo,t),e.set(Mz,t);let r=new H5r(e,{accessToken:"",login:"user"});e.set(Fr,r),e.set(is,new is),e.set(gI,new gI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(np,Cqi([])),e.set(DR,Vbt(e)),e.set(rM,new rM),e.set(NP,new fQe);let n=new Fye;e.set(Ah,n);let o=new Ut(e,!0);e.set(Ut,o);let s=new Nf(e);return s.updateFromToken(n.defaultToken),e.set(Nf,s),e.set(P0,new P0),e.set(mN,new mN),e.set(ra,new Zbt),e.set(N0,new Jbt),e.set(sB,new Kye),e.set(Df,new j5r),e.set(oC,new oC),e.set(Oa,new Oa("test-session","test-machine","test-device")),e.set(mI,new mI(()=>Promise.resolve("test-device"))),e.set(D0,new Yye(e)),e.set(JR,new Yne),e.set(xh,new xh(e,"copilot-test")),e.set(Jt,new Jt(e)),e.set(bN,new bN(e,o)),e.set(i2,new i2),e.set(WP,new Gae),e.set(os,new lQe),e.set(_d,new _d),e.set(d5,new d5(e)),e.set(G$,new Ybt),e.set(d2,new d2(e)),e.set(kF,Vct(e)),e.set(HA,new HA),e.set(fb,new fb),e.set(DF,DF.default),e.set(lx,new lx(e,!1)),e.set(Lp,new Lp),e.set(ni,new ni(e)),e.set(gT,new Yct),e.set(r0,new r0),e.set(n0,sat(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(pb,new pb(e)),nkc(e),e.set(db,new db(e)),e.set(Mn,new Mn),e.set(T5,new Jye),e.set(h2,new h2),e.set(Hx,new Hx),e.set(wk,new wk(e)),e}a(rkc,"_createBaselineContext");function nkc(t){t.set(jo,new jo(t)),t.set(_c,new _c(t)),t.set(hA,new hA(t)),t.set(Qh,new Qh),t.set(tg,new tg),t.set(Uh,new zbt),t.set(PR,new PR(t,[])),t.set(zc,new Kbt),t.set(mk,new Wbt),t.set($M,new $M(t));let e=new HD(t);t.set(HD,e),t.set(RR,new RR(e,t)),t.set(tO,new tO(t)),t.set(XT,new qCt),t.set(NC,new NC(t.get(RR),t.get(XT),t)),t.set(X0,new X0)}a(nkc,"registerConversation");function jqi(){let t=rkc(new Mz(new $ae,new Map));return t.set(fr,new Gbt),t.set(Lr,new G5r),t.set(an,new Xbt(t)),t.set(Bo,new b7),t.set(Ec,new Ec(t)),t.set(lu,new lu(t)),t.set(ES,new nWe),t.set(kM,new kM(t)),t.set(f5,new ape),t.set(n2,new Pst),t.set(cu,new qVe),t.set(C_,new C_(t)),t.set(fA,new IVe),t.set(om,new om),TVe(t),t.set(qA,new Lpe(t)),t}a(jqi,"createLibTestingContext");var G5r=class extends Lr{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 Gqi=he(require("fs"));var Hqi=`${process.env.HOME}/.copilot-testing-gh-token`,e1t,t1t;function $qi(t){let e=Vqi(),r=new Cbt(ikc);return t.forceSet(Ah,r),t.get(Fr).setTransientSession(e),r}a($qi,"setIntegrationTokenManager");var ikc=a(async()=>{if(t1t)return t1t;let t=await Vqi(),e=jqi(),r=new mne(e);return e.forceSet(fr,r),t1t=MPt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new Jn('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),t1t},"getEnvelope");async function Vqi(){let{session:t}=CNt(process.env);if(t)return t;try{e1t??=(await Gqi.promises.readFile(Hqi)).toString().trim()}catch{e1t??=process.env.GITHUB_TOKEN??""}if(!e1t)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 ${Hqi}. Run "npm run get_token" to get one.`);return{...Lm({}),accessToken:e1t,login:"copilot-client tests"}}a(Vqi,"getTestingGitHubSession");var okc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function skc(t,e,r){return $qi(t),await t.get(Ut).primeToken(),["OK",null]}a(skc,"handleTestingUseTestingTokenChecked");var Wqi=je(okc,skc);p();var akc=S.Object({});async function ckc(t,e,r){return await new TAe().uninstall(t),["OK",null]}a(ckc,"handleUninstallChecked");var zqi=je(akc,ckc);p();var lkc=DWn;function ukc(t,e,r){let n=t.get(n0),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(ukc,"unregisterContextProviders");var Yqi=je(lkc,ukc);p();var $5r=he(require("os"));var dkc=S.Object({expectedCertificate:S.String()});async function fkc(t,e,r){let o=(await cnt(t).getAllRootCAs()).map(Nye),s=Nye(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${jOr(s)}. Only found those installed on the system:${$5r.EOL}${o.map(c=>"- "+jOr(c)).join($5r.EOL)}`},null]}a(fkc,"handleVerifyCertificateChecked");var Kqi=je(dkc,fkc);p();var pkc=S.Object({});async function hkc(){return[{status:!!await new gLe().load()},null]}a(hkc,"handleVerifyKerberosChecked");var Jqi=je(pkc,hkc);p();var mkc=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function gkc(t,e,r){let o=await t.get(an).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(gkc,"handleVerifyStateChecked");var Zqi=je(mkc,gkc);p();var Akc=S.Object({});function ykc(t,e,r){return[t.get(an).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(ykc,"handleVerifyWorkspaceStateChecked");var Xqi=je(Akc,ykc);p();p();var Xye=he(require("fs/promises")),eji=he(require("os")),Hd=he(require("path"));var bp=new Ee("GitWorktreeService"),Ekc=20,Zye=class{constructor(e){this.ctx=e;this.gitInstances=new yn(Ekc)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=Hd.resolve(e),n=this.gitInstances.get(r);return n||(n=UKe(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=Hd.resolve(e);bp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return bp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw bp.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?(bp.info(this.ctx,`Skipping checkpoint commit for ${Hd.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)),bp.info(this.ctx,`Created ${n} commit for ${Hd.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){bp.info(this.ctx,`Snapshotting copied changes in ${Hd.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 bp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await Xye.mkdtemp(Hd.join(eji.tmpdir(),"copilot-worktree-")),o=Hd.join(n,"changes.patch");try{bp.info(this.ctx,`Writing temporary patch for ${Hd.resolve(e)} to ${o} (${r.length} chars)`),await Xye.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 Xye.rm(n,{recursive:!0,force:!0}),bp.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=Hd.basename(r),h=Hd.join(Hd.dirname(r),`${f}.worktrees`),m=Hd.join(h,d);return bp.info(this.ctx,`Preparing worktree creation for ${Hd.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])),bp.info(this.ctx,`Created worktree ${m} from ${Hd.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){bp.info(this.ctx,`Preparing to remove worktree ${e} from ${Hd.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),bp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return bp.info(this.ctx,`Skipping status lookup for ${Hd.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){bp.info(this.ctx,`Applying worktree changes from ${Hd.resolve(e)} to ${Hd.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");bp.info(this.ctx,o?`Committed pending worktree changes in ${Hd.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${Hd.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return bp.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 bp.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 bp.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"])),bp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),bp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),bp.info(this.ctx,`Popped stash in ${e}`)}};p();var tji=he(ti());var s1=new Ee("WorktreeService");var _kc=new tji.ProtocolRequestType("worktree/requestUserDecision"),ALe=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 s1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";s1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ur).connection.sendRequest(_kc,{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?(s1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(s1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){s1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(s1.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&&(s1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(s1.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},s1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);s1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw s1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return s1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){s1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return s1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var vkc="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",Ckc=["already exists in working directory","patch does not apply","patch failed"];function bkc(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&Ckc.some(n=>e.includes(n))?vkc:`Failed to apply worktree changes: ${e}`}a(bkc,"getWorktreeCompleteErrorMessage");var Skc=S.Object({repositoryPath:S.String()});async function Tkc(t,e,r){try{let n=new Zye(t),o=new ALe(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:it.InternalError,message:`Failed to create worktree: ${o}`}]}}a(Tkc,"handleWorktreeCreateChecked");var rji=je(Skc,Tkc),Ikc=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function xkc(t,e,r){try{let n=new Zye(t);return[{success:!0,baseCommit:(await new ALe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:it.InternalError,message:bkc(n)}]}}a(xkc,"handleWorktreeCompleteChecked");var nji=je(Ikc,xkc),wkc=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function Rkc(t,e,r){try{return await new Zye(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:it.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(Rkc,"handleWorktreeDeleteChecked");var iji=je(wkc,Rkc);var gne=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function oji(){let t=new Map;return t.set(s7i.method,a7i),t.set("getCompletions",VUi),t.set("getCompletionsCycling",WUi),t.set("getDefaultFileSafetyRules",zUi),t.set("copilot/parseTerminalCommand",L7i),t.set("getPanelCompletions",JUi),t.set(SUi.method,TUi),t.set("getVersion",XUi),t.set("getUserInfo",ZUi),t.set("setEditorInfo",j7i),t.set("checkStatus",N9i),t.set("checkQuota",D9i),t.set("checkFileStatus",P9i),t.set("claude/checkCliCompatibility",R9i),t.set("signInInitiate",zOr),t.set("signIn",zOr),t.set("signInWithCodeFlow",Z7i),t.set("signInWithDeviceFlow",tQi),t.set("signInConfirm",H7i),t.set("signInWithGithubToken",rQi),t.set("signOut",nQi),t.set("auth/listAvailableTokens",XFi),t.set("auth/useExistingToken",e8i),t.set("notifyShown",B7i),t.set("notifyAccepted",N7i),t.set("notifyRejected",O7i),t.set("notifyNextEditRejected",M7i),t.set("telemetry/exception",iQi),t.set("textDocument/copilotInlineEdit",D7i),t.set("testing/overrideExpFlags",Sqi),t.set("testing/alwaysAuth",n5r),t.set("testing/setAlwaysAuthed",n5r),t.set("testing/neverAuth",D5r),t.set("testing/setNeverAuthed",D5r),t.set("testing/useTestingToken",Wqi),t.set("testing/setCompletionDocuments",jUi),t.set("testing/setPanelCompletionDocuments",CUi),t.set("testing/setNextEditDocument",x7i),t.set("testing/triggerShowMessageRequest",xqi),t.set("testing/flushPromiseQueue",yqi),t.set("testing/getDocument",vqi),t.set("testing/chatml",oQi),t.set("testing/setSyntheticTurns",Iqi),t.set("testing/fetch",Aqi),t.set("testing/setContentExclusionRules",Tqi),t.set("testing/getContext",_qi),t.set("uninstall",zqi),t.set("debug/diagnostics",BUi),t.set("debug/listCertificates",c7i),t.set("debug/verifyState",Zqi),t.set("debug/verifyCertificate",Kqi),t.set("debug/verifyKerberos",Jqi),t.set("debug/verifyWorkspaceState",Xqi),t.set("debug/getAgentDebugLog",LUi),t.set("context/registerProviders",F7i),t.set("context/unregisterProviders",Yqi),t.set("conversation/preconditions",J9i),t.set("conversation/persistence",K9i),t.set("conversation/create",V9i),t.set("conversation/turn",tUi),t.set("conversation/turnDelete",rUi),t.set("conversation/destroy",W9i),t.set("conversation/compress",j9i),t.set("conversation/rating",Z9i),t.set("conversation/copyCode",Q9i),t.set("conversation/insertCode",q9i),t.set("conversation/templates",eUi),t.set("conversation/modes",z9i),t.set("conversation/agents",U9i),t.set("conversation/registerTools",X9i),t.set("conversation/unregisterTools",nUi),t.set("conversation/updateToolsStatus",iUi),t.set("conversation/notifyCodeAcceptance",Y9i),t.set("customAgent/registerExtensionAgents",xUi),t.set("customAgent/unregisterExtensionAgents",wUi),t.set("copilot/customAgent/list",IUi),t.set("copilot/customSkill/list",kUi),t.set("copilot/customPrompt/list",PUi),t.set("copilot/customInstruction/list",RUi),t.set("copilot/hook/list",i7i),t.set("copilot/models",gUi),t.set("copilot/models/getModelMetadataList",AUi),t.set("copilot/byok/saveModel",w9i),t.set("copilot/byok/deleteModel",r8i),t.set("copilot/byok/listModels",I9i),t.set("copilot/byok/saveApiKey",x9i),t.set("copilot/byok/deleteApiKey",t8i),t.set("copilot/byok/listApiKeys",n8i),t.set("copilot/setModelPolicy",yUi),t.set("copilot/codeReview/reviewChanges",sUi),t.set("copilot/codeReview/reviewSnippets",aUi),t.set("git/commitGenerate",e7i),t.set("thinking/generateTitle",oUi),t.set("mcp/getTools",uUi),t.set("mcp/updateToolsStatus",dUi),t.set("mcp/readResource",fUi),t.set("mcp/registry/listServers",b7i),t.set("mcp/registry/getServer",S7i),t.set("mcp/registry/getAllowlist",I7i),t.set("mcp/getPrompt",pUi),t.set("mcp/completePrompt",hUi),t.set("mcp/serverAction",mUi),t.set("mcpGateway/listServers",f7i),t.set("mcpGateway/getServerDetails",p7i),t.set("mcpGateway/serverAction",h7i),t.set("githubApi/searchPR",n7i),t.set("githubApi/cancelCodingAgent",O9i),t.set("cloudAgent/listSessions",F9i),t.set("cloudAgent/getSessionLogs",L9i),t.set("cloudAgent/createJob",B9i),t.set("cloudAgent/addPullRequestComment",M9i),t.set("githubApi/listPullRequestChangedFiles",t7i),t.set("worktree/create",rji),t.set("worktree/complete",nji),t.set("worktree/delete",iji),t.set("backgroundAgent/create",kFi),t.set("backgroundAgent/send",JFi),t.set("backgroundAgent/destroy",DFi),t.set("backgroundAgent/listModels",VFi),t.set("backgroundAgent/listSessions",HFi),t.set("backgroundAgent/resume",YFi),t.set("backgroundAgent/stop",ZFi),t.set("backgroundAgent/interaction",QFi),t.set("backgroundAgent/enableRemote",BFi),t.set("backgroundAgent/disableRemote",MFi),t.set("backgroundAgent/getRemoteStatus",FFi),t.set("backgroundAgent/getPlanPath",LFi),t.set("backgroundAgent/compactHistory",wFi),new gne(t)}a(oji,"getAllMethods");p();p();p();var sji=he(XP());var Pv=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new sji.NotificationType(this.name)}};var Pkc=new Ee("BackgroundAgent.notifications"),V5r=class extends Pv{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},W5r=class extends Pv{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:SNr})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){Pkc.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Bs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},aji=[V5r,W5r];p();var z5r=class extends Pv{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Ut).resetToken("did_change_token_notification")}},cji=[z5r];p();var kkc=new Ee("agentCopilotTokenManager");function K5r(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(K5r,"tokenEndpointToApiUrl");function Dkc(t,e){if(!e.tokenEndpoint)return Lm(e);let r=K5r(e.tokenEndpoint);return r||kkc.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),Lm({apiUrl:r})}a(Dkc,"getUrlsFromParams");var Y5r=class extends Pv{constructor(){super(...arguments);this.name=D9t.method;this.params=Ggn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Fr),o=Dkc(this.ctx,r);this.ctx.get(D0).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})}},lji=[Y5r];p();var J5r=class extends Pv{constructor(){super(...arguments);this.name=F9t.method;this.params=Zgn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(vu).get(n);s&&eJn(this.ctx,s)}},Z5r=class extends Pv{constructor(){super(...arguments);this.name=Q9t.method;this.params=nAn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(wv).handleShown(n)}},X5r=class extends Pv{constructor(){super(...arguments);this.name=U9t.method;this.params=Xgn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(vu),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Ope(this.ctx,c)):rlt(this.ctx,c,o,void 0,void 0,"cumulative"))}},uji=[J5r,Z5r,X5r];p();var r1t=class extends Pv{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(GD).cancel(r.token)}};var Nkc=[...aji,...cji,...lji,...uji,r1t];function dji(t,e){for(let r of Nkc){let n=new r(t),o=Mu.Compile(n.params);e.onNotification(n.type,km(t,async s=>{b6(s),o.Check(s)?await n.handle(s):gs.error(t,`Notification ${n.name}:`,new SA(o.Errors(s)))},`Notification ${n.name}`))}}a(dji,"registerNotifications");p();p();var fji=he(require("crypto")),pji=require("os");As();var Mkc=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function Okc(t){let e=t.replace(/-/g,":").toLowerCase();return!Mkc.has(e)}a(Okc,"validateMacAddress");function Bkc(){let t=(0,pji.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(Okc(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(Bkc,"getMac");var e4r;function Lkc(){try{let t=Bkc();return fji.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(Lkc,"getMacMachineId");function t4r(){return e4r||(e4r=Lkc()||ir()),e4r}a(t4r,"getMachineId");As();function r4r(t){let e=t??ir()+Date.now();return new Oa(e,t4r(),t4r())}a(r4r,"createEditorSession");var hji=r4r();p();var n1t=he(ml());var n4r=new Ee("AgentTextDocumentConfiguration"),i4r=class{constructor(e){this.ctx=e;this.#e=new ro;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return JP.create(e,r,n,o)}catch(s){throw n4r.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=JP.withChanges(e,r,n);for(let l of r)if(n1t.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])}.`;n4r.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Vt.createAndMarkAsIssued({message:`Received ${g}`});yt(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}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw n4r.exception(this.ctx,o,".update"),o}}},V$=class extends an{constructor(){super(...arguments);this.#e=new ro;this.onDidOpenTextDocument=this.#e.event;this.#t=new ro;this.onDidCloseTextDocument=this.#t.event;this.#r=new ro;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new i4r(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new n1t.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new ro;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ur).connection}init(r){this.connection.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._textDocumentConfiguration.create(o.uri,o.languageId,o.version,o.text);this._documents.set(ia(o.uri),s),this.#e.fire({document:{...o,uri:s.uri}})}),this.connection.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges,{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=ia(o.uri),u=this._documents.get(l);u!==void 0&&(u=this._textDocumentConfiguration.update(u,s,c),this._documents.set(l,u))}),this.connection.onDidCloseTextDocument(n=>{let o=ia(n.textDocument.uri);this._documents.delete(o),this.#t.fire({document:{uri:o}})}),this.connection.onNotification(O9t.type,n=>{let o=("textDocument"in n?n.textDocument:n)??{};this.#r.fire("uri"in o?{document:o}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0,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)}registerWorkspaceFolder(r){this.workspaceFolders.find(n=>n.uri===r.uri)||this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(ia(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 mji=Mu.Compile(Ygn);function b6(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(gji.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of nLe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(UM).handleConfigurationChange(e.settings)}catch(n){gs.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return gbt(this.ctx,b6(e))}catch(r){gs.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Df)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),dji(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(is).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(V$).didChangeWorkspaceFolders(c)}catch(l){gs.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;let l=c.capabilities.copilot,u=b6(c.initializationOptions);if(u){if(!mji.Check(u))throw new SA(mji.Errors(u));let m=u,g=e.get(Lr);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):gs.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(Lp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Oa,r4r(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(V$).init(c.workspaceFolders??[]),pWn(this.ctx),l&&(e.get(Mn).setCapabilities(l),l.contentProvider&&na.registerSchemes(l.contentProvider),"openURL"in l&&nlt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,gs.info(e,`${n.name} ${n.version} initialized`),e.get(Ut).primeToken().catch(m=>{e.get(os).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:gji}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(LC).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||mbt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(os).sendInitNonAuthStatus(),new TAe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(km(e,h,"onInitialized")),e.get(QD).init(),l?.token&&e.get(Fr).setTransientSession({}),l?.redirectedTelemetry&&vFi(e),Aji.lt(process.versions.node,"22.0.0")&&gs.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:AFi(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 Svt;this.ctx.forceSet(Df,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");gi(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(gne).handlers.get(e);if(!o)return new tI.ResponseError(it.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new tI.ResponseError(it.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new tI.ResponseError(it.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!xxn(this.ctx.get(Lr)))throw new tI.ResponseError(it.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),b6(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(it.RequestCancelled,"Request was canceled");if(s instanceof Jn)return this.telemetryMethodFailure(e,s),new tI.ResponseError(it.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof tI.ResponseError||gs.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(Hz).stop()}catch(e){gs.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(I3).dispose()}catch(e){gs.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(ub).dispose().catch(e=>{gs.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){gs.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(_j).dispose()}catch(e){gs.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(bk).dispose()}catch(e){gs.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(SF).dispose()}catch(e){gs.exception(this.ctx,e,"failed to dispose Claude Code agent service")}this.ctx.get(Bs).shutdown().catch(e=>{gs.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(zm).dispose()}catch(e){gs.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Df,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(LC).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Aur(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(_d).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(P0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},gs=new Ee("lsp");var kv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new yji.ProtocolRequestType("conversation/context");this.typeCheck=Mu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ur).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 Eji.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 SA(this.typeCheck.Errors(o));return o}}};var o4r=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")}},j6=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new o4r(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},i1t=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(_c)}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(jo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new kv(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 KI(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:ir()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var $D=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(j6).get(r);if(o)return new i1t(e,o);let c=(await Ix(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 lYe(e.ctx):l=new Wce(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new ewe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new ewe(e,l):new Ret(e,l)}};p();var W$=class extends E_{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 Or([new wr(r)],"success")}errorResult(r){return new Or([new wr(r)],"error")}};p();function Fkc(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(Fkc,"mapToolNameToKind");function Ukc(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(Ukc,"extractLocationsFromInput");function Qkc(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(Qkc,"mapToolCallStatus");var o1t=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=Qkc(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=Ukc(c.name,c.input);await this.reportToolCallStart(c.id,c.name,Fkc(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 j1t(t){try{if((await t.get(Ur).checkAndUpdateStatus()).status==="OK")return;let n=await e1t(t,(o,s)=>new rN(o,rN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(Ke.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof eU?new fo(Ke.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof Ai?new fo(Ke.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(j1t,"performACPGitHubOAuth");function H1t(t){if(t!=="github_oauth")throw new fo(Ke.InvalidParams,`Unknown authentication method: ${t}`)}a(H1t,"validateAuthMethodId");async function G1t(t){let r=await t.get(Ur).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(G1t,"requireACPAuthenticated");var HHi=[{id:yl.Ask.id,name:yl.Ask.name,description:yl.Ask.description},{id:yl.Agent.id,name:yl.Agent.name,description:yl.Agent.description}],$1t=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(Lr);o instanceof Rq&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}gt(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:ltt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:N1(this.ctx)},authMethods:n})}async newSession(e){gt(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=gr(),n=gr(),s=this.ctx.get(Vo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ia(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 gt(this.ctx,"acp.authenticate"),H1t(e.methodId),await j1t(this.ctx),{}}async requireAuthenticated(){await G1t(this.ctx)}async prompt(e){gt(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 qn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=gr(),l=new Gf(s,c),u=r.currentModeId===yl.Ask.id?yl.Ask:yl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Vo),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 q1t(this.connection,e.sessionId),g=new Wx(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(v_);A instanceof dV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(XD).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,n)}finally{A instanceof dV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(v_);if(s instanceof dV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){gt(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){gt(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ke.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(Ke.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){gt(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ke.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(Ke.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return FI(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?HHi:HHi.filter(e=>e.id===yl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?yl.Agent.id:yl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(dc).getMetadata(),r=[],n=MS;r.push({modelId:MS,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!(Xae.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 GHi=require("node:child_process"),W1t=require("node:stream");var V1t=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","--yolo"];if(this.cliProcess=(0,GHi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:A8t}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{gi(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||gt(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=W1t.Writable.toWeb(this.cliProcess.stdin),c=W1t.Readable.toWeb(this.cliProcess.stdout),l=xwe(s,c);return this._cliConnection=new mtt(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 z1t=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(Lr);r instanceof Rq&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return gt(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:ltt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:N1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return gt(this.ctx,"acp.cli.authenticate"),H1t(e.methodId),await j1t(this.ctx),{}}async newSession(e){return gt(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return gt(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return gt(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return gt(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return gt(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return gt(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return gt(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return gt(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(Ke.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:N1(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]),gt(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw gi(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(Ke.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await G1t(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 $Hi="auth.db",GMc=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],$Mc=` +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 s1t(t){try{if((await t.get(Fr).checkAndUpdateStatus()).status==="OK")return;let n=await ybt(t,(o,s)=>new zD(o,zD.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new uo(it.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof q9?new uo(it.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof Jn?new uo(it.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(s1t,"performACPGitHubOAuth");function a1t(t){if(t!=="github_oauth")throw new uo(it.InvalidParams,`Unknown authentication method: ${t}`)}a(a1t,"validateAuthMethodId");async function c1t(t){let r=await t.get(Fr).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw uo.authRequired()}a(c1t,"requireACPAuthenticated");var _ji=[{id:gl.Ask.id,name:gl.Ask.name,description:gl.Ask.description},{id:gl.Agent.id,name:gl.Agent.name,description:gl.Agent.description}],l1t=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(Lr);o instanceof dq&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}_t(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:Eet,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:T1(this.ctx)},authMethods:n})}async newSession(e){_t(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=ir(),n=ir(),s=this.ctx.get(jo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:ba(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 _t(this.ctx,"acp.authenticate"),a1t(e.methodId),await s1t(this.ctx),{}}async requireAuthenticated(){await c1t(this.ctx)}async prompt(e){_t(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 qn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=ir(),l=new $f(s,c),u=r.currentModeId===gl.Ask.id?gl.Ask:gl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(jo),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 o1t(this.connection,e.sessionId),g=new Qx(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(E_);A instanceof W$&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get($D).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,n)}finally{A instanceof W$&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(E_);if(s instanceof W$&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){_t(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){_t(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new uo(it.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new uo(it.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){_t(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new uo(it.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new uo(it.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return DI(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?_ji:_ji.filter(e=>e.id===gl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?gl.Agent.id:gl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(lc).getMetadata(),r=[],n=xS;r.push({modelId:xS,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!(Oae.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 vji=require("node:child_process"),d1t=require("node:stream");var u1t=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,vji.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:OFt}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{gi(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||_t(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=d1t.Writable.toWeb(this.cliProcess.stdin),c=d1t.Readable.toWeb(this.cliProcess.stdout),l=Jxe(s,c);return this._cliConnection=new Iet(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 f1t=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(Lr);r instanceof dq&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return _t(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Eet,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:T1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return _t(this.ctx,"acp.cli.authenticate"),a1t(e.methodId),await s1t(this.ctx),{}}async newSession(e){return _t(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return _t(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return _t(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return _t(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return _t(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return _t(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return _t(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return _t(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 uo(it.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(Ut).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:T1(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]),_t(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw gi(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 uo(it.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await c1t(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 Cji="auth.db",qkc=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],jkc=` CREATE TABLE IF NOT EXISTS oauth_tokens ( token_id INTEGER PRIMARY KEY AUTOINCREMENT, auth_authority TEXT NOT NULL, @@ -3931,23 +3888,23 @@ Cancelled: ${o.message}`),await this.complete()}async reportTextChunk(e){this.me last_used_at INTEGER NOT NULL, UNIQUE(auth_authority, oauth_client_id, user_login) ) -`,VMc=` +`,Hkc=` 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 ) -`,WMc=` +`,Gkc=` CREATE TABLE IF NOT EXISTS editor_signout ( editor_id TEXT PRIMARY KEY, signed_out_at INTEGER NOT NULL ) -`,zMc=` +`,$kc=` CREATE TABLE IF NOT EXISTS metadata ( key TEXT PRIMARY KEY, value TEXT NOT NULL ) -`,YMc=[$Mc,VMc,WMc,zMc];function uBr(t){for(let e of GMc)t.exec(e);return KMc(t),t}a(uBr,"applyPragmas");function KMc(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(KMc,"ensureWalMode");function dBr(t){for(let e of YMc)t.exec(e);return t}a(dBr,"applySchema");function bEe(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(bEe,"runInWriteTx");p();p();p();function VHi(t){return{upsertToken:t.prepare(` +`,Vkc=[jkc,Hkc,Gkc,$kc];function s4r(t){for(let e of qkc)t.exec(e);return Wkc(t),t}a(s4r,"applyPragmas");function Wkc(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(Wkc,"ensureWalMode");function a4r(t){for(let e of Vkc)t.exec(e);return t}a(a4r,"applySchema");function eEe(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(eEe,"runInWriteTx");p();p();p();function bji(t){return{upsertToken:t.prepare(` INSERT INTO oauth_tokens ( auth_authority, oauth_client_id, user_login, scopes, token_ciphertext, token_schema_version, source_editor_id, @@ -3992,43 +3949,43 @@ Cancelled: ${o.message}`),await this.complete()}async reportTextChunk(e){this.me `),deleteSignoutTombstone:t.prepare("DELETE FROM editor_signout WHERE editor_id = ?"),selectSignoutTombstone:t.prepare("SELECT 1 FROM editor_signout WHERE editor_id = ?"),deleteTokenById:t.prepare("DELETE FROM oauth_tokens WHERE token_id = ?"),bumpLastUsed:t.prepare("UPDATE oauth_tokens SET last_used_at = ? WHERE token_id = ?"),getMetadata:t.prepare("SELECT value FROM metadata WHERE key = ?"),setMetadata:t.prepare(` INSERT INTO metadata (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value - `)}}a(VHi,"prepareStatements");var $Le=class extends MN{constructor(r){super();this.db=r;this.stmts=VHi(r)}static{a(this,"SqliteAuthRepository")}close(){this.db.close()}async getActiveSession(r){let n=this.stmts.selectActiveSessionByEditor.get(r);return n?Y1t(n):void 0}async getTokenById(r){let n=this.stmts.selectTokenById.get(r);return n?Y1t(n):void 0}async upsertTokenAndAssign(r,n){let o=Date.now();return bEe(this.db,()=>{let s=JMc(n.accessToken),c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s,0,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();bEe(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();bEe(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(){return this.stmts.selectAllTokensByRecency.all().map(Y1t)}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?Y1t(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all().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{affectedEditors:bEe(this.db,()=>{let s=this.stmts.deleteActiveSessionsForTokenReturning.all(r);this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of s)this.stmts.insertSignoutTombstone.run(c,n);return s.length})}}async touchActiveSession(r){let n=Date.now();bEe(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)}};function Y1t(t){return{tokenId:t.token_id,sourceEditorId:t.source_editor_id,record:{user:t.user_login,accessToken:ZMc(t.token_ciphertext),authAuthority:t.auth_authority,oauthClientId:t.oauth_client_id,scopes:t.scopes}}}a(Y1t,"toStoredTokenRecord");function JMc(t){return Buffer.from(t,"utf8")}a(JMc,"encodeToken");function ZMc(t){return new TextDecoder().decode(t)}a(ZMc,"decodeToken");var zHi=ce(require("fs")),pBr=ce(require("node:sqlite")),YHi=ce(require("path"));var fBr=new ge("AuthRepoInit");function SEe(){return typeof performance<"u"?performance.now():Date.now()}a(SEe,"nowMs");function WHi(t){try{t.close()}catch{}}a(WHi,"safeClose");function XMc(t){let e=SEe(),r={durationMs:0};try{zHi.mkdirSync(YHi.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=SEe()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new pBr.default.DatabaseSync(t)}catch(o){return r.durationMs=SEe()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{uBr(n)}catch(o){return r.durationMs=SEe()-e,r.errorPhase="applyPragmas",r.error=o,WHi(n),{db:void 0,diagnostics:r}}try{dBr(n)}catch(o){return r.durationMs=SEe()-e,r.errorPhase="applySchema",r.error=o,WHi(n),{db:void 0,diagnostics:r}}return r.durationMs=SEe()-e,{db:n,diagnostics:r}}a(XMc,"tryOpenAuthDb");function eOc(){let t=new pBr.default.DatabaseSync(":memory:");return uBr(t),dBr(t),new $Le(t)}a(eOc,"openInMemoryAuthRepo");function KHi(t){let{db:e,diagnostics:r}=XMc(t);return e?{repo:new $Le(e),diagnostics:{...r,repoKind:"sqlite"}}:{repo:eOc(),diagnostics:{...r,repoKind:"memory"}}}a(KHi,"buildAuthRepository");function JHi(t,e){if(e.repoKind==="memory"){fBr.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(sa).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=>{fBr.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){fBr.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(JHi,"reportAuthRepoFallbackNotice");function ZHi(t,e){fZr(t,e)}a(ZHi,"reportAuthRepoTelemetry");p();var RIt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(qXi(),QXi)),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 jXi(t){let e=new ile;e.set(Zo,t),e.set(dM,new dM),e.set(ss,new ss),e.set(f2,new f2);let r=new Qt(e);return e.set(Qt,r),e.set(Jt,new Jt(e)),e.set(PN,new PN(e,r)),e.set(bN,new bN),e.set(Nf,new Nf(e)),e.set(k0,new k0),e.set(lv,new lv),e.set(HM,new LTe),e.set(eP,new cce),e.set(Qk,new Fbe),e.set(_d,new _d),e.set(b5,new b5(e)),e.set(Jn,new Jn(e)),e.set(E2,new E2(e)),e.set(VF,wlt(e)),e.set(FA,new FA),e.set(_b,new _b),e.set(WF,WF.default),e.set(W0,new W0(e)),e.set(mx,new mx(e)),e.set(Bp,new Bp),e.set(Eb,new Eb(e)),e.set(Mn,new Mn),e.set(Rd,new Rd(e)),e.set(jM,new jM(e)),e.set(v2,new v2),e.set(ZY,new ZY(e)),e}a(jXi,"createCommonContext");p();var kIt=class extends Df{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||ovt(r))&&this.console.warn(`[${o}]`,...s)}};p();var VXi=require("node:os");var Mzc=new ge("repository"),iie="\\\\",WXi="(?:[#;].*)",I_e=`(?:[^"${iie}]|${iie}.)`,Ozc="[0-9A-Za-z-]",HXi=`[A-Za-z]${Ozc}*`,zXi=`\\s*${WXi}?$`,YXi=`(?:[^"${iie};#]|${iie}.)`,Bzc=`(?:"${I_e}*"|"${I_e}*(?${iie})$)`,Lzc=`(?:${YXi}|${Bzc})+`,Fzc=`(?:(?${iie})$)`,KXi=`(?${Lzc})${Fzc}?${zXi}`,GXi=new RegExp(`^${KXi}`),Uzc=new RegExp(`^(?${I_e}*(?:(?${iie})$|(?")))`),Qzc=new RegExp(`^\\s*(?:(?${HXi})\\s*=\\s*${KXi}|(?${HXi})${zXi})`),qzc=new RegExp(`(?${YXi}+)|"(?${I_e}*)"`,"g"),$Xi="[-.0-9A-Za-z]+",jzc=`\\s+"(?${I_e}*)"`,Hzc=`\\s+"(?${I_e}*)"`,Gzc=new RegExp(`^\\s*\\[(?:(?${$Xi})${jzc}|${Hzc}|(?${$Xi}))\\]`),$zc=new RegExp(`^\\s*${WXi}$`),t6r=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(Gzc);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(Qzc);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(Uzc),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(GXi),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(GXi),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(qzc)].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(){$zc.test(this.line)&&(this.line="")}},PIt=class extends cP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await W0.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 kY)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new t6r(o),c=new kY;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Fo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&Mzc.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=xa(this.xdgConfigUri(),"git","config"),s=xa(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=tf(r),o=xa(n,"commondir");try{let s=(await e.get(Fo).readFileString(o)).trimEnd();return xa(aW(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ia(process.env.XDG_CONFIG_HOME):xa(this.homeUri(),".config")}homeUri(){return Ia((0,VXi.homedir)())}};p();var JXi=require("child_process");var DIt=class extends cP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,JXi.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){O8t.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=ho(r);if(n===void 0)return;let o;try{o=(await rQ()).path}catch(c){O8t.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 kY;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 ZXi(t){let e=jXi(t);return Vzc(e),e.set(rp,Znt(e)),e.set(UR,w1t(e)),e.set(cP,new YVe([new DIt,new PIt])),e}a(ZXi,"createProductionContext");function Vzc(t){t.set(vI,vI.fromEnvironment(!1)),t.set(yB,new EEe),t.set(Df,new kIt(console))}a(Vzc,"setupRudimentaryLogging");var k3h=new ge("context");p();var xeo=require("fs");p();p();var veo=require("node:url");p();p();var x_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,eeo=new Set,r6r=typeof process=="object"&&process?process:{},teo=a((t,e,r,n)=>{typeof r6r.emitWarning=="function"?r6r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),NIt=globalThis.AbortController,XXi=globalThis.AbortSignal;if(typeof NIt>"u"){XXi=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},NIt=class{static{a(this,"AbortController")}constructor(){e()}signal=new XXi;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=r6r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,teo("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 Wzc=a(t=>!eeo.has(t),"shouldWarn");var NV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),reo=a(t=>NV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?w_e:null:null,"getUintArray"),w_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},n6r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=reo(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]}},_Fe=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;#C;#m;#b;#T;#E;#v;#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.#C,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&&!NV(r))throw new TypeError("max option must be a nonnegative integer");let x=r?reo(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.#C=n6r.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.#v=!!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&&!NV(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!NV(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=NV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!NV(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 k="LRU_CACHE_UNBOUNDED";Wzc(k)&&(eeo.add(k),teo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new w_e(this.#e),r=new w_e(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=x_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?x_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=x_e.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");#B=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new w_e(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!NV(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!NV(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");#L=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-(x_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=x_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=x_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.#L(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.#C.length!==0?this.#C.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.#v&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#v&&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.#B(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.#v||this.#y)&&(this.#v&&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.#C.push(r)),this.#s===1?(this.#A=this.#h=0,this.#C.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 NIt,{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 NIt}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.#v||this.#y)&&(this.#v&&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.#C.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.#v&&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.#C.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 P_e=require("node:path"),feo=require("node:url"),gB=require("fs"),nYc=ce(require("node:fs"),1),BV=require("node:fs/promises");p();var QIt=require("node:events"),u6r=ce(require("node:stream"),1),aeo=require("node:string_decoder");var neo=typeof process=="object"&&process?process:{stdout:null,stderr:null},zzc=a(t=>!!t&&typeof t=="object"&&(t instanceof OV||t instanceof u6r.default||Yzc(t)||Kzc(t)),"isStream"),Yzc=a(t=>!!t&&typeof t=="object"&&t instanceof QIt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==u6r.default.Writable.prototype.pipe,"isReadable"),Kzc=a(t=>!!t&&typeof t=="object"&&t instanceof QIt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),g9=Symbol("EOF"),A9=Symbol("maybeEmitEnd"),MV=Symbol("emittedEnd"),MIt=Symbol("emittingEnd"),CFe=Symbol("emittedError"),OIt=Symbol("closed"),ieo=Symbol("read"),BIt=Symbol("flush"),oeo=Symbol("flushChunk"),gN=Symbol("encoding"),R_e=Symbol("decoder"),qg=Symbol("flowing"),vFe=Symbol("paused"),k_e=Symbol("resume"),jg=Symbol("buffer"),qC=Symbol("pipes"),Hg=Symbol("bufferLength"),i6r=Symbol("bufferPush"),LIt=Symbol("bufferShift"),WE=Symbol("objectMode"),fh=Symbol("destroyed"),o6r=Symbol("error"),s6r=Symbol("emitData"),seo=Symbol("emitEnd"),a6r=Symbol("emitEnd2"),hB=Symbol("async"),c6r=Symbol("abort"),FIt=Symbol("aborted"),bFe=Symbol("signal"),oie=Symbol("dataListeners"),AI=Symbol("discarded"),SFe=a(t=>Promise.resolve().then(t),"defer"),Jzc=a(t=>t(),"nodefer"),Zzc=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Xzc=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),eYc=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),UIt=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[k_e](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},l6r=class extends UIt{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)}},tYc=a(t=>!!t.objectMode,"isObjectModeOptions"),rYc=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),OV=class extends QIt.EventEmitter{static{a(this,"Minipass")}[qg]=!1;[vFe]=!1;[qC]=[];[jg]=[];[WE];[gN];[hB];[R_e];[g9]=!1;[MV]=!1;[MIt]=!1;[OIt]=!1;[CFe]=null;[Hg]=0;[fh]=!1;[bFe];[FIt]=!1;[oie]=0;[AI]=!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");tYc(r)?(this[WE]=!0,this[gN]=null):rYc(r)?(this[gN]=r.encoding,this[WE]=!1):(this[WE]=!1,this[gN]=null),this[hB]=!!r.async,this[R_e]=this[gN]?new aeo.StringDecoder(this[gN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[jg],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[qC],"get")});let{signal:n}=r;n&&(this[bFe]=n,n.aborted?this[c6r]():n.addEventListener("abort",()=>this[c6r]()))}get bufferLength(){return this[Hg]}get encoding(){return this[gN]}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[WE]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[hB]}set async(e){this[hB]=this[hB]||!!e}[c6r](){this[FIt]=!0,this.emit("abort",this[bFe]?.reason),this.destroy(this[bFe]?.reason)}get aborted(){return this[FIt]}set aborted(e){}write(e,r,n){if(this[FIt])return!1;if(this[g9])throw new Error("write after end");if(this[fh])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[hB]?SFe:Jzc;if(!this[WE]&&!Buffer.isBuffer(e)){if(eYc(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Xzc(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[WE]?(this[qg]&&this[Hg]!==0&&this[BIt](!0),this[qg]?this.emit("data",e):this[i6r](e),this[Hg]!==0&&this.emit("readable"),n&&o(n),this[qg]):e.length?(typeof e=="string"&&!(r===this[gN]&&!this[R_e]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[gN]&&(e=this[R_e].write(e)),this[qg]&&this[Hg]!==0&&this[BIt](!0),this[qg]?this.emit("data",e):this[i6r](e),this[Hg]!==0&&this.emit("readable"),n&&o(n),this[qg]):(this[Hg]!==0&&this.emit("readable"),n&&o(n),this[qg])}read(e){if(this[fh])return null;if(this[AI]=!1,this[Hg]===0||e===0||e&&e>this[Hg])return this[A9](),null;this[WE]&&(e=null),this[jg].length>1&&!this[WE]&&(this[jg]=[this[gN]?this[jg].join(""):Buffer.concat(this[jg],this[Hg])]);let r=this[ieo](e||null,this[jg][0]);return this[A9](),r}[ieo](e,r){if(this[WE])this[LIt]();else{let n=r;e===n.length||e===null?this[LIt]():typeof n=="string"?(this[jg][0]=n.slice(e),r=n.slice(0,e),this[Hg]-=e):(this[jg][0]=n.subarray(e),r=n.subarray(0,e),this[Hg]-=e)}return this.emit("data",r),!this[jg].length&&!this[g9]&&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[g9]=!0,this.writable=!1,(this[qg]||!this[vFe])&&this[A9](),this}[k_e](){this[fh]||(!this[oie]&&!this[qC].length&&(this[AI]=!0),this[vFe]=!1,this[qg]=!0,this.emit("resume"),this[jg].length?this[BIt]():this[g9]?this[A9]():this.emit("drain"))}resume(){return this[k_e]()}pause(){this[qg]=!1,this[vFe]=!0,this[AI]=!1}get destroyed(){return this[fh]}get flowing(){return this[qg]}get paused(){return this[vFe]}[i6r](e){this[WE]?this[Hg]+=1:this[Hg]+=e.length,this[jg].push(e)}[LIt](){return this[WE]?this[Hg]-=1:this[Hg]-=this[jg][0].length,this[jg].shift()}[BIt](e=!1){do;while(this[oeo](this[LIt]())&&this[jg].length);!e&&!this[jg].length&&!this[g9]&&this.emit("drain")}[oeo](e){return this.emit("data",e),this[qg]}pipe(e,r){if(this[fh])return e;this[AI]=!1;let n=this[MV];return r=r||{},e===neo.stdout||e===neo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[qC].push(r.proxyErrors?new l6r(this,e,r):new UIt(this,e,r)),this[hB]?SFe(()=>this[k_e]()):this[k_e]()),e}unpipe(e){let r=this[qC].find(n=>n.dest===e);r&&(this[qC].length===1?(this[qg]&&this[oie]===0&&(this[qg]=!1),this[qC]=[]):this[qC].splice(this[qC].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[AI]=!1,this[oie]++,!this[qC].length&&!this[qg]&&this[k_e]();else if(e==="readable"&&this[Hg]!==0)super.emit("readable");else if(Zzc(e)&&this[MV])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[CFe]){let o=r;this[hB]?SFe(()=>o.call(this,this[CFe])):o.call(this,this[CFe])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[oie]=this.listeners("data").length,this[oie]===0&&!this[AI]&&!this[qC].length&&(this[qg]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[oie]=0,!this[AI]&&!this[qC].length&&(this[qg]=!1)),r}get emittedEnd(){return this[MV]}[A9](){!this[MIt]&&!this[MV]&&!this[fh]&&this[jg].length===0&&this[g9]&&(this[MIt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[OIt]&&this.emit("close"),this[MIt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==fh&&this[fh])return!1;if(e==="data")return!this[WE]&&!n?!1:this[hB]?(SFe(()=>this[s6r](n)),!0):this[s6r](n);if(e==="end")return this[seo]();if(e==="close"){if(this[OIt]=!0,!this[MV]&&!this[fh])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[CFe]=n,super.emit(o6r,n);let s=!this[bFe]||this.listeners("error").length?super.emit("error",n):!1;return this[A9](),s}else if(e==="resume"){let s=super.emit("resume");return this[A9](),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[A9](),o}[s6r](e){for(let n of this[qC])n.dest.write(e)===!1&&this.pause();let r=this[AI]?!1:super.emit("data",e);return this[A9](),r}[seo](){return this[MV]?!1:(this[MV]=!0,this.readable=!1,this[hB]?(SFe(()=>this[a6r]()),!0):this[a6r]())}[a6r](){if(this[R_e]){let r=this[R_e].end();if(r){for(let n of this[qC])n.dest.write(r);this[AI]||super.emit("data",r)}}for(let r of this[qC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[WE]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[WE]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[WE])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[gN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(fh,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[AI]=!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[g9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(fh,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(fh,f),this.pause(),s({value:h,done:!!this[g9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(fh,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(fh,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[AI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(o6r,r),this.off(fh,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(o6r,r),this.once(fh,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[fh])return e?this.emit("error",e):this.emit(fh),this;this[fh]=!0,this[AI]=!0,this[jg].length=0,this[Hg]=0;let r=this;return typeof r.close=="function"&&!this[OIt]&&r.close(),e?this.emit("error",e):this.emit(fh),this}static get isStream(){return zzc}};var iYc=gB.realpathSync.native,IFe={lstatSync:gB.lstatSync,readdir:gB.readdir,readdirSync:gB.readdirSync,readlinkSync:gB.readlinkSync,realpathSync:iYc,promises:{lstat:BV.lstat,readdir:BV.readdir,readlink:BV.readlink,realpath:BV.realpath}},peo=a(t=>!t||t===IFe||t===nYc?IFe:{...IFe,...t,promises:{...IFe.promises,...t.promises||{}}},"fsFromOption"),heo=/^\\\\\?\\([a-z]:)\\?$/i,oYc=a(t=>t.replace(/\//g,"\\").replace(heo,"$1\\"),"uncToDrive"),sYc=/[\\\/]/,ek=0,meo=1,geo=2,mB=4,Aeo=6,yeo=8,sie=10,Eeo=12,XR=15,TFe=~XR,d6r=16,ceo=32,xFe=64,AN=128,qIt=256,HIt=512,leo=xFe|AN|HIt,aYc=1023,f6r=a(t=>t.isFile()?yeo:t.isDirectory()?mB:t.isSymbolicLink()?sie:t.isCharacterDevice()?geo:t.isBlockDevice()?Aeo:t.isSocket()?Eeo:t.isFIFO()?meo:ek,"entToType"),ueo=new Map,wFe=a(t=>{let e=ueo.get(t);if(e)return e;let r=t.normalize("NFKD");return ueo.set(t,r),r},"normalize"),deo=new Map,jIt=a(t=>{let e=deo.get(t);if(e)return e;let r=wFe(t.toLowerCase());return deo.set(t,r),r},"normalizeNocase"),GIt=class extends _Fe{static{a(this,"ResolveCache")}constructor(){super({max:256})}},p6r=class extends _Fe{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},_eo=Symbol("PathScurry setAsCwd"),zE=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}#C;get atime(){return this.#C}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#E;#v;#S;#y;#k;#R;#d;#B;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=ek,n,o,s,c,l){this.name=e,this.#E=s?jIt(e):wFe(e),this.#d=r&aYc,this.nocase=s,this.roots=o,this.root=n||this,this.#B=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=peo(l.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#B}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.#B.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#B.set(this,r),this.#d&=~d6r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?jIt(e):wFe(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,ek,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=AN),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&XR)===ek}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&XR)===yeo}isDirectory(){return(this.#d&XR)===mB}isCharacterDevice(){return(this.#d&XR)===geo}isBlockDevice(){return(this.#d&XR)===Aeo}isFIFO(){return(this.#d&XR)===meo}isSocket(){return(this.#d&XR)===Eeo}isSymbolicLink(){return(this.#d&sie)===sie}lstatCached(){return this.#d&ceo?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&XR;return!(e!==ek&&e!==sie||this.#d&qIt||this.#d&AN)}calledReaddir(){return!!(this.#d&d6r)}isENOENT(){return!!(this.#d&AN)}isNamed(e){return this.nocase?this.#E===jIt(e):this.#E===wFe(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|=d6r;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&leo)return!1;let e=XR&this.#d;return e===ek||e===mB||e===sie}shouldWalk(e,r){return(this.#d&mB)===mB&&!(this.#d&leo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((HIt|qIt|AN)&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(!((HIt|qIt|AN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[_eo](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}},$It=class t extends zE{static{a(this,"PathWin32")}sep="\\";splitSep=sYc;constructor(e,r=ek,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=ek,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return P_e.win32.parse(e).root}getRoot(e){if(e=oYc(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 D_e(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(heo,"$1\\"),e===r}},VIt=class t extends zE{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=ek,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=ek,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},WIt=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=IFe}={}){this.#n=peo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,feo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new GIt,this.#t=new GIt,this.#r=new p6r(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 zE||(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 zE||(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 zE||(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 zE||(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 zE||(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 zE||(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 zE||(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 zE||(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 zE||(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 zE||(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 zE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new OV({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 zE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new OV({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[_eo](r)}},D_e=class extends WIt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,P_e.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return P_e.win32.parse(e).root.toUpperCase()}newRoot(e){return new $It(this.rootPath,mB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},N_e=class extends WIt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,P_e.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new VIt(this.rootPath,mB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},RFe=class extends N_e{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},G3h=process.platform==="win32"?$It:VIt,Ceo=process.platform==="win32"?D_e:process.platform==="darwin"?RFe:N_e;p();var cYc=a(t=>t.length>=1,"isPatternList"),lYc=a(t=>t.length>=1,"isGlobList"),M_e=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!cYc(e))throw new TypeError("empty pattern list");if(!lYc(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]===Up}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 uYc=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",O_e=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=uYc}){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 b_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},g6r=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())}},kFe=class t{static{a(this,"Processor")}hasWalkedCache;matches=new m6r;subwalks=new g6r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new h6r}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===Up){(!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===Up?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 dYc=a((t,e)=>typeof t=="string"?new O_e([t],e):Array.isArray(t)?new O_e(t,e):t,"makeIgnore"),zIt=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=dYc(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 kFe(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 kFe(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()}},PFe=class extends zIt{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}},DFe=class extends zIt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new OV({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 fYc=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yN=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,veo.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||fYc,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"?D_e:r.platform==="darwin"?RFe:r.platform?N_e:Ceo;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 b_(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 M_e(u,f,0,this.platform)})}async walk(){return[...await new PFe(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 PFe(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 DFe(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 DFe(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 A6r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new b_(r,e).hasMagic())return!0;return!1},"hasMagic");function KIt(t,e={}){return new yN(t,e).streamSync()}a(KIt,"globStreamSync");function Seo(t,e={}){return new yN(t,e).stream()}a(Seo,"globStream");function Teo(t,e={}){return new yN(t,e).walkSync()}a(Teo,"globSync");async function beo(t,e={}){return new yN(t,e).walk()}a(beo,"glob_");function JIt(t,e={}){return new yN(t,e).iterateSync()}a(JIt,"globIterateSync");function Ieo(t,e={}){return new yN(t,e).iterate()}a(Ieo,"globIterate");var pYc=KIt,hYc=Object.assign(Seo,{sync:KIt}),mYc=JIt,gYc=Object.assign(Ieo,{sync:JIt}),AYc=Object.assign(Teo,{stream:KIt,iterate:JIt}),YIt=Object.assign(beo,{glob:beo,globSync:Teo,sync:AYc,globStream:Seo,stream:hYc,globStreamSync:KIt,streamSync:pYc,globIterate:Ieo,iterate:gYc,globIterateSync:JIt,iterateSync:mYc,Glob:yN,hasMagic:A6r,escape:Oce,unescape:lP});YIt.glob=YIt;var NFe=class t{constructor(){this.logger=new ge("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(T_),s=r.map(d=>Wn(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(Ia(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 YIt(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 xeo.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=Ia(r);try{let o=await e.get(Fo).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 ZFh=new ge("exp");function Reo(t){let e=t.get(Jt);e.registerStaticFilters(_Yc(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>qt(t,je.DebugOverrideEngine)||qt(t,je.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>R9e()?"copilot-web":t.get(Lr).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>weo(t)),e.registerDynamicFilter(yie.CopilotRelatedPluginVersionGithubCopilot,()=>weo(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>yYc(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Lr).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>ZIt(t.get(Lr).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>EYc(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(CI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Lr).getRelatedPluginInfo()){let o=r_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(yie).includes(o)){x9e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=ZIt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Lr).getEditorPluginSpecificFilters()){let o=n.isVersion?ZIt(n.value):n.value;r[n.filter]=o}return r})}a(Reo,"setupExperimentationService");function weo(t){return ZIt(!t.get(ss).isProduction()&&t.get(Lr).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Lr).getEditorPluginInfo().version)}a(weo,"getEditorPluginVersion");function yYc(t){let e=t.get(Lr).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(yYc,"getPluginRelease");function EYc(t){let e=t.get(Lr).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(EYc,"getTargetPopulation");function _Yc(t){return CYc(t)}a(_Yc,"createAllFilters");function CYc(t){let e=t.get(Fa);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(ss).isProduction()?N1(t):"1.999.0"}}a(CYc,"createDefaultFilters");function ZIt(t){return t.split("-")[0]}a(ZIt,"trimVersionSuffix");p();var LV=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var B_e=class{static{a(this,"AbstractCopilotMessageSender")}};p();var keo=100,Peo=1e3*60*5;function Deo(t){let e=new y6r(t);t.get(n0).registerContextProvider(e),t.get(S5).add(e.id)}a(Deo,"registerRelatedFilesShim");var y6r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new sk(keo,Peo);this.relatedFilesCache=new sk(keo,Peo);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 alt(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){D7(this.ctx,s,"relatedFilesShim")}}};var Tto=ce(cX()),Ito=ce(require("path"));p();var MFe=ce(ti());var vYc=new MFe.ProtocolRequestType("workspace/readFile"),bYc=new MFe.ProtocolRequestType("workspace/readDirectory"),SYc=new MFe.ProtocolRequestType("workspace/findFiles"),TYc=new MFe.ProtocolRequestType("workspace/findTextInFiles"),XIt=class extends aa{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(vYc,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(bYc,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(SYc,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(TYc,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ur).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 gt(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw gi(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var ext=class extends eO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ur);try{return await o.connection.sendRequest(r,n)}catch(s){throw gi(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var txt=class t extends dX{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ur)}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),sm.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){sm.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(Mn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return sm.debug(this.context,"`copilot/related` not supported"),vJn;try{let c=await this.service.connection.sendRequest(OUt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){sm.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,ht(r,"copilotRelated.hasRelatedCapability",n)}catch(s){sm.exception(r,s,"copilotRelated")}}};p();p();var Ueo=ce(ti());p();p();function Neo(t,e){return(e<<5)-e+t|0}a(Neo,"numberHash");function Meo(t,e){e=Neo(149417,e);for(let r=0,n=t.length;r{let s=zkc(n.accessToken),c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s,0,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();eEe(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();eEe(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(){return this.stmts.selectAllTokensByRecency.all().map(p1t)}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?p1t(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all().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{affectedEditors:eEe(this.db,()=>{let s=this.stmts.deleteActiveSessionsForTokenReturning.all(r);this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of s)this.stmts.insertSignoutTombstone.run(c,n);return s.length})}}async touchActiveSession(r){let n=Date.now();eEe(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)}};function p1t(t){return{tokenId:t.token_id,sourceEditorId:t.source_editor_id,record:{user:t.user_login,accessToken:Ykc(t.token_ciphertext),authAuthority:t.auth_authority,oauthClientId:t.oauth_client_id,scopes:t.scopes}}}a(p1t,"toStoredTokenRecord");function zkc(t){return Buffer.from(t,"utf8")}a(zkc,"encodeToken");function Ykc(t){return new TextDecoder().decode(t)}a(Ykc,"decodeToken");var Tji=he(require("fs")),l4r=he(require("node:sqlite")),Iji=he(require("path"));var c4r=new Ee("AuthRepoInit");function tEe(){return typeof performance<"u"?performance.now():Date.now()}a(tEe,"nowMs");function Sji(t){try{t.close()}catch{}}a(Sji,"safeClose");function Kkc(t){let e=tEe(),r={durationMs:0};try{Tji.mkdirSync(Iji.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=tEe()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new l4r.default.DatabaseSync(t)}catch(o){return r.durationMs=tEe()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{s4r(n)}catch(o){return r.durationMs=tEe()-e,r.errorPhase="applyPragmas",r.error=o,Sji(n),{db:void 0,diagnostics:r}}try{a4r(n)}catch(o){return r.durationMs=tEe()-e,r.errorPhase="applySchema",r.error=o,Sji(n),{db:void 0,diagnostics:r}}return r.durationMs=tEe()-e,{db:n,diagnostics:r}}a(Kkc,"tryOpenAuthDb");function Jkc(){let t=new l4r.default.DatabaseSync(":memory:");return s4r(t),a4r(t),new yLe(t)}a(Jkc,"openInMemoryAuthRepo");function xji(t){let{db:e,diagnostics:r}=Kkc(t);return e?{repo:new yLe(e),diagnostics:{...r,repoKind:"sqlite"}}:{repo:Jkc(),diagnostics:{...r,repoKind:"memory"}}}a(xji,"buildAuthRepository");function wji(t,e){if(e.repoKind==="memory"){c4r.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ra).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=>{c4r.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){c4r.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(wji,"reportAuthRepoFallbackNotice");function Rji(t,e){cJr(t,e)}a(Rji,"reportAuthRepoTelemetry");p();var WTt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(yZi(),AZi)),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 EZi(t){let e=new Bce;e.set(zo,t),e.set(rM,new rM),e.set(is,new is),e.set(i2,new i2);let r=new Ut(e);return e.set(Ut,r),e.set(Jt,new Jt(e)),e.set(bN,new bN(e,r)),e.set(mN,new mN),e.set(Nf,new Nf(e)),e.set(P0,new P0),e.set(oC,new oC),e.set(DM,new uTe),e.set(WP,new Gae),e.set(NP,new mbe),e.set(_d,new _d),e.set(d5,new d5(e)),e.set(ni,new ni(e)),e.set(d2,new d2(e)),e.set(kF,Vct(e)),e.set(HA,new HA),e.set(fb,new fb),e.set(DF,DF.default),e.set(V0,new V0(e)),e.set(lx,new lx(e)),e.set(Lp,new Lp),e.set(db,new db(e)),e.set(Mn,new Mn),e.set(lu,new lu(e)),e.set(kM,new kM(e)),e.set(h2,new h2),e.set(MY,new MY(e)),e}a(EZi,"createCommonContext");p();var zTt=class extends Df{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||bvt(r))&&this.console.warn(`[${o}]`,...s)}};p();var bZi=require("node:os");var kGc=new Ee("repository"),qne="\\\\",SZi="(?:[#;].*)",n_e=`(?:[^"${qne}]|${qne}.)`,DGc="[0-9A-Za-z-]",_Zi=`[A-Za-z]${DGc}*`,TZi=`\\s*${SZi}?$`,IZi=`(?:[^"${qne};#]|${qne}.)`,NGc=`(?:"${n_e}*"|"${n_e}*(?${qne})$)`,MGc=`(?:${IZi}|${NGc})+`,OGc=`(?:(?${qne})$)`,xZi=`(?${MGc})${OGc}?${TZi}`,vZi=new RegExp(`^${xZi}`),BGc=new RegExp(`^(?${n_e}*(?:(?${qne})$|(?")))`),LGc=new RegExp(`^\\s*(?:(?${_Zi})\\s*=\\s*${xZi}|(?${_Zi})${TZi})`),FGc=new RegExp(`(?${IZi}+)|"(?${n_e}*)"`,"g"),CZi="[-.0-9A-Za-z]+",UGc=`\\s+"(?${n_e}*)"`,QGc=`\\s+"(?${n_e}*)"`,qGc=new RegExp(`^\\s*\\[(?:(?${CZi})${UGc}|${QGc}|(?${CZi}))\\]`),jGc=new RegExp(`^\\s*${SZi}$`),JFr=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(qGc);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(LGc);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(BGc),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(vZi),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(vZi),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(FGc)].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(){jGc.test(this.line)&&(this.line="")}},YTt=class extends tk{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await V0.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 fY)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new JFr(o),c=new fY;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Bo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&kGc.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=Sa(this.xdgConfigUri(),"git","config"),s=Sa(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=Xd(r),o=Sa(n,"commondir");try{let s=(await e.get(Bo).readFileString(o)).trimEnd();return Sa(HV(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?ba(process.env.XDG_CONFIG_HOME):Sa(this.homeUri(),".config")}homeUri(){return ba((0,bZi.homedir)())}};p();var wZi=require("child_process");var KTt=class extends tk{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,wZi.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){qFt.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=Yo(r);if(n===void 0)return;let o;try{o=(await j7()).path}catch(c){qFt.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 fY;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 RZi(t){let e=EZi(t);return HGc(e),e.set(np,cnt(e)),e.set(DR,Vbt(e)),e.set(tk,new gVe([new KTt,new YTt])),e}a(RZi,"createProductionContext");function HGc(t){t.set(gI,gI.fromEnvironment(!1)),t.set(sB,new Kye),t.set(Df,new zTt(console))}a(HGc,"setupRudimentaryLogging");var VOh=new Ee("context");p();var iXi=require("fs");p();p();var XZi=require("node:url");p();p();var i_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,kZi=new Set,ZFr=typeof process=="object"&&process?process:{},DZi=a((t,e,r,n)=>{typeof ZFr.emitWarning=="function"?ZFr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),JTt=globalThis.AbortController,PZi=globalThis.AbortSignal;if(typeof JTt>"u"){PZi=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},JTt=class{static{a(this,"AbortController")}constructor(){e()}signal=new PZi;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=ZFr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,DZi("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 GGc=a(t=>!kZi.has(t),"shouldWarn");var mV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),NZi=a(t=>mV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?o_e:null:null,"getUintArray"),o_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},XFr=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=NZi(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]}},W3e=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&&!mV(r))throw new TypeError("max option must be a nonnegative integer");let x=r?NZi(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=XFr.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&&!mV(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!mV(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=mV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!mV(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}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";GGc(P)&&(kZi.add(P),DZi("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}#P(){let e=new o_e(this.#e),r=new o_e(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=i_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?i_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=i_e.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");#B=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new o_e(this.#e);this.#a=0,this.#b=e,this.#k=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!mV(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!mV(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)}}#k=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#L=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-(i_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=i_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=i_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.#L(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.#k(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.#P(),this.#E&&(d||this.#B(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.#k(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 JTt,{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 JTt}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.#k(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 c_e=require("node:path"),HZi=require("node:url"),iB=require("fs"),e$c=he(require("node:fs"),1),yV=require("node:fs/promises");p();var iIt=require("node:events"),s8r=he(require("node:stream"),1),FZi=require("node:string_decoder");var MZi=typeof process=="object"&&process?process:{stdout:null,stderr:null},$Gc=a(t=>!!t&&typeof t=="object"&&(t instanceof AV||t instanceof s8r.default||VGc(t)||WGc(t)),"isStream"),VGc=a(t=>!!t&&typeof t=="object"&&t instanceof iIt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==s8r.default.Writable.prototype.pipe,"isReadable"),WGc=a(t=>!!t&&typeof t=="object"&&t instanceof iIt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),t9=Symbol("EOF"),r9=Symbol("maybeEmitEnd"),gV=Symbol("emittedEnd"),ZTt=Symbol("emittingEnd"),z3e=Symbol("emittedError"),XTt=Symbol("closed"),OZi=Symbol("read"),eIt=Symbol("flush"),BZi=Symbol("flushChunk"),cN=Symbol("encoding"),s_e=Symbol("decoder"),Hg=Symbol("flowing"),Y3e=Symbol("paused"),a_e=Symbol("resume"),Gg=Symbol("buffer"),Lv=Symbol("pipes"),$g=Symbol("bufferLength"),e8r=Symbol("bufferPush"),tIt=Symbol("bufferShift"),GE=Symbol("objectMode"),ph=Symbol("destroyed"),t8r=Symbol("error"),r8r=Symbol("emitData"),LZi=Symbol("emitEnd"),n8r=Symbol("emitEnd2"),rB=Symbol("async"),i8r=Symbol("abort"),rIt=Symbol("aborted"),K3e=Symbol("signal"),jne=Symbol("dataListeners"),dI=Symbol("discarded"),J3e=a(t=>Promise.resolve().then(t),"defer"),zGc=a(t=>t(),"nodefer"),YGc=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),KGc=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),JGc=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),nIt=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[a_e](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},o8r=class extends nIt{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)}},ZGc=a(t=>!!t.objectMode,"isObjectModeOptions"),XGc=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),AV=class extends iIt.EventEmitter{static{a(this,"Minipass")}[Hg]=!1;[Y3e]=!1;[Lv]=[];[Gg]=[];[GE];[cN];[rB];[s_e];[t9]=!1;[gV]=!1;[ZTt]=!1;[XTt]=!1;[z3e]=null;[$g]=0;[ph]=!1;[K3e];[rIt]=!1;[jne]=0;[dI]=!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");ZGc(r)?(this[GE]=!0,this[cN]=null):XGc(r)?(this[cN]=r.encoding,this[GE]=!1):(this[GE]=!1,this[cN]=null),this[rB]=!!r.async,this[s_e]=this[cN]?new FZi.StringDecoder(this[cN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Gg],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[Lv],"get")});let{signal:n}=r;n&&(this[K3e]=n,n.aborted?this[i8r]():n.addEventListener("abort",()=>this[i8r]()))}get bufferLength(){return this[$g]}get encoding(){return this[cN]}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[GE]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[rB]}set async(e){this[rB]=this[rB]||!!e}[i8r](){this[rIt]=!0,this.emit("abort",this[K3e]?.reason),this.destroy(this[K3e]?.reason)}get aborted(){return this[rIt]}set aborted(e){}write(e,r,n){if(this[rIt])return!1;if(this[t9])throw new Error("write after end");if(this[ph])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[rB]?J3e:zGc;if(!this[GE]&&!Buffer.isBuffer(e)){if(JGc(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(KGc(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[GE]?(this[Hg]&&this[$g]!==0&&this[eIt](!0),this[Hg]?this.emit("data",e):this[e8r](e),this[$g]!==0&&this.emit("readable"),n&&o(n),this[Hg]):e.length?(typeof e=="string"&&!(r===this[cN]&&!this[s_e]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[cN]&&(e=this[s_e].write(e)),this[Hg]&&this[$g]!==0&&this[eIt](!0),this[Hg]?this.emit("data",e):this[e8r](e),this[$g]!==0&&this.emit("readable"),n&&o(n),this[Hg]):(this[$g]!==0&&this.emit("readable"),n&&o(n),this[Hg])}read(e){if(this[ph])return null;if(this[dI]=!1,this[$g]===0||e===0||e&&e>this[$g])return this[r9](),null;this[GE]&&(e=null),this[Gg].length>1&&!this[GE]&&(this[Gg]=[this[cN]?this[Gg].join(""):Buffer.concat(this[Gg],this[$g])]);let r=this[OZi](e||null,this[Gg][0]);return this[r9](),r}[OZi](e,r){if(this[GE])this[tIt]();else{let n=r;e===n.length||e===null?this[tIt]():typeof n=="string"?(this[Gg][0]=n.slice(e),r=n.slice(0,e),this[$g]-=e):(this[Gg][0]=n.subarray(e),r=n.subarray(0,e),this[$g]-=e)}return this.emit("data",r),!this[Gg].length&&!this[t9]&&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[t9]=!0,this.writable=!1,(this[Hg]||!this[Y3e])&&this[r9](),this}[a_e](){this[ph]||(!this[jne]&&!this[Lv].length&&(this[dI]=!0),this[Y3e]=!1,this[Hg]=!0,this.emit("resume"),this[Gg].length?this[eIt]():this[t9]?this[r9]():this.emit("drain"))}resume(){return this[a_e]()}pause(){this[Hg]=!1,this[Y3e]=!0,this[dI]=!1}get destroyed(){return this[ph]}get flowing(){return this[Hg]}get paused(){return this[Y3e]}[e8r](e){this[GE]?this[$g]+=1:this[$g]+=e.length,this[Gg].push(e)}[tIt](){return this[GE]?this[$g]-=1:this[$g]-=this[Gg][0].length,this[Gg].shift()}[eIt](e=!1){do;while(this[BZi](this[tIt]())&&this[Gg].length);!e&&!this[Gg].length&&!this[t9]&&this.emit("drain")}[BZi](e){return this.emit("data",e),this[Hg]}pipe(e,r){if(this[ph])return e;this[dI]=!1;let n=this[gV];return r=r||{},e===MZi.stdout||e===MZi.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Lv].push(r.proxyErrors?new o8r(this,e,r):new nIt(this,e,r)),this[rB]?J3e(()=>this[a_e]()):this[a_e]()),e}unpipe(e){let r=this[Lv].find(n=>n.dest===e);r&&(this[Lv].length===1?(this[Hg]&&this[jne]===0&&(this[Hg]=!1),this[Lv]=[]):this[Lv].splice(this[Lv].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[dI]=!1,this[jne]++,!this[Lv].length&&!this[Hg]&&this[a_e]();else if(e==="readable"&&this[$g]!==0)super.emit("readable");else if(YGc(e)&&this[gV])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[z3e]){let o=r;this[rB]?J3e(()=>o.call(this,this[z3e])):o.call(this,this[z3e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[jne]=this.listeners("data").length,this[jne]===0&&!this[dI]&&!this[Lv].length&&(this[Hg]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[jne]=0,!this[dI]&&!this[Lv].length&&(this[Hg]=!1)),r}get emittedEnd(){return this[gV]}[r9](){!this[ZTt]&&!this[gV]&&!this[ph]&&this[Gg].length===0&&this[t9]&&(this[ZTt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[XTt]&&this.emit("close"),this[ZTt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==ph&&this[ph])return!1;if(e==="data")return!this[GE]&&!n?!1:this[rB]?(J3e(()=>this[r8r](n)),!0):this[r8r](n);if(e==="end")return this[LZi]();if(e==="close"){if(this[XTt]=!0,!this[gV]&&!this[ph])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[z3e]=n,super.emit(t8r,n);let s=!this[K3e]||this.listeners("error").length?super.emit("error",n):!1;return this[r9](),s}else if(e==="resume"){let s=super.emit("resume");return this[r9](),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[r9](),o}[r8r](e){for(let n of this[Lv])n.dest.write(e)===!1&&this.pause();let r=this[dI]?!1:super.emit("data",e);return this[r9](),r}[LZi](){return this[gV]?!1:(this[gV]=!0,this.readable=!1,this[rB]?(J3e(()=>this[n8r]()),!0):this[n8r]())}[n8r](){if(this[s_e]){let r=this[s_e].end();if(r){for(let n of this[Lv])n.dest.write(r);this[dI]||super.emit("data",r)}}for(let r of this[Lv])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[GE]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[GE]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[GE])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[cN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(ph,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[dI]=!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[t9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(ph,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(ph,f),this.pause(),s({value:h,done:!!this[t9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(ph,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(ph,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[dI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(t8r,r),this.off(ph,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(t8r,r),this.once(ph,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[ph])return e?this.emit("error",e):this.emit(ph),this;this[ph]=!0,this[dI]=!0,this[Gg].length=0,this[$g]=0;let r=this;return typeof r.close=="function"&&!this[XTt]&&r.close(),e?this.emit("error",e):this.emit(ph),this}static get isStream(){return $Gc}};var t$c=iB.realpathSync.native,X3e={lstatSync:iB.lstatSync,readdir:iB.readdir,readdirSync:iB.readdirSync,readlinkSync:iB.readlinkSync,realpathSync:t$c,promises:{lstat:yV.lstat,readdir:yV.readdir,readlink:yV.readlink,realpath:yV.realpath}},GZi=a(t=>!t||t===X3e||t===e$c?X3e:{...X3e,...t,promises:{...X3e.promises,...t.promises||{}}},"fsFromOption"),$Zi=/^\\\\\?\\([a-z]:)\\?$/i,r$c=a(t=>t.replace(/\//g,"\\").replace($Zi,"$1\\"),"uncToDrive"),n$c=/[\\\/]/,WR=0,VZi=1,WZi=2,nB=4,zZi=6,YZi=8,Hne=10,KZi=12,VR=15,Z3e=~VR,a8r=16,UZi=32,eFe=64,lN=128,oIt=256,aIt=512,QZi=eFe|lN|aIt,i$c=1023,c8r=a(t=>t.isFile()?YZi:t.isDirectory()?nB:t.isSymbolicLink()?Hne:t.isCharacterDevice()?WZi:t.isBlockDevice()?zZi:t.isSocket()?KZi:t.isFIFO()?VZi:WR,"entToType"),qZi=new Map,tFe=a(t=>{let e=qZi.get(t);if(e)return e;let r=t.normalize("NFKD");return qZi.set(t,r),r},"normalize"),jZi=new Map,sIt=a(t=>{let e=jZi.get(t);if(e)return e;let r=tFe(t.toLowerCase());return jZi.set(t,r),r},"normalizeNocase"),cIt=class extends W3e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},l8r=class extends W3e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},JZi=Symbol("PathScurry setAsCwd"),$E=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;#P;#R;#d;#B;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=WR,n,o,s,c,l){this.name=e,this.#E=s?sIt(e):tFe(e),this.#d=r&i$c,this.nocase=s,this.roots=o,this.root=n||this,this.#B=c,this.#S=l.fullpath,this.#P=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=GZi(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#B}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#k(o):this.#k(o)}#k(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#B.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#B.set(this,r),this.#d&=~a8r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?sIt(e):tFe(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,WR,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=lN),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=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&VR)===WR}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&VR)===YZi}isDirectory(){return(this.#d&VR)===nB}isCharacterDevice(){return(this.#d&VR)===WZi}isBlockDevice(){return(this.#d&VR)===zZi}isFIFO(){return(this.#d&VR)===VZi}isSocket(){return(this.#d&VR)===KZi}isSymbolicLink(){return(this.#d&Hne)===Hne}lstatCached(){return this.#d&UZi?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&VR;return!(e!==WR&&e!==Hne||this.#d&oIt||this.#d&lN)}calledReaddir(){return!!(this.#d&a8r)}isENOENT(){return!!(this.#d&lN)}isNamed(e){return this.nocase?this.#E===sIt(e):this.#E===tFe(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|=a8r;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&QZi)return!1;let e=VR&this.#d;return e===WR||e===nB||e===Hne}shouldWalk(e,r){return(this.#d&nB)===nB&&!(this.#d&QZi)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((aIt|oIt|lN)&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(!((aIt|oIt|lN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[JZi](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.#P=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#P=void 0,o.#R=void 0,o=o.parent}},lIt=class t extends $E{static{a(this,"PathWin32")}sep="\\";splitSep=n$c;constructor(e,r=WR,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=WR,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return c_e.win32.parse(e).root}getRoot(e){if(e=r$c(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 l_e(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace($Zi,"$1\\"),e===r}},uIt=class t extends $E{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=WR,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=WR,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},dIt=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=X3e}={}){this.#n=GZi(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,HZi.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new cIt,this.#t=new cIt,this.#r=new l8r(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 $E||(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 $E||(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 $E||(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 $E||(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 $E||(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 $E||(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 $E||(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 $E||(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 $E||(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 $E||(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 $E||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new AV({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 $E||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new AV({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[JZi](r)}},l_e=class extends dIt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,c_e.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return c_e.win32.parse(e).root.toUpperCase()}newRoot(e){return new lIt(this.rootPath,nB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},u_e=class extends dIt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,c_e.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new uIt(this.rootPath,nB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},rFe=class extends u_e{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},s5h=process.platform==="win32"?lIt:uIt,ZZi=process.platform==="win32"?l_e:process.platform==="darwin"?rFe:u_e;p();var o$c=a(t=>t.length>=1,"isPatternList"),s$c=a(t=>t.length>=1,"isGlobList"),d_e=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!o$c(e))throw new TypeError("empty pattern list");if(!s$c(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]===Qp}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 a$c=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",f_e=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=a$c}){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 v_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},f8r=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())}},nFe=class t{static{a(this,"Processor")}hasWalkedCache;matches=new d8r;subwalks=new f8r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new u8r}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===Qp){(!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===Qp?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 c$c=a((t,e)=>typeof t=="string"?new f_e([t],e):Array.isArray(t)?new f_e(t,e):t,"makeIgnore"),fIt=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=c$c(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 nFe(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 nFe(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()}},iFe=class extends fIt{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}},oFe=class extends fIt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new AV({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 l$c=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",uN=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,XZi.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||l$c,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"?l_e:r.platform==="darwin"?rFe:r.platform?u_e:ZZi;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 v_(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 d_e(u,f,0,this.platform)})}async walk(){return[...await new iFe(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 iFe(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 oFe(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 oFe(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 p8r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new v_(r,e).hasMagic())return!0;return!1},"hasMagic");function hIt(t,e={}){return new uN(t,e).streamSync()}a(hIt,"globStreamSync");function tXi(t,e={}){return new uN(t,e).stream()}a(tXi,"globStream");function rXi(t,e={}){return new uN(t,e).walkSync()}a(rXi,"globSync");async function eXi(t,e={}){return new uN(t,e).walk()}a(eXi,"glob_");function mIt(t,e={}){return new uN(t,e).iterateSync()}a(mIt,"globIterateSync");function nXi(t,e={}){return new uN(t,e).iterate()}a(nXi,"globIterate");var u$c=hIt,d$c=Object.assign(tXi,{sync:hIt}),f$c=mIt,p$c=Object.assign(nXi,{sync:mIt}),h$c=Object.assign(rXi,{stream:hIt,iterate:mIt}),pIt=Object.assign(eXi,{glob:eXi,globSync:rXi,sync:h$c,globStream:tXi,stream:d$c,globStreamSync:hIt,streamSync:u$c,globIterate:nXi,iterate:p$c,globIterateSync:mIt,iterateSync:f$c,Glob:uN,hasMagic:p8r,escape:pce,unescape:rk});pIt.glob=pIt;var sFe=class t{constructor(){this.logger=new Ee("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(C_),s=r.map(d=>Wn(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(ba(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 pIt(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 iXi.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=ba(r);try{let o=await e.get(Bo).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 h4h=new Ee("exp");function sXi(t){let e=t.get(Jt);e.registerStaticFilters(A$c(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Gt(t,Je.DebugOverrideEngine)||Gt(t,Je.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>t9e()?"copilot-web":t.get(Lr).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>oXi(t)),e.registerDynamicFilter(tie.CopilotRelatedPluginVersionGithubCopilot,()=>oXi(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>m$c(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Lr).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>gIt(t.get(Lr).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>g$c(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(mI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Lr).getRelatedPluginInfo()){let o=XE+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(tie).includes(o)){X6e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=gIt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Lr).getEditorPluginSpecificFilters()){let o=n.isVersion?gIt(n.value):n.value;r[n.filter]=o}return r})}a(sXi,"setupExperimentationService");function oXi(t){return gIt(!t.get(is).isProduction()&&t.get(Lr).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Lr).getEditorPluginInfo().version)}a(oXi,"getEditorPluginVersion");function m$c(t){let e=t.get(Lr).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(m$c,"getPluginRelease");function g$c(t){let e=t.get(Lr).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(g$c,"getTargetPopulation");function A$c(t){return y$c(t)}a(A$c,"createAllFilters");function y$c(t){let e=t.get(Oa);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(is).isProduction()?T1(t):"1.999.0"}}a(y$c,"createDefaultFilters");function gIt(t){return t.split("-")[0]}a(gIt,"trimVersionSuffix");p();var EV=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var p_e=class{static{a(this,"AbstractCopilotMessageSender")}};p();var aXi=100,cXi=1e3*60*5;function lXi(t){let e=new h8r(t);t.get(n0).registerContextProvider(e),t.get(f5).add(e.id)}a(lXi,"registerRelatedFilesShim");var h8r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new XR(aXi,cXi);this.relatedFilesCache=new XR(aXi,cXi);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 Tct(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){y7(this.ctx,s,"relatedFilesShim")}}};var reo=he($Z()),neo=he(require("path"));p();var aFe=he(ti());var E$c=new aFe.ProtocolRequestType("workspace/readFile"),_$c=new aFe.ProtocolRequestType("workspace/readDirectory"),v$c=new aFe.ProtocolRequestType("workspace/findFiles"),C$c=new aFe.ProtocolRequestType("workspace/findTextInFiles"),AIt=class extends na{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(E$c,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(_$c,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(v$c,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(C$c,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ur).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 _t(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw gi(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var yIt=class extends HM{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ur);try{return await o.connection.sendRequest(r,n)}catch(s){throw gi(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var EIt=class t extends zZ{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ur)}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),sm.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){sm.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(Mn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return sm.debug(this.context,"`copilot/related` not supported"),ZYn;try{let c=await this.service.connection.sendRequest(q9t.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){sm.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,yt(r,"copilotRelated.hasRelatedCapability",n)}catch(s){sm.exception(r,s,"copilotRelated")}}};p();p();var gXi=he(ti());p();p();function uXi(t,e){return(e<<5)-e+t|0}a(uXi,"numberHash");function dXi(t,e){e=uXi(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=UTn(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(Mn).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,L_e.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){L_e.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,Feo.setTimeout)(wYc).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 Beo.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` - ${RYc}; - ${kYc}; - ${PYc}; - ${DYc}; - ${NYc}; - `);let n=this.all(r,OYc,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):L_e.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){L_e.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(Si).directory;await Oeo.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Leo.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Lr).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||xYc}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=IYc;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=>{L_e.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){L_e.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,MYc,[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 jC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},rxt=class extends jC{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"&&fat(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(Gg).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(Gg).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(Gg).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(Gg).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(Gg).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(Gg).delete(n)}};var YE=new ge("DynamicAuthenticationProvider"),nxt=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 E6r(e,l,{set:a(u=>{this.ctx.get(jC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(YE.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=>Exe([...c.scopes].sort(),n));if(YE.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(YE.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){YE.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&&(YE.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),YE.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){YE.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=>Exe([...d.scopes].sort(),n))),YE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new sEe(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(YE.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 YE.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){YE.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return YE.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]}),YE.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(YE.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(ar).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(fat(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},E6r=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}){YE.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)),YE.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=Bcr(e.id_token)}catch{}if(!r)try{r=Bcr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:Meo(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 yI=new ge("DynamicAuthProviderService"),EN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Ueo.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 nxt(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){yI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Vu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${oEe}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ur).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)? +`,D$c="SELECT key, value FROM state",h_e=new Ee("state-database"),Vg=class{constructor(e){this.cache=new Map;this.changeEmitter=new ro;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(Mn).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=eSn(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(Mn).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,h_e.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){h_e.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,mXi.setTimeout)(T$c).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 pXi.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` + ${I$c}; + ${x$c}; + ${w$c}; + ${R$c}; + ${P$c}; + `);let n=this.all(r,D$c,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):h_e.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){h_e.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(bi).directory;await fXi.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return hXi.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Lr).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||S$c}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=b$c;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=>{h_e.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){h_e.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,k$c,[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 Fv=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},_It=class extends Fv{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"&&Dst(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(Vg).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(Vg).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(Vg).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(Vg).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(Vg).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(Vg).delete(n)}};var VE=new Ee("DynamicAuthenticationProvider"),vIt=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 m8r(e,l,{set:a(u=>{this.ctx.get(Fv).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(VE.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=>HIe([...c.scopes].sort(),n));if(VE.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(VE.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){VE.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&&(VE.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),VE.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){VE.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=>HIe([...d.scopes].sort(),n))),VE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new Lye(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(VE.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 VE.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){VE.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return VE.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]}),VE.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(VE.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(fr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Dst(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},m8r=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}){VE.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)),VE.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=Var(e.id_token)}catch{}if(!r)try{r=Var(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:dXi(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 fI=new Ee("DynamicAuthProviderService"),dN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new gXi.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 vIt(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){fI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Vu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${Bye}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ur).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){yI.error(this.ctx,`Failed to get client ID and secret from user: ${Vu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,yI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?yI.info(this.ctx,`User provided client secret for ${e.toString()}`):yI.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(ar).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=>n4r.includes(s)):n4r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${oEe}/callback`,`http://127.0.0.1:${oEe}/callback`],scope:r?.join(Y$n),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(tVn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(e0).registerAuthenticationProvider(e.id,e),this.ctx.get(jC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(e0);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);yI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);yI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw yI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(e0);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});yI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);yI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw yI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(e0),n=this.ctx.get(jC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),yI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw yI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var ixt=class extends e0{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===rN.providerId){let s=new rN(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(jC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(jC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(EN).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 qeo=ce(Al());var Qeo=new ge("agentCopilotTokenManager"),BYc={type:new qeo.ProtocolRequestType("copilot/token")},oxt=class extends gh{constructor(){super(...arguments);this.networkFetcher=new M9e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(Mn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ur).connection;try{let c=await s.sendRequest(BYc.type,{force:!1,session:n});if(!c?.envelope)throw new Ai("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(Qeo.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(Mn),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(Mn),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(Lr).getEditorPluginInfo().name==="copilot-intellij"}};p();var LYc=new ge("Public Code References"),sxt=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," ");LYc.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(Mn).getCapabilities().ipCodeCitation===!0&&await e.get(ur).connection.sendNotification(xUt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var _6r=ce(Al());var FYc=new _6r.ProtocolNotificationType("$/copilot/compressionStarted"),UYc=new _6r.ProtocolNotificationType("$/copilot/compressionCompleted"),axt=class extends oI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ur).connection.sendNotification(FYc,r)}async notifyCompressionCompleted(r){await this.ctx.get(ur).connection.sendNotification(UYc,r)}};p();p();function jeo(t){QYc(t)}a(jeo,"activateExtensibilityPlatformFeature");function QYc(t){t.set(vP,new sKe(t)),t.set(rO,new rO(t))}a(QYc,"registerContextDependencies");p();var Heo=S.String(),C6r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(lxt,"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){fI.error(this.ctx,`Failed to get client ID and secret from user: ${Vu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,fI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?fI.info(this.ctx,`User provided client secret for ${e.toString()}`):fI.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(fr).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=>XOr.includes(s)):XOr,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${Bye}/callback`,`http://127.0.0.1:${Bye}/callback`],scope:r?.join(s$n),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(f$n(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(e0).registerAuthenticationProvider(e.id,e),this.ctx.get(Fv).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(e0);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);fI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);fI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw fI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(e0);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});fI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);fI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw fI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(e0),n=this.ctx.get(Fv);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),fI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw fI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var CIt=class extends e0{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===zD.providerId){let s=new zD(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(Fv).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(Fv).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(dN).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 yXi=he(ml());var AXi=new Ee("agentCopilotTokenManager"),N$c={type:new yXi.ProtocolRequestType("copilot/token")},bIt=class extends Ah{constructor(){super(...arguments);this.networkFetcher=new s9e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(Mn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ur).connection;try{let c=await s.sendRequest(N$c.type,{force:!1,session:n});if(!c?.envelope)throw new Jn("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(AXi.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(Mn),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(Mn),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(Lr).getEditorPluginInfo().name==="copilot-intellij"}};p();var M$c=new Ee("Public Code References"),SIt=class extends gT{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," ");M$c.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(Mn).getCapabilities().ipCodeCitation===!0&&await e.get(ur).connection.sendNotification(N9t.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var g8r=he(ml());var O$c=new g8r.ProtocolNotificationType("$/copilot/compressionStarted"),B$c=new g8r.ProtocolNotificationType("$/copilot/compressionCompleted"),TIt=class extends XT{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ur).connection.sendNotification(O$c,r)}async notifyCompressionCompleted(r){await this.ctx.get(ur).connection.sendNotification(B$c,r)}};p();p();function EXi(t){L$c(t)}a(EXi,"activateExtensibilityPlatformFeature");function L$c(t){t.set(mk,new _Ye(t)),t.set($M,new $M(t))}a(L$c,"registerContextDependencies");p();var _Xi=S.String(),A8r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(xIt,"build logs"),`The contents of the application build logs: \`\`\` ${e} -\`\`\``}},lxt="build-logs",cxt=class extends Xm{static{a(this,"BuildLogsSkill")}constructor(e){super(lxt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new C6r(r))}};p();var v6r=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 bZe(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")}},b6r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},qYc="directory-references",uxt=class{constructor(){this.id=qYc;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new b6r}processor(e){return new v6r(e)}};p();var BFe=class extends FM{constructor(r,n){super();this.ctx=r;this.enablementCheck=n;this.ready=!1;this.ctx.get(S_).addListener(this)}static{a(this,"ProjectContextListener")}start(){this.ready=!0}async didAddWorkspace(r){if(!await this.isEnabled()||!await this.enablementCheck(this.ctx)||!r.uri)return;this.workerPoolToken=await RIe();let n=this.ctx.get(Y0),o=this.ctx.get(qy),s=this.ctx.get(D_),c=await n.chunk(this.ctx,r);n.status(r)!=="completed"&&o.terminateWatching(r),await s.initialize(this.ctx,r,c),await this.workerPoolToken.stopWorkerPool()}async didRemoveWorkspace(r){if(!await this.isEnabled()||!await this.enablementCheck(this.ctx)||!r)return;let n=this.ctx.get(Y0),o=n.getParentFolder(r);if(o){let l=await n.deleteSubfolderChunks(o,r);await this.ctx.get(D_).deleteEmbeddings(this.ctx,o,l);return}n.terminateChunking(this.ctx,r),await this.ctx.get(D_).terminateRanking(this.ctx,r),this.ctx.get(Lx).terminateScoring(this.ctx,r),n.workspaceCount===0&&await Vle.forceStopWorkerPool()}async didTerminateWorkspaceSubfolders(r,n){if(!await this.enablementCheck(this.ctx))return;let o=this.ctx.get(Y0),s=this.ctx.get(D_),c=this.ctx.get(Lx);for(let l of n)o.terminateChunking(this.ctx,l),await s.terminateRanking(this.ctx,l),c.terminateScoring(this.ctx,r)}async didChangeFiles(r){if(!await this.isEnabled()||!await this.enablementCheck(this.ctx))return;let n=await RIe();try{let o=r.documents.map(u=>u.uri),s=r.workspaceFolder;if(!s)return;let c=this.ctx.get(Y0),l=this.ctx.get(D_);if(r.type==="delete"||r.type==="update"){let u=await c.deleteFileChunks(s,o);await l.deleteEmbeddings(this.ctx,s,u)}if(r.type==="create"||r.type==="update"){let u=await c.chunk(this.ctx,s,r.documents);await l.addChunks(this.ctx,s,u)}}finally{await n.stopWorkerPool()}}isStarted(){return this.ready}isEnabled(){return Promise.resolve(!0)}};p();var jYc=S.Object({uri:S.String(),visibleRange:S.Optional(hf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Geo=S.Object({files:S.Array(jYc)}),HYc=3,S6r=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=jQ(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(Jn),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=zu(c);if(await this.turnContext.collectFile(fxt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===HYc))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(Jn).getRelativePath(n),c=new ZM(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 Uo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},fxt="recent-files",dxt=class extends Xm{static{a(this,"RecentFilesSkill")}constructor(e){super(fxt,"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 S6r(r))}};p();var $eo=S.String(),T6r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(hxt,"runtime logs"),`The contents of the application runtime logs: +\`\`\``}},xIt="build-logs",IIt=class extends eg{static{a(this,"BuildLogsSkill")}constructor(e){super(xIt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new A8r(r))}};p();var y8r=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 MJe(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")}},E8r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},F$c="directory-references",wIt=class{constructor(){this.id=F$c;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new E8r}processor(e){return new y8r(e)}};p();var U$c=S.Object({uri:S.String(),visibleRange:S.Optional(ff),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),vXi=S.Object({files:S.Array(U$c)}),Q$c=3,_8r=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=IQ(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=zu(c);if(await this.turnContext.collectFile(PIt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Q$c))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 qM(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 Jo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},PIt="recent-files",RIt=class extends eg{static{a(this,"RecentFilesSkill")}constructor(e){super(PIt,"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 _8r(r))}};p();var CXi=S.String(),v8r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(DIt,"runtime logs"),`The contents of the application runtime logs: \`\`\` ${e} -\`\`\``}},hxt="runtime-logs",pxt=class extends Xm{static{a(this,"RuntimeLogsSkill")}constructor(e){super(hxt,"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 T6r(r))}};p();var mxt=ce(sP());var gxt=class extends Uh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return a6e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ur).connection}async inspectPrompt(r){return this.connection?.sendNotification(new mxt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new mxt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new mxt.NotificationType("conversation/documentDiff"),r)}};p();var Veo=ce(Al());var LFe=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(LR).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ur).connection.sendNotification(new Veo.NotificationType(this.notificationEndpoint),e)}};function Weo(t){GYc(t),$Yc(t),jeo(t)}a(Weo,"activateConversationFeature");function GYc(t){t.set(Vo,new Vo(t)),t.set(eg,new eg),t.set(dA,new dA(t)),t.set(Bc,new DWe(t)),t.set(n9,new n9),t.set(vc,new vc(t)),t.set(LR,new LR(t)),t.set(LFe,new LFe(t)),t.set(dc,new KHe(t,new YHe(t))),t.set(XD,new XD),t.set(JQ,new JQ),t.set(Uh,new gxt(t)),t.set(Y0,new Y0(t)),t.set(D_,new D_),t.set(Lx,new Lx),t.set(kP,new kP(t)),t.set(BFe,new BFe(t,()=>Promise.resolve(!1)))}a(GYc,"registerContextDependencies");function $Yc(t){let e=new Qh;e.registerSkill(new KJe(new YJe)),e.registerSkill(new hYe(new OC(t,XM,Uyn))),e.registerSkill(new rYe(new OC(t,EP,Myn))),e.registerSkill(new tYe(new OC(t,Vy,Nyn))),e.registerSkill(new mYe),e.registerSkill(new uxt),e.registerSkill(new dxt(new OC(t,fxt,Geo))),e.registerSkill(new GYe(new OC(t,nO,WEn))),e.registerSkill(new tZe(new OC(t,dq,VSn))),e.registerSkill(new pxt(new OC(t,hxt,$eo))),e.registerSkill(new cxt(new OC(t,lxt,Heo))),e.registerSkill(new nZe(new OC(t,PP,WSn))),e.registerSkill(new iZe(new OC(t,TK,zSn))),t.set(Qh,e)}a($Yc,"registerSkills");p();var zeo=ce(Al()),Yeo=ce(sP());var Axt=class extends Md{constructor(){super(...arguments);this.requestType=new zeo.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=Ou.Compile($0n)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ur).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Yeo.ResponseError(u.code,u.message,u.data);throw Ye.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 vA(this.typeCheck.Errors(s));return s}};p();var Keo=ce(Al()),Jeo=ce(sP());var yxt=class extends v_{constructor(){super(...arguments);this.requestType=new Keo.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=Ou.Compile(G0n)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ur).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Jeo.ResponseError(u.code,u.message,u.data);throw Ye.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 vA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new wr(o.value):new LY(o.value));return new Or(n,r.status??"success")}};p();p();function Zeo(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 Dr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Zeo,"fillInJavaActiveExperiments");var I6r=ce(sP());var VYc={type:new I6r.NotificationType("featureFlagsNotification")},WYc={type:new I6r.NotificationType("copilot/didChangeFeatureFlags")},FFe=class{constructor(e){this.ctx=e;Es(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=r.get(Jt),u=await l.updateExPValuesAndAssignments(e);n=l.ideDataMigrationCompleted(u),o=l.appmodContextMenuEnabled(u),s=l.cliAsDefaultAgentProviderEnabled(u),c=Scn(r,u);let d={};r.get(Jt).excludeRelatedFiles(u)&&(d.ExcludeRelatedFiles=!0);let f=Olr(r,u);f.length>0&&(d.ExpContextProviders=f);let h=new Map;Wzn(r,f,h,u),Uat(r,h,u),Zeo(r,h,u);for(let[A,y]of h.entries())d[A]=y;let m=r.get(Mn),g=r.get(ur).connection;if(m.getCapabilities().didChangeFeatureFlags)await g.sendNotification(WYc.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,user_notification: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:d,byok:AQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,copilot_plan:e.userInfo.copilotPlan});else{let A={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:d,byok:AQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c};e.getTokenValue("agent_mode")==="0"&&(A.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(A.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(A.mcp=!1),e.envelope.chat_enabled&&(A.xc=!0),await g.sendNotification(VYc.type,A)}}};p();var Ext=class extends as{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(ur).connection.sendNotification(LUt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ur).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ur).connection.sendNotification(FUt.type,r)}};p();var Xeo=new ge("AgentEncodingConfigurationService"),_xt=class extends KM{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ur)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Xeo.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){Xeo.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var eto=new L7;p();var nto=ce(ti());var ito={"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"}},zYc=new nto.NotificationType("policy/didChange"),YYc=Object.fromEntries(Object.entries(ito).map(([t,e])=>[t,{type:e.type}])),UFe=class extends uu{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(ito).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ur);o.onActivation(()=>{this.startWatching().catch(s=>{Dr.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(()=>ce(rto()));this.policyWatcher=r("IDEGitHubCopilot",YYc,n=>{this.handlePolicyUpdate(n).catch(o=>{Dr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Dr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Dr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Dr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Dr.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),Dr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(Mn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(Mn).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(zYc,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Dr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Dr.debug(this.ctx,"Policy watcher stopped")}}};p();var Cxt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(){this.ctx.get(ur).connection.sendNotification(NQi,{}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ur).connection.sendNotification(MQi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(EN).unregisterProvider(e)}};p();var vxt=class extends fb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(Gg).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(Gg).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(Gg).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var oto=ce(ti());var bxt="mcp.elicitation",Sxt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new oto.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Ln(Xn.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 Ln(Xn.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;ir.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await sc(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(eO).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 ht(e.ctx,bxt,jt.createAndMarkAsIssued()),gt(e.ctx,bxt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw ir.error(e.ctx,l,c),await im(e.ctx,{message:l,server:r}),_s(e.ctx,c,bxt),gi(e.ctx,bxt,c),new Ln(Xn.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var tk=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var QFe=class extends tk{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":ir.info(this.ctx,`MCP server ${this.serverName} log:`,r),sc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":ir.warn(this.ctx,`MCP server ${this.serverName} log:`,r),UZ(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":ir.error(this.ctx,`MCP server ${this.serverName} log:`,r),im(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:ir.info(this.ctx,`MCP server ${this.serverName} log:`,r),sc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var qFe=class extends tk{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,"Prompts list changed, refreshing prompts..."),sc(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(Ubt)}};p();var jFe=class extends tk{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,"Resource list changed, refreshing resources..."),sc(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(Fbt)}};p();var HFe=class extends tk{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),sc(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(D7i)}};p();var Txt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},GFe=class extends Txt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){ir.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get(cn).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),sc(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){ir.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),im(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 $Fe=class extends tk{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,"Tool list changed, refreshing tools..."),sc(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(Lbt)}};p();var sto="mcp.sampling",Ixt=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 Ln(Xn.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,ir.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await sc(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(LV).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(Md).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 Mc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await UTe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new qn.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 gt(e.ctx,sto,{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 ir.error(e.ctx,u,l),await im(e.ctx,{message:u,server:o}),gt(e.ctx,sto,{success:"false",errorMessage:u}),new Ln(Xn.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){ir.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 ir.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",ir.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?QM(e,u.provider,l):await e.get(Bc).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(dc).getMetadata()).filter(n=>n.capabilities.type&&!Xae.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 bc(e.get(Si)).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 F_e=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function ato(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=dat(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(ato,"parseScopeChallenge");p();var w6r=/[^a-z0-9_-]/gi;var KYc=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function cto(){let t={};for(let e of KYc){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(cto,"getDefaultEnvironment");async function lto(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;ir.warn(t,n),await UZ(t,{message:n,server:r,tool:e.name}),e.description=""}if(w6r.lastIndex=0,w6r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;ir.warn(t,n),await UZ(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(w6r,"_")}else e._nameForModel=e.name;return e}a(lto,"normalizeTool");var xxt=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*R6r(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(R6r,"paginateRequest");async function k6r(t){let e=[];for await(let r of t)e.push(...r);return e}a(k6r,"flattenAsyncIterable");var uto=ce(require("events"));var P6r=6e4,FV=class{constructor(e,r,n){this.transport=null;this.emitter=new uto.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(Mn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new Ixt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new Sxt);let s=this.ctx.get(Lr).getEditorInfo(),c=this.ctx.get(Lr).getEditorPluginInfo();this.mcp=new Vj({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 ir.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw ir.error(this.ctx,"Connection failed:",r),await im(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(rV)}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 lto(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof F_e){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(ir.info(this.ctx,l),await im(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===Xn.MethodNotFound){if(ir.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(ir.error(this.ctx,c),await im(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=R6r(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 k6r(this.getResourcesIterable(e));return sc(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=R6r(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 k6r(this.getResourceTemplatesIterable(e));return sc(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=VK();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Or([],"error");return f.content.push(new wr(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}},Mj,{onprogress:a(m=>{ir.info(this.ctx,`${e} calling progress`,m),sc(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 ir.error(this.ctx,m),await im(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return ir.error(this.ctx,h),await im(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=()=>{ir.info(this.ctx,`MCP server ${this.name} connection closed.`),sc(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{ir.error(this.ctx,`MCP server ${this.name} error:`,e),im(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(_Z,e=>new QFe(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(xF,e=>new $Fe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(IF,e=>new qFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(TF,e=>new jFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(osr,e=>new HFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(Asr,e=>(this.initRootsTracker(),new GFe(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(uPe,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw ir.error(this.ctx,o),new Ln(Xn.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw ir.error(this.ctx,o),new Ln(Xn.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new rc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(dPe,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw ir.error(this.ctx,n),new Ln(Xn.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(Lbt,()=>{this.refreshToolsCache()}),this.emitter.on(Fbt,()=>{this.refreshResourcesCache()}),this.emitter.on(Ubt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(P6r),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)))),ir.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(rV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(P6r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,ir.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(rV)}catch(r){ir.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(P6r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,ir.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(rV)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Or([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new wr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new pQ({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new wr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new pQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new wr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get(cn);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 JYc(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=ato(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new F_e(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(JYc,"createFetchAdapter");function wxt(t,e){let r=t.get(ar),n=JYc(r);return{...e,fetch:n}}a(wxt,"createConfigWithFetch");var Rxt=class extends FV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=wxt(this.ctx,r),{url:o,...s}=n;return new hpe(new URL(o),s)}};p();var dto=require("child_process"),fto=require("util");var kxt=class extends FV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...cto(),...r.env||{}},r.stderr="pipe",new _pe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{UZ(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,fto.promisify)(dto.exec);ir.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),sc(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),ir.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){ir.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),im(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var VFe=class extends FV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=wxt(this.ctx,r),{url:o,...s}=n;return new mpe(new URL(o),s)}};p();var Pxt=class extends fQ{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 Mc;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(Md).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var gto=ce(Al());p();var pto="mcp-servers-cache",hto="mcp-first-boot-completed",Dxt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(Gg),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(hto)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(hto,"true")}parseCache(){let e=this.stateDb.get(pto);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(pto,e)}};p();function mto(t){let e=t.get(Lr).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(mto,"isNightlyOrDevBuild");var Nxt=class t extends jE{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new tQ;this.prefixGenerator=new xxt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new Dxt(r),this.registryService=r.get(tN),Es(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(ir.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(ir.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(Mn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(ir.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new gto.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return ir.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(Mn).getCapabilities().mcpAllowlist)return ir.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=mto(this.ctx);return n||ir.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:(ir.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(Mn).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),ir.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),ir.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),ir.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)}`);ir.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){ir.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}NTe(r)&&(d._status=c),this.ctx.get(us).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(us).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 ht(this.ctx,"mcp.getPrompt",jt.createAndMarkAsIssued()),gt(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){ir.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){ir.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await sc(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){ir.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await sc(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(rV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await sc(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await sc(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 sc(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){ir.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await sc(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),ir.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(EN).unregisterProvider(o)}catch{ir.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;ir.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(fb).removeAccountPreference(r,c);try{let u=this.ctx.get(e0).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),ir.info(this.ctx,`Successfully removed session for account ${l}`)):ir.warn(this.ctx,`No session found for account ${l}`)}catch(u){ir.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 ir.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),ir.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){ir.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(rV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await sc(this.ctx,{message:"Connection state: Running",server:r})}catch(c){ir.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Pw||c instanceof a2e,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof VFe&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;ir.info(this.ctx,f),sc(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 ir.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 im(this.ctx,{message:d,server:r}),this.ctx.get(sa).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=>{ir.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){ir.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new Rxt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new VFe(this.ctx,r.name,r.version||"1.0.0"):new kxt(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(ur).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){ir.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(us).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 Pxt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(ir.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){ir.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(us).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){ir.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){ir.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;ir.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(fb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new Ape(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw ir.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(e0).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(e0).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(e0).createDynamicAuthenticationProvider(o,s,c),!A)){ir.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(e0).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(fb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(e0).getProvider(l),g=!!this.ctx.get(jC).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(sa).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){ir.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){ir.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(fb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){ir.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(sa).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){ir.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){ir.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(sa).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(fb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){ir.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(sa).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 Ato=ce(Al());var Mxt=class t extends d2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Ato.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ur).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var yto=ce(Al());var ZYc=new yto.ProtocolRequestType("copilot/readMcpSamplingConfig"),Oxt=class extends LV{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ur).connection,o;try{o=await n.sendRequest(ZYc,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Vu(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 Lxt=ce(Al());var XYc=new Lxt.ProtocolRequestType("copilot/showPanelMessageRequest"),eKc=new Lxt.ProtocolNotificationType("copilot/showPanelMessage"),Bxt=class extends B_e{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ur).connection.sendNotification(eKc,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ur).connection,o;try{o=await n.sendRequest(XYc,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Vu(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 _to=require("node:stream"),aie=ce(For());var y9=new ge("UndiciFetcher"),Uxt=class extends ar{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(ss).getVersion()}`,this.certificateConfigurator=new mEe(r),this.proxySocketFactory=r.get(UR),this.settings=r.get(Zo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),y9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Zo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),y9.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=nKc(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};y9.debug(this.ctx,"Starting Undici fetch.",{target:Fxt(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,aie.fetch)(r,{...h,dispatcher:m});return y9.debug(this.ctx,"Undici fetch completed.",{target:Fxt(r),status:A.status,isProxy:g}),new BI(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?_to.Readable.fromWeb(A.body):null)}catch(h){throw l?(y9.warn(this.ctx,"Undici fetch timed out.",{target:Fxt(r),timeout:n.timeout}),new oW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):iKc(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&&(y9.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||(y9.debug(this.ctx,"Creating direct Undici agent.",{target:Fxt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new aie.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,aie.buildConnector)(r);return y9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:Eto(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new aie.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)&&y9.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}=tKc(s),u=rKc(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:Eto(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 tKc(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(tKc,"splitHostPort");function rKc(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(rKc,"compileHostPattern");function Fxt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Fxt,"describeUrl");function Eto(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Eto,"describeProxy");function nKc(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(nKc,"toNativeAbortSignal");function iKc(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(iKc,"withCauseNetworkProperties");p();var WFe=new ge("fetcher"),oKc="https://default.exp-tas.com/",zFe=class extends ar{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(P0(o)||`${r}/`.startsWith(oKc))throw o;WFe.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),WFe.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()}},Qxt=class extends ar{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new zFe(r,n,o,(s,c)=>{this.current!==o&&(WFe.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,gi(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:aKc(c),...cKc(s),...lKc(r)}),n.disconnectAll().catch(l=>{WFe.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(WFe.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()])}},sKc=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function aKc(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return sKc.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(aKc,"describeHost");function cKc(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(cKc,"buildErrorCauseProperties");function lKc(t){try{let e=t.get(Zo).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(lKc,"describeHttpContext");var Cto=new ge("fetcher");function uKc(t){return qt(t,je.UseHelixFetcher)==="true"}a(uKc,"isHelixFetcherForced");function dKc(t){if(uKc(t))return new Dne(t);let e=new Qxt(t,new Uxt(t),new Dne(t));return t.get(Zo).onDidChangeHttpSettings(()=>e.reset()),e}a(dKc,"createDefaultFetcher");var qxt=class extends ar{constructor(r,n=dKc(r),o=new pEe(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=qt(this.ctx,je.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&&(Cto.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new zFe(r,n,o,()=>{Cto.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(Mn).onDidSetCapabilities(this.updateFetcher),r.get(Zo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return qt(this.ctx,je.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(Mn).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 Hxt=ce(ti());var jxt=class extends sa{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ur).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(Hxt.ShowMessageRequest.type,{type:Hxt.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 U_e=ce(Al());var fKc=new U_e.ProtocolNotificationType("copilot/customAgent/didChange"),pKc=new U_e.ProtocolNotificationType("copilot/customSkill/didChange"),hKc=new U_e.ProtocolNotificationType("copilot/customPrompt/didChange"),mKc=new U_e.ProtocolNotificationType("copilot/customInstruction/didChange"),gKc=new U_e.ProtocolNotificationType("copilot/hook/didChange");function AKc(t){switch(t){case"agent":return fKc;case"skill":return pKc;case"prompt":return hKc;case"instructions":return mKc;case"hook":return gKc;default:return}}a(AKc,"notificationTypeFor");var Gxt=class extends lA{constructor(r){super();this.ctx=r;this.logger=new ge("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=AKc(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ur).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};p();var vto=ce(Al());var $xt=class t extends UY{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new vto.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ur).connection.sendNotification(t.notificationType,r)}};p();var bto=ce(Al());var Vxt=class t extends EQ{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new bto.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ur).connection.sendNotification(t.notificationType,r)}};p();var Sto=ce(Al());var yKc=new Sto.ProtocolNotificationType("$/copilot/rateLimitWarning"),Wxt=class extends IS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ur).connection.sendNotification(yKc,r)}};p();p();var zxt=class extends nWe{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(zD).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(zD).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(zD);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 Yxt=class extends qy{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new zxt(this.ctx,e)}shouldStartWatching(e){return!!this.ctx.get(Mn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function Kxt(t){let e=new Hv(process.env),r=ZXi(e);r.set(Hv,e),r.set(ar,new qxt(r)),r.set(rc,new rc(r)),J5r(r,{});let n=lZr();r.set(Si,n),r.set(Gg,new Gg(r));let o=new oxt;r.set(gh,o);let s=Ito.join(n.directory,$Hi),{repo:c,diagnostics:l}=KHi(s);r.set(MN,c),r.set(Ur,new FQe(r,process.env)),r.set(bT,new bT(r)),r.set(Ine,new Ine(r));let u=new Ih(r,"agent");u.onInitialized(()=>ZHi(r,l)),r.set(Ih,u),r.set(Fa,LHi),r.set(CI,new CI),r.set(Lr,new Rq),r.set(Nne,wHi()),r.set(vu,new vu),r.set(Fo,eto),r.set(aa,new XIt(r)),r.set(dX,new txt(r)),r.set(qy,new Yxt(r)),r.set(zD,new zD(r)),r.set(r0,new r0),r.set(n0,jat(r,lQi)),r.set(Cb,new Cb(r)),r.set(S5,new kpe),Deo(r),iWe(r),Ncn(r),r.set(ur,new ur(r,t)),r.set(eO,new ext(r)),r.set(sa,new jxt(r)),JHi(r,l),r.set(B_e,new Bxt(r)),r.set(LV,new Oxt(r)),r.set(N0,new iEe(r)),r.set(as,new Ext(r));let d=new UFe(r,t);r.set(UFe,d),r.set(uu,d),r.set(FFe,new FFe(r)),r.set(OFe,new OFe(r));let f=new uV(r);r.set(cn,f),r.set(uV,f),r.set(D0,new yEe(r,process.env)),r.set(ik,new fie),r.set(Cc,new Cc(r)),Weo(r),Reo(r),r.set(ZD,new ZD),r.set(iV,new iV),r.set(eN,new eN),r.set(oV,new oV([])),r.set(vT,new sxt),r.set(Tto.ObservableWorkspace,new WAe(r,!0,!0)),r.set(L5,new _Ee),r.set(B6,new B6),r.set(DC,new DC(r)),r.set(BA,new tvt(r)),r.set(v_,new yxt(r)),r.set(Md,new Axt(r)),r.set(zx,new zx(r)),r.set(us,new us(r)),r.set(F3,new F3(r)),r.set(Q3,new Q3(r)),r.set(qS,new qS(r)),r.set(OK,new OK(r)),r.set(bO,new bO),r.set(X0,new X0),r.set(tN,new tN(r)),r.set(jE,new Nxt(r)),r.set(d2,new Mxt(r)),r.set(N3,new N3(r)),r.set(fb,new vxt(r));let h=new Bj(r);r.set(Bj,h),r.set(n2,new n2(r,h)),r.set(pb,new pb(r,h,new Cxt(r))),r.set(IS,new Wxt(r)),r.set(gZ,new gZ),r.set(Sne,new Sne),r.set(e0,new ixt(r)),r.set(jC,new rxt(r)),r.set(EN,new EN(r));let m=new T_(r);r.set(T_,m),r.set(pf,new pf(r,m)),r.set(ag,new ag(r,m)),r.set(jp,new jp(r,m)),r.set(EA,new EA(r,e,m));let g=new YL(r,m,n);r.set(YL,g),r.get(S_).addListener(g.lifecycleListener);let A=new NFe;return r.set(NFe,A),r.set(lA,new Gxt(r)),r.set(zm,new zm(r,A)),r.set(Kx,new Kx),r.set(OP,new OP(r)),r.set(bq,new bq(r)),r.set(Ox,new $Q([new VQ,new WQ])),r.set(bne,new bne(r)),r.set(x_,new x_(r)),r.set(EQ,new Vxt(r)),r.set(UY,new $xt(r)),r.set(BF,new BF(r)),r.set(Us,new Us(r)),r.set(om,new om),r.set(zZ,new zZ(r)),r.set(UF,new UF(r,new RIt)),r.set(kc,new kc(r)),r.set(KM,new _xt(r)),r.set(JD,new JD(r)),r.set(BR,new BR(r.get(JD),r)),r.set(pO,new pO(r)),r.set(oI,new axt(r)),r.set(Uv,new Uv(r.get(BR),r.get(oI),r)),r.set(Xy,new Xy(r)),r}a(Kxt,"createLanguageServerContext");var _N=new ge("ACP");async function xto(t){let e=t.get(ss);_N.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(Hv).markReady(),t.get(Bp).githubAppId=Vse,CKc(t),_Kc(t),t.get(Mn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?_N.info(t,"Token primed successfully"):_N.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(Ih).initialize(!0),ipn()?await EKc(t):(gt(t,"acp.server.start",{acpPipeline:"internal"}),await wto(t))}a(xto,"startACPServer");async function wto(t){_N.info(t,"Starting ACP server with internal pipeline");let e=Q_e.Writable.toWeb(process.stdout),r=Q_e.Readable.toWeb(process.stdin),n=xwe(e,r),o=new wwe(s=>new $1t(s,t),n);o.signal.addEventListener("abort",()=>{_N.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(wto,"startACPServerInternal");async function EKc(t){_N.info(t,"Starting ACP server with CLI proxy"),gt(t,"acp.cli.discover");let e;try{e=await opn()}catch(u){let d=u instanceof Error?u.message:String(u);_N.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),gi(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await wto(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;_N.info(t,`Found Copilot CLI: ${r} v${e.version}`),gt(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new V1t(e,t),o=Q_e.Writable.toWeb(process.stdout),s=Q_e.Readable.toWeb(process.stdin),c=xwe(o,s),l=new wwe(u=>new z1t(u,t,n),c);l.signal.addEventListener("abort",()=>{_N.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(EKc,"startACPServerWithCLI");function _Kc(t){let e=t.get(us);e.registerTool(new Sq({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 Sq({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 Sq({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."})})})),_N.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(_Kc,"registerACPClientTools");function Rto(){let e=Kxt({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 dV(e);return e.forceSet(v_,r),{ctx:e,acpToolInvoker:r}}a(Rto,"createACPContext");function CKc(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(_N.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),N9e(t,r))}a(CKc,"configureGitHubEnterpriseUrl");p();var D6r=require("events"),YFe=ce(require("fs"));LHe();var Zxt=ce(Al());p();var Pto=ce(require("fs")),Dto=ce(require("http")),q_e=ce(require("path"));var Jxt=class{constructor(e,r){this.port=e;let n;this.server=Dto.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=>{kto(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{kto(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;q_e.basename(__dirname)!=="debug"&&(c=q_e.dirname(__dirname)),n??=Pto.readFileSync(q_e.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 kto(t,e){t.write("data: "+e.toString().replace(/\n/g,` +\`\`\``}},DIt="runtime-logs",kIt=class extends eg{static{a(this,"RuntimeLogsSkill")}constructor(e){super(DIt,"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 v8r(r))}};p();var NIt=he(XP());var MIt=class extends Uh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return N8e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ur).connection}async inspectPrompt(r){return this.connection?.sendNotification(new NIt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new NIt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new NIt.NotificationType("conversation/documentDiff"),r)}};p();var bXi=he(ml());var lFe=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(PR).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ur).connection.sendNotification(new bXi.NotificationType(this.notificationEndpoint),e)}};function SXi(t){q$c(t),j$c(t),EXi(t)}a(SXi,"activateConversationFeature");function q$c(t){t.set(jo,new jo(t)),t.set(tg,new tg),t.set(hA,new hA(t)),t.set(zc,new XVe(t)),t.set(j6,new j6),t.set(_c,new _c(t)),t.set(PR,new PR(t)),t.set(lFe,new lFe(t)),t.set(lc,new SHe(t,new bHe(t))),t.set($D,new $D),t.set(Uh,new MIt(t)),t.set(bk,new bk(t))}a(q$c,"registerContextDependencies");function j$c(t){let e=new Qh;e.registerSkill(new cJe(new aJe)),e.registerSkill(new Oze(new kv(t,jM,pAn))),e.registerSkill(new bze(new kv(t,fk,cAn))),e.registerSkill(new Cze(new kv(t,Vy,aAn))),e.registerSkill(new Bze),e.registerSkill(new wIt),e.registerSkill(new RIt(new kv(t,PIt,vXi))),e.registerSkill(new dYe(new kv(t,VM,vyn))),e.registerSkill(new fJe(new kv(t,WQ,a1n))),e.registerSkill(new kIt(new kv(t,DIt,CXi))),e.registerSkill(new IIt(new kv(t,xIt,_Xi))),e.registerSkill(new hJe(new kv(t,Sk,c1n))),e.registerSkill(new mJe(new kv(t,sK,l1n))),t.set(Qh,e)}a(j$c,"registerSkills");p();var TXi=he(ml()),IXi=he(XP());var OIt=class extends Dd{constructor(){super(...arguments);this.requestType=new TXi.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=Mu.Compile(_hn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ur).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new IXi.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 SA(this.typeCheck.Errors(s));return s}};p();var xXi=he(ml()),wXi=he(XP());var BIt=class extends E_{constructor(){super(...arguments);this.requestType=new xXi.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=Mu.Compile(Ehn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ur).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new wXi.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 SA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new wr(o.value):new EY(o.value));return new Or(n,r.status??"success")}};p();p();function RXi(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 Dr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(RXi,"fillInJavaActiveExperiments");var C8r=he(XP());var H$c={type:new C8r.NotificationType("featureFlagsNotification")},G$c={type:new C8r.NotificationType("copilot/didChangeFeatureFlags")},uFe=class{constructor(e){this.ctx=e;ys(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=r.get(Jt),d=await u.updateExPValuesAndAssignments(e);n=u.ideDataMigrationCompleted(d),o=u.appmodContextMenuEnabled(d),s=u.cliAsDefaultAgentProviderEnabled(d),c=van(r,d),l=u.inlineChatUseCliEnabled(d);let f={};r.get(Jt).excludeRelatedFiles(d)&&(f.ExcludeRelatedFiles=!0);let h=kcr(r,d);h.length>0&&(f.ExpContextProviders=h);let m=new Map;bWn(r,h,m,d),nat(r,m,d),RXi(r,m,d);for(let[y,E]of m.entries())f[y]=E;let g=r.get(Mn),A=r.get(ur).connection;if(g.getCapabilities().didChangeFeatureFlags)await A.sendNotification(G$c.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,user_notification: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:f,byok:rQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,inline_chat_use_cli_enabled:l,copilot_plan:e.userInfo.copilotPlan});else{let y={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:f,byok:rQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,inline_chat_use_cli_enabled:l};e.getTokenValue("agent_mode")==="0"&&(y.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(y.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(y.mcp=!1),e.envelope.chat_enabled&&(y.xc=!0),await A.sendNotification(H$c.type,y)}}};p();var LIt=class extends os{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(ur).connection.sendNotification(H9t.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ur).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ur).connection.sendNotification(G9t.type,r)}};p();var PXi=new Ee("AgentEncodingConfigurationService"),FIt=class extends UM{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ur)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){PXi.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){PXi.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var kXi=new b7;p();var MXi=he(ti());var OXi={"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"}},$$c=new MXi.NotificationType("policy/didChange"),V$c=Object.fromEntries(Object.entries(OXi).map(([t,e])=>[t,{type:e.type}])),dFe=class extends cu{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(OXi).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ur);o.onActivation(()=>{this.startWatching().catch(s=>{Dr.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(()=>he(NXi()));this.policyWatcher=r("IDEGitHubCopilot",V$c,n=>{this.handlePolicyUpdate(n).catch(o=>{Dr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Dr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Dr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Dr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Dr.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),Dr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(Mn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(Mn).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($$c,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Dr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Dr.debug(this.ctx,"Policy watcher stopped")}}};p();var UIt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(){this.ctx.get(ur).connection.sendNotification(l7i,{}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ur).connection.sendNotification(u7i,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(dN).unregisterProvider(e)}};p();var QIt=class extends lb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(Vg).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(Vg).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(Vg).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var BXi=he(ti());var qIt="mcp.elicitation",jIt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new BXi.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Ln(Xn.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 Ln(Xn.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;or.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await ic(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(HM).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 yt(e.ctx,qIt,Vt.createAndMarkAsIssued()),_t(e.ctx,qIt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw or.error(e.ctx,l,c),await im(e.ctx,{message:l,server:r}),La(e.ctx,c,qIt),gi(e.ctx,qIt,c),new Ln(Xn.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var zR=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var fFe=class extends zR{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":or.info(this.ctx,`MCP server ${this.serverName} log:`,r),ic(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":or.warn(this.ctx,`MCP server ${this.serverName} log:`,r),CZ(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":or.error(this.ctx,`MCP server ${this.serverName} log:`,r),im(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:or.info(this.ctx,`MCP server ${this.serverName} log:`,r),ic(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var pFe=class extends zR{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,"Prompts list changed, refreshing prompts..."),ic(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(nbt)}};p();var hFe=class extends zR{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,"Resource list changed, refreshing resources..."),ic(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(rbt)}};p();var mFe=class extends zR{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),ic(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(cUi)}};p();var HIt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},gFe=class extends HIt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){or.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get(an).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),ic(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){or.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),im(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 AFe=class extends zR{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,"Tool list changed, refreshing tools..."),ic(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(tbt)}};p();var LXi="mcp.sampling",GIt=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 Ln(Xn.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,or.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await ic(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(EV).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(Dd).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 Dc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await fTe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new qn.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 _t(e.ctx,LXi,{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 or.error(e.ctx,u,l),await im(e.ctx,{message:u,server:o}),_t(e.ctx,LXi,{success:"false",errorMessage:u}),new Ln(Xn.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){or.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 or.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",or.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?RM(e,u.provider,l):await e.get(zc).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(lc).getMetadata()).filter(n=>n.capabilities.type&&!Oae.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 vc(e.get(bi)).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 m_e=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function FXi(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=kst(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(FXi,"parseScopeChallenge");p();var S8r=/[^a-z0-9_-]/gi;var W$c=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function UXi(){let t={};for(let e of W$c){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(UXi,"getDefaultEnvironment");async function QXi(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;or.warn(t,n),await CZ(t,{message:n,server:r,tool:e.name}),e.description=""}if(S8r.lastIndex=0,S8r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;or.warn(t,n),await CZ(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(S8r,"_")}else e._nameForModel=e.name;return e}a(QXi,"normalizeTool");var $It=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*T8r(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(T8r,"paginateRequest");async function I8r(t){let e=[];for await(let r of t)e.push(...r);return e}a(I8r,"flattenAsyncIterable");var qXi=he(require("events"));var x8r=6e4,_V=class{constructor(e,r,n){this.transport=null;this.emitter=new qXi.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(Mn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new GIt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new jIt);let s=this.ctx.get(Lr).getEditorInfo(),c=this.ctx.get(Lr).getEditorPluginInfo();this.mcp=new Pj({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 or.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw or.error(this.ctx,"Connection failed:",r),await im(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(F$)}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 QXi(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof m_e){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(or.info(this.ctx,l),await im(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===Xn.MethodNotFound){if(or.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(or.error(this.ctx,c),await im(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=T8r(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 I8r(this.getResourcesIterable(e));return ic(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=T8r(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 I8r(this.getResourceTemplatesIterable(e));return ic(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=xK();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Or([],"error");return f.content.push(new wr(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}},yj,{onprogress:a(m=>{or.info(this.ctx,`${e} calling progress`,m),ic(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 or.error(this.ctx,m),await im(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return or.error(this.ctx,h),await im(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=()=>{or.info(this.ctx,`MCP server ${this.name} connection closed.`),ic(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{or.error(this.ctx,`MCP server ${this.name} error:`,e),im(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(nZ,e=>new fFe(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(mF,e=>new AFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(hF,e=>new pFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(pF,e=>new hFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(mor,e=>new mFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(xor,e=>(this.initRootsTracker(),new gFe(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(GPe,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw or.error(this.ctx,o),new Ln(Xn.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw or.error(this.ctx,o),new Ln(Xn.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new ec(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler($Pe,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw or.error(this.ctx,n),new Ln(Xn.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(tbt,()=>{this.refreshToolsCache()}),this.emitter.on(rbt,()=>{this.refreshResourcesCache()}),this.emitter.on(nbt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(x8r),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)))),or.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(F$)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(x8r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,or.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(F$)}catch(r){or.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(x8r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,or.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(F$)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Or([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new wr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new Z7({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new wr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new Z7({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new wr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get(an);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 z$c(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=FXi(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new m_e(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(z$c,"createFetchAdapter");function VIt(t,e){let r=t.get(fr),n=z$c(r);return{...e,fetch:n}}a(VIt,"createConfigWithFetch");var WIt=class extends _V{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=VIt(this.ctx,r),{url:o,...s}=n;return new Wfe(new URL(o),s)}};p();var jXi=require("child_process"),HXi=require("util");var zIt=class extends _V{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...UXi(),...r.env||{}},r.stderr="pipe",new Xfe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{CZ(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,HXi.promisify)(jXi.exec);or.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),ic(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),or.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){or.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),im(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var yFe=class extends _V{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=VIt(this.ctx,r),{url:o,...s}=n;return new zfe(new URL(o),s)}};p();var YIt=class extends J7{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 Dc;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(Dd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var WXi=he(ml());p();var GXi="mcp-servers-cache",$Xi="mcp-first-boot-completed",KIt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(Vg),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get($Xi)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set($Xi,"true")}parseCache(){let e=this.stateDb.get(GXi);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(GXi,e)}};p();function VXi(t){let e=t.get(Lr).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(VXi,"isNightlyOrDevBuild");var JIt=class t extends UE{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new q7;this.prefixGenerator=new $It;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new KIt(r),this.registryService=r.get(WD),ys(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(or.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(or.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(Mn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(or.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new WXi.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return or.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(Mn).getCapabilities().mcpAllowlist)return or.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=VXi(this.ctx);return n||or.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:(or.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(Mn).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),or.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),or.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),or.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)}`);or.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){or.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}oTe(r)&&(d._status=c),this.ctx.get(cs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(cs).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 yt(this.ctx,"mcp.getPrompt",Vt.createAndMarkAsIssued()),_t(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){or.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){or.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await ic(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){or.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await ic(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(F$),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await ic(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await ic(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 ic(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){or.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await ic(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),or.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(dN).unregisterProvider(o)}catch{or.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;or.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(lb).removeAccountPreference(r,c);try{let u=this.ctx.get(e0).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),or.info(this.ctx,`Successfully removed session for account ${l}`)):or.warn(this.ctx,`No session found for account ${l}`)}catch(u){or.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 or.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),or.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){or.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(F$,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await ic(this.ctx,{message:"Connection state: Running",server:r})}catch(c){or.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Sw||c instanceof qke,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof yFe&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;or.info(this.ctx,f),ic(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 or.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 im(this.ctx,{message:d,server:r}),this.ctx.get(ra).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=>{or.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){or.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new WIt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new yFe(this.ctx,r.name,r.version||"1.0.0"):new zIt(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(ur).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){or.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(cs).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 YIt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(or.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){or.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(cs).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){or.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){or.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;or.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(lb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new Kfe(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw or.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(e0).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(e0).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(e0).createDynamicAuthenticationProvider(o,s,c),!A)){or.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(e0).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(lb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(e0).getProvider(l),g=!!this.ctx.get(Fv).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(ra).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){or.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){or.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(lb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){or.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ra).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){or.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){or.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ra).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(lb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){or.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ra).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 zXi=he(ml());var ZIt=class t extends n2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new zXi.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ur).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var YXi=he(ml());var Y$c=new YXi.ProtocolRequestType("copilot/readMcpSamplingConfig"),XIt=class extends EV{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ur).connection,o;try{o=await n.sendRequest(Y$c,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Vu(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 txt=he(ml());var K$c=new txt.ProtocolRequestType("copilot/showPanelMessageRequest"),J$c=new txt.ProtocolNotificationType("copilot/showPanelMessage"),ext=class extends p_e{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ur).connection.sendNotification(J$c,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ur).connection,o;try{o=await n.sendRequest(K$c,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Vu(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 JXi=require("node:stream"),Gne=he(Iir());var n9=new Ee("UndiciFetcher"),nxt=class extends fr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(is).getVersion()}`,this.certificateConfigurator=new Vye(r),this.proxySocketFactory=r.get(DR),this.settings=r.get(zo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),n9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(zo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),n9.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=eVc(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};n9.debug(this.ctx,"Starting Undici fetch.",{target:rxt(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,Gne.fetch)(r,{...h,dispatcher:m});return n9.debug(this.ctx,"Undici fetch completed.",{target:rxt(r),status:A.status,isProxy:g}),new PI(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?JXi.Readable.fromWeb(A.body):null)}catch(h){throw l?(n9.warn(this.ctx,"Undici fetch timed out.",{target:rxt(r),timeout:n.timeout}),new qV(`Request to <${r}> timed out after ${n.timeout}ms`,h)):tVc(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&&(n9.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||(n9.debug(this.ctx,"Creating direct Undici agent.",{target:rxt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new Gne.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,Gne.buildConnector)(r);return n9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:KXi(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new Gne.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)&&n9.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}=Z$c(s),u=X$c(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:KXi(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 Z$c(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(Z$c,"splitHostPort");function X$c(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(X$c,"compileHostPattern");function rxt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(rxt,"describeUrl");function KXi(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(KXi,"describeProxy");function eVc(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(eVc,"toNativeAbortSignal");function tVc(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(tVc,"withCauseNetworkProperties");p();var EFe=new Ee("fetcher"),rVc="https://default.exp-tas.com/",_Fe=class extends fr{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(k0(o)||`${r}/`.startsWith(rVc))throw o;EFe.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),EFe.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()}},ixt=class extends fr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new _Fe(r,n,o,(s,c)=>{this.current!==o&&(EFe.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,gi(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:iVc(c),...oVc(s),...sVc(r)}),n.disconnectAll().catch(l=>{EFe.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(EFe.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()])}},nVc=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function iVc(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return nVc.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(iVc,"describeHost");function oVc(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(oVc,"buildErrorCauseProperties");function sVc(t){try{let e=t.get(zo).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(sVc,"describeHttpContext");var ZXi=new Ee("fetcher");function aVc(t){return Gt(t,Je.UseHelixFetcher)==="true"}a(aVc,"isHelixFetcherForced");function cVc(t){if(aVc(t))return new mne(t);let e=new ixt(t,new nxt(t),new mne(t));return t.get(zo).onDidChangeHttpSettings(()=>e.reset()),e}a(cVc,"createDefaultFetcher");var oxt=class extends fr{constructor(r,n=cVc(r),o=new Gye(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=Gt(this.ctx,Je.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&&(ZXi.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new _Fe(r,n,o,()=>{ZXi.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(Mn).onDidSetCapabilities(this.updateFetcher),r.get(zo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Gt(this.ctx,Je.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(Mn).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 axt=he(ti());var sxt=class extends ra{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ur).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(axt.ShowMessageRequest.type,{type:axt.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 g_e=he(ml());var lVc=new g_e.ProtocolNotificationType("copilot/customAgent/didChange"),uVc=new g_e.ProtocolNotificationType("copilot/customSkill/didChange"),dVc=new g_e.ProtocolNotificationType("copilot/customPrompt/didChange"),fVc=new g_e.ProtocolNotificationType("copilot/customInstruction/didChange"),pVc=new g_e.ProtocolNotificationType("copilot/hook/didChange");function hVc(t){switch(t){case"agent":return lVc;case"skill":return uVc;case"prompt":return dVc;case"instructions":return fVc;case"hook":return pVc;default:return}}a(hVc,"notificationTypeFor");var cxt=class extends fA{constructor(r){super();this.ctx=r;this.logger=new Ee("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=hVc(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ur).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};p();var XXi=he(ml());var lxt=class t extends vY{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new XXi.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ur).connection.sendNotification(t.notificationType,r)}};p();var eeo=he(ml());var uxt=class t extends iQ{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new eeo.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ur).connection.sendNotification(t.notificationType,r)}};p();var teo=he(ml());var mVc=new teo.ProtocolNotificationType("$/copilot/rateLimitWarning"),dxt=class extends ES{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ur).connection.sendNotification(mVc,r)}};p();p();var fxt=class extends SVe{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(QD).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(QD).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(QD);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 pxt=class extends _x{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new fxt(this.ctx,e)}shouldStartWatching(e){return!!this.ctx.get(Mn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function hxt(t){let e=new LC(process.env),r=RZi(e);r.set(LC,e),r.set(fr,new oxt(r)),r.set(ec,new ec(r)),WOr(r,{});let n=oJr();r.set(bi,n),r.set(Vg,new Vg(r));let o=new bIt;r.set(Ah,o);let s=neo.join(n.directory,Cji),{repo:c,diagnostics:l}=xji(s);r.set(TN,c),r.set(Fr,new uQe(r,process.env)),r.set(AT,new AT(r)),r.set(lne,new lne(r));let u=new xh(r,"agent");u.onInitialized(()=>Rji(r,l)),r.set(xh,u),r.set(Oa,hji),r.set(mI,new mI),r.set(Lr,new dq),r.set(gne,oji()),r.set(vu,new vu),r.set(Bo,kXi),r.set(na,new AIt(r)),r.set(zZ,new EIt(r)),r.set(_x,new pxt(r)),r.set(QD,new QD(r)),r.set(r0,new r0),r.set(n0,sat(r,UUi)),r.set(pb,new pb(r)),r.set(f5,new ape),lXi(r),TVe(r),Pan(r),r.set(ur,new ur(r,t)),r.set(HM,new yIt(r)),r.set(ra,new sxt(r)),wji(r,l),r.set(p_e,new ext(r)),r.set(EV,new XIt(r)),r.set(N0,new Oye(r)),r.set(os,new LIt(r));let d=new dFe(r,t);r.set(dFe,d),r.set(cu,d),r.set(uFe,new uFe(r)),r.set(cFe,new cFe(r));let f=new V$(r);r.set(an,f),r.set(V$,f),r.set(D0,new Yye(r,process.env)),r.set(JR,new Yne),r.set(Ec,new Ec(r)),SXi(r),sXi(r),r.set(GD,new GD),r.set(Q$,new Q$),r.set(VD,new VD),r.set(q$,new q$([])),r.set(gT,new SIt),r.set(reo.ObservableWorkspace,new SAe(r,!0,!0)),r.set(T5,new Jye),r.set(v6,new v6),r.set(wv,new wv(r)),r.set(qA,new Evt(r)),r.set(E_,new BIt(r)),r.set(Dd,new OIt(r)),r.set(qx,new qx(r)),r.set(cs,new cs(r)),r.set(S3,new S3(r)),r.set(I3,new I3(r)),r.set(MS,new MS(r)),r.set(gK,new gK(r)),r.set(dO,new dO),r.set(X0,new X0),r.set(WD,new WD(r)),r.set(UE,new JIt(r)),r.set(n2,new ZIt(r)),r.set(E3,new E3(r)),r.set(lb,new QIt(r));let h=new _j(r);r.set(_j,h),r.set(dT,new dT(r,h)),r.set(ub,new ub(r,h,new UIt(r))),r.set(ES,new dxt(r)),r.set(IZ,new IZ),r.set(ane,new ane),r.set(e0,new CIt(r)),r.set(Fv,new _It(r)),r.set(dN,new dN(r));let m=new C_(r);r.set(C_,m),r.set(df,new df(r,m)),r.set(ag,new ag(r,m)),r.set(Hp,new Hp(r,m)),r.set(Z0,new Z0(r,e,m));let g=new OL(r,m,n);r.set(OL,g),r.get(AS).addListener(g.lifecycleListener);let A=new sFe;return r.set(sFe,A),r.set(fA,new cxt(r)),r.set(zm,new zm(r,A)),r.set(Hx,new Hx),r.set(wk,new wk(r)),r.set(oq,new oq(r)),r.set(Px,new RQ([new PQ,new kQ])),r.set(sne,new sne(r)),r.set(S_,new S_(r)),r.set(iQ,new uxt(r)),r.set(vY,new lxt(r)),r.set(dF,new dF(r)),r.set(Bs,new Bs(r)),r.set(om,new om),r.set(kZ,new kZ(r)),r.set(SF,new SF(r,new WTt)),r.set(wc,new wc(r)),r.set(UM,new FIt(r)),r.set(HD,new HD(r)),r.set(RR,new RR(r.get(HD),r)),r.set(tO,new tO(r)),r.set(XT,new TIt(r)),r.set(NC,new NC(r.get(RR),r.get(XT),r)),r.set(Xy,new Xy(r)),r}a(hxt,"createLanguageServerContext");var fN=new Ee("ACP");async function ieo(t){let e=t.get(is);fN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(LC).markReady(),t.get(Lp).githubAppId=wse,yVc(t),AVc(t),t.get(Mn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Ut).primeToken()?fN.info(t,"Token primed successfully"):fN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(xh).initialize(!0),tfn()?await gVc(t):(_t(t,"acp.server.start",{acpPipeline:"internal"}),await oeo(t))}a(ieo,"startACPServer");async function oeo(t){fN.info(t,"Starting ACP server with internal pipeline");let e=A_e.Writable.toWeb(process.stdout),r=A_e.Readable.toWeb(process.stdin),n=Jxe(e,r),o=new Zxe(s=>new l1t(s,t),n);o.signal.addEventListener("abort",()=>{fN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(oeo,"startACPServerInternal");async function gVc(t){fN.info(t,"Starting ACP server with CLI proxy"),_t(t,"acp.cli.discover");let e;try{e=await rfn()}catch(u){let d=u instanceof Error?u.message:String(u);fN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),gi(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await oeo(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;fN.info(t,`Found Copilot CLI: ${r} v${e.version}`),_t(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new u1t(e,t),o=A_e.Writable.toWeb(process.stdout),s=A_e.Readable.toWeb(process.stdin),c=Jxe(o,s),l=new Zxe(u=>new f1t(u,t,n),c);l.signal.addEventListener("abort",()=>{fN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(gVc,"startACPServerWithCLI");function AVc(t){let e=t.get(cs);e.registerTool(new sq({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 sq({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 sq({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."})})})),fN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(AVc,"registerACPClientTools");function seo(){let e=hxt({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 W$(e);return e.forceSet(E_,r),{ctx:e,acpToolInvoker:r}}a(seo,"createACPContext");function yVc(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(fN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),o9e(t,r))}a(yVc,"configureGitHubEnterpriseUrl");p();var w8r=require("events"),vFe=he(require("fs"));lHe();var gxt=he(ml());p();var ceo=he(require("fs")),leo=he(require("http")),y_e=he(require("path"));var mxt=class{constructor(e,r){this.port=e;let n;this.server=leo.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=>{aeo(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{aeo(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;y_e.basename(__dirname)!=="debug"&&(c=y_e.dirname(__dirname)),n??=ceo.readFileSync(y_e.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 aeo(t,e){t.write("data: "+e.toString().replace(/\n/g,` data: `)+` -`)}a(kto,"writeData");var N6r=class extends Zxt.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()}},M6r=class extends Zxt.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 Nto(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new D6r.EventEmitter;let l=new Jxt(o,n).listen();o===0&&await cSe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=YFe.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=YFe.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&YFe.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new D6r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} +`)}a(aeo,"writeData");var R8r=class extends gxt.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()}},P8r=class extends gxt.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 ueo(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new w8r.EventEmitter;let l=new mxt(o,n).listen();o===0&&await U1e(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=vFe.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=vFe.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&vFe.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new w8r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} `)),n.on("write",u=>l(`--> ${JSON.stringify(u)} -`))}return n&&(e=new M6r(e,n),r=new N6r(r,n)),[e,r]}a(Nto,"wrapTransports");p();var Xxt=ce(require("fs/promises")),Mto=ce(require("os")),Oto=ce(require("path"));var vKc={tmpdir:a(()=>Mto.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function Bto(t=vKc){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Xxt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Xxt.mkdtemp(Oto.join(e,"github-copilot-"))}}a(Bto,"mitigateTempFolder");function aJc(){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(aJc,"shouldEnableSourceMapSupport");aJc()&&Aro();async function Ero(){let t=Xfn(process.argv.slice(2)).version(new ss().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}=Rto();await xto(u);return}let r,n;e["node-ipc"]?(r=new nk.IPCMessageReader(process),n=new nk.IPCMessageWriter(process)):e.stdio?(r=new nk.StreamMessageReader(process.stdin),n=new nk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await Bto();let o=(0,nk.createConnection)(nk.ProposedFeatures.all,...await Nto(process.env,r,n)),s=Kxt(o);console=Lun(s);let c=s.get(ur),l=new oY(s);s.set(oY,l),c.onActivation(()=>{l.start()}),cJc(c,r),Mcn(s),c.listen()}a(Ero,"main");function cJc(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(cJc,"setupExitHandlers");yro.isMainThread?require.main===module&&Ero():(rln()&&nln(),dFt()&&Oun());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); +`))}return n&&(e=new P8r(e,n),r=new R8r(r,n)),[e,r]}a(ueo,"wrapTransports");p();var Axt=he(require("fs/promises")),deo=he(require("os")),feo=he(require("path"));var EVc={tmpdir:a(()=>deo.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function peo(t=EVc){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Axt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Axt.mkdtemp(feo.join(e,"github-copilot-"))}}a(peo,"mitigateTempFolder");function iWc(){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(iWc,"shouldEnableSourceMapSupport");iWc()&&zeo();async function Keo(){let t=Kdn(process.argv.slice(2)).version(new is().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}=seo();await ieo(u);return}let r,n;e["node-ipc"]?(r=new KR.IPCMessageReader(process),n=new KR.IPCMessageWriter(process)):e.stdio?(r=new KR.StreamMessageReader(process.stdin),n=new KR.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await peo();let o=(0,KR.createConnection)(KR.ProposedFeatures.all,...await ueo(process.env,r,n)),s=hxt(o);console=Dln(s);let c=s.get(ur),l=new Hz(s);s.set(Hz,l),c.onActivation(()=>{l.start()}),oWc(c,r),kan(s),c.listen()}a(Keo,"main");function oWc(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(oWc,"setupExitHandlers");Yeo.isMainThread?require.main===module&&Keo():(Xan()&&ecn(),R3t()&&kln());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' /*! Bundled license information: @@ -4372,7 +4329,7 @@ yargs-parser/build/lib/index.js: *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) + (*! 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 f156a6a5..eeb67243 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.503.0", + version = "1.504.0", }, } return info